基础信息
This commit is contained in:
1 parent
b6334f796c
commit
61235c6ec2
2 files changed
+214
-34
No files matched your search
@@ -0,0 +1,134 @@
|
||||
<template id="workflow-basic-info">
|
||||
<v-row>
|
||||
<v-col cols="12" sm="12" md="12" xl="12">
|
||||
<span class="jh-input-label">流程名<span class="red--text text--accent-2 ml-1">*必填</span></span>
|
||||
<v-text-field
|
||||
class="jh-v-input mr-2" dense filled single-line color="success"
|
||||
v-model="basicInfo['workflowName']" :rules="validationRules.requireRules">
|
||||
</v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="12" md="12" xl="12">
|
||||
<span class="jh-input-label">模板图标</span>
|
||||
<v-menu
|
||||
:nudge-right="40"
|
||||
transition="scale-transition"
|
||||
offset-y
|
||||
min-width="auto"
|
||||
max-width="20%"
|
||||
max-height="60%"
|
||||
class="block"
|
||||
>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-text-field
|
||||
class="jh-v-input"
|
||||
dense
|
||||
single-line
|
||||
filled
|
||||
v-model="basicInfo['taskTemplateIcon']"
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
>
|
||||
<template #prepend-inner>
|
||||
<v-icon size="18" class="mr-1" color="green">mdi-{{basicInfo['taskTemplateIcon']}}</v-icon>
|
||||
</template>
|
||||
</v-text-field>
|
||||
</template>
|
||||
<v-card>
|
||||
<div class="d-flex flex-wrap">
|
||||
<div
|
||||
v-for="icon in materialDesignIcons"
|
||||
class="item-icon pa-1"
|
||||
@click="setIcon(icon)"
|
||||
>
|
||||
<v-icon size="18" class="mr-1" :color="basicInfo['taskTemplateIcon'] == icon ? 'green' : ''">mdi-{{icon}}</v-icon>
|
||||
</div>
|
||||
</div>
|
||||
</v-card>
|
||||
</v-menu>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" sm="12" md="12" xl="12" class="pb-1">
|
||||
<span class="jh-input-label">模板分组(支持输入自定义分组)</span>
|
||||
<v-combobox v-model="basicInfo['taskTemplateGroup']" :items="constantObj.taskTemplateGroup" class="jh-v-input" dense
|
||||
filled small hide-actions hide-controls hide-details>
|
||||
</v-combobox>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="12" md="12" xl="12">
|
||||
<span class="jh-input-label">备注</span>
|
||||
<v-text-field
|
||||
class="jh-v-input mr-2" dense filled single-line color="success"
|
||||
v-model="basicInfo['workflowRemark']">
|
||||
</v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="12" md="12" xl="12">
|
||||
<span class="jh-input-label">审批模式</span>
|
||||
<v-select
|
||||
class="jh-v-input mr-2" dense filled single-line color="success"
|
||||
v-model="basicInfo['mode']" :items="constantObj.modeList" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
<script type="module">
|
||||
Vue.component("workflow-basic-info", {
|
||||
template: '#workflow-basic-info',
|
||||
// vuetify: new Vuetify(),
|
||||
props: {
|
||||
basicInfo: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
taskTemplateIcon: 'account'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
validationRules: {
|
||||
requireRules: [
|
||||
v => !!v || '必填',
|
||||
],
|
||||
},
|
||||
constantObj: {
|
||||
modeList: [
|
||||
{text: '串行', value: 'serial'},
|
||||
{text: '并行', value: 'parallel'},
|
||||
],
|
||||
taskTemplateGroup: ['行政', '人事', '其他']
|
||||
},
|
||||
materialDesignIcons: [
|
||||
'account',
|
||||
'account-lock',
|
||||
'account-lock-open',
|
||||
'account-lock-open-outline',
|
||||
'account-lock-outline',
|
||||
'account-minus',
|
||||
'account-minus-outline',
|
||||
],
|
||||
// materialDesignIcons: [
|
||||
// '10001.png',
|
||||
// '10002.png',
|
||||
// '10003.png',
|
||||
// '10004.png',
|
||||
// ],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
default:
|
||||
console.error("[doUiAction] uiActionId not find", {uiActionId});
|
||||
break;
|
||||
}
|
||||
},
|
||||
setIcon(icon){
|
||||
this.$set(this.basicInfo, 'taskTemplateIcon', icon)
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -15,37 +15,76 @@
|
||||
|
||||
<div class="px-4 mt-2">
|
||||
<v-form ref="form">
|
||||
<!-- 流程信息 -->
|
||||
<v-row>
|
||||
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
|
||||
<span class="jh-input-label">流程名<span class="red--text text--accent-2 ml-1">*必填</span></span>
|
||||
<v-text-field
|
||||
class="jh-v-input mr-2" dense filled single-line color="success"
|
||||
v-model="formObj['workflowName']" :rules="validationRules.requireRules">
|
||||
</v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
|
||||
<span class="jh-input-label">备注</span>
|
||||
<v-text-field
|
||||
class="jh-v-input mr-2" dense filled single-line color="success"
|
||||
v-model="formObj['workflowRemark']">
|
||||
</v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
|
||||
<span class="jh-input-label">审批模式</span>
|
||||
<v-select
|
||||
class="jh-v-input mr-2" dense filled single-line color="success"
|
||||
v-model="formObj['mode']" :items="constantObj.modeList" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- 模板设置 -->
|
||||
<div class="mt-8">
|
||||
<div class="text-subtitle-2 mb-2">模板设置</div>
|
||||
<template>
|
||||
<v-stepper non-linear flat outlined>
|
||||
<v-stepper-header>
|
||||
<v-stepper-step
|
||||
editable
|
||||
step="1"
|
||||
>
|
||||
基础信息
|
||||
</v-stepper-step>
|
||||
<v-divider></v-divider>
|
||||
<v-stepper-step
|
||||
editable
|
||||
step="2"
|
||||
>
|
||||
模板设置
|
||||
</v-stepper-step>
|
||||
<v-divider></v-divider>
|
||||
<v-stepper-step
|
||||
step="3"
|
||||
editable
|
||||
>
|
||||
流程设置
|
||||
</v-stepper-step>
|
||||
</v-stepper-header>
|
||||
<v-stepper-items flat outlined>
|
||||
<v-stepper-content step="1">
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
<div class="mt-1">
|
||||
{{formObj.basicInfo}}
|
||||
<!-- <div class="text-subtitle-2 mb-2">基础信息</div> -->
|
||||
<workflow-basic-info :basic-info="formObj.basicInfo"></workflow-basic-info>
|
||||
</div>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-stepper-content>
|
||||
<v-stepper-content step="2">
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
<div class="mt-1">
|
||||
{{formObj.workflowForm}}
|
||||
<!-- <div class="text-subtitle-2 mb-2">模板设置</div> -->
|
||||
<tpl-form-design :form="formObj.workflowForm" v-if="!loading"></tpl-form-design>
|
||||
</div>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-stepper-content>
|
||||
<v-stepper-content step="3">
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
<div class="mt-1">
|
||||
<!-- <div class="text-subtitle-2 mb-2">流程设置</div> -->
|
||||
<process-flow
|
||||
ref="processFlow"
|
||||
:data="formObj.workflowConfig"
|
||||
:user="constantObj.userList"
|
||||
:group="constantObj.groupList"
|
||||
:tpl="constantObj.workflowFormList"
|
||||
:mode="formObj.mode">
|
||||
</process-flow>
|
||||
</div>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-stepper-content>
|
||||
</v-stepper-items>
|
||||
</v-stepper>
|
||||
|
||||
<!-- 流程设置 -->
|
||||
</template>
|
||||
<!-- <v-card flat>
|
||||
<v-card-text>
|
||||
<div class="mt-8">
|
||||
<div class="text-subtitle-2 mb-2">流程设置</div>
|
||||
<process-flow
|
||||
@@ -57,6 +96,8 @@
|
||||
:mode="formObj.mode">
|
||||
</process-flow>
|
||||
</div>
|
||||
</v-card-text>
|
||||
</v-card> -->
|
||||
</v-form>
|
||||
</div>
|
||||
|
||||
@@ -74,6 +115,8 @@
|
||||
{% include 'component/flow/processFlow.html' %}
|
||||
{% include 'component/flow/editLine.html' %}
|
||||
{% include 'component/flow/editNode.html' %}
|
||||
{% include 'component/workflowBasicInfo.html' %}
|
||||
{% include 'component/common/dateTimePicker.html' %}
|
||||
<script type="module">
|
||||
Vue.component("workflow-editor-drawer", {
|
||||
template: '#workflow-editor-drawer',
|
||||
@@ -92,16 +135,14 @@ Vue.component("workflow-editor-drawer", {
|
||||
userList: [],
|
||||
groupList: [],
|
||||
workflowFormList: [],
|
||||
modeList: [
|
||||
{text: '串行', value: 'serial'},
|
||||
{text: '并行', value: 'parallel'},
|
||||
]
|
||||
},
|
||||
formObj: {},
|
||||
submitUiActionId: 'createItem',
|
||||
loading: false,
|
||||
isHelpPageDrawerShown: false,
|
||||
formSubmitData: null
|
||||
formSubmitData: null,
|
||||
|
||||
tab: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -156,13 +197,18 @@ Vue.component("workflow-editor-drawer", {
|
||||
if(item) {
|
||||
this.submitUiActionId = 'updateItem';
|
||||
let formObj = _.clone(item);
|
||||
formObj.basicInfo = {
|
||||
workflowName: item.workflowName,
|
||||
workflowRemark: item.workflowRemark,
|
||||
mode: item.mode,
|
||||
}
|
||||
formObj.workflowConfig = formObj.workflowConfig ? JSON.parse(formObj.workflowConfig) : null;
|
||||
formObj.workflowForm = formObj.workflowForm ? (typeof formObj.workflowForm == 'string'? JSON.parse(formObj.workflowForm): formObj.workflowForm) : [];
|
||||
formObj.mode = formObj.workflowConfig.mode || 'serial';
|
||||
this.formObj = formObj;
|
||||
} else {
|
||||
this.submitUiActionId = 'createItem';
|
||||
this.formObj = {workflowForm: [], workflowConfig: {lineList: [], nodeList: []}, mode: 'serial'};
|
||||
this.formObj = {basicInfo: {}, workflowForm: [], workflowConfig: {lineList: [], nodeList: []}, mode: 'serial'};
|
||||
}
|
||||
this.$refs.form.resetValidation();
|
||||
this.loading = false;
|
||||
|
||||
Reference in new issue
Block a user