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() {
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) {
this.$refs.sectionControl.doShow(operate, this.selected);
}
@ -204,7 +205,8 @@ export default {
},
//
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) {
this.$refs.sectionControl.doShow(operate, this.selected);
}
@ -226,7 +228,8 @@ export default {
// },
//
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) {
this.$refs.speedLimitControl.doShow(operate, this.selected);
}

View File

@ -166,7 +166,8 @@ export default {
},
//
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) {
this.$refs.sectionControl.doShow(operate, this.selected);
}
@ -182,7 +183,8 @@ export default {
},
//
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) {
this.$refs.sectionControl.doShow(operate, this.selected);
}
@ -206,7 +208,8 @@ export default {
},
//
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) {
this.$refs.speedLimitControl.doShow(operate, this.selected);
}

View File

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