|
|
@@ -197,7 +197,16 @@
|
|
|
<icon-user />
|
|
|
智能体
|
|
|
</template>
|
|
|
- Content of Tab Panel 3
|
|
|
+ <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', 'overflow-y': 'auto', margin:'1px'}"
|
|
|
@@ -226,6 +235,17 @@
|
|
|
{{ tag.knowledgeName }}
|
|
|
</a-tag>
|
|
|
</a-space>
|
|
|
+ <a-divider />
|
|
|
+ <a-space wrap>
|
|
|
+ 智能体:
|
|
|
+ <a-tag
|
|
|
+ v-for="(tag, index) of checkStrictlyDialog"
|
|
|
+ :key="tag.dialogId"
|
|
|
+ @close="handleDialogRemove(tag)"
|
|
|
+ >
|
|
|
+ {{ tag.dialogName }}
|
|
|
+ </a-tag>
|
|
|
+ </a-space>
|
|
|
</a-card>
|
|
|
</div>
|
|
|
|
|
|
@@ -240,6 +260,7 @@ import useLoading from "@/hooks/loading";
|
|
|
import { Pagination } from "@/types/global";
|
|
|
import type { TableColumnData } from "@arco-design/web-vue/es/table/interface";
|
|
|
import {
|
|
|
+ DialogList,
|
|
|
KnowledgeList,
|
|
|
OrganizationList,
|
|
|
ResourceList,
|
|
|
@@ -268,7 +289,12 @@ let checkStrictlyMenu = ref([]);
|
|
|
let checkedKeysKnowledge= ref([]);
|
|
|
let checkStrictlyKnowledge= ref([]);
|
|
|
|
|
|
+let checkedKeysDialog= ref([]);
|
|
|
+let checkStrictlyDialog= ref([]);
|
|
|
+
|
|
|
let knowledgeList = ref([]);
|
|
|
+let DialogsList = ref([]);
|
|
|
+
|
|
|
|
|
|
let menuTips = ref(["权限管理", "账号"]);
|
|
|
type SizeProps = "mini" | "small" | "medium" | "large";
|
|
|
@@ -344,6 +370,23 @@ const onCheckKnowledge = (newCheckedKeys, event) => {
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+
|
|
|
+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);
|
|
|
};
|
|
|
@@ -353,6 +396,10 @@ const handleMenuRemove = (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 = {
|
|
|
current: 1,
|
|
|
@@ -442,16 +489,22 @@ const editDeptHandleOk = async () => {
|
|
|
};
|
|
|
|
|
|
const editResourceHandleOk = async () => {
|
|
|
- let resources: Array = [],Knowledges: Array = [], user: User = { "userId": selectUser.value.userId };
|
|
|
+ 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();
|
|
|
});
|
|
|
@@ -524,6 +577,8 @@ const operation = async (t, record) => {
|
|
|
checkStrictlyMenu.value = [];
|
|
|
checkStrictlyKnowledge.value=[];
|
|
|
checkedKeysKnowledge.value=[];
|
|
|
+ checkStrictlyDialog.value=[];
|
|
|
+ checkedKeysDialog.value=[];
|
|
|
selectUser.value = record;
|
|
|
record.resources.forEach((val) => {
|
|
|
checkStrictlyMenu.value.push({ "menuId": val.menuId, "menuName": val.menuName });
|
|
|
@@ -534,6 +589,10 @@ const operation = async (t, record) => {
|
|
|
checkStrictlyKnowledge.value.push({ "knowledgeId": val.id, "knowledgeName": val.name });
|
|
|
checkedKeysKnowledge.value.push(val.id);
|
|
|
});
|
|
|
+ record.dialogs.forEach((val) => {
|
|
|
+ checkStrictlyDialog.value.push({ "dialogId": val.id, "dialogName": val.name });
|
|
|
+ checkedKeysDialog.value.push(val.id);
|
|
|
+ });
|
|
|
|
|
|
}
|
|
|
//机构
|
|
|
@@ -596,6 +655,10 @@ const MenuData = async (key) => {
|
|
|
KnowledgeList().then((res) => {
|
|
|
knowledgeList.value = res.rows;
|
|
|
});
|
|
|
+
|
|
|
+DialogList().then((res) => {
|
|
|
+ DialogsList.value = res.rows;
|
|
|
+});
|
|
|
fetchData();
|
|
|
OrganizationData("");
|
|
|
MenuData();
|