cnhis-design-vue 3.1.48-beta.10 → 3.1.48-beta.11

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.
@@ -40,6 +40,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
40
40
  groupSetting: {
41
41
  type: import("vue").PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("..").IhoTableRowGroupItem[]>> | undefined>;
42
42
  };
43
+ customColumns: {
44
+ type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
45
+ default: () => never[];
46
+ };
43
47
  }, {
44
48
  fieldsMapping: Record<string, string>;
45
49
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -82,6 +86,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
82
86
  groupSetting: {
83
87
  type: import("vue").PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("..").IhoTableRowGroupItem[]>> | undefined>;
84
88
  };
89
+ customColumns: {
90
+ type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
91
+ default: () => never[];
92
+ };
85
93
  }>> & {
86
94
  onReset?: ((...args: any[]) => any) | undefined;
87
95
  onClose?: ((...args: any[]) => any) | undefined;
@@ -89,7 +97,14 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
89
97
  }>>;
90
98
  emit: (event: "close" | "save" | "reset", ...args: any[]) => void;
91
99
  newFields: import("vue").Ref<import("../../../es/shared/types").AnyObject[]>;
92
- columns: import("vue").Ref<import("../../../es/shared/types").AnyObject[]>;
100
+ columns: import("vue").Ref<{
101
+ title: string;
102
+ type: "text" | "checkbox" | "select" | "input" | "inputNumber";
103
+ field: string;
104
+ checkedAll?: boolean | undefined;
105
+ disabledAll?: boolean | undefined;
106
+ isShow?: boolean | undefined;
107
+ }[]>;
93
108
  fieldList: import("vue").ComputedRef<import("../../../es/shared/types").AnyObject[]>;
94
109
  handleFieldSave: () => void;
95
110
  onCancle: () => void;
@@ -354,6 +369,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
354
369
  groupSetting: {
355
370
  type: import("vue").PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("..").IhoTableRowGroupItem[]>> | undefined>;
356
371
  };
372
+ customColumns: {
373
+ type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
374
+ default: () => never[];
375
+ };
357
376
  }>> & {
358
377
  onReset?: ((...args: any[]) => any) | undefined;
359
378
  onClose?: ((...args: any[]) => any) | undefined;
@@ -380,5 +399,6 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
380
399
  }>[];
381
400
  footerFlag: boolean;
382
401
  isEdit: boolean;
402
+ customColumns: import("./src/types").FieldSetColumnItem[];
383
403
  }>>;
384
404
  export default FieldSet;
@@ -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<AnyObject[]>;
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 h,toDisplayString as m,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 S,getGroupTree as W,isDisable as E}from"./utils/index.js";import{isString as C}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}},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 W(V.groupSetting,e).reduce(((t,i)=>{const d=C(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;(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))}))),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=>!E(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(S)(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=>{E(e,i)||(e[i]=t)}));var t,i}],disabled:e.disabledAll},{default:f((()=>[h(m(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])):p("v-if",!0),h(" "+m("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((()=>[h("恢复默认设置")])),_:1})])),default:f((()=>[h(" 确认要恢复系统默认设置吗? ")])),_:1}),y(r(g),{style:{"margin-right":"8px"},onClick:H},{default:f((()=>[h("取消")])),_:1}),y(r(g),{type:"primary",onClick:G},{default:f((()=>[h("保存")])),_:1})]))])):p("v-if",!0)]))}});export{U as default};
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,createVNode as u,withCtx as o,createTextVNode as p,toDisplayString as m,createCommentVNode as c,withDirectives as f,createBlock 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},[u(d(y),{trigger:"hover"},{trigger:o((()=>[u(d(k),{style:{"margin-right":"5px",top:"2px"},component:d(C)},null,8,["component"])])),default:o((()=>[O])),_:1}),p(" "+m(e.element[a.field]),1)],64)):c("v-if",!0),"checkbox"===a.type?f((l(),v(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]]):c("v-if",!0),"select"===a.type?f((l(),v(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]]):c("v-if",!0),"input"===a.type?f((l(),v(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]]):c("v-if",!0),"inputNumber"===a.type?(l(),v(d(U),{key:4,value:e.element[a.field],"onUpdate:value":l=>e.element[a.field]=l},null,8,["value","onUpdate:value"])):c("v-if",!0)],12,w)):c("v-if",!0)],64)))),128))]))}});export{S as default};
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 n}from"../../../iho-table/src/constants/index.js";function i(e){const t={flex:"1 1 90px"};switch(e.type){case"text":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(i,s,r=(e=>e.name)){const c=s.map((e=>r(e)));return n.some((n=>{const s=i[n];if(!e(s))return!0;s.forEach((n=>{if(!e(n.list)||!n.list.length)return;const i=[];let s=null;n.list.forEach(((e,r)=>{const l=function(e,n,i){return n.findIndex((n=>n!==i&&(t(n)?n.fieldName:n)===e))}(e,c,s);~l&&(i.push(c[l]),0===r?c.splice(l,1,s={fieldName:n.title,children:i}):c.splice(l,1))}))}))})),c}export{r as getGroupTree,s as isDisable,i as setStyle};
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 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.1.48-beta.10",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.1.48-beta.10",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};
1
+ var e="@cnhis-design-vue/shared",i="3.1.48-beta.11",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.1.48-beta.11",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.1.48-beta.10",
3
+ "version": "3.1.48-beta.11",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -63,5 +63,5 @@
63
63
  "iOS 7",
64
64
  "last 3 iOS versions"
65
65
  ],
66
- "gitHead": "e8cfd779a754429c260d6631732970715c10adfd"
66
+ "gitHead": "ae07c8dbca3e21f6965802f1e3c459c294e345fc"
67
67
  }