diff --git a/src/views/bigScreen/bigScreen.vue b/src/views/bigScreen/bigScreen.vue index f3168f5..ecbe740 100644 --- a/src/views/bigScreen/bigScreen.vue +++ b/src/views/bigScreen/bigScreen.vue @@ -73,9 +73,7 @@
- -
123
-
+
@@ -96,13 +94,14 @@ import '@/styles/scss/style.scss'; import centerLeft1 from './component/centerLeft1' import centerLeft2 from './component/centerLeft2' -import centerRight1 from './component/centerRight1_copy' +import centerRight1 from './component/centerRight1' import centerRight2 from './component/centerRight2' import center from './component/center' import bottomLeft from './component/bottomLeft' import bottomRight from './component/bottomRight' import drawMixin from "@/mixin/drawMixin"; -import backBtn from './component/backBtn.vue' +import backBtn from './component/backBtn.vue'; +import bottom from "./component/bottom.vue" export default { mixins: [ drawMixin ], provide() { @@ -121,7 +120,8 @@ export default { center, bottomLeft, bottomRight, - backBtn + backBtn, + bottom }, data() { return { @@ -136,12 +136,13 @@ export default { } }, mounted() { - //document.documentElement.requestFullscreen(); + document.documentElement.requestFullscreen(); this.timeFn(); this.cancelLoading(); }, beforeDestroy () { clearInterval(this.timing) + document.exitFullscreen(); }, methods: { timeFn() { diff --git a/src/views/bigScreen/component/bottom.vue b/src/views/bigScreen/component/bottom.vue new file mode 100644 index 0000000..501aee6 --- /dev/null +++ b/src/views/bigScreen/component/bottom.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/views/bigScreen/component/centerLeft1.vue b/src/views/bigScreen/component/centerLeft1.vue index ccacfff..3bc5e8f 100644 --- a/src/views/bigScreen/component/centerLeft1.vue +++ b/src/views/bigScreen/component/centerLeft1.vue @@ -11,7 +11,7 @@
- +
diff --git a/src/views/bigScreen/component/centerRight1.vue b/src/views/bigScreen/component/centerRight1.vue index 69de4ee..e7d9826 100644 --- a/src/views/bigScreen/component/centerRight1.vue +++ b/src/views/bigScreen/component/centerRight1.vue @@ -8,50 +8,15 @@ >
待执行 -
-
- -
-
- 待执行 -

{{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }}

-
-
-
-
- 执行时间:{{ item.start_time }} -
-
- 倒计时: -
-
-
- 执行 -
-
-
-
-
-
+
- 即将执行 - - + 执行中 +
已完成 - - +
@@ -70,138 +35,45 @@ export default { }, data() { return { - dom: '', - needCalc: false, - rowNum: 4, - height: 0, - width: 0, - avgHeight: 0, - updater: 0, - animationIndex: 0, - heights: [], - animationHandler: '', - - transfers: [], - rows: [] + transfers: [ + [], + [], + [] + ], }; }, methods: { - setTransferStatus (status,row) { - let copyRow = deepCopy(row); - copyRow.status = status; - for (let key in copyRow) { - if (/_relation/g.test(key)) { - delete copyRow[key] - } - } - console.log(copyRow) - save({ - table_name: 'transfers', - ...copyRow - }).then(_ => {}) - }, - - - async getTransfer() { + this.transfers = [ + [],[],[] + ] const res = ( await index({ table_name: "transfers", page: 1, page_size: 9999, + filter: [ + { + key: 'start_time', + op: 'range', + value: `${this.$moment().startOf('days').format('YYYY-MM-DD HH:mm:ss')},${this.$moment().endOf('days').format('YYYY-MM-DD HH:mm:ss')}` + } + ] },false) ).data; - this.transfers = res; - this.rows = res.map(i => ({ ...i, scroll: i })); - - }, - initWH (resize = true) { - const { $nextTick, $refs, onResize } = this - - return new Promise(resolve => { - $nextTick(_ => { - const dom = this.dom = $refs['board-item-container'] - - this.width = dom ? dom.clientWidth : 0 - this.height = dom ? dom.clientHeight : 0 - - if (!dom) { - console.warn('DataV: Failed to get dom node, component rendering may be abnormal!') - } else if (!this.width || !this.height) { - console.warn('DataV: Component width or height is 0px, rendering abnormality may occur!') - } - - if (typeof onResize === 'function' && resize) onResize() - - resolve() - }) + res.forEach(i => { + if (i.status === 2 || i.status === 3) { + this.transfers[0].push(i) + } + if (i.status === 4) { + this.transfers[1].push(i) + } + if (i.status === 6) { + this.transfer[2].push(i) + } }) - }, - calcHeights (onresize = false) { - const { height, rowNum } = this - - let allHeight = height - - const avgHeight = allHeight / rowNum - - this.avgHeight = avgHeight - - if (!onresize) this.heights = new Array(this.transfers.length).fill(avgHeight) - }, - async animation (start = false) { - const { needCalc, calcHeights } = this - - if (needCalc) { - calcHeights() - this.needCalc = false; - } - - let { avgHeight, animationIndex, mergedConfig, animation, updater } = this - - const { waitTime, carousel, rowNum } = { - waitTime: 5000, - carousel: 'single', - rowNum: this.rowNum - } - - const rowLength = this.transfers.length - - if (rowNum >= rowLength) return - - if (start) { - await new Promise(resolve => setTimeout(resolve, waitTime)) - if (updater !== this.updater) return - } - - const animationNum = carousel === 'single' ? 1 : rowNum - let rows = this.transfers.slice(animationIndex) - rows.push(...this.transfers.slice(0, animationIndex)) - - this.rows = rows.slice(0, carousel === 'page' ? rowNum * 2 : rowNum + 1) - this.heights = new Array(rowLength).fill(avgHeight) - - await new Promise(resolve => setTimeout(resolve, 300)) - if (updater !== this.updater) return - - this.heights.splice(0, animationNum, ...new Array(animationNum).fill(0)) - - animationIndex += animationNum - - const back = animationIndex - rowLength - if (back >= 0) animationIndex = back - - this.animationIndex = animationIndex - this.animationHandler = setTimeout(animation, waitTime - 300) - }, - stopAnimation () { - const { animationHandler, updater } = this - - this.updater = (updater + 1) % 999999 - - if (!animationHandler) return - - clearTimeout(animationHandler) + this.cancelLoading() }, }, created() { @@ -209,14 +81,8 @@ export default { }, async mounted() { await this.getTransfer(); - await this.initWH(false); - this.calcHeights(); - await this.animation(true); }, destroyed () { - const { stopAnimation } = this - - stopAnimation(); } }; diff --git a/src/views/bigScreen/component/centerRight1_copy.vue b/src/views/bigScreen/component/centerRight1_copy.vue deleted file mode 100644 index 0a7e28e..0000000 --- a/src/views/bigScreen/component/centerRight1_copy.vue +++ /dev/null @@ -1,234 +0,0 @@ - - - - - diff --git a/src/views/bigScreen/component/transferBoard.vue b/src/views/bigScreen/component/transferBoard.vue index 0d686bd..597e938 100644 --- a/src/views/bigScreen/component/transferBoard.vue +++ b/src/views/bigScreen/component/transferBoard.vue @@ -12,7 +12,7 @@
- 待执行 + {{typeMap.get(item.status)}}

{{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }}

@@ -21,12 +21,12 @@ 执行时间:{{ item.start_time }}
- 倒计时: + 倒计时:{{ $moment(new Date(item.start_time)).diff($moment(),'minutes') }}分
-
+
执行 + >{{setStatusText}}
@@ -41,7 +41,8 @@ import {save} from "@/api/system/baseForm"; export default { props: { - transfers: Array + transfers: Array, + setTransferStatusNumber: Number }, data() { return { @@ -55,20 +56,31 @@ export default { animationIndex: 0, heights: [], animationHandler: '', - - rows: [] + copyTransfers: [], + rows: [], + typeMap: new Map([ + [1,'待下发'], + [2,'已下发'], + [3,'待执行'], + [4,'执行中'], + [5,'已取消'], + [6,'已完成'] + ]) } }, methods: { setTransferStatus (status,row) { + if (!this.setTransferStatusNumber) { + console.warn('setTransferStatusNumber is required') + return + } let copyRow = deepCopy(row); - copyRow.status = status; + copyRow.status = this.setTransferStatusNumber; for (let key in copyRow) { if (/_relation/g.test(key)) { delete copyRow[key] } } - console.log(copyRow) save({ table_name: 'transfers', ...copyRow @@ -108,6 +120,7 @@ export default { this.avgHeight = avgHeight if (!onresize) this.heights = new Array(this.transfers.length).fill(avgHeight) + }, async animation (start = false) { const { needCalc, calcHeights } = this @@ -125,7 +138,7 @@ export default { rowNum: this.rowNum } - const rowLength = this.transfers.length + const rowLength = this.copyTransfers.length if (rowNum >= rowLength) return @@ -134,10 +147,10 @@ export default { if (updater !== this.updater) return } - const animationNum = carousel === 'single' ? 1 : rowNum - let rows = this.transfers.slice(animationIndex) - rows.push(...this.transfers.slice(0, animationIndex)) + const animationNum = carousel === 'single' ? 1 : rowNum + let rows = this.copyTransfers.slice(animationIndex) + rows.push(...this.copyTransfers.slice(0, animationIndex)) this.rows = rows.slice(0, carousel === 'page' ? rowNum * 2 : rowNum + 1) this.heights = new Array(rowLength).fill(this.avgHeight) @@ -165,13 +178,20 @@ export default { clearTimeout(animationHandler) }, }, - computed: {}, + computed: { + setStatusText () { + if (this.setTransferStatusNumber === 4) return '执行'; + if (this.setTransferStatusNumber === 6) return '完成'; + } + }, watch: { async transfers(val) { if (val && val.length > 0) { + this.rows = val.map((i,index) => ({...i,scroll: index})) + this.copyTransfers = deepCopy(val); await this.initWH(false); this.calcHeights(); - val.length > this.rowNum ? await this.animation(true) : ''; + await this.animation(true); } } }, diff --git a/src/views/order/component/createDispatch.vue b/src/views/order/component/createDispatch.vue index 2a268c4..980ce7f 100644 --- a/src/views/order/component/createDispatch.vue +++ b/src/views/order/component/createDispatch.vue @@ -69,6 +69,7 @@