提交代码

dev_xds
姜玉琦 2023-09-07 22:14:21 +08:00
parent 0f0ab5dc80
commit 9b73771165
8 changed files with 129 additions and 351 deletions

View File

@ -9,6 +9,15 @@ export function listDefinition(query) {
}) })
} }
// 查询流程定义我的角色相关列表
export function myDefinitionList(query) {
return request({
url: '/flowable/definition/myList',
method: 'get',
params: query
})
}
// 部署流程实例 // 部署流程实例
export function definitionStart(procDefId, data) { export function definitionStart(procDefId, data) {
return request({ return request({

View File

@ -22,12 +22,19 @@ const getZgsDeptList = () => {
}) })
} }
// 获取项目 // 获取项目
const getMyProjectList = () => { const getProjectList = () => {
return request({ return request({
url: '/publics/projectList', url: '/publics/projectList',
method: 'get' method: 'get'
}) })
} }
// 获取和我相关的项目信息
const getMyProjectList = () => {
return request({
url: '/publics/findMyProjectList',
method: 'get'
})
}
// 获取人员 // 获取人员
const getUserList = (data) => { const getUserList = (data) => {
return request({ return request({
@ -65,6 +72,7 @@ export default{
getMyDeptList, getMyDeptList,
getDeptTree, getDeptTree,
getZgsDeptList, getZgsDeptList,
getProjectList,
getMyProjectList, getMyProjectList,
getUserList, getUserList,
queryUnitList, queryUnitList,

View File

@ -1,6 +1,12 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
>
<el-form-item label="角色名称" prop="roleName"> <el-form-item label="角色名称" prop="roleName">
<el-input <el-input
v-model="queryParams.roleName" v-model="queryParams.roleName"
@ -11,35 +17,48 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-show="checkType === 'multiple'" ref="dataTable" v-loading="loading" :data="roleList" @selection-change="handleMultipleRoleSelect"> <el-table
<el-table-column type="selection" width="50" align="center" /> v-show="checkType === 'multiple'"
<el-table-column label="角色编号" prop="roleId" width="120" /> ref="dataTable"
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" /> v-loading="loading"
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" /> :data="roleList"
<el-table-column label="显示顺序" prop="roleSort" width="100" /> @selection-change="handleMultipleRoleSelect"
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> >
<el-table-column width="55" type="selection" align="center" />
<el-table-column label="角色编号" prop="roleId" />
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" />
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" />
<el-table-column label="显示顺序" prop="roleSort" />
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-table v-show="checkType === 'single'" v-loading="loading" :data="roleList" @current-change="handleSingleRoleSelect"> <el-table
<el-table-column width="55" align="center" > v-show="checkType === 'single'"
v-loading="loading"
:data="roleList"
@current-change="handleSingleRoleSelect"
>
<el-table-column width="55" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 可以手动的修改label的值从而控制选择哪一项 --> <!-- 可以手动的修改label的值从而控制选择哪一项 -->
<el-radio v-model="radioSelected" :label="scope.row.roleId">{{''}}</el-radio> <el-radio v-model="radioSelected" :label="scope.row.roleId">{{ "" }}</el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="角色编号" prop="roleId" width="120" /> <el-table-column label="角色编号" prop="roleId" />
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" /> <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" />
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" /> <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" />
<el-table-column label="显示顺序" prop="roleSort" width="100" /> <el-table-column label="显示顺序" prop="roleSort" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
@ -47,9 +66,9 @@
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page-sizes="[5,10]" :page-sizes="[5, 10]"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
@ -58,25 +77,34 @@
</template> </template>
<script> <script>
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"; import {
listRole,
getRole,
delRole,
addRole,
updateRole,
dataScope,
changeRoleStatus,
deptTreeSelect,
} from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"; import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import {StrUtil} from "@/utils/StrUtil"; import { StrUtil } from "@/utils/StrUtil";
export default { export default {
name: "FlowRole", name: "FlowRole",
dicts: ['sys_normal_disable'], dicts: ["sys_normal_disable"],
// //
props: { props: {
// //
selectValues: { selectValues: {
type: Number | String | Array, type: Number | String | Array,
default: null, default: null,
required: false required: false,
}, },
checkType: { checkType: {
type: String, type: String,
default: 'multiple', default: "multiple",
required: false required: false,
}, },
}, },
data() { data() {
@ -105,12 +133,12 @@ export default {
pageSize: 5, pageSize: 5,
roleName: undefined, roleName: undefined,
roleKey: undefined, roleKey: undefined,
status: undefined status: undefined,
}, },
// //
form: {}, form: {},
radioSelected: null, // radioSelected: null, //
selectRoleList: [] // selectRoleList: [], //
}; };
}, },
watch: { watch: {
@ -118,30 +146,31 @@ export default {
handler(newVal) { handler(newVal) {
if (StrUtil.isNotBlank(newVal)) { if (StrUtil.isNotBlank(newVal)) {
if (newVal instanceof Number || newVal instanceof String) { if (newVal instanceof Number || newVal instanceof String) {
this.radioSelected = newVal this.radioSelected = newVal;
} else { } else {
this.selectRoleList = newVal; this.selectRoleList = newVal;
} }
} }
}, },
immediate: true immediate: true,
}, },
roleList: { roleList: {
handler(newVal) { handler(newVal) {
if (StrUtil.isNotBlank(newVal) && this.selectRoleList.length > 0) { if (StrUtil.isNotBlank(newVal) && this.selectRoleList.length > 0) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.dataTable.clearSelection(); this.$refs.dataTable.clearSelection();
this.selectRoleList?.split(',').forEach(key => { this.selectRoleList?.split(",").forEach((key) => {
this.$refs.dataTable.toggleRowSelection(newVal.find( this.$refs.dataTable.toggleRowSelection(
item => key == item.roleId newVal.find((item) => key == item.roleId),
), true) true
);
}); });
}); });
} }
}, },
immediate: true, // immediate: true, //
deep: true // deep: true, //
} },
}, },
created() { created() {
this.getList(); this.getList();
@ -150,24 +179,23 @@ export default {
/** 查询角色列表 */ /** 查询角色列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listRole(this.queryParams).then(response => { listRole(this.queryParams).then((response) => {
this.roleList = response.rows; this.roleList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
} });
);
}, },
// //
handleMultipleRoleSelect(selection) { handleMultipleRoleSelect(selection) {
const idList = selection.map(item => item.roleId); const idList = selection.map((item) => item.roleId);
const nameList = selection.map(item => item.roleName); const nameList = selection.map((item) => item.roleName);
this.$emit('handleRoleSelect', idList.join(','), nameList.join(',')); this.$emit("handleRoleSelect", idList.join(","), nameList.join(","));
}, },
// //
handleSingleRoleSelect(selection) { handleSingleRoleSelect(selection) {
this.radioSelected = selection.roleId; this.radioSelected = selection.roleId;
const roleName = selection.roleName; const roleName = selection.roleName;
this.$emit('handleRoleSelect', this.radioSelected.toString(), roleName); this.$emit("handleRoleSelect", this.radioSelected.toString(), roleName);
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -178,7 +206,7 @@ export default {
resetQuery() { resetQuery() {
this.handleQuery(); this.handleQuery();
}, },
} },
}; };
</script> </script>
<style> <style>

View File

@ -12,15 +12,15 @@
v-model="queryParams.name" v-model="queryParams.name"
placeholder="请输入流程名称" placeholder="请输入流程名称"
clearable clearable
size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
size="small"
/> />
</el-form-item> </el-form-item>
<el-form-item label="流程分类" prop="category"> <el-form-item label="流程分类" prop="category">
<el-select <el-select
v-model="queryParams.category" v-model="queryParams.category"
@keyup.enter.native="handleQuery"
placeholder="请选择流程分类" placeholder="请选择流程分类"
@keyup.enter.native="handleQuery"
clearable clearable
> >
<el-option <el-option
@ -84,6 +84,12 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column
label="项目名称"
align="left"
prop="projectName"
:show-overflow-tooltip="true"
/>
<el-table-column <el-table-column
label="流程编号" label="流程编号"
align="center" align="center"
@ -111,8 +117,8 @@
> >
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="耗时" align="center" prop="duration" width="180" />
<el-table-column label="当前节点" align="center" prop="taskName" /> <el-table-column label="当前节点" align="center" prop="taskName" />
<el-table-column label="耗时" align="center" prop="duration" width="180" />
<el-table-column label="办理人" align="center"> <el-table-column label="办理人" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<label v-if="scope.row.assigneeName" <label v-if="scope.row.assigneeName"
@ -171,13 +177,13 @@
placeholder="请输入流程名称" placeholder="请输入流程名称"
clearable clearable
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleProcessQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="流程分类" prop="category"> <el-form-item label="流程分类" prop="category">
<el-select <el-select
v-model="queryParams.category" v-model="queryProcessParams.category"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleProcessQuery"
placeholder="请选择流程分类" placeholder="请选择流程分类"
clearable clearable
> >
@ -203,7 +209,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="processLoading" fit :data="definitionList" border> <el-table v-loading="processLoading" fit :data="definitionList" border>
<el-table-column label="流程名称" align="center" prop="name" /> <el-table-column label="流程名称" align="center" prop="name" width="280" />
<el-table-column label="流程版本" align="center"> <el-table-column label="流程版本" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag size="medium">v{{ scope.row.version }}</el-tag> <el-tag size="medium">v{{ scope.row.version }}</el-tag>
@ -232,9 +238,10 @@
:total="processTotal" :total="processTotal"
:page.sync="queryProcessParams.pageNum" :page.sync="queryProcessParams.pageNum"
:limit.sync="queryProcessParams.pageSize" :limit.sync="queryProcessParams.pageSize"
@pagination="listDefinition" @pagination="myDefinitionList"
/> />
</el-dialog> </el-dialog>
<initTaskDrawer ref="initTaskDrawer" :closeCallBack="getList"></initTaskDrawer>
</div> </div>
</template> </template>
@ -248,11 +255,12 @@ import {
flowRecord, flowRecord,
} from "@/api/flowable/finished"; } from "@/api/flowable/finished";
import { myProcessList, stopProcess } from "@/api/flowable/process"; import { myProcessList, stopProcess } from "@/api/flowable/process";
import { listDefinition } from "@/api/flowable/definition"; import { myDefinitionList } from "@/api/flowable/definition";
import initTaskDrawer from "./initTaskDrawer.vue";
export default { export default {
name: "Deploy", name: "Deploy",
dicts: ["sys_process_category"], dicts: ["sys_process_category"],
components: {}, components: { initTaskDrawer },
data() { data() {
return { return {
// //
@ -358,7 +366,7 @@ export default {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleProcessQuery() { handleProcessQuery() {
this.queryProcessParams.pageNum = 1; this.queryProcessParams.pageNum = 1;
this.listDefinition(); this.myDefinitionList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetProcessQuery() { resetProcessQuery() {
@ -375,10 +383,10 @@ export default {
handleAdd() { handleAdd() {
this.open = true; this.open = true;
this.title = "发起流程"; this.title = "发起流程";
this.listDefinition(); this.myDefinitionList();
}, },
listDefinition() { myDefinitionList() {
listDefinition(this.queryProcessParams).then((response) => { myDefinitionList(this.queryProcessParams).then((response) => {
this.definitionList = response.data.records; this.definitionList = response.data.records;
this.processTotal = response.data.total; this.processTotal = response.data.total;
this.processLoading = false; this.processLoading = false;
@ -386,13 +394,15 @@ export default {
}, },
/** 发起流程申请 */ /** 发起流程申请 */
handleStartProcess(row) { handleStartProcess(row) {
this.$router.push({ this.open = false;
path: "/flowable/task/myProcess/send/index", this.$refs.initTaskDrawer.show(row);
query: { // this.$router.push({
deployId: row.deploymentId, // path: "/flowable/task/myProcess/send/index",
procDefId: row.id, // query: {
}, // deployId: row.deploymentId,
}); // procDefId: row.id,
// },
// });
}, },
/** 取消流程申请 */ /** 取消流程申请 */
handleStop(row) { handleStop(row) {

View File

@ -1,279 +0,0 @@
<template>
<div class="app-container">
<el-card
class="box-card"
v-for="dict in dict.type.sys_process_category"
:key="dict.value"
>
<div slot="header" class="clearfix">
<span>{{ dict.label }}</span>
</div>
<div :key="o" class="text item">
{{ "列表内容 " + o }}
</div>
</el-card>
</div>
</template>
<script>
import {
getDeployment,
delDeployment,
addDeployment,
updateDeployment,
exportDeployment,
flowRecord,
} from "@/api/flowable/finished";
import { myProcessList, stopProcess } from "@/api/flowable/process";
import { listDefinition } from "@/api/flowable/definition";
export default {
name: "Deploy",
dicts: ["sys_process_category"],
components: {},
data() {
return {
//
loading: true,
processLoading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
processTotal: 0,
//
myProcessList: [],
//
title: "",
//
open: false,
src: "",
definitionList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
category: null,
key: null,
tenantId: null,
deployTime: null,
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null,
},
//
queryProcessParams: {
pageNum: 1,
pageSize: 10,
name: null,
category: null,
key: null,
tenantId: null,
deployTime: null,
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null,
},
//
form: {},
//
rules: {},
processCategoryList: [],
};
},
created() {
this.getList();
},
methods: {
/** 查询流程定义列表 */
getList() {
this.loading = true;
myProcessList(this.queryParams).then((response) => {
this.myProcessList = response.data.records;
this.total = response.data.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
category: null,
key: null,
tenantId: null,
deployTime: null,
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 搜索按钮操作 */
handleProcessQuery() {
this.queryProcessParams.pageNum = 1;
this.listDefinition();
},
/** 重置按钮操作 */
resetProcessQuery() {
this.resetForm("queryProcessForm");
this.handleProcessQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.procInsId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.open = true;
this.title = "发起流程";
this.listDefinition();
},
listDefinition() {
listDefinition(this.queryProcessParams).then((response) => {
this.definitionList = response.data.records;
this.processTotal = response.data.total;
this.processLoading = false;
});
},
/** 发起流程申请 */
handleStartProcess(row) {
this.$router.push({
path: "/flowable/task/myProcess/send/index",
query: {
deployId: row.deploymentId,
procDefId: row.id,
},
});
},
/** 取消流程申请 */
handleStop(row) {
const params = {
instanceId: row.procInsId,
};
stopProcess(params).then((res) => {
this.$modal.msgSuccess(res.msg);
this.getList();
});
},
/** 流程流转记录 */
handleFlowRecord(row) {
this.$router.push({
path: "/flowable/task/myProcess/detail/index",
query: {
procInsId: row.procInsId,
deployId: row.deployId,
taskId: row.taskId,
},
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getDeployment(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改流程定义";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateDeployment(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDeployment(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.procInsId || this.ids; //
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
return delDeployment(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有流程定义数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
return exportDeployment(queryParams);
})
.then((response) => {
this.download(response.msg);
});
},
},
};
</script>
<style>
.text {
font-size: 14px;
}
.item {
margin-bottom: 18px;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both;
}
.box-card {
width: 28%;
margin-left: 3%;
}
</style>

View File

@ -411,11 +411,13 @@ export default {
}, },
methods: { methods: {
getImageUrl(url) { getImageUrl(url) {
return process.env.VUE_APP_BASE_API + url + ".min.jpg"; return process.env.VUE_APP_BASE_API + url.split(",")[0] + ".min.jpg";
}, },
onPreview(url) { onPreview(url) {
this.previewList = []; this.previewList = [];
this.previewList.push(process.env.VUE_APP_BASE_API + url); url.split(",").forEach((item) => {
this.previewList.push(process.env.VUE_APP_BASE_API + item);
});
this.showViewer = true; this.showViewer = true;
}, },
closeViewer() { closeViewer() {

View File

@ -310,7 +310,7 @@ export default {
data: {} data: {}
} }
// //
this.$api.publics.getMyProjectList(param).then(response => { this.$api.publics.getProjectList(param).then(response => {
this.projectOptions = response.rows this.projectOptions = response.rows
}) })
}, },

View File

@ -415,7 +415,7 @@ export default {
data: {}, data: {},
}; };
// //
this.$api.publics.getMyProjectList(param).then((response) => { this.$api.publics.getProjectList(param).then((response) => {
this.projectOptions = response.rows; this.projectOptions = response.rows;
}); });
}, },