191 lines
5.7 KiB
HTML
191 lines
5.7 KiB
HTML
<template id="edit-node">
|
|
<v-form v-model="isFormValid" ref="dataForm" lazy-validation>
|
|
<v-row class="px-2" :class="{'pb-7': isMobile}">
|
|
<v-col cols="12" class=" pb-3">
|
|
<span class="inputLabel">GUID</span>
|
|
<v-text-field class="jh-v-input" dense filled single-line disabled label="GUID" v-model="node.id"></v-text-field>
|
|
</v-col>
|
|
<v-col cols="12" class=" pb-3">
|
|
<span class="inputLabel">名称</span>
|
|
<v-text-field class="jh-v-input" dense filled single-line label="名称" v-model="node.label"></v-text-field>
|
|
</v-col>
|
|
<v-col cols="12" class=" pb-3">
|
|
<span class="inputLabel">备注说明</span>
|
|
<v-text-field class="jh-v-input" dense filled single-line label="备注说明" v-model="node.Remark"></v-text-field>
|
|
</v-col>
|
|
<template v-if="!node.id.includes('start-') && !node.id.includes('end-')">
|
|
|
|
<v-col cols="12" class=" pb-3">
|
|
<span class="inputLabel">指派类型</span>
|
|
|
|
<v-select
|
|
:items="assignTypeList"
|
|
dense filled single-line
|
|
item-text="text"
|
|
color="success"
|
|
item-color="success"
|
|
item-value="value"
|
|
class="jh-v-input"
|
|
label="指派类型"
|
|
v-model="node.assignType"
|
|
></v-select>
|
|
</v-col>
|
|
<v-col cols="12" class=" pb-3">
|
|
<span class="inputLabel">指派</span>
|
|
<v-autocomplete
|
|
class="jh-v-input mr-2"
|
|
dense filled single-line clearable
|
|
:items="optionList"
|
|
item-text="text"
|
|
item-value="value"
|
|
:label="assignType"
|
|
:multiple="node.assignType === 'person'"
|
|
v-model="node.assignValue"
|
|
:disabled="!node.assignType">
|
|
</v-autocomplete>
|
|
</v-col>
|
|
<v-col cols="12" class=" pb-3" v-if="mode == 'serial'">
|
|
<span class="inputLabel">允许的操作(英文逗号分隔)</span>
|
|
<v-text-field class="jh-v-input" dense filled single-line label="允许的操作(英文逗号分隔)" v-model="node.lineTypeList"></v-text-field>
|
|
</v-col>
|
|
<v-col cols="12" class=" pb-3" >
|
|
<span class="inputLabel">可写模板</span>
|
|
<v-select
|
|
:items="tpl"
|
|
dense filled single-line
|
|
item-text="text"
|
|
color="success"
|
|
item-color="success"
|
|
item-value="value"
|
|
class="jh-v-input"
|
|
label="可写模板"
|
|
multiple
|
|
v-model="node.formId"
|
|
></v-select>
|
|
</v-col>
|
|
<v-col cols="12" class=" pb-3" >
|
|
<span class="inputLabel">隐藏模板</span>
|
|
<v-select
|
|
:items="tpl"
|
|
dense filled single-line
|
|
item-text="text"
|
|
item-value="value"
|
|
color="success"
|
|
item-color="success"
|
|
class="jh-v-input"
|
|
label="隐藏模板"
|
|
multiple
|
|
v-model="node.formIdHidden"
|
|
></v-select>
|
|
</v-col>
|
|
</template>
|
|
<template v-if="node.id.includes('end-')">
|
|
<v-col cols="12" class=" pb-3">
|
|
<span class="inputLabel">流程完成Hook</span>
|
|
<v-text-field class="jh-v-input mr-2" dense filled single-line label="流程完成Hook" v-model="node.finishHook"></v-text-field>
|
|
</v-col>
|
|
<v-col cols="12" class=" pb-3">
|
|
<span class="inputLabel">流程中断Hook</span>
|
|
<v-text-field class="jh-v-input mr-2" dense filled single-line label="流程中断Hook" v-model="node.interruptHook"></v-text-field>
|
|
</v-col>
|
|
</template>
|
|
</v-row>
|
|
</v-form>
|
|
</template>
|
|
|
|
<script>
|
|
Vue.component("edit-node", {
|
|
template: '#edit-node',
|
|
vuetify: new Vuetify(),
|
|
name: 'editNode',
|
|
props: {
|
|
lf: {
|
|
type: Object,
|
|
default: null
|
|
},
|
|
user: {
|
|
type: Array,
|
|
default: () => {
|
|
return []
|
|
}
|
|
},
|
|
group: {
|
|
type: Array,
|
|
default: () => {
|
|
return []
|
|
}
|
|
},
|
|
tpl: {
|
|
type: Array,
|
|
default: () => {
|
|
return []
|
|
}
|
|
},
|
|
mode: {
|
|
type: String,
|
|
default: 'serial'
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
isFormValid: true,
|
|
node: {
|
|
id: ''
|
|
},
|
|
typeList: [
|
|
{ Value: 'start', Text: '起点' },
|
|
{ Value: 'end', Text: '终点' },
|
|
{ Value: 'userTask', Text: '审核节点' },
|
|
{ Value: 'receiveTask', Text: '处理节点' }
|
|
],
|
|
assignTypeList: [{value: 'person', text: '用户'}, {value: 'group', text: '组'}]
|
|
}
|
|
},
|
|
watch: {
|
|
node: {
|
|
handler: function (node) {
|
|
this.lf.updateText(node.id, node.label);
|
|
this.lf.setProperties(node.id, node);
|
|
},
|
|
deep: true
|
|
},
|
|
tpl: {
|
|
handler: function (tpl) {
|
|
console.log('tpl change', tpl)
|
|
},
|
|
deep: true
|
|
}
|
|
},
|
|
computed: {
|
|
isMobile() {
|
|
return window.innerWidth < 600;
|
|
},
|
|
assignType() {
|
|
if (!this.node.assignType) return '请选择指派类型';
|
|
return this.assignTypeList.find(e => e.value === this.node.assignType).text;
|
|
},
|
|
optionList() {
|
|
if (!this.node.assignType) {
|
|
return []
|
|
}
|
|
if (this.node.assignType === 'person') {
|
|
return this.user
|
|
}
|
|
if (this.node.assignType === 'group') {
|
|
return this.group
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
init(node) {
|
|
this.node = node.properties;
|
|
},
|
|
}
|
|
})
|
|
</script>
|
|
<style>
|
|
.v-textarea textarea {
|
|
line-height: 1.2rem;
|
|
}
|
|
</style>
|