diff --git a/src/api/system/sensitiveWord/index.ts b/src/api/system/sensitiveWord/index.ts index 08078ba6..1116226f 100644 --- a/src/api/system/sensitiveWord/index.ts +++ b/src/api/system/sensitiveWord/index.ts @@ -10,27 +10,13 @@ export interface SensitiveWordVO { createTime: Date } -export interface SensitiveWordPageReqVO extends PageParam { - name?: string - tag?: string - status?: number - createTime?: Date[] -} - -export interface SensitiveWordExportReqVO { - name?: string - tag?: string - status?: number - createTime?: Date[] -} - export interface SensitiveWordTestReqVO { text: string tag: string[] } // 查询敏感词列表 -export const getSensitiveWordPage = (params: SensitiveWordPageReqVO) => { +export const getSensitiveWordPage = (params: PageParam) => { return request.get({ url: '/system/sensitive-word/page', params }) } @@ -55,12 +41,12 @@ export const deleteSensitiveWord = (id: number) => { } // 导出敏感词 -export const exportSensitiveWord = (params: SensitiveWordExportReqVO) => { +export const exportSensitiveWord = (params) => { return request.download({ url: '/system/sensitive-word/export-excel', params }) } // 获取所有敏感词的标签数组 -export const getSensitiveWordTags = () => { +export const getSensitiveWordTagList = () => { return request.get({ url: '/system/sensitive-word/get-tags' }) } diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index 374893bb..4edfc6e7 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -54,11 +54,13 @@ declare module '@vue/runtime-core' { ElIcon: typeof import('element-plus/es')['ElIcon'] ElImageViewer: typeof import('element-plus/es')['ElImageViewer'] ElInput: typeof import('element-plus/es')['ElInput'] + ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElLink: typeof import('element-plus/es')['ElLink'] ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopover: typeof import('element-plus/es')['ElPopover'] ElRadio: typeof import('element-plus/es')['ElRadio'] + ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] @@ -72,6 +74,8 @@ declare module '@vue/runtime-core' { ElTag: typeof import('element-plus/es')['ElTag'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTransfer: typeof import('element-plus/es')['ElTransfer'] + ElTree: typeof import('element-plus/es')['ElTree'] + ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] ElUpload: typeof import('element-plus/es')['ElUpload'] Error: typeof import('./../components/Error/src/Error.vue')['default'] FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default'] diff --git a/src/views/system/oauth2/client/index.vue b/src/views/system/oauth2/client/index.vue index 9ff44692..c88af726 100644 --- a/src/views/system/oauth2/client/index.vue +++ b/src/views/system/oauth2/client/index.vue @@ -133,7 +133,6 @@ import type { FormExpose } from '@/components/Form' // 业务相关的 import import * as ClientApi from '@/api/system/oauth2/client' -import { rules, allSchemas } from './client.data' const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 diff --git a/src/views/system/oauth2/token/form.vue b/src/views/system/oauth2/token/form.vue deleted file mode 100644 index 5372ca7e..00000000 --- a/src/views/system/oauth2/token/form.vue +++ /dev/null @@ -1,131 +0,0 @@ - - diff --git a/src/views/system/sensitiveWord/form.vue b/src/views/system/sensitiveWord/SensitiveWordForm.vue similarity index 86% rename from src/views/system/sensitiveWord/form.vue rename to src/views/system/sensitiveWord/SensitiveWordForm.vue index ce5de578..c069756b 100644 --- a/src/views/system/sensitiveWord/form.vue +++ b/src/views/system/sensitiveWord/SensitiveWordForm.vue @@ -33,7 +33,7 @@ placeholder="请选择文章标签" style="width: 380px" > - + @@ -47,7 +47,6 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import * as SensitiveWordApi from '@/api/system/sensitiveWord' import { CommonStatusEnum } from '@/utils/constants' - const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -67,11 +66,10 @@ const formRules = reactive({ tags: [{ required: true, message: '标签不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref -const tags: Ref = ref([]) // todo @blue-syd:在 openModal 里加载下 +const tagList = ref([]) // 标签数组 /** 打开弹窗 */ -const openModal = async (type: string, paramTags: string[], id?: number) => { - tags.value = paramTags +const open = async (type: string, id?: number) => { modelVisible.value = true modelTitle.value = t('action.' + type) formType.value = type @@ -81,13 +79,14 @@ const openModal = async (type: string, paramTags: string[], id?: number) => { formLoading.value = true try { formData.value = await SensitiveWordApi.getSensitiveWord(id) - console.log(formData.value) } finally { formLoading.value = false } } + // 获得 Tag 标签列表 + tagList.value = await SensitiveWordApi.getSensitiveWordTagList() } -defineExpose({ openModal }) // 提供 openModal 方法,用于打开弹窗 +defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 @@ -101,10 +100,10 @@ const submitForm = async () => { try { const data = formData.value as unknown as SensitiveWordApi.SensitiveWordVO if (formType.value === 'create') { - await SensitiveWordApi.createSensitiveWord(data) // TODO @blue-syd:去掉 API 后缀 + await SensitiveWordApi.createSensitiveWord(data) message.success(t('common.createSuccess')) } else { - await SensitiveWordApi.updateSensitiveWord(data) // TODO @blue-syd:去掉 API 后缀 + await SensitiveWordApi.updateSensitiveWord(data) message.success(t('common.updateSuccess')) } modelVisible.value = false diff --git a/src/views/system/sensitiveWord/testForm.vue b/src/views/system/sensitiveWord/SensitiveWordTestForm.vue similarity index 82% rename from src/views/system/sensitiveWord/testForm.vue rename to src/views/system/sensitiveWord/SensitiveWordTestForm.vue index 766d771f..881309c8 100644 --- a/src/views/system/sensitiveWord/testForm.vue +++ b/src/views/system/sensitiveWord/SensitiveWordTestForm.vue @@ -1,6 +1,5 @@