@jetlinks-web/components 3.3.12 → 3.3.14

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.
Files changed (103) hide show
  1. package/es/AutoComplete/AutoComplete.md +41 -0
  2. package/es/BadgeStatus/BadgeStatus.md +37 -0
  3. package/es/CardSelect/CardSelect.md +56 -0
  4. package/es/CardSelect/style/index.js +3 -3
  5. package/es/CheckButton/CheckButton.md +37 -0
  6. package/es/CheckButton/style/index.js +9 -9
  7. package/es/ConfigProvider/ConfigProvider.md +40 -0
  8. package/es/DragModal/DragModal.md +47 -0
  9. package/es/DragModal/style/index.js +6 -6
  10. package/es/EditTable/EditTable.md +62 -0
  11. package/es/EditTable/FormItem.js +18 -15
  12. package/es/EditTable/components/Search/sort.js +15 -1
  13. package/es/EditTable/style/body.js +8 -6
  14. package/es/EditTable/style/group.js +3 -3
  15. package/es/EditTable/style/header.js +3 -3
  16. package/es/EditTable/style/menu.js +3 -3
  17. package/es/EditTable/style/table.js +3 -3
  18. package/es/Ellipsis/Ellipsis.md +45 -0
  19. package/es/Empty/Empty.md +34 -0
  20. package/es/FullPage/FullPage.js +15 -5
  21. package/es/FullPage/FullPage.md +31 -0
  22. package/es/Icon/Icon.md +33 -0
  23. package/es/LocaleProvider/LocaleProvider.md +25 -0
  24. package/es/LocaleReciver/LocaleReciver.md +42 -0
  25. package/es/Markdown/Markdown.md +40 -0
  26. package/es/PermissionButton/PermissionButton.md +40 -0
  27. package/es/ProLayout/ProLayout.md +63 -0
  28. package/es/ProLayout/SiderMenu/style.js +105 -26
  29. package/es/ProLayout/TopHeader/style.js +55 -11
  30. package/es/ProTable/ProTable.js +2 -4
  31. package/es/ProTable/ProTable.md +70 -0
  32. package/es/ProTable/style/index.js +11 -8
  33. package/es/RadioButton/RadioButton.md +32 -0
  34. package/es/RadioButton/style/index.js +3 -2
  35. package/es/Scrollbar/Scrollbar.md +43 -0
  36. package/es/Scrollbar/style/index.js +9 -9
  37. package/es/Search/Search.md +60 -0
  38. package/es/Search/style/search.js +5 -5
  39. package/es/Skeleton/Skeleton.md +50 -0
  40. package/es/Skeleton/components/Page.js +18 -5
  41. package/es/Skeleton/style/index.js +12 -6
  42. package/es/TimeFormat/TimeFormat.md +25 -0
  43. package/es/Title/Title.md +33 -0
  44. package/es/Title/style/index.js +2 -2
  45. package/es/ValueItem/ValueItem.md +58 -0
  46. package/es/VirtualTable/VirtualTable.md +42 -0
  47. package/es/VirtualTable/style/index.js +7 -4
  48. package/es/components.md +108 -0
  49. package/es/style/scrollbar.js +24 -0
  50. package/es/style/styleRegister.js +45 -11
  51. package/es/style/variable.js +1 -4
  52. package/lib/AutoComplete/AutoComplete.md +41 -0
  53. package/lib/BadgeStatus/BadgeStatus.md +37 -0
  54. package/lib/CardSelect/CardSelect.md +56 -0
  55. package/lib/CardSelect/style/index.js +3 -3
  56. package/lib/CheckButton/CheckButton.md +37 -0
  57. package/lib/CheckButton/style/index.js +9 -9
  58. package/lib/ConfigProvider/ConfigProvider.md +40 -0
  59. package/lib/DragModal/DragModal.md +47 -0
  60. package/lib/DragModal/style/index.js +6 -6
  61. package/lib/EditTable/EditTable.md +62 -0
  62. package/lib/EditTable/FormItem.js +18 -15
  63. package/lib/EditTable/components/Search/sort.js +15 -1
  64. package/lib/EditTable/style/body.js +8 -6
  65. package/lib/EditTable/style/group.js +3 -3
  66. package/lib/EditTable/style/header.js +3 -3
  67. package/lib/EditTable/style/menu.js +3 -3
  68. package/lib/EditTable/style/table.js +3 -3
  69. package/lib/Ellipsis/Ellipsis.md +45 -0
  70. package/lib/Empty/Empty.md +34 -0
  71. package/lib/FullPage/FullPage.js +15 -5
  72. package/lib/FullPage/FullPage.md +31 -0
  73. package/lib/Icon/Icon.md +33 -0
  74. package/lib/LocaleProvider/LocaleProvider.md +25 -0
  75. package/lib/LocaleReciver/LocaleReciver.md +42 -0
  76. package/lib/Markdown/Markdown.md +40 -0
  77. package/lib/PermissionButton/PermissionButton.md +40 -0
  78. package/lib/ProLayout/ProLayout.md +63 -0
  79. package/lib/ProLayout/SiderMenu/style.js +104 -25
  80. package/lib/ProLayout/TopHeader/style.js +55 -11
  81. package/lib/ProTable/ProTable.js +2 -4
  82. package/lib/ProTable/ProTable.md +70 -0
  83. package/lib/ProTable/style/index.js +10 -7
  84. package/lib/RadioButton/RadioButton.md +32 -0
  85. package/lib/RadioButton/style/index.js +3 -2
  86. package/lib/Scrollbar/Scrollbar.md +43 -0
  87. package/lib/Scrollbar/style/index.js +8 -8
  88. package/lib/Search/Search.md +60 -0
  89. package/lib/Search/style/search.js +5 -5
  90. package/lib/Skeleton/Skeleton.md +50 -0
  91. package/lib/Skeleton/components/Page.js +18 -5
  92. package/lib/Skeleton/style/index.js +12 -6
  93. package/lib/TimeFormat/TimeFormat.md +25 -0
  94. package/lib/Title/Title.md +33 -0
  95. package/lib/Title/style/index.js +2 -2
  96. package/lib/ValueItem/ValueItem.md +58 -0
  97. package/lib/VirtualTable/VirtualTable.md +42 -0
  98. package/lib/VirtualTable/style/index.js +6 -3
  99. package/lib/components.md +108 -0
  100. package/lib/style/scrollbar.js +30 -0
  101. package/lib/style/styleRegister.js +44 -10
  102. package/lib/style/variable.js +1 -4
  103. package/package.json +1 -1
@@ -1,4 +1 @@
1
- export default {
2
- textColorTitle: '#000',
3
- textColorSubtitle: '#263237'
4
- };
1
+ export default {};
@@ -0,0 +1,41 @@
1
+ ### AutoComplete
2
+
3
+ 带搜索的输入选择组件,支持单选与多选(tags)两种模式;单选时可输入任意值并自动补全,未匹配的输入值会作为自定义选项回填。
4
+
5
+ #### Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | value | 当前值(可用 `v-model:value`) | `string \| string[]` | - |
10
+ | multiple | 多选模式,为 `true` 时渲染为 Select tags | `boolean` | `true` |
11
+ | searchKey | 选项匹配字段名,默认取 `options` 的 `label` 字段 | `string` | `'label'` |
12
+ | options | 候选项 | `DefaultOptionType[]` | `[]` |
13
+ | 其余 | 透传 ant-design-vue `Select` / `AutoComplete` 全部 props(`selectProps()`) | - | - |
14
+
15
+ #### 事件
16
+
17
+ | 事件 | 说明 | 回调参数 |
18
+ | --- | --- | --- |
19
+ | select | 选中选项时 | `(value, option)` |
20
+ | change | 值变化时 | `(value)` |
21
+ | update:value | 值变化(v-model) | `(value: string \| string[] \| undefined)` |
22
+
23
+ #### 用法
24
+
25
+ ```vue
26
+ <template>
27
+ <JAutoComplete
28
+ v-model:value="value"
29
+ :options="[{ label: '设备A', value: 'device-a' }]"
30
+ multiple
31
+ placeholder="输入或选择"
32
+ />
33
+ </template>
34
+ ```
35
+
36
+ #### Rules
37
+
38
+ - 单选模式下输入框中未命中任何选项的值,会在 `select` / `blur` 时自动追加为自定义选项。
39
+ - 匹配逻辑同时支持 `value` 与 `searchKey` 命中的字段(含 `label`),默认大小写敏感、去除首尾空格后比较。
40
+ - `multiple` 模式下使用 `Select` 的 `tags` 模式,选项与自定义值合并展示、按值去重。
41
+ - 其余 props(如 `placeholder`、`disabled`、`allowClear`)直接透传给底层组件,`allowClear` 默认开启。
@@ -0,0 +1,37 @@
1
+ ### BadgeStatus
2
+
3
+ 状态徽标组件,将业务状态值(如 `success` / `error` / 数字)映射为 Ant Design `Badge` 的颜色徽标。
4
+
5
+ #### Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | text | 徽标文本 | `string` | - |
10
+ | status | 状态值,作为 `statusNames` 的键 | `string \| number` | `'default'` |
11
+ | statusNames | 状态值 → 语义色映射表,支持自定义任意业务状态 | `Record<string, string>` | `{ success, warning, error, default }` |
12
+
13
+ #### 用法
14
+
15
+ ```vue
16
+ <template>
17
+ <JBadgeStatus :status="row.status" :text="row.statusText" />
18
+ </template>
19
+ ```
20
+
21
+ 自定义状态映射:
22
+
23
+ ```vue
24
+ <template>
25
+ <JBadgeStatus
26
+ status="1"
27
+ text="启用"
28
+ :status-names="{ 1: 'success', 0: 'error' }"
29
+ />
30
+ </template>
31
+ ```
32
+
33
+ #### Rules
34
+
35
+ - 颜色取自内置语义色板:`success`(绿) / `warning`(橙) / `error`(红) / `processing`(蓝) / `default`(灰),未命中的状态回退为 `default`。
36
+ - `statusNames` 中的值使用语义色名,组件内部通过 `getHexColor` 转为带透明度的 `rgba` 色(默认透明度 0.1)。
37
+ - `text` 为空时仅显示色点,不渲染文字。
@@ -0,0 +1,56 @@
1
+ ### CardSelect
2
+
3
+ 卡片式选择组件,以网格布局渲染一组卡片供单选或多选,可自定义卡片内容。
4
+
5
+ #### Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | value | 当前选中值,可用 `v-model:value` | `string \| string[]` | - |
10
+ | options | 选项列表 | `{ value, label, describe?, disabled? }[]` | `[]` |
11
+ | multiple | 是否多选 | `boolean` | `false` |
12
+ | disabled | 整体禁用 | `boolean` | `false` |
13
+ | column | 网格列数(仅 `layout="horizontal"` 生效) | `number` | `3` |
14
+ | layout | 布局方向:`horizontal` / `vertical` | `string` | `'horizontal'` |
15
+ | itemLayout | 卡片内部布局方向:`horizontal` / `vertical` | `string` | `'horizontal'` |
16
+
17
+ #### 事件
18
+
19
+ | 事件 | 说明 | 回调参数 |
20
+ | --- | --- | --- |
21
+ | select | 选中时 | `(value, node)`;多选时为 `(values: string[], nodes)` |
22
+ | change | 值变化时 | 同上 |
23
+ | update:value | 值变化(v-model) | `(value)` |
24
+
25
+ #### 插槽
26
+
27
+ | 名称 | 说明 | 作用域参数 |
28
+ | --- | --- | --- |
29
+ | itemRender | 自定义卡片内容 | `{ node }` 当前选项 |
30
+
31
+ #### 用法
32
+
33
+ ```vue
34
+ <template>
35
+ <JCardSelect
36
+ v-model:value="value"
37
+ :options="options"
38
+ :column="3"
39
+ multiple
40
+ />
41
+ </template>
42
+
43
+ <script setup lang="ts">
44
+ const options = [
45
+ { value: '1', label: '基础版', describe: '适合小规模接入' },
46
+ { value: '2', label: '专业版', describe: '适合中等规模接入' },
47
+ ]
48
+ </script>
49
+ ```
50
+
51
+ #### Rules
52
+
53
+ - 多选模式下通过 `multiple` 属性区分;单选时 `value` 为字符串,多选时为字符串数组。
54
+ - `vertical` 布局下 `column` 不生效(强制 1 列)。
55
+ - 选项项可单独设置 `disabled` 禁用,优先于全局 `disabled`。
56
+ - 选中变化会同步通知 Form 上下文(`Form.useInjectFormItemContext`),与表单校验联动。
@@ -15,8 +15,8 @@ var genCardSelectStyle = function genCardSelectStyle(config) {
15
15
  gap: '12px'
16
16
  }, "".concat(componentCls, "-item"), (0, _defineProperty2.default)({
17
17
  padding: '12px',
18
- border: '1px solid #e6e6e6',
19
- borderRadius: '@border-radius-base',
18
+ border: "".concat(token.lineWidth, "px solid ").concat(token.colorBorderSecondary),
19
+ borderRadius: token.borderRadius,
20
20
  cursor: 'pointer',
21
21
  '&.active': {
22
22
  borderColor: token.colorPrimary
@@ -26,7 +26,7 @@ var genCardSelectStyle = function genCardSelectStyle(config) {
26
26
  opacity: 0.7
27
27
  }
28
28
  }, "".concat(componentCls, "-describe"), {
29
- color: token.textColorSubtitle
29
+ color: token.colorTextDescription
30
30
  })));
31
31
  };
32
32
  var _default = exports.default = (0, _styleRegister.default)([genCardSelectStyle]);
@@ -0,0 +1,37 @@
1
+ ### CheckButton
2
+
3
+ 选择按钮组,以按钮形式呈现多选选项,可单独使用或与 `a-checkbox-group` 组合使用。
4
+
5
+ #### Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | multiple | 多选 | `boolean` | `false` |
10
+ | disabled | 失效状态 | `boolean` | `false` |
11
+ | value | 与 CheckboxGroup 组合使用时的值 | `boolean \| string \| number` | - |
12
+ | options | 选择项 | `{ label: string; value: string; disabled?: boolean }[]` | `[]` |
13
+ | class | 类名 | `string` | - |
14
+ | style | CSS 样式 | `CSSProperties` | `{}` |
15
+
16
+ #### 事件
17
+
18
+ | 事件 | 说明 | 回调参数 |
19
+ | --- | --- | --- |
20
+ | change | 变化时回调 | `(keys: string \| string[], nodes: any[])` |
21
+
22
+ #### 用法
23
+
24
+ ```vue
25
+ <template>
26
+ <JCheckButton
27
+ v-model:value="value"
28
+ :options="[{ label: '在线', value: 'online' }, { label: '离线', value: 'offline' }]"
29
+ />
30
+ </template>
31
+ ```
32
+
33
+ #### Rules
34
+
35
+ - `options` 中的每项可单独设置 `disabled`。
36
+ - `multiple` 决定单选还是多选,单选时 `change` 返回单个值。
37
+ - 该组件数据录入语义为"选择",与表单组件(CheckboxGroup)组合使用时通过 `value` 对接。
@@ -19,27 +19,27 @@ var genCheckButtonStyle = function genCheckButtonStyle(config) {
19
19
  minWidth: 0,
20
20
  padding: '8px',
21
21
  borderRadius: token.borderRadius,
22
- backgroundColor: '#f2f3f5',
22
+ backgroundColor: token.colorFillTertiary,
23
23
  transition: 'all 0.3s',
24
- color: '#333',
24
+ color: token.colorText,
25
25
  textAlign: 'center',
26
26
  cursor: 'pointer',
27
27
  '&:hover': {
28
- backgroundColor: token.colorPrimary,
28
+ backgroundColor: token.colorPrimaryHover,
29
29
  opacity: 0.85,
30
- color: '#fff'
30
+ color: token.colorTextLightSolid
31
31
  },
32
32
  '&.selected': {
33
33
  backgroundColor: token.colorPrimary,
34
- color: '#fff'
34
+ color: token.colorTextLightSolid
35
35
  },
36
36
  '&.disabled': {
37
- backgroundColor: '#f5f5f5',
38
- color: '#ccc',
37
+ backgroundColor: token.colorBgContainerDisabled,
38
+ color: token.colorTextDisabled,
39
39
  cursor: 'not-allowed',
40
40
  '&:hover': {
41
- backgroundColor: '#f5f5f5',
42
- color: '#ccc',
41
+ backgroundColor: token.colorBgContainerDisabled,
42
+ color: token.colorTextDisabled,
43
43
  opacity: 1
44
44
  }
45
45
  }
@@ -0,0 +1,40 @@
1
+ ### ConfigProvider
2
+
3
+ 全局配置 Provider,为 JetLinks 组件体系提供统一的应用级配置与国际化上下文,同时透传 ant-design-vue `ConfigProvider` 的能力。
4
+
5
+ #### Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | IconConfig | 全局 Icon 配置(如 iconfont `scriptUrl`) | `object` | `{}` |
10
+ | MapConfig | 全局地图配置 | `object` | `{}` |
11
+ | SearchConfig | 全局搜索组件配置 | `object` | `{}` |
12
+ | PermissionButtonConfig | 全局权限按钮配置(如自定义 `components`) | `object` | `{}` |
13
+ | FullPageConfig | 全屏页面容器配置(如 `reduceHeight`) | `object` | `{}` |
14
+ | TableConfig | ProTable 全局配置 | `object` | `{}` |
15
+ | componentsLocale | 组件文案语言包 | `object` | 内置 `zh-CN` |
16
+ | 其余 | 透传 ant-design-vue `ConfigProvider` props(如 `locale`、`theme`) | - | - |
17
+
18
+ #### 插槽
19
+
20
+ | 名称 | 说明 |
21
+ | --- | --- |
22
+ | default | 应用内容 |
23
+ | renderEmpty | 自定义全局空状态渲染(默认使用 `JEmpty`) |
24
+
25
+ #### 用法
26
+
27
+ ```vue
28
+ <template>
29
+ <JConfigProvider :locale="zhCN" :theme="{ token: { colorPrimary: '#1677ff' } }">
30
+ <router-view />
31
+ </JConfigProvider>
32
+ </template>
33
+ ```
34
+
35
+ #### Rules
36
+
37
+ - 通过 Vue `provide` 注入以下配置,供全组件体系消费:Icon / Map / Search / PermissionButton / FullPage / ProTable(Table)。
38
+ - 空状态统一由内置 `JEmpty` 兜底,可通过 `renderEmpty` 插槽覆盖。
39
+ - 内部自动包装 `JLocaleProvider`,`componentsLocale` 缺省使用内置中文语言包。
40
+ - 兼容 `ConfigProvider.config()` 静态方法(如 `Message` 主题配置)。
@@ -0,0 +1,47 @@
1
+ ### DragModal
2
+
3
+ 可拖拽、可缩放的模态弹窗,替代固定尺寸弹窗用于需要调整视口的场景;支持右下角手柄缩放、标题栏拖拽。
4
+
5
+ #### Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | title | 标题;传 `false` 隐藏标题栏 | `string \| boolean` | `''` |
10
+ | width | 初始宽度(px) | `number` | `400` |
11
+ | height | 初始高度(px) | `number` | `100` |
12
+ | dragRang | 最小缩放尺寸 `[最小宽, 最小高]`(px) | `number[] \| number` | `[400, 200]` |
13
+ | bodyStyle | 内容区自定义样式 | `object` | `{}` |
14
+ | footer | 是否显示底部按钮区;传 `false` 隐藏 | `boolean` | `true` |
15
+
16
+ #### 事件
17
+
18
+ | 事件 | 说明 | 回调参数 |
19
+ | --- | --- | --- |
20
+ | cancel | 点击取消 / 关闭按钮 | - |
21
+ | ok | 点击确认按钮 | - |
22
+ | visibleChange | 可见状态变化 | `(visible: boolean)` |
23
+ | heightChange | 拖动改变高度时 | `(height: number)` |
24
+
25
+ #### 插槽
26
+
27
+ | 名称 | 说明 |
28
+ | --- | --- |
29
+ | default | 弹窗内容 |
30
+ | footer | 自定义底部按钮区 |
31
+
32
+ #### 用法
33
+
34
+ ```vue
35
+ <template>
36
+ <JDragModal v-model:visible="visible" title="高级筛选" :width="640" :drag-rang="[400, 200]">
37
+ <div>弹窗内容</div>
38
+ </JDragModal>
39
+ </template>
40
+ ```
41
+
42
+ #### Rules
43
+
44
+ - 挂载时自动居中于视口;默认位置 `(right - width) / 2, top + 200`。
45
+ - 拖拽/缩放边界以 `dragRang` 为最小宽高,无法缩小到更小。
46
+ - 高度变化通过 `heightChange` 事件实时上报,便于外部记录位置。
47
+ - 底部默认渲染"取消 / 确认"按钮,文案随 `LocaleProvider` 国际化;关闭与取消均触发 `cancel` + `visibleChange(false)`。
@@ -21,19 +21,19 @@ var genDragModalStyle = function genDragModalStyle(config) {
21
21
  flexDirection: 'column',
22
22
  overflow: 'hidden',
23
23
  zIndex: 23456765435,
24
- backgroundColor: '#ffffff',
24
+ backgroundColor: token.colorBgElevated,
25
25
  borderRadius: 4,
26
- border: '1px solid #91CAFF',
27
- boxShadow: '0 3px 8px 0 rgba(22, 119, 255, 0.24)',
26
+ border: "".concat(token.lineWidth, "px solid ").concat(token.colorPrimaryBorder),
27
+ boxShadow: token.boxShadowSecondary,
28
28
  header: {
29
29
  padding: '5px 15px',
30
30
  fontSize: 18,
31
31
  fontWeight: 700,
32
- color: '#333',
32
+ color: token.colorTextHeading,
33
33
  display: 'flex',
34
34
  justifyContent: 'space-between',
35
35
  alignItems: 'center',
36
- borderBottom: '1px solid #f0f0f0',
36
+ borderBottom: "".concat(token.lineWidth, "px solid ").concat(token.colorSplit),
37
37
  cursor: 'move'
38
38
  }
39
39
  }, "".concat(componentCls, "-body"), {
@@ -42,7 +42,7 @@ var genDragModalStyle = function genDragModalStyle(config) {
42
42
  overflowY: 'auto',
43
43
  padding: '24px 20px'
44
44
  }), "".concat(componentCls, "-footer"), {
45
- borderTop: '1px solid #f0f0f0',
45
+ borderTop: "".concat(token.lineWidth, "px solid ").concat(token.colorSplit),
46
46
  padding: '5px 15px'
47
47
  })), "".concat(componentCls, "-range"), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
48
48
  position: 'absolute',
@@ -0,0 +1,62 @@
1
+ ### EditTable
2
+
3
+ 可编辑表格组件,基于虚拟滚动大表(VirtualTable)实现单元格编辑、校验、分组、行内表单、右键菜单与全屏切换,适合大数据的参数/明细录入场景。
4
+
5
+ #### Props
6
+
7
+ | 参数 | 说明 | 类型 | 默认值 |
8
+ | --- | --- | --- | --- |
9
+ | columns | 列配置(ant-design-vue Table columns,支持编辑列) | `array` | `[]` |
10
+ | dataSource | 数据数组 | `array` | `[]` |
11
+ | rowKey | 行主键字段 | `string` | `'id'` |
12
+ | height | 表格高度(px) | `number` | `300` |
13
+ | cellHeight | 行高(px),虚拟滚动按此计算 | `number` | `65` |
14
+ | readonly | 只读模式,内容区覆盖遮罩禁止编辑 | `boolean` | `false` |
15
+ | serial | 序号列配置,`false` 关闭 | `object \| boolean` | `{ width: 70, title: '' }` |
16
+ | searchColumns | 搜索列配置(如 `[{ title: '标识', dataIndex: 'id' }]`) | `array` | 内置 `id` / `name` 两列 |
17
+ | openGroup | 开启分组(表头分组条) | `boolean` | `false` |
18
+ | rowSelection | 行选择配置 | `object` | - |
19
+ | validateRowKey | 是否按行校验 | `boolean` | `false` |
20
+ | disableMenu | 禁用右键菜单 | `boolean` | `true` |
21
+ | 其余 | 透传 ant-design-vue `Table` props(`tableProps()`) | - | - |
22
+
23
+ #### 事件
24
+
25
+ | 事件 | 说明 | 回调参数 |
26
+ | --- | --- | --- |
27
+ | editChange | 单元格编辑变化 | - |
28
+ | scrollDown | 滚动到底部 | - |
29
+ | rightMenuClick | 右键菜单点击 | - |
30
+ | searchVisibleChange | 搜索可见性变化 | - |
31
+ | groupDelete / groupEdit | 分组删除 / 编辑 | - |
32
+
33
+ #### 插槽
34
+
35
+ | 名称 | 说明 | 作用域参数 |
36
+ | --- | --- | --- |
37
+ | extra | 工具栏扩展区 | `{ isFullscreen, fullScreenToggle }` |
38
+ | bodyExtra | 表格主体底部扩展 | - |
39
+ | `#列dataIndex` | 按列自定义单元格渲染 | `{ column, record, index, visibleIndex }` |
40
+ | 其他插槽 | 透传给内部 VirtualTable | - |
41
+
42
+ #### 用法
43
+
44
+ ```vue
45
+ <template>
46
+ <JEditTable
47
+ v-model:dataSource="dataSource"
48
+ :columns="columns"
49
+ :height="400"
50
+ :open-group="true"
51
+ @editChange="onEditChange"
52
+ />
53
+ </template>
54
+ ```
55
+
56
+ #### Rules
57
+
58
+ - 编辑字段通过 `FormItem` 注册(与 `JEditTable` 同步安装),单元格渲染约定见 `CellRender.vue`。
59
+ - 校验错误按行/分组聚合,`fieldsErrMap` / `fieldsGroupError` 驱动行高亮与提示。
60
+ - 大数据量下基于虚拟滚动(`virtual.itemHeight = cellHeight`,`threshold = height / cellHeight`),请勿关闭。
61
+ - 分组功能需在 `openGroup` 时配合 `rowSelection` 使用,分组操作会同步更新 `dataSource` 的分组标记。
62
+ - 全屏切换通过工具栏 `extra` 插槽暴露的 `fullScreenToggle` 触发,全屏态表格占满可视区。
@@ -30,6 +30,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
30
30
  "Schema": "setup-maybe-ref",
31
31
  "useInjectError": "setup-maybe-ref",
32
32
  "useInjectForm": "setup-maybe-ref",
33
+ "useTableWrapper": "setup-maybe-ref",
33
34
  "TABLE_FORM_ITEM_ERROR": "setup-maybe-ref",
34
35
  "genEditTableStyle": "setup-maybe-ref",
35
36
  "fieldPool": "setup-maybe-ref",
@@ -41,6 +42,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
41
42
  "visible": "setup-ref",
42
43
  "context": "setup-maybe-ref",
43
44
  "globalErrorMessage": "setup-maybe-ref",
45
+ "tableWrapperRef": "setup-maybe-ref",
44
46
  "hideTimer": "setup-let",
45
47
  "cachedSchema": "setup-let",
46
48
  "cachedRulesHash": "setup-let",
@@ -76,7 +78,7 @@ import { onBeforeUnmount, computed, shallowReactive, watch, provide, toRaw, onMo
76
78
  import { get, isArray } from 'lodash-es';
77
79
  import { useProvideFormItemContext } from 'ant-design-vue/lib/form/FormItemContext';
78
80
  import Schema from 'async-validator';
79
- import { useInjectError, useInjectForm } from "./hooks";
81
+ import { useInjectError, useInjectForm, useTableWrapper } from "./hooks";
80
82
  import { TABLE_FORM_ITEM_ERROR } from "./consts";
81
83
  import genEditTableStyle from './style';
82
84
  import { fieldPool } from './fieldPool';
@@ -98,6 +100,7 @@ const __sfc_main__ = _defineComponent({
98
100
  const visible = ref(false);
99
101
  const context = useInjectForm();
100
102
  const globalErrorMessage = useInjectError();
103
+ const tableWrapperRef = useTableWrapper();
101
104
  let hideTimer = null;
102
105
  // 缓存 Schema 实例,避免重复创建
103
106
  let cachedSchema = null;
@@ -145,7 +148,7 @@ const __sfc_main__ = _defineComponent({
145
148
  });
146
149
  // 向下提供错误状态
147
150
  provide(TABLE_FORM_ITEM_ERROR, errorState);
148
- const popContainer = (e) => e;
151
+ const popContainer = (e) => _optionalChain([tableWrapperRef, 'optionalAccess', _4 => _4.value]) || e.parentElement || document.body;
149
152
  const removeTimer = () => {
150
153
  if (hideTimer) {
151
154
  clearTimeout(hideTimer);
@@ -171,7 +174,7 @@ const __sfc_main__ = _defineComponent({
171
174
  return props.rules;
172
175
  }
173
176
  // 从 context 中获取规则
174
- if (_optionalChain([context, 'access', _4 => _4.rules, 'optionalAccess', _5 => _5.value]) && fieldName.value) {
177
+ if (_optionalChain([context, 'access', _5 => _5.rules, 'optionalAccess', _6 => _6.value]) && fieldName.value) {
175
178
  const rules = context.rules.value[fieldName.value];
176
179
  if (Array.isArray(rules)) {
177
180
  return rules;
@@ -210,7 +213,7 @@ const __sfc_main__ = _defineComponent({
210
213
  const schema = getSchema();
211
214
  if (!schema) {
212
215
  hideErrorTip();
213
- _optionalChain([context, 'access', _6 => _6.removeFieldError, 'optionalCall', _7 => _7(eventKey.value)]);
216
+ _optionalChain([context, 'access', _7 => _7.removeFieldError, 'optionalCall', _8 => _8(eventKey.value)]);
214
217
  resolve();
215
218
  return;
216
219
  }
@@ -221,12 +224,12 @@ const __sfc_main__ = _defineComponent({
221
224
  if (errors && errors.length > 0) {
222
225
  const errorMsg = errors[0].message || '校验失败';
223
226
  showErrorTip(errorMsg);
224
- _optionalChain([context, 'access', _8 => _8.addFieldError, 'optionalCall', _9 => _9(eventKey.value, errorMsg)]);
227
+ _optionalChain([context, 'access', _9 => _9.addFieldError, 'optionalCall', _10 => _10(eventKey.value, errorMsg)]);
225
228
  reject(errors);
226
229
  }
227
230
  else {
228
231
  hideErrorTip();
229
- _optionalChain([context, 'access', _10 => _10.removeFieldError, 'optionalCall', _11 => _11(eventKey.value)]);
232
+ _optionalChain([context, 'access', _11 => _11.removeFieldError, 'optionalCall', _12 => _12(eventKey.value)]);
230
233
  resolve();
231
234
  }
232
235
  });
@@ -239,18 +242,18 @@ const __sfc_main__ = _defineComponent({
239
242
  const promise = context.validateItem({ [fieldName.value]: fieldValue.value }, rowIndex.value);
240
243
  promise.then(() => {
241
244
  hideErrorTip();
242
- _optionalChain([context, 'access', _12 => _12.removeFieldError, 'optionalCall', _13 => _13(eventKey.value)]);
245
+ _optionalChain([context, 'access', _13 => _13.removeFieldError, 'optionalCall', _14 => _14(eventKey.value)]);
243
246
  }).catch((res) => {
244
- const error = _optionalChain([res, 'optionalAccess', _14 => _14.filter, 'call', _15 => _15((item) => item.field === fieldName.value)]) || [];
247
+ const error = _optionalChain([res, 'optionalAccess', _15 => _15.filter, 'call', _16 => _16((item) => item.field === fieldName.value)]) || [];
245
248
  if (error.length === 0) {
246
249
  hideErrorTip();
247
- _optionalChain([context, 'access', _16 => _16.removeFieldError, 'optionalCall', _17 => _17(eventKey.value)]);
250
+ _optionalChain([context, 'access', _17 => _17.removeFieldError, 'optionalCall', _18 => _18(eventKey.value)]);
248
251
  }
249
252
  else {
250
253
  removeTimer();
251
- errorState.message = _optionalChain([error, 'access', _18 => _18[0], 'optionalAccess', _19 => _19.message]) || errorState.message;
254
+ errorState.message = _optionalChain([error, 'access', _19 => _19[0], 'optionalAccess', _20 => _20.message]) || errorState.message;
252
255
  errorState.visible = !!error.length;
253
- _optionalChain([context, 'access', _20 => _20.addFieldError, 'optionalCall', _21 => _21(eventKey.value, errorState.message)]);
256
+ _optionalChain([context, 'access', _21 => _21.addFieldError, 'optionalCall', _22 => _22(eventKey.value, errorState.message)]);
254
257
  }
255
258
  });
256
259
  return promise;
@@ -272,7 +275,7 @@ const __sfc_main__ = _defineComponent({
272
275
  }, { immediate: true });
273
276
  watch(() => {
274
277
  const key = currentEventKey.value;
275
- return key ? _optionalChain([globalErrorMessage, 'optionalAccess', _22 => _22.value, 'optionalAccess', _23 => _23[key]]) : undefined;
278
+ return key ? _optionalChain([globalErrorMessage, 'optionalAccess', _23 => _23.value, 'optionalAccess', _24 => _24[key]]) : undefined;
276
279
  }, (errorMsg) => {
277
280
  if (errorMsg) {
278
281
  showErrorTip(errorMsg);
@@ -294,7 +297,7 @@ const __sfc_main__ = _defineComponent({
294
297
  onFieldChange,
295
298
  onFieldBlur,
296
299
  }, computed(() => {
297
- return get(_optionalChain([context, 'access', _24 => _24.dataSource, 'optionalAccess', _25 => _25.value]), props.name);
300
+ return get(_optionalChain([context, 'access', _25 => _25.dataSource, 'optionalAccess', _26 => _26.value]), props.name);
298
301
  }));
299
302
  // 注册字段到父组件 - 使用字段池复用
300
303
  let isRegistered = false;
@@ -307,7 +310,7 @@ const __sfc_main__ = _defineComponent({
307
310
  validateRules,
308
311
  showErrorTip
309
312
  });
310
- _optionalChain([context, 'access', _26 => _26.addField, 'optionalCall', _27 => _27(eventKey.value, fieldInfo)]);
313
+ _optionalChain([context, 'access', _27 => _27.addField, 'optionalCall', _28 => _28(eventKey.value, fieldInfo)]);
311
314
  isRegistered = true;
312
315
  }
313
316
  };
@@ -318,7 +321,7 @@ const __sfc_main__ = _defineComponent({
318
321
  onBeforeUnmount(() => {
319
322
  removeTimer();
320
323
  if (isRegistered) {
321
- _optionalChain([context, 'access', _28 => _28.removeField, 'optionalCall', _29 => _29(eventKey.value)]);
324
+ _optionalChain([context, 'access', _29 => _29.removeField, 'optionalCall', _30 => _30(eventKey.value)]);
322
325
  fieldPool.release(eventKey.value);
323
326
  isRegistered = false;
324
327
  }
@@ -22,16 +22,21 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
22
22
  "active": "props",
23
23
  "useTableTool": "setup-maybe-ref",
24
24
  "useTableWrapper": "setup-maybe-ref",
25
+ "computed": "setup-const",
25
26
  "ref": "setup-const",
26
27
  "reactive": "setup-const",
28
+ "theme": "setup-maybe-ref",
27
29
  "useLocaleReceiver": "setup-maybe-ref",
28
30
  "props": "setup-reactive-const",
29
31
  "emit": "setup-const",
30
32
  "contextLocale": "setup-maybe-ref",
31
33
  "tableWrapperRef": "setup-maybe-ref",
32
34
  "tableTool": "setup-maybe-ref",
35
+ "token": "setup-maybe-ref",
33
36
  "visible": "setup-ref",
34
37
  "mySelectedRowKeys": "setup-ref",
38
+ "sortIconColor": "setup-ref",
39
+ "sortIconActiveColor": "setup-ref",
35
40
  "columns": "setup-reactive-const",
36
41
  "visibleChange": "setup-const",
37
42
  "onSelectChange": "setup-const",
@@ -40,13 +45,15 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
40
45
  "onAsc": "setup-const",
41
46
  "onDesc": "setup-const"
42
47
  } */
48
+ import { useCssVars as _useCssVars } from 'vue';
43
49
  import { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, normalizeClass as _normalizeClass } from "vue";
44
50
  const _hoisted_1 = { class: "jetlinks-table-sort-content" };
45
51
  const _hoisted_2 = { class: "jetlinks-table-sort-title" };
46
52
  const _hoisted_3 = { class: "table-sort-body" };
47
53
  const _hoisted_4 = { class: "jetlinks-table-sort-footer" };
48
54
  import { useTableTool, useTableWrapper } from "../../context";
49
- import { ref, reactive } from 'vue';
55
+ import { computed, ref, reactive } from 'vue';
56
+ import { theme } from 'ant-design-vue';
50
57
  import { useLocaleReceiver } from "../../../LocaleReciver";
51
58
  const __sfc_main__ = Object.assign({
52
59
  name: 'JEditTableSearchSort'
@@ -75,14 +82,21 @@ const __sfc_main__ = Object.assign({
75
82
  },
76
83
  emits: ['click'],
77
84
  setup(__props, { emit: __emit }) {
85
+ _useCssVars(_ctx => ({
86
+ "1787918239757-sortIconColor": (sortIconColor.value),
87
+ "1787918239757-sortIconActiveColor": (sortIconActiveColor.value)
88
+ }));
78
89
  const props = __props;
79
90
  const emit = __emit;
80
91
  const [contextLocale] = useLocaleReceiver('EditTable');
81
92
  const tableWrapperRef = useTableWrapper();
82
93
  const tableTool = useTableTool();
94
+ const { token } = theme.useToken();
83
95
  const visible = ref(false);
84
96
  const dataSource = ref([]);
85
97
  const mySelectedRowKeys = ref([]);
98
+ const sortIconColor = computed(() => token.value.colorTextDisabled);
99
+ const sortIconActiveColor = computed(() => token.value.colorPrimary);
86
100
  const columns = reactive([
87
101
  {
88
102
  dataIndex: 'name',