main
wangqiujuan0808 2024-12-29 22:22:10 +08:00
parent 244832ff69
commit 013a5c9e78
29 changed files with 186 additions and 116 deletions

16
package-lock.json generated
View File

@ -13,7 +13,7 @@
"@sentry/tracing": "^6.3.1",
"axios": "^0.21.1",
"echarts": "^5.4.2",
"element-plus": "^2.3.4",
"element-plus": "^2.8.6",
"js-base64": "^3.7.7",
"js-md5": "^0.7.3",
"moment": "^2.29.4",
@ -628,9 +628,9 @@
}
},
"node_modules/@element-plus/icons-vue": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@element-plus/icons-vue/-/icons-vue-2.1.0.tgz",
"integrity": "sha512-PSBn3elNoanENc1vnCfh+3WA9fimRC7n+fWkf3rE5jvv+aBohNHABC/KAR5KWPecxWxDTVT1ERpRbOMRcOV/vA==",
"version": "2.3.1",
"resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
"integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==",
"peerDependencies": {
"vue": "^3.2.0"
}
@ -2655,12 +2655,12 @@
"integrity": "sha512-MrlFq/j+TYHOjeWsWGYfzevc25HNeJdsF6qaLFrqBTRWZQtWkb1myq/Q2veLWezVaa5OcSZ99CFwTT4aF4Mung=="
},
"node_modules/element-plus": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.3.4.tgz",
"integrity": "sha512-SQr0J9z7N4z48WYk/l9NE2tizl8Q7j2OhqlpTc42k4pGncry3+rVX6dsmcsglFynn6vt3NzYxWJqmLFyDKQq+g==",
"version": "2.8.6",
"resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.8.6.tgz",
"integrity": "sha512-fk5jB8V3efM02/4roZ5SWOLArgaYXbxEydZLlXSr+KPAwjNyHBlk2+HO5em8YKo5+RLBoHnn6BaThj6IE4nXoQ==",
"dependencies": {
"@ctrl/tinycolor": "^3.4.1",
"@element-plus/icons-vue": "^2.0.6",
"@element-plus/icons-vue": "^2.3.1",
"@floating-ui/dom": "^1.0.1",
"@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7",
"@types/lodash": "^4.14.182",

View File

@ -15,7 +15,7 @@
"@sentry/tracing": "^6.3.1",
"axios": "^0.21.1",
"echarts": "^5.4.2",
"element-plus": "^2.3.4",
"element-plus": "^2.8.6",
"js-base64": "^3.7.7",
"js-md5": "^0.7.3",
"moment": "^2.29.4",

View File

@ -67,6 +67,10 @@ const infoApi = {
exportP(params) {
return postPBRequest('/template', params, 53211, params.template_name)
},
// dlt645 point
getDlt645Data() {
return postPBRequest("/template", {}, 53012);
},
//
getTx(params) {
return postPBRequest('/driver', params, 54000)
@ -190,6 +194,6 @@ const infoApi = {
//
writeValue(params) {
return postPBRequest("/data", params, 56001);
},
}
};
export default infoApi;

View File

@ -125,7 +125,7 @@ export default {
if (valid) {
const res = props.type === '0' ? await infoApi.saveTx(state.addForm) : await infoApi.editTx(state.addForm);
if (res.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data || res.message || "请求成功");
ctx.emit("dialogSuccess");
} else {
ElMessage.error(res.data || res.message);

View File

@ -94,11 +94,11 @@ export default {
if (valid) {
const res = props.type === 'I' ? await infoApi.addMb(state.addForm) : await infoApi.editMb(state.addForm);
if (res.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data || res.message || "请求成功");
//
ctx.emit("dialogSuccess");
} else {
ElMessage.error(res.data);
ElMessage.error(res.data || res.message || "请求失败");
}
} else {
}

View File

@ -1,6 +1,8 @@
<template>
<el-dialog v-model="visible" title="点位管理" width="40%" :before-close="closeDialog">
<el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef" size="large" label-position="top">
<!-- modbus -->
<el-form v-if="formData.template_type === 1" :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef"
size="large" label-position="top">
<el-form-item label="点位名称:" prop="point_name">
<el-input v-model="addForm.point_name" placeholder="请输入点位名称" clearable :disabled="type !== 'I'" />
</el-form-item>
@ -34,6 +36,33 @@
<el-input v-model="addForm.point_unit" placeholder="请输入点位单位" clearable />
</el-form-item>
</el-form>
<!-- dlt645 2007 -->
<el-form v-if="formData.template_type === 5" :model="addForm" label-width="100px" :rules="rules1" ref="ruleFormRef">
<el-form-item label="点位名称:" prop="point_name">
<el-select v-model="addForm.point_name" size="mini" placeholder="请选择点位名称" @change="changePointName">
<el-option v-for="(item, key) of dlt645PointData" :key="key" :label="key"
:value="key" />
</el-select>
</el-form-item>
<el-form-item label="点位地址:" prop="id">
<el-input v-model="addForm.id" disabled/>
</el-form-item>
<el-form-item label="点位描述:" prop="point_description">
<el-input v-model="addForm.point_description" disabled/>
</el-form-item>
<el-form-item label="读写权限:" prop="point_permissions">
<el-select v-model="addForm.point_permissions" size="mini" placeholder="请选择读写权限" disabled>
<el-option v-for="item in perOptions" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="缩放系数:" prop="multiplier">
<el-input v-model="addForm.multiplier" placeholder="请输入缩放系数" type="number" clearable />
</el-form-item>
<el-form-item label="点位单位:" prop="point_unit">
<el-input v-model="addForm.point_unit" disabled/>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button size="large" @click="closeDialog"></el-button>
@ -166,6 +195,11 @@ export default {
{ required: false, message: "请输入点位描述", trigger: "blur" }
],
},
rules1: {
point_name: { required: true, message: "请输入点位名称", trigger: "blur" },
multiplier: [{ required: true, message: "请输入缩放系数", trigger: "blur" }],
},
dlt645PointData: {},
});
const visible = computed(() => {
return props.dialogVisible;
@ -173,10 +207,36 @@ export default {
onMounted(() => {
state.addForm = props.pointData;
getPointData();
props.type === 'U'? changeSelectData() : changeRegister();
if (props.formData.template_type === 1) {// modbus
getPointData();
props.type === 'U' ? changeSelectData() : changeRegister();
}
if (props.formData.template_type === 5) {// dlt645 2007
getDlt645Data();
}
});
const getDlt645Data = async () => {
const res = await infoApi.getDlt645Data();
if (res.code == 0) {
state.dlt645PointData = res.data;
} else {
ElMessage.error(res.data || res.message);
}
}
const changePointName = () => {
let somePointData = state.dlt645PointData[state.addForm.point_name];
console.log(somePointData);
state.addForm.id = somePointData.id;
state.addForm.point_description = somePointData.point_description;
state.addForm.point_permissions = somePointData.point_permissions;
state.addForm.multiplier = somePointData.multiplier;
state.addForm.point_unit = somePointData.point_unit;
}
const getPointData = () => {
state.datatypeArr = [];
for (let i in props.pointTypeOptions) {
@ -265,10 +325,10 @@ export default {
}
const res = props.type === 'I' ? await infoApi.addP(param) : await infoApi.editP(param);
if (res.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data || res.message || "请求成功");
ctx.emit("dialogSuccess");
} else {
ElMessage.error(res.data || res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
} else {
}
@ -282,7 +342,8 @@ export default {
closeDialog,
saveP,
ruleFormRef,
changeRegister
changeRegister,
changePointName
};
},
};

View File

@ -110,10 +110,10 @@ export default {
const res = props.type === 'I' ? await infoApi.saveTx(req_data) : await infoApi.updateTx(req_data);
const ret = response.decode(new Uint8Array(res));
if(ret.code == 0) {
ElMessage.success(res.message || '请求成功');
ElMessage.success(res.data || res.message || '请求成功');
ctx.emit("dialogSuccess");
} else {
ElMessage.error(res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
} else {
}

View File

@ -86,10 +86,10 @@ export default {
}
const res = props.type === 'I' ? await infoApi.addSet(param) : await infoApi.editSet(param);
if (res.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data || res.message || "请求成功");
ctx.emit("dialogSuccess");
} else {
ElMessage.error(res.data || res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
} else {
}

View File

@ -393,10 +393,10 @@ export default {
if (valid) {
const res = await infoApi.saveTc(props.formData);
if(res.code == 0) {
ElMessage.success(res.msg || '请求成功');
ElMessage.success(res.data || res.message || '请求成功');
ctx.emit("dialogSuccess");
} else {
ElMessage.error(res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
} else {
}

View File

@ -85,7 +85,7 @@ export default {
}
const res = await infoApi.resetHealth(parm);
if (res.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data || res.message || "请求成功");
}
}
const closeDialog = () => {

View File

@ -37,10 +37,10 @@ export default {
const saveP = async () => {
const res = await infoApi.importDevice(state.importData, props.formData.driver_name);
if (res.code == 0) {
ElMessage.success(res.message);
ElMessage.success(res.data || res.message || "请求成功");
ctx.emit("dialogSuccess");
} else {
ElMessage.error(res.data || res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
};

View File

@ -38,10 +38,10 @@ export default {
const saveP = async () => {
const res = await infoApi.importP(state.importData, props.formData.template_name);
if (res.code == 0) {
ElMessage.success(res.message);
ElMessage.success(res.data || res.message || "请求成功");
ctx.emit("dialogSuccess");
} else {
ElMessage.error(res.data || res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
};

View File

@ -70,9 +70,9 @@ export default {
const reStart = async () => {
const res = await infoApi.reboot();
if (res.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data || res.message || "请求成功");
} else {
ElMessage.error(res.message || "请求失败");
ElMessage.error(res.data || res.message || "请求失败");
}
};
const logout = async () => {

View File

@ -1,12 +1,14 @@
<template>
<el-drawer v-model="visible" direction="rtl" :before-close="closeDialog">
<div class="count-status">
<el-tag>最大计数: {{ formData.history && formData.history.max }}</el-tag>
<el-tag v-if="formData.history && formData.history.enable">: {{ formData.history && formData.history.max
}}</el-tag>
<el-tag>状态: {{ formData.history && formData.history.enable ? "启用" : "禁用" }}</el-tag>
</div>
<div>
<el-table :data="tableData" height="400" border :header-cell-style="{ background: '#F6F7FC' }" size="large">
<el-table :data="tableData" height="600" border :header-cell-style="{ background: '#F6F7FC' }" size="large"
:sort-method="sortDates">
<el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column prop="timestamp" label="时间戳" align="center" />
<el-table-column prop="value" label="点位值" align="center" />
@ -74,21 +76,11 @@ export default {
}
}
const exportHis = async () => {
// const parm = {
// driver_name: props.formData.driver_name,
// device_name: props.formData.device_name,
// point_name: props.formData.point_name,
// }
// const res = await infoApi.exportHis(parm);
// const url = window.URL.createObjectURL(new Blob([res]));
// window.open(url);
const params = {
driver_name: props.formData.driver_name,
device_name: props.formData.device_name,
point_name: props.formData.point_name,
};
driver_name: props.formData.driver_name,
device_name: props.formData.device_name,
point_name: props.formData.point_name,
};
axios({
method: "post",
url: '/data',
@ -123,6 +115,12 @@ export default {
ctx.emit("dialogClose");
};
const sortDates = (a, b) => {
const dateA = new Date(a.timestamp);
const dateB = new Date(b.timestamp);
return dateA - dateB;
}
return {
...toRefs(state),
@ -132,7 +130,8 @@ export default {
startHis,
exportHis,
clearHis,
dialogSuccess1
dialogSuccess1,
sortDates
};
},
};

View File

@ -4,7 +4,7 @@
<legend class="box-ht">驱动名称</legend>
<el-form label-width="130px">
<el-form-item>
{{ form.driver_name }}
{{ formData.driver_name }}
</el-form-item>
</el-form>
</fieldset>
@ -40,7 +40,7 @@
</fieldset>
</el-form>
<!-- 1: 'modbus_rtu' -->
<el-form size="large" :model="form2" label-width="120px" :rules="rules2" ref="ruleFormRef2" v-if="pztypecode === 1">
<el-form size="large" :model="form2" label-width="120px" :rules="rules2" ref="ruleFormRef2" v-if="pztypecode === 1 || pztypecode === 6">
<fieldset class="box2">
<legend class="box-ht">通用配置</legend>
<el-form-item label="轮询时间" prop="polling_time">
@ -307,7 +307,7 @@ export default {
} else {
}
});
} else if (props.pztypecode === 1) { // modbus_rtu
} else if (props.pztypecode === 1 || props.pztypecode === 6) { // modbus_rtu
await ruleFormRef2.value.validate(async (valid) => {
if (valid) {
var param = {
@ -373,7 +373,7 @@ export default {
if (props.pztypecode === 2) {
state.form = res.data;
}
if (props.pztypecode === 1) {
if (props.pztypecode === 1 || props.pztypecode === 6) {
state.form2 = res.data;
state.form2.com_name = res.data.com.name;
state.form2.dataBits = Number(res.data.com.dataBits);

View File

@ -36,7 +36,7 @@ export default {
rules: {
max: [
{ required: true, message: "请输入历史记录最大数量", trigger: "blur" },
{ required: true, message: "请输入历史记录最大数量(最大值50-250)", trigger: "blur" },
{ required: true, validator: checkMax, trigger: "blur" }
],
},

View File

@ -19,7 +19,9 @@
<el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column prop="point_name" label="点位名称" align="center" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="address" label="点位地址" align="center" show-overflow-tooltip>
<el-table-column prop="address" label="点位地址" align="center" show-overflow-tooltip v-if="formData.template_type===1">
</el-table-column>
<el-table-column prop="id" label="点位地址" align="center" show-overflow-tooltip v-if="formData.template_type ===5">
</el-table-column>
<el-table-column prop="point_type" label="点位类型" align="center" show-overflow-tooltip>
<template #default="scope">
@ -27,7 +29,7 @@
</template>
</el-table-column>
<el-table-column prop="register" label="寄存器" align="center" show-overflow-tooltip>
<el-table-column prop="register" label="寄存器" align="center" show-overflow-tooltip v-if="formData.template_type!==5">
<template #default="scope">
<span>{{ registerData[scope.row.register] }}</span>
</template>

View File

@ -95,7 +95,7 @@ export default {
});
}
} else {
ElMessage.error(res.data || res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
};
const closeDialog = () => {
@ -115,10 +115,10 @@ export default {
}
const res = await infoApi.delSet(param);
if (res.code == 0) {
ElMessage.success(res.message || "删除成功");
ElMessage.success(res.data || res.message || "删除成功");
getSet();
} else {
ElMessage.error(res.data | res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
})
.catch(() => {

View File

@ -1,7 +1,7 @@
<template>
<el-drawer v-model="visible" direction="rtl" :before-close="closeDialog">
<div class="count-status">
<el-input-number v-model="writeV" style="width: 240px" placeholder="请输入点位值" />
<el-input-number v-model="writeV" style="width: 240px" placeholder="请输入点位值" size="large"/>
</div>
<div class="btns">
<el-button type="primary" size="large" @click="writeValue"></el-button>

View File

@ -2,6 +2,7 @@ import { createApp } from "vue";
import App from "./App.vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import router from "./router/index";
import store from "./store/index";
import "./css/index.scss";
@ -12,7 +13,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component);
}
app.use(ElementPlus);
app.use(ElementPlus, {lacale: zhCn});
app.use(router);
app.use(store);

View File

@ -54,9 +54,9 @@ axios.interceptors.response.use(
(error) => {
ElMessage.closeAll();
ElMessage.error("请求错误");
// router.push({
// path: "/login"
// });
router.push({
path: "/login"
});
return Promise.reject(error);
}
);

View File

@ -16,34 +16,27 @@
<table>
<tr>
<td style="width:180px;border-bottom: 1px solid #006b3b;">
驱动名称: {{ curDriver.driver_name }}
</td>
<td style="width:180px;border-bottom: 1px solid #006b3b;">通讯失败计数: {{ curDriver.health &&
curDriver.health.failure_count }}</td>
<td style="width:340px;border-bottom: 1px solid #006b3b;">
通讯最后一次成功时间: {{ curDriver.health && curDriver.health.last_success_time }}
</td>
<td style="border-bottom: 1px solid #006b3b;">
通讯状态: {{ txStatus[curDriver.driver_status] }}
</td>
<td style="border-bottom: 1px solid #006b3b;">
通讯总计数: {{ curDriver.health && curDriver.health.total_count }}
<td style="width:180px;border-bottom: 1px solid #006b3b;">成功计数: {{ curDriver.health &&
curDriver.health.success_count }}</td>
<td style="width:340px;border-bottom: 1px solid #006b3b;">
通讯最后一次成功时间: {{ curDriver.health && curDriver.health.last_success_time }}
</td>
</tr>
<tr>
<td >
驱动描述: {{ curDriver.driver_description }}
</td>
<td>
通讯成功计数: {{ curDriver.health && curDriver.health.success_count }}
通讯计数: {{ curDriver.health && curDriver.health.total_count }}
</td>
<td>
通讯最后一次失败时间: {{ curDriver.health && curDriver.health.last_failure_ctime || '-'}}
失败计数: {{ curDriver.health && curDriver.health.failure_count }}
</td>
<td colspan="2">通讯最后一次失败原因: {{ curDriver.health && curDriver.health.last_failure_cause }}</td>
<td>
通讯最后一次失败时间: {{ curDriver.health && curDriver.health.last_failure_ctime || '-' }}
</td>
<!-- <td colspan="2">通讯最后一次失败原因: {{ curDriver.health && curDriver.health.last_failure_cause }}</td> -->
</tr>
</table>
</span>
@ -63,18 +56,20 @@
<div class="box-info1">
<div>
<el-tag size="medium" type="">设备名称: {{ curDevice.device_name }}</el-tag>
<el-tag size="medium" type="">设备状态: {{ !curDevice.device_disable ? '启用' : '停用' }} </el-tag>
<el-tag size="medium" type="">设备描述: {{ curDevice.device_description }} </el-tag>
</div>
<el-button type="danger" @click="doDevice">{{ !curDevice.device_disable ? '' : '' }}</el-button>
<el-button type="danger" @click="doDevice">{{ !curDevice.device_disable ? '' : '' }}</el-button>
</div>
</div>
<el-table :data="tableData" height="600" border :header-cell-style="{ background: '#F6F7FC' }" size="large">
<el-table :data="tableData" height="600" border :header-cell-style="{ background: '#F6F7FC' }" size="large"
:row-class-name="tableRowClassName">
<el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column prop="point_name" label="名称" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="point_description" label="描述" align="center" show-overflow-tooltip />
<el-table-column prop="point_quality" label="质量" width="80" align="center" show-overflow-tooltip>
<template #default="scope">
<span>{{ scope.row.point_quality ==1 ? 'good' : 'bad' }}</span>
<span>{{ scope.row.point_quality == 1 ? 'good' : 'bad' }}</span>
</template>
</el-table-column>
<el-table-column prop="point_value" label="点位值" width="80" align="center" show-overflow-tooltip />
@ -117,7 +112,7 @@
</template>
<script>
import { onMounted, reactive, ref, toRefs, nextTick,onUnmounted } from "vue";
import { onMounted, reactive, ref, toRefs, nextTick, onUnmounted } from "vue";
import infoApi from "@/api/infoApi.js";
import { ElMessage, ElMessageBox } from "element-plus";
import De from "@/components/De.vue";
@ -154,7 +149,7 @@ export default {
dialogVisible2: false,
txStatus: [], //
pointTypeOptions: {},
intervalId:null
intervalId: null
});
onMounted(() => {
@ -169,6 +164,13 @@ export default {
clearInterval(state.intervalId);
})
const tableRowClassName = ({ row, rowIndex }) => {
if (state.curDevice.device_disable) {
return '#ccc'
}
}
const getPointType = async () => {
const parm = {};
const res = await infoApi.getPointType(parm);
@ -183,9 +185,9 @@ export default {
if (res.code == 0) {
state.driverData = res.data || [];
if (state.driverData.length > 0) {
changeQd(0, state.driverData[0]);
state.curDriver = state.driverData[0];
console.log(333, state.curDriver)
let select = state.curDriver || state.driverData[0];
changeQd(0, select);
console.log(333, select)
}
}
@ -216,8 +218,8 @@ export default {
state.deviceData = res.data || [];
console.log(123, state.deviceData)
if (state.deviceData.length > 0) {
handleNodeClick(state.deviceData[0]);
state.curDevice = state.deviceData[0]
let node = state.curDevice || state.deviceData[0];
handleNodeClick(node);
nextTick(() => {
console.log(123, state.deviceData[0].device_name)
taskTree.value.setCurrentKey(state.deviceData[0].device_name);
@ -253,7 +255,7 @@ export default {
}
const res = !state.curDevice.device_disable ? await infoApi.stopDevice(param) : await infoApi.startDevice(param);
if (res.code == 0) {
ElMessage.success(res.message || '请求成功');
ElMessage.success(res.data || res.message || '请求成功');
getDeviceData(state.curDriver.driver_name);
}
}
@ -296,7 +298,8 @@ export default {
openDe,
openHis,
openWrite,
getTxStatus
getTxStatus,
tableRowClassName
};
},
};
@ -336,7 +339,7 @@ export default {
padding: 10px 5px;
background: #00AAA3;
color: #fff;
margin:0 5px;
margin: 0 5px;
// border-right: 1px solid #006b3b;
display: flex;

View File

@ -191,7 +191,7 @@ export default {
ElMessage.success(res.data + ',保存网络后会重启' || "请求成功,保存网络后会重启");
getNet();
} else {
ElMessage.error(res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
} else {
}

View File

@ -107,7 +107,7 @@ export default {
if (res.code == 0) {
window.location.href = '/';
} else {
ElMessage.error(res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
}
const resetForm = () => {

View File

@ -140,10 +140,10 @@ export default {
.then(async () => {
const res = await infoApi.delMb(item);
if (res.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data || res.message || "请求成功");
getTableData();
} else {
ElMessage.error(res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
})
.catch(() => {

View File

@ -101,13 +101,13 @@ export default {
onMounted(() => {
getTxSupport();
getTxStatus();
// getTableData();
state.intervalId = setInterval(() =>
getTableData(), 1000);
getTableData();
// state.intervalId = setInterval(() =>
// getTableData(), 1000);
});
onUnmounted(() => {
clearInterval(state.intervalId);
// clearInterval(state.intervalId);
})
//
const getTxSupport = async () => {
@ -206,10 +206,10 @@ export default {
}
const res = await infoApi.delTx(param);
if (res.code == 0) {
ElMessage.success(res.message || "删除成功");
ElMessage.success(res.data || res.message || "删除成功");
getTableData();
} else {
ElMessage.error(res.message || "删除失败");
ElMessage.error(res.data || res.message || "删除失败");
}
})
.catch(() => {
@ -233,10 +233,10 @@ export default {
}
const res = !item.driver_enable ? await infoApi.startStatus(param) : await infoApi.stopStatus(param);
if (res.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data || res.message || "请求成功");
getTableData();
} else {
ElMessage.error(res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
};

View File

@ -170,10 +170,10 @@ export default {
const res = await infoApi.delSc(req_data);
const ret = response.decode(new Uint8Array(res));
if (ret.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data || res.message || "请求成功");
getTableData();
} else {
ElMessage.error(res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
})
.catch(() => {
@ -187,10 +187,10 @@ export default {
};
const res = await infoApi.stopSc(param);
if (res.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data || res.message || "请求成功");
getTableData();
} else {
ElMessage.error(res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
};

View File

@ -131,10 +131,10 @@ export default {
const res = await infoApi.postRules(req_data1);
const ret = response.decode(new Uint8Array(res));
if (ret.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data || res.message || "请求成功");
getTableData();
} else {
ElMessage.error(res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
})
.catch(() => {
@ -175,10 +175,10 @@ export default {
const res = item.enable==='启动' ? await infoApi.postRules(req_data2) : await infoApi.postRules(req_data1);
const ret = response.decode(new Uint8Array(res));
if (ret.code == 0) {
ElMessage.success(res.message || "更新成功");
ElMessage.success(res.data || res.message || "更新成功");
getTableData();
} else {
ElMessage.error(res.message);
ElMessage.error(res.data || res.message || "请求失败");
}
};
const dialogClose = () => {

View File

@ -37,7 +37,7 @@ export default ({ mode }) => defineConfig({
'/api': {
// target: 'http://cdcm_test_api.shikicc.com:58909',
// target: 'http://frp.shikicc.com:58951',
target: 'https://cdcm_api2.shikicc.com',
target: 'http://cdcm_test_api.shikicc.com:8900',
// target: 'https://cdcm_api.shikicc.com',
// target: 'http://localhost:8088',
changeOrigin: true,