cnhis-design-vue 3.1.46-beta.20 → 3.1.46-beta.22

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.
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,computed as t,watch as a,openBlock as n,createBlock as u,unref as i,withCtx as r,createVNode as c,withKeys as o,createTextVNode as d,toDisplayString as s,withDirectives as h,vShow as v,createCommentVNode as p,mergeProps as f,createElementBlock as y,createElementVNode as k,Fragment as m,renderList as g}from"vue";import{NGrid as b,NGi as _,NSpace as w,NInputGroup as C,NInput as x,NButton as L,NCheckbox as S,NTree as j,NIcon as T,NTooltip as I}from"naive-ui";import{CloseCircleSharp as N}from"@vicons/ionicons5";import{filterTree as $,getExpandedKeys as D}from"./utils/index.js";import{cloneDeep as q}from"lodash-es";import B from"./SearchMultiple.vue.js";const K={key:0},P={class:"c-select-person__scroll",style:{height:"342px"}};var U=e({__name:"SelectPerson",props:{defaultList:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},searchPlaceholder:{type:String,default:"输入关键字搜索"},searchButtonText:{type:String,default:"搜索"},wordbook:{type:Object,default:()=>({})},wordbookChild:{type:Object,default:()=>({})},showCount:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},multiple:{type:Boolean,default:!0},searchInner:{type:Boolean,default:!1},treeSetting:{type:Object,default:()=>({})},queryLoadChildData:{type:Function,default:void 0},queryTreeSearch:{type:Function,default:()=>Promise.resolve([])}},emits:["check","checkWithLevel"],setup(e,{emit:U}){const E=e,O=l(""),A=l(!1),F=l([]),W=l([]),M=l([]),R=l([]),z=l([]),G=l(!1),H=q(((J=E.data).forEach((e=>{var l;if(null==(l=e.children)?void 0:l.length){const l=ne(e.children,[]);e.innerItemsNum=l.length}})),ue(J,"")));var J;let Q=[];const V=t((()=>!!E.queryLoadChildData)),X=t((()=>{var e,l;return null!=(l=null==(e=null==E?void 0:E.treeSetting)?void 0:e.checkStrategy)?l:"child"}));function Y(e){e.disabled||e.children||!e.key||Q.push(e.key)}function Z(e){e.disabled||e.tempTitle||!e.key||Q.push(e.key)}async function ee(e){if(E.queryLoadChildData){const l=await E.queryLoadChildData(e);return l.children&&(l.children=l.children.map((e=>({...e,tempTitle:l.tempTitle?`${l.title}/${l.tempTitle}`:l.title})))),l}return e}function le(e){var l;(null==(l=e.children)?void 0:l.every((e=>e.disabled)))&&(e.disabled=!0)}function te({option:e}){var l;if((null==(l=e.children)?void 0:l.length)||V.value&&!(null==e?void 0:e.isLeaf)){const l=E.wordbook.user_count_obj&&e[E.wordbook.user_count_obj]||"",t=l?`(${l})`:"";return c("span",null,[`${e.title}${t}`])}return c(I,{trigger:"hover"},{default:()=>c("span",null,[e.title]),trigger:()=>c("span",null,[e.title])})}function ae(e){return e[E.wordbookChild.user_name_obj]||e[E.wordbook.parent_name_obj]||e.orgName||e.title||""}function ne(e,l){return e.forEach((e=>{var t;(null==(t=e.children)?void 0:t.length)?ne(e.children,l):l.push(e)})),l}function ue(e,l){return e&&0!==e.length?e.map((e=>{var t;const a=ae(e),n=l?`${a}/${l}`:a;return{...e,tempTitle:l,children:(null==(t=e.children)?void 0:t.length)?ue(null==e?void 0:e.children,n):[]}})):[]}async function ie(){G.value=!!O.value.trim(),V.value?M.value=await E.queryTreeSearch(O.value):M.value=$(E.searchInner,H,O.value),W.value=M.value.length&&O.value?D(M.value):[]}function re(){setTimeout((()=>{ie()}))}function ce(e,l){var t,a;switch(null!=(a=null==(t=null==E?void 0:E.treeSetting)?void 0:t.checkStrategy)?a:"child"){case"child":!function(e,l){for(let t=0,a=e.length;t<a;t++){const a=e[t];if(!a.disabled&&(!a.children||a.isLeaf)&&(l&&!F.value.includes(a.key)&&F.value.push(a.key),!l)){const e=F.value.findIndex((e=>e===a.key));F.value.splice(e,1)}a.children&&ce(a.children,l)}}(e,l);break;case"parent":!function(e,l){F.value=[];for(let t=0,a=e.length;t<a;t++){const a=e[t];if(!a.disabled&&!a.tempTitle&&(l&&!F.value.includes(a.key)&&F.value.push(a.key),!l)){const e=F.value.findIndex((e=>e===a.key));F.value.splice(e,1)}}}(e,l)}}function oe(e){ce(M.value,e)}function de(e){var l;for(let t=0,a=e.length;t<a;t++){const a=e[t],n=z.value.map((e=>e.key));F.value.includes(a.key)&&!n.includes(a.key)&&R.value.push({key:a.key,name:a.title,parentName:a.tempTitle,innerItemsNum:a.innerItemsNum}),(null==(l=a.children)?void 0:l.length)&&de(a.children)}}function se(e){F.value=e}function he(){F.value=[]}function ve(e){F.value=e}return function e(l,t){var a,n,u,i;for(let r=0,c=l.length;r<c;r++){const c=l[r];switch(c.title=ae(c),c.parentNode=t,c.key||(c.key=c[E.wordbookChild.user_id_obj]||c[E.wordbook.parent_id_obj]||Date.now()),(null==(a=c.children)?void 0:a.length)?(e(c.children,c),le(c)):0===(null==(n=c.children)?void 0:n.length)&&Reflect.deleteProperty(c,"children"),null!=(i=null==(u=null==E?void 0:E.treeSetting)?void 0:u.checkStrategy)?i:"child"){case"child":Y(c);break;case"parent":Z(c)}}}(H,null),M.value=H,E.defaultList.length>0&&(V.value?(E.defaultList.forEach((e=>F.value.push(e.key))),R.value=q(E.defaultList),z.value=q(E.defaultList)):(E.defaultList.forEach((e=>F.value.push(e))),de(H))),a((()=>F),(e=>{R.value=z.value.filter((l=>e.value.includes(l.key))),e.value.length&&de(V.value?M.value:H),A.value=Q.every((e=>R.value.findIndex((l=>l.key===e))>-1));const l=R.value.filter((l=>e.value.includes(l.key)));U("check",e.value),U("checkWithLevel",l)}),{deep:!0}),(l,t)=>(n(),u(i(b),{cols:2,class:"c-select-person"},{default:r((()=>[c(i(_),null,{default:r((()=>[c(i(w),{vertical:"",style:{"padding-right":"12px","border-right":"1px solid #e8e8e8"}},{default:r((()=>[c(i(C),{style:{"margin-bottom":"12px"}},{default:r((()=>[c(i(x),{clearable:"",value:O.value,"onUpdate:value":t[0]||(t[0]=e=>O.value=e),placeholder:e.searchPlaceholder,onClear:re,onKeyup:o(ie,["enter"])},null,8,["value","placeholder","onKeyup"]),c(i(L),{type:"primary",onClick:ie},{default:r((()=>[d(s(e.searchButtonText),1)])),_:1})])),_:1}),e.multiple&&!G.value?h((n(),u(i(S),{key:0,checked:A.value,"onUpdate:checked":[t[1]||(t[1]=e=>A.value=e),oe]},{default:r((()=>[d(" 全选 ")])),_:1},8,["checked"])),[[v,i(Q).length<1e3]]):p("v-if",!0),e.searchInner&&e.multiple&&G.value&&"parent"===i(X)?(n(),u(B,{key:1,treeData:M.value,checkedKeys:F.value,onNotifyCheck:ve},null,8,["treeData","checkedKeys"])):(n(),u(i(j),f({key:2,"virtual-scroll":"",class:"c-select-person__scroll","checked-keys":F.value,"expanded-keys":W.value,"onUpdate:expanded-keys":t[2]||(t[2]=e=>W.value=e),checkable:e.multiple,cascade:"","allow-checking-not-loaded":"",selectable:!e.multiple,"selected-keys":F.value,"onUpdate:selected-keys":t[3]||(t[3]=e=>F.value=e),data:M.value,"check-strategy":"child","render-label":te},e.treeSetting,{"onUpdate:checkedKeys":se,onLoad:ee}),null,16,["checked-keys","expanded-keys","checkable","selectable","selected-keys","data"]))])),_:1})])),_:1}),c(i(_),null,{default:r((()=>[c(i(w),{vertical:"",style:{"padding-left":"12px"}},{default:r((()=>[c(i(w),{justify:"space-between",style:{"margin-bottom":"20px"}},{default:r((()=>[e.showCount?(n(),y("span",K,"已选择:"+s(R.value.length),1)):p("v-if",!0),e.showClear?(n(),y("span",{key:1,class:"c-select-person__clear-btn",onClick:he},"清空")):p("v-if",!0)])),_:1}),k("div",P,[(n(!0),y(m,null,g(R.value,(e=>(n(),y("span",{class:"c-select-person__tag-item",key:e.key},[d(s(e.name)+" "+s(e.parentName?`(${e.parentName})`:e.innerItemsNum?`(${e.innerItemsNum})`:"")+" ",1),c(i(T),{class:"tag-close",component:i(N),onClick:l=>function(e){F.value=F.value.filter((l=>l!==e.key))}(e)},null,8,["component","onClick"])])))),128))])])),_:1})])),_:1})])),_:1}))}});export{U as default};
1
+ import{defineComponent as e,ref as l,computed as t,watch as n,openBlock as a,createBlock as u,unref as i,withCtx as r,createVNode as c,withKeys as o,createTextVNode as d,toDisplayString as s,withDirectives as h,vShow as v,createCommentVNode as p,mergeProps as f,createElementBlock as y,createElementVNode as k,Fragment as m,renderList as g}from"vue";import{NGrid as b,NGi as _,NSpace as w,NInputGroup as L,NInput as C,NButton as x,NCheckbox as S,NTree as j,NIcon as T,NTooltip as I}from"naive-ui";import{CloseCircleSharp as N}from"@vicons/ionicons5";import{filterTree as $,getExpandedKeys as D}from"./utils/index.js";import{cloneDeep as q}from"lodash-es";import B from"./SearchMultiple.vue.js";const K={key:0},P={class:"c-select-person__scroll",style:{height:"342px"}};var U=e({__name:"SelectPerson",props:{defaultList:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},searchPlaceholder:{type:String,default:"输入关键字搜索"},searchButtonText:{type:String,default:"搜索"},wordbook:{type:Object,default:()=>({})},wordbookChild:{type:Object,default:()=>({})},showCount:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},multiple:{type:Boolean,default:!0},searchInner:{type:Boolean,default:!1},treeSetting:{type:Object,default:()=>({})},queryLoadChildData:{type:Function,default:void 0},queryTreeSearch:{type:Function,default:()=>Promise.resolve([])}},emits:["check","checkWithLevel"],setup(e,{emit:U}){const E=e,O=l(""),A=l(!1),F=l([]),W=l([]),M=l([]),R=l([]),z=l([]),G=l(!1),H=q(function e(l){return l.forEach((l=>{var t;if(null==(t=l.children)?void 0:t.length){const t=ne(l.children,[]);l.innerItemsNum=t.length,l.innerLeafs=t,e(l.children)}})),ae(l,"")}(E.data));let J=[];const Q=t((()=>!!E.queryLoadChildData)),V=t((()=>{var e,l;return null!=(l=null==(e=null==E?void 0:E.treeSetting)?void 0:e.checkStrategy)?l:"child"}));function X(e){e.disabled||e.children||!e.key||J.push(e.key)}function Y(e){e.disabled||e.tempTitle||!e.key||J.push(e.key)}async function Z(e){if(E.queryLoadChildData){const l=await E.queryLoadChildData(e);return l.children&&(l.children=l.children.map((e=>({...e,tempTitle:l.tempTitle?`${l.title}/${l.tempTitle}`:l.title})))),l}return e}function ee(e){var l;(null==(l=e.children)?void 0:l.every((e=>e.disabled)))&&(e.disabled=!0)}function le({option:e}){var l;if((null==(l=e.children)?void 0:l.length)||Q.value&&!(null==e?void 0:e.isLeaf)){const l=E.wordbook.user_count_obj&&e[E.wordbook.user_count_obj]||"",t=l?`(${l})`:"";return c("span",null,[`${e.title}${t}`])}return c(I,{trigger:"hover"},{default:()=>c("span",null,[e.title]),trigger:()=>c("span",null,[e.title])})}function te(e){return e[E.wordbookChild.user_name_obj]||e[E.wordbook.parent_name_obj]||e.orgName||e.title||""}function ne(e,l){return e.forEach((e=>{var t;(null==(t=e.children)?void 0:t.length)?ne(e.children,l):l.push(e)})),l}function ae(e,l){return e&&0!==e.length?e.map((e=>{var t;const n=te(e),a=l?`${n}/${l}`:n;return{...e,tempTitle:l,children:(null==(t=e.children)?void 0:t.length)?ae(null==e?void 0:e.children,a):[]}})):[]}async function ue(){G.value=!!O.value.trim(),Q.value?M.value=await E.queryTreeSearch(O.value):M.value=$(E.searchInner,H,O.value),W.value=M.value.length&&O.value?D(M.value):[]}function ie(){setTimeout((()=>{ue()}))}function re(e,l){var t,n;switch(null!=(n=null==(t=null==E?void 0:E.treeSetting)?void 0:t.checkStrategy)?n:"child"){case"child":!function(e,l){for(let t=0,n=e.length;t<n;t++){const n=e[t];if(!n.disabled&&(!n.children||n.isLeaf)&&(l&&!F.value.includes(n.key)&&F.value.push(n.key),!l)){const e=F.value.findIndex((e=>e===n.key));F.value.splice(e,1)}n.children&&re(n.children,l)}}(e,l);break;case"parent":!function(e,l){F.value=[];for(let t=0,n=e.length;t<n;t++){const n=e[t];if(!n.disabled&&!n.tempTitle&&(l&&!F.value.includes(n.key)&&F.value.push(n.key),!l)){const e=F.value.findIndex((e=>e===n.key));F.value.splice(e,1)}}}(e,l)}}function ce(e){re(M.value,e)}function oe(e){var l;for(let t=0,n=e.length;t<n;t++){const n=e[t],a=z.value.map((e=>e.key));F.value.includes(n.key)&&!a.includes(n.key)&&R.value.push({key:n.key,name:n.title,parentName:n.tempTitle,innerItemsNum:n.innerItemsNum,innerLeafs:n.innerLeafs}),(null==(l=n.children)?void 0:l.length)&&oe(n.children)}}function de(e){F.value=e}function se(){F.value=[]}function he(e){F.value=e}return function e(l,t){var n,a,u,i;for(let r=0,c=l.length;r<c;r++){const c=l[r];switch(c.title=te(c),c.parentNode=t,c.key||(c.key=c[E.wordbookChild.user_id_obj]||c[E.wordbook.parent_id_obj]||Date.now()),(null==(n=c.children)?void 0:n.length)?(e(c.children,c),ee(c)):0===(null==(a=c.children)?void 0:a.length)&&Reflect.deleteProperty(c,"children"),null!=(i=null==(u=null==E?void 0:E.treeSetting)?void 0:u.checkStrategy)?i:"child"){case"child":X(c);break;case"parent":Y(c)}}}(H,null),M.value=H,E.defaultList.length>0&&(Q.value?(E.defaultList.forEach((e=>F.value.push(e.key))),R.value=q(E.defaultList),z.value=q(E.defaultList)):(E.defaultList.forEach((e=>F.value.push(e))),oe(H))),n((()=>F),(e=>{R.value=z.value.filter((l=>e.value.includes(l.key))),e.value.length&&oe(Q.value?M.value:H),A.value=J.every((e=>R.value.findIndex((l=>l.key===e))>-1));const l=R.value.filter((l=>e.value.includes(l.key)));U("check",e.value),U("checkWithLevel",l)}),{deep:!0}),(l,t)=>(a(),u(i(b),{cols:2,class:"c-select-person"},{default:r((()=>[c(i(_),null,{default:r((()=>[c(i(w),{vertical:"",style:{"padding-right":"12px","border-right":"1px solid #e8e8e8"}},{default:r((()=>[c(i(L),{style:{"margin-bottom":"12px"}},{default:r((()=>[c(i(C),{clearable:"",value:O.value,"onUpdate:value":t[0]||(t[0]=e=>O.value=e),placeholder:e.searchPlaceholder,onClear:ie,onKeyup:o(ue,["enter"])},null,8,["value","placeholder","onKeyup"]),c(i(x),{type:"primary",onClick:ue},{default:r((()=>[d(s(e.searchButtonText),1)])),_:1})])),_:1}),e.multiple&&!G.value?h((a(),u(i(S),{key:0,checked:A.value,"onUpdate:checked":[t[1]||(t[1]=e=>A.value=e),ce]},{default:r((()=>[d(" 全选 ")])),_:1},8,["checked"])),[[v,i(J).length<1e3]]):p("v-if",!0),e.searchInner&&e.multiple&&G.value&&"parent"===i(V)?(a(),u(B,{key:1,treeData:M.value,checkedKeys:F.value,onNotifyCheck:he},null,8,["treeData","checkedKeys"])):(a(),u(i(j),f({key:2,"virtual-scroll":"",class:"c-select-person__scroll","checked-keys":F.value,"expanded-keys":W.value,"onUpdate:expanded-keys":t[2]||(t[2]=e=>W.value=e),checkable:e.multiple,cascade:"","allow-checking-not-loaded":"",selectable:!e.multiple,"selected-keys":F.value,"onUpdate:selected-keys":t[3]||(t[3]=e=>F.value=e),data:M.value,"check-strategy":"child","render-label":le},e.treeSetting,{"onUpdate:checkedKeys":de,onLoad:Z}),null,16,["checked-keys","expanded-keys","checkable","selectable","selected-keys","data"]))])),_:1})])),_:1}),c(i(_),null,{default:r((()=>[c(i(w),{vertical:"",style:{"padding-left":"12px"}},{default:r((()=>[c(i(w),{justify:"space-between",style:{"margin-bottom":"20px"}},{default:r((()=>[e.showCount?(a(),y("span",K,"已选择:"+s(R.value.length),1)):p("v-if",!0),e.showClear?(a(),y("span",{key:1,class:"c-select-person__clear-btn",onClick:se},"清空")):p("v-if",!0)])),_:1}),k("div",P,[(a(!0),y(m,null,g(R.value,(e=>(a(),y("span",{class:"c-select-person__tag-item",key:e.key},[d(s(e.name)+" "+s(e.parentName?`(${e.parentName})`:"")+" "+s(e.innerItemsNum?`(${e.innerItemsNum})`:"")+" ",1),c(i(T),{class:"tag-close",component:i(N),onClick:l=>function(e){F.value=F.value.filter((l=>l!==e.key))}(e)},null,8,["component","onClick"])])))),128))])])),_:1})])),_:1})])),_:1}))}});export{U as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,inject as t,computed as a,watch as i,openBlock as o,createBlock as s,unref as n,normalizeClass as r,isRef as d,withCtx as u,createVNode as c,normalizeStyle as m,createElementVNode as h,createTextVNode as f,renderSlot as p,toDisplayString as v,h as g}from"vue";import{useMessage as b,NModal as w,NCard as y,NButton as L,NCheckbox as x,NSelect as k,NCheckboxGroup as I,NPopover as F,NPopconfirm as A,NIcon as N}from"naive-ui";import{Trash as C}from"@vicons/ionicons5";import{InjectionExportApiConfig as _}from"../constants/index.js";import P from"../../../../shared/components/VueDraggable/src/vuedraggable.js";import S from"../hooks/useAsyncData.js";import{dragFieldCheckList as z}from"../tool.js";import{cloneDeep as j}from"lodash-es";const H={class:"svg-wrap"},K={class:"flex_right"},O=h("div",{class:"tip"},"提示:支持拖动调整字段顺序,字段导出顺序为从左到右,从上到下。",-1),U={class:"flex_between"},$=["title"];var E=e({__name:"ExportModal",props:{visible:{type:Boolean,default:!1},tableListId:{type:String,default:""},curProgram:{type:Object,default:()=>({})},programOptions:{type:Array,default:()=>[]},downLoadFieldList:{type:Array,default:()=>[]},showAllFieldList:{type:Array,default:()=>[]}},emits:["cancelModal","updateCurProgram","updateFieldCheckList","updateShowAllFieldList"],setup(e,{emit:E}){const T=e,M="default",D="860px",B="496px",V={class:"select-export-popover"},q=b(),{deleteTableListExportScheme:G,exportTableListScheme:J}=S(),Q=l(!1),R=l(D),W=l({maxHeight:B,height:B}),X=l(!1),Y=l(!0),Z=l([]),ee=t(_),le=a((()=>T.curProgram.schemeId));function te(){E("updateShowAllFieldList",T.showAllFieldList)}function ae({option:e}){return g("span",e.schemeName)}function ie(e){const l=[g(F,{trigger:"hover",duration:0},{default:()=>e.schemeName,trigger:()=>g("span",{class:"content"},e.schemeName)})],t=[g(A,{placement:"top-start",positiveText:"确认",negativeText:"取消",onPositiveClick:()=>function(e){const{schemeId:l}=T.curProgram;if(l===e.schemeId)return q.warning("当前正在使用该方案,请先切换其他方案再删除");!async function(e){if(!T.tableListId)return q.warning("请传入列表id");try{await G({id:T.tableListId,schemeId:e},ee)&&q.success("删除成功")}catch(e){q.error(`获取导出方案数据请求失败:${e}`)}}(e.schemeId)}(e)},{trigger:()=>g(N,{onclick:oe},{default:()=>g(C)}),default:()=>"确定删除该导出方案吗?"})],a=e.schemeId===M?[l]:[l,t];return g("div",{class:"flex-between"},a)}function oe(e){e.stopPropagation()}function se(e){E("updateCurProgram",e)}function ne(){!async function(){if(!T.tableListId)return q.warning("请传入列表id");if(Z.value.length<1)return q.warning("请至少勾选一个字段");try{const{schemeId:e}=T.curProgram,l=T.programOptions.find((l=>l.schemeId===e)),t={fieldKeys:z(T.showAllFieldList,Z.value),lastUsedSchemeName:l?l.schemeName:"",schemeId:l?l.schemeId:"",schemeName:l?l.schemeName:"",tableListId:T.tableListId};await J(t,ee)&&(q.success("导出成功"),de())}catch(e){q.error(`获取导出方案数据请求失败:${e}`)}}()}function re(e){var l;Y.value=!1,Z.value=e&&(null==(l=T.showAllFieldList)?void 0:l.map((e=>e.columnName)))||[]}function de(){E("cancelModal"),R.value=D,W.value={height:B,maxHeight:B},Q.value=!1}function ue(){Q.value=!Q.value;let e=document.body.clientHeight;R.value===D?(R.value="100%",W.value.maxHeight=`${e}px`,W.value.height=`${e}px`):(R.value=D,W.value.maxHeight=B,W.value.height=B)}return i((()=>Z.value),(e=>{T.showAllFieldList.length>0&&(Y.value=e.length>0&&e.length<T.showAllFieldList.length,X.value=e.length===T.showAllFieldList.length,E("updateFieldCheckList",e))}),{immediate:!0}),i((()=>T.curProgram),(e=>{e&&function(e){const l=T.programOptions.find((l=>l.schemeId===e));if(l){let t=[];if(Z.value=l.fieldKeys,e===M){const e=j(T.downLoadFieldList);return void E("updateShowAllFieldList",e)}l.fieldKeys.forEach((e=>{const l=T.downLoadFieldList.find((l=>l.columnName===e));l&&t.push(l)}));const a=T.downLoadFieldList.filter((e=>!l.fieldKeys.includes(e.columnName))),i=[...t,...a];E("updateShowAllFieldList",i)}}(e.schemeId)}),{immediate:!0}),(l,t)=>(o(),s(n(w),{class:r(["table-export-field-modal",{"modal-screen":Q.value}]),show:e.visible,"onUpdate:show":t[3]||(t[3]=e=>d(visible)?visible.value=e:null),maskClosable:!1,width:R.value,bodyStyle:W.value,closable:!1,centered:"",onPositiveClick:ne,onNegativeClick:de},{default:u((()=>[c(n(y),{style:m({width:R.value,...W.value}),title:"选择导出字段",bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":u((()=>[h("div",H,[h("i",{onClick:ue,class:r(["iconfont-table-filter",Q.value?"icon-table-filter-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-table-filter-menzhenyishengzhanxitongtubiaozuidahua"])},null,2),h("i",{onClick:de,class:"iconfont-table-filter icon-table-filter-menzhenyishengzhanxitongtubiaoguanbi"})])])),footer:u((()=>[h("div",K,[c(n(L),{onClick:de},{default:u((()=>[f("取消")])),_:1}),p(l.$slots,"add"),c(n(L),{type:"info",onClick:ne},{default:u((()=>[f("导出")])),_:1})])])),default:u((()=>[O,h("header",U,[c(n(x),{checked:X.value,"onUpdate:checked":[t[0]||(t[0]=e=>X.value=e),re],indeterminate:Y.value},{default:u((()=>[f(" 全选 ")])),_:1},8,["checked","indeterminate"]),c(n(k),{style:{width:"200px"},value:n(le),"onUpdate:value":[t[1]||(t[1]=e=>d(le)?le.value=e:null),se],filterable:"","label-field":"schemeName","value-field":"schemeId","show-checkmark":!1,"render-label":ie,"render-tag":ae,"menu-props":V,options:e.programOptions},null,8,["value","options"])]),c(n(I),{value:Z.value,"onUpdate:value":t[2]||(t[2]=e=>Z.value=e)},{default:u((()=>[c(n(P),{class:"draggable-checkbox-list",list:e.showAllFieldList,animation:"300",itemKey:"columnName",onEnd:te},{item:u((({element:e})=>{var l;return[c(n(x),{class:r(Z.value.includes(e.columnName)?"":"checkbox-disabled"),value:e.columnName,label:null!=(l=e.alias)?l:e.title},{default:u((()=>{var l,t;return[h("span",{title:null!=(l=e.alias)?l:e.title},v(null!=(t=e.alias)?t:e.title),9,$)]})),_:2},1032,["class","value","label"])]})),_:1},8,["list"])])),_:1},8,["value"])])),_:3},8,["style"])])),_:3},8,["class","show","width","bodyStyle"]))}});export{E as default};
1
+ import{defineComponent as e,ref as l,inject as t,computed as a,watch as i,openBlock as o,createBlock as s,unref as n,normalizeClass as d,isRef as r,withCtx as u,createVNode as c,normalizeStyle as m,createElementVNode as h,createTextVNode as f,renderSlot as p,toDisplayString as v,h as g}from"vue";import{useMessage as b,NModal as w,NCard as x,NButton as L,NCheckbox as y,NSelect as k,NCheckboxGroup as F,NPopover as I,NPopconfirm as A,NIcon as N}from"naive-ui";import{Trash as C}from"@vicons/ionicons5";import{InjectionExportApiConfig as _}from"../constants/index.js";import P from"../../../../shared/components/VueDraggable/src/vuedraggable.js";import S from"../hooks/useAsyncData.js";import{dragFieldCheckList as z}from"../tool.js";import{cloneDeep as E}from"lodash-es";const j={class:"svg-wrap"},H={class:"flex_right"},O=h("div",{class:"tip"},"提示:支持拖动调整字段顺序,字段导出顺序为从左到右,从上到下。",-1),U={class:"flex_between"},$=["title"];var T=e({__name:"ExportModal",props:{visible:{type:Boolean,default:!1},tableListId:{type:String,default:""},curProgram:{type:Object,default:()=>({})},programOptions:{type:Array,default:()=>[]},downLoadFieldList:{type:Array,default:()=>[]},showAllFieldList:{type:Array,default:()=>[]}},emits:["cancelModal","updateCurProgram","updateFieldCheckList","updateShowAllFieldList"],setup(e,{emit:T}){const K=e,M="default",D="860px",B="496px",V={class:"select-export-popover"},q=b(),{deleteTableListExportScheme:G,exportTableListScheme:J}=S(),Q=l(!1),R=l(D),W=l({maxHeight:B,height:B}),X=l(!1),Y=l(!0),Z=l([]),ee=t(_),le=a((()=>K.curProgram.schemeId));function te(){T("updateShowAllFieldList",K.showAllFieldList)}function ae({option:e}){return g("span",e.schemeName)}function ie(e){const l=[g(I,{trigger:"hover",duration:0},{default:()=>e.schemeName,trigger:()=>g("span",{class:"content"},e.schemeName)})],t=[g(A,{placement:"top-start",positiveText:"确认",negativeText:"取消",onPositiveClick:()=>function(e){const{schemeId:l}=K.curProgram;if(l===e.schemeId)return q.warning("当前正在使用该方案,请先切换其他方案再删除");!async function(e){if(!K.tableListId)return q.warning("请传入列表id");try{await G({id:K.tableListId,schemeId:e},ee)&&q.success("删除成功")}catch(e){q.error(`获取导出方案数据请求失败:${e}`)}}(e.schemeId)}(e)},{trigger:()=>g(N,{onclick:oe},{default:()=>g(C)}),default:()=>"确定删除该导出方案吗?"})],a=e.schemeId===M?[l]:[l,t];return g("div",{class:"flex-between"},a)}function oe(e){e.stopPropagation()}function se(e){T("updateCurProgram",e)}function ne(){!async function(){if(!K.tableListId)return q.warning("请传入列表id");if(Z.value.length<1)return q.warning("请至少勾选一个字段");try{const{schemeId:e}=K.curProgram,l=K.programOptions.find((l=>l.schemeId===e)),t={fieldKeys:z(K.showAllFieldList,Z.value),lastUsedSchemeName:l?l.schemeName:"",schemeId:l?l.schemeId:"",schemeName:l?l.schemeName:"",tableListId:K.tableListId};await J(t,ee)&&(q.success("导出成功"),re())}catch(e){q.error(`获取导出方案数据请求失败:${e}`)}}()}function de(e){var l;Y.value=!1,Z.value=e&&(null==(l=K.showAllFieldList)?void 0:l.map((e=>e.columnName)))||[]}function re(){T("cancelModal"),R.value=D,W.value={height:B,maxHeight:B},Q.value=!1}function ue(){Q.value=!Q.value;let e=document.body.clientHeight;R.value===D?(R.value="100%",W.value.maxHeight=`${e}px`,W.value.height=`${e}px`):(R.value=D,W.value.maxHeight=B,W.value.height=B)}return i((()=>Z.value),(e=>{K.showAllFieldList.length>0&&(Y.value=e.length>0&&e.length<K.showAllFieldList.length,X.value=e.length===K.showAllFieldList.length,T("updateFieldCheckList",e))}),{immediate:!0}),i((()=>K.curProgram),(e=>{e&&function(e){const l=K.programOptions.find((l=>l.schemeId===e));if(l){let t=[];const a=K.downLoadFieldList.filter((e=>e.fixedExport)).map((e=>e.columnName)),i=l.fieldKeys.filter((e=>!a.includes(e)));if(Z.value=[...i,...a],e===M){const e=E(K.downLoadFieldList);return void T("updateShowAllFieldList",e)}Z.value.forEach((e=>{const l=K.downLoadFieldList.find((l=>l.columnName===e));l&&t.push(l)}));const o=K.downLoadFieldList.filter((e=>!Z.value.includes(e.columnName))),s=[...t,...o];T("updateShowAllFieldList",s)}}(e.schemeId)}),{immediate:!0}),(l,t)=>(o(),s(n(w),{class:d(["table-export-field-modal",{"modal-screen":Q.value}]),show:e.visible,"onUpdate:show":t[3]||(t[3]=e=>r(visible)?visible.value=e:null),maskClosable:!1,width:R.value,bodyStyle:W.value,closable:!1,centered:"",onPositiveClick:ne,onNegativeClick:re},{default:u((()=>[c(n(x),{style:m({width:R.value,...W.value}),title:"选择导出字段",bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":u((()=>[h("div",j,[h("i",{onClick:ue,class:d(["iconfont-table-filter",Q.value?"icon-table-filter-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-table-filter-menzhenyishengzhanxitongtubiaozuidahua"])},null,2),h("i",{onClick:re,class:"iconfont-table-filter icon-table-filter-menzhenyishengzhanxitongtubiaoguanbi"})])])),footer:u((()=>[h("div",H,[c(n(L),{onClick:re},{default:u((()=>[f("取消")])),_:1}),p(l.$slots,"add"),c(n(L),{type:"info",onClick:ne},{default:u((()=>[f("导出")])),_:1})])])),default:u((()=>[O,h("header",U,[c(n(y),{checked:X.value,"onUpdate:checked":[t[0]||(t[0]=e=>X.value=e),de],indeterminate:Y.value},{default:u((()=>[f(" 全选 ")])),_:1},8,["checked","indeterminate"]),c(n(k),{style:{width:"200px"},value:n(le),"onUpdate:value":[t[1]||(t[1]=e=>r(le)?le.value=e:null),se],filterable:"","label-field":"schemeName","value-field":"schemeId","show-checkmark":!1,"render-label":ie,"render-tag":ae,"menu-props":V,options:e.programOptions},null,8,["value","options"])]),c(n(F),{value:Z.value,"onUpdate:value":t[2]||(t[2]=e=>Z.value=e)},{default:u((()=>[c(n(P),{class:"draggable-checkbox-list",list:e.showAllFieldList,animation:"300",itemKey:"columnName",onEnd:te},{item:u((({element:e})=>{var l;return[c(n(y),{disabled:e.fixedExport,class:d(Z.value.includes(e.columnName)?"":"checkbox-disabled"),value:e.columnName,label:null!=(l=e.alias)?l:e.title},{default:u((()=>{var l,t;return[h("span",{title:null!=(l=e.alias)?l:e.title},v(null!=(t=e.alias)?t:e.title),9,$)]})),_:2},1032,["disabled","class","value","label"])]})),_:1},8,["list"])])),_:1},8,["value"])])),_:3},8,["style"])])),_:3},8,["class","show","width","bodyStyle"]))}});export{T as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as i,provide as l,watch as t,openBlock as a,createElementBlock as o,createVNode as n,withCtx as s,unref as r,createTextVNode as d}from"vue";import{useMessage as u,NButton as c}from"naive-ui";import m from"./components/ExportModal.vue.js";import v from"./components/SaveProjectModal.vue.js";import f from"./hooks/useAsyncData.js";import{InjectionExportApiConfig as p}from"./constants/index.js";import{cloneDeep as b}from"lodash-es";const L={class:"table-export-field"};var g=e({__name:"index",props:{visible:{type:Boolean,default:!1},tableListId:{type:String,default:""},fieldOriginList:{type:Array,default:()=>[]},exportApiConfig:{type:Object}},emits:["cancelModal"],setup(e,{emit:g}){const h=e,y="default",I=u(),{getTableListExportScheme:w}=f(),j={schemeId:y,schemeName:"列表显示字段",fieldKeys:[]},A=i(!1),O=i({schemeId:"",schemeName:"",fieldKeys:[]}),x=i([b(j)]),C=i([]),F=i([]),S=i([]);function M(e){F.value=e}function N(){A.value=!A.value}function P(){g("cancelModal")}function K(e){const i=x.value.find((i=>i.schemeId===e));i&&(O.value=b(i))}function U(e){O.value.fieldKeys=b(e)}function _(e){return e.map((e=>(e.schemeId===y&&(e.fieldKeys=S.value||[]),e)))}async function k(){!function(){var e;C.value=h.fieldOriginList.filter((e=>{var i;return!("operatorColumn"==e.columnName||e.settingObj&&(null==e?void 0:e.settingObj)&&"0"!==(null==(i=null==e?void 0:e.settingObj)?void 0:i.isHide))})),F.value=b(C.value);let i=C.value.filter((e=>"1"==e.isShow));S.value=(null==(e=null==i?void 0:i.map)?void 0:e.call(i,(e=>e.columnName)))||[]}(),await async function(){if(!h.tableListId)return I.warning("请传入列表id");try{let e=await w({id:h.tableListId},h.exportApiConfig);if(e){const{schemes:i=[],lastUsedSchemeName:l=""}=e.obj;if(i&&i.length>0){x.value=_([b(j),...i]);const e=i.find((e=>e.schemeName===l));if(e)return void(O.value=b(e))}x.value=_(b(x.value)),O.value=b(x.value[0])}}catch(e){I.error(`获取导出方案数据请求失败:${e}`)}}()}return l(p,h.exportApiConfig),t((()=>h.visible),(async e=>{e&&await k()}),{immediate:!0}),(i,l)=>(a(),o("div",L,[n(m,{visible:e.visible,tableListId:e.tableListId,curProgram:O.value,programOptions:x.value,downLoadFieldList:C.value,showAllFieldList:F.value,onCancelModal:P,onUpdateCurProgram:K,onUpdateFieldCheckList:U,onUpdateShowAllFieldList:M},{add:s((()=>[n(r(c),{type:"info",onClick:N},{default:s((()=>[d("导出并存为方案")])),_:1})])),_:1},8,["visible","tableListId","curProgram","programOptions","downLoadFieldList","showAllFieldList"]),n(v,{visible:A.value,tableListId:e.tableListId,showAllFieldList:F.value,programOptions:x.value,curProgram:O.value,onCancelSaveModal:N},null,8,["visible","tableListId","showAllFieldList","programOptions","curProgram"])]))}});export{g as default};
1
+ import{defineComponent as e,ref as i,provide as t,watch as l,openBlock as a,createElementBlock as o,createVNode as n,withCtx as s,unref as r,createTextVNode as d}from"vue";import{useMessage as u,NButton as c}from"naive-ui";import m from"./components/ExportModal.vue.js";import v from"./components/SaveProjectModal.vue.js";import f from"./hooks/useAsyncData.js";import{InjectionExportApiConfig as p}from"./constants/index.js";import{cloneDeep as b}from"lodash-es";const L={class:"table-export-field"};var g=e({__name:"index",props:{visible:{type:Boolean,default:!1},tableListId:{type:String,default:""},fieldOriginList:{type:Array,default:()=>[]},exportApiConfig:{type:Object}},emits:["cancelModal"],setup(e,{emit:g}){const h=e,y="default",I=u(),{getTableListExportScheme:w}=f(),x={schemeId:y,schemeName:"列表显示字段",fieldKeys:[]},j=i(!1),A=i({schemeId:"",schemeName:"",fieldKeys:[]}),O=i([b(x)]),C=i([]),F=i([]),S=i([]);function M(e){F.value=e}function N(){j.value=!j.value}function P(){g("cancelModal")}function K(e){const i=O.value.find((i=>i.schemeId===e));i&&(A.value=b(i))}function U(e){A.value.fieldKeys=b(e)}function _(e){return e.map((e=>(e.schemeId===y&&(e.fieldKeys=S.value||[]),e)))}async function k(){!function(){var e;C.value=h.fieldOriginList.filter((e=>{var i;return!("operatorColumn"==e.columnName||e.settingObj&&(null==e?void 0:e.settingObj)&&"0"!==(null==(i=null==e?void 0:e.settingObj)?void 0:i.isHide))})),F.value=b(C.value);let i=C.value.filter((e=>"1"==e.isShow||e.fixedExport));S.value=(null==(e=null==i?void 0:i.map)?void 0:e.call(i,(e=>e.columnName)))||[]}(),await async function(){if(!h.tableListId)return I.warning("请传入列表id");try{let e=await w({id:h.tableListId},h.exportApiConfig);if(e){const{schemes:i=[],lastUsedSchemeName:t=""}=e.obj;if(i&&i.length>0){O.value=_([b(x),...i]);const e=i.find((e=>e.schemeName===t));if(e)return void(A.value=b(e))}O.value=_(b(O.value)),A.value=b(O.value[0])}}catch(e){I.error(`获取导出方案数据请求失败:${e}`)}}()}return t(p,h.exportApiConfig),l((()=>h.visible),(async e=>{e&&await k()}),{immediate:!0}),(i,t)=>(a(),o("div",L,[n(m,{visible:e.visible,tableListId:e.tableListId,curProgram:A.value,programOptions:O.value,downLoadFieldList:C.value,showAllFieldList:F.value,onCancelModal:P,onUpdateCurProgram:K,onUpdateFieldCheckList:U,onUpdateShowAllFieldList:M},{add:s((()=>[n(r(c),{type:"info",onClick:N},{default:s((()=>[d("导出并存为方案")])),_:1})])),_:1},8,["visible","tableListId","curProgram","programOptions","downLoadFieldList","showAllFieldList"]),n(v,{visible:j.value,tableListId:e.tableListId,showAllFieldList:F.value,programOptions:O.value,curProgram:A.value,onCancelSaveModal:N},null,8,["visible","tableListId","showAllFieldList","programOptions","curProgram"])]))}});export{g as default};
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.1.46-beta.20",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.46-beta.20",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.46-beta.22",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.46-beta.22",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.46-beta.20",
3
+ "version": "3.1.46-beta.22",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -61,5 +61,5 @@
61
61
  "iOS 7",
62
62
  "last 3 iOS versions"
63
63
  ],
64
- "gitHead": "f535b689e15a41fd7e8d3633a94683a029878d4b"
64
+ "gitHead": "b3a02b375539e9133116e54705d5f00285b563f3"
65
65
  }