Commit 25ba7af2 by huangqy

1111

parent cf1e1dd7
......@@ -249,7 +249,7 @@ export default defineComponent({
})
}
function handleCommand() {
function handleCommand(command) {
if (command === '#223170') { // 藏蓝
sessionStorage.setItem('loginbg', 'bg1')
}
......@@ -259,6 +259,7 @@ export default defineComponent({
if (command === '#1f8a36') { // 军绿
sessionStorage.setItem('loginbg', 'bg')
}
window.location.reload()
}
return {
......
<template>
<el-tabs :tab-position="tabPosition" type="card" :stretch="true" class="menu-tabs" @tab-change="tabChange">
<el-tabs :tab-position="tabPosition" type="card" :stretch="true" class="menu-tabs" @tab-change="tabChange" :style="{backgroundImage:'url('+ bg +')'}">
<el-tab-pane v-for="item in tabList" :key="item.title">
<template #label>
<span class="custom-tabs-label">
......@@ -29,6 +29,7 @@ export default defineComponent({
const { proxy } = getCurrentInstance()
const tabPosition = ref('bottom')
const log = ref('')
const bg = ref('/src/assets/theme/bg.png')
const tabList = [
{title: '射频识别', icon: 'iconfont icon-tiaozhishibie', template: 'RFID'},
{title: '入库作业', icon: 'iconfont icon-rukuguanli-', template: 'InTask'},
......@@ -37,11 +38,36 @@ export default defineComponent({
{title: '查询', icon: 'iconfont icon-chaxun', template: 'Query'},
{title: '通道配置', icon: 'iconfont icon-shezhi', template: 'ChannelSetting'},
]
const a = sessionStorage.getItem('loginbg')
if(a == 'bg') {
bg.value = '/src/assets/theme/bg.png'
}
if(a == 'bg1') {
bg.value = '/src/assets/theme/bg1.png'
}
if(a == 'bg2') {
bg.value = '/src/assets/theme/bg2.png'
}
setTimeout(()=> {
changeBg()
}, 200)
function changeBg() {
for(var i =0;i< document.getElementsByClassName('el-card__header').length; i++){
document.getElementsByClassName('el-card__header')[i].style.backgroundImage = 'url(' + bg.value +')'
}
}
function tabChange(index) {
if (index == 0) {
return
}
proxy.$refs[tabList[index].template][0].loadData()
}
function handleRefresh() {
proxy.$refs.InTask[0].loadData()
......@@ -54,6 +80,7 @@ export default defineComponent({
tabPosition,
tabList,
log,
bg,
tabChange,
handleRefresh,
handleLogChange
......
......@@ -4,11 +4,9 @@
<el-tab-pane v-for="item in channelList" :key="item" :label="'通道' + item.stationId" :name="item.stationId">
<el-card style="height: calc(100vh - 227.75px)">
<template #header>
<div class="card-header">
<span>实时出入库数据</span>
<el-button round style="float: right;" type="primary" @click="showChannelSetting">通道配置</el-button>
<el-button round style="float: right;margin-right: 10px;" type="warning" @click="clearData">清空数据</el-button>
</div>
<span>实时出入库数据</span>
<el-button round style="float: right;" type="primary" @click="showChannelSetting">通道配置</el-button>
<el-button round style="float: right;margin-right: 10px;" type="warning" @click="clearData">清空数据</el-button>
</template>
<el-row :gutter="20">
<el-col :span="18">
......@@ -211,7 +209,7 @@
<script>
import { defineComponent, ref, reactive, toRefs, onBeforeUnmount } from 'vue'
import { ElMessage } from 'element-plus'
import { ElMessage, ElCard } from 'element-plus'
import { postAction, getAction } from '@/api/manage'
import { Help, Monitor } from '@element-plus/icons-vue'
export default defineComponent({
......@@ -252,9 +250,13 @@ export default defineComponent({
});
// websocket开始
let websock = null
function initWebSocket () {
if (websock) {
return
}
websock = new WebSocket(window._CONFIG['wsURL'] + JSON.parse(sessionStorage.getItem('storeInfo')).storeCode);
websock.onopen = websocketOnopen;
websock.onerror = websocketOnerror;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论