Răsfoiți Sursa

feat: 碳源投加修改, cod增加气浮计算, 池组更新, 后反馈设定+1, 反硝化报警

sunxiao 4 luni în urmă
părinte
comite
a7db9af7b0

+ 7 - 2
src/api/control.js

@@ -54,18 +54,23 @@ export const controlApi = {
   /**
    * 获取最大最小值配置
    */
-  getMinMaxVal: () => http.get(`front/bigModel/smartAdd/addConfigDetail`),
+  getMinMaxVal: () => http.get(`/front/bigModel/smartAdd/addConfigDetail`),
   
     /**
    * 更新最大最小值配置
    */
-  putMinMaxVal: (data) => http.put(`front/bigModel/smartAdd/updateConfig`, data),
+  putMinMaxVal: (data) => http.put(`/front/bigModel/smartAdd/updateConfig`, data),
 
   /**
    * 碳源投加 获取echart记录 - 数据看板 - 新
    */
   getAllEchartData: (params) => http.get(`/front/bigModel/smartAdd/charListAll`, { params }),
   
+  /**
+   * 更新选择池组手自动方式
+   */
+  updateSelectStatus: (data) => http.put(`/front/bigModel/smartAdd/updateAddTypeStatus`, data),
+    
 
   // 预测相关 - 新增
 

+ 19 - 13
src/views/control/MedicinalView.vue

@@ -13,7 +13,6 @@ import TheEchartPanel from './components/TheEchartPanel.vue';
 const warningList = ref([]);
 const notification = useNotification()
 const message = useMessage();
-const isVisibleBtn = ref(true);
 const isVisibleUpdateInfo = ref(false);
 const zuTaiStatus = ref({});
 const minAndMaxValue = ref({});
@@ -139,6 +138,10 @@ const transformData = (list) => {
 
 // 编辑系数 - confirm
 const onEditConfirm = (source) => {
+  const { htfksdOne, htfksdTwo } = dataSourceParams.value;
+  
+  minAndMaxValue.value['hycxsygkz' + source] = source === 'One' ? htfksdOne + 1 : htfksdTwo + 1;
+
   setting.value['isVisibleBtn' + source] = true;
 
   transformData(southColumnData.value);
@@ -316,7 +319,7 @@ const isEmpty = (val) => {
 }
 
 const waringTips = () => {
-  const { kzmbplbjz, hycxsygkz, xhycbjz, jylpybjz, minAddAmount } = minAndMaxValue.value;
+  const { kzmbplbjz, hycxsygkzOne, hycxsygkzTwo, xhycbjz, jylpybjz, minAddAmount } = minAndMaxValue.value;
 
   const {
     hycXsyOne, htfksdOne, hycXsyTwo, htfksdTwo, 
@@ -364,7 +367,7 @@ const waringTips = () => {
       questionCollect.firstItem.push('西池');
     }
     
-    if ( hycXsyOne > hycxsygkz ) {
+    if ( hycXsyOne > hycxsygkzOne ) {
       questionCollect.secondItem.push('西池');
     }
   }
@@ -373,7 +376,7 @@ const waringTips = () => {
     if ( (hycXsyTwo - htfksdTwo) > kzmbplbjz ) {
       questionCollect.firstItem.push('东池');
     }
-    if ( hycXsyTwo > hycxsygkz ) {
+    if ( hycXsyTwo > hycxsygkzTwo ) {
       questionCollect.secondItem.push('东池');
     }
   }
@@ -390,13 +393,13 @@ const waringTips = () => {
     }
   }
 
-  if ( isEmpty(addDifferenceOne) && isEmpty(jylpybjz) && isEmpty(minAddAmount)) {
+  if ( isEmpty(addDifferenceOne) && isEmpty(jylpybjz) && isEmpty(minAddAmount) && zuTaiStatus.value.activeOne == 1) {
     if (addDifferenceOne > minAddAmount && addDifferenceOne > jylpybjz) {
       result.threeTips.push('西池');
     }
   }
  
-  if ( isEmpty(addDifferenceTwo) && isEmpty(jylpybjz) && isEmpty(minAddAmount)) {
+  if ( isEmpty(addDifferenceTwo) && isEmpty(jylpybjz) && isEmpty(minAddAmount) && zuTaiStatus.value.activeTwo == 1 ) {
     if (addDifferenceTwo > minAddAmount && addDifferenceTwo > jylpybjz) {
       result.threeTips.push('东池');
     }
@@ -407,7 +410,6 @@ const waringTips = () => {
     return qEnum[index] + "(" + value.join(' | ') + ")";
   }).filter(Boolean);
 
-
   warningList.value = Object.entries(result).map(([key, value]) => {
     if ( key === 'oneTips' ) {
       if ( !r.length ) return;
@@ -434,7 +436,8 @@ const waringTips = () => {
   }).filter(Boolean);
 }
 
-const handleAutoSwitchType = (val) => {
+const handleAutoSwitchType = async (val) => {
+  await controlApi.updateSelectStatus({type: Number(val)});
   dataSourceParams.value.type = val;
 }
 
@@ -483,7 +486,8 @@ onMounted(async () => {
       addDifferenceOne,
       addDifferenceTwo,
       // 运行方式
-      type
+      type,
+      
     } = data;
     
     // 0 不可以  组态投放 1 可以   系统投放
@@ -623,7 +627,8 @@ onUnmounted(() => {
                             :btn-group="[
                               { label: '手动', value1: '', value2: '' },
                               { label: '仪表', value1: waterConfigParams.jsCodYB },
-                              { label: '化验', value1: waterConfigParams.jsCodHY }
+                              { label: '化验', value1: waterConfigParams.jsCodHY },
+                              { label: '气浮', value1: waterConfigParams.oneCodQF },
                             ]"></BaseChooseItem>
                           <BaseChooseItem
                             tab-key="south"
@@ -773,7 +778,8 @@ onUnmounted(() => {
                             :btn-group="[
                               { label: '手动', value1: '', value2: '' },
                               { label: '仪表', value1: waterConfigParams.jsCodYB },
-                              { label: '化验', value1: waterConfigParams.jsCodHY }
+                              { label: '化验', value1: waterConfigParams.jsCodHY },
+                              { label: '气浮', value1: waterConfigParams.twoCodQF },
                             ]"></BaseChooseItem>
                           <BaseChooseItem
                             tab-key="south"
@@ -883,9 +889,9 @@ onUnmounted(() => {
           </div>
           <div class="right-section">
             <BaseTitle title="智能投加计算结果" type="second">
-              <!-- <template #right>
+              <template #right>
                 <div class="warning-btn" @click="onSystemWarning" v-show="warningList.length">查看系统警报</div>
-              </template> -->
+              </template>
             </BaseTitle>
             <div class="right-section-content">
               <TheResultPanel

+ 2 - 4
src/views/control/components/TheResultPanel.vue

@@ -1,11 +1,9 @@
 <script setup>
 import { computed, onMounted, ref } from 'vue';
-import { NNumberAnimation, useMessage } from 'naive-ui';
+import { NNumberAnimation } from 'naive-ui';
 import { controlApi } from "@/api/control"
 import { SvgIcon } from '@/components';
 
-const message = useMessage();
-
 const isVisibleBtn = defineModel();
 const systemStatus = ref({});
 const modelSystemStatus = defineModel('system');
@@ -145,7 +143,7 @@ onMounted(() => {
           <span>东池加药量计算:{{ nums.updateNum2 || 0}}L/h,是否更新?</span>
         </li> -->
       </ul>
-      <div class="space-x-[10px]" v-show="isShowUpdateBtnState">
+      <div class="space-x-[10px]">
         <span class="text-[#ed742f] cursor-pointer" @click="emitUpdate">更新投放</span>
         <span class="text-[#88909b] cursor-pointer" @click="isVisibleBtn = false">取消</span>
       </div>

+ 16 - 10
src/views/user/index.vue

@@ -44,12 +44,6 @@ const customRenderData = [
       { key: 'kzmbplbjz', label: '大于设定值触发报警', unit: 'mg/L', min: 0, max: 999999 },
     ]
   },
-  {
-    title: '好氧池硝酸盐管控值',
-    children: [
-      { key: 'hycxsygkz', label: '大于设定值触发报警', unit: 'mg/L', min: 0, max: 999999 },
-    ]
-  },
   {
     title: '硝化异常报警值',
     children: [
@@ -62,7 +56,14 @@ const customRenderData = [
       { key: 'jylpybjz', label: '大于设定值触发报警', unit: 'L/h', min: 0, max: 999999 },
       { key: 'timeVal', label: '偏移量统计时间,建议填写5的倍数值', unit: '分', min: 0, max: 999999, precision: 0 },
     ]
-  }
+  },
+  {
+    title: '好氧池硝酸盐管控值',
+    children: [
+      { key: 'hycxsygkzOne', label: '大于设定值触发报警', unit: 'mg/L', type: 'text' },
+      { key: 'hycxsygkzTwo', label: '大于设定值触发报警', unit: 'mg/L', type: 'text' },
+    ]
+  },
 ]
 
 const formValue = ref({});
@@ -88,12 +89,12 @@ const updateConfig = () => {
     'minJsCod', 'maxJsCod',
     'minAddAmount', 'maxAddAmount',
     'kzmbplbjz',
-    'hycxsygkz',
+    // 'hycxsygkz',
     'xhycbjz',
     'jylpybjz'
   ]
-  
   const result = whitelist.every(key => {
+    console.log( formValue.value,  key );
     const value = formValue.value[key]
     return value !== null && value !== undefined && value !== ''
   })
@@ -136,13 +137,18 @@ onMounted(() => {
               <div class="mb-[16px] text-[#1A2029] text-[14px]" v-for="item in customRenderData" :key="item.title">
                 <h4 class="mb-[8px]">{{ item.title }}</h4>
                 <ul class="flex items-center space-x-[24px]">
-                  <li class="w-[264px]" v-for="val in item.children">
+                  <li class="w-[264px]" v-for="val, index in item.children">
+                    <p v-show="val.type" class="h-[34px] space-x-[2px]">
+                      <span class="text-[15px]">{{index == 0 ? '西池' : '东池'}} {{ formValue[val.key] }}</span>
+                      <span>{{ val.unit }}</span>
+                    </p>
                     <BaseNumberInput
                       v-model:value="formValue[val.key]"
                       :unit="val.unit"
                       :min="val.min"
                       :max="val.max"
                       :precision="val.precision"
+                      v-show="!val.type"
                     ></BaseNumberInput>
                     <span class="text-[#B0B7C0] text-[12px]">{{ val.label }}</span>
                   </li>