范文健康探索娱乐情感热点
投稿投诉
热点动态
科技财经
情感日志
励志美文
娱乐时尚
游戏搞笑
探索旅游
历史星座
健康养生
美丽育儿
范文作文
教案论文

工作流ActivitiOA低代码平台bpmnjs源码分析

  低代码平台第二步:bpmnjs源码分析
  带您感受下低代码的功能实现案例,通过简单的几步操作,就能完成一个模块的CRUD操作。
  更多技术文档请点击查看:bpmnjs源码分析 · 语雀
  预览地址:青锋后台管理系统
  核心代码位置-package
  bpmn核心代码全部在package包下面,如下图的位置:
  流程设计器模块process-designer页面对应内容
  页面布局代码                                                                           设计器控制面板process-panel
  代码重构基础组件refactor
  包含了基础组件、流程表达式、流程表单、监听器、多实例、其他任务、参数设置、信号消息、任务管理等等基础组件。
  了解了代码重构的基础组件,在实际业务中可以根据自己的需求进行修改。
  任务组件-改造讲解
  在工作流的设计器中,我们对任务组件做了改造,由于之前的任务只能选择固定的人员或者组织,并没有和实际的数据库进行关联,无法与系统的用户打通,导致设计流程任务审批节点无法动态配置。
  为了打通工作流与系统用户、组织之间的壁垒,我们通过对流程设计器的改造,重新指定了任务组件。
  静态用户任务基础业务介绍
  1、选择静态分配后,我们可以选择用户和组织信息。
  2、选择用户和组织的公共组件可以查看单选用户、单选组织、多选用户、多选组织的案例。
  功能代码介绍
  创建候选静态候选用户表单,可以动态选择用户或者组织。                选择       清空                        选择       清空     
  重新设置用户表单
  resetTaskForm() {       this.$set(this.userTaskForm, "model_id", this.bpmnElement.parent.id);       this.$set(this.userTaskForm, "node_key", this.bpmnElement?.id);       for (let key in this.defaultTaskForm) {         let value;         if (key === "candidateUsers" || key === "candidateGroups") {           value = this.bpmnElement?.businessObject[key]             ? this.bpmnElement.businessObject[key].split(",")             : [];           if (value != "") {             findUserOrOrganizeNames({ type: key, ids: value.join(",") }).then(               (response) => {                 console.log(response);                 if (key === "candidateUsers") {                   this.$set(                     this.userTaskForm,                     "candidateUsers",                     response.data.data.myIds                   );                   this.$set(                     this.userTaskForm,                     "candidateUsersName",                     response.data.data.myNames                   );                 } else if (key === "candidateGroups") {                   this.$set(                     this.userTaskForm,                     "candidateGroups",                     response.data.data.myIds                   );                   this.$set(                     this.userTaskForm,                     "candidateGroupsName",                     response.data.data.myNames                   );                 }               }             );           } else {             if (key === "candidateUsers") {               this.$set(this.userTaskForm, "candidateUsers", "");               this.$set(this.userTaskForm, "candidateUsersName", "");             } else if (key === "candidateGroups") {               this.$set(this.userTaskForm, "candidateGroups", "");               this.$set(this.userTaskForm, "candidateGroupsName", "");             }           }         } else if (key === "assignee") {           value =             this.bpmnElement?.businessObject[key] || this.defaultTaskForm[key];           if (value != "") {             findUserOrOrganizeNames({ type: key, ids: value }).then(               (response) => {                 this.$set(                   this.userTaskForm,                   "assignee",                   response.data.data.myIds                 );                 this.$set(                   this.userTaskForm,                   "assigneeName",                   response.data.data.myNames                 );               }             );           } else {             this.$set(this.userTaskForm, "assignee", "");             this.$set(this.userTaskForm, "assigneeName", "");           }         } else {           value =             this.bpmnElement?.businessObject[key] || this.defaultTaskForm[key];           this.$set(this.userTaskForm, key, value);         }         console.log(key + "|" + value);       }动态用户任务
                                                                                                                     节点解析所有人员中选择(根据组织选择)
  可以从系统人员中,选择节点需要审批的人员,可以指定一个人或者多个人,如果指定一个,则这个人就是本节点的办理人,如果指定了多个人,则流程下发时由上一级用户选择。
  组织选择(指定组织父节点)
  指定组织父节点后,节点办理人为当前组织下的人员,上一节点用户发起流程可以从改组织下面所有的人员中选择下级节点的办理人。
  用户组选择(选择指定组内成员)
  指定用户分组,节点办理人为当前用户组下的人员,上一节点用户发起流程可以从该分组下面所有的人员中选择下级节点的办理人。
  发起人本组织选择
  节点办理人为当前用户同组织下的人员,上一节点用户发起流程可以从发起人同组织下面所有的人员中选择下级节点的办理人。
  部门经理
  在人员中设置人员的部门经理,流程发起人员发起的流程由发起人的部门经理进行审批。
  上级领导
  在人员中设置人员的上级领导,流程发起人员发起的流程由发起人的上级领导进行审批。
  分管领导
  在人员中设置人员的分管领导,流程发起人员发起的流程由发起人的分管领导进行审批。
  流程发起人
  用户节点由流程发起人审批。
  指定范围选择
  指定范围选择-可以选择一个用户集合,用户节点审核时,由上一节点办理人指定用户节点具体的办理人。
  代理人(选择单用户)
  如果节点设置为代理人,则可以指定当前审核代理人,制定后节点由设置的代理人进行审核。
  候选人(选择多用户)
  候选人,可以设置多为候选人,流程审批节点会同时给多为候选人发起审批任务,谁先认领谁审批,由第一个认领的候选人审批。
  候选组(选择多组织)
  候选组的概念同候选人,流程审批节点会同时给多为候选组下的所有人发起审批任务,谁先认领谁审批,由第一个认领的候选人审批。
  在activiti7中,抛弃了候选组审批的功能,在activiti5 和activiti6中依然保持着候选组的审批模式。
  功能代码分析
  下面是具体的核心方法源码,完成的源码需要在代码中进行查看和分析。    cellclick(row) {       var key = this.checktype;       let taskAttr = Object.create(null);       this.userTaskForm.assignee = row.id;       this.dialogVisible = false;       if (key === "candidateUsers" || key === "candidateGroups") {         taskAttr[key] =           this.userTaskForm[key] && this.userTaskForm[key].length             ? this.userTaskForm[key].join()             : null;       } else {         taskAttr[key] = this.userTaskForm[key] || null;         console.log(taskAttr[key]);       }       window.bpmnInstances.modeling.updateProperties(         this.bpmnElement,         taskAttr       );     },     clearAssignee(key) {       let value;       let taskAttr = Object.create(null);       if (key === "candidateUsers" || key === "candidateGroups") {         console.log(key);       } else {         taskAttr[key] = ""; //this.bpmnElement?.businessObject[key] || this.defaultTaskForm[key];       }       this.$set(this.userTaskForm, key, "");       window.bpmnInstances.modeling.updateProperties(         this.bpmnElement,         taskAttr       );     },      //初始化initGroup     initGroup() {       findGroupList({}).then((response) => {         this.groupList = response.data.data;       });     },      //选择办理人     selectAssignee() {       this.dialog(SelectOneUser, "assignee", {         user_id: this.userTaskForm.assignee,         user_name: this.userTaskForm.assigneeName,       });     },     //选择候选人     selectCandidateUsers() {       this.dialog(SelectMoreUser, "candidateUsers", {         user_ids: this.userTaskForm.candidateUsers,         user_names: this.userTaskForm.candidateUsersName,       });     },     //选择候选组     selectCandidateGroups() {       this.dialog(SelectMoreOrganize, "candidateGroups", {         organize_ids: this.userTaskForm.candidateGroups,         organize_names: this.userTaskForm.candidateGroupsName,       });     },      //选择单组织     selectOneOrganize() {       this.dialog(SelectOneOrganize, "oneOrganize", {         organize_id: this.userTaskForm.organize_id,         organize_name: this.userTaskForm.organize_name,       });     },     //选择多用户     selectMoreUser() {       this.dialog(SelectMoreUser, "moreUser", {         user_ids: this.userTaskForm.user_ids,         user_names: this.userTaskForm.user_names,       });     },     //选择单用户     selectOneUser() {       this.dialog(SelectOneUser, "oneUser", {         user_id: this.userTaskForm.user_id,         user_name: this.userTaskForm.user_name,       });     },     //选择多组织     selectMoreOrganize() {       this.dialog(SelectMoreOrganize, "moreOrganize", {         organize_ids: this.userTaskForm.organize_ids,         organize_names: this.userTaskForm.organize_names,       });     },      //选择用户组织弹框     dialog(component, fileType, record) {       console.log(component, fileType, record);       const that = this;       this.$dialog(         component,         // component props         {           record,           on: {             ok() {               console.log("ok 回调");             },             cancel() {               console.log("cancel 回调");             },             close() {               console.log("modal close 回调");             },             initValue(value, type) {               if (type == "1") {                 if (fileType == "assignee") {                   that.userTaskForm.assignee = value.split(":")[0];                   that.userTaskForm.assigneeName = value.split(":")[1];                   //更新文档参数                   that.updateActivitiProperties(                     "assignee",                     value.split(":")[0]                   );                   that.saveAssignMode(                     value.split(":")[0] + "#" + value.split(":")[1]                   );                 } else if (fileType == "oneUser") {                   that.userTaskForm.user_id = value.split(":")[0];                   that.userTaskForm.user_name = value.split(":")[1];                   that.saveAssignMode(                     value.split(":")[0] + "#" + value.split(":")[1]                   );                 }               } else if (type == "2") {                 if (fileType == "candidateUsers") {                   that.userTaskForm.candidateUsers = value.split(":")[0];                   that.userTaskForm.candidateUsersName = value.split(":")[1];                   //更新文档参数                   that.updateActivitiProperties(                     "candidateUsers",                     value.split(":")[0]                   );                   that.saveAssignMode(                     value.split(":")[0] + "#" + value.split(":")[1]                   );                 } else if (fileType == "moreUser") {                   that.userTaskForm.user_ids = value.split(":")[0];                   that.userTaskForm.user_names = value.split(":")[1];                   that.saveAssignMode(                     value.split(":")[0] + "#" + value.split(":")[1]                   );                 }               } else if (type == "3") {                 if (fileType == "oneOrganize") {                   that.userTaskForm.organize_id = value.split(":")[0];                   that.userTaskForm.organize_name = value.split(":")[1];                   that.saveAssignMode(                     value.split(":")[0] + "#" + value.split(":")[1]                   );                 }               } else if (type == "4") {                 if (fileType == "candidateGroups") {                   that.userTaskForm.candidateGroups = value.split(":")[0];                   that.userTaskForm.candidateGroupsName = value.split(":")[1];                   //更新文档参数                   that.updateActivitiProperties(                     "candidateGroups",                     value.split(":")[0]                   );                   that.saveAssignMode(                     value.split(":")[0] + "#" + value.split(":")[1]                   );                 } else if (fileType == "moreOrganize") {                   that.userTaskForm.organize_ids = value.split(":")[0];                   that.userTaskForm.organize_names = value.split(":")[1];                   that.saveAssignMode(                     value.split(":")[0] + "#" + value.split(":")[1]                   );                 }               }               that.$forceUpdate();             },           },         },         // modal props         {           title: "操作",           width: 800,           height: 500,           centered: true,           maskClosable: false,           okText: "确认",           cancelText: "取消",         }       );     },     updateActivitiProperties(key, value) {       let taskAttr = {};       taskAttr[key] = value;       window.bpmnInstances.modeling.updateProperties(         this.bpmnElement,         taskAttr       );     },     selectAssignMode() {       let assign_mode = this.userTaskForm.assign_mode;       let assign_content = this.userTaskForm.assign_content;       if (         assign_mode == "0" ||         assign_mode == "3" ||         assign_mode == "4" ||         assign_mode == "5" ||         assign_mode == "6" ||         assign_mode == "7" ||         (assign_mode == "2" &&           assign_content != "" &&           assign_content != undefined)       ) {         saveAssignment({           id: this.userTaskForm.node_id,           type: this.userTaskForm.type,           assign_mode: this.userTaskForm.assign_mode,           assign_content: this.userTaskForm.assign_content,           model_id: this.userTaskForm.model_id,           node_key: this.userTaskForm.node_key,         }).then((response) => {           console.log(response);         });       }     },     saveAssignMode(assign_content) {       saveAssignment({         id: this.userTaskForm.node_id,         type: this.userTaskForm.type,         assign_mode: this.userTaskForm.assign_mode,         model_id: this.userTaskForm.model_id,         node_key: this.userTaskForm.node_key,         assign_content: assign_content,       }).then((response) => {         console.log(response);       });     },   },    beforeDestroy() {     this.bpmnElement = null;   }, };

给老人买助听器,有哪些经验可以分享?带老人去验配中心验配助听器,检测听力后进行试听,让老人根据自己聆听后的感受进行选择,助听器的款式,老人的生活环境,听力损失情况都要考虑到!应该到专业的听力中心检查后再选配(有的医院联发科公布了Dimensity920和Dimensity810芯片的相关信息Dimensity920采用6nm工艺制造,配备2个ARMCortexA78核心6个ARMCortexA55核心以及MalG68GPUDimensity810则是采用6nm工艺制造华为入场,落后二十年的光刻机技术终于有望得到突破华为随着华为遭到芯片限制的影响,我们再一次将目光聚集到半导体这一高端技术领域。华为在逆境之中依然没有放弃并且开始招募人才进入光刻机领域,芯片制造这一困扰了我们半个多世纪的难题终于有荣耀发布其离开华为后的首款旗舰手机Magic3,美国威胁要限制荣耀这款新旗舰手机最终获得了Google的应用和服务许可,将在全球推出自前母公司华为出售以来,Honor(荣耀)发布了其首款旗舰智能手机Magic3系列手机。该阵容包括三款手机,Mag一加66T推送OxygenOS11Beta3更新优化后台进程管理机制IT之家8月10日消息据OnePlus论坛用户称,一加现在正在向O一加6和一加6T智能手机推出OxygenOS11OpenBeta3系统更新。新的开放测试版不包括新功能,但包含与V助听器的寿命是五到八年,之后还能用吗?助听器的使用寿命一般在56年左右,但也不代表这期间助听器不坏。不管是耳背式还是定制式,都是需要定期保养干燥,日常维护。平时注意保养,防潮,防震,防耳垢。三个月左右到听力中心做常规保高速稳定,一卡多用铠侠极至光速microSD存储卡评测Hello,大家好,我是小胖子。半个月前收到了KIOXIA铠侠寄来的一张256GB的TF卡,用了大半个月,让我们看看这款产品表现如何吧。其实很多人并不太了解铠侠,问我铠侠是什么品牌颜值不俗火力全开爱国者K100压制噪音游戏玩家都注重的游戏体验不只是分辨率和帧数,音频效果也同样不能忽视。爱国者针对游戏玩家需要的静音环境,将散热和降噪结合起来,打造出了YOGOK100机箱。爱国者YOGOK100机箱魅族两款新机通过核准认证截图曝光是魅蓝回归还是迭代新机?众所周知,在去年虽然魅族科技仅发布了魅族17魅族17Pro两款旗舰机型,但是仍然实现了盈利。那么在今年,其首批搭载了高通骁龙888旗舰处理器的魅族18系列自从上市之后就赢得了相当不桌面级安卓播放器,山灵EM5安卓加持,全新物种!桌面级全新物种,现已来袭!厌倦了单调的封闭系统与简陋的操作界面,全新的桌面级安卓播放器EM5,掀起一场台机新革命!桌面级安卓播放器?意味着比移动版更强劲的性能。LG32英寸UltraFineOLED4K显示器发售约合2。59万元IT之家8月13日消息LG于今年CES2021上,发布了一款UltraFine系列OELD显示器,型号为32EP950B。今日这款显示器正式在官网开售,定价高达3999。99美元,
会飞的汽车你能信吗?小鹏推第六代飞行汽车着急你就飞过去不是玩笑,可能就要实现了哦!10月24日,小鹏汽车第三届1024科技日。在会上小鹏官宣了第六代飞行汽车计划,小鹏这次貌似是铁了心要造飞行汽车,并同时同步了量产计划表和ROG幻142021款以轻薄幻彩赋能创意新思不知从何时起,大家开始越来越注重创意!为孩子起名字时会绞尽脑汁观看广告时会纠结广告的形式欣赏电影综艺时会留心海报设计,即使在生活中一些不起眼的小地方,只要有些小创意存在,就会格外吸Q1归母营运利润增长8。9金融升温背后,平安正在走向用户在漫长的商业历史中,几乎所有优秀的企业都有一个特征,就是从不画地为牢,而是总能随着时代变迁而持续进行战略迭代。比如,腾讯从最初的即时通讯工具,逐渐进化到覆盖社交内容等领域的庞大社交农商行也要活下去谁能想到,手握放贷大权的银行,有一天也要开始担心自己的生存问题了。多重压力之下,农商行活下来要提上议事日程,不赚钱不盈利肯定会倒闭,现在能够活下来是最关键的。不久前,佛山农商行董事现在的哈啰,像极了三年前的美团过去一年,美团无疑是资本市场上最受关注的公司之一,其股价从去年低点的70。1港元最高上涨到460港元,涨幅超过5倍。但当我们将目光拉到三年前,美团的情况却截然不同。尽管从生态延伸初2400家公司公布年度分红方案,开普云分红超千万年报分红季来临,上市公司纷纷公布分红方案。根据choice数据,截至2021年4月27日,共有2418家公司公布了分红方案。其中分配方案中涉及派现的有2408家,包含送转的有302达内宣布达成私有化协议,KKR新东方创始人韩少云现身买方团4月30日,美国上市公司达内教育集团(NASDAQTEDU)宣布达成私有化协议,上达资本KKR新东方高榕资本及创始人董事长韩少云为买方团成员。受此消息影响,达内教育集团股价开盘上涨亮相上海车展,恒大汽车价值升维之路开启近日的上海国际车展,可谓是新能源汽车行业最热的车圈大事件。车展向来是没有硝烟的战场,车企把技术车型创意等十八般武艺都拿出来较量,既是向行业秀实力,也是市场人气的比拼。当然,在4月1从读书郎冲刺上市,看千亿在线教育的隐秘战场去年,可能没有什么比在线教育赛道,更受投资人关注了。在一级市场,猿辅导和作业帮先后完成新一轮融资,投后估值分别在155亿美元和110亿美元左右。事实上,这也不难理解。在线教育可能中蓝光发展被迫卖卖卖背后,中小房企暴雷潮开始了4月底,蓝光发展卖身传闻四起,这家成立于1993年的老房企,似乎已经很难撑到而立之年。这也不奇怪,谁让公司在过去几年,太激进了呢。2015年开启的房地产小牛市,让敢于激进举债拿地的史上最强一季报背后,不得不提的伊利电商有句话说得好,大浪淘沙沉者为金,风卷残云胜者为王。4月28日,伊利股份发布了2020年年报。财报显示,报告期内,公司营业总收入达968。86亿元,归母净利润70。78亿元,逆势实现