diff --git a/src/components/features/bindSN.vue b/src/components/features/bindSN.vue index 3e8a2c8..6574bfe 100644 --- a/src/components/features/bindSN.vue +++ b/src/components/features/bindSN.vue @@ -79,6 +79,8 @@ import bindSNActiveStore from "../../stores/bindSN"; const bindSNActive = bindSNActiveStore(); +const emit = defineEmits(["reloadRecord"]); + const selectedUser = ref(""); const selectedSN = ref(""); const unbindUsers = ref([]); @@ -101,6 +103,7 @@ const resetCheckForm = () => { }; const searchBindUser = () => { + unbindUsers.value = []; nextTick(() => { $http.get($url.searchBindUser).then((res) => { if (res.data.code === 200) { @@ -109,7 +112,6 @@ const searchBindUser = () => { userObj.value[element.account_name] = element.uid; }); } else { - unbindUsers.value = []; resetCheckForm(); // ElMessage.error("未查找到相关数据!"); } @@ -118,6 +120,7 @@ const searchBindUser = () => { }; const searchBindSN = () => { + unbindSN.value = []; nextTick(() => { $http.get($url.searchBindSN).then((res) => { if (res.data.code === 200) { @@ -125,7 +128,6 @@ const searchBindSN = () => { unbindSN.value.push(element); }); } else { - unbindSN.value = []; resetCheckForm(); // ElMessage.error("未查找到相关数据!"); } @@ -133,6 +135,11 @@ const searchBindSN = () => { }); }; +const resetList = () => { + unbindUsers.value = []; + unbindSN.value = []; +}; + const bindSN = () => { if (selectedUser.value === "" || selectedSN.value === "") { ElMessage.warning("请选择用户和SN号!"); @@ -151,8 +158,8 @@ const bindSN = () => { message: "绑定成功!", type: "success", }); - unbindUsers.value = []; - unbindSN.value = []; + resetList(); + emit("reloadRecord"); } else { ElMessage.error("绑定失败!"); } diff --git a/src/components/features/bsideManager.vue b/src/components/features/bsideManager.vue index 697e330..77bbbd5 100644 --- a/src/components/features/bsideManager.vue +++ b/src/components/features/bsideManager.vue @@ -185,6 +185,8 @@ import { hasNullOrEmptyPropertyWithTypeof } from "../../utils/hasNullOrEmptyProp const bsideManagerActive = bsideManagerActiveStore(); +const emit = defineEmits(["reloadRecord"]); + const editSelectHold = { single: "编辑", label: "编辑信息" @@ -400,6 +402,9 @@ const requestOperate = () => { type: "success", }); bsideManager(); + if (operate.value == "unBindingSN") { + emit("reloadRecord"); + } } else { ElMessage.error(`${operateType}失败!`); } diff --git a/src/components/features/historyMsg.vue b/src/components/features/historyMsg.vue index c356d8d..7e38be0 100644 --- a/src/components/features/historyMsg.vue +++ b/src/components/features/historyMsg.vue @@ -86,7 +86,7 @@ plain disabled > - {{ scope.row.original_msg.length/2 }}个字节 + {{ scope.row.original_msg.slice(104, scope.row.original_msg.length).length / 2 }}个字节 - {{ scope.row.original_msg ? scope.row.original_msg : "解析错误" }} + {{ scope.row.original_msg ? scope.row.original_msg.slice(104, scope.row.original_msg.length) : "解析错误" }} 展示全部内容 diff --git a/src/components/pageStructure/main.vue b/src/components/pageStructure/main.vue index a4cc4a5..5b6ed30 100644 --- a/src/components/pageStructure/main.vue +++ b/src/components/pageStructure/main.vue @@ -108,13 +108,13 @@
- +
- +
@@ -141,6 +141,8 @@ import shortMsgActiveStore from "../../stores/shortMsg"; const historyMsgActive = historyMsgActiveStore(); const shortMsgActive = shortMsgActiveStore(); +const emit = defineEmits(["getMsg"]); + const activeIndex = ref("1"); const subActiveIndex = ref("1"); const indexStyle = "background-color: rgb(241 245 249);"; @@ -172,6 +174,11 @@ const historyMsg = () => { historyMsgRef.value.historyMsg(); }; +const reloadRecord = () => { + recordRef.value.getRecord(); + emit("getMsg"); +}; + defineExpose({ manager, color, message, created_at, historyMsg }); watch(activeIndex, (value) => { diff --git a/src/views/Main.vue b/src/views/Main.vue index 79fa714..7c8e3a2 100644 --- a/src/views/Main.vue +++ b/src/views/Main.vue @@ -9,7 +9,7 @@ /> -
+