提交 | 用户 | 时间
|
820397
|
1 |
<template> |
H |
2 |
|
|
3 |
<ContentWrap> |
|
4 |
<!-- 搜索工作栏 --> |
|
5 |
<el-form |
|
6 |
class="-mb-15px" |
|
7 |
:model="queryParams" |
|
8 |
ref="queryFormRef" |
|
9 |
:inline="true" |
|
10 |
label-width="68px" |
|
11 |
> |
|
12 |
<el-form-item label="名字" prop="name"> |
|
13 |
<el-input |
|
14 |
v-model="queryParams.name" |
|
15 |
placeholder="请输入名字" |
|
16 |
clearable |
|
17 |
@keyup.enter="handleQuery" |
|
18 |
class="!w-240px" |
|
19 |
/> |
|
20 |
</el-form-item> |
|
21 |
<el-form-item label="状态" prop="status"> |
|
22 |
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px"> |
|
23 |
<el-option |
|
24 |
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" |
|
25 |
:key="dict.value" |
|
26 |
:label="dict.label" |
|
27 |
:value="dict.value" |
|
28 |
/> |
|
29 |
</el-select> |
|
30 |
</el-form-item> |
|
31 |
<el-form-item label="创建时间" prop="createTime"> |
|
32 |
<el-date-picker |
|
33 |
v-model="queryParams.createTime" |
|
34 |
value-format="YYYY-MM-DD HH:mm:ss" |
|
35 |
type="daterange" |
|
36 |
start-placeholder="开始日期" |
|
37 |
end-placeholder="结束日期" |
|
38 |
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" |
|
39 |
class="!w-240px" |
|
40 |
/> |
|
41 |
</el-form-item> |
|
42 |
<el-form-item> |
|
43 |
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> |
|
44 |
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> |
|
45 |
<el-button |
|
46 |
type="primary" |
|
47 |
plain |
|
48 |
@click="openForm('create')" |
|
49 |
v-hasPermi="['bpm:process-expression:create']" |
|
50 |
> |
|
51 |
<Icon icon="ep:plus" class="mr-5px" /> 新增 |
|
52 |
</el-button> |
|
53 |
</el-form-item> |
|
54 |
</el-form> |
|
55 |
</ContentWrap> |
|
56 |
|
|
57 |
<!-- 列表 --> |
|
58 |
<ContentWrap> |
|
59 |
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> |
|
60 |
<el-table-column label="编号" align="center" prop="id" /> |
|
61 |
<el-table-column label="名字" align="center" prop="name" /> |
|
62 |
<el-table-column label="状态" align="center" prop="status"> |
|
63 |
<template #default="scope"> |
|
64 |
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" /> |
|
65 |
</template> |
|
66 |
</el-table-column> |
|
67 |
<el-table-column label="表达式" align="center" prop="expression" /> |
|
68 |
<el-table-column |
|
69 |
label="创建时间" |
|
70 |
align="center" |
|
71 |
prop="createTime" |
|
72 |
:formatter="dateFormatter" |
|
73 |
width="180px" |
|
74 |
/> |
|
75 |
<el-table-column label="操作" align="center"> |
|
76 |
<template #default="scope"> |
|
77 |
<el-button |
|
78 |
link |
|
79 |
type="primary" |
|
80 |
@click="openForm('update', scope.row.id)" |
|
81 |
v-hasPermi="['bpm:process-expression:update']" |
|
82 |
> |
|
83 |
编辑 |
|
84 |
</el-button> |
|
85 |
<el-button |
|
86 |
link |
|
87 |
type="danger" |
|
88 |
@click="handleDelete(scope.row.id)" |
|
89 |
v-hasPermi="['bpm:process-expression:delete']" |
|
90 |
> |
|
91 |
删除 |
|
92 |
</el-button> |
|
93 |
</template> |
|
94 |
</el-table-column> |
|
95 |
</el-table> |
|
96 |
<!-- 分页 --> |
|
97 |
<Pagination |
|
98 |
:total="total" |
|
99 |
v-model:page="queryParams.pageNo" |
|
100 |
v-model:limit="queryParams.pageSize" |
|
101 |
@pagination="getList" |
|
102 |
/> |
|
103 |
</ContentWrap> |
|
104 |
|
|
105 |
<!-- 表单弹窗:添加/修改 --> |
|
106 |
<ProcessExpressionForm ref="formRef" @success="getList" /> |
|
107 |
</template> |
|
108 |
|
|
109 |
<script setup lang="ts"> |
|
110 |
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict' |
|
111 |
import { dateFormatter } from '@/utils/formatTime' |
|
112 |
import { ProcessExpressionApi, ProcessExpressionVO } from '@/api/bpm/processExpression' |
|
113 |
import ProcessExpressionForm from './ProcessExpressionForm.vue' |
|
114 |
|
|
115 |
/** BPM 流程表达式列表 */ |
|
116 |
defineOptions({ name: 'BpmProcessExpression' }) |
|
117 |
|
|
118 |
const message = useMessage() // 消息弹窗 |
|
119 |
const { t } = useI18n() // 国际化 |
|
120 |
|
|
121 |
const loading = ref(true) // 列表的加载中 |
|
122 |
const list = ref<ProcessExpressionVO[]>([]) // 列表的数据 |
|
123 |
const total = ref(0) // 列表的总页数 |
|
124 |
const queryParams = reactive({ |
|
125 |
pageNo: 1, |
|
126 |
pageSize: 10, |
|
127 |
name: undefined, |
|
128 |
status: undefined, |
|
129 |
createTime: [] |
|
130 |
}) |
|
131 |
const queryFormRef = ref() // 搜索的表单 |
|
132 |
const exportLoading = ref(false) // 导出的加载中 |
|
133 |
|
|
134 |
/** 查询列表 */ |
|
135 |
const getList = async () => { |
|
136 |
loading.value = true |
|
137 |
try { |
|
138 |
const data = await ProcessExpressionApi.getProcessExpressionPage(queryParams) |
|
139 |
list.value = data.list |
|
140 |
total.value = data.total |
|
141 |
} finally { |
|
142 |
loading.value = false |
|
143 |
} |
|
144 |
} |
|
145 |
|
|
146 |
/** 搜索按钮操作 */ |
|
147 |
const handleQuery = () => { |
|
148 |
queryParams.pageNo = 1 |
|
149 |
getList() |
|
150 |
} |
|
151 |
|
|
152 |
/** 重置按钮操作 */ |
|
153 |
const resetQuery = () => { |
|
154 |
queryFormRef.value.resetFields() |
|
155 |
handleQuery() |
|
156 |
} |
|
157 |
|
|
158 |
/** 添加/修改操作 */ |
|
159 |
const formRef = ref() |
|
160 |
const openForm = (type: string, id?: number) => { |
|
161 |
formRef.value.open(type, id) |
|
162 |
} |
|
163 |
|
|
164 |
/** 删除按钮操作 */ |
|
165 |
const handleDelete = async (id: number) => { |
|
166 |
try { |
|
167 |
// 删除的二次确认 |
|
168 |
await message.delConfirm() |
|
169 |
// 发起删除 |
|
170 |
await ProcessExpressionApi.deleteProcessExpression(id) |
|
171 |
message.success(t('common.delSuccess')) |
|
172 |
// 刷新列表 |
|
173 |
await getList() |
|
174 |
} catch {} |
|
175 |
} |
|
176 |
|
|
177 |
/** 初始化 **/ |
|
178 |
onMounted(() => { |
|
179 |
getList() |
|
180 |
}) |
|
181 |
</script> |