Browse Source

表格数据修改

master
aBin 4 years ago
parent
commit
ffb4456cff
  1. 2
      src/components/Day/Day.vue
  2. 17
      src/components/Search/Search.vue
  3. 4
      src/components/Table/Table.vue
  4. 4
      src/views/Index/Index.vue

2
src/components/Day/Day.vue

@ -177,7 +177,7 @@ export default {
obj = { obj = {
value: list[i].name, value: list[i].name,
xAxis: this.$moment(parseInt(list[i].time)).format('YYYY-MM-DD HH:mm:ss'), xAxis: this.$moment(parseInt(list[i].time)).format('YYYY-MM-DD HH:mm:ss'),
yAxis: parseInt(list[i].value) / 1000, yAxis: parseInt(list[i].serial, 16),
}; };
this.weight1.push(obj); this.weight1.push(obj);
} }

17
src/components/Search/Search.vue

@ -16,7 +16,7 @@
@change="onChange" @change="onChange"
/> />
<span class="ml-3">平车</span> <span class="ml-3">平车</span>
<a-select style="width: 120px" :default-value="1" @change="handleChangeCar" placeholder="全部"> <a-select style="width: 120px" :default-value="2" @change="handleChangeCar" placeholder="全部">
<a-select-option v-for="item in carList" :value="item.carId" :key="item.carId"> {{ item.name }} </a-select-option> <a-select-option v-for="item in carList" :value="item.carId" :key="item.carId"> {{ item.name }} </a-select-option>
</a-select> </a-select>
<span class="ml-3">类型</span> <span class="ml-3">类型</span>
@ -35,7 +35,7 @@ export default {
data() { data() {
return { return {
timeObj: { timeObj: {
carId: 1, carId: 2,
startTime: this.$moment(Date.parse(new Date()) - 3600 * 24 * 1000).format('YYYY-MM-DD'), startTime: this.$moment(Date.parse(new Date()) - 3600 * 24 * 1000).format('YYYY-MM-DD'),
types: [1, 2], types: [1, 2],
endTime: this.$moment(Date.parse(new Date())).format('YYYY-MM-DD'), endTime: this.$moment(Date.parse(new Date())).format('YYYY-MM-DD'),
@ -59,11 +59,11 @@ export default {
carList: [ carList: [
{ {
carId: 1, carId: 1,
name: '91', name: 'V1.0',
}, },
{ {
carId: 2, carId: 2,
name: '92', name: 'V2.0',
}, },
], ],
btnObj: null, btnObj: null,
@ -129,9 +129,10 @@ export default {
// startTime=${this.btnObj.startTime}&&endTime=${this.btnObj.endTime} // startTime=${this.btnObj.startTime}&&endTime=${this.btnObj.endTime}
// &&types=${this.btnObj.types[0]}&&types=${this.btnObj.types[1]}`); // &&types=${this.btnObj.types[0]}&&types=${this.btnObj.types[1]}`);
window.open( window.open(
`https://www.tall.wiki/gateway/wisdomcar/record/weightExport?startTime=` + `https://www.tall.wiki/gateway/qcp/v3.0/record/weightExport?startTime=` +
`${this.btnObj.startTime}&&endTime=${this.btnObj.endTime}&&types=` + `${this.btnObj.startTime}&&endTime=${this.btnObj.endTime}&&types=` +
`${this.btnObj.types[0]}&&types=${this.btnObj.types[1]}`, `${this.btnObj.types[0]}&&types=${this.btnObj.types[1]}&&carId=` +
`${this.btnObj.carId}`,
); );
// window.open( // window.open(
// `http://www.tall.wiki/gateway/wisdomcar/record/weightExport?startTime=161 // `http://www.tall.wiki/gateway/wisdomcar/record/weightExport?startTime=161
@ -139,8 +140,8 @@ export default {
// ); // );
} else { } else {
window.open( window.open(
`https://www.tall.wiki/gateway/wisdomcar/record/weightExport?startTime` + `https://www.tall.wiki/gateway/qcp/v3.0/record/weightExport?startTime` +
`=${this.btnObj.startTime}&&endTime=${this.btnObj.endTime}&&types=${this.btnObj.types[0]}`, `=${this.btnObj.startTime}&&endTime=${this.btnObj.endTime}&&types=${this.btnObj.types[0]}]}&&carId=${this.btnObj.carId}`,
); );
} }
} }

4
src/components/Table/Table.vue

@ -24,6 +24,10 @@
<template slot="time" slot-scope="text, record"> <template slot="time" slot-scope="text, record">
<span>{{ $moment(+record.time).format('YYYY-MM-DD HH:mm:ss') }}</span> <span>{{ $moment(+record.time).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template> </template>
<template slot="name" slot-scope="text, record">
<span v-if="record.type === 1">{{ record.name }}</span>
<span v-else-if="record.type === 2">RFID</span>
</template>
<template slot="value" slot-scope="text, record"> <template slot="value" slot-scope="text, record">
<span v-if="record.type === 1">{{ record.value / 1000 }}kg</span> <span v-if="record.type === 1">{{ record.value / 1000 }}kg</span>
<span v-else-if="record.type === 2">{{ record.name }}</span> <span v-else-if="record.type === 2">{{ record.name }}</span>

4
src/views/Index/Index.vue

@ -42,7 +42,7 @@ export default {
str: '', str: '',
disProgress: true, disProgress: true,
timeObj: { timeObj: {
carId: 1, carId: 2,
startTime: Date.parse(new Date()) - 3600 * 24 * 1000, startTime: Date.parse(new Date()) - 3600 * 24 * 1000,
endTime: Date.parse(new Date()), endTime: Date.parse(new Date()),
types: [1, 2], types: [1, 2],
@ -85,7 +85,7 @@ export default {
this.disProgress = true; this.disProgress = true;
const params = { const params = {
param: { param: {
carId: 1, carId: 2,
startTime: timeData && timeData.startTime ? timeData.startTime : this.timeObj.startTime, startTime: timeData && timeData.startTime ? timeData.startTime : this.timeObj.startTime,
endTime: timeData && timeData.endTime ? timeData.endTime : this.timeObj.endTime, endTime: timeData && timeData.endTime ? timeData.endTime : this.timeObj.endTime,
types: timeData && timeData.types ? timeData.types : this.timeObj.types, types: timeData && timeData.types ? timeData.types : this.timeObj.types,

Loading…
Cancel
Save