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_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=选矿系统

18
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);

6
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}`,
);
}
},

17
src/components/Table/Table.vue

@ -1,12 +1,13 @@
<template>
<div class="main flex-1">
<div style="width: 100%" v-if="list && list.length > 0">
<div style="width: 100%">
<a-table
:columns="columns"
:data-source="list"
:loading="loading"
:row-key="record => record.id"
bordered
:pagination="pagination"
class="white"
:scroll="{ y: height }"
>
@ -22,7 +23,6 @@
</template>
</a-table>
</div>
<a-empty v-else />
</div>
</template>
@ -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: {},
};

4
src/views/Index/Index.vue

@ -9,7 +9,8 @@
<a-empty v-else />
</a-card>
<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>
</div>
</div>
@ -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);

Loading…
Cancel
Save