Quellcode durchsuchen

fix:“优化分组标签删除功能”

soobin vor 1 Jahr
Ursprung
Commit
625b4d7cbd

+ 2 - 0
src/assets/language/en.json

@@ -282,6 +282,8 @@
     "attention": "(Note: the number of bits is incorrect, updating may cause machine anomalies)",
     "submitUpdates": "Submit Updates",
     "modificationSucceeded": "Modification succeeded",
+    "existsFailed": "The machine name already exists",
+    "editFailed": "Modification failure",
     "noParameterData": "No parameter data is available !",
     "addDistributor": "Add Distributor",
     "equipmentNoLabel": "Equipment No",

+ 2 - 0
src/assets/language/zh.json

@@ -282,6 +282,8 @@
     "attention": "(注意:位数不正确,更新可能会造成机器异常)",
     "submitUpdates": "提交更新",
     "modificationSucceeded": "修改成功",
+    "existsFailed": "设备名称已存在",
+    "editFailed": "修改失败",
     "noParameterData": "暂无参数数据",
     "addDistributor": "添加分销人",
     "equipmentNoLabel": "设备编号",

+ 8 - 8
src/service/labelMan/index.js

@@ -2,34 +2,34 @@ import axios from '../../utils/axios';
 
 // 获取标签列表
 export function Api_getLabelList(params) {
-  return axios.get('/SZWL-SERVER/tLabel/list',{params});
+  return axios.get('/SZWL-SERVER/tLabel/list', { params });
 }
 // 获取商家列表
 export function Api_getListAdmin(params) {
-  return axios.get('/SZWL-SERVER/tAdmin/listAdmin',{params});
+  return axios.get('/SZWL-SERVER/tAdmin/listAdmin', { params });
 }
 // 获取机器列表
 export function Api_getListEquipment(params) {
-  return axios.get('/SZWL-SERVER/tEquipment/listEquipment',{params});
+  return axios.get('/SZWL-SERVER/tEquipment/listEquipment', { params });
 }
 
 // 添加
 export function Api_postAddLabel(params) {
-  return axios.post('/SZWL-SERVER/tLabel/add',params);
+  return axios.post('/SZWL-SERVER/tLabel/add', params);
 }
 // 修改
 export function Api_postUpdateLabel(params) {
-  return axios.post('/SZWL-SERVER/tLabel/update',params);
+  return axios.post('/SZWL-SERVER/tLabel/update', params);
 }
 // 删除
 export function Api_getDelLabel(params) {
-  return axios.get('/SZWL-SERVER/tLabel/delete',{params});
+  return axios.post('/SZWL-SERVER/tLabel/delete', params);
 }
 // 单个机器添加标签
 export function Api_getEquipmentToLabel(params) {
-  return axios.get('/SZWL-SERVER/tLabel/equipmentToLabel',{params});
+  return axios.get('/SZWL-SERVER/tLabel/equipmentToLabel', { params });
 }
 // 查询机器的标签列表
 export function Api_getGetEquipmentToLabel(params) {
-  return axios.get('/SZWL-SERVER/tLabel/getEquipmentToLabel',{params});
+  return axios.get('/SZWL-SERVER/tLabel/getEquipmentToLabel', { params });
 }

+ 1 - 1
src/styles/login/index.less

@@ -54,7 +54,7 @@
         margin-top: 38px;
 
         .van-field__body {
-            height: 100%;
+            height: 38px;
         }
 
         .van-form .van-cell {

+ 7 - 2
src/views/device/deviceSet.vue

@@ -448,9 +448,14 @@ export default {
       if (data.code === "00000") {
         isUpdate.value = true;
         showSuccessToast(t("device.modificationSucceeded"));
-        router.push({ path: "/device" });
+        setTimeout(() => {
+          router.push({ path: "/device" });
+        }, 1500);
+      } else if (data.code === "A0001"){
+        // 设备名称重复
+        showToast(t("device.existsFailed"));
       } else {
-        showFailToast(data.message);
+        showFailToast(t("device.editFailed"))
       }
     };
 

+ 1 - 4
src/views/labelMan/index.vue

@@ -139,10 +139,7 @@ export default {
           ids.push(item.id);
         }
       });
-      let param = {
-        ids,
-      };
-      Api_getDelLabel(param).then((res) => {
+      Api_getDelLabel(ids).then((res) => {
         console.log(res);
         if (res.data.code === "00000") {
           isDelete.value = false;