Browse Source

合并其他分支功能

Shan9312 10 months ago
parent
commit
02c0369344

+ 17 - 28
.env.development

@@ -1,30 +1,19 @@
-# just a flag
-ENV = 'development'
-
+
+# just a flag
+ENV = 'development'
+
 # base api
-# 南通测试线
-# VUE_APP_BASE_API = 'http://kpttestnt.kptyun.com/'
-# VUE_APP_BASE_API = 'http://tmrwatch.cn/'
-# 测试线
-VUE_APP_BASE_API = 'http://tmrwatch.cn:8081/'
-# VUE_APP_BASE_API = 'http://127.0.0.1:8081/'
-
-# VUE_APP_BASE_API = 'http://lhpc81.kptyun.com/'
-
-
-
-# 白少杰
-# VUE_APP_BASE_API = 'http://192.168.1.56:8081/'
-
-=======
-# 白少后台本地
-VUE_APP_BASE_API = 'http://192.168.1.56:8081/'
+# 测试线
+# VUE_APP_BASE_API = 'http://192.168.1.70:8082/'
+VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+# 白少后台本地
+# VUE_APP_BASE_API = 'http://192.168.1.56:8081/'
 # VUE_APP_BASE_API = 'http://192.168.1.93/'
-# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
-# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
-# It only does one thing by converting all import() to require().
-# This configuration can significantly increase the speed of hot updates,
-# when you have a large number of pages.
-# Detail:  https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
-
-VUE_CLI_BABEL_TRANSPILE_MODULES = true
+# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
+# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
+# It only does one thing by converting all import() to require().
+# This configuration can significantly increase the speed of hot updates,
+# when you have a large number of pages.
+# Detail:  https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
+
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 2 - 0
package.json

@@ -15,6 +15,7 @@
     "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
   },
   "dependencies": {
+    "@amap/amap-jsapi-loader": "^1.0.1",
     "@sentry/browser": "^5.15.5",
     "@sentry/integrations": "^5.15.5",
     "axios": "0.18.1",
@@ -26,6 +27,7 @@
     "fuse.js": "3.4.4",
     "js-cookie": "^2.2.0",
     "js-table2excel": "^1.0.3",
+    "leaflet": "^1.9.4",
     "md5": "^2.3.0",
     "moment": "^2.24.0",
     "normalize.css": "7.0.0",

BIN
src/assets/images/guiji.png


BIN
src/assets/images/guiji2.jpeg


BIN
src/assets/images/guji.jpg


BIN
src/assets/images/lcbg.jpg


File diff suppressed because it is too large
+ 0 - 0
src/icons/svg/巡检轨迹.svg


+ 3 - 1
src/main.js

@@ -27,7 +27,9 @@ import '@/icons' // icon
 import '@/permission' // permission control
 import './icons'
 import * as filters from './filters' // global filters
-
+import Leaflet from 'leaflet'
+import "leaflet/dist/leaflet.css"
+Vue.use(Leaflet);
 Vue.config.productionTip = false
 /**
  * If you don't want to use mock-server

+ 147 - 146
src/utils/request.js

@@ -1,148 +1,149 @@
-import axios from 'axios'
-import { MessageBox, Message } from 'element-ui'
-import store from '@/store'
-import { getToken } from '@/utils/auth'
-import Cookies from 'js-cookie';
-
-//获取当前url
-const DoMainString = document.querySelector("html").getAttribute("domain");
-var URL = process.env.VUE_APP_BASE_API
-if (DoMainString) {
-  URL = DoMainString
-}
-
-var reg =  /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/;
-var browserUrl = window.location.hostname
-console.log("========url===",reg.test(browserUrl))
-if (reg.test(browserUrl)){
-  URL = window.location.protocol +"//"+ browserUrl + ":80/"
-}
-
-Cookies.set('url',URL)
-console.log(process.env.VUE_APP_BASE_API,'===========URL1111')
-console.log(URL,'===========URL')
-
-const service = axios.create({
-  baseURL: URL, // url = base url + request url
-  withCredentials: true, // send cookies when cross-domain requests
-  timeout: 60000 ,// request timeout
-})
-// request interceptor
-service.interceptors.request.use(
-  config => {
-    // do something before request is sent
-    // config.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'  //此处是增加的代码,设置请求头的类型
-    if (process.env.VUE_APP_BASE_API !== '/dev-api') {
-      config.headers['Content-Type'] = 'application/json'
-      config.withCredentials = false
-    }
-
-    if (store.getters.token) {
-      // let each request carry token
-      // ['Authorization'] is a custom headers key
-      // please modify it according to the actual situation
-      if (process.env.VUE_APP_BASE_API === '/dev-api') {
-        config.headers['X-Token'] = getToken()
-      } else {
-        config.headers['token'] = getToken()
-      }
-    }
-    return config
-  },
-  error => {
-    // do something with request error
-    console.log(error) // for debug
-    return Promise.reject(error)
-  }
-)
-
-// response interceptor
-service.interceptors.response.use(
-  /**
-   * If you want to get http information such as headers or status
-   * Please return  response => response
-  */
-
-  /**
-   * Determine the request status by custom code
-   * Here is just an example
-   * You can also judge the status by HTTP Status Code
-   */
-  response => {
-    const res = response.data
-
-    // if the custom code is not 20000, it is judged as an error.
-    if (res.code !== 200) {
-      Message({
-        // message: res.msg + res.code,
-        message: '请求超时',
-        type: 'error',
-        duration: 5 * 1000
-      })
-
-      // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
-      if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
-        // to re-login
-        MessageBox.confirm('你已经注销登陆,你可以取消或重新登陆', '确认注销', {
-          confirmButtonText: '重新登陆',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          store.dispatch('user/resetToken').then(() => {
-            location.reload()
-          })
-        })
-      }
-      if (res.code === 20002) {
-        store.dispatch('user/resetToken').then(() => {
-          location.reload()
-        })
-      }
-      if (res.code === undefined) {
-        return res
-      } else {
-        return Promise.reject(new Error(res.message || 'Error'))
-      }
-    } else {
-      return res
-    }
-  },
-  error => {
-    console.log('err' + error) // for debug
-    let config = error.config
-    if (!config) {
-      Message({ message: error.message, type: 'error', duration: 5 * 1000 })
-      return Promise.reject(error)
-    }
-    console.log('config==>', config) // for debug
-    console.log('config.__retryCount==>', config.__retryCount) // for debug
-    // 设置请求超时次数
+import axios from 'axios'
+import { MessageBox, Message } from 'element-ui'
+import store from '@/store'
+import { getToken } from '@/utils/auth'
+import Cookies from 'js-cookie';
+
+//获取当前url
+const DoMainString = document.querySelector("html").getAttribute("domain");
+var URL = process.env.VUE_APP_BASE_API
+if (DoMainString) {
+  URL = DoMainString
+}
+
+var reg =  /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/;
+var browserUrl = window.location.hostname
+console.log("========url===",reg.test(browserUrl))
+// 打包的时候打开,日常关掉
+// if (reg.test(browserUrl)){
+//   URL = window.location.protocol +"//"+ browserUrl + ":80/"
+// }
+
+Cookies.set('url',URL)
+console.log(process.env.VUE_APP_BASE_API,'===========URL1111')
+console.log(URL,'===========URL')
+
+const service = axios.create({
+  baseURL: URL, // url = base url + request url
+  withCredentials: true, // send cookies when cross-domain requests
+  timeout: 60000 ,// request timeout
+})
+// request interceptor
+service.interceptors.request.use(
+  config => {
+    // do something before request is sent
+    // config.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'  //此处是增加的代码,设置请求头的类型
+    if (process.env.VUE_APP_BASE_API !== '/dev-api') {
+      config.headers['Content-Type'] = 'application/json'
+      config.withCredentials = false
+    }
+
+    if (store.getters.token) {
+      // let each request carry token
+      // ['Authorization'] is a custom headers key
+      // please modify it according to the actual situation
+      if (process.env.VUE_APP_BASE_API === '/dev-api') {
+        config.headers['X-Token'] = getToken()
+      } else {
+        config.headers['token'] = getToken()
+      }
+    }
+    return config
+  },
+  error => {
+    // do something with request error
+    console.log(error) // for debug
+    return Promise.reject(error)
+  }
+)
+
+// response interceptor
+service.interceptors.response.use(
+  /**
+   * If you want to get http information such as headers or status
+   * Please return  response => response
+  */
+
+  /**
+   * Determine the request status by custom code
+   * Here is just an example
+   * You can also judge the status by HTTP Status Code
+   */
+  response => {
+    const res = response.data
+
+    // if the custom code is not 20000, it is judged as an error.
+    if (res.code !== 200) {
+      Message({
+        // message: res.msg + res.code,
+        message: '请求超时',
+        type: 'error',
+        duration: 5 * 1000
+      })
+
+      // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
+      if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
+        // to re-login
+        MessageBox.confirm('你已经注销登陆,你可以取消或重新登陆', '确认注销', {
+          confirmButtonText: '重新登陆',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          store.dispatch('user/resetToken').then(() => {
+            location.reload()
+          })
+        })
+      }
+      if (res.code === 20002) {
+        store.dispatch('user/resetToken').then(() => {
+          location.reload()
+        })
+      }
+      if (res.code === undefined) {
+        return res
+      } else {
+        return Promise.reject(new Error(res.message || 'Error'))
+      }
+    } else {
+      return res
+    }
+  },
+  error => {
+    console.log('err' + error) // for debug
+    let config = error.config
+    if (!config) {
+      Message({ message: error.message, type: 'error', duration: 5 * 1000 })
+      return Promise.reject(error)
+    }
+    console.log('config==>', config) // for debug
+    console.log('config.__retryCount==>', config.__retryCount) // for debug
+    // 设置请求超时次数
     config.__retryCount = config.__retryCount || 0
-    // 君盛牧场不需要多次请求
+    // 君盛牧场不需要多次请求
     // if (config.__retryCount >= 0) {
-    // 其他牧场失败后需要多次尝试
-    if (config.__retryCount >= 3) {
-      // Message({ message:error.message, type: 'error', duration: 5 * 1000 })
-      Message({ message:'请求超时', type: 'error', duration: 5 * 1000 })
-      // Message.error((error && error.data && error.data.msg) || '请求超时')
-      return Promise.reject(error)
-    }
-    config.__retryCount += 1
-    let backoff = new Promise((resolve) => {
-      setTimeout(() => {
-        resolve()
-      }, config.retryDelay || 1000)
-    })
-    return backoff.then(() => {
-      return service(config)
-    })
-    // Message({
-    //   message: error.message,
-    //   type: 'error',
-    //   duration: 5 * 1000
-    // })
-    // return Promise.reject(error)
-  }
-)
-
-export default service
+    // 其他牧场失败后需要多次尝试
+    if (config.__retryCount >= 3) {
+      // Message({ message:error.message, type: 'error', duration: 5 * 1000 })
+      Message({ message:'请求超时', type: 'error', duration: 5 * 1000 })
+      // Message.error((error && error.data && error.data.msg) || '请求超时')
+      return Promise.reject(error)
+    }
+    config.__retryCount += 1
+    let backoff = new Promise((resolve) => {
+      setTimeout(() => {
+        resolve()
+      }, config.retryDelay || 1000)
+    })
+    return backoff.then(() => {
+      return service(config)
+    })
+    // Message({
+    //   message: error.message,
+    //   type: 'error',
+    //   duration: 5 * 1000
+    // })
+    // return Promise.reject(error)
+  }
+)
+
+export default service

+ 16 - 1
src/views/basicData/defaultParameter/function/index.vue

@@ -169,6 +169,18 @@
               <el-input ref="tmrUnder" v-model="createTemp.tmrUnder" :disabled="isRoleEdit==false" class="filter-item" placeholder="tmr容量下限(%)" type="number" />
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item label="预混料允许误差:" prop="yhfeedtemplet">
+              <el-input ref="yhfeedtemplet" v-model="createTemp.yhfeedtemplet" :disabled="isRoleEdit==false" class="filter-item" placeholder="kg" type="number" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="预混跳转延时:" prop="yhautosecond">
+              <el-select v-model="createTemp.yhautosecond" :disabled="isRoleEdit==false" filterable placeholder="预混跳转延时" class="filter-item" style="width:100%">
+                <el-option v-for="item in yhautosecondList" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
     <div slot="footer" class="dialog-footer" style="bottom: 10px;">
@@ -243,6 +255,7 @@ export default {
       smallMaterialList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 小料是否称量
       dataSynchronizationList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用数据同步
       accuracyList: [{ id: '1', name: '排除允许误差准确率' }, { id: '0', name: '不排除允许误差准确率' }],  //混料准确率
+      yhautosecondList:[{ id: '1', name: '禁用' }, { id: '2', name: '3秒' }, { id: '3', name: '6秒' }, { id: '4', name: '9秒' }],  //预混跳转延时
       requestParams: [
         { name: 'getRemainFeedList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
       ],
@@ -341,7 +354,9 @@ export default {
         sprinkleFeedTimeAllow:this.createTemp.sprinkleFeedTimeAllow,
         domain:this.createTemp.domain,
         tmrUpper:this.createTemp.tmrUpper,
-        tmrUnder:this.createTemp.tmrUnder
+        tmrUnder:this.createTemp.tmrUnder,
+        yhfeedtemplet:this.createTemp.yhfeedtemplet,
+        yhautosecond:this.createTemp.yhautosecond,
       }}
       this.requestParam.data[1] = { 'name': 'updateFPbyFTChangeALL', 'type': 'e', 'parammaps': {
         pastureid: this.createTemp.pastureid

+ 1 - 1
src/views/formulationPlan/pushMaterialPlan/index.vue

@@ -170,7 +170,7 @@ export default {
 
   methods: {
     getButtons() {
-      const Edit = 'DhedFormula'
+      const Edit = 'PushMaterialPlan'
       const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
       this.isRoleEdit = isRoleEdit
     },

+ 23 - 4
src/views/formulationPlan/recipeTemplate/index.vue

@@ -297,6 +297,12 @@
                 </el-select>
               </template>
             </el-table-column>
+            <el-table-column label="停机时间" min-width="70px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit">{{ scope.row.shutdown }}</span>
+                <el-input v-if="scope.row.Edit" v-model="scope.row.shutdown" step="0.01" type="number" style="width:95%;padding:10px 0;" min-number="0"/>
+              </template>
+            </el-table-column>
             <el-table-column label="顺序" min-width="70px" align="center">
               <template slot-scope="scope">
                 <span v-if="scope.row.NoEdit">{{ scope.row.sort }}</span>
@@ -2230,7 +2236,7 @@ export default {
       } else {
         var mysort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
       }
-      this.table2.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'groupEdit': false, 'groupNoEdit': true, 'enable': 1, 'feedgroup': '', 'fid': '', 'fname': '', 'fweight': '', 'autosecond': '0','deviation':'0','islockcount': '0', 'sort': mysort })
+      this.table2.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'groupEdit': false, 'groupNoEdit': true, 'enable': 1, 'feedgroup': '', 'fid': '', 'fname': '', 'fweight': '', 'autosecond': '0','deviation':'0','islockcount': '0', 'sort': mysort,'shutdown':'0' })
       console.log(this.table2.list)
     },
     changeFname(item, row) {
@@ -2328,6 +2334,7 @@ export default {
       this.table2.temp.preftid = this.table2.temp.preftid
       this.table2.temp.autosecond = row.autosecond
       this.table2.temp.deviation = row.deviation
+      this.table2.temp.shutdown = row.shutdown
       if (this.table2.temp.fid === '' && this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
         this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
         return false
@@ -2365,6 +2372,9 @@ export default {
           row.sort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
         }
       }
+      if (this.table2.temp.shutdown == '') {
+        this.table2.temp.shutdown = 0
+      }
       if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
         if (parseInt(this.table2.temp.preftid) > 0) {
           this.$message({ type: 'error', message: '饲料名称不能选择预混配方', duration: 2000 })
@@ -2406,7 +2416,8 @@ export default {
         feedgroup: row.feedgroup,
         preftid: this.table2.temp.preftid,
         autosecond: row.autosecond,
-        deviation: row.deviation
+        deviation: row.deviation,
+        shutdown:  this.table2.temp.shutdown,
       }}
       this.requestParam.data[1] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
         pastureid: this.table2.temp.pastureid,
@@ -2545,6 +2556,7 @@ export default {
           this.table2.temp.preftid = this.table2.temp.preftid
           this.table2.temp.autosecond = row.autosecond
           this.table2.temp.deviation = row.deviation
+          this.table2.temp.shutdown = row.shutdown
           this.table2.temp.id = row.id
           console.log('this.table2.updateList', this.table2.updateList)
           console.log('temp', this.table2.temp)
@@ -2580,6 +2592,9 @@ export default {
             this.$message({ type: 'error', message: '允许延时偏差不可超出搅拌延时', duration: 2000 })
             return false
           }
+          if (this.table2.temp.shutdown == '') {
+            this.table2.temp.shutdown = 0
+          }
           if (this.table2.temp.sort !== '') {
             this.table2.temp.sort = this.table2.temp.sort
           } else {
@@ -2634,7 +2649,8 @@ export default {
             preftid: this.table2.temp.preftid,
             autosecond: row.autosecond,
             id: row.id,
-            deviation:row.deviation
+            deviation:row.deviation,
+            shutdown: this.table2.temp.shutdown,
           }}
           this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
             pastureid: row.pastureid,
@@ -3092,6 +3108,7 @@ export default {
           ftid: this.table2.getdataListParm.parammaps.ftid,
           fid: this.detail.list2[0].id,
           fname: '@insertSpotList2.tname',
+          shutdown: '0',
           fweight: sumFweight,
           islockcount: '0',
           sort: parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1,
@@ -3173,7 +3190,8 @@ export default {
           sort: '@insertSpotList.sort',
           feedgroup: '@insertSpotList.feedgroup',
           preftid: '@insertSpotList.preftid',
-          autosecond: '@insertSpotList.autosecond'
+          autosecond: '@insertSpotList.autosecond',
+          shutdown: '@insertSpotList.shutdown'
         }}
         this.requestParam.data[1].children[1] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
           pastureid: '@insertSpotList.pastureid',
@@ -3186,6 +3204,7 @@ export default {
           ftid: this.table2.getdataListParm.parammaps.ftid,
           fid: '@insertFT.LastInsertId',
           fname: '@insertSpotList2.tname',
+          shutdown: '0',
           fweight: sumFweight,
           islockcount: '0',
           sort: parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1,

+ 258 - 138
src/views/statisticalAnalysis/inventoryManagement/pasture/index.vue

@@ -49,7 +49,7 @@
       </el-tab-pane>
       <el-tab-pane label="用料分析" name="second">
         <div class="search">
-          <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 245px;" :picker-options="pickerOptions" />
+          <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 245px;" :picker-options="pickerOptions2" />
           <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled2" @click="handleBefore2" />
           <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled2" @click="handleNext2" />
           <span style="margin-left: 10px;">统计类型:</span>
@@ -74,7 +74,10 @@
           </el-select>
           <el-button class="successBorder" @click="form_search('second')">查询</el-button>
           <el-button class="export" style="float: right;margin-right: 5px;margin-top:10px;" icon="el-icon-upload2" @click="handleExport('tab2')">导出</el-button>
-        </div>
+          <el-button class="export" style="float: right;margin-right: 5px;margin-top:10px;" icon="el-icon-upload2" @click="handlesWitch()">切换展示</el-button>
+        </div>
+
+        <div v-if="isTable1">
         <div v-if="tab2.table.tableConfig.length > 8">
           <u-table v-if="isDispayTable2" ref="plTable2" v-loading="tab2.table.listLoading" :row-style="rowStyle" :cell-style="cellStyle" :max-height="myHeight2" use-virtual :row-height="rowHeight" border class="elTable table-fixed plTable2">
             <!-- 第一个表头 -->
@@ -117,6 +120,13 @@
         </div>
 
         <span v-if="tab2.table.listLoading == false && tab2.table.list.length>0" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab2.table.total }}条</span>
+        </div>
+        <div v-else>
+          <!-- 新展示 -->
+          <u-table :span-method="objectSpanMethod" ref="plTable22" v-loading="tab2.table.listLoading" :row-style="rowStyle" :cell-style="cellStyle" :max-height="myHeight2" use-virtual :row-height="rowHeight" border class="elTable table-fixed plTable2">
+            <u-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.prop" :label="column.label" align="center"></u-table-column>
+          </u-table>
+        </div>
       </el-tab-pane>
       <el-tab-pane label="价格分析" name="third">
         <div class="search">
@@ -202,6 +212,27 @@ export default {
           }
           return time.getTime() > Date.now()
         }
+      },
+      pickerOptions2: {
+        onPick: ({ maxDate, minDate }) => {
+          this.pickerMinDate = minDate.getTime()
+          if (maxDate) {
+            this.pickerMinDate = ''
+          }
+        },
+        // 限制不能选择今天之后的日期
+        disabledDate: (time) => {
+          if (this.pickerMinDate !== '') {
+            const one = 31 * 24 * 3600 * 1000
+            const minTime = this.pickerMinDate - one
+            let maxTime = this.pickerMinDate + one
+            // if (maxTime > new Date()) {
+            //   maxTime = new Date()
+            // }
+            return time.getTime() < minTime || time.getTime() > maxTime
+          }
+          // return time.getTime() > Date.now()
+        }
       },
       fileComment: [{ 'label': '商务文件评分', 'children': [{ 'label': '1' }, { 'label': '2' }, { 'label': '管理员' }] }],
       displayList:[{id:'1',name:'理论'},{id:'2',name:'实际'}],//列表显示
@@ -307,6 +338,12 @@ export default {
       statisticalTypeList2: [{ id: '1', name: '牲畜类别' }, { id: '2', name: '栏舍名称' }, { id: '3', name: '日期' }, { id: '4', name: 'TMR设备编号' }, { id: '5', name: 'TMR班次' }, { id: '6', name: '车次' }],
       statisticalTypeList3: [{ id: '1', name: '牲畜类别' }, { id: '2', name: '栏舍名称' }, { id: '3', name: '日期' }, { id: '4', name: 'TMR设备编号' }],
       frequencyList: [], // 班次
+      isTable1:true,
+      spanObj: {},
+      mergekeys: ['A', 'B'],
+      tableColumns:[],
+      myData:{},
+      columnsToTotal: ['10-配种']
     }
   },
   created() {
@@ -460,72 +497,87 @@ export default {
       setTimeout(()=>{
         this.isDispayTable2 = true
         this.$nextTick(() => {
-          let myList = []
-          GetReportform(this.tab2.table.getdataListParm).then(response => {
-            if (response.data !== null && response.data.data !== null && response.data.data1 !== null) {
-              this.tab2.table.data = response.data.data
-              response.data.feedcode.push('')
-              response.data.feedcode.unshift('饲料编码')
-              for (let i = 0; i < response.data.list.data2.length; i++) {
-                console.log(response.data.list.data2[i],'===label')
-                for (let j = 0; j < response.data.list.data1.length; j++) {
-                  for (let a = 0; a < response.data.list.data2[i].children.length; a++) {
-                    if (response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == undefined || response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == null || response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == '') {
-                      response.data.list.data1[j][response.data.list.data2[i].children[a].prop] = 0
-                    }
-                  }
-                }
-                if (response.data.list.data2[i].children.length > 1) {
-                  for (let j = 0; j < response.data.list.data2[i].children.length; j++) {
-                    if (response.data.list.data2[i].children[j].label == '理论' || response.data.list.data2[i].children[j].label == '实际') {
-                      this.$set(response.data.list.data2[i].children[j], 'width', '80px')
-                    } else {
-                      this.$set(response.data.list.data2[i].children[j], 'width', '80px')
-                    }
-                  }
-                } else {
-                  this.$set(response.data.list.data2[i].children[0], 'width', '80px')
-                }
-              }
-              let list = response.data.list.data2
-              let code = response.data.feedcode
-              const headers = []
-              for(let i=0;i<list.length;i++){
-                for(let j=0;j<code.length;j++){
-                  if(i== j){
-                    let obj = {
-                      label:code[j],
-                      children:[
-                        list[i]
-                      ]
+          let myList = []
+          if(this.isTable1){
+            this.tab2.table.getdataListParm.parammaps.mode = 0
+          }else{
+            this.tab2.table.getdataListParm.parammaps.mode = 1
+          }
+          GetReportform(this.tab2.table.getdataListParm).then(response => {
+            if(this.isTable1){
+              if (response.data !== null && response.data.data !== null && response.data.data1 !== null) {
+                this.tab2.table.data = response.data.data
+                response.data.feedcode.push('')
+                response.data.feedcode.unshift('饲料编码')
+                for (let i = 0; i < response.data.list.data2.length; i++) {
+                  // console.log(response.data.list.data2[i],'===label')
+                  for (let j = 0; j < response.data.list.data1.length; j++) {
+                    for (let a = 0; a < response.data.list.data2[i].children.length; a++) {
+                      if (response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == undefined || response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == null || response.data.list.data1[j][response.data.list.data2[i].children[a].prop] == '') {
+                        response.data.list.data1[j][response.data.list.data2[i].children[a].prop] = 0
+                      }
+                    }
+                  }
+                  if (response.data.list.data2[i].children.length > 1) {
+                    for (let j = 0; j < response.data.list.data2[i].children.length; j++) {
+                      if (response.data.list.data2[i].children[j].label == '理论' || response.data.list.data2[i].children[j].label == '实际') {
+                        this.$set(response.data.list.data2[i].children[j], 'width', '80px')
+                      } else {
+                        this.$set(response.data.list.data2[i].children[j], 'width', '80px')
+                      }
                     }
-                    headers.push(obj)
+                  } else {
+                    this.$set(response.data.list.data2[i].children[0], 'width', '80px')
                   }
                 }
-              }
-              myList = response.data.list.data1
-              this.tab2.table.list = response.data.list.data1
-              this.tab2.table.tableConfig = headers
-              this.tab2.table.total = response.data.list.data1.length
-              console.log('库存统计-用料分析this.tab2.table.data', response.data.data)
-              console.log('库存统计-用料分析this.tab2.table.feedcode', response.data.feedcode)
-              console.log('库存统计-用料分析this.tab2.table.list', response.data.list.data1)
-              console.log('库存统计-用料分析this.tab2.table.tableConfig',response.data.list.data2)
-            } else {
-              myList = []
-              this.tab2.table.list = []
-              this.tab2.table.tableConfig = []
+                let list = response.data.list.data2
+                let code = response.data.feedcode
+                const headers = []
+                for(let i=0;i<list.length;i++){
+                  for(let j=0;j<code.length;j++){
+                    if(i== j){
+                      let obj = {
+                        label:code[j],
+                        children:[
+                          list[i]
+                        ]
+                      }
+                      headers.push(obj)
+                    }
+                  }
+                }
+                myList = response.data.list.data1
+                this.tab2.table.list = response.data.list.data1
+                this.tab2.table.tableConfig = headers
+                this.tab2.table.total = response.data.list.data1.length
+
+                console.log('库存统计-用料分析this.tab2.table.data', response.data.data)
+                console.log('库存统计-用料分析this.tab2.table.feedcode', response.data.feedcode)
+                console.log('库存统计-用料分析this.tab2.table.list', response.data.list.data1)
+                console.log('库存统计-用料分析this.tab2.table.tableConfig',response.data.list.data2)
+              } else {
+                myList = []
+                this.tab2.table.list = []
+                this.tab2.table.tableConfig = []
+              }
+
+              console.log(this.tab2.table.list.length)
+              this.$refs.plTable2.reloadData(myList)
+            }else{
+              this.myData = response.data
+              this.tableColumns = response.data.columns;
+              this.tableData = response.data.data;
+              this.$refs.plTable22.reloadData(this.tableData)
+              this.handleSpan()
             }
-
-            console.log(this.tab2.table.list.length)
-            this.$refs.plTable2.reloadData(myList)
             setTimeout(() => {
               this.tab2.table.listLoading = false
             }, 100)
           })
         })
       })
-    },
+    },
+
     changeRadio2() {
       console.log(this.tab2.radio)
       if (this.tab2.radio == '1') {
@@ -810,6 +862,53 @@ export default {
     },
     changeChecked(item) {
       this.form_search('second')
+    },
+    handlesWitch(item){
+      this.isTable1 = !this.isTable1
+        this.getTab2List()
+    },
+    handleSpan() {
+      this.mergekeys.forEach(key => {
+        this.spanObj[key] = []
+        let position = 0
+        this.tableData.forEach((item, index) => {
+          if (index === 0) {
+            this.spanObj[key].push(1)
+            position = 0
+          } else {
+            if (key == 'B') {
+              if (this.tableData[index][key] === this.tableData[index - 1][key] && this.tableData[index]['A'] === this.tableData[index - 1]['A']) {
+                this.spanObj[key][position] += 1
+                this.spanObj[key].push(0)
+              } else {
+                this.spanObj[key].push(1)
+                position = index
+              }
+            } else {
+              if (this.tableData[index][key] === this.tableData[index - 1][key]) {
+                this.spanObj[key][position] += 1
+                this.spanObj[key].push(0)
+              } else {
+                this.spanObj[key].push(1)
+                position = index
+              }
+            }
+          }
+        })
+      })
+    },
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      for (let i = 0; i < this.mergekeys.length; i++) {
+        if (column.property === this.mergekeys[i]) {
+          let _row = this.spanObj[this.mergekeys[i]][rowIndex]
+          let _col = _row > 0 ? 1 : 0
+          console.log(_row,'_row1')
+          return {
+            rowspan: _row,
+            colspan: _col
+          }
+        }
+      }
     },
     handleExport(item) {
       if (item == 'tab1') {
@@ -835,100 +934,121 @@ export default {
             excel.export_json_to_excel({ multiHeader, multiHeader2, data, filename: '库存统计', merges })
           })
         })
-      } else if (item == 'tab2') {
-        console.log('用料分析导出数据', this.tab2.table.list)
-        console.log('用料分析导出表头', this.tab2.table.tableConfig)
-        console.log(this.tab2.table.getdataListParm.checked, 'checked')
-        console.log(this.tab2.table.getdataListParm)
-        var startTime = this.tab2.table.getdataListParm.parammaps.startTime
-        var stopTime = this.tab2.table.getdataListParm.parammaps.stopTime
+      } else if (item == 'tab2') {
+        if(this.isTable1){
+          console.log('用料分析导出数据', this.tab2.table.list)
+          console.log('用料分析导出表头', this.tab2.table.tableConfig)
+          console.log(this.tab2.table.getdataListParm.checked, 'checked')
+          console.log(this.tab2.table.getdataListParm)
+          var startTime = this.tab2.table.getdataListParm.parammaps.startTime
+          var stopTime = this.tab2.table.getdataListParm.parammaps.stopTime
 
-        var exportData = []
-        var exportTitle1 = [] // 一级标题
-        var exportTitle2 = [] // 二级标题
-        var exportTitle3 = [] // 一级标题
-        var filterValArr = []
-        for (let i = 0; i < this.tab2.table.tableConfig.length; i++) {
-          exportTitle1.push(this.tab2.table.tableConfig[i].label)
-          for (let j = 0; j < this.tab2.table.tableConfig[i].children.length; j++) {
-            exportTitle2.push(this.tab2.table.tableConfig[i].children[j].label)
-            for(let a = 0;a<this.tab2.table.tableConfig[i].children[j].children.length;a++){
-              exportTitle3.push(this.tab2.table.tableConfig[i].children[j].children[a].label)
-              filterValArr.push(this.tab2.table.tableConfig[i].children[j].children[a].prop)
-            }
-            // filterValArr.push(this.tab2.table.tableConfig[i].children[j].prop)
-          }
-        }
-        console.log('一级标题exportTitle1', exportTitle1)
-        console.log('二级标题exportTitle2', exportTitle2)
-        console.log('三级标题exportTitle3', exportTitle3)
-        console.log('对应字段filterValArr', filterValArr)
-        var headerArr = []// 处理一级标题
-        var headerArr2 = []// 处理一级标题
-        if (this.tab2.table.getdataListParm.checked == 1) {
-          for (let i = 0; i < exportTitle1.length; i++) {
-            if (i > 0) {
-              headerArr.push(exportTitle1[i], '', '', '')
-            } else {
-              headerArr.push(exportTitle1[i])
-            }
-            if (i > 0) {
-              headerArr2.push(exportTitle2[i], '', '', '')
-            } else {
-              headerArr2.push(exportTitle2[i])
+          var exportData = []
+          var exportTitle1 = [] // 一级标题
+          var exportTitle2 = [] // 二级标题
+          var exportTitle3 = [] // 一级标题
+          var filterValArr = []
+          for (let i = 0; i < this.tab2.table.tableConfig.length; i++) {
+            exportTitle1.push(this.tab2.table.tableConfig[i].label)
+            for (let j = 0; j < this.tab2.table.tableConfig[i].children.length; j++) {
+              exportTitle2.push(this.tab2.table.tableConfig[i].children[j].label)
+              for(let a = 0;a<this.tab2.table.tableConfig[i].children[j].children.length;a++){
+                exportTitle3.push(this.tab2.table.tableConfig[i].children[j].children[a].label)
+                filterValArr.push(this.tab2.table.tableConfig[i].children[j].children[a].prop)
+              }
+              // filterValArr.push(this.tab2.table.tableConfig[i].children[j].prop)
             }
           }
-        } else {
-          if(this.tab2.table.getdataListParm.parammaps.typea == ''){
+          console.log('一级标题exportTitle1', exportTitle1)
+          console.log('二级标题exportTitle2', exportTitle2)
+          console.log('三级标题exportTitle3', exportTitle3)
+          console.log('对应字段filterValArr', filterValArr)
+          var headerArr = []// 处理一级标题
+          var headerArr2 = []// 处理一级标题
+          if (this.tab2.table.getdataListParm.checked == 1) {
             for (let i = 0; i < exportTitle1.length; i++) {
               if (i > 0) {
-                headerArr.push(exportTitle1[i], '')
+                headerArr.push(exportTitle1[i], '', '', '')
               } else {
                 headerArr.push(exportTitle1[i])
               }
               if (i > 0) {
-                headerArr2.push(exportTitle2[i], '')
+                headerArr2.push(exportTitle2[i], '', '', '')
               } else {
                 headerArr2.push(exportTitle2[i])
               }
             }
-          }else{
-            headerArr = exportTitle1
-            headerArr2 = exportTitle2
+          } else {
+            if(this.tab2.table.getdataListParm.parammaps.typea == ''){
+              for (let i = 0; i < exportTitle1.length; i++) {
+                if (i > 0) {
+                  headerArr.push(exportTitle1[i], '')
+                } else {
+                  headerArr.push(exportTitle1[i])
+                }
+                if (i > 0) {
+                  headerArr2.push(exportTitle2[i], '')
+                } else {
+                  headerArr2.push(exportTitle2[i])
+                }
+              }
+            }else{
+              headerArr = exportTitle1
+              headerArr2 = exportTitle2
+            }
           }
-        }
-        console.log('headerArr', headerArr)
-        console.log('exportTitle2', exportTitle2)
-        console.log('filterValArr', filterValArr)
-        if (headerArr.length > 0) {
-          import('@/vendor/Export3Excel').then((excel) => {
-            const multiHeader = [
-              headerArr
-            ]
-            const multiHeader2 = [
-              headerArr2
-            ]
-            const tHeader = exportTitle3
-            const filterVal = filterValArr
-            const data = this.tab2.table.list.map(v => filterVal.map(j => v[j]))
-            // const data = []
-            const merges = ['A1:A1']
-            excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '用料分析-'+startTime+'-' +stopTime , merges })
-          })
-        }else{
-          import('@/vendor/Export3Excel').then((excel) => {
-            const multiHeader = [
-              headerArr
-            ]
-            const multiHeader2 = []
-            const tHeader = exportTitle2
-            const filterVal = filterValArr
-            const data = this.tab2.table.list.map(v => filterVal.map(j => v[j]))
-            // const data = []
-            // const merges = ['A1:A1']
-            const merges = []
-            excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '用料分析', merges })
-          })
+          console.log('headerArr', headerArr)
+          console.log('exportTitle2', exportTitle2)
+          console.log('filterValArr', filterValArr)
+          if (headerArr.length > 0) {
+            import('@/vendor/Export3Excel').then((excel) => {
+              const multiHeader = [
+                headerArr
+              ]
+              const multiHeader2 = [
+                headerArr2
+              ]
+              const tHeader = exportTitle3
+              const filterVal = filterValArr
+              const data = this.tab2.table.list.map(v => filterVal.map(j => v[j]))
+              // const data = []
+              const merges = ['A1:A1']
+              excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '用料分析-'+startTime+'-' +stopTime , merges })
+            })
+          }else{
+            import('@/vendor/Export3Excel').then((excel) => {
+              const multiHeader = [
+                headerArr
+              ]
+              const multiHeader2 = []
+              const tHeader = exportTitle2
+              const filterVal = filterValArr
+              const data = this.tab2.table.list.map(v => filterVal.map(j => v[j]))
+              // const data = []
+              // const merges = ['A1:A1']
+              const merges = []
+              excel.export_json_to_excel({ multiHeader, multiHeader2, header: tHeader, data, filename: '用料分析', merges })
+            })
+          }
+        }else{
+          var startTime = this.tab2.table.getdataListParm.parammaps.startTime
+          var stopTime = this.tab2.table.getdataListParm.parammaps.stopTime
+          var title = '用料分析-'+startTime+'-' +stopTime
+          var tHeader = []
+          var filterVal = []
+          for (let i = 0; i < this.tableColumns.length; i++) {
+            tHeader.push(this.tableColumns[i].label)
+            filterVal.push(this.tableColumns[i].prop)
+          }
+          var excelDatas = [
+            {
+              tHeader: tHeader,
+              filterVal: filterVal,
+              tableDatas: this.tableData,
+              sheetName: 'Sheet'
+            }
+          ]
+          json2excel(excelDatas, title, true, 'xlsx')
         }
       } else if (item == 'tab3') {
         console.log('价格分析导出')

+ 453 - 0
src/views/statisticalAnalysis/pushingplan/index.vue

@@ -0,0 +1,453 @@
+ <template>
+  <div class="app-container">
+    <div class="search">
+      <el-date-picker
+        v-model="table.parammaps.inputDatetime"
+        type="daterange"
+        class="inputDatetime filter-item"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"
+      >
+      </el-date-picker>
+      <el-input
+        v-model="table.parammaps.tname"
+        placeholder="推料车"
+        style="width: 180px"
+        class="filter-item"
+        clearable
+      />
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+      <el-button class="successBorder" @click="form_search">查询</el-button>
+    </div>
+    <div class="table">
+      <el-table
+        :key="tableKey"
+        ref="table"
+        v-loading="listLoading"
+        element-loading-text="给我一点时间"
+        :data="list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        :max-height="myHeight"
+      >
+        <el-table-column
+          label="序号"
+          align="center"
+          type="index"
+          width="50px"
+        />
+        <el-table-column
+          label="推料车"
+          min-width="100px"
+          align="center"
+          prop="tname"
+        />
+        <el-table-column
+          label="备注"
+          min-width="100px"
+          align="center"
+          prop="remark"
+        />
+        <el-table-column
+          label="开始时间"
+          min-width="100px"
+          align="center"
+          prop="startdate"
+        />
+        <el-table-column
+          label="结束时间"
+          min-width="100px"
+          align="center"
+          prop="enddate"
+        />
+        <el-table-column
+          label="运行时间"
+          min-width="100px"
+          align="center"
+          prop="date"
+        />
+        <el-table-column
+          label="运行轨迹"
+          align="center"
+          width="80"
+          class-name="small-padding fixed-width"
+          fixed="right"
+        >
+          <template slot-scope="{ row }">
+            <el-button
+              v-if="isRoleEdit"
+              class="miniSuccess"
+              @click="handleRunning_trajectory(row)"
+              >查看</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- <span
+        v-if="listLoading == false"
+        style="margin-right: 30px; margin-top: 10px; font-size: 14px"
+        >共{{ total }}条</span
+      > -->
+    </div>
+    <!-- 分页 start-->
+    <el-pagination
+      class="pages"
+      v-if="listLoading == false"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :current-page="currentPage"
+      :page-sizes="[50, 100, 150, 200]"
+      :page-size="table.pagecount"
+      layout="total, sizes, prev, pager, next, jumper"
+      :total="total"
+    >
+    </el-pagination>
+    <!-- 分页 end -->
+
+    <el-dialog
+      :visible.sync="run.dialogFormVisible"
+      :close-on-click-modal="false"
+      width="80%"
+    >
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span
+              style="
+                display: inline-block;
+                width: 3px;
+                height: 20px;
+                margin-right: 5px;
+                float: left;
+                margin-top: 2px;
+              "
+            />
+            运行轨迹
+          </span>
+          <div
+            class="avue-crud__dialog__menu"
+            @click="dialogFull ? (dialogFull = false) : (dialogFull = true)"
+          >
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <!-- <div style="margin-bottom: 20px;background-image: url('http://niu305.cn:8091/uploads/image/headphoto1.png');background-position: top right;"> -->
+      <div ref="map" class="map-container"></div>
+      <!-- </div> -->
+      <div slot="footer" class="dialog-footer">
+        <el-button
+          class="cancelClose1"
+          @click="
+            run.dialogFormVisible = false
+            getList()
+          "
+          >关闭</el-button
+        >
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  GetDataByName,
+  postJson,
+  getJson,
+  formatNum,
+  checkButtons
+} from '@/api/common'
+import { parseTime } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+import Cookies from 'js-cookie'
+import axios from 'axios'
+import { getToken } from '@/utils/auth'
+import { createApp } from 'vue'
+import AMapLoader from '@amap/amap-jsapi-loader'
+// import vLoUrl from '../../../assets/images/tet.png'
+import vLoUrl from '../../../assets/images/guiji2.jpeg'
+window._AMapSecurityConfig = {
+  securityJsCode: '0133db0118e961029dc45a2d5039cbb1' // '「申请的安全密钥」',
+}
+export default {
+  name: 'Pushingplan',
+  data() {
+    return {
+      currentPage: 1,
+      table: {
+        offset: 1,
+        name: 'getTmrEqipmemtList',
+        pagecount: 50,
+        parammaps: {
+          // pastureid: Cookies.get('pastureid'),
+          tname: '',
+          startdate: '',
+          enddate: '',
+          inputDatetime: null
+          // startdate: parseTime(new Date(), '{y}-{m}-{d}'),
+          // enddate: parseTime(new Date(), '{y}-{m}-{d}'),
+          // inputDatetime: [new Date(), new Date()],
+        }
+      },
+      tableKey: 0,
+      list: [],
+      total: 0,
+      listLoading: true,
+
+      run: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: {}
+      },
+      dialogFull: false,
+      isRoleEdit: [],
+      isokDisable: false,
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      myHeight: document.documentElement.clientHeight - 85 - 150,
+      map: null,
+      path: [],
+      // path: [
+      //   [116.405285, 39.904989], // 示例轨迹点1
+      //   [116.407516, 39.904717], // 示例轨迹点2
+      //   [3118.407366, 39.91344],  // 示例轨迹点3
+      //   // 添加更多轨迹点
+      // ],
+      index: 0,
+      latitude: 40.87873, // 实景图所在位置的纬度
+      longitude: 113.216553, // 实景图所在位置的经度
+      zoom: 17, // 实景
+      apiKey: 'fb6a0e88dbad4931d96a121bcf7c4442',
+      vLoUrl
+    }
+  },
+
+  mounted() {
+    // this.initMap();
+  },
+  created() {
+    this.getButtons()
+    this.getList()
+  },
+
+  methods: {
+    // 分页
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`)
+      this.table.pagecount = val
+      this.table.offset = 1
+      this.currentPage = 1
+      this.getList()
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`)
+      this.currentPage = val
+      this.table.offset = val
+      this.getList()
+    },
+    getButtons() {
+      const Edit = 'Pushingplan'
+      const isRoleEdit = checkButtons(
+        JSON.parse(sessionStorage.getItem('buttons')),
+        Edit
+      )
+      this.isRoleEdit = isRoleEdit
+    },
+
+    getList() {
+      this.listLoading = true
+      let url = '/authdata/GetDataByName'
+      let data = this.table
+
+      if (this.table.parammaps.inputDatetime !== null) {
+        data.parammaps.startdate = parseTime(
+          this.table.parammaps.inputDatetime[0],
+          '{y}-{m}-{d}'
+        )
+        data.parammaps.enddate = parseTime(
+          this.table.parammaps.inputDatetime[1],
+          '{y}-{m}-{d}'
+        )
+      } else {
+        data.parammaps.startdate = ''
+        data.parammaps.enddate = ''
+      }
+      postJson(url, data).then((response) => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.list = response.data.list
+        } else {
+          this.list = []
+        }
+        this.total = response.data.total
+        setTimeout(() => {
+          this.listLoading = false
+        }, 100)
+      })
+    },
+
+    form_search() {
+      console.log('点击了查询')
+      this.getList()
+    },
+    handleRefresh() {
+      this.table.parammaps.tname = ''
+      this.table.parammaps.inputDatetime = null
+      this.getList()
+    },
+    handleRunning_trajectory(row) {
+      console.log('点击了运行轨迹')
+      this.run.dialogStatus = 'run'
+      this.run.dialogFormVisible = true
+      this.run.temp = Object.assign({}, row)
+      this.getRuningList()
+    },
+
+    getRuningList() {
+      let url = '/authdata/equipment/muster'
+      let data = '?id=' + this.run.temp.id
+      getJson(url, data).then((response) => {
+        // path
+        // console.log('table数据', response.data.list)
+        if (response.data !== null) {
+          let arrList = []
+          for (let i = 0; i < response.data.length; i++) {
+            let list = []
+            // let str= `${parseFloat(response.data[i].N)} ${parseFloat(response.data[i].A)} `
+            list.push(
+              parseFloat(response.data[i].N),
+              parseFloat(response.data[i].A)
+            )
+
+            arrList.push(list)
+            ////////
+            // let testArr =[];
+            // testArr.push(parseFloat(response.data[i].A),parseFloat(response.data[i].N));
+            // arrList.push(testArr);
+            //////
+          }
+
+          this.path = arrList //真实数据
+          //  console.log(JSON.stringify(arrList),'arrList')
+          //  console.log(arrList.join('\n'),'9999999');
+          // 测试数据
+          // this.path =  [
+          //   // [116.317911, 39.939229], // 示例轨迹点1
+          //   // [116.327911, 39.939229], // 示例轨迹点1
+          //   // [116.328911, 39.939329], // 示例轨迹点1
+          //   // [116.338911, 39.939429], // 示例轨迹点1
+          //   // [116.342659, 39.946275]
+          //   // [113.2268105910612,40.88140752472374],
+          //   // [113.210637000,40.8765545]
+          //    [113.210637000,40.8765548] ,// 左下
+          //   // [113.210637002,40.8765551],
+          //   // [113.210637012,40.8765561],
+          //   // [113.210637015,40.8765562],
+          //   // [113.210637020,40.8765564],
+          //   // [113.210637021,40.8765568],
+          //   //  [113.213728833,40.8798781621],
+          //   //  [113.214728833,40.8798781624],
+          //   //  [113.215728833,40.8798781342],
+          //   //  [113.216728833,40.8798781664],
+          //    [113.210637000,40.8798781666], //左上
+
+          //    [113.219728833,40.8798781666],//// 右上
+          // ]
+          // this.longitude = this.path[0][0] // 实景图所在位置的经度
+          // this.latitude = this.path[0][1] // 实景图所在位置的纬度
+          // zoom: 15, // 实景
+        } else {
+          this.path = []
+        }
+        this.initMap()
+      })
+    },
+    async initMap() {
+      await AMapLoader.load({
+        key: 'fb6a0e88dbad4931d96a121bcf7c4442', // 替换为你的高德地图API Key
+        version: '2.0',
+        plugins: []
+      }).then(() => {})
+      // 后续牧场栏舍图
+      var backgroundImageUrl = this.vLoUrl // 示例图片链接
+      var imageLayer = new AMap.ImageLayer({
+        url: backgroundImageUrl,
+        bounds: new AMap.Bounds(
+          // this.path[0],
+          // this.path[this.path.length - 1]
+          // [113.20750428,40.87528624] ,// 左下
+          // [113.22348518,40.88395588], // 右上
+          [113.21478078, 40.87649131], //左下角;
+          [113.23067741, 40.88588863] // 右上角
+        ), //图片范围大小的经纬度,传入西南和东北的经纬度坐标
+        zooms: [15, 20]
+      })
+      this.map = new window.AMap.Map(this.$refs.map, {
+        zoom: 18,
+        // zIndex:2,
+        center: [113.21549472999999, 40.879621060000005],
+        layers: [AMap.createDefaultLayer(), imageLayer]
+      })
+      const startMarker = new window.AMap.Marker({
+        position: this.path[this.path.length - 1], // 起始点位置
+        map: this.map,
+        icon: 'https://webapi.amap.com/theme/v1.3/markers/n/start.png' // 起始点图标
+      })
+      const endMarker = new window.AMap.Marker({
+        position: this.path[0],
+        map: this.map,
+        icon: 'https://webapi.amap.com/theme/v1.3/markers/n/end.png' // 终点图标
+      })
+
+      this.drawPath()
+    },
+    drawPath() {
+      const polyline = new window.AMap.Polyline({
+        path: this.path,
+        strokeStyle: 'red',
+        strokeColor: '#F9423A',
+        strokeOpacity: 1,
+        strokeWeight: 3,
+        map: this.map,
+        dirArrowStyle: true
+      })
+
+      // 调整地图视图以适应轨迹
+
+      this.map.setFitView()
+      this.map.setZoom(18)
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.map-container {
+  height: 600px;
+  width: 1000px;
+}
+.search {
+  clear: both;
+}
+
+.table {
+  margin-top: 10px;
+}
+.el-tag {
+  margin-right: 5px;
+}
+.pages {
+  margin-top: 12px;
+}
+</style>
+<style lang="scss">
+.red-row {
+  background: #fde2e2 !important;
+}
+</style>

Some files were not shown because too many files changed in this diff