xsh 3 سال پیش
والد
کامیت
008bc1dcd0

+ 3 - 0
src/store/index.js

@@ -5,7 +5,10 @@ Vue.use(Vuex)
 
 export default new Vuex.Store({
   state: {
+    // 小于接口
     baseUrl: 'http://122.112.224.199:9000',
+    // 杨迪接口
+    baseTwoUrl: 'http://122.112.224.199:9500',
     selected: 1,
   },
   mutations: {

+ 0 - 1
src/utils/http.js

@@ -5,7 +5,6 @@ import merge from 'lodash/merge'
 
 
 const http = axios.create({
-  baseURL: 'http://192.168.1.171:8210',
   timeout: 1000 * 30,
   // withCredentials: true,
   headers: {

+ 6 - 4
src/views/collectData/collectData.vue

@@ -127,7 +127,7 @@
               border
               stripe
               :header-cell-style="{'text-align':'center', 'background-color': '#F9FAFC', 'padding': '5px 0', 'color': '#666666'}"
-              :cell-style="{'text-align':'center', 'padding': '5px 0'}"
+              :cell-style="{'text-align':'center', 'padding': '5px 0', 'cursor': 'pointer'}"
               height="700"
               row-key="name"
               default-expand-all
@@ -141,8 +141,10 @@
                 width="55">
               </el-table-column>
               <el-table-column
-                label="牧场名"
-                prop="farmName">
+                label="牧场名">
+                <template slot-scope="scope">
+                  <span style="color: #8cc5ff">{{scope.row.farmName}}</span>
+                </template>
               </el-table-column>
               <el-table-column label="母猪存栏">
                 <el-table-column
@@ -426,7 +428,7 @@ export default {
       this.updateSelected(1);
       this.$router.push({
         path: '/',
-        query: {farmCode: row.farmCode, type: 4, isColl: true}
+        query: {farmCode: row.farmCode, type: 4, isColl: true, farmName: row.farmName}
       })
     },
     // 牧场对比

+ 8 - 8
src/views/collectData/update.vue

@@ -6,12 +6,12 @@
     <div slot="title" class="dialog-title">
       编辑牧场
     </div>
-    <el-form 
-      :model="form" 
+    <el-form
+      :model="form"
       :rules="formRule"
-      size="mini" 
-      label-position="left" 
-      label-width="135px" 
+      size="mini"
+      label-position="left"
+      label-width="135px"
       ref="form">
       <el-form-item label="牧场名:" prop="farmName">
         <el-input v-model="form.farmName" disabled></el-input>
@@ -78,7 +78,7 @@ export default {
     }
   },
   computed: {
-    ...mapState(['baseUrl'])
+    ...mapState(['baseUrl', 'baseTwoUrl'])
   },
   methods: {
     init (row) {
@@ -94,7 +94,7 @@ export default {
       this.$refs['form'].validate((valid) => {
         if (valid) {
           this.$http({
-            url: this.$http.adornUrl(`http://122.112.224.199:9500/management/sowranktable/update`),
+            url: this.$http.adornUrl(`${this.baseTwoUrl}/management/sowranktable/update`),
             method: 'post',
             data: this.$http.adornData({
               'id': this.form.id,
@@ -170,4 +170,4 @@ export default {
     padding-right: 50px;
     padding-top: 10px;
   }
-</style>
+</style>

+ 29 - 27
src/views/deviceAdmin/addOrUpdate.vue

@@ -6,13 +6,13 @@
     <div slot="title" class="dialog-title">
       {{ form.id? '编辑设备': '新增设备' }}
     </div>
-    <el-form 
-      :model="form" 
+    <el-form
+      :model="form"
       :rules="formRule"
-      size="mini" 
-      label-position="left" 
-      label-width="135px" 
-      ref="form" 
+      size="mini"
+      label-position="left"
+      label-width="135px"
+      ref="form"
       inline>
       <el-row :gutter="20">
         <el-col :span="12">
@@ -29,17 +29,17 @@
       <el-row :gutter="20">
         <el-col :span="12">
           <el-form-item label="省市县名:" prop="countyCode">
-            <areaZzother 
+            <areaZzother
               @getCityCode="getCityCode"
               style="width: 178px;"
               :countyCode="form.countyCode">
-            </areaZzother>  
+            </areaZzother>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="牧场名:" prop="farmCode">
-            <el-select 
-              v-model="form.farmCode" 
+            <el-select
+              v-model="form.farmCode"
               style="width: 178px;"
               ref="farm"
               @focus="handleFocus('farm', 'countyCode')"
@@ -70,9 +70,9 @@
         <el-col :span="12">
           <el-form-item label="栋舍:" prop="pigpenId">
             <!-- <el-input v-model="form.pigpenId"></el-input> -->
-            <el-select 
-              v-model="form.pigpenId" 
-              ref="pigpen" 
+            <el-select
+              v-model="form.pigpenId"
+              ref="pigpen"
               @focus="handleFocus('pigpen', 'farmCode')"
               @blur="handleBlur"
               style="width: 178px;">
@@ -90,9 +90,9 @@
         <el-col :span="12">
           <el-form-item label="单元:" prop="unitId">
             <!-- <el-input v-model="form.pigpenId"></el-input> -->
-            <el-select 
-              v-model="form.unitId" 
-              ref="unit" 
+            <el-select
+              v-model="form.unitId"
+              ref="unit"
               @focus="handleFocus('unit', 'pigpenId')"
               @blur="handleBlur"
               style="width: 178px;">
@@ -128,6 +128,7 @@
 <script>
 import {mapState} from 'vuex'
 import areaZzother from '../../components/areaZzother.vue'
+import utils from '../../utils/index';
 export default {
   data() {
     return {
@@ -236,7 +237,8 @@ export default {
   methods: {
     init (row) {
       this.visible = true
-      this.form.registerTime = this.getDate(new Date()) // 默认注册时间
+      // this.form.registerTime = this.getDate(new Date()) // 默认注册时间
+      this.form.registerTime = utils.timeDate(new Date().getTime());
       this.$http({
         url: this.$http.adornUrl(`${this.baseUrl}/manager/basepigpen/listAll`),
         method: 'get'
@@ -269,14 +271,14 @@ export default {
     // 获取时间格式:2021-07-28
     getDate (time) {
       let fmt = 'yyyy-MM-dd'
-      var o = { 
-        "M+" : time.getMonth()+1,                 //月份 
-        "d+" : time.getDate(),                    //日 
-        "h+" : time.getHours(),                   //小时 
-        "m+" : time.getMinutes(),                 //分 
-        "s+" : time.getSeconds(),                 //秒 
-        "q+" : Math.floor((time.getMonth()+3)/3), //季度 
-        "S" : time.getMilliseconds()             //毫秒 
+      var o = {
+        "M+" : time.getMonth()+1,                 //月份
+        "d+" : time.getDate(),                    //日
+        "h+" : time.getHours(),                   //小时
+        "m+" : time.getMinutes(),                 //分
+        "s+" : time.getSeconds(),                 //秒
+        "q+" : Math.floor((time.getMonth()+3)/3), //季度
+        "S" : time.getMilliseconds()             //毫秒
       };
       if(/(y+)/.test(fmt)) {
         fmt=fmt.replace(RegExp.$1, (time.getFullYear()+"").substr(4 - RegExp.$1.length))
@@ -286,7 +288,7 @@ export default {
           fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)))
         }
       }
-      return fmt; 
+      return fmt;
     },
     // 省市县
     getCityCode (val) {
@@ -468,4 +470,4 @@ export default {
     padding-right: 50px;
     padding-top: 10px;
   }
-</style>
+</style>

+ 24 - 11
src/views/deviceAdmin/deviceAdmin.vue

@@ -387,15 +387,15 @@ export default {
           'acqStatus': this.searchForm.acqStatus?? undefined,
           'canStatus': this.searchForm.canStatus?? undefined
         }, false)
-      }).then(async({data}) => {
-        let res = await this.$http({
-          url: this.$http.adornUrl(`${this.baseUrl}/manager/collectorregister/selectPcEveryStatusCollectors`),
-          method: 'get'
-        })
-        this.boxList[0].value = res.data.data.total
-        this.boxList[1].value = res.data.data.normal
-        this.boxList[2].value = res.data.data.abnormal
-        this.boxList[3].value = res.data.data.logout
+      }).then(({data}) => {
+        // let res = await this.$http({
+        //   url: this.$http.adornUrl(`${this.baseUrl}/manager/collectorregister/selectPcEveryStatusCollectors`),
+        //   method: 'get'
+        // })
+        // this.boxList[0].value = res.data.data.total
+        // this.boxList[1].value = res.data.data.normal
+        // this.boxList[2].value = res.data.data.abnormal
+        // this.boxList[3].value = res.data.data.logout
         this.tableData = data.page.list
         this.totalPages = data.page.totalCount
         this.dataListLoading = false
@@ -403,6 +403,18 @@ export default {
         this.dataListLoading = false
       })
     },
+    initState() {
+      this.$http({
+        url: this.$http.adornUrl(`${this.baseUrl}/manager/collectorregister/selectPcEveryStatusCollectors`),
+        method: 'get'
+      })
+      .then(res => {
+        this.boxList[0].value = res.data.data.total
+        this.boxList[1].value = res.data.data.normal
+        this.boxList[2].value = res.data.data.abnormal
+        this.boxList[3].value = res.data.data.logout
+      })
+    },
     getCountyCode (code) {
       let arr = code.split(',')
       let len = arr.length
@@ -432,8 +444,8 @@ export default {
     handleCheck (row) {
       // 组件间传值`/deviceInfo/${row.id}`
       this.$router.push({
-        name: 'deviceInfo',
-        params: {
+        path: '/deviceInfo',
+        query: {
           id: row.id,
           deviceCode: row.deviceCode
         }
@@ -536,6 +548,7 @@ export default {
   },
   mounted() {
     this.init()
+    this.initState()
   }
 }
 </script>

+ 6 - 5
src/views/deviceAdmin/deviceInfo.vue

@@ -16,7 +16,7 @@
           </tr>
           <tr>
             <th>省市县</th><td>{{ info.countyName }}</td>
-            <th>省市县编码</th><td>{{ info.countyCode }}</td>
+            <th>省市县编码</th><td>{{ info.countyCode.split(',')[2] }}</td>
           </tr>
           <tr>
             <th>牧场名称</th><td>{{ info.farmName }}</td>
@@ -48,7 +48,7 @@
         <div class="title">
           <span>上传数据走势图</span>
           <div class="right">
-            <el-date-picker 
+            <el-date-picker
               v-model="timeSelected"
               type="datetimerange"
               range-separator="—"
@@ -172,13 +172,14 @@ export default {
   methods: {
     // 初始化 -> 获取设备的信息
     init () {
-      let id = this.$route.params.id
+      let id = this.$route.query.id
       console.log(id);
       this.$http({
         url: this.$http.adornUrl(`${this.baseUrl}/manager/collectorregister/info/${id}`),
         method: 'get'
       }).then(async({data}) => {
         // 遍历 + 对应放置
+        console.log(data);
         for (let item in this.info) {
           if (Object.hasOwnProperty.call(this.info, item)) {
             this.info[item] = data.collectorRegister[item]
@@ -252,7 +253,7 @@ export default {
   .table td,
   .table th {
     border: 1px solid #ddd;
-    
+
   }
 
   /* 正常 */
@@ -313,4 +314,4 @@ export default {
     color: #fff;
     border: 1px solid #1abc9c;
   }
-</style>
+</style>

+ 2 - 0
src/views/pastureData/Home.vue

@@ -88,11 +88,13 @@ export default {
   created() {
     let farmCode = this.$route.query.farmCode;
     let type = this.$route.query.type;
+    let farmName = this.$route.query.farmName;
     if(farmCode) {
       this.farmCode = farmCode;
       this.type = Number(type);
       this.isProvince = false;
       this.isColl = this.$route.query.isColl;
+      this.farmName = farmName;
       console.log(this.type);
     }
   }

+ 21 - 0
src/views/pastureData/chart/chartDl.vue

@@ -71,12 +71,33 @@ export default {
             type: 'category',
             boundaryGap: false,
             data: that.dlList[0],
+            axisLine: {
+              show: true,
+              lineStyle: {
+                color: "#aaa",
+              }
+            },
+            axisLabel: {
+              color: '#aaa'
+            }
           },
           yAxis: {
             type: 'value',
             name: '单位:%',
             boundaryGap: [0, '100%'],
             max: 100,
+            axisLine: {       //y轴
+              show: false
+            },
+            axisTick: {
+              show: false,
+            },
+            splitLine:{
+              show:false
+            },
+            axisLabel: {
+              color: '#aaa'
+            }
           },
           series: [
             {

+ 21 - 5
src/views/pastureData/chart/chartTemp.vue

@@ -46,7 +46,7 @@ export default {
           },
           dataZoom: [{
             type: 'inside',
-            start: 90,
+            start: 60,
             end: 100,
           }, {
             start: 0,
@@ -71,6 +71,15 @@ export default {
             type: 'category',
             boundaryGap: false,
             data: that.tempList[0],
+            axisLine: {
+              show: true,
+              lineStyle: {
+                color: "#aaa",
+              }
+            },
+            axisLabel: {
+              color: '#aaa'
+            }
           },
           yAxis: {
             type: 'value',
@@ -79,11 +88,18 @@ export default {
             min(value) {
               return value.min - 1;
             },
-            axisLabel: {
-              formatter(value) {
-                return value.toFixed(2);
-              },
+            axisLine: {       //y轴
+              show: false
+            },
+            axisTick: {
+              show: false,
             },
+            splitLine:{
+              show:false
+            },
+            axisLabel: {
+              color: '#aaa'
+            }
           },
           series: [
             {

+ 22 - 1
src/views/pastureData/chart/chartYdl.vue

@@ -47,7 +47,7 @@ export default {
           color: ['#7387F3'],
           dataZoom: [{
             type: 'inside',
-            start: 90,
+            start: 60,
             end: 100,
           }, {
             start: 0,
@@ -72,10 +72,31 @@ export default {
             type: 'category',
             boundaryGap: false,
             data: that.ydlList[0],
+            axisLine: {
+              show: true,
+              lineStyle: {
+                color: "#aaa",
+              }
+            },
+            axisLabel: {
+              color: '#aaa'
+            }
           },
           yAxis: {
             type: 'value',
             boundaryGap: [0, '100%'],
+            axisLine: {       //y轴
+              show: false
+            },
+            axisTick: {
+              show: false,
+            },
+            splitLine:{
+              show:false
+            },
+            axisLabel: {
+              color: '#aaa'
+            }
           },
           series: [
             {

+ 5 - 1
src/views/pastureData/dataDetail.vue

@@ -149,6 +149,7 @@ import chartTemp from "./chart/chartTemp";
 import chartDl from "./chart/chartDl";
 import chartYdl from "./chart/chartYdl";
 // import chartPjwd from "./chart/chartPjwd";
+import {mapState} from 'vuex';
 export default {
   name: "dataDetail",
   components: {
@@ -213,6 +214,9 @@ export default {
       ]
     }
   },
+  computed: {
+    ...mapState(['baseUrl', 'baseTwoUrl'])
+  },
   methods: {
     // 过滤
     getStage(id) {
@@ -237,7 +241,7 @@ export default {
       //http://192.168.1.171:8210
       // http://122.112.224.199:9500
       this.$http({
-        url: this.$http.adornUrl('http://122.112.224.199:9500/manager/eartagdata/list_deatils'),
+        url: this.$http.adornUrl(`${this.baseTwoUrl}/manager/eartagdata/list_deatils`),
         method: 'post',
         data: formData
       })

+ 6 - 2
src/views/pastureData/dayData.vue

@@ -172,6 +172,7 @@
 <script>
 import TableFooter from "../../components/TableFooter";
 import utils from '../../utils/index';
+import {mapState} from 'vuex';
 export default {
   name: "dayData",
   components: {
@@ -232,6 +233,9 @@ export default {
       isParent: false,
     }
   },
+  computed: {
+    ...mapState(['baseUrl', 'baseTwoUrl'])
+  },
   methods: {
     // 过滤
     getStage(id) {
@@ -279,7 +283,7 @@ export default {
         date: this.value1,
       }
       this.$http({
-        url: this.$http.adornUrl('http://122.112.224.199:9000/manager/dailytabulatedata/listByFarm'),
+        url: this.$http.adornUrl(`${this.baseUrl}/manager/dailytabulatedata/listByFarm`),
         method: 'get',
         params: this.$http.adornParams(params)
       })
@@ -322,7 +326,7 @@ export default {
       }
       //http://122.112.224.199:9500/manager/eartagdata/findByConditions
       this.$http({
-        url: this.$http.adornUrl("http://122.112.224.199:9500/manager/eartagdata/findByConditions"),
+        url: this.$http.adornUrl(`${this.baseTwoUrl}/manager/eartagdata/findByConditions`),
         method: 'post',
         data: fromData,
       }).then(res => {

+ 5 - 1
src/views/pastureData/hand.vue

@@ -129,6 +129,7 @@
 <script>
 import chartMzcl from "./chart/chartMzcl";
 import chartMzxz from "./chart/chartMzxz";
+import {mapState} from 'vuex';
 // import chartGzxz from "./chart/chartGzxz";
 export default {
   name: "hand",
@@ -149,6 +150,9 @@ export default {
       mzxzList: [],
     }
   },
+  computed: {
+    ...mapState(['baseUrl', 'baseTwoUrl'])
+  },
   methods: {
     init() {
       let params = {
@@ -166,7 +170,7 @@ export default {
         params.endDate = this.endYear
       }
       this.$http({
-        url: this.$http.adornUrl('http://122.112.224.199:9000/manager/dailytabulatedata/countAllChange'),
+        url: this.$http.adornUrl(`${this.baseUrl}/manager/dailytabulatedata/countAllChange`),
         method: 'get',
         params: this.$http.adornParams(params)
       })

+ 1 - 1
src/views/pastureData/homeComponent/city.vue

@@ -281,7 +281,7 @@ export default {
     // 统计
     initState() {
       this.$http({
-        url: this.$http.adornUrl('http://122.112.224.199:9000/manager/dailytabulatedata/countAllsow'),
+        url: this.$http.adornUrl(`${this.baseUrl}/manager/dailytabulatedata/countAllsow`),
         method: 'get',
         params: this.$http.adornParams({countyCode: this.cityCode})
       })

+ 1 - 1
src/views/pastureData/homeComponent/district.vue

@@ -263,7 +263,7 @@ export default {
         limit: this.pageSize,
       }
       this.$http({
-        url: this.$http.adornUrl('http://122.112.224.199:9000/manager/dailytabulatedata/countAllsow'),
+        url: this.$http.adornUrl(`${this.baseUrl}/manager/dailytabulatedata/countAllsow`),
         method: 'get',
         params: this.$http.adornParams(params)
       })

+ 9 - 4
src/views/pastureData/homeComponent/farm.vue

@@ -39,11 +39,12 @@
           <el-form-item label="时间:">
             <el-date-picker
                 v-model="value2"
-                type="datetimerange"
+                type="daterange"
                 :picker-options="pickerOptions"
                 range-separator="至"
                 start-placeholder="开始日期"
                 end-placeholder="结束日期"
+                value-format="yyyy-MM-dd"
                 align="right">
             </el-date-picker>
           </el-form-item>
@@ -256,10 +257,14 @@ export default {
     },
     // // 去牧场
     onFarm() {
+      console.log(this.value2);
+      if(this.value2 == null) {
+        this.value2 = [];
+      }
       let params = {
         farmCode: this.farmCode,
-        startTime: this.value2[0],
-        endTime: this.value2[1],
+        startTime: this.value2[0] ? this.value2[0]+' ' + '00:00:00' : '',
+        endTime: this.value2[1] ? this.value2[1] + ' ' + '23:59:59' : '',
         minStockTotal: this.minStockTotal,
         maxStockTotal: this.maxStockTotal,
         minStockNew: this.minStockNew,
@@ -306,7 +311,7 @@ export default {
     // 统计
     initState() {
       this.$http({
-        url: this.$http.adornUrl('http://122.112.224.199:9000/manager/dailytabulatedata/countAllsow'),
+        url: this.$http.adornUrl(`${this.baseUrl}/manager/dailytabulatedata/countAllsow`),
         method: 'get',
         params: this.$http.adornParams({farmCode: this.farmCode})
       })

+ 1 - 1
src/views/pastureData/homeComponent/proinvce.vue

@@ -271,7 +271,7 @@ export default {
     // 统计
     initState() {
       this.$http({
-        url: this.$http.adornUrl('http://122.112.224.199:9000/manager/dailytabulatedata/countAllsow'),
+        url: this.$http.adornUrl(`${this.baseUrl}/manager/dailytabulatedata/countAllsow`),
         method: 'get',
         params: this.$http.adornParams({countyCode: this.countyCode})
       })