|
@@ -3,19 +3,16 @@ import { ref } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { NTabs, NTab } from 'naive-ui';
|
|
|
import { useChatStore } from '@/stores/modules/chatStore';
|
|
|
+import { columns } from './config/index.jsx';
|
|
|
import { BaseTable, ChatWelcome, RecodeSquareCardItem, TheSubMenu, TheChatView } from "@/components";
|
|
|
import { ChatBaseCard, ChatAnswer } from '@/components/Chat';
|
|
|
+import { CustomModal } from "./components";
|
|
|
|
|
|
-import { format, truncateDecimals } from "@/utils/format";
|
|
|
+import { format } from "@/utils/format";
|
|
|
|
|
|
import { waterApi } from '@/api/water';
|
|
|
-import { CustomModal } from "./components";
|
|
|
|
|
|
-import { useInfinite } from '@/composables/useInfinite';
|
|
|
-import { useRecommend } from '@/composables/useRecommend';
|
|
|
-import { useFetchStream } from '@/composables/useFetchStream';
|
|
|
-import { useScroll } from '@/composables/useScroll';
|
|
|
-import { SIMULATE_ENUM } from './components/config';
|
|
|
+import { useInfinite, useRecommend, useFetchStream, useScroll } from '@/composables';
|
|
|
|
|
|
const { recommendList } = useRecommend({type: 1});
|
|
|
const { scrollRef, scrollToTop, scrollToBottom, scrollToBottomIfAtBottom } = useScroll();
|
|
@@ -47,69 +44,6 @@ const visible = ref(false);
|
|
|
|
|
|
const modalData = ref({});
|
|
|
|
|
|
-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 columns = [
|
|
|
- {
|
|
|
- title: '流量(m³/h)',
|
|
|
- key: 'name',
|
|
|
- titleAlign: 'center',
|
|
|
- align: 'center',
|
|
|
- className: 'small',
|
|
|
- width: '80px',
|
|
|
- render: (row) => renderRowDom({ row, key: '流量' })
|
|
|
- },
|
|
|
- {
|
|
|
- title: 'COD(mg/L)',
|
|
|
- key: 'small',
|
|
|
- titleAlign: 'center',
|
|
|
- align: 'center',
|
|
|
- className: 'small',
|
|
|
- width: '80px',
|
|
|
- render: (row) => renderRowDom({ row, key: 'COD' })
|
|
|
- },
|
|
|
- {
|
|
|
- title: 'TN(mg/L)',
|
|
|
- key: 'address',
|
|
|
- titleAlign: 'center',
|
|
|
- align: 'center',
|
|
|
- className: 'small',
|
|
|
- width: '80px',
|
|
|
- render: (row) => renderRowDom({ row, key: 'TN' })
|
|
|
- },
|
|
|
- {
|
|
|
- title: 'NH3-N(mg/L)',
|
|
|
- key: 'tags',
|
|
|
- titleAlign: 'center',
|
|
|
- align: 'center',
|
|
|
- className: 'small',
|
|
|
- width: '80px',
|
|
|
- render: (row) => renderRowDom({ row, key: 'NH3-N' })
|
|
|
- },
|
|
|
- {
|
|
|
- title: 'TP(mg/L)',
|
|
|
- key: 'COD',
|
|
|
- titleAlign: 'center',
|
|
|
- align: 'center',
|
|
|
- className: 'small',
|
|
|
- width: '80px',
|
|
|
- render: (row) => renderRowDom({ row, key: 'TP' })
|
|
|
- },
|
|
|
- {
|
|
|
- title: 'SS(mg/L)',
|
|
|
- key: '流量',
|
|
|
- titleAlign: 'center',
|
|
|
- align: 'center',
|
|
|
- className: 'age',
|
|
|
- width: '78px',
|
|
|
- render: (row) => renderRowDom({ row, key: 'SS' })
|
|
|
- }
|
|
|
-]
|
|
|
-
|
|
|
const handleModelVisible = () => {
|
|
|
visible.value = true;
|
|
|
}
|
|
@@ -119,8 +53,11 @@ const resetConfiguration = () => {
|
|
|
* 临时这样,后续统一处理
|
|
|
* */
|
|
|
textDataSources.value = '';
|
|
|
+
|
|
|
answerLoading.value = false;
|
|
|
+
|
|
|
answerResult.value = [];
|
|
|
+
|
|
|
flowParams.feedback = '';
|
|
|
flowParams.category = '';
|
|
|
flowParams.warningId = '';
|
|
@@ -134,16 +71,15 @@ const resetConfiguration = () => {
|
|
|
const handleOpenContent = async ({ id, category }) => {
|
|
|
|
|
|
if ( id == flowParams.warningId ) return;
|
|
|
-
|
|
|
+
|
|
|
flowParams.category = category;
|
|
|
flowParams.warningId = id;
|
|
|
flowParams.feedback = '';
|
|
|
flowParams.simulate = '{}';
|
|
|
answerLoading.value = false;
|
|
|
- cancelFetch();
|
|
|
|
|
|
const { data } = await waterApi.getWaringDetails(id);
|
|
|
- const res = await waterApi.getWaringForecast(id);
|
|
|
+ // const res = await waterApi.getWaringForecast(id);
|
|
|
|
|
|
const showVal = JSON.parse(data.showVal);
|
|
|
const { basic, jsData, csData } = showVal;
|
|
@@ -547,7 +483,7 @@ const handleWelcomeRecommend = question => {
|
|
|
</tbody>
|
|
|
</table>
|
|
|
<strong class="block mb-[16px]">预测推演结果:</strong>
|
|
|
- <span>未来三小时好氧池硝酸盐预测结果:{{ item.content }}</span>
|
|
|
+ <span>以上指标达成后,预计三小时内总氮可以达到:{{ item.content }}</span>
|
|
|
</div>
|
|
|
</ChatAnswer>
|
|
|
<button class="
|