cnhis-design-vue 3.1.55-release.2 → 3.1.56-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/annotation-edit/index.d.ts +18 -0
- package/es/components/annotation-edit/src/AnnotationEdit.d.ts +18 -0
- package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
- package/es/components/annotation-edit/src/type.d.ts +4 -0
- package/es/components/audio-sdk/src/audioSDK.d.ts +20 -6
- package/es/components/audio-sdk/src/audioSDK.js +1 -1
- package/es/components/audio-sdk/src/components/recordingDialog.vue.d.ts +14 -0
- package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -1
- package/es/components/audio-sdk/src/utils/recordingDialog.d.ts +5 -2
- package/es/components/audio-sdk/src/utils/recordingDialog.js +1 -1
- package/es/components/audio-sdk/style/index.css +1 -1
- package/es/components/base-search/index.d.ts +14 -0
- package/es/components/base-search/src/index.vue.d.ts +14 -0
- package/es/components/base-search/src/index.vue2.js +1 -1
- package/es/components/base-search/style/index.css +1 -1
- package/es/components/button-print/src/utils/print.d.ts +3 -0
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +26 -4
- package/es/components/classification/index.d.ts +20 -22
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +14 -0
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +20 -22
- package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +9 -20
- package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
- package/es/components/classification/src/index.vue.d.ts +20 -22
- package/es/components/classification/src/index.vue2.js +1 -1
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/fabric-chart/index.d.ts +4 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +4 -2
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/form-config/index.d.ts +82 -14
- package/es/components/form-config/src/FormConfig.vue.d.ts +82 -14
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +26 -4
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +41 -7
- package/es/components/form-render/index.d.ts +26 -4
- package/es/components/form-render/src/FormRender.vue.d.ts +27 -4
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +26 -4
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/constants/index.d.ts +1 -0
- package/es/components/form-render/src/constants/index.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.d.ts +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +10 -2
- package/es/components/form-render/src/hooks/useFormContext.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +3 -1
- package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +77 -13
- package/es/components/info-header/src/InfoHeader.vue.d.ts +77 -13
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +5 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +5 -1
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +31 -5
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +26 -4
- package/es/components/recommend-search/index.d.ts +8 -8
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +8 -8
- package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +3 -3
- package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +3 -3
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/shortcut-setter/index.d.ts +26 -4
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +26 -4
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +14 -0
- package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +14 -0
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +14 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +14 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +15 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +14 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +15 -0
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +15 -0
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/hooks/selectHooks/useSelectRenders.d.ts +1 -1
- package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/business.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,computed as t,createVNode as r,mergeProps as
|
|
1
|
+
import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as i,watch as a,onUnmounted as s,onMounted as d,withModifiers as c}from"vue";import{checkInSetupEnv as u}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as h,noop as v,isEmpty as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as x}from"../constants/index.js";import{useFieldListAdaptor as b}from"./useFieldListAdaptor.js";import{createObjSchema as F}from"../utils/schema.js";import{renderDescOption as S}from"../utils/index.js";const j=e(new Map);function O(e,t,r=0){j.set(e,j.get(e)||{});j.get(e)[t+""]=r}function M(e,t,r=!0){const n=j.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function W(e,t){const r=j.get(e);r&&Reflect.deleteProperty(r,t+"")}function $(e){j.delete(e)}const k=l({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},name:{type:String,required:!0}},setup(e){const l=o(g),u=o(x),h=p(),y=o(l+"_virtualParent",""),S=`${y?y+".":""}${h.value.address}`;function j(e){return`${S}.${e}`}i(l+"_virtualParent",S);const{schemaAdaptor:$}=b(u);function k(t){var r,n,l,o;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,childWidthMode:null!=(o=null==(l=t["x-component-props"])?void 0:l.childWidthMode)?o:e.childWidthMode,size:"small"}})}const E=t((()=>{const t=$(e.fieldItems);return Object.values(t).forEach(k),F(t)}));a(E,(()=>{return e=E.value,void Object.values(e.properties||{}).forEach((e=>{var t;O(l,j(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const K=m();function P(){return e.fieldItems.map((e=>K.value.query(e.val_key).take()))}s((()=>{var e;P().forEach((e=>{e&&e.setDisplay("none")})),e=E.value,Object.values(e.properties||{}).forEach((e=>{W(l,j(e.name))}))})),d((()=>{P().forEach((e=>{e&&e.setDisplay("visible")}))}));const _=c(v,["stop"]),I=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=_,e)),{});return()=>{return r("section",n({class:"form-render__labelField",style:{"--column":(e=E.value,Object.values(e.properties||{}).reduce(((e,t)=>e+M(l,j(t.name))),0)),flex:"1"}},I),[r(f,{basePath:".",schema:E.value},null)]);var e}}});function E(e,l){u();const o=t((()=>e.options.some((e=>h(e.childrenFields)&&e.childrenFields.length))));function i(e,t,r="value"){return!y(t.childrenFields)&&(h(e)?e.includes(t[r]):e===t[r])}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:a="label",childFieldStrategy:s,childWidthMode:d,renderLabel:c=!0,attrs:u}){return[function(){var e;const n=null!=(e=t.title)?e:t[a],l=r("span",{title:n},[t[a]]);return c?t.desc?S(l,t):l:null}(),o.value&&("all"===s||i(e,t,l))?r(k,n({fieldItems:t.childrenFields,name:t[l],childFieldStrategy:s,childWidthMode:d},u),null):null]},valueRef:l,hasComplexOption:o}}function K(){return{getSpan:M,setSpan:O,deleteSpan:W,clearSpan:$}}export{E as useComplexOptions,K as useComplexOptionsSpan};
|
|
@@ -68,7 +68,11 @@ export declare function useFieldNormalize(): {
|
|
|
68
68
|
}>;
|
|
69
69
|
components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
|
|
70
70
|
scope: import("../../../../shared/types").AnyObject;
|
|
71
|
-
annotation: import("
|
|
71
|
+
annotation: Record<string, import("../../../annotation-edit/src/type").AnnotationItem>;
|
|
72
|
+
annotationShortcuts: (string | {
|
|
73
|
+
label: string;
|
|
74
|
+
value: string;
|
|
75
|
+
})[] | undefined;
|
|
72
76
|
consumer: boolean;
|
|
73
77
|
uuid: string;
|
|
74
78
|
lifeCycle: Partial<{
|
|
@@ -159,7 +163,11 @@ export declare function useFieldNormalize(): {
|
|
|
159
163
|
}>;
|
|
160
164
|
components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
|
|
161
165
|
scope: import("../../../../shared/types").AnyObject;
|
|
162
|
-
annotation: import("
|
|
166
|
+
annotation: Record<string, import("../../../annotation-edit/src/type").AnnotationItem>;
|
|
167
|
+
annotationShortcuts: (string | {
|
|
168
|
+
label: string;
|
|
169
|
+
value: string;
|
|
170
|
+
})[] | undefined;
|
|
163
171
|
consumer: boolean;
|
|
164
172
|
uuid: string;
|
|
165
173
|
lifeCycle: Partial<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{uuidGenerator as e}from"../../../../shared/utils/index.js";import"lodash-es";import"naive-ui";import{computed as o,provide as t,readonly as r}from"vue";import"@vueuse/core";import"date-fns";import{useFormAsyncQueue as s,presetRequestHandler as n}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{createSchemaField as i}from"@formily/vue";import{isObject as a}from"@vue/shared";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as u,InjectionSchemaField as c,InjectionBusinessCollector as p,InjectionChangeContextCollector as l,InjectionFormItemDepsCollector as f,InjectionFormUUID as d,InjectionAnnotation as h,InjectionFormGlobalProps as
|
|
1
|
+
import{uuidGenerator as e}from"../../../../shared/utils/index.js";import"lodash-es";import"naive-ui";import{computed as o,provide as t,readonly as r}from"vue";import"@vueuse/core";import"date-fns";import{useFormAsyncQueue as s,presetRequestHandler as n}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{createSchemaField as i}from"@formily/vue";import{isObject as a}from"@vue/shared";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as u,InjectionSchemaField as c,InjectionBusinessCollector as p,InjectionChangeContextCollector as l,InjectionFormItemDepsCollector as f,InjectionFormUUID as d,InjectionAnnotation as h,InjectionAnnotationShortcuts as j,InjectionFormGlobalProps as C}from"../constants/index.js";import{useFormRenderLifeCycle as v}from"./useFormRenderLifeCycle.js";import{usePresetScope as x}from"./usePresetScope.js";import{useBusinessBinding as y}from"./useBusinessBinding.js";import{useChangeContext as q}from"./useChangeContext.js";import{useFormItemDeps as g}from"./useFormItemDeps.js";function F(F,R){const{callLifeCycle:b}=v(F),S=s(o((()=>F.requestInstance)),o((()=>!!F.uniqueCacheData))).create(F.parallelism,{beforeRequest:(...e)=>b("beforeRequest",e)||e[1],afterRequest:(...e)=>b("afterRequest",e)||n(e[1])});t(u,S);const D=i({components:{...m,...F.components},scope:Object.assign({},x(),F.scope)}).SchemaField;t(c,D);const I=y().create(F.businessFormatter);t(p,I);const k=q().create();t(l,k);const B=g().create();t(f,B);const L=F.uuid||e();return t(d,L),t(h,o({get:()=>F.annotation?r(F.annotation):null,set(e){if(!a(F.annotation)||!a(e))return;const o=F.annotation[e.property];F.annotation[e.property]=e.value,R("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),t(j,o((()=>F.annotationShortcuts))),t(C,F),{asyncQueue:S,SchemaField:D,businessCollector:I,changeContextCollector:k,formItemDepsCollector:B,formUUID:L}}export{F as useFormContext};
|
|
@@ -3,6 +3,7 @@ import { AnyObject, LowCodeTypes, UndefinedAble } from '../../../../shared/types
|
|
|
3
3
|
import { DataField, Field, Form, GeneralField } from '@formily/core';
|
|
4
4
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
5
5
|
import { Component, FunctionalComponent } from 'vue';
|
|
6
|
+
import { AnnotationItem } from '../../../../components/annotation-edit/src/type';
|
|
6
7
|
import { FIELD_BUSINESS_TYPE } from '../../../../components/form-render/src/constants';
|
|
7
8
|
import { FieldItem } from '../types';
|
|
8
9
|
export * from './fieldItem';
|
|
@@ -134,7 +135,8 @@ export declare type FormRenderProps = Partial<{
|
|
|
134
135
|
schema: ISchema;
|
|
135
136
|
components: Record<string, Component | FunctionalComponent>;
|
|
136
137
|
scope: AnyObject;
|
|
137
|
-
annotation:
|
|
138
|
+
annotation: Record<string, AnnotationItem>;
|
|
139
|
+
annotationShortcuts: Exclude<NonNullable<AnnotationItem>, string>['shortcuts'];
|
|
138
140
|
consumer: boolean;
|
|
139
141
|
uuid: string;
|
|
140
142
|
lifeCycle: FormRenderLifeCycle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{format as e}from"date-fns";import"../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../constants/index.js";import{getLowCodeFieldFromField as
|
|
1
|
+
import{format as e}from"date-fns";import"../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../constants/index.js";import{getLowCodeFieldFromField as n}from"../utils/index.js";import{defineTablePlugin as u}from"../hooks/useTablePlugin.js";function l(){const l="defaultValuePlugin",a=new Map([[t.TIME,({defaultValue:t,valueFormat:n="HH:mm"})=>"current"===t?e(Date.now(),n):t],[t.DATE,({defaultValue:t,valueFormat:n="yyyy-MM-dd HH:mm:ss"})=>"current"===t?e(Date.now(),n):t]]);return u({name:l,apply(e){e.fieldHooks.field.tap(l,(e=>(e.editRender={defaultValue:({column:e})=>function(e){var t;const u=n(e);if(!u||null==u.defaultValue)return null;const l=null==(t=e.editRender)?void 0:t.name,o=l&&a.get(l);return o?o(u):u.defaultValue}(e),...e.editRender},e)))}})}export{l as defaultValuePlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useAttrs as t,onBeforeUnmount as e,inject as l,createVNode as o}from"vue";import{arrayed as n,widthAppend as a}from"../../../../shared/utils/index.js";import{isObject as r,isString as i,isFunction as s}from"lodash-es";import u from"../../../annotation-edit/index.js";import"../../index.js";import{InjectionIhoTableAnnotation as d,InjectionIhoTableConfig as m}from"../constants/index.js";import{getLowCodeFieldFromField as c,IhoTableRenderHelper as p}from"../utils/index.js";import{defineTablePlugin as h}from"../hooks/useTablePlugin.js";function f(){const f="headerPlugin";return h({name:f,apply(h){let v=null;h.setupHooks.setup.tap(f,(()=>{v=t(),e((()=>{v=null}))})),h.fieldHooks.field.tap(f,(t=>{var e;const h=null==(e=t.slots)?void 0:e.header;return t.slots={...t.slots,header:e=>function(t,e,c){var h;const f=l(d),x=l(m),b=l("$xetable"),j=t.column||{},g=r(null==f?void 0:f.value)&&!1!==e.annotation,w=p.isEditableColumn(x.value,j),W=p.hasFilter(e)||p.hasDateFiler(e),k=null==(h=e.titlePrefix)?void 0:h.content,y=i(c)?c:s(c)?c(t):null;let D=!1;if(x.value){const t=x.value.editRules&&x.value.editRules[j.field];t&&(D=n(t).some((t=>t.required)))}const M=x.value.border?Math.max(2,Math.ceil(b.reactData.scrollbarWidth/b.reactData.tableColumn.length)):1,P=a(Math.max(0,j.renderWidth-20-M-(D?14:0)-(g?18:0)-(W?23:0)-(w?22:0)-(k?20:0)-(j.sortable?23:0)));return o("section",{class:"iho-table__headerWrapper"},[o("section",{style:{width:P}},[null!=y?y:o("div",{style:{maxWidth:"100%",textOverflow:"ellipsis",whiteSpace:"nowrap"}},[function(){const t=j.title,e=/\\n|\n|\r/g;if(!e.test(t))return t;const l=t.replace(e,"<br>").split("<br>");return l.map(((t,e)=>[t,e===l.length-1?null:o("br",null,null)]))}()])]),g?o(u,{modelValue:f.value[j.field],"onUpdate:modelValue":t=>f.value[j.field]=t,shortcuts:v&&(v["annotation-shortcuts"]||v.annotationShortcuts)||[]},null):null])}(e,c(t),h)},t}))}})}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as o,createVNode as t,mergeProps as
|
|
1
|
+
import{reactive as e,inject as o,createVNode as t,mergeProps as n,onBeforeUnmount as l}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as s}from"../../../../constants/index.js";import{useAutoFocus as u}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as d,getTitle as a,IhoTableRenderHelper as c,IhoTableUtils as p}from"../../../../utils/index.js";import f from"./editSelect.js";import{getDefaultValue as m,isConnectField as v,getArray as w}from"./selectUtils.js";import{getSelectOptions as h,selectOptionsMap as b}from"../hooks/useSelectOption.js";import{cloneDeep as g,isFunction as y,isEqual as C}from"lodash-es";import{defineTablePlugin as E}from"../../../../hooks/useTablePlugin.js";function x(){const x="selectRendererPlugin",k=e(new Map);function j(e){return!0===e||"1"===e}return E({name:x,vxe(e){e.interceptor.add("event.clearActived",d(r.SELECT,(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(r.SELECT,{renderCell({props:e},{row:n,column:l,$table:r}){var u;const d=o(s),c=h(d,l.field,n,r),p=m(n,e,c),f=i(p).join(","),v=e&&(j(e.variableHeight)||(null==(u=e.componentProps)?void 0:u.indexedText));return[t("span",{title:a(l,f),class:"iho-table__colorAndIcon"},[v?i(p).reduce(((e,o)=>(null!=o&&e.push([o,";",t("br",null,null)]),e)),[]):f])]},renderEdit:c.createRenderEdit((({fieldItem:e,emitFormClick:l,row:i,column:r,$rowIndex:u,$table:d})=>{var a,c,p,m;const v=o(s),w=h(v,r.field,i,d),b=j(null!=(c=null==(a=e.componentProps)?void 0:a.allowModify)?c:e.allowModify),g=j(null!=(m=null==(p=e.componentProps)?void 0:p.allowCreate)?m:e.allowCreate)||b;return[t(f,n({queryOptions:e.queryOptions},e.componentProps,{options:w,column:r,row:i,"row-index":u,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,allowModify:b,allowCreate:g,onClick:l}),null)]}))})},apply(e){async function o(e,o={}){var t,n,l;const i=null==(t=e.editRender)?void 0:t.props;if(!i)return[];let r=w(i.options)||w(null==(n=i.componentProps)?void 0:n.options)||[];if(i.queryOptions)try{const t={column:e,isFullData:!0,...o};r=await(null==(l=i.queryOptions)?void 0:l.call(i,t))}catch(e){console.log(`获取${i.field}_options错误`)}return r}function t(e){return e&&p.getCellType(e)===r.SELECT}u(e).bindAutoFocusConfig(x,r.SELECT,".n-base-selection-input,.n-base-selection-tags"),e.fieldHooks.fieldList.tap(x,((e,{uuid:n})=>{if(n){b.get(n)||b.set(n,{}),k.set(n,g(e));const l=b.get(n);e.forEach((async n=>{var i;const r=null==(i=n.editRender)?void 0:i.props;if(n.field&&r&&t(r)&&!v(e,n.field)){if(y(r.queryOptions)&&l[n.field])return;l[n.field]=[],l[n.field]=await o(n)}}))}return e})),e.dataHooks.data.tap(x,((e,{uuid:n},l)=>{if(!n)return;const i=k.get(n);if(!i||!i.length)return;const r=b.get(n);i.forEach((async n=>{var l;const s=null==(l=n.editRender)?void 0:l.props;if(n.field&&s&&t(s)&&(null==s?void 0:s.connectField)){const t=s.connectField.split(","),l=e[s.columnName];t.forEach((async t=>{const u=null==i?void 0:i.find((e=>e.field===t));if(!u)return;const d=l?`${t}__${s.columnName}-${l}`:t;r[d]||(r[d]=[],r[d]=await o(u,{row:e,connectColumn:n}))}))}}))})),e.setupHooks.setup.tap(x,(e=>{l((()=>{var o;const t=null==(o=e.value)?void 0:o.uuid;t&&(b.delete(t),k.delete(t))}))})),e.eventHooks.onCellDblclick.tap(x,(({$table:e},o,{emits:n})=>{var l;const{column:i,row:r}=e.reactData.editStore.actived;if(!i||!r)return;const s=null==(l=i.editRender)?void 0:l.props,{cellDblclickSelectable:u=!1,multiple:d=!1,valueField:a="value"}=s.componentProps||{};if(!u||!t(s))return;const c=o.uuid&&h(o.uuid,i.field,r,e);if(1!==(null==c?void 0:c.length))return;const p=d?[c[0][a]]:c[0][a],f=r[i.field];e.clearEdit(),C(p,f)||(r[i.field]=p,n("formChange",{column:i,row:r,oldValue:f,value:p,index:e.getRowIndex(r),$table:e,option:c[0]}))}))}})}export{x as selectRendererPlugin};
|