|
@@ -1,6 +1,6 @@
|
|
|
<script setup>
|
|
|
-import { ref, onMounted, watch, computed, unref } from 'vue';
|
|
|
-import { NScrollbar, useMessage, NTabs, NTabPane } from 'naive-ui';
|
|
|
+import { ref, onMounted, computed, unref } from 'vue';
|
|
|
+import { NScrollbar, useMessage, NTabs, NTabPane, c } from 'naive-ui';
|
|
|
import { TheChatView } from '@/components';
|
|
|
import { controlApi } from "@/api/control";
|
|
|
import BaseTitle from './components/BaseTitle.vue';
|
|
@@ -24,7 +24,7 @@ const columnData = ref([
|
|
|
{ label: '水量分配系数', key: 'slfpxs', value: '' },
|
|
|
{ label: '碳源当量', key: 'tydl', value: '' },
|
|
|
{ label: '转换系数', key: 'zhxs', value: '' },
|
|
|
- { label: '稀释配属', key: 'sxps', value: '' },
|
|
|
+ { label: '稀释倍数', key: 'sxps', value: '' },
|
|
|
{ label: '药剂密度', key: 'yymd', value: '' },
|
|
|
{ label: '最小启动流量', key: 'zxqdll', value: '' },
|
|
|
{ label: '碳氮比', key: 'tdb', value: '' }
|
|
@@ -90,11 +90,11 @@ const onEditCancel = () => {
|
|
|
const onFinalResult = () => {
|
|
|
const addStatus = systemStatus.value === 0 ? 1 : 0;
|
|
|
|
|
|
- controlApi.putSystemStatus({ addStatus })
|
|
|
+ controlApi.putSystemStatus({ addStatus });
|
|
|
|
|
|
systemStatus.value = addStatus;
|
|
|
|
|
|
- message.warning(addStatus === 0 ? '当前投药状态,已停用' : '当前投药状态,投放中');
|
|
|
+ message.warning(addStatus === 0 ? '当前投药状态:已停用' : '当前投药状态:投放中');
|
|
|
|
|
|
}
|
|
|
|
|
@@ -105,7 +105,6 @@ const onUpdateTab = (index) => {
|
|
|
isVisibleUpdateInfo.value = false;
|
|
|
return;
|
|
|
}
|
|
|
- updateNum.value = null;
|
|
|
handleMedicateAmount();
|
|
|
}
|
|
|
|
|
@@ -125,13 +124,13 @@ const getTotalNum = () => {
|
|
|
const rOne1 = (((2*hycXsyOne-htfksd)+((qycAdOne+qycYxyOne)*xzxs-htfksd))*(jzxs-1))*(jsLlOne*slfpxs)/1000;
|
|
|
const rOne2 = (rOne1*kzxs-(jsLlOne*slfpxs*jsCodOne*zhxs/1000))/tydl;
|
|
|
const rOne3 = rOne2/yymd/1000*sxps
|
|
|
-
|
|
|
+
|
|
|
const rTwo1 = (((2*hycXsyTwo-htfksd)+((qycAdTwo+qycYxyTwo)*xzxs-htfksd))*(jzxs-1))*(jsLlTwo*slfpxs)/1000;
|
|
|
const rTwo2 = (rTwo1*kzxs-(jsLlTwo*slfpxs*jsCodTwo*zhxs/1000))/tydl;
|
|
|
const rTwo3 = rTwo2/yymd/1000*sxps
|
|
|
|
|
|
- const r1 = (rOne3 < 0 || !rOne3) ? 0 : rOne3.toFixed(3);
|
|
|
- const r2 = (rTwo3 < 0 || !rTwo3) ? 0 : rTwo3.toFixed(3);
|
|
|
+ const r1 = Number((rOne3 < 0 || !rOne3) ? 0 : rOne3.toFixed(3)) || 0;
|
|
|
+ const r2 = Number((rTwo3 < 0 || !rTwo3) ? 0 : rTwo3.toFixed(3)) || 0;
|
|
|
|
|
|
return [ r1, r2 ];
|
|
|
}
|
|
@@ -155,39 +154,44 @@ const handleMedicateAmount = () => {
|
|
|
const type = tabActiveKey.value;
|
|
|
const lastNum = unref(updateNum);
|
|
|
|
|
|
- if ( tabActiveKey === 'worker' ) {
|
|
|
+ if ( tabActiveKey.value === 'worker' ) {
|
|
|
const medicineNum = dataSourceParams.value.worker.medicineAmount;
|
|
|
- if ( medicineNum && lastNum != medicineNum ) {
|
|
|
+ if ( medicineNum || medicineNum == 0 ) {
|
|
|
updateNum.value = medicineNum;
|
|
|
isVisibleUpdateInfo.value = true;
|
|
|
+ message.warning("有新投放方案, 请查看")
|
|
|
+ } else {
|
|
|
+ isVisibleUpdateInfo.value = false;
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
const [r1, r2] = getTotalNum();
|
|
|
+ const maxR = Math.max( r1, r2 );
|
|
|
|
|
|
- if ( type === 'auto') {
|
|
|
- const maxR = Math.max( r1, r2 );
|
|
|
- if ( maxR != lastNum ) {
|
|
|
- updateNum.value = maxR;
|
|
|
- isVisibleUpdateInfo.value = true;
|
|
|
- }
|
|
|
+ if ( type === 'auto' && maxR !== lastNum) {
|
|
|
+ updateNum.value = maxR;
|
|
|
+ isVisibleUpdateInfo.value = true;
|
|
|
+ message.warning("有新的投放方案, 请查看");
|
|
|
}
|
|
|
|
|
|
- if ( type === 'onePool' && r1 !== lastNum ) {
|
|
|
+ if ( type === 'onePool' && r1 != lastNum ) {
|
|
|
updateNum.value = r1;
|
|
|
isVisibleUpdateInfo.value = true;
|
|
|
+ r1 !== lastNum && message.warning("有新的投放方案, 请查看");
|
|
|
}
|
|
|
|
|
|
- if ( type === 'twoPool' && r2 !== lastNum) {
|
|
|
+ if ( type === 'twoPool' && r2 != lastNum ) {
|
|
|
updateNum.value = r2;
|
|
|
isVisibleUpdateInfo.value = true;
|
|
|
+ message.warning("有新的投放方案, 请查看");
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
onMounted(async () => {
|
|
|
// 获取最后一条记录 getSystemStatus
|
|
|
- controlApi.getBaseData().then(({ data }) => {
|
|
|
+ await controlApi.getBaseData().then(({ data }) => {
|
|
|
const {
|
|
|
numberBeng = 0, type = 0,
|
|
|
htfksd, jzxs, xzxs, kzxs, slfpxs, tydl, zhxs, sxps, yymd, zxqdll, tdb,
|
|
@@ -203,7 +207,7 @@ onMounted(async () => {
|
|
|
addType
|
|
|
};
|
|
|
|
|
|
- updateNum.value = medicineAmount
|
|
|
+ updateNum.value = medicineAmount;
|
|
|
|
|
|
doseNum.value = medicineAmount;
|
|
|
|
|
@@ -219,11 +223,40 @@ onMounted(async () => {
|
|
|
|
|
|
// 获取实时数据
|
|
|
controlApi.getNumValue().then(({ data }) => {
|
|
|
+
|
|
|
Object.entries(data).forEach(([key, val]) => {
|
|
|
data[key] = val;
|
|
|
});
|
|
|
// water实时数据
|
|
|
waterConfigParams.value = data;
|
|
|
+
|
|
|
+ const params = {
|
|
|
+ jsLlType: 1,
|
|
|
+ jsLlOne: data.jslYB,
|
|
|
+ jsLlTwo: data.jslYB,
|
|
|
+ jsCodType: 1,
|
|
|
+ jsCodOne: data.jsCodYB,
|
|
|
+ jsCodTwo: data.jsCodYB,
|
|
|
+ hycXsyType: 1,
|
|
|
+ hycXsyOne: data.hyXsyHYOne,
|
|
|
+ hycXsyTwo: data.hyXsyHYTwo,
|
|
|
+ qycYxyType: 1,
|
|
|
+ qycYxyOne: data.qyXsyHYOne,
|
|
|
+ qycYxyTwo: data.qyXsyHYTwo,
|
|
|
+ qycAdType: 1,
|
|
|
+ qycAdOne: data.qyAdHYOne,
|
|
|
+ qycAdTwo: data.qyAdHYTwo,
|
|
|
+ jsTnType: 1,
|
|
|
+ jsTnOne: data.jsTnYB,
|
|
|
+ jsTnTwo: data.jsTnYB
|
|
|
+ }
|
|
|
+
|
|
|
+ Object.keys(dataSourceParams.value).forEach(key => {
|
|
|
+ const item = dataSourceParams.value[key];
|
|
|
+ if ( !Object.keys(item).length ) {
|
|
|
+ dataSourceParams.value[key] = params
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
|
|
|
// 获取是否允许投药开关
|
|
@@ -241,9 +274,7 @@ onMounted(async () => {
|
|
|
<template #control>
|
|
|
<div class="control-container space-x-[12px]">
|
|
|
<div class="left-section">
|
|
|
-
|
|
|
<BaseTitle title="智能投加计算"></BaseTitle>
|
|
|
-
|
|
|
<n-scrollbar class="scrollbar" style="height: 100%;">
|
|
|
<div class="form-content">
|
|
|
|