| | |
| | | children: 'children', |
| | | }" |
| | | :treedata="listTreeData" |
| | | title-name="分组列表" |
| | | title-name="场景列表" |
| | | :show-more-operate="false" |
| | | defaultExpandAll |
| | | :show-add="false" |
| | | :current-node-key="currentListID" |
| | | :node-icon="() => 'ele-Document'" |
| | |
| | | <template #header> |
| | | <el-form ref="queryFormRef" :inline="true" :model="queryParams"> |
| | | <el-form-item label="标题" prop="title"> |
| | | <el-input v-model="queryParams.title" style="width: 226.4px" placeholder="标题" clearable /> |
| | | <el-input v-model="queryParams.title" style="width: 226.4px" placeholder="标题" clearable @input="debounceQueryTable" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button type="primary" icon="ele-Search" @click="handleQueryTable"> 查询 </el-button> |
| | | <!-- <el-button type="primary" icon="ele-Search" @click="handleQueryTable"> 查询 </el-button> --> |
| | | <el-button icon="ele-Refresh" @click="resetQuery">重置 </el-button> |
| | | <el-button icon="ele-Plus" @click="openOptDlg()"> 添加 </el-button> |
| | | </el-form-item> |
| | |
| | | label: 'title', |
| | | children: 'children', |
| | | }" |
| | | defaultExpandAll |
| | | :data="parentSelectOptions" |
| | | node-key="id" |
| | | :clearable="true" |
| | |
| | | |
| | | <script setup lang="ts"> |
| | | import { useDraggable } from '@vueuse/core'; |
| | | import { deleteCurrentRow, travelTree } from '/@/utils/util'; |
| | | import { debounce, travelTree } from '/@/utils/util'; |
| | | |
| | | import { computed, onMounted, ref } from 'vue'; |
| | | import { usePageDisplay } from '/@/hooks/usePageDisplay'; |
| | | import { useQueryTable } from '/@/hooks/useQueryTable'; |
| | | // import { useTableSort } from '/@/hooks/useTableSort'; |
| | | // import { useValidateUniqueness } from '/@/hooks/useValidateUniqueness'; |
| | | import axios, { CancelTokenSource } from 'axios'; |
| | | import type { FormInstance, FormRules } from 'element-plus'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | | import { nextTick } from 'vue'; |
| | | import SqlAmisEdit from './edit/SqlAmisEdit.vue'; |
| | | import OptDlg from './optDlg/OptDlg.vue'; |
| | | import { SupervisorPublished, supervisorPublishedMap } from './types'; |
| | | import * as agentGroupApi from '/@/api/ai/agentGroup'; |
| | | import * as supervisorAdminApi from '/@/api/supervisorAdmin'; |
| | | import { checkSupervisorValidate, updatePublishStatus } from '/@/api/supervisorAdmin'; |
| | | import * as supervisorGroupApi from '/@/api/supervisorAdmin/supervisorGroup'; |
| | | import Chat from '/@/components/chat/Chat.vue'; |
| | | import AHMContainer from '/@/components/layout/AHMContainer.vue'; |
| | | import ColFilter from '/@/components/table/colFilter/ColFilter.vue'; |
| | | import { TableCol } from '/@/components/table/colFilter/types'; |
| | | import LeftTreeByMgr from '/@/components/tree/leftTreeByMgr.vue'; |
| | | import { useUpdateData } from '/@/hooks/useUpdateData'; |
| | | import emitter from '/@/utils/mitt'; |
| | | import { deepClone } from '/@/utils/other'; |
| | | import { gotoRoute } from '/@/utils/route'; |
| | | import { useCompRef } from '/@/utils/types'; |
| | | import { convertListToTree } from '/@/utils/util'; |
| | | import * as agentGroupApi from '/@/api/ai/agentGroup'; |
| | | |
| | | import axios, { CancelTokenSource } from 'axios'; |
| | | import * as supervisorGroupApi from '/@/api/supervisorAdmin/supervisorGroup'; |
| | | import AHMContainer from '/@/components/layout/AHMContainer.vue'; |
| | | import LeftTreeByMgr from '/@/components/tree/leftTreeByMgr.vue'; |
| | | import { useUpdateData } from '/@/hooks/useUpdateData'; |
| | | import ColFilter from '/@/components/table/colFilter/ColFilter.vue'; |
| | | import { TableCol } from '/@/components/table/colFilter/types'; |
| | | import { OptClassificationMap, classificationEnum } from '/@/views/types/metrics'; |
| | | |
| | | const columnList = ref<TableCol[]>([ |
| | | { prop: 'title', label: '标题', width: 300, fixed: 'left' }, |
| | |
| | | const currentNode = ref(null); |
| | | |
| | | const listTreeData = computed(() => { |
| | | const result = convertListToTree(listData.value, { |
| | | const byParentData = convertListToTree(listData.value, { |
| | | ID: 'group_id', |
| | | ParentID: 'p_group_id', |
| | | Children: 'children', |
| | | }); |
| | | const result = []; |
| | | byParentData.forEach((item) => { |
| | | if ( |
| | | item.group_type != OptClassificationMap[classificationEnum.Office] && |
| | | item.group_type != OptClassificationMap[classificationEnum.Knowledge] |
| | | ) { |
| | | result.push(item); |
| | | } |
| | | }); |
| | | return result; |
| | | }); |
| | |
| | | //#endregion |
| | | |
| | | //#region ====================== 表格数据,table init ====================== |
| | | const getLenById =(data:any[],id:string,value:any)=>{ |
| | | return data.filter( |
| | | (item) => |
| | | item.group_id === id || value.children?.some((treeItem) => treeItem.group_id === item.group_id) |
| | | ).length; |
| | | } |
| | | const tableLoading = ref(false); |
| | | const tableData = ref([]); |
| | | const isDragStatus = ref(false); |
| | |
| | | |
| | | return item; |
| | | }); |
| | | |
| | | travelTree(listTreeData.value, (value, index, array, parent) => { |
| | | const len = getLenById(allTableData.value,value.group_id,value); |
| | | value.group_name =`${value.group_name} (${len})` |
| | | |
| | | }) |
| | | |
| | | } |
| | | tableData.value = allTableData.value.filter((item) => item.group_id === currentListID.value); |
| | | tableData.value = allTableData.value.filter( |
| | | (item) => |
| | | item.group_id === currentListID.value || currentNode.value.children?.some((treeItem) => treeItem.group_id === item.group_id) |
| | | ); |
| | | }; |
| | | //#endregion |
| | | |
| | |
| | | const { resetQuery, handleQueryTable, displayTableData } = useQueryTable(tableData, queryParams, () => { |
| | | displayTableData.value = tableData.value; |
| | | }); |
| | | |
| | | const debounceQueryTable = debounce(handleQueryTable, 400); |
| | | //#endregion |
| | | |
| | | //#region ====================== 查询快捷键 ====================== |