Przeglądaj źródła

Merge remote-tracking branch 'origin/dev' into dev

Hwf 2 tygodni temu
rodzic
commit
de6796e941

+ 8 - 0
src/api/duty/commandSystem.ts

@@ -25,6 +25,14 @@ export const commandSystemFilteredDept = (data) => {
   });
 };
 
+export const commandSystemDeleteDept = (data) => {
+  return request({
+    url: '/api/event_management/command_system/system/dept/delete',
+    method: 'post',
+    data: data
+  });
+};
+
 export const commandSystemListUser = (query) => {
   return request({
     url: '/api/event_management/command_system/system/user/list',

+ 21 - 3
src/views/emergencyCommandMap/RightSection/InitConsultation.vue

@@ -34,7 +34,7 @@
               <template #default="{ node, data }">
                 <div class="custom-tree-node">
                   <span>{{ node.label }}</span>
-                  <el-icon v-if="data.user_category === 'temp'" @click="handleDelete(data)"><DeleteFilled /></el-icon>
+                  <el-icon v-if="data.deptCategory === 'temp'" @click="handleDelete(data)"><DeleteFilled /></el-icon>
                 </div>
               </template>
             </el-tree>
@@ -94,7 +94,7 @@
 <script lang="ts" setup>
 import { Search } from '@element-plus/icons-vue';
 import { ConvergedCommunication } from '@/utils/convergedCommunication';
-import { commandCommonListDept, commandSystemListDept, commandSystemFilteredDept, commandSystemListUser, commandSystemCheckedUsers } from '@/api/duty/commandSystem';
+import { commandCommonListDept, commandSystemListDept, commandSystemFilteredDept, commandSystemDeleteDept, commandSystemListUser, commandSystemCheckedUsers } from '@/api/duty/commandSystem';
 import { listUser } from '@/api/system/user';
 import { listDept } from '@/api/system/dept';
 import { DeptVO } from '@/api/system/dept/types';
@@ -157,6 +157,11 @@ const handleCheck = async() => {
 
 const handleNodeClick = (data) => {
   console.log(data);
+  
+  // 忽略成员单位节点
+  if(data.deptCategory == 'member_root')
+    return;
+
   queryParams2.value.deptId = data.id;
   getPerson();
 };
@@ -219,8 +224,20 @@ const handleClose = () => {
   emits('update:show', false);
 };
 
-const handleDelete = (data) => {
+const handleDelete = async(data) => {
   console.log(data);
+  ElMessageBox.confirm('删除部门【'+data.deptName+ "】及人员吗?", '系统提示', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    type: 'warning'
+  }).then(() => {
+    commandSystemDeleteDept({eventId: props.eventId, deptId: data.id}).then((res)=>{
+      console.log(res);
+      filteredTreeData.value = proxy?.handleTree(res.data, 'deptId');
+      userList.value = [];
+    }) 
+  }).catch(() => {
+  });
 };
 
 // 融合通信参数
@@ -479,6 +496,7 @@ onMounted(() => {
 .custom-tree-node {
   display: flex;
   align-items: center;
+  justify-content: space-between;
   .el-icon {
     margin-left: 4px;
     color: red;