{{ t('routine.config.Test mail sending') }}
@@ -184,10 +203,20 @@ const onSubmit = (formEl: InstanceType | undefined) => {
if (!formEl) return
formEl.validate((valid) => {
if (valid) {
- postData('edit', state.form).then(() => {
+ // 只提交当前tab的表单数据
+ const formData: anyObj = {}
+ for (const key in state.config) {
+ if (key != state.activeTab) {
+ continue
+ }
+ for (const lKey in state.config[key].list) {
+ formData[state.config[key].list[lKey].name] = state.form[state.config[key].list[lKey].name] ?? ''
+ }
+ }
+ postData('edit', formData).then(() => {
for (const key in siteConfig.$state) {
- if (siteConfig.$state[key as keyof SiteConfig] != state.form[key]) {
- siteConfig.$state[key as keyof SiteConfig] = state.form[key]
+ if (formData[key] && siteConfig.$state[key as keyof SiteConfig] != formData[key]) {
+ siteConfig.$state[key as keyof SiteConfig] = formData[key]
}
}
})