refactor: 优化代码

This commit is contained in:
wxg0103 2024-10-16 18:56:54 +08:00
parent 5a9c92b915
commit 735b7c7a22

View File

@ -5,7 +5,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
> >
<el-form label-position="top" ref="limitFormRef" :model="form"> <el-form label-position="top" ref="limitFormRef" :model="form" :rules="rules">
<!-- <el-form-item <!-- <el-form-item
:label="$t('views.applicationOverview.appInfo.LimitDialog.showSourceLabel')" :label="$t('views.applicationOverview.appInfo.LimitDialog.showSourceLabel')"
@click.prevent @click.prevent
@ -35,6 +35,7 @@
<el-switch size="small" v-model="form.authentication"></el-switch> <el-switch size="small" v-model="form.authentication"></el-switch>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
prop="authentication_value"
v-if="form.authentication" v-if="form.authentication"
:label="$t('views.applicationOverview.appInfo.LimitDialog.authenticationValue')" :label="$t('views.applicationOverview.appInfo.LimitDialog.authenticationValue')"
v-hasPermission="new ComplexPermission([], ['x-pack'], 'OR')" v-hasPermission="new ComplexPermission([], ['x-pack'], 'OR')"
@ -103,6 +104,15 @@ const form = ref<any>({
authentication_value: '', authentication_value: '',
authentication: false authentication: false
}) })
const rules: FormRules = {
authentication_value: [
{
required: true,
message: '身份验证值不能为空',
trigger: 'blur'
}
]
}
const dialogVisible = ref<boolean>(false) const dialogVisible = ref<boolean>(false)
const loading = ref(false) const loading = ref(false)