From b05fb583edc25c8ef02073a21f6f5a41644a5bac Mon Sep 17 00:00:00 2001 From: wangqiujuan0808 <578331299@qq.com> Date: Sat, 11 May 2024 15:15:16 +0800 Subject: [PATCH] .. --- src/api/infoApi.js | 5 ++ src/components/AddData.vue | 12 +---- src/components/AddPoint.vue | 6 --- src/components/AddSet.vue | 2 +- src/components/ExportPoint.vue | 84 ++++++++++++++++++++++++++++++++++ src/components/Header.vue | 20 +------- src/components/ViewPoint.vue | 22 +++++++-- src/utils/axios.js | 11 +++-- src/views/Login.vue | 8 +++- 9 files changed, 124 insertions(+), 46 deletions(-) create mode 100644 src/components/ExportPoint.vue diff --git a/src/api/infoApi.js b/src/api/infoApi.js index 93d0930..bf16e23 100644 --- a/src/api/infoApi.js +++ b/src/api/infoApi.js @@ -84,6 +84,11 @@ const infoApi = { detP(params) { return postPBRequest('/template', params, 53310, params.template_name) }, + // 点位导入 + + importP(params) { + return postPBRequest('/template', params, 53310, params.template_name) + }, // 驱动列表查询 getTx(params) { return postPBRequest('/driver', params, 54000) diff --git a/src/components/AddData.vue b/src/components/AddData.vue index 8cc559a..5272aaf 100644 --- a/src/components/AddData.vue +++ b/src/components/AddData.vue @@ -208,15 +208,7 @@ export default { { required: true, validator: validName, trigger: "blur" }, ], description: [{ required: true, message: "请输入驱动描述", trigger: "blur" }], - type: [{ required: true, message: "请选择通讯驱动", trigger: "blur" }], - // com: [{ required: true, message: "请选择COM口", trigger: "blur" }], - // baudRate: [{ required: true, message: "请选择波特率", trigger: "blur" }], - // parity: [{ required: true, message: "请选择校验位", trigger: "blur" }], - // dataBits: [{ required: true, message: "请选择数据位", trigger: "blur" }], - // stopBits: [{ required: true, message: "请选择停止位", trigger: "blur" }], - // timeout: [{ required: true, message: "请选择超时时间", trigger: "blur" }], - // port: [{ required: true, message: "请填写主机地址", trigger: "blur" }], - // host: [{ required: true, message: "请填写主机端口", trigger: "blur" }] + type: [{ required: true, message: "请选择通讯驱动", trigger: "blur" }] }, }); const visible = computed(() => { @@ -269,7 +261,7 @@ export default { ElMessage.success(res.message || "请求成功"); ctx.emit("dialogSuccess"); } else { - ElMessage.error(res.message || "请求失败"); + ElMessage.error(res.data || res.message); } } else { console.log("error submit!"); diff --git a/src/components/AddPoint.vue b/src/components/AddPoint.vue index 47200f1..d363142 100644 --- a/src/components/AddPoint.vue +++ b/src/components/AddPoint.vue @@ -171,10 +171,6 @@ export default { ctx.emit("dialogClose"); }; - const importData = () => { }; - - const exportData = () => { }; - const saveP = async () => { console.log(ruleFormRef.value); await ruleFormRef.value.validate(async (valid) => { @@ -203,8 +199,6 @@ export default { ...toRefs(state), visible, closeDialog, - importData, - exportData, saveP, ruleFormRef }; diff --git a/src/components/AddSet.vue b/src/components/AddSet.vue index 765d84b..2b3b9e1 100644 --- a/src/components/AddSet.vue +++ b/src/components/AddSet.vue @@ -2,7 +2,7 @@ - + diff --git a/src/components/ExportPoint.vue b/src/components/ExportPoint.vue new file mode 100644 index 0000000..cd7bcf0 --- /dev/null +++ b/src/components/ExportPoint.vue @@ -0,0 +1,84 @@ + + + diff --git a/src/components/Header.vue b/src/components/Header.vue index 0f7336f..17fc291 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -20,7 +20,7 @@
-

登录名:{{ (userInfo && userInfo.loginUserName) || "" }}

+

登录名:{{ (userInfo && userInfo.nickName) || "" }}

昵称:{{ (userInfo && userInfo.nickName) || "" }}

重启设备 { const pathname = window.location.hash.split("/")[1] || ""; - if (!["login"].includes(pathname)) { - getUserInfo(); - } }); const dialogClose = () => { state.dialogVisible = false; @@ -79,19 +76,6 @@ export default { const dialogSuccess = () => { state.dialogVisible = false; }; - const getUserInfo = async () => { - // const userInfo = await myApi.getUserInfo(); - // state.userInfo = userInfo - state.userInfo = { - adminUserId: 1, - locked: 0, - loginPassword: "******", - loginUserName: "admin", - nickName: "admin", - }; - store.commit("setUserInfo", state.userInfo); - }; - const reStart = async () => { const res = await infoApi.reboot(); if (res.code == 0) { diff --git a/src/components/ViewPoint.vue b/src/components/ViewPoint.vue index 1d15b7c..6aefb3c 100644 --- a/src/components/ViewPoint.vue +++ b/src/components/ViewPoint.vue @@ -42,7 +42,7 @@ @@ -56,9 +56,11 @@ - + +