cnhis-design-vue 3.1.42-release.8 → 3.1.43-beta.0
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 +87 -87
- package/es/components/form-config/index.d.ts +5 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +5 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -0
- package/es/components/form-render/src/FormRender.vue.js +1 -1
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +18 -0
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.d.ts +2 -1
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +4 -0
- package/es/components/form-render/src/types/index.d.ts +1 -1
- package/es/components/iho-table/src/plugins/anchorPlugin/tableAnchor.js +1 -1
- package/es/components/iho-table/src/plugins/fieldConnectionPlugin/fieldConnectionUtils.d.ts +11 -0
- package/es/components/iho-table/src/plugins/fieldConnectionPlugin/fieldConnectionUtils.js +1 -0
- package/es/components/iho-table/src/plugins/fieldConnectionPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/fieldConnectionPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +4 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +17 -0
- package/es/components/iho-table/src/types/pluginType.d.ts +21 -18
- package/es/components/keyboard/index.d.ts +3 -1
- package/es/components/keyboard/src/Keyboard.vue.d.ts +3 -1
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +3 -1
- package/es/components/keyboard/src/components/NumberPanel.vue.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/shortcut-setter/index.d.ts +1 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
- package/es/env.d.ts +25 -25
- package/es/shared/package.json.js +1 -1
- package/package.json +65 -65
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
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.FAQ
|
|
65
|
-
|
|
66
|
-
### 3.1 项目打包后样式丢失
|
|
67
|
-
|
|
68
|
-
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
// vite.config.ts
|
|
72
|
-
import { defineConfig } from 'vite';
|
|
73
|
-
|
|
74
|
-
export default defineConfig({
|
|
75
|
-
build: {
|
|
76
|
-
rollupOptions: {
|
|
77
|
-
// ..otherOptions
|
|
78
|
-
output: {
|
|
79
|
-
dir: './dist',
|
|
80
|
-
manualChunks: {
|
|
81
|
-
'cnhis-vendor': ['cnhis-design-vue']
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
```
|
|
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.FAQ
|
|
65
|
+
|
|
66
|
+
### 3.1 项目打包后样式丢失
|
|
67
|
+
|
|
68
|
+
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// vite.config.ts
|
|
72
|
+
import { defineConfig } from 'vite';
|
|
73
|
+
|
|
74
|
+
export default defineConfig({
|
|
75
|
+
build: {
|
|
76
|
+
rollupOptions: {
|
|
77
|
+
// ..otherOptions
|
|
78
|
+
output: {
|
|
79
|
+
dir: './dist',
|
|
80
|
+
manualChunks: {
|
|
81
|
+
'cnhis-vendor': ['cnhis-design-vue']
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
```
|
|
@@ -1703,6 +1703,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1703
1703
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
1704
1704
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
1705
1705
|
} | undefined;
|
|
1706
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
1706
1707
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
1707
1708
|
reactions?: {
|
|
1708
1709
|
[x: string]: any;
|
|
@@ -3399,6 +3400,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3399
3400
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
3400
3401
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
3401
3402
|
} | undefined;
|
|
3403
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
3402
3404
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
3403
3405
|
reactions?: {
|
|
3404
3406
|
[x: string]: any;
|
|
@@ -6039,6 +6041,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
6039
6041
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
6040
6042
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
6041
6043
|
} | undefined;
|
|
6044
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
6042
6045
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
6043
6046
|
reactions?: {
|
|
6044
6047
|
[x: string]: any;
|
|
@@ -7747,6 +7750,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
7747
7750
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
7748
7751
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
7749
7752
|
} | undefined;
|
|
7753
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
7750
7754
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
7751
7755
|
reactions?: {
|
|
7752
7756
|
[x: string]: any;
|
|
@@ -9427,6 +9431,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
9427
9431
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
9428
9432
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
9429
9433
|
} | undefined;
|
|
9434
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
9430
9435
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
|
9431
9436
|
reactions?: {
|
|
9432
9437
|
[x: string]: any;
|
|
@@ -1705,6 +1705,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1705
1705
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
1706
1706
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
1707
1707
|
} | undefined;
|
|
1708
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
1708
1709
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
1709
1710
|
reactions?: {
|
|
1710
1711
|
[x: string]: any;
|
|
@@ -3401,6 +3402,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3401
3402
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
3402
3403
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
3403
3404
|
} | undefined;
|
|
3405
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
3404
3406
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
3405
3407
|
reactions?: {
|
|
3406
3408
|
[x: string]: any;
|
|
@@ -6041,6 +6043,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6041
6043
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
6042
6044
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
6043
6045
|
} | undefined;
|
|
6046
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
6044
6047
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
6045
6048
|
reactions?: {
|
|
6046
6049
|
[x: string]: any;
|
|
@@ -7749,6 +7752,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7749
7752
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
7750
7753
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
7751
7754
|
} | undefined;
|
|
7755
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
7752
7756
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
7753
7757
|
reactions?: {
|
|
7754
7758
|
[x: string]: any;
|
|
@@ -9429,6 +9433,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9429
9433
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
9430
9434
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
9431
9435
|
} | undefined;
|
|
9436
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
9432
9437
|
validator?: ((value: unknown, fieldItem: import("../../../../es/components/form-render").FieldItem) => string | void) | undefined;
|
|
9433
9438
|
reactions?: {
|
|
9434
9439
|
[x: string]: any;
|
|
@@ -1668,6 +1668,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1668
1668
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
1669
1669
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
1670
1670
|
} | undefined;
|
|
1671
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
1671
1672
|
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
|
1672
1673
|
reactions?: {
|
|
1673
1674
|
[x: string]: any;
|
|
@@ -3376,6 +3377,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3376
3377
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
3377
3378
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
3378
3379
|
} | undefined;
|
|
3380
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
3379
3381
|
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
|
3380
3382
|
reactions?: {
|
|
3381
3383
|
[x: string]: any;
|
|
@@ -5056,6 +5058,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5056
5058
|
"text-anchor"?: import("csstype").TextAnchorProperty | undefined;
|
|
5057
5059
|
"vector-effect"?: import("csstype").VectorEffectProperty | undefined;
|
|
5058
5060
|
} | undefined;
|
|
5061
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
|
5059
5062
|
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
|
5060
5063
|
reactions?: {
|
|
5061
5064
|
[x: string]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as p,normalizeStyle as d,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as j,createCommentVNode as g,createElementVNode as b,withKeys as k,withModifiers as v,toDisplayString as F,renderSlot as x}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as H,cloneDeep as S}from"lodash-es";import{createForm as A,onFieldValueChange as L,onFieldMount as R,onFieldUnmount as _,onFieldReact as O,onFormMount as w}from"@formily/core";import{FormProvider as B,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as D,NConfigProvider as q}from"naive-ui";import{InjectionFormGraph as U}from"./constants/index.js";import{useAutoHidden as W}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as G}from"./hooks/useComplexOptions.js";import{useFormDomEvent as T,useFormExposeEvent as K}from"./hooks/useFormEvent.js";import{useFormGraph as M}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as E}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeReactions as P}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as J}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as $}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as z}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as Q}from"./hooks/useFormValidator.js";import{useAnchor as X}from"./hooks/useAnchor.js";import{useFormContext as Y}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import Z from"../../../_virtual/plugin-vue_export-helper.js";import{createObjSchema as ee}from"./utils/schema.js";const oe={key:0,style:{height:"54px"}},te={style:{"white-space":"pre"}};var re=Z(e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},linebarAutoHidden:{type:Boolean},bordered:{type:Boolean,default:!0}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:Z,emit:re}){const se=e,ae=C(),{nuiThemeOverrides:ie}=J();Q();const le=o(),ne=t((()=>H(se.maxHeight)?se.maxHeight+"px":se.maxHeight)),{SchemaField:me,businessCollector:pe,formItemDepsCollector:de,changeContextCollector:ue,formUUID:ce}=Y(se,re),{anchorBarRef:fe,currentAnchor:he,generateAnchorList:ye,updateAnchorList:je,anchorIdList:ge,onScroll:be}=X(se,re,le,de);E(se).callLifeCycle("onSetup");const{trigger:ke}=W(),{observeFormGraph:ve,setGraph:Fe,removeGraph:xe}=M();r(U,ve);const Ce=A({initialValues:se.initialData,effects(e){L("*",(o=>{const t=o.props.name.toString();pe.trigger(e,t),de.trigger(t),re("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ue.getContext(t,o.value)}),He(t,o.value)})),R("*",Fe),_("*",xe),se.linebarAutoHidden&&(O("*",ke),w((e=>e.query("*").forEach(ke)))),se.anchor&&(O("*",je),w(ye))}}),{lowCodeReactionsHandler:He,triggerAllReactionsHandler:Se}=P(t((()=>se.lowCodeReactions)),Ce);s(Se);const{schemaAdaptor:Ae}=$(pe);let Le=se.fieldList||[];const Re=t((()=>se.schema?se.schema:se.fieldList?(Le=z().traverse(S(se.fieldList),se.fieldVisitor),ee(Ae(Le))):ee({}))),{onKeydown:_e}=T({formModel:Ce,formRenderRef:le,props:se}),{clearSpan:Oe}=G();a((()=>Oe(ce)));const we=K({formModel:Ce,formRenderRef:le,formItemDepsCollector:de,getFieldList:()=>Le,formUUID:ce});return Z({formModel:Ce,validate:(e="*")=>we.validate(e),getFormValues:(e=!0)=>we.getFormValues(e),async setFormValues(e,o=!0,t=!1,r=!0){t&&(pe.triggerLock=!0),we.setFormValues(e,o,r),await i(),pe.triggerLock=!1},setFieldState(e,o){we.setFieldState(e,o)},resetFields(e="*"){we.resetFields(e)},queryWidget:async e=>we.queryWidget(e),getFieldList:()=>Le,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:p(["form-render",{"form-render--no-border":!e.bordered}]),"require-mark-placement":"left",style:d(m(ae))},{default:u((()=>[e.anchor?(l(),c("section",oe,[f(m(N),{value:m(he),"onUpdate:value":t[0]||(t[0]=e=>h(he)?he.value=e:null),type:"line",ref_key:"anchorBarRef",ref:fe},{default:u((()=>[(l(!0),c(y,null,j(m(ge),(e=>(l(),n(m(D),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):g("v-if",!0),f(m(q),{"theme-overrides":m(ie)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:d({"--column":e.column,"--form-height":m(ne)}),ref_key:"formRenderRef",ref:le,onScroll:t[1]||(t[1]=(...e)=>m(be)&&m(be)(...e)),onKeydownCapture:t[2]||(t[2]=k(v(((...e)=>m(_e)&&m(_e)(...e)),["prevent"]),["enter"]))},[f(m(B),{form:m(Ce)},{default:u((()=>[f(m(me),{schema:m(Re)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",te,F(JSON.stringify(e.values,null,2)),1)])),_:1})):g("v-if",!0),x(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}}),[["__file","FormRender.vue"]]);export{re as default};
|
|
@@ -49,6 +49,10 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
49
49
|
type: BooleanConstructor;
|
|
50
50
|
default: boolean;
|
|
51
51
|
};
|
|
52
|
+
childFieldStrategy: {
|
|
53
|
+
type: PropType<"checked" | "all">;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
52
56
|
onChange: {};
|
|
53
57
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
54
58
|
value: {
|
|
@@ -99,6 +103,10 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
99
103
|
type: BooleanConstructor;
|
|
100
104
|
default: boolean;
|
|
101
105
|
};
|
|
106
|
+
childFieldStrategy: {
|
|
107
|
+
type: PropType<"checked" | "all">;
|
|
108
|
+
default: string;
|
|
109
|
+
};
|
|
102
110
|
onChange: {};
|
|
103
111
|
}>> & {
|
|
104
112
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -109,6 +117,7 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
109
117
|
valueField: string;
|
|
110
118
|
lazyRequest: boolean;
|
|
111
119
|
requestCache: boolean;
|
|
120
|
+
childFieldStrategy: "checked" | "all";
|
|
112
121
|
}>;
|
|
113
122
|
export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
114
123
|
value: {
|
|
@@ -159,6 +168,10 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
159
168
|
type: BooleanConstructor;
|
|
160
169
|
default: boolean;
|
|
161
170
|
};
|
|
171
|
+
childFieldStrategy: {
|
|
172
|
+
type: PropType<"checked" | "all">;
|
|
173
|
+
default: string;
|
|
174
|
+
};
|
|
162
175
|
onChange: {};
|
|
163
176
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
164
177
|
value: {
|
|
@@ -209,6 +222,10 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
209
222
|
type: BooleanConstructor;
|
|
210
223
|
default: boolean;
|
|
211
224
|
};
|
|
225
|
+
childFieldStrategy: {
|
|
226
|
+
type: PropType<"checked" | "all">;
|
|
227
|
+
default: string;
|
|
228
|
+
};
|
|
212
229
|
onChange: {};
|
|
213
230
|
}>> & {
|
|
214
231
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -219,4 +236,5 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
219
236
|
valueField: string;
|
|
220
237
|
lazyRequest: boolean;
|
|
221
238
|
requestCache: boolean;
|
|
239
|
+
childFieldStrategy: "checked" | "all";
|
|
222
240
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,createVNode as t,isVNode as o}from"vue";import{connect as
|
|
1
|
+
import{defineComponent as e,createVNode as t,isVNode as o}from"vue";import{connect as l,mapProps as a}from"@formily/vue";import{NSpace as r,NRadio as i,NRadioGroup as u,NCheckbox as n,NCheckboxGroup as p}from"naive-ui";import"../../../index.js";import{useComplexOptions as d}from"../../hooks/useComplexOptions.js";import"../../utils/index.js";import{useAutographOptions as s}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as c,createVisitedSetter as v}from"../../utils/schema.js";import{useFormField as y}from"../../hooks/useFormField.js";function f(l,a,i){return e({name:l,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},onChange:{}},emits:["update:value"],setup(e,{emit:l}){const{field:u}=y(),{renderComplexOption:n,valueRef:p}=d(e,l),{labelKey:c,valueKey:f,fullOptions:j}=s(e,p),{injectValueBindKey:b,injectValueValidate:h}=m();h(p);const g=b(p);return()=>t(a,{key:g.value,value:p.value,"onUpdate:value":e=>p.value=e,onClick:v(u)},{default:()=>[t(r,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var l;return[null==(l=j.value)?void 0:l.map((l=>{let a;return t(i,{key:l[f.value],value:l[f.value],disabled:l.disabled},"function"==typeof(r=a=n({value:p.value,option:l,valueKey:f.value,labelKey:c.value,childFieldStrategy:e.childFieldStrategy}))||"[object Object]"===Object.prototype.toString.call(r)&&!o(r)?a:{default:()=>[a]});var r}))]}})]})}})}const j=l(f("FormRadio",u,i),a({dataSource:"options"},c)),b=l(f("FormCheckbox",p,n),a({dataSource:"options"},c));export{b as CHECKBOX,j as RADIO};
|
|
@@ -9,11 +9,12 @@ export declare function useComplexOptions(props: {
|
|
|
9
9
|
options: AnyObject[];
|
|
10
10
|
value: unknown;
|
|
11
11
|
}, emit: Func): {
|
|
12
|
-
renderComplexOption: ({ value, option, valueKey, labelKey }: {
|
|
12
|
+
renderComplexOption: ({ value, option, valueKey, labelKey, childFieldStrategy }: {
|
|
13
13
|
value: unknown;
|
|
14
14
|
option: FormOptionItem;
|
|
15
15
|
valueKey: string;
|
|
16
16
|
labelKey: string;
|
|
17
|
+
childFieldStrategy: 'checked' | 'all';
|
|
17
18
|
}) => any[];
|
|
18
19
|
valueRef: import("vue").WritableComputedRef<unknown>;
|
|
19
20
|
hasComplexOption: import("vue").ComputedRef<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,defineComponent as t,inject as r,provide as n,computed as
|
|
1
|
+
import{reactive as e,defineComponent as t,inject as r,provide as n,computed as l,watch as o,onUnmounted as a,onMounted as i,withModifiers as s,createVNode as c,mergeProps as u}from"vue";import{checkInSetupEnv as d}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{noop as v,isArray as h,isNumber as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as b}from"../constants/index.js";import{useFieldListAdaptor as F}from"./useFieldListAdaptor.js";import{createObjSchema as x}from"../utils/schema.js";const S=e(new Map);function j(e,t,r=0){S.set(e,S.get(e)||{});S.get(e)[t+""]=r}function O(e,t,r=!0){const n=S.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function $(e,t){const r=S.get(e);r&&Reflect.deleteProperty(r,t+"")}function k(e){S.delete(e)}const E=t({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},name:{type:String,required:!0}},setup(e){const t=r(g),d=r(b),h=p(),y=r(t+"_virtualParent",""),S=`${y?y+".":""}${h.value.address}`;function k(e){return`${S}.${e}`}n(t+"_virtualParent",S);const{schemaAdaptor:E}=F(d);function K(t){var r,n;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1,showLabel:!!t.title},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,size:"small"}})}const P=l((()=>{const t=E(e.fieldItems);return Object.values(t).forEach(K),x(t)}));o(P,(()=>{return e=P.value,void Object.values(e.properties||{}).forEach((e=>{var r;j(t,k(e.name),null==(r=null==e?void 0:e["x-decorator-props"])?void 0:r.span)}));var e}),{immediate:!0});const _=m();function w(){return e.fieldItems.map((e=>_.value.query(e.val_key).take()))}a((()=>{var e;w().forEach((e=>{e&&(e.display="none")})),e=P.value,Object.values(e.properties||{}).forEach((e=>{$(t,k(e.name))}))})),i((()=>{w().forEach((e=>{e&&(e.display="visible")}))}));const I=s(v,["stop"]),A=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=I,e)),{});return()=>{return c("section",u({class:"form-render__labelField",style:{"--column":(e=P.value,Object.values(e.properties||{}).reduce(((e,r)=>e+O(t,k(r.name))),0))}},A),[c(f,{basePath:".",schema:P.value},null)]);var e}}});function K(e,t){d();const r=l((()=>e.options.some((e=>h(e.childrenFields)&&e.childrenFields.length))));function n(e,t,r="value"){if(h(e)?e.includes(t[r]):e===t[r])return h(t.childrenFields)&&t.childrenFields.length}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:o="label",childFieldStrategy:a}){return[t[o],r.value&&("all"===a||n(e,t,l))?c(E,{fieldItems:t.childrenFields,name:t[l],childFieldStrategy:a},null):null]},valueRef:l({get(){return t=e.value,y(t)?t+"":t;var t},set(e){t("update:value",e)}}),hasComplexOption:r}}function P(){return{getSpan:O,setSpan:j,deleteSpan:$,clearSpan:k}}export{K as useComplexOptions,P as useComplexOptionsSpan};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function
|
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(d){const{createValidatorSchema:u}=l(),x=e=>{var t;const n={name:e.val_key,type:null!=(t=e.fieldType)?t:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable"};e.reactions&&(n["x-reactions"]=e.reactions),e.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o(e,["reactions"]),span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const r=u(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},f=e=>{var o;const t=x(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(t,e):e.autograph&&m(t,e);const i=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:i,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),i&&(t.type="array"),t},_=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),m(o,e),o},h=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},g=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),y=new Map([["LINEBAR",g],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=x(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",f],["REMOTE_SEARCH",f],["DATE",e=>{const o=x(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),o}],["SEARCH_CASCADER",e=>{var o;const t=x(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=x(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,getProperties:()=>e.children||[]}),o}],["RADIO",_],["CHECKBOX",_],["SWITCH",e=>{const o=x(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=x(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?C(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),b=e=>{if(e.suffixConfig)return v(e);return(y.get(e.html_type)||h)(e)},v=o=>{if(!o.suffixConfig)return b(o);const t=e(o.suffixConfig),n=[{...o,is_show:"1",hide_title:"1",suffixConfig:void 0}].concat(t.map((e=>({...e,hide_title:"1",is_show:"1"})))),r=x(o);return Object.assign(r,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:2*(o.elem_width||3)},"x-decorator-props":{...r["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:C(n)}),r},{FieldNormalizeWaterfallHook:O}=s();function C(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=O.call(t(o))).validate)?void 0:a.obj_type;return p&&d&&d.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(g(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(b(o),s):(n=null,e[i(o)]=r(b(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function i(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:C}}export{d as useFieldListAdaptor};
|
|
@@ -264,6 +264,10 @@ export declare type FieldItem = {
|
|
|
264
264
|
* COMPLEX控件额外样式
|
|
265
265
|
*/
|
|
266
266
|
wrapperStyle: CSSProperties | Record<string, string>;
|
|
267
|
+
/**
|
|
268
|
+
* 多级表单的显示策略, checked表示展示选中的子表单, all表示任何时候都展示所有子表单
|
|
269
|
+
*/
|
|
270
|
+
childFieldStrategy?: 'checked' | 'all';
|
|
267
271
|
/**
|
|
268
272
|
* 自定义校验规则
|
|
269
273
|
* @param value 表单当前控件的值
|
|
@@ -31,7 +31,7 @@ export declare type FormRenderExpose = {
|
|
|
31
31
|
formModel: Form;
|
|
32
32
|
validate(path?: string): Promise<unknown>;
|
|
33
33
|
getFormValues(needCombineExtendKey?: boolean): AnyObject;
|
|
34
|
-
setFormValues(values: AnyObject, needSplitExtendKey?: boolean, avoidBusinessConnection?: boolean, overwrite?: boolean):
|
|
34
|
+
setFormValues(values: AnyObject, needSplitExtendKey?: boolean, avoidBusinessConnection?: boolean, overwrite?: boolean): any;
|
|
35
35
|
setFieldState(path: string, setter: (field: Field) => void): void;
|
|
36
36
|
resetFields(path?: string): void;
|
|
37
37
|
queryWidget(key: string): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,createVNode as
|
|
1
|
+
import{defineComponent as e,computed as t,createVNode as l,isVNode as n}from"vue";import{NTabs as a,NTabPane as o}from"naive-ui";import{useAnchor as r}from"./useAnchor.js";import{useTableContext as u}from"../../hooks/useTableContext.js";var i=e({name:"IhoTableAnchor",setup(){const{configRef:e,eventListener:i,fieldListRef:c,$table:p}=u(),{updateAnchor:s,onScroll:f,currentAnchorList:v,anchorValue:d}=r(t((()=>{var t;return null!=(t=e.value.anchorList)?t:[]})),p,c);return i.addEventListener("scroll",f),()=>{let e;return v.value.length>0?l(a,{type:"line",animated:!0,"pane-style":"padding: 0",value:d.value,"onUpdate:value":e=>d.value=e},"function"==typeof(t=e=v.value.map((e=>l(o,{name:e.field,tab:e.title,key:e.field,tabProps:{onClick:()=>s(e.field)}},null))))||"[object Object]"===Object.prototype.toString.call(t)&&!n(t)?e:{default:()=>[e]}):null;var t}}});export{i as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../../es/shared/types';
|
|
2
|
+
import { FieldEventSetting } from '../../../../../../es/components/iho-table/src/types';
|
|
3
|
+
/**
|
|
4
|
+
* 判断是否匹配
|
|
5
|
+
* @param conObj params条件数组
|
|
6
|
+
* @param curVal 当前行数据对应fieldKey的值
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function isContain(conObj: AnyObject, curVal: string | number): boolean;
|
|
10
|
+
export declare function judgeCondition(row: AnyObject, setObj: FieldEventSetting): boolean;
|
|
11
|
+
export declare function handleFieldTriggerSetValue(row: AnyObject, setObj: FieldEventSetting): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isNumber as e,isString as a}from"lodash-es";function n(n,r){const s=n.p_select,c=n.p_value;let l=!0;switch(s){case"NULL":l=!r;break;case"NOT_NULL":l=!!r;break;case"EQ":l=r==c;break;case"NEQ":l=r!=c;break;case"CL":l=a(r)&&r.includes(c);break;case"NC":l=a(r)&&!r.includes(c);break;case"BIG":l=e(r)&&1*r>1*c;break;case"LESS":l=e(r)&&1*r<1*c;break;case"BIGEQ":l=e(r)&&1*r>=1*c;break;case"LESSEQ":l=e(r)&&1*r<=1*c}return l}function r(e,a){var r;const s=null!=(r=null==a?void 0:a.params)?r:[];if(s.length>0)for(let a=0;a<s.length;a++){const r=s[a];if(!n(r,e[r.p_name]))return!1}return!0}function s(e,a){var n;const s=null!=(n=null==a?void 0:a.results)?n:[];r(e,a)&&s.length>0&&s.forEach((a=>{e[a.p_name]=a.p_value}))}export{s as handleFieldTriggerSetValue,n as isContain,r as judgeCondition};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fieldConnectionPlugin(): import("../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../../index.js";import{isFunction as n}from"lodash-es";import{handleFieldTriggerSetValue as o}from"./fieldConnectionUtils.js";import{defineTablePlugin as t}from"../../hooks/useTablePlugin.js";function e(){const e="fieldConnectionPlugin";return t({name:e,apply(t){t.configHooks.config.tap(e,(t=>{const e=t.onFormChange;return t.onFormChange=function(t){var i;const{column:r,row:s}=t,l=null==(i=r.editRender)?void 0:i.props;if(l&&(null==l?void 0:l.bindEventSetting)){const n=l.bindEventSetting,t={SET_VALUE:o,REPEAT_VALIDATE:()=>({}),IS_SHOW_FIELD:()=>({}),SQLSAVE:()=>({}),API:()=>({})};n.forEach((n=>{t[n.event_type](s,n)}))}n(e)&&e(t)},t}))}})}export{e as fieldConnectionPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,reactive as t,openBlock as a,createBlock as l,unref as o}from"vue";import r from"../../../../date-picker/index.js";import{subDays as n,subMonths as i}from"date-fns";import p from"../../../../../_virtual/plugin-vue_export-helper.js";var u=p(e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){var p,u,d;const m=e,
|
|
1
|
+
import{defineComponent as e,reactive as t,openBlock as a,createBlock as l,unref as o}from"vue";import r from"../../../../date-picker/index.js";import{subDays as n,subMonths as i}from"date-fns";import p from"../../../../../_virtual/plugin-vue_export-helper.js";var u=p(e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){var p,u,d;const m=e,f=t((null==(d=null==(u=null==(p=m.payload)?void 0:p.column)?void 0:u.filters)?void 0:d[0])||{data:void 0}),v=t({"近一周":()=>[n(new Date,7).getTime(),(new Date).getTime()],"近一个月":()=>[i(new Date,1).getTime(),(new Date).getTime()]});function s(e,t){var a;f.value=t,(null==(a=m.payload)?void 0:a.$panel)&&(m.payload.$panel.changeOption(null,!!t,f),m.payload.$panel.confirmFilter(new CustomEvent("click")))}return(e,t)=>(a(),l(o(r),{type:"datetimerange",panel:"",clearable:"","default-time":["00:00:00","23:59:59"],"formatted-value":f.data,"onUpdate:formatted-value":t[0]||(t[0]=e=>f.data=e),shortcuts:v,onConfirm:s},null,8,["formatted-value","shortcuts"]))}}),[["__file","filter.vue"]]);export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./defaultConfigPlugin/index.js";import*as i from"./
|
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./defaultConfigPlugin/index.js";import*as i from"./fieldConnectionPlugin/index.js";import*as n from"./filterDaterangeRenderPlugin/index.js";import*as d from"./filterRenderPlugin/index.js";import*as s from"./highLightSetPlugin.js";import*as t from"./keyboardEventPlugin/index.js";import*as l from"./lowCodeFieldAdaptorPlugin/index.js";import*as g from"./maxCheckSizePlugin.js";import*as u from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as o from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as P from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as a from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as m from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as x from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as f from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as p from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as j from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as R from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as b from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as w from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as c from"./rowClickPlugin/index.js";import*as h from"./rowDragPlugin/index.js";import*as W from"./rowGroupSettingPlugin/index.js";import*as C from"./varialbleHeightPlugin/index.js";import*as k from"./virtualTreePlugin/index.js";import{separateMetaModule as v}from"../../../../shared/utils/index.js";var S=v(Object.assign({"./anchorPlugin/index.tsx":e,"./defaultConfigPlugin/index.ts":r,"./fieldConnectionPlugin/index.ts":i,"./filterDaterangeRenderPlugin/index.tsx":n,"./filterRenderPlugin/index.tsx":d,"./highLightSetPlugin.tsx":s,"./keyboardEventPlugin/index.ts":t,"./lowCodeFieldAdaptorPlugin/index.tsx":l,"./maxCheckSizePlugin.ts":g,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":u,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":o,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":P,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":a,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":m,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":x,"./rendererPlugins/widgets/checkRendererPlugin.tsx":f,"./rendererPlugins/widgets/colorRendererPlugin.tsx":p,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":j,"./rendererPlugins/widgets/labelRendererPlugin.tsx":R,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":b,"./rendererPlugins/widgets/seqRendererPlugin.tsx":w,"./rowClickPlugin/index.ts":c,"./rowDragPlugin/index.ts":h,"./rowGroupSettingPlugin/index.ts":W,"./varialbleHeightPlugin/index.tsx":C,"./virtualTreePlugin/index.ts":k}));export{S as default};
|
|
@@ -46,7 +46,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
46
46
|
formRef: import("vue").Ref<HTMLElement | null>;
|
|
47
47
|
isShow: import("vue").Ref<boolean>;
|
|
48
48
|
timePickerRef: import("vue").Ref<any>;
|
|
49
|
-
|
|
49
|
+
formattedValue: import("vue").Ref<any>;
|
|
50
|
+
__formattedValue: import("vue").Ref<any>;
|
|
50
51
|
oldValue: string | undefined;
|
|
51
52
|
placeholder: any;
|
|
52
53
|
valueFormat: any;
|
|
@@ -54,8 +55,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
54
55
|
timeConfig: AnyObject;
|
|
55
56
|
clickShortcutOption: (item: string) => void;
|
|
56
57
|
onUpdateFormattedValue: (value: string) => void;
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
onChange: () => void;
|
|
59
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
59
60
|
NInput: any;
|
|
60
61
|
NPopover: any;
|
|
61
62
|
NSpace: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as
|
|
1
|
+
import{defineComponent as e,useAttrs as l,ref as t,watch as a,nextTick as o,openBlock as r,createBlock as u,unref as i,mergeProps as n,withCtx as m,createVNode as c,createElementBlock as v,Fragment as d,renderList as f,createTextVNode as s,toDisplayString as p,createCommentVNode as _}from"vue";import{NPopover as k,NInput as h,NSpace as y,NScrollbar as w,NButton as g}from"naive-ui";import{useIhoTableFormEvent as b}from"../../../../utils/index.js";import{useAutoFocus as V}from"../hooks/useAutoFocus.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as j,format as q}from"date-fns";import x from"../../../../../../../_virtual/plugin-vue_export-helper.js";var R=x(e({__name:"editTime",props:{formattedValue:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:formattedValue","click"],setup(e,{emit:x}){const R=e,S=l(),{emitFormChangeWithParams:A}=b(R),{formRef:I,isShow:O}=V(),P=t(),$=t(),E=t();let H=R.formattedValue;const{placeholder:T="请选择",valueFormat:U="HH:mm",shortcutOptions:z=[]}=S,D={placeholder:T,valueFormat:U,format:U};function K(e){E.value=e,H!==e&&(x("update:formattedValue",e),A({oldValue:H}),H=e)}function N(){[D.valueFormat.replace(/:/,""),D.valueFormat].some((e=>{const l=F($.value||"",e,new Date);if(j(l)){return K(q(l,D.valueFormat)),!0}}))}function W(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=I.value)||l.blur(),O.value=!1)}return a((()=>R.formattedValue),(e=>{$.value=e,E.value=e}),{immediate:!0}),a((()=>O.value),(async e=>{var l,t,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(t=null==(l=P.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(e,l)=>(r(),u(i(k),n({show:i(O),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},e.$attrs,{onClickoutside:l[3]||(l[3]=()=>O.value=!1)}),{trigger:m((()=>[c(i(h),{ref_key:"formRef",ref:I,clearable:"",value:$.value,"onUpdate:value":l[0]||(l[0]=e=>$.value=e),onClick:l[1]||(l[1]=()=>O.value=!0),onChange:N,onKeydown:W},null,8,["value"])])),default:m((()=>[c(i(y),null,{default:m((()=>[c(i(C),n({ref_key:"timePickerRef",ref:P,show:"","formatted-value":E.value},i(D),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":K,onConfirm:l[2]||(l[2]=()=>O.value=!1)}),null,16,["formatted-value"]),c(i(w),{class:"iho-table__scrollbar"},{default:m((()=>[i(z).length?(r(),u(i(y),{key:0,vertical:"",wrap:!1},{default:m((()=>[(r(!0),v(d,null,f(i(z),(e=>(r(),u(i(g),{size:"tiny",key:e,onClick:l=>function(e){K(e),O.value=!1}(e)},{default:m((()=>[s(p(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):_("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}}),[["__file","editTime.vue"]]);export{R as default};
|