zhou zhou
2 天以前 7c2bffa1a495cc4a3a263f654c08c231009c5c4e
rsf-design/src/views/system/role/index.vue
@@ -17,7 +17,7 @@
      >
        <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.role.buttons.add') }}</ElButton>
            <ElButton
              v-auth="'delete'"
              type="danger"
@@ -25,7 +25,7 @@
              @click="handleBatchDelete"
              v-ripple
            >
              批量删除
              {{ t('common.actions.batchDelete') }}
            </ElButton>
            <span v-auth="'query'" class="inline-flex">
              <ListExportPrint
@@ -76,6 +76,7 @@
<script setup>
  import { useUserStore } from '@/store/modules/user'
  import { useI18n } from 'vue-i18n'
  import {
    fetchExportRoleReport,
    fetchDeleteRole,
@@ -102,21 +103,22 @@
    buildRoleSavePayload,
    buildRoleSearchParams,
    createRoleSearchState,
    getRoleReportTitle,
    getRolePaginationKey,
    normalizeRoleListRow,
    ROLE_REPORT_STYLE,
    ROLE_REPORT_TITLE,
    resolveRoleReportColumns
  } from './rolePage.helpers'
  defineOptions({ name: 'Role' })
  const { t } = useI18n()
  const searchForm = ref(createRoleSearchState())
  const showSearchBar = ref(false)
  const permissionDialogVisible = ref(false)
  const permissionScopeType = ref('menu')
  const userStore = useUserStore()
  const reportTitle = ROLE_REPORT_TITLE
  const reportTitle = computed(() => getRoleReportTitle())
  const reportQueryParams = computed(() => buildRoleSearchParams(searchForm.value))
  const roleActionHandlers = {
    'scope-menu': (row) => openScopeDialog('menu', row),
@@ -186,7 +188,7 @@
    saveRequest: fetchSaveRole,
    updateRequest: fetchUpdateRole,
    deleteRequest: fetchDeleteRole,
    entityName: '角色',
    entityName: t('pages.system.role.entity'),
    resolveRecordLabel: (record) => record?.name || record?.code || record?.id,
    refreshCreate,
    refreshUpdate,
@@ -196,7 +198,7 @@
  const buildPreviewDialogMeta = (rows) => {
    const now = new Date()
    return {
      reportTitle,
      reportTitle: reportTitle.value,
      reportDate: now.toLocaleDateString('zh-CN'),
      printedAt: now.toLocaleString('zh-CN', { hour12: false }),
      operator: userStore.getUserInfo?.name || userStore.getUserInfo?.username || '',