00405156
wuxw
优化代码
|
1
2
3
4
5
6
7
8
9
|
<template>
<div class="oa-workflow-manage-container">
<!-- 查询条件 -->
<el-card class="search-wrapper">
<div slot="header" class="flex justify-between">
<span>{{ $t('oaWorkflowManage.search.title') }}</span>
</div>
<el-row :gutter="20">
<el-col :span="6">
|
8e6e71fd
wuxw
优化代码
|
10
11
|
<el-input v-model.trim="searchForm.flowName" :placeholder="$t('oaWorkflowManage.search.flowNamePlaceholder')"
clearable />
|
00405156
wuxw
优化代码
|
12
13
|
</el-col>
<el-col :span="6">
|
8e6e71fd
wuxw
优化代码
|
14
15
16
17
|
<el-select v-model="searchForm.flowType" :placeholder="$t('oaWorkflowManage.search.flowTypePlaceholder')"
style="width:100%">
<el-option :label="$t('oaWorkflowManage.search.selectAll')" value="" />
<el-option v-for="item in flowTypes" :key="item.statusCd" :label="item.name" :value="item.statusCd" />
|
00405156
wuxw
优化代码
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
</el-select>
</el-col>
<el-col :span="6">
<el-button type="primary" @click="handleSearch">
<i class="el-icon-search"></i>
{{ $t('common.search') }}
</el-button>
<el-button @click="handleReset">
<i class="el-icon-refresh"></i>
{{ $t('common.reset') }}
</el-button>
</el-col>
</el-row>
</el-card>
<!-- 流程实例列表 -->
<el-card class="list-wrapper">
<div slot="header" class="flex justify-between">
<span>{{ $t('oaWorkflowManage.list.title') }}</span>
|
8e6e71fd
wuxw
优化代码
|
37
|
<el-button type="primary" size="small" style="float:right" @click="handleAdd">
|
00405156
wuxw
优化代码
|
38
39
40
41
42
|
<i class="el-icon-plus"></i>
{{ $t('oaWorkflowManage.list.addWorkflow') }}
</el-button>
</div>
|
8e6e71fd
wuxw
优化代码
|
43
44
45
46
|
<el-table v-loading="loading" :data="tableData" border style="width:100%">
<el-table-column prop="flowId" :label="$t('oaWorkflowManage.table.flowId')" align="center" />
<el-table-column prop="flowName" :label="$t('oaWorkflowManage.table.flowName')" align="center" />
<el-table-column prop="flowType" :label="$t('oaWorkflowManage.table.flowType')" align="center">
|
00405156
wuxw
优化代码
|
47
|
<template slot-scope="scope">
|
8e6e71fd
wuxw
优化代码
|
48
49
|
{{ scope.row.flowType === '1001' ? $t('oaWorkflowManage.table.normalFlow') :
$t('oaWorkflowManage.table.unknown') }}
|
00405156
wuxw
优化代码
|
50
51
|
</template>
</el-table-column>
|
8e6e71fd
wuxw
优化代码
|
52
53
54
|
<el-table-column prop="modelId" :label="$t('oaWorkflowManage.table.modelId')" align="center" />
<el-table-column prop="flowKey" label="KEY" align="center" />
<el-table-column prop="state" :label="$t('oaWorkflowManage.table.state')" align="center">
|
00405156
wuxw
优化代码
|
55
|
<template slot-scope="scope">
|
8e6e71fd
wuxw
优化代码
|
56
57
|
{{ scope.row.state === 'C' ? $t('oaWorkflowManage.table.deployed') :
$t('oaWorkflowManage.table.pendingDeploy') }}
|
00405156
wuxw
优化代码
|
58
59
|
</template>
</el-table-column>
|
8e6e71fd
wuxw
优化代码
|
60
61
62
|
<el-table-column prop="describle" :label="$t('oaWorkflowManage.table.describle')" align="center" width="150" />
<el-table-column prop="createTime" :label="$t('oaWorkflowManage.table.createTime')" align="center" />
<el-table-column :label="$t('common.operation')" align="center" width="300" fixed="right">
|
00405156
wuxw
优化代码
|
63
|
<template slot-scope="scope">
|
8e6e71fd
wuxw
优化代码
|
64
|
<el-button size="mini" type="text" @click="handleWorkflowEditor(scope.row)">
|
00405156
wuxw
优化代码
|
65
66
|
{{ $t('oaWorkflowManage.table.workflow') }}
</el-button>
|
8e6e71fd
wuxw
优化代码
|
67
|
<el-button size="mini" type="text" @click="handleWorkflowForm(scope.row)">
|
00405156
wuxw
优化代码
|
68
69
|
{{ $t('oaWorkflowManage.table.designForm') }}
</el-button>
|
8e6e71fd
wuxw
优化代码
|
70
|
<el-button type="text" v-if="scope.row.state === 'W'" size="mini" @click="handleDeploy(scope.row)">
|
00405156
wuxw
优化代码
|
71
72
|
{{ $t('oaWorkflowManage.table.deploy') }}
</el-button>
|
8e6e71fd
wuxw
优化代码
|
73
|
<el-button size="mini" type="text" @click="handleEdit(scope.row)">
|
00405156
wuxw
优化代码
|
74
75
|
{{ $t('common.edit') }}
</el-button>
|
8e6e71fd
wuxw
优化代码
|
76
|
<el-button size="mini" type="text" @click="handleDelete(scope.row)">
|
00405156
wuxw
优化代码
|
77
78
79
80
81
82
|
{{ $t('common.delete') }}
</el-button>
</template>
</el-table-column>
</el-table>
|
8e6e71fd
wuxw
优化代码
|
83
84
85
|
<el-pagination :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size"
:total="pagination.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
@current-change="handleCurrentChange" />
|
00405156
wuxw
优化代码
|
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
</el-card>
<!-- 组件 -->
<add-oa-workflow ref="addWorkflow" @success="handleSuccess" />
<edit-oa-workflow ref="editWorkflow" @success="handleSuccess" />
<delete-oa-workflow ref="deleteWorkflow" @success="handleSuccess" />
</div>
</template>
<script>
import { getOaWorkflowList, deployModel } from '@/api/oa/oaWorkflowManageApi'
import { getDict } from '@/api/community/communityApi'
import AddOaWorkflow from '@/components/oa/addOaWorkflow'
import EditOaWorkflow from '@/components/oa/editOaWorkflow'
import DeleteOaWorkflow from '@/components/oa/deleteOaWorkflow'
export default {
name: 'OaWorkflowManageList',
components: {
AddOaWorkflow,
EditOaWorkflow,
DeleteOaWorkflow
},
data() {
return {
loading: false,
searchForm: {
flowName: '',
flowType: '',
state: ''
},
tableData: [],
flowTypes: [],
states: [],
pagination: {
current: 1,
size: 10,
total: 0
}
}
},
created() {
this.getList()
this.getDictData()
},
methods: {
async getList() {
try {
this.loading = true
const params = {
page: this.pagination.current,
row: this.pagination.size,
...this.searchForm
}
const { data, total } = await getOaWorkflowList(params)
this.tableData = data
this.pagination.total = total
} catch (error) {
this.$message.error(this.$t('oaWorkflowManage.fetchError'))
} finally {
this.loading = false
}
},
async getDictData() {
try {
this.flowTypes = await getDict('oa_workflow', 'flow_type')
this.states = await getDict('oa_workflow', 'state')
} catch (error) {
console.error('获取字典数据失败:', error)
}
},
handleSearch() {
this.pagination.current = 1
this.getList()
},
handleReset() {
this.searchForm = {
flowName: '',
flowType: '',
state: ''
}
this.handleSearch()
},
handleAdd() {
this.$refs.addWorkflow.open()
},
handleEdit(row) {
this.$refs.editWorkflow.open(row)
},
handleDelete(row) {
this.$refs.deleteWorkflow.open(row)
},
handleWorkflowEditor(row) {
window.open(`/bpmnjs/index.html?flowId=${row.flowId}&modelId=${row.modelId}`)
},
handleWorkflowForm(row) {
window.open(`/formjs/editor.html?flowId=${row.flowId}&modelId=${row.modelId}`)
},
async handleDeploy(row) {
try {
this.loading = true
const res = await deployModel({ modelId: row.modelId })
this.$message.success(res.msg)
this.getList()
} catch (error) {
this.$message.error(this.$t('oaWorkflowManage.deployError'))
} finally {
this.loading = false
}
},
handleSuccess() {
this.getList()
},
handleSizeChange(val) {
this.pagination.size = val
this.getList()
},
handleCurrentChange(val) {
this.pagination.current = val
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.oa-workflow-manage-container {
padding: 20px;
.search-wrapper {
|
d0f57231
wuxw
点击logo 进入首页bug 修复
|
216
|
margin-bottom: 10px;
|
00405156
wuxw
优化代码
|
217
218
219
220
221
222
223
|
.el-input {
width: 100%;
}
}
.list-wrapper {
|
d0f57231
wuxw
点击logo 进入首页bug 修复
|
224
|
margin-bottom: 10px;
|
00405156
wuxw
优化代码
|
225
226
227
228
229
230
231
232
|
.el-pagination {
margin-top: 20px;
text-align: right;
}
}
}
</style>
|