Skip to content

Commit d989fa2

Browse files
committed
重构:优化配置管理的列表展示
1 parent 922c4a1 commit d989fa2

File tree

1 file changed

+9
-40
lines changed

1 file changed

+9
-40
lines changed

src/views/infra/config/index.vue

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
<template>
22
<content-wrap>
33
<!-- 搜索工作栏 -->
4-
<el-form
5-
:model="queryParams"
6-
ref="queryFormRef"
7-
:inline="true"
8-
v-show="showSearch"
9-
label-width="68px"
10-
>
4+
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
115
<el-form-item label="参数名称" prop="name">
126
<el-input
137
v-model="queryParams.name"
148
placeholder="请输入参数名称"
159
clearable
16-
style="width: 240px"
1710
@keyup.enter="handleQuery"
1811
/>
1912
</el-form-item>
@@ -22,7 +15,6 @@
2215
v-model="queryParams.key"
2316
placeholder="请输入参数键名"
2417
clearable
25-
style="width: 240px"
2618
@keyup.enter="handleQuery"
2719
/>
2820
</el-form-item>
@@ -39,7 +31,6 @@
3931
<el-form-item label="创建时间" prop="createTime">
4032
<el-date-picker
4133
v-model="queryParams.createTime"
42-
style="width: 240px"
4334
value-format="YYYY-MM-DD HH:mm:ss"
4435
type="daterange"
4536
range-separator="-"
@@ -49,27 +40,11 @@
4940
/>
5041
</el-form-item>
5142
<el-form-item>
52-
<el-button type="primary" @click="handleQuery">
53-
<Icon icon="ep:search" class="mr-5px" /> 搜索
54-
</el-button>
43+
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
5544
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
56-
</el-form-item>
57-
</el-form>
58-
59-
<!-- 操作栏 -->
60-
<!-- TODO 间隔貌似有点问题 没发现 -->
61-
<el-row :gutter="10" class="mb8">
62-
<el-col :span="1.5">
63-
<el-button
64-
type="primary"
65-
plain
66-
@click="openModal('create')"
67-
v-hasPermi="['infra:config:create']"
68-
>
45+
<el-button type="primary" @click="openModal('create')" v-hasPermi="['infra:config:create']">
6946
<Icon icon="ep:plus" class="mr-5px" /> 新增
7047
</el-button>
71-
</el-col>
72-
<el-col :span="1.5">
7348
<el-button
7449
type="success"
7550
plain
@@ -79,13 +54,8 @@
7954
>
8055
<Icon icon="ep:download" class="mr-5px" /> 导出
8156
</el-button>
82-
<el-button text @click="showSearch = !showSearch">
83-
<Icon :icon="showSearch ? 'ep:arrow-up' : 'ep:arrow-down'" />
84-
</el-button>
85-
</el-col>
86-
<!-- TODO 芋艿:右侧导航 -->
87-
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
88-
</el-row>
57+
</el-form-item>
58+
</el-form>
8959

9060
<!-- 列表 -->
9161
<el-table v-loading="loading" :data="list" align="center">
@@ -112,23 +82,23 @@
11282
width="180"
11383
:formatter="dateFormatter"
11484
/>
115-
<el-table-column label="操作" align="center" width="140">
85+
<el-table-column label="操作" align="center">
11686
<template #default="scope">
11787
<el-button
11888
link
11989
type="primary"
12090
@click="openModal('update', scope.row.id)"
12191
v-hasPermi="['infra:config:update']"
12292
>
123-
<Icon icon="ep:edit" /> 修改
93+
编辑
12494
</el-button>
12595
<el-button
12696
link
127-
type="primary"
97+
type="danger"
12898
@click="handleDelete(scope.row.id)"
12999
v-hasPermi="['infra:config:delete']"
130100
>
131-
<Icon icon="ep:delete" /> 删除
101+
删除
132102
</el-button>
133103
</template>
134104
</el-table-column>
@@ -147,7 +117,6 @@ import ConfigForm from './form.vue'
147117
const message = useMessage() // 消息弹窗
148118
const { t } = useI18n() // 国际化
149119
150-
const showSearch = ref(true) // 搜索框的是否展示
151120
const loading = ref(true) // 列表的加载中
152121
const total = ref(0) // 列表的总页数
153122
const list = ref([]) // 列表的数据

0 commit comments

Comments
 (0)