This commit is contained in:
fan 2020-04-16 17:30:07 +08:00
commit 46d95bf715
3 changed files with 22 additions and 15 deletions

View File

@ -189,7 +189,8 @@ export default {
}, },
// //
split() { split() {
commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code;
commitOperate(menuOperate.Section.split, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{
if (valid) { if (valid) {
this.$refs.sectionControl.doShow(operate, this.selected); this.$refs.sectionControl.doShow(operate, this.selected);
} }
@ -204,7 +205,8 @@ export default {
}, },
// //
active() { active() {
commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code;
commitOperate(menuOperate.Section.active, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{
if (valid) { if (valid) {
this.$refs.sectionControl.doShow(operate, this.selected); this.$refs.sectionControl.doShow(operate, this.selected);
} }
@ -226,7 +228,8 @@ export default {
// }, // },
// //
setSpeed() { setSpeed() {
commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code;
commitOperate(menuOperate.Section.setSpeed, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{
if (valid) { if (valid) {
this.$refs.speedLimitControl.doShow(operate, this.selected); this.$refs.speedLimitControl.doShow(operate, this.selected);
} }

View File

@ -166,7 +166,8 @@ export default {
}, },
// //
split() { split() {
commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code;
commitOperate(menuOperate.Section.split, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{
if (valid) { if (valid) {
this.$refs.sectionControl.doShow(operate, this.selected); this.$refs.sectionControl.doShow(operate, this.selected);
} }
@ -182,7 +183,8 @@ export default {
}, },
// //
active() { active() {
commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code;
commitOperate(menuOperate.Section.active, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{
if (valid) { if (valid) {
this.$refs.sectionControl.doShow(operate, this.selected); this.$refs.sectionControl.doShow(operate, this.selected);
} }
@ -206,7 +208,8 @@ export default {
}, },
// //
setSpeed() { setSpeed() {
commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code;
commitOperate(menuOperate.Section.setSpeed, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{
if (valid) { if (valid) {
this.$refs.speedLimitControl.doShow(operate, this.selected); this.$refs.speedLimitControl.doShow(operate, this.selected);
} }

View File

@ -64,25 +64,26 @@ export default {
// this.validateText = this.$t('rules.pleaseEnterMapName'); // this.validateText = this.$t('rules.pleaseEnterMapName');
return false; return false;
} }
// const loading = this.$loading({ const loading = this.$loading({
// lock: true, lock: true,
// text: '...', text: '正在导入中...',
// spinner: 'el-icon-loading', spinner: 'el-icon-loading',
// background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
// }); });
const that = this; const that = this;
that.loading = true; that.loading = true;
this.jsonData.name = this.editModel.name; this.jsonData.name = this.editModel.name;
this.dialogShow = false;
this.validateText = '';
postBuildMapImport(this.jsonData).then(res => { postBuildMapImport(this.jsonData).then(res => {
// loading.close(); loading.close();
that.loading = false; that.loading = false;
that.$message.success('导入成功!'); that.$message.success('导入成功!');
// that.loadInitData();
this.$emit('loadInitData'); this.$emit('loadInitData');
// loading.close(); // loading.close();
this.close(); this.close();
}).catch(error => { }).catch(error => {
// loading.close(); loading.close();
that.loading = false; that.loading = false;
this.close(); this.close();
that.$message.error('导入失败' + error.message); that.$message.error('导入失败' + error.message);