cnhis-design-vue 3.1.22-beta.0 → 3.1.22-beta.10

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 (105) hide show
  1. package/README.md +123 -123
  2. package/es/components/big-table/index.d.ts +8 -0
  3. package/es/components/big-table/index2.js +0 -2
  4. package/es/components/big-table/src/BigTable.vue.d.ts +8 -0
  5. package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +29 -36
  6. package/es/components/big-table/src/components/edit-form/edit-date.js +81 -10
  7. package/es/components/big-table/src/components/edit-form/edit-input.js +1 -0
  8. package/es/components/big-table/src/hooks/useEdit2.js +2 -2
  9. package/es/components/big-table/style/index.css +1 -1
  10. package/es/components/fabric-chart/index.d.ts +1 -0
  11. package/es/components/fabric-chart/src/FabricChart.js +3 -2
  12. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +1 -0
  13. package/es/components/fabric-chart/src/hooks/useCenter.d.ts +1 -0
  14. package/es/components/fabric-chart/src/hooks/useCenter2.js +15 -3
  15. package/es/components/fabric-chart/src/hooks/useLeft.d.ts +1 -1
  16. package/es/components/fabric-chart/src/hooks/useLeft2.js +7 -5
  17. package/es/components/fabric-chart/src/interface.d.ts +2 -0
  18. package/es/components/field-set/index.d.ts +4 -3
  19. package/es/components/field-set/src/FieldSet.js +9 -4
  20. package/es/components/field-set/src/FieldSet.vue.d.ts +4 -3
  21. package/es/components/form-render/src/components/renderer/cascader.js +10 -7
  22. package/es/components/form-render/src/components/renderer/combination.d.ts +7 -0
  23. package/es/components/form-render/src/components/renderer/combination.js +4 -1
  24. package/es/components/form-render/src/components/renderer/date.js +11 -4
  25. package/es/components/form-render/src/components/renderer/input.js +2 -2
  26. package/es/components/form-render/src/components/renderer/inputNumber.js +2 -2
  27. package/es/components/form-render/src/components/renderer/search.js +3 -3
  28. package/es/components/form-render/src/components/renderer/select.js +3 -3
  29. package/es/components/form-render/src/components/renderer/textarea.js +2 -2
  30. package/es/components/form-render/src/hooks/useCommonInjection2.js +6 -2
  31. package/es/components/form-render/src/utils/schema.d.ts +4 -1
  32. package/es/components/form-render/src/utils/schema.js +1 -1
  33. package/es/components/form-render/src/utils/schema2.js +9 -2
  34. package/es/components/grid/index2.js +0 -2
  35. package/es/components/iho-table/index.d.ts +4266 -337
  36. package/es/components/iho-table/index.js +1 -1
  37. package/es/components/iho-table/index2.js +9 -4
  38. package/es/components/iho-table/src/IhoTable.js +39 -13
  39. package/es/components/iho-table/src/IhoTable.vue.d.ts +4254 -326
  40. package/es/components/iho-table/src/components/IhoTableColumn.d.ts +2 -2
  41. package/es/components/iho-table/src/components/IhoTableColumn.js +25 -5
  42. package/es/components/iho-table/src/constants/index.d.ts +8 -1
  43. package/es/components/iho-table/src/constants/index.js +1 -1
  44. package/es/components/iho-table/src/constants/index2.js +79 -1
  45. package/es/components/iho-table/src/hooks/index.js +1 -1
  46. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +5 -0
  47. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  48. package/es/components/iho-table/src/hooks/tapHooks/index2.js +71 -24
  49. package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +14 -0
  50. package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks2.js +39 -1
  51. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +61 -60
  52. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks2.js +62 -60
  53. package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.d.ts +4 -1
  54. package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks2.js +4 -1
  55. package/es/components/iho-table/src/hooks/useTablePlugin.d.ts +2 -2
  56. package/es/components/iho-table/src/hooks/useTablePlugin2.js +2 -3
  57. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index2.js +3 -2
  58. package/es/components/iho-table/src/plugins/index.d.ts +1 -0
  59. package/es/components/iho-table/src/plugins/index.js +8 -5
  60. package/es/components/iho-table/src/plugins/index2.js +8 -5
  61. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +10 -4
  62. package/es/components/iho-table/src/plugins/rendererPlugins/index.d.ts +2 -5
  63. package/es/components/iho-table/src/plugins/rendererPlugins/index.js +7 -5
  64. package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.d.ts +1 -0
  65. package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.js +1 -0
  66. package/es/components/iho-table/src/plugins/rendererPlugins/inputs/inputRendererPlugins.d.ts +1 -0
  67. package/es/components/iho-table/src/plugins/rendererPlugins/inputs/inputRendererPlugins.js +49 -0
  68. package/es/components/iho-table/src/plugins/rendererPlugins/{checkRendererPlugin.d.ts → widgets/checkRendererPlugin.d.ts} +1 -1
  69. package/es/components/iho-table/src/plugins/rendererPlugins/{checkRendererPlugin.js → widgets/checkRendererPlugin.js} +2 -2
  70. package/es/components/iho-table/src/plugins/rendererPlugins/{colorRendererPlugin.d.ts → widgets/colorRendererPlugin.d.ts} +1 -1
  71. package/es/components/iho-table/src/plugins/rendererPlugins/{colorRendererPlugin.js → widgets/colorRendererPlugin.js} +6 -8
  72. package/es/components/iho-table/src/plugins/rendererPlugins/{defaultRendererPlugin.d.ts → widgets/defaultRendererPlugin.d.ts} +1 -1
  73. package/es/components/iho-table/src/plugins/rendererPlugins/{defaultRendererPlugin.js → widgets/defaultRendererPlugin.js} +4 -4
  74. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/index.d.ts +6 -0
  75. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/index.js +6 -0
  76. package/es/components/iho-table/src/plugins/rendererPlugins/{labelRendererPlugin.d.ts → widgets/labelRendererPlugin.d.ts} +1 -1
  77. package/es/components/iho-table/src/plugins/rendererPlugins/{labelRendererPlugin.js → widgets/labelRendererPlugin.js} +3 -3
  78. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.d.ts +2 -0
  79. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +89 -0
  80. package/es/components/iho-table/src/plugins/rendererPlugins/{seqRendererPlugin.d.ts → widgets/seqRendererPlugin.d.ts} +1 -1
  81. package/es/components/iho-table/src/plugins/rendererPlugins/{seqRendererPlugin.js → widgets/seqRendererPlugin.js} +3 -3
  82. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index.d.ts +1 -0
  83. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index.js +1 -0
  84. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index2.js +72 -0
  85. package/es/components/iho-table/src/types/index.d.ts +31 -8
  86. package/es/components/iho-table/src/types/pluginType.d.ts +91 -64
  87. package/es/components/iho-table/src/utils/index.d.ts +3 -0
  88. package/es/components/iho-table/src/utils/index.js +1 -1
  89. package/es/components/iho-table/src/utils/index2.js +16 -1
  90. package/es/components/index.css +1 -1
  91. package/es/components/index.js +1 -1
  92. package/es/components/index2.js +1 -1
  93. package/package.json +4 -4
  94. package/es/components/big-table/src/components/edit-form/useCommon.d.ts +0 -4
  95. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  96. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  97. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  98. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  99. package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
  100. package/es/components/form-render/src/components/index.d.ts +0 -0
  101. package/es/components/form-render/src/components/index.js +0 -1
  102. package/es/shared/utils/loadVxe.d.ts +0 -2
  103. package/es/shared/utils/loadVxe.js +0 -1
  104. package/es/shared/utils/loadVxe2.js +0 -12
  105. package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md CHANGED
@@ -1,123 +1,123 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式 1(按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式 2(全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3. 注意
65
-
66
- 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
-
68
- ```typescript
69
- // main.ts
70
- import { createApp } from 'vue';
71
- import App from './App.vue';
72
-
73
- import { CGrid } from 'cnhis-design-vue';
74
- // 或者
75
- import { CBigTable } from 'cnhis-design-vue';
76
-
77
- const app = createApp(App);
78
- app.use(CGrid);
79
- // 或者
80
- app.use(CBigTable);
81
- app.mount('#app');
82
- ```
83
-
84
- ## 4.FAQ
85
-
86
- ### 4.1 项目打包后样式丢失
87
-
88
- > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
-
90
- ```typescript
91
- // vite.config.ts
92
- import { defineConfig } from 'vite';
93
-
94
- export default defineConfig({
95
- rollupOptions: {
96
- // ..otherOptions
97
- output: {
98
- dir: './dist',
99
- manualChunks(id: string) {
100
- if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
- return 'vendor';
102
- }
103
- }
104
- }
105
- }
106
- });
107
- ```
108
-
109
- ### 4.2 找不到文件
110
-
111
- > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
-
113
- ```javascript
114
- // vite.config.ts
115
- const config = {
116
- // ...otherOptions
117
- resolve: {
118
- // ...otherOptions
119
- // 如果没有配置, 则不用考虑
120
- extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
- }
122
- };
123
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式 1(按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式 2(全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3. 注意
65
+
66
+ 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
+
68
+ ```typescript
69
+ // main.ts
70
+ import { createApp } from 'vue';
71
+ import App from './App.vue';
72
+
73
+ import { CGrid } from 'cnhis-design-vue';
74
+ // 或者
75
+ import { CBigTable } from 'cnhis-design-vue';
76
+
77
+ const app = createApp(App);
78
+ app.use(CGrid);
79
+ // 或者
80
+ app.use(CBigTable);
81
+ app.mount('#app');
82
+ ```
83
+
84
+ ## 4.FAQ
85
+
86
+ ### 4.1 项目打包后样式丢失
87
+
88
+ > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
+
90
+ ```typescript
91
+ // vite.config.ts
92
+ import { defineConfig } from 'vite';
93
+
94
+ export default defineConfig({
95
+ rollupOptions: {
96
+ // ..otherOptions
97
+ output: {
98
+ dir: './dist',
99
+ manualChunks(id: string) {
100
+ if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
+ return 'vendor';
102
+ }
103
+ }
104
+ }
105
+ }
106
+ });
107
+ ```
108
+
109
+ ### 4.2 找不到文件
110
+
111
+ > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
+
113
+ ```javascript
114
+ // vite.config.ts
115
+ const config = {
116
+ // ...otherOptions
117
+ resolve: {
118
+ // ...otherOptions
119
+ // 如果没有配置, 则不用考虑
120
+ extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
+ }
122
+ };
123
+ ```
@@ -329,6 +329,14 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
329
329
  showInsertStatus?: boolean | undefined;
330
330
  showAsterisk?: boolean | undefined;
331
331
  autoClear?: boolean | undefined;
332
+ beforeEditMethod?: ((params: {
333
+ row: any;
334
+ rowIndex: number;
335
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
336
+ columnIndex: number;
337
+ $table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
338
+ $grid: import("vxe-table").VxeGridConstructor | null | undefined;
339
+ }) => boolean) | undefined;
332
340
  activeMethod?: ((params: {
333
341
  row: any;
334
342
  rowIndex: number;
@@ -1,6 +1,5 @@
1
1
  import { COMPONENT_NAMESPACE } from '../../shared/global/variable2.js';
2
2
  import { safeComponentRegister } from '../../shared/utils/index2.js';
3
- import { loadVxeTable } from '../../shared/utils/loadVxe2.js';
4
3
  import { expandXEUtils } from '../../shared/utils/utilExpand.js';
5
4
  import '../index2.js';
6
5
  import script from './src/BigTable.js';
@@ -12,7 +11,6 @@ const BigTable = script;
12
11
  BigTable.install = function(app) {
13
12
  safeComponentRegister(app, BigTable, COMPONENT_NAMESPACE + "BigTable");
14
13
  safeComponentRegister(app, Grid, COMPONENT_NAMESPACE + "Grid");
15
- loadVxeTable(app);
16
14
  return expandXEUtils();
17
15
  };
18
16
 
@@ -327,6 +327,14 @@ declare const _default: import("vue").DefineComponent<{
327
327
  showInsertStatus?: boolean | undefined;
328
328
  showAsterisk?: boolean | undefined;
329
329
  autoClear?: boolean | undefined;
330
+ beforeEditMethod?: ((params: {
331
+ row: any;
332
+ rowIndex: number;
333
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
334
+ columnIndex: number;
335
+ $table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
336
+ $grid: import("vxe-table").VxeGridConstructor | null | undefined;
337
+ }) => boolean) | undefined;
330
338
  activeMethod?: ((params: {
331
339
  row: any;
332
340
  rowIndex: number;
@@ -14,8 +14,7 @@ import { useAnnotation } from './hooks/useAnnotation.js';
14
14
  import { useSeparateRow, useSeparateMap } from './hooks/useSeparateRow2.js';
15
15
  import { SettingsSharp, CaretDown, CaretForward, CopyOutline, SyncOutline } from '@vicons/ionicons5';
16
16
  import NoData from './components/NoData.js';
17
- import script from '../../../shared/components/TextOverTooltip/TextOverTooltip.js';
18
- import script$1 from '../../../shared/components/SvgIcon/SvgIcon.js';
17
+ import script from '../../../shared/components/SvgIcon/SvgIcon.js';
19
18
  import { useMessage, NIcon, NTooltip, NCheckbox, NCheckboxGroup, NGrid, NGi, NSpace, NButton, NPopconfirm, NProgress, NDropdown, NSwitch, NPopover, NTabs, NTabPane } from 'naive-ui';
20
19
  import Grid from '../../grid/index2.js';
21
20
  import XEUtils from 'xe-utils';
@@ -291,11 +290,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
291
290
  selectTableDisable: false
292
291
  };
293
292
  });
294
- await table.loadData(await separate(formatList, data));
293
+ if (props.columnConfig.isEdit) {
294
+ await table.loadData(data);
295
+ } else {
296
+ await table.loadData(await separate(formatList, data));
297
+ }
295
298
  table.setCurrentRow({});
296
299
  setCurrentPageRowChecked();
297
300
  setGroupTreeExpand();
298
- resetTableInlineEditStatus();
299
301
  };
300
302
  separateHandle.clear();
301
303
  separateHandle.add(() => loadData(props.data));
@@ -430,7 +432,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
430
432
  };
431
433
  }
432
434
  const currentColumns = fieldList.map((item, index) => {
433
- var _a2, _b2, _c2, _d, _e, _f, _g;
435
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h;
434
436
  let filterField = false;
435
437
  let filterItems = [];
436
438
  try {
@@ -445,6 +447,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
445
447
  let sortable = props.isNestTable ? false : !filterField && item.isSort == 1 && notParticipatingSort != 1 && item.isMerge != 1;
446
448
  let treeNode = props.isNestTable ? false : state.isTree != 0 ? index === 0 : false;
447
449
  let type = index === 0 && props.showNestTable ? "expand" : "";
450
+ const isShow = item.isShow == 1 && ((_e = item == null ? void 0 : item.settingObj) == null ? void 0 : _e.isHide) != 1;
448
451
  if (isScanMultiTable2) {
449
452
  fixed = "";
450
453
  sortable = false;
@@ -452,15 +455,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
452
455
  type = "";
453
456
  }
454
457
  const col = Object.assign(item, {
455
- visible: item.columnName == "operatorColumn" ? showButtonTop == 0 : item.isShow == 1,
458
+ visible: item.columnName == "operatorColumn" ? showButtonTop == 0 : isShow,
456
459
  field: item.columnName,
457
460
  title: handleName(item, "title"),
458
461
  minWidth: item.colWidth,
459
462
  fixed,
460
463
  sortable,
461
464
  headerClassName: "mycolumn",
462
- resizable: (_e = item.resizable) != null ? _e : true,
463
- showOverflow: (_f = item.showOverflow) != null ? _f : "title",
465
+ resizable: (_f = item.resizable) != null ? _f : true,
466
+ showOverflow: (_g = item.showOverflow) != null ? _g : "title",
464
467
  treeNode,
465
468
  type,
466
469
  slots: {
@@ -475,7 +478,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
475
478
  if (filterField && !props.isNestTable && !isScanMultiTable2) {
476
479
  state.filterFields[item.columnName] = Object.assign({}, XEUtils.clone({
477
480
  ...item,
478
- setting: item.settingObj
481
+ setting: item.settingObj || {}
479
482
  }, true), {
480
483
  visible: false,
481
484
  left: "initial",
@@ -497,7 +500,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
497
500
  if (!isScanMultiTable2 && !isFunction(attr.footerMethod) && !isFunction(attr["footer-method"])) {
498
501
  col.slots.footer = "tooltip_footer";
499
502
  }
500
- if (props.showNestTable && state.isTree == 0 && ((_g = props.curNestColumnConfig) == null ? void 0 : _g.isTree) == 0) {
503
+ if (props.showNestTable && state.isTree == 0 && ((_h = props.curNestColumnConfig) == null ? void 0 : _h.isTree) == 0) {
501
504
  col.slots.content = "nest_table_content";
502
505
  }
503
506
  return col;
@@ -544,7 +547,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
544
547
  },
545
548
  editTrigger: state.editConfig.trigger
546
549
  };
547
- if (formType === "date" || formType === "time") {
550
+ if (["date", "time"].includes(formType)) {
548
551
  propsData.formattedValue = row[col.columnName];
549
552
  } else if (formatMap) {
550
553
  propsData.value = row[formatMap.value];
@@ -967,33 +970,23 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
967
970
  const toolTipTitle = (item, type) => {
968
971
  var _a;
969
972
  let name = item.formTitle || item.alias || item.title;
970
- let tooltipTitle = item.alias;
971
- let isAlias = false;
973
+ item.alias;
972
974
  if (((_a = props.tableOptions) == null ? void 0 : _a.dataSourceType) == "guage") {
973
- tooltipTitle = item.alias || item.title;
974
- }
975
- if (name && tooltipTitle && name !== tooltipTitle) {
976
- isAlias = !!tooltipTitle;
975
+ item.alias || item.title;
977
976
  }
978
977
  if (isFunction(item.headerSlotFn))
979
978
  return () => item.headerSlotFn(item);
980
979
  if (type === "format")
981
- return [createVNode(script, {
982
- "tooltipTitle": tooltipTitle,
983
- "content": name,
984
- "isAlias": isAlias
985
- }, null), renderAnnotation(item)];
980
+ return [createVNode("span", {
981
+ "class": "header-title-span"
982
+ }, [name]), renderAnnotation(item)];
986
983
  return () => {
987
- return [createVNode(script, {
988
- "tooltipTitle": tooltipTitle,
989
- "content": name,
990
- "isAlias": isAlias
991
- }, {
992
- default: () => [item.treeNode && state.isTree == 1 ? createVNode(NIcon, {
993
- "component": state.isExpand && state.total < 1001 ? CaretDown : CaretForward,
994
- "onClick": (e) => triggerExpand(e, state.isExpand)
995
- }, null) : ""]
996
- }), renderAnnotation(item)];
984
+ return [item.treeNode && state.isTree == 1 ? createVNode(NIcon, {
985
+ "component": state.isExpand && state.total < 1001 ? CaretDown : CaretForward,
986
+ "onClick": (e) => triggerExpand(e, state.isExpand)
987
+ }, null) : "", createVNode("span", {
988
+ "class": "header-title-span"
989
+ }, [name]), renderAnnotation(item)];
997
990
  };
998
991
  };
999
992
  const triggerExpand = (e, isExpand) => {
@@ -1630,7 +1623,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1630
1623
  "onPositiveClick": () => confirmScanMulti(params)
1631
1624
  }, {
1632
1625
  trigger() {
1633
- return createVNode(script$1, {
1626
+ return createVNode(script, {
1634
1627
  "class": "scan-multi-delete",
1635
1628
  "iconClass": "shanchu"
1636
1629
  }, null);
@@ -1847,7 +1840,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1847
1840
  }, [createVNode("img", {
1848
1841
  "class": "bigTable-qr-img",
1849
1842
  "src": src
1850
- }, null), createVNode("span", null, [createVNode(script$1, {
1843
+ }, null), createVNode("span", null, [createVNode(script, {
1851
1844
  "iconClass": "fangda"
1852
1845
  }, null)])])];
1853
1846
  };
@@ -1931,7 +1924,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1931
1924
  }, null);
1932
1925
  } else {
1933
1926
  icon = createVNode(NTooltip, null, {
1934
- trigger: () => createVNode(script$1, {
1927
+ trigger: () => createVNode(script, {
1935
1928
  "iconClass": btn.icon,
1936
1929
  "style": {
1937
1930
  marginRight: mr
@@ -1941,7 +1934,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1941
1934
  });
1942
1935
  }
1943
1936
  } else if (btn.iconSetting) {
1944
- icon = createVNode(script$1, {
1937
+ icon = createVNode(script, {
1945
1938
  "iconClass": JSON.parse(btn.iconSetting).icon,
1946
1939
  "style": {
1947
1940
  marginRight: mr
@@ -1,7 +1,7 @@
1
- import { defineComponent, computed, createVNode, mergeProps } from 'vue';
1
+ import { defineComponent, ref, computed, watch, createVNode, mergeProps } from 'vue';
2
2
  import { generateTimeFormat } from '../../../../../shared/utils/index2.js';
3
- import { isFunction } from 'lodash-es';
4
- import { NDatePicker } from 'naive-ui';
3
+ import { isFunction, isNaN } from 'lodash-es';
4
+ import { NDatePicker, NPopover, NInput } from 'naive-ui';
5
5
  import { useCommon } from './useCommon2.js';
6
6
 
7
7
  var EditDate = defineComponent({
@@ -33,7 +33,9 @@ var EditDate = defineComponent({
33
33
  formRef,
34
34
  isShow
35
35
  } = useCommon(props, attrs);
36
+ const __value = ref(attrs.formattedValue);
36
37
  const onConfirm = (value) => {
38
+ __value.value = value;
37
39
  emit("formChange", {
38
40
  value,
39
41
  row: props.row,
@@ -107,6 +109,45 @@ var EditDate = defineComponent({
107
109
  return customDateDisabled(ts, props.row);
108
110
  };
109
111
  }
112
+ function getFormatDate(str) {
113
+ if (!str)
114
+ return "";
115
+ const d = new Date(str);
116
+ const month = `00${d.getMonth() + 1}`.slice(-2);
117
+ const day = `00${d.getDate()}`.slice(-2);
118
+ const valueFormat = formatConfig.value.valueFormat;
119
+ const format = valueFormat.includes("/") ? "/" : valueFormat.includes(".") ? "." : "-";
120
+ let date = `${d.getFullYear()}${format}${month}${format}${day}`;
121
+ const dTime = d.getTime();
122
+ const connectFieldTime = new Date(props.row[connectField]).getTime();
123
+ if (props.row[connectField] && (isStartDate && dTime > connectFieldTime || isEndDate && dTime < connectFieldTime)) {
124
+ date = "";
125
+ }
126
+ return date;
127
+ }
128
+ function onBlur() {
129
+ let date = __value.value;
130
+ if (isNaN(new Date(date).getTime())) {
131
+ if (/^\d{8}$/.test(date)) {
132
+ const dateNew = `${date.slice(0, 4)} ${date.slice(4, 6)} ${date.slice(6)}`;
133
+ date = "";
134
+ if (!isNaN(new Date(dateNew).getTime())) {
135
+ date = getFormatDate(dateNew);
136
+ }
137
+ } else {
138
+ date = "";
139
+ }
140
+ } else {
141
+ date = getFormatDate(date);
142
+ }
143
+ __value.value = date || void 0;
144
+ emit("formChange", {
145
+ value: __value.value,
146
+ row: props.row,
147
+ column: props.col,
148
+ index: props.index
149
+ });
150
+ }
110
151
  const formatConfig = computed(() => {
111
152
  var _a;
112
153
  const valueFormat = ((_a = props.col.componentProps) == null ? void 0 : _a.valueFormat) || props.col.valueFormat || "yyyy-MM-dd HH:mm:ss";
@@ -130,13 +171,43 @@ var EditDate = defineComponent({
130
171
  if (config.type.includes("time")) {
131
172
  config.isTimeDisabled = customDateDisabledDecorator(props.col.isTimeDisabled) || isTimeDisabled;
132
173
  }
133
- return () => createVNode(NDatePicker, mergeProps({
134
- "ref": formRef,
135
- "show": isShow.value,
136
- "onUpdate:show": ($event) => isShow.value = $event
137
- }, attrs, config, {
138
- "onUpdateFormattedValue": onConfirm
139
- }), null);
174
+ watch(() => attrs.formattedValue, (value) => {
175
+ __value.value = value;
176
+ });
177
+ return () => {
178
+ var _a;
179
+ return ((_a = props.col.componentProps) == null ? void 0 : _a.isPopover) ? createVNode(NPopover, mergeProps({
180
+ "show": isShow.value,
181
+ "trigger": "click",
182
+ "showArrow": false,
183
+ "placement": "bottom-start",
184
+ "style": "padding: 0"
185
+ }, props.col.componentProps || {}, {
186
+ "onClickoutside": () => isShow.value = false
187
+ }), {
188
+ trigger: () => createVNode(NInput, {
189
+ "ref": formRef,
190
+ "clearable": true,
191
+ "value": __value.value,
192
+ "onUpdate:value": ($event) => __value.value = $event,
193
+ "onBlur": onBlur,
194
+ "onClick": () => isShow.value = true
195
+ }, null),
196
+ default: () => createVNode(NDatePicker, mergeProps({
197
+ "panel": true,
198
+ "show": isShow.value,
199
+ "onUpdate:show": ($event) => isShow.value = $event
200
+ }, attrs, config, {
201
+ "onUpdateFormattedValue": onConfirm
202
+ }), null)
203
+ }) : createVNode(NDatePicker, mergeProps({
204
+ "ref": formRef,
205
+ "show": isShow.value,
206
+ "onUpdate:show": ($event) => isShow.value = $event
207
+ }, attrs, config, {
208
+ "onUpdateFormattedValue": onConfirm
209
+ }), null);
210
+ };
140
211
  }
141
212
  });
142
213
 
@@ -54,6 +54,7 @@ var EditInput = defineComponent({
54
54
  });
55
55
  }
56
56
  const config = {
57
+ clearable: true,
57
58
  placeholder: props.col.placeholder || "\u8BF7\u8F93\u5165",
58
59
  ...props.col.componentProps || {}
59
60
  };
@@ -65,7 +65,7 @@ const useEdit = (props, state, emit, xGrid) => {
65
65
  }) => {
66
66
  var _a, _b;
67
67
  let oldValue = row[column.columnName];
68
- if (((column == null ? void 0 : column.formType) === "input" || (column == null ? void 0 : column.formType) === "number") && ((_a = props.columnConfig) == null ? void 0 : _a.formValidate)) {
68
+ if (["input", "number"].includes(column == null ? void 0 : column.formType) && ((_a = props.columnConfig) == null ? void 0 : _a.formValidate)) {
69
69
  row[column.columnName] = (_b = props.columnConfig) == null ? void 0 : _b.formValidate({
70
70
  row,
71
71
  column,
@@ -82,7 +82,7 @@ const useEdit = (props, state, emit, xGrid) => {
82
82
  } else {
83
83
  row[column.columnName] = value;
84
84
  }
85
- if (((column == null ? void 0 : column.formType) === "date" || (column == null ? void 0 : column.formType) === "time") && !value) {
85
+ if (["date", "time"].includes(column == null ? void 0 : column.formType) && !value) {
86
86
  row[column.columnName] = void 0;
87
87
  }
88
88
  emit("formChange", { value, row, column, index, oldValue, ...type ? { type } : {} });