Sfoglia il codice sorgente

feat(水肥一体机): 新增运行模式切换功能并优化界面交互

refactor(自动设置): 重构配方选择逻辑并添加实时保存功能

fix(定时设置): 修复时间显示格式问题

style(组件): 调整多个组件的内边距和背景颜色

perf(配方设置): 优化配方编辑功能并添加输入验证

chore: 添加多个新的图标资源文件
allen 2 settimane fa
parent
commit
90b7df145e

BIN
pages/cb/shuifeizsFirst/assets/media-pause-fill.png


BIN
pages/cb/shuifeizsFirst/assets/media-pause.png


BIN
pages/cb/shuifeizsFirst/assets/media-play-fill.png


BIN
pages/cb/shuifeizsFirst/assets/media-play.png


BIN
pages/cb/shuifeizsFirst/assets/rain.png


BIN
pages/cb/shuifeizsFirst/assets/stop-fill.png


BIN
pages/cb/shuifeizsFirst/assets/stop.png


+ 112 - 24
pages/cb/shuifeizsFirst/autoSetting.vue

@@ -60,7 +60,7 @@
         <view class="setting-item">
           <text class="setting-label">轮灌次数</text>
           <view class="number-input">
-            <u-number-box v-model="IrrCnt" placeholder="请输入轮灌次数" min="1" max="9999999" @change="irrChange(IrrCnt)"></u-number-box>
+            <u-number-box v-model="IrrCnt" placeholder="请输入轮灌次数" min="1" max="9999999" @minus="irrChange(IrrCnt)" @plus="irrChange(IrrCnt)"></u-number-box>
           </view>
         </view>
 
@@ -91,7 +91,7 @@
           </view>
         </view>
       </view>
-      <u-picker :show="show" :columns="columns"></u-picker>
+      <u-picker v-model="show" mode="selector" :range="selector" range-key="label" @confirm="confirmHandler"></u-picker>
       <!-- 定时轮灌组 -->
       <view class="round-groups-section">
         <text class="section-title">定时轮灌组</text>
@@ -120,7 +120,7 @@
               <view class="group-settings">
                 <view class="setting-row">
                   <text class="setting-row-label">施肥配方</text>
-                  <view @click="selectFormula(index)" class="select-group">选择配方</view>
+                  <view @click="selectFormula(index)" class="select-group">{{ getTitle(item) }}</view>
                 </view>
                 <view class="setting-row">
                   <text class="setting-row-label">灌溉时长</text>
@@ -161,35 +161,102 @@
 export default {
   data() {
     return {
-      show: true,
+      show: false,
       devBid:'',
-      columns: [ ['中国', '美国', '日本']],
+      title: '选择配方',
+      selector: [],
       selectedGroup: 0,
-      // 1组设置
-      irrigationTime1: 0,
-      fertilizationTime1: 0,
-      // 2组设置
-      irrigationTime2: 0,
-      fertilizationTime2: 0,
       FertType: -1,
       FertPidType: -1,
       IrrCnt: 0,
       IdleTim: 0,
       FrontClearWater: 0,
       UnderClearWater: 0,
-      group_list:[]
+      group_list:[],
+      currentIndex: -1,
     };
   },
   
-  onLoad(options) {
+  async onLoad(options) {
     const { devBid } = options;
     this.devBid = devBid;
-    this.getConfigInfo();
+    await this.getInfoList();
+    await this.getConfigInfo();
   },
   methods: {
-    /*
-    FertType = '1' && editGroup({FertType: '1'})
-    */
+    async refresh(){
+      const params = {
+        devBid: this.devBid,
+      };
+      await this.$myRequest({
+        url:'/api/v2/iot/device/sf/refresh/',
+        method:'POST',
+        data: params,
+        header: {
+          'Content-Type': 'application/json',
+          'accept': 'application/json, text/plain, */*'
+        }
+      })
+    },
+    getTitle(item){
+      let value = '';
+      if(item.labelText){
+        return item.labelText;
+      }
+      for(let key in item){
+        if(key.includes('Formula')){
+          value = item[key];
+          break;
+        }
+      }
+      for(let i = 0;i< this.selector.length;i++){
+        const item = this.selector[i];
+        if(item.Formula == value){
+          return item.label;
+        }
+      }
+      return '选择配方';
+    },
+   confirmHandler(e){
+    const currentItem = this.selector[e];
+    const Formula = currentItem.Formula;
+    const item = this.group_list[this.currentIndex];
+    item.labelText = currentItem.label;
+    if(item.selected){
+      let keyLabel = '';
+      for(let key in item){
+        if(key.includes('Formula')){
+          keyLabel = key
+          break;
+        }
+      }
+      const params = {
+        [keyLabel]: Formula,
+        group_value: 1,
+      }
+      this.editGroupList(params);
+    }
+   },
+   async getInfoList(){
+      this.recipeList = [];
+      const params = {
+        devBid: this.devBid
+      }
+      const res = await this.$myRequest({
+        url:'/api/v2/iot/device/sf/yunshang/peifang/list/',
+        method:'POST',
+        data: params,
+        header: {
+          'Content-Type': 'application/json',
+          'accept': 'application/json, text/plain, */*'
+        }
+      })
+      const list = res?.data || [];
+      list.forEach((item,index)=>{
+        item.label = '配方' + (index + 1);
+      })
+      this.selector = list;
+    },
     selectFertType(type){
       this.FertType = type;
       this.editGroup({
@@ -207,14 +274,13 @@ export default {
       this.editGroup({UnderClearWater: val});
     },
     PartTimChange(item){
-      console.log(item,'itemitmeimteimte')
       if(item.selected){
-        this.editGroup({group_value: item.group_value, PartTim: item.PartTim});
+        this.editGroupList({group_value: item.group_value, PartTim: item.PartTim});
       }
     },
     FertTimChange(item){
       if(item.selected){
-        this.editGroup({group_value: item.group_value, FertTim: item.FertTim});
+        this.editGroupList({group_value: item.group_value, FertTim: item.FertTim});
       }
     },
     frontChange(val){
@@ -231,15 +297,36 @@ export default {
     },
     selectFormula(index){
       this.show = true;
-      console.log(index,'indexnidex')
+      this.currentIndex = index;
+    },
+    async editGroupList(data){
+      const params = {
+        devBid: parseInt(this.devBid),
+        data,
+      }
+      const res = await this.$myRequest({
+        url:'/api/v2/iot/device/sf/yunshang/auto/group/edit/',
+        method:'POST',
+        data: params,
+        header: {
+          'Content-Type': 'application/json',
+          'accept': 'application/json, text/plain, */*'
+        }
+      })
+      console.log(res,'resres')
+      if(res?.code === '000000'){
+        uni.showToast({
+          title: '保存成功',
+          icon: 'success',
+        })
+        this.refresh();
+      }
     },
     async editGroup(data){
-      console.log('editGroup data:', data);
       const params = {
         devBid: parseInt(this.devBid),
         data,
       }
-      console.log('editGroup params:', params);
       const res = await this.$myRequest({
         url:'/api/v2/iot/device/sf/yunshang/auto/config/edit/',
         method:'POST',
@@ -254,6 +341,7 @@ export default {
           title: '保存成功',
           icon: 'success',
         })
+        this.refresh();
       }
     },
     async getConfigInfo(){
@@ -291,7 +379,7 @@ export default {
     },
     changeGroupStatus(item) {
       item.selected = !item.selected;
-      this.editGroup({group_value: item.group_value});
+      this.editGroupList({group_value: item.group_value});
     },
     selectGroup(index) {
       this.selectedGroup = index;

+ 0 - 2
pages/cb/shuifeizsFirst/components/base.vue

@@ -28,9 +28,7 @@ export default {
   display: flex;
   flex-direction: column;
   align-items: center;
-  width: calc(100% - 64rpx);
   padding: 16rpx 0;
-  margin: 0 32rpx;
   justify-content: space-between;
   border-radius: 16rpx;
   background: linear-gradient(180deg, #edfbfb 0%, #d2f2ed 100%);

+ 1 - 1
pages/cb/shuifeizsFirst/components/facilitystate.vue

@@ -233,7 +233,7 @@ export default {
 </script>
 <style scoped lang="scss">
 .facilitystate-container {
-  padding: 16rpx 32rpx;
+  padding: 16rpx 0rpx;
   justify-content: space-between;
   border-radius: 16rpx;
   position: relative;

+ 1 - 1
pages/cb/shuifeizsFirst/components/irrigatedArea.vue

@@ -66,7 +66,7 @@ export default {
       justify-content: space-between;
       align-items: center;
       padding: 10px;
-      background: #f5f7fa;
+      background: #F5F6FA;
       margin-bottom: 8rpx;
       .irrigated-area-item-title {
         width: 120rpx;

+ 153 - 60
pages/cb/shuifeizsFirst/formulaSetting.vue

@@ -9,37 +9,60 @@
       <!-- 配方列表 -->
       <view class="formula-list">
         <!-- 配方1 -->
-        <view class="formula-item" v-for="(item,index) in formulas" :key="item.id">
+        <view class="formula-item" v-for="(recipe,index) in recipeList" :key="recipe.id">
           <view class="formula-header">
-            <text class="formula-name">配方{{index+1}}</text>
+            <text class="formula-name">配方{{index + 1}}</text>
           </view>
           <view class="formula-details">
             <view class="detail-row">
               <text class="detail-label">目标EC</text>
               <view class="detail-value">
-                <u-input v-model="item.ec" type="number" placeholder="请输入EC值" class="input"/>
+                <input
+                  v-model="recipe.ec"
+                  type="number"
+                  placeholder="请输入EC值"
+                  class="input"
+                  @blur="(e)=>peifangEditHandle(index, -1, 'ec', e.detail.value)"
+                />
                 <text class="detail-unit">us/cm</text>
               </view>
             </view>
             <view class="detail-row">
               <text class="detail-label">目标PH</text>
               <view class="detail-value">
-                <u-input v-model="item.ph" type="number" placeholder="请输入PH值"  class="input"/>
+                <input
+                  v-model="recipe.ph"
+                  type="number"
+                  placeholder="请输入PH值"
+                  class="input"
+                  @blur="(e)=>peifangEditHandle(index, -1, 'ph', e.detail.value)"
+                />
               </view>
             </view>
             <view class="detail-row">
               <text class="detail-label">目标水肥比</text>
               <view class="detail-value">
-                <u-input v-model="item.waterFertilizerRatio" type="number" placeholder="请输入水肥比值"  class="input"/>
+                <input
+                  v-model="recipe.wfratio"
+                  type="number"
+                  placeholder="请输入水肥比值"
+                  class="input" 
+                  @blur="(e)=>peifangEditHandle(index, -1, 'wfratio', e.detail.value)"
+                />
               </view>
             </view>
             <view class="detail-row">
               <text class="detail-label">吸肥通道比例</text>
               <view class="detail-value">
-                <u-input v-model="item.channelRatio" type="number" placeholder="请输入吸肥通道比例值"  class="input1"/>
-                <u-input v-model="item.channelRatio" type="number" placeholder="请输入吸肥通道比例值"  class="input2"/>
-                <u-input v-model="item.channelRatio" type="number" placeholder="请输入吸肥通道比例值"  class="input3"/>
-                <u-input v-model="item.channelRatio" type="number" placeholder="请输入吸肥通道比例值"  class="input4"/>
+                <input
+                  v-model="channel.percentage"
+                  type="number"
+                  placeholder="请输入吸肥通道比例值"
+                  class="input1"
+                  v-for="(channel,channelIndex) in recipe.channels"
+                  :key="channelIndex"
+                  @blur="(e)=>peifangEditHandle(index, channelIndex, 'fertratio', e.detail.value)"
+                />
                 <text class="detail-unit">%</text>
               </view>
             </view>
@@ -55,50 +78,134 @@ export default {
   data() {
     return {
       title: '配方设置',
-      // 配方列表
-      formulas: [
-        { id: 1, name: '配方1', ec: 0, ph: 0, waterFertilizerRatio: 1, channelRatio: 0 },
-        { id: 2, name: '配方2', ec: 0, ph: 0, waterFertilizerRatio: 1, channelRatio: 0 },
-        { id: 3, name: '配方3', ec: 0, ph: 0, waterFertilizerRatio: 1, channelRatio: 0 },
-        { id: 4, name: '配方4', ec: 0, ph: 0, waterFertilizerRatio: 1, channelRatio: 0 },
-        { id: 5, name: '配方5', ec: 0, ph: 0, waterFertilizerRatio: 1, channelRatio: 0 },
-        { id: 6, name: '配方6', ec: 0, ph: 0, waterFertilizerRatio: 1, channelRatio: 0 },
-        { id: 7, name: '配方7', ec: 0, ph: 0, waterFertilizerRatio: 1, channelRatio: 0 },
-        { id: 8, name: '配方8', ec: 0, ph: 0, waterFertilizerRatio: 1, channelRatio: 0 }
-      ]
+      devBid: '',
+      recipeList: [],
     };
   },
+  onLoad(options) {
+    const { devBid } = options;
+    this.devBid = devBid;
+    this.getInfoList();
+  },
   methods: {
-    // 添加配方
-    addFormula() {
-      const newFormula = {
-        id: this.formulas.length + 1,
-        name: `配方${this.formulas.length + 1}`,
-        ec: 0,
-        ph: 0,
-        waterFertilizerRatio: 1,
-        channelRatio: 0
-      };
-      this.formulas.push(newFormula);
-    },
-    // 删除配方
-    deleteFormula(index) {
-      if (this.formulas.length <= 1) {
+    async peifangEditHandle(index, channelIndex, type, value) {
+      // 判断value 是否是数字
+      if (isNaN(value)) {
         uni.showToast({
-          title: '至少保留一个配方',
-          icon: 'none'
-        });
+          title: '请输入数字',
+          icon: 'none',
+        })
         return;
       }
-      uni.showModal({
-        title: '确认删除',
-        content: '确定要删除该配方吗?',
-        success: (res) => {
-          if (res.confirm) {
-            this.formulas.splice(index, 1);
-          }
+      let key = '';
+      if (type == 'fertratio') {
+        // 4个加一起不能超过100
+        const sum = this.recipeList[index].channels.reduce(
+          (acc, cur) => Number(acc) + Number(cur.percentage),
+          0
+        );
+        if (sum > 100) {
+        uni.showToast({
+          title: '吸肥通道比例加起来不能超过100',
+          icon: 'none',
+        })
+          // 如果超过了100,恢复原来的值
+          this.recipeList[index].channels[channelIndex].percentage = +value;
+          return;
+        }
+      }
+      if (channelIndex == -1) {
+        key = `ValveFormula:VF0${index}:${type}`;
+      } else {
+        key = `ValveFormula:VF0${index}:${type}${channelIndex}`;
+      }
+      const peifang = {
+        [key]: +value
+      };
+      const params = {
+        devBid: Number(this.devBid),
+        peifang: peifang
+      }
+      const res = await this.$myRequest({
+        url:'/api/v2/iot/device/sf/yunshang/peifang/edit/',
+        method:'POST',
+        data: params,
+        header: {
+          'Content-Type': 'application/json',
+          'accept': 'application/json, text/plain, */*'
+        }
+      })
+      const resData = res
+      console.log(resData,'resDataresData')
+      if (resData.code === '000000') {
+        uni.showToast({
+          title: '配方保存成功',
+          icon: 'success',
+        })
+      } else {
+        uni.showToast({
+          title: '配方保存失败',
+          icon: 'none',
+        })
+      }
+    },
+    async getInfoList(){
+      this.recipeList = [];
+      const params = {
+        devBid: this.devBid
+      }
+      const res = await this.$myRequest({
+        url:'/api/v2/iot/device/sf/yunshang/peifang/list/',
+        method:'POST',
+        data: params,
+        header: {
+          'Content-Type': 'application/json',
+          'accept': 'application/json, text/plain, */*'
         }
-      });
+      })
+      const resData = res.data || [];
+      for (let i = 0; i < resData.length; i++) {
+        const item = resData[i];
+        const recipe = {
+          ec: item[`ValveFormula:VF0${i}:ec`],
+          ph: item[`ValveFormula:VF0${i}:ph`],
+          wfratio: item[`ValveFormula:VF0${i}:wfratio`],
+          channels: []
+        };
+        if (
+          item[`ValveFormula:VF0${i}:fertratio0`] !== null &&
+          item[`ValveFormula:VF0${i}:fertratio0`] !== undefined
+        ) {
+          recipe.channels.push({
+            percentage: item[`ValveFormula:VF0${i}:fertratio0`]
+          });
+        }
+        if (
+          item[`ValveFormula:VF0${i}:fertratio1`] !== null &&
+          item[`ValveFormula:VF0${i}:fertratio1`] !== undefined
+        ) {
+          recipe.channels.push({
+            percentage: item[`ValveFormula:VF0${i}:fertratio1`]
+          });
+        }
+        if (
+          item[`ValveFormula:VF0${i}:fertratio2`] !== null &&
+          item[`ValveFormula:VF0${i}:fertratio2`] !== undefined
+        ) {
+          recipe.channels.push({
+            percentage: item[`ValveFormula:VF0${i}:fertratio2`]
+          });
+        }
+        if (
+          item[`ValveFormula:VF0${i}:fertratio3`] !== null &&
+          item[`ValveFormula:VF0${i}:fertratio3`] !== undefined
+        ) {
+          recipe.channels.push({
+            percentage: item[`ValveFormula:VF0${i}:fertratio3`]
+          });
+        }
+        this.recipeList.push(recipe);
+      }
     },
     // 确认按钮点击事件
     confirm() {
@@ -123,26 +230,12 @@ export default {
   width: 100%;
   height: 80rpx;
   text-align:right;
-  display:flex;
-  align-items: center;
   color:#020305;
 }
 .input1{
   width: 25%;
   color:#020305;
 }
-.input2{
-  width: 25%;
-  color:#020305;
-}
-.input3{
-  width: 25%;
-  color:#020305;
-}
-.input4{
-  width: 25%;
-  color:#020305;
-}
 /* 顶部导航栏 */
 .nav-bar {
   display: flex;

+ 278 - 15
pages/cb/shuifeizsFirst/shuifeizs.vue

@@ -23,20 +23,63 @@
         <view class="facilitystate-top__item-text">{{ item.title }}</view>
       </view>
     </view>
-    <Base :dataList="dataList" />
-    <facilitystate
-      :devBid="devBid"
-      :ggbCurrent="ggbCurrent"
-      :sfbCurrent="sfbCurrent"
-      :irrigatedAreaList="irrigatedAreaList"
-      :webSockedData="webSockedData"
-      :alreadyfertilizerBucketList="alreadyfertilizerBucketList"
-    />
+    <view class="irrMode">
+      <view class="irrMode__header">
+        <view @click="changeMode('1')" :class="workStatus == '1' ? 'active' : ''">施肥模式</view>
+        <view @click="changeMode('0')" :class="workStatus == '0' ? 'active' : ''">灌溉模式</view>
+      </view>
+      <view class="irrMode__content">
+        <view class="irrMode__content-header">
+          <view class="irrMode__content-header-list" v-if="runTitle">
+            <view class="irrMode__content-header-title">
+              <image class="header-item-icon" :src="rain" />
+              {{ runTitle }}
+            </view>
+          </view>
+          <view class="irrMode__content-item">
+            <view class="irrMode__content-item-raduis" :class="runStatus == '1' ? 'active-radius' : ''" @click="changeActive('1')">
+              <image class="item-icon" :src="runStatus=='1'?mediaPlayFill:mediaPlay" />
+              <view class="item-text">启动</view>
+            </view>
+            <view class="irrMode__content-item-raduis" :class="runStatus == '2' ? 'active-radius' : ''" @click="changeActive('2')">
+              <image class="item-icon" :src="runStatus=='2'?mediaPauseFill:mediaPause" />
+              <view class="item-text">暂停</view>
+            </view>
+            <view class="irrMode__content-item-raduis" :class="runStatus == '0' ? 'active-radius' : ''" @click="changeActive('0')" style="margin-right:0">
+              <image class="item-icon" :src="runStatus=='0'?stopFill:stop" />
+              <view class="item-text">停止</view>
+            </view>
+          </view>
+        </view>
+        <view class="irr-run-list">
+          <text v-for="(item, index) in selectAreaList" :key="index">
+            {{ item.group_name }}
+            <text v-if="index != selectAreaList.length - 1">、</text>
+          </text>
+        </view>
+      </view>
+      <Base :dataList="dataList" />
+      <facilitystate
+        :devBid="devBid"
+        :ggbCurrent="ggbCurrent"
+        :sfbCurrent="sfbCurrent"
+        :irrigatedAreaList="irrigatedAreaList"
+        :webSockedData="webSockedData"
+        :alreadyfertilizerBucketList="alreadyfertilizerBucketList"
+      />
+    </view>
   </view>
 </template>
 
 <script>
 import manualControl from './assets/manualControl.png';
+import mediaPause from './assets/media-pause.png';
+import mediaPauseFill from './assets/media-pause-fill.png';
+import mediaPlay from './assets/media-play.png';
+import mediaPlayFill from './assets/media-play-fill.png';
+import rain from './assets/rain.png';
+import stop from './assets/stop.png';
+import stopFill from './assets/stop-fill.png';
 import wheelIrrigation from './assets/wheelIrrigation.png';
 import time from './assets/timing.png';
 import formulaSetting from './assets/formulaSetting.png';
@@ -47,6 +90,7 @@ export default {
   data() {
     return {
       ws: null,
+      currentMode: '1',
       title: '水肥一体机',
       manualControl,
       devBid: '',
@@ -55,6 +99,13 @@ export default {
       dataList: [],
       irrigatedAreaList: [],
       alreadyfertilizerBucketList: [],
+      mediaPause,
+      mediaPauseFill,
+      mediaPlay,
+      mediaPlayFill,
+      rain,
+      stop,
+      stopFill,
       deviceList: [
         {
           icon: manualControl,
@@ -93,6 +144,12 @@ export default {
       dataArray:[],
       webSockedData: {},
       reconnectCount: 0,
+      isActive: '0',
+      runStatus: -1,
+      workStatus: -1,
+      clearIrr: {},
+      selectAreaList: [],
+      runTitle: '',
     };
   },
   components: {
@@ -129,6 +186,72 @@ export default {
     this.ws.close();
   },
   methods: {
+    isAutoRun(childrenList) {
+      for (let i = 0; i < childrenList.length; i++) {
+        const item = childrenList[i];
+        if (item.value === 1) {
+          return true
+        }
+      }
+      return false
+    },
+    async initsfyunshangAutoConfigInfo() {
+      const selectAreaList = [];
+      const res = await this.$myRequest({
+        url:'/api/v2/iot/device/sf/yunshang/auto/config/info/',
+        method:'post',
+        data: {
+          devBid: String(this.devBid),
+        },
+      })
+      const list = res;
+      const group_list = list.group_list || [];
+      group_list.forEach((item) => {
+        if (item.group_value == 1) {
+          selectAreaList.push(item);
+        }
+      });
+      this.selectAreaList = selectAreaList;
+    },
+    async devctlContorl(data){
+      const params = {
+        devBid: Number(this.devBid),
+        data,
+      };
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/devctl/',
+        method: 'post',
+        data:params,
+        header: {
+          'Content-Type': 'application/json',
+        },
+      });
+      uni.showToast({
+        title: res.msg,
+        icon: 'none',
+      });
+    },
+    changeActive(active) {
+      this.runStatus = active;
+      const params = {
+        IrrStatus:active
+      }
+      this.devctlContorl(params);
+    },
+    changeMode(mode) {
+      if(this.runStatus == '1' || this.runStatus == '2'){
+        uni.showToast({
+          title: '请先停止运行',
+          icon: 'none',
+        });
+        return
+      }
+      this.currentMode = mode;
+      const params = {
+        IrrMode:mode
+      }
+      this.devctlContorl(params);
+    },
     initWebSocket() {
       const url = 'wss://things.ysiot.net:18080/api/ws';
       this.ws = uni.connectSocket({
@@ -153,7 +276,7 @@ export default {
           ],
           authCmd: {
             cmdId: 0,
-            token: this.sfToken
+            token: this.sfToken,
           }
         };
         console.log('发送测试参数:', testParams);
@@ -178,7 +301,6 @@ export default {
               this.mergeTwoObject(this.dataArray,this.webSockedData?.data);
               this.initData(this.dataArray);
             }
-            // this.$refs.facilRightItem && this.$refs.facilRightItem.init();
         } catch (e) {
           console.error('WebSocket 消息解析失败', e);
         }
@@ -252,6 +374,7 @@ export default {
       this.getdeviceSfStatus();
       await this.getpeifangRefresh();
       this.getsfrhinfo();
+      this.initsfyunshangAutoConfigInfo();
       await this.getRunStatus();
     },
     async getpeifangRefresh() {
@@ -275,10 +398,8 @@ export default {
 
       if (data == '{}') {
         this.isRun = true;
-        // this.deviceList[1].url = `/pages/cb/shuifeizsFirst/automation?devBid=${this.devBid}&devName=${this.devName}&devStatus=${this.devStatus}`;
       } else {
         this.isRun = false;
-        // this.deviceList[1].url = `/pages/cb/shuifeizsFirst/rotationflow?devBid=${this.devBid}&devName=${this.devName}&devStatus=${this.devStatus}`;
       }
     },
     initData(res){
@@ -296,8 +417,26 @@ export default {
           this.dataList.push(item);
         } else if (item.sfType === '7') {
           this.irrigatedAreaList.push(item);
+        } else if (item.sfType === '9') {
+          if (item.sfCode === 'IrrStatus') {
+            this.runStatus = item.value;
+          } else if (item.sfCode === 'IrrMode') {
+            this.workStatus = item.value;
+          } else if (item.sfCode === 'WaterFlowSum:Value') {
+            this.clearIrr = item;
+          }
         }
       });
+      this.runTitle = '';
+      if(this.runStatus == '1'){
+      this.irrigatedAreaList.forEach((item) => {
+        if (this.isAutoRun(item.childrenList)) {
+          this.runTitle += item.sfDisplayname;
+        }
+      });
+      }else{
+        this.runTitle = '';
+      }
     },
     async getdeviceSfStatus() {
       const res = await this.$myRequest({
@@ -311,6 +450,15 @@ export default {
       this.initData(this.dataArray);
     },
     nativeTo(item) {
+      if(item.className == 'manualControl'){
+        if(this.runStatus == '1' || this.runStatus == '2'){
+          uni.showToast({
+            title: '请先停止运行',
+            icon: 'none',
+          });
+          return
+        }
+      }
       uni.navigateTo({
         url: item.url,
       });
@@ -323,6 +471,122 @@ uni-page-body {
   position: relative;
   height: 100%;
 }
+.irrMode{
+  margin-top: 30rpx;
+  border-radius: 32rpx 32rpx 0 0;
+  background: linear-gradient(180deg, #edfbfb 0%, #d2f2ed 100%);
+  margin-bottom: 30rpx;
+  padding: 32rpx;
+  border: 3rpx solid #FFF;
+  .irrMode__header{
+    display: flex;
+    width:320rpx;
+    padding:0 10rpx;
+    align-items: center;
+    background: #ffffff;
+    border-radius: 12rpx;
+    margin-bottom: 24rpx;
+    font-family: "Source Han Sans CN VF";
+    font-size: 28rpx;
+    font-style: normal;
+    font-weight: 400;
+    line-height: normal;
+    color:#999999;
+    height: 68rpx;
+    line-height: 68rpx;
+    view{
+      width: 160rpx;
+      text-align: center;
+    }
+  }
+  .active{
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border-radius: 8rpx;
+    color: #ffffff;
+    background: #0BBC58; 
+    height: 56rpx;
+  }
+  .irrMode__content{
+    margin-top: 24rpx;
+    border-radius: 16rpx;
+    padding: 16rpx;
+    background: linear-gradient(180deg, #FFF 0%, #F5F6FA 100%);
+    .irrMode__content-header{
+      width: calc(100% - 32rpx);
+      padding: 16rpx 16rpx 16rpx 16rpx;
+      border-radius: 12rpx;
+      background: linear-gradient(180deg, #BBF1EA 0%, #E6F4F9 100%);
+      .irrMode__content-header-list{
+        display:flex;
+        justify-content: space-between;
+        align-items: center;
+        margin-bottom: 12rpx;
+      }
+      .irrMode__content-header-title{
+        color: #020305;
+        text-align: right;
+        font-family: "Source Han Sans CN VF";
+        font-size: 30rpx;
+        font-weight: 500;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        .header-item-icon{
+          width: 48rpx;
+          height: 48rpx;
+        }
+      }
+      .irrMode__content-header-desc{
+        color: #999999;
+        text-align: right;
+        font-family: "Source Han Sans CN VF";
+        font-size: 28rpx;
+        font-weight: 400;
+      }
+    }
+    .irrMode__content-item{
+      display:flex;
+      align-items: center;
+      justify-content: center;
+      padding: 16rpx 0;
+      border-radius: 12rpx;
+      .irrMode__content-item-raduis{
+        display: flex;
+        height: 88rpx;
+        padding: 0rpx 32rpx;
+        flex-direction: column;
+        justify-content: center;
+        align-items: center;
+        flex: 1 0 0;
+        border-radius: 16rpx;
+        margin-right: 16rpx;
+        border: 2rpx solid #0BBC58;
+        color: #0bbc58;
+        text-align: right;
+        font-family: "Source Han Sans CN VF";
+        font-size: 20rpx;
+        image{
+          width: 48rpx;
+          height: 48rpx;
+        }
+      }
+      .active-radius{
+        background: #0BBC58;
+        color:#ffffff;
+      }
+    }
+    .irr-run-list{
+      padding: 16rpx;
+      font-family: "Source Han Sans CN VF";
+      color: #999999;
+      font-family: "Source Han Sans CN VF";
+      font-size: 24rpx;
+      font-weight: 400;
+    }
+  }
+}
 .online {
   height: 32rpx;
   line-height: 32rpx;
@@ -373,8 +637,7 @@ uni-page-body {
   position: relative;
 }
 .facilitystate-page {
-  background: linear-gradient(180deg, #ffffff00 0%, #fff 23.64%, #fff 100%),
-    linear-gradient(102deg, #bfeadd 6.77%, #b8f1e7 40.15%, #b9eef5 84.02%);
+  background: linear-gradient(180deg, #f5f6fa00 0%, #F5F6FA 23.46%, #FFF 25.24%, #FFF 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
   height: 100%;
   width: 100%;
   overflow-x: hidden;

+ 1 - 2
pages/cb/shuifeizsFirst/timingSetting.vue

@@ -48,7 +48,6 @@
             <text class="radio-text">每天一次</text>
           </view>
         </view>
-
         <!-- 时间选择器 -->
         <picker
           mode="time"
@@ -120,7 +119,7 @@ export default {
         const minute = time.slice(2, 4);
         item.enabled = item[`Timer0${i}:TimerEn`] == 1;
         item.frequency = item[`Timer0${i}:Mode`] == 1 ? 'daily' : 'once';
-        item.time = new Date(hour, minute);
+        item.time = hour + ':' + minute;
         item.timeLabel = hour + ':' + minute;
       }
       this.timerList = resData;