fix: 回调配置, 调整信用位置, 套餐
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m55s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m55s
This commit is contained in:
@@ -40,10 +40,10 @@
|
||||
<ElDialog
|
||||
v-model="dialogVisible"
|
||||
title="编辑系统配置"
|
||||
width="560px"
|
||||
width="30%"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<ElForm label-width="120px">
|
||||
<ElForm label-width="80px">
|
||||
<ElFormItem label="配置说明">
|
||||
<span>{{ currentConfig?.description || '-' }}</span>
|
||||
</ElFormItem>
|
||||
@@ -90,7 +90,14 @@
|
||||
|
||||
<template #footer>
|
||||
<ElButton @click="dialogVisible = false">取消</ElButton>
|
||||
<ElButton type="primary" :loading="submitLoading" @click="handleSubmit"> 保存 </ElButton>
|
||||
<ElButton
|
||||
type="primary"
|
||||
:loading="submitLoading"
|
||||
:disabled="submitLoading"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
保存
|
||||
</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
</div>
|
||||
@@ -111,6 +118,7 @@
|
||||
type SystemConfigModule
|
||||
} from '@/types/api/systemConfig'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { normalizeApiError } from '@/utils/business/apiError'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { JULY_PERMISSIONS } from '@/config/constants'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
@@ -258,7 +266,8 @@
|
||||
const validateValue = (value: string) => {
|
||||
const config = currentConfig.value
|
||||
if (!config) return '配置不存在'
|
||||
if (config.enum_values.length > 0 && !config.enum_values.includes(value)) {
|
||||
const enumValues = config.enum_values ?? []
|
||||
if (enumValues.length > 0 && !enumValues.includes(value)) {
|
||||
return '配置值不在允许的枚举范围内'
|
||||
}
|
||||
if (config.value_type === 'int') {
|
||||
@@ -324,7 +333,14 @@
|
||||
}
|
||||
|
||||
const handleSubmit = async () => {
|
||||
if (!currentConfig.value || currentConfig.value.readonly) return
|
||||
if (!currentConfig.value) {
|
||||
ElMessage.error('未选择要编辑的系统配置')
|
||||
return
|
||||
}
|
||||
if (currentConfig.value.readonly) {
|
||||
ElMessage.warning('当前配置为只读配置,不能保存')
|
||||
return
|
||||
}
|
||||
const value = getSubmittedValue()
|
||||
if (currentConfig.value.sensitive && value === originalValue.value) {
|
||||
ElMessage.warning('敏感配置未输入新值,无需保存')
|
||||
@@ -351,6 +367,7 @@
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('更新系统配置失败:', error)
|
||||
ElMessage.error(normalizeApiError(error).message)
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user