zhou zhou
15 小时以前 50e95b985a72fcec4a93a2470e9efdfb2620148a
rsf-design/src/views/system/config/index.vue
@@ -12,7 +12,9 @@
      <ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData">
        <template #left>
          <ElSpace wrap>
            <ElButton v-auth="'add'" @click="showDialog('add')" v-ripple>新增配置</ElButton>
            <ElButton v-auth="'add'" @click="showDialog('add')" v-ripple>
              {{ t('pages.system.config.buttons.add') }}
            </ElButton>
            <ElButton
              v-auth="'delete'"
              type="danger"
@@ -20,7 +22,7 @@
              @click="handleBatchDelete"
              v-ripple
            >
              批量删除
              {{ t('common.actions.batchDelete') }}
            </ElButton>
          </ElSpace>
        </template>
@@ -53,6 +55,7 @@
<script setup>
  import { ElMessage } from 'element-plus'
  import { useI18n } from 'vue-i18n'
  import { useAuth } from '@/hooks/core/useAuth'
  import { useTable } from '@/hooks/core/useTable'
  import { useCrudPage } from '@/views/system/common/useCrudPage'
@@ -79,6 +82,7 @@
  defineOptions({ name: 'Config' })
  const { t } = useI18n()
  const { hasAuth } = useAuth()
  const searchForm = ref(createConfigSearchState())
  const detailDrawerVisible = ref(false)
@@ -88,41 +92,42 @@
  const searchItems = computed(() => [
    {
      label: '关键字',
      label: t('table.keyword'),
      key: 'condition',
      type: 'input',
      props: {
        clearable: true,
        placeholder: '请输入配置名称'
        placeholder: t('pages.system.config.search.conditionPlaceholder')
      }
    },
    {
      label: '标识',
      label: t('pages.system.config.table.flag'),
      key: 'flag',
      type: 'input',
      props: {
        clearable: true,
        placeholder: '请输入配置标识'
        placeholder: t('pages.system.config.search.flagPlaceholder')
      }
    },
    {
      label: '类型',
      label: t('pages.system.config.table.type'),
      key: 'type',
      type: 'select',
      props: {
        clearable: true,
        options: getConfigTypeOptions()
        placeholder: t('pages.system.config.placeholders.type'),
        options: getConfigTypeOptions(t)
      }
    },
    {
      label: '状态',
      label: t('table.status'),
      key: 'status',
      type: 'select',
      props: {
        clearable: true,
        options: [
          { label: '正常', value: 1 },
          { label: '冻结', value: 0 }
          { label: t('common.status.normal'), value: 1 },
          { label: t('common.status.frozen'), value: 0 }
        ]
      }
    }
@@ -136,7 +141,7 @@
    } catch (error) {
      detailDrawerVisible.value = false
      detailData.value = {}
      ElMessage.error(error?.message || '获取配置详情失败')
      ElMessage.error(error?.message || t('pages.system.config.messages.detailFailed'))
    } finally {
      detailLoading.value = false
    }
@@ -148,7 +153,7 @@
      dialogVisible.value = true
      dialogType.value = 'edit'
    } catch (error) {
      ElMessage.error(error?.message || '获取配置详情失败')
      ElMessage.error(error?.message || t('pages.system.config.messages.detailFailed'))
    }
  }
@@ -174,6 +179,7 @@
      paginationKey: getConfigPaginationKey(),
      columnsFactory: () =>
        createConfigTableColumns({
          t,
          handleView: openDetail,
          handleEdit: openEditDialog,
          handleDelete: hasAuth('delete') ? (row) => handleDeleteAction?.(row) : null
@@ -206,7 +212,7 @@
    saveRequest: fetchSaveConfig,
    updateRequest: fetchUpdateConfig,
    deleteRequest: fetchDeleteConfig,
    entityName: '配置',
    entityName: t('pages.system.config.entity'),
    resolveRecordLabel: (record) => record?.name || record?.flag || record?.id,
    refreshCreate,
    refreshUpdate,