diff --git a/web/admin/region/index.aspx b/web/admin/region/index.aspx index 37975a6..c3f1480 100644 --- a/web/admin/region/index.aspx +++ b/web/admin/region/index.aspx @@ -15,17 +15,16 @@ 全部收起 - + 儲存區域資料 - - - - 儲存區域資料 - + + + 儲存區域資料1 + 新增下層區域 @@ -517,6 +516,7 @@ regionTypes: [], currentSelectRegion: null, currentSelectRoom: null, + createRegionFlag: false, form: { uuid: null, name: '', @@ -636,6 +636,8 @@ this.disabledParentOptions = []; this.currentSelectRegion = null; this.currentSelectRoom = null; + this.createRegionFlag = true; + this.selectedType = null; }, createSubRegion() { if (!this.selectedRegionId) return; @@ -658,17 +660,18 @@ return; } const url = this.form.uuid - ? HTTP_HOST + '/api/region/update' - : HTTP_HOST + '/api/region/create'; + ? HTTP_HOST + 'api/region/update' + : HTTP_HOST + 'api/region/create'; axios.post(url, this.form) .then((res) => { //alert('儲存成功'); this.loadRegions(); //this.newRegion(); - this.form.uuid = res.data.uuid; - this.selectedRegionId = res.data.uuid; + this.form.uuid = res.data.id; + this.selectedRegionId = res.data.id; this.currentSelectRegion = JSON.parse(JSON.stringify(this.form)); + this.createRegionFlag = false; this.$refs.messageModal.open({ title: "更新", message: "更新成功", @@ -1000,7 +1003,16 @@ }, watch: { - + currentSelectRegion(newVal) { + if (newVal !== null) { + this.createRegionFlag = false; + } + }, + currentSelectRoom(newVal) { + if (newVal !== null) { + this.createRegionFlag = false; + } + } }, mounted() { this.loadRegions();