From abf4a87962df8d7c203acea8029b30c9186867d0 Mon Sep 17 00:00:00 2001
From: liudong <liudong>
Date: 星期四, 08 八月 2024 16:11:30 +0800
Subject: [PATCH] 智能体测试和配置bug页面修改

---
 src/views/authority/users/index.vue |  131 +++++++++++++++++++++++++++----------------
 1 files changed, 81 insertions(+), 50 deletions(-)

diff --git a/src/views/authority/users/index.vue b/src/views/authority/users/index.vue
index d20bb62..1509a15 100644
--- a/src/views/authority/users/index.vue
+++ b/src/views/authority/users/index.vue
@@ -5,7 +5,7 @@
       <a-row>
         <a-col :flex="2"></a-col>
         <a-col :flex="1">
-          <a-form :model="formModel"  style="margin-top: 30px">
+          <a-form :model="formModel" style="margin-top: 30px">
             <a-form-item field="name">
               <a-input
                 v-model="formModel.name"
@@ -15,7 +15,7 @@
             </a-form-item>
           </a-form>
         </a-col>
-        <a-col :flex="'200px'" style="text-align: right;margin-top: 30px">
+        <a-col :flex="'200px'" style="text-align: right; margin-top: 30px">
           <a-button @click="reset" style="margin-right: 20px">
             <template #icon>
               <icon-refresh />
@@ -92,23 +92,33 @@
           />
         </template>
         <template #operations="{ record }">
-          <a-button type="outline" @click="operation(1, record)"
-            >閲嶇疆瀵嗙爜</a-button
-          >
-          <a-button type="outline" @click="operation(2, record)">缂栬緫</a-button>
-          <a-popconfirm
-            content="Are you sure you want to delete?"
-            type="success"
-            @ok="operation(3, record)"
-          >
-            <a-button type="outline">鍒犻櫎</a-button>
-          </a-popconfirm>
-          <a-button type="outline" @click="operation(4, record)"
-            >鏉冮檺閰嶇疆</a-button
-          >
-          <a-button type="outline" @click="operation(5, record)"
-            >閮ㄩ棬閰嶇疆</a-button
-          >
+          <a-space>
+            <a-button
+              type="outline"
+              status="success"
+              @click="operation(1, record)"
+              >閲嶇疆瀵嗙爜</a-button
+            >
+            <a-button type="outline" @click="operation(2, record)"
+              >缂栬緫</a-button
+            >
+            <a-popconfirm
+              content="Are you sure you want to delete?"
+              type="success"
+              @ok="operation(3, record)"
+            >
+              <a-button type="outline" status="danger">鍒犻櫎</a-button>
+            </a-popconfirm>
+            <a-button
+              type="dashed"
+              status="warning"
+              @click="operation(4, record)"
+              >鏉冮檺閰嶇疆</a-button
+            >
+            <a-button status="success" @click="operation(5, record)"
+              >閮ㄩ棬閰嶇疆</a-button
+            >
+          </a-space>
         </template>
       </a-table>
     </a-card>
@@ -359,6 +369,7 @@
   let editform = ref<User>({
     createTime: '',
     dept: undefined,
+    deptName:"",
     email: '',
     nickName: '',
     phoneNumber: '',
@@ -489,8 +500,8 @@
       slotName: 'index',
     },
     {
-      title: t('鐢ㄦ埛鍚�'),
-      dataIndex: 'userName',
+      title: t('鐧诲綍鍚�'),
+      dataIndex: 'email',
     },
     {
       title: t('鍒涘缓鏃堕棿'),
@@ -498,8 +509,8 @@
     },
     {
       title: t('鎵�灞為儴闂�'),
-      dataIndex: 'dept',
-      slotName: 'dept',
+      dataIndex: 'deptName',
+      slotName: 'deptName',
     },
     {
       title: t('鐘舵��'),
@@ -620,7 +631,7 @@
     //鍒犻櫎
     if (t == 3) {
       await UserDelete(record.userId).then((res) => {
-        if (res.code == 20000) {
+        if (res.code == 200) {
           fetchData();
         }
       });
@@ -636,28 +647,35 @@
       checkStrictlyDialog.value = [];
       checkedKeysDialog.value = [];
       selectUser.value = record;
-      record.resources.forEach((val) => {
-        checkStrictlyMenu.value.push({
-          menuId: val.menuId,
-          menuName: val.menuName,
+      if (record.resources) {
+        record.resources.forEach((val) => {
+          checkStrictlyMenu.value.push({
+            menuId: val.menuId,
+            menuName: val.menuName
+          });
+          checkedKeysMenu.value.push(val.menuId);
+          expandKdysMenu.value.push(val.menuId);
         });
-        checkedKeysMenu.value.push(val.menuId);
-        expandKdysMenu.value.push(val.menuId);
-      });
-      record.knowledges.forEach((val) => {
-        checkStrictlyKnowledge.value.push({
-          knowledgeId: val.id,
-          knowledgeName: val.name,
+      }
+      if (record.knowledges) {
+        record.knowledges.forEach((val) => {
+          checkStrictlyKnowledge.value.push({
+            knowledgeId: val.id,
+            knowledgeName: val.name
+          });
+          checkedKeysKnowledge.value.push(val.id);
         });
-        checkedKeysKnowledge.value.push(val.id);
-      });
-      record.dialogs.forEach((val) => {
-        checkStrictlyDialog.value.push({
-          dialogId: val.id,
-          dialogName: val.name,
+      }
+      if (record.dialogs) {
+        record.dialogs.forEach((val) => {
+          checkStrictlyDialog.value.push({
+            dialogId: val.id,
+            dialogName: val.name
+          });
+          checkedKeysDialog.value.push(val.id);
         });
-        checkedKeysDialog.value.push(val.id);
-      });
+      }
+
     }
     //鏈烘瀯
     if (t == 5) {
@@ -667,14 +685,16 @@
       checkStrictly.value = [];
       selectUser.value = record;
       expandKdys.value.push('0');
-      record.dept.forEach((val) => {
-        checkStrictly.value.push({
-          deptId: val.deptId,
-          deptName: val.deptName,
+      if (record.dept) {
+        record.dept.forEach((val) => {
+          checkStrictly.value.push({
+            deptId: val.deptId,
+            deptName: val.deptName
+          });
+          checkedKeys.value.push(val.deptId);
+          expandKdys.value.push(val.deptId);
         });
-        checkedKeys.value.push(val.deptId);
-        expandKdys.value.push(val.deptId);
-      });
+      }
     }
   };
 
@@ -684,6 +704,17 @@
     setLoading(true);
     try {
       await UserList(params).then((res) => {
+        for (const user of res.rows) {
+          if (user.dept) {
+            for (const d of user.dept) {
+              if (user.deptName) {
+                user.deptName += d.deptName + ",";
+              } else {
+                user.deptName = d.deptName + ",";
+              }
+            }
+          }
+        }
         renderData.value = res.rows;
         console.log(renderData);
         pagination.current = params.current;

--
Gitblit v1.8.0