|
@ -31,8 +31,28 @@ class MarkupTableUtil { |
|
|
props['bordered'] = !Tools.isUndefinedOrNull(props['bordered']) ? props['bordered'] : true; |
|
|
props['bordered'] = !Tools.isUndefinedOrNull(props['bordered']) ? props['bordered'] : true; |
|
|
props['square'] = !Tools.isUndefinedOrNull(props['square']) ? props['square'] : false; |
|
|
props['square'] = !Tools.isUndefinedOrNull(props['square']) ? props['square'] : false; |
|
|
|
|
|
|
|
|
|
|
|
let tableContainerStyle = ''; |
|
|
|
|
|
if (!Tools.isUndefinedOrNull(props['width'])) { |
|
|
|
|
|
tableContainerStyle += 'width:' + props['width'] + ';'; |
|
|
|
|
|
} |
|
|
|
|
|
if (!Tools.isUndefinedOrNull(props['height'])) { |
|
|
|
|
|
tableContainerStyle += 'height:' + props['height'] + ';'; |
|
|
|
|
|
} |
|
|
|
|
|
if (!Tools.isUndefinedOrNull(props['maxWidth'])) { |
|
|
|
|
|
tableContainerStyle += 'max-width:' + props['maxWidth'] + ';'; |
|
|
|
|
|
} |
|
|
|
|
|
if (!Tools.isUndefinedOrNull(props['maxHeight'])) { |
|
|
|
|
|
tableContainerStyle += 'max-height:' + props['maxHeight'] + ';'; |
|
|
|
|
|
} |
|
|
|
|
|
if (!Tools.isUndefinedOrNull(props['max-width'])) { |
|
|
|
|
|
tableContainerStyle += 'max-width:' + props['max-width'] + ';'; |
|
|
|
|
|
} |
|
|
|
|
|
if (!Tools.isUndefinedOrNull(props['max-height'])) { |
|
|
|
|
|
tableContainerStyle += 'max-height:' + props['max-height'] + ';'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
let html = ''; |
|
|
let html = ''; |
|
|
html += '<div class="' + MarkupTableUtil.getClassNames(props) + '">'; |
|
|
html += '<div class="' + MarkupTableUtil.getClassNames(props) + '" style="' + tableContainerStyle + '">'; |
|
|
html += '<table class="q-table">'; |
|
|
html += '<table class="q-table">'; |
|
|
if (tableHeader) { |
|
|
if (tableHeader) { |
|
|
html += '<thead>' + tableHeader + '</thead>'; |
|
|
html += '<thead>' + tableHeader + '</thead>'; |
|
@ -47,7 +67,8 @@ class MarkupTableUtil { |
|
|
|
|
|
|
|
|
private static getClassNames(props: any) { |
|
|
private static getClassNames(props: any) { |
|
|
// 基础 CSS
|
|
|
// 基础 CSS
|
|
|
let css = 'q-markup-table q-table__container q-table__card'; |
|
|
// overflow-auto' style='max-height:100px'
|
|
|
|
|
|
let css = 'q-markup-table q-table__container q-table__card overflow-auto'; |
|
|
|
|
|
|
|
|
// 分割模式 (horizontal:行分割,vertical:列分割,cell:单元格分割,none:不分割)
|
|
|
// 分割模式 (horizontal:行分割,vertical:列分割,cell:单元格分割,none:不分割)
|
|
|
if (props['separator'] === 'vertical') { |
|
|
if (props['separator'] === 'vertical') { |
|
|