1. 工单详情 2.首页接口对接 3.日志管理

main
赵培友 3 years ago
parent 72818d64d3
commit 81e49a0cd6
  1. 7
      src/api/logs.js
  2. 7
      src/api/maintenance/database.js
  3. 4
      src/api/plugin/workflow/form.js
  4. 16
      src/api/wel/wel.js
  5. 64
      src/const/journal/journal.js
  6. 66
      src/const/workflow/todo.js
  7. 10
      src/styles/custom/custom.scss
  8. 210
      src/views/journal/index.vue
  9. 33
      src/views/maintenance/database1.vue
  10. 773
      src/views/plugin/workflow/mixins/ex-form.js
  11. 106
      src/views/plugin/workflow/process/components/detail.vue
  12. 41
      src/views/plugin/workflow/process/components/examForm.vue
  13. 34
      src/views/plugin/workflow/process/components/form.vue
  14. 39
      src/views/plugin/workflow/process/start.vue
  15. 97
      src/views/wel/index.vue
  16. 108
      src/views/work/process/leave/detail.vue

@ -62,3 +62,10 @@ export const getErrorLogs = (id) => {
})
}
export const getList = (query) => {
return request({
url: '/api/blade-log/api/list',
method: 'get',
params:query
})
}

@ -23,4 +23,11 @@ export const getDatabaseType = () => {
url: "/api/blade-system/dict-biz/dictionary?code=database_type",
method: "get",
})
}
// 数据库类型
export const getListData = () => {
return request({
url: `${prefix}/listData`,
method: "get",
})
}

@ -101,10 +101,11 @@ export const getTaskTypeData = (query) => {
})
}
// 系统名称/数据库
export const getTaskAndDataBase = () => {
export const getTaskAndDataBase = (query) => {
return request({
url: '/api/blade-workflow/projectInfo/projectAndDataBase',
method: 'get',
params:query
})
}
// 系统名称/数据表
@ -116,3 +117,4 @@ export const getModuleAndDataTable = (query) => {
})
}

@ -0,0 +1,16 @@
import request from '@/router/axios';
const prefix = '/api/blade-workflow/homePage'
// 查询
export const getAboutMy = () => {
return request({
url: `${prefix}/aboutMy`,
method: 'get',
})
}
// 折线图
export const getFlowListMonth = () => {
return request({
url: `${prefix}/flowListMonth`,
method: 'get',
})
}

@ -0,0 +1,64 @@
export const tableOption = {
index: true,
indexLabel: "序号",
indexWidth:120,
labelPosition: "top",
selection: false,
border: false,
headerAlign: "left",
align: "left",
menuAlign:'left',
menuHeaderAlign:'left',
menuBtn: true,
editBtn: false,
delBtn: false,
addBtn: false,
tip: false,
searchMenuSpan: 3, //控制搜索按钮
columnBtn: false,
refreshBtn: false,
header: false,
dialogCustomClass:"custom",
menu: false,
column: [
{
type: "input",
label: "用户",
prop: "createBy",
align: "left",
overHidden: true,
},
{
type: "input",
label: "操作模块",
prop: "aa",
align: "left",
overHidden: true,
},
{
label: "操作时间",
type: "datetime",
overHidden: true,
prop: "createTime",
format: "yyyy-MM-dd HH:mm",
valueFormat: "yyyy-MM-dd HH:mm:ss",
addDisplay:false,
editDisplay: false
},
{
type: "input",
label: "IP地址",
prop: "remoteIp",
align: "left",
overHidden: true,
},
{
type: "input",
label: "操作详情",
prop: "title",
align: "left",
overHidden: true,
},
],
}

@ -0,0 +1,66 @@
export const tableOption = {
index: true,
indexLabel: "序号",
indexWidth: 120,
labelPosition: "top",
selection: false,
border: false,
headerAlign: "left",
align: "left",
menuAlign: "left",
menuHeaderAlign: "left",
menuBtn: true,
editBtn: false,
delBtn: false,
addBtn: false,
tip: false,
searchMenuSpan: 3, //控制搜索按钮
columnBtn: false,
refreshBtn: false,
header: false,
dialogCustomClass: "custom",
column: [
{
label: "流程名称",
prop: "processDefinitionName",
overHidden: true,
},
{
label: "流程标识",
prop: "processDefinitionKey",
overHidden: true,
},
{
label: "流水号",
prop: "serialNumber",
bind: "variables.serialNumber",
overHidden: true,
},
{
label: "流程分类",
row: true,
type: "tree",
dicUrl: "/api/blade-workflow/design/category/tree",
props: {
label: "name",
value: "id",
},
prop: "category",
},
{
label: "当前节点",
prop: "taskName",
},
{
label: "申请人",
prop: "startUsername",
},
{
label: "申请时间",
prop: "createTime",
type: "datetime",
format: "yyyy-MM-dd HH:mm",
width: 165,
},
],
};

@ -101,11 +101,11 @@
height: 50px;
line-height: 50px;
}
.el-col-md-8 {
width: 29%;
}
.el-col-md-8:nth-child(3n + 2) {
margin: 0 100px;
// .el-col-md-8 {
// width: calc(100% / 3.6);
// }
.el-col-md-7:nth-child(3n + 2) {
margin: 0 70px;
}
// input输入框
.el-input--small .el-input__inner {

@ -0,0 +1,210 @@
<template>
<div class="cus-container">
<el-form :model="searchForm">
<div class="search">
<div style="display: flex; align-items: center">
<el-select
v-model="searchForm.taskParentId"
placeholder="任务父类"
class="search-select"
>
<el-option
v-for="item in parentList"
:key="item.id"
:label="item.dictValue"
:value="item.id"
>
</el-option>
</el-select>
<el-select
v-model="searchForm.taskTypeName"
placeholder="任务种类"
class="search-select"
>
<el-option
v-for="item in taskTypeList"
:key="item.taskTypeName"
:label="item.taskTypeName"
:value="item.taskTypeName"
>
</el-option>
</el-select>
<el-select
v-model="searchForm.taskLevel"
placeholder="任务等级"
class="search-select"
>
<el-option
v-for="item in levelList"
:key="item.id"
:label="item.dictValue"
:value="item.id"
>
</el-option>
</el-select>
<el-date-picker
style="width: 314px; margin-right: 20px"
v-model="searchForm.timeArr"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm:ss"
class="search-picker"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
<div style="display: flex">
<el-button class="search-btn" @click="searchHandle(1)"
>查询</el-button
>
<div class="search-reset" @click="searchHandle(2)">
<i class="el-icon-refresh-right" style="font-size: 20px"></i>
</div>
</div>
</div>
</div>
</el-form>
<div style="margin-top: 30px">
<avue-crud
id="avue-id"
ref="crud"
:option="option"
:data="tableData"
:page.sync="page"
:table-loading="loading"
@current-change="currentChange"
@size-change="sizeChange"
>
</avue-crud>
</div>
</div>
</template>
<script>
import { getList } from "@/api/logs";
import { tableOption } from "@/const/journal/journal.js";
export default {
data() {
return {
searchForm: {
timeArr: null,
},
option: tableOption,
page: {
current: 1,
total: 0,
size: 10,
},
//
tableData: [],
loading: false,
parentList: [],
levelList: [],
};
},
created() {
// this.getDict();
this.onLoad();
},
methods: {
//
// getDict() {
// getTaskParent().then((res) => {
// this.parentList = res.data.data;
// const column = this.findObject(this.option.column, "taskParentId");
// column.dicData = res.data.data;
// });
// getTaskLevel().then((res) => {
// this.levelList = res.data.data;
// const column = this.findObject(this.option.column, "taskLevel");
// column.dicData = res.data.data;
// });
// getTaskTypeData().then((res) => {
// this.taskTypeList = res.data.data;
// });
// },
//
onLoad() {
this.loading = true;
const { current, size } = this.page;
if (
this.searchForm.timeArr !== null &&
this.searchForm.timeArr !== undefined
) {
this.searchForm.startTime = this.searchForm.timeArr[0];
this.searchForm.endTime = this.searchForm.timeArr[1];
}
const {
taskParentId,
taskTypeName,
taskLevel,
startTime,
endTime,
} = this.searchForm;
let params = {
taskParentId,
taskTypeName,
taskLevel,
startTime,
endTime,
};
getList({ current, size, ...params }).then((res) => {
const { total, records } = res.data.data;
this.page.total = total;
this.tableData = records;
this.loading = false;
});
},
//
currentChange(currentPage) {
this.page.current = currentPage;
this.onLoad();
},
sizeChange(pageSize) {
this.page.size = pageSize;
this.onLoad();
},
//
searchHandle(index) {
this.page.current = 1;
if (index === 2) {
this.searchForm = {
timeArr: null,
};
}
this.onLoad();
},
},
};
</script>
<style lang="scss" scoped>
.search {
display: flex;
justify-content: space-between;
}
.search-select {
width: 150px;
margin-right: 20px;
}
.search-input {
width: 288px;
}
.search-btn {
width: 130px;
height: 46px !important;
background: #2e92f6;
color: #fff;
margin-left: 40px;
margin-right: 20px;
}
.search-reset {
width: 46px;
height: 44px !important;
background: #ff9130;
color: #fff;
text-align: center;
line-height: 46px;
}
/deep/ .el-input__inner {
height: 46px;
}
</style>

@ -4,15 +4,15 @@
<div class="search">
<div style="display: flex; align-items: center">
<el-select
v-model="searchForm.projectInfoId"
v-model="searchForm.dataBaseName"
placeholder="数据库实例名"
class="search-select"
>
<el-option
v-for="item in projectList"
:key="item.id"
:label="item.projectName"
:value="item.id"
v-for="item in dataBaseNamesList"
:key="item.dataBaseName"
:label="item.dataBaseName"
:value="item.dataBaseName"
>
</el-option>
</el-select>
@ -30,27 +30,27 @@
</el-option>
</el-select>
<el-select
v-model="searchForm.manageDeptId"
v-model="searchForm.company"
placeholder="运维公司"
class="search-select"
>
<el-option
v-for="item in deptsList"
v-for="item in companysList"
:key="item.id"
:label="item.fullName"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
<el-select
v-model="searchForm.maintenanceDeptId"
v-model="searchForm.deptId"
placeholder="管理部门"
class="search-select"
>
<el-option
v-for="item in usersList"
v-for="item in deptsList"
:key="item.id"
:label="item.name"
:label="item.deptName"
:value="item.id"
>
</el-option>
@ -105,6 +105,7 @@ import {
getList,
dowmLoadTemplate,
getDatabaseType,
getListData,
} from "@/api/maintenance/database.js";
import { tableOption } from "@/const/maintenance/database.js";
import { getToken } from "@/util/auth";
@ -127,7 +128,10 @@ export default {
headers: {
"Blade-Auth": "",
},
deptsList: [],
databaseTypeList: [],
companysList: [],
dataBaseNamesList: [],
};
},
filters: {
@ -150,9 +154,16 @@ export default {
},
methods: {
dicBiz() {
//
getDatabaseType().then((res) => {
this.databaseTypeList = res.data.data;
});
getListData().then((res) => {
const { companys, dataBaseNames, depts } = res.data.data;
this.companysList = companys;
this.deptsList = depts;
this.dataBaseNamesList = dataBaseNames;
});
},
//
onLoad() {

@ -1,78 +1,121 @@
import { getFormByProcessId, getFormByProcessDefKey, startProcess, detail, completeTask, transferTask, delegateTask, rollbackTask, terminateProcess, addMultiInstance, withdrawTask } from '@/api/plugin/workflow/process'
import {
getFormByProcessId,
getFormByProcessDefKey,
startProcess,
detail,
completeTask,
transferTask,
delegateTask,
rollbackTask,
terminateProcess,
addMultiInstance,
withdrawTask,
} from "@/api/plugin/workflow/process";
import Layout from '@/page/index/'
import defaultValues from './default-values'
import Layout from "@/page/index/";
import defaultValues from "./default-values";
import Print from '../util/print'
import Watermark from '../util/watermark'
import Print from "../util/print";
import Watermark from "../util/watermark";
import { mapGetters } from 'vuex'
import { mapGetters } from "vuex";
export default {
mixins: [defaultValues],
computed: {
...mapGetters(['tag', 'userInfo', 'permission']),
...mapGetters(["tag", "userInfo", "permission"]),
},
data() {
return {
process: {}, // 流程定义/流程实例信息
buttonList: [], // 配置按钮信息
flow: [], // 流转信息
userSelectType: '', // 人员选择类型 transfer转办 delegate委托 copy抄送 assignee审核人
checkType: 'radio', // 人员选择check类型 radio单选 checkbox多选
comment: '', // 评论
userSelectType: "", // 人员选择类型 transfer转办 delegate委托 copy抄送 assignee审核人
checkType: "radio", // 人员选择check类型 radio单选 checkbox多选
comment: "", // 评论
bpmnOption: {}, // 流程图配置信息
defaultChecked: '', // 人员选择默认选中
defaultChecked: "", // 人员选择默认选中
waiting: true, // 骨架屏加载中
}
};
},
methods: {
// 动态路由跳转
dynamicRoute(row, type, async = false,parent) {
const { id, taskId, processInstanceId, processId, formKey, formUrl, processDefKey } = row
let param = Buffer.from(JSON.stringify({
processId: id,
dynamicRoute(row, type, async = false, parent) {
const {
id,
taskId,
processInsId: processInstanceId || processId,
processDefKey
})).toString('base64')
processInstanceId,
processId,
formKey,
formUrl,
processDefKey,
} = row;
let param = Buffer.from(
JSON.stringify({
processId: id,
taskId,
processInsId: processInstanceId || processId,
processDefKey,
})
).toString("base64");
if (formKey && formKey.startsWith('wf_ex_')) {
if (formUrl) { // 配置了自定义路由
this.$router.push(formUrl + `?p=${param}`)
} else { // 动态添加路由
this.$router.addRoutes([{
path: `/workflow/process/external`,
component: Layout,
children: [{
path: `${formKey.substring(6)}/${type}`,
name: type == 'start' ? '发起流程' : '流程详情',
component: () =>
import( /* webpackChunkName: "views" */ `@/views/plugin/workflow/process/external/${formKey.substring(6)}/${type}.vue`),
}]
}])
this.$router.push(`/workflow/process/external/${formKey.substring(6)}/${type}?p=${param}`)
if (formKey && formKey.startsWith("wf_ex_")) {
if (formUrl) {
// 配置了自定义路由
this.$router.push(formUrl + `?p=${param}`);
} else {
// 动态添加路由
this.$router.addRoutes([
{
path: `/workflow/process/external`,
component: Layout,
children: [
{
path: `${formKey.substring(6)}/${type}`,
name: type == "start" ? "发起流程" : "流程详情",
component: () =>
import(
/* webpackChunkName: "views" */ `@/views/plugin/workflow/process/external/${formKey.substring(
6
)}/${type}.vue`
),
},
],
},
]);
this.$router.push(
`/workflow/process/external/${formKey.substring(
6
)}/${type}?p=${param}`
);
}
} else {
if (async) {
return new Promise((resolve) => {
resolve({ row, type, param })
})
resolve({ row, type, param });
});
} else {
this.$router.push(`/workflow/process/${type}/${param}?parent=${parent}`)
this.$router.push(
`/workflow/process/${type}/${param}?parent=${parent}`
);
}
}
},
// 根据可读可写,过滤avue column
filterAvueColumn(column, taskForm, isExForm = false, props = { label: 'label', prop: 'prop' }) {
const _this = this
filterAvueColumn(
column,
taskForm,
isExForm = false,
props = { label: "label", prop: "prop" }
) {
const _this = this;
if (!column || column.length == 0) return { column, vars: [] }
if (!column || column.length == 0) return { column, vars: [] };
const values = []
const vars = []
column.forEach(col => {
let c = taskForm.find(s => s.id == col[props.prop])
const values = [];
const vars = [];
column.forEach((col) => {
let c = taskForm.find((s) => s.id == col[props.prop]);
if (c && c.readable) {
// /**
// * @deprecated 与节点配置可读可写冲突
@ -81,42 +124,57 @@ export default {
// if ((this.process.isOwner && this.process.status == 'todo') || !this.process.hasOwnProperty('isOwner')) c = { readable: true, writable: true }
// else c = { readable: true, writable: false }
// }
if (!isExForm) { // 非外置表单 处理事件
let event = ['change', 'blur', 'click', 'focus']
event.forEach(e => {
if (col[e]) col[e] = eval((col[e] + '').replace(/this/g, '_this'))
})
if (col.event) Object.keys(col.event).forEach(key => col.event[key] = eval((col.event[key] + '').replace(/this/g, '_this')))
if (!isExForm) {
// 非外置表单 处理事件
let event = ["change", "blur", "click", "focus"];
event.forEach((e) => {
if (col[e])
col[e] = eval((col[e] + "").replace(/this/g, "_this"));
});
if (col.event)
Object.keys(col.event).forEach(
(key) =>
(col.event[key] = eval(
(col.event[key] + "").replace(/this/g, "_this")
))
);
}
if (c.writable) { // 可写,记录需要提交的字段、处理字段默认值
vars.push(col[props.prop])
if (col.value) col.value = _this.getDefaultValues(col.value)
} else { // 不可写,清除校验、默认值
if (col.type == 'dynamic') {
col.children.addBtn = false
col.children.delBtn = false
if (c.writable) {
// 可写,记录需要提交的字段、处理字段默认值
vars.push(col[props.prop]);
if (col.value) col.value = _this.getDefaultValues(col.value);
} else {
// 不可写,清除校验、默认值
if (col.type == "dynamic") {
col.children.addBtn = false;
col.children.delBtn = false;
} else {
col.readonly = true
col.disabled = true
col.readonly = true;
col.disabled = true;
}
delete col.rules
delete col.value
delete col.rules;
delete col.value;
// delete col.event
// event.forEach(e => delete col[e])
}
if (col.type == 'dynamic') { // 处理子表单
col.children.column = _this.filterAvueColumn(col.children.column, taskForm).column
if (col.type == "dynamic") {
// 处理子表单
col.children.column = _this.filterAvueColumn(
col.children.column,
taskForm
).column;
}
if (col.rules && col.pattern) { // 处理正则
col.rules.forEach(c => {
if (c.pattern) c.pattern = new RegExp(col.pattern)
})
if (col.rules && col.pattern) {
// 处理正则
col.rules.forEach((c) => {
if (c.pattern) c.pattern = new RegExp(col.pattern);
});
}
values.push(col)
values.push(col);
}
})
return { column: values, vars }
});
return { column: values, vars };
},
/**
* 获取流程发起表单
@ -125,34 +183,38 @@ export default {
*/
getStartForm(processId) {
return new Promise((resolve, reject) => {
getFormByProcessId({ processId }).then(res => {
const { process } = res.data.data
process.hideComment = true
this.process = process
this.tag.label = '发起流程 - ' + process.name
resolve(res.data.data)
}).catch(() => {
reject()
})
})
getFormByProcessId({ processId })
.then((res) => {
const { process } = res.data.data;
process.hideComment = true;
this.process = process;
this.tag.label = "发起流程 - " + process.name;
resolve(res.data.data);
})
.catch(() => {
reject();
});
});
},
/**
* 获取流程发起表单
* @param processDefKey 流程定义key
* @returns Promise({"process": "流程定义信息", "startForm": "开始节点表单"})
*/
* 获取流程发起表单
* @param processDefKey 流程定义key
* @returns Promise({"process": "流程定义信息", "startForm": "开始节点表单"})
*/
getStartFormByProcessDefKey(processDefKey) {
return new Promise((resolve, reject) => {
getFormByProcessDefKey({ processDefKey }).then(res => {
const { process } = res.data.data
process.hideComment = true
this.process = process
this.tag.label = '发起流程 - ' + process.name
resolve(res.data.data)
}).catch(() => {
reject()
})
})
getFormByProcessDefKey({ processDefKey })
.then((res) => {
const { process } = res.data.data;
process.hideComment = true;
this.process = process;
this.tag.label = "发起流程 - " + process.name;
resolve(res.data.data);
})
.catch(() => {
reject();
});
});
},
/**
* 发起流程
@ -160,38 +222,52 @@ export default {
*/
handleStartProcess(isExForm = false) {
return new Promise((resolve) => {
this.loading = true
this.loading = true;
this.$refs.form.validate((valid, done, msg) => {
let form = this.deepClone(this.form)
let form = this.deepClone(this.form);
if (this.$refs.examineForm && this.$refs.examineForm.examineForm) {
const { copyUser, assignee } = this.$refs.examineForm.examineForm
form = { ...form, copyUser, assignee }
const { copyUser, assignee } = this.$refs.examineForm.examineForm;
form = { ...form, copyUser, assignee };
}
if (valid) {
startProcess(form).then(() => {
if (isExForm === true) {
resolve(done)
} else {
this.$message.success("发起成功")
this.handleCloseTag('/plugin/workflow/process/send')
done()
this.loading = false
}
}).catch(() => {
done()
this.loading = false
})
// 追加
// if(this.tableData.length>0) {
// form = {...form, uploadrecord: this.tableData}
// }
// if (form.uploadrecord.length > 0) {
// for (const key in form.uploadrecord) {
// if(this.userInfo.real_name === form.uploadrecord[key].createUser) {
// form.uploadrecord[key].remark = form.beizhu
// }
// }
// }
startProcess(form)
.then(() => {
if (isExForm === true) {
resolve(done);
} else {
this.$message.success("发起成功");
this.handleCloseTag("/plugin/workflow/process/send");
done();
this.loading = false;
}
})
.catch(() => {
done();
this.loading = false;
});
} else {
done()
this.loading = false
done();
this.loading = false;
if (msg) {
const key = Object.keys(msg)[0]
const rules = msg[key]
this.$message.error(rules.map(r => r.message).join(' | '))
const key = Object.keys(msg)[0];
const rules = msg[key];
this.$message.error(rules.map((r) => r.message).join(" | "));
}
}
})
})
});
});
},
/**
* 获取流程任务详情
@ -201,24 +277,27 @@ export default {
*/
getTaskDetail(taskId, processInsId) {
return new Promise((resolve, reject) => {
detail({ taskId, processInsId }).then(res => {
const { process, form, flow, button } = res.data.data
const { xml } = process
detail({ taskId, processInsId })
.then((res) => {
const { process, form, flow, button } = res.data.data;
const { xml } = process;
const bpmnOption = {
mode: 'view', xml,
flows: this.handleResolveFlows(flow)
}
this.process = process
this.flow = flow
this.buttonList = button
this.bpmnOption = bpmnOption
this.tag.label = '流程详情 - ' + process.processDefinitionName
resolve({ process, form, flow, button, bpmnOption })
}).catch(() => {
reject()
})
})
const bpmnOption = {
mode: "view",
xml,
flows: this.handleResolveFlows(flow),
};
this.process = process;
this.flow = flow;
this.buttonList = button;
this.bpmnOption = bpmnOption;
this.tag.label = "流程详情 - " + process.processDefinitionName;
resolve({ process, form, flow, button, bpmnOption });
})
.catch(() => {
reject();
});
});
},
/**
* 任务审核
@ -226,276 +305,332 @@ export default {
*/
handleCompleteTask(pass, variables) {
return new Promise((resolve, reject) => {
const { comment, copyUser, assignee, attachment } = this.$refs.examineForm.examineForm
const { comment, copyUser, assignee, attachment } =
this.$refs.examineForm.examineForm;
if (!pass && !comment) {
this.$message.error("请填写批复意见")
this.submitLoading = false
reject()
return
this.$message.error("请填写批复意见");
this.submitLoading = false;
reject();
return;
}
const { taskId, processInstanceId, processDefinitionName, processDefinitionId } = this.process
const {
taskId,
processInstanceId,
processDefinitionName,
processDefinitionId,
} = this.process;
const param = {
taskId, processInstanceId, processDefinitionName, processDefinitionId, pass,
comment, copyUser, assignee, variables, attachment
}
completeTask(param).then(() => {
resolve()
}).catch(() => {
reject()
})
})
taskId,
processInstanceId,
processDefinitionName,
processDefinitionId,
pass,
comment,
copyUser,
assignee,
variables,
attachment,
uploadrecord: this.form.uploadrecord,
};
completeTask(param)
.then(() => {
resolve();
})
.catch(() => {
reject();
});
});
},
/**
* 驳回到指定节点
* @param nodeId 节点id
*/
handleRollbackTask(nodeId) {
const { taskId } = this.process
const { taskId } = this.process;
rollbackTask({ comment: this.comment, nodeId, taskId }).then(() => {
this.$message.success("回退成功")
this.handleCloseTag('/plugin/workflow/process/todo')
})
this.$message.success("回退成功");
this.handleCloseTag("/plugin/workflow/process/todo");
});
},
/**
* 终止流程
*/
handleTerminateProcess() {
const comment = this.comment
const comment = this.comment;
if (!comment) {
this.$message.error("请填写批复意见")
return
this.$message.error("请填写批复意见");
return;
}
this.$confirm('确定要终止此流程吗?', '警告', {
type: 'warning'
}).then(() => {
const { taskId } = this.process
this.$confirm("确定要终止此流程吗?", "警告", {
type: "warning",
})
.then(() => {
const { taskId } = this.process;
terminateProcess({ taskId, comment }).then(() => {
this.$message.success("操作成功")
this.handleCloseTag('/plugin/workflow/process/todo')
terminateProcess({ taskId, comment }).then(() => {
this.$message.success("操作成功");
this.handleCloseTag("/plugin/workflow/process/todo");
});
})
}).catch(() => {
})
.catch(() => {});
},
// 人员选择弹窗
handleUserSelect({ type, checkType }) {
if (!this.comment && ['transfer', 'delegate'].includes(type)) {
this.$message.error("请填写批复意见")
return
if (!this.comment && ["transfer", "delegate"].includes(type)) {
this.$message.error("请填写批复意见");
return;
}
if (type == 'assignee') this.defaultChecked = this.$refs.examineForm.examineForm.assignee
else if (type == 'copy') this.defaultChecked = this.$refs.examineForm.examineForm.copyUser
if (type == "assignee")
this.defaultChecked = this.$refs.examineForm.examineForm.assignee;
else if (type == "copy")
this.defaultChecked = this.$refs.examineForm.examineForm.copyUser;
this.$refs['user-select'].visible = true
this.userSelectType = type
this.checkType = checkType
this.$refs["user-select"].visible = true;
this.userSelectType = type;
this.checkType = checkType;
},
// 选人回调
handleUserSelectConfirm(id, name) {
const { comment, copyUser } = this.$refs.examineForm.examineForm
const { taskId, processInstanceId, processDefinitionName, processDefinitionId } = this.process
const { comment, copyUser } = this.$refs.examineForm.examineForm;
const {
taskId,
processInstanceId,
processDefinitionName,
processDefinitionId,
} = this.process;
const type = this.userSelectType
const type = this.userSelectType;
const param = {
taskId, processInstanceId, processDefinitionName, processDefinitionId,
taskId,
processInstanceId,
processDefinitionName,
processDefinitionId,
assignee: id,
comment, copyUser
}
if (type == 'transfer') {
transferTask(param).then(() => { // 转办
this.$message.success("转办成功")
this.handleCloseTag('/plugin/workflow/process/todo')
})
} else if (type == 'delegate') { // 委托
comment,
copyUser,
};
if (type == "transfer") {
transferTask(param).then(() => {
// 转办
this.$message.success("转办成功");
this.handleCloseTag("/plugin/workflow/process/todo");
});
} else if (type == "delegate") {
// 委托
delegateTask(param).then(() => {
this.$message.success("委托成功")
this.handleCloseTag('/plugin/workflow/process/todo')
})
} else if (type == 'addInstance') { // 加签
this.$message.success("委托成功");
this.handleCloseTag("/plugin/workflow/process/todo");
});
} else if (type == "addInstance") {
// 加签
addMultiInstance(param).then(() => {
this.$message.success("加签成功")
})
} else if (type == 'copy') { // 抄送
this.$refs.examineForm.examineForm.copyUser = id
this.$refs.examineForm.examineForm.$copyUser = name
} else if (type == 'assignee') { // 指定下一步审批人
this.$refs.examineForm.examineForm.assignee = id
this.$refs.examineForm.examineForm.$assignee = name
this.$message.success("加签成功");
});
} else if (type == "copy") {
// 抄送
this.$refs.examineForm.examineForm.copyUser = id;
this.$refs.examineForm.examineForm.$copyUser = name;
} else if (type == "assignee") {
// 指定下一步审批人
this.$refs.examineForm.examineForm.assignee = id;
this.$refs.examineForm.examineForm.$assignee = name;
}
this.$refs['user-select'].visible = false
this.$refs["user-select"].visible = false;
},
handleWithdrawTask() {
const { taskId } = this.process
this.$confirm('<p><span style="color: red;">撤销:</span>撤销终止此流程</p><p><span style="color: red;">撤回:</span>撤回到发起人重新提交,若当前流程不存在发起人节点,功能同撤销</p>', '请选择撤销/撤回操作', {
type: 'warning',
distinguishCancelAndClose: true,
confirmButtonText: '撤销',
cancelButtonText: '撤回',
dangerouslyUseHTMLString: true
}).then(() => {
withdrawTask({ taskId, withdrawType: 'wf_withdraw_end' }).then(() => {
this.$message.success("操作成功")
this.handleCloseTag('/plugin/workflow/process/todo')
})
}).catch((action) => {
if (action == 'cancel') {
withdrawTask({ taskId, withdrawType: 'wf_withdraw_start' }).then(() => {
this.$message.success("操作成功")
this.handleCloseTag('/plugin/workflow/process/todo')
})
const { taskId } = this.process;
this.$confirm(
'<p><span style="color: red;">撤销:</span>撤销终止此流程</p><p><span style="color: red;">撤回:</span>撤回到发起人重新提交,若当前流程不存在发起人节点,功能同撤销</p>',
"请选择撤销/撤回操作",
{
type: "warning",
distinguishCancelAndClose: true,
confirmButtonText: "撤销",
cancelButtonText: "撤回",
dangerouslyUseHTMLString: true,
}
})
)
.then(() => {
withdrawTask({ taskId, withdrawType: "wf_withdraw_end" }).then(() => {
this.$message.success("操作成功");
this.handleCloseTag("/plugin/workflow/process/todo");
});
})
.catch((action) => {
if (action == "cancel") {
withdrawTask({ taskId, withdrawType: "wf_withdraw_start" }).then(
() => {
this.$message.success("操作成功");
this.handleCloseTag("/plugin/workflow/process/todo");
}
);
}
});
},
handlePrint() { // 打印
handlePrint() {
// 打印
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
text: "Loading",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
const option = this.deepClone(this.option)
this.option.detail = true
const option = this.deepClone(this.option);
this.option.detail = true;
if (this.option.column) {
this.option.column.forEach(col => {
this.handleTemporaryPrintOption(col)
})
this.option.column.forEach((col) => {
this.handleTemporaryPrintOption(col);
});
}
if (this.option.group) {
this.option.group.forEach(g => {
g.column.forEach(col => {
this.handleTemporaryPrintOption(col)
})
})
this.option.group.forEach((g) => {
g.column.forEach((col) => {
this.handleTemporaryPrintOption(col);
});
});
}
// 汇总表单打印
const summaryOption = this.deepClone(this.summaryOption)
const summaryOption = this.deepClone(this.summaryOption);
if (this.summaryOption && this.summaryOption.group) {
this.summaryOption.group.forEach(g => {
g.collapse = false
g.column.forEach(col => {
this.handleTemporaryPrintOption(col)
})
this.summaryOption.group.forEach((g) => {
g.collapse = false;
g.column.forEach((col) => {
this.handleTemporaryPrintOption(col);
});
setTimeout(() => {
g.collapse = true
})
})
g.collapse = true;
});
});
}
setTimeout(() => {
loading.close()
loading.close();
// const watermarkText = this.userInfo.user_name + " " + this.userInfo.dept_name
// Watermark.set({ watermark_txt: watermarkText }) // 添加水印
Print('#printBody')
this.option = option
this.summaryOption = summaryOption
Watermark.remove() // 删除水印
}, 500)
Print("#printBody");
this.option = option;
this.summaryOption = summaryOption;
Watermark.remove(); // 删除水印
}, 500);
},
// 生成打印临时option
handleTemporaryPrintOption(obj) {
if (!obj.type) return
obj.span = 24
if (obj.type == 'dynamic') {
obj.children.type = 'form'
obj.children.column.forEach(col => {
this.handleTemporaryPrintOption(col)
})
if (!obj.type) return;
obj.span = 24;
if (obj.type == "dynamic") {
obj.children.type = "form";
obj.children.column.forEach((col) => {
this.handleTemporaryPrintOption(col);
});
}
},
// 关闭当前tag,并跳转
handleCloseTag(path) {
this.$store.commit('DEL_TAG', this.tag)
if (path) this.$router.push(path)
this.$store.commit("DEL_TAG", this.tag);
if (path) this.$router.push(path);
},
handleResolveFlows(flow) {
const flows = []
const flows = [];
flow.forEach(f => {
let { assigneeName, createTime, endTime, comments } = f
flow.forEach((f) => {
let { assigneeName, createTime, endTime, comments } = f;
if ((/Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent))) { // safari
createTime = createTime.replace(/-/g, '/')
endTime = endTime.replace(/-/g, '/')
if (
/Safari/.test(navigator.userAgent) &&
!/Chrome/.test(navigator.userAgent)
) {
// safari
createTime = createTime.replace(/-/g, "/");
endTime = endTime.replace(/-/g, "/");
}
const ff = {
id: f.historyActivityId,
class: (!endTime && f.historyActivityType != 'candidate') ? 'nodePrimary' : ''
}
let tooltip = ''
class:
!endTime && f.historyActivityType != "candidate"
? "nodePrimary"
: "",
};
let tooltip = "";
if (assigneeName) {
tooltip = `<span title='${assigneeName}'>${assigneeName}</span><br>`
if (createTime) tooltip += `<span title='${createTime}'>${this.dateFormat(new Date(createTime), 'yyyy-MM-dd hh:mm')}</span><br>`
tooltip = `<span title='${assigneeName}'>${assigneeName}</span><br>`;
if (createTime)
tooltip += `<span title='${createTime}'>${this.dateFormat(
new Date(createTime),
"yyyy-MM-dd hh:mm"
)}</span><br>`;
if (comments && comments.length > 0) {
let comment
let { type, fullMessage } = comments.find(c => c.action == 'AddComment') || {}
let comment;
let { type, fullMessage } =
comments.find((c) => c.action == "AddComment") || {};
if (type == 'assigneeComment') {
comment = '变更审核人:' + fullMessage
ff.class = 'nodeWarn'
if (type == "assigneeComment") {
comment = "变更审核人:" + fullMessage;
ff.class = "nodeWarn";
}
if (type == 'dispatchComment') {
comment = '调度:' + fullMessage
ff.class = 'nodeWarn'
if (type == "dispatchComment") {
comment = "调度:" + fullMessage;
ff.class = "nodeWarn";
}
if (type == 'transferComment') {
comment = '转办:' + fullMessage
ff.class = 'nodeWarn'
if (type == "transferComment") {
comment = "转办:" + fullMessage;
ff.class = "nodeWarn";
}
if (type == 'delegateComment') {
comment = '委托:' + fullMessage
ff.class = 'nodeWarn'
if (type == "delegateComment") {
comment = "委托:" + fullMessage;
ff.class = "nodeWarn";
}
if (type == 'rollbackComment') {
comment = '驳回:' + fullMessage
ff.class = 'nodeError'
if (type == "rollbackComment") {
comment = "驳回:" + fullMessage;
ff.class = "nodeError";
}
if (type == 'terminateComment') {
comment = '终止:' + fullMessage
ff.class = 'nodeError'
if (type == "terminateComment") {
comment = "终止:" + fullMessage;
ff.class = "nodeError";
}
if (type == 'addMultiInstanceComment') {
comment = '加签:' + fullMessage
ff.class = 'nodeWarn'
if (type == "addMultiInstanceComment") {
comment = "加签:" + fullMessage;
ff.class = "nodeWarn";
}
if (type == 'deleteMultiInstanceComment') {
comment = '减签:' + fullMessage
ff.class = 'nodeError'
if (type == "deleteMultiInstanceComment") {
comment = "减签:" + fullMessage;
ff.class = "nodeError";
}
if (type == 'withdrawComment') {
comment = '撤销:' + fullMessage
ff.class = 'nodeWarn'
if (type == "withdrawComment") {
comment = "撤销:" + fullMessage;
ff.class = "nodeWarn";
}
if (type == 'deleteProcessComment') {
comment = '删除流程:' + fullMessage
ff.class = 'nodeError'
if (type == "deleteProcessComment") {
comment = "删除流程:" + fullMessage;
ff.class = "nodeError";
}
if (type == 'comment') {
comment = '审批:' + fullMessage
ff.class = 'nodeSuccess'
if (type == "comment") {
comment = "审批:" + fullMessage;
ff.class = "nodeSuccess";
}
if (comment) tooltip += `<span title='${comment}'>${comment}</span>`
if (comment)
tooltip += `<span title='${comment}'>${comment}</span>`;
}
ff.tooltip = tooltip
ff.tooltip = tooltip;
}
if (f.historyActivityType == 'sequenceFlow') ff.class = 'lineWarn'
else if (!ff.class && f.historyActivityType != 'candidate') ff.class = 'nodeSuccess'
if (f.historyActivityType == "sequenceFlow") ff.class = "lineWarn";
else if (!ff.class && f.historyActivityType != "candidate")
ff.class = "nodeSuccess";
const index = flows.findIndex(fl => fl.id == f.historyActivityId)
if (index != -1) flows.splice(index, 1, ff)
else flows.push(ff)
})
return flows
const index = flows.findIndex((fl) => fl.id == f.historyActivityId);
if (index != -1) flows.splice(index, 1, ff);
else flows.push(ff);
});
return flows;
},
// 上传组件预览
handleUploadPreview(file, column, done) {
const { url } = file
const video = /\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|ogg|mp4)/
const img = /\.(gif|jpg|jpeg|png|GIF|JPG|PNG)/
if (video.test(url) || img.test(url)) done()
else window.open(url)
const { url } = file;
const video = /\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|ogg|mp4)/;
const img = /\.(gif|jpg|jpeg|png|GIF|JPG|PNG)/;
if (video.test(url) || img.test(url)) done();
else window.open(url);
},
}
}
},
};

@ -34,8 +34,8 @@
>
<template slot="uploadrecord">
<el-table
v-if="tableData.length > 0"
:data="tableData"
v-if="form.uploadrecord && form.uploadrecord.length > 0"
:data="form.uploadrecord"
style="width: 100%"
>
<el-table-column prop="name" label="附件名称" width="250">
@ -59,13 +59,13 @@
width="240"
>
</el-table-column>
<el-table-column label="操作">
<template>
<template slot-scope="scope">
<i
v-if="userInfo.real_name === scope.row.createUser"
class="el-icon-delete"
style="cursor: pointer"
@click="deleteFile(index)"
@click="deleteFile(scope.$index)"
></i>
</template>
</el-table-column>
@ -85,6 +85,7 @@
:comment.sync="comment"
:process="process"
@user-select="handleUserSelect"
@uploadSuccess="uploadSuccess"
></wf-examine-form>
</el-card>
</el-tab-pane>
@ -131,11 +132,20 @@
</template>
<script>
import {
downloadFile,
getCompany,
getDepts,
getTaskParent,
getTaskTypeData,
getTaskAndDataBase,
getModuleAndDataTable,
} from "@/api/plugin/workflow/form.js";
import WfExamineForm from "./examForm.vue";
import WfButton from "./button.vue";
import WfFlow from "./flow.vue";
import userSelect from "./user-select";
import {mapGetters} from "vuex";
import exForm from "../../mixins/ex-form";
import theme from "../../mixins/theme";
@ -163,10 +173,44 @@ export default {
vars: [], //
submitLoading: false, // loading
summaryOption: {}, // option
tableData: [],
};
},
computed: {
...mapGetters(["userInfo"]),
},
methods: {
//
async download(row) {
let res = await downloadFile({
path: row.path,
});
const fileName = res.headers["content-disposition"].split(";");
const filename2 = fileName[1].split("=");
const filename3 = decodeURIComponent(filename2[1]);
let blob = new Blob([res.data], {
type: res.type,
});
let downloadElement = document.createElement("a");
let href = window.URL.createObjectURL(blob);
downloadElement.href = href;
downloadElement.download = filename3;
document.body.appendChild(downloadElement);
downloadElement.click();
window.URL.revokeObjectURL(href);
},
//
deleteFile(index) {
this.$confirm("确定要删除附件吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.form.uploadrecord.splice(index, 1);
});
},
uploadSuccess(res) {
this.form.uploadrecord.push(res);
},
//
getDetail(taskId, processInsId) {
this.getTaskDetail(taskId, processInsId).then((res) => {
@ -217,11 +261,57 @@ export default {
detail: true,
});
}
//
const { yunweigongsi, renwufulei, xitongmingchengshujuku } =
variables;
getCompany().then((res) => {
const yunweigongsi = this.findObject(option.column, "yunweigongsi");
yunweigongsi.dicData = res.data.data;
});
getDepts({ id: yunweigongsi }).then((res) => {
const guanlibumen = this.findObject(option.column, "guanlibumen");
guanlibumen.dicData = res.data.data;
});
getTaskParent().then((res) => {
const renwufulei = this.findObject(option.column, "renwufulei");
renwufulei.dicData = res.data.data;
});
getTaskTypeData({ parentId: renwufulei }).then((res) => {
const renwuzhonglei = this.findObject(
this.option.column,
"renwuzhonglei"
);
renwuzhonglei.dicData = res.data.data;
});
getTaskAndDataBase({id:yunweigongsi}).then((res) => {
const datasql = this.findObject(
this.option.column,
"xitongmingchengshujuku"
);
datasql.dicData = res.data.data;
let obj = res.data.data.find(function (i) {
return i.id === xitongmingchengshujuku;
});
getModuleAndDataTable({ id: obj.id, type: obj.type }).then(
(res2) => {
console.log("res", res);
const xitongmokuaishujubiao = this.findObject(
this.option.column,
"xitongmokuaishujubiao"
);
xitongmokuaishujubiao.dicData = res2.data.data;
}
);
});
this.option = option;
this.vars = vars;
}
this.form = variables;
this.waiting = false;
setTimeout(() => {
this.waiting = false;
}, 10);
});
},
handleResolveOption(option, taskForm, status) {

@ -1,7 +1,7 @@
<template>
<avue-form v-model="examineForm"
ref="examineForm"
:option="examineOption"></avue-form>
:option="examineOption" :upload-after="uploadAfter"></avue-form>
</template>
<script>
@ -37,26 +37,14 @@ export default {
examineOption: {
menuBtn: false,
labelPosition: "top",
column: [{
label: '批复意见',
prop: 'comment',
type: 'textarea',
span: 24,
event: {
change: (val) => {
val = typeof val == 'object'? val.value: val
this.$emit('update:comment', val)
}
},
display: true
}, {
column: [ {
label: '附件',
prop: 'attachment',
type: 'upload',
propsHttp: {
res: 'data',
url: 'link',
name: 'originalName'
url: 'path',
name: 'name'
},
props: {
label: 'name',
@ -67,6 +55,19 @@ export default {
display: true,
dragFile: true,
},
{
label: '审批意见',
prop: 'comment',
type: 'textarea',
span: 24,
event: {
change: (val) => {
val = typeof val == 'object'? val.value: val
this.$emit('update:comment', val)
}
},
display: true
},
// {
// label: '',
// prop: '$copyUser',
@ -101,7 +102,13 @@ export default {
methods: {
getComment() {
return this.examineForm.comment
}
},
//
uploadAfter(res, done, loading, column) {
this.$emit("uploadSuccess",res)
done();
this.$message.success("上传成功!");
},
}
}
</script>

@ -25,7 +25,7 @@
v-model="form.yunweigongsi"
placeholder="请选择运维公司"
@change="companyChange"
:disabled="companyList.length===1"
:disabled="companyList.length === 1"
>
<el-option
v-for="item in companyList"
@ -70,8 +70,8 @@
</template>
<template slot="uploadrecord">
<el-table
v-if="tableData.length > 0"
:data="tableData"
v-if="form.uploadrecord && form.uploadrecord.length > 0"
:data="form.uploadrecord"
style="width: 100%"
>
<el-table-column prop="name" label="附件名称" width="250">
@ -93,7 +93,7 @@
<i
class="el-icon-delete"
style="cursor: pointer"
@click="deleteFile(index)"
@click="deleteFile(scope.$index)"
></i>
</template>
</el-table-column>
@ -193,7 +193,6 @@ export default {
option: {},
process: {},
loading: false,
tableData: [],
companyList: [], //
deptList: [], //
taskParentList: [], //
@ -205,22 +204,19 @@ export default {
getCompany().then((res) => {
this.companyList = res.data.data;
if (this.companyList.length > 0) {
const id = this.companyList[0].id
const id = this.companyList[0].id;
this.form.yunweigongsi = id;
this.companyChange(id)
this.companyChange(id);
}
});
getTaskParent().then((res) => {
this.taskParentList = res.data.data;
if(this.$route.query.parent) {
const id = this.$route.query.parent
this.form.renwufulei = id
this.taskParentChange(id)
if (this.$route.query.parent) {
const id = this.$route.query.parent;
this.form.renwufulei = id;
this.taskParentChange(id);
}
});
getTaskAndDataBase().then((res) => {
this.taskAndDataBaseList = res.data.data;
});
},
methods: {
// -
@ -232,6 +228,9 @@ export default {
const guanlibumen = this.findObject(this.option.column, "guanlibumen");
guanlibumen.dicData = res.data.data;
});
getTaskAndDataBase({ id }).then((res) => {
this.taskAndDataBaseList = res.data.data;
});
},
//
taskParentChange(id) {
@ -276,7 +275,10 @@ export default {
},
//
uploadAfter(res, done, loading, column) {
this.tableData.push(res);
if (typeof this.form.uploadrecord == "string") {
this.form.uploadrecord = this.form.uploadrecord.split("");
}
this.form.uploadrecord.push(res);
done();
this.$message.success("上传成功!");
},
@ -287,7 +289,7 @@ export default {
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.tableData.splice(index, 1);
this.form.uploadrecord.splice(index, 1);
});
},
getForm(processId, processDefKey) {

@ -9,10 +9,15 @@
<div class="subTitle">{{ item.remark }}</div>
</div>
<div class="item-top-right">
<img :src="require(`@/assets/img/gdwel/${item.dictKey}.png`)" alt="" />
<img
:src="require(`@/assets/img/gdwel/${item.dictKey}.png`)"
alt=""
/>
</div>
</div>
<div class="btn" @click="dynamicRoute(row, 'start',false,item.id)">立即创建</div>
<div class="btn" @click="dynamicRoute(row, 'start', false, item.id)">
立即创建
</div>
</div>
</div>
</div>
@ -22,12 +27,12 @@
<script>
// v-if="permission.wf_process_start_flow"
import { processList as getList } from "@/api/plugin/workflow/process";
import { getTaskParent } from "@/api/maintenance/task.js"
import { getTaskParent } from "@/api/maintenance/task.js";
import { mapGetters } from "vuex";
import exForm from '../mixins/ex-form'
import WfStartGrid from './components/start/grid.vue'
import WfCategory from './components/category.vue'
import exForm from "../mixins/ex-form";
import WfStartGrid from "./components/start/grid.vue";
import WfCategory from "./components/category.vue";
export default {
mixins: [exForm],
@ -39,27 +44,27 @@ export default {
size: 10,
current: 1,
},
row: {}
row: {},
};
},
computed: {
...mapGetters(["permission"]),
},
created() {
this.onLoad()
this.onLoad();
},
methods: {
onLoad() {
getTaskParent().then(res => {
this.homepageList = res.data.data
})
const {current,size} = this.page
getList(current,size).then(res => {
getTaskParent().then((res) => {
this.homepageList = res.data.data;
});
const { current, size } = this.page;
getList(current, size).then((res) => {
const data = res.data.data;
this.row = data.records[0];
});
}
}
},
},
};
</script>
@ -106,11 +111,11 @@ export default {
color: #666;
text-align: center;
line-height: 37px;
cursor:pointer;
cursor: pointer;
}
}
.item:nth-child(4) {
margin-right: 0;
}
}
</style>
</style>

@ -30,7 +30,7 @@
</div>
</div>
<div class="main">
<div id="lineChart" style="height: 427px"></div>
<div id="lineChart" style="height: calc(100%)"></div>
</div>
<div class="footer">
<div class="footer__item1">
@ -47,6 +47,7 @@
</template>
<script>
import { getAboutMy, getFlowListMonth } from "@/api/wel/wel.js";
export default {
name: "wel",
data() {
@ -55,34 +56,31 @@ export default {
{
id: 1,
title: "到期提醒",
num: 3,
num: "",
},
{
id: 2,
title: "我的待办",
num: 5,
num: "5",
},
{
id: 3,
title: "今日新增",
num: 3,
num: "",
},
{
id: 4,
title: "今日完成",
num: 45,
num: "",
},
],
};
},
created() {
this.onload();
},
methods: {
chart() {
this.lineChart();
this.pieOneChart();
this.pieTwoChart();
this.barChart();
},
lineChart() {
lineChart(xData, monthAddNum, monthFinishNum) {
var myChart = this.$echarts.init(document.getElementById("lineChart"));
//
var option = (option = {
@ -138,15 +136,7 @@ export default {
color: "#CFCFCF",
},
},
data: [
"2022-01",
"2022-02",
"2022-03",
"2022-04",
"2022-05",
"2022-06",
"2022-07",
],
data: xData,
},
yAxis: {
type: "value",
@ -187,7 +177,7 @@ export default {
lineStyle: {
width: 5,
},
data: [100, 50, 101, 350, 90, 230, 210],
data: monthFinishNum,
},
{
name: "月新增",
@ -197,11 +187,16 @@ export default {
width: 5,
},
data: [220, 182, 191, 234, 100, 150, 310],
data: monthAddNum,
},
],
});
myChart.setOption(option);
window.addEventListener("resize", () => {
setTimeout(() => {
myChart.resize();
}, 100);
});
},
pieOneChart() {
var myChart = this.$echarts.init(document.getElementById("pieItemOne"));
@ -261,6 +256,11 @@ export default {
],
};
myChart.setOption(option);
window.addEventListener("resize", () => {
setTimeout(() => {
myChart.resize();
}, 100);
});
},
pieTwoChart() {
var myChart = this.$echarts.init(document.getElementById("pieItemTwo"));
@ -299,13 +299,8 @@ export default {
{ value: 206, name: "进行中" },
{ value: 75, name: "已完成" },
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
hoverAnimation: false,
label: {
normal: {
color: "#000",
@ -315,6 +310,11 @@ export default {
},
},
},
labelLine: {
length: 30,
length2: 20,
show: true,
},
},
{
center: ["36%", "48%"],
@ -322,13 +322,22 @@ export default {
type: "pie",
radius: "30%",
itemStyle: {
color: "#E8F2F6",
color: "#ccc",
},
hoverAnimation: false,
data: [100],
labelLine: {
show: false,
},
},
],
};
myChart.setOption(option);
window.addEventListener("resize", () => {
setTimeout(() => {
myChart.resize();
}, 100);
});
},
barChart() {
var myChart = this.$echarts.init(document.getElementById("barChart"));
@ -411,10 +420,32 @@ export default {
],
};
myChart.setOption(option);
window.addEventListener("resize", () => {
setTimeout(() => {
myChart.resize();
}, 100);
});
},
onload() {
//
getAboutMy().then((res) => {
const { expireNum, needDoNum, todayAddNum, todayFinishNum } =
res.data.data;
const arr = [expireNum, needDoNum, todayAddNum, todayFinishNum];
for (const i in this.headerList) {
this.headerList[i].num = arr[i];
}
});
getFlowListMonth().then((res) => {
const { xData, monthAddNum, monthFinishNum } = res.data.data;
this.lineChart(xData, monthAddNum, monthFinishNum);
});
},
},
mounted() {
this.chart()
this.pieOneChart();
this.pieTwoChart();
this.barChart();
},
};
</script>
@ -448,7 +479,7 @@ export default {
}
}
.main {
height: 427px;
height: calc(100% - 492px);
width: 100%;
background: #fff;
border-radius: 3px;

@ -35,12 +35,22 @@
</div>
<el-row type="flex" class="row-bg">
<el-timeline>
<el-timeline-item :key="flow.id" :timestamp="flow.createTime" v-for="flow in flowList" placement="top">
<el-timeline-item
:key="flow.id"
:timestamp="flow.createTime"
v-for="flow in flowList"
placement="top"
>
<el-card shadow="hover">
<p>{{flow.assigneeName}} [{{flow.createTime}}] 开始处理 [{{flow.historyActivityName}}] 环节</p>
<p v-if="flow.historyActivityDurationTime!==''">任务历时 [{{flow.historyActivityDurationTime}}]</p>
<p v-if="flow.comment!==''">批复意见: [{{flow.comment}}]</p>
<p v-if="flow.endTime!==''">结束时间: [{{flow.endTime}}]</p>
<p>
{{ flow.assigneeName }} [{{ flow.createTime }}] 开始处理
[{{ flow.historyActivityName }}] 环节
</p>
<p v-if="flow.historyActivityDurationTime !== ''">
任务历时 [{{ flow.historyActivityDurationTime }}]
</p>
<p v-if="flow.comment !== ''">批复意见: [{{ flow.comment }}]</p>
<p v-if="flow.endTime !== ''">结束时间: [{{ flow.endTime }}]</p>
</el-card>
</el-timeline-item>
</el-timeline>
@ -51,7 +61,10 @@
<span>流程跟踪</span>
</div>
<el-row class="row-bg">
<flow-design :is-display="true" :process-instance-id="processInstanceId"></flow-design>
<flow-design
:is-display="true"
:process-instance-id="processInstanceId"
></flow-design>
</el-row>
</el-card>
</el-form>
@ -59,49 +72,48 @@
</template>
<script>
import {historyFlowList, leaveDetail} from "@/api/work/process";
export default {
data() {
return {
businessId: '',
processInstanceId: '',
src: '',
flowList: [],
form: {
flow:{
assigneeName:'',
},
startTime: '',
endTime: '',
reason: '',
import { historyFlowList, leaveDetail } from "@/api/work/process";
export default {
data() {
return {
businessId: "",
processInstanceId: "",
src: "",
flowList: [],
form: {
flow: {
assigneeName: "",
},
startTime: "",
endTime: "",
reason: "",
},
};
},
created() {
this.init();
},
methods: {
init() {
this.processInstanceId = this.$route.params.processInstanceId;
this.businessId = this.$route.params.businessId;
historyFlowList(this.processInstanceId).then((res) => {
const data = res.data;
if (data.success) {
this.flowList = data.data;
}
}
});
leaveDetail(this.businessId).then((res) => {
const data = res.data;
if (data.success) {
this.form = data.data;
}
});
},
created() {
this.init();
handleCancel() {
this.$router.$avueRouter.closeTag();
this.$router.push({ path: `/work/start` });
},
methods: {
init() {
this.processInstanceId = this.$route.params.processInstanceId;
this.businessId = this.$route.params.businessId;
historyFlowList(this.processInstanceId).then(res => {
const data = res.data;
if (data.success) {
this.flowList = data.data;
}
})
leaveDetail(this.businessId).then(res => {
const data = res.data;
if (data.success) {
this.form = data.data;
}
})
},
handleCancel() {
this.$router.$avueRouter.closeTag();
this.$router.push({path: `/work/start`});
}
}
}
},
};
</script>

Loading…
Cancel
Save