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
@@ -40,8 +40,9 @@ describe('permission editor modal', () => {
expect(dialog.style.getPropertyValue('--el-dialog-width')).toBe('min(720px, calc(100vw - 28px))')
expect(document.querySelector('.el-drawer')).toBeNull()
expect(dialog.querySelectorAll('.el-form-item')).toHaveLength(6)
const codeInput = dialog.querySelector<HTMLInputElement>('input[placeholder="如:platform:customer:list"]')!
expect(codeInput.disabled).toBe(mode === 'edit')
const codeInput = dialog.querySelector<HTMLInputElement>('input[placeholder="如:platform:customer:list"]')
if (mode === 'edit') { expect(codeInput).toBeNull(); expect(dialog.textContent).toContain('platform:sample:list') }
else expect(codeInput?.disabled).toBe(false)
// Vitest externalizes Element Plus: its CJS validator interop differs from the Vite browser bundle.
// Exercise the dialog's validation gate explicitly, without changing production rules.
const form = wrapper.findComponent({ name: 'ElForm' })
@@ -64,6 +65,7 @@ describe('permission editor modal', () => {
if (mode === 'create') expect(createPlatformPermission).toHaveBeenCalledWith({ type: 'MENU', code: 'platform:new:list', name: '新增菜单', parentId: '0', routePath: '/new', httpMethod: null, sortNo: 10 })
else expect(updatePlatformPermission).toHaveBeenCalledWith('90071992547409931', { name: '测试菜单', parentId: null, routePath: '/sample', httpMethod: null, sortNo: 10 })
expect(wrapper.getComponent(AppDialog).props('modelValue')).toBe(true)
expect(codeInput.value).toBe(mode === 'create' ? 'platform:new:list' : 'platform:sample:list')
if (mode === 'create') expect(codeInput?.value).toBe('platform:new:list')
else expect(dialog.textContent).toContain('platform:sample:list')
})
})