cnhis-design-vue 3.1.22-beta.8 → 3.1.22
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/README.md +123 -123
- package/es/components/big-table/index.d.ts +0 -8
- package/es/components/big-table/src/BigTable.vue.d.ts +0 -8
- package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +9 -23
- package/es/components/big-table/src/components/edit-form/edit-date.js +81 -10
- package/es/components/big-table/src/components/edit-form/edit-input.js +1 -0
- package/es/components/big-table/src/components/edit-form/useCommon.d.ts +4 -0
- package/es/components/big-table/src/hooks/useEdit.d.ts +1 -1
- package/es/components/big-table/src/hooks/useEdit2.js +6 -3
- package/es/components/big-table/src/utils2.js +0 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
- package/es/components/form-render/src/components/renderer/cascader.js +10 -7
- package/es/components/form-render/src/components/renderer/date.js +11 -4
- package/es/components/form-render/src/components/renderer/input.js +2 -2
- package/es/components/form-render/src/components/renderer/inputNumber.js +2 -2
- package/es/components/form-render/src/components/renderer/search.js +3 -3
- package/es/components/form-render/src/components/renderer/select.js +3 -3
- package/es/components/form-render/src/components/renderer/textarea.js +2 -2
- package/es/components/form-render/src/hooks/useCommonInjection2.js +6 -2
- package/es/components/form-render/src/utils/schema.d.ts +4 -1
- package/es/components/form-render/src/utils/schema.js +1 -1
- package/es/components/form-render/src/utils/schema2.js +9 -2
- package/es/components/iho-table/index.d.ts +231 -446
- package/es/components/iho-table/index.js +1 -1
- package/es/components/iho-table/src/IhoTable.js +8 -5
- package/es/components/iho-table/src/IhoTable.vue.d.ts +231 -446
- package/es/components/iho-table/src/components/IhoTableColumn.js +3 -2
- package/es/components/iho-table/src/constants/index.d.ts +4 -2
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/constants/index2.js +15 -2
- package/es/components/iho-table/src/hooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +4 -2
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index2.js +67 -28
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +14 -0
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -0
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks2.js +26 -0
- package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.d.ts +4 -1
- package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks2.js +4 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index2.js +2 -1
- package/es/components/iho-table/src/plugins/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -0
- package/es/components/iho-table/src/plugins/index2.js +1 -0
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +10 -6
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index2.js +72 -0
- package/es/components/iho-table/src/types/index.d.ts +23 -9
- package/es/components/iho-table/src/types/index.js +1 -1
- package/es/components/iho-table/src/types/pluginType.d.ts +16 -3
- package/es/components/iho-table/src/types/pluginType.js +1 -1
- package/es/components/iho-table/src/types/pluginType2.js +3 -1
- package/es/components/iho-table/src/utils/index.d.ts +2 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/src/utils/index2.js +5 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/style/iconfont.ttf +0 -0
- package/es/components/info-header/style/index.css +1 -1
- package/es/shared/utils/tapable/SyncHook.js +23 -2
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
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,14 +329,6 @@ 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;
|
|
340
332
|
activeMethod?: ((params: {
|
|
341
333
|
row: any;
|
|
342
334
|
rowIndex: number;
|
|
@@ -327,14 +327,6 @@ 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;
|
|
338
330
|
activeMethod?: ((params: {
|
|
339
331
|
row: any;
|
|
340
332
|
rowIndex: number;
|
|
@@ -87,7 +87,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
87
87
|
deleteRow,
|
|
88
88
|
onFormChange,
|
|
89
89
|
getDefaultValue
|
|
90
|
-
} = useEdit(props, state, emit, xGrid);
|
|
90
|
+
} = useEdit(props, state, emit, xGrid, loadData);
|
|
91
91
|
const {
|
|
92
92
|
isAboutNestTable,
|
|
93
93
|
isExpandTable,
|
|
@@ -262,40 +262,31 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
262
262
|
onColumnResize(payload);
|
|
263
263
|
emit("resizableChange", payload);
|
|
264
264
|
};
|
|
265
|
-
|
|
265
|
+
async function loadData(data) {
|
|
266
266
|
state.isShowEmpty = !(data == null ? void 0 : data.length);
|
|
267
|
-
let
|
|
267
|
+
let formatList = data;
|
|
268
268
|
let {
|
|
269
269
|
isTransform
|
|
270
270
|
} = props.tableParams;
|
|
271
271
|
if (isTransform && [1, 3].includes(Number(state.isTree)))
|
|
272
|
-
|
|
272
|
+
formatList = treeToList(data);
|
|
273
273
|
let table = xGrid.value;
|
|
274
274
|
if (!table)
|
|
275
275
|
return;
|
|
276
276
|
state.checkedRows = [];
|
|
277
|
-
let formatList = setChecklist(list);
|
|
278
277
|
state.originFormatList = formatList;
|
|
279
278
|
setGroupTitleToFristColumnFieldData(formatList);
|
|
280
|
-
state.curAbleCheckedLen =
|
|
279
|
+
state.curAbleCheckedLen = formatList.filter((item) => checkMethod({
|
|
281
280
|
row: item
|
|
282
281
|
})).length;
|
|
283
282
|
if (!props.isNestTable) {
|
|
284
283
|
await handleFormTheUniqueKey();
|
|
285
284
|
}
|
|
286
|
-
formatList = formatList.map((v) => {
|
|
287
|
-
return {
|
|
288
|
-
...v,
|
|
289
|
-
selectTableShow: false,
|
|
290
|
-
selectTableDisable: false
|
|
291
|
-
};
|
|
292
|
-
});
|
|
293
285
|
await table.loadData(await separate(formatList, data));
|
|
294
286
|
table.setCurrentRow({});
|
|
295
287
|
setCurrentPageRowChecked();
|
|
296
288
|
setGroupTreeExpand();
|
|
297
|
-
|
|
298
|
-
};
|
|
289
|
+
}
|
|
299
290
|
separateHandle.clear();
|
|
300
291
|
separateHandle.add(() => loadData(props.data));
|
|
301
292
|
const setGroupTitleToFristColumnFieldData = (formatList) => {
|
|
@@ -544,7 +535,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
544
535
|
},
|
|
545
536
|
editTrigger: state.editConfig.trigger
|
|
546
537
|
};
|
|
547
|
-
if (
|
|
538
|
+
if (["date", "time"].includes(formType)) {
|
|
548
539
|
propsData.formattedValue = row[col.columnName];
|
|
549
540
|
} else if (formatMap) {
|
|
550
541
|
propsData.value = row[formatMap.value];
|
|
@@ -2158,13 +2149,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2158
2149
|
}, {
|
|
2159
2150
|
immediate: true
|
|
2160
2151
|
});
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
loadData(value);
|
|
2164
|
-
});
|
|
2165
|
-
}, {
|
|
2166
|
-
immediate: true,
|
|
2167
|
-
deep: true
|
|
2152
|
+
nextTick(() => {
|
|
2153
|
+
loadData(props.data);
|
|
2168
2154
|
});
|
|
2169
2155
|
watch(() => currentCheckedKeys, (val) => {
|
|
2170
2156
|
setVisibleCheckAllWrap(state, props, currentCheckedKeys.value);
|
|
@@ -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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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
|
|
|
@@ -322,7 +322,7 @@ export declare const comps: {
|
|
|
322
322
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
323
323
|
}, {}>;
|
|
324
324
|
};
|
|
325
|
-
export declare const useEdit: (props: any, state: any, emit: any, xGrid: any) => {
|
|
325
|
+
export declare const useEdit: (props: any, state: any, emit: any, xGrid: any, loadData: (data: unknown) => void) => {
|
|
326
326
|
initEditTable: () => Promise<void>;
|
|
327
327
|
deleteRow: (row: any, col: any, index: number) => void;
|
|
328
328
|
onClickSelectTable: (row: any) => Promise<void>;
|
|
@@ -12,7 +12,7 @@ const comps = {
|
|
|
12
12
|
time: EditTime,
|
|
13
13
|
separate: EditSeparate
|
|
14
14
|
};
|
|
15
|
-
const useEdit = (props, state, emit, xGrid) => {
|
|
15
|
+
const useEdit = (props, state, emit, xGrid, loadData) => {
|
|
16
16
|
const initEditTable = async () => {
|
|
17
17
|
const { isEdit, fieldList = [] } = props.columnConfig;
|
|
18
18
|
if (!isEdit)
|
|
@@ -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 (
|
|
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,9 +82,12 @@ const useEdit = (props, state, emit, xGrid) => {
|
|
|
82
82
|
} else {
|
|
83
83
|
row[column.columnName] = value;
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
85
|
+
if (["date", "time"].includes(column == null ? void 0 : column.formType) && !value) {
|
|
86
86
|
row[column.columnName] = void 0;
|
|
87
87
|
}
|
|
88
|
+
if (["separate"].includes(column == null ? void 0 : column.formType)) {
|
|
89
|
+
loadData(props.data);
|
|
90
|
+
}
|
|
88
91
|
emit("formChange", { value, row, column, index, oldValue, ...type ? { type } : {} });
|
|
89
92
|
};
|
|
90
93
|
const getDefaultValue = (params, item) => {
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/Viewer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/features/modeling';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'diagram-js/lib/navigation/movecanvas';
|