Compare commits

..

4 Commits

16 changed files with 419 additions and 262 deletions

View File

@ -15,8 +15,10 @@
data() { data() {
return {} return {}
}, },
mounted() { created() {
getToken() getToken()
},
mounted() {
let beforeUrl = sessionStorage.getItem('router-path') let beforeUrl = sessionStorage.getItem('router-path')
if(beforeUrl === undefined || beforeUrl === ''){ if(beforeUrl === undefined || beforeUrl === ''){
//this.$router.push("/workPanel") //this.$router.push("/workPanel")

View File

@ -12,3 +12,10 @@ export function startProcessInstance(param) {
data: param data: param
}) })
} }
export function getInitiatedInstanceList() {
return request({
url: "/flowable/process/instance/self",
method: "get",
})
}

View File

@ -5,16 +5,19 @@ import { Notification, MessageBox, Message } from "element-ui";
// 第三方插件 // 第三方插件
import "element-ui/lib/theme-chalk/index.css"; import "element-ui/lib/theme-chalk/index.css";
import da from "element-ui/src/locale/lang/da";
import {getToken} from "../main"; import {getToken} from "../main";
import th from "element-ui/src/locale/lang/th";
Vue.prototype.$axios = axios; Vue.prototype.$axios = axios;
// 字体图标 // 字体图标
export function getBaseUrl(){
// return "http://gateway.mytwins.top"
return "http://localhost:8000"
}
const service = axios.create({ const service = axios.create({
baseURL: "http://localhost:8000", baseURL: getBaseUrl(),
// baseURL: "http://security-react.mytwins.top", // baseURL: "http://gateway.mytwins.top",
// baseURL: "http://gateway.odliken.cn", // baseURL: "http://gateway.odliken.cn",
timeout: 50000 timeout: 50000
}); });

View File

@ -8,6 +8,7 @@ export function getTaskList() {
method: "get", method: "get",
}) })
} }
export function getTaskInfo(taskId) { export function getTaskInfo(taskId) {
return request({ return request({
url: "/flowable/process/task/"+taskId, url: "/flowable/process/task/"+taskId,
@ -21,3 +22,12 @@ export function completeTask(params) {
data: params data: params
}) })
} }
export function addComment(params) {
return request({
url: "/flowable/process/task/comment",
method: "post",
data: params
})
}

View File

@ -1,5 +1,5 @@
<template> <template>
<w-dialog :border="false" closeFree width="500px" :title="title" v-model="visible"> <w-dialog :border="false" closeFree width="500px" :title="title" v-model="visible" @ok="selectConfirm">
<div class="el-textarea"> <div class="el-textarea">
<el-input <el-input
type="textarea" type="textarea"
@ -7,18 +7,18 @@
maxlength="255" maxlength="255"
show-word-limit show-word-limit
placeholder="评论内容" placeholder="评论内容"
v-model="textarea"> v-model="context">
</el-input> </el-input>
</div> </div>
<div style="margin: 20px 0"> <div style="margin: 20px 0">
<el-upload :file-list="fileList" action="#" <el-upload :file-list="imageList" action="#"
:limit="maxSize" with-credentials :limit="imageSize" with-credentials
:multiple="maxSize > 0" :multiple="imageSize > 0"
:data="uploadParams" :data="uploadParams"
list-type="picture-card" list-type="picture-card"
:action="uploadFileUrl" :action="uploadFileUrl"
:headers="headers" :headers="headers"
:auto-upload="false" :auto-upload="true"
:on-success="handleUploadSuccess" :on-success="handleUploadSuccess"
:before-upload="beforeUpload"> :before-upload="beforeUpload">
<i slot="default" class="el-icon-plus"></i> <i slot="default" class="el-icon-plus"></i>
@ -41,9 +41,9 @@
:multiple="attachmentMaxSize > 0" :multiple="attachmentMaxSize > 0"
:action="uploadFileUrl" :action="uploadFileUrl"
:headers="headers" :headers="headers"
:auto-upload="false" :auto-upload="true"
:on-success="handleUploadSuccess" :on-success="handleAttachmentUploadSuccess"
:before-upload="beforeUpload" :before-upload="beforeAttachmentUpload"
> >
<el-button size="small" round> <el-button size="small" round>
<i class="el-icon-paperclip"></i> <i class="el-icon-paperclip"></i>
@ -56,17 +56,18 @@
<script> <script>
import {deleteFile} from "@/api/common"; import {deleteFile} from "@/api/common";
import {getBaseUrl} from "../../api/request";
export default { export default {
name: "Comment", name: "Comment",
props: { props: {
value: { // value: {
type: Array, // type: Array,
default: () => { // default: () => {
return []; // return [];
} // }
}, // },
maxSize: { imageSize: {
type: Number, type: Number,
default: 10 default: 10
}, },
@ -77,51 +78,65 @@ export default {
}, },
computed: { computed: {
sizeTip() { sizeTip() {
return this.maxSize > 0 ? `| 每张图不超过${this.maxSize}MB` : ""; return this.imageSize > 0 ? `| 每张图不超过${this.imageSize}MB` : "";
}, },
attachmentTip() { attachmentTip() {
return this.attachmentMaxSize > 0 ? `| 单个附件不超过${this.attachmentMaxSize}MB` : ""; return this.attachmentMaxSize > 0 ? `| 单个附件不超过${this.attachmentMaxSize}MB` : "";
} }
}, },
created() { created() {
this.fileList = this._value;
console.log(this.value, "images");
}, },
data() { data() {
return { return {
visible: false, visible: false,
title: "添加评论", title: "添加评论",
fileList: [], imageList: [],
attachmentList: [], attachmentList: [],
disabled: false, disabled: false,
uploadParams: {}, uploadParams: {},
uploadFileUrl: "http://security-react.mytwins.top/flowable/process/file", uploadFileUrl: getBaseUrl() + "/flowable/process/file",
headers: { headers: {
authorization: localStorage.getItem("token") authorization: localStorage.getItem("token")
}, },
textarea:'' context: null
}; };
}, },
methods: { methods: {
handleChange(file, fileList) { show() {
this.fileList = fileList.slice(-3); this.visible = true
},
handleChange(file, imageList) {
this.imageList = imageList.slice(-3);
}, },
handleUploadSuccess(res, file) { handleUploadSuccess(res, file) {
if (res.code !== 1000) { if (res.code !== 1000) {
this.$message.error("上传失败"); this.$message.error("上传失败");
} }
let data = res.data; let data = res.data;
this.fileList.push(data); this.imageList.push(data);
this.$emit("input", this.fileList); },
console.log(res, file, this.fileList); handleAttachmentUploadSuccess(res, file) {
if (res.code !== 1000) {
this.$message.error("上传失败");
}
let data = res.data;
this.attachmentList.push(data);
},
beforeAttachmentUpload(file) {
if (this.attachmentMaxSize > 0 && file.size / 1024 / 1024 > this.attachmentMaxSize) {
this.$message.warning(`单张图片最大不超过 ${this.attachmentMaxSize}MB`);
return false;
} else {
return true;
}
}, },
beforeUpload(file) { beforeUpload(file) {
const alows = ["image/jpeg", "image/png", "image/gif", "image/jpg"]; const alows = ["image/jpeg", "image/png", "image/gif", "image/jpg"];
if (alows.indexOf(file.type) === -1) { if (alows.indexOf(file.type) === -1) {
this.$message.warning("存在不支持的图片格式"); this.$message.warning("存在不支持的图片格式");
} else if (this.maxSize > 0 && file.size / 1024 / 1024 > this.maxSize) { } else if (this.imageSize > 0 && file.size / 1024 / 1024 > this.imageSize) {
this.$message.warning(`单张图片最大不超过 ${this.maxSize}MB`); this.$message.warning(`单张图片最大不超过 ${this.imageSize}MB`);
} else { } else {
return true; return true;
} }
@ -133,10 +148,39 @@ export default {
handleDownload(file) { handleDownload(file) {
console.log(file); console.log(file);
}, },
handleRemove(file, fileList) { handleRemove(file, imageList) {
deleteFile(file.id).then(res => { deleteFile(file.id).then(res => {
this.$message.success("删除成功"); this.$message.success("删除成功");
}); });
},
selectConfirm() {
let fileList = []
this.attachmentList.forEach((attachment) => {
fileList.push({
id: attachment.id,
name:attachment.name,
isImage: attachment.isImage,
size: attachment.size,
url: attachment.url
})
})
this.imageList.forEach((image) => {
fileList.push({
id: image.id,
name:image.name,
isImage: image.isImage,
size: image.size,
url: image.url
})
})
let data = {
context: this.context,
attachments:fileList
}
console.log(this.attachmentList, this.imageList)
this.$emit("ok", data)
this.visible = false;
} }
} }
}; };
@ -148,10 +192,11 @@ export default {
height: 65px; height: 65px;
line-height: 70px; line-height: 70px;
} }
/deep/ .el-upload-list--picture-card{
/deep/ .el-upload-list--picture-card {
.is-ready { .is-ready {
width: 65px!important; width: 65px !important;
height: 65px!important; height: 65px !important;
} }
} }

View File

@ -10,10 +10,10 @@
<!-- 部门 --> <!-- 部门 -->
<el-empty :image-size="100" description="似乎没有数据" v-show="deptList.length === 0"/> <el-empty :image-size="100" description="似乎没有数据" v-show="deptList.length === 0"/>
<el-scrollbar style="height:350px"> <el-scrollbar style="height:350px">
<el-tree :data="deptList" ref="tree" empty-text="" node-key="value" default-expand-all <el-tree :data="deptList" ref="tree" :props="deptProps" empty-text="" node-key="deptId" default-expand-all
:show-checkbox="showCheckbox" check-strictly highlight-current :show-checkbox="showCheckbox" check-strictly highlight-current
@check-change="handleCheckChange" @node-click="(node,check)=>handle(node,check)" :filter-node-method="filterNode"> @check-change="handleCheckChange" @node-click="(node,check)=>handle(node,check)" :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }" style="width: 100%"> <div class="custom-tree-node" slot-scope="{ node }" style="width: 100%">
<i class="el-icon-folder-opened" style="margin-right: 5px"></i>{{ node.label }} <i class="el-icon-folder-opened" style="margin-right: 5px"></i>{{ node.label }}
</div> </div>
</el-tree> </el-tree>
@ -29,7 +29,7 @@
<el-empty :image-size="100" description="请点击左侧列表选择数据" v-show="selectList.length === 0"/> <el-empty :image-size="100" description="请点击左侧列表选择数据" v-show="selectList.length === 0"/>
<div v-for="(selectItem, selectIndex) in selectList" :key="selectIndex" class="org-item"> <div v-for="(selectItem, selectIndex) in selectList" :key="selectIndex" class="org-item">
<i class="el-icon-folder-opened"></i> <i class="el-icon-folder-opened"></i>
<span>{{ selectItem.label }}</span> <span>{{ selectItem.deptName }}</span>
<i class="el-icon-close" @click="noSelected(selectItem)" v-if="showCheckbox===false"></i> <i class="el-icon-close" @click="noSelected(selectItem)" v-if="showCheckbox===false"></i>
</div> </div>
</div> </div>
@ -67,43 +67,12 @@ export default {
title: "请选择", title: "请选择",
selectList: [], selectList: [],
filterText: "", filterText: "",
deptList: [ deptList: [],
{ deptProps:{
value: 1, value:'deptId',
label: '一级 1', label: 'deptName',
children: [{ children: 'children'
value: 4,
label: '二级 1-1',
children: [{
value: 9,
label: '31'
}, {
value: 10,
label: '三级 1-1-2'
}]
}]
}, {
value: 2,
label: '一级 2',
children: [{
value: 5,
label: '二级 2-1'
}, {
value: 6,
label: '二级 2-2'
}]
}, {
value: 3,
label: '一级 3',
children: [{
value: 7,
label: '二级 3-1'
}, {
value: 8,
label: '二级 3-2'
}]
} }
]
}; };
}, },
watch: { watch: {
@ -128,16 +97,19 @@ export default {
// //
getDepartmentTree() { getDepartmentTree() {
getDepartmentTree().then(res => { getDepartmentTree().then(res => {
console.log("获取部门信息", res); const jsona = JSON.stringify(res.data) // res.data
this.deptList = res.data; const jsonb = jsona.replace(/"value"/g, '"deptId"') //
const jsonc = jsonb.replace(/"label"/g, '"deptName"')
this.deptList=JSON.parse(jsonc)
console.log("获取部门信息===========", this.deptList);
}); });
}, },
// //
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.label.indexOf(value) !== -1; return data.deptName.indexOf(value) !== -1;
}, },
// //
showDeptPicker() { showDeptPicker() {
this.visible = true; this.visible = true;
}, },
@ -153,7 +125,7 @@ export default {
if (this.multiple) { if (this.multiple) {
// //
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === data.value) { if (this.selectList[i].deptId === data.deptId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
break; break;
} }
@ -167,7 +139,7 @@ export default {
} else {// + } else {// +
// //
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === data.value) { if (this.selectList[i].deptId === data.deptId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
break; break;
} }
@ -186,7 +158,7 @@ export default {
//,tree-item //,tree-item
/** /**
* 可以点击树节点label,进行选择 * 可以点击树节点deptName,进行选择
* @param node 选择的每个节点item * @param node 选择的每个节点item
* @param check checked(checkbox选择框)是否选中 * @param check checked(checkbox选择框)是否选中
*/ */
@ -194,7 +166,7 @@ export default {
if(this.multiple){ if(this.multiple){
// //
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === node.value) { if (this.selectList[i].deptId === node.deptId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
break; break;
} }
@ -209,7 +181,7 @@ export default {
//,× //,×
noSelected(selectItem) { noSelected(selectItem) {
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === selectItem.value) { if (this.selectList[i].deptId === selectItem.deptId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
this.$refs.tree.setCheckedKeys(i); this.$refs.tree.setCheckedKeys(i);
break; break;
@ -237,7 +209,7 @@ export default {
}, },
// //
selectConfirm() { selectConfirm() {
// this.$emit("input", this.selectList) this.$emit("input", this.selectList)
// this.$emit("dengjie") // this.$emit("dengjie")
} }
} }

View File

@ -12,7 +12,7 @@
@click="selectChange(roleItem)"> @click="selectChange(roleItem)">
<el-checkbox v-model="roleItem.selected" v-if="showCheckbox" @change="selectChange(roleItem)"></el-checkbox> <el-checkbox v-model="roleItem.selected" v-if="showCheckbox" @change="selectChange(roleItem)"></el-checkbox>
<i class="el-icon-user-solid" style="margin-left: 5px"></i> <i class="el-icon-user-solid" style="margin-left: 5px"></i>
<span>{{ roleItem.label }}</span> <span>{{ roleItem.roleName }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -24,10 +24,10 @@
</div> </div>
<div class="org-items"> <div class="org-items">
<el-empty :image-size="100" description="请点击左侧列表选择数据" v-show="selectList.length === 0"/> <el-empty :image-size="100" description="请点击左侧列表选择数据" v-show="selectList.length === 0"/>
<div v-for="(org, index) in selectList" :key="index" class="org-role-item"> <div v-for="(selectItem, selectIndex) in selectList" :key="selectIndex" class="org-role-item">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
<span>{{ org.label }}</span> <span>{{ selectItem.roleName }}</span>
<i class="el-icon-close" @click="noSelected(org)"></i> <i class="el-icon-close" @click="noSelected(selectItem)"></i>
</div> </div>
</div> </div>
</div> </div>
@ -46,6 +46,24 @@ export default {
return []; return [];
}, },
type: Array type: Array
},
multiple: { //
default: true,
type: Boolean
},
showCheckbox: { //
default: true,
type: Boolean
}
},
computed: {
_value: {
get() {
return this.value
},
set(val) {
this.$emit("input", val)
}
} }
}, },
data() { data() {
@ -53,34 +71,7 @@ export default {
visible: false, visible: false,
loading: false, loading: false,
title: "请选择", title: "请选择",
multiple: true,// roleList: [],
showCheckbox: true,//
roleList: [
// {
// value: 1,
// label: ""
// },
// {
// value: 2,
// label: ""
// },
// {
// value: 100,
// label: ""
// },
// {
// value: 101,
// label: ""
// },
// {
// value: 102,
// label: ""
// },
// {
// value: 103,
// label: ""
// }
],
selectList: [] selectList: []
}; };
}, },
@ -91,9 +82,16 @@ export default {
// //
getRole() { getRole() {
getRole().then(res => { getRole().then(res => {
this.roleList = res.data; console.log('系统角色',res.data);
this.roleList= res.data.map(function (val){
return {roleId:val.value,roleName:val.label}
})
}); });
}, },
//
showRolePicker() {
this.visible = true;
},
// //
selectChange(roleItem) { selectChange(roleItem) {
// //
@ -101,7 +99,7 @@ export default {
// + // +
if (this.multiple) { if (this.multiple) {
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === roleItem.value) { if (this.selectList[i].roleId === roleItem.roleId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
break; break;
} }
@ -112,7 +110,7 @@ export default {
} else {// + } else {// +
//, //,
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === roleItem.value) { if (this.selectList[i].roleId === roleItem.roleId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
break; break;
} }
@ -122,7 +120,7 @@ export default {
} }
for (let i = 0; i < this.roleList.length; i++) { for (let i = 0; i < this.roleList.length; i++) {
for (let j = 0; j < this.selectList.length; j++) { for (let j = 0; j < this.selectList.length; j++) {
if (this.roleList[i].value !== this.selectList[j].value) { if (this.roleList[i].roleId !== this.selectList[j].roleId) {
this.roleList[i].selected = false; this.roleList[i].selected = false;
} }
} }
@ -132,7 +130,7 @@ export default {
// + // +
if (this.multiple) { if (this.multiple) {
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === roleItem.value) { if (this.selectList[i].roleId === roleItem.roleId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
break; break;
} }
@ -142,16 +140,17 @@ export default {
this.selectList = [roleItem]; this.selectList = [roleItem];
} }
} }
this._value = this.selectList
}, },
//× //×
noSelected(org) { noSelected(selectItem) {
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === org.value) { if (this.selectList[i].roleId === selectItem.roleId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
break; break;
} }
} }
org.selected = false; selectItem.selected = false;
}, },
// //
clearSelected() { clearSelected() {
@ -170,14 +169,9 @@ export default {
}, },
// //
selectConfirm() { selectConfirm() {
// this.$emit("ok", Object.assign([], this.select.map(v => { this.$emit("ok", this.selectList);
// v.avatar = undefined; this.visible = false;
// return v;
// })));
// this.visible = false;
// this.recover();
} }
} }
}; };
</script> </script>

View File

@ -10,10 +10,10 @@
<!-- 部门 --> <!-- 部门 -->
<el-empty :image-size="100" description="似乎没有数据" v-show="deptList.length === 0"/> <el-empty :image-size="100" description="似乎没有数据" v-show="deptList.length === 0"/>
<el-scrollbar style="height:350px"> <el-scrollbar style="height:350px">
<el-tree :data="deptList" ref="tree" empty-text="" node-key="value" default-expand-all <el-tree :data="deptList" ref="tree" :props="deptProps" empty-text="" node-key="deptId" default-expand-all
:show-checkbox="showCheckbox" check-strictly highlight-current :show-checkbox="showCheckbox" check-strictly highlight-current
@check-change="handleCheckChange" @node-click="(node,check)=>handle(node,check)" :filter-node-method="filterNode"> @check-change="handleCheckChange" @node-click="(node,check)=>handle(node,check)" :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }" style="width: 100%"> <div class="custom-tree-node" slot-scope="{ node }" style="width: 100%">
<i class="el-icon-folder-opened" style="margin-right: 5px"></i>{{ node.label }} <i class="el-icon-folder-opened" style="margin-right: 5px"></i>{{ node.label }}
</div> </div>
</el-tree> </el-tree>
@ -29,7 +29,7 @@
<el-empty :image-size="100" description="请点击左侧列表选择数据" v-show="selectList.length === 0"/> <el-empty :image-size="100" description="请点击左侧列表选择数据" v-show="selectList.length === 0"/>
<div v-for="(selectItem, selectIndex) in selectList" :key="selectIndex" class="org-item"> <div v-for="(selectItem, selectIndex) in selectList" :key="selectIndex" class="org-item">
<i class="el-icon-folder-opened"></i> <i class="el-icon-folder-opened"></i>
<span>{{ selectItem.label }}</span> <span>{{ selectItem.deptName }}</span>
<i class="el-icon-close" @click="noSelected(selectItem)" v-if="showCheckbox===false"></i> <i class="el-icon-close" @click="noSelected(selectItem)" v-if="showCheckbox===false"></i>
</div> </div>
</div> </div>
@ -67,43 +67,12 @@ export default {
title: "请选择", title: "请选择",
selectList: [], selectList: [],
filterText: "", filterText: "",
deptList: [ deptList: [],
{ deptProps:{
value: 1, value:'deptId',
label: '一级 1', label: 'deptName',
children: [{ children: 'children'
value: 4,
label: '二级 1-1',
children: [{
value: 9,
label: '31'
}, {
value: 10,
label: '三级 1-1-2'
}]
}]
}, {
value: 2,
label: '一级 2',
children: [{
value: 5,
label: '二级 2-1'
}, {
value: 6,
label: '二级 2-2'
}]
}, {
value: 3,
label: '一级 3',
children: [{
value: 7,
label: '二级 3-1'
}, {
value: 8,
label: '二级 3-2'
}]
} }
]
}; };
}, },
watch: { watch: {
@ -128,14 +97,18 @@ export default {
// //
getDepartmentTree() { getDepartmentTree() {
getDepartmentTree().then(res => { getDepartmentTree().then(res => {
console.log("获取部门信息", res); const jsona = JSON.stringify(res.data) // res.data
this.deptList = res.data; const jsonb = jsona.replace(/"value"/g, '"deptId"') //
const jsonc = jsonb.replace(/"label"/g, '"deptName"')
const endjson = JSON.parse(jsonc)
this.deptList=endjson
console.log("获取部门信息===========", this.deptList);
}); });
}, },
// //
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.label.indexOf(value) !== -1; return data.deptName.indexOf(value) !== -1;
}, },
// //
showDeptPicker() { showDeptPicker() {
@ -153,7 +126,7 @@ export default {
if (this.multiple) { if (this.multiple) {
// //
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === data.value) { if (this.selectList[i].deptId === data.deptId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
break; break;
} }
@ -167,7 +140,7 @@ export default {
} else {// + } else {// +
// //
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === data.value) { if (this.selectList[i].deptId === data.deptId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
break; break;
} }
@ -186,7 +159,7 @@ export default {
//,tree-item //,tree-item
/** /**
* 可以点击树节点label,进行选择 * 可以点击树节点deptName,进行选择
* @param node 选择的每个节点item * @param node 选择的每个节点item
* @param check checked(checkbox选择框)是否选中 * @param check checked(checkbox选择框)是否选中
*/ */
@ -194,7 +167,7 @@ export default {
if(this.multiple){ if(this.multiple){
// //
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === node.value) { if (this.selectList[i].deptId === node.deptId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
break; break;
} }
@ -209,7 +182,7 @@ export default {
//,× //,×
noSelected(selectItem) { noSelected(selectItem) {
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
if (this.selectList[i].value === selectItem.value) { if (this.selectList[i].deptId === selectItem.deptId) {
this.selectList.splice(i, 1); this.selectList.splice(i, 1);
this.$refs.tree.setCheckedKeys(i); this.$refs.tree.setCheckedKeys(i);
break; break;
@ -237,7 +210,7 @@ export default {
}, },
// //
selectConfirm() { selectConfirm() {
// this.$emit("input", this.selectList) this.$emit("input", this.selectList)
// this.$emit("dengjie") // this.$emit("dengjie")
} }
} }

View File

@ -16,6 +16,7 @@ import Ellipsis from '@/components/common/Ellipsis'
import WDialog from '@/components/common/WDialog' import WDialog from '@/components/common/WDialog'
import Tip from '@/components/common/Tip' import Tip from '@/components/common/Tip'
import axios from "axios"; import axios from "axios";
import {getBaseUrl} from "./api/request";
Vue.use(ElementUI); Vue.use(ElementUI);
Vue.use(Ellipsis); Vue.use(Ellipsis);
@ -54,8 +55,9 @@ export function getToken() {
// } // }
axios.post( axios.post(
// "http://security-react.mytwins.top/auth/login", // "http://security-react.mytwins.top/auth/login",
// "http://gateway.odliken.cn/auth/login", // getBaseUrl()+"/auth/login",
"http://localhost:8000/auth/login", "http://gateway.mytwins.top/auth/login",
// "http://localhost:8000/auth/login",
{ {
code: "string", code: "string",
password: "926425", password: "926425",

View File

@ -23,3 +23,5 @@ Array.prototype.toMap = function (key) {
} }

View File

@ -6,8 +6,8 @@
</template> </template>
<template v-else> <template v-else>
<template v-if="perm === 'E'"> <template v-if="perm === 'E'">
<el-button icon="iconfont icon-map-site" type="primary" size="mini" round @click="$refs.orgPicker.show()"> 选择部门</el-button> <el-button icon="iconfont icon-map-site" type="primary" size="mini" round @click="selectDept"> 选择部门</el-button>
<org-picker type="dept" :multiple="multiple" ref="orgPicker" :selected="_value" @ok="selected"/> <org-picker type="dept" :multiple="multiple" ref="deptPicker" :selected="_value" @ok="selected"/>
<span class="placeholder"> {{placeholder}}</span> <span class="placeholder"> {{placeholder}}</span>
<div style="margin-top: 5px"> <div style="margin-top: 5px">
<el-tag size="mini" style="margin: 5px" closable v-for="(dept, i) in _value" :key="i" @close="delDept(i)">{{dept.name}}</el-tag> <el-tag size="mini" style="margin: 5px" closable v-for="(dept, i) in _value" :key="i" @close="delDept(i)">{{dept.name}}</el-tag>
@ -54,6 +54,10 @@ export default {
} }
}, },
methods: { methods: {
//,
selectDept() {
this.$refs.deptPicker.showDeptPicker()
},
selected(values){ selected(values){
this.showOrgSelect = false this.showOrgSelect = false
this._value = values this._value = values

View File

@ -48,6 +48,7 @@
<script> <script>
import componentMinxins from '../ComponentMinxins' import componentMinxins from '../ComponentMinxins'
import {deleteFile} from "../../../../api/common"; import {deleteFile} from "../../../../api/common";
import {getBaseUrl} from "../../../../api/request";
export default { export default {
mixins: [componentMinxins], mixins: [componentMinxins],
@ -90,7 +91,7 @@ export default {
return { return {
fileList:[], fileList:[],
disabled: false, disabled: false,
uploadFileUrl: "http://security-react.mytwins.top/flowable/process/file", uploadFileUrl: getBaseUrl()+"/flowable/process/file",
headers: { headers: {
authorization: localStorage.getItem("token") authorization: localStorage.getItem("token")
}, },

View File

@ -119,40 +119,38 @@
<el-form-item label="🙅‍ 如果审批被驳回 👇"> <el-form-item label="🙅‍ 如果审批被驳回 👇">
<el-radio-group v-model="nodeProps.refuse.type"> <el-radio-group v-model="nodeProps.refuse.type">
<el-radio label="TO_END">直接结束流程</el-radio> <el-radio label="TO_END">直接结束流程</el-radio>
<!-- <el-radio label="TO_BEFORE">驳回到上级审批节点</el-radio>--> <!-- <el-radio label="TO_BEFORE">驳回到上级审批节点</el-radio>-->
<!-- <el-radio label="TO_NODE">驳回到指定节点</el-radio>--> <!-- <el-radio label="TO_NODE">驳回到指定节点</el-radio>-->
</el-radio-group> </el-radio-group>
<div v-if="nodeProps.refuse.type === 'TO_NODE'"> <div v-if="nodeProps.refuse.type === 'TO_NODE'">
<span>指定节点:</span> <span>指定节点:</span>
<el-select style="margin-left: 10px; width: 150px;" placeholder="选择跳转步骤" size="small" v-model="nodeProps.refuse.target"> <el-select style="margin-left: 10px; width: 150px;" placeholder="选择跳转步骤" size="small"
v-model="nodeProps.refuse.target">
<el-option v-for="(node, i) in nodeOptions" :key="i" :label="node.name" :value="node.id"></el-option> <el-option v-for="(node, i) in nodeOptions" :key="i" :label="node.name" :value="node.id"></el-option>
</el-select> </el-select>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- <org-picker :title="pickerTitle" multiple :type="orgPickerType" ref="orgPicker" :selected="orgPickerSelected"-->
<!-- @ok="selected"/>-->
<role-picker-me :title="pickerTitle" multiple ref="rolePicker" :selected="rolePickerSelected" @ok="selectedRole"/> <role-picker :title="pickerTitle" multiple ref="rolePicker" :v-model="select" @ok="selectedRole"/>
</div> </div>
</template> </template>
<script> <script>
import OrgPicker from "@/components/common/Test"; import RolePicker from "@/components/common/RolePicker";
import RolePickerMe from "../../../../components/common/RolePickerMe";
import RoleItems from "../RoleItems"; import RoleItems from "../RoleItems";
import OrgItems from "../OrgItems"; import OrgItems from "../OrgItems";
export default { export default {
name: "ApprovalNodeConfig", name: "ApprovalNodeConfig",
components: {RoleItems, OrgPicker, OrgItems,RolePickerMe}, components: {RoleItems, OrgItems, RolePicker},
props: { props: {
config: { config: {
type: Object, type: Object,
default: () => { default: () => {
return {} return {};
} }
} }
}, },
@ -160,54 +158,52 @@ export default {
return { return {
showOrgSelect: false, showOrgSelect: false,
orgPickerSelected: [], orgPickerSelected: [],
showRoleSelect: false, orgPickerType: "user",
rolePickerSelected: [],
orgPickerType: 'user',
approvalTypes: [ approvalTypes: [
{name: '指定人员', type: 'ASSIGN_USER'}, {name: "指定人员", type: "ASSIGN_USER"},
{name: '发起人自选', type: 'SELF_SELECT'}, {name: "发起人自选", type: "SELF_SELECT"},
{name: '连续多级主管', type: 'LEADER_TOP'}, {name: "连续多级主管", type: "LEADER_TOP"},
{name: '主管', type: 'LEADER'}, {name: "主管", type: "LEADER"},
{name: '角色', type: 'ROLE'}, {name: "角色", type: "ROLE"},
{name: '发起人自己', type: 'SELF'}, {name: "发起人自己", type: "SELF"},
{name: '表单内联系人', type: 'FORM_USER'} {name: "表单内联系人", type: "FORM_USER"}
] ]
} };
}, },
computed: { computed: {
nodeProps() { nodeProps() {
return this.$store.state.selectedNode.props return this.$store.state.selectedNode.props;
}, },
select() { select() {
return this.config.assignedUser || [] return this.config.assignedUser || [];
}, },
roleList() { roleList() {
return this.config.roleList || [] return this.config.roleList || [];
}, },
forms() { forms() {
return this.$store.state.design.formItems.filter(f => { return this.$store.state.design.formItems.filter(f => {
return f.name === 'UserPicker' return f.name === "UserPicker";
}) });
}, },
pickerTitle() { pickerTitle() {
switch (this.orgPickerType) { switch (this.orgPickerType) {
case 'user': case "user":
return '请选择人员'; return "请选择人员";
case 'role': case "role":
return '请选择系统角色'; return "请选择系统角色";
default: default:
return null; return null;
} }
}, },
nodeOptions() { nodeOptions() {
let values = [] let values = [];
const excType = ['ROOT', 'EMPTY', "CONDITION", "CONDITIONS", "CONCURRENT", "CONCURRENTS"] const excType = ["ROOT", "EMPTY", "CONDITION", "CONDITIONS", "CONCURRENT", "CONCURRENTS"];
this.$store.state.nodeMap.forEach((v) => { this.$store.state.nodeMap.forEach((v) => {
if (excType.indexOf(v.type) === -1) { if (excType.indexOf(v.type) === -1) {
values.push({id: v.id, name: v.name}) values.push({id: v.id, name: v.name});
} }
}) });
return values return values;
}, },
showMode() { showMode() {
switch (this.nodeProps.assignedType) { switch (this.nodeProps.assignedType) {
@ -216,7 +212,7 @@ export default {
case "SELF_SELECT": case "SELF_SELECT":
return this.nodeProps.selfSelect.multiple; return this.nodeProps.selfSelect.multiple;
case "LEADER_TOP": case "LEADER_TOP":
return this.nodeProps.formUser !== ''; return this.nodeProps.formUser !== "";
case "FORM_USER": case "FORM_USER":
return true; return true;
case "ROLE": case "ROLE":
@ -228,33 +224,36 @@ export default {
}, },
methods: { methods: {
selectUser() { selectUser() {
this.orgPickerSelected = this.select this.orgPickerSelected = this.select;
this.orgPickerType = 'user' this.orgPickerType = "user";
this.$refs.orgPicker.show() this.$refs.orgPicker.show();
}, },
selectNoSetUser() { selectNoSetUser() {
this.orgPickerSelected = this.config.nobody.assignedUser this.orgPickerSelected = this.config.nobody.assignedUser;
this.orgPickerType = 'user' this.orgPickerType = "user";
this.$refs.orgPicker.show() this.$refs.orgPicker.show();
}, },
//,
selectRole() { selectRole() {
this.showRoleSelect = null this.orgPickerType = "role";
this.rolePickerSelected = this.roleList this.$refs.rolePicker.showRolePicker();
this.$refs.rolePicker.show()
},
selected(select) {
}, },
selectedRole(select) { selectedRole(select) {
console.log(select) select.forEach(val => {
this.rolePickerSelected.length = 0 for (let i = 0; i < this.roleList.length; i++) {
select.forEach(val => this.rolePickerSelected.push(val)) if (this.roleList[i].roleId === val.roleId) {
this.roleList.splice(i, 1);
break;
}
}
this.roleList.push(val);
});
}, },
removeOrgItem(index) { removeOrgItem(index) {
this.select.splice(index, 1) this.select.splice(index, 1);
} }
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -26,10 +26,13 @@
label="任务到达时间"> label="任务到达时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="status" prop="state"
label="状态"> label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="success">{{ scope.row.status }}</el-tag> <el-tag v-if="scope.row.state == 1" >待处理</el-tag>
<el-tag v-if="scope.row.state == 4" type="success">已同意</el-tag>
<el-tag v-if="scope.row.state == 3" type="danger">已拒绝</el-tag>
<el-tag v-if="scope.row.state == 2" type="warning">已退回</el-tag>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -38,27 +41,33 @@
size="50%" size="50%"
:visible.sync="approveOpen" :visible.sync="approveOpen"
direction="rtl"> direction="rtl">
<div v-loading="loading">
<form-render-view ref="taskViewForm" :form-items="taskData.formItems" <form-render-view ref="taskViewForm" :form-items="taskData.formItems"
v-model="taskData.formData"/> v-model="taskData.formData"/>
<process-diagram-viewer/> <!-- <process-diagram-viewer/>-->
<el-button type="success" @click="submitTask()">通过</el-button> <el-button type="success" @click="submitTask()">通过</el-button>
<el-button type="success" @click="$refs.comment.show()">评论</el-button>
</div>
</el-drawer> </el-drawer>
<comment ref="comment" :max-size="5" :attachment-max-size="10" @ok="commentConfirm"/>
</div> </div>
</template> </template>
<script> <script>
import Comment from "../../components/common/Comment";
import FormRenderView from '@/views/common/form/FormRender' import FormRenderView from '@/views/common/form/FormRender'
import ProcessDiagramViewer from "../admin/layout/ProcessDiagramViewer"; import ProcessDiagramViewer from "../admin/layout/ProcessDiagramViewer";
import {completeTask, getTaskInfo, getTaskList} from "../../api/task"; import {addComment, completeTask, getTaskInfo, getTaskList} from "../../api/task";
export default { export default {
name: "DisposalTask", name: "DisposalTask",
components: {FormRenderView,ProcessDiagramViewer}, components: {Comment, FormRenderView, ProcessDiagramViewer},
data() { data() {
return { return {
approveOpen: false, approveOpen: false,
selectTask: {}, selectTask: {},
tableData: [], tableData: [],
loading: false,
taskData: { taskData: {
formData: {}, formData: {},
formItems: [], formItems: [],
@ -81,28 +90,48 @@ export default {
this.tableData = data.rows this.tableData = data.rows
}) })
}, },
init() {
this.taskData = {
formData: {},
formItems: [],
processList: [],
}
this.loading = true
this.$store.state.design = this.taskData
this.$store.state.runningList = []
this.$store.state.endList = []
this.$store.state.noTakeList = []
this.$store.state.diagramMode = 'viewer'
this.$store.state.preview = false;
},
loadProcessTask(taskId) { loadProcessTask(taskId) {
let that = this let that = this
this.init()
getTaskInfo(taskId).then(res => { getTaskInfo(taskId).then(res => {
this.$store.state.preview = 'viewer'
this.$store.state.preview = false;
that.taskData = res.data that.taskData = res.data
that.$store.state.design = that.taskData that.$store.state.design = that.taskData
that.$store.state.runningList = that.taskData.runningList that.$store.state.runningList = that.taskData.runningList
that.$store.state.endList = that.taskData.endList that.$store.state.endList = that.taskData.endList
that.$store.state.noTakeList = that.taskData.noTakeList that.$store.state.noTakeList = that.taskData.noTakeList
this.loading = false
}) })
}, },
submitTask(){ submitTask() {
let params = { let params = {
taskId: this.selectTask.taskId, taskId: this.selectTask.taskId,
formData : JSON.stringify(this.taskData.formData) formData: JSON.stringify(this.taskData.formData)
} }
completeTask(params).then(res =>{ completeTask(params).then(res => {
this.approveOpen = false this.approveOpen = false
this.getList() this.getList()
this.$message.success(res.msg) this.$message.success(res.msg)
}) })
},
commentConfirm(data) {
this.$set(data, "taskId", this.selectTask.taskId)
addComment(data).then(res => {
this.$message.success(res.msg)
})
} }
} }
}; };

View File

@ -0,0 +1,113 @@
<template>
<div>
<el-table :data="tableData"
@row-click="clickRow"
style="width: 100%">
<el-table-column
prop="deploymentName"
label="审批类型"
width="180"/>
<el-table-column
prop="approveName"
label="审批人"
width="180"/>
<el-table-column
prop="submitTime"
label="提交时间"/>
<el-table-column
prop="endTime"
label="结束时间"/>
<el-table-column
prop="taskName"
label="当前节点"/>
<el-table-column
label="处理耗时">
<template slot-scope="scope">
{{ getTimeConsuming(scope.row) }}
</template>
</el-table-column>
<el-table-column
prop="state"
label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.state == 1" >进行中</el-tag>
<el-tag v-if="scope.row.state == 4" type="success">审批通过</el-tag>
<el-tag v-if="scope.row.state == 3" type="danger">审批驳回</el-tag>
<el-tag v-if="scope.row.state == 2" type="info">已撤销</el-tag>
</template>
</el-table-column>
<el-table-column
label="操作">
<template slot-scope="scope">
<el-button size="min" type="text" icon="el-icon-thumb">再次提交</el-button>
</template>
</el-table-column>
</el-table>
<el-drawer
title="审批详情"
size="50%"
:visible.sync="approveOpen"
direction="rtl">
<div v-loading="loading">
<form-render-view ref="taskViewForm" :form-items="taskData.formItems"
v-model="taskData.formData"/>
<process-diagram-viewer/>
<el-button type="success" @click="submitTask()">通过</el-button>
<el-button type="success" @click="$refs.comment.show()">评论</el-button>
</div>
</el-drawer>
<comment ref="comment" :max-size="5" :attachment-max-size="10" @ok="commentConfirm"/>
</div>
</template>
<script>
import Comment from "../../components/common/Comment";
import FormRenderView from '@/views/common/form/FormRender'
import ProcessDiagramViewer from "../admin/layout/ProcessDiagramViewer";
import {getInitiatedInstanceList} from "../../api/processInstance";
export default {
name: "InitiatedInstance",
components: {Comment, FormRenderView, ProcessDiagramViewer},
data() {
return {
approveOpen: false,
selectTask: {},
tableData: [],
loading: false,
taskData: {
formData: {},
formItems: [],
processList: [],
}
};
},
created() {
this.getList();
},
methods: {
clickRow(row) {
this.approveOpen = true;
// this.loadProcessTask(row.taskId)
this.selectTask = row
},
getList() {
getInitiatedInstanceList().then(res => {
let data = res.data
this.tableData = data.rows
})
},
getTimeConsuming(instance) {
if (instance.state != 1) {
let submitTime = new Date(instance.submitTime)
let endTime = new Date(instance.endTime)
return endTime - submitTime;
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -41,10 +41,10 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="待我处理(3)" name="disposalTask"> <el-tab-pane label="待我处理(3)" name="disposalTask">
<disposal-task ref="disposalTask"/> <disposal-task v-if="active == 'disposalTask'" ref="disposalTask"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="我发起的" name="initiated"> <el-tab-pane label="我发起的" name="initiated">
<div class="no-data">暂无数据 😀</div> <initiated-instance v-if="active == 'initiated'" ref="InitiatedInstance"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="关于我的" name="aboutMe"> <el-tab-pane label="关于我的" name="aboutMe">
<div class="no-data">暂无数据 😀</div> <div class="no-data">暂无数据 😀</div>
@ -63,13 +63,14 @@
<script> <script>
import InitiateProcess from "./InitiateProcess"; import InitiateProcess from "./InitiateProcess";
import InitiatedInstance from "./InitiatedInstance";
import DisposalTask from "./DisposalTask"; import DisposalTask from "./DisposalTask";
import {getProcessDefinitionList} from "../../api/processDefinition"; import {getProcessDefinitionList} from "../../api/processDefinition";
import {startProcessInstance} from "../../api/processInstance"; import {startProcessInstance} from "../../api/processInstance";
export default { export default {
name: "workSpace", name: "workSpace",
components: {InitiateProcess,DisposalTask}, components: {InitiateProcess,DisposalTask,InitiatedInstance},
data() { data() {
return { return {
active: 'disposalTask', active: 'disposalTask',