cnhis-design-vue 3.2.4-beta.23 → 3.2.4-beta.24
Sign up to get free protection for your applications and to get access to all the features.
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -0
- package/es/components/field-set/src/FieldFilter.vue.d.ts +3 -2
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -0
- package/es/components/field-set/src/components/Row.vue.d.ts +1 -0
- package/es/components/field-set/src/components/Row.vue2.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -307,6 +307,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
307
307
|
onEdit: () => void;
|
308
308
|
getTextValue: (field: string) => any;
|
309
309
|
isMultiple: (field: string) => boolean;
|
310
|
+
isRender: (field: string) => boolean;
|
310
311
|
isShow: (field: string) => any;
|
311
312
|
getSortPriorityOptions: () => {
|
312
313
|
label: string;
|
@@ -58,7 +58,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
58
58
|
isShowSearch?: boolean | undefined;
|
59
59
|
filterExplicit?: boolean | undefined;
|
60
60
|
explicitRequired?: boolean | undefined;
|
61
|
-
defaultValue?: string | string[] | undefined;
|
61
|
+
defaultValue?: string | string[] | null | undefined;
|
62
62
|
customTitle?: string | undefined;
|
63
63
|
width?: number | undefined;
|
64
64
|
}[]>;
|
@@ -85,7 +85,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
85
85
|
isShowSearch?: boolean | undefined;
|
86
86
|
filterExplicit?: boolean | undefined;
|
87
87
|
explicitRequired?: boolean | undefined;
|
88
|
-
defaultValue?: string | string[] | undefined;
|
88
|
+
defaultValue?: string | string[] | null | undefined;
|
89
89
|
customTitle?: string | undefined;
|
90
90
|
width?: number | undefined;
|
91
91
|
}[];
|
@@ -328,6 +328,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
328
328
|
onEdit: () => void;
|
329
329
|
getTextValue: (field: string) => any;
|
330
330
|
isMultiple: (field: string) => boolean;
|
331
|
+
isRender: (field: string) => boolean;
|
331
332
|
isShow: (field: string) => any;
|
332
333
|
getSortPriorityOptions: () => {
|
333
334
|
label: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,reactive as
|
1
|
+
import{defineComponent as e,ref as t,reactive as i,watch as l,openBlock as a,createElementBlock as d,createElementVNode as r,Fragment as o,renderList as c,normalizeStyle as s,unref as n,createBlock as u,withCtx as p,createTextVNode as m,toDisplayString as f,createCommentVNode as h,createVNode as v,mergeProps as k,renderSlot as b}from"vue";import{NCheckbox as x,NPopconfirm as y,NButton as g}from"naive-ui";import _ from"../../../shared/components/VueDraggable/src/vuedraggable.js";import w from"./components/Row.vue.js";import{cloneDeep as A}from"lodash-es";import{isShowExplicitRequired as F,setStyle as R}from"./utils/index.js";import{COLUMNLIST_MAP as j}from"./constants/filter.js";const C={class:"main-wrapper"},q={class:"main-wrapper__table-header"},H={class:"main-wrapper__table-body",ref:"tableBodyRef"},V=["tabindex"],S={key:0,class:"main-wrapper__table-footer"};var U=e({__name:"FieldFilter",props:{rowHeight:{type:Number,default:52},footerFlag:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:U,emit:E}){const L=e,B=t([]),N=t([]),O=i({columns:B,data:N,onUpdateChecked:function({checked:e,column:t}){const i=!e||z(t.field);t.checkedAll=!i}}),T=()=>{E("save")},D=()=>{E("close")};function P(){N.value=A(L.defaultList),$(),E("reset")}function $(){B.value=Object.entries(j).map((([e,t])=>{const i=function(e){return e?["isShowSearch","filterExplicit","explicitRequired"].includes(e)?"checkbox":["defaultValue"].includes(e)?"select":["customTitle"].includes(e)?"input":["width"].includes(e)?"inputNumber":"text":"text"}(e),l={isShow:!0,title:t,type:i,field:e};return"checkbox"===i&&Object.assign(l,{checkedAll:!z(e),disabledAll:!1,isHeadCheckHide:["filterExplicit","explicitRequired"].includes(e)}),l}))}function z(e){return N.value.some((t=>("explicitRequired"!==e||F(t))&&!t[e]))}return l((()=>L.defaultList),(e=>{e.length>0&&(N.value=A(e),$())}),{immediate:!0,deep:!0}),U({getTableFields:()=>N.value}),(t,i)=>(a(),d("div",C,[r("div",q,[(a(!0),d(o,null,c(B.value,((e,t)=>(a(),d(o,{key:t},[e.isShow?(a(),d("span",{key:0,class:"table-cell",style:s(n(R)(e,t))},["checkbox"!==e.type||e.isHeadCheckHide?(a(),d(o,{key:1},[m(f(e.title),1)],64)):(a(),u(n(x),{key:0,checked:e.checkedAll,"onUpdate:checked":[t=>e.checkedAll=t,t=>{return i=t,l=e.field,void N.value.forEach((e=>{("explicitRequired"!==l||"explicitRequired"===l&&F(e))&&(e[l]=i)}));var i,l}],disabled:e.disabledAll},{default:p((()=>[m(f(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"]))],4)):h("v-if",!0)],64)))),128))]),r("div",H,[v(n(_),{modelValue:N.value,"onUpdate:modelValue":i[0]||(i[0]=e=>N.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:t})=>[e.hide?h("v-if",!0):(a(),d("div",{key:0,class:"item",tabindex:t},[v(w,k(O,{element:e,idx:t+1}),null,16,["element","idx"])],8,V))])),_:1},8,["modelValue"])],512),e.footerFlag?(a(),d("div",S,[h(" 底部按钮插槽 "),b(t.$slots,"fieldFilterFooter",{},(()=>[v(n(y),{onPositiveClick:P},{trigger:p((()=>[v(n(g),{style:{"margin-right":"8px"}},{default:p((()=>[m("恢复默认设置")])),_:1})])),default:p((()=>[m(" 确认要恢复系统默认设置吗? ")])),_:1}),v(n(g),{style:{"margin-right":"8px"},onClick:D},{default:p((()=>[m("取消")])),_:1}),v(n(g),{type:"primary",onClick:T},{default:p((()=>[m("保存")])),_:1})]))])):h("v-if",!0)]))}});export{U as default};
|
@@ -425,6 +425,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
425
425
|
onEdit: () => void;
|
426
426
|
getTextValue: (field: string) => any;
|
427
427
|
isMultiple: (field: string) => boolean;
|
428
|
+
isRender: (field: string) => boolean;
|
428
429
|
isShow: (field: string) => any;
|
429
430
|
getSortPriorityOptions: () => {
|
430
431
|
label: string;
|
@@ -149,6 +149,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
149
149
|
onEdit: () => void;
|
150
150
|
getTextValue: (field: string) => any;
|
151
151
|
isMultiple: (field: string) => boolean;
|
152
|
+
isRender: (field: string) => boolean;
|
152
153
|
isShow: (field: string) => any;
|
153
154
|
getSortPriorityOptions: () => {
|
154
155
|
label: string;
|
@@ -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 r,createVNode as o,withCtx as u,createBlock as d,createElementVNode as c,toDisplayString as s,createCommentVNode as f,normalizeClass as p,withDirectives as m,vShow as v,resolveDynamicComponent as y,createTextVNode as h}from"vue";import{NTooltip as g,NIcon as b,NCheckbox as k,NSelect as x,NColorPicker as E,NInput as T,NInputNumber as w,NPopconfirm as S}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 V,WIDGET_MAP as I,SELECT_TYPE as q,SELECT_DEFAULT_MAP as F,DATE_MAP as B,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}},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===q.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(F).map((([e,t])=>({value:e,label:t}))):e===P.DATE?Object.entries(B).map((([e,t])=>({value:e,label:t}))):e===P.DATETIME?Object.entries(W).map((([e,t])=>({value:e,label:t}))):[]}default:return[]}}function re(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 oe(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(r(C)(n,U))},["text"===n.type?(t(),l(i,{key:0},[0===U?(t(),l(i,{key:0},[o(r(g),{trigger:"hover"},{trigger:u((()=>[o(r(b),{style:{"margin-right":"5px",top:"2px"},component:r(_)},null,8,["component"])])),default:u((()=>[J])),_:1}),"title"===n.field&&e.element.feildDescribe?(t(),d(r(g),{key:0,trigger:"hover"},{trigger:u((()=>[o(r(b),{style:{"margin-right":"5px",top:"2px"},component:r(O)},null,8,["component"])])),default:u((()=>[c("span",null,s(e.element.feildDescribe),1)])),_:1})):f("v-if",!0)],64)):f("v-if",!0),c("span",{class:p([e.isHighlight&&"title"===n.field?"highlight":""]),style:a(oe(n))},s((H=n.field,"seq"===H?Q.idx:"optionType"===H?Q.element[H]&&Q.element.type===P.SELECT?V[Q.element[H]]:"":"type"===H?I[Q.element[H]]:Q.element[H])),7)],64)):f("v-if",!0),"checkbox"===n.type&&ie(n.field)?m((t(),d(r(k),{key:1,disabled:re(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)]]):f("v-if",!0),"select"===n.type&&ie(n.field)?m((t(),d(r(x),{key:2,clearable:"",multiple:le(n.field),disabled:re(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)]]):f("v-if",!0),"color"===n.type?(t(),d(r(E),{key:3,class:"c-field-set__color-picker",clearable:"",disabled:re(n),value:e.element[n.field],"onUpdate:value":[t=>e.element[n.field]=t,D[0]||(D[0]=t=>r(N)(e.element))],"show-preview":"",modes:["hex"],swatches:r($)},null,8,["disabled","value","onUpdate:value","swatches"])):f("v-if",!0),"input"===n.type?m((t(),d(r(T),{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]]):f("v-if",!0),"inputNumber"===n.type?(t(),d(r(w),{key:5,value:e.element[n.field],"onUpdate:value":t=>e.element[n.field]=t},null,8,["value","onUpdate:value"])):f("v-if",!0),"custom"===n.type&&r(A)(n.contentRender)?(t(),d(y((()=>n.contentRender(n,e.element))),{key:6})):f("v-if",!0),"custom"===n.type&&"opt"===n.field&&1!=e.element.defaultMark?(t(),l(i,{key:7},[o(r(g),{trigger:"hover"},{trigger:u((()=>[o(r(b),{component:r(j),onClick:te},null,8,["component"])])),default:u((()=>[h(" 编辑 ")])),_:1}),o(r(S),{onPositiveClick:ee},{trigger:u((()=>[o(r(g),{trigger:"hover"},{trigger:u((()=>[o(r(b),{component:r(R)},null,8,["component"])])),default:u((()=>[h(" 删除 ")])),_:1})])),default:u((()=>[h(" 是否确认删除? ")])),_:1})],64)):f("v-if",!0)],12,z)):f("v-if",!0)],64);var H})),128))]))}});export{K as default};
|
@@ -52,7 +52,7 @@ export declare type FilterSetItem = {
|
|
52
52
|
isShowSearch?: boolean;
|
53
53
|
filterExplicit?: boolean;
|
54
54
|
explicitRequired?: boolean;
|
55
|
-
defaultValue?: string | string[];
|
55
|
+
defaultValue?: string | string[] | null;
|
56
56
|
customTitle?: string;
|
57
57
|
width?: number;
|
58
58
|
[key: string]: any;
|
@@ -1 +1 @@
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.2.4-beta.
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.2.4-beta.24",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.4-beta.24",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cnhis-design-vue",
|
3
|
-
"version": "3.2.4-beta.
|
3
|
+
"version": "3.2.4-beta.24",
|
4
4
|
"license": "ISC",
|
5
5
|
"module": "./es/components/index.js",
|
6
6
|
"main": "./es/components/index.js",
|
@@ -71,5 +71,5 @@
|
|
71
71
|
"iOS 7",
|
72
72
|
"last 3 iOS versions"
|
73
73
|
],
|
74
|
-
"gitHead": "
|
74
|
+
"gitHead": "ffd3e7085f23a8c163d34ee95ef77aa14ee62d3f"
|
75
75
|
}
|