Commit c0681ad5 authored by rockyl's avatar rockyl

内建过程不可编辑props

parent ff8abbd3
...@@ -28,6 +28,31 @@ const data = { ...@@ -28,6 +28,31 @@ const data = {
}, },
output: ['complete'], output: ['complete'],
}, },
{
id: 'hehe',
name: 'Hehe',
desc: '呵呵',
type: 'builtin',
subEntry: '1',
sub: {
1: {
uuid: '1',
alias: '入口',
meta: 'entry',
output: {
success: ['2'],
},
},
2: {
uuid: '2',
meta: 'wait',
alias: '等待',
props: {
duration: 500,
},
},
}
},
{ {
id: 'prefab1', id: 'prefab1',
name: 'Prefab1', name: 'Prefab1',
...@@ -53,7 +78,7 @@ const data = { ...@@ -53,7 +78,7 @@ const data = {
}, },
}, },
} }
} },
], ],
scripts: [ scripts: [
{ {
......
...@@ -33,6 +33,9 @@ ...@@ -33,6 +33,9 @@
"Preparing": "Preparing…", "Preparing": "Preparing…",
"Deleting": "Deleting…", "Deleting": "Deleting…",
"Saving": "Saving…", "Saving": "Saving…",
"Divider": "Divider",
"Custom": "Custom",
"Entry": "Entry",
"Create project": "Create project", "Create project": "Create project",
"Rename project": "Rename project", "Rename project": "Rename project",
"Props Editor": "Props Editor", "Props Editor": "Props Editor",
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* 行为编辑 * 行为编辑
*/ */
import Vue from 'vue'; import i18n from "../../i18n";
import generateUUID from "uuid/v4"; import generateUUID from "uuid/v4";
import {metaInUse, updateProcesses} from "../../utils"; import {metaInUse, updateProcesses} from "../../utils";
...@@ -16,6 +16,15 @@ export const behaviorStore = { ...@@ -16,6 +16,15 @@ export const behaviorStore = {
originData: null, originData: null,
originBehaviors: null, originBehaviors: null,
behaviors: null, behaviors: null,
processStack: [],
editable: false,
drawState: {
drawing: false,
targetUUID: '',
lineID: 0,
boardOffset: {x: 0, y: 0},
},
}, },
mutations: { mutations: {
behavior_startEdit(state, {originData, behaviors, event}) { behavior_startEdit(state, {originData, behaviors, event}) {
...@@ -42,7 +51,7 @@ export const behaviorStore = { ...@@ -42,7 +51,7 @@ export const behaviorStore = {
sub: { sub: {
[subEntryUUID]: { [subEntryUUID]: {
uuid: subEntryUUID, uuid: subEntryUUID,
alias: 'Entry', alias: i18n.t('Entry'),
meta: 'entry', meta: 'entry',
design: { design: {
x: 10, x: 10,
...@@ -76,6 +85,18 @@ export const behaviorStore = { ...@@ -76,6 +85,18 @@ export const behaviorStore = {
} }
} }
}, },
clearProcessStack(state) {
state.processStack.splice(0);
updatePropsEditable(state);
},
pushProcessStack(state, process) {
state.processStack.push(process);
updatePropsEditable(state);
},
popProcessStack(state, index) {
state.processStack.splice(index);
updatePropsEditable(state);
},
}, },
getters: { getters: {
customProcessMap: state => { customProcessMap: state => {
...@@ -108,7 +129,7 @@ export const behaviorStore = { ...@@ -108,7 +129,7 @@ export const behaviorStore = {
behavior_getAssetByUUID: state => uuid => { behavior_getAssetByUUID: state => uuid => {
return state.data.assets.find(item => item.uuid === uuid); return state.data.assets.find(item => item.uuid === uuid);
}, },
behavior_views: state=>{ behavior_views: state => {
return state.data.views; return state.data.views;
} }
}, },
...@@ -116,7 +137,7 @@ export const behaviorStore = { ...@@ -116,7 +137,7 @@ export const behaviorStore = {
addCustomProcessMeta({commit, state}) { addCustomProcessMeta({commit, state}) {
let meta = { let meta = {
id: generateUUID(), id: generateUUID(),
name: 'Custom', name: i18n.t('Custom'),
script: '', script: '',
props: {}, props: {},
output: ['success', 'failed'], output: ['success', 'failed'],
...@@ -127,7 +148,7 @@ export const behaviorStore = { ...@@ -127,7 +148,7 @@ export const behaviorStore = {
addDividerProcessMeta({commit, state}) { addDividerProcessMeta({commit, state}) {
let meta = { let meta = {
id: generateUUID(), id: generateUUID(),
name: 'Divider', name: i18n.t('Divider'),
isDivider: true, isDivider: true,
output: ['p0'], output: ['p0'],
}; };
...@@ -136,3 +157,7 @@ export const behaviorStore = { ...@@ -136,3 +157,7 @@ export const behaviorStore = {
}, },
} }
}; };
function updatePropsEditable(state) {
state.editable = state.processStack.filter(item => item.meta.type === 'builtin') <= 0;
}
...@@ -34,13 +34,13 @@ export const envStore = { ...@@ -34,13 +34,13 @@ export const envStore = {
const dividerProcess = { const dividerProcess = {
id: 'divider', id: 'divider',
name: 'Divider', name: i18n.t('Divider'),
desc: i18n.t('Divider node desc'),//'分流节点,出口会按顺序一次执行', desc: i18n.t('Divider node desc'),//'分流节点,出口会按顺序一次执行',
}; };
tree.unshift(dividerProcess); tree.unshift(dividerProcess);
const customProcess = { const customProcess = {
id: 'custom', id: 'custom',
name: 'Custom', name: i18n.t('Custom'),
desc: i18n.t('Custom node desc'),//'自定义节点', desc: i18n.t('Custom node desc'),//'自定义节点',
}; };
tree.unshift(customProcess); tree.unshift(customProcess);
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
props: [], props: [],
data() { data() {
return { return {
processStack: [],
metaInEditing: null, metaInEditing: null,
} }
}, },
...@@ -57,14 +56,12 @@ ...@@ -57,14 +56,12 @@
}, },
...mapState({ ...mapState({
behavior: state => state.behavior.currentBehavior, behavior: state => state.behavior.currentBehavior,
processStack: state=>state.behavior.processStack,
}), }),
...mapGetters([ ...mapGetters([
'prefabProcessTree', 'prefabProcessTree',
'builtinProcessTree' 'builtinProcessTree'
]) ]),
},
mounted() {
}, },
methods: { methods: {
resolveProcess(id) { resolveProcess(id) {
...@@ -75,7 +72,7 @@ ...@@ -75,7 +72,7 @@
} }
}, },
edit() { edit() {
this.processStack.splice(0); this.clearProcessStack();
let process = new Process(null, this.behavior, this.resolveProcess); let process = new Process(null, this.behavior, this.resolveProcess);
this.editProcess(process); this.editProcess(process);
}, },
...@@ -83,12 +80,12 @@ ...@@ -83,12 +80,12 @@
this.$refs.properties.edit(process); this.$refs.properties.edit(process);
}, },
editProcess(process) { editProcess(process) {
this.processStack.push(process); this.pushProcessStack(process);
this.$refs.board.edit(process, this.resolveProcess); this.$refs.board.edit(process, this.resolveProcess);
this.$refs.properties.edit(); this.$refs.properties.edit();
}, },
onPop(index) { onPop(index) {
this.processStack.splice(index + 1); this.popProcessStack(index + 1);
let process = this.processStack[this.processStack.length - 1]; let process = this.processStack[this.processStack.length - 1];
this.$refs.board.edit(process, this.resolveProcess); this.$refs.board.edit(process, this.resolveProcess);
this.$refs.properties.edit(); this.$refs.properties.edit();
...@@ -131,6 +128,10 @@ ...@@ -131,6 +128,10 @@
...mapMutations([ ...mapMutations([
'updateProcesses', 'updateProcesses',
'deleteProcessMeta', 'deleteProcessMeta',
'updatePropsEditable',
'clearProcessStack',
'pushProcessStack',
'popProcessStack',
]), ]),
...mapGetters([ ...mapGetters([
'metaInUse', 'metaInUse',
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
import LinkLine from "./Board/LinkLine"; import LinkLine from "./Board/LinkLine";
import ToolTip from "./Board/ToolTip"; import ToolTip from "./Board/ToolTip";
import {DOCK_POINT_OFFSET} from "../../../config"; import {DOCK_POINT_OFFSET} from "../../../config";
import {state} from "./Board/state";
import events from "../../../global-events"; import events from "../../../global-events";
import generateUUID from "uuid/v4"; import generateUUID from "uuid/v4";
//todo 缩放功能 //todo 缩放功能
...@@ -53,7 +52,11 @@ ...@@ -53,7 +52,11 @@
mounted() { mounted() {
}, },
computed: {}, computed: {
...mapState({
drawState: state=>state.behavior.drawState
})
},
methods: { methods: {
...mapActions([ ...mapActions([
'addCustomProcessMeta', 'addCustomProcessMeta',
...@@ -141,8 +144,8 @@ ...@@ -141,8 +144,8 @@
}, },
onResize(){ onResize(){
const {x, y} = this.$el.getBoundingClientRect(); const {x, y} = this.$el.getBoundingClientRect();
state.boardOffset.x = x; this.drawState.boardOffset.x = x;
state.boardOffset.y = y; this.drawState.boardOffset.y = y;
}, },
measure() { measure() {
this.onResize(); this.onResize();
...@@ -170,14 +173,14 @@ ...@@ -170,14 +173,14 @@
addLine(process, outputID, outputType, outputIndex) { addLine(process, outputID, outputType, outputIndex) {
const nextProcess = this.subProcessMap[outputID]; const nextProcess = this.subProcessMap[outputID];
if (nextProcess) { if (nextProcess) {
this.$set(this.lines, state.lineID, { this.$set(this.lines, this.drawState.lineID, {
id: state.lineID, id: this.drawState.lineID,
prev: process, prev: process,
next: nextProcess.data, next: nextProcess.data,
outputType, outputType,
outputIndex, outputIndex,
}); });
state.lineID++; this.drawState.lineID++;
} }
}, },
onPinHover(x, y, pin) { onPinHover(x, y, pin) {
...@@ -196,12 +199,12 @@ ...@@ -196,12 +199,12 @@
const startPos = process.design.output[pin][0]; const startPos = process.design.output[pin][0];
this.drawingLineStart = `M${startPos.x + x - DOCK_POINT_OFFSET},${startPos.y + y + DOCK_POINT_OFFSET} C${startPos.x + x + 100},${startPos.y + y} `; this.drawingLineStart = `M${startPos.x + x - DOCK_POINT_OFFSET},${startPos.y + y + DOCK_POINT_OFFSET} C${startPos.x + x + 100},${startPos.y + y} `;
this.lineDrawing.visible = true; this.lineDrawing.visible = true;
state.drawing = true; this.drawState.drawing = true;
this.onMouseMove(e); this.onMouseMove(e);
}, },
onMouseMove(e) { onMouseMove(e) {
let x = e.x - state.boardOffset.x; let x = e.x - this.drawState.boardOffset.x;
let y = e.y - state.boardOffset.y; let y = e.y - this.drawState.boardOffset.y;
this.lineDrawing.path = this.drawingLineStart + `${x},${y} ${x},${y}`; this.lineDrawing.path = this.drawingLineStart + `${x},${y} ${x},${y}`;
}, },
onMouseUp(e) { onMouseUp(e) {
...@@ -209,13 +212,13 @@ ...@@ -209,13 +212,13 @@
document.removeEventListener("mouseup", this.onMouseUp); document.removeEventListener("mouseup", this.onMouseUp);
this.lineDrawing.visible = false; this.lineDrawing.visible = false;
state.drawing = false; this.drawState.drawing = false;
if (state.targetUUID && state.targetUUID !== this.processDrawing.uuid) { if (this.drawState.targetUUID && this.drawState.targetUUID !== this.processDrawing.uuid) {
this.processDrawing.output[this.pointDrawing] = [state.targetUUID]; this.processDrawing.output[this.pointDrawing] = [this.drawState.targetUUID];
this.addLine(this.processDrawing, state.targetUUID, this.pointDrawing, 0); this.addLine(this.processDrawing, this.drawState.targetUUID, this.pointDrawing, 0);
state.targetUUID = null; this.drawState.targetUUID = null;
} }
}, },
onDeleteLine(line) { onDeleteLine(line) {
......
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
</template> </template>
<script> <script>
import {mapState} from "vuex";
import DockPin from "./DockPin"; import DockPin from "./DockPin";
import {state} from "./state";
import events from "../../../../global-events"; import events from "../../../../global-events";
import {linkedFlag} from "../../../../utils"; import {linkedFlag} from "../../../../utils";
...@@ -75,6 +75,9 @@ ...@@ -75,6 +75,9 @@
data() { data() {
return this.process.data; return this.process.data;
}, },
...mapState({
drawState: state=>state.behavior.drawState
}),
}, },
watch: { watch: {
process(v) { process(v) {
...@@ -125,13 +128,13 @@ ...@@ -125,13 +128,13 @@
this.active = active; this.active = active;
}, },
onMouseEnter(e) { onMouseEnter(e) {
if (state.drawing && this.meta.id !== 'entry') { if (this.drawState.drawing && this.meta.id !== 'entry') {
state.targetUUID = this.data.uuid; this.drawState.targetUUID = this.data.uuid;
} }
}, },
onMouseLeave(e) { onMouseLeave(e) {
if (state.drawing) { if (this.drawState.drawing) {
state.targetUUID = null; this.drawState.targetUUID = null;
} }
}, },
onMouseDown(e) { onMouseDown(e) {
...@@ -171,7 +174,7 @@ ...@@ -171,7 +174,7 @@
}, },
updateDockPointPos() { updateDockPointPos() {
const {x: dx, y: dy} = this.process.data.design; const {x: dx, y: dy} = this.process.data.design;
const {x: offX, y: offY} = state.boardOffset; const {x: offX, y: offY} = this.drawState.boardOffset;
for (let side of ['input', 'output']) { for (let side of ['input', 'output']) {
let container = this.$refs[side + 'Dock']; let container = this.$refs[side + 'Dock'];
let sideMeta = side === 'input' ? this.inputMeta : this.meta[side]; let sideMeta = side === 'input' ? this.inputMeta : this.meta[side];
......
/**
* Created by rockyl on 2019-10-08.
*/
export const state = {
drawing: false,
targetUUID: '',
lineID: 0,
boardOffset: {x: 0, y: 0},
};
<template> <template>
<div class="wrapper" v-if="process"> <div class="wrapper" v-if="process">
<el-input class="name-input" v-model="process.data.alias" clearable :placeholder="process.meta.name" size="mini"> <el-input :readonly="!editable" class="name-input" v-model="process.data.alias" clearable :placeholder="process.meta.name" size="mini">
<template slot="prepend">{{$t('Name')}}</template> <template slot="prepend">{{$t('Name')}}</template>
</el-input> </el-input>
<el-scrollbar class="scrollbar" wrap-class="wrap-x-hidden" <el-scrollbar class="scrollbar" wrap-class="wrap-x-hidden"
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
:property="property" :property="property"
:container="process" :container="process"
:key="key" :key="key"
:editable="editable"
/> />
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
</template> </template>
<script> <script>
import {mapState} from "vuex";
import NumberEditor from "./editors/NumberEditor"; import NumberEditor from "./editors/NumberEditor";
import StringEditor from "./editors/StringEditor"; import StringEditor from "./editors/StringEditor";
import EnumEditor from "./editors/EnumEditor"; import EnumEditor from "./editors/EnumEditor";
...@@ -46,6 +48,11 @@ ...@@ -46,6 +48,11 @@
process: null, process: null,
} }
}, },
computed: {
...mapState({
editable: state => state.behavior.editable,
}),
},
methods: { methods: {
edit(process) { edit(process) {
this.process = process; this.process = process;
......
<template> <template>
<editor-wrapper :value="value" :container="container" :property="property" :propertyName="propertyName"> <editor-wrapper :editable="editable" :value="value" :container="container" :property="property" :propertyName="propertyName">
<el-select :value="editValue" @input="onInput" :placeholder="property.default" class="el-select"> <el-select :disabled="!editable" :value="editValue" @input="onInput" :placeholder="property.default" class="el-select">
<el-option <el-option
v-for="(item, key) in assets" v-for="(item, key) in assets"
:key="key" :key="key"
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
export default { export default {
name: "AssetEditor", name: "AssetEditor",
components: {EditorWrapper,}, components: {EditorWrapper,},
props: ['value', 'container', 'property', 'propertyName'], props: ['value', 'container', 'property', 'propertyName', 'editable'],
computed: { computed: {
editValue() { editValue() {
return this.value === undefined ? this.property.default : this.value; return this.value === undefined ? this.property.default : this.value;
......
<template> <template>
<editor-wrapper :value="value" :container="container" :property="property" :propertyName="propertyName"> <editor-wrapper :editable="editable" :value="value" :container="container" :property="property" :propertyName="propertyName">
<el-switch :value="editValue" @input="onInput" <el-switch :disabled="!editable" :value="editValue" @input="onInput"
class="picker"></el-switch> class="picker"></el-switch>
</editor-wrapper> </editor-wrapper>
</template> </template>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
export default { export default {
name: "BooleanEditor", name: "BooleanEditor",
components: {EditorWrapper}, components: {EditorWrapper},
props: ['value', 'container', 'property', 'propertyName'], props: ['value', 'container', 'property', 'propertyName', 'editable'],
data() { data() {
return {} return {}
}, },
......
<template> <template>
<editor-wrapper :value="value" :container="container" :property="property" :propertyName="propertyName" class="color-editor-container"> <editor-wrapper :editable="editable" :value="value" :container="container" :property="property" :propertyName="propertyName" class="color-editor-container">
<el-color-picker <el-color-picker
:disabled="!editable"
class="picker" class="picker"
:value="editValue" :value="editValue"
@input="onInput" @input="onInput"
...@@ -16,7 +17,7 @@ ...@@ -16,7 +17,7 @@
export default { export default {
name: "ColorEditor", name: "ColorEditor",
components: {EditorWrapper,}, components: {EditorWrapper,},
props: ['value', 'container', 'property', 'propertyName'], props: ['value', 'container', 'property', 'propertyName', 'editable'],
data() { data() {
return { return {
predefineColors: [ predefineColors: [
......
...@@ -9,13 +9,14 @@ ...@@ -9,13 +9,14 @@
</template> </template>
<el-popover <el-popover
trigger="click" trigger="click"
:disabled="!editable"
> >
<div> <div>
<span>{{$t('Link to parent')}}: </span> <span>{{$t('Link to parent')}}: </span>
<el-switch :value="linked" @input="onChange"/> <el-switch :value="linked" @input="onChange"/>
</div> </div>
<el-link style="padding: 3px;" slot="reference" icon="el-icon-link" :underline="false" <el-link style="padding: 3px;" slot="reference" icon="el-icon-link" :underline="false"
:type="linked ? 'success' : 'default'"/> :type="linked ? 'success' : 'default'" :disabled="!editable"/>
</el-popover> </el-popover>
</el-form-item> </el-form-item>
</template> </template>
...@@ -33,6 +34,7 @@ ...@@ -33,6 +34,7 @@
value: {}, value: {},
container: {}, container: {},
propertyName: String, propertyName: String,
editable: Boolean,
contentWidth: { contentWidth: {
type: String, type: String,
default: '65%', default: '65%',
......
<template> <template>
<editor-wrapper :value="value" :container="container" :property="property" :propertyName="propertyName"> <editor-wrapper :editable="editable" :value="value" :container="container" :property="property" :propertyName="propertyName">
<el-select :value="editValue" @input="onInput" :placeholder="property.default" class="el-select"> <el-select :disabled="!editable" :value="editValue" @input="onInput" :placeholder="property.default" class="el-select">
<el-option <el-option
v-for="(item, key) in property.enum" v-for="(item, key) in property.enum"
:key="item" :key="item"
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
export default { export default {
name: "EnumEditor", name: "EnumEditor",
components: {EditorWrapper,}, components: {EditorWrapper,},
props: ['value', 'container', 'property', 'propertyName'], props: ['value', 'container', 'property', 'propertyName', 'editable'],
computed: { computed: {
editValue() { editValue() {
return this.value === undefined ? this.property.default : this.value; return this.value === undefined ? this.property.default : this.value;
......
<template> <template>
<editor-wrapper :value="value" :container="container" :property="property" :propertyName="propertyName"> <editor-wrapper :editable="editable" :value="value" :container="container" :property="property" :propertyName="propertyName">
<div style="display: flex;flex: 1;"> <div style="display: flex;flex: 1;">
<el-popover <el-popover
placement="top" placement="top"
...@@ -34,13 +34,13 @@ ...@@ -34,13 +34,13 @@
</el-button-group> </el-button-group>
</div> </div>
</div> </div>
<el-input clearable slot="reference" v-model="editValue" @change="onInput" placeholder="unset"> <el-input clearable slot="reference" v-model="editValue" @change="onInput" placeholder="unset" :readonly="!editable">
<template slot="prepend">node://</template> <template slot="prepend">node://</template>
</el-input> </el-input>
</el-popover> </el-popover>
<el-button-group> <el-button-group>
<el-button :icon="editButtonIcon" @click="onClickEdit"></el-button> <el-button :icon="editButtonIcon" @click="onClickEdit" :disabled="!editable"></el-button>
<el-button icon="el-icon-delete" @click="onClickClean"></el-button> <el-button icon="el-icon-delete" @click="onClickClean" :disabled="!editable"></el-button>
</el-button-group> </el-button-group>
</div> </div>
</editor-wrapper> </editor-wrapper>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
export default { export default {
name: "NodeSelectEditor", name: "NodeSelectEditor",
components: {EditorWrapper,}, components: {EditorWrapper,},
props: ['value', 'container', 'property', 'propertyName'], props: ['value', 'container', 'property', 'propertyName', 'editable'],
data() { data() {
return { return {
editValueOrigin: this.value, editValueOrigin: this.value,
......
<template> <template>
<editor-wrapper :value="value" :container="container" :property="property" :propertyName="propertyName"> <editor-wrapper :editable="editable" :value="value" :container="container" :property="property" :propertyName="propertyName">
<el-input-number :value="editValue" @input="onInput" controls-position="right" <el-input-number :disabled="!editable" :value="editValue" @input="onInput" controls-position="right"
:placeholder="defaultValue"></el-input-number> :placeholder="defaultValue"></el-input-number>
</editor-wrapper> </editor-wrapper>
</template> </template>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
export default { export default {
name: "NumberEditor", name: "NumberEditor",
components: {EditorWrapper,}, components: {EditorWrapper,},
props: ['value', 'container', 'property', 'propertyName'], props: ['value', 'container', 'property', 'propertyName', 'editable'],
computed: { computed: {
editValue() { editValue() {
return this.value === undefined ? this.property.default : this.value; return this.value === undefined ? this.property.default : this.value;
......
<template> <template>
<editor-wrapper :value="value" :container="container" :property="property" :propertyName="propertyName"> <editor-wrapper :editable="editable" :value="value" :container="container" :property="property" :propertyName="propertyName">
<div style="display: flex;flex: 1;"> <div style="display: flex;flex: 1;">
<el-popover <el-popover
placement="top" placement="top"
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
trigger="manual" trigger="manual"
width="400" width="400"
v-model="popoverVisible" v-model="popoverVisible"
:disabled="!editable"
> >
<div> <div>
<el-input <el-input
...@@ -25,12 +26,12 @@ ...@@ -25,12 +26,12 @@
</el-button-group> </el-button-group>
</div> </div>
</div> </div>
<el-input clearable slot="reference" :value="editValue" @input="onInput" @change="onChange" <el-input clearable slot="reference" :value="editValue" @input="onInput" @change="onChange" :readonly="!editable"
:placeholder="defaultValue"/> :placeholder="defaultValue"/>
</el-popover> </el-popover>
<el-button-group> <el-button-group>
<el-button :icon="editButtonIcon" @click="onClickEdit" ></el-button> <el-button :icon="editButtonIcon" @click="onClickEdit" :disabled="!editable"></el-button>
<el-button icon="el-icon-delete" @click="onClickClean" ></el-button> <el-button icon="el-icon-delete" @click="onClickClean" :disabled="!editable"></el-button>
</el-button-group> </el-button-group>
</div> </div>
</editor-wrapper> </editor-wrapper>
...@@ -43,7 +44,7 @@ ...@@ -43,7 +44,7 @@
export default { export default {
name: "StringEditor", name: "StringEditor",
components: {EditorWrapper,}, components: {EditorWrapper,},
props: ['value', 'container', 'property', 'propertyName'], props: ['value', 'container', 'property', 'propertyName', 'editable'],
data() { data() {
return { return {
editValueOrigin: this.value, editValueOrigin: this.value,
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
this.$emit('change'); this.$emit('change');
}, },
beforeClose(done) { beforeClose(done) {
this.$confirm(this.$t('Save this behavior before?'), this.$t('Alert'), { this.$confirm(this.$t('Save this behavior before'), this.$t('Alert'), {
showClose: false, showClose: false,
closeOnClickModal: false, closeOnClickModal: false,
closeOnPressEscape: false, closeOnPressEscape: false,
......
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