zhou zhou
22 小时以前 50e95b985a72fcec4a93a2470e9efdfb2620148a
rsf-design/src/views/system/dict-type/index.vue
@@ -12,7 +12,7 @@
      <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.dictType.buttons.add') }}</ElButton>
            <ElButton
              v-auth="'delete'"
              type="danger"
@@ -20,7 +20,7 @@
              @click="handleBatchDelete"
              v-ripple
            >
              批量删除
              {{ t('common.actions.batchDelete') }}
            </ElButton>
          </ElSpace>
        </template>
@@ -52,6 +52,7 @@
</template>
<script setup>
  import { useI18n } from 'vue-i18n'
  import { ElMessage } from 'element-plus'
  import { useAuth } from '@/hooks/core/useAuth'
  import { useTable } from '@/hooks/core/useTable'
@@ -78,6 +79,7 @@
  defineOptions({ name: 'DictType' })
  const { t } = useI18n()
  const { hasAuth } = useAuth()
  const searchForm = ref(createDictTypeSearchState())
  const detailDrawerVisible = ref(false)
@@ -87,41 +89,41 @@
  const searchItems = computed(() => [
    {
      label: '关键字',
      label: t('table.keyword'),
      key: 'condition',
      type: 'input',
      props: {
        clearable: true,
        placeholder: '请输入编码或名称'
        placeholder: t('pages.system.dictType.search.conditionPlaceholder')
      }
    },
    {
      label: '编码',
      label: t('table.code'),
      key: 'code',
      type: 'input',
      props: {
        clearable: true,
        placeholder: '请输入字典编码'
        placeholder: t('pages.system.dictType.search.codePlaceholder')
      }
    },
    {
      label: '名称',
      label: t('table.name'),
      key: 'name',
      type: 'input',
      props: {
        clearable: true,
        placeholder: '请输入字典名称'
        placeholder: t('pages.system.dictType.search.namePlaceholder')
      }
    },
    {
      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 }
        ]
      }
    }
@@ -131,11 +133,11 @@
    detailDrawerVisible.value = true
    detailLoading.value = true
    try {
      detailData.value = normalizeDictTypeListRow(await fetchGetDictTypeDetail(row.id))
      detailData.value = normalizeDictTypeListRow(await fetchGetDictTypeDetail(row.id), t)
    } catch (error) {
      detailDrawerVisible.value = false
      detailData.value = {}
      ElMessage.error(error?.message || '获取数据字典详情失败')
      ElMessage.error(error?.message || t('pages.system.dictType.messages.detailFailed'))
    } finally {
      detailLoading.value = false
    }
@@ -147,7 +149,7 @@
      dialogVisible.value = true
      dialogType.value = 'edit'
    } catch (error) {
      ElMessage.error(error?.message || '获取数据字典详情失败')
      ElMessage.error(error?.message || t('pages.system.dictType.messages.detailFailed'))
    }
  }
@@ -175,7 +177,8 @@
        createDictTypeTableColumns({
          handleView: openDetail,
          handleEdit: openEditDialog,
          handleDelete: hasAuth('delete') ? (row) => handleDeleteAction?.(row) : null
          handleDelete: hasAuth('delete') ? (row) => handleDeleteAction?.(row) : null,
          t
        })
    },
    transform: {
@@ -183,7 +186,7 @@
        if (!Array.isArray(records)) {
          return []
        }
        return records.map((item) => normalizeDictTypeListRow(item))
        return records.map((item) => normalizeDictTypeListRow(item, t))
      }
    }
  })
@@ -205,7 +208,7 @@
    saveRequest: fetchSaveDictType,
    updateRequest: fetchUpdateDictType,
    deleteRequest: fetchDeleteDictType,
    entityName: '数据字典',
    entityName: t('pages.system.dictType.entity'),
    resolveRecordLabel: (record) => record?.name || record?.code || record?.id,
    refreshCreate,
    refreshUpdate,