2021-11-18 12:06:24 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
2022-01-01 08:54:37 +08:00
|
|
|
|
|
|
|
|
|
<!-- 搜索工作栏 -->
|
2021-11-18 12:06:24 +08:00
|
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
2022-01-02 08:49:35 +08:00
|
|
|
|
<el-form-item label="流程标识" prop="key">
|
|
|
|
|
<el-input v-model="queryParams.key" placeholder="请输入流程标识" clearable style="width: 240px;" size="small"
|
2021-11-18 12:06:24 +08:00
|
|
|
|
@keyup.enter.native="handleQuery"/>
|
|
|
|
|
</el-form-item>
|
2022-01-02 08:49:35 +08:00
|
|
|
|
<el-form-item label="流程名称" prop="name">
|
|
|
|
|
<el-input v-model="queryParams.name" placeholder="请输入流程名称" clearable style="width: 240px;" size="small"
|
|
|
|
|
@keyup.enter.native="handleQuery"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="流程分类" prop="category">
|
|
|
|
|
<el-select v-model="queryParams.category" placeholder="流程分类" clearable size="small" style="width: 240px">
|
|
|
|
|
<el-option v-for="dict in categoryDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
2021-11-18 12:06:24 +08:00
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
2022-01-01 08:54:37 +08:00
|
|
|
|
|
|
|
|
|
<!-- 操作工具栏 -->
|
2021-11-18 12:06:24 +08:00
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
2022-01-01 19:31:16 +08:00
|
|
|
|
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
|
2022-01-12 00:33:50 +08:00
|
|
|
|
v-hasPermi="['bpm:model:create']">新建流程</el-button>
|
2021-11-18 12:06:24 +08:00
|
|
|
|
</el-col>
|
2022-01-03 18:46:00 +08:00
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="info" icon="el-icon-upload2" size="mini" @click="handleImport"
|
2022-01-12 00:33:50 +08:00
|
|
|
|
v-hasPermi="['bpm:model:import']">导入流程</el-button>
|
2022-01-03 18:46:00 +08:00
|
|
|
|
</el-col>
|
2021-11-18 12:06:24 +08:00
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
2022-01-01 08:54:37 +08:00
|
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
2021-11-18 12:06:24 +08:00
|
|
|
|
<el-table v-loading="loading" :data="list">
|
2022-01-01 08:54:37 +08:00
|
|
|
|
<el-table-column label="流程标识" align="center" prop="key" />
|
2022-01-03 04:31:48 +08:00
|
|
|
|
<el-table-column label="流程名称" align="center" prop="name" width="200">
|
2022-01-03 02:41:24 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button type="text" @click="handleBpmnDetail(scope.row)">
|
|
|
|
|
<span>{{ scope.row.name }}</span>
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2022-01-03 04:31:48 +08:00
|
|
|
|
<el-table-column label="流程分类" align="center" prop="category" width="100">
|
2022-01-02 08:49:35 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ getDictDataLabel(DICT_TYPE.BPM_MODEL_CATEGORY, scope.row.category) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2022-01-02 12:56:34 +08:00
|
|
|
|
<el-table-column label="表单信息" align="center" prop="formId">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button v-if="scope.row.formId" type="text" @click="handleFormDetail(scope.row)">
|
|
|
|
|
<span>{{ scope.row.formName }}</span>
|
|
|
|
|
</el-button>
|
|
|
|
|
<label v-else>暂无表单</label>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2022-01-01 08:54:37 +08:00
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
2021-11-18 18:23:56 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2022-01-03 04:31:48 +08:00
|
|
|
|
<el-table-column label="最新部署的流程定义" align="center">
|
|
|
|
|
<el-table-column label="流程版本" align="center" prop="processDefinition.version" width="80">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-tag size="medium" v-if="scope.row.processDefinition">v{{ scope.row.processDefinition.version }}</el-tag>
|
|
|
|
|
<el-tag size="medium" type="warning" v-else>未部署</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="激活状态" align="center" prop="processDefinition.version" width="80">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-switch v-if="scope.row.processDefinition" v-model="scope.row.processDefinition.suspensionState"
|
2022-01-03 12:26:04 +08:00
|
|
|
|
:active-value="1" :inactive-value="2" @change="handleChangeState(scope.row)" />
|
2022-01-03 04:31:48 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2022-01-03 11:08:47 +08:00
|
|
|
|
<el-table-column label="部署时间" align="center" prop="deploymentTime" width="180">
|
2022-01-03 04:31:48 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span v-if="scope.row.processDefinition">{{ parseTime(scope.row.processDefinition.deploymentTime) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table-column>
|
2022-01-13 00:56:57 +08:00
|
|
|
|
<el-table-column label="操作" align="center" width="450" fixed="right">
|
2021-11-18 18:23:56 +08:00
|
|
|
|
<template slot-scope="scope">
|
2022-01-12 00:33:50 +08:00
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['bpm:model:update']">修改流程</el-button>
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-setting" @click="handleDesign(scope.row)"
|
2022-01-03 19:03:54 +08:00
|
|
|
|
v-hasPermi="['bpm:model:update']">设计流程</el-button>
|
2022-01-13 00:56:57 +08:00
|
|
|
|
<!-- TODO 权限 -->
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-s-custom" @click="handleAssignRule(scope.row)"
|
|
|
|
|
v-hasPermi="['bpm:model:update']">分配规则</el-button>
|
2022-01-03 19:03:54 +08:00
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-thumb" @click="handleDeploy(scope.row)"
|
|
|
|
|
v-hasPermi="['bpm:model:deploy']">发布流程</el-button>
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-ice-cream-round" @click="handleDefinitionList(scope.row)"
|
|
|
|
|
v-hasPermi="['bpm:model:query']">流程定义</el-button>
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
|
|
v-hasPermi="['bpm:model:delete']">删除</el-button>
|
2021-11-18 18:23:56 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2021-11-18 12:06:24 +08:00
|
|
|
|
</el-table>
|
2022-01-01 19:31:16 +08:00
|
|
|
|
<!-- 分页组件 -->
|
2021-11-18 12:06:24 +08:00
|
|
|
|
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"/>
|
2022-01-01 18:13:00 +08:00
|
|
|
|
|
2022-01-02 12:56:34 +08:00
|
|
|
|
<!-- 流程表单配置详情 -->
|
|
|
|
|
<el-dialog title="表单详情" :visible.sync="detailOpen" width="50%" append-to-body>
|
2022-01-03 02:41:24 +08:00
|
|
|
|
<parser :key="new Date().getTime()" :form-conf="detailForm" />
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 流程模型图的预览 -->
|
|
|
|
|
<el-dialog title="流程图" :visible.sync="showBpmnOpen" width="80%" append-to-body>
|
|
|
|
|
<my-process-viewer key="designer" v-model="bpmnXML" v-bind="bpmnControlForm" />
|
2022-01-02 12:56:34 +08:00
|
|
|
|
</el-dialog>
|
2022-01-03 18:46:00 +08:00
|
|
|
|
|
2022-01-12 00:33:50 +08:00
|
|
|
|
<!-- 对话框(添加 / 修改) -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
2022-01-11 20:17:01 +08:00
|
|
|
|
<el-form-item label="流程标识" prop="key">
|
2022-01-12 00:33:50 +08:00
|
|
|
|
<el-input v-model="form.key" placeholder="请输入流标标识" style="width: 330px;" :disabled="form.id" />
|
|
|
|
|
<el-tooltip v-if="!form.id" class="item" effect="light" content="新建后,流程标识不可修改!" placement="top">
|
|
|
|
|
<i style="padding-left: 5px;" class="el-icon-question" />
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip v-else class="item" effect="light" content="流程标识不可修改!" placement="top">
|
2022-01-11 20:17:01 +08:00
|
|
|
|
<i style="padding-left: 5px;" class="el-icon-question" />
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="流程名称" prop="name">
|
2022-01-12 00:33:50 +08:00
|
|
|
|
<el-input v-model="form.name" placeholder="请输入流程名称" :disabled="form.id" clearable />
|
2022-01-11 20:17:01 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="流程描述" prop="description">
|
|
|
|
|
<el-input type="textarea" v-model="form.description" clearable />
|
|
|
|
|
</el-form-item>
|
2022-01-12 00:33:50 +08:00
|
|
|
|
<div v-if="form.id">
|
|
|
|
|
<el-form-item label="表单类型" prop="formType">
|
|
|
|
|
<el-radio-group v-model="form.formType">
|
|
|
|
|
<el-radio v-for="dict in modelFormTypeDictDatas" :key="parseInt(dict.value)" :label="parseInt(dict.value)">
|
|
|
|
|
{{dict.label}}
|
|
|
|
|
</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
2022-01-12 00:38:57 +08:00
|
|
|
|
<el-form-item v-if="form.formType === 10" label="流程表单" prop="formId">
|
2022-01-12 00:33:50 +08:00
|
|
|
|
<el-select v-model="form.formId" clearable style="width: 100%">
|
|
|
|
|
<el-option v-for="form in forms" :key="form.id" :label="form.name" :value="form.id"/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
2022-01-12 00:38:57 +08:00
|
|
|
|
<el-form-item v-if="form.formType === 20" label="表单提交路由" prop="formCustomCreatePath" >
|
2022-01-12 00:33:50 +08:00
|
|
|
|
<el-input v-model="form.formCustomCreatePath" placeholder="请输入表单提交路由" style="width: 330px;" />
|
|
|
|
|
<el-tooltip class="item" effect="light" content="自定义表单的提交路径,使用 Vue 的路由地址,例如说:bpm/oa/leave/create" placement="top">
|
|
|
|
|
<i style="padding-left: 5px;" class="el-icon-question" />
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</el-form-item>
|
2022-01-12 00:38:57 +08:00
|
|
|
|
<el-form-item v-if="form.formType === 20" label="表单查看路由" prop="formCustomViewPath">
|
2022-01-12 00:33:50 +08:00
|
|
|
|
<el-input v-model="form.formCustomViewPath" placeholder="请输入表单查看路由" style="width: 330px;" />
|
|
|
|
|
<el-tooltip class="item" effect="light" content="自定义表单的查看路径,使用 Vue 的路由地址,例如说:bpm/oa/leave/view" placement="top">
|
|
|
|
|
<i style="padding-left: 5px;" class="el-icon-question" />
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</div>
|
2022-01-11 20:17:01 +08:00
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
2022-01-03 18:46:00 +08:00
|
|
|
|
<!-- 用户导入对话框 -->
|
2022-01-12 00:33:50 +08:00
|
|
|
|
<el-dialog title="导入流程" :visible.sync="upload.open" width="400px" append-to-body>
|
2022-01-11 20:17:01 +08:00
|
|
|
|
<el-upload ref="upload" :limit="1" accept=".bpmn, .xml" :headers="upload.headers" :action="upload.url"
|
|
|
|
|
:disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
|
|
|
|
|
:auto-upload="false" name="bpmnFile" :data="upload.form" drag>
|
2022-01-03 18:46:00 +08:00
|
|
|
|
<i class="el-icon-upload"></i>
|
|
|
|
|
<div class="el-upload__text">
|
|
|
|
|
将文件拖到此处,或
|
|
|
|
|
<em>点击上传</em>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“bpm”或“xml”格式文件!</div>
|
|
|
|
|
<div class="el-upload__tip" slot="tip">
|
|
|
|
|
<el-form ref="uploadForm" size="mini" label-width="90px" :model="upload.form" :rules="upload.rules" @submit.native.prevent>
|
|
|
|
|
<el-form-item label="流程标识" prop="key">
|
2022-01-11 20:17:01 +08:00
|
|
|
|
<el-input v-model="upload.form.key" placeholder="请输入流标标识" style="width: 250px;" />
|
|
|
|
|
<el-tooltip class="item" effect="light" content="新建后,流程标识不可修改!" placement="top">
|
|
|
|
|
<i style="padding-left: 5px;" class="el-icon-question" />
|
|
|
|
|
</el-tooltip>
|
2022-01-03 18:46:00 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="流程名称" prop="name">
|
|
|
|
|
<el-input v-model="upload.form.name" placeholder="请输入流程名称" clearable />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="流程描述" prop="description">
|
|
|
|
|
<el-input type="textarea" v-model="upload.form.description" clearable />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
|
|
<el-button @click="uploadClose">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
2022-01-13 00:56:57 +08:00
|
|
|
|
|
|
|
|
|
<!-- ========== 流程任务分配规则 ========== -->
|
|
|
|
|
<!-- 列表弹窗 -->
|
|
|
|
|
<el-dialog title="任务分配规则" :visible.sync="taskAssignRule.listOpen" width="800px" append-to-body>
|
|
|
|
|
<el-table v-loading="taskAssignRule.loading" :data="taskAssignRule.list">
|
|
|
|
|
<el-table-column label="任务名" align="center" prop="taskDefinitionName" width="120" fixed />
|
2022-01-13 21:23:00 +08:00
|
|
|
|
<el-table-column label="任务标识" align="center" prop="taskDefinitionKey" width="120" show-tooltip-when-overflow />
|
|
|
|
|
<el-table-column label="规则类型" align="center" prop="type" width="120">
|
2022-01-13 00:56:57 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ getDictDataLabel(DICT_TYPE.BPM_TASK_ASSIGN_RULE_TYPE, scope.row.type) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2022-01-13 21:23:00 +08:00
|
|
|
|
<el-table-column label="规则范围" align="center" prop="options" width="300px">
|
2022-01-13 13:21:54 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-tag size="medium" v-if="scope.row.options" v-for="option in scope.row.options">
|
|
|
|
|
{{ getAssignRuleOptionName(scope.row.type, option) }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2022-01-13 00:56:57 +08:00
|
|
|
|
<el-table-column label="操作" align="center" width="80" fixed="right">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<!-- TODO 权限 -->
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdateTaskAssignRule(scope.row)"
|
|
|
|
|
v-hasPermi="['bpm:model:update']">修改</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!-- 添加/修改弹窗 -->
|
|
|
|
|
<el-dialog title="修改任务规则" :visible.sync="taskAssignRule.open" width="500px" append-to-body>
|
2022-01-13 10:16:28 +08:00
|
|
|
|
<el-form ref="taskAssignRuleForm" :model="taskAssignRule.form" :rules="taskAssignRule.rules" label-width="110px">
|
2022-01-13 00:56:57 +08:00
|
|
|
|
<el-form-item label="任务名称" prop="taskDefinitionName">
|
|
|
|
|
<el-input v-model="taskAssignRule.form.taskDefinitionName" disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="任务标识" prop="taskDefinitionKey">
|
|
|
|
|
<el-input v-model="taskAssignRule.form.taskDefinitionKey" disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="规则类型" prop="type">
|
|
|
|
|
<el-select v-model="taskAssignRule.form.type" clearable style="width: 100%">
|
|
|
|
|
<el-option v-for="dict in taskAssignRuleDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-if="taskAssignRule.form.type === 10" label="指定角色" prop="roleIds">
|
2022-01-13 10:16:28 +08:00
|
|
|
|
<el-select v-model="taskAssignRule.form.roleIds" multiple clearable style="width: 100%">
|
2022-01-13 00:56:57 +08:00
|
|
|
|
<el-option v-for="item in taskAssignRule.roleOptions" :key="parseInt(item.id)" :label="item.name" :value="parseInt(item.id)" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
2022-01-14 00:21:34 +08:00
|
|
|
|
<el-form-item v-if="taskAssignRule.form.type === 20 || taskAssignRule.form.type === 21" label="指定部门" prop="deptIds">
|
|
|
|
|
<treeselect v-model="taskAssignRule.form.deptIds" :options="taskAssignRule.deptTreeOptions" multiple flat :defaultExpandLevel="3"
|
|
|
|
|
placeholder="请选择指定部门" :normalizer="normalizer"/>
|
|
|
|
|
</el-form-item>
|
2022-01-13 00:56:57 +08:00
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
2022-01-13 10:16:28 +08:00
|
|
|
|
<el-button type="primary" @click="submitAssignRuleForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancelAssignRuleForm">取 消</el-button>
|
2022-01-13 00:56:57 +08:00
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
2021-11-18 12:06:24 +08:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-01-12 00:33:50 +08:00
|
|
|
|
import {
|
|
|
|
|
deleteModel,
|
|
|
|
|
deployModel,
|
|
|
|
|
getModelPage,
|
|
|
|
|
getModel,
|
|
|
|
|
updateModelState,
|
|
|
|
|
createModel,
|
|
|
|
|
updateModel
|
|
|
|
|
} from "@/api/bpm/model";
|
2022-01-02 08:49:35 +08:00
|
|
|
|
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
2022-01-03 18:46:00 +08:00
|
|
|
|
import {getForm, getSimpleForms} from "@/api/bpm/form";
|
2022-01-02 12:56:34 +08:00
|
|
|
|
import {decodeFields} from "@/utils/formGenerator";
|
|
|
|
|
import Parser from '@/components/parser/Parser'
|
2022-01-03 18:46:00 +08:00
|
|
|
|
import {getBaseHeader} from "@/utils/request";
|
2022-01-13 10:16:28 +08:00
|
|
|
|
import {createTaskAssignRule, getTaskAssignRuleList, updateTaskAssignRule} from "@/api/bpm/taskAssignRule";
|
2022-01-13 00:56:57 +08:00
|
|
|
|
import {listSimpleRoles} from "@/api/system/role";
|
2022-01-14 00:21:34 +08:00
|
|
|
|
import {listSimpleDepts} from "@/api/system/dept";
|
|
|
|
|
|
|
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
2021-11-18 12:06:24 +08:00
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "model",
|
2022-01-02 12:56:34 +08:00
|
|
|
|
components: {
|
2022-01-14 00:21:34 +08:00
|
|
|
|
Parser,
|
|
|
|
|
Treeselect
|
2022-01-02 12:56:34 +08:00
|
|
|
|
},
|
2021-11-18 12:06:24 +08:00
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 表格数据
|
|
|
|
|
list: [],
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10
|
2022-01-01 18:13:00 +08:00
|
|
|
|
},
|
2022-01-02 08:49:35 +08:00
|
|
|
|
|
2022-01-01 18:13:00 +08:00
|
|
|
|
// BPMN 数据
|
2022-01-01 19:31:16 +08:00
|
|
|
|
showBpmnOpen: false,
|
2022-01-01 18:13:00 +08:00
|
|
|
|
bpmnXML: null,
|
2022-01-03 02:41:24 +08:00
|
|
|
|
bpmnControlForm: {
|
|
|
|
|
prefix: "activiti"
|
|
|
|
|
},
|
2022-01-02 08:49:35 +08:00
|
|
|
|
|
2022-01-02 12:56:34 +08:00
|
|
|
|
// 流程表单详情
|
|
|
|
|
detailOpen: false,
|
|
|
|
|
detailForm: {
|
|
|
|
|
fields: []
|
|
|
|
|
},
|
|
|
|
|
|
2022-01-11 20:17:01 +08:00
|
|
|
|
// 流程表单
|
2022-01-12 00:33:50 +08:00
|
|
|
|
title: "",
|
2022-01-11 20:17:01 +08:00
|
|
|
|
open: false,
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
key: [{ required: true, message: "流程标识不能为空", trigger: "blur" }],
|
|
|
|
|
name: [{ required: true, message: "流程名称不能为空", trigger: "blur" }],
|
2022-01-12 00:33:50 +08:00
|
|
|
|
formType: [{ required: true, message: "流程名称不能为空", trigger: "blur" }],
|
2022-01-12 00:38:57 +08:00
|
|
|
|
formId: [{ required: true, message: "业务表单不能为空", trigger: "blur" }],
|
|
|
|
|
formCustomCreatePath: [{ required: true, message: "表单提交路由不能为空", trigger: "blur" }],
|
|
|
|
|
formCustomViewPath: [{ required: true, message: "表单查看路由不能为空", trigger: "blur" }],
|
2022-01-11 20:17:01 +08:00
|
|
|
|
},
|
|
|
|
|
|
2022-01-13 00:56:57 +08:00
|
|
|
|
// 任务分配规则表单
|
|
|
|
|
taskAssignRule: {
|
|
|
|
|
row: undefined, // 选中的流程模型
|
|
|
|
|
list: [], // 选中流程模型的任务分配规则们
|
|
|
|
|
listOpen: false, // 列表是否打开
|
|
|
|
|
loading: false, // 加载中
|
|
|
|
|
open: false, // 是否打开
|
|
|
|
|
form: {}, // 表单
|
|
|
|
|
rules: { // 表单校验规则
|
|
|
|
|
type: [{ required: true, message: "规则类型不能为空", trigger: "change" }],
|
|
|
|
|
roleIds: [{required: true, message: "指定角色不能为空", trigger: "change" }],
|
2022-01-14 00:21:34 +08:00
|
|
|
|
deptIds: [{required: true, message: "指定部门不能为空", trigger: "change" }],
|
2022-01-13 00:56:57 +08:00
|
|
|
|
},
|
|
|
|
|
// 各种下拉框
|
|
|
|
|
roleOptions: [],
|
2022-01-14 00:21:34 +08:00
|
|
|
|
deptOptions: [],
|
|
|
|
|
deptTreeOptions: [],
|
2022-01-13 00:56:57 +08:00
|
|
|
|
},
|
|
|
|
|
|
2022-01-03 18:46:00 +08:00
|
|
|
|
// 流程导入参数
|
|
|
|
|
upload: {
|
|
|
|
|
// 是否显示弹出层(用户导入)
|
|
|
|
|
open: false,
|
|
|
|
|
// 是否禁用上传
|
|
|
|
|
isUploading: false,
|
|
|
|
|
// 设置上传的请求头部
|
|
|
|
|
headers: getBaseHeader(),
|
|
|
|
|
// 上传的地址
|
|
|
|
|
url: process.env.VUE_APP_BASE_API + '/api/' + "/bpm/model/import",
|
|
|
|
|
// 表单
|
|
|
|
|
form: {},
|
|
|
|
|
// 校验规则
|
|
|
|
|
rules: {
|
|
|
|
|
key: [{ required: true, message: "流程标识不能为空", trigger: "blur" }],
|
|
|
|
|
name: [{ required: true, message: "流程名称不能为空", trigger: "blur" }],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// 流程表单的下拉框的数据
|
|
|
|
|
forms: [],
|
|
|
|
|
|
2022-01-02 08:49:35 +08:00
|
|
|
|
// 数据字典
|
|
|
|
|
categoryDictDatas: getDictDatas(DICT_TYPE.BPM_MODEL_CATEGORY),
|
2022-01-13 00:56:57 +08:00
|
|
|
|
modelFormTypeDictDatas: getDictDatas(DICT_TYPE.BPM_MODEL_FORM_TYPE),
|
|
|
|
|
taskAssignRuleDictDatas: getDictDatas(DICT_TYPE.BPM_TASK_ASSIGN_RULE_TYPE),
|
2021-11-18 12:06:24 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
2022-01-03 18:46:00 +08:00
|
|
|
|
// 获得流程表单的下拉框的数据
|
|
|
|
|
getSimpleForms().then(response => {
|
|
|
|
|
this.forms = response.data
|
|
|
|
|
})
|
2021-11-18 12:06:24 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2022-01-01 19:31:16 +08:00
|
|
|
|
/** 查询流程模型列表 */
|
2021-11-18 12:06:24 +08:00
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
2022-01-01 19:31:16 +08:00
|
|
|
|
getModelPage(this.queryParams).then(response => {
|
2021-11-18 12:06:24 +08:00
|
|
|
|
this.list = response.data.list;
|
|
|
|
|
this.total = response.data.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
},
|
2022-01-11 20:17:01 +08:00
|
|
|
|
/** 取消按钮 */
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
2022-01-01 19:31:16 +08:00
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
2022-01-11 20:17:01 +08:00
|
|
|
|
this.form = {
|
2022-01-12 00:33:50 +08:00
|
|
|
|
id: undefined,
|
2022-01-11 20:17:01 +08:00
|
|
|
|
key: undefined,
|
|
|
|
|
name: undefined,
|
2022-01-12 00:33:50 +08:00
|
|
|
|
description: undefined,
|
|
|
|
|
formType: undefined,
|
|
|
|
|
formId: undefined,
|
|
|
|
|
formCustomCreatePath: undefined,
|
|
|
|
|
formCustomViewPath: undefined
|
2022-01-11 20:17:01 +08:00
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
2021-11-18 12:06:24 +08:00
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNo = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.dateRange = [];
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
2022-01-03 01:12:36 +08:00
|
|
|
|
/** 新增按钮操作 */
|
2022-01-01 19:31:16 +08:00
|
|
|
|
handleAdd() {
|
2022-01-11 20:17:01 +08:00
|
|
|
|
this.reset();
|
2022-01-12 00:33:50 +08:00
|
|
|
|
this.title = "新建模型";
|
2022-01-11 20:17:01 +08:00
|
|
|
|
this.open = true;
|
2021-11-18 18:23:56 +08:00
|
|
|
|
},
|
2022-01-03 01:12:36 +08:00
|
|
|
|
/** 修改按钮操作 */
|
2022-01-01 19:31:16 +08:00
|
|
|
|
handleUpdate(row) {
|
2022-01-12 00:33:50 +08:00
|
|
|
|
this.reset();
|
|
|
|
|
this.title = "修改模型";
|
|
|
|
|
this.open = true;
|
|
|
|
|
// 设置 form
|
|
|
|
|
this.form = {
|
|
|
|
|
...row
|
|
|
|
|
};
|
|
|
|
|
// 触发一次校验
|
2022-01-12 00:38:57 +08:00
|
|
|
|
// this.$refs["form"].validate();
|
2022-01-12 00:33:50 +08:00
|
|
|
|
},
|
|
|
|
|
/** 设计按钮操作 */
|
|
|
|
|
handleDesign(row) {
|
2022-01-03 01:12:36 +08:00
|
|
|
|
this.$router.push({
|
2022-01-12 00:33:50 +08:00
|
|
|
|
path:"/bpm/manager/model/design",
|
2022-01-03 01:12:36 +08:00
|
|
|
|
query:{
|
|
|
|
|
modelId: row.id
|
|
|
|
|
}
|
|
|
|
|
});
|
2021-11-18 18:23:56 +08:00
|
|
|
|
},
|
2022-01-11 20:17:01 +08:00
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (!valid) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2022-01-12 00:33:50 +08:00
|
|
|
|
// 更新
|
|
|
|
|
if (this.form.id) {
|
|
|
|
|
updateModel({
|
|
|
|
|
...this.form,
|
|
|
|
|
formId: this.form.formType === 10 ? this.form.formId : undefined,
|
|
|
|
|
formCustomCreatePath: this.form.formType === 20 ? this.form.formCustomCreatePath : undefined,
|
|
|
|
|
formCustomViewPath: this.form.formType === 20 ? this.form.formCustomViewPath : undefined,
|
|
|
|
|
}).then(response => {
|
|
|
|
|
this.msgSuccess("修改模型成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 创建
|
2022-01-11 20:17:01 +08:00
|
|
|
|
createModel(this.form).then(response => {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
2022-01-14 00:21:34 +08:00
|
|
|
|
this.$alert('<strong>新建模型成功!</strong>后续需要执行如下 4 个步骤:' +
|
|
|
|
|
'<div>1. 点击【修改流程】按钮,配置流程的分类、表单信息</div>' +
|
|
|
|
|
'<div>2. 点击【设计流程】按钮,绘制流程图</div>' +
|
|
|
|
|
'<div>3. 点击【分配规则】按钮,设置每个用户任务的审批人</div>' +
|
|
|
|
|
'<div>4. 点击【发布流程】按钮,完成流程的最终发布</div>' +
|
|
|
|
|
'另外,每次流程修改后,都需要点击【发布流程】按钮,才能正式生效!!!',
|
|
|
|
|
'重要提示', {
|
|
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
2022-01-11 20:17:01 +08:00
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
2022-01-03 01:12:36 +08:00
|
|
|
|
/** 删除按钮操作 */
|
2022-01-01 22:03:17 +08:00
|
|
|
|
handleDelete(row) {
|
2021-11-18 18:23:56 +08:00
|
|
|
|
const that = this;
|
|
|
|
|
this.$confirm('是否删除该流程!!', "警告", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning"
|
|
|
|
|
}).then(function() {
|
2022-01-01 19:31:16 +08:00
|
|
|
|
deleteModel(row.id).then(response => {
|
2021-11-18 18:23:56 +08:00
|
|
|
|
that.getList();
|
|
|
|
|
that.msgSuccess("删除成功");
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
2022-01-03 01:12:36 +08:00
|
|
|
|
/** 部署按钮操作 */
|
2022-01-01 22:03:17 +08:00
|
|
|
|
handleDeploy(row) {
|
2021-11-18 18:23:56 +08:00
|
|
|
|
const that = this;
|
|
|
|
|
this.$confirm('是否部署该流程!!', "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "success"
|
|
|
|
|
}).then(function() {
|
2022-01-01 22:03:17 +08:00
|
|
|
|
deployModel(row.id).then(response => {
|
2021-11-18 18:23:56 +08:00
|
|
|
|
that.getList();
|
|
|
|
|
that.msgSuccess("部署成功");
|
|
|
|
|
})
|
|
|
|
|
})
|
2022-01-02 12:56:34 +08:00
|
|
|
|
},
|
|
|
|
|
/** 流程表单的详情按钮操作 */
|
|
|
|
|
handleFormDetail(row) {
|
|
|
|
|
getForm(row.formId).then(response => {
|
|
|
|
|
// 设置值
|
|
|
|
|
const data = response.data
|
|
|
|
|
this.detailForm = {
|
|
|
|
|
...JSON.parse(data.conf),
|
|
|
|
|
fields: decodeFields(data.fields)
|
|
|
|
|
}
|
|
|
|
|
// 弹窗打开
|
|
|
|
|
this.detailOpen = true
|
|
|
|
|
})
|
|
|
|
|
},
|
2022-01-03 02:41:24 +08:00
|
|
|
|
/** 流程图的详情按钮操作 */
|
|
|
|
|
handleBpmnDetail(row) {
|
|
|
|
|
getModel(row.id).then(response => {
|
|
|
|
|
this.bpmnXML = response.data.bpmnXml
|
|
|
|
|
// 弹窗打开
|
|
|
|
|
this.showBpmnOpen = true
|
|
|
|
|
})
|
|
|
|
|
},
|
2022-01-03 05:41:05 +08:00
|
|
|
|
/** 跳转流程定义的列表 */
|
|
|
|
|
handleDefinitionList(row) {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path:"/bpm/manager/definition",
|
|
|
|
|
query:{
|
|
|
|
|
key: row.key
|
|
|
|
|
}
|
|
|
|
|
});
|
2022-01-03 12:26:04 +08:00
|
|
|
|
},
|
|
|
|
|
/** 更新状态操作 */
|
|
|
|
|
handleChangeState(row) {
|
|
|
|
|
const id = row.id;
|
|
|
|
|
let state = row.processDefinition.suspensionState;
|
|
|
|
|
let statusState = state === 1 ? '激活' : '挂起';
|
|
|
|
|
this.$confirm('是否确认' + statusState + '流程名字为"' + row.name + '"的数据项?', "警告", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning"
|
|
|
|
|
}).then(function() {
|
|
|
|
|
return updateModelState(id, state);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.msgSuccess(statusState + "成功");
|
|
|
|
|
})
|
|
|
|
|
},
|
2022-01-03 18:46:00 +08:00
|
|
|
|
/** 导入按钮操作 */
|
|
|
|
|
handleImport() {
|
|
|
|
|
this.upload.open = true;
|
|
|
|
|
},
|
|
|
|
|
// 文件上传中处理
|
|
|
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
|
|
|
this.upload.isUploading = true;
|
|
|
|
|
},
|
|
|
|
|
// 文件上传成功处理
|
|
|
|
|
handleFileSuccess(response, file, fileList) {
|
|
|
|
|
if (response.code !== 0) {
|
|
|
|
|
this.msgError(response.msg)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 重置表单
|
|
|
|
|
this.uploadClose();
|
|
|
|
|
// 提示,并刷新
|
2022-01-12 00:33:50 +08:00
|
|
|
|
this.msgSuccess("导入流程成功!请点击【设计流程】按钮,进行编辑保存后,才可以进行【发布流程】");
|
2022-01-03 18:46:00 +08:00
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
uploadClose() {
|
|
|
|
|
// 关闭弹窗
|
|
|
|
|
this.upload.open = false;
|
|
|
|
|
// 重置上传状态和文件
|
|
|
|
|
this.upload.isUploading = false;
|
|
|
|
|
this.$refs.upload.clearFiles();
|
|
|
|
|
// 重置表单
|
|
|
|
|
this.upload.form = {};
|
|
|
|
|
this.resetForm("uploadForm");
|
|
|
|
|
},
|
|
|
|
|
/** 提交上传文件 */
|
|
|
|
|
submitFileForm() {
|
|
|
|
|
this.$refs["uploadForm"].validate(valid => {
|
|
|
|
|
if (!valid) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
|
})
|
|
|
|
|
},
|
2022-01-13 00:56:57 +08:00
|
|
|
|
// ========== ==========
|
|
|
|
|
doGetTaskAssignRuleList() {
|
|
|
|
|
this.taskAssignRule.loading = true;
|
|
|
|
|
getTaskAssignRuleList({
|
|
|
|
|
modelId: this.taskAssignRule.row.id
|
|
|
|
|
}).then(response => {
|
|
|
|
|
this.taskAssignRule.loading = false;
|
|
|
|
|
this.taskAssignRule.list = response.data;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 处理任务分配规则列表的按钮操作 */
|
|
|
|
|
handleAssignRule(row) {
|
|
|
|
|
this.taskAssignRule.row = row;
|
|
|
|
|
this.taskAssignRule.listOpen = true;
|
|
|
|
|
this.doGetTaskAssignRuleList();
|
|
|
|
|
// 获得角色列表
|
|
|
|
|
this.taskAssignRule.roleOptions = [];
|
|
|
|
|
listSimpleRoles().then(response => {
|
|
|
|
|
this.taskAssignRule.roleOptions.push(...response.data);
|
|
|
|
|
});
|
2022-01-14 00:21:34 +08:00
|
|
|
|
// 获得部门列表
|
|
|
|
|
this.taskAssignRule.deptOptions = [];
|
|
|
|
|
this.taskAssignRule.deptTreeOptions = [];
|
|
|
|
|
listSimpleDepts().then(response => {
|
|
|
|
|
// 处理 roleOptions 参数
|
|
|
|
|
this.taskAssignRule.deptOptions.push(...response.data);
|
|
|
|
|
this.taskAssignRule.deptTreeOptions.push(...this.handleTree(response.data, "id"));
|
|
|
|
|
});
|
2022-01-13 00:56:57 +08:00
|
|
|
|
},
|
|
|
|
|
/** 处理修改任务分配规则的按钮操作 */
|
|
|
|
|
handleUpdateTaskAssignRule(row) {
|
2022-01-13 10:16:28 +08:00
|
|
|
|
// 先重置标识
|
|
|
|
|
this.resetAssignRuleForm();
|
|
|
|
|
// 设置表单
|
2022-01-13 00:56:57 +08:00
|
|
|
|
this.taskAssignRule.form = {
|
|
|
|
|
...row,
|
2022-01-13 21:23:00 +08:00
|
|
|
|
options: [],
|
|
|
|
|
roleIds: [],
|
2022-01-14 00:21:34 +08:00
|
|
|
|
deptIds: [],
|
2022-01-13 00:56:57 +08:00
|
|
|
|
};
|
2022-01-13 13:21:54 +08:00
|
|
|
|
// 将 options 赋值到对应的 roleIds 等选项
|
2022-01-13 00:56:57 +08:00
|
|
|
|
if (row.type === 10) {
|
2022-01-13 21:23:00 +08:00
|
|
|
|
this.taskAssignRule.form.roleIds.push(...row.options);
|
2022-01-14 00:21:34 +08:00
|
|
|
|
} else if (row.type === 20 || row.type === 21) {
|
|
|
|
|
this.taskAssignRule.form.deptIds.push(...row.options);
|
2022-01-13 00:56:57 +08:00
|
|
|
|
}
|
|
|
|
|
this.taskAssignRule.open = true;
|
2022-01-13 10:16:28 +08:00
|
|
|
|
},
|
|
|
|
|
/** 提交任务分配规则的表单 */
|
|
|
|
|
submitAssignRuleForm() {
|
|
|
|
|
this.$refs["taskAssignRuleForm"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
// 构建表单
|
|
|
|
|
let form = {
|
|
|
|
|
...this.taskAssignRule.form,
|
|
|
|
|
taskDefinitionName: undefined,
|
|
|
|
|
};
|
2022-01-13 13:21:54 +08:00
|
|
|
|
// 将 roleIds 等选项赋值到 options 中
|
2022-01-13 10:16:28 +08:00
|
|
|
|
if (form.type === 10) {
|
|
|
|
|
form.options = form.roleIds;
|
2022-01-14 00:21:34 +08:00
|
|
|
|
} else if (form.type === 20 || form.type === 21) {
|
|
|
|
|
form.options = form.deptIds;
|
2022-01-13 10:16:28 +08:00
|
|
|
|
}
|
|
|
|
|
form.roleIds = undefined;
|
2022-01-14 00:21:34 +08:00
|
|
|
|
form.deptIds = undefined;
|
2022-01-13 10:16:28 +08:00
|
|
|
|
// 新增
|
|
|
|
|
if (!form.id) {
|
2022-01-13 13:21:54 +08:00
|
|
|
|
form.modelId = this.taskAssignRule.row.id // 模型编号
|
2022-01-13 10:16:28 +08:00
|
|
|
|
createTaskAssignRule(form).then(response => {
|
|
|
|
|
this.msgSuccess("修改成功");
|
|
|
|
|
this.taskAssignRule.open = false;
|
|
|
|
|
this.doGetTaskAssignRuleList();
|
|
|
|
|
});
|
|
|
|
|
// 修改
|
|
|
|
|
} else {
|
|
|
|
|
form.taskDefinitionKey = undefined; // 无法修改
|
|
|
|
|
updateTaskAssignRule(form).then(response => {
|
|
|
|
|
this.msgSuccess("修改成功");
|
|
|
|
|
this.taskAssignRule.open = false;
|
|
|
|
|
this.doGetTaskAssignRuleList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 取消任务分配规则的表单 */
|
|
|
|
|
cancelAssignRuleForm() {
|
|
|
|
|
this.taskAssignRule.open = false;
|
|
|
|
|
this.resetAssignRuleForm();
|
|
|
|
|
},
|
2022-01-13 13:21:54 +08:00
|
|
|
|
/** 表单重置 */
|
2022-01-13 10:16:28 +08:00
|
|
|
|
resetAssignRuleForm() {
|
|
|
|
|
this.taskAssignRule.form = {};
|
|
|
|
|
this.resetForm("taskAssignRuleForm");
|
2022-01-13 13:21:54 +08:00
|
|
|
|
},
|
|
|
|
|
getAssignRuleOptionName(type, option) {
|
|
|
|
|
if (type === 10) {
|
|
|
|
|
for (const roleOption of this.taskAssignRule.roleOptions) {
|
|
|
|
|
if (roleOption.id === option) {
|
|
|
|
|
return roleOption.name;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-01-14 00:21:34 +08:00
|
|
|
|
} else if (type === 20 || type === 21) {
|
|
|
|
|
for (const deptOption of this.taskAssignRule.deptOptions) {
|
|
|
|
|
if (deptOption.id === option) {
|
|
|
|
|
return deptOption.name;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-01-13 13:21:54 +08:00
|
|
|
|
}
|
|
|
|
|
return '未知(' + option + ')';
|
2022-01-14 00:21:34 +08:00
|
|
|
|
},
|
|
|
|
|
// 格式化部门的下拉框
|
|
|
|
|
normalizer(node) {
|
|
|
|
|
return {
|
|
|
|
|
id: node.id,
|
|
|
|
|
label: node.name,
|
|
|
|
|
children: node.children
|
|
|
|
|
}
|
2022-01-13 00:56:57 +08:00
|
|
|
|
}
|
2021-11-18 12:06:24 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
2022-01-03 02:41:24 +08:00
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
.my-process-designer {
|
|
|
|
|
height: calc(100vh - 200px);
|
|
|
|
|
}
|
|
|
|
|
</style>
|