Compare commits

..

No commits in common. "bb9a4715662975bf6af35936528e50f55a560a65" and "a3c282cdd0047d8f8029baa921b7de31e7574634" have entirely different histories.

8 changed files with 351 additions and 129 deletions

View File

@ -9,15 +9,6 @@ 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,16 +22,9 @@ const getZgsDeptList = () => {
}) })
} }
// 获取项目 // 获取项目
const getProjectList = () => {
return request({
url: '/publics/projectList',
method: 'get'
})
}
// 获取和我相关的项目信息
const getMyProjectList = () => { const getMyProjectList = () => {
return request({ return request({
url: '/publics/findMyProjectList', url: '/publics/projectList',
method: 'get' method: 'get'
}) })
} }
@ -72,7 +65,6 @@ export default{
getMyDeptList, getMyDeptList,
getDeptTree, getDeptTree,
getZgsDeptList, getZgsDeptList,
getProjectList,
getMyProjectList, getMyProjectList,
getUserList, getUserList,
queryUnitList, queryUnitList,

View File

@ -1,12 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
: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"
@ -17,48 +11,35 @@
/> />
</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 type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
>搜索</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 <el-table v-show="checkType === 'multiple'" ref="dataTable" v-loading="loading" :data="roleList" @selection-change="handleMultipleRoleSelect">
v-show="checkType === 'multiple'" <el-table-column type="selection" width="50" align="center" />
ref="dataTable" <el-table-column label="角色编号" prop="roleId" width="120" />
v-loading="loading" <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
:data="roleList" <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
@selection-change="handleMultipleRoleSelect" <el-table-column label="显示顺序" prop="roleSort" width="100" />
> <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 <el-table v-show="checkType === 'single'" v-loading="loading" :data="roleList" @current-change="handleSingleRoleSelect">
v-show="checkType === 'single'" <el-table-column width="55" align="center" >
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" /> <el-table-column label="角色编号" prop="roleId" width="120" />
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" /> <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" /> <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
<el-table-column label="显示顺序" prop="roleSort" /> <el-table-column label="显示顺序" prop="roleSort" width="100" />
<el-table-column label="创建时间" align="center" prop="createTime"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
@ -66,9 +47,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"
@ -77,34 +58,25 @@
</template> </template>
<script> <script>
import { import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
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() {
@ -133,12 +105,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: {
@ -146,31 +118,30 @@ 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( this.$refs.dataTable.toggleRowSelection(newVal.find(
newVal.find((item) => key == item.roleId), item => key == item.roleId
true ), true)
);
}); });
}); });
} }
}, },
immediate: true, // immediate: true, //
deep: true, // deep: true //
}, }
}, },
created() { created() {
this.getList(); this.getList();
@ -179,23 +150,24 @@ 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() {
@ -206,7 +178,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
@keyup.enter.native="handleQuery"
size="small" size="small"
@keyup.enter.native="handleQuery"
/> />
</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"
placeholder="请选择流程分类"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
placeholder="请选择流程分类"
clearable clearable
> >
<el-option <el-option
@ -84,12 +84,6 @@
@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"
@ -117,8 +111,8 @@
> >
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="当前节点" align="center" prop="taskName" />
<el-table-column label="耗时" align="center" prop="duration" width="180" /> <el-table-column label="耗时" align="center" prop="duration" width="180" />
<el-table-column label="当前节点" align="center" prop="taskName" />
<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"
@ -177,13 +171,13 @@
placeholder="请输入流程名称" placeholder="请输入流程名称"
clearable clearable
size="small" size="small"
@keyup.enter.native="handleProcessQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="流程分类" prop="category"> <el-form-item label="流程分类" prop="category">
<el-select <el-select
v-model="queryProcessParams.category" v-model="queryParams.category"
@keyup.enter.native="handleProcessQuery" @keyup.enter.native="handleQuery"
placeholder="请选择流程分类" placeholder="请选择流程分类"
clearable clearable
> >
@ -209,7 +203,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" width="280" /> <el-table-column label="流程名称" align="center" prop="name" />
<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>
@ -238,10 +232,9 @@
:total="processTotal" :total="processTotal"
:page.sync="queryProcessParams.pageNum" :page.sync="queryProcessParams.pageNum"
:limit.sync="queryProcessParams.pageSize" :limit.sync="queryProcessParams.pageSize"
@pagination="myDefinitionList" @pagination="listDefinition"
/> />
</el-dialog> </el-dialog>
<initTaskDrawer ref="initTaskDrawer" :closeCallBack="getList"></initTaskDrawer>
</div> </div>
</template> </template>
@ -255,12 +248,11 @@ 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 { myDefinitionList } from "@/api/flowable/definition"; import { listDefinition } 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: { initTaskDrawer }, components: {},
data() { data() {
return { return {
// //
@ -366,7 +358,7 @@ export default {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleProcessQuery() { handleProcessQuery() {
this.queryProcessParams.pageNum = 1; this.queryProcessParams.pageNum = 1;
this.myDefinitionList(); this.listDefinition();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetProcessQuery() { resetProcessQuery() {
@ -383,10 +375,10 @@ export default {
handleAdd() { handleAdd() {
this.open = true; this.open = true;
this.title = "发起流程"; this.title = "发起流程";
this.myDefinitionList(); this.listDefinition();
}, },
myDefinitionList() { listDefinition() {
myDefinitionList(this.queryProcessParams).then((response) => { listDefinition(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;
@ -394,15 +386,13 @@ export default {
}, },
/** 发起流程申请 */ /** 发起流程申请 */
handleStartProcess(row) { handleStartProcess(row) {
this.open = false; this.$router.push({
this.$refs.initTaskDrawer.show(row); path: "/flowable/task/myProcess/send/index",
// this.$router.push({ query: {
// path: "/flowable/task/myProcess/send/index", deployId: row.deploymentId,
// query: { procDefId: row.id,
// deployId: row.deploymentId, },
// procDefId: row.id, });
// },
// });
}, },
/** 取消流程申请 */ /** 取消流程申请 */
handleStop(row) { handleStop(row) {

View File

@ -0,0 +1,279 @@
<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,13 +411,11 @@ export default {
}, },
methods: { methods: {
getImageUrl(url) { getImageUrl(url) {
return process.env.VUE_APP_BASE_API + url.split(",")[0] + ".min.jpg"; return process.env.VUE_APP_BASE_API + url + ".min.jpg";
}, },
onPreview(url) { onPreview(url) {
this.previewList = []; this.previewList = [];
url.split(",").forEach((item) => { this.previewList.push(process.env.VUE_APP_BASE_API + url);
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.getProjectList(param).then(response => { this.$api.publics.getMyProjectList(param).then(response => {
this.projectOptions = response.rows this.projectOptions = response.rows
}) })
}, },

View File

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