Browse Source

下载修改/统计图修改

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

4
.env.development

@ -6,5 +6,5 @@ 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://www.tall.wiki/websocket/message/v4.0/ws
VUE_APP_TITLE=选矿系统
VUE_APP_DESCRIPTION=选矿系统
VUE_APP_TITLE=智慧
VUE_APP_DESCRIPTION=智慧

4
src/components/Day/Day.vue

@ -153,6 +153,7 @@ export default {
this.weightDate = [];
this.weight1 = [];
this.weight2 = [];
this.timeList = [];
//
for (let i = 0; i < list.length; i++) {
if (list[i].type === 1) {
@ -162,6 +163,7 @@ export default {
this.weight2.push(0);
}
}
console.log(this.timeList);
//
for (let i = 0; i < list.length; i++) {
if (list[i].type === 1) {
@ -174,7 +176,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);

9
src/components/Search/Search.vue

@ -88,6 +88,11 @@ export default {
this.$emit('getData', this.timeObj);
}
},
// downFile() {
// window.open(
// 'http://www.tall.wiki/gateway/wisdomcar/record/weightExport?startTime=1616558400000&endTime=1616721639230&types=1&&types=2',
// );
// },
//
downFile() {
if (typeof this.timeObj.startTime === 'string') {
@ -100,7 +105,6 @@ export default {
if (mistake > 3600 * 24 * 7 * 1000) {
this.$message.error('时间跨度请不要超过7天');
} else {
this.$message.success('导出成功');
if (this.timeObj.types.length > 1) {
// console.log(`https://www.tall.wiki/gateway/wisdomcar/record/weightExport?
// startTime=${this.btnObj.startTime}&&endTime=${this.btnObj.endTime}
@ -108,6 +112,9 @@ export default {
window.open(
`https://www.tall.wiki/gateway/wisdomcar/record/weightExport?startTime=${this.btnObj.startTime}&&endTime=${this.btnObj.endTime}&&types=${this.btnObj.types[0]}&&types=${this.btnObj.types[1]}`,
);
// window.open(
// `http://www.tall.wiki/gateway/wisdomcar/record/weightExport?startTime=1616558400000&&endTime=${this.btnObj.endTime}&types=${this.btnObj.types[0]}&types=${this.btnObj.types[1]}`,
// );
} else {
window.open(
`https://www.tall.wiki/gateway/wisdomcar/record/weightExport?startTime=${this.btnObj.startTime}&&endTime=${this.btnObj.endTime}&&types=${this.btnObj.types[1]}`,

17
src/components/Table/Table.vue

@ -7,13 +7,14 @@
-->
<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 }"
>
@ -30,7 +31,6 @@
</template>
</a-table>
</div>
<a-empty v-else />
</div>
</template>
@ -41,6 +41,7 @@ const columns = [
align: 'center',
dataIndex: 'id',
key: 'id',
width: '25%',
scopedSlots: { customRender: 'id' },
},
{
@ -48,7 +49,7 @@ const columns = [
align: 'center',
dataIndex: 'time',
key: 'time',
width: 350,
width: '25%',
scopedSlots: { customRender: 'time' },
},
{
@ -56,14 +57,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' },
},
];
@ -80,12 +82,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

@ -19,7 +19,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>
@ -95,7 +96,6 @@ export default {
list = data;
this.list = [...list];
this.$message.success('获取数据成功');
// this.list = data;
this.disProgress = false;
} else {
// this.$message.error(msg);

Loading…
Cancel
Save