From 6de8d274d3cf495a7d11ce67b8ebb0a11defe0a6 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 09 十月 2024 13:33:47 +0800 Subject: [PATCH] 更新至最新 chatComponents --- src/components/chat/chatComponents/summaryCom/components/recordSetTable/RecordSetTable.vue | 65 ++++++++++++++++++-------------- 1 files changed, 36 insertions(+), 29 deletions(-) diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSetTable/RecordSetTable.vue b/src/components/chat/chatComponents/summaryCom/components/recordSetTable/RecordSetTable.vue index 2cccabb..4dd1dd7 100644 --- a/src/components/chat/chatComponents/summaryCom/components/recordSetTable/RecordSetTable.vue +++ b/src/components/chat/chatComponents/summaryCom/components/recordSetTable/RecordSetTable.vue @@ -1,30 +1,45 @@ <!-- 鏌ヨ鏈�鏂拌鍛婁俊鎭� --> <template> <div> - <span v-if="data?.title" class="text-base font-bold flex-center mb-5">{{ data?.title }}</span> - <div class="w-full" style="height: 70vh" ref="containerRef" v-resize="resizeHandler"> + <!-- <span v-if="data?.title" class="text-base font-bold flex-center mb-5">{{ data?.title }}</span> --> + <div class="w-full" ref="containerRef" v-resize="resizeHandler"> <el-table ref="tableRef" + maxHeight="70vh" border :cell-style="tableCellStyle" :header-cell-style="tableHeaderCellStyle" :data="data?.values" :spanMethod="objectSpanMethod" - class="w-full h-full" cellClassName="text-sm" headerCellClassName="text-sm" > - <template v-if="data?.cols?.length > 0"> - <el-table-column - v-for="(item, index) in colList" - :label="item.title" - :width="item.width" - :sortable="item.type === 'time'" - :key="index" - :prop="index + ''" - show-overflow-tooltip - /> + <el-table-column v-if="data?.title" :label="data?.title" show-overflow-tooltip> + <template v-if="data?.cols?.length > 0"> + <el-table-column + v-for="(item, index) in colList" + :label="item.title" + :width="item.width" + :sortable="item.type === 'time'" + :key="index" + :prop="index + ''" + show-overflow-tooltip + /> + </template> + </el-table-column> + <template v-else> + <template v-if="data?.cols?.length > 0"> + <el-table-column + v-for="(item, index) in colList" + :label="item.title" + :width="item.width" + :sortable="item.type === 'time'" + :key="index" + :prop="index + ''" + show-overflow-tooltip + /> + </template> </template> </el-table> </div> @@ -47,7 +62,6 @@ const containerRef = ref<HTMLDivElement>(null); const tableRef = ref<TableInstance>(null); const measureWidthOffset = 28; - const groupColIndex = []; (props.data?.cols ?? []).map((item, index) => { if (item.group) { @@ -165,14 +179,10 @@ const resizeHandler = debounce(resizeEvent); //#region ====================== 鏍峰紡 ====================== const tableCellStyle = ({ row, rowIndex, column, columnIndex }): CSSProperties => { - const extraStyle = - columnIndex === 0 - ? { - borderLeft: `${THICK_BORDER_WIDTH}px solid ${BORDER_COLOR}`, - } - : {}; - if (columnIndex === 0) { - } + const extraStyle = { + ...(columnIndex === 0 ? { borderLeft: `${THICK_BORDER_WIDTH}px solid ${BORDER_COLOR}` } : {}), + }; + return { textAlign: 'center', borderColor: BORDER_COLOR, @@ -184,12 +194,10 @@ }; const tableHeaderCellStyle = ({ row, rowIndex, column, columnIndex }): CSSProperties => { - const extraStyle = - columnIndex === 0 - ? { - borderLeft: `${THICK_BORDER_WIDTH}px solid ${BORDER_COLOR}`, - } - : {}; + const extraStyle = { + ...(columnIndex === 0 ? { borderLeft: `${THICK_BORDER_WIDTH}px solid ${BORDER_COLOR}` } : {}), + ...(rowIndex === 0 ? { borderTop: `${THICK_BORDER_WIDTH}px solid ${BORDER_COLOR}`, backgroundColor: '#8db4e2',fontSize: '1rem'} : {}), + }; return { textAlign: 'center', @@ -211,7 +219,6 @@ }); </script> <style scoped lang="scss"> - // :deep(.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell){ // background-color: v-bind(stripedBgColor); // } -- Gitblit v1.9.3