修复:根据图片字段选择前台列表布局
This commit is contained in:
@@ -903,38 +903,18 @@ function solutionPreviewClasses(preset) {
|
||||
const solution = visualSolutionDefinition(preset)
|
||||
const navigation = solutionNavigation(solution.shell, 'frontend')
|
||||
const header = String(solution.shell.header || '')
|
||||
const listLayout = String(solution.layoutPolicy['frontend.list'] || '')
|
||||
const layoutClass = listLayout.includes('card')
|
||||
? 'preview-layout-card'
|
||||
: listLayout.includes('split')
|
||||
? 'preview-layout-split'
|
||||
: listLayout.includes('dense')
|
||||
? 'preview-layout-dense'
|
||||
: listLayout
|
||||
? 'preview-layout-table'
|
||||
: 'preview-layout-unconfigured'
|
||||
return [
|
||||
navigation ? `preview-navigation-${navigation}` : 'preview-navigation-unconfigured',
|
||||
header ? `preview-header-${header}` : 'preview-header-unconfigured',
|
||||
layoutClass
|
||||
'preview-layout-adaptive'
|
||||
]
|
||||
}
|
||||
|
||||
function solutionMetaLabels(preset) {
|
||||
const solution = visualSolutionDefinition(preset)
|
||||
const listLayout = String(solution.layoutPolicy['frontend.list'] || '')
|
||||
const frontendNavigation = navigationLabel(solutionNavigation(solution.shell, 'frontend'), '前台')
|
||||
const adminNavigation = navigationLabel(solutionNavigation(solution.shell, 'admin'), '后台')
|
||||
const layout = listLayout.includes('card')
|
||||
? '卡片列表'
|
||||
: listLayout.includes('split')
|
||||
? '分栏列表'
|
||||
: listLayout.includes('dense')
|
||||
? '高密度列表'
|
||||
: listLayout
|
||||
? '标准表格'
|
||||
: '布局未配置'
|
||||
return [`${frontendNavigation} / ${adminNavigation}`, layout]
|
||||
return [`${frontendNavigation} / ${adminNavigation}`, '列表按图片自适应']
|
||||
}
|
||||
|
||||
function solutionNavigation(shell, scope) {
|
||||
|
||||
@@ -411,6 +411,8 @@ test('generate page presents style presets as visual themes with previews', () =
|
||||
assert.match(source, /navigationLabel\(solutionNavigation\(solution\.shell, 'frontend'\), '前台'\)/)
|
||||
assert.match(source, /navigationLabel\(solutionNavigation\(solution\.shell, 'admin'\), '后台'\)/)
|
||||
assert.match(source, /scope === 'admin' \? 'adminNavigation' : 'frontendNavigation'/)
|
||||
assert.match(source, /列表按图片自适应/)
|
||||
assert.match(source, /'preview-layout-adaptive'/)
|
||||
})
|
||||
|
||||
test('generate page shows one managed-theme error and never falls back to local presets', () => {
|
||||
|
||||
Reference in New Issue
Block a user