diff --git a/src/views/components/WarehouseWarning.vue b/src/views/components/WarehouseWarning.vue index 154eb80..c59447e 100644 --- a/src/views/components/WarehouseWarning.vue +++ b/src/views/components/WarehouseWarning.vue @@ -34,8 +34,29 @@ export default { tableData: [] } }, - created() { + mounted() { this.getData() + console.log(11333) + this.$nextTick(() => { + this.tableRefScroll() + }) + // this.$nextTick(() => { + // this.scroll = new Bscroll('.warehose-el-table .el-table__body-wrapper', { + // scrollY: true + // ,startY: 10 + // }) + // this.scroll.on('scrollEnd', () => { + // // let pageIndex = this.scroll.getCurrentPage().pageX; + // // this.currentPageIndex = pageIndex; + // // if(vm.autoPlay) { + // // vm.play(); + // // } + // console.log('scrollEnd') + // }) + // }) + }, + destroyed() { + clearInterval(this.timer) }, methods: { getData() { @@ -48,6 +69,41 @@ export default { } else { return '' } + }, + // table滚动 + tableRefScroll() { + clearInterval(this.timer) // 清除定时器 + const table = this.$refs.table // 获取DOM元素 + const wrapperHeight = table.$el.offsetHeight - 30 + this.scollNum = Math.floor(wrapperHeight / 40) + const bodyWrapper = table.bodyWrapper // 获取表格中承载数据的div元素 + this.addTableRefScroll(bodyWrapper) + // 鼠标移入 + bodyWrapper.onmouseover = () => { + clearInterval(this.timer) + } + // 鼠标移出 + bodyWrapper.onmouseout = () => { + this.addTableRefScroll(bodyWrapper) + } + }, + addTableRefScroll(bodyWrapper) { + let scrollTop = bodyWrapper.scrollTop + this.timer = setInterval(() => { + scrollTop = bodyWrapper.scrollTop + bodyWrapper.scrollTop += this.scollNum * 40 + if (scrollTop === bodyWrapper.scrollTop) { + if (this.isScroll) { + scrollTop = 0 + bodyWrapper.scrollTop = 0 + } else { + if (this.flag === 1) { + this.currentPage++ + this.handleSearch() // 函数中需要清楚定时器 + } + } + } + }, 1000 * 3 * this.scollNum) } } } diff --git a/src/views/components/data1.json b/src/views/components/data1.json index 7eb567d..9bcf3ff 100644 --- a/src/views/components/data1.json +++ b/src/views/components/data1.json @@ -78,22 +78,22 @@ { "time":"2022-6-30 13:00", "warehouse":"文书档案库房", - "warning":"温度温度温度温度温度温度" + "warning":"4温度温度温度温度温度温度" }, { "time":"2022-6-30 13:00", "warehouse":"文书档案库房", - "warning":"温度温度温度温度温度温度" + "warning":"3温度温度温度温度温度温度" }, { "time":"2022-6-30 13:00", "warehouse":"文书档案库房", - "warning":"温度温度温度温度温度温度" + "warning":"2温度温度温度温度温度温度" }, { "time":"2022-6-30 13:00", "warehouse":"文书档案库房", - "warning":"温度温度温度温度温度温度" + "warning":"1温度温度温度温度温度温度" } ] diff --git a/src/views/home.vue b/src/views/home.vue index ee716ad..b399ce4 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -120,7 +120,7 @@ - + diff --git a/src/views/storeManage/warehouse3D/archivesStorage/index.vue b/src/views/storeManage/warehouse3D/archivesStorage/index.vue index 51b622f..f63313d 100644 --- a/src/views/storeManage/warehouse3D/archivesStorage/index.vue +++ b/src/views/storeManage/warehouse3D/archivesStorage/index.vue @@ -58,11 +58,11 @@ -
-
+ +
@@ -107,8 +107,10 @@ @@ -246,5 +245,7 @@ export default { height: calc(100%/2 - 10px); overflow: hidden; } - +.container-wrap{ + margin-bottom: 20px; +} diff --git a/src/views/storeManage/warehouse3D/data1.json b/src/views/storeManage/warehouse3D/data1.json index 0f1c943..60af9c6 100644 --- a/src/views/storeManage/warehouse3D/data1.json +++ b/src/views/storeManage/warehouse3D/data1.json @@ -78,22 +78,22 @@ { "time":"2022-6-30 13:00", "warehouse":"文书档案库房", - "warning":"温度温度温度温度温度温度" + "warning":"4温度温度温度温度温度温度" }, { "time":"2022-6-30 13:00", "warehouse":"文书档案库房", - "warning":"温度温度温度温度温度温度" + "warning":"3温度温度温度温度温度温度" }, { "time":"2022-6-30 13:00", "warehouse":"文书档案库房", - "warning":"温度温度温度温度温度温度" + "warning":"2温度温度温度温度温度温度" }, { "time":"2022-6-30 13:00", "warehouse":"文书档案库房", - "warning":"温度温度温度温度温度温度" + "warning":"1温度温度温度温度温度温度" } ] diff --git a/src/views/storeManage/warehouse3D/fullView/index.vue b/src/views/storeManage/warehouse3D/fullView/index.vue index 5fc66d8..a17efc7 100644 --- a/src/views/storeManage/warehouse3D/fullView/index.vue +++ b/src/views/storeManage/warehouse3D/fullView/index.vue @@ -14,7 +14,7 @@ />
- +