|  |  | 
 |  |  |         <template #index="{ rowIndex }"> | 
 |  |  |           {{ rowIndex + 1 + (pagination.current - 1) * pagination.pageSize }} | 
 |  |  |         </template> | 
 |  |  |         <template #dept="{ record }">{{ | 
 |  |  |           record.dept ? record.dept.deptName : '' | 
 |  |  |         }}</template> | 
 |  |  |         <template #status="{ record }"> | 
 |  |  |           <a-switch | 
 |  |  |             checked-value="1" | 
 |  |  | 
 |  |  |               type="dashed" | 
 |  |  |               status="warning" | 
 |  |  |               @click="operation(4, record)" | 
 |  |  |               >权限配置</a-button | 
 |  |  |               >查看权限</a-button | 
 |  |  |             > | 
 |  |  |             <a-button status="success" @click="operation(5, record)" | 
 |  |  |               >部门配置</a-button | 
 |  |  | 
 |  |  |       :title="save" | 
 |  |  |       @cancel="handleCancel(1)" | 
 |  |  |       @ok="editHandleOk" | 
 |  |  |       width="48%" | 
 |  |  |     > | 
 |  |  |       <a-form :model="editform"> | 
 |  |  |         <a-form-item field="email" label="用户名"> | 
 |  |  |           <a-input v-model="editform.email" /> | 
 |  |  |         </a-form-item> | 
 |  |  |         <a-form-item field="name" label="昵称"> | 
 |  |  |           <a-input v-model="editform.nickName" /> | 
 |  |  |         </a-form-item> | 
 |  |  |         <a-form-item field="phoneNumber" label="手机号"> | 
 |  |  |           <a-input v-model="editform.phoneNumber" /> | 
 |  |  |         </a-form-item> | 
 |  |  |       <a-form ref="formRef" :model="editform"> | 
 |  |  |         <a-row :gutter="20"> | 
 |  |  |           <a-col :span="10"> | 
 |  |  |             <a-form-item   field="loginName" label="用户名" :rules="[{required:true,message:'用户名必填'},{maxLength:50,message:'长度不超过50'}]" | 
 |  |  |                            > | 
 |  |  |               <a-input  v-model="editform.loginName" /> | 
 |  |  |             </a-form-item> | 
 |  |  |           </a-col> | 
 |  |  |           <a-col :span="10"> | 
 |  |  |             <a-form-item field="userName" label="姓名"> | 
 |  |  |               <a-input v-model="editform.userName" /> | 
 |  |  |             </a-form-item> | 
 |  |  |           </a-col> | 
 |  |  |         </a-row> | 
 |  |  |         <a-row :gutter="20"> | 
 |  |  |           <a-col :span="10"> | 
 |  |  |             <a-form-item field="phoneNumber" label="手机号"> | 
 |  |  |               <a-input v-model="editform.phoneNumber" /> | 
 |  |  |             </a-form-item> | 
 |  |  |           </a-col> | 
 |  |  |           <a-col :span="10"> | 
 |  |  |             <a-form-item required  field="email" label="邮箱" :rules="[{required:true,message:'邮箱必填'},{maxLength:50,message:'长度不超过50'}]" > | 
 |  |  |               <a-input v-model="editform.email" /> | 
 |  |  |             </a-form-item> | 
 |  |  |           </a-col> | 
 |  |  |         </a-row> | 
 |  |  |         <a-row :gutter="20"> | 
 |  |  |           <a-col :span="10"> | 
 |  |  |             <a-form-item field="psw" label="密码"> | 
 |  |  |               <a-input v-model="editform.psw" /> | 
 |  |  |             </a-form-item> | 
 |  |  |           </a-col> | 
 |  |  |           <a-col :span="10"> | 
 |  |  |             <a-form-item required  field="role" label="角色" :rules="[{required:true,message:'角色必选'}]" > | 
 |  |  |               <a-select | 
 |  |  |                 v-model="editform.role" | 
 |  |  |                 :options="roles" | 
 |  |  |                 :field-names="fieldNames" | 
 |  |  |                 @change="roleChange" | 
 |  |  |               > | 
 |  |  |               </a-select> | 
 |  |  |             </a-form-item> | 
 |  |  |           </a-col> | 
 |  |  |         </a-row> | 
 |  |  |       </a-form> | 
 |  |  |     </a-modal> | 
 |  |  |     <a-modal | 
 |  |  | 
 |  |  |       width="50%" | 
 |  |  |       v-model:visible="resourcevisible" | 
 |  |  |       v-if="resourcevisible" | 
 |  |  |       title="权限配置" | 
 |  |  |       title="用户所有权限" | 
 |  |  |       @cancel="handleCancel(3)" | 
 |  |  |       @ok="editResourceHandleOk" | 
 |  |  |     > | 
 |  |  |       <div :style="{ 'display': 'flex', 'flex-direction': 'column' }"> | 
 |  |  |         <a-tabs | 
 |  |  |           :style="{ 'width': '100%', 'height': '500px', 'overflow-y': 'auto' }" | 
 |  |  |         > | 
 |  |  |           <a-tab-pane key="1"> | 
 |  |  |             <template #title> | 
 |  |  |               <icon-calendar /> | 
 |  |  |               菜单 | 
 |  |  |             </template> | 
 |  |  |             <a-tree | 
 |  |  |               class="tree-demo-box" | 
 |  |  |               v-model:checked-keys="checkedKeysMenu" | 
 |  |  |               v-model:expanded-keys="expandKdysMenu" | 
 |  |  |               :checkable="true" | 
 |  |  |               :data="treeDataMenu" | 
 |  |  |               :show-line="showLineMenu" | 
 |  |  |               @check="onCheckMenu" | 
 |  |  |               :fieldNames="{ | 
 |  |  |                 key: 'menuId', | 
 |  |  |                 title: 'menuName', | 
 |  |  |                 children: 'children', | 
 |  |  |               }" | 
 |  |  |               :check-strictly="checkStrictlyMenu" | 
 |  |  |             > | 
 |  |  |               <!-- <template #extra="nodeData"> | 
 |  |  |                 <div :class="{ 'custom-class': nodeData.menuType == 1 }"> | 
 |  |  |                   <span> | 
 |  |  |                     {{ nodeData.menuName }} | 
 |  |  |                   </span> | 
 |  |  |                 </div> | 
 |  |  |               </template> --> | 
 |  |  |             </a-tree> | 
 |  |  |             <!-- <a-space class="space_select_all"> | 
 |  |  |               <a-button type="primary">全选</a-button> | 
 |  |  |               <a-button>取消全选</a-button> | 
 |  |  |             </a-space> | 
 |  |  |  | 
 |  |  |             <div class="table_box" v-if="treeDataMenu[0].children"> | 
 |  |  |               <div class="table_row1"> | 
 |  |  |                 <div | 
 |  |  |                   class="row1_list" | 
 |  |  |                   v-for="(item, index) in treeDataMenu[0].children" | 
 |  |  |                   :key="item.menuId" | 
 |  |  |                 > | 
 |  |  |                   <div class="row1_clo"> | 
 |  |  |                     <a-checkbox | 
 |  |  |                       :checked="item.menuId" | 
 |  |  |                       @change="onCheckChange(item, $event)" | 
 |  |  |                     > | 
 |  |  |                       {{ item.menuName }} | 
 |  |  |                     </a-checkbox> | 
 |  |  |                   </div> | 
 |  |  |                   <div v-if="item.children" class="row1_clo2"> | 
 |  |  |                     <div | 
 |  |  |                       class="row2_clo2_1" | 
 |  |  |                       v-for="(item2, index2) in item.children" | 
 |  |  |                       :key="item2.menuId" | 
 |  |  |                     > | 
 |  |  |                       <div class="row1_clo2_1"> | 
 |  |  |                         <a-checkbox | 
 |  |  |                           :checked="item2.menuId" | 
 |  |  |                           @change="onCheckChange(item2, $event)" | 
 |  |  |                         > | 
 |  |  |                           {{ item2.menuName }} | 
 |  |  |                         </a-checkbox> | 
 |  |  |                       </div> | 
 |  |  |                       <div v-if="item2.children" class="row1_clo2_2"> | 
 |  |  |                         <div | 
 |  |  |                           v-for="(item3, index3) in item2.children" | 
 |  |  |                           :key="item3.menuId" | 
 |  |  |                         > | 
 |  |  |                           <a-checkbox | 
 |  |  |                             :checked="item3.menuId" | 
 |  |  |                             @change="onCheckChange(item3, $event)" | 
 |  |  |                           > | 
 |  |  |                             {{ item3.menuName }}</a-checkbox | 
 |  |  |                           > | 
 |  |  |                         </div> | 
 |  |  |                       </div> | 
 |  |  |                     </div> | 
 |  |  |                   </div> | 
 |  |  |                 </div> | 
 |  |  |               </div> | 
 |  |  |             </div> --> | 
 |  |  |           </a-tab-pane> | 
 |  |  |           <a-tab-pane key="2"> | 
 |  |  |             <template #title> | 
 |  |  |               <icon-clock-circle /> | 
 |  |  |               知识库 | 
 |  |  |             </template> | 
 |  |  |             <a-space direction="vertical" size="large"> | 
 |  |  |               <a-checkbox-group | 
 |  |  |                 v-model="checkedKeysKnowledge" | 
 |  |  |                 direction="vertical" | 
 |  |  |                 @change="onCheckKnowledge" | 
 |  |  |               > | 
 |  |  |                 <a-checkbox | 
 |  |  |                   v-for="(knowledg, index) of knowledgeList" | 
 |  |  |                   :value="knowledg.id" | 
 |  |  |                   :lable="knowledg.name" | 
 |  |  |                   @change="onCheckKnowledge" | 
 |  |  |                 > | 
 |  |  |                   {{ knowledg.name }} | 
 |  |  |                 </a-checkbox> | 
 |  |  |               </a-checkbox-group> | 
 |  |  |             </a-space> | 
 |  |  |           </a-tab-pane> | 
 |  |  |           <a-tab-pane key="3"> | 
 |  |  |             <template #title> | 
 |  |  |               <icon-user /> | 
 |  |  |               智能体 | 
 |  |  |             </template> | 
 |  |  |             <a-checkbox-group | 
 |  |  |               v-model="checkedKeysDialog" | 
 |  |  |               direction="vertical" | 
 |  |  |               @change="onCheckDialog" | 
 |  |  |             > | 
 |  |  |               <a-checkbox | 
 |  |  |                 v-for="(dialog, index) of DialogsList" | 
 |  |  |                 :value="dialog.id" | 
 |  |  |                 :lable="dialog.name" | 
 |  |  |                 @change="onCheckDialog" | 
 |  |  |               > | 
 |  |  |                 {{ dialog.name }} | 
 |  |  |               </a-checkbox> | 
 |  |  |             </a-checkbox-group> | 
 |  |  |           </a-tab-pane> | 
 |  |  |         </a-tabs> | 
 |  |  |         <a-card | 
 |  |  |           :style="{ | 
 |  |  |             'width': '100%', | 
 |  |  |             'height': '200px', | 
 |  |  |             'height': '40%', | 
 |  |  |             'overflow-y': 'auto', | 
 |  |  |             'margin': '1px', | 
 |  |  |           }" | 
 |  |  | 
 |  |  |             > | 
 |  |  |               {{ tag.dialogName }} | 
 |  |  |             </a-tag> | 
 |  |  |             <a-tag | 
 |  |  |               v-for="(tag, index) of checkStrictlyAgent" | 
 |  |  |               :key="tag.agentId" | 
 |  |  |               @close="handleDialogRemove(tag)" | 
 |  |  |             > | 
 |  |  |               {{ tag.agentName }} | 
 |  |  |             </a-tag> | 
 |  |  |           </a-space> | 
 |  |  |         </a-card> | 
 |  |  |       </div> | 
 |  |  | 
 |  |  |     DialogList, | 
 |  |  |     KnowledgeList, | 
 |  |  |     OrganizationList, | 
 |  |  |     ResourceList, | 
 |  |  |     ResourceList, Role, RoleList, | 
 |  |  |     User, | 
 |  |  |     UserAdd, | 
 |  |  |     UserChangePwd, | 
 |  |  |     UserDelete, | 
 |  |  |     UserEdit, | 
 |  |  |     UserList, | 
 |  |  |     Userstatus, | 
 |  |  |   } from '@/api/authority'; | 
 |  |  |     Userstatus | 
 |  |  |   } from "@/api/authority"; | 
 |  |  |   import { Modal } from '@arco-design/web-vue'; | 
 |  |  |   import Authheader from '@/views/authority/components/authheader.vue'; | 
 |  |  |   import { create } from 'lodash'; | 
 |  |  |   import { queryCanvasList } from "@/api/Agent"; | 
 |  |  |  | 
 |  |  |   const fieldNames = { value: 'roleId', label: 'roleName' }; | 
 |  |  |   const roles = ref([]); | 
 |  |  |  | 
 |  |  |   let treeData = ref([]); | 
 |  |  |   let checkedKeys = ref([]); | 
 |  |  |   let expandKdys = ref([]); | 
 |  |  |   let checkStrictly = ref([]); | 
 |  |  |  | 
 |  |  |   let treeDataMenu = ref<any>([]); | 
 |  |  |   let checkedKeysMenu = ref([]); | 
 |  |  |   let expandKdysMenu = ref([]); | 
 |  |  |   let checkStrictlyMenu = ref([]); | 
 |  |  |  | 
 |  |  |   let checkedKeysKnowledge = ref([]); | 
 |  |  |   let checkStrictlyKnowledge = ref([]); | 
 |  |  |  | 
 |  |  |   let checkedKeysDialog = ref([]); | 
 |  |  |   let checkStrictlyDialog = ref([]); | 
 |  |  |  | 
 |  |  |   let knowledgeList = ref([]); | 
 |  |  |   let DialogsList = ref([]); | 
 |  |  |   let checkStrictlyAgent = ref([]); | 
 |  |  |   let formRef = ref(); | 
 |  |  |  | 
 |  |  |   let menuTips = ref(['权限管理', '账号']); | 
 |  |  |   type SizeProps = 'mini' | 'small' | 'medium' | 'large'; | 
 |  |  | 
 |  |  |     phoneNumber: '', | 
 |  |  |     status: '', | 
 |  |  |     userId: '', | 
 |  |  |     loginName:'', | 
 |  |  |     userName: '', | 
 |  |  |     psw:'', | 
 |  |  |     role:'', | 
 |  |  |   }); | 
 |  |  |  | 
 |  |  |   let size = ref<SizeProps>('medium'); | 
 |  |  | 
 |  |  |   let deptvisible = ref(false); | 
 |  |  |   let resourcevisible = ref(false); | 
 |  |  |   let selectUser = ref({}); | 
 |  |  |   const treeDataList = ref([]); | 
 |  |  |   const checked1 = ref(false); | 
 |  |  |  | 
 |  |  |   //表格复选框选择 | 
 |  |  |   const onCheckChange = (checkedKeysValue: (string | number)[], e: any) => { | 
 |  |  |     console.log('onCheckChange', checkedKeysValue, e); | 
 |  |  |  const loadRole=async () => { | 
 |  |  |    await RoleList(null).then((res) => { | 
 |  |  |      roles.value = res.rows; | 
 |  |  |    }); | 
 |  |  |  } | 
 |  |  |  | 
 |  |  |   const roleChange = (val) => { | 
 |  |  |     editform.value.role = val; | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   const onCheck = (newCheckedKeys, event) => { | 
 |  |  | 
 |  |  |         } | 
 |  |  |       }); | 
 |  |  |     } | 
 |  |  |   }; | 
 |  |  |   const onCheckMenu = (newCheckedKeys, event) => { | 
 |  |  |     let o = { menuId: event.node.menuId, menuName: event.node.menuName }; | 
 |  |  |     if (event.checked) { | 
 |  |  |       checkStrictlyMenu.value.push(o); | 
 |  |  |     } else { | 
 |  |  |       checkStrictlyMenu.value.forEach((val, idx, array) => { | 
 |  |  |         // val: 当前值 | 
 |  |  |         if (val.menuId == event.node.menuId) { | 
 |  |  |           checkStrictlyMenu.value.splice(idx, 1); | 
 |  |  |           return true; | 
 |  |  |         } | 
 |  |  |       }); | 
 |  |  |     } | 
 |  |  |   }; | 
 |  |  |   const onCheckKnowledge = (newCheckedKeys, event) => { | 
 |  |  |     let o = { | 
 |  |  |       knowledgeId: event.target.value, | 
 |  |  |       knowledgeName: event.target.labels[0].innerText, | 
 |  |  |     }; | 
 |  |  |     if (event.target.checked) { | 
 |  |  |       checkStrictlyKnowledge.value.push(o); | 
 |  |  |     } else { | 
 |  |  |       checkStrictlyKnowledge.value.forEach((val, idx, array) => { | 
 |  |  |         // val: 当前值 | 
 |  |  |         if (val.knowledgeId == event.target.value) { | 
 |  |  |           checkStrictlyKnowledge.value.splice(idx, 1); | 
 |  |  |           return true; | 
 |  |  |         } | 
 |  |  |       }); | 
 |  |  |     } | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   const onCheckDialog = (newCheckedKeys, event) => { | 
 |  |  |     let o = { | 
 |  |  |       dialogId: event.target.value, | 
 |  |  |       dialogName: event.target.labels[0].innerText, | 
 |  |  |     }; | 
 |  |  |     if (event.target.checked) { | 
 |  |  |       checkStrictlyDialog.value.push(o); | 
 |  |  |     } else { | 
 |  |  |       checkStrictlyDialog.value.forEach((val, idx, array) => { | 
 |  |  |         // val: 当前值 | 
 |  |  |         if (val.dialogId == event.target.value) { | 
 |  |  |           checkStrictlyDialog.value.splice(idx, 1); | 
 |  |  |           return true; | 
 |  |  |         } | 
 |  |  |       }); | 
 |  |  |     } | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   const handleRemove = (key) => { | 
 |  |  |     checkStrictly.value = checkStrictly.value.filter((tag) => tag !== key); | 
 |  |  |   }; | 
 |  |  |   const handleMenuRemove = (key) => { | 
 |  |  |     checkStrictlyMenu.value = checkStrictlyMenu.value.filter( | 
 |  |  |       (tag) => tag !== key | 
 |  |  |     ); | 
 |  |  |   }; | 
 |  |  |   const handleKnowledgeRemove = (key) => { | 
 |  |  |     checkStrictlyKnowledge.value = checkStrictlyKnowledge.value.filter( | 
 |  |  |       (tag) => tag !== key | 
 |  |  |     ); | 
 |  |  |   }; | 
 |  |  |   const handleDialogRemove = (key) => { | 
 |  |  |     checkStrictlyDialog.value = checkStrictlyDialog.value.filter( | 
 |  |  |       (tag) => tag !== key | 
 |  |  |     ); | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   const basePagination: Pagination = { | 
 |  |  | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: t('用户名'), | 
 |  |  |       dataIndex: 'email', | 
 |  |  |       dataIndex: 'loginName', | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: t('创建时间'), | 
 |  |  |       dataIndex: 'createTime', | 
 |  |  |       title: t('角色'), | 
 |  |  |       dataIndex: 'roleName', | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: t('所属部门'), | 
 |  |  | 
 |  |  |     if (type == 2) { | 
 |  |  |       deptvisible.value = false; | 
 |  |  |     } | 
 |  |  |     if (type == 2) { | 
 |  |  |       resourcevisible.value = false; | 
 |  |  |     } | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   const editDeptHandleOk = async () => { | 
 |  |  | 
 |  |  |     }); | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   const editResourceHandleOk = async () => { | 
 |  |  |     let resources: Array = [], | 
 |  |  |       dialogs: Array = [], | 
 |  |  |       Knowledges: Array = [], | 
 |  |  |       user: User = { userId: selectUser.value.userId }; | 
 |  |  |     checkStrictlyMenu.value.forEach((val) => { | 
 |  |  |       resources.push(val.menuId); | 
 |  |  |     }); | 
 |  |  |     user.resources = resources; | 
 |  |  |  | 
 |  |  |     checkStrictlyKnowledge.value.forEach((val) => { | 
 |  |  |       Knowledges.push(val.knowledgeId); | 
 |  |  |     }); | 
 |  |  |     user.knowledges = Knowledges; | 
 |  |  |  | 
 |  |  |     checkStrictlyDialog.value.forEach((val) => { | 
 |  |  |       dialogs.push(val.dialogId); | 
 |  |  |     }); | 
 |  |  |     user.dialogs = dialogs; | 
 |  |  |  | 
 |  |  |     await UserEdit(user).then((res) => { | 
 |  |  |       fetchData(); | 
 |  |  |     }); | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   const editHandleOk = async () => { | 
 |  |  |     if (editform.value.userId.length > 0) { | 
 |  |  |       await UserEdit({ | 
 |  |  |         ...editform.value, | 
 |  |  |       } as unknown as User).then((res) => { | 
 |  |  |         fetchData(); | 
 |  |  |       }); | 
 |  |  |   const cb = async (err) => { | 
 |  |  |     if (err) { | 
 |  |  |       visible.value = true; | 
 |  |  |     } else { | 
 |  |  |       await UserAdd({ | 
 |  |  |         ...editform.value, | 
 |  |  |       } as unknown as User).then((res) => { | 
 |  |  |         fetchData(); | 
 |  |  |       }); | 
 |  |  |       if (editform.value.userId.length > 0) { | 
 |  |  |         await UserEdit({ | 
 |  |  |           ...editform.value | 
 |  |  |         } as unknown as User).then((res) => { | 
 |  |  |           fetchData(); | 
 |  |  |         }); | 
 |  |  |       } else { | 
 |  |  |         await UserAdd({ | 
 |  |  |           ...editform.value | 
 |  |  |         } as unknown as User).then((res) => { | 
 |  |  |           fetchData(); | 
 |  |  |         }); | 
 |  |  |       } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |   }; | 
 |  |  |   const editHandleOk = () => { | 
 |  |  |     formRef.value.validate(cb); | 
 |  |  |   }; | 
 |  |  |   const operation = async (t, record) => { | 
 |  |  |     if (t == 0) { | 
 |  |  | 
 |  |  |       visible.value = true; | 
 |  |  |       editform.value.userId = ''; | 
 |  |  |       editform.value.userName = ''; | 
 |  |  |       editform.value.loginName = ''; | 
 |  |  |       editform.value.nickName = ''; | 
 |  |  |       editform.value.email = ''; | 
 |  |  |       editform.value.phoneNumber = ''; | 
 |  |  |       editform.value.role = ''; | 
 |  |  |     } | 
 |  |  |     //重置密码 | 
 |  |  |     if (t == 1) { | 
 |  |  | 
 |  |  |       save.value = '编辑'; | 
 |  |  |       editform.value.userId = record.userId; | 
 |  |  |       editform.value.userName = record.userName; | 
 |  |  |       editform.value.nickName = record.nickName; | 
 |  |  |       editform.value.loginName = record.loginName; | 
 |  |  |       editform.value.email = record.email; | 
 |  |  |       editform.value.phoneNumber = record.phoneNumber; | 
 |  |  |       editform.value.role = record.role; | 
 |  |  |     } | 
 |  |  |     //删除 | 
 |  |  |     if (t == 3) { | 
 |  |  | 
 |  |  |     //权限 | 
 |  |  |     if (t == 4) { | 
 |  |  |       resourcevisible.value = true; | 
 |  |  |       checkedKeysMenu.value = []; | 
 |  |  |       expandKdysMenu.value = []; | 
 |  |  |       checkStrictlyMenu.value = []; | 
 |  |  |       checkStrictlyKnowledge.value = []; | 
 |  |  |       checkedKeysKnowledge.value = []; | 
 |  |  |       checkStrictlyDialog.value = []; | 
 |  |  |       checkedKeysDialog.value = []; | 
 |  |  |       selectUser.value = record; | 
 |  |  |       if (record.resources) { | 
 |  |  |         record.resources.forEach((val) => { | 
 |  |  |  | 
 |  |  |       let agents; | 
 |  |  |       if (record.agents){ | 
 |  |  |         agents=record.agents | 
 |  |  |       }else{ | 
 |  |  |         agents = record.roles ? record.roles[0].agents : null; | 
 |  |  |       } | 
 |  |  |       if (agents) { | 
 |  |  |         agents.forEach((val) => { | 
 |  |  |           checkStrictlyAgent.value.push({ | 
 |  |  |             agentId: val.id, | 
 |  |  |             agentName: val.title, | 
 |  |  |           }); | 
 |  |  |  | 
 |  |  |         }); | 
 |  |  |       } | 
 |  |  |       let resources; | 
 |  |  |       if (record.resources){ | 
 |  |  |         resources=record.resources | 
 |  |  |       }else{ | 
 |  |  |         resources = record.roles ? record.roles[0].resources : null; | 
 |  |  |       } | 
 |  |  |       if (resources) { | 
 |  |  |         resources.forEach((val) => { | 
 |  |  |           checkStrictlyMenu.value.push({ | 
 |  |  |             menuId: val.menuId, | 
 |  |  |             menuName: val.menuName, | 
 |  |  |           }); | 
 |  |  |           checkedKeysMenu.value.push(val.menuId); | 
 |  |  |           expandKdysMenu.value.push(val.menuId); | 
 |  |  |  | 
 |  |  |         }); | 
 |  |  |       } | 
 |  |  |       let knowledges; | 
 |  |  |       if (record.knowledges) { | 
 |  |  |         record.knowledges.forEach((val) => { | 
 |  |  |         knowledges = record.knowledges; | 
 |  |  |       } else { | 
 |  |  |         knowledges = record.roles ? record.roles[0].knowledges : null; | 
 |  |  |       } | 
 |  |  |       if (knowledges) { | 
 |  |  |         knowledges.forEach((val) => { | 
 |  |  |           checkStrictlyKnowledge.value.push({ | 
 |  |  |             knowledgeId: val.id, | 
 |  |  |             knowledgeName: val.name, | 
 |  |  |           }); | 
 |  |  |           checkedKeysKnowledge.value.push(val.id); | 
 |  |  |         }); | 
 |  |  |       } | 
 |  |  |       let dialogs; | 
 |  |  |       if (record.dialogs) { | 
 |  |  |         record.dialogs.forEach((val) => { | 
 |  |  |         dialogs = record.dialogs; | 
 |  |  |       } else { | 
 |  |  |         dialogs = record.roles ? record.roles[0].dialogs : null; | 
 |  |  |       } | 
 |  |  |       if (dialogs) { | 
 |  |  |         dialogs.forEach((val) => { | 
 |  |  |           checkStrictlyDialog.value.push({ | 
 |  |  |             dialogId: val.id, | 
 |  |  |             dialogName: val.name, | 
 |  |  |           }); | 
 |  |  |           checkedKeysDialog.value.push(val.id); | 
 |  |  |         }); | 
 |  |  |       } | 
 |  |  |     } | 
 |  |  | 
 |  |  |               } | 
 |  |  |             } | 
 |  |  |           } | 
 |  |  |           if (user.roles) { | 
 |  |  |             for (const r of user.roles) { | 
 |  |  |               if (user.roleName) { | 
 |  |  |                 user.roleName += r.roleName + ","; | 
 |  |  |               } else { | 
 |  |  |                 user.roleName = r.roleName + ","; | 
 |  |  |               } | 
 |  |  |             } | 
 |  |  |           } | 
 |  |  |         } | 
 |  |  |         renderData.value = res.rows; | 
 |  |  |         console.log(renderData); | 
 |  |  | 
 |  |  |       treeData.value = [...res.rows]; | 
 |  |  |     }); | 
 |  |  |   }; | 
 |  |  |   const objArr = ref<any>([]); | 
 |  |  |   const MenuData = async (key) => { | 
 |  |  |     await ResourceList(key).then((res) => { | 
 |  |  |       treeDataMenu.value = [...res.rows]; | 
 |  |  |       // addClassToLeafNodes(treeDataMenu.value); | 
 |  |  |       treeDataList.value = res.rows; | 
 |  |  |     }); | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   KnowledgeList().then((res) => { | 
 |  |  |     knowledgeList.value = res.rows; | 
 |  |  |   }); | 
 |  |  |  | 
 |  |  |   DialogList().then((res) => { | 
 |  |  |     DialogsList.value = res.rows; | 
 |  |  |     //加载agent | 
 |  |  |     queryCanvasList(null).then((r) => { | 
 |  |  |  | 
 |  |  |     }); | 
 |  |  |   }); | 
 |  |  |  | 
 |  |  |   fetchData(); | 
 |  |  |   OrganizationData(''); | 
 |  |  |   MenuData(); | 
 |  |  |   loadRole() | 
 |  |  |  | 
 |  |  |   const reset = () => { | 
 |  |  |     formModel.value = generateFormModel(); |