|
@@ -15,6 +15,14 @@ const message = useMessage();
|
|
|
const isVisibleBtn = ref(true);
|
|
|
const isVisibleUpdateInfo = ref(false);
|
|
|
const systemStatus = ref(0);
|
|
|
+const resultNumberSet = ref({
|
|
|
+ flowNum1: 0,
|
|
|
+ flowNum2: 0,
|
|
|
+ doseNum1: 0,
|
|
|
+ doseNum2: 0,
|
|
|
+ updateNum1: 0,
|
|
|
+ updateNum2: 0
|
|
|
+});
|
|
|
|
|
|
const columnData = ref([
|
|
|
{ label: '后反馈设定', key: 'htfksd', value: '' },
|
|
@@ -28,7 +36,7 @@ const columnData = ref([
|
|
|
{ label: '药剂密度', key: 'yymd', value: '' },
|
|
|
{ label: '最小启动流量', key: 'zxqdll', value: '' },
|
|
|
{ label: '碳氮比', key: 'tdb', value: '' }
|
|
|
-])
|
|
|
+]);
|
|
|
|
|
|
const doseNum = ref(null);
|
|
|
const flowNum = ref(null);
|
|
@@ -66,6 +74,8 @@ const tabActiveKey = computed(() => tabKeyEnum[baseSourceParams.value.type]);
|
|
|
const tdbNum = computed(() => {
|
|
|
const type = tabActiveKey.value;
|
|
|
|
|
|
+ const [ r1, r2, rOne, rTwo] = getTotalNum();
|
|
|
+
|
|
|
const {
|
|
|
jsLlOne, jsLlTwo,
|
|
|
jsCodOne, jsCodTwo,
|
|
@@ -76,19 +86,19 @@ const tdbNum = computed(() => {
|
|
|
tydl, zhxs
|
|
|
} = baseSourceParams.value
|
|
|
|
|
|
- const { tytjzl } = waterConfigParams.value;
|
|
|
-
|
|
|
if ( type === 'auto' || type === 'worker' ) {
|
|
|
- const jsll = Math.max( jsLlOne, jsLlTwo );
|
|
|
- const cod = Math.max( jsCodOne, jsCodTwo );
|
|
|
- const jsTn = Math.max( jsTnOne, jsTnTwo );
|
|
|
- return Number(((tytjzl*1000/jsll*tydl+cod*zhxs*tydl)/jsTn).toFixed(2));
|
|
|
+ const rNum = Math.max( r1, r2 );
|
|
|
+ const jsll = rNum == r1 ? jsLlOne: jsLlTwo;
|
|
|
+ const cod = rNum == r1 ? jsCodOne: jsCodTwo;
|
|
|
+ const jsTn = rNum == r1 ? jsTnOne: jsTnTwo;
|
|
|
+ const n = rNum == r1 ? rOne : rOne
|
|
|
+ return Number(((n*1000/jsll*tydl+cod*zhxs*tydl)/jsTn).toFixed(2)) + "%";
|
|
|
}
|
|
|
if ( type === 'onePool' ) {
|
|
|
- return Number(((tytjzl*1000/jsLlOne*tydl+jsCodOne*zhxs*tydl)/jsTnOne).toFixed(2));
|
|
|
+ return Number(((rOne*1000/jsLlOne*tydl+jsCodOne*zhxs*tydl)/jsTnOne).toFixed(2)) + "%";
|
|
|
}
|
|
|
if ( type === 'twoPool' ) {
|
|
|
- return Number(((tytjzl*1000/jsLlTwo*tydl+jsCodTwo*zhxs*tydl)/jsTnTwo).toFixed(2));
|
|
|
+ return Number(((rTwo*1000/jsLlTwo*tydl+jsCodTwo*zhxs*tydl)/jsTnTwo).toFixed(2)) + "%";
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -120,13 +130,14 @@ const onEditCancel = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const onFinalResult = () => {
|
|
|
+const onFinalResult = async () => {
|
|
|
+
|
|
|
const addStatus = systemStatus.value === 0 ? 1 : 0;
|
|
|
|
|
|
controlApi.putSystemStatus({ addStatus });
|
|
|
|
|
|
systemStatus.value = addStatus;
|
|
|
-
|
|
|
+
|
|
|
message.warning(addStatus === 0 ? '当前投药状态:已停用' : '当前投药状态:投放中');
|
|
|
|
|
|
}
|
|
@@ -141,7 +152,7 @@ const onUpdateTab = (index) => {
|
|
|
handleMedicateAmount();
|
|
|
}
|
|
|
|
|
|
-const getTotalNum = () => {
|
|
|
+function getTotalNum() {
|
|
|
const {
|
|
|
hycXsyOne = 0, hycXsyTwo = 0,
|
|
|
qycAdOne = 0, qycAdTwo = 0,
|
|
@@ -165,7 +176,7 @@ const getTotalNum = () => {
|
|
|
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 ];
|
|
|
+ return [ r1, r2, rOne2, rTwo2 ];
|
|
|
}
|
|
|
|
|
|
const onConfirmUpdate = async () => {
|
|
@@ -177,14 +188,22 @@ const onConfirmUpdate = async () => {
|
|
|
isVisibleUpdateInfo.value = false;
|
|
|
|
|
|
message.success("系统加药量,更新成功");
|
|
|
+
|
|
|
+ if ( tabActiveKey === 'onePool' ) {
|
|
|
+ resultNumberSet.value.doseNum1 = resultNumberSet.value.updateNum1;
|
|
|
+ } else {
|
|
|
+ resultNumberSet.value.doseNum2 = resultNumberSet.value.updateNum2;
|
|
|
+ }
|
|
|
|
|
|
- doseNum.value = updateNum.value;
|
|
|
+ // doseNum.value = updateNum.value;
|
|
|
}
|
|
|
|
|
|
// 更新投药结果
|
|
|
const handleMedicateAmount = () => {
|
|
|
const type = tabActiveKey.value;
|
|
|
- const lastNum = unref(updateNum);
|
|
|
+ // const lastNum = unref(updateNum);
|
|
|
+ const { updateNum1, updateNum2 } = unref(resultNumberSet);
|
|
|
+
|
|
|
const tdb = tdbNum.value;
|
|
|
|
|
|
if ( type === 'worker' ) {
|
|
@@ -204,25 +223,28 @@ const handleMedicateAmount = () => {
|
|
|
const [r1, r2] = getTotalNum();
|
|
|
const maxR = Math.max( r1, r2 );
|
|
|
|
|
|
- if ( type === 'auto' && maxR !== lastNum) {
|
|
|
- updateNum.value = maxR;
|
|
|
+ if ( type === 'auto' && maxR !== updateNum1) {
|
|
|
+ resultNumberSet.value.updateNum = maxR;
|
|
|
isVisibleUpdateInfo.value = true;
|
|
|
baseSourceParams.value.tdb = tdb;
|
|
|
message.warning("有新的投放方案, 请查看");
|
|
|
}
|
|
|
-
|
|
|
- if ( type === 'onePool' && r1 != lastNum) {
|
|
|
- updateNum.value = r1;
|
|
|
+ console.log( "r1", r1 );
|
|
|
+ if ( type === 'onePool' && r1 != updateNum1) {
|
|
|
+ console.log( "r1", r1 );
|
|
|
+ resultNumberSet.value.updateNum1 = r1;
|
|
|
+ // updateNum.value = r1;
|
|
|
isVisibleUpdateInfo.value = true;
|
|
|
baseSourceParams.value.tdb = tdb;
|
|
|
- message.warning("有新的投放方案, 请查看");
|
|
|
+ message.warning("1#有新的投放方案, 请查看");
|
|
|
}
|
|
|
|
|
|
- if ( type === 'twoPool' && r2 != lastNum ) {
|
|
|
- updateNum.value = r2;
|
|
|
+ if ( type === 'twoPool' && r2 != updateNum2 ) {
|
|
|
+ resultNumberSet.value.updateNum2 = r2;
|
|
|
+ // updateNum.value = r2;
|
|
|
isVisibleUpdateInfo.value = true;
|
|
|
baseSourceParams.value.tdb = tdb;
|
|
|
- message.warning("有新的投放方案, 请查看");
|
|
|
+ message.warning("1#有新的投放方案, 请查看");
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -234,27 +256,35 @@ onMounted(async () => {
|
|
|
numberBeng = 0, type = 0,
|
|
|
htfksd, jzxs, xzxs, kzxs, slfpxs, tydl, zhxs, sxps, yymd, zxqdll,
|
|
|
medicineAmount,
|
|
|
- addType,
|
|
|
- tytjTransientLL
|
|
|
+ tytjTransientLL,
|
|
|
+ tytjTransientLLOne,
|
|
|
+ tytjTransientLLTwo
|
|
|
} = data;
|
|
|
|
|
|
baseSourceParams.value = {
|
|
|
...baseSourceParams.value,
|
|
|
numberBeng, type,
|
|
|
- htfksd, jzxs, xzxs, kzxs, slfpxs, tydl, zhxs, sxps, yymd, zxqdll,
|
|
|
- addType
|
|
|
+ htfksd, jzxs, xzxs, kzxs, slfpxs, tydl, zhxs, sxps, yymd, zxqdll
|
|
|
};
|
|
|
|
|
|
- updateNum.value = medicineAmount;
|
|
|
+ resultNumberSet.value = {
|
|
|
+ updateNum1: medicineAmount,
|
|
|
+ updateNum2: medicineAmount,
|
|
|
+ flowNum1: tytjTransientLLOne,
|
|
|
+ flowNum2: tytjTransientLLTwo,
|
|
|
+ doseNum1: medicineAmount,
|
|
|
+ doseNum2: medicineAmount,
|
|
|
+ }
|
|
|
+
|
|
|
+ // updateNum.value = medicineAmount;
|
|
|
|
|
|
- doseNum.value = medicineAmount;
|
|
|
+ // doseNum.value = medicineAmount;
|
|
|
|
|
|
- flowNum.value = tytjTransientLL;
|
|
|
+ // flowNum.value = tytjTransientLL;
|
|
|
|
|
|
dataSourceParams.value[tabActiveKey.value] = data;
|
|
|
|
|
|
})
|
|
|
-
|
|
|
|
|
|
// 获取实时数据
|
|
|
controlApi.getNumValue().then(({ data }) => {
|
|
@@ -304,7 +334,7 @@ onMounted(async () => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- // 获取是否允许投药开关
|
|
|
+ // 获取是否允许投药开关 - 锡林浩特
|
|
|
controlApi.getSystemStatus().then(({ data }) => {
|
|
|
// 0不允许 1允许
|
|
|
systemStatus.value = data;
|
|
@@ -329,7 +359,8 @@ onMounted(async () => {
|
|
|
|
|
|
<BaseCard title="投加运行方式">
|
|
|
<span class="status-bar">
|
|
|
- <i>{{ baseSourceParams.addType === 0 ? '启用智适应碳源投加' : '手动碳源投加' }}</i>
|
|
|
+
|
|
|
+ <i>{{ systemStatus === 1 ? '启用智适应碳源投加' : '停用智适应碳源投加' }}</i>
|
|
|
</span>
|
|
|
</BaseCard>
|
|
|
|
|
@@ -668,7 +699,7 @@ onMounted(async () => {
|
|
|
:updateNum="updateNum"
|
|
|
:flowNum="flowNum"
|
|
|
:doseNum="doseNum"
|
|
|
- :configuration-status="baseSourceParams.addType"
|
|
|
+ :nums="resultNumberSet"
|
|
|
v-model:system="systemStatus"
|
|
|
v-model="isVisibleUpdateInfo"
|
|
|
@on-click="onFinalResult"
|