Quellcode durchsuchen

feat: 修改进出水key以及添加tips

sunxiao vor 8 Monaten
Ursprung
Commit
a77714085c

+ 1 - 3
src/main.ts

@@ -2,7 +2,7 @@ import { createApp } from 'vue'
 
 import App from './App.vue'
 import router from './router'
-import pinia from './stores/index.js'
+import pinia from './stores'
 import './permission'
 
 import 'virtual:svg-icons-register'
@@ -16,5 +16,3 @@ app.use(pinia)
 app.use(router)
 
 app.mount('#app')
-
-

+ 5 - 6
src/views/analyse/ForecastView.vue

@@ -11,7 +11,7 @@ import { ChatBaseCard, ChatAnswer } from '@/components/Chat';
 import { formatToData, replaceArray } from "@/utils/format";
 import { waterApi } from '@/api/water';
 import { useInfinite, useRecommend, useScroll } from '@/composables'
-import { columns } from './config';
+import { inColumns, outColumns } from './config';
 
 const { recommendList } = useRecommend({ type: 3 });
 const { scrollRef, scrollToTop } = useScroll();
@@ -123,7 +123,7 @@ onMounted(() => {
                 <span>当前进水数据:</span>
               </div>
               <div class="main">
-                <BaseTable :columns="columns" :data="jsTableData"></BaseTable>
+                <BaseTable :columns="inColumns" :data="jsTableData"></BaseTable>
               </div>
             </div>
             <div class="warning-table">
@@ -131,7 +131,7 @@ onMounted(() => {
                 <span>当前出水数据:</span>
               </div>
               <div class="main">
-                <BaseTable :columns="columns" :data="csTableData"></BaseTable>
+                <BaseTable :columns="outColumns" :data="csTableData"></BaseTable>
               </div>
             </div>
           </div>
@@ -153,8 +153,7 @@ onMounted(() => {
 
       </ChatBaseCard>
 
-      <ChatAnswer :loading="false" :delay-loading="false" :toggleVisibleIcons="false" :content="answerResult"
-        v-if="answerResult" />
+      <ChatAnswer :loading="false" :delay-loading="false" :toggleVisibleIcons="false" :content="answerResult" v-if="answerResult" class="reset-chart"/>
 
     </TheChatView>
   </section>
@@ -170,4 +169,4 @@ onMounted(() => {
   padding: 50px 0 30px 0;
   border-radius: 8px;
 }
-</style>
+</style>

+ 3 - 3
src/views/analyse/PymolView.vue

@@ -8,7 +8,7 @@ import { ChatBaseCard, ChatAnswer } from '@/components/Chat';
 import { formatToData } from "@/utils/format";
 import { waterApi } from '@/api/water';
 import { useInfinite, useRecommend, useScroll } from '@/composables'
-import { columns } from './config';
+import { inColumns, outColumns } from './config';
 
 const { recommendList } = useRecommend({ type: 2 });
 const { scrollRef, scrollToTop } = useScroll();
@@ -100,7 +100,7 @@ const handleWelcomeRecommend = question => {
                 <span>当前进水数据:</span>
               </div>
               <div class="main">
-                <BaseTable :columns="columns" :data="jsTableData"></BaseTable>
+                <BaseTable :columns="inColumns" :data="jsTableData"></BaseTable>
               </div>
             </div>
             <div class="warning-table">
@@ -108,7 +108,7 @@ const handleWelcomeRecommend = question => {
                 <span>当前出水数据:</span>
               </div>
               <div class="main">
-                <BaseTable :columns="columns" :data="csTableData"></BaseTable>
+                <BaseTable :columns="outColumns" :data="csTableData"></BaseTable>
               </div>
             </div>
           </div>

+ 24 - 8
src/views/analyse/WaterView.vue

@@ -7,7 +7,7 @@ import { BaseTable, ChatWelcome, RecodeSquareCardItem, TheSubMenu, TheChatView }
 import { useInfinite, useRecommend, useFetchStream, useScroll } from '@/composables';
 import { ChatBaseCard, ChatAnswer } from '@/components/Chat';
 import { CustomModal } from "./components";
-import { columns } from './config';
+import { inColumns, outColumns } from './config';
 
 import { formatToData } from "@/utils/format";
 
@@ -425,7 +425,7 @@ const handleWelcomeRecommend = question => {
                 <span>当前进水数据:</span>
               </div>
               <div class="main">
-                <BaseTable :columns="columns" :data="jsTableData"></BaseTable>
+                <BaseTable :columns="inColumns" :data="jsTableData"></BaseTable>
               </div>
             </div>
             <div class="warning-table">
@@ -433,7 +433,7 @@ const handleWelcomeRecommend = question => {
                 <span>当前出水数据:</span>
               </div>
               <div class="main">
-                <BaseTable :columns="columns" :data="csTableData"></BaseTable>
+                <BaseTable :columns="outColumns" :data="csTableData"></BaseTable>
               </div>
             </div>
           </div>
@@ -484,12 +484,13 @@ const handleWelcomeRecommend = question => {
             水质预测推演
           </button>
         </template>
-        
+
         <template v-if="item.biz === 'DECISION_TABLE'">
           <ChatAnswer
             :loading="item.loading"
             :delay-loading="item.delayLoading"
             :toggleVisibleIcons="false"
+            class="reset-chart"
           >
             <div class="markdown-body text-[15px] break-all">
               <strong class="block mb-[16px]">推荐指标调整:</strong>
@@ -513,8 +514,8 @@ const handleWelcomeRecommend = question => {
           </ChatAnswer>
           <button class="
             px-[30px] py-[10px] mb-[20px]
-            rounded-[8px] 
-            bg-white text-[13px] 
+            rounded-[8px]
+            bg-white text-[13px]
             text-[#5E5E5E] hover:text-[#2454FF]"
             :disabled="item.isDisable"
             @click="handleModelVisible"
@@ -529,7 +530,7 @@ const handleWelcomeRecommend = question => {
         :delay-loading="answerLoading"
         :toggleVisibleIcons="false"
         v-show="answerLoading"
-        loadingText="内容生成中,大概需要50秒..."
+        loadingText="内容生成中,大概需要1分钟..."
       ></ChatAnswer>
 
     </TheChatView>
@@ -539,4 +540,19 @@ const handleWelcomeRecommend = question => {
     :current-data="modalData"
     @on-submit="handleSendSimulate"
     ></CustomModal>
-</template>
+</template>
+
+<style lang="scss">
+  .reset-chart {
+  .markdown-body {
+    .custom-table-wrapper {
+      width: 100%;
+      overflow: hidden;
+      padding: 10px;
+      table td,  table th {
+        white-space: normal !important; 
+      }
+    }
+  }
+}
+</style>

+ 2 - 2
src/views/analyse/WorkOrder.vue

@@ -234,7 +234,7 @@ const handleCreateOrder = async () => {
   const endDateTime = dayjs(timeEnd);
   let params = {};
 
-  let question = `请生成${reportDate.value}智慧工单分析报告`;
+  let question = `${reportDate.value}智慧工单分析报告`;
 
   if (tabActive.value === 'customDaily') {
     const thirtyDaysBeforeEndTime = endDateTime.subtract(31, 'day');
@@ -252,7 +252,7 @@ const handleCreateOrder = async () => {
     }
     checkGroup.forEach(key => params[key] = true);
 
-    question = `请成生${startDateTime.format("MM月DD日")}-${endDateTime.format("MM月DD日")}的在线仪表的日报工单`
+    question = `${startDateTime.format("MM月DD日")}-${endDateTime.format("MM月DD日")}的在线仪表的日报工单`
 
   } else {
 

+ 74 - 9
src/views/analyse/config/index.jsx

@@ -1,15 +1,23 @@
 import { h } from 'vue';
+import { NTooltip, NGradientText } from 'naive-ui';
 import { truncateDecimals } from "@/utils/format";
 
 export const renderRowDom = ({ row, key }) => {
   const { exceed, value } = row[key] || {};
-  const cls = exceed ? 'text-[#F44C49] font-bold' : 'text-[1A2029]'
-  return (<span class={ cls }>{truncateDecimals(value)} {exceed && <i>↑</i>}</span>)
+  const cls = exceed ? 'text-[#F44C49] font-bold' : 'text-[1A2029]';
+  return (<span class={ cls }>{truncateDecimals(value)} {exceed && <i>↑</i>}</span>);
 } 
 
-export const columns = [
+export const renderTooltip = (trigger, content) => {
+  return h(NTooltip, null, {
+    trigger: () => trigger,
+    default: () => content
+  })
+}
+
+export const inColumns = [
   {
-    title: '流量(m³/h)',
+    title: () => renderTooltip(h( 'span', '流量(m³/h)' ), '进水流量 | 在线仪表'),
     key: 'name',
     titleAlign: 'center',
     align: 'center',
@@ -18,7 +26,7 @@ export const columns = [
     render: (row) => renderRowDom({ row, key: '流量' })
   },
   {
-    title: 'COD(mg/L)',
+    title: () => renderTooltip(h( 'span', 'COD(mg/L)' ), '进水cod | 在线仪表'),
     key: 'small',
     titleAlign: 'center',
     align: 'center',
@@ -27,7 +35,7 @@ export const columns = [
     render: (row) => renderRowDom({ row, key: 'COD' })
   },
   {
-    title: 'TN(mg/L)',
+    title: () => renderTooltip(h( 'span', 'TN(mg/L)' ), '进水总氮 | 在线仪表'),
     key: 'address',
     titleAlign: 'center',
     align: 'center',
@@ -36,7 +44,7 @@ export const columns = [
     render: (row) => renderRowDom({ row, key: 'TN' })
   },
   {
-    title: 'NH3-N(mg/L)',
+    title: () => renderTooltip(h( 'span', 'NH₃-N(mg/L)' ), '进水氨氮 | 在线仪表'),
     key: 'tags',
     titleAlign: 'center',
     align: 'center',
@@ -45,7 +53,7 @@ export const columns = [
     render: (row) => renderRowDom({ row, key: 'NH3-N' })
   },
   {
-    title: 'TP(mg/L)',
+    title: () => renderTooltip(h( 'span', 'TP(mg/L)' ), '进水总磷 | 在线仪表'),
     key: 'COD',
     titleAlign: 'center',
     align: 'center',
@@ -54,7 +62,7 @@ export const columns = [
     render: (row) => renderRowDom({ row, key: 'TP' })
   },
   {
-    title: 'SS(mg/L)',
+    title: () => renderTooltip(h( 'span', 'SS(mg/L)' ), '进水SS | 在线仪表'),
     key: '流量',
     titleAlign: 'center',
     align: 'center',
@@ -62,4 +70,61 @@ export const columns = [
     width: '78px',
     render: (row) => renderRowDom({ row, key: 'SS' })
   }
+]
+
+export const outColumns = [
+  {
+    title: () => renderTooltip(h( 'span', 'COD(mg/L)' ), '出水cod | 在线仪表'),
+    key: 'COD',
+    titleAlign: 'center',
+    align: 'center',
+    className: 'small',
+    width: '80px',
+    render: (row) => renderRowDom({ row, key: '流量' })
+  },
+  {
+    title: () => renderTooltip(h( 'span', 'xsy1(mg/L)' ), '1号好氧池硝酸盐 | 连续检测'),
+    key: 'HYC1',
+    titleAlign: 'center',
+    align: 'center',
+    className: 'small',
+    width: '80px',
+    render: (row) => renderRowDom({ row, key: 'COD' })
+  },
+  {
+    title: () => renderTooltip(h( 'span', 'xsy2(mg/L)' ), '2号好氧池硝酸盐 | 连续检测'),
+    key: 'HYC2',
+    titleAlign: 'center',
+    align: 'center',
+    className: 'small',
+    width: '80px',
+    render: (row) => renderRowDom({ row, key: 'TN' })
+  },
+  {
+    title: () => renderTooltip(h( 'span', 'NH₃-N(mg/L)' ), '出水氨氮 | 在线检测'),
+    key: 'NH3-N',
+    titleAlign: 'center',
+    align: 'center',
+    className: 'small',
+    width: '80px',
+    render: (row) => renderRowDom({ row, key: 'NH3-N' })
+  },
+  {
+    title: () => renderTooltip(h( 'span', 'zlsy(mg/L)' ), '二沉池正磷酸盐 | 连续检测'),
+    key: 'TP',
+    titleAlign: 'center',
+    align: 'center',
+    className: 'small',
+    width: '80px',
+    render: (row) => renderRowDom({ row, key: 'TP' })
+  },
+  {
+    title: () => renderTooltip(h( 'span', 'SS(mg/L)' ), '出水SS | 在线仪表'),
+    key: 'SS',
+    titleAlign: 'center',
+    align: 'center',
+    className: 'small',
+    width: '78px',
+    render: (row) => renderRowDom({ row, key: 'SS' })
+  }
 ]