| | |
| | | <el-table |
| | | v-loading="tableLoading" |
| | | ref="draggableTableRef" |
| | | rowKey="group_id" |
| | | rowKey="group_id" |
| | | class="h100" |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
| | | border |
| | | :row-class-name="isDragStatus ? 'cursor-move' : 'cursor-pointer'" |
| | | :data="displayTableData" |
| | |
| | | |
| | | <el-table-column label="操作" width="200" fixed="right" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <!-- <div class="space-x-3 items-center flex"> |
| | | <el-tooltip effect="dark" content="查看提示词" placement="top"> |
| | | <i class="ywifont ywicon-tishici !text-[21px] text-blue-400 cursor-pointer" @click="openCopyPrompt(scope.row)"></i> |
| | | <div class="space-x-3 items-center flex"> |
| | | <el-tooltip effect="dark" content="编辑" placement="top"> |
| | | <i class="ywifont ywicon-bianji !text-[15px] text-blue-400 cursor-pointer" @click="openOptDlg(scope.row)"></i> |
| | | </el-tooltip> |
| | | <el-tooltip effect="dark" content="查看指标名称" placement="top"> |
| | | <i |
| | | class="ywifont ywicon-zhibiao !text-[17px] text-blue-400 cursor-pointer" |
| | | @click="openMetricNameDlg(scope.row)" |
| | | ></i> |
| | | </el-tooltip> |
| | | |
| | | <el-tooltip effect="dark" content="对话测试" placement="top"> |
| | | <i class="ywifont ywicon-ceshi !text-[20px] text-blue-400 cursor-pointer" @click="openChatTest(scope.row)"></i> |
| | | </el-tooltip> |
| | | |
| | | |
| | | </div> --> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | |
| | | <!-- <OptDlg v-model="optDlgIsShow" :item="optDlgMapRow" @insert="insertOpt" @update="updateOpt" :groupId="currentListID"></OptDlg> --> |
| | | <OptDlg v-model="optDlgIsShow" :item="optDlgMapRow" @insert="insertOpt" @update="updateOpt" ></OptDlg> |
| | | <!-- <MetricPrompt v-model="infoDlgIsShow" :metricItem="infoDlgMapRow"></MetricPrompt> |
| | | <MetricName v-model="metricNameIsShow" :metricItem="metricNameMapRow"></MetricName> --> |
| | | </HMContainer> |
| | |
| | | // import MetricName from './optDlg/MetricName.vue'; |
| | | // import MetricPrompt from './optDlg/MetricPrompt.vue'; |
| | | import HMContainer from '/@/components/layout/HMContainer.vue'; |
| | | import { convertListToTree } from '/@/utils/util'; |
| | | |
| | | import { convertListToTree, travelTree } from '/@/utils/util'; |
| | | import OptDlg from './optDlg/OptDlg.vue'; |
| | | //#region ====================== 表格数据,table init ====================== |
| | | const tableLoading = ref(false); |
| | | const tableData = ref([]); |
| | | const isDragStatus = ref(false); |
| | | const getTableData = async () => { |
| | | const res = await agentGroupApi.getAgentGroupTreeByPost(); |
| | | const res = await agentGroupApi.getSceneGroupTreeByPost(); |
| | | |
| | | tableData.value = convertListToTree(res?.groups ?? [], { |
| | | ID: 'group_id', |
| | |
| | | const queryParams = ref({ |
| | | group_name: '', |
| | | }); |
| | | const { resetQuery, handleQueryTable, displayTableData } = useQueryTable(tableData, queryParams, () => { |
| | | displayTableData.value = tableData.value; |
| | | },false,true); |
| | | const { resetQuery, handleQueryTable, displayTableData } = useQueryTable( |
| | | tableData, |
| | | queryParams, |
| | | () => { |
| | | displayTableData.value = tableData.value; |
| | | }, |
| | | false, |
| | | true |
| | | ); |
| | | |
| | | //#endregion |
| | | |
| | |
| | | }; |
| | | |
| | | const updateOpt = (formValue) => { |
| | | const foundIndex = tableData.value.findIndex((item) => item.id === formValue.id); |
| | | if (foundIndex > -1) { |
| | | tableData.value[foundIndex] = { |
| | | ...tableData.value[foundIndex], |
| | | ...formValue, |
| | | }; |
| | | } |
| | | travelTree(tableData.value,(value,index,array)=>{ |
| | | if(value.group_id===formValue.group_id){ |
| | | array[index] = { |
| | | ...array[index], |
| | | ...formValue |
| | | } |
| | | return true; |
| | | } |
| | | }) |
| | | |
| | | }; |
| | | |
| | | const insertOpt = (newData) => { |