提交 | 用户 | 时间
|
820397
|
1 |
<!-- 执行器选择 --> |
H |
2 |
<template> |
|
3 |
<Dialog title="请选择监听器" v-model="dialogVisible" width="1024px"> |
|
4 |
<ContentWrap> |
|
5 |
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> |
|
6 |
<el-table-column label="名字" align="center" prop="name" /> |
|
7 |
<el-table-column label="类型" align="center" prop="type"> |
|
8 |
<template #default="scope"> |
|
9 |
<dict-tag :type="DICT_TYPE.BPM_PROCESS_LISTENER_TYPE" :value="scope.row.type" /> |
|
10 |
</template> |
|
11 |
</el-table-column> |
|
12 |
<el-table-column label="事件" align="center" prop="event" /> |
|
13 |
<el-table-column label="值类型" align="center" prop="valueType"> |
|
14 |
<template #default="scope"> |
|
15 |
<dict-tag |
|
16 |
:type="DICT_TYPE.BPM_PROCESS_LISTENER_VALUE_TYPE" |
|
17 |
:value="scope.row.valueType" |
|
18 |
/> |
|
19 |
</template> |
|
20 |
</el-table-column> |
|
21 |
<el-table-column label="值" align="center" prop="value" /> |
|
22 |
<el-table-column label="操作" align="center"> |
|
23 |
<template #default="scope"> |
|
24 |
<el-button link type="primary" @click="select(scope.row)"> 选择 </el-button> |
|
25 |
</template> |
|
26 |
</el-table-column> |
|
27 |
</el-table> |
|
28 |
<!-- 分页 --> |
|
29 |
<Pagination |
|
30 |
:total="total" |
|
31 |
v-model:page="queryParams.pageNo" |
|
32 |
v-model:limit="queryParams.pageSize" |
|
33 |
@pagination="getList" |
|
34 |
/> |
|
35 |
</ContentWrap> |
|
36 |
</Dialog> |
|
37 |
</template> |
|
38 |
<script setup lang="ts"> |
|
39 |
import { ProcessListenerApi, ProcessListenerVO } from '@/api/bpm/processListener' |
|
40 |
import { DICT_TYPE } from '@/utils/dict' |
|
41 |
import { CommonStatusEnum } from '@/utils/constants' |
|
42 |
|
|
43 |
/** BPM 流程 表单 */ |
|
44 |
defineOptions({ name: 'ProcessListenerDialog' }) |
|
45 |
|
|
46 |
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
47 |
const loading = ref(true) // 列表的加载中 |
|
48 |
const list = ref<ProcessListenerVO[]>([]) // 列表的数据 |
|
49 |
const total = ref(0) // 列表的总页数 |
|
50 |
const queryParams = reactive({ |
|
51 |
pageNo: 1, |
|
52 |
pageSize: 10, |
|
53 |
type: '', |
|
54 |
status: CommonStatusEnum.ENABLE |
|
55 |
}) |
|
56 |
|
|
57 |
/** 打开弹窗 */ |
|
58 |
const open = async (type: string) => { |
|
59 |
queryParams.pageNo = 1 |
|
60 |
queryParams.type = type |
|
61 |
getList() |
|
62 |
dialogVisible.value = true |
|
63 |
} |
|
64 |
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
65 |
|
|
66 |
/** 查询列表 */ |
|
67 |
const getList = async () => { |
|
68 |
loading.value = true |
|
69 |
try { |
|
70 |
const data = await ProcessListenerApi.getProcessListenerPage(queryParams) |
|
71 |
list.value = data.list |
|
72 |
total.value = data.total |
|
73 |
} finally { |
|
74 |
loading.value = false |
|
75 |
} |
|
76 |
} |
|
77 |
|
|
78 |
/** 提交表单 */ |
|
79 |
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|
80 |
const select = async (row) => { |
|
81 |
dialogVisible.value = false |
|
82 |
// 发送操作成功的事件 |
|
83 |
emit('select', row) |
|
84 |
} |
|
85 |
</script> |