feat: sync page state and global state saving behavior (#1540)

This commit is contained in:
chilingling 2025-07-24 14:22:08 +08:00 committed by GitHub
parent c157e9f19c
commit 021d3c4d35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 3 deletions

View File

@ -230,7 +230,7 @@ export default {
if (activeName.value === STATE.CURRENT_STATE) {
//
variableRef.value.validateForm().then(() => {
variableRef.value.validateForm().then(async () => {
//
const variable = variableRef.value.getFormData()
@ -243,7 +243,17 @@ export default {
updateSchema({ state: { ...(schema.state || {}), [name]: variable } })
useHistory().addHistory()
openCommon()
const isFixed = props.fixedPanels.includes(PLUGIN_NAME.State)
//
if (!isFixed) {
useLayout().changeLeftFixedPanels(PLUGIN_NAME.State)
}
await openCommon()
//
if (!isFixed) {
useLayout().changeLeftFixedPanels(PLUGIN_NAME.State)
}
})
} else {
storeRef.value.validateForm().then(() => {
@ -276,6 +286,7 @@ export default {
updateGlobalState(id, { global_state: storeList }).then((res) => {
isPanelShow.value = false
useResource().appSchemaState.globalState = res.global_state || []
useNotify({ message: '保存成功!', type: 'success' })
})
openCommon()
})

View File

@ -173,7 +173,7 @@ export const openCommon = async () => {
}
*/
saveCommon(state.code).finally(() => {
return saveCommon(state.code).finally(() => {
state.disabled = false
if (typeof saved === 'function') {