From d3c20092ca246f9cc62c32f7aab96c4fd7f478a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Mar 2021 10:01:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E5=9B=BE=E4=B8=8D=E6=A0=87?= =?UTF-8?q?=E5=87=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 6 +++--- src/components/Day/Day.vue | 18 +++++++++++++----- src/components/Search/Search.vue | 6 ++++-- src/components/Table/Table.vue | 17 +++++++++++++---- src/views/Index/Index.vue | 4 ++-- 5 files changed, 35 insertions(+), 16 deletions(-) diff --git a/.env.development b/.env.development index 39d689a..6dbbeb9 100644 --- a/.env.development +++ b/.env.development @@ -1,10 +1,10 @@ VUE_APP_MODE=development VUE_APP_NODE_ENV=development VUE_APP_SCENE=wisdomcar_counter -VUE_APP_BASE_URL=http://test.tall.wiki/ -VUE_APP_API_URL=http://test.tall.wiki/gateway +VUE_APP_BASE_URL=http://www.tall.wiki/ +VUE_APP_API_URL=http://www.tall.wiki/gateway VUE_APP_PROXY_URL=/gateway VUE_APP_PUBLIC_PATH=/wisdomcar_counter -VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws +VUE_APP_MSG_URL=wss://www.tall.wiki/websocket/message/v4.0/ws VUE_APP_TITLE=选矿系统 VUE_APP_DESCRIPTION=选矿系统 diff --git a/src/components/Day/Day.vue b/src/components/Day/Day.vue index a255716..cbf98fe 100644 --- a/src/components/Day/Day.vue +++ b/src/components/Day/Day.vue @@ -21,6 +21,7 @@ export default { height: '', timer: null, dateTiem: [], + timeList: [], weightDate: [], weight1: [], weight2: [], @@ -110,15 +111,22 @@ export default { this.weightDate = []; this.weight1 = []; this.weight2 = []; + this.timeList = []; // 获取横坐标 for (let i = 0; i < list.length; i++) { - this.dateTiem.push(this.format(parseInt(list[i].time))); - this.weight2.push(-50); + if (this.$moment(parseInt(list[i].time)).format('YYYY-MM-DD HH:mm:ss') !== this.dateTiem[this.dateTiem.length - 1]) { + this.dateTiem.push(this.$moment(parseInt(list[i].time)).format('YYYY-MM-DD HH:mm:ss')); + this.timeList.push(list[i]); + } + // this.weight2.push(-50); } + console.log(this.timeList); // 体重数据数组 - for (let i = 0; i < list.length; i++) { - this.weightDate.push(parseInt(list[i].value) / 1000); + for (let i = 0; i < this.timeList.length; i++) { + this.weightDate.push(parseInt(this.timeList[i].value) / 1000); } + console.log(this.weightDate); + // // 处理rfid横线 // for (let i = 0; i < list.length; i++) { // let obj = {}; @@ -137,7 +145,7 @@ export default { if (list[i].type === 2) { obj = { value: list[i].name, - xAxis: this.format(parseInt(list[i].time)), + xAxis: this.$moment(parseInt(list[i].time)).format('YYYY-MM-DD HH:mm:ss'), yAxis: parseInt(list[i].value) / 1000, }; this.weight1.push(obj); diff --git a/src/components/Search/Search.vue b/src/components/Search/Search.vue index 9c86147..8af17e3 100644 --- a/src/components/Search/Search.vue +++ b/src/components/Search/Search.vue @@ -62,10 +62,12 @@ export default { if (mistake > 3600 * 24 * 30 * 1000) { this.$message.error('时间跨度请不要超过30天'); } else { + console.log(`http://www.tall.wiki/gateway/wisdomcar/record/weightExport? + startTime=${this.timeObj.startTime}&&endTime=${this.timeObj.endTime}`); this.$message.success('导出成功'); window.open( - `http://test.tall.wiki/gateway/wisdomcar/record/weightExport? - startTime=${this.timeObj.startTime}&&endTime=${this.timeObj.endTime}`, + `https://www.tall.wiki/gateway/wisdomcar/record/weightExport?` + + `startTime=${this.timeObj.startTime}&&endTime=${this.timeObj.endTime}`, ); } }, diff --git a/src/components/Table/Table.vue b/src/components/Table/Table.vue index afc239f..ed87874 100644 --- a/src/components/Table/Table.vue +++ b/src/components/Table/Table.vue @@ -1,12 +1,13 @@ - @@ -33,6 +33,7 @@ const columns = [ align: 'center', dataIndex: 'id', key: 'id', + width: '25%', scopedSlots: { customRender: 'id' }, }, { @@ -40,7 +41,7 @@ const columns = [ align: 'center', dataIndex: 'time', key: 'time', - width: 350, + width: '25%', scopedSlots: { customRender: 'time' }, }, { @@ -48,14 +49,15 @@ const columns = [ align: 'center', dataIndex: 'name', key: 'name', + width: '25%', scopedSlots: { customRender: 'name' }, }, - { title: '数据', align: 'center', dataIndex: 'value', key: 'value', + width: '25%', scopedSlots: { customRender: 'value' }, }, ]; @@ -72,12 +74,19 @@ export default { return { columns, loading: false, + pagination: false, editingKey: '', height: '', editVisible: false, editItem: null, // 修改的那条 + dataList: [], }; }, + watch: { + list(val) { + console.log(val); + }, + }, methods: {}, }; diff --git a/src/views/Index/Index.vue b/src/views/Index/Index.vue index be632c2..d5eb3f6 100644 --- a/src/views/Index/Index.vue +++ b/src/views/Index/Index.vue @@ -9,7 +9,8 @@ - +
+ @@ -56,7 +57,6 @@ export default { this.list = [...list]; setTimeout(hide, 500); this.$message.success('获取数据成功'); - // this.list = data; this.disProgress = false; } else { this.$message.error(msg);