cnhis-design-vue 3.2.9-beta.0 → 3.2.9-beta.1
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.
@@ -552,7 +552,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
552
552
|
formRef: import("vue").Ref<any>;
|
553
553
|
conditionRef: import("vue").Ref<any>;
|
554
554
|
filterVisible: import("vue").Ref<boolean>;
|
555
|
-
title: import("vue").ComputedRef<"
|
555
|
+
title: import("vue").ComputedRef<"修改" | "新增" | "过滤条件">;
|
556
556
|
model: {
|
557
557
|
name: string;
|
558
558
|
color: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as l,ref as t,computed as i,reactive as o,
|
1
|
+
import{defineComponent as e,useAttrs as l,ref as t,computed as i,reactive as o,toRef as d,watch as a,openBlock as r,createElementBlock as s,createBlock as n,unref as u,withKeys as c,withModifiers as f,createCommentVNode as p,createElementVNode as h,Fragment as m,renderList as y,normalizeStyle as v,withCtx as b,createTextVNode as x,toDisplayString as g,createVNode as k,normalizeClass as w,mergeProps as S,renderSlot as A}from"vue";import{NInput as _,NCheckbox as E,NTooltip as D,NIcon as W,NPopconfirm as C,NButton as P}from"naive-ui";import F from"../../../shared/components/VueDraggable/src/vuedraggable.js";import M from"./components/table-row.vue.js";import{isArray as H,cloneDeep as B,isString as N,omit as j}from"lodash-es";import{isDisable as q,setStyle as O,isDraggableItem as V,isDraggable as R,getGroupTree as I}from"./utils/index.js";import{uuidGenerator as U}from"../../../shared/utils/index.js";import{HelpCircleSharp as T}from"@vicons/ionicons5";const K={class:"main-wrapper"},G={class:"main-wrapper__table-header"},L=h("span",null,"数值越小,优先级越高",-1),$=["tabindex"],z={key:1,class:"main-wrapper__table-footer"};var J=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},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object},showHideExpression:{type:Boolean},hideExpressionOption:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:J,emit:Q}){const X=e,Y={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"};l();const Z=t(Date.now()),ee=t(""),le=t(),te=t([]),ie=[{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!!X.fieldShowMaxValue,field:"show",fieldShowMaxValue:X.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"},{title:"脱敏配置",type:"select",field:"hideExpression"}],oe=t([]),de=i((()=>te.value.flat())),ae=i((()=>de.value.some((e=>e.feildDescribe)))),re=o({columns:oe,data:de,onUpdateChecked:function({checked:e,column:l}){const t=!e||ye(l.field);l.checkedAll=!t},draggable:X.rowDraggable,isFieldSet:!0,fieldDescribeMode:X.fieldDescribeMode,developMode:X.developMode,columnWidthProps:X.columnWidthProps,hideExpressionOption:d(X,"hideExpressionOption")}),se={keyword:ee.value,idx:0,startIdx:0},ne=()=>{Q("save")},ue=()=>{Q("close")};function ce(){te.value=fe(),me(),Z.value=Date.now(),Q("reset")}function fe(){const e=B(X.fields).map((e=>({...e,uuid:U()})));return Object.keys(Y).forEach((l=>{e.forEach((e=>{"old"==X.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[Y[l]]=1==e[l]:e[Y[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=!!R(e)}))})),function(e){if(X.groupSetting){return I(X.groupSetting,e).reduce(((t,i)=>{const o=N(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 pe(){const e=se.keyword!==ee.value;let l=ee.value?de.value.findIndex(((l,t)=>{var i;if(null==(i=l.title)?void 0:i.includes(ee.value))return!!e||t>se.idx})):0;-1!==l||e||(l=se.startIdx),le.value.scrollTop=52*l,Object.assign(se,{keyword:ee.value,idx:l},e?{startIdx:l}:{})}function he(e){var l;return!!ee.value&&(null==(l=e.title)?void 0:l.includes(ee.value))}function me(){var e,l;oe.value=B(ie),(null==(e=X.showColumnNames)?void 0:e.length)&&(oe.value=ie.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=X.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=X.customColumns)?void 0:l.length)&&oe.value.push(...X.customColumns),"column"===X.fieldDescribeMode&&ae.value&&oe.value.push({title:"字段描述",type:"text",field:"feildDescribe"}),X.showSeq&&oe.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),oe.value.forEach((e=>{if(e.isShow=function(e){return!(["editable","required"].includes(e.field)&&!X.isEdit||"sortPriority"===e.field&&!X.showSortPriority||"isShowHeaderFilter"===e.field&&!X.showHeadFilter||"hideExpression"===e.field&&!X.showHideExpression)}(e),"checkbox"===e.type){const l=te.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!ye(e.field)&&!l}}))}function ye(e){return te.value.flat().some((l=>!q(l,e)&&!l[e]&&"0001"!=l.id))}function ve(e){return!!V(e.relatedContext.element)}return a([()=>X.fields,()=>{var e;return null==(e=X.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(te.value=fe(),me())}),{immediate:!0,deep:!0}),J({getTableFields:function(){let e=[];return e="old"==X.type?de.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,...X.isEdit?{required:e.required,editable:e.editable}:{}}))):de.value,e.map((e=>j(e,["uuid"])))}}),(l,t)=>(r(),s("div",K,[e.showSearch?(r(),n(u(_),{key:0,class:"main-wrapper__search-wrapper",value:ee.value,"onUpdate:value":t[0]||(t[0]=e=>ee.value=e),valueModifiers:{trim:!0},placeholder:"请输入字段标题",onKeydown:c(f(pe,["prevent"]),["enter"])},null,8,["value","onKeydown"])):p("v-if",!0),h("div",G,[(r(!0),s(m,null,y(oe.value,((l,t)=>(r(),s(m,{key:t},[l.isShow?(r(),s("span",{key:0,class:"table-cell",style:v(u(O)(l,t,e.columnWidthProps))},["checkbox"!==l.type||l.isHeadCheckHide?(r(),s(m,{key:1},[x(g(l.title),1)],64)):(r(),n(u(E),{key:0,checked:l.checkedAll,"onUpdate:checked":[e=>l.checkedAll=e,e=>{return t=e,i=l.field,void de.value.forEach((e=>{q(e,i)||(e[i]=t)}));var t,i}],disabled:l.disabledAll},{default:b((()=>[x(g(l.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===l.field?(r(),n(u(D),{key:2,trigger:"hover"},{trigger:b((()=>[k(u(W),{component:u(T),style:{top:"2px"}},null,8,["component"])])),default:b((()=>[L])),_:1})):p("v-if",!0)],4)):p("v-if",!0)],64)))),128))]),h("div",{class:"main-wrapper__table-body",ref_key:"tableBodyRef",ref:le},[(r(),n(u(F),{modelValue:te.value,"onUpdate:modelValue":t[1]||(t[1]=e=>te.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:ve,disabled:!e.rowDraggable,key:Z.value},{item:b((({element:e,index:l})=>[e.hide?p("v-if",!0):(r(),s("div",{key:0,class:w(["item",u(V)(e)?"":"disabled"]),tabindex:l},[u(H)(e)?(r(!0),s(m,{key:0},y(e,((e,t)=>(r(),n(M,S(re,{key:t,element:e,idx:l+1,"is-highlight":he(e)}),null,16,["element","idx","is-highlight"])))),128)):(r(),n(M,S({key:1},re,{element:e,idx:l+1,"is-highlight":he(e)}),null,16,["element","idx","is-highlight"]))],10,$))])),_:1},8,["modelValue","disabled"]))],512),e.footerFlag?(r(),s("div",z,[p(" 底部按钮插槽 "),A(l.$slots,"footer",{},(()=>[k(u(C),{onPositiveClick:ce},{trigger:b((()=>[k(u(P),{style:{"margin-right":"8px"}},{default:b((()=>[x("恢复默认设置")])),_:1})])),default:b((()=>[x(" 确认要恢复系统默认设置吗? ")])),_:1}),k(u(P),{style:{"margin-right":"8px"},onClick:ue},{default:b((()=>[x("取消")])),_:1}),k(u(P),{type:"primary",onClick:ne},{default:b((()=>[x("保存")])),_:1})]))])):p("v-if",!0)]))}});export{J as default};
|
@@ -44,7 +44,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
44
44
|
formRef: import("vue").Ref<any>;
|
45
45
|
conditionRef: import("vue").Ref<any>;
|
46
46
|
filterVisible: import("vue").Ref<boolean>;
|
47
|
-
title: import("vue").ComputedRef<"
|
47
|
+
title: import("vue").ComputedRef<"修改" | "新增" | "过滤条件">;
|
48
48
|
model: {
|
49
49
|
name: string;
|
50
50
|
color: string;
|
@@ -1 +1 @@
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.2.9-beta.
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.2.9-beta.1",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.9-beta.1",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.9-beta.
|
3
|
+
"version": "3.2.9-beta.1",
|
4
4
|
"license": "ISC",
|
5
5
|
"module": "./es/components/index.js",
|
6
6
|
"main": "./es/components/index.js",
|
@@ -72,5 +72,5 @@
|
|
72
72
|
"iOS 7",
|
73
73
|
"last 3 iOS versions"
|
74
74
|
],
|
75
|
-
"gitHead": "
|
75
|
+
"gitHead": "ed51f5c30dccd4e01326f60fed71320a030d22f4"
|
76
76
|
}
|