mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 05:22:13 +08:00
fix(系统设置): 三方嵌入只保存不验证的情况会改变应用状态并关闭应用
This commit is contained in:
@@ -11,6 +11,8 @@ const dingtalkForm = ref<FormInstance>()
|
||||
interface DingtalkForm {
|
||||
id?: string
|
||||
domain?: string
|
||||
valid?: boolean
|
||||
enabled?: boolean
|
||||
}
|
||||
const state = reactive({
|
||||
form: reactive<DingtalkForm>({
|
||||
@@ -18,7 +20,7 @@ const state = reactive({
|
||||
domain: null
|
||||
})
|
||||
})
|
||||
const validateUrl = (rule, value, callback) => {
|
||||
const validateUrl = (_, value, callback) => {
|
||||
const reg = new RegExp(/(http|https):\/\/([\w.]+\/?)\S*/)
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error(t('system.incorrect_please_re_enter')))
|
||||
@@ -44,10 +46,12 @@ const rule = reactive<FormRules>({
|
||||
]
|
||||
})
|
||||
|
||||
const edit = row => {
|
||||
const edit = ({ id, domain, valid, enabled }) => {
|
||||
state.form = {
|
||||
id: row.id,
|
||||
domain: row.domain
|
||||
id,
|
||||
domain,
|
||||
valid,
|
||||
enabled
|
||||
}
|
||||
dialogVisible.value = true
|
||||
}
|
||||
@@ -117,7 +121,7 @@ const validateHandler = () => {
|
||||
ElMessage.success(t('datasource.validate_success'))
|
||||
})
|
||||
.catch(() => {
|
||||
state.form.enable = false
|
||||
state.form.enabled = false
|
||||
state.form.valid = false
|
||||
save()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user