优化
This commit is contained in:
@@ -73,6 +73,15 @@ enableAutoUnmount(afterEach)
|
||||
afterAll(() => vi.unstubAllGlobals())
|
||||
|
||||
describe('ExpressCompaniesView query and table migration', () => {
|
||||
it('renders edit and status as colored outlined buttons with prototype icons', () => {
|
||||
expect(expressCompaniesSource).toContain('size="small"\n plain\n type="primary"')
|
||||
expect(expressCompaniesSource).toContain('size="small"\n plain\n :disabled="loading"\n :type=')
|
||||
expect(expressCompaniesSource).toContain('<Pencil :size="15" />编辑')
|
||||
expect(expressCompaniesSource).toContain('<Power :size="15" />')
|
||||
expect(expressCompaniesSource).not.toContain("access.can('platform:express:edit')\"\n link")
|
||||
expect(expressCompaniesSource).not.toContain("access.can('platform:express:status')\"\n link")
|
||||
})
|
||||
|
||||
it('keeps operation first and exposes the prototype business columns separately', () => {
|
||||
const actionsIndex = expressCompaniesSource.indexOf("{ key: 'actions', label: '操作'")
|
||||
const nameIndex = expressCompaniesSource.indexOf("{ key: 'company', label: '公司名称'")
|
||||
|
||||
@@ -314,7 +314,8 @@ onMounted(() => {
|
||||
<div v-if="access.can('platform:express:edit') || access.can('platform:express:status')" class="table-actions">
|
||||
<el-button
|
||||
v-if="access.can('platform:express:edit')"
|
||||
link
|
||||
size="small"
|
||||
plain
|
||||
type="primary"
|
||||
:disabled="loading"
|
||||
:loading="editLoadingIds.has(String((row as PlatformExpressCompanyResource).id))"
|
||||
@@ -322,7 +323,8 @@ onMounted(() => {
|
||||
><Pencil :size="15" />编辑</el-button>
|
||||
<el-button
|
||||
v-if="access.can('platform:express:status')"
|
||||
link
|
||||
size="small"
|
||||
plain
|
||||
:disabled="loading"
|
||||
:type="(row as PlatformExpressCompanyResource).status === 'ACTIVE' ? 'danger' : 'success'"
|
||||
:loading="statusLoadingIds.has(String((row as PlatformExpressCompanyResource).id))"
|
||||
|
||||
Reference in New Issue
Block a user