feat(appointments): restore simplified four-type calendar
This commit is contained in:
@@ -180,31 +180,26 @@ describe('approved Admin density ownership', () => {
|
||||
expect(css).toContain('.admin-density-dialog.density-confirm-dialog.el-dialog .el-dialog__header { border-bottom: 0; }')
|
||||
expect(css).toContain('.admin-density-dialog.density-confirm-dialog.el-dialog .el-dialog__footer { border-top: 0;')
|
||||
})
|
||||
it('keeps appointment dialog content scrollable with fixed controls and unclipped calendar days', () => {
|
||||
const declarations = (file: string, selector: string) => {
|
||||
it('keeps the simplified calendar in two columns with bounded previews and scrollable daily details', () => {
|
||||
const view = parse(read('modules/appointment-calendar/AppointmentCalendarView.vue')).descriptor
|
||||
const panel = parse(read('modules/appointment-calendar/AppointmentCalendarPanel.vue')).descriptor
|
||||
expect(view.template!.content).toContain('<AppointmentCalendarPanel')
|
||||
expect(view.scriptSetup!.content).not.toMatch(/getWorkSummary|getWorkCalendar|getWorkItems/)
|
||||
const declarations = (selector: string) => {
|
||||
const values: Record<string, string> = {}
|
||||
const css = parse(read(`modules/appointment-calendar/${file}`)).descriptor.styles.map(style => style.content).join('\n')
|
||||
cssRoot(css).walkRules(selector, rule => { rule.walkDecls(decl => { values[decl.prop] = decl.value }) })
|
||||
cssRoot(panel.styles.map(style => style.content).join('\n')).walkRules(selector, rule => {
|
||||
if (rule.parent?.type !== 'root') return
|
||||
rule.walkDecls(decl => { values[decl.prop] = decl.value })
|
||||
})
|
||||
return values
|
||||
}
|
||||
const panel = declarations('AppointmentCalendarView.vue', '.work-panel')
|
||||
expect(panel.position).toBeUndefined()
|
||||
expect(panel['min-height']).toBe('0')
|
||||
expect(declarations('AppointmentCalendarView.vue', ':global(.work-dialog.el-dialog:not(.is-fullscreen))').height).toBe('88dvh')
|
||||
expect(declarations('AppointmentCalendarView.vue', ':global(.work-dialog .el-dialog__body)').overflow).toBe('hidden')
|
||||
expect(declarations('AppointmentCalendarView.vue', '.work-layout')['grid-template-columns']).toBeUndefined()
|
||||
expect(declarations('AppointmentCalendarView.vue', '.panel-body')).toMatchObject({ 'overflow-y': 'auto', 'min-height': '0' })
|
||||
expect(declarations('AppointmentCalendarView.vue', '.panel-header').flex).toBe('none')
|
||||
expect(declarations('AppointmentCalendarView.vue', '.panel-footer').flex).toBe('none')
|
||||
expect(declarations('AppointmentCalendarView.vue', '.work-row-action .el-button')).toMatchObject({ 'line-height': '20px', 'white-space': 'normal', height: 'auto' })
|
||||
expect(declarations('AppointmentCalendarView.vue', '.work-row-action :deep(.el-button > span)')).toMatchObject({ 'line-height': 'inherit', 'white-space': 'normal', 'overflow-wrap': 'anywhere', 'min-width': '0', 'max-width': '100%' })
|
||||
expect(declarations('WorkCalendarPanel.vue', '.calendar-toolbar')['justify-content']).toBe('flex-start')
|
||||
expect(declarations('AppointmentCalendarView.vue', '.work-inbox').border).toBeUndefined()
|
||||
const day = declarations('WorkCalendarPanel.vue', '.work-day')
|
||||
expect(day.height).toBe('146px')
|
||||
expect(day['min-height']).toBe(day.height)
|
||||
expect(day['max-height']).toBe(day.height)
|
||||
expect(day.overflow).not.toBe('hidden')
|
||||
expect(declarations('.appointment-calendar')['grid-template-columns']).toBe('minmax(0, 1fr) 360px')
|
||||
expect(declarations('.calendar-day').height).toBe('146px')
|
||||
expect(declarations('.week-grid .calendar-day').height).toBe('270px')
|
||||
expect(declarations('.detail-events')['overflow-y']).toBe('auto')
|
||||
expect(declarations('.detail-event dd')['overflow-wrap']).toBe('anywhere')
|
||||
expect(panel.template!.content).toContain('.slice(0, 3)')
|
||||
expect(panel.template!.content).not.toContain('新增预约')
|
||||
})
|
||||
it('shares list status and category tab styles across registered list consumers', () => {
|
||||
for (const file of [
|
||||
@@ -372,7 +367,7 @@ describe('approved Admin density ownership', () => {
|
||||
visit(node.children)
|
||||
} }
|
||||
visit(ast.children)
|
||||
expect(panes).toBe(file === 'LastMileOrderDetailView' ? 6 : 4)
|
||||
expect(panes).toBe(file === 'LastMileOrderDetailView' ? 7 : 4)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user