diff --git a/web-vue/packages/core/components/Upload/src/FileList.vue b/web-vue/packages/core/components/Upload/src/FileList.vue index 6ee240a..d3369dd 100644 --- a/web-vue/packages/core/components/Upload/src/FileList.vue +++ b/web-vue/packages/core/components/Upload/src/FileList.vue @@ -21,76 +21,82 @@ const { columns, actionColumn, dataSource } = props; const columnList = [...columns, actionColumn]; return ( - - - {columnList.map((item) => { - const { width = 0, dataIndex } = item; - const style: CSSProperties = { - width: `${width}px`, - minWidth: `${width}px`, - }; - return ; - })} - - - +
+
+ {columnList.map((item) => { - const { title = '', align = 'center', dataIndex } = item; + const { width = 0, dataIndex } = item; + const style: CSSProperties = { + width: `${width}px`, + minWidth: `${width}px`, + }; + return ; + })} + + + + {columnList.map((item) => { + const { title = '', align = 'center', dataIndex } = item; + return ( + dataIndex && ( + + ) + ); + })} + + + + {dataSource.map((record = {}, index) => { return ( - dataIndex && ( - - ) + + {columnList.map((item) => { + const { dataIndex = '', customRender, align = 'center' } = item; + const render = customRender && isFunction(customRender); + return ( + dataIndex && ( + + ) + ); + })} + ); })} - - - - {dataSource.map((record = {}, index) => { - return ( - - {columnList.map((item) => { - const { dataIndex = '', customRender, align = 'center' } = item; - const render = customRender && isFunction(customRender); - return ( - dataIndex && ( - - ) - ); - })} + {dataSource.length == 0 && ( + + - ); - })} - {dataSource.length == 0 && ( - - - - )} - -
+ {title} +
- {title} -
+ {render + ? customRender?.({ text: get(record, dataIndex), record, index }) + : get(record, dataIndex)} +
- {render - ? customRender?.({ text: get(record, dataIndex), record, index }) - : get(record, dataIndex)} -
+ {props.emptyText} +
- {props.emptyText} -
+ )} + + + ); }; }, });