fix 系统参数使用到MySQL8保留字

This commit is contained in:
DaxPay
2024-10-28 11:47:34 +08:00
parent 85d1692f53
commit 56f4a0ef63
3 changed files with 15 additions and 8 deletions

View File

@@ -83,7 +83,7 @@ export interface SystemParam extends BaseEntity {
// 参数名称
name?: string
// 参数键名
key?: string
paramKey?: string
// 参数值
value?: string
// 参数类型

View File

@@ -29,7 +29,7 @@
</a-form-item>
<a-form-item label="参数Key" name="key">
<a-input
v-model:value="form.key"
v-model:value="form.paramKey"
:disabled="showable || form.internal"
placeholder="请输入参数键名"
/>
@@ -112,14 +112,14 @@
formEditType,
} = useFormEdit()
const { existsByServer } = useValidate()
const { dictDropDownNumber } = useDict()
const { dictDropDown } = useDict()
// 表单
const formRef = ref<FormInstance>()
let form = ref<SystemParam>({
id: null,
name: '',
key: '',
paramKey: '',
value: '',
enable: true,
type: undefined,
@@ -145,7 +145,7 @@
initFormEditType(editType)
resetForm()
getInfo(id, editType)
dictDropDownNumber('ParamType').then((res) => (paramTypeList.value = res))
dictDropDown('ParamType').then((res) => (paramTypeList.value = res))
}
// 获取信息
function getInfo(id, editType: FormEditType) {
@@ -181,8 +181,15 @@
}
// 校验key值
async function validateKey() {
const { key, id } = form.value
return existsByServer(key, id, formEditType.value, existsByKey, existsByKeyNotId, '该Key已存在')
const { paramKey, id } = form.value
return existsByServer(
paramKey,
id,
formEditType.value,
existsByKey,
existsByKeyNotId,
'该Key已存在',
)
}
defineExpose({
init,

View File

@@ -28,7 +28,7 @@
>
<vxe-column type="seq" :min-width="60" />
<vxe-column field="name" title="参数名称" :min-width="200" />
<vxe-column field="key" title="参数Key" :min-width="150" />
<vxe-column field="paramKey" title="参数Key" :min-width="150" />
<vxe-column field="value" title="参数值" :min-width="200" />
<vxe-column field="type" title="参数类型" :min-width="80">
<template #default="{ row }">