40
40
:default-time =" [new Date('1 00:00:00'), new Date('1 23:59:59')]"
41
41
/>
42
42
</el-form-item >
43
-
44
43
<el-form-item >
45
44
<el-button @click =" handleQuery" ><Icon icon =" ep:search" class =" mr-5px" /> 搜索</el-button >
46
45
<el-button @click =" resetQuery" ><Icon icon =" ep:refresh" class =" mr-5px" /> 重置</el-button >
82
81
:key =" index"
83
82
v-for =" (tag, index) in scope.row.tags"
84
83
:index =" index"
84
+ class =" mr-5px"
85
85
>
86
86
{{ tag }}
87
87
</el-tag >
88
+   ;   ;
88
89
</template >
89
90
</el-table-column >
90
91
<el-table-column
@@ -132,14 +133,13 @@ import { DICT_TYPE, getDictOptions } from '@/utils/dict'
132
133
import { dateFormatter } from ' @/utils/formatTime'
133
134
import download from ' @/utils/download'
134
135
import * as SensitiveWordApi from ' @/api/system/sensitiveWord'
135
- import ConfigForm from ' ./form.vue'
136
+ import ConfigForm from ' ./form.vue' // TODO @blue-syd:组件名不对
136
137
const message = useMessage () // 消息弹窗
137
138
const { t } = useI18n () // 国际化
138
139
139
140
const loading = ref (true ) // 列表的加载中
140
141
const total = ref (0 ) // 列表的总页数
141
142
const list = ref ([]) // 列表的数据
142
- const tags = ref ([])
143
143
const queryParams = reactive ({
144
144
pageNo: 1 ,
145
145
pageSize: 10 ,
@@ -150,25 +150,20 @@ const queryParams = reactive({
150
150
})
151
151
const queryFormRef = ref () // 搜索的表单
152
152
const exportLoading = ref (false ) // 导出的加载中
153
+ const tags = ref ([])
153
154
154
155
/** 查询参数列表 */
155
156
const getList = async () => {
156
157
loading .value = true
157
158
try {
158
- const data = await SensitiveWordApi .getSensitiveWordPageApi (queryParams )
159
+ const data = await SensitiveWordApi .getSensitiveWordPageApi (queryParams ) // TODO @blue-syd:去掉 API 后缀哈
159
160
list .value = data .list
160
161
total .value = data .total
161
162
} finally {
162
163
loading .value = false
163
164
}
164
165
}
165
166
166
- /** 初始化标签select*/
167
- const getTags = async () => {
168
- const data = await SensitiveWordApi .getSensitiveWordTagsApi ()
169
- tags .value = data
170
- }
171
-
172
167
/** 搜索按钮操作 */
173
168
const handleQuery = () => {
174
169
queryParams .pageNo = 1
@@ -187,6 +182,8 @@ const openModal = (type: string, id?: number) => {
187
182
modalRef .value .openModal (type , id )
188
183
}
189
184
185
+ // TODO @blue-syd:还少一个【测试】按钮的功能,参见 http://dashboard.yudao.iocoder.cn/system/sensitive-word
186
+
190
187
/** 删除按钮操作 */
191
188
const handleDelete = async (id : number ) => {
192
189
try {
@@ -207,14 +204,19 @@ const handleExport = async () => {
207
204
await message .exportConfirm ()
208
205
// 发起导出
209
206
exportLoading .value = true
210
- const data = await SensitiveWordApi .exportSensitiveWordApi (queryParams )
207
+ const data = await SensitiveWordApi .exportSensitiveWordApi (queryParams ) // TODO @blue-syd:去掉 API 后缀哈
211
208
download .excel (data , ' 敏感词.xls' )
212
209
} catch {
213
210
} finally {
214
211
exportLoading .value = false
215
212
}
216
213
}
217
214
215
+ /** 获得 Tag 标签列表 */
216
+ const getTags = async () => {
217
+ tags .value = await SensitiveWordApi .getSensitiveWordTagsApi () // TODO @blue-syd:去掉 API 后缀哈
218
+ }
219
+
218
220
/** 初始化 **/
219
221
onMounted (() => {
220
222
getTags ()
0 commit comments