liuyuedi 2 лет назад
Родитель
Сommit
4f9f688686

+ 72 - 79
src/views/dataReport/intakeWaterAnalysis.vue

@@ -1,74 +1,67 @@
 <template>
   <el-row class="el-row-container" v-loading="loading">
-    <el-col
-      :span="4"
-      style="height:100%;padding-bottom:32px;"
-    >
-    <el-card style="margin:16px;height: 100%; overflow-y: auto">
-      <data-report-left
-        @setCurrentData="setCurrentData"
-        :treeData="treeData"
-      ></data-report-left>
-    </el-card>
+    <el-col :span="4" style="height: 100%; padding-bottom: 32px">
+      <el-card style="margin: 16px; height: 100%; overflow-y: auto">
+        <data-report-left
+          @setCurrentData="setCurrentData"
+          :treeData="treeData"
+        ></data-report-left>
+      </el-card>
     </el-col>
-    <el-col
-      :span="20"
-      style="padding: 16px 16px 16px 0; height: 100%;"
-    >
-    <el-card style="height: 100%; overflow-y: auto">
-      <el-col :span="24" class="elrow-main__col-top">
-        <div>
-          <el-select
-            v-model="currentYear"
-            style="width: 250px;margin-right: 16px;"
+    <el-col :span="20" style="padding: 16px 16px 16px 0; height: 100%">
+      <el-card style="height: 100%; overflow-y: auto">
+        <el-col :span="24" class="elrow-main__col-top">
+          <div>
+            <el-select
+              v-model="currentYear"
+              style="width: 250px; margin-right: 16px"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            <el-button type="primary" size="small" @click="handleSearch"
+              >查询</el-button
+            >
+          </div>
+          <i
+            class="el-icon-download"
+            @click="downloadHandler"
+            v-hasPermi="['wpr:organization:download']"
+          ></i>
+        </el-col>
+        <el-col :span="24" class="elrow-main__col-bottom">
+          <b-table
+            ref="tableRef"
+            :args="{ 'highlight-current-row': true }"
+            :data="loadData"
+            :columns="columns"
+            isShowIndex
           >
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value">
-            </el-option>
-          </el-select>
-          <el-button
-            type="primary"
-            size="small"
-            @click="handleSearch"
-            >查询</el-button
-          > 
-        </div>
-        <i
-          class="el-icon-download"
-          @click="downloadHandler"
-        ></i>
-      </el-col>
-      <el-col :span="24" class="elrow-main__col-bottom">
-        <b-table
-          ref="tableRef"
-          :args="{ 'highlight-current-row': true }"
-          :data="loadData"
-          :columns="columns"
-          isShowIndex
-        >
-        </b-table>
-      </el-col>
-    </el-card>
+          </b-table>
+        </el-col>
+      </el-card>
     </el-col>
   </el-row>
 </template>
 
 <script>
-import { getAreaList } from '@/api/statistics/index.js'
-import { getTree } from '@/api/tree.js'
+import { getAreaList } from '@/api/statistics/index.js';
+import { getTree } from '@/api/tree.js';
 import BTable from '@/components/Table/index.vue';
-import DataReportLeft from '@/components/DataReportLeft/index.vue'
+import DataReportLeft from '@/components/DataReportLeft/index.vue';
 import { assign, omit } from 'lodash-es';
 
 export default {
-  name:"waterManage",
-  components: { BTable,DataReportLeft},
+  name: 'waterManage',
+  components: { BTable, DataReportLeft },
   data() {
     return {
-      activeName:'first',
+      activeName: 'first',
       currentYear: '',
       loading: false,
       associationManageShow: false,
@@ -127,24 +120,24 @@ export default {
       this.$refs.tableRef.refresh(true);
     },
     async loadData(parameter) {
-      this.setYear()
+      this.setYear();
       if (!this.currentClickId) {
-        const treeList = this.$store.state.tree.treeList
-        let res = []
+        const treeList = this.$store.state.tree.treeList;
+        let res = [];
         if (treeList.code === '000000') {
-          res = treeList
-        } else { 
-          res = await getTree()
-          this.$store.dispatch('tree/setTree',res)
+          res = treeList;
+        } else {
+          res = await getTree();
+          this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data
-        this.currentClick = res?.data[0]
-        this.currentClickId = this.currentClick?.cusareaId
+        this.treeData = res?.data;
+        this.currentClick = res?.data[0];
+        this.currentClickId = this.currentClick?.cusareaId;
       }
       const params = {
         areaId: this.currentClickId,
         year: this.currentYear
-      }
+      };
       const payload = omit(assign({}, parameter, params), []);
       return getAreaList(payload);
     },
@@ -158,27 +151,27 @@ export default {
       );
     },
     setYear() {
-      this.options = []
-      let date = new Date
-      let currentYear = date.getFullYear()
-      this.currentYear = currentYear
+      this.options = [];
+      let date = new Date();
+      let currentYear = date.getFullYear();
+      this.currentYear = currentYear;
       for (let i = 0; i < 5; i++) {
         this.options.push({
           label: currentYear - i,
           value: currentYear - i
-        })  
+        });
       }
     },
-   setCurrentData(areaId) {
-      this.currentClickId = areaId
+    setCurrentData(areaId) {
+      this.currentClickId = areaId;
       this.$refs.tableRef.refresh(false);
-    },
+    }
   }
 };
 </script>
 
 <style lang="scss" scoped>
-.el-row-container{
+.el-row-container {
   height: 100%;
 }
 .elrow-main__col-top {
@@ -197,9 +190,9 @@ export default {
       margin-right: 5px;
     }
   }
-  .el-icon-download{
-    font-size:26px;
-    color:#14A478;
+  .el-icon-download {
+    font-size: 26px;
+    color: #14a478;
     cursor: pointer;
   }
 }

+ 1 - 0
src/views/dataReport/waterConsumption.vue

@@ -26,6 +26,7 @@
             <i
               class="el-icon-download"
               @click="downloadHandler"
+               v-hasPermi="['wpr:well:download']"
             ></i>
           </div>
         </el-col>

+ 98 - 77
src/views/infrastructure/deviceSetup.vue

@@ -1,20 +1,14 @@
 <template>
   <el-row class="el-row-container" style="height: 100%" v-loading="loading">
-    <el-col
-      :span="4"
-      style="height:100%;padding-bottom:32px;"
-    >
-    <el-card style="margin:16px;height: 100%; overflow-y: auto">
-      <data-report-left
-        @setCurrentData="setCurrentData"
-        :treeData="treeData"
-      ></data-report-left>
-    </el-card>
+    <el-col :span="4" style="height: 100%; padding-bottom: 32px">
+      <el-card style="margin: 16px; height: 100%; overflow-y: auto">
+        <data-report-left
+          @setCurrentData="setCurrentData"
+          :treeData="treeData"
+        ></data-report-left>
+      </el-card>
     </el-col>
-    <el-col
-      :span="20"
-      style="padding: 16px 16px 16px 0; height: 100%"
-    >
+    <el-col :span="20" style="padding: 16px 16px 16px 0; height: 100%">
       <el-card style="height: 100%; overflow-y: auto">
         <el-col :span="24" class="elrow-main__col-top">
           <div>
@@ -37,10 +31,7 @@
               >
               </el-option>
             </el-select>
-            <el-button
-              type="primary"
-              size="small"
-              @click="handleSearch"
+            <el-button type="primary" size="small" @click="handleSearch"
               >查询</el-button
             >
           </div>
@@ -54,11 +45,29 @@
             isShowIndex
           >
             <template #status="scope">
-              <span style="display:flex;align-items:center;justify-content:center">
-                <span class="status nowork" v-if="scope.row.tmnstatusRunstatusContent == '空闲中'"></span>
-                <span class="status work" v-if="scope.row.tmnstatusRunstatusContent == '工作中'"></span>
-                <span class="status error" v-if="scope.row.tmnstatusRunstatusContent == '故障'"></span>
-                <span class="status nolive" v-if="scope.row.tmnstatusRunstatusContent == '离线'"></span>
+              <span
+                style="
+                  display: flex;
+                  align-items: center;
+                  justify-content: center;
+                "
+              >
+                <span
+                  class="status nowork"
+                  v-if="scope.row.tmnstatusRunstatusContent == '空闲中'"
+                ></span>
+                <span
+                  class="status work"
+                  v-if="scope.row.tmnstatusRunstatusContent == '工作中'"
+                ></span>
+                <span
+                  class="status error"
+                  v-if="scope.row.tmnstatusRunstatusContent == '故障'"
+                ></span>
+                <span
+                  class="status nolive"
+                  v-if="scope.row.tmnstatusRunstatusContent == '离线'"
+                ></span>
                 {{ scope.row.tmnstatusRunstatusContent }}
               </span>
             </template>
@@ -67,8 +76,9 @@
                 size="small"
                 :underline="false"
                 type="primary"
-                style="margin-right: 10px;color:rgb(219, 162, 28)"
+                style="margin-right: 10px; color: rgb(219, 162, 28)"
                 @click="irrigationShowHistory(scope.row)"
+                v-hasPermi="['wpr:device:setup']"
                 >参数设置</el-link
               >
               <!-- <el-link
@@ -92,34 +102,43 @@
 </template>
 
 <script>
-import { getBaseList, getTmnconfigInfo, addTmnconfig } from '@/api/tmn/index.js'
-import { getTree } from '@/api/tree.js'
+import {
+  getBaseList,
+  getTmnconfigInfo,
+  addTmnconfig
+} from '@/api/tmn/index.js';
+import { getTree } from '@/api/tree.js';
 import BTable from '@/components/Table/index.vue';
-import DataReportLeft from '@/components/DataReportLeft/index.vue'
-import setPreferencs from './components/setPreferenc.vue'
+import DataReportLeft from '@/components/DataReportLeft/index.vue';
+import setPreferencs from './components/setPreferenc.vue';
 import { assign, omit } from 'lodash-es';
 
 export default {
   name: 'deviceSetup',
-  components: { BTable,DataReportLeft,setPreferencs },
+  components: { BTable, DataReportLeft, setPreferencs },
   data() {
     return {
-      tmnstatusRunstatus:'I',
+      tmnstatusRunstatus: 'I',
       treeData: [],
       waterKeyword: '',
-      tmnstatusList: [{
-        label: '空闲中',
-        value: 'I'
-      }, {
-        label: '工作中',
-        value: 'W'
-      }, {
-        label: '故障',
-        value: 'E'
-      }, {
-        label: '离线',
-        value: 'O'
-        }],
+      tmnstatusList: [
+        {
+          label: '空闲中',
+          value: 'I'
+        },
+        {
+          label: '工作中',
+          value: 'W'
+        },
+        {
+          label: '故障',
+          value: 'E'
+        },
+        {
+          label: '离线',
+          value: 'O'
+        }
+      ],
       tmnId: '',
       loading: false,
       associationManageShow: false,
@@ -149,18 +168,20 @@ export default {
           prop: 'tmnstatusRunstatusContent',
           customRender: 'status',
           align: 'center'
-        },{
+        },
+        {
           label: '累计用水量',
           prop: 'waterNumTotal',
           customRender: '',
           align: 'center'
-        },{
+        },
+        {
           label: '累计用电量',
           prop: 'elecNumTotal',
           customRender: '',
           align: 'center'
-        }
-        , {
+        },
+        {
           label: '更新时间',
           prop: 'tmnstatusUpdateddate',
           customRender: '',
@@ -179,56 +200,56 @@ export default {
       const res = await getFarmerList({
         farmerName,
         areaId
-      })
-      this.userList = res.data
+      });
+      this.userList = res.data;
     },
     setCurrentData(areaId) {
-      this.currentClickId = areaId
-      this.areaId = areaId
+      this.currentClickId = areaId;
+      this.areaId = areaId;
       this.$refs.tableRef.refresh(false);
     },
     irrigationShowHistory(row) {
-      this.tmnId = row?.tmnId
-      this.associationManageShow = true
-     },
+      this.tmnId = row?.tmnId;
+      this.associationManageShow = true;
+    },
     async loadData(parameter) {
       if (!this.currentClickId) {
-        const treeList = this.$store.state.tree.treeList
-        let res = []
+        const treeList = this.$store.state.tree.treeList;
+        let res = [];
         if (treeList.code === '000000') {
-          res = treeList
+          res = treeList;
         } else {
-          res = await getTree()
-          this.$store.dispatch('tree/setTree', res)
+          res = await getTree();
+          this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data
-        this.currentClick = res?.data[0]
-        this.currentClickId = this.currentClick?.cusareaId
-        this.areaId = this.currentClickId
+        this.treeData = res?.data;
+        this.currentClick = res?.data[0];
+        this.currentClickId = this.currentClick?.cusareaId;
+        this.areaId = this.currentClickId;
       }
       const params = {
         areaId: this.areaId,
         waterKeyword: this.waterKeyword,
         tmnstatusRunstatus: this.tmnstatusRunstatus
-      }
+      };
       const payload = omit(assign({}, parameter, params), []);
       return this.getTableData(payload);
     },
-    getTableData(payload) {  
-      return getBaseList(payload)
+    getTableData(payload) {
+      return getBaseList(payload);
     },
     handleSearch() {
       this.$refs.tableRef.refresh(true);
     },
     goDetail(row) {
-      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
-    },
+      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno);
+    }
   }
 };
 </script>
 
 <style lang="scss" scoped>
-.el-row-container{
+.el-row-container {
   height: 100%;
 }
 .elrow-main__col-top {
@@ -248,23 +269,23 @@ export default {
     }
   }
 }
-.status{
+.status {
   display: inline-block;
   width: 8px;
   height: 8px;
   border-radius: 50%;
   margin-right: 8px;
 }
-.nowork{
-  background: #14A478;
+.nowork {
+  background: #14a478;
 }
-.work{
-  background: #1890FF;
+.work {
+  background: #1890ff;
 }
-.error{
-  background: #F4A72F;
+.error {
+  background: #f4a72f;
 }
-.nolive{
+.nolive {
   background: rgba(0, 0, 0, 0.26);
 }
 </style>

+ 162 - 98
src/views/infrastructure/waterElectricityPriceSetting.vue

@@ -3,68 +3,96 @@
     <el-col :span="24" style="padding: 16px; height: 100%">
       <el-card style="height: 100%; overflow-y: auto">
         <el-col :span="24" class="elrow-main__col-top">
-          <div style="display:flex">
-            <select-tree 
-              :placeholder="'行政区域(全国)'" 
-              style="width:50%"
+          <div style="display: flex">
+            <select-tree
+              :placeholder="'行政区域(全国)'"
+              style="width: 50%"
               :treeData="treeData"
               @handlerClick="handlerClick"
               :checkVal="cusareaName"
             ></select-tree>
-            <el-select style="margin:0 20px;width: 50%" placeholder="全部" v-model="priceConfigVal" @change="handleChange">
-              <el-option v-for="(item, index) in priceConfigList" :key="index" :label="item.label" :value="item.value">
+            <el-select
+              style="margin: 0 20px; width: 50%"
+              placeholder="全部"
+              v-model="priceConfigVal"
+              @change="handleChange"
+            >
+              <el-option
+                v-for="(item, index) in priceConfigList"
+                :key="index"
+                :label="item.label"
+                :value="item.value"
+              >
               </el-option>
             </el-select>
-            <el-button type="primary" size="small" @click="handleSearch">查询</el-button>
+            <el-button type="primary" size="small" @click="handleSearch"
+              >查询</el-button
+            >
           </div>
           <!-- <div class="top-left">
             <el-button
               type="primary"
               size="small"
               @click="addAssociation"
+                v-hasPermi="['wpr:price:add']"
+
               >新增
               </el-button
           ></div> -->
         </el-col>
         <el-col :span="24" class="elrow-main__col-bottom">
-          <b-table ref="tableRef" 
+          <b-table
+            ref="tableRef"
             border
             :args="{ 'highlight-current-row': true }"
-            :data="loadData" 
+            :data="loadData"
             :columns="columns"
-            isShowIndex>
+            isShowIndex
+          >
             <template #priceconfigWaterchargingtype="scope">
-              {{ scope.row.priceconfigWaterchargingtype == 1 ? '是': '否'}}
+              {{ scope.row.priceconfigWaterchargingtype == 1 ? '是' : '否' }}
             </template>
             <template #waterPriceName="scope">
               <span v-if="scope.row.priceconfigWaterchargingtype == 1">
-                <div v-for="(item, index) in scope.row.waterPriceSteps" :key="index" class="pricestepNum">
-                  {{ 
-                    item.pricestepNum == '0' ? '第1阶梯' : item.pricestepNum == '1' ? '第2阶梯' : '第3阶梯'
+                <div
+                  v-for="(item, index) in scope.row.waterPriceSteps"
+                  :key="index"
+                  class="pricestepNum"
+                >
+                  {{
+                    item.pricestepNum == '0'
+                      ? '第1阶梯'
+                      : item.pricestepNum == '1'
+                      ? '第2阶梯'
+                      : '第3阶梯'
                   }}
                 </div>
               </span>
               <span v-else>
-                <div class="pricestepNum">
-                  恒定水价
-                </div>
+                <div class="pricestepNum">恒定水价</div>
               </span>
             </template>
             <template #priceYield="scope">
               <span v-if="scope.row.priceconfigWaterchargingtype == 1">
-                <div v-for="(item, index) in scope.row.waterPriceSteps" :key="index" class="pricestepNum">
+                <div
+                  v-for="(item, index) in scope.row.waterPriceSteps"
+                  :key="index"
+                  class="pricestepNum"
+                >
                   {{ item.pricestepUsagemin + ' - ' + item.pricestepUsagemax }}
                 </div>
               </span>
               <span v-else>
-                <div class="pricestepNum">
-                  -
-                </div>
+                <div class="pricestepNum">-</div>
               </span>
             </template>
             <template #averageWaterPrice="scope">
               <span v-if="scope.row.priceconfigWaterchargingtype == 1">
-                <div v-for="(item, index) in scope.row.waterPriceSteps" :key="index" class="pricestepNum">
+                <div
+                  v-for="(item, index) in scope.row.waterPriceSteps"
+                  :key="index"
+                  class="pricestepNum"
+                >
                   {{ item.pricestepUnitprice }}
                 </div>
               </span>
@@ -75,39 +103,53 @@
               </span>
             </template>
             <template #stepPriceOrNot="scope">
-             {{ scope.row.priceconfigElectricitychargingtype == 1 ? '是' : '否' }}
+              {{
+                scope.row.priceconfigElectricitychargingtype == 1 ? '是' : '否'
+              }}
             </template>
             <template #elecPriceName="scope">
               <span v-if="scope.row.priceconfigElectricitychargingtype == 1">
-                <div v-for="(item, index) in scope.row.elecPriceSteps" :key="index" class="pricestepNum">
+                <div
+                  v-for="(item, index) in scope.row.elecPriceSteps"
+                  :key="index"
+                  class="pricestepNum"
+                >
                   {{
-                    item.pricestepNum == '0' ? '第1阶梯' : item.pricestepNum == '1' ? '第2阶梯': '第3阶梯'
+                    item.pricestepNum == '0'
+                      ? '第1阶梯'
+                      : item.pricestepNum == '1'
+                      ? '第2阶梯'
+                      : '第3阶梯'
                   }}
                 </div>
               </span>
               <span v-else>
-                <div class="pricestepNum">
-                  恒定电价
-                </div>
+                <div class="pricestepNum">恒定电价</div>
               </span>
             </template>
             <template #elecPriceSteps="scope">
               <span v-if="scope.row.priceconfigElectricitychargingtype == 1">
-                <div v-for="(item, index) in scope.row.elecPriceSteps" :key="index" class="pricestepNum">
+                <div
+                  v-for="(item, index) in scope.row.elecPriceSteps"
+                  :key="index"
+                  class="pricestepNum"
+                >
                   {{ item.pricestepUsagemin + ' - ' + item.pricestepUsagemax }}
                 </div>
               </span>
               <span v-else>
-                <div class="pricestepNum">
-                  -
-                </div>
+                <div class="pricestepNum">-</div>
               </span>
             </template>
             <template #averageElecPriceSteps="scope">
               <span v-if="scope.row.priceconfigElectricitychargingtype == 1">
-              <div v-for="(item, index) in scope.row.elecPriceSteps" :key="index" class="pricestepNum">
-                {{ item.pricestepUnitprice }}
-              </div>
+                <div
+                  v-for="(item, index) in scope.row.elecPriceSteps"
+                  :key="index"
+                  class="pricestepNum"
+                >
+                  {{ item.pricestepUnitprice }}
+                </div>
               </span>
               <span v-else>
                 <div class="pricestepNum">
@@ -116,10 +158,24 @@
               </span>
             </template>
             <template #operate="scope">
-              <el-link size="small" :underline="false" type="primary" style="margin-right: 10px"
-                @click="editAssociation(scope.row)">修改</el-link>
-              <el-link size="small" :underline="false" type="danger" style="margin-right: 10px"
-                @click="deleteHandler(scope.row)">删除</el-link>
+              <el-link
+                size="small"
+                :underline="false"
+                type="primary"
+                style="margin-right: 10px"
+                @click="editAssociation(scope.row)"
+                v-hasPermi="['wpr:price:edit']"
+                >修改</el-link
+              >
+              <el-link
+                size="small"
+                :underline="false"
+                type="danger"
+                style="margin-right: 10px"
+                @click="deleteHandler(scope.row)"
+                v-hasPermi="['wpr:price:delete']"
+                >删除</el-link
+              >
             </template>
           </b-table>
         </el-col>
@@ -137,10 +193,10 @@
 import { Message } from 'element-ui';
 import SelectTree from '@/components/SelectTree';
 import BTable from '@/components/Table/index.vue';
-import { Waterchargingtype, Electricitychargingtype } from './status'
-import setAnnualWaterRight from './components/setAnnualWaterRight.vue'
-import { getPriceList, deletePrice } from '@/api/price/index.js'
-import { getTree } from '@/api/tree.js'
+import { Waterchargingtype, Electricitychargingtype } from './status';
+import setAnnualWaterRight from './components/setAnnualWaterRight.vue';
+import { getPriceList, deletePrice } from '@/api/price/index.js';
+import { getTree } from '@/api/tree.js';
 import { assign, omit } from 'lodash-es';
 
 export default {
@@ -172,19 +228,22 @@ export default {
           value: '0',
           label: '恒定水价',
           type: Waterchargingtype
-        }, {
+        },
+        {
           value: '1',
           label: '阶梯水价',
           type: Waterchargingtype
-        }, {
+        },
+        {
           value: '2',
           label: '恒定电价',
           type: Electricitychargingtype
-        }, {
+        },
+        {
           value: '3',
           label: '阶梯电价',
           type: Electricitychargingtype
-        },
+        }
       ],
       columns: [
         {
@@ -210,27 +269,32 @@ export default {
           prop: 'waterPriceSteps',
           customRender: 'priceYield',
           align: 'center'
-        }, {
+        },
+        {
           label: '水价(元/m³)',
           prop: 'waterPriceSteps',
           customRender: 'averageWaterPrice',
           align: 'center'
-        }, {
+        },
+        {
           label: '是否阶梯电价',
           prop: 'priceconfigElectricitychargingtype',
           customRender: 'stepPriceOrNot',
           align: 'center'
-        }, {
+        },
+        {
           label: '电价名称',
           prop: 'elecPriceSteps',
           customRender: 'elecPriceName',
           align: 'center'
-        }, {
+        },
+        {
           label: '电量(度)',
           prop: 'elecPriceSteps',
           customRender: 'elecPriceSteps',
           align: 'center'
-        }, {
+        },
+        {
           label: '电价(元/度)',
           prop: 'elecPriceSteps',
           customRender: 'averageElecPriceSteps',
@@ -245,72 +309,74 @@ export default {
     };
   },
   mounted() {
-    this.getWaterrightList()
+    this.getWaterrightList();
   },
   methods: {
     editAssociation(row) {
-      this.editRow = row
-      this.associationManageShow = true
+      this.editRow = row;
+      this.associationManageShow = true;
     },
     async getWaterrightList() {
       if (!this.areaId) {
-        const res = await getTree()
-        this.treeData = res?.data
+        const res = await getTree();
+        this.treeData = res?.data;
         this.treeData.unshift({
           cusareaId: '',
           cusareaName: '行政区域(全国)'
-        })
-        this.areaId = this.treeData[0].cusareaId
+        });
+        this.areaId = this.treeData[0].cusareaId;
       }
     },
     handlerClick(value) {
-      this.areaId = value?.cusareaId
+      this.areaId = value?.cusareaId;
     },
     handlerClearEdit() {
       this.editRow = {
         cusareaName: ''
-      }
-      this.handleSearch()
+      };
+      this.handleSearch();
     },
     handleChange(value) {
       switch (value) {
         case '0':
-          this.priceconfigWaterchargingtype = 0
-          this.priceconfigElectricitychargingtype = ''
-          break
+          this.priceconfigWaterchargingtype = 0;
+          this.priceconfigElectricitychargingtype = '';
+          break;
         case '1':
-          this.priceconfigWaterchargingtype = 1
-          this.priceconfigElectricitychargingtype = ''
-          break
+          this.priceconfigWaterchargingtype = 1;
+          this.priceconfigElectricitychargingtype = '';
+          break;
         case '2':
-          this.priceconfigWaterchargingtype = ''
-          this.priceconfigElectricitychargingtype = 0
-          break
+          this.priceconfigWaterchargingtype = '';
+          this.priceconfigElectricitychargingtype = 0;
+          break;
         case '3':
-          this.priceconfigWaterchargingtype = ''
-          this.priceconfigElectricitychargingtype = 1
-          break
+          this.priceconfigWaterchargingtype = '';
+          this.priceconfigElectricitychargingtype = 1;
+          break;
         default:
-          this.priceconfigWaterchargingtype = ''
-          this.priceconfigElectricitychargingtype = ''
+          this.priceconfigWaterchargingtype = '';
+          this.priceconfigElectricitychargingtype = '';
       }
     },
     loadData(parameter) {
       const params = {
         areaId: this.areaId,
         priceconfigWaterchargingtype: this.priceconfigWaterchargingtype,
-        priceconfigElectricitychargingtype: this.priceconfigElectricitychargingtype
-      }
+        priceconfigElectricitychargingtype:
+          this.priceconfigElectricitychargingtype
+      };
       const payload = omit(assign({}, parameter, params), []);
-      return getPriceList(payload)
+      return getPriceList(payload);
     },
     getTableData() {
       const params = {
         areaId: this.areaId,
         priceconfigWaterchargingtype: this.priceconfigWaterchargingtype,
-        priceconfigElectricitychargingtype: this.priceconfigElectricitychargingtype
-      }
-      return getPriceList(params)
+        priceconfigElectricitychargingtype:
+          this.priceconfigElectricitychargingtype
+      };
+      return getPriceList(params);
     },
     handleSearch() {
       this.$refs.tableRef.refresh(true);
@@ -319,40 +385,38 @@ export default {
       this.$refs.tableRef.refresh(false);
     },
     goDetail(row) {
-      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
+      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno);
     },
     deleteHandler(row) {
-      const { priceconfigId } = row
-      this.$modal
-      .confirm(`是否确认删除`)
-      .then(() => {
+      const { priceconfigId } = row;
+      this.$modal.confirm(`是否确认删除`).then(() => {
         deletePrice({
           priceconfigIds: priceconfigId
         }).then(() => {
-          Message({ message: "删除成功", type: 'success' });
-          this.handlerChange()
-        })
-      })
+          Message({ message: '删除成功', type: 'success' });
+          this.handlerChange();
+        });
+      });
     }
   }
 };
 </script>
 
 <style lang="scss" scoped>
-.el-row-container{
+.el-row-container {
   height: 100%;
   min-height: 100%;
 }
-.pricestepNum{
-  border-bottom: 1px solid #EBEEF5;
+.pricestepNum {
+  border-bottom: 1px solid #ebeef5;
 }
-::v-deep .el-table__row{
-  .el-table__cell{
+::v-deep .el-table__row {
+  .el-table__cell {
     padding: 0;
   }
-  .cell{
+  .cell {
     padding: 0;
-    line-height:44px;
+    line-height: 44px;
   }
 }
 .elrow-main__col-top {

+ 55 - 48
src/views/infrastructure/waterEstablishment.vue

@@ -1,14 +1,11 @@
 <template>
   <el-row class="el-row-container" v-loading="loading">
-    <el-col
-      :span="24"
-      style="padding: 16px; height: 100%"
-    >
+    <el-col :span="24" style="padding: 16px; height: 100%">
       <el-card style="height: 100%; overflow-y: auto">
         <el-col :span="24" class="elrow-main__col-top">
-          <div style="display:flex">
+          <div style="display: flex">
             <el-select
-              style="width: 100%;margin-right:16px;"
+              style="width: 100%; margin-right: 16px"
               laceholder="请选择您的年份"
               v-model="waterrightYear"
             >
@@ -16,18 +13,19 @@
                 v-for="item in options"
                 :key="item.value"
                 :label="item.label"
-                :value="item.value">
+                :value="item.value"
+              >
               </el-option>
             </el-select>
             <select-tree
-              :placeholder="'年份'" 
-              style="width:100%"
+              :placeholder="'年份'"
+              style="width: 100%"
               :treeData="treeData"
               @handlerClick="handlerClick"
               :checkVal="cusareaName"
             ></select-tree>
             <el-button
-              style="margin-left: 16px;"
+              style="margin-left: 16px"
               type="primary"
               size="small"
               @click="handleSearch"
@@ -39,9 +37,10 @@
               type="primary"
               size="small"
               @click="setAnnualWaterRight"
+              v-hasPermi="['wpr:power:setup']"
               >设置年度水权
-              </el-button
-            ></div>
+            </el-button>
+          </div>
         </el-col>
         <el-col :span="24" class="elrow-main__col-bottom">
           <!--  -->
@@ -57,6 +56,7 @@
                 :underline="false"
                 type="primary"
                 style="margin-right: 10px"
+                v-hasPermi="['wpr:power:edit']"
                 @click="handlerRecompose(scope.row)"
                 >修改</el-link
               >
@@ -71,36 +71,42 @@
       @resetEdit="resetEdit"
       @refresh="handlerChange"
     />
-    <water-price-setting :visible.sync="waterprice" @refresh="handleSearch"/>
+    <water-price-setting :visible.sync="waterprice" @refresh="handleSearch" />
   </el-row>
 </template>
 
 <script>
-import { getTree } from '@/api/tree.js'
-import { getWaterrightList } from '@/api/waterright/index.js'
+import { getTree } from '@/api/tree.js';
+import { getWaterrightList } from '@/api/waterright/index.js';
 import SelectTree from '@/components/SelectTree';
 import BTable from '@/components/Table/index.vue';
-import setAnnualWaterRight from './components/setAnnualWaterRight.vue'
-import waterPriceSetting from './components/waterPriceSetting.vue'
-import recompose from './components/recompose.vue'
+import setAnnualWaterRight from './components/setAnnualWaterRight.vue';
+import waterPriceSetting from './components/waterPriceSetting.vue';
+import recompose from './components/recompose.vue';
 import { assign, omit } from 'lodash-es';
 
 export default {
   name: 'waterEstablishment',
-  components: { BTable,setAnnualWaterRight, recompose,waterPriceSetting,SelectTree },
+  components: {
+    BTable,
+    setAnnualWaterRight,
+    recompose,
+    waterPriceSetting,
+    SelectTree
+  },
   data() {
     return {
       form: {
         productName: ''
       },
-      options:[],
+      options: [],
       treeData: [],
       loading: false,
       recomposeShow: false,
       waterprice: false,
-      cusareaName:'',
+      cusareaName: '',
       waterrightYear: new Date().getFullYear(),
-      areaId:'',
+      areaId: '',
       editRow: {},
       columns: [
         {
@@ -120,7 +126,8 @@ export default {
           prop: 'waterrightAmount',
           customRender: '',
           align: 'left'
-        },{
+        },
+        {
           label: '亩均水权(亩/m³)',
           prop: 'amountPerMu',
           customRender: '',
@@ -137,56 +144,56 @@ export default {
   },
   methods: {
     setYear() {
-      this.options = []
-      let date = new Date
-      let currentYear = date.getFullYear()
-      this.currentYear = currentYear
+      this.options = [];
+      let date = new Date();
+      let currentYear = date.getFullYear();
+      this.currentYear = currentYear;
       for (let i = 0; i < 5; i++) {
         this.options.push({
           label: currentYear - i,
           value: currentYear - i
-        })
+        });
       }
     },
     resetEdit() {
-      this.editRow = {}
+      this.editRow = {};
     },
     async loadData(parameter) {
-      this.setYear()
-      if(!this.areaId) {
-        const treeList = this.$store.state.tree.treeList
-        let res = []
+      this.setYear();
+      if (!this.areaId) {
+        const treeList = this.$store.state.tree.treeList;
+        let res = [];
         if (treeList.code === '000000') {
-          res = treeList
+          res = treeList;
         } else {
-          res = await getTree()
-          this.$store.dispatch('tree/setTree', res)
+          res = await getTree();
+          this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data
-        this.cusareaName ||= this.treeData[0].cusareaName
-        this.areaId = this.treeData[0].cusareaId
+        this.treeData = res?.data;
+        this.cusareaName ||= this.treeData[0].cusareaName;
+        this.areaId = this.treeData[0].cusareaId;
       }
       const params = {
         areaId: this.areaId,
         waterrightYear: this.waterrightYear
-      }
+      };
       const payload = omit(assign({}, parameter, params), []);
-      return this.getTableData(payload)
+      return this.getTableData(payload);
     },
     getTableData(payload) {
-      return getWaterrightList(payload)
+      return getWaterrightList(payload);
     },
     handlerClick(value) {
-      this.areaId = value?.cusareaId
+      this.areaId = value?.cusareaId;
     },
-    handleSearch() { 
+    handleSearch() {
       this.$refs.tableRef.refresh(true);
     },
     handlerChange() {
       this.$refs.tableRef.refresh(false);
     },
     setAnnualWaterRight() {
-      this.waterprice = true
+      this.waterprice = true;
     },
     // loadData(parameter) {
     //   const queryform = this.form;
@@ -197,15 +204,15 @@ export default {
     //   return {}
     // },
     handlerRecompose(row) {
-      this.editRow = row
-      this.recomposeShow = true
+      this.editRow = row;
+      this.recomposeShow = true;
     }
   }
 };
 </script>
 
 <style lang="scss" scoped>
-.el-row-container{
+.el-row-container {
   height: 100%;
 }
 .elrow-main__col-top {

+ 266 - 220
src/views/monitoringMamage/index.vue

@@ -1,217 +1,256 @@
 <template>
   <el-row class="el-row-container" v-loading="loading">
-    <el-col
-      :span="4"
-      style="height:100%;padding-bottom:32px;"
-    >
-    <el-card style="margin:16px;height: 100%; overflow-y: auto">
-      <data-report-left
-        @setCurrentData="setCurrentData"
-        :treeData="treeData"
-      ></data-report-left>
-    </el-card>
+    <el-col :span="4" style="height: 100%; padding-bottom: 32px">
+      <el-card style="margin: 16px; height: 100%; overflow-y: auto">
+        <data-report-left
+          @setCurrentData="setCurrentData"
+          :treeData="treeData"
+        ></data-report-left>
+      </el-card>
     </el-col>
-    <el-col
-      :span="20"
-    >
-    <el-card style="overflow-y: hidden;min-height:180px;margin-bottom:16px;">
-      <div style="margin-bottom: 16px; display:flex;justify-content:space-between">
-        <div>
-          <span style="font-weight:bold">机井情况</span>(总数: {{ resData.tmnCount }} 口)
-        </div>
-        <div>
-          <el-date-picker
-            v-model="dateValue"
-            type="daterange"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            :default-time="['00:00:00', '23:59:59']"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-            style="width: 300px; margin:0 16px"
-          >
-          </el-date-picker>
-          <el-button
-            type="primary"
-            size="small"
-            @click="getTopListHandler"
-            >查询</el-button
-          >
+    <el-col :span="20">
+      <el-card
+        style="overflow-y: hidden; min-height: 180px; margin-bottom: 16px"
+      >
+        <div
+          style="
+            margin-bottom: 16px;
+            display: flex;
+            justify-content: space-between;
+          "
+        >
+          <div>
+            <span style="font-weight: bold">机井情况</span>(总数:
+            {{ resData.tmnCount }} 口)
+          </div>
+          <div>
+            <el-date-picker
+              v-model="dateValue"
+              type="daterange"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              :default-time="['00:00:00', '23:59:59']"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              style="width: 300px; margin: 0 16px"
+            >
+            </el-date-picker>
+            <el-button type="primary" size="small" @click="getTopListHandler"
+              >查询</el-button
+            >
+          </div>
         </div>
-      </div>
-      <div style="height:100px;width:auto;overflow:hidden">
-        <el-row>
-          <el-col :span="14">
-            <el-row :gutter="8">
-              <el-col 
-                :span="4" 
-                class="right_width" 
-                v-for="item in dataList" 
-                :key="item.title"
-              >
-                <div class="left">
-                  <span>
-                    <div :class="item.styleClass"></div>
+        <div style="height: 100px; width: auto; overflow: hidden">
+          <el-row>
+            <el-col :span="14">
+              <el-row :gutter="8">
+                <el-col
+                  :span="4"
+                  class="right_width"
+                  v-for="item in dataList"
+                  :key="item.title"
+                >
+                  <div class="left">
+                    <span>
+                      <div :class="item.styleClass"></div>
                       {{ item.title }}
                     </span>
-                  <div>
-                    {{ item.number }}
-                  </div>
-                </div>
-              </el-col>
-            </el-row>
-          </el-col>
-          <el-col :span="10">
-            <div style="display:flex;justify-content: space-around">
-              <echarts-pie style="width:30%;margin-left:5%" :proportion="proportion"/>
-              <div style="width:65%">
-              <el-row :gutter="20">
-                <el-col :span="12">
-                  <div class="radius_container">
-                    <span class="radius"></span>
-                    <span class="label">计划用水量: </span> {{ resData.waterrightAmount }} 吨
-                  </div>
-                  <div class="radius_container">
-                    <span class="radius"></span>
-                    <span class="label">累计用水量: </span>  {{ resData.waterNumTotal }} 吨
-                  </div>
-                  <div class="radius_container">
-                    <span class="radius"></span>
-                    <span class="label">累计用电量: </span>  {{ resData.elecNumTotal }} 吨
-                  </div>
-                </el-col>
-                <el-col :span="12">
-                  <div class="radius_container">
-                    <span class="label">累计费用: </span>  {{ resData.useMoneyTotal }} 元
-                  </div>
-                  <div class="radius_container">
-                    <span class="label">累计用水费用: </span>  {{ resData.usewatermoneyTotal }} 元
-                  </div>
-                  <div class="radius_container">
-                    <span class="label">累计用电费用: </span>  {{ resData.useelecmoneyTotal }} 元
+                    <div>
+                      {{ item.number }}
+                    </div>
                   </div>
                 </el-col>
               </el-row>
-            </div>
-            </div>
-          </el-col>
-        </el-row>
-      </div>
-    </el-card>
-    <el-card style="height: calc(100% - 180px); overflow-y: auto;">
-      <el-col :span="24" class="elrow-main__col-top">
-        <div>
-          <el-input
-            v-model="waterKeyword"
-            style="width: 250px;margin-right:20px;"
-            placeholder="请输入机井编号/机井名称"
-            clearable
-          />
-          <el-select
-            v-model="tmnstatusRunstatus"
-            style="width: 200px;margin-right:16px"
-            placeholder="设备状态"
-            clearable
-          >
-          <el-option
-            v-for="item in options"
-            :key="item.value"
-            :value="item.value"
-            :label="item.label"
-          ></el-option>
-        </el-select>
-          <el-button
-            type="primary"
-            size="small"
-            @click="handleSearch"
-            >查询</el-button
-          >
+            </el-col>
+            <el-col :span="10">
+              <div style="display: flex; justify-content: space-around">
+                <echarts-pie
+                  style="width: 30%; margin-left: 5%"
+                  :proportion="proportion"
+                />
+                <div style="width: 65%">
+                  <el-row :gutter="20">
+                    <el-col :span="12">
+                      <div class="radius_container">
+                        <span class="radius"></span>
+                        <span class="label">计划用水量: </span>
+                        {{ resData.waterrightAmount }} 吨
+                      </div>
+                      <div class="radius_container">
+                        <span class="radius"></span>
+                        <span class="label">累计用水量: </span>
+                        {{ resData.waterNumTotal }} 吨
+                      </div>
+                      <div class="radius_container">
+                        <span class="radius"></span>
+                        <span class="label">累计用电量: </span>
+                        {{ resData.elecNumTotal }} 吨
+                      </div>
+                    </el-col>
+                    <el-col :span="12">
+                      <div class="radius_container">
+                        <span class="label">累计费用: </span>
+                        {{ resData.useMoneyTotal }} 元
+                      </div>
+                      <div class="radius_container">
+                        <span class="label">累计用水费用: </span>
+                        {{ resData.usewatermoneyTotal }} 元
+                      </div>
+                      <div class="radius_container">
+                        <span class="label">累计用电费用: </span>
+                        {{ resData.useelecmoneyTotal }} 元
+                      </div>
+                    </el-col>
+                  </el-row>
+                </div>
+              </div>
+            </el-col>
+          </el-row>
         </div>
-      </el-col>
-      <el-col :span="24" class="elrow-main__col-bottom">
-        <b-table
-          ref="tableRef"
-          :args="{ 'highlight-current-row': true }"
-          :data="loadData"
-          :columns="columns"
-          isShowIndex
-        >
-          <template #status="scope">
-            <span style="display:flex;align-items:center;justify-content:center">
-              <span class="status nowork" v-if="scope.row.tmnstatusRunstatusContent == '空闲中'"></span>
-              <span class="status work" v-if="scope.row.tmnstatusRunstatusContent == '工作中'"></span>
-              <span class="status error" v-if="scope.row.tmnstatusRunstatusContent == '故障'"></span>
-              <span class="status nolive" v-if="scope.row.tmnstatusRunstatusContent == '离线'"></span>
-              {{ scope.row.tmnstatusRunstatusContent }}
-            </span>
-          </template>
-
-          <template #operate="scope">
-            <el-link
-              size="small"
-              :underline="false"
-              type="primary"
-              style="margin-right: 10px"
-              @click="realTime(scope.row)"
-              >实时监测</el-link
+      </el-card>
+      <el-card style="height: calc(100% - 180px); overflow-y: auto">
+        <el-col :span="24" class="elrow-main__col-top">
+          <div>
+            <el-input
+              v-model="waterKeyword"
+              style="width: 250px; margin-right: 20px"
+              placeholder="请输入机井编号/机井名称"
+              clearable
+            />
+            <el-select
+              v-model="tmnstatusRunstatus"
+              style="width: 200px; margin-right: 16px"
+              placeholder="设备状态"
+              clearable
             >
-            <el-link
-              size="small"
-              :underline="false"
-              type="primary"
-              style="margin-right: 10px"
-              @click="irrigationShowHistory(scope.row)"
-              >灌溉记录</el-link
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :value="item.value"
+                :label="item.label"
+              ></el-option>
+            </el-select>
+            <el-button type="primary" size="small" @click="handleSearch"
+              >查询</el-button
             >
-          </template>
-        </b-table>
-      </el-col>
-    </el-card>
+          </div>
+        </el-col>
+        <el-col :span="24" class="elrow-main__col-bottom">
+          <b-table
+            ref="tableRef"
+            :args="{ 'highlight-current-row': true }"
+            :data="loadData"
+            :columns="columns"
+            isShowIndex
+          >
+            <template #status="scope">
+              <span
+                style="
+                  display: flex;
+                  align-items: center;
+                  justify-content: center;
+                "
+              >
+                <span
+                  class="status nowork"
+                  v-if="scope.row.tmnstatusRunstatusContent == '空闲中'"
+                ></span>
+                <span
+                  class="status work"
+                  v-if="scope.row.tmnstatusRunstatusContent == '工作中'"
+                ></span>
+                <span
+                  class="status error"
+                  v-if="scope.row.tmnstatusRunstatusContent == '故障'"
+                ></span>
+                <span
+                  class="status nolive"
+                  v-if="scope.row.tmnstatusRunstatusContent == '离线'"
+                ></span>
+                {{ scope.row.tmnstatusRunstatusContent }}
+              </span>
+            </template>
+
+            <template #operate="scope">
+              <el-link
+                size="small"
+                :underline="false"
+                type="primary"
+                style="margin-right: 10px"
+                @click="realTime(scope.row)"
+                v-hasPermi="['wpr:monitor:realtime']"
+                >实时监测</el-link
+              >
+              <el-link
+                size="small"
+                :underline="false"
+                type="primary"
+                style="margin-right: 10px"
+                @click="irrigationShowHistory(scope.row)"
+                v-hasPermi="['wpr:Irrigation:records']"
+                >灌溉记录</el-link
+              >
+            </template>
+          </b-table>
+        </el-col>
+      </el-card>
     </el-col>
-    <real-time-monitor :visible.sync="realTimeShow"/>
+    <real-time-monitor :visible.sync="realTimeShow" />
     <irrigation-record :visible.sync="irrigationShow" />
   </el-row>
 </template>
 
 <script>
-import { getBaseList, getTopList } from '@/api/tmn/index.js'
-import EchartsPie from './components/echartsPie.vue'
+import { getBaseList, getTopList } from '@/api/tmn/index.js';
+import EchartsPie from './components/echartsPie.vue';
 import BTable from '@/components/Table/index.vue';
-import DataReportLeft from '@/components/DataReportLeft/index.vue'
+import DataReportLeft from '@/components/DataReportLeft/index.vue';
 import realTimeMonitor from './components/realTimeMonitor.vue';
 import IrrigationRecord from './components/IrrigationRecord.vue';
-import { getTree } from '@/api/tree.js'
+import { getTree } from '@/api/tree.js';
 import { assign, omit } from 'lodash-es';
 
 export default {
   name: 'monitoringMamage',
-  components: { BTable,DataReportLeft,EchartsPie,realTimeMonitor,IrrigationRecord },
+  components: {
+    BTable,
+    DataReportLeft,
+    EchartsPie,
+    realTimeMonitor,
+    IrrigationRecord
+  },
   data() {
     return {
-      dateValue:'',
+      dateValue: '',
       form: {
         productName: ''
       },
-      dataList: [{
-        title: '在线',
-        number: 0,
-        styleClass: 'radius'
-      }, {
-        title: '运行',
-        number: 0,
-        styleClass: 'radius run'
-      }, {
-        title: '故障',
-        number: 0,
-        styleClass: 'radius error'
-      }, {
-        title: '告警',
-        number: 0,
-        styleClass: 'radius waring'
-      }, {
-        title: '离线',
-        number: 0,
-        styleClass: 'radius noliving'
-      }],
+      dataList: [
+        {
+          title: '在线',
+          number: 0,
+          styleClass: 'radius'
+        },
+        {
+          title: '运行',
+          number: 0,
+          styleClass: 'radius run'
+        },
+        {
+          title: '故障',
+          number: 0,
+          styleClass: 'radius error'
+        },
+        {
+          title: '告警',
+          number: 0,
+          styleClass: 'radius waring'
+        },
+        {
+          title: '离线',
+          number: 0,
+          styleClass: 'radius noliving'
+        }
+      ],
       options: [
         {
           label: '全部',
@@ -232,7 +271,7 @@ export default {
         {
           label: '离线',
           value: 'O'
-        },
+        }
       ],
       treeData: [],
       loading: false,
@@ -269,22 +308,25 @@ export default {
           prop: 'tmnstatusRunstatusContent',
           customRender: 'status',
           align: 'center'
-        }, {
+        },
+        {
           label: '累计用水量',
           prop: 'waterNumTotal',
           customRender: '',
           align: 'center'
-        }, {
+        },
+        {
           label: '累计用电量',
           prop: 'elecNumTotal',
           customRender: '',
           align: 'center'
-        }, {
+        },
+        {
           label: '更新时间',
           prop: 'tmnstatusUpdateddate',
           customRender: '',
           align: 'center'
-        }, 
+        },
         {
           label: '操作',
           customRender: 'operate',
@@ -308,83 +350,87 @@ export default {
     //   this.treeData = data
     // },
     irrigationShowHistory() {
-      this.irrigationShow = true
+      this.irrigationShow = true;
     },
-    
+
     setCurrentData(areaId) {
-      this.areaId = areaId
+      this.areaId = areaId;
       this.$refs.tableRef.refresh(false);
     },
     realTime() {
-      this.realTimeShow = true
+      this.realTimeShow = true;
     },
     async loadData(parameter) {
       if (!this.areaId) {
-        const treeList = this.$store.state.tree.treeList
-        let res = []
+        const treeList = this.$store.state.tree.treeList;
+        let res = [];
         if (treeList.code === '000000') {
-          res = treeList
+          res = treeList;
         } else {
-          res = await getTree()
-          this.$store.dispatch('tree/setTree', res)
+          res = await getTree();
+          this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data
-        this.cusareaName ||= this.treeData[0].cusareaName
-        this.areaId = this.treeData[0].cusareaId
+        this.treeData = res?.data;
+        this.cusareaName ||= this.treeData[0].cusareaName;
+        this.areaId = this.treeData[0].cusareaId;
       }
       const params = {
         areaId: this.areaId,
         tmnstatusRunstatus: this.tmnstatusRunstatus,
         waterKeyword: this.waterKeyword
-      }
+      };
       const payload = omit(assign({}, parameter, params), []);
-      this.getTopListHandler()
-      return this.getTableData(payload)
+      this.getTopListHandler();
+      return this.getTableData(payload);
     },
     getTableData(payload) {
-      return getBaseList(payload)
+      return getBaseList(payload);
     },
-    async getTopListHandler() { 
-      let [startTime, endTime] = this.dateValue
-      startTime ||= new Date().getFullYear()
+    async getTopListHandler() {
+      let [startTime, endTime] = this.dateValue;
+      startTime ||= new Date().getFullYear();
       const res = await getTopList({
         areaId: this.areaId,
         startTime,
         endTime
-      })
-      const resData = res?.data
-      this.resData = resData
-      this.proportion = this.resData.proportion
+      });
+      const resData = res?.data;
+      this.resData = resData;
+      this.proportion = this.resData.proportion;
       this.dataList = [
         {
           title: '在线',
           number: resData?.tmnCount1,
           styleClass: 'radius'
-        }, {
+        },
+        {
           title: '运行',
           number: resData?.tmnCount2,
           styleClass: 'radius run'
-        }, {
+        },
+        {
           title: '故障',
           number: resData?.tmnCount3,
           styleClass: 'radius error'
-        }, {
+        },
+        {
           title: '告警',
           number: resData?.tmnCount5,
           styleClass: 'radius waring'
-        }, {
+        },
+        {
           title: '离线',
           number: resData?.tmnCount4,
           styleClass: 'radius noliving'
         }
-      ]
+      ];
     },
     handleSearch() {
       this.$refs.tableRef.refresh(true);
     },
     goDetail(row) {
-      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
-    },
+      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno);
+    }
   },
   mounted() {
     // this.getTreeList()
@@ -393,5 +439,5 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-@import './monitoringMamage.scss'
+@import './monitoringMamage.scss';
 </style>

+ 138 - 112
src/views/peasantHouseholdManage/index.vue

@@ -1,26 +1,20 @@
 <template>
   <el-row class="el-row-container" style="height: 100%" v-loading="loading">
-    <el-col
-      :span="4"
-      style="height:100%;padding-bottom:32px;"
-    >
-    <el-card style="margin:16px;height: 100%; overflow-y: auto">
-      <data-report-left
-        @setCurrentData="setCurrentData"
-        :treeData="treeData"
-      ></data-report-left>
-    </el-card>
+    <el-col :span="4" style="height: 100%; padding-bottom: 32px">
+      <el-card style="margin: 16px; height: 100%; overflow-y: auto">
+        <data-report-left
+          @setCurrentData="setCurrentData"
+          :treeData="treeData"
+        ></data-report-left>
+      </el-card>
     </el-col>
-    <el-col
-      :span="20"
-      style="padding: 16px 16px 16px 0; height: 100%"
-    >
+    <el-col :span="20" style="padding: 16px 16px 16px 0; height: 100%">
       <el-card style="height: 100%; overflow-y: auto">
         <el-col :span="24" class="elrow-main__col-top">
-          <div style="display:flex">
+          <div style="display: flex">
             <el-input
               v-model="farmerName"
-              style="width: 250px;"
+              style="width: 250px"
               placeholder="请输入姓名/电话"
               @keyup.enter.native="handleSearch"
               clearable
@@ -28,10 +22,10 @@
             <el-button
               type="primary"
               size="small"
-              style="margin: 0 16px;"
+              style="margin: 0 16px"
               @click="handleSearch"
               >查询</el-button
-            > 
+            >
             <el-upload
               class="avatar-uploader"
               :action="uploadUrl"
@@ -40,13 +34,15 @@
               :on-error="handleUploadError"
               name="file"
               :headers="headers"
-              :data="{areaId: this.currentClickId}"
+              :data="{ areaId: this.currentClickId }"
               :before-upload="beforeAvatarUpload"
-            ><el-button
+              ><el-button
                 size="small"
                 type="primary"
-                style="height:36px;margin-right:16px"
-              >导入</el-button>
+                style="height: 36px; margin-right: 16px"
+                v-hasPermi="['wpr:farmer:import']"
+                >导入</el-button
+              >
             </el-upload>
             <el-button
               class="filter-item"
@@ -54,16 +50,19 @@
               type="primary"
               icon="el-icon-download"
               @click="downloadExcel()"
-              >下载模板</el-button>
+              v-hasPermi="['wpr:farmer:template:upload']"
+              >下载模板</el-button
+            >
           </div>
           <div class="top-left">
             <el-button
               type="primary"
               size="small"
               @click="addAssociation"
+              v-hasPermi="['wpr:farmer:add']"
               >新增农户
-              </el-button
-            ></div>
+            </el-button>
+          </div>
         </el-col>
         <el-col :span="24" class="elrow-main__col-bottom">
           <b-table
@@ -74,7 +73,13 @@
             isShowIndex
           >
             <template #status="scope">
-              <span style="display:flex;align-items:center;justify-content:center">
+              <span
+                style="
+                  display: flex;
+                  align-items: center;
+                  justify-content: center;
+                "
+              >
                 <span class="status"></span>
                 {{ scope.row.name }}
               </span>
@@ -86,6 +91,7 @@
                 type="primary"
                 style="margin-right: 10px"
                 @click="irrigationShowHistory(scope.row)"
+                v-hasPermi="['wpr:farmer:Irrigation:records']"
                 >灌溉记录</el-link
               >
               <el-link
@@ -93,75 +99,91 @@
                 :underline="false"
                 type="primary"
                 style="margin-right: 10px"
+                v-hasPermi="['wpr:farmer:edit']"
                 @click="editFarmerHandler(scope.row)"
-              >修改</el-link>
+                >修改</el-link
+              >
               <el-link
                 size="small"
                 :underline="false"
                 type="primary"
                 style="margin-right: 10px"
+                v-hasPermi="['wpr:farmer:info']"
                 @click="showDetails(scope.row)"
-              >详情</el-link>
+                >详情</el-link
+              >
               <el-link
                 slot="reference"
                 size="small"
                 :underline="false"
                 type="danger"
                 style="margin-right: 10px"
+                v-hasPermi="['wpr:farmer:delete']"
                 @click="deleteRow(scope.row)"
-              >删除</el-link>
+                >删除</el-link
+              >
             </template>
           </b-table>
         </el-col>
       </el-card>
     </el-col>
-  <added-farmers
-    :visible.sync="associationManageShow"
-    :treeData="treeDatas"
-    :editFarmerData="editFarmerData"
-    :isEdit="isEdit"
-    :currentClickId="currentClickId"
-    @refresh="handleSearch"
-  />
-  <farmer-management 
-    :visible.sync="farmerManageShow"
-    :detailsData="detailsData"
-  />
-  <irrigation-record
-    :visible.sync="irrigationShow"
-    :irrigationDetail="irrigationDetail"
-  />
+    <added-farmers
+      :visible.sync="associationManageShow"
+      :treeData="treeDatas"
+      :editFarmerData="editFarmerData"
+      :isEdit="isEdit"
+      :currentClickId="currentClickId"
+      @refresh="handleSearch"
+    />
+    <farmer-management
+      :visible.sync="farmerManageShow"
+      :detailsData="detailsData"
+    />
+    <irrigation-record
+      :visible.sync="irrigationShow"
+      :irrigationDetail="irrigationDetail"
+    />
   </el-row>
 </template>
 
 <script>
-import { getToken } from "@/utils/auth";
-import { Message } from 'element-ui'
-import { getTree } from '@/api/tree.js'
-import { getWaterrightList } from '@/api/waterright/index.js'
-import { getFarmerList,deleteFarmer,getFarmerDetail } from '@/api/farmer/list.js'
+import { getToken } from '@/utils/auth';
+import { Message } from 'element-ui';
+import { getTree } from '@/api/tree.js';
+import { getWaterrightList } from '@/api/waterright/index.js';
+import {
+  getFarmerList,
+  deleteFarmer,
+  getFarmerDetail
+} from '@/api/farmer/list.js';
 import BTable from '@/components/Table/index.vue';
-import DataReportLeft from '@/components/DataReportLeft/index.vue'
-import AddedFarmers from './components/addedFarmers.vue'
+import DataReportLeft from '@/components/DataReportLeft/index.vue';
+import AddedFarmers from './components/addedFarmers.vue';
 import FarmerManagement from './components/farmerManagement.vue';
 import IrrigationRecord from './components/IrrigationRecord.vue';
 import { assign, omit } from 'lodash-es';
 
 export default {
   name: 'peasantHouseholdManage',
-  components: { BTable,DataReportLeft,AddedFarmers,FarmerManagement,IrrigationRecord },
+  components: {
+    BTable,
+    DataReportLeft,
+    AddedFarmers,
+    FarmerManagement,
+    IrrigationRecord
+  },
   data() {
     return {
-      uploadUrl: process.env.VUE_APP_BASE_API + "/wpr/farmer/import", // 上传的图片服务器地址
+      uploadUrl: process.env.VUE_APP_BASE_API + '/wpr/farmer/import', // 上传的图片服务器地址
       headers: {
-        Authorization: "Bearer " + getToken()
+        Authorization: 'Bearer ' + getToken()
       },
       visibles: false,
       farmerName: '',
       detailsData: {},
       treeData: [],
       treeDatas: [],
-      currentClick:{},
+      currentClick: {},
       irrigationDetail: {},
       isEdit: false,
       loading: false,
@@ -171,7 +193,7 @@ export default {
       editFarmerData: {},
       farmerId: '',
       requestData: {},
-      currentClickId:'',
+      currentClickId: '',
       columns: [
         {
           label: '农户姓名',
@@ -191,17 +213,20 @@ export default {
           prop: 'farmerPhone',
           customRender: '',
           align: 'center'
-        },{
+        },
+        {
           label: '种植面积(亩)',
           prop: 'farmerAreasize',
           customRender: '',
           align: 'center'
-        },{
+        },
+        {
           label: '水权数量(m³)',
           prop: 'farmerWramount',
           customRender: '',
           align: 'center'
-        },{
+        },
+        {
           label: '剩余水权(m³)',
           prop: 'farmerWrbalance',
           customRender: '',
@@ -213,95 +238,98 @@ export default {
           width: 200,
           align: 'center'
         }
-      ],
+      ]
     };
   },
   methods: {
     handleAvatarSuccess(res, file) {
       if (res.code !== '000000') {
-        Message.error(res?.msg)
-        return
-      } else { 
-        Message.success('导入成功')
+        Message.error(res?.msg);
+        return;
+      } else {
+        Message.success('导入成功');
       }
     },
     handleUploadError() {
-      Message.error("图片插入失败");
+      Message.error('图片插入失败');
     },
     beforeAvatarUpload(file) {
       this.requestData = {
         areaId: this.currentClickId
-      }
+      };
     },
     downloadExcel() {
-      const href = process.env.NODE_ENV === 'production' ? "../../../wpr/static/template.xlsx" : "../../../static/template.xlsx"
-      let a = document.createElement("a");
+      const href =
+        process.env.NODE_ENV === 'production'
+          ? '../../../wpr/static/template.xlsx'
+          : '../../../static/template.xlsx';
+      let a = document.createElement('a');
       a.href = href;
-      a.download = "农户信息统计表.xlsx";
-      a.style.display = "none";
+      a.download = '农户信息统计表.xlsx';
+      a.style.display = 'none';
       document.body.appendChild(a);
       a.click();
       a.remove();
     },
     editFarmerHandler(row) {
-      this.associationManageShow = true
-      this.isEdit = true
-      this.editFarmerData = row
+      this.associationManageShow = true;
+      this.isEdit = true;
+      this.editFarmerData = row;
     },
     async getDetail(farmerId) {
-      const res  = await getFarmerDetail({
+      const res = await getFarmerDetail({
         farmerId
-      })
-      this.detailsData = res?.data
+      });
+      this.detailsData = res?.data;
     },
     async getWaterrighTreetList(currentClickId) {
-      const date = new Date()
-      const waterrightYear = date.getFullYear()
+      const date = new Date();
+      const waterrightYear = date.getFullYear();
       const res = await getWaterrightList({
         waterrightYear
-      })
-      this.treeDatas = res?.data ?? []
+      });
+      this.treeDatas = res?.data ?? [];
     },
     async loadData(parameter) {
-      if(!this.currentClickId ) {
-        const treeList = this.$store.state.tree.treeList
-        let res = []
+      if (!this.currentClickId) {
+        const treeList = this.$store.state.tree.treeList;
+        let res = [];
         if (treeList.code === '000000') {
-          res = treeList
+          res = treeList;
         } else {
-          res = await getTree()
-          this.$store.dispatch('tree/setTree', res)
+          res = await getTree();
+          this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data
-        this.currentClick = res?.data[0]
-        this.currentClickId = this.currentClick?.cusareaId
-        this.getWaterrighTreetList(this.currentClickId)
+        this.treeData = res?.data;
+        this.currentClick = res?.data[0];
+        this.currentClickId = this.currentClick?.cusareaId;
+        this.getWaterrighTreetList(this.currentClickId);
       }
       const params = {
         farmerName: this.farmerName,
         areaId: this.currentClickId
-      }
+      };
       const payload = omit(assign({}, parameter, params), []);
-      return getFarmerList(payload)
+      return getFarmerList(payload);
     },
     setCurrentData(areaId) {
-      this.currentClickId = areaId
+      this.currentClickId = areaId;
       this.$refs.tableRef.refresh(false);
     },
     irrigationShowHistory(row) {
-      this.irrigationDetail = row
-      this.irrigationShow = true
+      this.irrigationDetail = row;
+      this.irrigationShow = true;
     },
     // 详情
-    showDetails(row){
-      this.farmerManageShow = true
-      this.farmerId = row.farmerId
-      this.getDetail(row.farmerId)
+    showDetails(row) {
+      this.farmerManageShow = true;
+      this.farmerId = row.farmerId;
+      this.getDetail(row.farmerId);
     },
     addAssociation() {
-      this.isEdit = false
-      this.editFarmerData = {}
-      this.associationManageShow = true
+      this.isEdit = false;
+      this.editFarmerData = {};
+      this.associationManageShow = true;
     },
     handleSearch() {
       this.$refs.tableRef.refresh(true);
@@ -310,23 +338,21 @@ export default {
       this.$refs.tableRef.refresh(false);
     },
     deleteRow(row) {
-      this.$modal
-      .confirm(`是否确认删除农户${row.farmerName}`)
-      .then(()=> {
+      this.$modal.confirm(`是否确认删除农户${row.farmerName}`).then(() => {
         deleteFarmer({
           farmerIds: row.farmerId
         }).then(() => {
-          Message({ message: "删除成功", type: 'success' });
-          this.handlerChange()
-        })
-      })
+          Message({ message: '删除成功', type: 'success' });
+          this.handlerChange();
+        });
+      });
     }
   }
 };
 </script>
 
 <style lang="scss" scoped>
-.el-row-container{
+.el-row-container {
   height: 100%;
 }
 .elrow-main__col-top {
@@ -346,7 +372,7 @@ export default {
     }
   }
 }
-.status{
+.status {
   display: inline-block;
   width: 8px;
   height: 8px;

+ 154 - 123
src/views/waterCardManage/index.vue

@@ -1,39 +1,37 @@
 <template>
-  <el-row  class="el-row-container" v-loading="loading">
+  <el-row class="el-row-container" v-loading="loading">
     <el-col
       v-if="!detailType"
       :span="4"
-      style="height:100%;padding-bottom:32px;"
+      style="height: 100%; padding-bottom: 32px"
     >
-    <el-card style="margin:16px;height: 100%; overflow-y: auto">
-      <data-report-left
-        @setCurrentData="setCurrentData"
-        :treeData="treeData"
-      ></data-report-left>
-    </el-card>
+      <el-card style="margin: 16px; height: 100%; overflow-y: auto">
+        <data-report-left
+          @setCurrentData="setCurrentData"
+          :treeData="treeData"
+        ></data-report-left>
+      </el-card>
     </el-col>
     <el-col
       v-show="!detailType"
       :span="20"
-      style="padding: 16px 16px 16px 0;  height: 100%"
+      style="padding: 16px 16px 16px 0; height: 100%"
     >
       <el-card style="height: 100%; overflow-y: auto">
         <el-col :span="24" class="elrow-main__col-top">
           <div>
-            <el-select 
-              placeholder="用户卡号" 
-              v-model="labelType"
-            >
+            <el-select placeholder="用户卡号" v-model="labelType">
               <el-option
                 v-for="item in options"
                 :key="item.value"
                 :label="item.label"
-                :value="item.value">
+                :value="item.value"
+              >
               </el-option>
             </el-select>
             <el-input
               v-model="inputContent"
-              style="width: 250px;margin:0 16px;"
+              style="width: 250px; margin: 0 16px"
               placeholder="请输入内容"
               @keyup.enter.native="handleSearch"
               clearable
@@ -41,19 +39,17 @@
             <el-select
               placeholder="IC卡状态"
               v-model="cardStatus"
-              style="margin-right:16px"
+              style="margin-right: 16px"
             >
               <el-option
                 v-for="item in icType"
                 :key="item.value"
                 :label="item.label"
-                :value="item.value">
+                :value="item.value"
+              >
               </el-option>
             </el-select>
-            <el-button
-              type="primary"
-              size="small"
-              @click="handleSearch"
+            <el-button type="primary" size="small" @click="handleSearch"
               >查询</el-button
             >
           </div>
@@ -62,9 +58,10 @@
               type="primary"
               size="small"
               @click="addICard"
+              v-hasPermi="['wpr:card:add']"
               >新增IC卡
-              </el-button
-            ></div>
+            </el-button>
+          </div>
         </el-col>
         <el-col :span="24" class="elrow-main__col-bottom">
           <b-table
@@ -75,12 +72,24 @@
             isShowIndex
           >
             <template #status="scope">
-              <span style="display:flex;align-items:center;justify-content:center">
+              <span
+                style="
+                  display: flex;
+                  align-items: center;
+                  justify-content: center;
+                "
+              >
                 {{ scope.row.cardStatusContent }}
               </span>
             </template>
             <template #cardAmount="scope">
-              <span style="display:flex;align-items:center;justify-content:center">
+              <span
+                style="
+                  display: flex;
+                  align-items: center;
+                  justify-content: center;
+                "
+              >
                 {{ Number(scope.row.cardAmount).toFixed(2) }}
               </span>
             </template>
@@ -88,9 +97,10 @@
               <el-link
                 size="small"
                 :underline="false"
-                :type="scope.row.cardStatus == '2'?'info':'primary'"
+                :type="scope.row.cardStatus == '2' ? 'info' : 'primary'"
                 style="margin-right: 10px"
-                @click="editCardHandler(scope.row,2)"
+                @click="editCardHandler(scope.row, 2)"
+                v-hasPermi="['wpr:card:logoff']"
                 >注销</el-link
               >
               <el-link
@@ -99,23 +109,29 @@
                 :underline="false"
                 type="primary"
                 style="margin-right: 10px"
-                @click="editCardHandler(scope.row,1)"
-              >挂失</el-link>
+                @click="editCardHandler(scope.row, 1)"
+                v-hasPermi="['wpr:card:loss']"
+                >挂失</el-link
+              >
               <el-link
                 size="small"
                 v-if="scope.row.cardStatus == '1'"
                 :underline="false"
                 type="primary"
                 style="margin-right: 10px"
-                @click="editCardHandler(scope.row,0)"
-              >解挂</el-link>
+                @click="editCardHandler(scope.row, 0)"
+                v-hasPermi="['wpr:card:unhook']"
+                >解挂</el-link
+              >
               <el-link
                 size="small"
                 :underline="false"
                 type="danger"
                 style="margin-right: 10px"
                 @click="deleteCardHandler(scope.row)"
-              >删除</el-link>
+                v-hasPermi="['wpr:card:delete']"
+                >删除</el-link
+              >
               <el-link
                 v-if="scope.row.cardStatus !== '2'"
                 size="small"
@@ -123,20 +139,24 @@
                 type="warning"
                 style="margin-right: 10px"
                 @click="rechargeCardHandler(scope.row)"
-              >充值</el-link>
+                v-hasPermi="['wpr:card:recharge']"
+                >充值</el-link
+              >
               <el-link
                 size="small"
                 :underline="false"
                 type="primary"
                 style="margin-right: 10px"
                 @click="changeDataDetailShow(scope.row)"
-              >数据详情</el-link>
+                v-hasPermi="['wpr:card:info']"
+                >数据详情</el-link
+              >
             </template>
           </b-table>
         </el-col>
       </el-card>
     </el-col>
-    <AddedICCard 
+    <AddedICCard
       :visible.sync="associationManageShow"
       :areaId="currentClickId"
       :userList="userList"
@@ -147,7 +167,7 @@
       :rechargeCardData="rechargeCardData"
       @refresh="handlerChange"
     />
-    <data-detail 
+    <data-detail
       v-if="detailType"
       :detailCardId="detailCardId"
       @backPage="showList"
@@ -157,52 +177,61 @@
 
 <script>
 import { Message } from 'element-ui';
-import { getFarmerList } from '@/api/farmer/list.js'
-import { getTree } from '@/api/tree.js'
-import { getCardList,editCard,deleteCard } from '@/api/card/index.js'
+import { getFarmerList } from '@/api/farmer/list.js';
+import { getTree } from '@/api/tree.js';
+import { getCardList, editCard, deleteCard } from '@/api/card/index.js';
 import BTable from '@/components/Table/index.vue';
-import DataReportLeft from '@/components/DataReportLeft/index.vue'
-import AddedICCard from './components/addedICCard.vue'
+import DataReportLeft from '@/components/DataReportLeft/index.vue';
+import AddedICCard from './components/addedICCard.vue';
 import RechargeCard from './components/rechargeCard.vue';
 import DataDetail from './dataDetail.vue';
 import { assign, omit } from 'lodash-es';
 
 export default {
   name: 'waterCardManage',
-  components: { BTable,DataReportLeft,AddedICCard,RechargeCard,DataDetail },
+  components: { BTable, DataReportLeft, AddedICCard, RechargeCard, DataDetail },
   data() {
     return {
-      inputContent:'',
-      labelType:0,
-      options:[{
-        value: 0,
-        label: '农户手机号',
-      },{
-        value: 1,
-        label: '用户卡号',
-      },{
-        value: 2,
-        label: '农户姓名',
-      }],
+      inputContent: '',
+      labelType: 0,
+      options: [
+        {
+          value: 0,
+          label: '农户手机号'
+        },
+        {
+          value: 1,
+          label: '用户卡号'
+        },
+        {
+          value: 2,
+          label: '农户姓名'
+        }
+      ],
       cardStatus: '',
-      icType: [{
-        value:'',
-        label:'全部'
-      },{
-        value: 0,
-        label: '正常'
-      },{
-        value: 1,
-        label: '挂失'
-      },{
-        value: 2,
-        label: '注销'
-      }],
+      icType: [
+        {
+          value: '',
+          label: '全部'
+        },
+        {
+          value: 0,
+          label: '正常'
+        },
+        {
+          value: 1,
+          label: '挂失'
+        },
+        {
+          value: 2,
+          label: '注销'
+        }
+      ],
       detailType: false,
       form: {
         productName: ''
       },
-      currentClickId:'',
+      currentClickId: '',
       treeData: [],
       loading: false,
       associationManageShow: false,
@@ -229,22 +258,26 @@ export default {
           prop: 'cardStatusContent',
           customRender: 'status',
           align: 'center'
-        },{
+        },
+        {
           label: '停泵下限',
           prop: 'phone',
           customRender: '',
           align: 'center'
-        },{
+        },
+        {
           label: '卡内余额',
           prop: 'cardAmount',
           customRender: 'cardAmount',
           align: 'center'
-        },{
+        },
+        {
           label: '累计用水量',
           prop: 'waterNumTotal',
           customRender: '',
           align: 'center'
-        },{
+        },
+        {
           label: '累计用电量',
           prop: 'electricNumTotal',
           customRender: '',
@@ -261,89 +294,87 @@ export default {
   },
   methods: {
     // 注销 cardStatus = 2,解挂 cardStatus = 0,挂失 cardStatus = 1
-    async editCardHandler(row,cardStatus) {
+    async editCardHandler(row, cardStatus) {
       // if(cardStatus == '2')return
-      const { farmerId,cardNo,cardAmount,cardId } = row
+      const { farmerId, cardNo, cardAmount, cardId } = row;
       await editCard({
         farmerId,
         cardNo,
         cardAmount,
         cardId,
         cardStatus
-      })
-      this.handlerChange()
+      });
+      this.handlerChange();
     },
     // 删除
-    deleteCardHandler(row){
-      const {cardId,farmerName} = row
-      this.$modal
-      .confirm(`是否确认删除农户${farmerName}`)
-      .then(()=> {
+    deleteCardHandler(row) {
+      const { cardId, farmerName } = row;
+      this.$modal.confirm(`是否确认删除农户${farmerName}`).then(() => {
         deleteCard({
           cardIds: cardId
         }).then(() => {
-          Message({ message: "删除成功", type: 'success' });
-          this.handlerChange()
-        })
-      })
+          Message({ message: '删除成功', type: 'success' });
+          this.handlerChange();
+        });
+      });
     },
     // 充值
     async rechargeCardHandler() {},
-    async searchHandler(farmerName,areaId) {
+    async searchHandler(farmerName, areaId) {
       const res = await getFarmerList({
         farmerName,
         areaId,
         pageNum: 1,
         pageSize: 9999999
-      })
-      this.userList = res.data
+      });
+      this.userList = res.data;
     },
     setCurrentData(areaId) {
-      this.currentClickId = areaId
+      this.currentClickId = areaId;
       this.$refs.tableRef.refresh(false);
-      this.searchHandler(this.farmerName,areaId)
+      this.searchHandler(this.farmerName, areaId);
     },
-    showList(){
-      this.detailType = false
+    showList() {
+      this.detailType = false;
     },
     async addICard() {
-      this.associationManageShow = true
+      this.associationManageShow = true;
     },
     async loadData(parameter) {
-      if(!this.currentClickId ) {
-        const treeList = this.$store.state.tree.treeList
-        let res = []
+      if (!this.currentClickId) {
+        const treeList = this.$store.state.tree.treeList;
+        let res = [];
         if (treeList.code === '000000') {
-          res = treeList
+          res = treeList;
         } else {
-          res = await getTree()
-          this.$store.dispatch('tree/setTree', res)
+          res = await getTree();
+          this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data
-        this.currentClick = res?.data[0]
-        this.currentClickId = this.currentClick?.cusareaId
+        this.treeData = res?.data;
+        this.currentClick = res?.data[0];
+        this.currentClickId = this.currentClick?.cusareaId;
       }
-      this.searchHandler(this.farmerName,this.currentClickId)
-      return this.getTableData(parameter,this.currentClickId);
+      this.searchHandler(this.farmerName, this.currentClickId);
+      return this.getTableData(parameter, this.currentClickId);
     },
     changeDataDetailShow(row) {
-      this.detailType = true
-      const {cardId} = row
-      this.detailCardId = cardId
+      this.detailType = true;
+      const { cardId } = row;
+      this.detailCardId = cardId;
     },
-    getTableData(parameter,areaId) {
-      switch(this.labelType){
+    getTableData(parameter, areaId) {
+      switch (this.labelType) {
         case 0:
-          this.farmerPhone = this.inputContent
-          break
+          this.farmerPhone = this.inputContent;
+          break;
         case 1:
-          this.cardNo = this.inputContent
-          break
+          this.cardNo = this.inputContent;
+          break;
         case 2:
-          this.farmerName = this.inputContent
-          break
+          this.farmerName = this.inputContent;
+          break;
         default:
-          this.farmerPhone = this.inputContent
+          this.farmerPhone = this.inputContent;
       }
       const params = {
         farmerName: this.farmerName,
@@ -351,26 +382,26 @@ export default {
         farmerPhone: this.farmerPhone,
         areaId,
         cardStatus: this.cardStatus
-      }
+      };
       const payload = omit(assign({}, parameter, params), []);
-      return getCardList(payload)
+      return getCardList(payload);
     },
     handleSearch() {
       this.$refs.tableRef.refresh(true);
     },
-    handlerChange() { 
+    handlerChange() {
       this.$refs.tableRef.refresh(false);
     },
     rechargeCardHandler(row) {
-      this.rechargeCardData = row
-      this.rechargeShow = true
+      this.rechargeCardData = row;
+      this.rechargeShow = true;
     }
   }
 };
 </script>
 
 <style lang="scss" scoped>
-.el-row-container{
+.el-row-container {
   height: 100%;
 }
 .elrow-main__col-top {
@@ -390,7 +421,7 @@ export default {
     }
   }
 }
-.status{
+.status {
   display: inline-block;
   width: 15px;
   height: 15px;

+ 62 - 66
src/views/waterManage/index.vue

@@ -1,12 +1,9 @@
 <template>
   <el-row class="el-row-container" v-loading="loading">
-    <el-col
-      :span="24"
-      style="padding: 16px; height: 100%"
-    >
+    <el-col :span="24" style="padding: 16px; height: 100%">
       <el-card style="height: 100%; overflow-y: auto">
         <el-col :span="24" class="elrow-main__col-top">
-          <div style="display: flex;">
+          <div style="display: flex">
             <select-tree
               v-model="form.goodsName"
               style="width: 250px"
@@ -17,14 +14,11 @@
             ></select-tree>
             <el-input
               v-model="assocName"
-              style="width: 250px;margin:0 16px;"
+              style="width: 250px; margin: 0 16px"
               placeholder="请输入用户协会名称"
               clearable
             />
-            <el-button
-              type="primary"
-              size="small"
-              @click="handleSearch"
+            <el-button type="primary" size="small" @click="handleSearch"
               >查询</el-button
             >
           </div>
@@ -33,8 +27,10 @@
               type="primary"
               size="small"
               @click="addAssociation"
+              v-hasPermi="['wpr:society:add']"
               >新增协会</el-button
-            ></div>
+            >
+          </div>
         </el-col>
         <el-col :span="24" class="elrow-main__col-bottom">
           <b-table
@@ -51,52 +47,54 @@
                 type="primary"
                 style="margin-right: 10px"
                 @click="editRowHandler(scope.row)"
+                v-hasPermi="['wpr:society:edit']"
                 >修改</el-link
               >
               <el-link
-              size="small"
-              :underline="false"
-              type="danger"
-              style="margin-right: 10px"
-              @click="deleteRowHandler(scope.row)"
-              >删除</el-link
+                size="small"
+                :underline="false"
+                type="danger"
+                style="margin-right: 10px"
+                @click="deleteRowHandler(scope.row)"
+                v-hasPermi="['wpr:society:delete']"
+                >删除</el-link
               >
             </template>
           </b-table>
         </el-col>
       </el-card>
     </el-col>
-  <association-manage
-    :visible.sync="associationManageShow"
-    :treeData="treeData"
-    :userList="userList"
-    @getList="handleSearch"
-    :typeAssoc="typeAssoc"
-    :editRow="editRow"
-  />
+    <association-manage
+      :visible.sync="associationManageShow"
+      :treeData="treeData"
+      :userList="userList"
+      @getList="handleSearch"
+      :typeAssoc="typeAssoc"
+      :editRow="editRow"
+    />
   </el-row>
 </template>
 
 <script>
-import { getAssocList, deleteAssoc } from '@/api/assoc/index.js'
-import { listUser } from '@/api/system/user.js'
+import { getAssocList, deleteAssoc } from '@/api/assoc/index.js';
+import { listUser } from '@/api/system/user.js';
 import BTable from '@/components/Table/index.vue';
-import AssociationManage from './component/associationManage.vue'
+import AssociationManage from './component/associationManage.vue';
 import SelectTree from '@/components/SelectTree';
-import { getTree } from '@/api/tree.js'
-import { Message } from 'element-ui'
+import { getTree } from '@/api/tree.js';
+import { Message } from 'element-ui';
 import { assign, omit } from 'lodash-es';
 
 export default {
-  name:"waterManage",
-  components: { BTable,AssociationManage, SelectTree },
+  name: 'waterManage',
+  components: { BTable, AssociationManage, SelectTree },
   data() {
     return {
       form: {
         productName: ''
       },
       userList: [],
-      treeData:[],
+      treeData: [],
       loading: false,
       cusareaName: '',
       associationManageShow: false,
@@ -137,58 +135,56 @@ export default {
       ]
     };
   },
-  mounted() { 
-    this.searchHandler()
+  mounted() {
+    this.searchHandler();
   },
   methods: {
     async searchHandler() {
       const res = await listUser({
         pageSize: 99999
-      })
-      this.userList = res.data
+      });
+      this.userList = res.data;
     },
     addAssociation() {
-      this.typeAssoc = 'add'
-      this.editRow = {}
-      this.associationManageShow = true
+      this.typeAssoc = 'add';
+      this.editRow = {};
+      this.associationManageShow = true;
     },
     // 删除
     deleteRowHandler(row) {
-      const { assocId: assocIds } = row
-      this.$modal
-        .confirm(`是否确认删除`)
-        .then(() => {
-          deleteAssoc({
-            assocIds
-          }).then(() => {
-            Message({ message: "删除成功", type: 'success' });
-            this.handlerChange()
-          })
-      })
+      const { assocId: assocIds } = row;
+      this.$modal.confirm(`是否确认删除`).then(() => {
+        deleteAssoc({
+          assocIds
+        }).then(() => {
+          Message({ message: '删除成功', type: 'success' });
+          this.handlerChange();
+        });
+      });
     },
     async loadData(parameter) {
       if (!this.areaId) {
-        const treeList = this.$store.state.tree.treeList
-        let res = []
+        const treeList = this.$store.state.tree.treeList;
+        let res = [];
         if (treeList.code === '000000') {
-          res = treeList
+          res = treeList;
         } else {
-          res = await getTree()
-          this.$store.dispatch('tree/setTree', res)
+          res = await getTree();
+          this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data
-        this.cusareaName ||= this.treeData[0].cusareaName
-        this.areaId = this.treeData[0].cusareaId
+        this.treeData = res?.data;
+        this.cusareaName ||= this.treeData[0].cusareaName;
+        this.areaId = this.treeData[0].cusareaId;
       }
       const params = {
         assocName: this.assocName,
         areaId: this.areaId
-      }
+      };
       const payload = omit(assign({}, parameter, params), []);
-      return getAssocList(payload)
+      return getAssocList(payload);
     },
     handlerClick(value) {
-      this.areaId = value?.cusareaId
+      this.areaId = value?.cusareaId;
     },
     handleSearch() {
       this.$refs.tableRef.refresh(true);
@@ -198,16 +194,16 @@ export default {
     },
     // 修改
     editRowHandler(row) {
-      this.typeAssoc = 'edit'
-      this.editRow = row
-      this.associationManageShow = true
+      this.typeAssoc = 'edit';
+      this.editRow = row;
+      this.associationManageShow = true;
     }
   }
 };
 </script>
 
 <style lang="scss" scoped>
-.el-row-container{
+.el-row-container {
   height: 100%;
 }
 .elrow-main__col-top {

+ 47 - 59
src/views/waterMarket/index.vue

@@ -1,31 +1,20 @@
 <template>
   <el-row class="el-row-container" v-loading="loading">
-    <el-col
-      :span="24"
-      style="padding: 16px; height: 100%"
-    >
+    <el-col :span="24" style="padding: 16px; height: 100%">
       <el-card style="height: 100%; overflow-y: auto">
         <el-col :span="24" class="elrow-main__col-top">
           <div>
             <el-select
-              style="display:inline-block;width: 100px;margin-right: "
+              style="display: inline-block; width: 100px; margin-right: "
               v-model="roleType"
               @change="changeRoleType"
             >
-              <el-option
-                label="买方"
-                value="0"
-              >
-              </el-option>
-              <el-option
-                label="卖方"
-                value="1"
-              >
-              </el-option>
+              <el-option label="买方" value="0"> </el-option>
+              <el-option label="卖方" value="1"> </el-option>
             </el-select>
             <el-input
               v-model="trxrcdName"
-              style="width: 250px;margin-left: 16px"
+              style="width: 250px; margin-left: 16px"
               :placeholder="placeholder"
               @keyup.enter.native="handleSearch"
               clearable
@@ -37,13 +26,10 @@
               :default-time="['00:00:00', '23:59:59']"
               start-placeholder="开始日期"
               end-placeholder="结束日期"
-              style="width: 300px; margin:0 16px"
+              style="width: 300px; margin: 0 16px"
             >
             </el-date-picker>
-            <el-button
-              type="primary"
-              size="small"
-              @click="handleSearch"
+            <el-button type="primary" size="small" @click="handleSearch"
               >查询</el-button
             >
           </div>
@@ -52,9 +38,10 @@
               type="primary"
               size="small"
               @click="addAssociation"
+              v-hasPermi="['wpr:trade:add']"
               >新增交易
-              </el-button
-            ></div>
+            </el-button>
+          </div>
         </el-col>
         <el-col :span="24" class="elrow-main__col-bottom">
           <b-table
@@ -74,13 +61,13 @@
                 >修改</el-link
               >
               <el-link
-              size="small"
-              :underline="false"
-              type="danger"
-              style="margin-right: 10px"
-              @click="download(scope.row)"
-              >删除</el-link
-            >
+                size="small"
+                :underline="false"
+                type="danger"
+                style="margin-right: 10px"
+                @click="download(scope.row)"
+                >删除</el-link
+              >
             </template>
           </b-table>
         </el-col>
@@ -95,21 +82,21 @@
 </template>
 
 <script>
-import { getFarmerList } from '@/api/farmer/list.js'
-import { getTrxrcdList } from '@/api/trxrcd/index.js'
+import { getFarmerList } from '@/api/farmer/list.js';
+import { getTrxrcdList } from '@/api/trxrcd/index.js';
 import BTable from '@/components/Table/index.vue';
-import WaterDeal from './component/waterDeal.vue'
+import WaterDeal from './component/waterDeal.vue';
 import { assign, omit } from 'lodash-es';
 
 export default {
-  name:'waterMarket',
+  name: 'waterMarket',
   components: { BTable, WaterDeal },
   data() {
     return {
       placeholder: '请输入买方姓名',
       roleType: '0',
-      dateValue:"",
-      trxrcdName:'',
+      dateValue: '',
+      trxrcdName: '',
       loading: false,
       associationManageShow: false,
       columns: [
@@ -136,12 +123,14 @@ export default {
           prop: 'trxrcdPrice',
           customRender: '',
           align: 'center'
-        },{
+        },
+        {
           label: '成交金额(元)',
           prop: 'trxrcdMoney',
           customRender: '',
           align: 'center'
-        },{
+        },
+        {
           label: '成交时间',
           prop: 'trxrcdCreateddate',
           customRender: '',
@@ -152,58 +141,57 @@ export default {
     };
   },
   mounted() {
-    this.getFarmerListHandler()
+    this.getFarmerListHandler();
   },
   methods: {
     async getFarmerListHandler() {
-      const res = await getFarmerList()
-      this.farmerList = res.data
+      const res = await getFarmerList();
+      this.farmerList = res.data;
     },
     changeRoleType(type) {
-      this.placeholder = type == 1 ? '请输入卖方姓名':'请输入买方姓名'
+      this.placeholder = type == 1 ? '请输入卖方姓名' : '请输入买方姓名';
     },
     addAssociation() {
-      this.associationManageShow = true
+      this.associationManageShow = true;
     },
     loadData(parameter) {
       return this.getTableData(parameter);
     },
     getTableData(parameter) {
       if (this.roleType == '0') {
-        this.buyerName = this.trxrcdName
-        this.sellerName = ''
-      } else { 
-        this.sellerName = this.trxrcdName
-        this.buyerName = ''
+        this.buyerName = this.trxrcdName;
+        this.sellerName = '';
+      } else {
+        this.sellerName = this.trxrcdName;
+        this.buyerName = '';
       }
-      const startTime = this.dateValue[0] || ''
-      const endTime = this.dateValue[1] || ''
+      const startTime = this.dateValue[0] || '';
+      const endTime = this.dateValue[1] || '';
       const params = {
         buyerName: this.buyerName,
         sellerName: this.sellerName,
         startTime,
-        endTime,
-      }
+        endTime
+      };
       const payload = omit(assign({}, parameter, params), []);
-      return getTrxrcdList(payload)
+      return getTrxrcdList(payload);
     },
-    addSuccessHandler() { 
-      this.handleSearch()
+    addSuccessHandler() {
+      this.handleSearch();
     },
     handleSearch() {
       this.$refs.tableRef.refresh(true);
     },
     goDetail(row) {
-      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
+      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno);
     },
-    download(row) {
-    }
+    download(row) {}
   }
 };
 </script>
 
 <style lang="scss" scoped>
-.el-row-container{
+.el-row-container {
   height: 100%;
 }
 .elrow-main__col-top {

+ 59 - 60
src/views/waterSubsidy/index.vue

@@ -1,28 +1,22 @@
 <template>
   <el-row class="el-row-container" v-loading="loading">
-    <el-col
-      :span="24"
-      style="padding: 16px; height: 100%"
-    >
+    <el-col :span="24" style="padding: 16px; height: 100%">
       <el-card style="height: 100%; overflow-y: auto">
         <el-col :span="24" class="elrow-main__col-top">
-          <div style="display: flex;">
-            <select-tree 
-              :placeholder="'年份'" 
+          <div style="display: flex">
+            <select-tree
+              :placeholder="'年份'"
               style="width: 250px"
               :treeData="treeData"
               @handlerClick="handlerClick"
               :checkVal="cusareaName"
             ></select-tree>
             <el-input
-              style="width: 250px;margin: 0 16px;"
+              style="width: 250px; margin: 0 16px"
               placeholder="请输入关键字"
               v-model="subsidypolicyTitle"
             />
-            <el-button
-              type="primary"
-              size="small"
-              @click="handleSearch"
+            <el-button type="primary" size="small" @click="handleSearch"
               >查询</el-button
             >
           </div>
@@ -31,9 +25,10 @@
               type="primary"
               size="small"
               @click="addAssociation"
+              v-hasPermi="['wpr:policy:add']"
               >发布新政策
-              </el-button
-            ></div>
+            </el-button>
+          </div>
         </el-col>
         <el-col :span="24" class="elrow-main__col-bottom">
           <b-table
@@ -61,16 +56,18 @@
                 type="primary"
                 style="margin-right: 10px"
                 @click="editHandler(scope.row)"
+                v-hasPermi="['wpr:policy:edit']"
                 >修改</el-link
               >
               <el-link
-              size="small"
-              :underline="false"
-              type="danger"
-              style="margin-right: 10px"
-              @click="deleteHandler(scope.row)"
-              >删除</el-link
-            >
+                size="small"
+                :underline="false"
+                type="danger"
+                style="margin-right: 10px"
+                @click="deleteHandler(scope.row)"
+                v-hasPermi="['wpr:policy:delete']"
+                >删除</el-link
+              >
             </template>
           </b-table>
         </el-col>
@@ -87,24 +84,27 @@
 </template>
 
 <script>
-import { getSubsidyPolicy, deleteSubsidyPolicy } from '@/api/subsidypolicy/index.js'
+import {
+  getSubsidyPolicy,
+  deleteSubsidyPolicy
+} from '@/api/subsidypolicy/index.js';
 import SelectTree from '@/components/SelectTree';
 import BTable from '@/components/Table/index.vue';
-import { getTree } from '@/api/tree.js'
-import newPolicy from './components/newPolicy.vue'
-import { Message } from 'element-ui'
+import { getTree } from '@/api/tree.js';
+import newPolicy from './components/newPolicy.vue';
+import { Message } from 'element-ui';
 import { assign, omit } from 'lodash-es';
 
 export default {
-  name:'waterSubsidy',
-  components: { BTable,newPolicy, SelectTree },
+  name: 'waterSubsidy',
+  components: { BTable, newPolicy, SelectTree },
   data() {
     return {
       form: {
         productName: ''
       },
       policyType: 'add',
-      subsidypolicyTitle:'',
+      subsidypolicyTitle: '',
       loading: false,
       showPolicy: false,
       treeData: [],
@@ -136,7 +136,8 @@ export default {
           prop: 'subsidypolicyCreatorName',
           customRender: '',
           align: 'center'
-        },{
+        },
+        {
           label: '发布时间',
           prop: 'subsidypolicyCreateddate',
           customRender: '',
@@ -150,40 +151,40 @@ export default {
       ]
     };
   },
-  mounted() { 
-    this.dialogImageUrl = process.env.VUE_APP_BASE_API
+  mounted() {
+    this.dialogImageUrl = process.env.VUE_APP_BASE_API;
   },
   methods: {
-    addSuccessHandler() { 
-      this.handleSearch()
+    addSuccessHandler() {
+      this.handleSearch();
     },
     addAssociation() {
-      this.policyType = 'add'
-      this.showPolicy = true
+      this.policyType = 'add';
+      this.showPolicy = true;
     },
     async loadData(parameter) {
       if (!this.areaId) {
-        const treeList = this.$store.state.tree.treeList
-        let res = []
+        const treeList = this.$store.state.tree.treeList;
+        let res = [];
         if (treeList.code === '000000') {
-          res = treeList
+          res = treeList;
         } else {
-          res = await getTree()
-          this.$store.dispatch('tree/setTree', res)
+          res = await getTree();
+          this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data
-        this.cusareaName ||= this.treeData[0].cusareaName
-        this.areaId = this.treeData[0].cusareaId
+        this.treeData = res?.data;
+        this.cusareaName ||= this.treeData[0].cusareaName;
+        this.areaId = this.treeData[0].cusareaId;
       }
       const params = {
         areaIds: this.areaId,
         subsidypolicyTitle: this.subsidypolicyTitle
-      }
+      };
       const payload = omit(assign({}, parameter, params), []);
-      return getSubsidyPolicy(payload)
+      return getSubsidyPolicy(payload);
     },
     handlerClick(value) {
-      this.areaId = value?.cusareaId
+      this.areaId = value?.cusareaId;
     },
     handleSearch() {
       this.$refs.tableRef.refresh(true);
@@ -192,39 +193,37 @@ export default {
       this.$refs.tableRef.refresh(false);
     },
     goDetail(row) {
-      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
+      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno);
     },
     editHandler(row) {
-      this.policyType = 'edit'
+      this.policyType = 'edit';
       const params = {
         subsidypolicyTitle: row?.subsidypolicyTitle,
         src: this.dialogImageUrl + row?.previews,
         subsidypolicyContent: row?.subsidypolicyContent,
         subsidypolicyId: row?.subsidypolicyId,
         resIds: row?.resIds
-      }
-      this.editRow = params
-      this.showPolicy = true
+      };
+      this.editRow = params;
+      this.showPolicy = true;
     },
     deleteHandler(row) {
-      const { subsidypolicyId } = row
-      this.$modal
-      .confirm(`是否确认删除`)
-      .then(() => {
+      const { subsidypolicyId } = row;
+      this.$modal.confirm(`是否确认删除`).then(() => {
         deleteSubsidyPolicy({
           subsidypolicyIds: subsidypolicyId
         }).then(() => {
-          Message({ message: "删除成功", type: 'success' });
-          this.handlerChange()
-        })
-      })
+          Message({ message: '删除成功', type: 'success' });
+          this.handlerChange();
+        });
+      });
     }
   }
 };
 </script>
 
 <style lang="scss" scoped>
-.el-row-container{
+.el-row-container {
   height: 100%;
 }
 .elrow-main__col-top {