Browse Source

下载问题,表格展示问题,数据统计图不标准问题

master
aBin 4 years ago
parent
commit
d3c20092ca
  1. 6
      .env.development
  2. 18
      src/components/Day/Day.vue
  3. 6
      src/components/Search/Search.vue
  4. 17
      src/components/Table/Table.vue
  5. 4
      src/views/Index/Index.vue

6
.env.development

@ -1,10 +1,10 @@
VUE_APP_MODE=development VUE_APP_MODE=development
VUE_APP_NODE_ENV=development VUE_APP_NODE_ENV=development
VUE_APP_SCENE=wisdomcar_counter VUE_APP_SCENE=wisdomcar_counter
VUE_APP_BASE_URL=http://test.tall.wiki/ VUE_APP_BASE_URL=http://www.tall.wiki/
VUE_APP_API_URL=http://test.tall.wiki/gateway VUE_APP_API_URL=http://www.tall.wiki/gateway
VUE_APP_PROXY_URL=/gateway VUE_APP_PROXY_URL=/gateway
VUE_APP_PUBLIC_PATH=/wisdomcar_counter 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_TITLE=选矿系统
VUE_APP_DESCRIPTION=选矿系统 VUE_APP_DESCRIPTION=选矿系统

18
src/components/Day/Day.vue

@ -21,6 +21,7 @@ export default {
height: '', height: '',
timer: null, timer: null,
dateTiem: [], dateTiem: [],
timeList: [],
weightDate: [], weightDate: [],
weight1: [], weight1: [],
weight2: [], weight2: [],
@ -110,15 +111,22 @@ export default {
this.weightDate = []; this.weightDate = [];
this.weight1 = []; this.weight1 = [];
this.weight2 = []; this.weight2 = [];
this.timeList = [];
// //
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
this.dateTiem.push(this.format(parseInt(list[i].time))); if (this.$moment(parseInt(list[i].time)).format('YYYY-MM-DD HH:mm:ss') !== this.dateTiem[this.dateTiem.length - 1]) {
this.weight2.push(-50); 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++) { for (let i = 0; i < this.timeList.length; i++) {
this.weightDate.push(parseInt(list[i].value) / 1000); this.weightDate.push(parseInt(this.timeList[i].value) / 1000);
} }
console.log(this.weightDate);
// // rfid线 // // rfid线
// for (let i = 0; i < list.length; i++) { // for (let i = 0; i < list.length; i++) {
// let obj = {}; // let obj = {};
@ -137,7 +145,7 @@ export default {
if (list[i].type === 2) { if (list[i].type === 2) {
obj = { obj = {
value: list[i].name, 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, yAxis: parseInt(list[i].value) / 1000,
}; };
this.weight1.push(obj); this.weight1.push(obj);

6
src/components/Search/Search.vue

@ -62,10 +62,12 @@ export default {
if (mistake > 3600 * 24 * 30 * 1000) { if (mistake > 3600 * 24 * 30 * 1000) {
this.$message.error('时间跨度请不要超过30天'); this.$message.error('时间跨度请不要超过30天');
} else { } else {
console.log(`http://www.tall.wiki/gateway/wisdomcar/record/weightExport?
startTime=${this.timeObj.startTime}&&endTime=${this.timeObj.endTime}`);
this.$message.success('导出成功'); this.$message.success('导出成功');
window.open( window.open(
`http://test.tall.wiki/gateway/wisdomcar/record/weightExport? `https://www.tall.wiki/gateway/wisdomcar/record/weightExport?` +
startTime=${this.timeObj.startTime}&&endTime=${this.timeObj.endTime}`, `startTime=${this.timeObj.startTime}&&endTime=${this.timeObj.endTime}`,
); );
} }
}, },

17
src/components/Table/Table.vue

@ -1,12 +1,13 @@
<template> <template>
<div class="main flex-1"> <div class="main flex-1">
<div style="width: 100%" v-if="list && list.length > 0"> <div style="width: 100%">
<a-table <a-table
:columns="columns" :columns="columns"
:data-source="list" :data-source="list"
:loading="loading" :loading="loading"
:row-key="record => record.id" :row-key="record => record.id"
bordered bordered
:pagination="pagination"
class="white" class="white"
:scroll="{ y: height }" :scroll="{ y: height }"
> >
@ -22,7 +23,6 @@
</template> </template>
</a-table> </a-table>
</div> </div>
<a-empty v-else />
</div> </div>
</template> </template>
@ -33,6 +33,7 @@ const columns = [
align: 'center', align: 'center',
dataIndex: 'id', dataIndex: 'id',
key: 'id', key: 'id',
width: '25%',
scopedSlots: { customRender: 'id' }, scopedSlots: { customRender: 'id' },
}, },
{ {
@ -40,7 +41,7 @@ const columns = [
align: 'center', align: 'center',
dataIndex: 'time', dataIndex: 'time',
key: 'time', key: 'time',
width: 350, width: '25%',
scopedSlots: { customRender: 'time' }, scopedSlots: { customRender: 'time' },
}, },
{ {
@ -48,14 +49,15 @@ const columns = [
align: 'center', align: 'center',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: '25%',
scopedSlots: { customRender: 'name' }, scopedSlots: { customRender: 'name' },
}, },
{ {
title: '数据', title: '数据',
align: 'center', align: 'center',
dataIndex: 'value', dataIndex: 'value',
key: 'value', key: 'value',
width: '25%',
scopedSlots: { customRender: 'value' }, scopedSlots: { customRender: 'value' },
}, },
]; ];
@ -72,12 +74,19 @@ export default {
return { return {
columns, columns,
loading: false, loading: false,
pagination: false,
editingKey: '', editingKey: '',
height: '', height: '',
editVisible: false, editVisible: false,
editItem: null, // editItem: null, //
dataList: [],
}; };
}, },
watch: {
list(val) {
console.log(val);
},
},
methods: {}, methods: {},
}; };

4
src/views/Index/Index.vue

@ -9,7 +9,8 @@
<a-empty v-else /> <a-empty v-else />
</a-card> </a-card>
<a-card style="width: 100%; height: auto"> <a-card style="width: 100%; height: auto">
<Table :list="list" /> <Table :list="list" v-if="list && list.length > 0" />
<a-empty v-else />
</a-card> </a-card>
</div> </div>
</div> </div>
@ -56,7 +57,6 @@ export default {
this.list = [...list]; this.list = [...list];
setTimeout(hide, 500); setTimeout(hide, 500);
this.$message.success('获取数据成功'); this.$message.success('获取数据成功');
// this.list = data;
this.disProgress = false; this.disProgress = false;
} else { } else {
this.$message.error(msg); this.$message.error(msg);

Loading…
Cancel
Save