优化
This commit is contained in:
@@ -26,10 +26,11 @@ describe('PDA release workbench', () => {
|
||||
})
|
||||
|
||||
it('uses the standard dense list workspace without repeating the route title', () => {
|
||||
expect(page).toContain('class="surface-panel table-panel pda-release-panel"')
|
||||
expect(page).toContain('appearance="integrated" :stripe="false"')
|
||||
expect(page).toContain('<template #toolbar-start>')
|
||||
expect(page).toContain('<template #toolbar-actions>')
|
||||
expect(page).toContain('class="pda-release-actions density-actions"')
|
||||
expect(page).not.toContain('<h1>PDA版本</h1>')
|
||||
expect(page).toContain('class="pda-release-actions density-actions row-actions admin-text-actions"')
|
||||
expect(page).toContain('<h1>PDA版本</h1>')
|
||||
expect(pdaReleaseRoutes[0]?.meta?.showPageHeading).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import '@/styles/adminDensity.css'
|
||||
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Download, Plus, RefreshCw } from '@lucide/vue'
|
||||
import { Plus, RefreshCw } from '@lucide/vue'
|
||||
import AdminPage from '@/shared/components/AdminPage.vue'
|
||||
import AppDialog from '@/shared/components/AppDialog.vue'
|
||||
import DataTable, { type DataTableColumn } from '@/shared/components/DataTable.vue'
|
||||
@@ -121,11 +121,10 @@ function download(row: PdaRelease) {
|
||||
<template>
|
||||
<AdminPage class="admin-density pda-releases-page">
|
||||
<ListPageLayout aria-label="PDA版本">
|
||||
<section class="surface-panel table-panel pda-release-panel" :aria-busy="loading">
|
||||
<el-alert v-if="error" class="pda-release-error" type="error" :title="error" show-icon :closable="false" />
|
||||
<DataTable :data="rows" :columns="columns" :loading="loading" row-key="id" border stripe empty-text="暂无版本记录">
|
||||
<template #toolbar-start>
|
||||
<div class="pda-release-context">
|
||||
<DataTable appearance="integrated" :stripe="false" column-settings-mode="show" preference-key="pda-releases-table" :data="rows" :columns="columns" :loading="loading" :aria-busy="loading" row-key="id" border empty-text="暂无版本记录">
|
||||
<template #toolbar-start><h1>PDA版本</h1></template>
|
||||
<template #filters>
|
||||
<div class="pda-release-context query-toolbar">
|
||||
<el-radio-group v-model="app" size="small" aria-label="选择PDA应用">
|
||||
<el-radio-button value="domestic">国内 PDA</el-radio-button>
|
||||
<el-radio-button value="overseas">海外 PDA</el-radio-button>
|
||||
@@ -136,13 +135,16 @@ function download(row: PdaRelease) {
|
||||
</dl>
|
||||
</div>
|
||||
</template>
|
||||
<template #notices><el-alert v-if="error" class="pda-release-error" type="error" :title="error" show-icon :closable="false" /></template>
|
||||
|
||||
|
||||
<template #toolbar-actions>
|
||||
<el-button :loading="loading" @click="load"><RefreshCw :size="16" />刷新</el-button>
|
||||
<el-button v-if="canManage" type="primary" @click="openUpload"><Plus :size="16" />上传版本</el-button>
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<div class="pda-release-actions density-actions">
|
||||
<el-button v-if="row.packageType === 'apk' && row.downloadUrl" class="density-action" data-tone="neutral" @click="download(asRelease(row))"><Download :size="15" />下载 APK</el-button>
|
||||
<div class="pda-release-actions density-actions row-actions admin-text-actions">
|
||||
<el-button v-if="row.packageType === 'apk' && row.downloadUrl" class="density-action" data-tone="neutral" @click="download(asRelease(row))">下载 APK</el-button>
|
||||
<el-button v-if="canManage && row.status === 'DRAFT'" class="density-action" data-tone="primary" :loading="actionId === row.id" @click="changeStatus(asRelease(row), 'publish')">发布</el-button>
|
||||
<el-button v-if="canManage && row.current" class="density-action" data-tone="danger" :loading="actionId === row.id" @click="changeStatus(asRelease(row), 'withdraw')">停发</el-button>
|
||||
</div>
|
||||
@@ -155,7 +157,6 @@ function download(row: PdaRelease) {
|
||||
<template #createdAt="{ row }">{{ row.createdAt?.replace('T', ' ').slice(0, 19) || '—' }}</template>
|
||||
<template #publishedAt="{ row }">{{ row.publishedAt?.replace('T', ' ').slice(0, 19) || '—' }}</template>
|
||||
</DataTable>
|
||||
</section>
|
||||
</ListPageLayout>
|
||||
|
||||
<AppDialog v-model="uploadOpen" class="admin-density-dialog" title="上传PDA版本" width="min(640px, calc(100vw - 28px))" confirm-text="保存草稿" :confirm-loading="uploading" @confirm="upload">
|
||||
|
||||
@@ -5,6 +5,6 @@ export const pdaReleaseRoutes = [
|
||||
path: 'system/pda-releases',
|
||||
name: 'pda-releases',
|
||||
component: () => import('@/modules/pda-releases/pages/PdaReleasesView.vue'),
|
||||
meta: { title: 'PDA版本', description: '国内与海外PDA安装包下载和热更新发布', permission: 'platform:pda-release:list' },
|
||||
meta: { showPageHeading: false, title: 'PDA版本', description: '国内与海外PDA安装包下载和热更新发布', permission: 'platform:pda-release:list' },
|
||||
},
|
||||
] satisfies RouteRecordRaw[]
|
||||
|
||||
Reference in New Issue
Block a user