Pārlūkot izejas kodu

修改蓝色背景页面接口

liu xiaoping 1 gadu atpakaļ
vecāks
revīzija
4f31b67443

+ 3 - 14
src/components/DataModal/common/DataModalWarn.vue

@@ -43,7 +43,7 @@
 </template>
 
 <script>
-import { mapState } from 'vuex'
+import { mapActions, mapState } from 'vuex'
 import moment from 'moment'
 import { v4 as uuidv4 } from 'uuid'
 
@@ -74,16 +74,9 @@ export default {
     }),
   },
   mounted() {
-    /*if (!this.interval) {
-      this.interval = setInterval(() => {
-        this.handleActive()
-      }, 1000)
-    }*/
+    this.initWarnRecordData()
   },
   watch: {
-    /*warnActive(newVal, oldValue) {
-      this.$parent.setAlertState(newVal)
-    },*/
     warnRecordData: {
       handler(newVal) {
         if (newVal) {
@@ -101,11 +94,7 @@ export default {
     }
   },
   methods: {
-    /*handleActive() {
-      if (moment().valueOf() - this.warnTime > 3000) {
-        this.warnActive = false
-      }
-    },*/
+    ...mapActions(['initWarnRecordData']),
     setTableData() {
       const record = this.dataList.pop()
       if (record) {

+ 6 - 5
src/components/DataModal/common/RealtimeTable.vue

@@ -1,7 +1,5 @@
 <template>
   <div class="realtime-table">
-    <!--element-loading-text="拼命加载中"
-      element-loading-spinner="el-icon-loading"-->
     <el-table
       v-loading="tableData.length <= 0"
       element-loading-background="inherit"
@@ -74,7 +72,7 @@
 </template>
 
 <script>
-import { findCollectEntityInfo } from '@/api/CollectEntity'
+import { findEntityByAcqId } from '@/api/CollectEntity'
 import { findTableColumnsNotStatus } from '@/api/TableConfig'
 import { mapState } from 'vuex'
 
@@ -91,6 +89,7 @@ export default {
   computed: {
     ...mapState({
       realtimeData: (state, getter) => state.queue.realtimeData,
+      acquisitionStationId: state => state.company.acquisitionStationId,
     }),
   },
   watch: {
@@ -129,12 +128,14 @@ export default {
           this.tableColumns = res.data
         }
       })
-      await findCollectEntityInfo().then(res => {
+      const params = {
+        acquisitionStationId: this.acquisitionStationId,
+      }
+      await findEntityByAcqId(params).then(res => {
         // 按照实体分类, 对应第二列
         const tableDataWrapper = []
         handleData(tableDataWrapper, res.data)
         this.tableDataWrapper = tableDataWrapper
-        console.log('tableDataWrapper =>', tableDataWrapper)
       })
     },
     getCellStyle({ row, column, rowIndex, columnIndex }) {

+ 6 - 1
src/store/modules/company.js

@@ -8,13 +8,17 @@ const company = {
     clientCode: '',
     companyName: '',
     factoryName: '',
-    acquisitionStationId: null
+    acquisitionStationId: null,
+    workshop: '',
   },
 
   mutations: {
     SET_ACQUISITION_STATION_ID: (state, payload) => {
       state.acquisitionStationId = payload
     },
+    SET_WORKSHOP_NAME: (state, payload) => {
+      state.workshop = payload
+    },
     SET_CLIENT_CODE: (state, payload) => {
       state.clientCode = payload.code
       state.companyName = payload.company
@@ -31,6 +35,7 @@ const company = {
       })
       findCurrentAcquisitionStation().then(res => {
         commit('SET_ACQUISITION_STATION_ID', res.data.id)
+        commit('SET_WORKSHOP_NAME', res.data.name)
       })
     },
   }

+ 2 - 1
src/views/Data.vue

@@ -137,7 +137,7 @@ export default {
     },
   },
   methods: {
-    ...mapMutations(['SET_ACQUISITION_STATION_ID']),
+    ...mapMutations(['SET_ACQUISITION_STATION_ID', 'SET_WORKSHOP_NAME']),
     getPositionArr() {
       const obj = {}
       this.tableData.forEach(e => {
@@ -230,6 +230,7 @@ export default {
       }
       await updateAcquisitionStation(params).then(res => {
         this.getCollectEntity()
+        this.SET_WORKSHOP_NAME(res.data.name)
       })
     },
   },