cnhis-design-vue 3.1.48-beta.2 → 3.1.48-beta.20
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 +13 -0
- package/es/components/base-search/src/index.vue.d.ts +13 -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/card-reader-sdk/src/cardReaderSDK.d.ts +37 -8
- package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
- package/es/components/card-reader-sdk/src/components/readCardDialog.vue.d.ts +19 -0
- package/es/components/card-reader-sdk/src/components/readCardDialog.vue2.js +1 -1
- package/es/components/card-reader-sdk/src/constants/index.d.ts +60 -168
- package/es/components/card-reader-sdk/src/constants/index.js +1 -1
- package/es/components/card-reader-sdk/src/insuranceSDK.d.ts +1 -6
- package/es/components/card-reader-sdk/src/insuranceSDK.js +1 -1
- package/es/components/card-reader-sdk/src/types/index.d.ts +27 -21
- package/es/components/card-reader-sdk/src/utils/index.d.ts +1 -1
- package/es/components/card-reader-sdk/src/utils/index.js +1 -1
- package/es/components/card-reader-sdk/src/utils/readHealthCard.d.ts +6 -1
- package/es/components/card-reader-sdk/src/utils/readHealthCard.js +1 -1
- package/es/components/classification/index.d.ts +3 -0
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +3 -0
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +3 -0
- package/es/components/classification/src/index.vue.d.ts +3 -0
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +7 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +2 -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.d.ts +2 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.d.ts +2 -2
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/field-set/index.d.ts +21 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +22 -2
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/components/Row.vue2.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +8 -0
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +13 -0
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +2 -0
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +1 -0
- package/es/components/iho-table/src/constants/index.d.ts +2 -1
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
- package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/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/radioRendererPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/radioRendererPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +18 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/colorRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/labelRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.js +1 -1
- package/es/components/iho-table/src/plugins/virtualTreePlugin/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 +1 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +13 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +13 -0
- package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
- package/es/components/info-header/style/index.css +1 -1
- package/es/components/quick-search/style/index.css +1 -1
- package/es/components/scale-view/index.d.ts +2 -0
- package/es/components/scale-view/src/ScaleView.vue.d.ts +2 -0
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +2 -0
- package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/utils/judge-types.d.ts +9 -1
- package/es/components/scale-view/src/utils/judge-types.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +3 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/index.d.ts +1 -0
- package/es/shared/utils/business.js +1 -1
- package/package.json +2 -2
- package/es/components/iho-table/src/plugins/fieldConnectionPlugin/index.d.ts +0 -1
- package/es/components/iho-table/src/plugins/fieldConnectionPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/tooltipPlugin.d.ts +0 -1
- package/es/components/iho-table/src/plugins/tooltipPlugin.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
import { setStyle, isDisable } from './utils';
|
|
3
|
-
import { FieldSetColumnName } from '../../../../es/components/field-set/src/types';
|
|
3
|
+
import { FieldSetColumnName, FieldSetColumnItem } from '../../../../es/components/field-set/src/types';
|
|
4
4
|
import { AnyObject } from '../../../../es/shared/types';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
fields: {
|
|
@@ -42,6 +42,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
42
42
|
groupSetting: {
|
|
43
43
|
type: PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("../../../../es/components/iho-table").IhoTableRowGroupItem[]>> | undefined>;
|
|
44
44
|
};
|
|
45
|
+
customColumns: {
|
|
46
|
+
type: PropType<FieldSetColumnItem[]>;
|
|
47
|
+
default: () => never[];
|
|
48
|
+
};
|
|
45
49
|
}, {
|
|
46
50
|
fieldsMapping: Record<string, string>;
|
|
47
51
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -84,6 +88,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
84
88
|
groupSetting: {
|
|
85
89
|
type: PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("../../../../es/components/iho-table").IhoTableRowGroupItem[]>> | undefined>;
|
|
86
90
|
};
|
|
91
|
+
customColumns: {
|
|
92
|
+
type: PropType<FieldSetColumnItem[]>;
|
|
93
|
+
default: () => never[];
|
|
94
|
+
};
|
|
87
95
|
}>> & {
|
|
88
96
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
89
97
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -91,7 +99,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
91
99
|
}>>;
|
|
92
100
|
emit: (event: "close" | "save" | "reset", ...args: any[]) => void;
|
|
93
101
|
newFields: import("vue").Ref<AnyObject[]>;
|
|
94
|
-
columns: import("vue").Ref<
|
|
102
|
+
columns: import("vue").Ref<{
|
|
103
|
+
title: string;
|
|
104
|
+
type: "text" | "checkbox" | "select" | "input" | "inputNumber";
|
|
105
|
+
field: string;
|
|
106
|
+
checkedAll?: boolean | undefined;
|
|
107
|
+
disabledAll?: boolean | undefined;
|
|
108
|
+
isShow?: boolean | undefined;
|
|
109
|
+
}[]>;
|
|
95
110
|
fieldList: import("vue").ComputedRef<AnyObject[]>;
|
|
96
111
|
handleFieldSave: () => void;
|
|
97
112
|
onCancle: () => void;
|
|
@@ -356,6 +371,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
356
371
|
groupSetting: {
|
|
357
372
|
type: PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("../../../../es/components/iho-table").IhoTableRowGroupItem[]>> | undefined>;
|
|
358
373
|
};
|
|
374
|
+
customColumns: {
|
|
375
|
+
type: PropType<FieldSetColumnItem[]>;
|
|
376
|
+
default: () => never[];
|
|
377
|
+
};
|
|
359
378
|
}>> & {
|
|
360
379
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
361
380
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -382,5 +401,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
382
401
|
}>[];
|
|
383
402
|
footerFlag: boolean;
|
|
384
403
|
isEdit: boolean;
|
|
404
|
+
customColumns: FieldSetColumnItem[];
|
|
385
405
|
}>;
|
|
386
406
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,computed as t,watch as i,openBlock as d,createElementBlock as o,createElementVNode as a,Fragment as s,renderList as c,normalizeStyle as n,unref as r,createBlock as u,withCtx as f,createTextVNode as
|
|
1
|
+
import{defineComponent as e,ref as l,computed as t,watch as i,openBlock as d,createElementBlock as o,createElementVNode as a,Fragment as s,renderList as c,normalizeStyle as n,unref as r,createBlock as u,withCtx as f,createTextVNode as m,toDisplayString as h,createCommentVNode as p,createVNode as y,renderSlot as v}from"vue";import{NCheckbox as b,NPopconfirm as k,NButton as g}from"naive-ui";import x from"../../../shared/components/VueDraggable/src/vuedraggable.js";import A from"./components/Row.vue.js";import{isArray as _,cloneDeep as w}from"lodash-es";import{setStyle as C,getGroupTree as S,isDisable as W}from"./utils/index.js";import{isString as E}from"xe-utils";const F={class:"c-field-set"},N={class:"c-field-set__table-header"},R={class:"c-field-set__table-body"},j=["tabindex"],q={key:0,class:"c-field-set__table-footer"};var U=e({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:U,emit:D}){const V=e,O={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"},T=l([]),B=l([{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"show"},{title:"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:"默认排序",type:"select",field:"sortDirection"},{title:"固定",type:"select",field:"fixedWay"},{title:"自定义标题",type:"input",field:"alias"},{title:"列宽",type:"inputNumber",field:"columnWidth"}]),P=t((()=>T.value.flat())),G=()=>{D("save",{tableFields:$()})},H=()=>{D("close")};function I(){T.value=L(),J(),D("reset")}function L(){const e=w(V.fields);return Object.keys(O).forEach((l=>{e.forEach((e=>{"old"==V.type&&Reflect.has(e,l)&&("isFixed"==l?e.fixedWay=1==e[l]?"LEFT":2==e[l]?"RIGHT":"NONE":["isShow","isSort"].includes(l)&&"boolean"!=typeof l?e[O[l]]=1==e[l]:e[O[l]]=e[l],Reflect.deleteProperty(e,l)),e.columnWidth=+e.columnWidth||null,Reflect.has(e,"alias")||(e.alias=""),Reflect.has(e,"bold")||(e.bold=!1)}))})),function(e){if(V.groupSetting){return S(V.groupSetting,e).reduce(((t,i)=>{const d=E(i)?e.find((e=>e.name===i)):l(i.children);return d&&t.push(d),t}),[])}return e;function l(t){const i=[];return t.forEach((t=>{if(t.children)i.push(...l(t.children));else{const l=e.find((e=>e.name===t));l&&i.push(l)}})),i}}(e)}const $=()=>"old"==V.type?P.value.map(((e,l)=>({id:e.id,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth,bold:e.bold,sortDirection:e.sortDirection,...V.isEdit?{required:e.required,editable:e.editable}:{}}))):P.value;function z({checked:e,column:l}){const t=!e||K(l.field);l.checkedAll=!t}function J(){var e,l;(null==(e=V.showColumnNames)?void 0:e.length)&&(B.value=B.value.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=V.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=V.customColumns)?void 0:l.length)&&B.value.push(...V.customColumns),B.value.forEach((e=>{if(function(e){const l=["editable","required"].includes(e.field);return l&&V.isEdit||!l}(e)&&(e.isShow=!0),"checkbox"===e.type){const l=T.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!K(e.field)&&!l}}))}function K(e){return T.value.flat().some((l=>!W(l,e)&&!l[e]&&"0001"!=l.id))}return i([()=>V.fields,()=>{var e;return null==(e=V.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(T.value=L(),J())}),{immediate:!0,deep:!0}),U({getTableFields:$}),(l,t)=>(d(),o("div",F,[a("div",N,[(d(!0),o(s,null,c(B.value,((e,l)=>(d(),o(s,{key:l},[e.isShow?(d(),o("span",{key:0,class:"table-cell",style:n(r(C)(e))},["checkbox"===e.type?(d(),u(r(b),{key:0,checked:e.checkedAll,"onUpdate:checked":[l=>e.checkedAll=l,l=>{return t=l,i=e.field,void P.value.forEach((e=>{W(e,i)||(e[i]=t)}));var t,i}],disabled:e.disabledAll},{default:f((()=>[m(h(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])):p("v-if",!0),m(" "+h("checkbox"!==e.type?e.title:""),1)],4)):p("v-if",!0)],64)))),128))]),a("div",R,[y(r(x),{modelValue:T.value,"onUpdate:modelValue":t[0]||(t[0]=e=>T.value=e),animation:"150","item-key":"id",draggable:".item"},{item:f((({element:e,index:l})=>[e.hide?p("v-if",!0):(d(),o("div",{key:0,class:"item",tabindex:l},[r(_)(e)?(d(!0),o(s,{key:0},c(e,((e,l)=>(d(),u(A,{key:l,element:e,columns:B.value,onUpdateChecked:z},null,8,["element","columns"])))),128)):(d(),u(A,{key:1,element:e,columns:B.value,onUpdateChecked:z},null,8,["element","columns"]))],8,j))])),_:1},8,["modelValue"])]),e.footerFlag?(d(),o("div",q,[p(" 底部按钮插槽 "),v(l.$slots,"footer",{},(()=>[y(r(k),{onPositiveClick:I},{trigger:f((()=>[y(r(g),{style:{"margin-right":"8px"}},{default:f((()=>[m("恢复默认设置")])),_:1})])),default:f((()=>[m(" 确认要恢复系统默认设置吗? ")])),_:1}),y(r(g),{style:{"margin-right":"8px"},onClick:H},{default:f((()=>[m("取消")])),_:1}),y(r(g),{type:"primary",onClick:G},{default:f((()=>[m("保存")])),_:1})]))])):p("v-if",!0)]))}});export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as n,renderList as a,normalizeStyle as i,unref as d,
|
|
1
|
+
import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as n,renderList as a,normalizeStyle as i,unref as d,createBlock as u,withCtx as o,createVNode as p,createCommentVNode as m,createTextVNode as f,toDisplayString as c,withDirectives as v,vShow as r,createElementVNode as s}from"vue";import{NTooltip as y,NIcon as k,NCheckbox as b,NSelect as h,NInput as x,NInputNumber as U}from"naive-ui";import{setStyle as g,isDisable as N}from"../utils/index.js";import{ReorderTwoOutline as C}from"@vicons/ionicons5";const E={class:"row"},w=["title"],O=s("span",null,"拖拽调整顺序",-1);var S=e({__name:"Row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]}},emits:["updateChecked"],setup(e,{emit:s}){const S=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],_=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}];function j(e){return"fixedWay"===e.field?S:_}return(S,_)=>(l(),t("div",E,[(l(!0),t(n,null,a(e.columns,((a,E)=>(l(),t(n,{key:E},[a.isShow?(l(),t("span",{key:0,class:"table-cell",title:e.element[a.field],style:i(d(g)(a))},["text"===a.type?(l(),t(n,{key:0},[0===E?(l(),u(d(y),{key:0,trigger:"hover"},{trigger:o((()=>[p(d(k),{style:{"margin-right":"5px",top:"2px"},component:d(C)},null,8,["component"])])),default:o((()=>[O])),_:1})):m("v-if",!0),f(" "+c(e.element[a.field]),1)],64)):m("v-if",!0),"checkbox"===a.type?v((l(),u(d(b),{key:1,disabled:d(N)(e.element,a.field),checked:e.element[a.field],"onUpdate:checked":[l=>e.element[a.field]=l,e=>function(e,l){s("updateChecked",{checked:e,column:l})}(e,a)]},null,8,["disabled","checked","onUpdate:checked"])),[[r,"0001"!=e.element.id]]):m("v-if",!0),"select"===a.type?v((l(),u(d(h),{key:2,value:e.element[a.field],"onUpdate:value":l=>e.element[a.field]=l,options:j(a)},null,8,["value","onUpdate:value","options"])),[[r,"fixedWay"===a.field||"0001"!=e.element.id]]):m("v-if",!0),"input"===a.type?v((l(),u(d(x),{key:3,value:e.element[a.field],"onUpdate:value":l=>e.element[a.field]=l,clearable:""},null,8,["value","onUpdate:value"])),[[r,"0001"!=e.element.id]]):m("v-if",!0),"inputNumber"===a.type?(l(),u(d(U),{key:4,value:e.element[a.field],"onUpdate:value":l=>e.element[a.field]=l},null,8,["value","onUpdate:value"])):m("v-if",!0)],12,w)):m("v-if",!0)],64)))),128))]))}});export{S as default};
|
|
@@ -17,3 +17,11 @@ export declare type FieldSetItem = Partial<{
|
|
|
17
17
|
[key: string]: any;
|
|
18
18
|
}>;
|
|
19
19
|
export declare type FieldSetColumnName = 'show' | 'editable' | 'required' | 'sort' | 'bold' | 'sortDirection' | 'fixedWay' | 'alias' | 'columnWidth';
|
|
20
|
+
export declare type FieldSetColumnItem = {
|
|
21
|
+
title: string;
|
|
22
|
+
type: 'text' | 'checkbox' | 'select' | 'input' | 'inputNumber';
|
|
23
|
+
field: string;
|
|
24
|
+
checkedAll?: boolean;
|
|
25
|
+
disabledAll?: boolean;
|
|
26
|
+
isShow?: boolean;
|
|
27
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as
|
|
1
|
+
import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as i}from"../../../iho-table/src/constants/index.js";function n(e){const t={flex:"1 1 90px"};switch(e.type){case"text":"title"===e.field&&Object.assign(t,{flex:"0 0 120px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"});break;case"checkbox":t.flex="1 1 60px";break;case"select":t.flex="1 1 80px";break;case"input":t.flex="1 1 100px"}return t}function s(e,t){return["editable","required"].includes(t)&&e[`${t}Disable`]||["sort"].includes(t)&&1==e.notParticipatingSort}function r(n,s,r=(e=>e.name)){const l=s.map((e=>r(e)));return i.some((i=>{const s=n[i];if(!e(s))return!0;s.forEach((i=>{if(!e(i.list)||!i.list.length)return;const n=[];let s=null;i.list.forEach(((e,r)=>{const c=function(e,i,n){return i.findIndex((i=>i!==n&&(t(i)?i.fieldName:i)===e))}(e,l,s);~c&&(n.push(l[c]),0===r?l.splice(c,1,s={fieldName:i.title,children:n}):l.splice(c,1))}))}))})),l}export{r as getGroupTree,s as isDisable,n as setStyle};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../../../es/shared/types';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
|
+
import { UrlConfig } from '../../../../../../es/components/form-render';
|
|
3
4
|
export declare const RADIO: import("vue").DefineComponent<{
|
|
4
5
|
value: {
|
|
5
6
|
type: (ArrayConstructor | NumberConstructor | ObjectConstructor | StringConstructor)[];
|
|
@@ -8,6 +9,9 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
8
9
|
type: PropType<AnyObject[]>;
|
|
9
10
|
default: () => never[];
|
|
10
11
|
};
|
|
12
|
+
urlConfig: {
|
|
13
|
+
type: PropType<UrlConfig>;
|
|
14
|
+
};
|
|
11
15
|
autograph: {
|
|
12
16
|
type: StringConstructor;
|
|
13
17
|
};
|
|
@@ -70,6 +74,9 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
70
74
|
type: PropType<AnyObject[]>;
|
|
71
75
|
default: () => never[];
|
|
72
76
|
};
|
|
77
|
+
urlConfig: {
|
|
78
|
+
type: PropType<UrlConfig>;
|
|
79
|
+
};
|
|
73
80
|
autograph: {
|
|
74
81
|
type: StringConstructor;
|
|
75
82
|
};
|
|
@@ -144,6 +151,9 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
144
151
|
type: PropType<AnyObject[]>;
|
|
145
152
|
default: () => never[];
|
|
146
153
|
};
|
|
154
|
+
urlConfig: {
|
|
155
|
+
type: PropType<UrlConfig>;
|
|
156
|
+
};
|
|
147
157
|
autograph: {
|
|
148
158
|
type: StringConstructor;
|
|
149
159
|
};
|
|
@@ -206,6 +216,9 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
206
216
|
type: PropType<AnyObject[]>;
|
|
207
217
|
default: () => never[];
|
|
208
218
|
};
|
|
219
|
+
urlConfig: {
|
|
220
|
+
type: PropType<UrlConfig>;
|
|
221
|
+
};
|
|
209
222
|
autograph: {
|
|
210
223
|
type: StringConstructor;
|
|
211
224
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as t,createVNode as o,isVNode as
|
|
1
|
+
import{defineComponent as e,useAttrs as t,createVNode as o,isVNode as l}from"vue";import{connect as a,mapProps as r}from"@formily/vue";import{promiseTimeout as i}from"@vueuse/shared";import{NSpace as u,NRadio as n,NRadioGroup as p,NCheckbox as d,NCheckboxGroup as s}from"naive-ui";import"../../../index.js";import{useComplexOptions as m}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"date-fns";import{assignUpdateValue as c,createVisitedSetter as v}from"../../utils/schema.js";import{useUrlConfigOptions as f,useAutographOptions as y}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as h}from"../../hooks/useCommonInjection.js";import{useFormField as b}from"../../hooks/useFormField.js";function j(a,r,n){return e({name:a,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},urlConfig:{type:Object},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},clearable:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:a}){const{field:d}=b(),{renderComplexOption:s,valueRef:c}=m(e,a),{labelKey:j,valueKey:g,fullOptions:k}=e.urlConfig?f(e,c):y(e,c),{injectValueBindKey:S,injectValueValidate:C}=h();C(c);const F=S(c),O=t();return()=>o(r,{key:F.value,value:c.value,"onUpdate:value":e=>c.value=e,onClick:v(d)},{default:()=>[o(u,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var t;return[null==(t=k.value)?void 0:t.map((t=>{let a;return o(n,{key:t[g.value],value:t[g.value],disabled:t.disabled,onClick:()=>async function(t){if(null==O?void 0:O.disabled)return;if(r!==p||!e.clearable)return;const o=c.value;await i(0),o===t[g.value]&&(c.value=null)}(t)},"function"==typeof(u=a=s({value:c.value,option:t,valueKey:g.value,labelKey:j.value,childFieldStrategy:e.childFieldStrategy}))||"[object Object]"===Object.prototype.toString.call(u)&&!l(u)?a:{default:()=>[a]});var u}))]}})]})}})}const g=a(j("FormRadio",p,n),r({dataSource:"options"},c)),k=a(j("FormCheckbox",s,d),r({dataSource:"options"},c));export{k as CHECKBOX,g as RADIO};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,inject as o,
|
|
1
|
+
import{defineComponent as e,computed as t,inject as o,useAttrs as a,createVNode as l}from"vue";import{useDebounceFn as r}from"@vueuse/core";import{cloneDeep as u,isArray as n,isString as s}from"lodash-es";import{useCommonInjection as i,useSelectOptionProps as p}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as m}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"date-fns";import{assignUpdateValue as c,assignClearBindVisited as d,createVisitedSetter as v}from"../../utils/schema.js";import{useFormField as y}from"../../hooks/useFormField.js";import{NSelect as f}from"naive-ui";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import{connect as h,mapProps as j}from"@formily/vue";import"./index.js";import{useUrlConfigOptions as b,useAutographOptions as k,useRecommendOptions as S,searchContentMatcher as g}from"../../hooks/useFormRenderOptions.js";const F=h(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:c,emit:d}){const h=t({get:()=>e.value,async set(e){d("update:value",e),O(e)}}),{labelKey:j,valueKey:F,fetchData:C,searchContent:A,fullOptions:H,filterOptions:B}=e.urlConfig?b(e,h):k(e,h),{getRecommend:x,postRecommend:O,sortedOptions:R}=S(e,B,d,j,F),{field:V,fieldKey:w}=y();o(m).setContext(w.value,(e=>{return{currentOption:u((t=e,n(t)?function(e){const t=H.value.reduce(((e,t)=>(e[t[F.value]]=t,e)),{});return e.map((e=>t[e]))}(t):(o=t,H.value.find((e=>e[F.value]===o)))))};var t,o}));const L=r((async(e="")=>{A.value=e,C(e),x(e)}),300),{injectValueValidate:N,injectValueWatchFromEmpty:K,injectValueBindKey:P}=i();K(h,L),N(h);const W=P(h),{menuProps:q,nodeProps:I}=p();function U(e){const t=e[j.value];if(!t||!s(t))return"";const o=A.value?g(A.value,t):null;return o?l("section",null,[o.map(((e,t)=>0!==t&&e?l("span",{style:{color:t%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):t}const z=t((()=>R.value.length||!e.allowCreate?R.value:A.value?[{[j.value]:A.value,[F.value]:A.value},...R.value]:R.value)),D=a(),E=t((()=>{if(e.allowCreate)return h.value;const t=D.multiple&&n(h.value);return z.value.find((e=>t?h.value.includes(e[F.value]):e[F.value]===h.value))?h.value:null}));function G(e){if(e)return L();A.value=""}return()=>l(f,{key:W.value,remote:!0,filterable:!0,value:E.value,onUpdateValue:e=>h.value=e,"menu-props":q,"node-props":I,labelField:j.value,valueField:F.value,options:z.value,onSearch:L,"onUpdate:show":G,onFocus:v(V),renderLabel:U},c)}}),j({dataSource:"options"},c,d));export{F as SELECT};
|
|
@@ -15,7 +15,7 @@ export declare class BusinessCollector {
|
|
|
15
15
|
private getType;
|
|
16
16
|
private getValueByField;
|
|
17
17
|
getValueByType(formModel: Form, type: FIELD_BUSINESS_TYPE): unknown;
|
|
18
|
-
setValueByType(formModel: Form, type: FIELD_BUSINESS_TYPE, value: unknown): void;
|
|
18
|
+
setValueByType(formModel: Form, type: FIELD_BUSINESS_TYPE, value: unknown, from: FIELD_BUSINESS_TYPE): void;
|
|
19
19
|
registerChangeBusiness(type: FIELD_BUSINESS_TYPE, handler: (formModel: Form) => void): this;
|
|
20
20
|
private changeHandlerMap;
|
|
21
21
|
trigger(formModel: Form, fieldName: string, triggerType?: 'change' | 'blur'): Map<FIELD_BUSINESS_TYPE, number> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@formily/path";import"@vue/shared";import"../../index.js";import{isIdCard as a,parseIdCard as l,parseAgeFromContext as o,parseBirthday as u,parseAge2Birthday as h}from"../utils/business.js";class y{constructor(e){this.businessFormatter=e,this.triggerLock=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return i(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,t,s){const
|
|
1
|
+
import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@formily/path";import"@vue/shared";import"../../index.js";import{isIdCard as a,parseIdCard as l,parseAgeFromContext as o,parseBirthday as u,parseAge2Birthday as h}from"../utils/business.js";class y{constructor(e){this.businessFormatter=e,this.triggerLock=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return i(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,t,s,i){const n=this.getField(t);n&&e.setFieldState(n.val_key,(e=>{if(e.value===s)return;const a=this.typeLockMap.get(t);this.typeLockMap.set(t,r(a)?a+1:1),e.value=this.formatter({value:s,type:t,fieldKey:n.val_key,from:i})}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(this.triggerLock)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r)>0)return this.typeLockMap.set(r,this.typeLockMap.get(r)-1);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.get(r))||i.call(this,e))}}function c(){function e(){var e;const t=this.getField(n.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function i(i){const r=this.getValueByType(i,n.ID_CARD);if(!r||!t(r)||!a(r))return;const u=l(r),{age:h,ageUnit:y}=o(u);this.setValueByType(i,n.AGE_UNIT,y,n.ID_CARD),this.setValueByType(i,n.AGE,h,n.ID_CARD),this.setValueByType(i,n.SEX,u.sex,n.ID_CARD),this.setValueByType(i,n.BIRTHDAY,s(new Date(u.birthday),e.call(this)),n.ID_CARD)}function c(e){const s=this.getValueByType(e,n.BIRTHDAY);if(!t(s))return;const{age:i,ageUnit:r}=o(u(s));this.setValueByType(e,n.AGE_UNIT,r,n.BIRTHDAY),this.setValueByType(e,n.AGE,i,n.BIRTHDAY)}function p(s){return function(i){const a=this.getValueByType(i,n.AGE),l=this.getValueByType(i,n.AGE_UNIT);(t(a)||r(a))&&""!==a&&t(l)&&""!==l&&this.setValueByType(i,n.BIRTHDAY,h(+a,l,e.call(this)),s)}}return{create:function(e){return new y(e).registerChangeBusiness(n.ID_CARD,i).registerChangeBusiness(n.AGE_UNIT,p(n.AGE_UNIT)).registerChangeBusiness(n.AGE,p(n.AGE)).registerChangeBusiness(n.BIRTHDAY,c)}}}export{y as BusinessCollector,c as useBusinessBinding};
|
|
@@ -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(
|
|
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(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(u){const{createValidatorSchema:x}=l(),f=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 n=x(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},_=e=>{var o;const t=f(e);e.urlConfig?d(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},h=e=>{const o=f(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=f(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},b=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",b],["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=f(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=f(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=f(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",_],["REMOTE_SEARCH",_],["DATE",e=>{const o=f(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=f(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),o}],["SEARCH_CASCADER",e=>{var o;const t=f(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=f(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=f(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=f(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=f(e);Array.isArray(e.properties)&&i("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"],n(e,["wrapperStyle","display"])),o}]]),v=e=>{if(e.suffixConfig)return C(e);return(y.get(e.html_type)||g)(e)},C=o=>{if(!o.suffixConfig)return v(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=f(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:j(n)}),r},{FieldNormalizeWaterfallHook:O}=s();function j(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=O.call(t(o))).validate)?void 0:a.obj_type;return p&&u&&u.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(b(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(v(o),s):(n=null,e[i(o)]=r(v(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:j}}export{u as useFieldListAdaptor};
|
|
@@ -29,6 +29,7 @@ export declare function useUrlConfigOptions(props: {
|
|
|
29
29
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
30
30
|
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
31
31
|
fetchData: (content?: string) => Promise<null | undefined>;
|
|
32
|
+
searchContent: Ref<string | undefined>;
|
|
32
33
|
};
|
|
33
34
|
export declare function useAutographOptions(props: Partial<{
|
|
34
35
|
labelField: string;
|
|
@@ -44,4 +45,5 @@ export declare function useAutographOptions(props: Partial<{
|
|
|
44
45
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
45
46
|
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
46
47
|
fetchData: (content?: string) => Promise<null | undefined>;
|
|
48
|
+
searchContent: Ref<string | undefined>;
|
|
47
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{checkInSetupEnv as e,jsonParse as n,keywordMatcher as t}from"../../../../shared/utils/index.js";import{useForm as l}from"@formily/vue";import{useMemoize as u,useDebounceFn as o}from"@vueuse/core";import{identity as r,uniqBy as a,isString as i,isEqual as c,isArray as s,omit as v,isFunction as m}from"lodash-es";import{computed as f,inject as d,ref as y,toRaw as p,watch as h}from"vue";import"../../index.js";import{InjectionAsyncQueue as g,InjectionFormLifeCycleCaller as w,InjectionFormItemDepsCollector as k}from"../constants/index.js";import{useFormField as b}from"./useFormField.js";import{createUrlConfigParams as
|
|
1
|
+
import{checkInSetupEnv as e,jsonParse as n,keywordMatcher as t}from"../../../../shared/utils/index.js";import{useForm as l}from"@formily/vue";import{useMemoize as u,useDebounceFn as o}from"@vueuse/core";import{identity as r,uniqBy as a,isString as i,isEqual as c,isArray as s,omit as v,isFunction as m}from"lodash-es";import{computed as f,inject as d,ref as y,toRaw as p,watch as h}from"vue";import"../../index.js";import{InjectionAsyncQueue as g,InjectionFormLifeCycleCaller as w,InjectionFormItemDepsCollector as k}from"../constants/index.js";import{useFormField as b}from"./useFormField.js";import{createUrlConfigParams as C,formRenderLog as R}from"../utils/index.js";import{useFormRequest as F}from"./useFormRequest.js";function K(e,n){const t=y();return f({get:()=>t.value?t.value:e[n],set(e){t.value=e}})}const q=(()=>{const e=u((e=>new RegExp(`(.*)${e.split("").map((e=>`(${function(e){return e.match(/[()\[\]{}$^\/]/)?"\\"+e:e}(e)})`)).join("(.*)")}(.*)`)),{getKey:r});return(n,t)=>t.match(e(n))})();function O(){const e=y();return{searchContent:e,optionSearchFilter:function(n,l,u){if(!e.value)return n;const o=s(u)?u.filter((e=>e&&i(e))):[];return n.filter((n=>function(n,l,u){if(!e.value)return!0;const o=n?n[l]:"";return!!i(o)&&(!!q(e.value,o)||!!t(e.value,n.keyword)||!!u.length&&u.some((t=>i(n[t])&&n[t].includes(e.value))))}(n,l,o)))}}}function j(e,t,l,u,o){const r=K(e,"commonList"),i=K(e,"recentList"),{searchContent:c,optionSearchFilter:s}=O();function y(e){return n(e.itemObj)}const p=f((()=>{var e,n;return null!=(n=null==(e=r.value)?void 0:e.map(y))?n:[]})),h=f((()=>{var e,n;return null!=(n=null==(e=i.value)?void 0:e.map(y))?n:[]})),w=f((()=>{if(!e.recommend||!p.value.length&&!h.value.length)return t.value;const n=a(p.value.concat(h.value),(e=>e[o.value])),l=t.value.filter((e=>n.every((function(n){return n[o.value]!==e[o.value]}))));return[...s(n,u.value),...l]})),{getRecommendRequestInfo:k,getHttpInstance:C}=F();function R(n){const{url:t,getRecommendIds:l}=k(),u=m(l)?l():{},o=m(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:t[n],info:Object.assign({},u,o)}}const{fieldKey:q}=b(),j=d(g);return{postRecommend:async function(n){if(!e.recommend)return;const t=C();if(!t)return;const{url:u,info:r}=R("post"),a=w.value.find((e=>e[o.value]===n));a&&l("postRecommend",await t.post(u,{...r,keyword:"",itemId:o.value,itemObj:JSON.stringify(a)}))},getRecommend:async function(n){if(!e.recommend)return;if(c.value=n,r.value&&i.value&&e.recommendCache)return;const t=await j.addAsync(function(n,t){const{url:l,info:u}=R("get");return{url:l,method:"get",key:n,cache:t,params:{...u,recNum:Math.max(e.commonNum,e.recentNum),keyword:""}}}(q.value,e.recommendCache)),{commonly:l,recently:u}=t.reduce(((e,n)=>("commonly"===n.type?e.commonly.push(v(n,["type"])):"recently"===n.type&&e.recently.push(v(n,["type"])),e)),{commonly:[],recently:[]});r.value=l.slice(0,e.commonNum),i.value=u.slice(0,e.recentNum)},sortedOptions:w}}function I(n,t){e();const l=d(g),u=d(w),r=f((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.nameKey)?t:n.labelField)?l:"text"})),a=f((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.valueKey)?t:n.valueField)?l:"value"})),{searchContent:s,optionSearchFilter:v}=O(),m=y(null),{field:F,fieldKey:K}=b(),q=o((async function(e){if(s.value=e||"",!n.urlConfig)return m.value=null;try{const e=await l.addAsync(await C({config:n.urlConfig,cache:n.requestCache,field:F.value}));p(m.value)!==e&&(m.value=e,u("afterOptionInit",[K.value,m.value]))}catch(e){i(e)&&R(e)}}),300),j=f((()=>m.value?v(m.value,r.value):Array.isArray(n.options)?v(n.options,r.value):[])),I=f((()=>m.value||n.options||[])),x=d(k);return h((()=>n.urlConfig),((e,l)=>{if(!c(e,l)){if(m.value=null,!e)return m.value=null;x.setDeps(K.value,e.dependKey||[],(async()=>{m.value=null,t.value=null,!n.lazyRequest&&await q()})),(t.value||!n.lazyRequest)&&q()}}),{immediate:!0}),{labelKey:r,valueKey:a,filterOptions:j,fullOptions:I,fetchData:q,searchContent:s}}function x(n,t){e();const u=d(g),r=d(w),a=l(),v=f((()=>{var e,t,l,u;const o=null==(t=null==(e=n.wordbook)?void 0:e.render_key)?void 0:t[0];if(i(o))return o;let r=null==(l=n.wordbook)?void 0:l.show_key;return s(r)&&(r=r[0]),i(r)?r:null!=(u=n.labelField)?u:"text"})),m=f((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.wordbook)?void 0:e.value_key)?t:n.valueField)?l:"value"})),C=f((()=>{var e;return(null==(e=n.wordbook)?void 0:e.search_key)||[]})),{searchContent:K,optionSearchFilter:q}=O(),j=y(null),{fieldKey:I}=b(),{getSearchRequestInfo:x}=F(),A=o((async function(e){if(K.value=e||"",!n.autograph||!n.wordbook)return j.value=null;try{const e=await u.addAsync(function(e,t,l){var u,o,r;const i={autograph:t,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1};if(null==(u=e.queryParams)?void 0:u.length){const n=null!=(r=null==(o=a.value)?void 0:o.getFormState().values)?r:{};e.queryParams.forEach((e=>{i[e]=n[e]}))}return console.log(i),{...x(),params:i,key:l,cache:n.requestCache}}(n.wordbook,n.autograph,I.value));p(j.value)!==e&&(j.value=e,r("afterOptionInit",[I.value,j.value]))}catch(e){i(e)&&R(e)}}),300),S=f((()=>j.value?q(j.value,v.value,C.value):Array.isArray(n.options)?q(n.options,v.value):[])),N=f((()=>j.value||n.options||[])),_=d(k);return h((()=>n.wordbook),((e,l)=>{if(!c(e,l)){if(j.value=null,!e)return j.value=null;_.setDeps(I.value,e.queryParams||[],(async()=>{j.value=null,A()})),(t.value||!n.lazyRequest)&&A()}}),{immediate:!0}),{labelKey:v,valueKey:m,filterOptions:S,fullOptions:N,fetchData:A,searchContent:K}}export{q as searchContentMatcher,x as useAutographOptions,j as useRecommendOptions,I as useUrlConfigOptions};
|
|
@@ -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.HTML="HTML",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||{}),
|
|
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.HTML="HTML",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.RADIO="RADIO",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||{}),I=(e=>(e[e.left=1]="left",e[e.right=2]="right",e))(I||{});const R=["formChange","settingClick","formClick","keyboard","rowDrag"],S=[...R,...E],i=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,I as IHO_TABLE_FIXED_STATUS,r as IHO_TABLE_NUMBER_STATUS,t as IHO_TABLE_STRING_STATUS,a as IHO_TABLE_TREE_TYPE,R as IhoTableCustomEventNameTuple,S as IhoTableEventNameTuple,l as IhoTableRowGroupSequence,N as InjectionIhoTableAnnotation,i 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{cloneDeep as e,isString as t,isFunction as n,pick as o,isArray as
|
|
1
|
+
import{cloneDeep as e,isString as t,isFunction as n,pick as o,isArray as a,isNumber as i}from"lodash-es";import{isObject as r}from"@vue/shared";const s=Symbol("remove property");function l(){return{formConfigLikeAdaptor:function(l){const p={};return r(l)?{fieldList:function(l){const m=new Map([["NONE",0],["LEFT",1],["RIGHT",2]]),u=new Map([["0",0],["1",1]]),c=new Map([...["RADIO","RADIO_BLOCK","CHECKBOX","CHECKBOX_BLOCK","SELECT","SEARCH","SEARCH_MORE","SWITCH_COMPONENT"].map((e=>[e,"select"])),...["DATE"].map((e=>[e,"date"])),...["INPUT"].map((e=>[e,"input"])),...["DIGITAL"].map((e=>[e,"number"]))]),d=(e,t)=>{if(!r(e))return;const n={label:e.describe,...e};t.options=a(t.options)?[...t.options,n]:[n]},f=(e,n)=>{0!==e&&"0"!==e&&e&&(t(e)||i(e))&&(console.log("value=>",e),n.componentProps={maxTagCount:+e,...n.componentProps})},_=new Map([["multi_select_value",f],["is_null",(e,t,n,o)=>{"1"!==e&&"0"===e&&(o[n.val_key]=[{required:!0,message:"必填"}])}],["validate",(e,t)=>{if(!r(e))return;t.componentProps={...Object.entries({maxlength:"max_length",minlength:"min_length",max:"max_value",min:"min_value",precision:"decimal_length"}).reduce(((t,[n,o])=>(t[n]=e[o],t)),{}),...t.componentProps}}],["dateValidate",(e,t)=>{r(e)&&(t.isDateDisabled=(t,n)=>{if(!r(n))return;const{startDate:o,endDate:a}=e;let i=!1;return o&&(i=new Date(n[o]).getTime()>t),a&&(i=i||new Date(n[a]).getTime()<t),i})}],["date_format","valueFormat"],...["open","close"].map((e=>[e,d])),["is_edit",{property:"isEdit",valueMap:u}],["free_entry",(e,t,n)=>{t.componentProps={...t.componentProps,allowCreate:"1"===e||1===e,shouldSaveCreatedOption:"1"===n.save_free_entry||1===n.save_free_entry}}],["html_type",(e,n,o)=>{var a;if(!t(e))return;if("DATE"===e)return void(n.formType=t(o.date_format)&&o.date_format.startsWith("HH:mm")?"time":"date");n.formType=null!=(a=c.get(e))?a:e;const i="SEARCH"!==e&&("SEARCH_MORE"===e||("SELECT"===e?"0"===o.multi_select:null));i&&(n.componentProps={multiple:i,...n.componentProps})}],["option",{property:"options",fieldMap:new Map([["text","label"]])}],...["alias","name"].map((e=>[e,(e,t,n)=>{var o;t.title=`${null!=(o=n.alias)?o:n.name}${n.suffix?`(${n.suffix})`:""}`}]))]),v=new Map([["sum","isSum"],["show","isShow"],["elementId","columnName"],["columnWidth","colWidth"],["fixedWayEnum",{property:"isFixed",valueMap:m}],["multi_select_value",f],["setting",{fieldMap:_,assign:!0}]]);return l.map((e=>E(e,p,v)));function E(i,l,p){if(!p)return e(i);const m={};return Object.entries(i).forEach((([e,o])=>{const a=p.get(e);return a?a!==s?t(a)?m[a]=o:n(a)?a(o,m,i,l):void(r(a)&&(a.assign?Object.assign(m,u(o,a)):m[a.property||e]=u(o,a))):void 0:m[e]=o})),m.componentProps=Object.assign({},m.componentProps,o(m,["options","isDateDisabled"])),m;function u(e,t){var o,i;return!r(t)||n(t)?e:a(e)?e.map((e=>u(e,t))):r(e)?E(e,l,t.fieldMap):null!=(i=null==(o=t.valueMap)?void 0:o.get(e))?i:e}}}(l.fieldList),editRules:p}:{fieldList:[],editRules:p}}}}export{l as useColumnConfigAdaptor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function bindEventSettingPlugin(): import("../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../../../../shared/utils/index.js";import"../../../index.js";import{isFunction as n}from"lodash-es";import{defineTablePlugin as t}from"../../hooks/useTablePlugin.js";import{getBindEventSettingTrigger as o}from"../../../../../shared/utils/business.js";function e(){const e="bindEventSettingPlugin";return t({name:e,apply(t){t.configHooks.config.tap(e,(t=>{const e=t.onFormChange;return t.onFormChange=function(t){var i;const{column:r,row:s}=t,u=null==(i=r.editRender)?void 0:i.props;if(u&&(null==u?void 0:u.bindEventSetting)){u.bindEventSetting.forEach((n=>{o(n.event_type)(n,{getter:n=>s[n],setter:(n,t)=>s[n]=t})}))}n(e)&&e(t)},t}))}})}export{e as bindEventSettingPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hex2rgba as
|
|
1
|
+
import{traverse as o,hex2rgba as r}from"../../../../shared/utils/index.js";import{isFunction as t,isString as n,isObject as e}from"lodash-es";import"../../index.js";import{useUUIDMap as i}from"../utils/index.js";import{defineTablePlugin as u}from"../hooks/useTablePlugin.js";function s(){const s="highLightSetPlugin",{getItemFromUUID:l,removeItemFromUUID:a,setItemFromUUID:m}=i((()=>!1));return u({name:s,apply(i){i.dataHooks.data.tapPromise(s,(async(r,t)=>{if(!t.uuid||l(t.uuid))return;let n=!1;o(r,((o,r)=>{(o.rowColor||o.fontColor)&&(n=!0,r())}),["children","childrenList"]),n&&m(t.uuid,!0)})),i.dataHooks.dataEnd.tap(s,(o=>{if(!o.uuid||!l(o.uuid))return;const i=o.rowStyle;o.rowStyle=function(o){if(o.row.rowColor||o.row.fontColor){const[n,e,u,s]=r(o.row.rowColor||"",.2),l={"--row-background-color":`rgba(${n}, ${e}, ${u}, ${s})`,color:o.row.fontColor};return t(i)?Object.assign(l,i(o)):l}return t(i)?i(o):null};const u=o.rowClassName;o.rowClassName=function(o){if(o.row.rowColor){const r="row--custom";if(n(u))return`${r} ${u}`;if(t(u)){const t=u(o);return e(t)?Object.assign({"row--custom":!0},t):n(t)?`${r} ${t}`:null}return r}return t(u)?u(o):n(u)?u:null},a(o.uuid)}))}})}export{s as highLightSetPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./
|
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin/index.js";import*as i from"./defaultConfigPlugin/index.js";import*as n from"./filterDaterangeRenderPlugin/index.js";import*as d from"./filterRenderPlugin/index.js";import*as s from"./highLightSetPlugin.js";import*as t from"./keyboardEventPlugin/index.js";import*as l from"./lowCodeFieldAdaptorPlugin/index.js";import*as g from"./maxCheckSizePlugin.js";import*as u from"./operationalFormPlugin/index.js";import*as o from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as a from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as P from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as m from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as x from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as p from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as f from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as R from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as j from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as b from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as w from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as c from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as h from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as W from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as v from"./rowClickPlugin/index.js";import*as k from"./rowDragPlugin/index.js";import*as C from"./rowGroupSettingPlugin/index.js";import*as S from"./varialbleHeightPlugin/index.js";import*as D from"./virtualTreePlugin/index.js";import{separateMetaModule as E}from"../../../../shared/utils/index.js";var F=E(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin/index.ts":r,"./defaultConfigPlugin/index.ts":i,"./filterDaterangeRenderPlugin/index.tsx":n,"./filterRenderPlugin/index.tsx":d,"./highLightSetPlugin.tsx":s,"./keyboardEventPlugin/index.ts":t,"./lowCodeFieldAdaptorPlugin/index.tsx":l,"./maxCheckSizePlugin.ts":g,"./operationalFormPlugin/index.ts":u,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":o,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":a,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":P,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":m,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":x,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":p,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":f,"./rendererPlugins/widgets/checkRendererPlugin.tsx":R,"./rendererPlugins/widgets/colorRendererPlugin.tsx":j,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":b,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":w,"./rendererPlugins/widgets/labelRendererPlugin.tsx":c,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":h,"./rendererPlugins/widgets/seqRendererPlugin.tsx":W,"./rowClickPlugin/index.ts":v,"./rowDragPlugin/index.ts":k,"./rowGroupSettingPlugin/index.ts":C,"./varialbleHeightPlugin/index.tsx":S,"./virtualTreePlugin/index.ts":D}));export{F as default};
|
|
@@ -1 +1 @@
|
|
|
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 a,cloneDeep as d,isString as r}from"lodash-es";import u from"../../../../annotation-edit/index.js";import{HIGHEST_PRIORITY as c,IHO_TABLE_FIXED_STATUS as f,LOWEST_PRIORITY as m,WIDGET_TYPE as p,InjectionIhoTableAnnotation as h,InjectionIhoTableConfig as v}from"../../constants/index.js";import{defineTablePlugin as b}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as g,IhoTableUtils as x,IhoTableRenderHelper as R}from"../../utils/index.js";import{getDefaultValue as j}from"../rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";function w(){const w="lowCodeFieldAdaptorPlugin";return b({name:w,apply(b){b.fieldHooks.field.tap({name:w,stage:c},((c,m,b)=>{const w=c,P={className:w.bold?"iho-table__boldCell":"",field:w.columnName,showOverflow:"
|
|
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 a,cloneDeep as d,isString as r}from"lodash-es";import u from"../../../../annotation-edit/index.js";import{HIGHEST_PRIORITY as c,IHO_TABLE_FIXED_STATUS as f,LOWEST_PRIORITY as m,WIDGET_TYPE as p,InjectionIhoTableAnnotation as h,InjectionIhoTableConfig as v}from"../../constants/index.js";import{defineTablePlugin as b}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as g,IhoTableUtils as x,IhoTableRenderHelper as R}from"../../utils/index.js";import{getDefaultValue as j}from"../rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";function w(){const w="lowCodeFieldAdaptorPlugin";return b({name:w,apply(b){b.fieldHooks.field.tap({name:w,stage:c},((c,m,b)=>{const w=c,P={className:w.bold?"iho-table__boldCell":"",field:w.columnName,showOverflow:"ellipsis",visible:g.notNegative(w.isShow),minWidth:w.colWidth,sortable:g.isPositive(w.isSort),fixed:f[w.isFixed],...w,title:w.alias||w.title};return function(e,d){const c={default:d.slotFn,header:d.headerSlotFn,edit:d.editSlotFn,footer:d.footerSlotFn,...d.slots};if(a(d.checkEditStatus)){const{default:e}=c;a(e)&&(c.default=l=>d.checkEditStatus(l)?e(l):[t("span",null,j(l.row,l.column.editRender.props))])}const f=c.header;c.header=e=>function(e,t,d){var c;const f=l(h),m=l(v),p=l("$xetable"),b=e.column||{},g=n(null==f?void 0:f.value)&&!1!==t.annotation,x=R.isEditableColumn(m.value,b),j=R.hasFilter(t)||R.hasDateFiler(t),w=null==(c=t.titlePrefix)?void 0:c.content,P=r(d)?d:a(d)?d(e):null;let F=!1;if(m.value){const e=m.value.editRules&&m.value.editRules[b.field];e&&(F=o(e).some((e=>e.required)))}const S=m.value.border?Math.max(2,Math.ceil(p.reactData.scrollbarWidth/p.reactData.tableColumn.length)):1;return i("section",{class:"iho-table__headerWrapper"},[i("section",{style:{width:s(Math.max(0,b.renderWidth-20-S-(F?14:0)-(g?18:0)-(j?23:0)-(x?22:0)-(w?20:0)-(b.sortable?23:0)))}},[null!=P?P:i("div",{style:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},[b.title])]),g?i(u,{modelValue:f.value[b.field],"onUpdate:modelValue":e=>f.value[b.field]=e},null):null])}(e,d,f),e.slots=c}(P,w),function(t,l,i){var o,s;const r=d(e(l));r.componentProps={size:"mini"===i.size?"small":i.size,...r.componentProps},t.editRender={autofocus:"input",name:x.getCellType(l),props:r},t.editRender.enabled=!Reflect.get(p,t.editRender.name),a(null==(o=t.slots)?void 0:o.default)&&(t.editRender.enabled=t.editRender.enabled&&a(null==(s=t.slots)?void 0:s.edit));if(!n(l.settingObj))return;Reflect.has(l.settingObj,"isHide")&&(t.visible=t.visible&&g.notPositive(l.settingObj.isHide))}(P,w,b),P})),b.fieldHooks.field.tap({name:w+"After",stage:m},(e=>(n(e.slots)&&Object.entries(e.slots).forEach((([t,l])=>{null==l&&Reflect.deleteProperty(e.slots,t)})),e)))}})}export{w as lowCodeFieldAdaptorPlugin};
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/radioRendererPlugin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function radioRendererPlugin(): import("../../../../../../../es/components/iho-table").TablePlugin;
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/radioRendererPlugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{computed as e,createVNode as t,mergeProps as o}from"vue";import{NRadio as n}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as r}from"../../../constants/index.js";import{IhoTableRenderHelper as i,getLowCodeFieldFromField as l,IhoTableUtils as d}from"../../../utils/index.js";import{defineTablePlugin as a}from"../../../hooks/useTablePlugin.js";function u(){const u="radioRendererPlugin";return a({name:u,vxe(l){l.renderer.add(r.RADIO,{renderCell:i.createRenderEdit((({fieldItem:r,emitFormChangeWithParams:i,row:l,column:d,$table:a})=>{const u=e({get:()=>l[d.field],set(){const{fullData:e}=a.getTableData();null==e||e.forEach((e=>e[d.field]=!1)),l[d.field]=!0,i({oldValue:!1})}}),f=(null==r?void 0:r.componentProps)||{};return[l.$__SEPARATE?"":t(n,o({checked:u.value,"onUpdate:checked":e=>u.value=e},f),null)]}))})},apply(e){function t(e){return d.getCellType(e)===r.RADIO}e.fieldHooks.field.tap(u,((e,o,n)=>{var r;const i=l(e);if(!i)return e;if(t(i)){const e=null==(r=n.editConfig)?void 0:r.beforeEditMethod;n.editConfig={...n.editConfig,beforeEditMethod:o=>{const{column:n}=o;return!t(l(n))&&(!e||e(o))}}}return e}))}})}export{u as radioRendererPlugin};
|
|
@@ -29,6 +29,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
29
29
|
type: StringConstructor;
|
|
30
30
|
default: string;
|
|
31
31
|
};
|
|
32
|
+
allowCreate: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
36
|
+
shouldSaveCreatedOption: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
32
40
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
41
|
value: {
|
|
34
42
|
type: PropType<string | number | (string | number)[]>;
|
|
@@ -56,10 +64,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
64
|
type: StringConstructor;
|
|
57
65
|
default: string;
|
|
58
66
|
};
|
|
67
|
+
allowCreate: {
|
|
68
|
+
type: BooleanConstructor;
|
|
69
|
+
default: boolean;
|
|
70
|
+
};
|
|
71
|
+
shouldSaveCreatedOption: {
|
|
72
|
+
type: BooleanConstructor;
|
|
73
|
+
default: boolean;
|
|
74
|
+
};
|
|
59
75
|
}>> & {
|
|
60
76
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
61
77
|
}, {
|
|
62
78
|
options: AnyObject[];
|
|
63
79
|
placeholder: string;
|
|
80
|
+
allowCreate: boolean;
|
|
81
|
+
shouldSaveCreatedOption: boolean;
|
|
64
82
|
}>;
|
|
65
83
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as o,ref as
|
|
1
|
+
import{defineComponent as e,inject as o,ref as l,computed as t,createVNode as a}from"vue";import{keywordMatcher as r}from"../../../../../../../shared/utils/index.js";import{isObject as n}from"@vue/shared";import{NSelect as u}from"naive-ui";import{useIhoTableFormEvent as i}from"../../../../utils/index.js";import{useDebounceFn as p}from"@vueuse/core";import{isEmpty as d,isFunction as c}from"lodash-es";var s=e({name:"EditSelect",props:{value:{type:[Array,String,Number]},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},options:{type:Array,default:()=>[]},queryOptions:{type:Function},placeholder:{type:String,default:"请选择"},allowCreate:{type:Boolean,default:!1},shouldSaveCreatedOption:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{emit:s}){const v=o("$xetable"),m=l(null);function f(e){m.value=e}const y=l(!1),{emitFormChangeWithParams:w}=i({...e,$table:v}),h=l("");function b(){h.value=""}const O=l([]),_=t((()=>{const o=d(O.value)?e.options:O.value;if(!h.value)return o;const l=o.filter((e=>e.label&&e.label.includes(h.value)||r(h.value,e.keyword)));return!e.allowCreate||l.some((e=>e.label===h.value))?l:[...l,{label:h.value,value:h.value,created:!0,shouldSave:e.shouldSaveCreatedOption}]})),S=l(!1),x=p((async function(o=""){h.value=o;try{if(S.value=!0,!c(e.queryOptions))return;O.value=await e.queryOptions({keyword:o,row:e.row,column:e.column,rowIndex:e.rowIndex})}catch(o){console.log(`获取${e.column.field}options错误`)}finally{S.value=!1}}),400);function q(o,l){const t=e.value;s("update:value",o),n(l)&&l.created?(e.row.__createdOptionMap=e.row.__createdOptionMap||{},e.row.__createdOptionMap[e.column.field]=l):Reflect.deleteProperty(e.row.__createdOptionMap||{},e.column.field),w({oldValue:t,option:l})}function g(e){var o,l;"Tab"===e.key&&m.value&&(null==(l=(o=m.value).handleKeydown)||l.call(o,{...e,key:"Enter",preventDefault:e.preventDefault.bind(e)}))}const C=()=>({class:"iho-table__selectOption"}),M={class:"iho-table__selectMenu"};return()=>a(u,{ref:f,show:y.value,"onUpdate:show":e=>y.value=e,placeholder:e.placeholder,loading:S.value,options:_.value,value:e.value,remote:!0,onSearch:x,clearable:!0,filterable:!0,nodeProps:C,menuProps:M,onUpdateShow:b,onUpdateValue:q,onKeydown:g},null)}});export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as e,createVNode as o,mergeProps as t,onBeforeUnmount as i}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as n,InjectionIhoTableUUID as l}from"../../../../constants/index.js";import{useAutoFocus as r}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as s,
|
|
1
|
+
import{inject as e,createVNode as o,mergeProps as t,onBeforeUnmount as i}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as n,InjectionIhoTableUUID as l}from"../../../../constants/index.js";import{useAutoFocus as r}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as s,getTitle as u,IhoTableRenderHelper as d,IhoTableUtils as p}from"../../../../utils/index.js";import c from"./editSelect.js";import{getDefaultValue as a,getArray as f}from"./selectUtils.js";import{selectOptionsMap as m}from"../hooks/useSelectOption.js";import{defineTablePlugin as v}from"../../../../hooks/useTablePlugin.js";function E(){const E="selectRendererPlugin";return v({name:E,vxe(i){i.interceptor.add("event.clearActived",s(n.SELECT,(e=>e.classList.contains("iho-table__selectMenu")))),i.renderer.add(n.SELECT,{renderCell({props:t},{row:i,column:n}){const r=e(l),s=m.get(r)[n.field]||[],d=a(i,t,s);return[o("span",{title:u(n,d)},[d])]},renderEdit:d.createRenderEdit((({fieldItem:i,emitFormClick:n,row:r,column:s,$rowIndex:u})=>{const d=e(l),p=m.get(d)[s.field]||[];return[o(c,t({queryOptions:i.queryOptions},i.componentProps,{options:p,column:s,row:r,"row-index":u,value:r[s.field],"onUpdate:value":e=>r[s.field]=e,onClick:n}),null)]}))})},apply(e){r(e).bindAutoFocusConfig(E,n.SELECT,".n-base-selection-input");let o=null;e.fieldHooks.fieldList.tap(E,((e,{uuid:t})=>(o=e,t&&m.set(t,{}),e))),e.fieldHooks.fieldEnd.tapPromise(E,(async({uuid:e})=>{if(!e)return;const t=m.get(e);null==o||o.forEach((async e=>{var o,i,n;const l=null==(o=e.editRender)?void 0:o.props;if(e.field&&l&&"SELECT"===p.getCellType(l)){if(t[e.field])return;let o=f(l.options)||f(null==(i=l.componentProps)?void 0:i.options)||[];if(l.queryOptions)try{const t={column:e,isFullData:!0};o=await(null==(n=l.queryOptions)?void 0:n.call(l,t))}catch(e){console.log(`获取${l.field}_options错误`)}t[e.field]=o}})),o=null})),e.setupHooks.setup.tap(E,(e=>{i((()=>{e.value.uuid&&m.delete(e.value.uuid)}))}))}})}export{E as selectRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e}from"vue";import"../../../../index.js";import{WIDGET_TYPE as r}from"../../../constants/index.js";import{getRowHeight as
|
|
1
|
+
import{createVNode as e}from"vue";import"../../../../index.js";import{WIDGET_TYPE as r}from"../../../constants/index.js";import{getTitle as n,getRowHeight as o}from"../../../utils/index.js";import{defineTablePlugin as l}from"../../../hooks/useTablePlugin.js";function t(){const t={blue:"blue",sky:"skyblue",azure:"azure",palegreen:"palegreen",yellow:"yellow",darkorange:"darkorange",magenta:"magenta",purple:"purple",maroon:"maroon",orange:"orange",green:"green",red:"red",grey:"grey"};return l({name:"colorRendererPlugin",vxe(l){l.renderer.add(r.COLOR,{renderCell(r,{row:l,column:a}){const u=l[a.field];if(!u)return[];const[i,g]=u.split("-");return[e("div",{title:n(a,u),style:{background:t[g]||i,height:o()-8+"px"}},null)]}})}})}export{t as colorRendererPlugin};
|
package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as n}from"vue";import"../../../../../../shared/utils/index.js";import{isObject as o,isArray as
|
|
1
|
+
import{createVNode as n}from"vue";import"../../../../../../shared/utils/index.js";import{isObject as o,isArray as e}from"lodash-es";import"../../../../index.js";import{WIDGET_TYPE as t}from"../../../constants/index.js";import{parseMergeField as r,isRichContent as i,parseRichContent as l,getTitle as s}from"../../../utils/index.js";import{defineTablePlugin as c}from"../../../hooks/useTablePlugin.js";import{isMatchLowCodeCondition as d}from"../../../../../../shared/utils/business.js";function u(){return c({name:"defaultRendererPlugin",vxe(c){c.renderer.add(t.DEFAULT,{renderCell(t,{row:c,column:u}){const a=r(c,u),f=i(a)?function(o,e){const t=l(o);return[n("span",{title:s(e,t.change_text),style:{color:t.background||t.icon}},[r(t.icon),t.change_text])];function r(o){return o?o.match(/#[\da-f]{6}|[\da-f]{3}/i)?n("i",{class:"icon-dot",style:{"--table-icon-color":o,"--table-icon-shadow":o}},null):n("i",{class:t.icon},null):null}}(a,u):[a];return function(o,t,r,i){if(!e(o)||!o.length)return n("span",{title:s(r,i)},[i]);const l=o.find((n=>n.condition&&n.condition.find((n=>{const o=t[n.field_key||r.field];return d(o,n)}))));return n("span",l?{title:s(r,i),style:{color:l.color},class:l.icon}:{title:s(r,i)},[i])}(function(n){var e,t,r;const i=null==(e=n.editRender)?void 0:e.props;if(!o(i))return;return null!=(r=i.colorAndIcon)?r:null==(t=i.settingObj)?void 0:t.colorAndIcon}(u),c,u,f)}}),c.renderer.add(t.STATUS,c.renderer.get(t.DEFAULT))}})}export{u as defaultRendererPlugin};
|