cnhis-design-vue 3.2.4-beta.31 → 3.2.4-beta.33
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/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/button-print/index.d.ts +8 -6
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +8 -6
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +8 -6
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/utils/print.d.ts +1 -0
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/button-print/style/index.css +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/classification/src/index.vue.d.ts +0 -3
- package/es/components/field-set/src/FieldColor.vue.d.ts +26 -0
- package/es/components/field-set/src/FieldFilter.vue.d.ts +26 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +41 -0
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/components/Row.vue.d.ts +26 -0
- package/es/components/field-set/src/components/Row.vue2.js +1 -1
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/iho-table/src/plugins/pagerScrollPlugin/pagerScroll.vue.d.ts +1 -0
- package/es/components/iho-table/src/plugins/pagerScrollPlugin/pagerScroll.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/index.css +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -66,6 +66,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
66
66
|
fieldShowMaxValue: {
|
|
67
67
|
type: NumberConstructor;
|
|
68
68
|
};
|
|
69
|
+
rowDraggable: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
69
73
|
}, {
|
|
70
74
|
fieldsMapping: Record<string, string>;
|
|
71
75
|
attrs: {
|
|
@@ -134,6 +138,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
134
138
|
fieldShowMaxValue: {
|
|
135
139
|
type: NumberConstructor;
|
|
136
140
|
};
|
|
141
|
+
rowDraggable: {
|
|
142
|
+
type: BooleanConstructor;
|
|
143
|
+
default: boolean;
|
|
144
|
+
};
|
|
137
145
|
}>> & {
|
|
138
146
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
139
147
|
onSave?: ((...args: any[]) => any) | undefined;
|
|
@@ -176,6 +184,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
176
184
|
checked: boolean;
|
|
177
185
|
column: AnyObject;
|
|
178
186
|
}) => void;
|
|
187
|
+
draggable: boolean;
|
|
188
|
+
isFieldSet: boolean;
|
|
179
189
|
};
|
|
180
190
|
searchData: {
|
|
181
191
|
keyword: string;
|
|
@@ -340,6 +350,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
340
350
|
type: BooleanConstructor;
|
|
341
351
|
default: boolean;
|
|
342
352
|
};
|
|
353
|
+
draggable: {
|
|
354
|
+
type: BooleanConstructor;
|
|
355
|
+
default: boolean;
|
|
356
|
+
};
|
|
357
|
+
isFieldSet: {
|
|
358
|
+
type: BooleanConstructor;
|
|
359
|
+
default: boolean;
|
|
360
|
+
};
|
|
343
361
|
}, {
|
|
344
362
|
fixedWayOptions: {
|
|
345
363
|
label: string;
|
|
@@ -416,6 +434,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
416
434
|
type: BooleanConstructor;
|
|
417
435
|
default: boolean;
|
|
418
436
|
};
|
|
437
|
+
draggable: {
|
|
438
|
+
type: BooleanConstructor;
|
|
439
|
+
default: boolean;
|
|
440
|
+
};
|
|
441
|
+
isFieldSet: {
|
|
442
|
+
type: BooleanConstructor;
|
|
443
|
+
default: boolean;
|
|
444
|
+
};
|
|
419
445
|
}>> & {
|
|
420
446
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
421
447
|
onEdit?: ((...args: any[]) => any) | undefined;
|
|
@@ -513,6 +539,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
513
539
|
type: BooleanConstructor;
|
|
514
540
|
default: boolean;
|
|
515
541
|
};
|
|
542
|
+
draggable: {
|
|
543
|
+
type: BooleanConstructor;
|
|
544
|
+
default: boolean;
|
|
545
|
+
};
|
|
546
|
+
isFieldSet: {
|
|
547
|
+
type: BooleanConstructor;
|
|
548
|
+
default: boolean;
|
|
549
|
+
};
|
|
516
550
|
}>> & {
|
|
517
551
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
518
552
|
onEdit?: ((...args: any[]) => any) | undefined;
|
|
@@ -555,9 +589,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
555
589
|
requiredDisable: boolean;
|
|
556
590
|
hide: boolean;
|
|
557
591
|
}>;
|
|
592
|
+
draggable: boolean;
|
|
558
593
|
isHighlightRow: boolean;
|
|
559
594
|
idx: number;
|
|
560
595
|
isHighlight: boolean;
|
|
596
|
+
isFieldSet: boolean;
|
|
561
597
|
}>;
|
|
562
598
|
isArray: {
|
|
563
599
|
(value?: any): value is any[];
|
|
@@ -629,6 +665,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
629
665
|
fieldShowMaxValue: {
|
|
630
666
|
type: NumberConstructor;
|
|
631
667
|
};
|
|
668
|
+
rowDraggable: {
|
|
669
|
+
type: BooleanConstructor;
|
|
670
|
+
default: boolean;
|
|
671
|
+
};
|
|
632
672
|
}>> & {
|
|
633
673
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
634
674
|
onSave?: ((...args: any[]) => any) | undefined;
|
|
@@ -654,6 +694,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
654
694
|
hide: boolean;
|
|
655
695
|
}>[];
|
|
656
696
|
isEdit: boolean;
|
|
697
|
+
rowDraggable: boolean;
|
|
657
698
|
showSeq: boolean;
|
|
658
699
|
footerFlag: boolean;
|
|
659
700
|
customColumns: FieldSetColumnItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as l,ref as t,computed as i,reactive as o,watch as
|
|
1
|
+
import{defineComponent as e,useAttrs as l,ref as t,computed as i,reactive as o,watch as a,openBlock as d,createElementBlock as r,createBlock as s,unref as n,withKeys as u,withModifiers as c,createCommentVNode as f,createElementVNode as h,Fragment as p,renderList as m,normalizeStyle as y,withCtx as v,createTextVNode as b,toDisplayString as g,createVNode as k,normalizeClass as x,mergeProps as w,renderSlot as S}from"vue";import{NInput as A,NCheckbox as _,NTooltip as C,NIcon as F,NPopconfirm as W,NButton as E}from"naive-ui";import H from"../../../shared/components/VueDraggable/src/vuedraggable.js";import N from"./components/Row.vue.js";import{isArray as P,cloneDeep as q,isString as B,omit as R}from"lodash-es";import{isDisable as V,setStyle as j,isDraggableItem as D,isDraggable as I,getGroupTree as M}from"./utils/index.js";import{uuidGenerator as U}from"../../../shared/utils/index.js";import{HelpCircleSharp as O}from"@vicons/ionicons5";const T={class:"main-wrapper"},K={class:"main-wrapper__table-header"},G=h("span",null,"数值越小,优先级越高",-1),L=["tabindex"],$={key:1,class:"main-wrapper__table-footer"};var z=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:()=>[]},showSeq:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},showSortPriority:{type:Boolean,default:!1},showHeadFilter:{type:Boolean,default:!1},fieldShowMaxValue:{type:Number},rowDraggable:{type:Boolean,default:!0}},emits:["save","close","reset"],setup(e,{expose:z,emit:J}){const Q=e,X={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"},Y=l(),Z=t(""),ee=t(),le=t([]),te=t([{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!!Q.fieldShowMaxValue,field:"show",fieldShowMaxValue:Q.fieldShowMaxValue},{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:"sortPriority"},{title:"固定",type:"select",field:"fixedWay"},{title:"自定义标题",type:"input",field:"alias"},{title:"列宽",type:"inputNumber",field:"columnWidth"},{title:"表头筛选",type:"checkbox",isHeadCheckHide:!0,field:"isShowHeaderFilter"}]),ie=i((()=>le.value.flat())),oe=o({columns:te,data:ie,onUpdateChecked:function({checked:e,column:l}){const t=!e||he(l.field);l.checkedAll=!t},draggable:Q.rowDraggable,isFieldSet:!0}),ae={keyword:Z.value,idx:0,startIdx:0},de=()=>{J("save")},re=()=>{J("close")};function se(){le.value=ne(),fe(),J("reset")}function ne(){const e=q(Q.fields).map((e=>({...e,uuid:U()})));return Object.keys(X).forEach((l=>{e.forEach((e=>{"old"==Q.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[X[l]]=1==e[l]:e[X[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),e.draggable=!!I(e)}))})),function(e){if(Q.groupSetting){return M(Q.groupSetting,e).reduce(((t,i)=>{const o=B(i)?e.find((e=>e.name===i)):l(i.children);return o&&t.push(o),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)}function ue(){const e=ae.keyword!==Z.value;let l=Z.value?ie.value.findIndex(((l,t)=>{var i;if(null==(i=l.title)?void 0:i.includes(Z.value))return!!e||t>ae.idx})):0;-1!==l||e||(l=ae.startIdx),ee.value.scrollTop=Y.rowHeight*l,Object.assign(ae,{keyword:Z.value,idx:l},e?{startIdx:l}:{})}function ce(e){var l;return!!Z.value&&(null==(l=e.title)?void 0:l.includes(Z.value))}function fe(){var e,l;(null==(e=Q.showColumnNames)?void 0:e.length)&&(te.value=te.value.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=Q.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=Q.customColumns)?void 0:l.length)&&te.value.push(...Q.customColumns),Q.showSeq&&te.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),te.value.forEach((e=>{if(e.isShow=function(e){return!(["editable","required"].includes(e.field)&&!Q.isEdit||"sortPriority"===e.field&&!Q.showSortPriority||"isShowHeaderFilter"===e.field&&!Q.showHeadFilter)}(e),"checkbox"===e.type){const l=le.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!he(e.field)&&!l}}))}function he(e){return le.value.flat().some((l=>!V(l,e)&&!l[e]&&"0001"!=l.id))}function pe(e){return!!D(e.relatedContext.element)}return a([()=>Q.fields,()=>{var e;return null==(e=Q.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(le.value=ne(),fe())}),{immediate:!0,deep:!0}),z({getTableFields:function(){let e=[];return e="old"==Q.type?ie.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,sortPriority:e.sortPriority,...Q.isEdit?{required:e.required,editable:e.editable}:{}}))):ie.value,e.map((e=>R(e,["uuid"])))}}),(l,t)=>(d(),r("div",T,[e.showSearch?(d(),s(n(A),{key:0,class:"main-wrapper__search-wrapper",value:Z.value,"onUpdate:value":t[0]||(t[0]=e=>Z.value=e),valueModifiers:{trim:!0},placeholder:"请输入字段标题",onKeydown:u(c(ue,["prevent"]),["enter"])},null,8,["value","onKeydown"])):f("v-if",!0),h("div",K,[(d(!0),r(p,null,m(te.value,((e,l)=>(d(),r(p,{key:l},[e.isShow?(d(),r("span",{key:0,class:"table-cell",style:y(n(j)(e,l))},["checkbox"!==e.type||e.isHeadCheckHide?(d(),r(p,{key:1},[b(g(e.title),1)],64)):(d(),s(n(_),{key:0,checked:e.checkedAll,"onUpdate:checked":[l=>e.checkedAll=l,l=>{return t=l,i=e.field,void ie.value.forEach((e=>{V(e,i)||(e[i]=t)}));var t,i}],disabled:e.disabledAll},{default:v((()=>[b(g(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===e.field?(d(),s(n(C),{key:2,trigger:"hover"},{trigger:v((()=>[k(n(F),{component:n(O),style:{top:"2px"}},null,8,["component"])])),default:v((()=>[G])),_:1})):f("v-if",!0)],4)):f("v-if",!0)],64)))),128))]),h("div",{class:"main-wrapper__table-body",ref_key:"tableBodyRef",ref:ee},[k(n(H),{modelValue:le.value,"onUpdate:modelValue":t[1]||(t[1]=e=>le.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:pe,disabled:!e.rowDraggable},{item:v((({element:e,index:l})=>[e.hide?f("v-if",!0):(d(),r("div",{key:0,class:x(["item",n(D)(e)?"":"disabled"]),tabindex:l},[n(P)(e)?(d(!0),r(p,{key:0},m(e,((e,t)=>(d(),s(N,w(oe,{key:t,element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"])))),128)):(d(),s(N,w({key:1},oe,{element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"]))],10,L))])),_:1},8,["modelValue","disabled"])],512),e.footerFlag?(d(),r("div",$,[f(" 底部按钮插槽 "),S(l.$slots,"footer",{},(()=>[k(n(W),{onPositiveClick:se},{trigger:v((()=>[k(n(E),{style:{"margin-right":"8px"}},{default:v((()=>[b("恢复默认设置")])),_:1})])),default:v((()=>[b(" 确认要恢复系统默认设置吗? ")])),_:1}),k(n(E),{style:{"margin-right":"8px"},onClick:re},{default:v((()=>[b("取消")])),_:1}),k(n(E),{type:"primary",onClick:de},{default:v((()=>[b("保存")])),_:1})]))])):f("v-if",!0)]))}});export{z as default};
|
|
@@ -64,6 +64,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
64
64
|
type: BooleanConstructor;
|
|
65
65
|
default: boolean;
|
|
66
66
|
};
|
|
67
|
+
draggable: {
|
|
68
|
+
type: BooleanConstructor;
|
|
69
|
+
default: boolean;
|
|
70
|
+
};
|
|
71
|
+
isFieldSet: {
|
|
72
|
+
type: BooleanConstructor;
|
|
73
|
+
default: boolean;
|
|
74
|
+
};
|
|
67
75
|
}, {
|
|
68
76
|
fixedWayOptions: {
|
|
69
77
|
label: string;
|
|
@@ -140,6 +148,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
140
148
|
type: BooleanConstructor;
|
|
141
149
|
default: boolean;
|
|
142
150
|
};
|
|
151
|
+
draggable: {
|
|
152
|
+
type: BooleanConstructor;
|
|
153
|
+
default: boolean;
|
|
154
|
+
};
|
|
155
|
+
isFieldSet: {
|
|
156
|
+
type: BooleanConstructor;
|
|
157
|
+
default: boolean;
|
|
158
|
+
};
|
|
143
159
|
}>> & {
|
|
144
160
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
145
161
|
onEdit?: ((...args: any[]) => any) | undefined;
|
|
@@ -237,6 +253,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
237
253
|
type: BooleanConstructor;
|
|
238
254
|
default: boolean;
|
|
239
255
|
};
|
|
256
|
+
draggable: {
|
|
257
|
+
type: BooleanConstructor;
|
|
258
|
+
default: boolean;
|
|
259
|
+
};
|
|
260
|
+
isFieldSet: {
|
|
261
|
+
type: BooleanConstructor;
|
|
262
|
+
default: boolean;
|
|
263
|
+
};
|
|
240
264
|
}>> & {
|
|
241
265
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
242
266
|
onEdit?: ((...args: any[]) => any) | undefined;
|
|
@@ -279,8 +303,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
279
303
|
requiredDisable: boolean;
|
|
280
304
|
hide: boolean;
|
|
281
305
|
}>;
|
|
306
|
+
draggable: boolean;
|
|
282
307
|
isHighlightRow: boolean;
|
|
283
308
|
idx: number;
|
|
284
309
|
isHighlight: boolean;
|
|
310
|
+
isFieldSet: boolean;
|
|
285
311
|
}>;
|
|
286
312
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,openBlock as t,createElementBlock as l,Fragment as i,renderList as n,normalizeStyle as a,unref as
|
|
1
|
+
import{defineComponent as e,openBlock as t,createElementBlock as l,Fragment as i,renderList as n,normalizeStyle as a,unref as o,createBlock as r,withCtx as u,createVNode as d,createCommentVNode as s,createElementVNode as c,toDisplayString as f,normalizeClass as p,withDirectives as m,vShow as v,resolveDynamicComponent as y,createTextVNode as g}from"vue";import{NTooltip as h,NIcon as b,NCheckbox as k,NSelect as x,NColorPicker as E,NInput as S,NInputNumber as T,NPopconfirm as w}from"naive-ui";import{setStyle as C,setColorInfo as N,isShowExplicitRequired as U,isDisable as D}from"../utils/index.js";import{ReorderTwoOutline as _,HelpCircleOutline as O,CreateOutline as j,TrashOutline as R}from"@vicons/ionicons5";import{isFunction as A,isArray as H,range as L}from"lodash-es";import{COLOR_MAP as M}from"../constants/index.js";import{WIDGET_TYPE as P,SELECT_MAP as F,WIDGET_MAP as V,SELECT_TYPE as I,SELECT_DEFAULT_MAP as B,DATE_MAP as q,DATETIME_MAP as W}from"../constants/filter.js";const G={class:"row"},z=["title"],J=c("span",null,"拖拽调整顺序",-1);var K=e({__name:"Row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1},data:{type:Array,default:()=>[]},isHighlight:{type:Boolean},index:{type:Number,default:0},isHighlightRow:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},isFieldSet:{type:Boolean,default:!1}},emits:["updateChecked","edit"],setup(e,{emit:K}){const Q=e,X=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],Y=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],Z=[{label:"字体",value:"font"},{label:"背景",value:"background"}],$=Object.entries(M).map((([e])=>e));function ee(){Q.data.splice(Q.index,1)}function te(){K("edit",Q.element)}function le(e){if("defaultValue"===e){const{optionType:e}=Q.element;return e===I.SELECT_MULTIPLE}return!1}function ie(e){if("0001"==Q.element.id&&"fixedWay"!=e)return!1;const{isConfiguredHeaderFilter:t}=Q.element;return"isShowHeaderFilter"===e?!!t:!(["explicitRequired","defaultValue"].includes(e)&&![P.DATE,P.DATETIME,P.SELECT].includes(Q.element.type))}function ne(e){return!["explicitRequired","defaultValue"].includes(e)||U(Q.element)}function ae(e){switch(e.field){case"fixedWay":return X;case"sortDirection":return Y;case"sortPriority":return function(){const e=L(1,Q.data.length+1).map((e=>({label:e.toString(),value:e}))),t=Q.data.filter((e=>!!e.sortPriority&&e.uuid!==Q.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!t.includes(e.value)))}();case"colorScope":return Z;case"defaultValue":{const{type:e,optionInfo:t}=Q.element;return e===P.SELECT?H(null==t?void 0:t.list)&&t.list.length>0?t.list.map((e=>({...e,label:e.name}))):Object.entries(B).map((([e,t])=>({value:e,label:t}))):e===P.DATE?Object.entries(q).map((([e,t])=>({value:e,label:t}))):e===P.DATETIME?Object.entries(W).map((([e,t])=>({value:e,label:t}))):[]}default:return[]}}function oe(e){var t;if(1==Q.element.defaultMark||"color"===e.type&&Q.isHighlightRow)return!0;if("checkbox"===e.type)return"show"===e.field&&e.fieldShowMaxValue?!Q.element[e.field]&&(null==(t=Q.data.filter((t=>t[e.field])))?void 0:t.length)===e.fieldShowMaxValue:D(Q.element,e.field);if("sortPriority"!==e.field)return!1;const{sortDirection:l}=Q.element;return!l||"NONE"===l}function re(e){return["title","result"].includes(e.field)&&Q.element.style||{}}return(U,D)=>(t(),l("div",G,[(t(!0),l(i,null,n(e.columns,((n,U)=>{return t(),l(i,{key:U},[n.isShow?(t(),l("span",{key:0,class:"table-cell",title:e.element[n.field],style:a(o(C)(n,U))},["text"===n.type?(t(),l(i,{key:0},[0===U?(t(),l(i,{key:0},[!e.isFieldSet||e.draggable&&e.isFieldSet?(t(),r(o(h),{key:0,trigger:"hover"},{trigger:u((()=>[d(o(b),{style:{"margin-right":"5px",top:"2px"},component:o(_)},null,8,["component"])])),default:u((()=>[J])),_:1})):s("v-if",!0),"title"===n.field&&e.element.feildDescribe?(t(),r(o(h),{key:1,trigger:"hover"},{trigger:u((()=>[d(o(b),{style:{"margin-right":"5px",top:"2px"},component:o(O)},null,8,["component"])])),default:u((()=>[c("span",null,f(e.element.feildDescribe),1)])),_:1})):s("v-if",!0)],64)):s("v-if",!0),c("span",{class:p([e.isHighlight&&"title"===n.field?"highlight":""]),style:a(re(n))},f((H=n.field,"seq"===H?Q.idx:"optionType"===H?Q.element[H]&&Q.element.type===P.SELECT?F[Q.element[H]]:"":"type"===H?V[Q.element[H]]:Q.element[H])),7)],64)):s("v-if",!0),"checkbox"===n.type&&ie(n.field)?m((t(),r(o(k),{key:1,disabled:oe(n),checked:e.element[n.field],"onUpdate:checked":[t=>e.element[n.field]=t,e=>function(e,t){K("updateChecked",{checked:e,column:t})}(e,n)]},null,8,["disabled","checked","onUpdate:checked"])),[[v,ne(n.field)]]):s("v-if",!0),"select"===n.type&&ie(n.field)?m((t(),r(o(x),{key:2,clearable:"",multiple:le(n.field),disabled:oe(n),value:e.element[n.field],"onUpdate:value":[t=>e.element[n.field]=t,e=>function(e,t){"sortDirection"===t.field&&"NONE"===e&&(Q.element.sortPriority=null),"colorScope"===t.field&&N(Q.element)}(e,n)],options:ae(n)},null,8,["multiple","disabled","value","onUpdate:value","options"])),[[v,ne(n.field)]]):s("v-if",!0),"color"===n.type?(t(),r(o(E),{key:3,class:"c-field-set__color-picker",clearable:"",disabled:oe(n),value:e.element[n.field],"onUpdate:value":[t=>e.element[n.field]=t,D[0]||(D[0]=t=>o(N)(e.element))],"show-preview":"",modes:["hex"],swatches:o($)},null,8,["disabled","value","onUpdate:value","swatches"])):s("v-if",!0),"input"===n.type?m((t(),r(o(S),{key:4,value:e.element[n.field],"onUpdate:value":t=>e.element[n.field]=t,clearable:""},null,8,["value","onUpdate:value"])),[[v,"0001"!=e.element.id]]):s("v-if",!0),"inputNumber"===n.type?(t(),r(o(T),{key:5,value:e.element[n.field],"onUpdate:value":t=>e.element[n.field]=t},null,8,["value","onUpdate:value"])):s("v-if",!0),"custom"===n.type&&o(A)(n.contentRender)?(t(),r(y((()=>n.contentRender(n,e.element))),{key:6})):s("v-if",!0),"custom"===n.type&&"opt"===n.field&&1!=e.element.defaultMark?(t(),l(i,{key:7},[d(o(h),{trigger:"hover"},{trigger:u((()=>[d(o(b),{component:o(j),onClick:te},null,8,["component"])])),default:u((()=>[g(" 编辑 ")])),_:1}),d(o(w),{onPositiveClick:ee},{trigger:u((()=>[d(o(h),{trigger:"hover"},{trigger:u((()=>[d(o(b),{component:o(R)},null,8,["component"])])),default:u((()=>[g(" 删除 ")])),_:1})])),default:u((()=>[g(" 是否确认删除? ")])),_:1})],64)):s("v-if",!0)],12,z)):s("v-if",!0)],64);var H})),128))]))}});export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as o}from"../../../iho-table/src/constants/index.js";import{COLOR_MAP as n}from"../constants/index.js";import{WIDGET_TYPE as r}from"../constants/filter.js";function i(e,t){const o={flex:"1 1 90px"};switch(e.type){case"text":0===t&&["title","name"].includes(e.field)&&Object.assign(o,{flex:"
|
|
1
|
+
import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as o}from"../../../iho-table/src/constants/index.js";import{COLOR_MAP as n}from"../constants/index.js";import{WIDGET_TYPE as r}from"../constants/filter.js";function i(e,t){const o={flex:"1 1 90px"};switch(e.type){case"text":0===t&&["title","name"].includes(e.field)&&Object.assign(o,{flex:"1 1 120px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),"seq"===e.field&&(o.flex="1 1 40px");break;case"checkbox":o.flex="1 1 60px";break;case"select":o.flex="1 1 80px";break;case"input":o.flex="1 1 100px"}return o}function l(e,t){return["editable","required","show"].includes(t)&&(e[`${t}Disable`]||e[`${t}Disabled`])||["sort"].includes(t)&&(1==e.notParticipatingSort||e.sortDisabled)}function s(n,r,i=(e=>e.name)){const l=r.map((e=>i(e)));return o.some((o=>{const r=n[o];if(!e(r))return!0;r.forEach((o=>{if(!e(o.list)||!o.list.length)return;const n=[];let r=null;o.list.forEach(((e,i)=>{const s=function(e,o,n){return o.findIndex((o=>o!==n&&(t(o)?o.fieldName:o)===e))}(e,l,r);~s&&(n.push(l[s]),0===i?l.splice(s,1,r={fieldName:o.title,children:n}):l.splice(s,1))}))}))})),l}function c(e){return void 0===e.draggable||e.draggable}function a(t){return e(t)?!t.some((e=>!e.draggable)):t.draggable}function f(e){e.style="font"===e.colorScope?{color:e.color}:{background:e.color,color:"#fff"},e.result=n[e.color]}function u(e){const{isShowSearch:t,filterExplicit:o,type:n}=e;return t&&o&&[r.DATE,r.DATETIME,r.SELECT].includes(n)}export{s as getGroupTree,l as isDisable,c as isDraggable,a as isDraggableItem,u as isShowExplicitRequired,f as setColorInfo,i as setStyle};
|
|
@@ -17,6 +17,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
17
17
|
tBodyHeight: import("vue").Ref<number>;
|
|
18
18
|
tHeaderHeight: import("vue").Ref<number>;
|
|
19
19
|
calcRectInfo: () => void;
|
|
20
|
+
isWheeling: boolean;
|
|
20
21
|
onWheel: () => Promise<void>;
|
|
21
22
|
isDragging: boolean;
|
|
22
23
|
onScroll: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as l,computed as t,ref as r,onMounted as a,nextTick as n,unref as o,openBlock as u,createElementBlock as c,normalizeStyle as i,createElementVNode as s,createCommentVNode as v}from"vue";import{widthAppend as p}from"../../../../../shared/utils/index.js";import{useElementSize as d,useThrottleFn as f,useEventListener as g}from"@vueuse/core";import{InjectionIhoTableGlobProps as h}from"../../constants/index.js";import{useTableContext as m}from"../../hooks/useTableContext.js";import{isPagerScrollEnable as y,isTreeTable as w,scrollStateMap as I}from"./utils.js";var b=e({__name:"pagerScroll",setup(e){const{configRef:b,$table:x,eventListener:
|
|
1
|
+
import{defineComponent as e,inject as l,computed as t,ref as r,onMounted as a,nextTick as n,unref as o,openBlock as u,createElementBlock as c,normalizeStyle as i,createElementVNode as s,createCommentVNode as v}from"vue";import{widthAppend as p}from"../../../../../shared/utils/index.js";import{useElementSize as d,useThrottleFn as f,useEventListener as g}from"@vueuse/core";import{InjectionIhoTableGlobProps as h}from"../../constants/index.js";import{useTableContext as m}from"../../hooks/useTableContext.js";import{isPagerScrollEnable as y,isTreeTable as w,scrollStateMap as I}from"./utils.js";var b=e({__name:"pagerScroll",setup(e){const{configRef:b,$table:x,eventListener:T}=m(),D=l(h),S=t((()=>y(b.value))),_=r(),P=t((()=>{var e,l,t,r,a,n;const o=null!=(l=null==(e=b.value.rowConfig)?void 0:e.height)?l:36;if(w(b.value)){const e=null!=(t=b.value.treeConfig.children)?t:"children";return o*(null!=(r=D.tableData.reduce(((l,t)=>{var r;return l+((null==(r=t[e])?void 0:r.length)||0)+1}),0))?r:0)}return o*(null!=(n=null==(a=D.tableData)?void 0:a.length)?n:0)})),j=r(null),U=r(null),{height:k}=d(j),{height:q}=d(U);a((()=>{S.value&&b.value.uuid&&function(){const e=document.querySelector(`#${b.value.uuid} .vxe-table--main-wrapper`);if(!e)return;j.value=e.querySelector(".vxe-table--body-wrapper"),U.value=e.querySelector(".vxe-table--header-wrapper")}()})),T.addEventListener("scroll",f((({scrollTop:e})=>{var l,t;if(E||C)return;const r=I.getItemFromUUID(b.value.uuid);if(!r.capacityInfo||!k.value)return;const a=(r.capacityInfo[r.currentPage||0].percent||0)*(e/k.value);if(r.currentPage){const e=r.capacityInfo.slice(0,r.currentPage).reduce(((e,l)=>e+l.percent),0)+a;null==(l=_.value)||l.scrollTo({top:e*P.value})}else null==(t=_.value)||t.scrollTo({top:a*P.value})}),100));let C=!1;const W=f((async function(){var e,l,t,r,a,o;C=!0,setTimeout((()=>{C=!1}),100);const u=_.value;if(!u||!b.value.uuid)return;const c=u.scrollTop/u.scrollHeight,i=I.getItemFromUUID(b.value.uuid);let s=0,v=0;const p=null==(e=i.capacityInfo)?void 0:e.findIndex((e=>{if(s+=e.percent,s>=c)return v=1-(s-c)/e.percent,!0}));if(-1===p)return;p!==i.currentPage&&(i.currentPage=p,(null==(l=i.capacityInfo)?void 0:l[p])&&(await x.value.loadData([]),await x.value.loadData(i.capacityInfo[p].pageData),null==(t=x.value)||t.setAllTreeExpand(!0),await n()));const d=(null!=(a=null==(r=j.value)?void 0:r.scrollHeight)?a:0)*v;null==(o=x.value)||o.scrollTo(null,d)}),50);let E=!1;g(window,"mousedown",(()=>{E=!0})),g(window,"mouseup",(()=>{E=!1}));const F=function(){E&&W()};return(e,l)=>o(S)?(u(),c("div",{key:0,class:"iho-table__pagerScrollWrapper",style:i({height:o(p)(o(k)),top:o(p)(o(q))}),ref_key:"scrollWrapper",ref:_,onWheel:l[0]||(l[0]=(...e)=>o(W)&&o(W)(...e)),onScroll:F},[s("div",{class:"iho-table__pagerScrollPlaceholder",style:i({height:o(p)(o(P))})},null,4)],36)):v("v-if",!0)}});export{b as default};
|
|
@@ -4,7 +4,7 @@ import { VxeTableDefines } from 'vxe-table';
|
|
|
4
4
|
import { IhoTableLowCodeField } from '../../../../../../../components/iho-table';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
value: {
|
|
7
|
-
type: PropType<string | number | (string | number)[]>;
|
|
7
|
+
type: PropType<string | number | (string | number)[] | null>;
|
|
8
8
|
};
|
|
9
9
|
column: {
|
|
10
10
|
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
@@ -75,7 +75,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
75
75
|
};
|
|
76
76
|
}, () => 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<{
|
|
77
77
|
value: {
|
|
78
|
-
type: PropType<string | number | (string | number)[]>;
|
|
78
|
+
type: PropType<string | number | (string | number)[] | null>;
|
|
79
79
|
};
|
|
80
80
|
column: {
|
|
81
81
|
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as l,ref as o,computed as t,onBeforeUnmount as n,nextTick as
|
|
1
|
+
import{defineComponent as e,inject as l,ref as o,computed as t,onBeforeUnmount as n,nextTick as a,createVNode as r,toRaw as u}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import{isFunction as s,isEmpty as d,isArray as c,isObject as p,omit as v,cloneDeep as f,xor as y}from"lodash-es";import{NSelect as m}from"naive-ui";import{useVModel as h,useDebounceFn as w}from"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as b}from"../../../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import{useOptionFiltered as g}from"../../../../../../../shared/hooks/selectHooks/useOptionFiltered.js";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as F}from"../../../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{InjectionIhoTableUUID as S,InjectionIhoTableConfig as O}from"../../../../constants/index.js";import{useIhoTableFormEvent as k}from"../../../../utils/index.js";import{getSelectOptions as A,selectOptionsMap as B}from"../hooks/useSelectOption.js";var j=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:"请选择"},allowModify:{type:Boolean},allowCreate:{type:Boolean},shouldSave:{type:Boolean},consistentMenuWidth:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},searchField:{type:Array},aliasField:{type:String},menuProps:{type:Object},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!0},searchByValue:{type:Boolean}},emits:["update:value"],setup(e,{emit:j}){const x=l("$xetable"),C=h(e,"value",j),K=o(null),{emitFormChangeWithParams:$}=k({...e,$table:x}),q=t((()=>e.labelField)),R=t((()=>e.valueField)),M=t((()=>e.aliasField)),D=t((()=>e.searchField)),{fullOptions:P,filterOptions:_,searchContent:E,remoteOptions:H}=g(e,{labelKey:q,valueKey:R,searchKey:D}),{modifyEvent:T,modifyAbleRef:V,getOptionsWithCreated:W}=b(e,{searchContent:E,labelKey:q,valueKey:R,valueRef:C,fullOptions:P}),L=t((()=>W(V.value?P.value:_.value))),I=o(!1),U=w((async function(l=""){E.value=l;try{if(I.value=!0,!s(e.queryOptions)||!d(e.options))return;H.value=await e.queryOptions({keyword:l,row:e.row,column:e.column,rowIndex:e.rowIndex})}catch(l){console.log(`获取${e.column.field}options错误`)}finally{I.value=!1}}),400),N=l(S);n((()=>J(!0)));const z=o(!1);function G(e){z.value=e,J(),U()}async function J(l=!1){var o,t,n;if(!e.multiple)return;await a();const{refTableLeftBody:r,refTableBody:u}=x.getRefMaps(),i=null==(o=null==r?void 0:r.value)?void 0:o.$el;if(!i)return;const s=null==(t=null==u?void 0:u.value)?void 0:t.$el,d=x.getRowid(e.row),c=null==(n=s.querySelector(`.vxe-body--row[rowid="${d}"]`))?void 0:n.clientHeight;i.querySelector(`.vxe-body--row[rowid="${d}"]`).style.height=l?"unset":c+"px"}async function Q(l,o){var t,n;const a=e.value;await T.updateValue(l,o);const r=A(N,e.column.field,e.row,x);N&&c(r)&&i(o).forEach((e=>{if(!p(e))return;const l=e;l.created&&l.shouldSave&&r.push(v(u(l),["created","shouldSave"]))}));const s=null==(t=e.column.editRender)?void 0:t.props;if(N&&(null==s?void 0:s.connectField)){const o=null==(n=s.connectField)?void 0:n.split(","),t=B.get(N);o.forEach((async o=>{var n;const{tableColumn:a}=x.reactData,r=a.find((e=>e.field===o)),u=null==(n=null==r?void 0:r.editRender)?void 0:n.props;if(null==u?void 0:u.queryOptions){const n=l?`${o}__${e.column.field}-${l}`:o;if(t[n])return;t[n]=await u.queryOptions({row:e.row,column:r,isFullData:!0,connectColumn:e.column})}}))}return $({oldValue:a,option:f(o)}),J()}const X=l(O);function Y(){var e,l;return null==(l=null==(e=X.value)?void 0:e.keyboardConfig)?void 0:l.forceArrowKey}function Z(e){var l,o,t;if(K.value)if("Tab"===e.code||Y()&&(t=e.key,["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t)))z.value?null==(o=(l=K.value).handleKeydown)||o.call(l,{...e,key:"Enter",preventDefault:e.preventDefault.bind(e)}):x.internalData.isActivated=!0;else if("Backspace"===e.code&&Y()){""===K.value.pattern&&(C.value=null)}}const{renderTag:ee,renderLabel:le,renderSelectAll:oe}=F(e,{labelKey:q,valueKey:R,valueRef:C,showKey:M,searchContent:E});function te(l){if(!e.multiple)return;const o=l?L.value.map((e=>e[R.value])):[];if(!y(o,C.value).length)return;const t=C.value;C.value=o,$({oldValue:t,option:l?L.value:[]})}const ne=()=>({class:"iho-table__selectOption"}),ae=t((()=>{var l,o;return{...e.menuProps,class:`iho-table__selectMenu ${null!=(o=null==(l=e.menuProps)?void 0:l.class)?o:""}`}}));return()=>{const l={};return e.multiple&&e.selectAll&&(l.action=()=>oe(te)),r(m,{ref:K,consistentMenuWidth:e.consistentMenuWidth,placeholder:e.placeholder,labelField:e.labelField,valueField:e.valueField,loading:I.value,options:L.value,multiple:e.multiple,value:e.value,remote:!0,onSearch:U,clearable:!0,filterable:!0,nodeProps:ne,menuProps:ae.value,renderTag:ee,renderLabel:le,show:z.value,onUpdateShow:G,onUpdateValue:Q,onKeydownCapture:Z,onFocus:T.focus,onBlur:T.blur},l)}}});export{j as default};
|