fast-element-plus 2.0.20 → 2.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/components/table/src/table.mjs +20 -20
- package/dist/components/table/src/table.mjs.map +1 -1
- package/dist/components/table/src/tableColumn.mjs +34 -28
- package/dist/components/table/src/tableColumn.mjs.map +1 -1
- package/dist/components/table/utils/table.mjs +2 -2
- package/dist/components/table/utils/table.mjs.map +1 -1
- package/dist/index.global.min.js +4 -4
- package/dist/index.global.min.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableColumn.mjs","names":[],"sources":["../../../../src/components/table/src/tableColumn.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, h, inject, resolveComponent } from \"vue\";\nimport { CopyDocument } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImage, ElMessage, ElTableColumn, ElTag, ElText, dayjs, useGlobalSize } from \"element-plus\";\nimport { tableColumnProps } from \"../../../internal/props\";\nimport { copy as copyToClipboard, definePropType, formatChineseRelativeTime, makeSlots, useProps, useRender } from \"../../../utils\";\nimport FaImage from \"../../image\";\nimport artwork from \"../images/artwork.png\";\nimport notImage from \"../images/notImage.png\";\nimport { tableUtil } from \"../utils/table\";\nimport { getTableDefaultSlots } from \"./table.type\";\nimport { enumMapKey, tableStateKey } from \"./useTable\";\nimport type { TableColumnCtx } from \"element-plus\";\nimport type { VNode } from \"vue\";\nimport type { DefaultRow } from \"./table.state\";\nimport type {\n\tFaTableColumnCtx,\n\tFaTableColumnDateFormat,\n\tFaTableColumnType,\n\tFaTableDefaultSlotsResult,\n\tFaTableEnumColumnCtx,\n\tFaTableEnumColumnType,\n} from \"./table.type\";\n\nexport { tableColumnProps } from \"../../../internal/props\";\n\n/** FaTableColumn 插槽返回的行列上下文。 */\nexport interface FaTableColumnSlotsResult {\n\t/** slots为表格内容的时候才会返回 */\n\trow?: DefaultRow;\n\t/** slot为表头内容的时候返回 'TableColumnCtx<DefaultRow>' 否则返回 'FaTableColumnCtx' */\n\tcolumn?: TableColumnCtx<DefaultRow> | FaTableColumnCtx;\n\t$index?: number;\n}\n\ntype FaTableColumnDefaultSlots = Record<string, FaTableDefaultSlotsResult & FaTableColumnSlotsResult>;\n\n/** FaTableColumn 的固定插槽和动态命名插槽。 */\nexport type FaTableColumnSlots = Record<string, unknown> & {\n\t/** 默认内容插槽 */\n\tdefault: FaTableDefaultSlotsResult & { row: DefaultRow; column: FaTableColumnCtx; $index: number };\n\t/** 自定义表头的内容 */\n\theader: FaTableDefaultSlotsResult & { column: FaTableColumnCtx; $index: number };\n\t/** 自定义 filter 图标 */\n\tfilterIcon: FaTableDefaultSlotsResult & { filterOpened: boolean };\n\t/** 展开列的自定义内容 */\n\texpand: FaTableDefaultSlotsResult & { expanded: boolean };\n} & FaTableColumnDefaultSlots;\n\nexport default defineComponent({\n\tname: \"FaTableColumn\",\n\tprops: {\n\t\t...tableColumnProps,\n\t\t/**\n\t\t * type of the column. If set to `selection`, the column will display checkbox. If set to `index`, the column will display index of the row (staring from 1). If set to `expand`, the column will display expand icon\n\t\t */\n\t\ttype: {\n\t\t\ttype: definePropType<FaTableColumnType>(String),\n\t\t\tdefault: \"default\",\n\t\t},\n\t\t/**\n\t\t * column width\n\t\t */\n\t\twidth: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: \"auto\",\n\t\t},\n\t\t/** alignment, the value should be 'left' \\/ 'center' \\/ 'right' */\n\t\talign: {\n\t\t\ttype: String,\n\t\t\tdefault: \"left\",\n\t\t},\n\t\t/** alignment of the table header. If omitted, the value of the above `align` attribute will be applied, the value should be 'left' \\/ 'center' \\/ 'right' */\n\t\theaderAlign: {\n\t\t\ttype: String,\n\t\t\tdefault: \"left\",\n\t\t},\n\t\t/** 是否显示在表格当中 */\n\t\tshow: Boolean,\n\t\t/** 小页面的宽度,如果为空,则继承默认宽度 */\n\t\tsmallWidth: {\n\t\t\ttype: [String, Number],\n\t\t},\n\t\t/** 自适应宽度 */\n\t\tautoWidth: Boolean,\n\t\t/** 插槽名称 */\n\t\tslot: String,\n\t\t/** 表格头部插槽名称 */\n\t\theaderSlot: String,\n\t\t/** 自定义表头内容渲染(tsx语法) */\n\t\theaderRender: {\n\t\t\ttype: definePropType<({ column, $index }: { column: TableColumnCtx<DefaultRow>; $index: number } & FaTableDefaultSlotsResult) => VNode[]>(\n\t\t\t\tFunction\n\t\t\t),\n\t\t},\n\t\t/** 自定义单元格内容渲染(tsx语法) */\n\t\trender: {\n\t\t\ttype: definePropType<\n\t\t\t\t({ row, column, $index }: { row: DefaultRow; column: FaTableColumnCtx; $index: number } & FaTableDefaultSlotsResult) => VNode[]\n\t\t\t>(Function),\n\t\t},\n\t\t/** 多级表头 */\n\t\t_children: {\n\t\t\ttype: definePropType<FaTableColumnCtx[]>(Array),\n\t\t},\n\t\t/** 隐藏图片 */\n\t\thideImage: Boolean,\n\t\t/** 复制 */\n\t\tcopy: Boolean,\n\t\t/** 是否为 Link Button */\n\t\tlink: Boolean,\n\t\t/** 合并行字段 */\n\t\tspanProp: String,\n\t\t/** Link 按钮的点击事件,优先级最高 */\n\t\tclick: {\n\t\t\ttype: definePropType<({ row, $index }: { row: DefaultRow; $index?: number } & FaTableDefaultSlotsResult) => void>(Function),\n\t\t},\n\t\t/** 点击Emits事件回调 */\n\t\tclickEmit: String,\n\t\t/** 图片列是否显示为原图,默认 false 显示缩略图 */\n\t\toriginalImage: Boolean,\n\t\t/** 显示时间格式化字符串 */\n\t\tdateFix: Boolean,\n\t\t/** 显示在页面中的日期格式 */\n\t\tdateFormat: {\n\t\t\ttype: definePropType<FaTableColumnDateFormat>(String),\n\t\t},\n\t\t/** 是否是标签展示 */\n\t\ttag: Boolean,\n\t\t/** 枚举类型(渲染值的字典) */\n\t\tenum: {\n\t\t\ttype: definePropType<FaTableEnumColumnType>([String, Array, Function]),\n\t\t},\n\t\t/** 数据删除字段,如果为 true 会显示遮罩层 */\n\t\tdataDeleteField: String,\n\t\t/** 时间信息字段 */\n\t\ttimeInfoField: {\n\t\t\ttype: definePropType<{ userName?: string; time?: string }>(Object),\n\t\t\tdefault: () => ({\n\t\t\t\tuserName: \"createdUserName\",\n\t\t\t\ttime: \"createdTime\",\n\t\t\t}),\n\t\t},\n\t},\n\temits: {\n\t\t/** 图片预览 */\n\t\timagePreview: (url: string) => typeof url === \"string\",\n\t\t/** 自定义单元格点击事件 */\n\t\tcustomCellClick: (emitName: string, { row, column, $index }: { row: DefaultRow; column: FaTableColumnCtx; $index: number }) =>\n\t\t\t(emitName == null || typeof emitName === \"string\") &&\n\t\t\ttypeof row === \"object\" &&\n\t\t\trow !== null &&\n\t\t\ttypeof column === \"object\" &&\n\t\t\tcolumn !== null &&\n\t\t\ttypeof $index === \"number\",\n\t},\n\tslots: makeSlots<FaTableColumnSlots>(),\n\tsetup(props, { slots, emit }) {\n\t\tconst globalSize = useGlobalSize();\n\t\tconst tableState = inject(tableStateKey);\n\t\tconst enumMap = inject(enumMapKey);\n\t\tif (tableState === undefined || enumMap === undefined) {\n\t\t\tthrow new Error(\"FaTableColumn 必须在 FaTable 内部渲染。\");\n\t\t}\n\n\t\tconst columnCtx = computed(() => props as FaTableColumnCtx);\n\n\t\t/** 获取ClassName */\n\t\tconst getClassName = () => {\n\t\t\tlet className = \"\";\n\t\t\tif (props.type === \"timeInfo\") {\n\t\t\t\tclassName += \"fa-table__line-height-normal-column\";\n\t\t\t}\n\t\t\tif (props.type === \"date\" || props.type === \"time\" || props.type === \"dateTime\") {\n\t\t\t\tif (props.dateFix) {\n\t\t\t\t\tclassName += \"fa-table__line-height-normal-column\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (props.className) {\n\t\t\t\treturn `${className} ${props.className}`;\n\t\t\t}\n\t\t\treturn className;\n\t\t};\n\n\t\t/** 获取宽度 */\n\t\tconst getWidth = (defAttr: string) => {\n\t\t\tif (props.autoWidth) {\n\t\t\t\tconst autoWidthEntry = tableState.autoColumnWidth.find((f) => f.prop === props.prop);\n\t\t\t\treturn autoWidthEntry ? `${autoWidthEntry.width}px` : \"auto\";\n\t\t\t}\n\t\t\tif (globalSize.value === \"small\") {\n\t\t\t\treturn props.smallWidth || props.width || props.minWidth || defAttr;\n\t\t\t}\n\t\t\treturn props.width || props.minWidth || defAttr;\n\t\t};\n\n\t\t/** 表头自动宽度渲染 */\n\t\tconst autoWidthHeaderRender = (el: VNode[]) => {\n\t\t\tif (props.autoWidth) {\n\t\t\t\treturn [\n\t\t\t\t\t<div class={[\"fa-table__auto-width-column__cell-header\", `__fa-table__auto-width-column__cell-header__${props.prop}`]}>{el}</div>,\n\t\t\t\t];\n\t\t\t} else {\n\t\t\t\treturn el;\n\t\t\t}\n\t\t};\n\n\t\t/** 自动宽度渲染 */\n\t\tconst autoWidthRender = (el: VNode[]) => {\n\t\t\tif (props.autoWidth) {\n\t\t\t\treturn [<div class={[\"fa-table__auto-width-column__cell\", `__fa-table__auto-width-column__cell__${props.prop}`]}>{el}</div>];\n\t\t\t} else {\n\t\t\t\treturn el;\n\t\t\t}\n\t\t};\n\n\t\t/** 表头渲染 */\n\t\tconst headerRender = ({ column, $index }: { column: TableColumnCtx<DefaultRow>; $index: number }) => {\n\t\t\tif (props.headerRender) {\n\t\t\t\treturn autoWidthHeaderRender(props.headerRender({ column, $index, ...getTableDefaultSlots(tableState) }));\n\t\t\t} else if (props.headerSlot) {\n\t\t\t\treturn autoWidthHeaderRender(slots[props.headerSlot]?.({ column, $index, ...getTableDefaultSlots(tableState) }) ?? []);\n\t\t\t} else {\n\t\t\t\treturn autoWidthHeaderRender([<span>{props.label}</span>]);\n\t\t\t}\n\t\t};\n\n\t\t/** 复制渲染 */\n\t\tconst displayText = (value: unknown) => {\n\t\t\tif (typeof value === \"string\") return value;\n\t\t\tif (typeof value === \"number\" || typeof value === \"bigint\" || typeof value === \"boolean\") return String(value);\n\t\t\treturn \"\";\n\t\t};\n\n\t\tconst copyRender = (value: unknown, copy?: boolean) => {\n\t\t\tif (!(props.copy || copy) || !value) return [];\n\n\t\t\treturn [\n\t\t\t\t<ElIcon\n\t\t\t\t\tclass=\"fa__copy-icon\"\n\t\t\t\t\ttitle=\"复制\"\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tcopyToClipboard(displayText(value)).then(\n\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\tElMessage({\n\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\tmessage: \"复制成功\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\tElMessage({\n\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\tmessage: \"复制失败\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<CopyDocument />\n\t\t\t\t</ElIcon>,\n\t\t\t];\n\t\t};\n\n\t\t/** 渲染单元格数据 */\n\t\tconst renderCellData = ({ row }: { row: DefaultRow }) => {\n\t\t\tconst cellValue: unknown = tableUtil.handleRowAccordingToProp(row, props.prop ?? \"\");\n\n\t\t\tlet enumData: FaTableEnumColumnCtx[] | undefined;\n\n\t\t\tif (typeof props.enum === \"string\") {\n\t\t\t\tenumData = enumMap.get(props.enum);\n\t\t\t} else if (Array.isArray(props.enum)) {\n\t\t\t\tenumData = props.enum;\n\t\t\t} else if (typeof props.enum === \"function\") {\n\t\t\t\tenumData = props.enum({ row });\n\t\t\t}\n\n\t\t\tif (enumData) {\n\t\t\t\treturn tableUtil.filterEnum(cellValue, enumData);\n\t\t\t} else {\n\t\t\t\treturn tableUtil.formatValue(cellValue);\n\t\t\t}\n\t\t};\n\n\t\t/** 格式化渲染 */\n\t\tconst formatterRender = (row: DefaultRow, column: TableColumnCtx<DefaultRow>, cellValue: unknown, index: number) => {\n\t\t\tconst formatter = column.formatter as TableColumnCtx<DefaultRow>[\"formatter\"] | null | undefined;\n\t\t\tif (formatter) {\n\t\t\t\treturn formatter(row, column, cellValue, index);\n\t\t\t} else {\n\t\t\t\treturn displayText(cellValue);\n\t\t\t}\n\t\t};\n\n\t\t/** 时间信息列渲染 */\n\t\tconst timeInfoRender = (row: DefaultRow, _column: TableColumnCtx<DefaultRow>, _$index: number) => {\n\t\t\tconst userName = displayText(row[props.timeInfoField.userName ?? \"createdUserName\"]);\n\t\t\tconst time = displayText(row[props.timeInfoField.time ?? \"createdTime\"]);\n\t\t\treturn [\n\t\t\t\t<Fragment>\n\t\t\t\t\t<div style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\" title={time}>\n\t\t\t\t\t\t{userName && <span style=\"margin-right: 5px;\">{userName}</span>}\n\t\t\t\t\t\t<span>{time}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t{time && (\n\t\t\t\t\t\t<ElTag type=\"info\" round effect=\"light\" size=\"small\">\n\t\t\t\t\t\t\t{formatChineseRelativeTime(time)}\n\t\t\t\t\t\t</ElTag>\n\t\t\t\t\t)}\n\t\t\t\t</Fragment>,\n\t\t\t];\n\t\t};\n\n\t\t/** 标签列渲染 */\n\t\tconst tagRender = (row: DefaultRow, column: TableColumnCtx<DefaultRow>, $index: number) => {\n\t\t\tconst renderValue = formatterRender(row, column, renderCellData({ row }), $index);\n\n\t\t\tlet enumData: FaTableEnumColumnCtx[] | undefined;\n\n\t\t\tif (typeof props.enum === \"string\") {\n\t\t\t\tenumData = enumMap.get(props.enum);\n\t\t\t} else if (Array.isArray(props.enum)) {\n\t\t\t\tenumData = props.enum;\n\t\t\t} else if (typeof props.enum === \"function\") {\n\t\t\t\tenumData = props.enum({ row });\n\t\t\t}\n\n\t\t\tconst enumValue: unknown = tableUtil.handleRowAccordingToProp(row, props.prop ?? \"\");\n\t\t\tconst type = enumData?.find((item) => item.value === enumValue)?.type ?? \"info\";\n\t\t\treturn [\n\t\t\t\t<Fragment>\n\t\t\t\t\t{copyRender(renderValue)}\n\t\t\t\t\t{renderValue ? <ElTag type={type}>{renderValue}</ElTag> : null}\n\t\t\t\t</Fragment>,\n\t\t\t];\n\t\t};\n\n\t\t/** 时间列渲染 */\n\t\tconst dateRender = (row: DefaultRow, column: TableColumnCtx<DefaultRow>, $index: number) => {\n\t\t\tlet dateFormat;\n\t\t\tswitch (props.type) {\n\t\t\t\tcase \"date\":\n\t\t\t\t\tdateFormat = \"YYYY-MM-DD\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"time\":\n\t\t\t\t\tdateFormat = \"HH:mm:ss\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"dateTime\":\n\t\t\t\t\tdateFormat = \"YYYY-MM-DD HH:mm:ss\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"default\":\n\t\t\t\tcase \"index\":\n\t\t\t\tcase \"selection\":\n\t\t\t\tcase \"expand\":\n\t\t\t\tcase \"image\":\n\t\t\t\tcase \"d2\":\n\t\t\t\tcase \"d4\":\n\t\t\t\tcase \"d6\":\n\t\t\t\tcase \"gd2\":\n\t\t\t\tcase \"gd4\":\n\t\t\t\tcase \"gd6\":\n\t\t\t\tcase \"timeInfo\":\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst rawValue: unknown = row[props.prop ?? \"\"];\n\t\t\tconst renderValue = rawValue\n\t\t\t\t? formatterRender(row, column, dayjs(rawValue as Parameters<typeof dayjs>[0]).format(props.dateFormat ?? dateFormat), $index)\n\t\t\t\t: null;\n\t\t\treturn [\n\t\t\t\t<Fragment>\n\t\t\t\t\t{copyRender(renderValue)}\n\t\t\t\t\t{renderValue}\n\t\t\t\t\t{props.dateFix && renderValue && (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t<ElTag type=\"info\" round effect=\"light\" size=\"small\">\n\t\t\t\t\t\t\t\t{formatChineseRelativeTime(displayText(renderValue))}\n\t\t\t\t\t\t\t</ElTag>\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t)}\n\t\t\t\t</Fragment>,\n\t\t\t];\n\t\t};\n\n\t\t/** 数值列渲染 */\n\t\tconst numberRender = (row: DefaultRow, column: TableColumnCtx<DefaultRow>, $index: number) => {\n\t\t\tconst renderValue: unknown = row[props.prop ?? \"\"];\n\t\t\tif (!renderValue || typeof renderValue !== \"number\") {\n\t\t\t\treturn [<Fragment>{formatterRender(row, column, renderValue, $index)}</Fragment>];\n\t\t\t}\n\t\t\tlet useGrouping = false;\n\t\t\tlet maximumFractionDigits = 2;\n\t\t\tswitch (props.type) {\n\t\t\t\tcase \"d2\":\n\t\t\t\t\tmaximumFractionDigits = 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"d4\":\n\t\t\t\t\tmaximumFractionDigits = 4;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"d6\":\n\t\t\t\t\tmaximumFractionDigits = 6;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"gd2\":\n\t\t\t\t\tmaximumFractionDigits = 2;\n\t\t\t\t\tuseGrouping = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"gd4\":\n\t\t\t\t\tmaximumFractionDigits = 4;\n\t\t\t\t\tuseGrouping = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"gd6\":\n\t\t\t\t\tmaximumFractionDigits = 6;\n\t\t\t\t\tuseGrouping = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"default\":\n\t\t\t\tcase \"index\":\n\t\t\t\tcase \"selection\":\n\t\t\t\tcase \"expand\":\n\t\t\t\tcase \"image\":\n\t\t\t\tcase \"date\":\n\t\t\t\tcase \"time\":\n\t\t\t\tcase \"dateTime\":\n\t\t\t\tcase \"timeInfo\":\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t<Fragment>\n\t\t\t\t\t{formatterRender(\n\t\t\t\t\t\trow,\n\t\t\t\t\t\tcolumn,\n\t\t\t\t\t\trenderValue.toLocaleString(\"zh-CN\", {\n\t\t\t\t\t\t\tminimumFractionDigits: 2,\n\t\t\t\t\t\t\tmaximumFractionDigits,\n\t\t\t\t\t\t\tuseGrouping,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t$index\n\t\t\t\t\t)}\n\t\t\t\t</Fragment>,\n\t\t\t];\n\t\t};\n\n\t\t/** 链接列渲染 */\n\t\tconst linkRender = (row: DefaultRow, column: TableColumnCtx<DefaultRow>, $index: number) => {\n\t\t\tconst renderValue = formatterRender(row, column, row[props.prop ?? \"\"], $index);\n\t\t\treturn autoWidthRender([\n\t\t\t\t<Fragment>\n\t\t\t\t\t{copyRender(renderValue)}\n\t\t\t\t\t{renderValue && (\n\t\t\t\t\t\t<ElText\n\t\t\t\t\t\t\tclass={\"el-link is-hover-underline fa-table__link-column__text\"}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t// 数据删除拦截点击\n\t\t\t\t\t\t\t\tif (props.dataDeleteField && row[props.dataDeleteField] === true) return;\n\t\t\t\t\t\t\t\tif (props.click) {\n\t\t\t\t\t\t\t\t\tprops.click({ row, $index, ...getTableDefaultSlots(tableState) });\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\temit(\"customCellClick\", props.clickEmit ?? \"\", {\n\t\t\t\t\t\t\t\t\t\trow,\n\t\t\t\t\t\t\t\t\t\tcolumn: columnCtx.value,\n\t\t\t\t\t\t\t\t\t\t$index,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderValue}\n\t\t\t\t\t\t</ElText>\n\t\t\t\t\t)}\n\t\t\t\t</Fragment>,\n\t\t\t]);\n\t\t};\n\n\t\tconst defaultRender = ({ row, column, $index }: { row: DefaultRow; column: TableColumnCtx<DefaultRow>; $index: number }) => {\n\t\t\tif (props.type === \"timeInfo\") {\n\t\t\t\treturn timeInfoRender(row, column, $index);\n\t\t\t}\n\t\t\tif (props.tag) {\n\t\t\t\treturn tagRender(row, column, $index);\n\t\t\t}\n\t\t\tif (props.type === \"date\" || props.type === \"time\" || props.type === \"dateTime\") {\n\t\t\t\treturn dateRender(row, column, $index);\n\t\t\t}\n\t\t\tif (\n\t\t\t\tprops.type === \"d2\" ||\n\t\t\t\tprops.type === \"d4\" ||\n\t\t\t\tprops.type === \"d6\" ||\n\t\t\t\tprops.type === \"gd2\" ||\n\t\t\t\tprops.type === \"gd4\" ||\n\t\t\t\tprops.type === \"gd6\"\n\t\t\t) {\n\t\t\t\treturn numberRender(row, column, $index);\n\t\t\t}\n\t\t\tif (props.link) {\n\t\t\t\treturn linkRender(row, column, $index);\n\t\t\t}\n\t\t\tif (props.render) {\n\t\t\t\treturn autoWidthRender(props.render({ row, column: columnCtx.value, $index, ...getTableDefaultSlots(tableState) }));\n\t\t\t}\n\t\t\tif (props.slot) {\n\t\t\t\treturn autoWidthRender(slots[props.slot]?.({ row, column: columnCtx.value, $index, ...getTableDefaultSlots(tableState) }) ?? []);\n\t\t\t}\n\t\t\tconst renderValue = formatterRender(row, column, row[props.prop ?? \"\"], $index);\n\t\t\treturn autoWidthRender([\n\t\t\t\t<Fragment>\n\t\t\t\t\t{copyRender(renderValue)}\n\t\t\t\t\t{renderValue}\n\t\t\t\t</Fragment>,\n\t\t\t]);\n\t\t};\n\n\t\tconst elTableColumnProps = useProps(props, tableColumnProps, [\n\t\t\t\"type\",\n\t\t\t\"width\",\n\t\t\t\"minWidth\",\n\t\t\t\"sortable\",\n\t\t\t\"sortOrders\",\n\t\t\t\"resizable\",\n\t\t\t\"showOverflowTooltip\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<Fragment>\n\t\t\t\t{\n\t\t\t\t\t// 如果有配置多级表头的数据,则递归该组件\n\t\t\t\t\tprops._children?.length ? (\n\t\t\t\t\t\t<ElTableColumn\n\t\t\t\t\t\t\t{...elTableColumnProps.value}\n\t\t\t\t\t\t\tclassName={getClassName()}\n\t\t\t\t\t\t\tminWidth={getWidth(\"auto\")}\n\t\t\t\t\t\t\tsortable={props.sortable ? \"custom\" : false}\n\t\t\t\t\t\t\tsortOrders={props.sortOrders}\n\t\t\t\t\t\t\tresizable={props.resizable && !props.autoWidth}\n\t\t\t\t\t\t\tshowOverflowTooltip={(props.showOverflowTooltip ?? true) && !props.autoWidth && props.type === \"default\"}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\theader: ({ column, $index }: { column: TableColumnCtx<DefaultRow>; $index: number }) =>\n\t\t\t\t\t\t\t\t\theaderRender({ column, $index }),\n\t\t\t\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\t\t\t\t(props._children ?? []).map((col: FaTableColumnCtx) =>\n\t\t\t\t\t\t\t\t\t\th(\n\t\t\t\t\t\t\t\t\t\t\tresolveComponent(\"FaTableColumn\"),\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t...col,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tslots\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</ElTableColumn>\n\t\t\t\t\t) : props.type === \"image\" ? (\n\t\t\t\t\t\t<ElTableColumn\n\t\t\t\t\t\t\t{...elTableColumnProps.value}\n\t\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\t\tclassName=\"fa-table__image-column\"\n\t\t\t\t\t\t\tminWidth=\"50px\"\n\t\t\t\t\t\t\tsortable={false}\n\t\t\t\t\t\t\tresizable={false}\n\t\t\t\t\t\t\tshowOverflowTooltip={false}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\theader: ({ column, $index }: { column: TableColumnCtx<DefaultRow>; $index: number }) =>\n\t\t\t\t\t\t\t\t\theaderRender({ column, $index }),\n\t\t\t\t\t\t\t\tdefault: ({ row }: { row: DefaultRow; column: TableColumnCtx<DefaultRow>; $index: number }) =>\n\t\t\t\t\t\t\t\t\trow[props.prop ?? \"\"] ? (\n\t\t\t\t\t\t\t\t\t\tprops.hideImage ? (\n\t\t\t\t\t\t\t\t\t\t\t<ElImage\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"fa-image\"\n\t\t\t\t\t\t\t\t\t\t\t\tlazy\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={artwork}\n\t\t\t\t\t\t\t\t\t\t\t\tfit=\"cover\"\n\t\t\t\t\t\t\t\t\t\t\t\tpreviewSrcList={[displayText(row[props.prop ?? \"\"])]}\n\t\t\t\t\t\t\t\t\t\t\t\tcloseOnPressEscape\n\t\t\t\t\t\t\t\t\t\t\t\thideOnClickModal\n\t\t\t\t\t\t\t\t\t\t\t\tpreviewTeleported\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<FaImage lazy src={displayText(row[props.prop ?? \"\"])} fit=\"cover\" original={props.originalImage} thumb />\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<ElImage class=\"fa-image\" lazy src={notImage} fit=\"cover\" />\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</ElTableColumn>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t// 其他正常的列\n\t\t\t\t\t\t<ElTableColumn\n\t\t\t\t\t\t\t{...elTableColumnProps.value}\n\t\t\t\t\t\t\ttype={props.type === \"selection\" || props.type === \"index\" || props.type === \"expand\" ? props.type : \"default\"}\n\t\t\t\t\t\t\tclassName={getClassName()}\n\t\t\t\t\t\t\tminWidth={getWidth(\"auto\")}\n\t\t\t\t\t\t\tsortable={props.sortable ? \"custom\" : false}\n\t\t\t\t\t\t\tsortOrders={props.sortOrders}\n\t\t\t\t\t\t\tresizable={props.resizable && !props.autoWidth}\n\t\t\t\t\t\t\tshowOverflowTooltip={(props.showOverflowTooltip ?? true) && !props.autoWidth && props.type === \"default\"}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\theader: ({ column, $index }: { column: TableColumnCtx<DefaultRow>; $index: number }) =>\n\t\t\t\t\t\t\t\t\tslots.header\n\t\t\t\t\t\t\t\t\t\t? slots.header({ column: columnCtx.value, $index, ...getTableDefaultSlots(tableState) })\n\t\t\t\t\t\t\t\t\t\t: headerRender({ column, $index }),\n\t\t\t\t\t\t\t\tdefault: ({ row, column, $index }: { row: DefaultRow; column: TableColumnCtx<DefaultRow>; $index: number }) =>\n\t\t\t\t\t\t\t\t\tslots.default\n\t\t\t\t\t\t\t\t\t\t? slots.default({ row, column: columnCtx.value, $index, ...getTableDefaultSlots(tableState) })\n\t\t\t\t\t\t\t\t\t\t: defaultRender({ row, column, $index }),\n\t\t\t\t\t\t\t\tfilterIcon: ({ filterOpened }: { filterOpened: boolean }) =>\n\t\t\t\t\t\t\t\t\tslots.filterIcon?.({ filterOpened, ...getTableDefaultSlots(tableState) }),\n\t\t\t\t\t\t\t\texpand: ({ expanded }: { expanded: boolean }) => slots.expand?.({ expanded, ...getTableDefaultSlots(tableState) }),\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</ElTableColumn>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t</Fragment>\n\t\t));\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;AAqBsB,SAAA,QAAA,GAAA;CAAA,OAAA,OAAA,MAAA,cAAA,OAAA,UAAA,SAAA,KAAA,CAAA,MAAA,qBAAA,CAAA,QAAA,CAAA;AAAA;AA2BtB,IAAA,sBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;EACN,GAAG;;;;EAIH,MAAM;GACL,MAAM,eAAk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BAAA;GAAA,GAAA,IAAA,IAAA,YAAA,SAAA;IAAA,QAAA;IAAA,OAMlC,YAAY,IAAI,MAAM,QAAQ,GAAG;IAAC,OAAA;IAAA,YAAwB,MAAM;IAAa,SAAA;GAAA,GAAA,IAAA,IAChG,YAAA,SAAA;IAAA,SAAA;IAAA,QAAA;IAAA,OAEmC;IAAQ,OAAA;GAAA,GAAA,IAAA;EAC5C,CAAA,IAIJ,YAAA,eAAA,WAEK,mBAAmB,OAAK;GAAA,QACtB,MAAM,SAAS,eAAe,MAAM,SAAS,WAAW,MAAM,SAAS,WAAW,MAAM,OAAO;GAAS,aACnG,aAAa;GAAC,YACf,SAAS,MAAM;GAAC,YAChB,MAAM,WAAW,WAAW;GAAK,cAC/B,MAAM;GAAU,aACjB,MAAM,aAAa,CAAC,MAAM;GAAS,wBACxB,MAAM,uBAAuB,SAAS,CAAC,MAAM,aAAa,MAAM,SAAS;EAAS,CAAA,GAAA;GAGvG,SAAS,EAAE,QAAQ,aAClB,MAAM,SACH,MAAM,OAAO;IAAE,QAAQ,UAAU;IAAO;IAAQ,GAAG,qBAAqB,UAAU;GAAE,CAAC,IACrF,aAAa;IAAE;IAAQ;GAAO,CAAC;GACnC,UAAU,EAAE,KAAK,QAAQ,aACxB,MAAM,UACH,MAAM,QAAQ;IAAE;IAAK,QAAQ,UAAU;IAAO;IAAQ,GAAG,qBAAqB,UAAU;GAAE,CAAC,IAC3F,cAAc;IAAE;IAAK;IAAQ;GAAO,CAAC;GACzC,aAAa,EAAE,mBACd,MAAM,aAAa;IAAE;IAAc,GAAG,qBAAqB,UAAU;GAAE,CAAC;GACzE,SAAS,EAAE,eAAsC,MAAM,SAAS;IAAE;IAAU,GAAG,qBAAqB,UAAU;GAAE,CAAC;EAAC,CAAA,CAGpH,CAAA,CAGH;CACF;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"tableColumn.mjs","names":[],"sources":["../../../../src/components/table/src/tableColumn.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, h, inject, resolveComponent } from \"vue\";\nimport { CopyDocument } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImage, ElMessage, ElTableColumn, ElTag, ElText, dayjs, useGlobalSize } from \"element-plus\";\nimport { tableColumnProps } from \"../../../internal/props\";\nimport { copy as copyToClipboard, definePropType, formatChineseRelativeTime, makeSlots, useProps, useRender } from \"../../../utils\";\nimport FaImage from \"../../image\";\nimport artwork from \"../images/artwork.png\";\nimport notImage from \"../images/notImage.png\";\nimport { tableUtil } from \"../utils/table\";\nimport { getTableDefaultSlots } from \"./table.type\";\nimport { enumMapKey, tableStateKey } from \"./useTable\";\nimport type { TableColumnCtx } from \"element-plus\";\nimport type { VNode } from \"vue\";\nimport type { DefaultRow } from \"./table.state\";\nimport type {\n\tFaTableColumnCtx,\n\tFaTableColumnDateFormat,\n\tFaTableColumnType,\n\tFaTableDefaultSlotsResult,\n\tFaTableEnumColumnCtx,\n\tFaTableEnumColumnType,\n} from \"./table.type\";\n\nexport { tableColumnProps } from \"../../../internal/props\";\n\n/** FaTableColumn 插槽返回的行列上下文。 */\nexport interface FaTableColumnSlotsResult {\n\t/** slots为表格内容的时候才会返回 */\n\trow?: DefaultRow;\n\t/** slot为表头内容的时候返回 'TableColumnCtx<DefaultRow>' 否则返回 'FaTableColumnCtx' */\n\tcolumn?: TableColumnCtx<DefaultRow> | FaTableColumnCtx;\n\t$index?: number;\n}\n\ntype FaTableColumnDefaultSlots = Record<string, FaTableDefaultSlotsResult & FaTableColumnSlotsResult>;\n\n/** FaTableColumn 的固定插槽和动态命名插槽。 */\nexport type FaTableColumnSlots = Record<string, unknown> & {\n\t/** 默认内容插槽 */\n\tdefault: FaTableDefaultSlotsResult & { row: DefaultRow; column: FaTableColumnCtx; $index: number };\n\t/** 自定义表头的内容 */\n\theader: FaTableDefaultSlotsResult & { column: FaTableColumnCtx; $index: number };\n\t/** 自定义 filter 图标 */\n\tfilterIcon: FaTableDefaultSlotsResult & { filterOpened: boolean };\n\t/** 展开列的自定义内容 */\n\texpand: FaTableDefaultSlotsResult & { expanded: boolean };\n} & FaTableColumnDefaultSlots;\n\nexport default defineComponent({\n\tname: \"FaTableColumn\",\n\tprops: {\n\t\t...tableColumnProps,\n\t\t/**\n\t\t * type of the column. If set to `selection`, the column will display checkbox. If set to `index`, the column will display index of the row (staring from 1). If set to `expand`, the column will display expand icon\n\t\t */\n\t\ttype: {\n\t\t\ttype: definePropType<FaTableColumnType>(String),\n\t\t\tdefault: \"default\",\n\t\t},\n\t\t/**\n\t\t * column width\n\t\t */\n\t\twidth: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: \"auto\",\n\t\t},\n\t\t/** alignment, the value should be 'left' \\/ 'center' \\/ 'right' */\n\t\talign: {\n\t\t\ttype: String,\n\t\t\tdefault: \"left\",\n\t\t},\n\t\t/** alignment of the table header. If omitted, the value of the above `align` attribute will be applied, the value should be 'left' \\/ 'center' \\/ 'right' */\n\t\theaderAlign: {\n\t\t\ttype: String,\n\t\t\tdefault: \"left\",\n\t\t},\n\t\t/** 是否显示在表格当中 */\n\t\tshow: Boolean,\n\t\t/** 小页面的宽度,如果为空,则继承默认宽度 */\n\t\tsmallWidth: {\n\t\t\ttype: [String, Number],\n\t\t},\n\t\t/** 自适应宽度 */\n\t\tautoWidth: Boolean,\n\t\t/** 插槽名称 */\n\t\tslot: String,\n\t\t/** 表格头部插槽名称 */\n\t\theaderSlot: String,\n\t\t/** 自定义表头内容渲染(tsx语法) */\n\t\theaderRender: {\n\t\t\ttype: definePropType<({ column, $index }: { column: TableColumnCtx<DefaultRow>; $index: number } & FaTableDefaultSlotsResult) => VNode[]>(\n\t\t\t\tFunction\n\t\t\t),\n\t\t},\n\t\t/** 自定义单元格内容渲染(tsx语法) */\n\t\trender: {\n\t\t\ttype: definePropType<\n\t\t\t\t({ row, column, $index }: { row: DefaultRow; column: FaTableColumnCtx; $index: number } & FaTableDefaultSlotsResult) => VNode[]\n\t\t\t>(Function),\n\t\t},\n\t\t/** 多级表头 */\n\t\t_children: {\n\t\t\ttype: definePropType<FaTableColumnCtx[]>(Array),\n\t\t},\n\t\t/** 隐藏图片 */\n\t\thideImage: Boolean,\n\t\t/** 复制 */\n\t\tcopy: Boolean,\n\t\t/** 是否为 Link Button */\n\t\tlink: Boolean,\n\t\t/** 合并行字段 */\n\t\tspanProp: String,\n\t\t/** Link 按钮的点击事件,优先级最高 */\n\t\tclick: {\n\t\t\ttype: definePropType<({ row, $index }: { row: DefaultRow; $index?: number } & FaTableDefaultSlotsResult) => void>(Function),\n\t\t},\n\t\t/** 点击Emits事件回调 */\n\t\tclickEmit: String,\n\t\t/** 图片列是否显示为原图,默认 false 显示缩略图 */\n\t\toriginalImage: Boolean,\n\t\t/** 显示时间格式化字符串 */\n\t\tdateFix: Boolean,\n\t\t/** 显示在页面中的日期格式 */\n\t\tdateFormat: {\n\t\t\ttype: definePropType<FaTableColumnDateFormat>(String),\n\t\t},\n\t\t/** 是否是标签展示 */\n\t\ttag: Boolean,\n\t\t/** 枚举类型(渲染值的字典) */\n\t\tenum: {\n\t\t\ttype: definePropType<FaTableEnumColumnType>([String, Array, Function]),\n\t\t},\n\t\t/** 数据删除字段,如果为 true 会显示遮罩层 */\n\t\tdataDeleteField: String,\n\t\t/** 时间信息字段 */\n\t\ttimeInfoField: {\n\t\t\ttype: definePropType<{ userName?: string; time?: string }>(Object),\n\t\t\tdefault: () => ({\n\t\t\t\tuserName: \"createdUserName\",\n\t\t\t\ttime: \"createdTime\",\n\t\t\t}),\n\t\t},\n\t},\n\temits: {\n\t\t/** 图片预览 */\n\t\timagePreview: (url: string) => typeof url === \"string\",\n\t\t/** 自定义单元格点击事件 */\n\t\tcustomCellClick: (emitName: string, { row, column, $index }: { row: DefaultRow; column: FaTableColumnCtx; $index: number }) =>\n\t\t\t(emitName == null || typeof emitName === \"string\") &&\n\t\t\ttypeof row === \"object\" &&\n\t\t\trow !== null &&\n\t\t\ttypeof column === \"object\" &&\n\t\t\tcolumn !== null &&\n\t\t\ttypeof $index === \"number\",\n\t},\n\tslots: makeSlots<FaTableColumnSlots>(),\n\tsetup(props, { slots, emit }) {\n\t\tconst globalSize = useGlobalSize();\n\t\tconst tableState = inject(tableStateKey);\n\t\tconst enumMap = inject(enumMapKey);\n\t\tif (tableState === undefined || enumMap === undefined) {\n\t\t\tthrow new Error(\"FaTableColumn 必须在 FaTable 内部渲染。\");\n\t\t}\n\n\t\tconst columnCtx = computed(() => props as FaTableColumnCtx);\n\n\t\t/** 获取ClassName */\n\t\tconst getClassName = () => {\n\t\t\tlet className = \"\";\n\t\t\tif (props.type === \"timeInfo\") {\n\t\t\t\tclassName += \"fa-table__line-height-normal-column\";\n\t\t\t}\n\t\t\tif (props.type === \"date\" || props.type === \"time\" || props.type === \"dateTime\") {\n\t\t\t\tif (props.dateFix) {\n\t\t\t\t\tclassName += \"fa-table__line-height-normal-column\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (props.className) {\n\t\t\t\treturn `${className} ${props.className}`;\n\t\t\t}\n\t\t\treturn className;\n\t\t};\n\n\t\t/** 获取宽度 */\n\t\tconst getWidth = (defAttr: string) => {\n\t\t\tif (props.autoWidth) {\n\t\t\t\tconst autoWidthEntry = tableState.autoColumnWidth.find((f) => f.prop === props.prop);\n\t\t\t\treturn autoWidthEntry ? `${autoWidthEntry.width}px` : \"auto\";\n\t\t\t}\n\t\t\tif (globalSize.value === \"small\") {\n\t\t\t\treturn props.smallWidth || props.width || props.minWidth || defAttr;\n\t\t\t}\n\t\t\treturn props.width || props.minWidth || defAttr;\n\t\t};\n\n\t\t/** 表头自动宽度渲染 */\n\t\tconst autoWidthHeaderRender = (el: VNode[]) => {\n\t\t\tif (props.autoWidth) {\n\t\t\t\treturn [\n\t\t\t\t\t<div class={[\"fa-table__auto-width-column__cell-header\", `__fa-table__auto-width-column__cell-header__${props.prop}`]}>{el}</div>,\n\t\t\t\t];\n\t\t\t} else {\n\t\t\t\treturn el;\n\t\t\t}\n\t\t};\n\n\t\t/** 自动宽度渲染 */\n\t\tconst autoWidthRender = (el: VNode[]) => {\n\t\t\tif (props.autoWidth) {\n\t\t\t\treturn [<div class={[\"fa-table__auto-width-column__cell\", `__fa-table__auto-width-column__cell__${props.prop}`]}>{el}</div>];\n\t\t\t} else {\n\t\t\t\treturn el;\n\t\t\t}\n\t\t};\n\n\t\t/** 表头渲染 */\n\t\tconst headerRender = ({ column, $index }: { column: TableColumnCtx<DefaultRow>; $index: number }) => {\n\t\t\tif (props.headerRender) {\n\t\t\t\treturn autoWidthHeaderRender(props.headerRender({ column, $index, ...getTableDefaultSlots(tableState) }));\n\t\t\t} else if (props.headerSlot) {\n\t\t\t\treturn autoWidthHeaderRender(slots[props.headerSlot]?.({ column, $index, ...getTableDefaultSlots(tableState) }) ?? []);\n\t\t\t} else {\n\t\t\t\treturn autoWidthHeaderRender([<span>{props.label}</span>]);\n\t\t\t}\n\t\t};\n\n\t\t/** 复制渲染 */\n\t\tconst displayText = (value: unknown) => {\n\t\t\tif (typeof value === \"string\") return value;\n\t\t\tif (typeof value === \"number\" || typeof value === \"bigint\" || typeof value === \"boolean\") return String(value);\n\t\t\treturn \"\";\n\t\t};\n\n\t\tconst copyRender = (value: unknown, copy?: boolean) => {\n\t\t\tif (!(props.copy || copy) || !value) return [];\n\n\t\t\treturn [\n\t\t\t\t<ElIcon\n\t\t\t\t\tclass=\"fa__copy-icon\"\n\t\t\t\t\ttitle=\"复制\"\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tcopyToClipboard(displayText(value)).then(\n\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\tElMessage({\n\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\tmessage: \"复制成功\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\tElMessage({\n\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\tmessage: \"复制失败\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<CopyDocument />\n\t\t\t\t</ElIcon>,\n\t\t\t];\n\t\t};\n\n\t\t/** 渲染单元格数据 */\n\t\tconst renderCellData = ({ row }: { row: DefaultRow }) => {\n\t\t\tconst cellValue = tableUtil.handleRowAccordingToProp(row, props.prop ?? \"\");\n\n\t\t\tlet enumData: FaTableEnumColumnCtx[] | undefined;\n\n\t\t\tif (typeof props.enum === \"string\") {\n\t\t\t\tenumData = enumMap.get(props.enum);\n\t\t\t} else if (Array.isArray(props.enum)) {\n\t\t\t\tenumData = props.enum;\n\t\t\t} else if (typeof props.enum === \"function\") {\n\t\t\t\tenumData = props.enum({ row });\n\t\t\t}\n\n\t\t\tif (enumData) {\n\t\t\t\treturn tableUtil.filterEnum(cellValue, enumData);\n\t\t\t} else {\n\t\t\t\treturn tableUtil.formatValue(cellValue);\n\t\t\t}\n\t\t};\n\n\t\t/** 格式化渲染 */\n\t\tconst formatterRender = (row: DefaultRow, column: TableColumnCtx<DefaultRow>, cellValue: unknown, index: number) => {\n\t\t\tconst formatter = column.formatter as TableColumnCtx<DefaultRow>[\"formatter\"] | null | undefined;\n\t\t\tif (formatter) {\n\t\t\t\treturn formatter(row, column, cellValue, index);\n\t\t\t} else {\n\t\t\t\treturn displayText(cellValue);\n\t\t\t}\n\t\t};\n\n\t\t/** 时间信息列渲染 */\n\t\tconst timeInfoRender = (row: DefaultRow, _column: TableColumnCtx<DefaultRow>, _$index: number) => {\n\t\t\tconst userName = displayText(row[props.timeInfoField.userName ?? \"createdUserName\"]);\n\t\t\tconst time = displayText(row[props.timeInfoField.time ?? \"createdTime\"]);\n\t\t\treturn [\n\t\t\t\t<Fragment>\n\t\t\t\t\t<div style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\" title={time}>\n\t\t\t\t\t\t{userName && <span style=\"margin-right: 5px;\">{userName}</span>}\n\t\t\t\t\t\t<span>{time}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t{time && (\n\t\t\t\t\t\t<ElTag type=\"info\" round effect=\"light\" size=\"small\">\n\t\t\t\t\t\t\t{formatChineseRelativeTime(time)}\n\t\t\t\t\t\t</ElTag>\n\t\t\t\t\t)}\n\t\t\t\t</Fragment>,\n\t\t\t];\n\t\t};\n\n\t\t/** 标签列渲染 */\n\t\tconst tagRender = (row: DefaultRow, column: TableColumnCtx<DefaultRow>, $index: number) => {\n\t\t\tconst renderValue = formatterRender(row, column, renderCellData({ row }), $index);\n\n\t\t\tlet enumData: FaTableEnumColumnCtx[] | undefined;\n\n\t\t\tif (typeof props.enum === \"string\") {\n\t\t\t\tenumData = enumMap.get(props.enum);\n\t\t\t} else if (Array.isArray(props.enum)) {\n\t\t\t\tenumData = props.enum;\n\t\t\t} else if (typeof props.enum === \"function\") {\n\t\t\t\tenumData = props.enum({ row });\n\t\t\t}\n\n\t\t\tconst enumValue: unknown = tableUtil.handleRowAccordingToProp(row, props.prop ?? \"\");\n\t\t\tconst type = enumData?.find((item) => item.value === enumValue)?.type ?? \"info\";\n\t\t\treturn [\n\t\t\t\t<Fragment>\n\t\t\t\t\t{copyRender(renderValue)}\n\t\t\t\t\t{renderValue ? <ElTag type={type}>{renderValue}</ElTag> : null}\n\t\t\t\t</Fragment>,\n\t\t\t];\n\t\t};\n\n\t\t/** 时间列渲染 */\n\t\tconst dateRender = (row: DefaultRow, column: TableColumnCtx<DefaultRow>, $index: number) => {\n\t\t\tlet dateFormat;\n\t\t\tswitch (props.type) {\n\t\t\t\tcase \"date\":\n\t\t\t\t\tdateFormat = \"YYYY-MM-DD\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"time\":\n\t\t\t\t\tdateFormat = \"HH:mm:ss\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"dateTime\":\n\t\t\t\t\tdateFormat = \"YYYY-MM-DD HH:mm:ss\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"default\":\n\t\t\t\tcase \"index\":\n\t\t\t\tcase \"selection\":\n\t\t\t\tcase \"expand\":\n\t\t\t\tcase \"image\":\n\t\t\t\tcase \"d2\":\n\t\t\t\tcase \"d4\":\n\t\t\t\tcase \"d6\":\n\t\t\t\tcase \"gd2\":\n\t\t\t\tcase \"gd4\":\n\t\t\t\tcase \"gd6\":\n\t\t\t\tcase \"timeInfo\":\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst cellValue = tableUtil.handleRowAccordingToProp(row, props.prop ?? \"\");\n\t\t\tconst renderValue = cellValue\n\t\t\t\t? formatterRender(row, column, dayjs(cellValue as Parameters<typeof dayjs>[0]).format(props.dateFormat ?? dateFormat), $index)\n\t\t\t\t: null;\n\t\t\treturn [\n\t\t\t\t<Fragment>\n\t\t\t\t\t{copyRender(renderValue)}\n\t\t\t\t\t{renderValue}\n\t\t\t\t\t{props.dateFix && renderValue && (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t<ElTag type=\"info\" round effect=\"light\" size=\"small\">\n\t\t\t\t\t\t\t\t{formatChineseRelativeTime(displayText(renderValue))}\n\t\t\t\t\t\t\t</ElTag>\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t)}\n\t\t\t\t</Fragment>,\n\t\t\t];\n\t\t};\n\n\t\t/** 数值列渲染 */\n\t\tconst numberRender = (row: DefaultRow, column: TableColumnCtx<DefaultRow>, $index: number) => {\n\t\t\tconst cellValue = tableUtil.handleRowAccordingToProp(row, props.prop ?? \"\");\n\t\t\tif (!cellValue || typeof cellValue !== \"number\") {\n\t\t\t\treturn [<Fragment>{formatterRender(row, column, cellValue, $index)}</Fragment>];\n\t\t\t}\n\t\t\tlet useGrouping = false;\n\t\t\tlet maximumFractionDigits = 2;\n\t\t\tswitch (props.type) {\n\t\t\t\tcase \"d2\":\n\t\t\t\t\tmaximumFractionDigits = 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"d4\":\n\t\t\t\t\tmaximumFractionDigits = 4;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"d6\":\n\t\t\t\t\tmaximumFractionDigits = 6;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"gd2\":\n\t\t\t\t\tmaximumFractionDigits = 2;\n\t\t\t\t\tuseGrouping = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"gd4\":\n\t\t\t\t\tmaximumFractionDigits = 4;\n\t\t\t\t\tuseGrouping = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"gd6\":\n\t\t\t\t\tmaximumFractionDigits = 6;\n\t\t\t\t\tuseGrouping = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"default\":\n\t\t\t\tcase \"index\":\n\t\t\t\tcase \"selection\":\n\t\t\t\tcase \"expand\":\n\t\t\t\tcase \"image\":\n\t\t\t\tcase \"date\":\n\t\t\t\tcase \"time\":\n\t\t\t\tcase \"dateTime\":\n\t\t\t\tcase \"timeInfo\":\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t<Fragment>\n\t\t\t\t\t{formatterRender(\n\t\t\t\t\t\trow,\n\t\t\t\t\t\tcolumn,\n\t\t\t\t\t\tcellValue.toLocaleString(\"zh-CN\", {\n\t\t\t\t\t\t\tminimumFractionDigits: 2,\n\t\t\t\t\t\t\tmaximumFractionDigits,\n\t\t\t\t\t\t\tuseGrouping,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t$index\n\t\t\t\t\t)}\n\t\t\t\t</Fragment>,\n\t\t\t];\n\t\t};\n\n\t\t/** 链接列渲染 */\n\t\tconst linkRender = (row: DefaultRow, column: TableColumnCtx<DefaultRow>, $index: number) => {\n\t\t\tconst cellValue = tableUtil.handleRowAccordingToProp(row, props.prop ?? \"\");\n\t\t\tconst renderValue = formatterRender(row, column, cellValue, $index);\n\t\t\treturn autoWidthRender([\n\t\t\t\t<Fragment>\n\t\t\t\t\t{copyRender(renderValue)}\n\t\t\t\t\t{renderValue && (\n\t\t\t\t\t\t<ElText\n\t\t\t\t\t\t\tclass={\"el-link is-hover-underline fa-table__link-column__text\"}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t// 数据删除拦截点击\n\t\t\t\t\t\t\t\tif (props.dataDeleteField && row[props.dataDeleteField] === true) return;\n\t\t\t\t\t\t\t\tif (props.click) {\n\t\t\t\t\t\t\t\t\tprops.click({ row, $index, ...getTableDefaultSlots(tableState) });\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\temit(\"customCellClick\", props.clickEmit ?? \"\", {\n\t\t\t\t\t\t\t\t\t\trow,\n\t\t\t\t\t\t\t\t\t\tcolumn: columnCtx.value,\n\t\t\t\t\t\t\t\t\t\t$index,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderValue}\n\t\t\t\t\t\t</ElText>\n\t\t\t\t\t)}\n\t\t\t\t</Fragment>,\n\t\t\t]);\n\t\t};\n\n\t\tconst defaultRender = ({ row, column, $index }: { row: DefaultRow; column: TableColumnCtx<DefaultRow>; $index: number }) => {\n\t\t\tif (props.type === \"timeInfo\") {\n\t\t\t\treturn timeInfoRender(row, column, $index);\n\t\t\t}\n\t\t\tif (props.tag) {\n\t\t\t\treturn tagRender(row, column, $index);\n\t\t\t}\n\t\t\tif (props.type === \"date\" || props.type === \"time\" || props.type === \"dateTime\") {\n\t\t\t\treturn dateRender(row, column, $index);\n\t\t\t}\n\t\t\tif (\n\t\t\t\tprops.type === \"d2\" ||\n\t\t\t\tprops.type === \"d4\" ||\n\t\t\t\tprops.type === \"d6\" ||\n\t\t\t\tprops.type === \"gd2\" ||\n\t\t\t\tprops.type === \"gd4\" ||\n\t\t\t\tprops.type === \"gd6\"\n\t\t\t) {\n\t\t\t\treturn numberRender(row, column, $index);\n\t\t\t}\n\t\t\tif (props.link) {\n\t\t\t\treturn linkRender(row, column, $index);\n\t\t\t}\n\t\t\tif (props.render) {\n\t\t\t\treturn autoWidthRender(props.render({ row, column: columnCtx.value, $index, ...getTableDefaultSlots(tableState) }));\n\t\t\t}\n\t\t\tif (props.slot) {\n\t\t\t\treturn autoWidthRender(slots[props.slot]?.({ row, column: columnCtx.value, $index, ...getTableDefaultSlots(tableState) }) ?? []);\n\t\t\t}\n\t\t\tconst cellValue = tableUtil.handleRowAccordingToProp(row, props.prop ?? \"\");\n\t\t\tconst renderValue = formatterRender(row, column, cellValue, $index);\n\t\t\treturn autoWidthRender([\n\t\t\t\t<Fragment>\n\t\t\t\t\t{copyRender(renderValue)}\n\t\t\t\t\t{renderValue}\n\t\t\t\t</Fragment>,\n\t\t\t]);\n\t\t};\n\n\t\tconst elTableColumnProps = useProps(props, tableColumnProps, [\n\t\t\t\"type\",\n\t\t\t\"width\",\n\t\t\t\"minWidth\",\n\t\t\t\"sortable\",\n\t\t\t\"sortOrders\",\n\t\t\t\"resizable\",\n\t\t\t\"showOverflowTooltip\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<Fragment>\n\t\t\t\t{\n\t\t\t\t\t// 如果有配置多级表头的数据,则递归该组件\n\t\t\t\t\tprops._children?.length ? (\n\t\t\t\t\t\t<ElTableColumn\n\t\t\t\t\t\t\t{...elTableColumnProps.value}\n\t\t\t\t\t\t\tclassName={getClassName()}\n\t\t\t\t\t\t\tminWidth={getWidth(\"auto\")}\n\t\t\t\t\t\t\tsortable={props.sortable ? \"custom\" : false}\n\t\t\t\t\t\t\tsortOrders={props.sortOrders}\n\t\t\t\t\t\t\tresizable={props.resizable && !props.autoWidth}\n\t\t\t\t\t\t\tshowOverflowTooltip={(props.showOverflowTooltip ?? true) && !props.autoWidth && props.type === \"default\"}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\theader: ({ column, $index }: { column: TableColumnCtx<DefaultRow>; $index: number }) =>\n\t\t\t\t\t\t\t\t\theaderRender({ column, $index }),\n\t\t\t\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\t\t\t\t(props._children ?? []).map((col: FaTableColumnCtx) =>\n\t\t\t\t\t\t\t\t\t\th(\n\t\t\t\t\t\t\t\t\t\t\tresolveComponent(\"FaTableColumn\"),\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t...col,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tslots\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</ElTableColumn>\n\t\t\t\t\t) : props.type === \"image\" ? (\n\t\t\t\t\t\t<ElTableColumn\n\t\t\t\t\t\t\t{...elTableColumnProps.value}\n\t\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\t\tclassName=\"fa-table__image-column\"\n\t\t\t\t\t\t\tminWidth=\"50px\"\n\t\t\t\t\t\t\tsortable={false}\n\t\t\t\t\t\t\tresizable={false}\n\t\t\t\t\t\t\tshowOverflowTooltip={false}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\theader: ({ column, $index }: { column: TableColumnCtx<DefaultRow>; $index: number }) =>\n\t\t\t\t\t\t\t\t\theaderRender({ column, $index }),\n\t\t\t\t\t\t\t\tdefault: ({ row }: { row: DefaultRow; column: TableColumnCtx<DefaultRow>; $index: number }) => {\n\t\t\t\t\t\t\t\t\tconst cellValue = tableUtil.handleRowAccordingToProp(row, props.prop ?? \"\");\n\t\t\t\t\t\t\t\t\tconst renderValue = displayText(cellValue);\n\t\t\t\t\t\t\t\t\treturn renderValue ? (\n\t\t\t\t\t\t\t\t\t\tprops.hideImage ? (\n\t\t\t\t\t\t\t\t\t\t\t<ElImage\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"fa-image\"\n\t\t\t\t\t\t\t\t\t\t\t\tlazy\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={artwork}\n\t\t\t\t\t\t\t\t\t\t\t\tfit=\"cover\"\n\t\t\t\t\t\t\t\t\t\t\t\tpreviewSrcList={[renderValue]}\n\t\t\t\t\t\t\t\t\t\t\t\tcloseOnPressEscape\n\t\t\t\t\t\t\t\t\t\t\t\thideOnClickModal\n\t\t\t\t\t\t\t\t\t\t\t\tpreviewTeleported\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<FaImage lazy src={renderValue} fit=\"cover\" original={props.originalImage} thumb />\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<ElImage class=\"fa-image\" lazy src={notImage} fit=\"cover\" />\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</ElTableColumn>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t// 其他正常的列\n\t\t\t\t\t\t<ElTableColumn\n\t\t\t\t\t\t\t{...elTableColumnProps.value}\n\t\t\t\t\t\t\ttype={props.type === \"selection\" || props.type === \"index\" || props.type === \"expand\" ? props.type : \"default\"}\n\t\t\t\t\t\t\tclassName={getClassName()}\n\t\t\t\t\t\t\tminWidth={getWidth(\"auto\")}\n\t\t\t\t\t\t\tsortable={props.sortable ? \"custom\" : false}\n\t\t\t\t\t\t\tsortOrders={props.sortOrders}\n\t\t\t\t\t\t\tresizable={props.resizable && !props.autoWidth}\n\t\t\t\t\t\t\tshowOverflowTooltip={(props.showOverflowTooltip ?? true) && !props.autoWidth && props.type === \"default\"}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\theader: ({ column, $index }: { column: TableColumnCtx<DefaultRow>; $index: number }) =>\n\t\t\t\t\t\t\t\t\tslots.header\n\t\t\t\t\t\t\t\t\t\t? slots.header({ column: columnCtx.value, $index, ...getTableDefaultSlots(tableState) })\n\t\t\t\t\t\t\t\t\t\t: headerRender({ column, $index }),\n\t\t\t\t\t\t\t\tdefault: ({ row, column, $index }: { row: DefaultRow; column: TableColumnCtx<DefaultRow>; $index: number }) =>\n\t\t\t\t\t\t\t\t\tslots.default\n\t\t\t\t\t\t\t\t\t\t? slots.default({ row, column: columnCtx.value, $index, ...getTableDefaultSlots(tableState) })\n\t\t\t\t\t\t\t\t\t\t: defaultRender({ row, column, $index }),\n\t\t\t\t\t\t\t\tfilterIcon: ({ filterOpened }: { filterOpened: boolean }) =>\n\t\t\t\t\t\t\t\t\tslots.filterIcon?.({ filterOpened, ...getTableDefaultSlots(tableState) }),\n\t\t\t\t\t\t\t\texpand: ({ expanded }: { expanded: boolean }) => slots.expand?.({ expanded, ...getTableDefaultSlots(tableState) }),\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</ElTableColumn>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t</Fragment>\n\t\t));\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;AAqBsB,SAAA,QAAA,GAAA;CAAA,OAAA,OAAA,MAAA,cAAA,OAAA,UAAA,SAAA,KAAA,CAAA,MAAA,qBAAA,CAAA,QAAA,CAAA;AAAA;AA2BtB,IAAA,sBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;EACN,GAAG;;;;EAIH,MAAM;GACL,MAAM,eAAkC,MAAM;GAC9C,SAAS;EACV;;;;EAIA,OAAO;GACN,MAAM,CAAC,QAAQ,MAAM;GACrB,SAAS;EACV;;EAEA,OAAO;GACN,MAAM;GACN,SAAS;EACV;;EAEA,aAAa;GACZ,MAAM;GACN,SAAS;EACV;;EAEA,MAAM;;EAEN,YAAY,EACX,MAAM,CAAC,QAAQ,MAAM,EACtB;;EAEA,WAAW;;EAEX,MAAM;;EAEN,YAAY;;EAEZ,cAAc,EACb,MAAM,eACL,QACD,EACD;;EAEA,QAAQ,EACP,MAAM,eAEJ,QAAQ,EACX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OAAA;IAAA,GAAA,IAAA;GAE9C;EAAC,CAAA,IAIH,YAAA,eAAA,WAEK,mBAAmB,OAAK;GAAA,QACtB,MAAM,SAAS,eAAe,MAAM,SAAS,WAAW,MAAM,SAAS,WAAW,MAAM,OAAO;GAAS,aACnG,aAAa;GAAC,YACf,SAAS,MAAM;GAAC,YAChB,MAAM,WAAW,WAAW;GAAK,cAC/B,MAAM;GAAU,aACjB,MAAM,aAAa,CAAC,MAAM;GAAS,wBACxB,MAAM,uBAAuB,SAAS,CAAC,MAAM,aAAa,MAAM,SAAS;EAAS,CAAA,GAAA;GAGvG,SAAS,EAAE,QAAQ,aAClB,MAAM,SACH,MAAM,OAAO;IAAE,QAAQ,UAAU;IAAO;IAAQ,GAAG,qBAAqB,UAAU;GAAE,CAAC,IACrF,aAAa;IAAE;IAAQ;GAAO,CAAC;GACnC,UAAU,EAAE,KAAK,QAAQ,aACxB,MAAM,UACH,MAAM,QAAQ;IAAE;IAAK,QAAQ,UAAU;IAAO;IAAQ,GAAG,qBAAqB,UAAU;GAAE,CAAC,IAC3F,cAAc;IAAE;IAAK;IAAQ;GAAO,CAAC;GACzC,aAAa,EAAE,mBACd,MAAM,aAAa;IAAE;IAAc,GAAG,qBAAqB,UAAU;GAAE,CAAC;GACzE,SAAS,EAAE,eAAsC,MAAM,SAAS;IAAE;IAAU,GAAG,qBAAqB,UAAU;GAAE,CAAC;EAAC,CAAA,CAGpH,CAAA,CAGH;CACF;AACD,CAAC"}
|
|
@@ -56,8 +56,8 @@ const tableUtil = {
|
|
|
56
56
|
const property = condition.enField;
|
|
57
57
|
const order = condition.mode;
|
|
58
58
|
if (!property) continue;
|
|
59
|
-
const aValue = a
|
|
60
|
-
const bValue = b
|
|
59
|
+
const aValue = this.handleRowAccordingToProp(a, property);
|
|
60
|
+
const bValue = this.handleRowAccordingToProp(b, property);
|
|
61
61
|
if (typeof aValue === "string" && typeof bValue === "string") {
|
|
62
62
|
if (order === "ascending") {
|
|
63
63
|
const comparison = aValue.localeCompare(bValue, "zh-CN");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.mjs","names":[],"sources":["../../../../src/components/table/utils/table.ts"],"sourcesContent":["import type { PagedSortInput } from \"../src/page.type\";\nimport type { DefaultRow } from \"../src/table.state\";\nimport type { FaTableColumnCtx, FaTableEnumColumnCtx, FaTableEnumColumnType } from \"../src/table.type\";\n\n/**\n * 表格工具类\n */\nexport const tableUtil = {\n\t/**\n\t * 处理无数据情况\n\t * @param {String} callValue 需要处理的值\n\t */\n\tformatValue(callValue: unknown): unknown {\n\t\t// 如果当前值为数组,使用 / 拼接(根据需求自定义)\n\t\tif (Array.isArray(callValue)) return callValue.length ? callValue.join(` , `) : null;\n\t\treturn callValue;\n\t},\n\t/**\n\t * 处理 prop 为多级嵌套的情况(列如: prop:user.name)\n\t * @param {Object} row 当前行数据\n\t * @param {String} prop 当前 prop\n\t */\n\thandleRowAccordingToProp(row: DefaultRow, prop: string): unknown {\n\t\tlet value: unknown = row;\n\t\tfor (const item of prop.split(\".\")) {\n\t\t\tif (typeof value !== \"object\" || value === null) return undefined;\n\t\t\tvalue = (value as Record<string, unknown>)[item];\n\t\t}\n\t\treturn value;\n\t},\n\t/**\n\t * 处理 prop,当 prop 为多级嵌套时 ==> 返回最后一级 prop\n\t * @param {String} prop 当前 prop\n\t */\n\thandleProp(prop: string): string {\n\t\tconst propArr = prop.split(\".\");\n\t\tif (propArr.length === 1) return prop;\n\t\treturn propArr.at(-1) ?? prop;\n\t},\n\t/**\n\t * 根据枚举列表查询当需要的数据(如果指定了 label 和 value 的 key值,会自动识别格式化)\n\t * @param {String} callValue 当前单元格值\n\t * @param {Array} enumData 字典列表\n\t * @param {Array} fieldNames 指定 label && value 的 key 值\n\t * @param {String} type 过滤类型(目前只有 tag)\n\t */\n\tfilterEnum(callValue: unknown, enumData: FaTableEnumColumnCtx[], fieldNames?: { label: string; value: string }, type?: \"tag\"): unknown {\n\t\tconst value = fieldNames?.value ?? \"value\";\n\t\tconst label = fieldNames?.label ?? \"label\";\n\t\tconst filterData = enumData.find((item) => item[value] === callValue);\n\t\tif (type === \"tag\") {\n\t\t\treturn filterData?.type ?? \"info\";\n\t\t}\n\t\treturn filterData ? filterData[label] : null;\n\t},\n\t/**\n\t * 数组动态排序\n\t */\n\tarrayDynamicSort(sortList: PagedSortInput[]): (a: DefaultRow, b: DefaultRow) => number {\n\t\treturn (a, b) => {\n\t\t\tif (sortList.length > 0) {\n\t\t\t\tfor (const condition of sortList) {\n\t\t\t\t\tconst property = condition.enField;\n\t\t\t\t\tconst order = condition.mode;\n\t\t\t\t\tif (!property) continue;\n\n\t\t\t\t\tconst aValue
|
|
1
|
+
{"version":3,"file":"table.mjs","names":[],"sources":["../../../../src/components/table/utils/table.ts"],"sourcesContent":["import type { PagedSortInput } from \"../src/page.type\";\nimport type { DefaultRow } from \"../src/table.state\";\nimport type { FaTableColumnCtx, FaTableEnumColumnCtx, FaTableEnumColumnType } from \"../src/table.type\";\n\n/**\n * 表格工具类\n */\nexport const tableUtil = {\n\t/**\n\t * 处理无数据情况\n\t * @param {String} callValue 需要处理的值\n\t */\n\tformatValue(callValue: unknown): unknown {\n\t\t// 如果当前值为数组,使用 / 拼接(根据需求自定义)\n\t\tif (Array.isArray(callValue)) return callValue.length ? callValue.join(` , `) : null;\n\t\treturn callValue;\n\t},\n\t/**\n\t * 处理 prop 为多级嵌套的情况(列如: prop:user.name)\n\t * @param {Object} row 当前行数据\n\t * @param {String} prop 当前 prop\n\t */\n\thandleRowAccordingToProp(row: DefaultRow, prop: string): unknown {\n\t\tlet value: unknown = row;\n\t\tfor (const item of prop.split(\".\")) {\n\t\t\tif (typeof value !== \"object\" || value === null) return undefined;\n\t\t\tvalue = (value as Record<string, unknown>)[item];\n\t\t}\n\t\treturn value;\n\t},\n\t/**\n\t * 处理 prop,当 prop 为多级嵌套时 ==> 返回最后一级 prop\n\t * @param {String} prop 当前 prop\n\t */\n\thandleProp(prop: string): string {\n\t\tconst propArr = prop.split(\".\");\n\t\tif (propArr.length === 1) return prop;\n\t\treturn propArr.at(-1) ?? prop;\n\t},\n\t/**\n\t * 根据枚举列表查询当需要的数据(如果指定了 label 和 value 的 key值,会自动识别格式化)\n\t * @param {String} callValue 当前单元格值\n\t * @param {Array} enumData 字典列表\n\t * @param {Array} fieldNames 指定 label && value 的 key 值\n\t * @param {String} type 过滤类型(目前只有 tag)\n\t */\n\tfilterEnum(callValue: unknown, enumData: FaTableEnumColumnCtx[], fieldNames?: { label: string; value: string }, type?: \"tag\"): unknown {\n\t\tconst value = fieldNames?.value ?? \"value\";\n\t\tconst label = fieldNames?.label ?? \"label\";\n\t\tconst filterData = enumData.find((item) => item[value] === callValue);\n\t\tif (type === \"tag\") {\n\t\t\treturn filterData?.type ?? \"info\";\n\t\t}\n\t\treturn filterData ? filterData[label] : null;\n\t},\n\t/**\n\t * 数组动态排序\n\t */\n\tarrayDynamicSort(sortList: PagedSortInput[]): (a: DefaultRow, b: DefaultRow) => number {\n\t\treturn (a, b) => {\n\t\t\tif (sortList.length > 0) {\n\t\t\t\tfor (const condition of sortList) {\n\t\t\t\t\tconst property = condition.enField;\n\t\t\t\t\tconst order = condition.mode;\n\t\t\t\t\tif (!property) continue;\n\n\t\t\t\t\tconst aValue = this.handleRowAccordingToProp(a, property);\n\t\t\t\t\tconst bValue = this.handleRowAccordingToProp(b, property);\n\n\t\t\t\t\tif (typeof aValue === \"string\" && typeof bValue === \"string\") {\n\t\t\t\t\t\tif (order === \"ascending\") {\n\t\t\t\t\t\t\tconst comparison = aValue.localeCompare(bValue, \"zh-CN\");\n\t\t\t\t\t\t\tif (comparison !== 0) {\n\t\t\t\t\t\t\t\treturn comparison;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (order === \"descending\") {\n\t\t\t\t\t\t\tconst comparison = bValue.localeCompare(aValue, \"zh-CN\");\n\t\t\t\t\t\t\tif (comparison !== 0) {\n\t\t\t\t\t\t\t\treturn comparison;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (order === \"ascending\") {\n\t\t\t\t\t\t\tif ((aValue as string) < (bValue as string)) return -1;\n\t\t\t\t\t\t\tif ((aValue as string) > (bValue as string)) return 1;\n\t\t\t\t\t\t} else if (order === \"descending\") {\n\t\t\t\t\t\t\tif ((aValue as string) > (bValue as string)) return -1;\n\t\t\t\t\t\t\tif ((aValue as string) < (bValue as string)) return 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t};\n\t},\n\t/**\n\t * 设置枚举\n\t */\n\tsetEnumMap(columnEnum: FaTableEnumColumnType, prop: string, enumMap: Map<string, FaTableEnumColumnCtx[]>): void {\n\t\tif (!columnEnum) return;\n\t\tif (typeof columnEnum === \"function\") {\n\t\t\tenumMap.set(prop, columnEnum());\n\t\t} else if (Array.isArray(columnEnum)) {\n\t\t\tenumMap.set(prop, columnEnum);\n\t\t}\n\t},\n\t/**\n\t * 扁平化 columns\n\t */\n\tflatColumns(columns: FaTableColumnCtx[], enumMap?: Map<string, FaTableEnumColumnCtx[]>): FaTableColumnCtx[] {\n\t\tconst flatArr: FaTableColumnCtx[] = [];\n\t\tcolumns.forEach((col) => {\n\t\t\tif (col._children?.length) {\n\t\t\t\tflatArr.push(...this.flatColumns(col._children));\n\t\t\t}\n\n\t\t\tflatArr.push(col);\n\n\t\t\t// 给每一项 column 添加 show && filterEnum 默认属性\n\t\t\tcol.show ??= true;\n\t\t\tlet enumKey = col.prop ?? col.search?.key;\n\n\t\t\tif (col.enum && typeof col.enum === \"string\") {\n\t\t\t\tenumKey = col.enum;\n\t\t\t}\n\n\t\t\t// 设置 enumMap\n\t\t\tif (col.enum && enumKey && enumMap) this.setEnumMap(col.enum, enumKey, enumMap);\n\t\t});\n\t\treturn flatArr.filter((item) => !item._children?.length);\n\t},\n};\n"],"mappings":";;;;AAOA,MAAa,YAAY;;;;;CAKx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