|
|
@@ -24,7 +24,6 @@
|
|
|
class="u-width"
|
|
|
:schema="productSelectSchema"
|
|
|
placeholder="请选择配置"
|
|
|
- :disabled="isSub"
|
|
|
/>
|
|
|
<span class="c-grid-form__label u-required">序列号</span>
|
|
|
<el-input
|
|
|
@@ -223,16 +222,31 @@ export default {
|
|
|
this.onAdd()
|
|
|
},
|
|
|
onAdd () {
|
|
|
- this.currObj = {
|
|
|
- name: '',
|
|
|
- productId: this.$master?.productId,
|
|
|
- serialNumber: '',
|
|
|
- mac: '',
|
|
|
- range: ['07:00', '22:00'],
|
|
|
- address: '',
|
|
|
- longitude: '',
|
|
|
- latitude: '',
|
|
|
- tenant: this.tenant
|
|
|
+ if (this.isSub) {
|
|
|
+ const { productId, openTime, closeTime, address, longitude, latitude } = this.$master
|
|
|
+ this.currObj = {
|
|
|
+ name: '',
|
|
|
+ productId,
|
|
|
+ serialNumber: '',
|
|
|
+ mac: '',
|
|
|
+ range: [openTime, closeTime],
|
|
|
+ address,
|
|
|
+ longitude,
|
|
|
+ latitude,
|
|
|
+ tenant: this.tenant
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.currObj = {
|
|
|
+ name: '',
|
|
|
+ productId: '',
|
|
|
+ serialNumber: '',
|
|
|
+ mac: '',
|
|
|
+ range: ['07:00', '22:00'],
|
|
|
+ address: '',
|
|
|
+ longitude: '',
|
|
|
+ latitude: '',
|
|
|
+ tenant: this.tenant
|
|
|
+ }
|
|
|
}
|
|
|
this.$refs.editDialog.show()
|
|
|
},
|
|
|
@@ -343,15 +357,13 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
onDelDevice (item) {
|
|
|
- if (item.isMaster) {
|
|
|
- deleteDevice(item).then(() => {
|
|
|
+ deleteDevice(item).then(() => {
|
|
|
+ if (item.isMaster) {
|
|
|
this.$refs.table.decrease(1)
|
|
|
- })
|
|
|
- } else {
|
|
|
- deleteDevice(item).then(() => {
|
|
|
+ } else {
|
|
|
this.reloadSubDevices(item.parent)
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
reloadSubDevices (item) {
|
|
|
item.loaded = false
|