matter.js
3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { STATUS, STATUS_DOT_CLASS_NAME_MAP } from '@/views/matter/myTask/const'
import moment from 'moment'
import clipboard from '@/utils/clipboard'
export default {
componentName: 'MatterComponent',
data() {
return {
status: STATUS,
pageResult: {
page: 1,
pageSize: 20,
total: 0,
},
nodeId: '',
defId: '',
pageSizes: [20, 40, 60, 100, 200, 300],
instanceId: '',
bpmnInstId: '',
statusDotClassName: STATUS_DOT_CLASS_NAME_MAP,
matterClassifyId: null,
baseSearchQuery: {
orgName: '',
orgId: '',
},
}
},
created() {
this.$on('matter-classify-update', (nodeId) => {
this.matterClassifyId = nodeId
})
},
methods: {
handleShowFlowChart(row) {
this.instanceId = row.procInstId || row.id
this.bpmnInstId = row.bpmnInstId
this.nodeId = row.nodeId
this.defId = row.procDefId
this.$nextTick(() => {
// this.$refs.flowChart.handleOpen()
this.$refs.processForecast &&
this.$refs.processForecast.handleOpen(
row.procInstId || row.ID_ || row.id,
row,
row.nodeId,
false,
'flowChart'
)
this.$refs?.htTable.$refs.htTable.toggleRowSelection(row)
})
},
getCurrentQuery(param, property) {
let query = param?.querys || []
if (this.matterClassifyId) {
const typeIdQuery = query.find(
(q) => q.group == 'typeId' && q.property == property
)
if (typeIdQuery) {
typeIdQuery['value'] = this.matterClassifyId
} else {
query.push({
property: property,
value: this.matterClassifyId,
group: 'typeId',
operation: 'IN',
relation: 'AND',
})
}
}
return query
},
calcExpireTime(deadline) {
if (deadline) {
const duration = moment(deadline).diff(new Date())
if (duration > 0) return deadline
const hour = moment(new Date()).diff(deadline, 'hours')
const minute = moment(new Date()).diff(deadline, 'minutes') % 60
return `已到期${hour}时${minute}分`
}
},
currentDateClassName(deadline) {
const duration = moment(deadline).diff(new Date())
const overThreeDay = moment(new Date()).diff(deadline, 'day') >= 3
if (duration > 0) {
return 'green-color'
} else if (overThreeDay) {
return 'orange-color'
} else {
return 'red-color'
}
},
rowClassName({ row }) {
let className = ''
const statusList = [
'revoke',
'revokeToStart',
'back',
'backToStart',
'BACK',
'BACKSHARE',
]
if (
statusList.includes(row.instStatus) ||
statusList.includes(row.status)
) {
className = 'red-row'
//row.priority === 60 指延后处理任务
} else if (row.priority === 60) {
className = 'gray-row'
}
return className
},
//复制文本方法
clipboard,
},
}