| | |
| | | <template> |
| | | <HMContainer type="card"> |
| | | <AHMContainer type="card"> |
| | | <template #aside> |
| | | <!-- 目录树 --> |
| | | <LeftTreeByMgr |
| | | v-loading="treeLoading" |
| | | class="h100" |
| | | ref="leftTreeRef" |
| | | :defaultProps="{ |
| | | id: 'group_id', |
| | | label: 'group_name', |
| | | children: 'children', |
| | | }" |
| | | :treedata="listTreeData" |
| | | title-name="分组列表" |
| | | :show-more-operate="false" |
| | | :show-add="false" |
| | | :current-node-key="currentListID" |
| | | :node-icon="() => 'ele-Document'" |
| | | @click="handleClickNode" |
| | | > |
| | | </LeftTreeByMgr> |
| | | </template> |
| | | <template #header> |
| | | <el-form ref="queryFormRef" :inline="true" :model="queryParams"> |
| | | <el-form-item label="标题" prop="title"> |
| | |
| | | <el-table-column type="expand" fixed="left"> |
| | | <template #default="scope"> |
| | | <div class="ml-16"> |
| | | <h3 >指标页面</h3> |
| | | <h3>指标页面</h3> |
| | | <div v-if="scope.row.supervisor"> |
| | | <div class="py-3">页面提示词:<span class="">{{scope.row.supervisor.prompt}}</span></div> |
| | | <el-table class="w-2/3 " :data="scope.row.supervisor.args" border> |
| | | <el-table-column prop="name" label="名称" show-overflow-tooltip> |
| | | |
| | | </el-table-column> |
| | | <el-table-column prop="prompt" label="参数提示词" show-overflow-tooltip> |
| | | |
| | | </el-table-column> |
| | | <el-table-column prop="check" label="缺省值" show-overflow-tooltip> |
| | | |
| | | </el-table-column> |
| | | |
| | | <div class="py-3"> |
| | | 页面提示词:<span class="">{{ scope.row.supervisor.prompt }}</span> |
| | | </div> |
| | | <el-table class="w-2/3" :data="scope.row.supervisor.args" border> |
| | | <el-table-column prop="name" label="名称" show-overflow-tooltip> </el-table-column> |
| | | <el-table-column prop="prompt" label="参数提示词" show-overflow-tooltip> </el-table-column> |
| | | <el-table-column prop="check" label="缺省值" show-overflow-tooltip> </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | --> |
| | | |
| | | |
| | | <el-table-column prop="title" label="名称" width="300" fixed="left" show-overflow-tooltip> </el-table-column> |
| | | |
| | | <el-table-column label="创建人" prop="creator" width="100" show-overflow-tooltip> </el-table-column> |
| | |
| | | <i class="ywifont ywicon-tishici !text-[21px] text-blue-400 cursor-pointer" @click="openCopyPrompt(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> |
| | | <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"> |
| | |
| | | <!-- <OptDlg v-model="optDlgIsShow" :item="optDlgMapRow" @insert="insertOpt" @update="updateOpt" :groupId="currentListID"></OptDlg> --> |
| | | <MetricPrompt v-model="infoDlgIsShow" :metricItem="infoDlgMapRow"></MetricPrompt> |
| | | <MetricName v-model="metricNameIsShow" :metricItem="metricNameMapRow"></MetricName> |
| | | </HMContainer> |
| | | </AHMContainer> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { useDraggable } from '@vueuse/core'; |
| | | import { deleteCurrentRow } from '/@/utils/util'; |
| | | |
| | | import { onMounted, ref } from 'vue'; |
| | | 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 { ElMessage } from 'element-plus'; |
| | | import { nextTick } from 'vue'; |
| | | import OptDlg from './optDlg/OptDlg.vue'; |
| | | import * as metricApi from '/@/api/metric'; |
| | | import { checkSupervisorValidate, updatePublishStatus } from '/@/api/supervisorAdmin'; |
| | | import * as metricApi from '/@/api/metrics'; |
| | | import { updatePublishStatus } from '/@/api/supervisorAdmin'; |
| | | import Chat from '/@/components/chat/Chat.vue'; |
| | | import { gotoRoute } from '/@/utils/route'; |
| | | import { useCompRef } from '/@/utils/types'; |
| | | |
| | | import axios, { CancelTokenSource } from 'axios'; |
| | | import HMContainer from '/@/components/layout/HMContainer.vue'; |
| | | import { useUpdateData } from '/@/hooks/useUpdateData'; |
| | | import { SupervisorPublished, supervisorPublishedMap } from '../../lowCode/sqlAmis/types'; |
| | | import MetricPrompt from './optDlg/MetricPrompt.vue'; |
| | | import MetricName from './optDlg/MetricName.vue'; |
| | | import MetricPrompt from './optDlg/MetricPrompt.vue'; |
| | | import AHMContainer from '/@/components/layout/AHMContainer.vue'; |
| | | import { convertListToTree } from '/@/utils/util'; |
| | | import LeftTreeByMgr from '/@/components/tree/leftTreeByMgr.vue'; |
| | | import * as agentGroupApi from '/@/api/ai/agentGroup'; |
| | | |
| | | //#region ====================== 左侧树数据,tree init ====================== |
| | | const leftTreeRef = useCompRef(LeftTreeByMgr); |
| | | const treeLoading = ref(false); |
| | | const listData = ref([]); |
| | | const currentListID = computed(() => currentNode.value?.group_id); |
| | | const currentNode = ref(null); |
| | | |
| | | const listTreeData = computed(() => { |
| | | const result = convertListToTree(listData.value, { |
| | | ID: 'group_id', |
| | | ParentID: 'p_group_id', |
| | | Children: 'children', |
| | | }); |
| | | return result; |
| | | }); |
| | | |
| | | const handleClickNode = (data) => { |
| | | nextTick(() => { |
| | | leftTreeRef.value?.treeRef.setCurrentKey(data.id); |
| | | }); |
| | | currentNode.value = data; |
| | | getTableData(); |
| | | }; |
| | | const getListTreeData = async () => { |
| | | const res = await agentGroupApi.getSceneGroupTreeByPost(); |
| | | listData.value = res.groups || []; |
| | | const firstListTreeNode = listTreeData.value[0]; |
| | | if (firstListTreeNode) { |
| | | handleClickNode(firstListTreeNode); |
| | | } else { |
| | | tableData.value = []; |
| | | currentNode.value = null; |
| | | } |
| | | }; |
| | | //#endregion |
| | | //#region ====================== 表格数据,table init ====================== |
| | | const tableLoading = ref(false); |
| | | const tableData = ref([]); |
| | | const isDragStatus = ref(false); |
| | | const allTableData = ref(null); |
| | | const getTableData = async () => { |
| | | const res = await metricApi.getMetricAgentListByPost(); |
| | | allTableData.value = (res.values || []).map((item) => { |
| | | item.create_time = item.create_time?.slice(0, 10); |
| | | |
| | | return item; |
| | | }); |
| | | tableData.value = res?.values ?? []; |
| | | if (!allTableData.value) { |
| | | const res = await metricApi.getMetricAgentListByPost(); |
| | | allTableData.value = (res.values || []).map((item) => { |
| | | item.create_time = item.create_time?.slice(0, 10); |
| | | |
| | | return item; |
| | | }); |
| | | } |
| | | |
| | | tableData.value = allTableData.value.filter((item) => item.agent_group === currentListID.value); |
| | | }; |
| | | //#endregion |
| | | |
| | |
| | | const openChatTest = (row) => { |
| | | chatTestMapRow.value = row; |
| | | chatTestIsShow.value = true; |
| | | |
| | | nextTick(() => { |
| | | chatRef.value.clear(); |
| | | setTimeout(() => { |
| | | chatRef.value.autoSend(row.title); |
| | | }, 30); |
| | | // setTimeout(() => { |
| | | // chatRef.value.autoSend(row.title); |
| | | // }, 30); |
| | | }); |
| | | }; |
| | | |
| | |
| | | }; |
| | | //#endregion |
| | | onMounted(() => { |
| | | getTableData(); |
| | | getListTreeData(); |
| | | }); |
| | | </script> |
| | | <style scoped lang="scss"></style> |