Bladeren bron

Merge branch 'master' of http://39.97.59.228:8013/hrx/mky-vent-base

lxh 5 maanden geleden
bovenliggende
commit
52ed4ad115

+ 37 - 0
src/components/AIChat/MiniChat.vue

@@ -115,6 +115,12 @@
         </div>
         <!-- 底部输入区 -->
         <div class="input-area">
+          <!-- <div class="file-preview" v-if="currentFile">
+            <div class="file-info">
+              📄 已选择文件:{{ currentFile.name }} (大小:{{ (currentFile.size / 1024).toFixed(2) }}KB)
+              <button @click="clearFile" class="clear-btn">×</button>
+            </div>
+          </div> -->
           <a-textarea v-model:value="inputText" placeholder="请输入你的问题" @keyup.enter="handleSend(inputText)" class="ant-input" auto-size />
           <div class="ctrl-btn">
             <div class="input-controls">
@@ -1146,6 +1152,37 @@ onMounted(() => {
     gap: 5px;
     height: 25%;
   }
+  /* 文件展示区域 */
+  .file-preview {
+    margin-bottom: 10px;
+    padding: 8px;
+    border: 1px solid #e5e7eb;
+    border-radius: 4px;
+    background: #f9fafb;
+  }
+  .file-info {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    font-size: 14px;
+    color: #333;
+  }
+  .clear-btn {
+    border: none;
+    background: #ff4d4f;
+    color: white;
+    border-radius: 50%;
+    width: 20px;
+    height: 20px;
+    cursor: pointer;
+    font-size: 12px;
+  }
+  .file-content {
+    margin-top: 6px;
+    font-size: 13px;
+    color: #666;
+    line-height: 1.4;
+  }
   /* 文件列表容器 */
   .uploaded-files {
     padding: 8px;

+ 1 - 1
src/layouts/default/header/index.vue

@@ -60,7 +60,7 @@
       <!-- 公司端不显示语音播报功能 weatherBroadcast.vue-->
       <WeatherBroadcast v-if="sysOrgCode != 'sdmtjtgsd' && isShowQy && portValue != '8062'" />
       <VoiceBroadcast v-if="sysOrgCode != 'sdmtjtgsd' && portValue != '8062'" />
-      <AIChat></AIChat>
+      <AIChat v-if="hasPermission('show:AIChat')"></AIChat>
       <VoiceBroadcastGsd v-if="sysOrgCode == 'sdmtjtgsd'" />
       <UserDropDown v-if="showUserDropdown" :theme="getHeaderTheme" />
       <LoginSelect ref="loginSelectRef" @success="loginSelectOk" />

+ 31 - 1
src/views/vent/dataCenter/statsCenter/index.vue

@@ -3,9 +3,18 @@
     <customHeader>统计监测</customHeader>
     <div class="content">
       <div class="box-content">
-        <a-table size="small" :columns="outerColumns" :data-source="deviceList" :pagination="true"> </a-table>
+        <a-table size="small" :columns="outerColumns" :data-source="deviceList" :pagination="true">
+          <template #bodyCell="{ column, record }">
+            <template v-if="column.dataIndex === 'action'">
+              <a class="action-link" @click="openNestedTable(record)">详情</a>
+            </template>
+          </template>
+        </a-table>
       </div>
     </div>
+    <a-modal width="80%" :footer="null" title="统计详情" centered v-model:visible="showDetail">
+      <a-table size="small" :columns="innerColumns" :data-source="monitorList" :pagination="true"></a-table>
+    </a-modal>
   </div>
 </template>
 
@@ -15,6 +24,7 @@ import { getInvokeList, getInvokeDetailList } from './stats.api.ts';
 import customHeader from '/@/components/vent/customHeader.vue';
 const deviceList = ref<any[]>([]); // 列表数据
 const monitorList = ref<any[]>([]); // 详情数据
+const showDetail = ref(false);
 // 分页参数
 const paginationState = ref({
   current: 1,
@@ -105,6 +115,12 @@ const outerColumns = [
     key: 'lastTime',
     align: 'center',
   },
+  {
+    title: '操作',
+    dataIndex: 'action',
+    width: 80,
+    align: 'center',
+  },
 ];
 
 // 内层表格列配置
@@ -140,6 +156,10 @@ const innerColumns = [
     align: 'center',
   },
 ];
+const openNestedTable = (record) => {
+  showDetail.value = !showDetail.value;
+  refreshData(record.userid);
+};
 
 async function getTableData(params?) {
   if (!params) {
@@ -155,6 +175,16 @@ async function getTableData(params?) {
     deviceList.value = result.records;
   }
 }
+async function refreshData(userid: string) {
+  // 这里实现具体的请求逻辑
+  const params = {
+    pageNo: 1,
+    pageSize: 20,
+    userid: userid,
+  };
+  const result = await getInvokeDetailList(params);
+  monitorList.value = Object.values(result.records);
+}
 onMounted(() => {
   getTableData();
 });