style(admin): unify dialog layouts and dense readonly presentation

This commit is contained in:
2026-10-20 10:11:31 +08:00
parent 7ff7c9914f
commit 3267679758
214 changed files with 10931 additions and 2654 deletions
@@ -188,7 +188,7 @@ describe('CustomersView', () => {
it('matches the frozen prototype containers for customer operations', () => {
expect(customersSource).toContain("router.push({ name: 'customer-detail'")
expect(customersSource).toContain("const editorDialogWidth = 'min(1120px, calc(100vw - 28px))'")
expect(customersSource.match(/class="form-grid three-cols"/g)).toHaveLength(2)
expect(customersSource.match(/class="density-table density-table--editable customer-editor-table"/g)).toHaveLength(2)
expect(customersSource).toContain('width="min(520px, calc(100vw - 28px))" class="admin-density-dialog customer-density-dialog customer-password-dialog"')
expect(customersSource).toContain('width="min(1040px, calc(100vw - 28px))" class="admin-density-dialog customer-density-dialog review-decision-dialog"')
expect(customersSource).not.toContain('<AppDrawer v-model="editorOpen"')
@@ -218,6 +218,18 @@ describe('CustomersView', () => {
const email = document.querySelector<HTMLInputElement>('input[placeholder="如:contact@example.com"]')
expect(phone?.value).toBe(fullTenant.contactPhone)
expect(email?.value).toBe(fullTenant.contactEmail)
expect(document.querySelector('.customer-editor-dialog .el-dialog__title')?.textContent).toBe('编辑客户 · TEN8')
expect(document.querySelector('input[placeholder="请输入18位大写字母或数字"]')).toBeNull()
expect(document.querySelector('.qualification-credit-code')?.textContent).toContain(fullTenant.unifiedSocialCreditCode)
phone!.value = '13900139000'
phone!.dispatchEvent(new Event('input', { bubbles: true }))
document.querySelector<HTMLButtonElement>('.customer-editor-dialog button[aria-label="展开全屏"]')!.click()
await flushPromises()
expect(document.querySelector('.customer-editor-dialog.is-fullscreen')).not.toBeNull()
expect(document.querySelector<HTMLInputElement>('input[placeholder="请输入公司联系电话"]')?.value).toBe('13900139000')
document.querySelector<HTMLButtonElement>('.customer-editor-dialog button[aria-label="退出全屏"]')!.click()
await flushPromises()
expect(document.querySelector<HTMLInputElement>('input[placeholder="请输入公司联系电话"]')?.value).toBe('13900139000')
})
it('shows an authenticated image preview for an uploaded qualification', async () => {
@@ -607,7 +619,7 @@ describe('CustomersView', () => {
temporaryPassword: 'Temporary#2026',
})
mount(CustomersView, { attachTo: document.body, global: { plugins: [pinia, ElementPlus] } })
const wrapper = mount(CustomersView, { attachTo: document.body, global: { plugins: [pinia, ElementPlus] } })
await flushPromises()
tableButtonByText('审核')?.click()
await flushPromises()
@@ -620,6 +632,13 @@ describe('CustomersView', () => {
expect(document.body.textContent).toContain('请立即保存以下一次性凭证')
expect(document.body.textContent).toContain('merchant_8_owner')
expect(document.body.textContent).toContain('Temporary#2026')
const credentials = wrapper.findAllComponents(AppDialog).find(dialog => dialog.props('title').startsWith('审核通过,管理员账号已创建'))!
expect(credentials.props()).toMatchObject({ modelValue: true, showClose: false, closeOnPressEscape: false, closeOnClickModal: false })
expect(document.querySelector('.approval-result-dialog .el-dialog__headerbtn')).toBeNull()
document.querySelector<HTMLButtonElement>('.approval-result-dialog .el-dialog__footer button')!.click()
await flushPromises()
expect(credentials.props('modelValue')).toBe(false)
expect(document.querySelector('.approval-result-dialog code')).toBeNull()
})
it('loads and previews authenticated qualification files in the review dialog', async () => {