Browse Source

首页,入库对话框,3D页面websocket连接开启

master
z_yu 3 years ago
parent
commit
1c5d41e269
  1. 1
      src/views/archivesManage/outInStorage/inStorage/module/inDialog.vue
  2. 70
      src/views/home.vue
  3. 4
      src/views/storeManage/deviceManage/module/deviceDetail.vue
  4. 62
      src/views/storeManage/warehouse3D/index.vue

1
src/views/archivesManage/outInStorage/inStorage/module/inDialog.vue

@ -347,6 +347,7 @@ export default {
background-color: #021941; background-color: #021941;
width: 200px; width: 200px;
// height: 100%; // height: 100%;
overflow: auto;
} }
.content-right { .content-right {
flex: 1; flex: 1;

70
src/views/home.vue

@ -2,7 +2,7 @@
<div class="dashboard-container"> <div class="dashboard-container">
<div class="dashboard-editor-container"> <div class="dashboard-editor-container">
<!-- <github-corner class="github-corner" /> --> <!-- <github-corner class="github-corner" /> -->
<panel-group @handleSetLineChartData="handleSetLineChartData" />
<panel-group />
<!-- <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> <!-- <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<line-chart :chart-data="lineChartData" /> <line-chart :chart-data="lineChartData" />
</el-row> --> </el-row> -->
@ -14,8 +14,8 @@
<div class="search-input"> <div class="search-input">
<!-- v-model="input3" v-model="select"--> <!-- v-model="input3" v-model="select"-->
<el-input placeholder="2022,办公室" class="input-with-select"> <el-input placeholder="2022,办公室" class="input-with-select">
<el-select slot="prepend" placeholder="全目录">
<el-option label="餐厅名" value="1" />
<el-select slot="prepend" v-model="selectValue">
<el-option label="全目录" value="1" />
<el-option label="订单号" value="2" /> <el-option label="订单号" value="2" />
<el-option label="用户电话" value="3" /> <el-option label="用户电话" value="3" />
</el-select> </el-select>
@ -111,7 +111,7 @@
<svg-icon icon-class="menjin" class-name="warehouse-svg" />门禁记录 <svg-icon icon-class="menjin" class-name="warehouse-svg" />门禁记录
</p> </p>
</h3> </h3>
<el-table ref="table2" style="min-width: 100%;" height="100%" :data="tableData" class="warehose-el-table" :row-class-name="rowBgColor">
<el-table ref="table2" style="min-width: 100%;" height="100%" :data="tableData" class="warehose-el-table" stripe>
<el-table-column prop="time" label="时间" align="center" min-width="60" /> <el-table-column prop="time" label="时间" align="center" min-width="60" />
<el-table-column prop="warehouse" label="库房" align="center" min-width="60" /> <el-table-column prop="warehouse" label="库房" align="center" min-width="60" />
<el-table-column prop="warning" label="警情" align="center" :show-overflow-tooltip="true" min-width="85" /> <el-table-column prop="warning" label="警情" align="center" :show-overflow-tooltip="true" min-width="85" />
@ -128,7 +128,7 @@
<svg-icon icon-class="alerm" class-name="warehouse-svg" />报警记录 <svg-icon icon-class="alerm" class-name="warehouse-svg" />报警记录
</p> </p>
</h3> </h3>
<el-table ref="table" style="min-width: 100%;" height="100%" :data="tableData" class="warehose-el-table" :row-class-name="rowBgColor">
<el-table ref="table" style="min-width: 100%;" height="100%" :data="tableData" class="warehose-el-table" stripe>
<el-table-column prop="time" label="时间" align="center" min-width="60" /> <el-table-column prop="time" label="时间" align="center" min-width="60" />
<el-table-column prop="warehouse" label="库房" align="center" min-width="60" /> <el-table-column prop="warehouse" label="库房" align="center" min-width="60" />
<el-table-column prop="warning" label="警情" align="center" :show-overflow-tooltip="true" min-width="85" /> <el-table-column prop="warning" label="警情" align="center" :show-overflow-tooltip="true" min-width="85" />
@ -193,24 +193,24 @@ import catePie from '@/views/components/echarts/catePie.vue'
import typePie from '@/views/components/echarts/typePie.vue' import typePie from '@/views/components/echarts/typePie.vue'
import data1 from './data1.json' import data1 from './data1.json'
const lineChartData = {
newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165],
actualData: [120, 82, 91, 154, 162, 140, 145]
},
messages: {
expectedData: [200, 192, 120, 144, 160, 130, 140],
actualData: [180, 160, 151, 106, 145, 150, 130]
},
purchases: {
expectedData: [80, 100, 121, 104, 105, 90, 100],
actualData: [120, 90, 100, 138, 142, 130, 130]
},
shoppings: {
expectedData: [130, 140, 141, 142, 145, 150, 160],
actualData: [120, 82, 91, 154, 162, 140, 130]
}
}
// const lineChartData = {
// newVisitis: {
// expectedData: [100, 120, 161, 134, 105, 160, 165],
// actualData: [120, 82, 91, 154, 162, 140, 145]
// },
// messages: {
// expectedData: [200, 192, 120, 144, 160, 130, 140],
// actualData: [180, 160, 151, 106, 145, 150, 130]
// },
// purchases: {
// expectedData: [80, 100, 121, 104, 105, 90, 100],
// actualData: [120, 90, 100, 138, 142, 130, 130]
// },
// shoppings: {
// expectedData: [130, 140, 141, 142, 145, 150, 160],
// actualData: [120, 82, 91, 154, 162, 140, 130]
// }
// }
export default { export default {
name: 'Dashboard', name: 'Dashboard',
@ -226,6 +226,7 @@ export default {
}, },
data() { data() {
return { return {
selectValue: '1',
lendData: [18203, 23489, 29034, 104970], lendData: [18203, 23489, 29034, 104970],
cateData: [1000, 700], cateData: [1000, 700],
typeData: [1110, 2000, 800, 600, 900] typeData: [1110, 2000, 800, 600, 900]
@ -235,11 +236,14 @@ export default {
this.getData() this.getData()
}, },
methods: { methods: {
handleSetLineChartData(type) {
this.lineChartData = lineChartData[type]
},
// handleSetLineChartData(type) {
// this.lineChartData = lineChartData[type]
// },
getData() { getData() {
this.tableData = data1.rows this.tableData = data1.rows
},
changeActiveTab() {
this.$router.push({ path: '/storeManage/warehouse3D' })
} }
} }
} }
@ -285,7 +289,7 @@ export default {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
position: absolute; position: absolute;
bottom: 20px;
bottom: 15px;
// left: 20px; // left: 20px;
z-index: 11; z-index: 11;
// width: calc(100vw - 545px); // width: calc(100vw - 545px);
@ -360,6 +364,9 @@ export default {
height: 42px; height: 42px;
border: 1px solid #339cff; border: 1px solid #339cff;
background-color: #021941; background-color: #021941;
&::placeholder {
color: #fff;
}
} }
} }
// border: 1px solid #339cff; // border: 1px solid #339cff;
@ -377,6 +384,7 @@ export default {
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
.el-input__inner { .el-input__inner {
text-align: center; text-align: center;
color: #fff;
} }
} }
& ::v-deep.el-input-group__append { & ::v-deep.el-input-group__append {
@ -388,6 +396,7 @@ export default {
border-radius: 34px; border-radius: 34px;
& i { & i {
font-size: 25px; font-size: 25px;
color: #fff;
} }
} }
& .el-select .el-input { & .el-select .el-input {
@ -446,4 +455,11 @@ export default {
} }
} }
} }
::v-deep
.el-table--striped
.el-table__body
tr.el-table__row--striped
td.el-table__cell {
background: #02255f;
}
</style> </style>

4
src/views/storeManage/deviceManage/module/deviceDetail.vue

@ -410,10 +410,10 @@ export default {
} }
}) })
} }
crud.status.edit = CRUD.STATUS.PREPARED
crud.getDataStatus(this.crud.selections[0].id).edit = CRUD.STATUS.PREPARED
form.supplier = form.supplierId.id form.supplier = form.supplierId.id
this.selectedDeviceType = form.deviceTypeId.name this.selectedDeviceType = form.deviceTypeId.name
crud.status.edit = CRUD.STATUS.PREPARED
crud.getDataStatus(this.crud.selections[0].id).edit = CRUD.STATUS.PREPARED
return false return false
}, },
[CRUD.HOOK.beforeSubmit]() { [CRUD.HOOK.beforeSubmit]() {

62
src/views/storeManage/warehouse3D/index.vue

@ -63,6 +63,10 @@ export default {
localStorage.removeItem('isDeseCabinetPage') localStorage.removeItem('isDeseCabinetPage')
} }
}, },
created() {
console.log(1111)
this.initWebSocket()
},
methods: { methods: {
handleMessageEvent(event) { handleMessageEvent(event) {
const _this = this const _this = this
@ -91,15 +95,56 @@ export default {
}, },
destroyed() { destroyed() {
window.removeEventListener('message', this.handleMessageEvent) window.removeEventListener('message', this.handleMessageEvent)
},
initWebSocket() {
// weosocket
const url = 'ws://192.168.99.65:7070/webSocket/testname'
const wsuri = url // ws
this.websocket = new WebSocket(wsuri)
this.websocket.onopen = this.websocketonopen
this.websocket.onerror = this.websocketonerror
this.websocket.onmessage = this.websocketonmessage
this.websocket.onclose = this.websocketclose
},
websocketonopen() {
console.log('WebSocket连接成功')
// co data = {
// type: 'user_init',
// userid: 'xxx'
// }
// this.websocket.send(
// //
// JSON.stringify(data)
// )
},
websocketonerror(e) {
//
// this.initWebSocket()
console.log('WebSocket连接发生错误')
},
websocketonmessage(e) {
//
var data = JSON.parse(e.data)
this.$store.commit('SET_ws', data)
console.log('接收数据')
// ...
},
websocketsend(agentData) {
//
this.websocket.send(agentData)
},
websocketclose(e) {
//
console.log('WebSocket关闭')
console.log(JSON.stringify(e))
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.warehouse-tab { .warehouse-tab {
color: #3298FA;
color: #3298fa;
.warehouse-nav { .warehouse-nav {
display: flex; display: flex;
position: absolute; position: absolute;
@ -126,7 +171,7 @@ export default {
font-size: 18px; font-size: 18px;
position: relative; position: relative;
cursor: default; cursor: default;
background: url('~@/assets/images/warehouse_tab_bg.png') no-repeat;
background: url("~@/assets/images/warehouse_tab_bg.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
span { span {
width: 72px; width: 72px;
@ -140,24 +185,23 @@ export default {
text-align: left; text-align: left;
} }
&:first-child span { &:first-child span {
background: url('~@/assets/images/tab_fullview_logo.png') no-repeat;
background: url("~@/assets/images/tab_fullview_logo.png") no-repeat;
} }
&:nth-child(2) span { &:nth-child(2) span {
background: url('~@/assets/images/tab_archives_logo.png') no-repeat;
background: url("~@/assets/images/tab_archives_logo.png") no-repeat;
} }
&:nth-child(3) span { &:nth-child(3) span {
background: url('~@/assets/images/tab_collate_logo.png') no-repeat;
background: url("~@/assets/images/tab_collate_logo.png") no-repeat;
} }
&:nth-child(4) span { &:nth-child(4) span {
background: url('~@/assets/images/tab_read_logo.png') no-repeat;
background: url("~@/assets/images/tab_read_logo.png") no-repeat;
} }
} }
.active-nav { .active-nav {
color: #fff; color: #fff;
background: url('~@/assets/images/warehouse_tab_active.png') no-repeat;
background: url("~@/assets/images/warehouse_tab_active.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
} }
} }
</style> </style>
Loading…
Cancel
Save