|
|
@ -320,6 +320,9 @@ export default { |
|
|
|
this.canvasPreview.setHeight(this.height) |
|
|
|
} |
|
|
|
}, |
|
|
|
beforeDestroy() { |
|
|
|
window.removeEventListener('beforeunload', this.clearLocalStorage) |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getLibraryFloorListAll() |
|
|
|
}, |
|
|
@ -327,6 +330,12 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
clearLocalStorage() { |
|
|
|
const key = 'formArea' |
|
|
|
if (localStorage.getItem(key)) { |
|
|
|
localStorage.removeItem(key) |
|
|
|
} |
|
|
|
}, |
|
|
|
formatShelfRow() { |
|
|
|
let value = this.form.shelfRow |
|
|
|
value = value.toString() |
|
|
@ -359,7 +368,25 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
[CRUD.HOOK.beforeRefresh]() { |
|
|
|
console.log(this.$route.query) |
|
|
|
if (this.$route.query.formArea) { |
|
|
|
const formArea = JSON.parse(localStorage.getItem('formArea')) |
|
|
|
if (formArea) { |
|
|
|
this.selectFloorVal = { |
|
|
|
id: formArea.floorId, |
|
|
|
floorMap: formArea.floorMap, |
|
|
|
floorName: formArea.floorName |
|
|
|
} |
|
|
|
this.selectRegionVal = formArea |
|
|
|
this.crud.query.floorId = this.selectFloorVal.id |
|
|
|
this.crud.query.regionId = this.selectRegionVal.id |
|
|
|
|
|
|
|
FetchInitLibraryRegionList({ 'floorId': this.selectFloorVal.id }).then(res => { |
|
|
|
this.regionOptions = res.content |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
[CRUD.HOOK.afterRefresh](crud) { |
|
|
|
console.log(crud.data) |
|
|
@ -453,6 +480,9 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
changeBeforeFloor(val) { |
|
|
|
if (this.$route.query.formArea) { |
|
|
|
localStorage.removeItem('formArea') |
|
|
|
} |
|
|
|
if (val) { |
|
|
|
this.selectFloorVal = val |
|
|
|
this.crud.query.floorId = val.id |
|
|
@ -460,6 +490,10 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
changeBeforeRegion(val) { |
|
|
|
if (this.$route.query.formArea) { |
|
|
|
localStorage.removeItem('formArea') |
|
|
|
} |
|
|
|
|
|
|
|
if (val) { |
|
|
|
this.selectRegionVal = val |
|
|
|
this.crud.query.regionId = val.id |
|
|
|