cnhis-design-vue 3.1.42-beta.51 → 3.1.42-beta.52
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/button-print/index.d.ts +28 -3
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +20 -4
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/form-config/index.d.ts +10 -5
- package/es/components/form-config/src/FormConfig.vue.d.ts +10 -5
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +6 -3
- package/es/components/form-render/src/components/renderer/date.d.ts +4 -0
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -4
- package/es/components/iho-table/src/constants/index.d.ts +1 -0
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.d.ts +4 -3
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/info-header/style/index.css +1 -1
- package/es/components/scale-view/index.d.ts +9 -130
- package/es/components/scale-view/src/ScaleView.vue.d.ts +8 -130
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/components/scale-view/src/components/AnswerParse.vue.d.ts +1 -43
- package/es/components/scale-view/src/components/AnswerParse.vue.js +1 -1
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +0 -42
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +4 -4
- package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.d.ts +5 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/types/index.d.ts +7 -0
- package/es/components/scale-view/src/types/index.js +1 -0
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/scale-view/style/scale-view-iconfont.ttf +0 -0
- package/es/components/shortcut-setter/index.d.ts +2 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -1
- package/package.json +2 -2
|
@@ -68,6 +68,13 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
68
68
|
type: BooleanConstructor;
|
|
69
69
|
default: boolean;
|
|
70
70
|
};
|
|
71
|
+
externalOptionConfig: {
|
|
72
|
+
type: import("vue").PropType<{
|
|
73
|
+
options?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
74
|
+
onSelect?: ((key: string | number, option: import("../../../es/shared/types").AnyObject) => void) | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
default: () => {};
|
|
77
|
+
};
|
|
71
78
|
}, {
|
|
72
79
|
$message: import("naive-ui").MessageApi;
|
|
73
80
|
printInstance: import("./src/utils").Print | null;
|
|
@@ -138,6 +145,13 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
138
145
|
type: BooleanConstructor;
|
|
139
146
|
default: boolean;
|
|
140
147
|
};
|
|
148
|
+
externalOptionConfig: {
|
|
149
|
+
type: import("vue").PropType<{
|
|
150
|
+
options?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
151
|
+
onSelect?: ((key: string | number, option: import("../../../es/shared/types").AnyObject) => void) | undefined;
|
|
152
|
+
}>;
|
|
153
|
+
default: () => {};
|
|
154
|
+
};
|
|
141
155
|
}>> & {
|
|
142
156
|
onError?: ((...args: any[]) => any) | undefined;
|
|
143
157
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
@@ -159,12 +173,12 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
159
173
|
watchPrintParamsReformatFn: null;
|
|
160
174
|
spinTimer: null;
|
|
161
175
|
};
|
|
162
|
-
options: import("
|
|
176
|
+
options: import("../../../es/shared/types").AnyObject[];
|
|
163
177
|
currentFormatItem: import("vue").ComputedRef<{} | undefined>;
|
|
164
178
|
formatTitle: import("vue").ComputedRef<any>;
|
|
165
179
|
getTemplateIdByFormatId: import("vue").ComputedRef<any>;
|
|
166
180
|
buttonClick: (origin: string) => Promise<false | undefined>;
|
|
167
|
-
renderLabel: (option: import("
|
|
181
|
+
renderLabel: (option: import("../../../es/shared/types").AnyObject) => JSX.Element;
|
|
168
182
|
callLocalServicesSuccessCb: (res: any, type: any) => void;
|
|
169
183
|
callLocalServicesErrorCb: (res: unknown) => void;
|
|
170
184
|
prevFnError: () => void;
|
|
@@ -174,7 +188,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
174
188
|
handleClickPreview: () => Promise<void>;
|
|
175
189
|
handleClickPdf: () => Promise<void>;
|
|
176
190
|
handleClickEdit: () => void;
|
|
177
|
-
handleSelect: (key: string) => Promise<void>;
|
|
191
|
+
handleSelect: (key: string, option: import("../../../es/shared/types").AnyObject) => Promise<void>;
|
|
178
192
|
handleClickOutside: () => void;
|
|
179
193
|
instantiatePrintSDK: () => false | undefined;
|
|
180
194
|
getDefaultFormatId: (list: any[], key: string | number) => Promise<any>;
|
|
@@ -1893,6 +1907,13 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1893
1907
|
type: BooleanConstructor;
|
|
1894
1908
|
default: boolean;
|
|
1895
1909
|
};
|
|
1910
|
+
externalOptionConfig: {
|
|
1911
|
+
type: import("vue").PropType<{
|
|
1912
|
+
options?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
1913
|
+
onSelect?: ((key: string | number, option: import("../../../es/shared/types").AnyObject) => void) | undefined;
|
|
1914
|
+
}>;
|
|
1915
|
+
default: () => {};
|
|
1916
|
+
};
|
|
1896
1917
|
}>> & {
|
|
1897
1918
|
onError?: ((...args: any[]) => any) | undefined;
|
|
1898
1919
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
@@ -1913,5 +1934,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1913
1934
|
printdlgshow: string;
|
|
1914
1935
|
btnprint: string;
|
|
1915
1936
|
directPrint: boolean;
|
|
1937
|
+
externalOptionConfig: {
|
|
1938
|
+
options?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
1939
|
+
onSelect?: ((key: string | number, option: import("../../../es/shared/types").AnyObject) => void) | undefined;
|
|
1940
|
+
};
|
|
1916
1941
|
}>>;
|
|
1917
1942
|
export default ButtonPrint;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { AnyObject } from '../../../../es/shared/types';
|
|
3
3
|
import { PropType } from 'vue';
|
|
4
|
-
import type { DropdownOption } from 'naive-ui';
|
|
5
4
|
import { Print } from './utils';
|
|
5
|
+
declare type IExternalOptionConfig = {
|
|
6
|
+
options?: AnyObject[];
|
|
7
|
+
onSelect?: (key: string | number, option: AnyObject) => void;
|
|
8
|
+
};
|
|
6
9
|
declare const _default: import("vue").DefineComponent<{
|
|
7
10
|
printParams: {
|
|
8
11
|
type: PropType<AnyObject[]>;
|
|
@@ -73,6 +76,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
73
76
|
type: BooleanConstructor;
|
|
74
77
|
default: boolean;
|
|
75
78
|
};
|
|
79
|
+
externalOptionConfig: {
|
|
80
|
+
type: PropType<IExternalOptionConfig>;
|
|
81
|
+
default: () => {};
|
|
82
|
+
};
|
|
76
83
|
}, {
|
|
77
84
|
$message: import("naive-ui").MessageApi;
|
|
78
85
|
printInstance: Print | null;
|
|
@@ -146,6 +153,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
146
153
|
type: BooleanConstructor;
|
|
147
154
|
default: boolean;
|
|
148
155
|
};
|
|
156
|
+
externalOptionConfig: {
|
|
157
|
+
type: PropType<IExternalOptionConfig>;
|
|
158
|
+
default: () => {};
|
|
159
|
+
};
|
|
149
160
|
}>> & {
|
|
150
161
|
onError?: ((...args: any[]) => any) | undefined;
|
|
151
162
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
@@ -167,12 +178,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
167
178
|
watchPrintParamsReformatFn: null;
|
|
168
179
|
spinTimer: null;
|
|
169
180
|
};
|
|
170
|
-
options:
|
|
181
|
+
options: AnyObject[];
|
|
171
182
|
currentFormatItem: import("vue").ComputedRef<{} | undefined>;
|
|
172
183
|
formatTitle: import("vue").ComputedRef<any>;
|
|
173
184
|
getTemplateIdByFormatId: import("vue").ComputedRef<any>;
|
|
174
185
|
buttonClick: (origin: string) => Promise<false | undefined>;
|
|
175
|
-
renderLabel: (option:
|
|
186
|
+
renderLabel: (option: AnyObject) => JSX.Element;
|
|
176
187
|
callLocalServicesSuccessCb: (res: any, type: any) => void;
|
|
177
188
|
callLocalServicesErrorCb: (res: unknown) => void;
|
|
178
189
|
prevFnError: () => void;
|
|
@@ -182,7 +193,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
182
193
|
handleClickPreview: () => Promise<void>;
|
|
183
194
|
handleClickPdf: () => Promise<void>;
|
|
184
195
|
handleClickEdit: () => void;
|
|
185
|
-
handleSelect: (key: string) => Promise<void>;
|
|
196
|
+
handleSelect: (key: string, option: AnyObject) => Promise<void>;
|
|
186
197
|
handleClickOutside: () => void;
|
|
187
198
|
instantiatePrintSDK: () => false | undefined;
|
|
188
199
|
getDefaultFormatId: (list: any[], key: string | number) => Promise<any>;
|
|
@@ -1904,6 +1915,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1904
1915
|
type: BooleanConstructor;
|
|
1905
1916
|
default: boolean;
|
|
1906
1917
|
};
|
|
1918
|
+
externalOptionConfig: {
|
|
1919
|
+
type: PropType<IExternalOptionConfig>;
|
|
1920
|
+
default: () => {};
|
|
1921
|
+
};
|
|
1907
1922
|
}>> & {
|
|
1908
1923
|
onError?: ((...args: any[]) => any) | undefined;
|
|
1909
1924
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
@@ -1924,5 +1939,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1924
1939
|
printdlgshow: string;
|
|
1925
1940
|
btnprint: string;
|
|
1926
1941
|
directPrint: boolean;
|
|
1942
|
+
externalOptionConfig: IExternalOptionConfig;
|
|
1927
1943
|
}>;
|
|
1928
1944
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as t,reactive as e,computed as r,onMounted as a,onUnmounted as
|
|
1
|
+
import{defineComponent as t,reactive as e,computed as r,onMounted as a,onUnmounted as n,watch as i,openBlock as o,createElementBlock as s,Fragment as l,createVNode as m,unref as p,withCtx as d,renderSlot as u,withModifiers as c,createTextVNode as f,toDisplayString as v,mergeProps as y}from"vue";import{isObject as b}from"@vue/shared";import{useMessage as g,NDropdown as P,NButton as I,NIcon as h}from"naive-ui";import{ChevronDown as F}from"@vicons/ionicons5";import{Print as w}from"./utils/print.js";import{isIReport as k}from"./utils/browserPrint.js";import T from"./components/IdentityVerification.vue.js";import{format as x}from"date-fns";import{savePrivateFormatApi as S,getPrivateFormatApi as j}from"./api.js";var D=t({__name:"ButtonPrint",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})}},emits:["success","error","clickoutside"],setup(t,{expose:D,emit:O}){var E;const L=t,N=g();let M;const V={},C=e({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null}),Y=e([{label:L.printText,key:"printText"},{label:L.previewText,key:"previewText"},{label:L.pdfLoadText,key:"downloadPdf"},{label:L.formatEditText,key:"formatEditText"},...(null==(E=L.externalOptionConfig)?void 0:E.options)||[]]),U=r((()=>{if(!C.currentFormatId)return{};let t=C.currentFormatId;return C.formatList.find((e=>e.id===t))})),B=r((()=>{var t;return(null==(t=U.value)?void 0:t.name)||"格式选择"})),J=r((()=>{let t=C.formatList.find((t=>t.id===C.currentFormatId));return null==t?void 0:t.templateId})),A=async t=>{if(L.directPrint){if(C.spinning)return;return"button"===t?void await it():rt()}return rt()},R=t=>m("span",{class:{active:t.key===C.currentFormatId}},[t.label]),q=(t,e)=>{let r={type:e,formatId:C.currentFormatId,templateId:J.value};O("success",t,r)},_=t=>{O("error",t),b(t)&&"notInstalledApp"===t.type&&N.error(t.message)},z=()=>{O("error",{message:"前置条件执行错误"})},H=(t=0)=>{var e;const r=(null==(e=L.printParams)?void 0:e.length)?L.printParams[t]:C.printParams[t];return JSON.stringify({...r||{},...L.token?{token:L.token}:{}})},$=()=>{var t,e;let r={},a={};if(null==(t=C.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(C.printParams[0].datasetData||{}))?void 0:e[0])||"",r=JSON.stringify(C.printParams.map((e=>JSON.parse(e.datasetData[t]))));a={datasetData:{}},a.datasetData[t]=r}else Object.keys(C.printParams[0]).forEach((t=>{a[t]=[],C.printParams.forEach((e=>{a[t].push(e[t])})),a[t]=a[t].join(",")}));return r=Object.assign({},JSON.parse(H(0)),a),JSON.stringify(r)},G=()=>{let t=C.printParams.length;const e=async e=>{try{--t<=0&&q(e,"print")}catch(t){console.log("error",t)}};L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t={formatId:C.currentFormatId,templateId:J.value,printdlgshow:L.printdlgshow};if("MULTI"===L.strategy)for(let r=0;r<C.printParams.length;r++)r>0&&(t.printdlgshow="0"),M.printDirect({...t,params:H(r)},e,_);else M.printDirect({...t,params:$()},(t=>{q(t,"print")}),_)})).finally((()=>{C.visible=!1}))},K=async(t,e)=>{var r,a;switch(t){case"printText":G();break;case"previewText":(async()=>{L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t="MULTI"===L.strategy?H():$(),e={formatId:C.currentFormatId,templateId:J.value,params:t,btnprint:L.btnprint};M.preview(e,(t=>{q(t,"preview")}),_)})).finally((()=>{C.visible=!1}))})();break;case"formatEditText":L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{C.identityVerification.visible=!0})).finally((()=>{C.visible=!1}));break;case"downloadPdf":(async()=>{L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t="MULTI"===L.strategy?H():$(),e={formatId:C.currentFormatId,templateId:J.value,print:{print:"1",type:"1"},params:t};M.downloadPDF(e,(t=>q(t,"preview")),_)})).finally((()=>{C.visible=!1}))})();break;default:{C.visible=!1;const n=C.formatList.find((e=>e.id===t))||{};if(Object.keys(n).length>0){C.currentFormatId=t;const[e]=Y;e.label=(null==n?void 0:n.name)||e.label,await S({formatForms:[{...n}],name:V.name||n.templateName,number:V.number||n.number,templateId:V.templateId||n.templateId,...V.id?{id:V.id}:{}},{token:L.token})}else null==(a=null==(r=L.externalOptionConfig)?void 0:r.onSelect)||a.call(r,t,e);break}}},Q=()=>{C.visible=!1,O("clickoutside")},W=()=>(C.isInited=!1,C.spinning=!1,setTimeout((()=>{C.visible=!1}),0),!1),X=(t,e,r)=>{const a={};return e.forEach((e=>{let n=((t,e)=>{let r=t.defaultValue||"",a=e;return"NUMBER"===t.type&&(a=Number(e)||0),"DATE"===t.type&&(a=e?x(e,"YYYY-MM-DD"):""),"DATETIME"===t.type&&(a=e?x(e,"YYYY-MM-DD HH:mm:ss"):""),r||a})(e,t[e[r]]);t[e[r]]&&n&&(a[e[r]]=n)})),a},Z=({customizeDataset:t=[],param:e=[]},r=[])=>r.map((r=>{let a={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;a.datasetData={[t.name]:JSON.stringify(X(r,e,"fieldName"))}})),a=Object.assign({},a,X(r,e,"key")),a})),tt=async t=>{var e;if(C.formatList=t?(t=>{let e=[];return t&&t.forEach((t=>{if(!t.format)return!1;e.push(...t.format.map((e=>Object.assign({},e,{templateName:t.name}))))})),e})(t.obj):[],C.currentFormatId=await(async(t,e)=>{var r;if(!(null==t?void 0:t.length))return"";const{data:a}=await j({templateId:t[0].templateId},{token:L.token});if("SUCCESS"===a.result){const{formatForms:e=[]}=a.map||{};Object.assign(V,a.map||{});const n=null==(r=null==e?void 0:e[0])?void 0:r.id;if(n&&t.map((t=>t.id)).includes(n))return n}const n=t.find((t=>1==t[e]));return(null==n?void 0:n.id)||t[0].id})(C.formatList,"defaultFlag"),!C.currentFormatId)return N.error("获取打印格式失败,请联系管理员!"),W();(()=>{const t=C.formatList.map((t=>({label:t.name,key:t.id})));Y.unshift({label:B.value,key:"format",children:t})})();let r=null==(e=await L.queryTemplateParams())?void 0:e.obj;if(!r||!J.value)return N.error("获取打印模板失败,请联系管理员!"),W();C.templateParams=r,C.printParams=Z(C.templateParams,L.params)},et=async()=>{if(C.isInited)return!0;C.isInited=!0,C.spinning=!0,(()=>{if(M)return!1;M=new w})();const t=await L.queryPrintFormatByNumber();return await tt(t),C.spinning=!1,!0},rt=async(t=!0)=>{var e;if(await L.clickPrevFn())if(null==(e=L.params)?void 0:e.length){if(!C.visible){if(!await et())return!1}t&&(C.visible=!C.visible)}else N.warning(L.noDataMsg)},at=()=>{C.watchPrintParamsReformatFn&&C.watchPrintParamsReformatFn(),C.isInited?C.printParams=Z(C.templateParams,L.params):C.watchPrintParamsReformatFn=()=>i((()=>C.isInited),(t=>{if(!t)return!1;at()}))},nt=t=>{if(C.identityVerification.visible=!1,k(C.currentFormatId))return q(null,"edit");const e={formatId:C.currentFormatId,templateId:J.value,params:H(),token:t};M.editPrintFormat(e,(t=>{q(t,"edit")}),_)};async function it(){await rt(!1),G()}return a((()=>{C.isInited=!1})),n((()=>{null==M||M.destroy()})),i((()=>L.params),(t=>{if(!(null==t?void 0:t.length))return!1;at()}),{deep:!0}),D({directPrint:it}),(e,r)=>(o(),s(l,null,[m(p(P),{class:"c-dropdown",placement:"bottom-start",trigger:"click",show:C.visible,onClickoutside:Q,options:Y,onSelect:K,"render-label":R},{default:d((()=>[u(e.$slots,"button",{handleClickPrintBtn:rt,printSpinning:C.spinning,printbtnText:t.btnText,printVisible:C.visible},(()=>[m(p(I),{class:"dropdown-button",onClick:r[1]||(r[1]=c((()=>A("button")),["stop"]))},{default:d((()=>[f(v(t.btnText)+" ",1),m(p(h),{component:p(F),style:{"margin-left":"5px"},onClick:r[0]||(r[0]=c((()=>A("icon")),["stop"]))},null,8,["component"])])),_:1})]))])),_:3},8,["show","options"]),m(T,y(e.$attrs,{modelValue:C.identityVerification.visible,"onUpdate:modelValue":r[2]||(r[2]=t=>C.identityVerification.visible=t),formatId:C.currentFormatId,templateId:p(J),onSuccess:nt}),null,16,["modelValue","formatId","templateId"])],64))}});export{D as default};
|
|
@@ -79,6 +79,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
79
79
|
vali_obj?: string | undefined;
|
|
80
80
|
max_value?: string | number | undefined;
|
|
81
81
|
min_value?: string | number | undefined;
|
|
82
|
+
min_date?: string | undefined;
|
|
83
|
+
max_date?: string | undefined;
|
|
82
84
|
min_length?: string | number | undefined;
|
|
83
85
|
max_length?: string | number | undefined;
|
|
84
86
|
decimal_length?: string | number | undefined;
|
|
@@ -114,7 +116,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
114
116
|
children?: any[] | undefined;
|
|
115
117
|
childrenFields?: any[] | undefined;
|
|
116
118
|
}[] | undefined;
|
|
117
|
-
multi_select?: import("..").FormCommonState | undefined;
|
|
118
119
|
multi_select_value?: string | number | undefined;
|
|
119
120
|
wordbook?: {
|
|
120
121
|
level_num?: number | undefined;
|
|
@@ -1772,6 +1773,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1772
1773
|
vali_obj?: string | undefined;
|
|
1773
1774
|
max_value?: string | number | undefined;
|
|
1774
1775
|
min_value?: string | number | undefined;
|
|
1776
|
+
min_date?: string | undefined;
|
|
1777
|
+
max_date?: string | undefined;
|
|
1775
1778
|
min_length?: string | number | undefined;
|
|
1776
1779
|
max_length?: string | number | undefined;
|
|
1777
1780
|
decimal_length?: string | number | undefined;
|
|
@@ -1807,7 +1810,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1807
1810
|
children?: any[] | undefined;
|
|
1808
1811
|
childrenFields?: any[] | undefined;
|
|
1809
1812
|
}[] | undefined;
|
|
1810
|
-
multi_select?: import("..").FormCommonState | undefined;
|
|
1811
1813
|
multi_select_value?: string | number | undefined;
|
|
1812
1814
|
wordbook?: {
|
|
1813
1815
|
level_num?: number | undefined;
|
|
@@ -4409,6 +4411,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
4409
4411
|
vali_obj?: string | undefined;
|
|
4410
4412
|
max_value?: string | number | undefined;
|
|
4411
4413
|
min_value?: string | number | undefined;
|
|
4414
|
+
min_date?: string | undefined;
|
|
4415
|
+
max_date?: string | undefined;
|
|
4412
4416
|
min_length?: string | number | undefined;
|
|
4413
4417
|
max_length?: string | number | undefined;
|
|
4414
4418
|
decimal_length?: string | number | undefined;
|
|
@@ -4444,7 +4448,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
4444
4448
|
children?: any[] | undefined;
|
|
4445
4449
|
childrenFields?: any[] | undefined;
|
|
4446
4450
|
}[] | undefined;
|
|
4447
|
-
multi_select?: import("..").FormCommonState | undefined;
|
|
4448
4451
|
multi_select_value?: string | number | undefined;
|
|
4449
4452
|
wordbook?: {
|
|
4450
4453
|
level_num?: number | undefined;
|
|
@@ -6114,6 +6117,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
6114
6117
|
vali_obj?: string | undefined;
|
|
6115
6118
|
max_value?: string | number | undefined;
|
|
6116
6119
|
min_value?: string | number | undefined;
|
|
6120
|
+
min_date?: string | undefined;
|
|
6121
|
+
max_date?: string | undefined;
|
|
6117
6122
|
min_length?: string | number | undefined;
|
|
6118
6123
|
max_length?: string | number | undefined;
|
|
6119
6124
|
decimal_length?: string | number | undefined;
|
|
@@ -6149,7 +6154,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
6149
6154
|
children?: any[] | undefined;
|
|
6150
6155
|
childrenFields?: any[] | undefined;
|
|
6151
6156
|
}[] | undefined;
|
|
6152
|
-
multi_select?: import("..").FormCommonState | undefined;
|
|
6153
6157
|
multi_select_value?: string | number | undefined;
|
|
6154
6158
|
wordbook?: {
|
|
6155
6159
|
level_num?: number | undefined;
|
|
@@ -7791,6 +7795,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
7791
7795
|
vali_obj?: string | undefined;
|
|
7792
7796
|
max_value?: string | number | undefined;
|
|
7793
7797
|
min_value?: string | number | undefined;
|
|
7798
|
+
min_date?: string | undefined;
|
|
7799
|
+
max_date?: string | undefined;
|
|
7794
7800
|
min_length?: string | number | undefined;
|
|
7795
7801
|
max_length?: string | number | undefined;
|
|
7796
7802
|
decimal_length?: string | number | undefined;
|
|
@@ -7826,7 +7832,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
7826
7832
|
children?: any[] | undefined;
|
|
7827
7833
|
childrenFields?: any[] | undefined;
|
|
7828
7834
|
}[] | undefined;
|
|
7829
|
-
multi_select?: import("..").FormCommonState | undefined;
|
|
7830
7835
|
multi_select_value?: string | number | undefined;
|
|
7831
7836
|
wordbook?: {
|
|
7832
7837
|
level_num?: number | undefined;
|
|
@@ -81,6 +81,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
81
81
|
vali_obj?: string | undefined;
|
|
82
82
|
max_value?: string | number | undefined;
|
|
83
83
|
min_value?: string | number | undefined;
|
|
84
|
+
min_date?: string | undefined;
|
|
85
|
+
max_date?: string | undefined;
|
|
84
86
|
min_length?: string | number | undefined;
|
|
85
87
|
max_length?: string | number | undefined;
|
|
86
88
|
decimal_length?: string | number | undefined;
|
|
@@ -116,7 +118,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
116
118
|
children?: any[] | undefined;
|
|
117
119
|
childrenFields?: any[] | undefined;
|
|
118
120
|
}[] | undefined;
|
|
119
|
-
multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
|
120
121
|
multi_select_value?: string | number | undefined;
|
|
121
122
|
wordbook?: {
|
|
122
123
|
level_num?: number | undefined;
|
|
@@ -1774,6 +1775,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1774
1775
|
vali_obj?: string | undefined;
|
|
1775
1776
|
max_value?: string | number | undefined;
|
|
1776
1777
|
min_value?: string | number | undefined;
|
|
1778
|
+
min_date?: string | undefined;
|
|
1779
|
+
max_date?: string | undefined;
|
|
1777
1780
|
min_length?: string | number | undefined;
|
|
1778
1781
|
max_length?: string | number | undefined;
|
|
1779
1782
|
decimal_length?: string | number | undefined;
|
|
@@ -1809,7 +1812,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1809
1812
|
children?: any[] | undefined;
|
|
1810
1813
|
childrenFields?: any[] | undefined;
|
|
1811
1814
|
}[] | undefined;
|
|
1812
|
-
multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
|
1813
1815
|
multi_select_value?: string | number | undefined;
|
|
1814
1816
|
wordbook?: {
|
|
1815
1817
|
level_num?: number | undefined;
|
|
@@ -4411,6 +4413,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4411
4413
|
vali_obj?: string | undefined;
|
|
4412
4414
|
max_value?: string | number | undefined;
|
|
4413
4415
|
min_value?: string | number | undefined;
|
|
4416
|
+
min_date?: string | undefined;
|
|
4417
|
+
max_date?: string | undefined;
|
|
4414
4418
|
min_length?: string | number | undefined;
|
|
4415
4419
|
max_length?: string | number | undefined;
|
|
4416
4420
|
decimal_length?: string | number | undefined;
|
|
@@ -4446,7 +4450,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4446
4450
|
children?: any[] | undefined;
|
|
4447
4451
|
childrenFields?: any[] | undefined;
|
|
4448
4452
|
}[] | undefined;
|
|
4449
|
-
multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
|
4450
4453
|
multi_select_value?: string | number | undefined;
|
|
4451
4454
|
wordbook?: {
|
|
4452
4455
|
level_num?: number | undefined;
|
|
@@ -6116,6 +6119,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6116
6119
|
vali_obj?: string | undefined;
|
|
6117
6120
|
max_value?: string | number | undefined;
|
|
6118
6121
|
min_value?: string | number | undefined;
|
|
6122
|
+
min_date?: string | undefined;
|
|
6123
|
+
max_date?: string | undefined;
|
|
6119
6124
|
min_length?: string | number | undefined;
|
|
6120
6125
|
max_length?: string | number | undefined;
|
|
6121
6126
|
decimal_length?: string | number | undefined;
|
|
@@ -6151,7 +6156,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6151
6156
|
children?: any[] | undefined;
|
|
6152
6157
|
childrenFields?: any[] | undefined;
|
|
6153
6158
|
}[] | undefined;
|
|
6154
|
-
multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
|
6155
6159
|
multi_select_value?: string | number | undefined;
|
|
6156
6160
|
wordbook?: {
|
|
6157
6161
|
level_num?: number | undefined;
|
|
@@ -7793,6 +7797,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7793
7797
|
vali_obj?: string | undefined;
|
|
7794
7798
|
max_value?: string | number | undefined;
|
|
7795
7799
|
min_value?: string | number | undefined;
|
|
7800
|
+
min_date?: string | undefined;
|
|
7801
|
+
max_date?: string | undefined;
|
|
7796
7802
|
min_length?: string | number | undefined;
|
|
7797
7803
|
max_length?: string | number | undefined;
|
|
7798
7804
|
decimal_length?: string | number | undefined;
|
|
@@ -7828,7 +7834,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7828
7834
|
children?: any[] | undefined;
|
|
7829
7835
|
childrenFields?: any[] | undefined;
|
|
7830
7836
|
}[] | undefined;
|
|
7831
|
-
multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
|
7832
7837
|
multi_select_value?: string | number | undefined;
|
|
7833
7838
|
wordbook?: {
|
|
7834
7839
|
level_num?: number | undefined;
|
|
@@ -44,6 +44,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
44
|
vali_obj?: string | undefined;
|
|
45
45
|
max_value?: string | number | undefined;
|
|
46
46
|
min_value?: string | number | undefined;
|
|
47
|
+
min_date?: string | undefined;
|
|
48
|
+
max_date?: string | undefined;
|
|
47
49
|
min_length?: string | number | undefined;
|
|
48
50
|
max_length?: string | number | undefined;
|
|
49
51
|
decimal_length?: string | number | undefined;
|
|
@@ -79,7 +81,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
79
81
|
children?: any[] | undefined;
|
|
80
82
|
childrenFields?: any[] | undefined;
|
|
81
83
|
}[] | undefined;
|
|
82
|
-
multi_select?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
83
84
|
multi_select_value?: string | number | undefined;
|
|
84
85
|
wordbook?: {
|
|
85
86
|
level_num?: number | undefined;
|
|
@@ -1749,6 +1750,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1749
1750
|
vali_obj?: string | undefined;
|
|
1750
1751
|
max_value?: string | number | undefined;
|
|
1751
1752
|
min_value?: string | number | undefined;
|
|
1753
|
+
min_date?: string | undefined;
|
|
1754
|
+
max_date?: string | undefined;
|
|
1752
1755
|
min_length?: string | number | undefined;
|
|
1753
1756
|
max_length?: string | number | undefined;
|
|
1754
1757
|
decimal_length?: string | number | undefined;
|
|
@@ -1784,7 +1787,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1784
1787
|
children?: any[] | undefined;
|
|
1785
1788
|
childrenFields?: any[] | undefined;
|
|
1786
1789
|
}[] | undefined;
|
|
1787
|
-
multi_select?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
1788
1790
|
multi_select_value?: string | number | undefined;
|
|
1789
1791
|
wordbook?: {
|
|
1790
1792
|
level_num?: number | undefined;
|
|
@@ -3426,6 +3428,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3426
3428
|
vali_obj?: string | undefined;
|
|
3427
3429
|
max_value?: string | number | undefined;
|
|
3428
3430
|
min_value?: string | number | undefined;
|
|
3431
|
+
min_date?: string | undefined;
|
|
3432
|
+
max_date?: string | undefined;
|
|
3429
3433
|
min_length?: string | number | undefined;
|
|
3430
3434
|
max_length?: string | number | undefined;
|
|
3431
3435
|
decimal_length?: string | number | undefined;
|
|
@@ -3461,7 +3465,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3461
3465
|
children?: any[] | undefined;
|
|
3462
3466
|
childrenFields?: any[] | undefined;
|
|
3463
3467
|
}[] | undefined;
|
|
3464
|
-
multi_select?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
3465
3468
|
multi_select_value?: string | number | undefined;
|
|
3466
3469
|
wordbook?: {
|
|
3467
3470
|
level_num?: number | undefined;
|
|
@@ -11,6 +11,8 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
|
11
11
|
vali_obj: string;
|
|
12
12
|
max_value: string | number;
|
|
13
13
|
min_value: string | number;
|
|
14
|
+
min_date: string;
|
|
15
|
+
max_date: string;
|
|
14
16
|
min_length: string | number;
|
|
15
17
|
max_length: string | number;
|
|
16
18
|
decimal_length: string | number;
|
|
@@ -35,6 +37,8 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
|
35
37
|
vali_obj: string;
|
|
36
38
|
max_value: string | number;
|
|
37
39
|
min_value: string | number;
|
|
40
|
+
min_date: string;
|
|
41
|
+
max_date: string;
|
|
38
42
|
min_length: string | number;
|
|
39
43
|
max_length: string | number;
|
|
40
44
|
decimal_length: string | number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,watch as
|
|
1
|
+
import{defineComponent as e,computed as t,watch as a,createVNode as r,mergeProps as n}from"vue";import{generateTimeFormat as o}from"../../../../../shared/utils/index.js";import{connect as u,mapProps as i}from"@formily/vue";import{isObject as s}from"@vueuse/core";import{format as l}from"date-fns";import m from"../../../../date-picker/index.js";import{useCommonInjection as d}from"../../hooks/useCommonInjection.js";import"../../utils/index.js";import{assignUpdateValue as v,assignClearBindVisited as c}from"../../utils/schema.js";const f=u(e({props:{onChange:{},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"}},emits:["update:value"],setup(e,{emit:u}){const{injectValueValidate:i,injectValueBindKey:v}=d();function c(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function f(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function p(e){return c()&&e<Date.now()-864e5||f()&&e>Date.now()}function D(e){const t=new Date(e),a=new Date,r=new Date(t);r.setHours(0),r.setMinutes(0),r.setSeconds(0);const n=new Date(t);n.setHours(23),n.setMinutes(59),n.setSeconds(59);const o=r>a,u=n<a,i=t.getHours(),s=a.getHours(),l=a.getMinutes();return{isHourDisabled:function(e){return c()&&!o&&e<s||f()&&!u&&e>s},isMinuteDisabled:function(e){if(i===s)return c()&&!o&&e<l||f()&&!u&&e>l;return c()&&!o&&i<s||f()&&!u&&i>s}}}i((()=>e.value));const y=t((()=>{const t={};if(s(e.validate)){const{min_date:a,max_date:r}=e.validate;(a||r)&&(t.isDateDisabled=p,t.isTimeDisabled=D)}return t})),j=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:o(e.valueFormat)}})));function g(t){return t?l(new Date(t),e.valueFormat):t}a((()=>e.value),(e=>{e&&g(e)!==e&&u("update:value",g(e))}));const w=t({get:()=>g(e.value),set:e=>{u("update:value",e)}}),x=v(w);return()=>r(m,n({key:x.value},y.value,j.value,{"formatted-value":w.value,"onUpdate:formatted-value":e=>w.value=e}),null)}}),i(v,c));export{f as DATE};
|
|
@@ -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 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
|
|
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,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}],["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)?O(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:O(n)}),r},{FieldNormalizeWaterfallHook:C}=s();function O(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=C.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:O}}export{d as useFieldListAdaptor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../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{FIELD_BUSINESS_TYPE as a}from"../constants/index.js";function l(){const l=new e(["fieldItem"]);l.tap("__block",(t=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(t.html_type)&&(t.__vertical=!0),t))),l.tap("__age",(e=>("AGE"===e.html_type&&(e.html_type="INPUT_NUMBER",e.reactions=e.reactions?t(e.reactions):[],e.reactions.push({target:e.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),e.suffixConfig=[{validate:{obj_type:a.AGE_UNIT},val_key:e.val_key_unit,html_type:"SELECT",option:e.option,urlConfig:e.urlConfig}]),e)));const o=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];return l.tap("__normalize",(t=>(o.some((([e,a])=>(Array.isArray(e)?e.includes(t.html_type):e===t.html_type)&&(t.html_type=a))),t))),{FieldNormalizeWaterfallHook:l}}export{l as useFieldNormalize};
|
|
1
|
+
import{arrayed as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../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{FIELD_BUSINESS_TYPE as a}from"../constants/index.js";function l(){const l=new e(["fieldItem"]);l.tap("__block",(t=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(t.html_type)&&(t.__vertical=!0),t))),l.tap("__age",(e=>("AGE"===e.html_type&&(e.html_type="INPUT_NUMBER",e.reactions=e.reactions?t(e.reactions):[],e.reactions.push({target:e.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),e.suffixConfig=[{validate:{obj_type:a.AGE_UNIT},val_key:e.val_key_unit,html_type:"SELECT",option:e.option,urlConfig:e.urlConfig}]),e))),l.tap("__search_more",(t=>("SEARCH_MORE"===t.html_type&&(t.__multiple=!0),t)));const o=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];return l.tap("__normalize",(t=>(o.some((([e,a])=>(Array.isArray(e)?e.includes(t.html_type):e===t.html_type)&&(t.html_type=a))),t))),{FieldNormalizeWaterfallHook:l}}export{l as useFieldNormalize};
|
|
@@ -17,6 +17,8 @@ export declare type ValidateItem = Partial<{
|
|
|
17
17
|
vali_obj: ValidateType;
|
|
18
18
|
max_value: string | number;
|
|
19
19
|
min_value: string | number;
|
|
20
|
+
min_date: string;
|
|
21
|
+
max_date: string;
|
|
20
22
|
min_length: string | number;
|
|
21
23
|
max_length: string | number;
|
|
22
24
|
decimal_length: string | number;
|
|
@@ -143,10 +145,6 @@ export declare type FieldItem = {
|
|
|
143
145
|
placeholder: string;
|
|
144
146
|
validate: ValidateItem;
|
|
145
147
|
option: FormOptionItem[];
|
|
146
|
-
/**
|
|
147
|
-
* 是否开启多选('0'表示开启, 值是反的)
|
|
148
|
-
*/
|
|
149
|
-
multi_select: FormCommonState;
|
|
150
148
|
/**
|
|
151
149
|
* 多选时最大选择数量
|
|
152
150
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{eventListener2EventName as e}from"../utils/index.js";var o=(e=>(e.DEFAULT="DEFAULT",e.PICTURE="PICTURE",e.FILE="FILE",e.MONEY="MONEY",e.HEADPORTRAIT="HEADPORTRAIT",e.LABEL="LABEL",e.TELEPHONE="TELEPHONE",e.BIRTHDAY="BIRTHDAY",e.MULTISELECT="MULTISELECT",e.CASCADE="CASCADE",e.SEARCH_TREE="SEARCH_TREE",e.COLOR="COLOR",e.EVALUATE="EVALUATE",e.MAP="MAP",e.VIDEO="VIDEO",e.SYSTEMFIELDS="SYSTEMFIELDS",e.PERCENTAGE="PERCENTAGE",e.CANDIDATE_COMPONENTS="CANDIDATE_COMPONENTS",e.TASKDATE="TASKDATE",e.AGE="AGE",e.STATUS="STATUS",e.WEBSITE="WEBSITE",e.IDCARD="IDCARD",e.COUNTDOWN="COUNTDOWN",e.DURATION="DURATION",e.COMBINATION="COMBINATION",e.PASSWORD="PASSWORD",e.QR_CODE="QR_CODE",e.CUSTOMER_NAME="CUSTOMER_NAME",e.BANK_CARD="BANK_CARD",e.SEQUENCE="SEQUENCE",e.VARIABLE_HEIGHT="VARIABLE_HEIGHT",e))(o||{});const n=Object.freeze(["onKeydownStart","onKeydown","onKeydownEnd","onPaste","onCopy","onCut","onCurrentChange","onRadioChange","onCheckboxChange","onCheckboxAll","onCheckboxRangeStart","onCheckboxRangeChange","onCheckboxRangeEnd","onCellClick","onCellDblclick","onCellMenu","onCellMouseenter","onCellMouseleave","onHeaderCellClick","onHeaderCellDblclick","onHeaderCellMenu","onFooterCellClick","onFooterCellDblclick","onFooterCellMenu","onSortChange","onFilterChange","onFilterVisible","onResizableChange","onToggleRowExpand","onToggleTreeExpand","onMenuClick","onEditClosed","onEditActived","onEditDisabled","onValidError","onScroll","onCustom","onOpenFnr","onFnrChange","onFnrFind","onFnrFindAll","onFnrReplace","onFnrReplaceAll","onCellAreaCopy","onCellAreaCut","onCellAreaPaste","onCellAreaMerge","onClearCellAreaMerge","onHeaderCellAreaSelection","onCellAreaSelectionStart","onCellAreaSelectionDrag","onCellAreaSelectionEnd","onCellAreaExtensionStart","onCellAreaExtensionDrag","onCellAreaExtensionEnd","onCellAreaArrowsStart","onCellAreaArrowsEnd","onActiveCellChangeStart","onActiveCellChangeEnd"]),E=n.map(e),l=Object.freeze(["firstRowGroup","secondRowGroup","thirdRowGroup","fourthRowGroup","fifthRowGroup","sixthRowGroup","seventhRowGroup","eighthRowGroup","ninthRowGroup","tenthRowGroup"]),C=-1/0,A=1/0;var T=(e=>(e.INPUT="INPUT",e.SEPARATE="SEPARATE",e.SELECT="SELECT",e.DATE="DATE",e.TIME="TIME",e.NUMBER="NUMBER",e))(T||{}),r=(e=>(e[e.NEGATIVE=0]="NEGATIVE",e[e.POSITIVE=1]="POSITIVE",e))(r||{}),t=(e=>(e.NEGATIVE="0",e.POSITIVE="1",e))(t||{}),a=(e=>(e.NOT_TREE="0",e.UNKNOWN="1",e.TRANSFORM_TREE_TYPE="2",e.TRANSFORM_WITH_SPAN_METHOD="3",e))(a||{}),
|
|
1
|
+
import{eventListener2EventName as e}from"../utils/index.js";var o=(e=>(e.DEFAULT="DEFAULT",e.PICTURE="PICTURE",e.FILE="FILE",e.MONEY="MONEY",e.HEADPORTRAIT="HEADPORTRAIT",e.LABEL="LABEL",e.TELEPHONE="TELEPHONE",e.BIRTHDAY="BIRTHDAY",e.MULTISELECT="MULTISELECT",e.CASCADE="CASCADE",e.SEARCH_TREE="SEARCH_TREE",e.COLOR="COLOR",e.EVALUATE="EVALUATE",e.MAP="MAP",e.VIDEO="VIDEO",e.SYSTEMFIELDS="SYSTEMFIELDS",e.PERCENTAGE="PERCENTAGE",e.CANDIDATE_COMPONENTS="CANDIDATE_COMPONENTS",e.TASKDATE="TASKDATE",e.AGE="AGE",e.STATUS="STATUS",e.WEBSITE="WEBSITE",e.IDCARD="IDCARD",e.COUNTDOWN="COUNTDOWN",e.DURATION="DURATION",e.COMBINATION="COMBINATION",e.PASSWORD="PASSWORD",e.QR_CODE="QR_CODE",e.CUSTOMER_NAME="CUSTOMER_NAME",e.BANK_CARD="BANK_CARD",e.SEQUENCE="SEQUENCE",e.VARIABLE_HEIGHT="VARIABLE_HEIGHT",e))(o||{});const n=Object.freeze(["onKeydownStart","onKeydown","onKeydownEnd","onPaste","onCopy","onCut","onCurrentChange","onRadioChange","onCheckboxChange","onCheckboxAll","onCheckboxRangeStart","onCheckboxRangeChange","onCheckboxRangeEnd","onCellClick","onCellDblclick","onCellMenu","onCellMouseenter","onCellMouseleave","onHeaderCellClick","onHeaderCellDblclick","onHeaderCellMenu","onFooterCellClick","onFooterCellDblclick","onFooterCellMenu","onSortChange","onFilterChange","onFilterVisible","onResizableChange","onToggleRowExpand","onToggleTreeExpand","onMenuClick","onEditClosed","onEditActived","onEditDisabled","onValidError","onScroll","onCustom","onOpenFnr","onFnrChange","onFnrFind","onFnrFindAll","onFnrReplace","onFnrReplaceAll","onCellAreaCopy","onCellAreaCut","onCellAreaPaste","onCellAreaMerge","onClearCellAreaMerge","onHeaderCellAreaSelection","onCellAreaSelectionStart","onCellAreaSelectionDrag","onCellAreaSelectionEnd","onCellAreaExtensionStart","onCellAreaExtensionDrag","onCellAreaExtensionEnd","onCellAreaArrowsStart","onCellAreaArrowsEnd","onActiveCellChangeStart","onActiveCellChangeEnd"]),E=n.map(e),l=Object.freeze(["firstRowGroup","secondRowGroup","thirdRowGroup","fourthRowGroup","fifthRowGroup","sixthRowGroup","seventhRowGroup","eighthRowGroup","ninthRowGroup","tenthRowGroup"]),C=-1/0,A=1/0;var T=(e=>(e.INPUT="INPUT",e.SEPARATE="SEPARATE",e.SELECT="SELECT",e.SELECT_MORE="SELECT_MORE",e.DATE="DATE",e.TIME="TIME",e.NUMBER="NUMBER",e))(T||{}),r=(e=>(e[e.NEGATIVE=0]="NEGATIVE",e[e.POSITIVE=1]="POSITIVE",e))(r||{}),t=(e=>(e.NEGATIVE="0",e.POSITIVE="1",e))(t||{}),a=(e=>(e.NOT_TREE="0",e.UNKNOWN="1",e.TRANSFORM_TREE_TYPE="2",e.TRANSFORM_WITH_SPAN_METHOD="3",e))(a||{}),S=(e=>(e[e.left=1]="left",e[e.right=2]="right",e))(S||{});const i=["formChange","settingClick","formClick","keyboard","rowDrag"],I=[...i,...E],R=Symbol("injectionIhoTableConfig"),O=Symbol("injectionIhoTableFieldList"),D=Symbol("InjectionIhoTableEmits"),N=Symbol("InjectionIhoTableAnnotation"),c=Symbol("InjectionIhoTableUUID"),h=Symbol("InjectionIhoTableInstance"),M=Symbol("InjectionIhoTableHandler"),d=Symbol("InjectionIhoTableEventListener");export{T as EDITABLE_WIDGET_TYPE,C as HIGHEST_PRIORITY,S as IHO_TABLE_FIXED_STATUS,r as IHO_TABLE_NUMBER_STATUS,t as IHO_TABLE_STRING_STATUS,a as IHO_TABLE_TREE_TYPE,i as IhoTableCustomEventNameTuple,I as IhoTableEventNameTuple,l as IhoTableRowGroupSequence,N as InjectionIhoTableAnnotation,R as InjectionIhoTableConfig,D as InjectionIhoTableEmits,d as InjectionIhoTableEventListener,O as InjectionIhoTableFieldList,M as InjectionIhoTableHandler,h as InjectionIhoTableInstance,c as InjectionIhoTableUUID,A as LOWEST_PRIORITY,n as VxeEventListenerNameList,E as VxeTableEventNameList,o as WIDGET_TYPE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,nextTick as l}from"vue";import{jsonParse as
|
|
1
|
+
import{createVNode as e,nextTick as l}from"vue";import{jsonParse as r,traverse as t,arrayed as i}from"../../../../../shared/utils/index.js";import{isObject as o}from"@vue/shared";import{isArray as n,first as s,isString as u}from"lodash-es";import"../../../index.js";import{IhoTableRenderHelper as a,isCompatibleColumn as d,parseRichContent as f}from"../../utils/index.js";import c from"./filter.vue.js";import{defineTablePlugin as p}from"../../hooks/useTablePlugin.js";function v(){const v="filterRenderPlugin";return p({name:v,vxe(l){l.renderer.mixin({filterRenderPlugin:{showFilterFooter:!1,renderFilter:(l,r)=>e(c,{payload:r,key:r.column.field},null)}})},apply(e){let c=[];e.fieldHooks.field.tap(v,((e,l,t,{$table:i})=>{var c,p,v,h,m,b,g,k;const C=null==(c=e.editRender)?void 0:c.props;if(!o(C))return e;const R=r(C.fieldSetting||"");if(!a.hasFilter(C))return e;e.editRender={...e.editRender,props:{...null==(p=e.editRender)?void 0:p.props,sortable:e.sortable}},e.filterRender={name:"filterRenderPlugin"};const x=null==(v=i.value)?void 0:v.getColumnByField(e.field),y={};x&&n(x.filters)&&x.filters.forEach((e=>{e&&(y[`${e.label}_${e.value}`]=e.checked)}));let F=null!=(b=null==(m=null==(h=R.mapping)?void 0:h.mappingFiled)?void 0:m.reduce(((e,l)=>{const r=s(l.value);return o(r)&&e.push({label:r.key,value:r.value,data:r.value}),e}),[]))?b:[];if(d(C)&&(F=null!=(g=C.options)?g:[]),e.filters=F.reduce(((e,l)=>(o(l)&&e.push({...l,checked:!!y[`${l.label}_${l.value}`]}),e)),[]),!e.filterMethod){const l=null==(k=t.treeConfig)?void 0:k.children;e.filterMethod=function({option:e,column:r,row:t}){if(l&&n(t[l])&&t[l].length)return!1;const i=t[r.field];if(!u(i))return!1;if(i===e.value||i===e.label)return!0;const{value:o,change_text:s}=f(i);return s===e.label||o===e.value}}return e.sortable?e.headerClassName=({$table:e,column:l})=>{const r=["iho-table__hideSortIcon"];return e.isSort(l)&&r.push("is--filter-active"),r}:e.headerClassName="iho-table__hideSortIcon",t.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...t.filterConfig},e})),e.fieldHooks.fieldList.tap(v,(e=>c=e)),e.fieldHooks.fieldEnd.tapPromise(v,(async(e,{$table:r})=>{var i;try{if(await l(),!r.value)return;const n=null!=(i=r.value.getColumns())?i:[],s=[];if(t(c,(e=>{n.find((l=>l.field===e.field))||s.push(e)})),!s.length)return;setTimeout((()=>{var l,t;if(null==(l=e.sortConfig)?void 0:l.multiple){const e=null!=(t=r.value.getColumns())?t:[],l=s.concat(e).reduce(((e,l)=>{var r;const t=null==(r=l.editRender)?void 0:r.props;return o(t)&&h(t.isOrder)&&e.push({field:l.field,order:t.isOrder}),e}),[]);r.value.sort(l)}else s.reverse().some((e=>{var l;const t=null==(l=e.editRender)?void 0:l.props;if(o(t)&&h(t.isOrder))return e&&r.value.sort(e.field,t.isOrder),!0}))}),100)}finally{c=[]}})),e.exposeHooks.expose.tap(v,((e,l,{$table:r})=>(Object.assign(e,{setSort(e,l){r.value&&r.value.sort(e,l)},setFilter(e,l){if(!r.value)return;const t=r.value.getColumnByField(e);if(!t||!n(t.filters))return;const o=i(l);t.filters.forEach((e=>{e.checked=o.includes(e.value)})),r.value.updateData()}}),e)))}})}function h(e){return["asc","desc",null].includes(e)}export{v as filterRenderPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toRaw as e,h as t,inject as
|
|
1
|
+
import{toRaw as e,h as t,inject as l,createVNode as i}from"vue";import{arrayed as o,widthAppend as s}from"../../../../../shared/utils/index.js";import{isObject as n,isFunction as d,cloneDeep as a,isString as r}from"lodash-es";import{NEllipsis as u}from"naive-ui";import f from"../../../../annotation-edit/index.js";import{HIGHEST_PRIORITY as m,IHO_TABLE_FIXED_STATUS as c,LOWEST_PRIORITY as p,WIDGET_TYPE as h,InjectionIhoTableAnnotation as v,InjectionIhoTableConfig as b}from"../../constants/index.js";import{defineTablePlugin as g}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as R,IhoTableUtils as j,IhoTableRenderHelper as x}from"../../utils/index.js";import{getDefaultValue as P}from"../rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";function F(){const F="lowCodeFieldAdaptorPlugin";return g({name:F,apply(g){g.fieldHooks.field.tap({name:F,stage:m},((m,p,g)=>{const F=m,S={className:F.bold?"iho-table__boldCell":"",field:F.columnName,showOverflow:"tooltip",visible:R.notNegative(F.isShow),minWidth:F.colWidth,sortable:R.isPositive(F.isSort),fixed:c[F.isFixed],...F,title:F.alias||F.title};return function(e,a){const m={default:a.slotFn,header:a.headerSlotFn,edit:a.editSlotFn,footer:a.footerSlotFn,...a.slots};if(d(a.checkEditStatus)){const{default:e}=m;d(e)&&(m.default=l=>a.checkEditStatus(l)?e(l):[t("span",null,P(l.row,l.column.editRender.props))])}const c=m.header;m.header=e=>function(e,t,a){const m=l(v),c=l(b),p=e.column||{},h=n(null==m?void 0:m.value)&&!1!==t.annotation,g=x.isEditableColumn(c.value,p),R=p.sortable||x.hasFilter(t),j=r(a)?a:d(a)?a(e):null;let P=!1;if(c.value){const e=c.value.editRules&&c.value.editRules[p.field];e&&(P=o(e).some((e=>e.required)))}return i("section",{class:"iho-table__headerWrapper"},[i("section",{style:{width:s(Math.max(0,p.renderWidth-20-(P?14:0)-(h?18:0)-(R?23:0)-(g?22:0)))}},[null!=j?j:i(u,{style:{maxWidth:"100%"}},{default:()=>p.title})]),h?i(f,{modelValue:m.value[p.field],"onUpdate:modelValue":e=>m.value[p.field]=e},null):null])}(e,a,c),e.slots=m}(S,F),function(t,l,i){var o,s;const r=a(e(l));r.componentProps={size:"mini"===i.size?"small":i.size,...r.componentProps},t.editRender={autofocus:"input",name:j.getCellType(l),props:r},t.editRender.enabled=!Reflect.get(h,t.editRender.name),d(null==(o=t.slots)?void 0:o.default)&&(t.editRender.enabled=t.editRender.enabled&&d(null==(s=t.slots)?void 0:s.edit));if(!n(l.settingObj))return;Reflect.has(l.settingObj,"isHide")&&(t.visible=t.visible&&R.notPositive(l.settingObj.isHide))}(S,F,g),S})),g.fieldHooks.field.tap({name:F+"After",stage:p},(e=>(n(e.slots)&&Object.entries(e.slots).forEach((([t,l])=>{null==l&&Reflect.deleteProperty(e.slots,t)})),e)))}})}export{F as lowCodeFieldAdaptorPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,
|
|
1
|
+
import{reactive as e,onBeforeUnmount as i,inject as t,createVNode as o,mergeProps as n}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as l,InjectionIhoTableUUID as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as d,IhoTableUtils as s,IhoTableRenderHelper as u}from"../../../../utils/index.js";import p from"./editSelect.js";import{getDefaultValue as a}from"./selectUtils.js";import{defineTablePlugin as c}from"../../../../hooks/useTablePlugin.js";function f(){const f="selectRendererPlugin",m=e(new Map),E=e(new Map);function v(e={}){return{renderCell({props:e},{row:i,column:n}){var l;const d=t(r),s=(null==(l=m.get(d).find((e=>e.field===n.field)))?void 0:l.options)||[],u=a(i,e,s);return[o("span",null,[u])]},renderEdit:u.createRenderEdit((({fieldItem:i,emitFormClick:l,row:d,column:s,$rowIndex:u})=>{var a;const c=t(r),f=(null==(a=m.get(c).find((e=>e.field===s.field)))?void 0:a.options)||[];return[o(p,n({queryOptions:i.queryOptions,options:f},e,i.componentProps,{column:s,row:d,"row-index":u,value:d[s.field],"onUpdate:value":e=>d[s.field]=e,onClick:l}),null)]}))}}return c({name:f,vxe(e){e.interceptor.add("event.clearActived",d([l.SELECT,l.SELECT_MORE],(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(l.SELECT,v()),e.renderer.add(l.SELECT_MORE,v({multiple:!0}))},apply(e){e.fieldHooks.fieldList.tap(f,((e,{uuid:i})=>(i&&(E.set(i,e),m.set(i,[])),e))),e.fieldHooks.fieldEnd.tapPromise(f,(async({uuid:e},{$table:i})=>{if(!e)return;const t=E.get(e),o=m.get(e);t.forEach((async i=>{var t,n;if(i.field&&(null==(t=i.editRender)?void 0:t.props)&&["SELECT","SELECT_MORE"].includes(s.getCellType(i.editRender.props))){if(o.findIndex((e=>e.field===i.field))>-1)return;let t=i.options||[];if(i.queryOptions)try{const e={keyword:"",column:i,isFullData:!0};t=await(null==(n=i.queryOptions)?void 0:n.call(i,e))}catch(e){console.log(`获取${i.field}_options错误`)}o.push({field:i.field,options:t}),m.set(e,o)}}))})),e.setupHooks.setup.tap(f,(e=>{i((()=>{e.value.uuid&&(E.delete(e.value.uuid),m.delete(e.value.uuid))}))}))}})}export{f as selectRendererPlugin};
|