数据
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {post} from './http.js'
|
||||
import {post, post1} from './http.js'
|
||||
// 大屏-中间设备运行情况
|
||||
export const deviceCondition = () => post('api/cockpit/deviceCondition', {})
|
||||
// 出、入窑输送线弹窗
|
||||
@@ -10,4 +10,4 @@ export const screenTableData = () => post('api/cockpit/screenTableData', {})
|
||||
// 窑看板
|
||||
export const klineInfo = () => post('api/cockpit/klineInfo', {})
|
||||
// 料仓监控
|
||||
export const queryliaocang = () => post('api/hand/queryliaocang', {})
|
||||
export const queryliaocang = () => post1('api/hand/queryliaocang', {})
|
||||
|
||||
@@ -63,3 +63,18 @@ export const post = (sevmethod, params) => {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export const post1 = (sevmethod, params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.post(`${store.getters.lcUrl}/` + sevmethod, params)
|
||||
.then(response => {
|
||||
resolve(response.data)
|
||||
}, error => {
|
||||
// Dialog(error.message)
|
||||
reject(error.message)
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2534,6 +2534,6 @@ export const klineInfo = () => {
|
||||
return res
|
||||
}
|
||||
export const queryliaocang = () => {
|
||||
let res = [{point_name: 'LC16'}]
|
||||
let res = [{point_name: 'A1', num: '2100'}, {point_name: 'A2', num: '6100'}, {point_name: 'A3', num: '100'}, {point_name: 'A4', num: '100'}, {point_name: 'A5', num: '100'}, {point_name: 'A6', num: '100'}, {point_name: 'A7', num: '100'}, {point_name: 'A8', num: '100'}, {point_name: 'A9', num: '100'}, {point_name: 'A10', num: '100'}, {point_name: 'A11', num: '100'}, {point_name: 'A12', num: '100'}, {point_name: 'A13', num: '100'}, {point_name: 'A14', num: '100'}, {point_name: 'A15', num: '100'}, {point_name: 'A16', num: '100'}, {point_name: 'B1', num: '100'}, {point_name: 'B2', num: '100'}, {point_name: 'B3', num: '100'}, {point_name: 'B4', num: '100'}, {point_name: 'B5', num: '100'}, {point_name: 'B6', num: '100'}, {point_name: 'B7', num: '100'}, {point_name: 'B8', num: '100'}, {point_name: 'B9', num: '100'}, {point_name: 'B10', num: '100'}, {point_name: 'B11', num: '100'}, {point_name: 'B12', num: '100'}, {point_name: 'B13', num: '100'}, {point_name: 'B14', num: '100'}, {point_name: 'B15', num: '100'}, {point_name: 'B16', num: '100'}, {point_name: 'C1', num: '100'}, {point_name: 'C2', num: '100'}, {point_name: 'C3', num: '100'}, {point_name: 'C4', num: '100'}, {point_name: 'C5', num: '100'}, {point_name: 'C6', num: '100'}, {point_name: 'C7', num: '100'}, {point_name: 'C8', num: '100'}, {point_name: 'C9', num: '100'}, {point_name: 'C10', num: '100'}, {point_name: 'C11', num: '100'}, {point_name: 'C12', num: '100'}, {point_name: 'C13', num: '100'}, {point_name: 'C14', num: '100'}, {point_name: 'C15', num: '100'}, {point_name: 'C16', num: '100'}, {point_name: 'Z1', num: '100'}, {point_name: 'Z2', num: '100'}, {point_name: 'Z3', num: '100'}, {point_name: 'Z4', num: '100'}, {point_name: 'Z5', num: '100'}, {point_name: 'Z6', num: '100'}, {point_name: 'Z7', num: '100'}, {point_name: 'Z8', num: '100'}, {point_name: 'Z9', num: '100'}, {point_name: 'Z10', num: '100'}, {point_name: 'Z11', num: '100'}, {point_name: 'Z12', num: '-100'}]
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
<label>域名地址</label>
|
||||
<input type="text" class="inputStyle" v-model="baseUrl">
|
||||
</div>
|
||||
<div class="inputOuter">
|
||||
<label>料仓域名地址</label>
|
||||
<input type="text" class="inputStyle" v-model="lcUrl">
|
||||
</div>
|
||||
<div class="inputOuter">
|
||||
<label>刷新时间(秒)</label>
|
||||
<input type="number" class="inputStyle" v-model="setTime">
|
||||
@@ -71,6 +75,7 @@ export default {
|
||||
options: [{value: '1', label: '大屏'}, {value: '2', label: '压制生产看板'}, {value: '3', label: '分拣作业监控'}, {value: '4', label: '干燥作业监控'}, {value: '5', label: '料仓监控'}],
|
||||
value: this.$store.getters.equipId,
|
||||
baseUrl: this.$store.getters.baseUrl,
|
||||
lcUrl: this.$store.getters.lcUrl,
|
||||
setTime: this.$store.getters.setTime / 1000,
|
||||
fullscreen: false
|
||||
}
|
||||
@@ -91,6 +96,7 @@ export default {
|
||||
}
|
||||
let obj = {
|
||||
baseUrl: this.baseUrl,
|
||||
lcUrl: this.lcUrl,
|
||||
setTime: this.setTime * 1000,
|
||||
equipId: this.value
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
<div class="st_item_i">
|
||||
<div class="txt">C<br>区</div>
|
||||
<div class="p_wraper">
|
||||
<div class="p_item" v-for="(e, i) in dataList[2]" :key="'a'+ i">
|
||||
<div class="p_item_i" :class="{'item_bg_1': Number(e.qty) >= 0 && Number(e.qty) < 2000, 'item_bg_2': Number(e.qty) >= 2000 && Number(e.qty) < 6000, 'item_bg_3': Number(e.qty) >= 6000}">
|
||||
<div class="p_item" v-for="(e, i) in cdata" :key="'a'+ i">
|
||||
<div class="p_item_i" :class="{'item_bg_1': Number(e.num) >= 0 && Number(e.num) < 2000, 'item_bg_2': Number(e.num) >= 2000 && Number(e.num) < 6000, 'item_bg_3': Number(e.num) >= 6000}">
|
||||
<p class="p1">{{ e.point_name }}</p>
|
||||
<p class="p2">{{ e.qty }}</p>
|
||||
<p class="p2">{{ e.num }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,10 +32,10 @@
|
||||
<div class="st_item_i">
|
||||
<div class="txt">B<br>区</div>
|
||||
<div class="p_wraper">
|
||||
<div class="p_item" v-for="(e, i) in dataList[1]" :key="'b'+ i">
|
||||
<div class="p_item_i" :class="{'item_bg_1': Number(e.qty) >= 0 && Number(e.qty) < 2000, 'item_bg_2': Number(e.qty) >= 2000 && Number(e.qty) < 6000, 'item_bg_3': Number(e.qty) >= 6000}">
|
||||
<div class="p_item" v-for="(e, i) in bdata" :key="'b'+ i">
|
||||
<div class="p_item_i" :class="{'item_bg_1': Number(e.num) >= 0 && Number(e.num) < 2000, 'item_bg_2': Number(e.num) >= 2000 && Number(e.num) < 6000, 'item_bg_3': Number(e.num) >= 6000}">
|
||||
<p class="p1">{{ e.point_name }}</p>
|
||||
<p class="p2">{{ e.qty }}</p>
|
||||
<p class="p2">{{ e.num }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,10 +45,10 @@
|
||||
<div class="st_item_i">
|
||||
<div class="txt">A<br>区</div>
|
||||
<div class="p_wraper">
|
||||
<div class="p_item" v-for="(e, i) in dataList[0]" :key="'c'+ i">
|
||||
<div class="p_item_i" :class="{'item_bg_1': Number(e.qty) >= 0 && Number(e.qty) < 2000, 'item_bg_2': Number(e.qty) >= 2000 && Number(e.qty) < 6000, 'item_bg_3': Number(e.qty) >= 6000}">
|
||||
<div class="p_item" v-for="(e, i) in adata" :key="'c'+ i">
|
||||
<div class="p_item_i" :class="{'item_bg_1': Number(e.num) >= 0 && Number(e.num) < 2000, 'item_bg_2': Number(e.num) >= 2000 && Number(e.num) < 6000, 'item_bg_3': Number(e.num) >= 6000}">
|
||||
<p class="p1">{{ e.point_name }}</p>
|
||||
<p class="p2">{{ e.qty }}</p>
|
||||
<p class="p2">{{ e.num }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -57,11 +57,11 @@
|
||||
<div class="st_item">
|
||||
<div class="st_item_i">
|
||||
<div class="txt">Z<br>区</div>
|
||||
<div class="p_wraper">
|
||||
<div class="p_item" v-for="(e, i) in dataList[3]" :key="'z'+ i" :class="{'p_item_active': e.point_status === '2'}">
|
||||
<div class="p_item_i" :class="{'item_bg_1': Number(e.qty) >= 0 && Number(e.qty) < 2000, 'item_bg_2': Number(e.qty) >= 2000 && Number(e.qty) < 6000, 'item_bg_3': Number(e.qty) >= 6000}">
|
||||
<div class="p_wraper p_wraper_1">
|
||||
<div class="p_item" v-for="(e, i) in zdata" :key="'z'+ i">
|
||||
<div class="p_item_i" :class="{'item_bg_1': Number(e.num) < 0, 'item_bg_2': Number(e.num) >= 0}">
|
||||
<p class="p1">{{ e.point_name }}</p>
|
||||
<p class="p2">{{ e.qty }}</p>
|
||||
<p class="p2">{{ e.num }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -71,49 +71,21 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import { klineInfo } from '@js/getData2.js'
|
||||
import { queryliaocang } from '@js/getData2.js'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
interTime: this.$store.getters.setTime,
|
||||
timer: null,
|
||||
dataList: [[], [], [], []]
|
||||
dataList: [[], [], [], []],
|
||||
adata: [],
|
||||
bdata: [],
|
||||
cdata: [],
|
||||
zdata: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.refresh()
|
||||
for (let i = 0; i < 4; i++) {
|
||||
if (i === 0) {
|
||||
for (let j = 0; j < 16; j++) {
|
||||
let qty = Math.random()
|
||||
qty = qty.toFixed(4) * 10000
|
||||
qty = qty.toFixed(0)
|
||||
this.dataList[i].push({point_name: `A${16 - j}`, qty: qty, point_status: '1'})
|
||||
}
|
||||
} else if (i === 1) {
|
||||
for (let j = 0; j < 16; j++) {
|
||||
let qty = Math.random()
|
||||
qty = qty.toFixed(4) * 10000
|
||||
qty = qty.toFixed(0)
|
||||
this.dataList[i].push({point_name: `B${16 - j}`, qty: qty, point_status: '1'})
|
||||
}
|
||||
} else if (i === 2) {
|
||||
for (let j = 0; j < 16; j++) {
|
||||
let qty = Math.random()
|
||||
qty = qty.toFixed(4) * 10000
|
||||
qty = qty.toFixed(0)
|
||||
this.dataList[i].push({point_name: `C${16 - j}`, qty: qty, point_status: '1'})
|
||||
}
|
||||
} else {
|
||||
for (let j = 0; j < 12; j++) {
|
||||
let qty = Math.random()
|
||||
qty = qty.toFixed(4) * 10000
|
||||
qty = qty.toFixed(0)
|
||||
this.dataList[i].push({point_name: `Z${12 - j}`, qty: qty, point_status: '2'})
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(this.dataList)
|
||||
},
|
||||
beforeDestroy () {
|
||||
clearInterval(this.timer)
|
||||
@@ -125,14 +97,24 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
refresh () {
|
||||
this._queryliaocang()
|
||||
this.timer = setInterval(() => {
|
||||
// this._klineInfo()
|
||||
this._queryliaocang()
|
||||
}, this.interTime)
|
||||
},
|
||||
async _queryliaocang () {
|
||||
let res = await queryliaocang()
|
||||
if (res.length > 0) {
|
||||
this.adata = [...res.slice(0, 16)]
|
||||
this.adata.reverse()
|
||||
this.bdata = [...res.slice(16, 32)]
|
||||
this.bdata.reverse()
|
||||
this.cdata = [...res.slice(32, 48)]
|
||||
this.cdata.reverse()
|
||||
this.zdata = [...res.slice(48, 60)]
|
||||
this.zdata.reverse()
|
||||
}
|
||||
}
|
||||
// async _klineInfo () {
|
||||
// let res = await klineInfo()
|
||||
// console.log(res)
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -196,6 +178,8 @@ export default {
|
||||
_fj(row, flex-start)
|
||||
align-content: flex-start
|
||||
flex-wrap wrap
|
||||
.p_wraper_1
|
||||
justify-content: flex-end
|
||||
.p_item
|
||||
_wh(5.5%, 100%)
|
||||
border-radius 4px
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import * as types from '../types'
|
||||
import { getStore, setStore } from '@js/mUtils.js'
|
||||
|
||||
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.59:8080' : 'http://192.168.46.5:8080/hl_nlapp'
|
||||
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.8.162:8010' : 'http://192.168.8.162:8010'
|
||||
const lcUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.8.160:8010' : 'http://192.168.8.160:8010'
|
||||
|
||||
/**
|
||||
* App通用配置
|
||||
*/
|
||||
const state = {
|
||||
baseUrl: getStore('baseUrl') || baseUrl,
|
||||
lcUrl: getStore('lcUrl') || lcUrl,
|
||||
setTime: getStore('setTime') || 50000,
|
||||
equipId: getStore('equipId') || '1'
|
||||
}
|
||||
@@ -15,6 +17,7 @@ const state = {
|
||||
const actions = {
|
||||
setConfig ({commit}, res) {
|
||||
setStore('baseUrl', res.baseUrl)
|
||||
setStore('lcUrl', res.lcUrl)
|
||||
setStore('setTime', res.setTime)
|
||||
setStore('equipId', res.equipId)
|
||||
commit(types.COM_CONFIG, res)
|
||||
@@ -23,6 +26,7 @@ const actions = {
|
||||
|
||||
const getters = {
|
||||
baseUrl: state => state.baseUrl,
|
||||
lcUrl: state => state.lcUrl,
|
||||
setTime: state => state.setTime,
|
||||
equipId: state => state.equipId
|
||||
}
|
||||
@@ -30,6 +34,7 @@ const getters = {
|
||||
const mutations = {
|
||||
[types.COM_CONFIG] (state, res) {
|
||||
state.baseUrl = res.baseUrl
|
||||
state.lcUrl = res.lcUrl
|
||||
state.setTime = res.setTime
|
||||
state.equipId = res.equipId
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user