From 7b5549dd6115d42eda331916fdb38ac806169c9b Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 13 五月 2024 10:35:46 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before into master

---
 src/views/plan/manufacturingorder/index.vue                 |    4 
 src/views/quality/processconfiguration/index.vue            |   25 ++--
 vue.config.js                                               |    4 
 src/views/product/workbench/workReportCard.vue              |    4 
 src/api/equipment/equipment.js                              |   15 +++
 src/views/equipment/mqtt-show/components/largeAreaChart.vue |   59 ++++++-----
 src/views/equipment/mqtt-show/index.vue                     |  165 ++++++++++++++++++++++----------
 src/views/plan/operationtask/operationtask-form.vue         |    4 
 8 files changed, 180 insertions(+), 100 deletions(-)

diff --git a/src/api/equipment/equipment.js b/src/api/equipment/equipment.js
index 1050e3b..7b86def 100644
--- a/src/api/equipment/equipment.js
+++ b/src/api/equipment/equipment.js
@@ -75,4 +75,19 @@
     url: '/mes/equipment/page/' + id,
     method: 'get'
   })
+}
+
+export function getDeviceId() {
+  return request({
+    url: '/mes/mqtt/getDeviceId',
+    method: 'get'
+  })
+}
+
+export function mqttList(query) {
+  return request({
+    url: '/mes/mqtt/mqttList',
+    method: 'get',
+    params: query
+  })
 }
\ No newline at end of file
diff --git a/src/views/equipment/mqtt-show/components/largeAreaChart.vue b/src/views/equipment/mqtt-show/components/largeAreaChart.vue
index 5bdaf75..90ecb43 100644
--- a/src/views/equipment/mqtt-show/components/largeAreaChart.vue
+++ b/src/views/equipment/mqtt-show/components/largeAreaChart.vue
@@ -7,27 +7,21 @@
 var myChart = null
 var option = null
 
-let base = +new Date(1968, 9, 3)
-let oneDay = 24 * 3600 * 1000
-let date = []
-let data = [Math.random() * 300]
-for (let i = 1; i < 20000; i++) {
-  var now = new Date((base += oneDay))
-  date.push([now.getFullYear(), now.getMonth() + 1, now.getDate()].join('/'))
-  data.push(Math.round((Math.random() - 0.5) * 20 + data[i - 1]))
-}
-
 export default {
-  //   props: {
-  //     yAxisMonth: {
-  //       type: Array,
-  //       default: []
-  //     },
-  //     seriesData: {
-  //       type: Array,
-  //       default: []
-  //     }
-  //   },
+  props: {
+    yAxisMonth: {
+      type: Array,
+      default: []
+    },
+    seriesData: {
+      type: Array,
+      default: []
+    },
+    otherData: {
+      type: Object,
+      default: {}
+    }
+  },
   data() {
     return {
       option: {
@@ -39,7 +33,7 @@
         },
         title: {
           left: '5%',
-          text: 'Large Ara Chart'
+          text: '璁惧鍚嶇О锛�' + this.otherData.deviceName + '\\鍗曚綅锛�' + (this.otherData.unit ? this.otherData.unit : '')
         },
         toolbox: {
           right: '5%',
@@ -57,7 +51,7 @@
         xAxis: {
           type: 'category',
           boundaryGap: false,
-          data: date
+          data: this.yAxisMonth
         },
         yAxis: {
           type: 'value',
@@ -76,7 +70,7 @@
         ],
         series: [
           {
-            name: 'Fake Data',
+            name: '鍙傛暟',
             type: 'line',
             symbol: 'none',
             sampling: 'lttb',
@@ -95,7 +89,7 @@
                 }
               ])
             },
-            data: data
+            data: this.seriesData
           }
         ]
       }
@@ -109,15 +103,26 @@
   methods: {
     makeOption() {},
     initDrag() {
-      myChart.setOption((option = this.option))
+      myChart.setOption((option = this.option), true)
 
-      option && myChart.setOption(option)
       // 椤甸潰鍙戠敓鍙樺寲tree涔熸敼鍙�
       window.addEventListener('resize', () => {
         if (myChart) myChart.resize()
       })
     }
-  }
+  },
+  // watch: {
+  //   yAxisMonth: {
+  //     handler(newVal) {
+  //       console.log(`output->myChart`,myChart)
+  //       setTimeout(()=>{
+  //         myChart.setOption((option = this.option), true)
+  //       },100)
+        
+  //     },
+  //     deep: true
+  //   }
+  // }
 }
 </script>
 
diff --git a/src/views/equipment/mqtt-show/index.vue b/src/views/equipment/mqtt-show/index.vue
index 8d3a4fe..6e95491 100644
--- a/src/views/equipment/mqtt-show/index.vue
+++ b/src/views/equipment/mqtt-show/index.vue
@@ -1,71 +1,130 @@
 <template>
   <div>
-    <div class="header_div">
-      <el-select v-model="value" placeholder="璇烽�夋嫨">
-        <el-option
-          v-for="item in options"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value"
-        >
-        </el-option>
-      </el-select>
-    </div>
-    <el-row>
-      <el-col
-        v-for="(v, k) in index"
-        :key="k"
-        style="height: 40vh; padding-top: 0.4em;"
-        :span="12"
-        ><largeAreaChart
-      /></el-col>
-    </el-row>
+    <basic-container>
+      <el-form label-width="100px" :inline="true">
+        <el-form-item label="璁惧锛�" required>
+          <el-select
+            v-model="deviceId"
+            placeholder="璇烽�夋嫨"
+            @change="getMqttLists"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.name"
+              :value="item.device_id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="鏃堕棿锛�">
+          <el-radio-group
+            v-model="checkboxGroup3"
+            size="small"
+            @change="destroyTimerAgainStart"
+          >
+            <el-radio-button v-for="city in cities" :label="city" :key="city">{{
+              city
+            }}</el-radio-button>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+    </basic-container>
+    <basic-container>
+      <div
+        v-if="!largeAreaChartList.length > 0"
+        style="height: 75vh; padding-top: 0.4em; display: flex; align-items: center; justify-content: center;"
+      >
+        鏆傛棤鏁版嵁
+      </div>
+      <el-row>
+        <el-col
+          v-for="(v, k) in largeAreaChartList"
+          :key="k"
+          style="height: 40vh; padding-top: 0.4em;"
+          :span="12"
+          ><largeAreaChart
+            ref="largeAreaChartRef"
+            v-if="largeAreaChartList.length > 0"
+            :key="k"
+            :yAxisMonth="v.yAxisMonth"
+            :seriesData="v.listData"
+            :otherData="v"
+          />
+        </el-col>
+      </el-row>
+    </basic-container>
   </div>
 </template>
 
 <script>
 import largeAreaChart from './components/largeAreaChart.vue'
+import { getDeviceId, mqttList } from '@/api/equipment/equipment'
+
 export default {
   components: {
     largeAreaChart: largeAreaChart
   },
   data() {
     return {
-      index: 7,
-      options: [
-        {
-          value: '閫夐」1',
-          label: '榛勯噾绯�'
-        },
-        {
-          value: '閫夐」2',
-          label: '鍙岀毊濂�'
-        },
-        {
-          value: '閫夐」3',
-          label: '铓典粩鐓�'
-        },
-        {
-          value: '閫夐」4',
-          label: '榫欓』闈�'
-        },
-        {
-          value: '閫夐」5',
-          label: '鍖椾含鐑ら腑'
-        }
-      ],
-      value: ''
+      largeAreaChartList: [],
+      cities: ['1 鍒嗛挓', '3 鍒嗛挓', '5 鍒嗛挓', '10 鍒嗛挓'],
+      checkboxGroup3: '1 鍒嗛挓',
+      options: [],
+      deviceId: '',
+      timer: ''
+    }
+  },
+  async created() {
+    await this.getDeviceIdFun()
+    this.getMqttLists()
+  },
+  mounted() {
+    this.destroyTimerAgainStart()
+  },
+  beforeDestroy() {
+    console.log(`output->閿�姣佷簡瀹氭椂鍣╜)
+    clearInterval(this.timer)
+  },
+  methods: {
+    async getDeviceIdFun() {
+      await getDeviceId().then((res) => {
+        this.options = res.data.data
+        this.deviceId = this.options[0].device_id
+      })
+    },
+    async getMqttLists() {
+      const obj = Object.assign({
+        deviceId: this.deviceId,
+        collectionTime: this.checkboxGroup3.split(' ')[0]
+      })
+      this.largeAreaChartList = []
+      await mqttList(obj).then((res) => {
+        let data = res.data.data
+        data.forEach((i) => {
+          i.listData = []
+          i.yAxisMonth = []
+          if (i.listMqttTableData.length > 0) {
+            i.deviceId = i.listMqttTableData[0].deviceId
+          }
+          i.listMqttTableData.forEach((j) => {
+            i.listData.push(j.value)
+            i.yAxisMonth.push(j.collectionTime)
+          })
+          i.listMqttTableData = []
+        })
+        this.largeAreaChartList = data
+      })
+    },
+    destroyTimerAgainStart() {
+      clearInterval(this.timer)
+      this.timer = setInterval(
+        this.getMqttLists,
+        1000 * 60 * this.checkboxGroup3.split(' ')[0]
+      )
     }
   }
 }
 </script>
 
-<style>
-.header_div {
-  height: 5em;
-  width: 100%;
-  display: flex;
-  align-items: center;
-  margin-left: 3em;
-}
-</style>
+<style></style>
diff --git a/src/views/plan/manufacturingorder/index.vue b/src/views/plan/manufacturingorder/index.vue
index fd28335..e3a8654 100644
--- a/src/views/plan/manufacturingorder/index.vue
+++ b/src/views/plan/manufacturingorder/index.vue
@@ -100,14 +100,14 @@
             >鍒锋柊ifs杞﹂棿璁㈠崟鍙�
           </el-button> -->
 
-          <el-button
+          <!-- <el-button
           v-if="permissions.manufacturingorder_export"
             @click="exportExcel"
             type="primary"
             style="margin-left:10px;"
             :loading="loadingExcel"
             >瀵煎嚭
-          </el-button>
+          </el-button> -->
           <el-button
           v-if="permissions.manufacturingorder_label_print"
             @click="labelPrint"
diff --git a/src/views/plan/operationtask/operationtask-form.vue b/src/views/plan/operationtask/operationtask-form.vue
index 515d65d..b35837e 100644
--- a/src/views/plan/operationtask/operationtask-form.vue
+++ b/src/views/plan/operationtask/operationtask-form.vue
@@ -157,7 +157,7 @@
                       </el-col>
                     </el-row>
                     <el-row :gutter="10">
-                      <el-col :span="15">
+                      <el-col :span="14">
                         <el-form-item label="璁″垝鏃堕棿" prop="localDateTimes">
                           <el-date-picker :class="tattimest ? 'sed' : ''" v-model="dataForm.localDateTimes"
                             type="datetimerange" range-separator="鑷�" start-placeholder="寮�濮�" end-placeholder="缁撴潫"
@@ -592,7 +592,7 @@
         workCenter: [
           { required: true, message: '宸ヤ綔涓績涓嶈兘涓虹┖', trigger: 'change' }
         ],
-        workstations: [
+        workstationId: [
           { required: true, message: '宸ヤ綔绔欎笉鑳戒负绌�', trigger: 'change' }
         ],
         plannedQuantity: [
diff --git a/src/views/product/workbench/workReportCard.vue b/src/views/product/workbench/workReportCard.vue
index 7f02663..fcf2a04 100644
--- a/src/views/product/workbench/workReportCard.vue
+++ b/src/views/product/workbench/workReportCard.vue
@@ -126,10 +126,10 @@
           <!-- <el-button class="tracking-out-revoke-btn" type="primary" icon="tracking-btn-out"
           :disabled="currProductMainDisable || currentDutyRecord.isConfirm" v-if="!editShow" >浜ょ彮
         </el-button> -->
-        <!-- <el-button class="submit-out-btn" type="primary"
+        <el-button class="submit-out-btn" type="primary"
             :disabled="currProductMainDisable || currentDutyRecord.isConfirm" v-if="!editShow" @click="submitList()"
             :loading="submitLoading">鎻愪氦
-          </el-button> -->
+          </el-button>
           <el-button class="batch-out-del-btn" type="primary"
             :disabled="currProductMainDisable || currentDutyRecord.isConfirm" v-if="!editShow" @click="deleteList()">鍒犻櫎
           </el-button>
diff --git a/src/views/quality/processconfiguration/index.vue b/src/views/quality/processconfiguration/index.vue
index 6fff645..197b3f4 100644
--- a/src/views/quality/processconfiguration/index.vue
+++ b/src/views/quality/processconfiguration/index.vue
@@ -170,6 +170,18 @@
             // render: { fun: this.addOrUpdateHandle }
               }
           },
+          {
+              minWidth: '120',
+              prop: 'state',
+              label: '鐘舵��',
+              isTrue: true,
+              isSearch: true,
+              searchInfoType: 'select',
+              formatter: this.formatInsState,
+              optList: () => {
+                  return this.StateList
+              }
+          },
           // 妫�楠岀紪鍙�
           {
             minWidth: '140',
@@ -264,18 +276,7 @@
                searchInfoType: 'datetimerange',
                formatter: this.formatDateTime,
            },
-          {
-              minWidth: '120',
-              prop: 'state',
-              label: '鐘舵��',
-              isTrue: true,
-              isSearch: true,
-              searchInfoType: 'select',
-              formatter: this.formatInsState,
-              optList: () => {
-                  return this.StateList
-              }
-          },
+          
           // {
           //   minWidth: '120',
           //   prop: '',
diff --git a/vue.config.js b/vue.config.js
index b413af0..545c796 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -6,8 +6,8 @@
 
 
 // const url = 'https://ztms-mes.chinaztt.cn/'
-  // const url = 'http://localhost:9999'
-const url = 'http://192.168.32.45:9999'
+const url = 'http://localhost:9999'
+//const url = 'http://192.168.32.45:9999'
 
 
 const localUrl = 'http://localhost:8089'

--
Gitblit v1.9.3