基础信息
This commit is contained in:
1 parent
b6334f796c
commit
61235c6ec2
2 files changed
+227
-47
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,48 +15,89 @@
|
|||||||
|
|
||||||
<div class="px-4 mt-2">
|
<div class="px-4 mt-2">
|
||||||
<v-form ref="form">
|
<v-form ref="form">
|
||||||
<!-- 流程信息 -->
|
<template>
|
||||||
<v-row>
|
<v-stepper non-linear flat outlined>
|
||||||
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
|
<v-stepper-header>
|
||||||
<span class="jh-input-label">流程名<span class="red--text text--accent-2 ml-1">*必填</span></span>
|
<v-stepper-step
|
||||||
<v-text-field
|
editable
|
||||||
class="jh-v-input mr-2" dense filled single-line color="success"
|
step="1"
|
||||||
v-model="formObj['workflowName']" :rules="validationRules.requireRules">
|
>
|
||||||
</v-text-field>
|
基础信息
|
||||||
</v-col>
|
</v-stepper-step>
|
||||||
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
|
<v-divider></v-divider>
|
||||||
<span class="jh-input-label">备注</span>
|
<v-stepper-step
|
||||||
<v-text-field
|
editable
|
||||||
class="jh-v-input mr-2" dense filled single-line color="success"
|
step="2"
|
||||||
v-model="formObj['workflowRemark']">
|
>
|
||||||
</v-text-field>
|
模板设置
|
||||||
</v-col>
|
</v-stepper-step>
|
||||||
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
|
<v-divider></v-divider>
|
||||||
<span class="jh-input-label">审批模式</span>
|
<v-stepper-step
|
||||||
<v-select
|
step="3"
|
||||||
class="jh-v-input mr-2" dense filled single-line color="success"
|
editable
|
||||||
v-model="formObj['mode']" :items="constantObj.modeList" />
|
>
|
||||||
</v-col>
|
流程设置
|
||||||
</v-row>
|
</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>
|
||||||
<div class="mt-8">
|
<!-- <v-card flat>
|
||||||
<div class="text-subtitle-2 mb-2">模板设置</div>
|
<v-card-text>
|
||||||
<tpl-form-design :form="formObj.workflowForm" v-if="!loading"></tpl-form-design>
|
<div class="mt-8">
|
||||||
</div>
|
<div class="text-subtitle-2 mb-2">流程设置</div>
|
||||||
|
<process-flow
|
||||||
<!-- 流程设置 -->
|
ref="processFlow"
|
||||||
<div class="mt-8">
|
:data="formObj.workflowConfig"
|
||||||
<div class="text-subtitle-2 mb-2">流程设置</div>
|
:user="constantObj.userList"
|
||||||
<process-flow
|
:group="constantObj.groupList"
|
||||||
ref="processFlow"
|
:tpl="constantObj.workflowFormList"
|
||||||
:data="formObj.workflowConfig"
|
:mode="formObj.mode">
|
||||||
:user="constantObj.userList"
|
</process-flow>
|
||||||
:group="constantObj.groupList"
|
</div>
|
||||||
:tpl="constantObj.workflowFormList"
|
</v-card-text>
|
||||||
:mode="formObj.mode">
|
</v-card> -->
|
||||||
</process-flow>
|
|
||||||
</div>
|
|
||||||
</v-form>
|
</v-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -74,6 +115,8 @@
|
|||||||
{% include 'component/flow/processFlow.html' %}
|
{% include 'component/flow/processFlow.html' %}
|
||||||
{% include 'component/flow/editLine.html' %}
|
{% include 'component/flow/editLine.html' %}
|
||||||
{% include 'component/flow/editNode.html' %}
|
{% include 'component/flow/editNode.html' %}
|
||||||
|
{% include 'component/workflowBasicInfo.html' %}
|
||||||
|
{% include 'component/common/dateTimePicker.html' %}
|
||||||
<script type="module">
|
<script type="module">
|
||||||
Vue.component("workflow-editor-drawer", {
|
Vue.component("workflow-editor-drawer", {
|
||||||
template: '#workflow-editor-drawer',
|
template: '#workflow-editor-drawer',
|
||||||
@@ -92,16 +135,14 @@ Vue.component("workflow-editor-drawer", {
|
|||||||
userList: [],
|
userList: [],
|
||||||
groupList: [],
|
groupList: [],
|
||||||
workflowFormList: [],
|
workflowFormList: [],
|
||||||
modeList: [
|
|
||||||
{text: '串行', value: 'serial'},
|
|
||||||
{text: '并行', value: 'parallel'},
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
formObj: {},
|
formObj: {},
|
||||||
submitUiActionId: 'createItem',
|
submitUiActionId: 'createItem',
|
||||||
loading: false,
|
loading: false,
|
||||||
isHelpPageDrawerShown: false,
|
isHelpPageDrawerShown: false,
|
||||||
formSubmitData: null
|
formSubmitData: null,
|
||||||
|
|
||||||
|
tab: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -156,13 +197,18 @@ Vue.component("workflow-editor-drawer", {
|
|||||||
if(item) {
|
if(item) {
|
||||||
this.submitUiActionId = 'updateItem';
|
this.submitUiActionId = 'updateItem';
|
||||||
let formObj = _.clone(item);
|
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.workflowConfig = formObj.workflowConfig ? JSON.parse(formObj.workflowConfig) : null;
|
||||||
formObj.workflowForm = formObj.workflowForm ? (typeof formObj.workflowForm == 'string'? JSON.parse(formObj.workflowForm): formObj.workflowForm) : [];
|
formObj.workflowForm = formObj.workflowForm ? (typeof formObj.workflowForm == 'string'? JSON.parse(formObj.workflowForm): formObj.workflowForm) : [];
|
||||||
formObj.mode = formObj.workflowConfig.mode || 'serial';
|
formObj.mode = formObj.workflowConfig.mode || 'serial';
|
||||||
this.formObj = formObj;
|
this.formObj = formObj;
|
||||||
} else {
|
} else {
|
||||||
this.submitUiActionId = 'createItem';
|
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.$refs.form.resetValidation();
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
Reference in new issue
Block a user