erp-plus 1.0.167 → 1.0.168
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/dist/App.vue.d.ts +1 -0
- package/dist/erp-plus.css +1 -1
- package/dist/erp-plus.es.js +2657 -2279
- package/dist/erp-plus.umd.js +33 -33
- package/dist/packages/DictStatus/DictStatus.vue.d.ts +5 -0
- package/dist/packages/VirtualTable/VirtualTable.vue.d.ts +774 -0
- package/dist/packages/VirtualTable/buildColumns.d.ts +26 -0
- package/dist/packages/VirtualTable/index.d.ts +5 -0
- package/dist/packages/VirtualTable/tier.d.ts +14 -0
- package/dist/packages/VirtualTable/types.d.ts +50 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Column } from 'element-plus';
|
|
2
|
+
import { VtTableColumn } from './types';
|
|
3
|
+
type KeyType = string | number | symbol;
|
|
4
|
+
/** 渲染上下文:由 VirtualTable.vue 提供(函数引用,反应式读取发生在渲染期) */
|
|
5
|
+
export interface VtRenderContext {
|
|
6
|
+
isSelection: boolean;
|
|
7
|
+
emptyState: boolean;
|
|
8
|
+
showOverflowTooltip: boolean;
|
|
9
|
+
arraySeparator: string;
|
|
10
|
+
getRowKey: (row: any) => KeyType;
|
|
11
|
+
isSelected: (row: any) => boolean;
|
|
12
|
+
allCheckedIcon: () => string;
|
|
13
|
+
handleAllChecked: () => void;
|
|
14
|
+
handleChecked: (row: any) => void;
|
|
15
|
+
handleCheckedSingle: (row: any) => void;
|
|
16
|
+
getError: (rowKey: KeyType, prop: string) => string | undefined;
|
|
17
|
+
/** 错误/溢出气泡 z-index(弹窗层级计算见 VirtualTable.vue) */
|
|
18
|
+
tipZIndex: () => number;
|
|
19
|
+
getSlot: (name: string) => ((scope: any) => any) | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 业务列 → TableV2 列数组。
|
|
23
|
+
* 兜底:全是像素列且总宽不足容器时,最后一个非固定列 flexGrow=1(避免右侧留白)。
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildVtColumns(bizColumns: VtTableColumn[] | undefined, ctx: VtRenderContext, containerWidth: number): Column[];
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 运行时档位读取。
|
|
3
|
+
*
|
|
4
|
+
* 为什么不用 src/index.ts 的 getErpSize:packages 内部 import 根入口会形成
|
|
5
|
+
* 循环依赖(根入口 import.meta.glob 扫全部 packages),这里镜像同一套根类约定:
|
|
6
|
+
* 稍小档 = html.app-size-small 或 html.erp-size-small;否则默认档。
|
|
7
|
+
*
|
|
8
|
+
* 注意:档位切换约定是 setItem + reload(页面刷新生效),故 setup 期读一次即可,
|
|
9
|
+
* 不需要响应式。
|
|
10
|
+
*/
|
|
11
|
+
export type RuntimeTier = 'default' | 'small';
|
|
12
|
+
export declare function getRuntimeTier(): RuntimeTier;
|
|
13
|
+
/** 行高 / 表头高:默认档 40px(同 yw-table tier-default 的 .el-table__cell),稍小档 32px */
|
|
14
|
+
export declare const TIER_ROW_HEIGHT: Record<RuntimeTier, number>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YwVirtualTable 虚拟化表格 —— 业务列配置类型。
|
|
3
|
+
*
|
|
4
|
+
* 设计目标:API 尽量对齐 yw-table(columns 配置式 + slotName 插槽),
|
|
5
|
+
* 底层是 Element Plus TableV2(el-table-v2)。
|
|
6
|
+
* 差异点(相对 yw-table):
|
|
7
|
+
* - width 建议显式给(number 像素 / '20%' 百分比,百分比按容器宽换算);
|
|
8
|
+
* - 行高固定(默认档 40px / 稍小档 32px),不支持内容撑高;
|
|
9
|
+
* - 校验定位用 rowKey 而不是 rowIndex(虚拟滚动下 index 语义弱化)。
|
|
10
|
+
*/
|
|
11
|
+
/** 校验规则(与 yw-table 的 column.rules 同形) */
|
|
12
|
+
export type VtRule = {
|
|
13
|
+
required?: boolean;
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
pattern?: string;
|
|
17
|
+
/** (value, row, rowIndex) => true | 错误文案 */
|
|
18
|
+
validator?: (value: any, row: any, rowIndex: number) => boolean | string;
|
|
19
|
+
message?: string;
|
|
20
|
+
};
|
|
21
|
+
export interface VtTableColumn extends Record<string, any> {
|
|
22
|
+
label?: string;
|
|
23
|
+
prop?: string;
|
|
24
|
+
/** 列宽:像素 number 或百分比字符串('20%');不传默认 120 并参与弹性分配 */
|
|
25
|
+
width?: number | string;
|
|
26
|
+
/** 内容插槽名;插槽作用域 { row, column, $index }(与 yw-table 一致) */
|
|
27
|
+
slotName?: string;
|
|
28
|
+
/** 表头插槽名 */
|
|
29
|
+
slotHeaderName?: string;
|
|
30
|
+
align?: 'left' | 'center' | 'right';
|
|
31
|
+
/** 固定列方向(true 等价 left) */
|
|
32
|
+
fixed?: boolean | 'left' | 'right';
|
|
33
|
+
/** 内置列类型:勾选列 / 单选列 / 序号列 */
|
|
34
|
+
type?: 'checkbox' | 'radio' | 'index';
|
|
35
|
+
/** 表头点击排序(组件内部完成数据排序并 emit sort-change) */
|
|
36
|
+
sortable?: boolean;
|
|
37
|
+
visible?: boolean;
|
|
38
|
+
/** flex 增长权重;默认:百分比列 1,像素列 0 */
|
|
39
|
+
flexGrow?: number;
|
|
40
|
+
/** 单行省略 + 溢出 tooltip(默认跟随表格级开关) */
|
|
41
|
+
showOverflowTooltip?: boolean;
|
|
42
|
+
/** 编辑列必填校验 */
|
|
43
|
+
required?: boolean;
|
|
44
|
+
rules?: VtRule[];
|
|
45
|
+
/** 单元格值为数组时的连接符(默认跟随表格级,',') */
|
|
46
|
+
arraySeparator?: string;
|
|
47
|
+
arrayValueKey?: string;
|
|
48
|
+
valueKey?: string;
|
|
49
|
+
arrayFormatter?: (value: any, row: any, column: VtTableColumn) => string;
|
|
50
|
+
}
|