网站的下载二维码怎么做,wordpress媒体页,wordpress更换IP,ios网站开发教程更多ruoyi-nbcio功能请看演示系统
gitee源代码地址
前后端代码#xff1a; https://gitee.com/nbacheng/ruoyi-nbcio
演示地址#xff1a;RuoYi-Nbcio后台管理系统
1、增加一个状态字段
wf_copy增加下面两个字段 就用未读已读来区分
2、前端
api接口增加如下#xff…更多ruoyi-nbcio功能请看演示系统
gitee源代码地址
前后端代码 https://gitee.com/nbacheng/ruoyi-nbcio
演示地址RuoYi-Nbcio后台管理系统
1、增加一个状态字段
wf_copy增加下面两个字段 就用未读已读来区分
2、前端
api接口增加如下
// 查询流程我的抄送列表
export function listMyCopyProcess(query) {return request({url: /workflow/process/myCopyList,method: get,params: query})
}//抄送人已读状态
export function updateCcReaded(parameter) {return request({url: /workflow/process/updateViewStatust,method:get,params: parameter})
}templatediv classapp-containerel-form :modelqueryParams refqueryForm sizesmall :inlinetrue v-showshowSearch label-width68pxel-form-item label流程名称 propprocessNameel-inputv-modelqueryParams.processNameplaceholder请输入流程名称clearablekeyup.enter.nativehandleQuery//el-form-itemel-form-item label发起人 proporiginatorNameel-inputv-modelqueryParams.originatorNameplaceholder请输入发起人clearablekeyup.enter.nativehandleQuery//el-form-itemel-form-itemel-button typeprimary iconel-icon-search sizemini clickhandleQuery搜索/el-buttonel-button iconel-icon-refresh sizemini clickresetQuery重置/el-button/el-form-item/el-formel-row :gutter10 classmb8el-col :span1.5el-buttontypewarningplainiconel-icon-downloadsizeminiv-hasPermi[workflow:process:copyExport]clickhandleExport导出/el-button/el-colright-toolbar :showSearch.syncshowSearch queryTablegetList/right-toolbar/el-rowel-table v-loadingloading :datacopyList selection-changehandleSelectionChangeel-table-column typeselection width55 aligncenter /el-table-column label抄送编号 aligncenter propcopyId /el-table-column label标题 aligncenter proptitle :show-overflow-tooltiptrue /el-table-column label流程名称 aligncenter propprocessName :show-overflow-tooltiptrue /el-table-column label发起人 aligncenter proporiginatorName /el-table-column label创建时间 aligncenter propcreateTimetemplate slot-scopescopespan{{ parseTime(scope.row.createTime) }}/span/template/el-table-columnel-table-column label操作 aligncenter class-namesmall-padding fixed-widthtemplate slot-scopescopeel-buttonsizeminitypetexticonel-icon-ticketsclickhandleFlowRecord(scope.row)v-hasPermi[workflow:process:query]详情/el-button/template/el-table-column/el-tablepaginationv-showtotal0:totaltotal:page.syncqueryParams.pageNum:limit.syncqueryParams.pageSizepaginationgetList//div
/templatescript
import { listMyCopyProcess } from /api/workflow/processexport default {name: myCopy,data() {return {// 按钮loadingbuttonLoading: false,// 遮罩层loading: true,// 选中数组ids: [],// 非单个禁用single: true,// 非多个禁用multiple: true,// 显示搜索条件showSearch: true,// 总条数total: 0,// 流程抄送表格数据copyList: [],// 弹出层标题title: ,// 是否显示弹出层open: false,// 查询参数queryParams: {pageNum: 1,pageSize: 10,processId: undefined,processName: undefined,categoryId: undefined,taskId: undefined,userId: undefined,originatorName: undefined,},// 表单参数form: {},// 表单校验rules: {copyId: [{ required: true, message: 抄送主键不能为空, trigger: blur }],processId: [{ required: true, message: 流程主键不能为空, trigger: blur }],processName: [{ required: true, message: 流程名称不能为空, trigger: blur }],categoryId: [{ required: true, message: 流程分类主键不能为空, trigger: blur }],taskId: [{ required: true, message: 任务主键不能为空, trigger: blur }],userId: [{ required: true, message: 用户主键不能为空, trigger: blur }]}};},created() {this.getList();},methods: {/** 查询流程抄送列表 */getList() {this.loading true;listMyCopyProcess(this.queryParams).then(response {this.copyList response.rows;this.total response.total;this.loading false;});},// 取消按钮cancel() {this.open false;this.reset();},// 表单重置reset() {this.form {copyId: undefined,processId: undefined,processName: undefined,categoryId: undefined,taskId: undefined,userId: undefined,originatorName: undefined,createBy: undefined,createTime: undefined,updateBy: undefined,updateTime: undefined,delFlag: undefined};this.resetForm(form);},/** 搜索按钮操作 */handleQuery() {this.queryParams.pageNum 1;this.getList();},/** 重置按钮操作 */resetQuery() {this.resetForm(queryForm);this.handleQuery();},// 多选框选中数据handleSelectionChange(selection) {this.ids selection.map(item item.copyId)this.single selection.length!1this.multiple !selection.length},/** 查看详情 */handleFlowRecord(row){console.log(row);this.$router.push({path: /workflow/process/detail/ row.instanceId,query: {taskId: row.taskId,processed: false}})},/** 导出按钮操作 */handleExport() {this.download(workflow/process/copyExport, {...this.queryParams}, wf_copy_process_${new Date().getTime()}.xlsx)}}
};
/script上面是我的抄送主要是接口不一样。
抄送点击详情的时候更新一下状态 /** 查看详情 */handleFlowRecord(row){console.log(row);updateCcReaded({ id: row.copyId }).then(res {if (res.success) {console.log(res);}})this.$router.push({path: /workflow/process/detail/ row.instanceId,query: {taskId: row.taskId,processed: false}})},
3、后端
查询我的抄送代码 /*** 查询我的流程抄送列表** param bo 流程抄送* return 流程抄送*/Overridepublic TableDataInfoWfCopyVo selectMyPageList(WfCopyBo bo, PageQuery pageQuery) {LambdaQueryWrapperWfCopy lqw buildMyQueryWrapper(bo);lqw.orderByDesc(WfCopy::getCreateTime);PageWfCopyVo result baseMapper.selectVoPage(pageQuery.build(), lqw);return TableDataInfo.build(result);}/*** 查询流程抄送列表** param bo 流程抄送* return 流程抄送*/Overridepublic ListWfCopyVo selectList(WfCopyBo bo) {LambdaQueryWrapperWfCopy lqw buildQueryWrapper(bo);return baseMapper.selectVoList(lqw);}private LambdaQueryWrapperWfCopy buildMyQueryWrapper(WfCopyBo bo) {MapString, Object params bo.getParams();LoginUser sysUser commonService.getLoginUser();LambdaQueryWrapperWfCopy lqw Wrappers.lambdaQuery();lqw.eq(bo.getUserId() sysUser.getUserId(), WfCopy::getOriginatorId, bo.getUserId());return lqw;}
更新抄送代码如下 Overridepublic Boolean makeCopy(WfTaskBo taskBo) {if (StringUtils.isBlank(taskBo.getCopyUserIds())) {// 若抄送用户为空则不需要处理返回成功return true;}HistoricProcessInstance historicProcessInstance historyService.createHistoricProcessInstanceQuery().processInstanceId(taskBo.getProcInsId()).singleResult();String[] ids taskBo.getCopyUserIds().split(,);ListWfCopy copyList new ArrayList(ids.length);Long originatorId LoginHelper.getUserId();String originatorName LoginHelper.getNickName();String title historicProcessInstance.getProcessDefinitionName() - taskBo.getTaskName();for (String id : ids) {Long userId Long.valueOf(id);WfCopy copy new WfCopy();copy.setTitle(title);copy.setProcessId(historicProcessInstance.getProcessDefinitionId());copy.setProcessName(historicProcessInstance.getProcessDefinitionName());copy.setDeploymentId(historicProcessInstance.getDeploymentId());copy.setInstanceId(taskBo.getProcInsId());copy.setTaskId(taskBo.getTaskId());copy.setUserId(userId);copy.setOriginatorId(originatorId);copy.setOriginatorName(originatorName);copy.setState(未读);copyList.add(copy);}return baseMapper.insertBatch(copyList);}Overridepublic void updateStatus(String id) {baseMapper.updateState(id);}update idupdateState parameterTypecom.ruoyi.workflow.domain.WfCopyupdate wf_copyset state 已读WHERE copy_id#{id}/update
4、效果图如下