portalAction.js
4.48 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
export default {
data() {
return {
pagination: {
page: 1,
pageSize: 30,
total: 0,
},
selectedRows: [],
pageSizes: [10, 20, 30, 50, 100, 200, 300],
headerStyle: {
background: '#fafafa',
},
}
},
computed: {
tableHeight() {
return this.$baseTableHeight(-47)
},
},
mounted() {
this.$baseEventBus.$on('get-layout-config', () => {
localStorage.setItem(
this.columnConfig.id,
JSON.stringify(this.columnConfig.updateDate)
)
if (this.$refs.htPortal) {
this.$refs.htPortal?.updateColumnLayout()
}
})
this.$baseEventBus.$on('add-column', (layoutId) => {
if (this.$refs.htPortal) {
this.$refs.htPortal.addColumn(layoutId)
}
})
},
methods: {
handleClickProcess(row, type, tableData) {
if (['commonProcess', 'processOverview', 'collection'].includes(type)) {
this.$refs.leaderDialog.handleNewProcessJumps(row)
} else if (type === 'todo') {
this.$refs.leaderDialog.handleJumpsTodoPage(
row,
{
isGetApprovalBtn: true,
type: 'fromTodoList',
key: tableData.length === 1 ? 'onlyOneTask' : '',
},
(url) => {
this.menuSelect('11')
}
)
} else if (type === 'request') {
this.handleRequestJump(row)
} else if (type === 'draft') {
const path = '/matter/startProcess'
this.$router.push({
path,
query: this.getCurrentQuery(row, type),
})
} else if (type === 'done') {
this.setReaded(row.id)
const path = '/matter/approvalForm'
this.$router.push({
path,
query: this.getCurrentQuery(row, type),
})
} else {
const path = '/matter/approvalForm'
this.$router.push({
path,
query: this.getCurrentQuery(row, type),
})
}
},
getColumnLayout(data) {
this.columnConfig = data
sessionStorage.setItem('layoutId', data.id)
//判断管理端是否修改了栏目布局 identifyChange:0.前台未进行拖拽 1.前台更新后,后台未更新 2.前台更新之后,后台进行更新
if ([1, 2].includes(data.identifyChange)) {
localStorage.setItem(`isNewLayout_${data.id}`, true)
this.$baseEventBus.$emit('change-layout', { isNewLayout: true })
} else {
localStorage.setItem(`isNewLayout_${data.id}`, false)
this.$baseEventBus.$emit('change-layout', { isNewLayout: false })
}
},
changeLayout() {
localStorage.setItem(`isDragColumn_${this.columnConfig.id}`, true)
this.$baseEventBus.$emit('change-layout', { isDragColumn: true })
},
handleRequestJump(row) {
getMyRequestTask(row.id).then((res) => {
let task = res.value
const path = '/matter/approvalForm'
let query = {
instId: row.id,
// 这个参数用于检查是否有撤回流程权限
type: 'request',
myApplication: true,
}
if (task && task.id) {
query = {
...query,
taskId: task.id,
isGetApprovalBtn: true,
}
}
this.$router.push({
path,
query,
})
})
},
setReaded(id) {
this.$requestConfig.setReaded({ procInstId: id }).then((resp) => {
console.log(resp)
})
},
getCurrentQuery(row, type) {
const { id, procInstId, nodeId } = row
const queryMap = {
done: {
type: 'done',
doneTaskId: row.taskId,
isDefAuthorize: row.isDefAuthorize,
},
draft: {
defId: row.procDefId,
name: row.subject,
instStatus: row.status,
},
received: {
readId: row.id, //为知会任务表的id
receivedStatus: row.status,
isRead: row.isRead,
},
circulated: {
readId: row.id,
},
}
let query = {
instId: ['done', 'request', 'draft'].includes(type) ? id : procInstId,
nodeId,
from: type,
}
if (['done', 'draft', 'received', 'circulated'].includes(type)) {
query = {
...query,
...queryMap[type],
}
}
if (['draft', 'done'].includes(type)) {
delete query.from
}
return query
},
menuSelect(index) {
this.$store.dispatch('app/addVisitedMenus', index)
},
},
}