diff --git a/flowable-engine-web/src/App.vue b/flowable-engine-web/src/App.vue index 3515aa4..b1f0b81 100644 --- a/flowable-engine-web/src/App.vue +++ b/flowable-engine-web/src/App.vue @@ -17,7 +17,7 @@ created() { }, mounted() { - let beforeUrl = sessionStorage.getItem('router-path') + let beforeUrl = localStorage.getItem('router-path') if(beforeUrl === undefined || beforeUrl === ''){ //this.$router.push("/workPanel") }else { diff --git a/flowable-engine-web/src/api/request.js b/flowable-engine-web/src/api/request.js index 73df665..6fc9891 100644 --- a/flowable-engine-web/src/api/request.js +++ b/flowable-engine-web/src/api/request.js @@ -6,12 +6,11 @@ import { Notification, MessageBox, Message } from "element-ui"; // 第三方插件 import "element-ui/lib/theme-chalk/index.css"; -Vue.prototype.$axios = axios; // 字体图标 export function getBaseUrl(){ - return "http://gateway.mytwins.top" - // return "http://192.168.101.8:8000" + // return "http://gateway.mytwins.top" + return "http://192.168.101.8:8000" // return "http://localhost:8000" } @@ -39,6 +38,7 @@ service.interceptors.response.use( let data = rsp.data if (data.code === 401){ localStorage.clear() + window.location.href = "/" } if (data.code === 1000){ return data diff --git a/flowable-engine-web/src/components/common/CodeEdit.vue b/flowable-engine-web/src/components/common/CodeEdit.vue index 5a70ad1..71159c4 100644 --- a/flowable-engine-web/src/components/common/CodeEdit.vue +++ b/flowable-engine-web/src/components/common/CodeEdit.vue @@ -59,7 +59,7 @@ export default { computed:{ _value :{ get(){ - return this.value; + return this.value || ""; }, set(val){ this.value = val; @@ -72,7 +72,7 @@ export default { }) this.$refs.codeEdit.codemirror.on("change", (cm) => { this._value = cm.getValue() - this.$emit("input",this._value) + this.$emit("input",cm.getValue()) }) }, methods:{ diff --git a/flowable-engine-web/src/main.js b/flowable-engine-web/src/main.js index 35b0f96..a327490 100644 --- a/flowable-engine-web/src/main.js +++ b/flowable-engine-web/src/main.js @@ -18,19 +18,6 @@ import WDialog from '@/components/common/WDialog' import Tip from '@/components/common/Tip' - - - - - - - - - - - - - Vue.use(ElementUI); Vue.use(AvatarEllipsis); Vue.use(Ellipsis); diff --git a/flowable-engine-web/src/router/index.js b/flowable-engine-web/src/router/index.js index b6941b8..108bdcf 100644 --- a/flowable-engine-web/src/router/index.js +++ b/flowable-engine-web/src/router/index.js @@ -77,7 +77,7 @@ router.beforeEach((to, from, next) => { head[0].appendChild(meta) } next(); - sessionStorage.setItem('router-path', to.path) + localStorage.setItem('router-path', to.path) }) export default router; diff --git a/flowable-engine-web/src/views/Index.vue b/flowable-engine-web/src/views/Index.vue index 67b990d..19f45a6 100644 --- a/flowable-engine-web/src/views/Index.vue +++ b/flowable-engine-web/src/views/Index.vue @@ -6,6 +6,7 @@
选择本次登录者
+ {{ loginUser.name }}
@@ -45,17 +46,11 @@ export default { return { token: localStorage.getItem("token"), select: [], - loginUser: { - id: 381496, - name: "clay", - selected: false, - sex: null, - type: "user" - } + loginUser: {} } }, mounted() { - let user = sessionStorage.getItem("user") + let user = localStorage.getItem("userInfo") if (user !== null && user !== '') { this.loginUser = JSON.parse(user) this.select.push(this.loginUser) @@ -74,7 +69,7 @@ export default { uuid: "string" } ).then(res => { - console.log(res) + localStorage.setItem("userInfo",JSON.stringify(this.loginUser)) this.token = res.data.data localStorage.setItem("token", this.token) }) diff --git a/flowable-engine-web/src/views/admin/layout/process/DefaultNodeProps.js b/flowable-engine-web/src/views/admin/layout/process/DefaultNodeProps.js index 4695e9f..9ce2577 100644 --- a/flowable-engine-web/src/views/admin/layout/process/DefaultNodeProps.js +++ b/flowable-engine-web/src/views/admin/layout/process/DefaultNodeProps.js @@ -1,113 +1,114 @@ //审批节点默认属性 export const APPROVAL_PROPS = { - assignedType: "ASSIGN_USER", - mode: "AND", - sign: false, - headerBgc: '#ff943e', - nobody: { - handler: "TO_PASS", - assignedUser:[] - }, - timeLimit:{ - timeout:{ - unit: "H", - value: 0 + assignedType: "ASSIGN_USER", //审批类型 + mode: "AND", //会签模式 + sign: false, //是否签字 + headerBgc: '#ff943e', //节点背景颜色 + nobody: { //没有审批的的时候需要的操作 + handler: "TO_PASS", //操作 + assignedUser: [] //审批人列表 }, - handler:{ - type: "REFUSE", - notify:{ - once: true, - hour: 1 - } - } - }, - assignedUser:[], - formPerms:[], - selfSelect: { - multiple: false - }, - leaderTop: { - endCondition: "TOP", - endLevel: 1, - }, - leader:{ - level: 1 - }, - roleList:[], - refuse: { - type: 'TO_END', //驳回规则 TO_END TO_NODE TO_BEFORE - target: '' //驳回到指定ID的节点 - }, - formUser: '' + timeLimit: { //边界事件 + timeout: { //超时提醒时间 + unit: "H", + value: 0 + }, + handler: { //超时提醒触发时候的操作 + type: "REFUSE", //操作 + notify: { + once: true, //是否循环 + hour: 1 + } + } + }, + assignedUser: [], // 审批人列表 + formPerms: [], //表单权限 + selfSelect: { //用户自选 + multiple: false //用户自选时是否是多选 + }, + leaderTop: { //领导 + endCondition: "TOP", + endLevel: 1, + }, + leader: { //第几级领导 + level: 1 + }, + roleList: [], //角色列表 + refuse: { //拒绝的操作 + type: 'TO_END', //驳回规则 TO_END TO_NODE TO_BEFORE + target: '' //驳回到指定ID的节点 + }, + formUser: '' //表单用户 } //根节点默认属性 export const ROOT_PROPS = { - assignedUser: [], - formPerms:[] + assignedUser: [], //审批人 + formPerms: [] //表单权限 } //条件节点默认属性 export const CONDITION_PROPS = { - groupsType:"OR", //条件组逻辑关系 OR、AND - groups:[ - { - groupType:"AND", //条件组内条件关系 OR、AND - cids:[], //条件ID集合 - conditions:[] //组内子条件 - } - ], - expression: "" //自定义表达式,灵活构建逻辑关系 + groupsType: "OR", //条件组逻辑关系 OR、AND + groups: [ + { + groupType: "AND", //条件组内条件关系 OR、AND + cids: [], //条件ID集合 + conditions: [] //组内子条件 + } + ], + expression: "" //自定义表达式,灵活构建逻辑关系 } //抄送节点默认属性 export const CC_PROPS = { - shouldAdd: false, - assignedUser: [], - formPerms:[] + shouldAdd: false, + assignedUser: [], + formPerms: [] } //触发器节点默认属性 export const TRIGGER_PROPS = { - type: 'WEBHOOK', - http:{ - method: 'GET', //请求方法 支持GET/POST - url: '', //URL地址,可以直接带参数 - headers: [ //http header - { - name: '', - isField: true, - value: '' //支持表达式 ${xxx} xxx为表单字段名称 - } - ], - contentType: 'FORM', //请求参数类型 - params:[ //请求参数 - { - name: '', - isField: true, //是表单字段还是自定义 - value: '' //支持表达式 ${xxx} xxx为表单字段名称 - } - ], - retry: 1, - handlerByScript: false, - success: 'function handlerOk(res) {\n return true;\n}', - fail: 'function handlerFail(res) {\n return true;\n}' - }, - email:{ - subject: '', - to: [], - content: '' - } + type: 'WEBHOOK', + http: { + method: 'GET', //请求方法 支持GET/POST + url: '', //URL地址,可以直接带参数 + headers: [ //http header + { + name: '', + isField: true, + value: '' //支持表达式 ${xxx} xxx为表单字段id + } + ], + contentType: 'FORM', //请求参数类型 + params: [ //请求参数 + { + name: '', + isField: true, //是表单字段还是自定义 + value: '' //支持表达式 ${xxx} xxx为表单字段id + } + ], + retry: 1, + handlerByScript: false, + success: 'function handlerSuccess(res) {\n return {\n state: true, \n msg: "请求成功!" \n };\n}', + fail: 'function handlerFail(res) {\n return {\n state: true, \n msg: "请求失败!" \n };\n}' + }, + email: { + subject: '', + to: [], + cc: [], + content: '' + } } //延时节点默认属性 export const DELAY_PROPS = { - type: "FIXED", //延时类型 FIXED:到达当前节点后延时固定时长 、AUTO:延时到 dateTime设置的时间 - time: 0, //延时时间 - unit: "M", //时间单位 D天 H小时 M分钟 - dateTime: "" //如果当天没有超过设置的此时间点,就延时到这个指定的时间,到了就直接跳过不延时 + type: "FIXED", //延时类型 FIXED:到达当前节点后延时固定时长 、AUTO:延时到 dateTime设置的时间 + time: 0, //延时时间 + unit: "M", //时间单位 D天 H小时 M分钟 + dateTime: "" //如果当天没有超过设置的此时间点,就延时到这个指定的时间,到了就直接跳过不延时 } export default { - APPROVAL_PROPS, CC_PROPS, DELAY_PROPS, CONDITION_PROPS, ROOT_PROPS, TRIGGER_PROPS + APPROVAL_PROPS, CC_PROPS, DELAY_PROPS, CONDITION_PROPS, ROOT_PROPS, TRIGGER_PROPS } diff --git a/flowable-engine-web/src/views/common/process/config/ApprovalNodeConfig.vue b/flowable-engine-web/src/views/common/process/config/ApprovalNodeConfig.vue index ac9062a..798e904 100644 --- a/flowable-engine-web/src/views/common/process/config/ApprovalNodeConfig.vue +++ b/flowable-engine-web/src/views/common/process/config/ApprovalNodeConfig.vue @@ -6,8 +6,9 @@ {{ item.name }}
- 选择人员 - + 选择人员 + +
@@ -40,7 +41,8 @@
- 选择系统角色 + 选择系统角色 +
@@ -64,12 +66,11 @@ 转交审批管理员 转交到指定人员 -
- 选择人员 - + 选择人员 + +
-
@@ -118,23 +119,22 @@ - 直接结束流程 + 重新开始流程 驳回到上级审批节点 - + 驳回到指定节点
指定节点: - +
- -
@@ -143,12 +143,11 @@ import RolePicker from "@/components/common/RolePicker"; import UserPicker from "@/components/common/UserPicker"; import RoleItems from "../RoleItems"; -import OrgItems from "../OrgItems"; export default { name: "ApprovalNodeConfig", - components: {RoleItems, OrgItems, RolePicker, UserPicker}, + components: {RoleItems, RolePicker, UserPicker}, props: { config: { type: Object, @@ -184,7 +183,15 @@ export default { this.config.assignedUser = val } }, - roleList:{ + nobodyAssignedUser: { + get() { + return this.config.nobody.assignedUser || []; + }, + set(val) { + this.config.nobody.assignedUser = val + } + }, + roleList: { get() { return this.config.roleList || []; }, @@ -199,7 +206,7 @@ export default { }, nodeOptions() { let values = []; - const excType = ["ROOT", "EMPTY", "CONDITION", "CONDITIONS", "CONCURRENT", "CONCURRENTS"]; + const excType = ["ROOT", "EMPTY", "CONDITION", "CONDITIONS", "CONCURRENT", "CONCURRENTS", "CC", "END", "TRIGGER"]; this.$store.state.nodeMap.forEach((v) => { if (excType.indexOf(v.type) === -1) { values.push({id: v.id, name: v.name}); @@ -216,7 +223,6 @@ export default { case "LEADER_TOP": return this.nodeProps.formUser !== ""; case "FORM_USER": - return true; case "ROLE": return true; default: @@ -225,15 +231,17 @@ export default { } }, methods: { - selectUser() { - this.$refs.userPicker.showUserPicker() - }, - selectNoSetUser() { - - }, - //弹出角色选择器,选择系统角色 - selectRole() { - this.$refs.rolePicker.showRolePicker(); + selectNoSetUser(select) { + let userInfoList = [] + for (let val of select) { + let userInfo = { + id: val.id, + name: val.name, + avatar: val.avatar, + } + userInfoList.push(userInfo) + } + this.nobodyAssignedUser = userInfoList }, selectedRole(select) { this.roleList = select diff --git a/flowable-engine-web/src/views/common/process/config/CcNodeConfig.vue b/flowable-engine-web/src/views/common/process/config/CcNodeConfig.vue index 76c2ded..b637d8f 100644 --- a/flowable-engine-web/src/views/common/process/config/CcNodeConfig.vue +++ b/flowable-engine-web/src/views/common/process/config/CcNodeConfig.vue @@ -30,7 +30,6 @@ export default { return this.config.shouldAdd || false }, set(val){ - console.log("asdjhajdhasjdhasdhasjdad") this.config.shouldAdd = val } }, diff --git a/flowable-engine-web/src/views/common/process/config/TriggerNodeConfig.vue b/flowable-engine-web/src/views/common/process/config/TriggerNodeConfig.vue index d7b1098..4ebeec8 100644 --- a/flowable-engine-web/src/views/common/process/config/TriggerNodeConfig.vue +++ b/flowable-engine-web/src/views/common/process/config/TriggerNodeConfig.vue @@ -9,7 +9,7 @@
- + @@ -23,84 +23,103 @@ Header请求头 + 添加
-
- - +
+ - + 表单 固定 - + - +
- Header请求参数 - + 添加 + 请求参数 + + 添加 参数类型 - json form
-
- - +
+ - + 表单 固定 - - + + - +
- -
- 请求结果处理 - 自定义脚本: - -
- - 👉 返回值为 ture 则流程通过,为 false 则流程将被驳回 -
支持函数 - setFormByName( - '表单字段名', '表单字段值' - ) - 可改表单数据 -
+ +
+ 请求结果处理 + 自定义脚本: + +
+ +

👉 返回值为 ture 则流程通过,为 false 则流程将被驳回

+

👉 (上线注意)占不支持ES高级语法

+

👉 (上线注意)不支持浏览器的内置函数

+ + + + + +
- 👉 无论请求结果如何,均通过 -
-
- 请求成功😀: - -
-
- 请求失败😥: - -
+ 👉 无论请求结果如何,均通过 +
+
+ 测试
- +
+ 请求成功😀: + +
+
+ 请求失败😥: + +
+
+
- + - - + + + + + + + - +
@@ -109,44 +128,87 @@ diff --git a/flowable-engine-web/src/views/common/process/nodes/CcNode.vue b/flowable-engine-web/src/views/common/process/nodes/CcNode.vue index 8dbb720..6b58235 100644 --- a/flowable-engine-web/src/views/common/process/nodes/CcNode.vue +++ b/flowable-engine-web/src/views/common/process/nodes/CcNode.vue @@ -28,7 +28,7 @@ export default { computed: { selectUser() { return { - show: this.config.props.assignedType !== 'ASSIGN_USER', + show: this.config.props.assignedType !== 'ASSIGN_USER' && this.config.props.shouldAdd, multiple: true }; },