🐛 修复 file 在 IDEA 报错的问题

This commit is contained in:
YunaiV 2023-12-03 10:34:08 +08:00
parent aecc9bb8cb
commit 85fe4ad8d6
3 changed files with 8 additions and 6 deletions

View File

@ -17,7 +17,7 @@ export interface FileClientConfig {
export interface FileConfigVO { export interface FileConfigVO {
id: number id: number
name: string name: string
storage: any storage?: number
master: boolean master: boolean
visible: boolean visible: boolean
config: FileClientConfig config: FileClientConfig

View File

@ -110,6 +110,7 @@ const queryParams = reactive({
pageSize: 10, pageSize: 10,
name: undefined, name: undefined,
type: undefined, type: undefined,
path: undefined,
createTime: [] createTime: []
}) })
const queryFormRef = ref() // const queryFormRef = ref() //

View File

@ -101,6 +101,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { DICT_TYPE, getDictOptions } from '@/utils/dict' import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import * as FileConfigApi from '@/api/infra/fileConfig' import * as FileConfigApi from '@/api/infra/fileConfig'
import { FormRules } from 'element-plus'
defineOptions({ name: 'InfraFileConfigForm' }) defineOptions({ name: 'InfraFileConfigForm' })
@ -116,9 +117,9 @@ const formData = ref({
name: '', name: '',
storage: 0, storage: 0,
remark: '', remark: '',
config: {} config: {} as FileConfigApi.FileClientConfig
}) })
const formRules = reactive({ const formRules = reactive<FormRules>({
name: [{ required: true, message: '配置名不能为空', trigger: 'blur' }], name: [{ required: true, message: '配置名不能为空', trigger: 'blur' }],
storage: [{ required: true, message: '存储器不能为空', trigger: 'change' }], storage: [{ required: true, message: '存储器不能为空', trigger: 'change' }],
config: { config: {
@ -133,7 +134,7 @@ const formRules = reactive({
accessKey: [{ required: true, message: 'accessKey 不能为空', trigger: 'blur' }], accessKey: [{ required: true, message: 'accessKey 不能为空', trigger: 'blur' }],
accessSecret: [{ required: true, message: 'accessSecret 不能为空', trigger: 'blur' }], accessSecret: [{ required: true, message: 'accessSecret 不能为空', trigger: 'blur' }],
domain: [{ required: true, message: '自定义域名不能为空', trigger: 'blur' }] domain: [{ required: true, message: '自定义域名不能为空', trigger: 'blur' }]
} } as FormRules
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
@ -186,9 +187,9 @@ const resetForm = () => {
formData.value = { formData.value = {
id: undefined, id: undefined,
name: '', name: '',
storage: 0, storage: undefined!,
remark: '', remark: '',
config: {} config: {} as FileConfigApi.FileClientConfig
} }
formRef.value?.resetFields() formRef.value?.resetFields()
} }