This commit is contained in:
2025-04-15 13:41:28 +08:00
parent ba387f5297
commit 85b885fdb5
4 changed files with 46 additions and 17 deletions

10
src/config/getData01.js Normal file
View File

@@ -0,0 +1,10 @@
import {post} from '@js/http.js'
/** 点位配置大屏展示页面 */
// 区域下拉框
export const selectAreaList = () => post('api/screen/selectAreaList', {})
// 点位下拉框
export const getPointInfo = (code) => post('api/screen/point/getPointInfo', {
area_code: code
})

View File

@@ -59,6 +59,7 @@
</template> </template>
<script> <script>
import { selectAreaList } from '@js/getData01'
import SelectOpt from '@components/select.vue' import SelectOpt from '@components/select.vue'
export default { export default {
components: { components: {
@@ -68,14 +69,22 @@ export default {
return { return {
loginname: '', loginname: '',
password: '', password: '',
options: [{value: '1', label: '称重'}, {value: '2', label: '入库'}], // options: [{value: '1', label: '称重'}, {value: '2', label: '入库'}],
options: [],
value: this.$store.getters.equipId, value: this.$store.getters.equipId,
baseUrl: this.$store.getters.baseUrl, baseUrl: this.$store.getters.baseUrl,
setTime: this.$store.getters.setTime / 1000, setTime: this.$store.getters.setTime / 1000,
fullscreen: false fullscreen: false
} }
}, },
mounted () {
this.initData()
},
methods: { methods: {
async initData () {
let res = await selectAreaList()
this.options = res.content
},
getCc () { getCc () {
const screenWidth = window.screen.width const screenWidth = window.screen.width
const screenHeight = window.screen.height const screenHeight = window.screen.height
@@ -95,13 +104,14 @@ export default {
equipId: this.value equipId: this.value
} }
this.$store.dispatch('setConfig', obj) this.$store.dispatch('setConfig', obj)
if (this.value === '1') { this.$router.push('/pointstatus')
this.$router.push('/Weight') // if (this.value === '1') {
} else if (this.value === '2') { // this.$router.push('/Weight')
this.$router.push('/InStore') // } else if (this.value === '2') {
} else if (this.value === '3') { // this.$router.push('/InStore')
this.$router.push('/Prod') // } else if (this.value === '3') {
} // this.$router.push('/Prod')
// }
let element = document.documentElement let element = document.documentElement
if (this.fullscreen) { if (this.fullscreen) {
if (document.exitFullscreen) { if (document.exitFullscreen) {

View File

@@ -12,9 +12,9 @@
:style="{ :style="{
width: item.width + 'px', width: item.width + 'px',
height: item.height + 'px', height: item.height + 'px',
left: item.x + 'px', left: item.x_value + 'px',
top: item.y + 'px', top: item.y_value + 'px',
backgroundImage: 'url(' + item.imageUrl + ')' backgroundImage: 'url(' + baseUrl + '/file/图片/' + item.icon_url + ')'
}" }"
> >
</div> </div>
@@ -22,11 +22,13 @@
</template> </template>
<script> <script>
import {dwzt} from '@js/mork001.js' // import {dwzt} from '@js/mork001.js'
import { getPointInfo } from '@js/getData01'
export default { export default {
name: 'PointStatus', name: 'PointStatus',
data () { data () {
return { return {
baseUrl: this.$store.getters.baseUrl,
timeOut: null, timeOut: null,
interTime: this.$store.getters.setTime, interTime: this.$store.getters.setTime,
timer: null, timer: null,
@@ -47,6 +49,7 @@ export default {
} }
}, },
mounted () { mounted () {
console.log(this.$store.getters.equipId, 'equipId')
this.initData() this.initData()
this.refresh() this.refresh()
}, },
@@ -60,11 +63,17 @@ export default {
this.initData() this.initData()
}, this.interTime) }, this.interTime)
}, },
// async initData () {
// let res = await dwzt()
// clearInterval(this.timeOut)
// this.bgUrl = res.bgUrl
// this.retData = res.pointArr
// }
async initData () { async initData () {
let res = await dwzt() let res = await getPointInfo(this.$store.getters.equipId)
clearInterval(this.timeOut) clearInterval(this.timeOut)
this.bgUrl = res.bgUrl // this.bgUrl = res.bgUrl
this.retData = res.pointArr this.retData = res.content
} }
} }
} }

View File

@@ -1,7 +1,7 @@
import * as types from '../types' import * as types from '../types'
import { getStore, setStore } from '@js/mUtils.js' import { getStore, setStore } from '@js/mUtils.js'
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.59:8080' : 'http://10.26.138.21:8010' const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.10.41:8012' : 'http://192.168.10.41:8012'
/** /**
* App通用配置 * App通用配置
@@ -9,7 +9,7 @@ const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.59:8
const state = { const state = {
baseUrl: getStore('baseUrl') || baseUrl, baseUrl: getStore('baseUrl') || baseUrl,
setTime: getStore('setTime') || 50000, setTime: getStore('setTime') || 50000,
equipId: getStore('equipId') || '1' equipId: getStore('equipId') || ''
} }
const actions = { const actions = {