zhou zhou
1 天以前 5454bbe86b1a22e9f05b6bc43f7ed7e9d6c4dc14
rsf-design/src/views/system/config/index.vue
@@ -77,7 +77,9 @@
    createConfigSearchState,
    getConfigPaginationKey,
    getConfigTypeOptions,
    normalizeConfigListRow
    normalizeConfigListRow,
    PROJECT_COPYRIGHT_FLAG,
    PROJECT_LOGO_FLAG
  } from './configPage.helpers'
  defineOptions({ name: 'Config' })
@@ -202,7 +204,7 @@
    selectedRows,
    handleSelectionChange,
    showDialog,
    handleDialogSubmit,
    closeDialog,
    handleDelete,
    handleBatchDelete
  } = useCrudPage({
@@ -220,6 +222,46 @@
  })
  handleDeleteAction = handleDelete
  function notifyProjectLogoUpdated(payload) {
    if (payload?.flag !== PROJECT_LOGO_FLAG) {
      return
    }
    window.dispatchEvent(new CustomEvent('project-logo-updated', { detail: { url: payload.val } }))
  }
  function notifyProjectCopyrightUpdated(payload) {
    if (payload?.flag !== PROJECT_COPYRIGHT_FLAG) {
      return
    }
    window.dispatchEvent(
      new CustomEvent('project-copyright-updated', { detail: { text: payload.val } })
    )
  }
  async function handleDialogSubmit(formData) {
    const payload = buildConfigSavePayload(formData)
    try {
      if (dialogType.value === 'edit') {
        await fetchUpdateConfig(payload)
        ElMessage.success(t('crud.messages.updateSuccess'))
        closeDialog()
        notifyProjectLogoUpdated(payload)
        notifyProjectCopyrightUpdated(payload)
        await refreshUpdate?.()
        return
      }
      await fetchSaveConfig(payload)
      ElMessage.success(t('crud.messages.createSuccess'))
      closeDialog()
      notifyProjectLogoUpdated(payload)
      notifyProjectCopyrightUpdated(payload)
      await refreshCreate?.()
    } catch (error) {
      ElMessage.error(error?.message || t('crud.messages.submitFailed'))
    }
  }
  function handleSearch(params) {
    replaceSearchParams(buildConfigSearchParams(params))
    getData()