|
@ -34,9 +34,9 @@
|
34
|
34
|
</div>
|
35
|
35
|
<div class="search-ctn" style="justify-content: flex-end;">
|
36
|
36
|
<div class="btns">
|
|
37
|
<t-button color="success" icon="plus-outline" @click="addEquipment">新增</t-button>
|
37
|
38
|
<t-button color="success" icon="upload-outline" @click="onReset">导入</t-button>
|
38
|
39
|
<t-button color="success" icon="download-outline" @click="onReset">下载模板</t-button>
|
39
|
|
<t-button color="success" icon="plus-outline" @click="addEquipment">新增</t-button>
|
40
|
40
|
</div>
|
41
|
41
|
</div>
|
42
|
42
|
</div>
|
|
@ -61,8 +61,8 @@
|
61
|
61
|
</div>
|
62
|
62
|
</template>
|
63
|
63
|
</t-table-column>
|
64
|
|
<t-table-column prop="LONGITUDE" label="经度"></t-table-column>
|
65
|
|
<t-table-column prop="LATITUDE" label="纬度"></t-table-column>
|
|
64
|
<t-table-column :formatter="longLatFormatter" prop="LONGITUDE" label="经度"></t-table-column>
|
|
65
|
<t-table-column :formatter="longLatFormatter" prop="LATITUDE" label="纬度"></t-table-column>
|
66
|
66
|
<t-table-column
|
67
|
67
|
fixed="right"
|
68
|
68
|
label="操作"
|
|
@ -84,50 +84,58 @@
|
84
|
84
|
@on-change="onPagerChange">
|
85
|
85
|
</t-pager>
|
86
|
86
|
</div>
|
87
|
|
<t-modal :visibled.sync="modal" title="新增设备" >
|
|
87
|
<t-modal :visibled.sync="modal":mask-closable="false" title="新增设备" >
|
88
|
88
|
<t-form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80" label-position="left">
|
89
|
89
|
<t-form-item label="设备类型" prop="type">
|
90
|
|
<t-select v-model="formValidate.type" placeholder="请选择设备类型" clearable>
|
|
90
|
<t-select v-model="formValidate.type" placeholder="请选择设备类型" clearable @change="typeChange(1)">
|
91
|
91
|
<t-option v-for="(item, index) in typeList" :value="item.value" :key="index">{{ item.label }}</t-option>
|
92
|
92
|
</t-select>
|
93
|
93
|
</t-form-item>
|
94
|
94
|
<t-form-item label="设备名称" prop="name">
|
95
|
|
<t-input v-model="formValidate.name" placeholder="请输入风机名称"></t-input>
|
|
95
|
<t-input v-model="formValidate.name" placeholder="请输入设备名称"></t-input>
|
96
|
96
|
</t-form-item>
|
97
|
97
|
<t-form-item label="设备编号" prop="number">
|
98
|
98
|
<t-input v-model="formValidate.number" placeholder="请输入字母、数字、中划线、下划线、#"></t-input>
|
99
|
99
|
</t-form-item>
|
100
|
|
<t-form-item label="经度" prop="lng">
|
101
|
|
<t-input v-model="formValidate.lng" placeholder="请输入数字"></t-input>
|
102
|
|
</t-form-item>
|
103
|
|
<t-form-item label="纬度" prop="lat">
|
104
|
|
<t-input v-model="formValidate.lat" placeholder="请输入数字"></t-input>
|
105
|
|
</t-form-item>
|
|
100
|
<div v-if="!lngLatDisabled">
|
|
101
|
<t-form-item label="经度" prop="lng">
|
|
102
|
<t-format-input v-model="formValidate.lng" numeral numeral-decimal-scale=8 placeholder="请输入数字"></t-format-input>
|
|
103
|
</t-form-item>
|
|
104
|
</div>
|
|
105
|
<div v-if="!lngLatDisabled">
|
|
106
|
<t-form-item label="纬度" prop="lat">
|
|
107
|
<t-format-input v-model="formValidate.lat" numeral numeral-decimal-scale=8 placeholder="请输入数字"></t-format-input>
|
|
108
|
</t-form-item>
|
|
109
|
</div>
|
106
|
110
|
</t-form>
|
107
|
111
|
<div slot="footer">
|
108
|
112
|
<t-button @click="cancel">取消</t-button>
|
109
|
113
|
<t-button class="submit-button" @click="submit">保存</t-button>
|
110
|
114
|
</div>
|
111
|
115
|
</t-modal>
|
112
|
|
<t-modal :visibled.sync="updateModal" title="编辑设备" >
|
|
116
|
<t-modal :visibled.sync="updateModal":mask-closable="false" title="编辑设备" >
|
113
|
117
|
<t-form ref="updateRow" :model="updateRow" :rules="updateRowValidate" :label-width="80" label-position="left">
|
114
|
118
|
<t-form-item label="设备类型" prop="FACILITY_TYPE">
|
115
|
|
<t-select v-model="updateRow.FACILITY_TYPE" placeholder="请选择设备类型" clearable>
|
|
119
|
<t-select v-model="updateRow.FACILITY_TYPE" placeholder="请选择设备类型" clearable @change="typeChange(2)">
|
116
|
120
|
<t-option v-for="(item, index) in typeList" :value="item.value" :key="index">{{ item.label }}</t-option>
|
117
|
121
|
</t-select>
|
118
|
122
|
</t-form-item>
|
119
|
123
|
<t-form-item label="设备名称" prop="FACILITY_NAME">
|
120
|
|
<t-input v-model="updateRow.FACILITY_NAME" placeholder="请输入风机名称"></t-input>
|
|
124
|
<t-input v-model="updateRow.FACILITY_NAME" placeholder="请输入设备名称"></t-input>
|
121
|
125
|
</t-form-item>
|
122
|
126
|
<t-form-item label="设备编号" prop="FACILITY_CODE">
|
123
|
127
|
{{ updateRow.FACILITY_CODE }}
|
124
|
128
|
</t-form-item>
|
125
|
|
<t-form-item label="经度" prop="LONGITUDE">
|
126
|
|
<t-input v-model="updateRow.LONGITUDE" placeholder="请输入数字"></t-input>
|
127
|
|
</t-form-item>
|
128
|
|
<t-form-item label="纬度" prop="LATITUDE">
|
129
|
|
<t-input v-model="updateRow.LATITUDE" placeholder="请输入数字"></t-input>
|
130
|
|
</t-form-item>
|
|
129
|
<div v-if="!lngLatDisabled">
|
|
130
|
<t-form-item label="经度" prop="LONGITUDE">
|
|
131
|
<t-format-input v-model="updateRow.LONGITUDE" numeral numeral-decimal-scale=8 placeholder="请输入数字"></t-format-input>
|
|
132
|
</t-form-item>
|
|
133
|
</div>
|
|
134
|
<div v-if="!lngLatDisabled">
|
|
135
|
<t-form-item label="纬度" prop="LATITUDE">
|
|
136
|
<t-format-input v-model="updateRow.LATITUDE" numeral numeral-decimal-scale=8 placeholder="请输入数字"></t-format-input>
|
|
137
|
</t-form-item>
|
|
138
|
</div>
|
131
|
139
|
</t-form>
|
132
|
140
|
<div slot="footer">
|
133
|
141
|
<t-button @click="cancel">取消</t-button>
|
|
@ -148,6 +156,7 @@ export default {
|
148
|
156
|
// currentLoading_n: false,
|
149
|
157
|
// searchResult_n: [],
|
150
|
158
|
// demoDataA_n: [],
|
|
159
|
lngLatDisabled: false,
|
151
|
160
|
typeList: [
|
152
|
161
|
{
|
153
|
162
|
value: '001',
|
|
@ -454,7 +463,6 @@ export default {
|
454
|
463
|
this.formValidate.lng = ''
|
455
|
464
|
this.formValidate.lat = ''
|
456
|
465
|
this.table.pager.currentPage = 1
|
457
|
|
this.getList()
|
458
|
466
|
},
|
459
|
467
|
submit() {
|
460
|
468
|
this.$refs.formValidate.validate(valid => {
|
|
@ -474,6 +482,7 @@ export default {
|
474
|
482
|
).then(res => {
|
475
|
483
|
// 请求成功处理...
|
476
|
484
|
this.$Message.success('提交成功!')
|
|
485
|
this.getList()
|
477
|
486
|
this.cancel()
|
478
|
487
|
}).catch(res => {
|
479
|
488
|
// 请求失败处理...
|
|
@ -501,6 +510,7 @@ export default {
|
501
|
510
|
).then(res => {
|
502
|
511
|
// 请求成功处理...
|
503
|
512
|
this.$Message.success('提交成功!')
|
|
513
|
this.getList()
|
504
|
514
|
this.cancel()
|
505
|
515
|
}).catch(res => {
|
506
|
516
|
// 请求失败处理...
|
|
@ -511,11 +521,23 @@ export default {
|
511
|
521
|
})
|
512
|
522
|
},
|
513
|
523
|
addEquipment() {
|
|
524
|
this.lngLatDisabled = false
|
514
|
525
|
this.modal = true
|
515
|
526
|
},
|
516
|
527
|
handleClick(row) {
|
517
|
|
this.updateModal = true
|
518
|
|
this.updateRow = row
|
|
528
|
var params = new FormData()
|
|
529
|
params.append('data', JSON.stringify({
|
|
530
|
FACILITY_ID: row.FACILITY_ID
|
|
531
|
}))
|
|
532
|
this.$test.post(services.equipment.GET_ONE_EQUIPMENT, params
|
|
533
|
).then(res => {
|
|
534
|
// 请求成功处理...
|
|
535
|
this.updateModal = true
|
|
536
|
this.updateRow = res.data.resultData
|
|
537
|
this.typeChange(2)
|
|
538
|
}).catch(res => {
|
|
539
|
// 请求失败处理...
|
|
540
|
})
|
519
|
541
|
},
|
520
|
542
|
remove(row) {
|
521
|
543
|
let that = this
|
|
@ -540,6 +562,21 @@ export default {
|
540
|
562
|
}
|
541
|
563
|
}
|
542
|
564
|
this.$Confirm.confirm(confirm)
|
|
565
|
},
|
|
566
|
longLatFormatter(cjsj, column, cellValue, index) {
|
|
567
|
if (cjsj.FACILITY_TYPE==1) {
|
|
568
|
return '--'
|
|
569
|
}
|
|
570
|
return cellValue
|
|
571
|
},
|
|
572
|
typeChange(t) {
|
|
573
|
var value
|
|
574
|
if (t === 1) {
|
|
575
|
value = this.formValidate.type
|
|
576
|
} else {
|
|
577
|
value = this.updateRow.FACILITY_TYPE
|
|
578
|
}
|
|
579
|
this.lngLatDisabled = (value == 1)
|
543
|
580
|
}
|
544
|
581
|
}
|
545
|
582
|
}
|