发起审批 && 清理代码
No files matched your search
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1,19 @@
|
|||||||
|
var materialDesignIcons = [
|
||||||
|
'/images/task-template-icon/10001.png',
|
||||||
|
'/images/task-template-icon/10002.png',
|
||||||
|
'/images/task-template-icon/10003.png',
|
||||||
|
'/images/task-template-icon/10004.png',
|
||||||
|
'/images/task-template-icon/10005.png',
|
||||||
|
'/images/task-template-icon/10006.png',
|
||||||
|
'/images/task-template-icon/10007.png',
|
||||||
|
'/images/task-template-icon/10008.png',
|
||||||
|
'/images/task-template-icon/10009.png',
|
||||||
|
'/images/task-template-icon/10010.png',
|
||||||
|
'/images/task-template-icon/10011.png',
|
||||||
|
'/images/task-template-icon/10012.png',
|
||||||
|
'/images/task-template-icon/10013.png',
|
||||||
|
'/images/task-template-icon/10014.png',
|
||||||
|
'/images/task-template-icon/10015.png',
|
||||||
|
'/images/task-template-icon/10016.png',
|
||||||
|
'/images/task-template-icon/10017.png',
|
||||||
|
]
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
const Service = require('egg').Service;
|
|
||||||
|
|
||||||
class HookService extends Service {
|
|
||||||
async executeFinishLine(actionData) {
|
|
||||||
const { taskId } = actionData;
|
|
||||||
// 根据任务ID找到绑定的业务数据,进行处理
|
|
||||||
console.log("审批结束", actionData)
|
|
||||||
}
|
|
||||||
async executeRejectLine(actionData) {
|
|
||||||
console.log("审批拒绝", actionData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = HookService;
|
|
||||||
@@ -8,15 +8,21 @@
|
|||||||
<!-- {{taskData.workflowForm}} -->
|
<!-- {{taskData.workflowForm}} -->
|
||||||
<!-- 表单 -->
|
<!-- 表单 -->
|
||||||
<v-row class="ma-4 mt-2">
|
<v-row class="ma-4 mt-2">
|
||||||
|
<template v-if="taskData.workflowForm && taskData.workflowForm.length > 0">
|
||||||
<v-col cols="12" v-for="(formItem, index) in taskData.workflowForm" :key="index" class="px-2 py-1 ma-0">
|
<v-col cols="12" v-for="(formItem, index) in taskData.workflowForm" :key="index" class="px-2 py-1 ma-0">
|
||||||
<span class="jh-input-label">{{ index + 1 }}. {{ formItem.statement }}<span v-show="formItem.isRequire" class="red--text ml-1">*</span></span>
|
<span class="jh-input-label">{{ index + 1 }}. {{ formItem.statement }}<span v-show="formItem.isRequire" class="red--text ml-1">*</span></span>
|
||||||
<form-component-list v-if="isDrawerShown" :form-item="formItem" :disabled='false' :readonly='false' @calc-workflow="getWorkflow" ></form-component-list>
|
<form-component-list v-if="isDrawerShown" :form-item="formItem" :disabled='false' :readonly='false' @calc-workflow="getWorkflow" ></form-component-list>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
暂无表单,请联系管理员!
|
||||||
|
</template>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-divider class="jh-divider"></v-divider>
|
<v-divider class="jh-divider"></v-divider>
|
||||||
<!-- 审批流 -->
|
<!-- 审批流 -->
|
||||||
<v-row class="ma-4 mt-2">
|
<v-row class="ma-4 mt-2">
|
||||||
<v-col cols="12" class="font-weight-bold pa-0 mx-0 my-2">审批流程</v-col>
|
<v-col cols="12" class="font-weight-bold pa-0 mx-0 my-2">审批流程</v-col>
|
||||||
|
<template v-if="curWorkflow.length > 0">
|
||||||
<v-col cols="12" class="pa-0 ma-0">
|
<v-col cols="12" class="pa-0 ma-0">
|
||||||
<div v-for="(node, nodeIndex) in curWorkflow">
|
<div v-for="(node, nodeIndex) in curWorkflow">
|
||||||
<div class="node-box">
|
<div class="node-box">
|
||||||
@@ -53,6 +59,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
暂无节点,请联系管理员!
|
||||||
|
</template>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row class="justify-end mx-0 my-8 px-4">
|
<v-row class="justify-end mx-0 my-8 px-4">
|
||||||
<!-- 抽屉操作按钮 -->
|
<!-- 抽屉操作按钮 -->
|
||||||
@@ -111,7 +121,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</v-card>
|
</v-card>
|
||||||
</template>
|
</template>
|
||||||
|
{% include 'component/tpl/tplFormDesign.html' %}
|
||||||
<script type="module">
|
<script type="module">
|
||||||
Vue.component("create-task-drawer", {
|
Vue.component("create-task-drawer", {
|
||||||
template: '#create-task-drawer',
|
template: '#create-task-drawer',
|
||||||
@@ -205,9 +215,9 @@ Vue.component("create-task-drawer", {
|
|||||||
let formObj = _.cloneDeep(item);
|
let formObj = _.cloneDeep(item);
|
||||||
formObj.workflowInfo = {
|
formObj.workflowInfo = {
|
||||||
workflowName: item.workflowName,
|
workflowName: item.workflowName,
|
||||||
...JSON.parse(item.workflowInfo),
|
...item.workflowInfo,
|
||||||
}
|
}
|
||||||
formObj.workflowConfig = formObj.workflowConfig ? JSON.parse(formObj.workflowConfig) : null;
|
formObj.workflowConfig = formObj.workflowConfig ? 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.workflowForm.forEach(f => f.answer = []) // 兼容多选
|
formObj.workflowForm.forEach(f => f.answer = []) // 兼容多选
|
||||||
this.defaultWorkflowConfig = _.cloneDeep(formObj.workflowConfig);
|
this.defaultWorkflowConfig = _.cloneDeep(formObj.workflowConfig);
|
||||||
|
|||||||
@@ -119,6 +119,9 @@
|
|||||||
<script src="/<$ ctx.app.config.appId $>/public/logicflow/extension/lib/Popup.js"></script>
|
<script src="/<$ ctx.app.config.appId $>/public/logicflow/extension/lib/Popup.js"></script>
|
||||||
<!-- <<<<<<<<<<<<< 加载logicflow组件 -->
|
<!-- <<<<<<<<<<<<< 加载logicflow组件 -->
|
||||||
|
|
||||||
|
{% include 'component/flow/editLine.html' %}
|
||||||
|
{% include 'component/flow/editNode.html' %}
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
Vue.component("process-flow", {
|
Vue.component("process-flow", {
|
||||||
template: '#process-flow',
|
template: '#process-flow',
|
||||||
|
|||||||
@@ -1,170 +0,0 @@
|
|||||||
<template id="form-item-list-review">
|
|
||||||
<div class="form-item-list-review-container">
|
|
||||||
<!-- 单选 -->
|
|
||||||
<template v-if="formItem.type === 'single'">
|
|
||||||
<span class="jh-input-label">{{ formItem.statement }}</span>
|
|
||||||
<v-radio-group readonly v-model="formItem.user.answer">
|
|
||||||
<v-radio
|
|
||||||
v-for="(option, optionIndex) in formItem.optionList" :key="optionIndex"
|
|
||||||
:label="assignmentOptionKey[optionIndex]+': '+option" :value="option"></v-radio>
|
|
||||||
</v-radio-group>
|
|
||||||
</template>
|
|
||||||
<!-- 多选和填空 -->
|
|
||||||
<template v-if="['fillBlank', 'multiple'].includes(formItem.type)">
|
|
||||||
<span class="jh-input-label" style="white-space:nowrap !important;" v-if="formItem.type === 'fillBlank'">
|
|
||||||
<template v-for="(blank, blankIndex) in formItem.statement" :key="blankIndex">
|
|
||||||
<span class="fill-blank fill-blank-input" v-if="blank.type === 'input'">{{
|
|
||||||
formItem.user.answer[blank.id] }}</span>
|
|
||||||
<span v-else>{{ blank.value }}</span>
|
|
||||||
</template>
|
|
||||||
</span>
|
|
||||||
<span class="jh-input-label" v-else>{{ formItem.statement }}</span>
|
|
||||||
<template v-if="formItem.type === 'multiple'">
|
|
||||||
<template v-for="(option, optionIndex) in formItem.optionList" :key="optionIndex">
|
|
||||||
<v-checkbox
|
|
||||||
readonly style="margin-top: 0px;" v-model="formItem.user.answer" :value="option"
|
|
||||||
:label="assignmentOptionKey[optionIndex]+': '+option" hide-details color="red"></v-checkbox>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
<!-- 多行文本,问答和markdown -->
|
|
||||||
<template v-if="['textarea', 'questionAnswer', 'markdown'].includes(formItem.type)">
|
|
||||||
<span class="jh-input-label">{{ formItem.statement }}</span>
|
|
||||||
<template v-if="formItem.type === 'markdown'" cols="12">
|
|
||||||
<md2html :article-content="formItem.user.answer" @complete="isContentLoading = false"></md2html>
|
|
||||||
</template>
|
|
||||||
<template v-else cols="12">
|
|
||||||
<v-textarea readonly dense filled single-line v-model="formItem.user.answer" :rows="5" auto-grow />
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
<!-- 题目组 -->
|
|
||||||
<template v-if="formItem.type === 'questionGroup'">
|
|
||||||
<span class="jh-input-label">{{ formItem.statement }}</span>
|
|
||||||
<md2html :article-content="formItem.markdownContent" @complete="isContentLoading = false">
|
|
||||||
</md2html>
|
|
||||||
<form-item-list-review
|
|
||||||
:form-item-list="formItem.itemList" :review-data="reviewData"
|
|
||||||
:answer-check="answerCheck" />
|
|
||||||
</template>
|
|
||||||
<!-- 纯标题 -->
|
|
||||||
<v-list-item-content v-if="formItem.type === 'displayText'">
|
|
||||||
<p>{{formItem.statement}}</p>
|
|
||||||
</v-list-item-content>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
Vue.component("form-item-list-review", {
|
|
||||||
template: '#form-item-list-review',
|
|
||||||
vuetify: new Vuetify(),
|
|
||||||
name: 'form-item-list-review',
|
|
||||||
props: {
|
|
||||||
formItem: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
reviewData: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
answerCheck: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data: () => ({
|
|
||||||
overlay: false,
|
|
||||||
imgSrc: '',
|
|
||||||
assignmentOptionKey: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'],
|
|
||||||
}),
|
|
||||||
computed: {
|
|
||||||
isMobile() {
|
|
||||||
return window.innerWidth < 500;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
destroyed() {
|
|
||||||
},
|
|
||||||
watch: {},
|
|
||||||
created() {
|
|
||||||
},
|
|
||||||
methods: {}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.form-item-list-review-container {
|
|
||||||
background-color: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-item-list-review-container .jh-input-label {
|
|
||||||
white-space: pre-line;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 16px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-item-list-review-container audio {
|
|
||||||
height: 35px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-item-list-review-container .audio-box {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*.form-item-list-review-container .submit-handle-box {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.form-item-list-review-container .submit-handle-box::after {
|
|
||||||
position: absolute;
|
|
||||||
width: 1px;
|
|
||||||
content: '';
|
|
||||||
background-color: #e0e0e0;
|
|
||||||
height: 200px;
|
|
||||||
top: auto;
|
|
||||||
bottom: auto;
|
|
||||||
}*/
|
|
||||||
.student-remark textarea {
|
|
||||||
color: rgb(0, 172, 37) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fill-blank {
|
|
||||||
display: inline-block;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.fill-blank-input {
|
|
||||||
padding-left: 10px;
|
|
||||||
padding-right: 10px;
|
|
||||||
border-bottom: 2px solid gray;
|
|
||||||
margin-left: 5px;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-close {
|
|
||||||
position: fixed;
|
|
||||||
right: 10px;
|
|
||||||
top: 5px;
|
|
||||||
z-index: 50000
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-download {
|
|
||||||
position: fixed;
|
|
||||||
right: 50px;
|
|
||||||
top: 5px;
|
|
||||||
z-index: 50000
|
|
||||||
}
|
|
||||||
|
|
||||||
.file-prev-wrap {
|
|
||||||
overflow: auto;
|
|
||||||
max-width: 80vw;
|
|
||||||
max-height: 90vh;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -4,28 +4,11 @@
|
|||||||
<form-item-list-generator
|
<form-item-list-generator
|
||||||
:form-item-list="form"
|
:form-item-list="form"
|
||||||
ref="formItemListGenerator"/>
|
ref="formItemListGenerator"/>
|
||||||
|
|
||||||
<!-- <v-navigation-drawer v-model="formItemListPreviewDrawer" fixed temporary bottom width="90%">
|
|
||||||
<v-toolbar dark class="blue darken-3" dense>
|
|
||||||
<v-toolbar-title>表单预览</v-toolbar-title>
|
|
||||||
<v-spacer></v-spacer>
|
|
||||||
<v-toolbar-items>
|
|
||||||
<v-btn dark text @click="formItemListPreviewDrawer = false">关闭</v-btn>
|
|
||||||
</v-toolbar-items>
|
|
||||||
</v-toolbar>
|
|
||||||
<v-card class="mt-3">
|
|
||||||
<v-row>
|
|
||||||
<v-col cols="12" md="6" class="pa-0">
|
|
||||||
<codemirror v-model="JSON.stringify(formItemList, null, 4)" :options="codemirrorOptions"/>
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="12" md="6">
|
|
||||||
<form-item-list-render :form-item-list="formItemList"></form-item-list-render>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-card>
|
|
||||||
</v-navigation-drawer> -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
{% include 'component/tpl/formItemListGenerator.html' %}
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
Vue.component("tpl-form-design", {
|
Vue.component("tpl-form-design", {
|
||||||
template: "#tpl-form-design",
|
template: "#tpl-form-design",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
transition="scale-transition"
|
transition="scale-transition"
|
||||||
offset-y
|
offset-y
|
||||||
min-width="auto"
|
min-width="auto"
|
||||||
max-width="20%"
|
max-width="75%"
|
||||||
max-height="60%"
|
max-height="60%"
|
||||||
class="block"
|
class="block"
|
||||||
>
|
>
|
||||||
@@ -30,7 +30,14 @@
|
|||||||
v-on="on"
|
v-on="on"
|
||||||
>
|
>
|
||||||
<template #prepend-inner>
|
<template #prepend-inner>
|
||||||
<v-icon size="18" class="mr-1" color="green">mdi-{{workflowInfo['taskTemplateIcon']}}</v-icon>
|
<template v-if="workflowInfo.taskTemplateIcon">
|
||||||
|
<v-img
|
||||||
|
max-height="30"
|
||||||
|
max-width="30"
|
||||||
|
:src="`/<$ ctx.app.config.appId $>/public${workflowInfo.taskTemplateIcon}`"
|
||||||
|
></v-img>
|
||||||
|
</template>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</v-text-field>
|
</v-text-field>
|
||||||
</template>
|
</template>
|
||||||
@@ -38,10 +45,14 @@
|
|||||||
<div class="d-flex flex-wrap">
|
<div class="d-flex flex-wrap">
|
||||||
<div
|
<div
|
||||||
v-for="icon in materialDesignIcons"
|
v-for="icon in materialDesignIcons"
|
||||||
class="item-icon pa-1"
|
:class="`item-icon pa-1 ${workflowInfo.taskTemplateIcon == icon && 'green'}`"
|
||||||
@click="setIcon(icon)"
|
@click="workflowInfo.taskTemplateIcon = icon"
|
||||||
>
|
>
|
||||||
<v-icon size="18" class="mr-1" :color="workflowInfo['taskTemplateIcon'] == icon ? 'green' : ''">mdi-{{icon}}</v-icon>
|
<v-img
|
||||||
|
max-height="30"
|
||||||
|
max-width="30"
|
||||||
|
:src="`/<$ ctx.app.config.appId $>/public${icon}`"
|
||||||
|
></v-img>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</v-card>
|
</v-card>
|
||||||
@@ -54,16 +65,19 @@
|
|||||||
filled small hide-actions hide-controls hide-details>
|
filled small hide-actions hide-controls hide-details>
|
||||||
</v-combobox>
|
</v-combobox>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" sm="12" md="12" xl="12">
|
<!-- <v-col cols="12" sm="12" md="12" xl="12">
|
||||||
<span class="jh-input-label">备注</span>
|
<span class="jh-input-label">备注</span>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
class="jh-v-input mr-2" dense filled single-line color="success"
|
class="jh-v-input mr-2" dense filled single-line color="success"
|
||||||
v-model="workflowInfo['workflowRemark']">
|
v-model="workflowInfo['workflowRemark']">
|
||||||
</v-text-field>
|
</v-text-field>
|
||||||
</v-col>
|
</v-col> -->
|
||||||
</v-row>
|
</v-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script src="/<$ ctx.app.config.appId $>/public/task-template-icons.js"></script>
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
Vue.component("workflow-basic-info", {
|
Vue.component("workflow-basic-info", {
|
||||||
template: '#workflow-basic-info',
|
template: '#workflow-basic-info',
|
||||||
@@ -86,27 +100,9 @@ Vue.component("workflow-basic-info", {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
constantObj: {
|
constantObj: {
|
||||||
modeList: [
|
|
||||||
{text: '串行', value: 'serial'},
|
|
||||||
{text: '并行', value: 'parallel'},
|
|
||||||
],
|
|
||||||
taskTemplateGroup: ['行政', '人事', '其他']
|
taskTemplateGroup: ['行政', '人事', '其他']
|
||||||
},
|
},
|
||||||
materialDesignIcons: [
|
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: {
|
watch: {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<div class="px-4 mt-2">
|
<div class="px-4 mt-2">
|
||||||
<v-form ref="form">
|
<v-form ref="form">
|
||||||
<template>
|
<template>
|
||||||
<v-stepper non-linear flat outlined>
|
<v-stepper non-linear flat outlined v-model="step">
|
||||||
<v-stepper-header>
|
<v-stepper-header>
|
||||||
<v-stepper-step
|
<v-stepper-step
|
||||||
editable
|
editable
|
||||||
@@ -94,10 +94,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
{% include 'component/tpl/tplFormDesign.html' %}
|
{% include 'component/tpl/tplFormDesign.html' %}
|
||||||
{% include 'component/tpl/formItemListGenerator.html' %}
|
|
||||||
{% include 'component/flow/processFlow.html' %}
|
{% include 'component/flow/processFlow.html' %}
|
||||||
{% include 'component/flow/editLine.html' %}
|
|
||||||
{% include 'component/flow/editNode.html' %}
|
|
||||||
{% include 'component/workflowBasicInfo.html' %}
|
{% include 'component/workflowBasicInfo.html' %}
|
||||||
<script type="module">
|
<script type="module">
|
||||||
Vue.component("workflow-editor-drawer", {
|
Vue.component("workflow-editor-drawer", {
|
||||||
@@ -125,7 +122,7 @@ Vue.component("workflow-editor-drawer", {
|
|||||||
isHelpPageDrawerShown: false,
|
isHelpPageDrawerShown: false,
|
||||||
formSubmitData: null,
|
formSubmitData: null,
|
||||||
|
|
||||||
tab: null
|
step: 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -144,7 +141,6 @@ Vue.component("workflow-editor-drawer", {
|
|||||||
switch (uiActionId) {
|
switch (uiActionId) {
|
||||||
case 'open':
|
case 'open':
|
||||||
await this.prepareFormObj(uiActionData);
|
await this.prepareFormObj(uiActionData);
|
||||||
// await this.buildConstantWorkflowFormList();
|
|
||||||
await this.buildConstantWorkflowConfig();
|
await this.buildConstantWorkflowConfig();
|
||||||
await this.openDrawer();
|
await this.openDrawer();
|
||||||
break;
|
break;
|
||||||
@@ -202,6 +198,7 @@ Vue.component("workflow-editor-drawer", {
|
|||||||
|
|
||||||
async closeDrawer() {
|
async closeDrawer() {
|
||||||
this.$refs.processFlow.setDisplayMode(1)
|
this.$refs.processFlow.setDisplayMode(1)
|
||||||
|
this.step = 1
|
||||||
this.isDrawerShown = false;
|
this.isDrawerShown = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -261,16 +258,6 @@ Vue.component("workflow-editor-drawer", {
|
|||||||
},
|
},
|
||||||
// -- <<<<<<<<<<<<< 获取数据 --------------------
|
// -- <<<<<<<<<<<<< 获取数据 --------------------
|
||||||
// -- constantObj 数据构建 >>>>>>>>>>> ---------------
|
// -- constantObj 数据构建 >>>>>>>>>>> ---------------
|
||||||
buildConstantWorkflowFormList() {
|
|
||||||
if (!this.formObj.workflowForm) return;
|
|
||||||
this.constantObj.workflowFormList = [];
|
|
||||||
for (const item of this.formObj.workflowForm) {
|
|
||||||
this.constantObj.workflowFormList.push({
|
|
||||||
text: item.statement,
|
|
||||||
value: item.id
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
buildConstantWorkflowConfig() {
|
buildConstantWorkflowConfig() {
|
||||||
if (!this.formObj.workflowConfig) return;
|
if (!this.formObj.workflowConfig) return;
|
||||||
|
|||||||
@@ -1,387 +0,0 @@
|
|||||||
{% extends 'template/jhTemplateV4.html'%}
|
|
||||||
|
|
||||||
{% block vueTemplate %}
|
|
||||||
|
|
||||||
<script type="text/html" id="app-template">
|
|
||||||
<div>
|
|
||||||
<v-app mobile-breakpoint="sm">
|
|
||||||
<jh-menu />
|
|
||||||
<v-main class="mt-15">
|
|
||||||
<!-- 头部内容 >>>>>>>>>>>>> -->
|
|
||||||
<div class="jh-page-second-bar px-8">
|
|
||||||
<div class="pt-3 text-h7 font-weight-bold">申请审批
|
|
||||||
<!-- 帮助页按钮 -->
|
|
||||||
<v-icon @click="isHelpPageDrawerShown = true" color="success" small>mdi-help-circle-outline</v-icon>
|
|
||||||
</div>
|
|
||||||
<v-breadcrumbs class="pb-3 pt-0 px-0" :items="breadcrumbs" divider="-"></v-breadcrumbs>
|
|
||||||
</div>
|
|
||||||
<!-- <<<<<<<<<<<<< 头部内容 -->
|
|
||||||
|
|
||||||
<div class="jh-page-body-container px-8">
|
|
||||||
<!-- 页面内容 >>>>>>>>>>>>> -->
|
|
||||||
<v-card class="rounded-lg mb-4">
|
|
||||||
<v-row class="ma-0 py-0 px-4">
|
|
||||||
<!--新增按钮-->
|
|
||||||
<v-col cols="12" xs="4" sm="4" md="4" xl="4" class="pl-0">
|
|
||||||
<!-- <v-btn color="success" small class="elevation-0 mr-2"
|
|
||||||
@click="doUiAction('jumpToCreateWorkflow')">新增</v-btn> -->
|
|
||||||
</v-col>
|
|
||||||
<v-spacer></v-spacer>
|
|
||||||
<!--搜索-->
|
|
||||||
<v-col cols="12" xs="8" sm="4" md="3" xl="2" class="px-0">
|
|
||||||
<v-text-field v-model="searchInput" color="success" prefix="搜索:" class="jh-v-input" dense filled single-line hide-details></v-text-field>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
<!--表格-->
|
|
||||||
<v-data-table
|
|
||||||
:headers="headers"
|
|
||||||
:items="tableData"
|
|
||||||
:search="searchInput"
|
|
||||||
:footer-props="{ itemsPerPageOptions: [20, 50, -1], itemsPerPageText: '每页行数', itemsPerPageAllText: '所有'}"
|
|
||||||
:items-per-page="-1"
|
|
||||||
mobile-breakpoint="0"
|
|
||||||
:loading="isTableLoading"
|
|
||||||
:class="{'zebraLine': isTableZebraLineShown }"
|
|
||||||
checkbox-color="success"
|
|
||||||
fixed-header
|
|
||||||
class="jh-fixed-table-height elevation-0 mt-0 mb-xs-4">
|
|
||||||
<!--表格行操作按钮-->
|
|
||||||
<template v-slot:item.action="{ item }">
|
|
||||||
<span role="button" class="success--text jh-font-size-3 pr-2"
|
|
||||||
@click="doUiAction('startCreateWorkflow', item)">
|
|
||||||
<v-icon size="16" class="success--text">mdi-note-edit-outline</v-icon>申请
|
|
||||||
</span>
|
|
||||||
<!-- <span role="button" class="success--text jh-font-size-3 pr-2"
|
|
||||||
@click="doUiAction('jumpUpdateWorkflow', item)">
|
|
||||||
<v-icon size="16" class="success--text">mdi-note-edit-outline</v-icon>编辑
|
|
||||||
</span> -->
|
|
||||||
</template>
|
|
||||||
<!--表格底部右侧功能按钮-->
|
|
||||||
<template v-slot:footer.prepend>
|
|
||||||
<v-menu top offset-y :close-on-content-click="false">
|
|
||||||
<template v-slot:activator="{on, attrs}">
|
|
||||||
<v-btn icon v-bind="attrs" v-on="on">
|
|
||||||
<v-icon>mdi-menu</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
<v-switch v-model="isTableZebraLineShown" hide-details class="mx-3 my-2" label="显示斑马纹" dense flat></v-switch>
|
|
||||||
</v-menu>
|
|
||||||
</template>
|
|
||||||
<!--没有数据-->
|
|
||||||
<template v-slot:loading>
|
|
||||||
<div class="jh-no-data">数据加载中</div>
|
|
||||||
</template>
|
|
||||||
<template v-slot:no-data>
|
|
||||||
<div class="jh-no-data">暂无数据</div>
|
|
||||||
</template>
|
|
||||||
<template v-slot:no-results>
|
|
||||||
<div class="jh-no-data">暂无数据</div>
|
|
||||||
</template>
|
|
||||||
<!--表格底部右侧分页-->
|
|
||||||
<template v-slot:footer.page-text="pagination">
|
|
||||||
<span>{{pagination.pageStart}}-{{pagination.pageStop}}</span>
|
|
||||||
<span class="ml-1">共{{pagination.itemsLength}}条</span>
|
|
||||||
</template>
|
|
||||||
</v-data-table>
|
|
||||||
</v-card>
|
|
||||||
<!-- <<<<<<<<<<<<< 页面内容 -->
|
|
||||||
</div>
|
|
||||||
<!-- <<<<<<<<<<<<< 创建审批抽屉 -->
|
|
||||||
<v-navigation-drawer v-model="isCreateDrawerShown" v-click-outside="drawerClickOutside" fixed temporary right width="80%"
|
|
||||||
class="elevation-24">
|
|
||||||
<v-form v-if="isCreateDrawerShown" ref="createForm" lazy-validation>
|
|
||||||
<!--抽屉标题-->
|
|
||||||
<v-row>
|
|
||||||
<span class="title pa-6 pl-8">创建审批</span>
|
|
||||||
</v-row>
|
|
||||||
<!--抽屉表单主体-->
|
|
||||||
<v-row class="mt-0 px-6">
|
|
||||||
<v-col cols="12" sm="12" md="4" v-for="(item, index) in createFormList" :key="index">
|
|
||||||
<form-item :form-item="item"></form-item>
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="12" sm="12" md="12">
|
|
||||||
<span class="jh-input-label">审批流程 - 添加审批人</span>
|
|
||||||
<v-row v-for="node in workflowPersonList">
|
|
||||||
<v-col cols="2">
|
|
||||||
<v-text-field class="jh-v-input " dense filled single-line hide-details v-model="node.label" disabled></v-text-field>
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="4">
|
|
||||||
<v-autocomplete
|
|
||||||
class="jh-v-input mr-2"
|
|
||||||
dense filled single-line clearable
|
|
||||||
:items="userList"
|
|
||||||
item-text="username"
|
|
||||||
item-value="userId"
|
|
||||||
multiple
|
|
||||||
hide-details
|
|
||||||
:rules="validationRules.requireRules"
|
|
||||||
v-model="node.assignValue">
|
|
||||||
|
|
||||||
</v-autocomplete>
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="4">
|
|
||||||
<v-checkbox dense filled v-model="node.isNeedAllApproval" label="是否需要所有人审批" hide-details ></v-checkbox>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
</v-row>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
<!--抽屉操作按钮-->
|
|
||||||
<v-row class="justify-end mx-0 mt-8 px-6">
|
|
||||||
<v-btn color="success" @click="doUiAction('createWorkflow')" small>保存</v-btn>
|
|
||||||
<v-btn class="ml-2" @click="isCreateDrawerShown = false" small>取消</v-btn>
|
|
||||||
</v-row>
|
|
||||||
</v-form>
|
|
||||||
<!--抽屉关闭按钮-->
|
|
||||||
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
|
|
||||||
@click="isCreateDrawerShown = false">
|
|
||||||
<v-icon>mdi-close</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</v-navigation-drawer>
|
|
||||||
<!-- 创建审批抽屉 >>>>>>>>>>>>> -->
|
|
||||||
|
|
||||||
<!-- 帮助页抽屉 >>>>>>>>>>>>> -->
|
|
||||||
<v-navigation-drawer v-model="isHelpPageDrawerShown" v-click-outside="drawerClickOutside" fixed temporary right width="80%"
|
|
||||||
class="elevation-24">
|
|
||||||
<iframe style="border: 0" :src="`/${appInfo.appId}/pageDoc#workflowManagement.md`" width="100%"
|
|
||||||
height="100%"></iframe>
|
|
||||||
|
|
||||||
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
|
|
||||||
@click="isHelpPageDrawerShown = false">
|
|
||||||
<v-icon>mdi-close</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</v-navigation-drawer>
|
|
||||||
<!-- <<<<<<<<<<<<< 帮助页抽屉 -->
|
|
||||||
|
|
||||||
</v-main>
|
|
||||||
</v-app>
|
|
||||||
|
|
||||||
<jh-toast />
|
|
||||||
<jh-mask />
|
|
||||||
<jh-confirm-dialog />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="app">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block vueScript %}
|
|
||||||
|
|
||||||
<!-- 加载页面组件 >>>>>>>>>>>>> -->
|
|
||||||
{% include 'component/formItem.html' %}
|
|
||||||
<!-- <<<<<<<<<<<<< 加载页面组件 -->
|
|
||||||
|
|
||||||
<script type="module">
|
|
||||||
new Vue({
|
|
||||||
el: '#app',
|
|
||||||
template: '#app-template',
|
|
||||||
vueComponent: 'page',
|
|
||||||
vuetify: new Vuetify(),
|
|
||||||
data: {
|
|
||||||
// 面包屑
|
|
||||||
breadcrumbs: [
|
|
||||||
{
|
|
||||||
text: '首页',
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '申请审批',
|
|
||||||
disabled: true,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
validationRules: {
|
|
||||||
requireRules: [
|
|
||||||
v => !!v || 'This is required',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
isTableLoading: false,
|
|
||||||
userList: [],
|
|
||||||
tableData: [],
|
|
||||||
headers: [
|
|
||||||
{ text: '操作', value: 'action', sortable: false, width: 130, class: 'fixed', cellClass: 'fixed' },
|
|
||||||
{ text: '流程ID', value: 'workflowId' },
|
|
||||||
{ text: '流程名称', value: 'workflowName' },
|
|
||||||
],
|
|
||||||
searchInput: '',
|
|
||||||
isHelpPageDrawerShown: false,
|
|
||||||
isTableZebraLineShown: true,
|
|
||||||
|
|
||||||
isCreateDrawerShown: false,
|
|
||||||
createFormList: [],
|
|
||||||
createItem: {
|
|
||||||
group: '',
|
|
||||||
},
|
|
||||||
workflowPersonList: [],
|
|
||||||
},
|
|
||||||
watch: {},
|
|
||||||
created() {
|
|
||||||
this.getTableData();
|
|
||||||
this.getUserList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async doUiAction(uiActionId, uiActionData) {
|
|
||||||
switch (uiActionId) {
|
|
||||||
case 'getTableData':
|
|
||||||
await this.getTableData();
|
|
||||||
break;
|
|
||||||
case 'startCreateWorkflow':
|
|
||||||
await this.prepareCreateFormData(uiActionData);
|
|
||||||
await this.openCreateDrawer();
|
|
||||||
break;
|
|
||||||
case 'createWorkflow':
|
|
||||||
await this.prepareCreateValidate();
|
|
||||||
await this.confirmCreateWorkDialog();
|
|
||||||
await this.prepareDoWorkItem();
|
|
||||||
await this.doCreateWork();
|
|
||||||
await this.closeCreateDrawer();
|
|
||||||
break;
|
|
||||||
case 'jumpToCreateWorkflow':
|
|
||||||
await this.jumpToCreateWorkflow();
|
|
||||||
break;
|
|
||||||
case 'jumpUpdateWorkflow':
|
|
||||||
await this.jumpUpdateWorkflow(uiActionData);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.error("[doUiAction] uiActionId not find", { uiActionId });
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async getTableData() {
|
|
||||||
this.isTableLoading = true;
|
|
||||||
const result = await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'workflowManagement',
|
|
||||||
actionId: 'selectItemList',
|
|
||||||
actionData: {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const rows = result.data.appData.resultData.rows;
|
|
||||||
rows.forEach(row => {
|
|
||||||
const workflowNodeList = JSON.parse(row.workflowConfig).nodeList;
|
|
||||||
workflowNodeList.forEach(node => {
|
|
||||||
node.isNeedAllApproval = true;
|
|
||||||
});
|
|
||||||
row.workflowPersonList = workflowNodeList.filter(node => node.id.includes('userTask-'));
|
|
||||||
row.workflowForm = JSON.parse(row.workflowForm);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.tableData = rows;
|
|
||||||
this.isTableLoading = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
async getUserList() {
|
|
||||||
const result = await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'workflowManagement',
|
|
||||||
actionId: 'selectUserList',
|
|
||||||
actionData: {},
|
|
||||||
orderBy: [{ column: 'userId', order: 'asc' }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const userList = result.data.appData.resultData.rows;
|
|
||||||
this.userList = userList;
|
|
||||||
},
|
|
||||||
|
|
||||||
// ---------- <<<<<<<<<< 申请项目审核 --------
|
|
||||||
async prepareCreateFormData({ workflowForm, workflowPersonList, workflowId }) {
|
|
||||||
this.createFormList = workflowForm;
|
|
||||||
this.workflowPersonList = workflowPersonList;
|
|
||||||
this.createItem.workflowId = workflowId;
|
|
||||||
},
|
|
||||||
|
|
||||||
async openCreateDrawer() {
|
|
||||||
this.isCreateDrawerShown = true;
|
|
||||||
},
|
|
||||||
async prepareCreateValidate() {
|
|
||||||
if (!await this.$refs.createForm.validate()) {
|
|
||||||
throw new Error("请完善表单信息")
|
|
||||||
}
|
|
||||||
|
|
||||||
this.workflowPersonList.forEach(workflowPerson => {
|
|
||||||
workflowPerson.assignValue = workflowPerson.assignValue || [];
|
|
||||||
workflowPerson.assignValue = workflowPerson.assignValue.filter(userId => this.userList.find(u => u.userId === userId));
|
|
||||||
workflowPerson.origin.properties.assignValue = workflowPerson.assignValue;
|
|
||||||
if (workflowPerson.assignValue.length === 0) {
|
|
||||||
window.vtoast.fail({ message: `${workflowPerson.label}必填!` });
|
|
||||||
throw new Error("[prepareValidate] 审批人 false");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async confirmCreateWorkDialog() {
|
|
||||||
if (await window.confirmDialog({ title: "新增", content: "确定新增吗?" }) === false) {
|
|
||||||
throw new Error("[confirmCreateFormDialog] 否");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
prepareDoWorkItem() {
|
|
||||||
console.log('create', this.createFormList);
|
|
||||||
},
|
|
||||||
|
|
||||||
async doCreateWork() {
|
|
||||||
await window.jhMask.show();
|
|
||||||
|
|
||||||
await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'workflowManagement',
|
|
||||||
actionId: 'insertTask',
|
|
||||||
actionData: {
|
|
||||||
formItemList: this.createFormList,
|
|
||||||
workflowId: this.createItem.workflowId,
|
|
||||||
workflowConfigCustom: JSON.stringify({ nodeListOfUserTaskNode: this.workflowPersonList })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
await window.jhMask.hide();
|
|
||||||
await window.vtoast.success("申请成功");
|
|
||||||
},
|
|
||||||
async closeCreateDrawer() {
|
|
||||||
this.isCreateDrawerShown = false;
|
|
||||||
},
|
|
||||||
// ---------- 申请项目审核 >>>>>>>>>> --------
|
|
||||||
|
|
||||||
// UpdateItem
|
|
||||||
async jumpUpdateWorkflow(item) {
|
|
||||||
sessionStorage.setItem('workflowEditItem', JSON.stringify(item))
|
|
||||||
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?id=${item.id}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
jumpToCreateWorkflow() {
|
|
||||||
window.location.href = '/<$ ctx.app.config.appId $>/page/workflowEditor';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.work-item-box {
|
|
||||||
padding: 50% 0;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.work-item-content {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 500px) {
|
|
||||||
body [xs='4'] {
|
|
||||||
flex: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{% endblock %}
|
|
||||||
@@ -0,0 +1,171 @@
|
|||||||
|
{% extends 'template/jhTemplateV4.html'%}
|
||||||
|
|
||||||
|
{% block vueTemplate %}
|
||||||
|
<script type="text/html" id="app-template">
|
||||||
|
<div>
|
||||||
|
<v-app mobile-breakpoint="sm">
|
||||||
|
<jh-menu />
|
||||||
|
<v-main class="mt-15">
|
||||||
|
<!-- 头部内容 >>>>>>>>>>>>> -->
|
||||||
|
<div class="jh-page-second-bar px-8">
|
||||||
|
<v-row class="align-center">
|
||||||
|
<v-col cols="12" xs="12" sm="12" md="4" xl="3">
|
||||||
|
<div class="py-4 text-body-1 font-weight-bold">发起申请
|
||||||
|
<!-- 帮助页按钮 -->
|
||||||
|
<span role="button" class="success--text font-weight-regular jh-font-size-13 ml-2" @click="isHelpPageDrawerShown = true">
|
||||||
|
<v-icon size="13" class="success--text">mdi-help-circle-outline</v-icon>帮助
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</div>
|
||||||
|
<!-- <<<<<<<<<<<<< 头部内容 -->
|
||||||
|
|
||||||
|
<div class="jh-page-body-container px-8">
|
||||||
|
<!-- 页面内容 >>>>>>>>>>>>> -->
|
||||||
|
<v-card class="rounded-lg pa-8">
|
||||||
|
<!-- {{tableData}} -->
|
||||||
|
<v-row v-for="(key, index) in Object.keys(tableData)" :key="index">
|
||||||
|
<v-col cols="12" sm="12" md="12" xl="12">
|
||||||
|
<span class="font-weight-bold">{{key}}</span>
|
||||||
|
</v-col>
|
||||||
|
<v-card v-for="(templateItem, templateIndex) in tableData[key]" class="template-box" outlined @click="doUiAction('startCreateTask', templateItem)">
|
||||||
|
<div class="d-flex align-center">
|
||||||
|
<v-img
|
||||||
|
class="mr-2 block"
|
||||||
|
max-height="30"
|
||||||
|
max-width="30"
|
||||||
|
:src="`/<$ ctx.app.config.appId $>/public${templateItem['taskTemplateIcon']}`"
|
||||||
|
></v-img>
|
||||||
|
<div class="omit">{{templateItem['workflowName']}}</div>
|
||||||
|
</div>
|
||||||
|
</v-card>
|
||||||
|
</v-row>
|
||||||
|
</v-card>
|
||||||
|
<create-task-drawer ref="createTaskDrawer"></create-task-drawer>
|
||||||
|
|
||||||
|
<!-- <<<<<<<<<<<<< 页面内容 -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 帮助页抽屉 >>>>>>>>>>>>> -->
|
||||||
|
<v-navigation-drawer v-model="isHelpPageDrawerShown" v-click-outside="drawerClickOutside" fixed temporary right width="80%"
|
||||||
|
class="elevation-24">
|
||||||
|
<iframe style="border: 0" :src="`/${appInfo.appId}/pageDoc#taskHistory.md`" width="100%" height="100%"></iframe>
|
||||||
|
|
||||||
|
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
|
||||||
|
@click="isHelpPageDrawerShown = false">
|
||||||
|
<v-icon>mdi-close</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</v-navigation-drawer>
|
||||||
|
<!-- <<<<<<<<<<<<< 帮助页抽屉 -->
|
||||||
|
</v-main>
|
||||||
|
</v-app>
|
||||||
|
|
||||||
|
<jh-toast />
|
||||||
|
<jh-mask />
|
||||||
|
<jh-confirm-dialog />
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div id="app"></div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
{% block vueScript %}
|
||||||
|
|
||||||
|
{% include 'component/createTaskDrawer.html' %}
|
||||||
|
|
||||||
|
<script type="module">
|
||||||
|
new Vue({
|
||||||
|
el: '#app',
|
||||||
|
template: '#app-template',
|
||||||
|
vuetify: new Vuetify(),
|
||||||
|
data: () => ({
|
||||||
|
isHelpPageDrawerShown: false,
|
||||||
|
isTableLoading: true,
|
||||||
|
tableData:[]
|
||||||
|
}),
|
||||||
|
computed: {
|
||||||
|
isMobile() {
|
||||||
|
return window.innerWidth < 600;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.doUiAction('getTableData');
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async doUiAction(uiActionId, uiActionData) {
|
||||||
|
switch (uiActionId) {
|
||||||
|
case 'getTableData':
|
||||||
|
await this.getTableData();
|
||||||
|
break;
|
||||||
|
case 'startCreateTask':
|
||||||
|
await this.openCreateTaskDrawer(uiActionData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.error('[doUiAction] uiActionId not find', { uiActionId });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async getTableData() {
|
||||||
|
this.isTableLoading = true;
|
||||||
|
const result = await window.jianghuAxios({
|
||||||
|
data: {
|
||||||
|
appData: {
|
||||||
|
pageId: 'taskApply',
|
||||||
|
actionId: 'selectItemList',
|
||||||
|
actionData: {},
|
||||||
|
orderBy: [{ column: 'id', order: 'asc' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const rows = result.data.appData.resultData.rows;
|
||||||
|
var tempTable = rows.map(template => {
|
||||||
|
const { workflowId, workflowName, workflowInfo, workflowForm, workflowConfig } = template
|
||||||
|
var info = JSON.parse(workflowInfo)
|
||||||
|
return {
|
||||||
|
workflowId, workflowName,
|
||||||
|
taskTemplateIcon: info.taskTemplateIcon,
|
||||||
|
taskTemplateGroup: info.taskTemplateGroup || '未命名',
|
||||||
|
workflowForm: JSON.parse(workflowForm),
|
||||||
|
workflowConfig: JSON.parse(workflowConfig),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let groupByTaskTemplateGroup = _.groupBy(tempTable,'taskTemplateGroup');
|
||||||
|
this.tableData = groupByTaskTemplateGroup
|
||||||
|
|
||||||
|
this.isTableLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
async openCreateTaskDrawer(workflow) {
|
||||||
|
this.$refs.createTaskDrawer.doUiAction('open', workflow);
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.omit{
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.template-box{
|
||||||
|
width: 180px;
|
||||||
|
height: 60px;
|
||||||
|
padding: 10px 15px;
|
||||||
|
margin-right: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
@@ -164,7 +164,6 @@
|
|||||||
isHelpPageDrawerShown: false,
|
isHelpPageDrawerShown: false,
|
||||||
// 表格相关数据
|
// 表格相关数据
|
||||||
isTableZebraLineShown: true,
|
isTableZebraLineShown: true,
|
||||||
// 生日日期选择
|
|
||||||
validationRules: {
|
validationRules: {
|
||||||
requireRules: [
|
requireRules: [
|
||||||
v => !!v || 'This is required',
|
v => !!v || 'This is required',
|
||||||
@@ -187,6 +186,9 @@
|
|||||||
},
|
},
|
||||||
// 计算
|
// 计算
|
||||||
computed: {
|
computed: {
|
||||||
|
isMobile() {
|
||||||
|
return window.innerWidth < 600;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
},
|
},
|
||||||
@@ -199,9 +201,6 @@
|
|||||||
case 'getTableData':
|
case 'getTableData':
|
||||||
await this.getTableData();
|
await this.getTableData();
|
||||||
break;
|
break;
|
||||||
case 'openDataPicker':
|
|
||||||
await this.openDataPicker(uiActionData);
|
|
||||||
break;
|
|
||||||
case 'startUpdateItem':
|
case 'startUpdateItem':
|
||||||
await this.prepareViewItemData(uiActionData);
|
await this.prepareViewItemData(uiActionData);
|
||||||
await this.openViewDrawer();
|
await this.openViewDrawer();
|
||||||
|
|||||||
@@ -1,375 +0,0 @@
|
|||||||
{% extends 'template/jhTemplateV4.html'%}
|
|
||||||
|
|
||||||
{% block vueTemplate %}
|
|
||||||
|
|
||||||
<script type="text/html" id="app-template">
|
|
||||||
<div>
|
|
||||||
<v-app mobile-breakpoint="sm">
|
|
||||||
<jh-menu />
|
|
||||||
<v-main class="mt-15">
|
|
||||||
<!-- 头部内容 >>>>>>>>>>>>> -->
|
|
||||||
<div class="jh-page-second-bar px-8">
|
|
||||||
<v-row>
|
|
||||||
<v-col cols="12" xs="12" sm="12" md="4" xl="3">
|
|
||||||
<div class="pt-3 text-h7 font-weight-bold">流程编辑
|
|
||||||
<!-- 帮助页按钮 -->
|
|
||||||
<v-icon @click="isHelpPageDrawerShown = true" color="success" small>mdi-help-circle-outline
|
|
||||||
</v-icon>
|
|
||||||
</div>
|
|
||||||
<v-breadcrumbs class="pb-3 pt-0 pl-0" :items="breadcrumbs" divider="-"></v-breadcrumbs>
|
|
||||||
</v-col>
|
|
||||||
<!--pc端的搜索条件表单 >>>>>>>> -->
|
|
||||||
<v-col cols="12" xs="12" sm="12" md="8" xl="9" class="d-flex align-center">
|
|
||||||
<v-row class="jh-backend-form-container justify-end ma-0 py-4 pt-xs-0 ">
|
|
||||||
<v-btn
|
|
||||||
small @click="doUiAction(submitUiActionId)" color="success" class="">
|
|
||||||
保存
|
|
||||||
</v-btn>
|
|
||||||
</v-row>
|
|
||||||
</v-col>
|
|
||||||
<!-- <<<<<<<< pc端的搜索条件表单 -->
|
|
||||||
</v-row>
|
|
||||||
</div>
|
|
||||||
<!-- <<<<<<<<<<<<< 头部内容 -->
|
|
||||||
<div class="jh-page-body-container px-8">
|
|
||||||
<v-card class="pa-4">
|
|
||||||
<v-row>
|
|
||||||
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
|
|
||||||
<v-text-field
|
|
||||||
class="jh-v-input mr-2" dense filled single-line color="success" prefix="流程名:"
|
|
||||||
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">
|
|
||||||
<v-text-field
|
|
||||||
class="jh-v-input mr-2" dense filled single-line color="success" prefix="备注:"
|
|
||||||
v-model="formObj['workflowRemark']">
|
|
||||||
</v-text-field>
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
|
|
||||||
<v-select
|
|
||||||
class="jh-v-input mr-2" dense filled single-line color="success" prefix="审批模式:"
|
|
||||||
v-model="formObj['mode']" :items="constantObj.modeList" />
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-card>
|
|
||||||
|
|
||||||
<div class="py-4 text-h7">模板设置</div>
|
|
||||||
<tpl-form-design :form="formObj.workflowForm" v-if="!loading" />
|
|
||||||
|
|
||||||
<div class="py-4 text-h7">流程设置</div>
|
|
||||||
<process-flow
|
|
||||||
v-if="!loading" ref="processFlow"
|
|
||||||
:data="formObj.workflowConfig"
|
|
||||||
:user="constantObj.userList"
|
|
||||||
:group="constantObj.groupList"
|
|
||||||
:tpl="constantObj.workflowFormList"
|
|
||||||
:mode="formObj.mode">
|
|
||||||
</process-flow>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 帮助页抽屉 >>>>>>>>>>>>> -->
|
|
||||||
<v-navigation-drawer v-model="isHelpPageDrawerShown" v-click-outside="drawerClickOutside" fixed temporary right width="80%" class="elevation-24">
|
|
||||||
<iframe style="border: 0" :src="`/${appInfo.appId}/pageDoc#workflowManagement.md`" width="100%"
|
|
||||||
height="100%"></iframe>
|
|
||||||
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
|
|
||||||
@click="isHelpPageDrawerShown = false">
|
|
||||||
<v-icon>mdi-close</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</v-navigation-drawer>
|
|
||||||
<!-- <<<<<<<<<<<<< 帮助页抽屉 -->
|
|
||||||
<!-- 页面loading 效果 -->
|
|
||||||
<v-overlay :value="loading" fixed style="z-index: 100">
|
|
||||||
<v-progress-circular
|
|
||||||
indeterminate
|
|
||||||
size="64"
|
|
||||||
></v-progress-circular>
|
|
||||||
</v-overlay>
|
|
||||||
</v-main>
|
|
||||||
</v-app>
|
|
||||||
|
|
||||||
<jh-toast />
|
|
||||||
<jh-mask />
|
|
||||||
<jh-confirm-dialog />
|
|
||||||
</div>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="app">
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block vueScript %}
|
|
||||||
{% include 'component/flow/processFlow.html' %}
|
|
||||||
{% include 'component/flow/editLine.html' %}
|
|
||||||
{% include 'component/flow/editNode.html' %}
|
|
||||||
{% include 'component/tpl/tplFormDesign.html' %}
|
|
||||||
{% include 'component/tpl/formItemListGenerator.html' %}
|
|
||||||
{% include 'component/tpl/formItemListReview.html' %}
|
|
||||||
|
|
||||||
<script type="module">
|
|
||||||
new Vue({
|
|
||||||
el: '#app',
|
|
||||||
template: '#app-template',
|
|
||||||
vueComponent: 'page',
|
|
||||||
vuetify: new Vuetify(),
|
|
||||||
data: () => ({
|
|
||||||
breadcrumbs: [
|
|
||||||
{text: '首页', disabled: true,},
|
|
||||||
{text: '申请模板', disabled: true,}
|
|
||||||
],
|
|
||||||
validationRules: {
|
|
||||||
requireRules: [
|
|
||||||
v => !!v || '必填',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
constantObj: {
|
|
||||||
userList: [],
|
|
||||||
groupList: [],
|
|
||||||
workflowFormList: [],
|
|
||||||
modeList: [
|
|
||||||
{text: '串行', value: 'serial'},
|
|
||||||
{text: '并行', value: 'parallel'},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
formObj: {},
|
|
||||||
submitUiActionId: 'createItem',
|
|
||||||
loading: false,
|
|
||||||
isHelpPageDrawerShown: false,
|
|
||||||
axiosActionData: null
|
|
||||||
}),
|
|
||||||
watch: {
|
|
||||||
// 监听表单的workflowForm数据变动,重构constantObj数据
|
|
||||||
'formObj.workflowForm': {
|
|
||||||
handler() {
|
|
||||||
if (!this.formObj.workflowForm) return;
|
|
||||||
this.buildConstantWorkflowFormList();
|
|
||||||
if (!this.formObj.workflowConfig) return;
|
|
||||||
this.buildConstantWorkflowConfig();
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async created() {
|
|
||||||
this.getUrlObj();
|
|
||||||
await this.syncUpdateFormObj()
|
|
||||||
this.doUiAction('getUserGroupData');
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async doUiAction(uiActionId, uiActionData) {
|
|
||||||
switch (uiActionId) {
|
|
||||||
case 'getUserGroupData':
|
|
||||||
await this.getUserList();
|
|
||||||
await this.getGroupList();
|
|
||||||
break;
|
|
||||||
case 'createItem':
|
|
||||||
await this.confirmCreateItemDialog();
|
|
||||||
await this.prepareAxiosActionData();
|
|
||||||
await this.doCreateItem();
|
|
||||||
await this.syncUpdateFormObj()
|
|
||||||
break;
|
|
||||||
case 'updateItem':
|
|
||||||
await this.confirmUpdateItemDialog();
|
|
||||||
await this.prepareAxiosActionData();
|
|
||||||
await this.doUpdateItem();
|
|
||||||
await this.syncUpdateFormObj()
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.error("[doUiAction] uiActionId not find", {uiActionId});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// -- 获取数据 >>>>>>>>>>>>>>>> --------------------
|
|
||||||
getUrlObj() {
|
|
||||||
const searchParams = new URLSearchParams(location.search.substring(1));
|
|
||||||
this.formObj.id = searchParams.get('id');
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取user数据
|
|
||||||
*/
|
|
||||||
async getUserList() {
|
|
||||||
const {rows} = (await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'workflowManagement',
|
|
||||||
actionId: 'selectUserList',
|
|
||||||
actionData: {},
|
|
||||||
where: {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})).data.appData.resultData;
|
|
||||||
this.constantObj.userList = rows.map(e => {
|
|
||||||
return {text: e.username, value: e.userId, userId: e.userId}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取group数据
|
|
||||||
*/
|
|
||||||
async getGroupList() {
|
|
||||||
const {rows} = (await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'workflowManagement',
|
|
||||||
actionId: 'selectGroupList',
|
|
||||||
actionData: {},
|
|
||||||
where: {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})).data.appData.resultData;
|
|
||||||
this.constantObj.groupList = rows.map(e => {
|
|
||||||
return {text: e.groupName, value: e.groupId}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// -- <<<<<<<<<<<<< 获取数据 --------------------
|
|
||||||
// -- constantObj 数据构建 >>>>>>>>>>> ---------------
|
|
||||||
buildConstantWorkflowFormList() {
|
|
||||||
this.constantObj.workflowFormList = [];
|
|
||||||
for (const item of this.formObj.workflowForm) {
|
|
||||||
this.constantObj.workflowFormList.push({
|
|
||||||
text: item.statement,
|
|
||||||
value: item.id
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
buildConstantWorkflowConfig() {
|
|
||||||
for (const config of this.formObj.workflowConfig.nodeList) {
|
|
||||||
if (!config.formId) return;
|
|
||||||
const formId = []
|
|
||||||
for (const item of config.formId) {
|
|
||||||
if (!this.constantObj.workflowFormList.some(e => e.value === item)) {
|
|
||||||
formId.push(item)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
config.formId = formId
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// -- <<<<<<<<<<<<< constantObj 数据构建 ---------------
|
|
||||||
// ---- 数据准备 >>>>>>>>>>>>>> ---------
|
|
||||||
async syncUpdateFormObj() {
|
|
||||||
this.loading = true;
|
|
||||||
if (this.formObj.id) {
|
|
||||||
const {rows} = (await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'workflowManagement',
|
|
||||||
actionId: 'selectItemList',
|
|
||||||
where: {id: this.formObj.id},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})).data.appData.resultData;
|
|
||||||
if (rows.length) {
|
|
||||||
await this.prepareUpdateFormObj(rows);
|
|
||||||
this.hideLoading();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await this.prepareCreateFormObj();
|
|
||||||
this.hideLoading();
|
|
||||||
},
|
|
||||||
hideLoading() {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.loading = false;
|
|
||||||
}, 300)
|
|
||||||
},
|
|
||||||
async prepareCreateFormObj() {
|
|
||||||
this.submitUiActionId = 'createItem';
|
|
||||||
this.formObj = {workflowForm: [], workflowConfig: {lineList: [], nodeList: []}, mode: 'serial'};
|
|
||||||
},
|
|
||||||
async prepareUpdateFormObj(rows) {
|
|
||||||
this.submitUiActionId = 'updateItem';
|
|
||||||
const item = rows[0];
|
|
||||||
item.workflowConfig = item.workflowConfig ? JSON.parse(item.workflowConfig) : null;
|
|
||||||
item.workflowForm = item.workflowForm ? JSON.parse(item.workflowForm) : [];
|
|
||||||
item.mode = item.workflowConfig.mode || 'serial';
|
|
||||||
this.formObj = item;
|
|
||||||
},
|
|
||||||
prepareAxiosActionData() {
|
|
||||||
const {id, workflowId, workflowName, workflowRemark, workflowCategory, mode, workflowForm} = this.formObj;
|
|
||||||
const workflowConfig = this.$refs.processFlow.getBusinessData();
|
|
||||||
workflowConfig.mode = mode
|
|
||||||
// TODO: 清除不存在的用户
|
|
||||||
workflowConfig.nodeList.forEach(node => {
|
|
||||||
if (node.type === 'userTask') {
|
|
||||||
node.assignValue = node.assignValue || [];
|
|
||||||
node.assignValue = node.assignValue.filter(userId => this.constantObj.userList.findIndex(u => u.userId === userId) > -1);
|
|
||||||
node.origin.properties.assignValue = node.assignValue;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.axiosActionData = {
|
|
||||||
workflowName,
|
|
||||||
workflowRemark,
|
|
||||||
workflowCategory,
|
|
||||||
workflowId: workflowId || null,
|
|
||||||
workflowConfig: workflowConfig ? JSON.stringify(workflowConfig) : null,
|
|
||||||
workflowForm: workflowForm ? JSON.stringify(workflowForm) : null,
|
|
||||||
}
|
|
||||||
if (id) {
|
|
||||||
this.axiosActionData.id = id;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// ---- <<<<<<<<<<<<<<< 数据准备 ---------
|
|
||||||
// ---------- 新建流程 createItem >>>>>>>>>> --------
|
|
||||||
async confirmCreateItemDialog() {
|
|
||||||
if (await window.confirmDialog({title: "新增", content: "确定新增吗?"}) === false) {
|
|
||||||
throw new Error("[confirmCreateFormDialog] 否");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async doCreateItem() {
|
|
||||||
delete this.formObj.id;
|
|
||||||
await window.vtoast.loading("新增数据");
|
|
||||||
const {rows} = (await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'workflowManagement',
|
|
||||||
actionId: 'insertItem',
|
|
||||||
actionData: this.axiosActionData
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})).data.appData.resultData;
|
|
||||||
this.formObj.id = rows[0];
|
|
||||||
history.pushState({}, '', `?id=${rows[0]}`);
|
|
||||||
await window.vtoast.success("新增数据成功");
|
|
||||||
},
|
|
||||||
// ---------- <<<<<<<<<< 新建流程 createItem --------
|
|
||||||
// ---------- 修改流程 updateItem >>>>>>>>>> --------
|
|
||||||
async confirmUpdateItemDialog() {
|
|
||||||
if (await window.confirmDialog({title: "修改", content: "确定修改吗?"}) === false) {
|
|
||||||
throw new Error("[confirmUpdateItemDialog] 否");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async doUpdateItem() {
|
|
||||||
await window.vtoast.loading("修改数据");
|
|
||||||
await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'workflowManagement',
|
|
||||||
actionId: 'updateItem',
|
|
||||||
actionData: this.axiosActionData,
|
|
||||||
where: {id: this.axiosActionData.id}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
await window.vtoast.success("修改数据成功");
|
|
||||||
},
|
|
||||||
// ---------- <<<<<<<<<< 修改流程 updateItem --------
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.theme--light.v-data-table > .v-data-table__wrapper > table > tbody > tr > td:not(.v-data-table__mobile-row) {
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
max-width: 500px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.theme--light.v-data-table > .v-data-table__wrapper > table > tbody > tr {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{% endblock %}
|
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<div class="jh-page-second-bar px-8">
|
<div class="jh-page-second-bar px-8">
|
||||||
<v-row class="align-center">
|
<v-row class="align-center">
|
||||||
<v-col cols="12" xs="12" sm="12" md="4" xl="3">
|
<v-col cols="12" xs="12" sm="12" md="4" xl="3">
|
||||||
<div class="py-4 text-body-1 font-weight-bold">发起任务
|
<div class="py-4 text-body-1 font-weight-bold">审批模版
|
||||||
<!-- 帮助页按钮 -->
|
<!-- 帮助页按钮 -->
|
||||||
<span role="button" class="success--text font-weight-regular jh-font-size-13 ml-2" @click="isHelpPageDrawerShown = true">
|
<span role="button" class="success--text font-weight-regular jh-font-size-13 ml-2" @click="isHelpPageDrawerShown = true">
|
||||||
<v-icon size="13" class="success--text">mdi-help-circle-outline</v-icon>帮助
|
<v-icon size="13" class="success--text">mdi-help-circle-outline</v-icon>帮助
|
||||||
@@ -53,9 +53,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- pc端 -->
|
<!-- pc端 -->
|
||||||
<template v-if="!isMobile">
|
<template v-if="!isMobile">
|
||||||
<span role="button" class="success--text font-weight-medium font-size-2 mr-2 ml-2" @click="doUiAction('startCreateTask', item)">
|
|
||||||
<v-icon size="16" class="success--text">mdi-note-edit-outline</v-icon>申请
|
|
||||||
</span>
|
|
||||||
<span role="button" class="success--text font-weight-medium font-size-2" @click="doUiAction('openWorkflowEditorDrawer', item)">
|
<span role="button" class="success--text font-weight-medium font-size-2" @click="doUiAction('openWorkflowEditorDrawer', item)">
|
||||||
<v-icon size="16" class="success--text">mdi-note-edit-outline</v-icon>编辑
|
<v-icon size="16" class="success--text">mdi-note-edit-outline</v-icon>编辑
|
||||||
</span>
|
</span>
|
||||||
@@ -69,9 +66,6 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<v-list dense>
|
<v-list dense>
|
||||||
<v-list-item @click="doUiAction('startCreateTask', item)">
|
|
||||||
<v-list-item-title>申请</v-list-item-title>
|
|
||||||
</v-list-item>
|
|
||||||
<v-list-item @click="doUiAction('openWorkflowEditorDrawer', item)">
|
<v-list-item @click="doUiAction('openWorkflowEditorDrawer', item)">
|
||||||
<v-list-item-title>编辑</v-list-item-title>
|
<v-list-item-title>编辑</v-list-item-title>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
@@ -100,54 +94,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- <<<<<<<<<<<<< 创建审批抽屉 -->
|
<!-- <<<<<<<<<<<<< 创建审批抽屉 -->
|
||||||
<create-task-drawer ref="createTaskDrawer"></create-task-drawer>
|
<create-task-drawer ref="createTaskDrawer"></create-task-drawer>
|
||||||
<v-navigation-drawer v-model="isCreateDrawerShown" v-click-outside="drawerClickOutside" fixed temporary right width="80%" class="elevation-24">
|
|
||||||
<v-form v-if="isCreateDrawerShown" ref="createForm" lazy-validation>
|
|
||||||
<!-- 抽屉标题 -->
|
|
||||||
<v-row no-gutters>
|
|
||||||
<span class="text-h7 font-weight-bold pa-4">创建审批</span>
|
|
||||||
</v-row>
|
|
||||||
<v-divider class="jh-divider"></v-divider>
|
|
||||||
<!--抽屉表单主体-->
|
|
||||||
<v-row class="mt-0 px-4">
|
|
||||||
<v-col cols="12" sm="12" :md="item.type === 'short' ? 12 : 4" v-for="(item, index) in currentWorkflowForm" :key="index">
|
|
||||||
<form-item :form-item="item"></form-item>
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="12" sm="12" md="12">
|
|
||||||
<span class="jh-input-label">审批流程 - 添加审批人</span>
|
|
||||||
<v-row v-for="workflowPersonItem in currentWorkflowPersonList">
|
|
||||||
<v-col cols="12" xs="6" md="4">
|
|
||||||
<v-text-field class="jh-v-input " dense filled single-line hide-details v-model="workflowPersonItem.label" disabled></v-text-field>
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="12" xs="6" md="4">
|
|
||||||
<v-autocomplete
|
|
||||||
class="jh-v-input mr-2"
|
|
||||||
dense filled single-line clearable
|
|
||||||
:items="userList"
|
|
||||||
item-text="username"
|
|
||||||
item-value="userId"
|
|
||||||
multiple
|
|
||||||
hide-details
|
|
||||||
:rules="validationRules.requireRules"
|
|
||||||
v-model="workflowPersonItem.assignValue">
|
|
||||||
</v-autocomplete>
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="12" xs="12" md="4" class="pt-xs-0">
|
|
||||||
<v-checkbox class="ma-0" dense filled v-model="workflowPersonItem.isNeedAllApproval" label="是否需要所有人审批" hide-details></v-checkbox>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
<!--抽屉操作按钮-->
|
|
||||||
<v-row class="justify-end mx-0 my-8 px-4">
|
|
||||||
<v-btn color="success" @click="doUiAction('createTask')" small>保存</v-btn>
|
|
||||||
<v-btn class="ml-2" @click="isCreateDrawerShown = false" small>取消</v-btn>
|
|
||||||
</v-row>
|
|
||||||
</v-form>
|
|
||||||
<!--抽屉关闭按钮-->
|
|
||||||
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn" @click="isCreateDrawerShown = false">
|
|
||||||
<v-icon>mdi-close</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</v-navigation-drawer>
|
|
||||||
<!-- <<<<<<<<<<<<< 创建审批抽屉 -->
|
<!-- <<<<<<<<<<<<< 创建审批抽屉 -->
|
||||||
|
|
||||||
<!-- 编辑流程抽屉 >>>>>>>>>>>>> -->
|
<!-- 编辑流程抽屉 >>>>>>>>>>>>> -->
|
||||||
@@ -230,22 +176,6 @@
|
|||||||
await this.getTableData();
|
await this.getTableData();
|
||||||
await this.parseTableData();
|
await this.parseTableData();
|
||||||
break;
|
break;
|
||||||
case 'startCreateTask':
|
|
||||||
await this.openCreateTaskDrawer(uiActionData);
|
|
||||||
break;
|
|
||||||
case 'createTask':
|
|
||||||
await this.prepareDoCreateWork();
|
|
||||||
await this.prepareCreateValidate();
|
|
||||||
await this.confirmCreateWorkDialog();
|
|
||||||
await this.doCreateWork();
|
|
||||||
await this.closeCreateDrawer();
|
|
||||||
break;
|
|
||||||
case 'jumpToCreateWorkflow':
|
|
||||||
await this.jumpToCreateWorkflow();
|
|
||||||
break;
|
|
||||||
case 'jumpUpdateWorkflow':
|
|
||||||
await this.jumpUpdateWorkflow(uiActionData);
|
|
||||||
break;
|
|
||||||
case 'openWorkflowEditorDrawer':
|
case 'openWorkflowEditorDrawer':
|
||||||
await this.openWorkflowEditorDrawer(uiActionData);
|
await this.openWorkflowEditorDrawer(uiActionData);
|
||||||
break;
|
break;
|
||||||
@@ -301,77 +231,6 @@
|
|||||||
this.userList = userList;
|
this.userList = userList;
|
||||||
},
|
},
|
||||||
|
|
||||||
// ---------- <<<<<<<<<< 申请项目审核 --------
|
|
||||||
async openCreateTaskDrawer(workflow) {
|
|
||||||
this.$refs.createTaskDrawer.doUiAction('open', workflow);
|
|
||||||
},
|
|
||||||
async prepareDoCreateWork() {
|
|
||||||
this.currentWorkflowPersonList.forEach(workflowPersonItem => {
|
|
||||||
if (!workflowPersonItem.assignValue) {
|
|
||||||
workflowPersonItem.assignValue = [];
|
|
||||||
}
|
|
||||||
workflowPersonItem.assignValue = workflowPersonItem.assignValue.filter(userId => {
|
|
||||||
return this.userList.some(user => user.userId === userId);
|
|
||||||
});
|
|
||||||
if (!workflowPersonItem.origin) workflowPersonItem['origin'] = {};
|
|
||||||
if (!workflowPersonItem.origin.properties) workflowPersonItem.origin['properties'] = {};
|
|
||||||
workflowPersonItem.origin.properties.assignValue = workflowPersonItem.assignValue;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async prepareCreateValidate() {
|
|
||||||
if (!await this.$refs.createForm.validate()) {
|
|
||||||
throw new Error("请完善表单信息")
|
|
||||||
}
|
|
||||||
this.currentWorkflowPersonList.forEach(workflowPersonItem => {
|
|
||||||
if (workflowPersonItem.assignValue.length === 0) {
|
|
||||||
window.vtoast.fail({ message: `${workflowPersonItem.label}必填!` });
|
|
||||||
throw new Error("[prepareValidate] 审批人 false");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async confirmCreateWorkDialog() {
|
|
||||||
if (await window.confirmDialog({ title: "新增", content: "确定新增吗?" }) === false) {
|
|
||||||
throw new Error("[confirmCreateFormDialog] 否");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async doCreateWork() {
|
|
||||||
await window.jhMask.show();
|
|
||||||
await window.vtoast.loading("正在申请");
|
|
||||||
await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'workflowManagement',
|
|
||||||
actionId: 'insertTask',
|
|
||||||
actionData: {
|
|
||||||
formItemList: this.currentWorkflowForm,
|
|
||||||
workflowId: this.currentWorkflowId,
|
|
||||||
workflowConfigCustom: JSON.stringify({ nodeListOfUserTaskNode: this.currentWorkflowPersonList })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
await window.jhMask.hide();
|
|
||||||
await window.vtoast.success("申请成功");
|
|
||||||
},
|
|
||||||
async closeCreateDrawer() {
|
|
||||||
this.currentWorkflowForm = null;
|
|
||||||
this.currentWorkflowId = null;
|
|
||||||
this.isCreateDrawerShown = false;
|
|
||||||
},
|
|
||||||
// ---------- 申请项目审核 >>>>>>>>>> --------
|
|
||||||
|
|
||||||
// ---------- <<<<<<<<<< jump --------
|
|
||||||
jumpUpdateWorkflow(item) {
|
|
||||||
sessionStorage.setItem('workflowEditItem', JSON.stringify(item))
|
|
||||||
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?id=${item.id}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
jumpToCreateWorkflow() {
|
|
||||||
window.location.href = '/<$ ctx.app.config.appId $>/page/workflowEditor';
|
|
||||||
},
|
|
||||||
// ---------- jump >>>>>>>>>> --------
|
|
||||||
|
|
||||||
openWorkflowEditorDrawer(item) {
|
openWorkflowEditorDrawer(item) {
|
||||||
this.$refs.workflowEditorDrawer.doUiAction('open', item);
|
this.$refs.workflowEditorDrawer.doUiAction('open', item);
|
||||||
}
|
}
|
||||||
|
|||||||