59
59
<!-- 操作栏 -->
60
60
<!-- TODO 间隔貌似有点问题 没发现 -->
61
61
<el-row :gutter =" 10" class =" mb8" >
62
- <!-- TODO 芋艿,图标不对 已解决 -->
63
62
<el-col :span =" 1.5" >
64
63
<el-button
65
64
type =" primary"
72
71
</el-col >
73
72
<el-col :span =" 1.5" >
74
73
<el-button
75
- type =" warning"
74
+ type =" success"
75
+ plain
76
76
@click =" handleExport"
77
77
:loading =" exportLoading"
78
78
v-hasPermi =" ['infra:config:export']"
79
79
>
80
80
<Icon icon =" ep:download" class =" mr-5px" /> 导出
81
81
</el-button >
82
+ <el-button text @click =" showSearch = !showSearch" >
83
+ <Icon :icon =" showSearch ? 'ep:arrow-up' : 'ep:arrow-down'" />
84
+ </el-button >
82
85
</el-col >
83
86
<!-- TODO 芋艿:右侧导航 -->
84
87
<right-toolbar v-model:showSearch =" showSearch" @queryTable =" getList" />
123
126
<el-button
124
127
link
125
128
type =" primary"
126
- @click =" handleDelete(scope.row)"
129
+ @click =" handleDelete(scope.row.id )"
127
130
v-hasPermi =" ['infra:config:delete']"
128
131
>
129
132
<Icon icon =" ep:delete" /> 删除
137
140
<config-form ref =" modalRef" @success =" getList" />
138
141
</template >
139
142
<script setup lang="ts" name="Config">
143
+ import { DICT_TYPE , getDictOptions } from ' @/utils/dict'
140
144
import * as ConfigApi from ' @/api/infra/config'
141
145
import ConfigForm from ' ./form.vue'
142
- import { DICT_TYPE , getDictOptions } from ' @/utils/dict'
143
- // import { Delete, Edit, Search, Download, Plus, Refresh } from '@element-plus/icons-vue'
144
146
import dayjs from ' dayjs'
147
+ const message = useMessage () // 消息弹窗
148
+ const { t } = useI18n () // 国际化
149
+
145
150
const showSearch = ref (true ) // 搜索框的是否展示
146
151
const loading = ref (true ) // 列表的加载中
147
152
const total = ref (0 ) // 列表的总页数
@@ -155,6 +160,7 @@ const queryParams = reactive({
155
160
createTime: []
156
161
})
157
162
const queryFormRef = ref () // 搜索的表单
163
+ const exportLoading = ref (false ) // 导出的加载中
158
164
159
165
/** 搜索按钮操作 */
160
166
const handleQuery = () => {
@@ -186,6 +192,19 @@ const openModal = (type: string, id?: number) => {
186
192
modalRef .value .openModal (type , id )
187
193
}
188
194
195
+ /** 删除按钮操作 */
196
+ const handleDelete = async (id : number ) => {
197
+ try {
198
+ // 二次确认
199
+ await message .delConfirm ()
200
+ // 发起删除
201
+ await ConfigApi .deleteConfig (id )
202
+ message .success (t (' common.delSuccess' ))
203
+ // 刷新列表
204
+ await getList ()
205
+ } catch {}
206
+ }
207
+
189
208
/** 初始化 **/
190
209
onMounted (() => {
191
210
getList ()
0 commit comments