cnhis-design-vue 3.1.50-release.3 → 3.1.51-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/es/components/base-search/index.d.ts +14 -8
- package/es/components/base-search/src/index.vue.d.ts +14 -8
- package/es/components/base-search/src/index.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
- package/es/components/field-set/index.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/form-config/index.d.ts +174 -25
- package/es/components/form-config/src/FormConfig.vue.d.ts +175 -26
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +4 -4
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +13 -10
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +121 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.js +1 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -0
- package/es/components/form-config/src/constants/index.d.ts +19 -1
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/src/hooks/useDataNormalize.d.ts +1 -1
- package/es/components/form-config/src/hooks/useDataNormalize.js +1 -1
- package/es/components/form-config/src/types/index.d.ts +7 -3
- package/es/components/form-config/style/index.css +1 -1
- package/es/components/form-render/index.d.ts +4 -4
- package/es/components/form-render/src/FormRender.vue.d.ts +2 -2
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +4 -4
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -2
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/hooks/useLowCodeReactions.d.ts +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
- package/es/components/form-render/src/types/index.d.ts +1 -19
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +2 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +13 -13
- package/es/components/info-header/src/InfoHeader.vue.d.ts +13 -13
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -1
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +5 -5
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +4 -4
- package/es/components/quick-search/index.d.ts +13 -8
- package/es/components/quick-search/src/index.vue.d.ts +13 -8
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +6 -5
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -5
- package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue.d.ts +58 -0
- package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +56 -1
- package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +4 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +55 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +2 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.d.ts +1 -7
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +6 -0
- package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +19 -1
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +20 -0
- package/es/shared/utils/business.d.ts +1 -2
- package/package.json +2 -2
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { FormLowCodeReactions, LOW_CODE_VALUE_RELATION } from '../../../../../es/shared/types';
|
|
2
|
+
import { FormConfigItem } from '../../../../../es/components/form-config';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: ArrayConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
default: () => never[];
|
|
8
|
+
};
|
|
9
|
+
}, {
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: FormLowCodeReactions.Config[];
|
|
12
|
+
};
|
|
13
|
+
emit: (event: "update:modelValue" | "validateFailure", ...args: any[]) => void;
|
|
14
|
+
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
15
|
+
valueRef: import("vue").Ref<{
|
|
16
|
+
conObj: {
|
|
17
|
+
con: LOW_CODE_VALUE_RELATION;
|
|
18
|
+
field_key: string;
|
|
19
|
+
value: unknown;
|
|
20
|
+
}[];
|
|
21
|
+
sqlExpression?: string | undefined;
|
|
22
|
+
showField?: string[] | undefined;
|
|
23
|
+
hideField?: string[] | undefined;
|
|
24
|
+
requiredField?: string[] | undefined;
|
|
25
|
+
notRequiredField?: string[] | undefined;
|
|
26
|
+
enabledField?: string[] | undefined;
|
|
27
|
+
disabledField?: string[] | undefined;
|
|
28
|
+
__oppositeBindField?: any | undefined;
|
|
29
|
+
__oppositeTargetField?: any | undefined;
|
|
30
|
+
}[]>;
|
|
31
|
+
expandedName: import("vue").Ref<string>;
|
|
32
|
+
addConnection: () => void;
|
|
33
|
+
removeConnection: (index: number) => void;
|
|
34
|
+
getOppositeBtnText: (item: FormLowCodeReactions.Config) => string | undefined;
|
|
35
|
+
unBindOpposite: (item: FormLowCodeReactions.Config) => void;
|
|
36
|
+
addOppositeCondition: (item: FormLowCodeReactions.Config) => void;
|
|
37
|
+
getOppositeSqlExpression: (expression?: string) => string | undefined;
|
|
38
|
+
createOppositeCondition: (config: FormLowCodeReactions.Config) => FormLowCodeReactions.Config;
|
|
39
|
+
isOppositeConfig: (c1: FormLowCodeReactions.Config, c2: FormLowCodeReactions.Config) => boolean;
|
|
40
|
+
onUpdateExpandedNames: (value: string[]) => void;
|
|
41
|
+
getBinderFieldDesc: (index: number) => string;
|
|
42
|
+
addCondition: (config: FormLowCodeReactions.Config) => void;
|
|
43
|
+
removeCondition: (config: FormLowCodeReactions.Config, index: number) => void;
|
|
44
|
+
onUpdateConditionType: (condition: FormLowCodeReactions.ConObj, type: LOW_CODE_VALUE_RELATION) => void;
|
|
45
|
+
showRef: import("vue").Ref<boolean>;
|
|
46
|
+
fieldListRef: import("vue").Ref<FormConfigItem[]>;
|
|
47
|
+
fieldOptions: import("vue").ComputedRef<FormConfigItem[]>;
|
|
48
|
+
currentTypeList: string[];
|
|
49
|
+
dialog: import("naive-ui").DialogApi;
|
|
50
|
+
onNegativeClick: () => Promise<void>;
|
|
51
|
+
onPositiveClick: () => Promise<void>;
|
|
52
|
+
configValidate: () => Promise<void>;
|
|
53
|
+
HelpCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
54
|
+
NButton: any;
|
|
55
|
+
NModal: any;
|
|
56
|
+
NSpace: any;
|
|
57
|
+
NScrollbar: any;
|
|
58
|
+
NThing: any;
|
|
59
|
+
NInputGroup: import("vue").DefineComponent<{
|
|
60
|
+
[x: string]: never;
|
|
61
|
+
[x: number]: never;
|
|
62
|
+
[x: symbol]: never;
|
|
63
|
+
}, {
|
|
64
|
+
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
65
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
66
|
+
[x: string]: never;
|
|
67
|
+
[x: number]: never;
|
|
68
|
+
[x: symbol]: never;
|
|
69
|
+
}>>, {}>;
|
|
70
|
+
NSelect: any;
|
|
71
|
+
NInput: any;
|
|
72
|
+
NCollapse: any;
|
|
73
|
+
NCollapseItem: import("vue").DefineComponent<{
|
|
74
|
+
readonly title: StringConstructor;
|
|
75
|
+
readonly name: import("vue").PropType<string | number>;
|
|
76
|
+
readonly disabled: BooleanConstructor;
|
|
77
|
+
readonly displayDirective: import("vue").PropType<"if" | "show">;
|
|
78
|
+
}, {
|
|
79
|
+
rtlEnabled: import("vue").Ref<import("naive-ui/es/config-provider/src/internal-interface").RtlItem | undefined> | undefined;
|
|
80
|
+
collapseSlots: Readonly<{
|
|
81
|
+
[name: string]: import("vue").Slot | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
randomName: string;
|
|
84
|
+
mergedClsPrefix: import("vue").Ref<string>;
|
|
85
|
+
collapsed: import("vue").ComputedRef<boolean>;
|
|
86
|
+
mergedDisplayDirective: import("vue").ComputedRef<"if" | "show">;
|
|
87
|
+
arrowPlacement: import("vue").ComputedRef<"left" | "right">;
|
|
88
|
+
handleClick(e: MouseEvent): void;
|
|
89
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
90
|
+
readonly title: StringConstructor;
|
|
91
|
+
readonly name: import("vue").PropType<string | number>;
|
|
92
|
+
readonly disabled: BooleanConstructor;
|
|
93
|
+
readonly displayDirective: import("vue").PropType<"if" | "show">;
|
|
94
|
+
}>>, {
|
|
95
|
+
readonly disabled: boolean;
|
|
96
|
+
}>;
|
|
97
|
+
NEllipsis: any;
|
|
98
|
+
NEmpty: any;
|
|
99
|
+
NTooltip: any;
|
|
100
|
+
NIcon: any;
|
|
101
|
+
conditionTypeOptions: {
|
|
102
|
+
value: LOW_CODE_VALUE_RELATION;
|
|
103
|
+
label: string;
|
|
104
|
+
}[];
|
|
105
|
+
connectionTypeOptions: {
|
|
106
|
+
value: string;
|
|
107
|
+
label: string;
|
|
108
|
+
}[];
|
|
109
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "validateFailure")[], "update:modelValue" | "validateFailure", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
110
|
+
modelValue: {
|
|
111
|
+
type: ArrayConstructor;
|
|
112
|
+
required: true;
|
|
113
|
+
default: () => never[];
|
|
114
|
+
};
|
|
115
|
+
}>> & {
|
|
116
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
117
|
+
onValidateFailure?: ((...args: any[]) => any) | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
modelValue: unknown[];
|
|
120
|
+
}>;
|
|
121
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./FormConfigEventSetting.vue2.js";import t from"../../../../_virtual/_plugin-vue_export-helper.js";var r=t(e,[["__file","FormConfigEventSetting.vue"]]);export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,ref as l,watchEffect as o,watch as n,inject as i,computed as t,reactive as a,openBlock as s,createElementBlock as d,createVNode as u,unref as p,withCtx as r,createTextVNode as c,normalizeStyle as _,createElementVNode as v,Fragment as f,renderList as m,createBlock as h,toDisplayString as g,withModifiers as y,createCommentVNode as b,normalizeClass as F}from"vue";import{useTheme as k}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{cloneDeep as x,isEmpty as O,isArray as j,union as C,omit as T}from"lodash-es";import{traverse as B}from"../../../../shared/utils/index.js";import{HelpCircleSharp as E}from"@vicons/ionicons5";import{useDialog as N,NButton as U,NModal as L,NScrollbar as z,NCollapse as q,NCollapseItem as w,NEllipsis as P,NThing as R,NSpace as $,NInputGroup as I,NSelect as A,NInput as D,NTooltip as V,NIcon as M,NEmpty as W}from"naive-ui";import{conditionOppositeMap as H,connectionTypeOptions as S,connectionTypeOppositeMap as X,InjectionFieldList as G,conditionTypeOptions as J}from"../constants/index.js";const K={class:"form-config__connectionOperation"},Q={class:"form-config__connectionConditionHeaderDesc"},Y={class:"form-config__connectionCondition"},Z={class:"form-config__connectionConditionItem"},ee={style:{"margin-right":"8px"}},le={class:"form-config__connectionFieldType"},oe=["onClick"],ne={style:{display:"inline-flex","align-items":"center",gap:"4px","margin-bottom":"4px"}};var ie=e({__name:"FormConfigEventSetting",props:{modelValue:{default:()=>[]}},emits:["update:modelValue","validateFailure"],setup(e,{emit:ie}){const te=e,ae=k(),se=l([]),de=l("");function ue(){se.value.push({conObj:[]}),de.value=se.value.length-1+""}function pe(e){return e.__oppositeBindField?`已绑定互斥联动: 联动${se.value.findIndex((l=>l===e.__oppositeBindField))+1}`:e.__oppositeTargetField?`已关联互斥联动: 联动${se.value.findIndex((l=>l===e.__oppositeTargetField))+1}`:void 0}function re(e){return null==e?void 0:e.replace(/(AND|OR)/g,(e=>"AND"===e?"OR":"AND"))}function ce(e){var l;const o=e.__oppositeTargetField||{conObj:[]};return o.conObj=x(e.conObj),null==(l=o.conObj)||l.forEach((e=>{e.con=H[e.con]})),o.sqlExpression=re(e.sqlExpression),S.forEach((({value:l})=>{O(e[l])?Reflect.deleteProperty(o,X[l]):o[X[l]]=x(e[l])})),o.__oppositeBindField=e,o}function _e(e,l){var o,n,i,t;return(null==(o=e.conObj)?void 0:o.length)===(null==(n=l.conObj)?void 0:n.length)&&(!(e.conObj&&l.conObj&&e.conObj.some((e=>!l.conObj.find((l=>{return n=l,(o=e).field_key===n.field_key&&o.con&&H[o.con]===n.con&&o.value===n.value;var o,n})))))&&(i=e.sqlExpression,t=l.sqlExpression,(!i&&!t||re(i)===t)&&!S.some((({value:o})=>{return n=e[o],i=l[X[o]],!(n&&i?n.length===i.length&&n.every((e=>i.some((l=>e===l)))):!n&&!i);var n,i}))))}function ve(e){de.value=e[0]}function fe(e){const l=se.value[e];if(!l)return"";const o=l.conObj||[],n=S.reduce(((e,{value:o})=>(j(l[o])&&l[o].length&&e.push(...l[o].map(t)),e)),[]),i=C([...o.map((({field_key:e})=>t(e))),...n]).filter((e=>!!e));return i.length?`( 相关字段: ${i} )`:"";function t(e){var l,o;return null!=(o=null==(l=ge.value.find((l=>e===l.key)))?void 0:l.name)?o:e}}o((()=>{se.value.forEach((e=>{e.__oppositeTargetField&&(e.__oppositeTargetField=ce(e))}))}));const me=l(!1);n(me,(e=>{e&&(se.value=x(te.modelValue),se.value.forEach(((e,l)=>{if(e.__oppositeBindField||e.__oppositeTargetField)return;const o=se.value.find(((o,n)=>n!==l&&!o.__oppositeBindField&&!o.__oppositeTargetField&&_e(o,e)));o&&(o.__oppositeBindField=e,e.__oppositeTargetField=o)})))}));const he=i(G,l([])),ge=t((()=>{const e=[];return B(he.value,(l=>{!["NEWLINE","LINE_BAR","COMPLEX","COMBINATION"].includes(l.type)&&e.push(l)})),e})),ye=a([]),be=N();async function Fe(){be.warning({title:"提示",content:"直接关闭弹窗会丢失已编辑的配置, 确定要关闭吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{me.value=!1,se.value=[]}})}async function ke(){try{await function(){var e;const l=[];return null==(e=se.value)||e.forEach(((e,o)=>{const n=[];e.conObj&&e.conObj.length?e.conObj.forEach(((e,l)=>{e.field_key||n.push(`条件${l+1}字段为空`),e.con||n.push(`条件${l+1}判断类型为空`),["NULL","NOT_NULL"].includes(e.con)||!e.con||e.value||n.push(`条件${l+1}值为空`)})):n.push("联动条件为空"),S.every((({value:l})=>!e[l]||!e[l].length))&&n.push("联动字段为空"),n.length&&l.push(`联动${o+1}: ${n}`)})),l.length?Promise.reject(l):Promise.resolve()}(),me.value=!1,ie("update:modelValue",se.value.map((e=>T(e,["__oppositeBindField","__oppositeTargetField"]))))}catch(e){ie("validateFailure",e)}}return(e,l)=>(s(),d("section",null,[u(p(U),{size:"small",onClick:l[0]||(l[0]=e=>me.value=!0)},{default:r((()=>[c("调整联动绑定")])),_:1}),u(p(L),{show:me.value,"onUpdate:show":l[1]||(l[1]=e=>me.value=e),closable:!1,bordered:!1,"show-icon":!1,title:"联动绑定设置",preset:"dialog","mask-closable":!1,"close-on-esc":!1,style:_({width:"1000px",...p(ae)}),class:"form-config__connectionModal"},{action:r((()=>[u(p(U),{size:"small",onClick:Fe},{default:r((()=>[c("取消")])),_:1}),u(p(U),{size:"small",onClick:ke,type:"primary"},{default:r((()=>[c("确定")])),_:1})])),default:r((()=>[v("header",K,[u(p(U),{onClick:ue,size:"small"},{default:r((()=>[c("新增联动")])),_:1})]),u(p(z),{style:{"max-height":"500px","min-height":"500px"}},{default:r((()=>[u(p(q),{accordion:"","expanded-names":de.value,"onUpdate:expandedNames":ve},{default:r((()=>[(s(!0),d(f,null,m(se.value,((e,l)=>(s(),h(p(w),{name:l+""},{header:r((()=>[c(" 联动"+g(l+1)+" ",1),u(p(P),{class:"form-config__connectionConditionHeaderDesc",style:{"max-width":"500px"}},{default:r((()=>[c(g(fe(l)),1)])),_:2},1024)])),"header-extra":r((()=>[e.__oppositeBindField||e.__oppositeTargetField?(s(),d(f,{key:1},[v("span",Q,"( "+g(pe(e))+" )",1),u(p(U),{quaternary:"",type:"primary",size:"small",onClick:y((l=>function(e){const l=e.__oppositeTargetField||e.__oppositeBindField;l&&[l,e].forEach((e=>{Reflect.deleteProperty(e,"__oppositeBindField"),Reflect.deleteProperty(e,"__oppositeTargetField")}))}(e)),["stop"])},{default:r((()=>[c("解除互斥")])),_:2},1032,["onClick"])],64)):(s(),h(p(U),{key:0,onClick:y((l=>function(e){se.value.push(e.__oppositeTargetField=ce(e))}(e)),["stop"]),quaternary:"",type:"primary",size:"small"},{default:r((()=>[c(" 创建互斥条件 ")])),_:2},1032,["onClick"])),u(p(U),{onClick:y((e=>function(e){var l;const o=null==(l=se.value)?void 0:l.splice(e,1);null==o||o.forEach((e=>{const l=e.__oppositeTargetField||e.__oppositeBindField;l&&(Reflect.deleteProperty(l,"__oppositeTargetField"),Reflect.deleteProperty(l,"__oppositeBindField"))})),ye.splice(e,1),!de.value||+de.value<e||(de.value=de.value===e+""?"":+de.value-1+"")}(l)),["stop"]),quaternary:"",type:"error",size:"small"},{default:r((()=>[c("移除")])),_:2},1032,["onClick"])])),default:r((()=>[u(p(R),{class:"form-config__connectionWrapper"},{default:r((()=>[u(p($),{justify:"space-between",wrap:!1},{default:r((()=>[v("section",Y,[v("header",null,[c(" 条件 "),e.__oppositeBindField?b("v-if",!0):(s(),h(p(U),{key:0,size:"small",quaternary:"",type:"primary",onClick:l=>{var o;j((o=e).conObj)?o.conObj.push({}):o.conObj=[{}]}},{default:r((()=>[c(" 添加条件 ")])),_:2},1032,["onClick"]))]),u(p(z),{style:{"max-height":"145px","min-height":"145px"},class:"form-config__connectionWrapper"},{default:r((()=>[(s(!0),d(f,null,m(e.conObj||[],((l,o)=>(s(),d("div",Z,[v("span",ee,g(o+1),1),u(p(I),{size:"small"},{default:r((()=>[u(p(A),{value:l.field_key,"onUpdate:value":e=>l.field_key=e,disabled:!!e.__oppositeBindField,placeholder:"请选择字段",options:p(ge),"label-field":"name","value-field":"key",filterable:""},null,8,["value","onUpdate:value","disabled","options"]),u(p(A),{value:l.con,disabled:!!e.__oppositeBindField,"onUpdate:value":e=>function(e,l){e.con=l,["NOT_NULL","NULL"].includes(l)&&Reflect.deleteProperty(e,"value")}(l,e),placeholder:"请选择判断类型",options:p(J)},null,8,["value","disabled","onUpdate:value","options"]),l.con&&!["NULL","NOT_NULL"].includes(l.con)?(s(),h(p(D),{key:0,disabled:!!e.__oppositeBindField,value:l.value,"onUpdate:value":e=>l.value=e,placeholder:"请输入值",clearable:""},null,8,["disabled","value","onUpdate:value"])):b("v-if",!0)])),_:2},1024),u(p(U),{disabled:!!e.__oppositeBindField,quaternary:"",onClick:l=>function(e,l){j(e.conObj)&&e.conObj.splice(l,1)}(e,o),type:"error",size:"small"},{default:r((()=>[c(" 移除 ")])),_:2},1032,["disabled","onClick"])])))),256))])),_:2},1024)]),v("section",le,[v("div",null,[(s(!0),d(f,null,m(p(S),(o=>{var n,i;return s(),d("div",{key:o.value,class:F({"is-active":ye[l]===o.value}),onClick:e=>ye[l]=o.value},g(o.label)+" ( "+g(null!=(i=null==(n=e[o.value])?void 0:n.length)?i:0)+" ) ",11,oe)})),128))]),v("div",null,[ye[l]?(s(),h(p(A),{key:0,value:e[ye[l]],"onUpdate:value":o=>e[ye[l]]=o,disabled:!!e.__oppositeBindField,multiple:"",placeholder:"请选择字段",options:p(ge),"label-field":"name","value-field":"key",filterable:"","max-tag-count":10},null,8,["value","onUpdate:value","disabled","options"])):b("v-if",!0)])])])),_:2},1024),v("section",null,[v("label",null,[v("span",ne,[c(" 条件逻辑 "),u(p(V),null,{trigger:r((()=>[u(p(M),{size:"16",component:p(E)},null,8,["component"])])),default:r((()=>[c(" 非必填, 默认为需要全部满足. 示例: (1 AND 2) OR 3, 表示 条件1和2需要满足其一, 条件3必须满足 ")])),_:1})]),u(p(D),{value:e.sqlExpression,"onUpdate:value":l=>e.sqlExpression=l,disabled:!!e.__oppositeBindField,placeholder:"请输入条件逻辑"},null,8,["value","onUpdate:value","disabled"])])])])),_:2},1024)])),_:2},1032,["name"])))),256))])),_:1},8,["expanded-names"]),se.value.length?b("v-if",!0):(s(),h(p(W),{key:0,size:"huge",style:{"margin-top":"20px"},description:"无联动配置"}))])),_:1})])),_:1},8,["show","style"])]))}});export{ie as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UndefinedAble } from '../../../../../es/shared/types';
|
|
1
|
+
import { FormLowCodeReactions, LOW_CODE_VALUE_RELATION, UndefinedAble } from '../../../../../es/shared/types';
|
|
2
2
|
import { InjectionKey, Ref } from 'vue';
|
|
3
3
|
import { FormConfigItem } from '../../../../../es/components/form-config';
|
|
4
4
|
export declare const WidgetTextMap: Map<string, string>;
|
|
@@ -77,8 +77,26 @@ export declare function isVisibleOptionConfig(): {
|
|
|
77
77
|
value: boolean;
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
|
+
export declare const conditionOppositeMap: Record<LOW_CODE_VALUE_RELATION, LOW_CODE_VALUE_RELATION>;
|
|
81
|
+
export declare const conditionTypeOptions: {
|
|
82
|
+
value: LOW_CODE_VALUE_RELATION;
|
|
83
|
+
label: string;
|
|
84
|
+
}[];
|
|
85
|
+
export declare const connectionTypeOppositeMap: {
|
|
86
|
+
showField: string;
|
|
87
|
+
hideField: string;
|
|
88
|
+
requiredField: string;
|
|
89
|
+
notRequiredField: string;
|
|
90
|
+
enabledField: string;
|
|
91
|
+
disabledField: string;
|
|
92
|
+
};
|
|
93
|
+
export declare const connectionTypeOptions: {
|
|
94
|
+
value: string;
|
|
95
|
+
label: string;
|
|
96
|
+
}[];
|
|
80
97
|
export declare const FORM_CONFIG_GROUP = "__display";
|
|
81
98
|
export declare const InjectionFieldList: InjectionKey<Ref<FormConfigItem[]>>;
|
|
82
99
|
export declare const InjectionMaterialList: InjectionKey<Ref<FormConfigItem[]>>;
|
|
100
|
+
export declare const InjectionLowCodeReactions: InjectionKey<Ref<FormLowCodeReactions.Config[]>>;
|
|
83
101
|
export declare const InjectionActiveFieldItem: InjectionKey<Ref<UndefinedAble<FormConfigItem>>>;
|
|
84
102
|
export declare const InjectionFormConfigEmit: InjectionKey<(event: 'addItem' | 'removeItem', ...args: unknown[]) => void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{range as e}from"lodash-es";const
|
|
1
|
+
import{range as e}from"lodash-es";const l=new Map([["LINE_BAR","分线栏"],["NEWLINE","分行符"]]);var a=(e=>(e.NAME="name",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialHigh",e))(a||{});function i(){return{option:[{text:"整行",value:"ALL_LINE"},{text:"半行",value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function t(){return{option:e(1,11).map((e=>({text:`${e}行`,value:e})))}}function u(){return{open:{describe:"默认展开",value:!0},close:{describe:"默认收起",value:!1}}}function d(){return{open:{describe:"可折叠",value:!0},close:{describe:"不可折叠",value:!1}}}function n(){return{open:{describe:"可编辑",value:!0},close:{describe:"不可编辑",value:!1}}}function o(){return{open:{describe:"必填",value:!0},close:{describe:"不必填",value:!1}}}function E(){return{open:{describe:"显示",value:!0},close:{describe:"隐藏",value:!1}}}const r={EQ:"NEQ",NEQ:"EQ",CL:"NC",NC:"CL",NULL:"NOT_NULL",NOT_NULL:"NULL",BIG:"LESSEQ",BIGEQ:"LESS",LESS:"BIGEQ",LESSEQ:"BIG"},b=[{value:"EQ",label:"等于"},{value:"NEQ",label:"不等于"},{value:"CL",label:"包含"},{value:"NC",label:"不包含"},{value:"NULL",label:"为空"},{value:"NOT_NULL",label:"不为空"},{value:"BIG",label:"大于"},{value:"BIGEQ",label:"大于等于"},{value:"LESS",label:"小于"},{value:"LESSEQ",label:"小于等于"}],v={showField:"hideField",hideField:"showField",requiredField:"notRequiredField",notRequiredField:"requiredField",enabledField:"disabledField",disabledField:"enabledField"},L=[{value:"showField",label:"显示字段"},{value:"hideField",label:"隐藏字段"},{value:"requiredField",label:"必填字段"},{value:"notRequiredField",label:"非必填字段"},{value:"enabledField",label:"启用字段"},{value:"disabledField",label:"禁用字段"}],c="__display",s=Symbol("InjectionFieldList"),F=Symbol("InjectionMaterialList"),N=Symbol("InjectionLowCodeReactions"),I=Symbol("InjectionActiveFieldItem"),S=Symbol("InjectionFormConfigEmit");export{a as EditAbleField,c as FORM_CONFIG_GROUP,I as InjectionActiveFieldItem,s as InjectionFieldList,S as InjectionFormConfigEmit,N as InjectionLowCodeReactions,F as InjectionMaterialList,l as WidgetTextMap,r as conditionOppositeMap,b as conditionTypeOptions,v as connectionTypeOppositeMap,L as connectionTypeOptions,n as isEditOptionConfig,d as isNotFoldOptionConfig,o as isNullOptionConfig,u as isShowOptionConfig,E as isVisibleOptionConfig,t as rowsOptionConfig,i as widgetWidthOptionConfig};
|
|
@@ -3,5 +3,5 @@ export declare function useDataNormalize(props: {
|
|
|
3
3
|
fieldVisitor?: FormConfigVisitor;
|
|
4
4
|
}): {
|
|
5
5
|
transform: (fieldList: FormConfigItem[]) => FormConfigItem[];
|
|
6
|
-
inverseTransform: (fieldList: FormConfigItem[], withOriginalSetting: boolean) => FormConfigItem[];
|
|
6
|
+
inverseTransform: (fieldList: FormConfigItem[], withOriginalSetting: boolean, otherConfig?: Partial<FormConfigItem>) => FormConfigItem[];
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject as e,omit as n}from"lodash-es";function r(r){return{transform:function(n){let i=null;const t=r.fieldVisitor;return n.reduce(((n,r)=>(r.originalSetting&&e(t)&&t[r.key]&&t[r.key]({field:r.originalSetting,replace(e){r.originalSetting=e}}),"LINE_BAR"===r.type?(r.children=[],i=r.children,n.push(r),n):i?(i.push(r),n):(n.push(r),n))),[])},inverseTransform:function(e,r){return e.reduce(((e,r)=>("LINE_BAR"===r.type?(e.push(n(r,["children"])),e.push(...r.children||[])):e.push(r),e)),[]).map((e=>r?e:n(e,["originalSetting"])))}}}export{r as useDataNormalize};
|
|
1
|
+
import{isObject as e,omit as n}from"lodash-es";function r(r){return{transform:function(n){let i=null;const t=r.fieldVisitor;return n.reduce(((n,r)=>(r.originalSetting&&e(t)&&t[r.key]&&t[r.key]({field:r.originalSetting,replace(e){r.originalSetting=e}}),"LINE_BAR"===r.type?(r.children=[],i=r.children,n.push(r),n):i?(i.push(r),n):(n.push(r),n))),[])},inverseTransform:function(e,r,i){return e.reduce(((e,r)=>("LINE_BAR"===r.type?(e.push(n(r,["children"])),e.push(...r.children||[])):e.push(r),e)),[]).map((e=>{const t=r?e:n(e,["originalSetting"]);return i?{...t,...i}:t}))}}}export{r as useDataNormalize};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, FunctionalComponent } from 'vue';
|
|
2
|
-
import { ArrayAble } from '../../../../../es/shared/types';
|
|
2
|
+
import { ArrayAble, FormLowCodeReactions } from '../../../../../es/shared/types';
|
|
3
3
|
import { FieldItem } from '../../../../../es/components/form-render';
|
|
4
4
|
interface Matcher {
|
|
5
5
|
(type: string): boolean;
|
|
@@ -36,9 +36,13 @@ export interface FormConfigTextFormatter {
|
|
|
36
36
|
(formConfigItem: FormConfigItem, parsedText: string): string;
|
|
37
37
|
}
|
|
38
38
|
export interface FormConfigExpose {
|
|
39
|
-
loadData(payload: Record<'fieldList', FormConfigItem[]>
|
|
39
|
+
loadData(payload: Record<'fieldList', FormConfigItem[]> & {
|
|
40
|
+
lowCodeReactions?: FormLowCodeReactions.Config[];
|
|
41
|
+
}): void;
|
|
40
42
|
validate(): Promise<unknown>;
|
|
41
|
-
getData(withOriginalSetting?: boolean): Record<'fieldList' | 'materialList', FormConfigItem[]
|
|
43
|
+
getData(withOriginalSetting?: boolean): Record<'fieldList' | 'materialList', FormConfigItem[]> & {
|
|
44
|
+
lowCodeReactions: FormLowCodeReactions.Config[];
|
|
45
|
+
};
|
|
42
46
|
clearExtraList(): void;
|
|
43
47
|
}
|
|
44
48
|
interface FieldVisitorContext {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.form-config,.form-config__material{display:flex;justify-content:space-between}.form-config__material{border-radius:8px;box-sizing:border-box;flex-direction:column;flex-shrink:0;padding:16px;width:200px}.form-config__materialHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__materialContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;flex-shrink:0;flex:1;gap:8px;max-height:var(--max-height);min-height:200px;overflow-y:auto;padding:16px}.form-config__materialExtraList{margin-top:12px}.form-config__displayWrapper{border-radius:8px;box-sizing:border-box;flex-shrink:0;flex:1;min-width:400px;padding:16px 0}.form-config__displayHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__displayContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:grid!important;flex-shrink:0;gap:8px;grid-template-columns:repeat(24,minmax(0,1fr));height:fit-content;max-height:var(--max-height);overflow-y:auto;padding:16px}.form-config__displayContentItem{grid-column:span var(--item-column) /span var(--item-column);position:relative}.form-config__config{border-radius:8px;box-sizing:border-box;flex-shrink:0;padding:16px;width:240px}.form-config__configHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__configContent{border:none;border-radius:8px;box-sizing:border-box;flex-shrink:0;max-height:var(--max-height);min-height:38px;overflow-y:auto;padding:16px}.form-config__renderer{box-sizing:border-box;cursor:move;justify-content:flex-start;width:100%}.form-config__renderer--default{align-items:center;box-sizing:border-box;display:flex;padding:8px 0;position:relative;user-select:none;width:100%}.form-config__renderer--defaultWrapper{align-items:center;border-radius:2px;box-sizing:border-box;display:inline-flex;height:34px;padding:0 14px;transition:all .3s linear}.form-config__renderer--defaultWrapper.is-disabled{background-color:transparent;border:1px dashed var(--c-primary-color)}.form-config__renderer--defaultWrapper:not(.is-disabled){background-color:rgba(46,51,56,.05);border:1px dashed transparent}.form-config__renderer--defaultWrapper:not(.is-disabled):hover{background-color:rgba(46,51,56,.09)}.form-config__renderer--defaultWrapper:not(.is-disabled):active{background-color:rgba(46,51,56,.15)}.form-config__renderer--complex{border:1px dashed var(--c-primary-color);border-radius:8px;padding:8px}.form-config__renderer--complexHeader{display:flex;justify-content:center;margin-top:-8px;padding:8px;position:relative}.form-config__renderer--complex--grid{display:grid!important;gap:8px;grid-column:span var(--item-column) /span var(--item-column);grid-template-columns:repeat(24,minmax(0,1fr));min-height:24px}.form-config__renderer--complex--flex{display:flex;min-height:24px}.form-config .is-required{padding-left:16px!important}.form-config .is-required:before{color:red;content:"*";left:8px;position:absolute}.form-config .is-extra:before{border-bottom:6px solid transparent;border-left:6px solid var(--c-primary-color);border-right:6px solid transparent;border-top:6px solid var(--c-primary-color);content:"";height:0;left:0;position:absolute;top:0;width:0}.form-config .is-active{color:var(--c-primary-color)!important}.form-config .is-choosing{box-shadow:inset var(--c-primary-color) 0 0 0 2px;opacity:.7}.form-config .is-choosing-area{background:hsla(0,0%,50%,.1)}.form-config [is-hovering=true] .form-config__renderer--closeButton{visibility:visible}.form-config .form-config__renderer--closeButton{position:absolute;right:4px;top:50%;transform:translateY(-50%);visibility:hidden}
|
|
1
|
+
.form-config,.form-config__material{display:flex;justify-content:space-between}.form-config__material{border-radius:8px;box-sizing:border-box;flex-direction:column;flex-shrink:0;padding:16px;width:200px}.form-config__materialHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__materialContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;flex-shrink:0;flex:1;gap:8px;max-height:var(--max-height);min-height:200px;overflow-y:auto;padding:16px}.form-config__materialExtraList{margin-top:12px}.form-config__displayWrapper{border-radius:8px;box-sizing:border-box;flex-shrink:0;flex:1;min-width:400px;padding:16px 0}.form-config__displayHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__displayContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:grid!important;flex-shrink:0;gap:8px;grid-template-columns:repeat(24,minmax(0,1fr));height:fit-content;max-height:var(--max-height);overflow-y:auto;padding:16px}.form-config__displayContentItem{grid-column:span var(--item-column) /span var(--item-column);position:relative}.form-config__config{border-radius:8px;box-sizing:border-box;flex-shrink:0;padding:16px;width:240px}.form-config__configHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__configContent{border:none;border-radius:8px;box-sizing:border-box;flex-shrink:0;max-height:var(--max-height);min-height:38px;overflow-y:auto;padding:16px}.form-config__renderer{box-sizing:border-box;cursor:move;justify-content:flex-start;width:100%}.form-config__renderer--default{align-items:center;box-sizing:border-box;display:flex;padding:8px 0;position:relative;user-select:none;width:100%}.form-config__renderer--defaultWrapper{align-items:center;border-radius:2px;box-sizing:border-box;display:inline-flex;height:34px;padding:0 14px;transition:all .3s linear}.form-config__renderer--defaultWrapper.is-disabled{background-color:transparent;border:1px dashed var(--c-primary-color)}.form-config__renderer--defaultWrapper:not(.is-disabled){background-color:rgba(46,51,56,.05);border:1px dashed transparent}.form-config__renderer--defaultWrapper:not(.is-disabled):hover{background-color:rgba(46,51,56,.09)}.form-config__renderer--defaultWrapper:not(.is-disabled):active{background-color:rgba(46,51,56,.15)}.form-config__renderer--complex{border:1px dashed var(--c-primary-color);border-radius:8px;padding:8px}.form-config__renderer--complexHeader{display:flex;justify-content:center;margin-top:-8px;padding:8px;position:relative}.form-config__renderer--complex--grid{display:grid!important;gap:8px;grid-column:span var(--item-column) /span var(--item-column);grid-template-columns:repeat(24,minmax(0,1fr));min-height:24px}.form-config__renderer--complex--flex{display:flex;min-height:24px}.form-config .is-required{padding-left:16px!important}.form-config .is-required:before{color:red;content:"*";left:8px;position:absolute}.form-config .is-extra:before{border-bottom:6px solid transparent;border-left:6px solid var(--c-primary-color);border-right:6px solid transparent;border-top:6px solid var(--c-primary-color);content:"";height:0;left:0;position:absolute;top:0;width:0}.form-config .is-active{color:var(--c-primary-color)!important}.form-config .is-choosing{box-shadow:inset var(--c-primary-color) 0 0 0 2px;opacity:.7}.form-config .is-choosing-area{background:hsla(0,0%,50%,.1)}.form-config [is-hovering=true] .form-config__renderer--closeButton{visibility:visible}.form-config .form-config__renderer--closeButton{position:absolute;right:4px;top:50%;transform:translateY(-50%);visibility:hidden}.form-config__connectionModal .n-collapse .n-collapse-item:not(:first-of-type){margin-top:4px}.form-config__connectionModal .n-collapse .n-collapse-item .n-collapse-item__header{padding-top:4px}.form-config__connectionOperation{margin-bottom:8px}.form-config__connectionWrapper{border:1px solid #e5e5e5;border-radius:4px;padding:8px}.form-config__connectionCondition{width:450px}.form-config__connectionCondition>header{align-items:center;display:flex;gap:12px}.form-config__connectionConditionHeaderDesc{color:#a5a5a5;display:inline-block;margin-left:12px}.form-config__connectionConditionItem{align-items:center;display:flex;margin-bottom:4px}.form-config__connectionConditionItem>div:first-of-type{flex:1}.form-config__connectionFieldType{display:flex;height:100%}.form-config__connectionFieldType>div:first-of-type{display:flex;flex-direction:column;height:100%;justify-content:space-between;margin-right:-1px}.form-config__connectionFieldType>div:first-of-type>div{background:#f5f5f5;border:1px solid #e5e5e5;cursor:pointer;padding:2px 4px 2px 8px}.form-config__connectionFieldType>div:first-of-type>div:not(:last-of-type){margin-bottom:4px}.form-config__connectionFieldType>div:first-of-type>div.is-active{background:#fff;border-right-color:#fff;color:var(--c-primary-color);z-index:1}.form-config__connectionFieldType>div:nth-of-type(2){border:1px solid #e5e5e5;padding:8px;width:300px}
|
|
@@ -131,7 +131,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
131
131
|
default: boolean;
|
|
132
132
|
};
|
|
133
133
|
lowCodeReactions: {
|
|
134
|
-
type: import("vue").PropType<import("
|
|
134
|
+
type: import("vue").PropType<import("../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
135
135
|
};
|
|
136
136
|
operationalForm: {
|
|
137
137
|
type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -276,7 +276,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
276
276
|
default: boolean;
|
|
277
277
|
};
|
|
278
278
|
lowCodeReactions: {
|
|
279
|
-
type: import("vue").PropType<import("
|
|
279
|
+
type: import("vue").PropType<import("../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
280
280
|
};
|
|
281
281
|
operationalForm: {
|
|
282
282
|
type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -435,7 +435,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
435
435
|
businessFormatter: import("./src/types").FormBusinessFormatter;
|
|
436
436
|
requestInstance: import("./src/hooks").RequestInstance;
|
|
437
437
|
enterToNextWidget: boolean | ((fieldItem: import("./src/types").FieldItem) => boolean | void);
|
|
438
|
-
lowCodeReactions: import("
|
|
438
|
+
lowCodeReactions: import("../../../es/shared/types").FormLowCodeReactions.Config[];
|
|
439
439
|
linebarAutoHidden: boolean;
|
|
440
440
|
bordered: string | boolean;
|
|
441
441
|
uniqueCacheData: boolean;
|
|
@@ -846,7 +846,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
846
846
|
default: boolean;
|
|
847
847
|
};
|
|
848
848
|
lowCodeReactions: {
|
|
849
|
-
type: import("vue").PropType<import("
|
|
849
|
+
type: import("vue").PropType<import("../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
850
850
|
};
|
|
851
851
|
operationalForm: {
|
|
852
852
|
type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyObject, FormOperationalConfig } from '../../../../es/shared/types';
|
|
1
|
+
import { AnyObject, FormLowCodeReactions, FormOperationalConfig } from '../../../../es/shared/types';
|
|
2
2
|
import { Field } from '@formily/core';
|
|
3
3
|
import { Component, FunctionalComponent, PropType } from 'vue';
|
|
4
4
|
import { RequestInstance } from './hooks';
|
|
5
|
-
import { FieldItem, FieldVisitor, FormBusinessFormatter
|
|
5
|
+
import { FieldItem, FieldVisitor, FormBusinessFormatter } from './types';
|
|
6
6
|
declare const _default: import("vue").DefineComponent<{
|
|
7
7
|
fieldList: {
|
|
8
8
|
type: PropType<FieldItem[]>;
|
|
@@ -129,7 +129,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
129
129
|
default: boolean;
|
|
130
130
|
};
|
|
131
131
|
lowCodeReactions: {
|
|
132
|
-
type: import("vue").PropType<import("../../../../es/
|
|
132
|
+
type: import("vue").PropType<import("../../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
133
133
|
};
|
|
134
134
|
operationalForm: {
|
|
135
135
|
type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -274,7 +274,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
274
274
|
default: boolean;
|
|
275
275
|
};
|
|
276
276
|
lowCodeReactions: {
|
|
277
|
-
type: import("vue").PropType<import("../../../../es/
|
|
277
|
+
type: import("vue").PropType<import("../../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
278
278
|
};
|
|
279
279
|
operationalForm: {
|
|
280
280
|
type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -433,7 +433,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
433
433
|
businessFormatter: import("../../../../es/components/form-render").FormBusinessFormatter;
|
|
434
434
|
requestInstance: import("../../../../es/components/form-render").RequestInstance;
|
|
435
435
|
enterToNextWidget: boolean | ((fieldItem: import("../../../../es/components/form-render").FieldItem) => boolean | void);
|
|
436
|
-
lowCodeReactions: import("../../../../es/
|
|
436
|
+
lowCodeReactions: import("../../../../es/shared/types").FormLowCodeReactions.Config[];
|
|
437
437
|
linebarAutoHidden: boolean;
|
|
438
438
|
bordered: string | boolean;
|
|
439
439
|
uniqueCacheData: boolean;
|
|
@@ -844,7 +844,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
844
844
|
default: boolean;
|
|
845
845
|
};
|
|
846
846
|
lowCodeReactions: {
|
|
847
|
-
type: import("vue").PropType<import("../../../../es/
|
|
847
|
+
type: import("vue").PropType<import("../../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
848
848
|
};
|
|
849
849
|
operationalForm: {
|
|
850
850
|
type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as
|
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as n,formRenderLog as r}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"],{...i(o,["wordbook","autograph"])})}function d(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function u(u){const{createValidatorSchema:f}=l(),_=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"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","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const i=f(e);return i&&(t["x-validator"]=i),"0"===e.is_null&&(t.required=!0),t},x=e=>{var o;const t=_(e);e.urlConfig?d(t,e):e.autograph&&m(t,e);const r=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:r,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowModify:"1"===e.allowModify,allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate||"1"===e.allowModify,shouldSave:"1"===e.save_free_entry,showField:e.show_key,maxTagCount:n(e.multi_select_value),...i(e,["lazyRequest","requestCache"])}),r&&(t.type="array"),t},h=e=>{const o=_(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),e.urlConfig?d(o,e):e.autograph&&m(o,e),o},g=e=>{const t=_(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},y=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}}),b=new Map([["LINEBAR",y],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=_(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=_(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=_(e),{decimal_length:t,validate:i,allowSlash:n}=e;return!0!==n&&"1"!==n||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:null!=t?t:null==i?void 0:i.decimal_length,whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",x],["REMOTE_SEARCH",x],["DATE",e=>{const o=_(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=_(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=_(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=_(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,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",h],["CHECKBOX",h],["SWITCH",e=>{const o=_(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=_(e);return Object.assign(o["x-component-props"],{step:n(e.step_length),max:n(e.max_length),min:n(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=_(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?j(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"],i(e,["wrapperStyle","display"])),o}]]),v=e=>{if(e.suffixConfig)return w(e);return(b.get(e.html_type)||g)(e)},w=o=>{if(!o.suffixConfig&&!o.prefixConfig)return v(o);const t=o.suffixConfig?e(o.suffixConfig):[],i=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],n=_(o),r=i.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(n,{type:"void",name:a(i),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...n["x-decorator-props"],showFeedback:!1,suffixFields:i.map((e=>e.val_key))},properties:j(i)}),n},{FieldNormalizeWaterfallHook:C,FieldListNormalizeWaterfallHook:O}=s();function j(o,i={column:9999}){let n=null;return O.call(t(o),i).reduce(((e,o,a)=>{var p;const l=null==(p=(o=C.call(o,i)).validate)?void 0:p.obj_type;return l&&u&&u.collect(l,t(o)),"LINEBAR"===o.html_type?(e[s(o)]=r(y(o),a),n=e[s(o)].properties={}):n?n[s(o)]=r(v(o),a):(n=null,e[s(o)]=r(v(o),a)),e}),{});function r(e,o){return e["x-index"]=o,e}function s(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:j}}export{u as useFieldListAdaptor};
|
|
@@ -80,7 +80,7 @@ export declare function useFieldNormalize(): {
|
|
|
80
80
|
businessFormatter: import("../types").FormBusinessFormatter;
|
|
81
81
|
requestInstance: import("./useFormRequest").RequestInstance;
|
|
82
82
|
enterToNextWidget: boolean | ((fieldItem: FieldItem) => boolean | void);
|
|
83
|
-
lowCodeReactions: import("
|
|
83
|
+
lowCodeReactions: import("../../../../../es/shared/types").FormLowCodeReactions.Config[];
|
|
84
84
|
linebarAutoHidden: boolean;
|
|
85
85
|
bordered: string | boolean;
|
|
86
86
|
uniqueCacheData: boolean;
|
|
@@ -167,7 +167,7 @@ export declare function useFieldNormalize(): {
|
|
|
167
167
|
businessFormatter: import("../types").FormBusinessFormatter;
|
|
168
168
|
requestInstance: import("./useFormRequest").RequestInstance;
|
|
169
169
|
enterToNextWidget: boolean | ((fieldItem: FieldItem) => boolean | void);
|
|
170
|
-
lowCodeReactions: import("
|
|
170
|
+
lowCodeReactions: import("../../../../../es/shared/types").FormLowCodeReactions.Config[];
|
|
171
171
|
linebarAutoHidden: boolean;
|
|
172
172
|
bordered: string | boolean;
|
|
173
173
|
uniqueCacheData: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as
|
|
1
|
+
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as i,isNumber as a,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import"../../index.js";import{isIdCard as n}from"../utils/business.js";function o(){const i=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(i){var a;if(null!=i&&""!==i)return m(i)&&n(i)?void 0:null!=(a=null==e?void 0:e.message)?a:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:i,regular_error_tip:a})=>({pattern:i||(null==e?void 0:e.regular_expression)||"",message:a||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),a={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:n,min_length:o,message:u,max_value:t,min_value:g,decimal_length:d}={},validator:v}=m;if(v&&e(v).forEach((e=>{l(e)&&r.push({validator:i=>e(i,m)})})),n&&r.push({max:n,message:u}),o&&r.push({min:o,message:u}),t&&r.push({maximum:t,message:u}),g&&r.push({minimum:g,message:u}),null!=d&&r.push(((e,i)=>{const a=null!=i?i:`小数位数最多${e}位`;return{validator(i){var m;return(null==(m=String(i).split(".")[1])?void 0:m.length)>e?a:""}}})(+d,u)),s){const e=i.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},a,e(m)))}return r}}}const u=i((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,i)=>a(Number(i.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!a(e)||isNaN(e)?"":e>Number(i.maximum)&&i.message||""):"",minimum:(e,i)=>a(Number(i.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!a(e)||isNaN(e)?"":e<Number(i.minimum)&&i.message||""):""})}));export{o as useFormValidator,u as validateMessageLocale};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { FormLowCodeReactions } from '../../../../../es/shared/types';
|
|
1
2
|
import { Form } from '@formily/core';
|
|
2
3
|
import { MaybeRef } from '@vueuse/core';
|
|
3
|
-
import { FormLowCodeReactions } from '../../../../../es/components/form-render';
|
|
4
4
|
export declare function useLowCodeReactions(configListRef: MaybeRef<FormLowCodeReactions.Config[] | undefined>, formModel: Form): {
|
|
5
5
|
lowCodeReactionsHandler: (field: string) => void;
|
|
6
6
|
triggerAllReactionsHandler: () => void;
|
|
@@ -149,9 +149,10 @@ export declare type FieldItem = {
|
|
|
149
149
|
allow_check_mid_level: '1' | '2' | '3' | '4';
|
|
150
150
|
prefix: string | AnyObject | (() => any);
|
|
151
151
|
suffix: string | AnyObject | (() => any);
|
|
152
|
-
allowSlash: boolean;
|
|
152
|
+
allowSlash: boolean | string;
|
|
153
153
|
allowModify: '0' | '1';
|
|
154
154
|
show_key: string;
|
|
155
|
+
whiteList: string[];
|
|
155
156
|
bordered: boolean | string;
|
|
156
157
|
fieldType: SchemaTypes;
|
|
157
158
|
content: string | FormRenderer | Record<string, FormRenderer>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsyncQueue } from '../../../../../es/shared/hooks';
|
|
2
|
-
import { AnyObject,
|
|
2
|
+
import { AnyObject, FormLowCodeReactions, FormOperationalConfig, UndefinedAble } from '../../../../../es/shared/types';
|
|
3
3
|
import { DataField, Field, Form } from '@formily/core';
|
|
4
4
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
5
5
|
import { Component, FunctionalComponent } from 'vue';
|
|
@@ -152,21 +152,3 @@ export declare type FormBusinessFormatter = (payload: {
|
|
|
152
152
|
type: FIELD_BUSINESS_TYPE;
|
|
153
153
|
from: FIELD_BUSINESS_TYPE;
|
|
154
154
|
}) => unknown;
|
|
155
|
-
export declare namespace FormLowCodeReactions {
|
|
156
|
-
type ConObj = {
|
|
157
|
-
con: LOW_CODE_VALUE_RELATION;
|
|
158
|
-
field_key: string;
|
|
159
|
-
value: unknown;
|
|
160
|
-
};
|
|
161
|
-
type Config = {
|
|
162
|
-
conObj: ConObj[];
|
|
163
|
-
} & Partial<{
|
|
164
|
-
sqlExpression: string;
|
|
165
|
-
showField: string[];
|
|
166
|
-
hideField: string[];
|
|
167
|
-
requiredField: string[];
|
|
168
|
-
notRequiredField: string[];
|
|
169
|
-
enabledField: string[];
|
|
170
|
-
disabledField: string[];
|
|
171
|
-
}>;
|
|
172
|
-
}
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,mergeProps as
|
|
1
|
+
import{createVNode as e,mergeProps as o,defineComponent as l,computed as n}from"vue";import r from"../../../../../../shared/components/InputNumberSlash/InputNumberSlash.js";import{isNumber as t}from"lodash-es";import{NInputNumber as u}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as a}from"../../../constants/index.js";import{useAutoFocus as s}from"./hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as p,IhoTableRenderHelper as i}from"../../../utils/index.js";import{defineTablePlugin as m}from"../../../hooks/useTablePlugin.js";const d=l({name:"IhoTableInputNumber",props:{value:[String,Number]},emits:["update:value"],setup(o,{emit:l}){const r=n({get:()=>t(o.value)?o.value:o.value&&t(+o.value)?+o.value:null,set(e){l("update:value",e)}});return()=>e(u,{value:r.value,"onUpdate:value":e=>r.value=e},null)}});function c(){const l="numberRendererPlugin";return m({name:l,vxe(l){l.interceptor.add("event.clearActived",p(a.NUMBER,(e=>e.classList.contains("iho-table_numberInputSlashPopper")))),l.renderer.add(a.NUMBER,{renderCell:i.createDefaultRenderCell(),renderEdit:i.createRenderEdit((({row:l,column:n,fieldItem:t,emitFormClick:u,emitFormChangeWithParams:a})=>{var s;const{placeholder:p="请输入"}=t.componentProps||{};function i(e){const o=l[n.field];l[n.field]=e,a({oldValue:o})}const m={clearable:!0,placeholder:p,onBlur:()=>a({type:"blur",oldValue:l[n.field]}),onClick:u};return!0===t.allowSlash||"1"===t.allowSlash?e(r,o({value:l[n.field],onChange:i},m,{whiteList:t.whiteList},t.componentProps,{popperProps:{...null==(s=t.componentProps)?void 0:s.popperProps,class:"iho-table_numberInputSlashPopper"}}),null):e(d,o({value:l[n.field],"onUpdate:value":i},m,t.componentProps),null)}))})},apply(e){s(e).bindAutoFocusConfig(l,a.NUMBER,".n-input__input-el",{focusType:"class"})}})}export{c as numberRendererPlugin};
|
|
@@ -131,7 +131,8 @@ export declare type LowCodeTableFieldItem = {
|
|
|
131
131
|
variableHeight: boolean | '0' | '1';
|
|
132
132
|
filterSetting: IhoTableLowCodeField.FilterSetting;
|
|
133
133
|
bindEventSetting: BindEventSettingItem[];
|
|
134
|
-
allowSlash: boolean;
|
|
134
|
+
allowSlash: boolean | string;
|
|
135
|
+
whiteList: string[];
|
|
135
136
|
}> & Partial<VxeTableDefines.ColumnInfo>;
|
|
136
137
|
export declare type IhoTableFormChangePayload = {
|
|
137
138
|
column: IhoTableFieldItem;
|