瀏覽代碼

修复:设备组无法删除设备的问题

范志成 4 月之前
父節點
當前提交
91ea85a393
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      smsb-plus-ui/src/views/smsb/deviceGroup/index.vue

+ 12 - 2
smsb-plus-ui/src/views/smsb/deviceGroup/index.vue

@@ -123,7 +123,7 @@
               <!--              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['digital:deviceGroup:edit']"></el-button>-->
               <!--            </el-tooltip>-->
               <el-tooltip content="删除" placement="top">
-                <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
+                <el-button link type="primary" icon="Delete" @click="handleDeleteDevice(scope.row)"
                            v-hasPermi="['digital:deviceGroup:remove']"></el-button>
               </el-tooltip>
             </template>
@@ -188,7 +188,8 @@ import {
 } from '@/api/smsb/digital/deviceGroup';
 import {
   getGroupRelByGroupId,
-  addDeviceGroupRel
+  addDeviceGroupRel,
+  delDeviceGroupRel
 } from '@/api/smsb/digital/deviceGroupRel';
 import {
   listDevice
@@ -456,6 +457,15 @@ const handleDelete = async (row?: DeviceGroupVO) => {
   await getList();
 }
 
+const handleDeleteDevice = async (row?: DeviceGroupRelVO) => {
+  const _ids = row?.id || ids.value;
+  await proxy?.$modal.confirm('是否确认删除设备信息编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
+  await delDeviceGroupRel(_ids);
+  proxy?.$modal.msgSuccess("删除成功");
+  const res = await getGroupRelByGroupId(groupId.value);
+  deviceList.value = res.data;
+}
+
 /** 导出按钮操作 */
 const handleExport = () => {
   proxy?.download('digital/deviceGroup/export', {