dev_xds
姜玉琦 2023-09-07 23:40:35 +08:00
commit c135996e8d
7 changed files with 129 additions and 72 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) {
return request({

View File

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

View File

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

View File

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

View File

@ -411,11 +411,13 @@ export default {
},
methods: {
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) {
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;
},
closeViewer() {

View File

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

View File

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