@@ -144,6 +144,7 @@ import { DICT_TYPE, getDictOptions } from '@/utils/dict'
144
144
import * as ConfigApi from ' @/api/infra/config'
145
145
import ConfigForm from ' ./form.vue'
146
146
import dayjs from ' dayjs'
147
+ import download from ' @/utils/download'
147
148
const message = useMessage () // 消息弹窗
148
149
const { t } = useI18n () // 国际化
149
150
@@ -162,12 +163,6 @@ const queryParams = reactive({
162
163
const queryFormRef = ref () // 搜索的表单
163
164
const exportLoading = ref (false ) // 导出的加载中
164
165
165
- /** 搜索按钮操作 */
166
- const handleQuery = () => {
167
- queryParams .pageNo = 1
168
- getList ()
169
- }
170
-
171
166
/** 查询参数列表 */
172
167
const getList = async () => {
173
168
loading .value = true
@@ -180,6 +175,12 @@ const getList = async () => {
180
175
}
181
176
}
182
177
178
+ /** 搜索按钮操作 */
179
+ const handleQuery = () => {
180
+ queryParams .pageNo = 1
181
+ getList ()
182
+ }
183
+
183
184
/** 重置按钮操作 */
184
185
const resetQuery = () => {
185
186
queryFormRef .value .resetFields ()
@@ -195,7 +196,7 @@ const openModal = (type: string, id?: number) => {
195
196
/** 删除按钮操作 */
196
197
const handleDelete = async (id : number ) => {
197
198
try {
198
- // 二次确认
199
+ // 删除的二次确认
199
200
await message .delConfirm ()
200
201
// 发起删除
201
202
await ConfigApi .deleteConfig (id )
@@ -205,6 +206,20 @@ const handleDelete = async (id: number) => {
205
206
} catch {}
206
207
}
207
208
209
+ const handleExport = async () => {
210
+ try {
211
+ // 导出的二次确认
212
+ await message .exportConfirm ()
213
+ // 发起导出
214
+ exportLoading .value = true
215
+ const data = await ConfigApi .exportConfigApi (queryParams )
216
+ download .excel (data , ' 参数配置.xls' )
217
+ } catch {
218
+ } finally {
219
+ exportLoading .value = false
220
+ }
221
+ }
222
+
208
223
/** 初始化 **/
209
224
onMounted (() => {
210
225
getList ()
0 commit comments