diff --git a/src/views/monitoring/equipmentFullParams/index.vue b/src/views/monitoring/equipmentFullParams/index.vue index 38324b7a..cfae88c8 100644 --- a/src/views/monitoring/equipmentFullParams/index.vue +++ b/src/views/monitoring/equipmentFullParams/index.vue @@ -6,14 +6,64 @@ --> @@ -49,6 +91,10 @@ export default { components: {}, props: {}, data() { + const now = new Date(); + const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()]; + const today = new Date(y, m, d, 0, 0, 0, 0).getTime(); + const aWeekAgo = today - 3600 * 1000 * 24 * 7; return { tableList: [], searchBarFormConfig: [ @@ -57,18 +103,20 @@ export default { label: '设备名称', placeholder: '请输入设备名称', param: 'name', + disabled: true, }, { type: 'input', label: '设备编码', placeholder: '请输入设备编码', - param: 'codes', + param: 'code', + disabled: true, }, { type: 'datePicker', label: '时间段', dateType: 'daterange', // datetimerange - format: 'yyyy-MM-dd', + format: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss', rangeSeparator: '-', startPlaceholder: '开始时间', @@ -76,6 +124,7 @@ export default { defaultTime: ['00:00:00', '23:59:59'], param: 'timeVal', width: 350, + defaultSelect: [new Date(aWeekAgo), new Date(today)], }, { type: 'button', @@ -84,14 +133,315 @@ export default { color: 'primary', }, ], + queryParams: { + id: null, + time: [new Date(aWeekAgo), new Date(today)], + }, + + table1: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + { + prop: 'val3', + label: '数值3', + }, + { + prop: 'bol3', + label: '布尔3', + }, + { + prop: 'val4', + label: '数值4', + }, + { + prop: 'bol4', + label: '布尔4', + }, + ], + data: [ + { + time: 1111111111111111, + plcCode: 2, + val1: 3, + bol1: 4, + val2: 5, + bol2: 6, + }, + { + time: 1, + plcCode: 22222222222222, + val1: 3, + bol1: 4, + val2: 5, + bol2: 6, + }, + { + time: 1, + plcCode: 2, + val1: 33333333333333, + bol1: 4, + val2: 5, + bol2: 6, + }, + { + time: 1, + plcCode: 2, + val1: 3, + bol1: 44444444444444, + val2: 5, + bol2: 6, + }, + { + time: 1, + plcCode: 2, + val1: 3, + bol1: 4, + val2: 5555555555555, + bol2: 6, + }, + { + time: 1, + plcCode: 2, + val1: 3, + bol1: 4, + val2: 5, + bol2: 6666666666666666666, + }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + ], + }, + table2: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, + table3: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, + table4: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, + table5: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, + table6: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, + table7: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, }; }, - mounted() {}, + computed: { + id() { + return this.$route.params.equipmentId; + }, + code() { + return this.$route.params.equipmentCode; + }, + name() { + return this.$route.params.equipmentName; + }, + }, + mounted() { + if (this.id) this.$set(this.queryParams, 'id', this.id); + if (this.code) + this.$set(this.searchBarFormConfig[0], 'defaultSelect', this.code); + if (this.name) + this.$set(this.searchBarFormConfig[1], 'defaultSelect', this.name); + }, methods: { /** 查询 */ - handleQuery() {}, + handleQuery() {}, - handleSearchBarBtnClick() {}, + handleSearchBarBtnClick() {}, handleEmitFun(table, val) { console.log('table val', table, val); @@ -115,4 +465,24 @@ export default { }; - +