|
@@ -19,7 +19,7 @@
|
|
|
:value-format="dateType"
|
|
|
:picker-options="endDatePicker"
|
|
|
@change="timeQuery"
|
|
|
- :clearable="false"
|
|
|
+ clearable
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</span>
|
|
@@ -86,6 +86,7 @@ export default {
|
|
|
props: ['params'],
|
|
|
components: {},
|
|
|
data() {
|
|
|
+ let _this = this;
|
|
|
return {
|
|
|
deviceLoader,
|
|
|
type: '',
|
|
@@ -131,7 +132,58 @@ export default {
|
|
|
{ label: '设备状态', prop: 'receiveTime' }
|
|
|
],
|
|
|
AlertsCols,
|
|
|
- valveInfoCols,
|
|
|
+ /* 设备详情-阀控记录列表展示信息配置 */
|
|
|
+ valveInfoCols: [
|
|
|
+ {
|
|
|
+ label: '操作原因',
|
|
|
+ prop: 'operationCause'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '操作类型',
|
|
|
+ prop: 'operationType',
|
|
|
+ format(val, data) {
|
|
|
+ let name = '';
|
|
|
+ switch (val) {
|
|
|
+ case 0:
|
|
|
+ return '关' + name;
|
|
|
+ case 1:
|
|
|
+ return '开' + name;
|
|
|
+ default:
|
|
|
+ return '-';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '操作结果',
|
|
|
+ prop: 'operationResult',
|
|
|
+ format(val, data) {
|
|
|
+ let name = '';
|
|
|
+ if (_this.mixins_query.categoryId === 1) {
|
|
|
+ name = '阀';
|
|
|
+ } else {
|
|
|
+ name = '闸';
|
|
|
+ }
|
|
|
+ switch (val) {
|
|
|
+ case 0:
|
|
|
+ return name + '关';
|
|
|
+ case 1:
|
|
|
+ return name + '开';
|
|
|
+ case 2:
|
|
|
+ return '执行中';
|
|
|
+ default:
|
|
|
+ return '-';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '操作时间',
|
|
|
+ prop: 'operationDate'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '处理时间',
|
|
|
+ prop: 'finishDate'
|
|
|
+ }
|
|
|
+ ],
|
|
|
historyCols, //告警列表表头
|
|
|
getRowStr,
|
|
|
historyDataList: []
|
|
@@ -144,8 +196,8 @@ export default {
|
|
|
this.initDate('YYYYMMDD');
|
|
|
this.mixins_query = {
|
|
|
deviceId: this.params.id || '',
|
|
|
- startDate: this.dataValue.length ? `${this.dataValue[0]}` : '',
|
|
|
- endDate: this.dataValue.length ? `${this.dataValue[1]}` : ''
|
|
|
+ startDate: !!this.dataValue ? `${this.dataValue[0]}` : '',
|
|
|
+ endDate: !!this.dataValue ? `${this.dataValue[1]}` : ''
|
|
|
};
|
|
|
|
|
|
new Promise((resolve) => {
|
|
@@ -211,8 +263,8 @@ export default {
|
|
|
// 获取历史数据列表
|
|
|
this.mixins_query = {
|
|
|
deviceId: this.params.id || '',
|
|
|
- startDate: this.dataValue.length ? `${this.dataValue[0]}` : '',
|
|
|
- endDate: this.dataValue.length ? `${this.dataValue[1]}` : ''
|
|
|
+ startDate: !!this.dataValue ? `${this.dataValue[0]}` : '',
|
|
|
+ endDate: !!this.dataValue ? `${this.dataValue[1]}` : ''
|
|
|
};
|
|
|
if (this.params.productId) {
|
|
|
this.$http
|
|
@@ -252,8 +304,8 @@ export default {
|
|
|
this.mixins_query = {
|
|
|
categoryId: this.params.categoryId || '',
|
|
|
deviceId: this.params.id || '',
|
|
|
- startDate: this.dataValue.length ? `${this.dataValue[0]}` : '',
|
|
|
- endDate: this.dataValue.length ? `${this.dataValue[1]}` : ''
|
|
|
+ startDate: !!this.dataValue ? `${this.dataValue[0]}` : '',
|
|
|
+ endDate: !!this.dataValue ? `${this.dataValue[1]}` : ''
|
|
|
};
|
|
|
this.mixins_search();
|
|
|
},
|
|
@@ -263,18 +315,16 @@ export default {
|
|
|
this.mixins_post = 'get';
|
|
|
this.mixins_dataUrl = '/sc-energy/device/command/page';
|
|
|
this.mixins_query = {
|
|
|
- // categoryId: this.params.categoryId || '',
|
|
|
- // communityId: this.params.communityId || '',
|
|
|
deviceId: this.params.id || '',
|
|
|
- startDate: this.dataValue.length ? `${this.dataValue[0]}` : '',
|
|
|
- endDate: this.dataValue.length ? `${this.dataValue[1]}` : ''
|
|
|
+ startDate: !!this.dataValue ? `${this.dataValue[0]}` : '',
|
|
|
+ endDate: !!this.dataValue ? `${this.dataValue[1]}` : ''
|
|
|
};
|
|
|
this.mixins_search();
|
|
|
},
|
|
|
|
|
|
timeQuery() {
|
|
|
- (this.mixins_query.startDate = this.dataValue.length ? `${this.dataValue[0]}` : ''),
|
|
|
- (this.mixins_query.endDate = this.dataValue.length ? `${this.dataValue[1]}` : '');
|
|
|
+ (this.mixins_query.startDate = !!this.dataValue ? `${this.dataValue[0]}` : ''),
|
|
|
+ (this.mixins_query.endDate = !!this.dataValue ? `${this.dataValue[1]}` : '');
|
|
|
this.change(this.value);
|
|
|
},
|
|
|
getDeviceMeasuringPoint(resolve) {
|
|
@@ -330,8 +380,8 @@ export default {
|
|
|
let downurl = '';
|
|
|
let params = {
|
|
|
deviceId: this.params.id || '',
|
|
|
- startDate: this.dataValue.length ? `${this.dataValue[0]}` : '',
|
|
|
- endDate: this.dataValue.length ? `${this.dataValue[1]}` : ''
|
|
|
+ startDate: !!this.dataValue ? `${this.dataValue[0]}` : '',
|
|
|
+ endDate: !!this.dataValue ? `${this.dataValue[1]}` : ''
|
|
|
};
|
|
|
if (this.value == 'history') {
|
|
|
params = {
|
|
@@ -350,8 +400,8 @@ export default {
|
|
|
downurl = '/sc-energy/device/command/export/excel';
|
|
|
params = {
|
|
|
deviceId: this.params.id || '',
|
|
|
- startDate: this.dataValue.length ? `${this.dataValue[0]}` : '',
|
|
|
- endDate: this.dataValue.length ? `${this.dataValue[1]}` : ''
|
|
|
+ startDate: !!this.dataValue ? `${this.dataValue[0]}` : '',
|
|
|
+ endDate: !!this.dataValue ? `${this.dataValue[1]}` : ''
|
|
|
};
|
|
|
}
|
|
|
this.__exportExcel(downurl, params);
|