Commit ff8abbd3 authored by rockyl's avatar rockyl

行为编辑器关闭警告

parent 4e2a11fb
......@@ -3,6 +3,7 @@
"Confirm": "Confirm",
"Cancel": "Cancel",
"Close": "Close",
"Still Close": "Still Close",
"Save": "Save",
"Copy": "Copy",
"Exit": "Exit",
......@@ -77,6 +78,7 @@
"This Meta ID is in use, can not save": "This Meta ID is in use, can not save!",
"Custom node desc": "Custom node",
"Divider node desc": "Divider node, exit will be executed in sequence",
"Save this behavior before": "Save this behavior before?",
"menu": {
"save": "Save",
"details": "Details",
......
......@@ -60,9 +60,6 @@ export const behaviorStore = {
behavior_save(state) {
state.originData.processes = state.data.processes;
state.originBehaviors[0] = state.currentBehavior;
},
behavior_cancel(state) {
},
updateProcesses(state, {targetMetaID, replaceMetaID}) {
for (let process of state.data.processes) {
......
<template>
<el-dialog :title="$t('Behavior Editor')" :visible.sync="visible" @before-close="beforeClose" @opened="onOpened"
<el-dialog :title="$t('Behavior Editor')" :visible.sync="visible" :before-close="beforeClose" @opened="onOpened"
:fullscreen="true"
:append-to-body="true" :close-on-click-modal="false" custom-class="behavior-editor-dialog">
<behavior-editor v-if="editorReady" ref="behaviorEditor" class="full-size"></behavior-editor>
......@@ -42,10 +42,21 @@
this.visible = false;
this.$emit('change');
},
beforeClose() {
this.behavior_cancel();
this.visible = false;
beforeClose(done) {
this.$confirm(this.$t('Save this behavior before?'), this.$t('Alert'), {
showClose: false,
closeOnClickModal: false,
closeOnPressEscape: false,
confirmButtonText: this.$t('Confirm'),
cancelButtonText: this.$t('Still Close'),
type: 'warning'
}).then(() => {
this.onSave();
done();
}).catch((e) => {
this.$emit('cancel');
done();
});
},
onOpened() {
this.editorReady = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment