cnhis-design-vue 3.2.4-beta.29 → 3.2.4-beta.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/es/components/biunique-chat/index.d.ts +10 -0
  2. package/es/components/biunique-chat/src/Index.vue.d.ts +10 -0
  3. package/es/components/biunique-chat/src/Index.vue2.js +1 -1
  4. package/es/components/biunique-chat/src/components/ChatFooter.vue.d.ts +4 -0
  5. package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
  6. package/es/components/biunique-chat/src/components/ChatMain.vue.d.ts +7 -1
  7. package/es/components/biunique-chat/src/components/ChatMain.vue2.js +1 -1
  8. package/es/components/biunique-chat/src/constants/index.d.ts +3 -1
  9. package/es/components/biunique-chat/src/constants/index.js +1 -1
  10. package/es/components/biunique-chat/src/hooks/useSession.js +1 -1
  11. package/es/components/biunique-chat/src/types/index.d.ts +1 -0
  12. package/es/components/biunique-chat/src/utils/index.d.ts +1 -1
  13. package/es/components/biunique-chat/src/utils/index.js +1 -1
  14. package/es/components/biunique-chat/style/index.css +1 -1
  15. package/es/components/button-print/index.d.ts +10 -4
  16. package/es/components/button-print/src/ButtonPrint.vue.d.ts +10 -4
  17. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  18. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -1
  19. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  20. package/es/components/callback/src/components/render/popupMaps.d.ts +8 -0
  21. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  22. package/es/components/classification/src/index.vue.d.ts +3 -0
  23. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  24. package/es/components/iho-table/index.d.ts +8 -0
  25. package/es/components/iho-table/src/IhoTable.vue.d.ts +8 -0
  26. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  27. package/es/components/iho-table/src/constants/index.d.ts +2 -1
  28. package/es/components/iho-table/src/constants/index.js +1 -1
  29. package/es/components/iho-table/src/plugins/index.js +1 -1
  30. package/es/components/iho-table/src/plugins/pagerScrollPlugin/index.d.ts +1 -0
  31. package/es/components/iho-table/src/plugins/pagerScrollPlugin/index.js +1 -0
  32. package/es/components/iho-table/src/plugins/pagerScrollPlugin/pagerScroll.vue.d.ts +25 -0
  33. package/es/components/iho-table/src/plugins/pagerScrollPlugin/pagerScroll.vue.js +1 -0
  34. package/es/components/iho-table/src/plugins/pagerScrollPlugin/pagerScroll.vue2.js +1 -0
  35. package/es/components/iho-table/src/plugins/pagerScrollPlugin/types.d.ts +16 -0
  36. package/es/components/iho-table/src/plugins/pagerScrollPlugin/types.js +1 -0
  37. package/es/components/iho-table/src/plugins/pagerScrollPlugin/utils.d.ts +51 -0
  38. package/es/components/iho-table/src/plugins/pagerScrollPlugin/utils.js +1 -0
  39. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useRowClassName.js +1 -1
  40. package/es/components/iho-table/src/types/index.d.ts +4 -0
  41. package/es/components/iho-table/src/utils/index.d.ts +1 -0
  42. package/es/components/iho-table/src/utils/index.js +1 -1
  43. package/es/components/iho-table/style/index.css +1 -1
  44. package/es/components/index.css +1 -1
  45. package/es/env.d.ts +25 -25
  46. package/es/shared/package.json.js +1 -1
  47. package/package.json +2 -2
@@ -1 +1 @@
1
- import{defineComponent as t,inject as e,ref as n,reactive as i,computed as r,onMounted as a,watch as o,openBlock as l,createElementBlock as s,Fragment as u,createElementVNode as c,createCommentVNode as p,createVNode as d,unref as m,withCtx as y,renderList as v,createBlock as f,createTextVNode as g,toDisplayString as k,isRef as h,renderSlot as b,withModifiers as w,normalizeClass as P,mergeProps as O}from"vue";import{isObject as S}from"@vue/shared";import{useMessage as C,NButtonGroup as I,NDropdown as T,NButton as L,NIcon as M,NPopover as F,NCheckbox as j,NDivider as x}from"naive-ui";import{PrintOutline as E,SettingsOutline as N,ChevronDownSharp as _,ArrowForwardOutline as D}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as z}from"../constants/index.js";import{Print as J}from"../utils/print.js";import{isIReport as U}from"../utils/browserPrint.js";import V from"./IdentityVerification.vue.js";import{format as A}from"date-fns";import"../api.js";const B={class:"newprint-button-outer"},R=c("span",{class:"label bold"},"外显设置",-1),H={class:"newprint-button-poperOver"},K={class:"print-lite"},q={class:"label bold"},G={class:"print-li"},Y={class:"print-lite"},$={class:"newprint-button-poperOver"},Q=["onMouseenter","onClick"],W={class:"label bold"},X={class:"newprint-button-poperOver"},Z={class:"print-lite"},tt={class:"label bold"},et={class:"print-li"},nt={class:"print-lite"},it={class:"print-lite"},rt=["onClick"],at={class:"newprint-button-poperOver"},ot=["onMouseenter"],lt={class:"print-lite"},st=["onClick"];var ut=t({__name:"NewPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number,default:1},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,isShowOutSetting:!0,customProps:{}})}},setup(t,{expose:ut}){const ct=t,pt=[{label:"分割线",key:"divider"},{label:"外显设置",key:"outSetting"}],dt=C();let mt;const yt=e(z),vt=n(""),ft=i({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1});let gt=n([]),kt=n([{label:ct.pdfLoadText,key:"downloadPdf"},{label:ct.previewText,key:"previewText"},{label:ct.formatEditText,key:"formatEditText"},{label:"重置打印机",key:"resetPrinter"}]);const ht=i({oneMouseType:"",oneClickType:"",twoMouseType:""}),bt=i({oneShow:!1,isOperation:!1,isOutSetting:!1}),wt=n([]),Pt=n([]),Ot=r((()=>{if(!ft.currentFormatId)return{};let t=ft.currentFormatId;return ft.formatList.find((e=>e.id===t))}));r((()=>{var t;return(null==(t=Ot.value)?void 0:t.name)||"格式选择"}));const St=r((()=>{let t=ft.formatList.find((t=>t.id===ft.currentFormatId));return null==t?void 0:t.templateId})),Ct=r((()=>{var t;return null==(t=ct.newPrintSetting)?void 0:t.isShowPrintAll})),It=r((()=>{var t;return null==(t=ct.newPrintSetting)?void 0:t.isShowOutSetting})),Tt=r((()=>{var t;return(null==(t=ct.newPrintSetting)?void 0:t.customProps)||{}})),Lt=r((()=>{const t=pt.map((t=>t.key));return gt.value.filter((e=>!t.includes(e.key)))})),Mt=r({get:()=>Lt.value.every((t=>t.selected)),set(t){Lt.value.forEach((e=>{e.selected=t}))}}),Ft=async()=>{await te(),bt.oneShow=!0},jt=async t=>{if(ct.directPrint){if(ft.spinning)return;return"button"===t?void(Ct.value?await ie():Ft()):Ft()}return Ft()},xt=(t,e)=>{ht[t]=e},Et=()=>{wt.value=gt.value.filter((t=>!t.selected)),Pt.value=Lt.value.filter((t=>t.selected)).map((t=>({...t,isLoading:!1}))),_t("oneShow"),_t("isOutSetting")},Nt=t=>{bt[t]=!0},_t=t=>{ht.oneClickType="",bt[t]=!1,"isOutSetting"==t&&(bt.isOutSetting=!1)},Dt=(t,e)=>{Bt(!1);let n={type:e,formatId:ft.currentFormatId,templateId:St.value};yt("success",t,n)},zt=t=>{Bt(!1),yt("error",t),S(t)&&"notInstalledApp"===t.type&&dt.error(t.message)},Jt=t=>{Bt(!1),yt("cancel",t)},Ut=t=>{yt("error",{message:"前置条件执行错误",type:t,preExecution:!0})},Vt=()=>JSON.stringify({...ct.token?{token:ct.token}:{}}),At=(t=[],e)=>{var n,i;let r={},a={};if((null==(n=ft.templateParams[e].customizeDataset)?void 0:n.length)>0){const e=(null==(i=Object.keys(t[0].datasetData||{}))?void 0:i[0])||"",n=JSON.stringify(t.map((t=>JSON.parse(t.datasetData[e]))));a={datasetData:{}},a.datasetData[e]=n}else Object.keys(t[0]).forEach((e=>{a[e]=[],t.forEach((t=>{a[e].includes(t[e])||a[e].push(t[e])})),a[e]=a[e].join(",")}));return r=Object.assign({},JSON.parse(Vt()),Tt.value,a),JSON.stringify(r)},Bt=(t,e)=>{if(ft.isClickOuterPrint){if(t&&e){const n=Pt.value.find((t=>t.key==e));return void(n&&(n.isLoading=t))}Pt.value.forEach((t=>{t.isLoading=!1}))}else ft.spinning=t},Rt=()=>ft.isClickOuterPrint?Pt.value.some((t=>t.isLoading)):ft.spinning,Ht=(t,e,n,i)=>{const r=ft.printParams[t];ft.isClickOuterPrint=i,Kt(r,t,e,n)},Kt=async(t=[],e,n,i,r)=>{let a=t.length;const o=async t=>{try{--a<=0&&Dt(t,"print")}catch(t){console.log("error",t)}};ct.showLoading&&Rt()&&!r||(Bt(!0,i),ct.prevFn("print").then((()=>{ft.curPrintParamList=t;const r={formatId:i,templateId:n,authorizationKey:vt.value,printdlgshow:ct.printdlgshow,signature:ct.signature,copies:ct.printCopies};if("MULTI"===ct.strategy)for(let e=0;e<t.length;e++)e>0&&(r.printdlgshow="0"),mt.printDirect({...r,params:Object.assign({},JSON.parse(Vt()),Tt.value,t[e])},o,zt,Jt);else mt.printDirect({...r,params:At(t,e)},(t=>{Dt(t,"print")}),zt,Jt)})).catch((()=>{Ut("print"),Bt(!1)})).finally((()=>{ft.visible=!1})))},qt=async(t,{templateCode:e,templateId:n,key:i},r)=>{const a=ft.printParams[e];switch(ft.isClickOuterPrint=r,t){case"previewText":(async(t=[],e,n,i)=>{ct.showLoading&&Rt()||(Bt(!0,i),ct.prevFn("preview").then((()=>{ft.curPrintParamList=t;const r="MULTI"===ct.strategy?Object.assign({},JSON.parse(Vt()),Tt.value,t[0]):At(t,e),a={formatId:i,templateId:n,authorizationKey:vt.value,params:r,btnprint:ct.btnprint,signature:ct.signature};mt.preview(a,(t=>{Dt(t,"preview")}),zt)})).catch((()=>{Ut("preview"),Bt(!1)})).finally((()=>{ft.visible=!1})))})(a,e,n,i);break;case"formatEditText":((t=[],e,n,i)=>{ct.showLoading&&Rt()||(Bt(!0,i),ct.prevFn("edit").then((()=>{ft.curPrintParamList=t,ft.currentFormatId=i,ft.identityVerification.visible=!0})).catch((()=>{Ut("edit")})).finally((()=>{Bt(!1)})))})(a,0,0,i);break;case"downloadPdf":(async(t=[],e,n,i)=>{ct.showLoading&&Rt()||(Bt(!0,i),ct.prevFn("download").then((()=>{ft.curPrintParamList=t;const r="MULTI"===ct.strategy?Object.assign({},JSON.parse(Vt()),Tt.value,t[0]):At(t,e),a={formatId:i,templateId:n,authorizationKey:vt.value,print:{print:"1",type:"1"},params:r,signature:ct.signature};mt.downloadPDF(a,(t=>Dt(t,"preview")),zt)})).catch((()=>{Ut("download"),Bt(!1)})).finally((()=>{ft.visible=!1})))})(a,e,n,i)}},Gt=()=>{},Yt=(t,e=[])=>{let n={};return e.forEach((e=>{n=Object.assign({},Wt(n,e,t))})),n},$t=(t,e,n)=>{const i={};return e.forEach((e=>{let r=((t,e)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let i=e;return Object.keys(n).includes(t.type)&&e&&e instanceof Date&&(i=A(e,n[t.type])),(null==t?void 0:t.defaultValue)||i})(e,t[e[n]]);t[e[n]]&&r&&(i[e[n]]=r)})),i},Qt=({customizeDataset:t=[],param:e=[]},n={})=>{let i={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;i.datasetData||(i.datasetData={}),i.datasetData[t.name]=JSON.stringify($t(n,e,"fieldName"))})),i=Object.assign({},i,$t(n,e,"key")),i},Wt=(t,e,n)=>{if(e.templateNumbers){for(let i=0;i<e.templateNumbers.length;i++){const r=e.templateNumbers[i],a=n[r];if(!a)return dt.error("当前勾选的数据没有匹配的模板"),t;t[r]||(t[r]=[]),t[r].push(Qt(a,e))}return t}const i=Object.keys(n);for(let r=0;r<i.length;r++){const a=i[r],o=n[a];if(!o)return dt.error("当前勾选的数据没有匹配的模板"),t;t[a]||(t[a]=[]),t[a].push(Qt(o,e))}return t},Xt=async t=>{ft.formatList=t?(t=>{let e=[];return t&&t.forEach((t=>{if(!t.format)return!1;e.push(...t.format.map((e=>Object.assign({},e,{templateName:t.name}))))})),e})(t.obj):[],(()=>{var t;const e=ft.formatList.map((t=>({templateCode:t.number,templateId:t.templateId,label:t.name,key:t.id,selected:!1})));gt.value.unshift(...e),It.value&&gt.value.push(...pt),wt.value=gt.value.filter((t=>!t.selected)),ct.hideButtons.length>0&&(kt.value=kt.value.filter((t=>!ct.hideButtons.includes(t.key))));const n=sessionStorage.getItem("portal");if(n){const e=JSON.parse(n),i=(null==(t=null==e?void 0:e.user)?void 0:t.currentRoleResourceObj)||{},r=Object.keys(i);r.includes("RY7.2.21.1.M2.G94181E")||(kt.value=kt.value.filter((t=>"downloadPdf"!=t.key))),r.includes("RY7.2.21.1.M2.G33633A")||(kt.value=kt.value.filter((t=>"formatEditText"!=t.key)))}})(),ft.templateParams=(t=>{let e={};return t&&t.forEach((t=>{if(!t.templateConfig)return!1;e[t.number]=t.templateConfig})),e})(t.obj),ft.printParams=Yt(ft.templateParams,ct.params)},Zt=async()=>{var t;if(ft.isInited)return!0;ft.isInited=!0,ft.spinning=!0,(()=>{if(mt)return!1;mt=new J})();const e=await ct.queryPrintFormatByNumber();return await Xt(e),(null==(t=e.obj)?void 0:t.length)>0&&(vt.value=e.obj[0].authorizationKey||""),ft.spinning=!1,!0},te=async(t=!0)=>{var e,n;if(await ct.clickPrevFn())if((null==(e=ct.params)?void 0:e.length)||(null==(n=ct.printParams)?void 0:n.length)){if(!ft.visible){if(!await Zt())return!1}t&&(ft.visible=!ft.visible)}else dt.warning(ct.noDataMsg)},ee=()=>{ft.watchPrintParamsReformatFn&&ft.watchPrintParamsReformatFn(),ft.isInited?ft.printParams=Yt(ft.templateParams,ct.params):ft.watchPrintParamsReformatFn=()=>o((()=>ft.isInited),(t=>{if(!t)return!1;ee()}))},ne=t=>{if(ft.identityVerification.visible=!1,U(ft.currentFormatId))return Dt(null,"edit");const e={formatId:ft.currentFormatId,templateId:St.value,params:Object.assign({},JSON.parse(Vt()),Tt.value,ft.curPrintParamList[0]),token:t};mt.editPrintFormat(e,(t=>{Dt(t,"edit")}),zt)};async function ie(){await te(!1),(()=>{const t=Object.keys(ft.printParams);ft.isClickOuterPrint=!1;for(let e=0;e<t.length;e++){const n=t[e],i=ft.printParams[n],r=ft.formatList.filter((t=>t.number==n));r&&r.length>0&&r.forEach((t=>{Kt(i,t.number,t.templateId,t.id,!0)}))}})()}return a((()=>{ft.isInited=!1})),o((()=>ct.params),(t=>{if(!(null==t?void 0:t.length))return!1;ee()}),{deep:!0}),ut({directPrint:ie}),(e,n)=>(l(),s(u,null,[c("div",B,[p(" 外显按钮集合 "),d(m(I),null,{default:y((()=>[(l(!0),s(u,null,v(Pt.value,(e=>(l(),f(m(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:Gt,options:m(kt),onSelect:t=>qt(t,e,!0)},{default:y((()=>[d(m(L),{loading:t.showLoading&&e.isLoading,onClick:t=>Ht(e.templateCode,e.templateId,e.key,!0)},{icon:y((()=>[d(m(M),{component:m(E),size:"18"},null,8,["component"])])),default:y((()=>[g(" "+k(e.label),1)])),_:2},1032,["loading","onClick"])])),_:2},1032,["options","onSelect"])))),128))])),_:1}),p(' <n-button-group>\r\n\t\t\t<n-popover\r\n\t\t\t\tv-for="outer in outterPrintItems"\r\n :key="outer.key"\r\n\t\t\t\ttrigger="hover"\r\n\t\t\t\t:show-arrow="false"\r\n\t\t\t\t:show="downlistPopover.isOperation"\r\n\t\t\t\t@clickoutside="handleClickOutHide(\'isOperation\')"\r\n\t\t\t>\r\n\t\t\t\t<template #trigger>\r\n\t\t\t\t\t<n-button\r\n\t\t\t\t\t\t@mouseenter="delayShowPopover(\'isOperation\')"\r\n\t\t\t\t\t\t@mouseleave="handleClickOutHide(\'isOperation\')"\r\n\t\t\t\t\t\t@click="console.log(33)"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t<n-icon :component="PrintOutline" size="18"></n-icon>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t<span class="label bold">{{ outer.label }}</span>\r\n\t\t\t\t\t</n-button>\r\n\t\t\t\t</template>\r\n\t\t\t\t<div class="newprint-button-poperOver">\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tclass="print-li"\r\n\t\t\t\t\t\tv-for="operation in operations"\r\n\t\t\t\t\t\t:key="operation.key"\r\n\t\t\t\t\t\t:class="downlistOperation.twoMouseType==operation.key ? \'active\' : \'\' "\r\n\t\t\t\t\t\t@mouseenter="handleTypeChange(\'twoMouseType\', operation.key)"\r\n\t\t\t\t\t\t@mouseleave="handleTypeChange(\'twoMouseType\', \'\')"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<div class="print-lite">\r\n\t\t\t\t\t\t\t<span class="label"> {{ operation.label }} </span>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</n-popover>\r\n\t\t</n-button-group> '),p(" 外显设置按钮 "),ft.isInited&&Pt.value.length>0&&Pt.value.length==m(Lt).length&&m(It)?(l(),f(m(F),{key:0,trigger:"click","show-arrow":!1,show:bt.isOutSetting,onClickoutside:n[2]||(n[2]=t=>_t("isOutSetting"))},{trigger:y((()=>[d(m(L),{onClick:n[0]||(n[0]=t=>Nt("isOutSetting"))},{default:y((()=>[R,d(m(M),{style:{"margin-left":"8px"},component:m(N),size:"18"},null,8,["component"])])),_:1})])),default:y((()=>[c("div",H,[(l(!0),s(u,null,v(m(Lt),(t=>(l(),s("div",{class:"print-li",key:t.key},[c("div",K,[c("span",q,k(t.label),1),d(m(j),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:y((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",G,[d(m(x)),c("div",Y,[d(m(L),{type:"primary",size:"small",onClick:Et},{default:y((()=>[g("保存")])),_:1}),d(m(j),{checked:m(Mt),"onUpdate:checked":n[1]||(n[1]=t=>h(Mt)?Mt.value=t:null)},{default:y((()=>[g("全选")])),_:1},8,["checked"])])])])])),_:1},8,["show"])):(l(),s(u,{key:1},[p(" 打印全部按钮 "),d(m(F),{trigger:"click","show-arrow":!1,show:bt.oneShow,onClickoutside:n[10]||(n[10]=t=>_t("oneShow"))},{trigger:y((()=>[b(e.$slots,"button",{handleClickPrintBtn:te,printSpinning:ft.spinning,printbtnText:t.btnText,printVisible:ft.visible},(()=>[d(m(I),{class:"newprint-button-component",onClick:n[4]||(n[4]=w((()=>jt("icon")),["stop"]))},{default:y((()=>[d(m(L),{loading:t.showLoading&&ft.spinning,onClick:n[3]||(n[3]=w((()=>jt("button")),["stop"]))},{icon:y((()=>[d(m(M),{component:m(E),size:"18"},null,8,["component"])])),default:y((()=>[g(" "+k(m(Ct)?"打印全部":t.btnText),1)])),_:1},8,["loading"]),d(m(L),{class:"icon-select"},{icon:y((()=>[d(m(M),{component:m(_),size:"18"},null,8,["component"])])),_:1})])),_:1})]))])),default:y((()=>[c("div",$,[(l(!0),s(u,null,v(wt.value,(t=>(l(),s("div",{class:P(["print-li",ht.oneMouseType==t.key||ht.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>xt("oneMouseType",t.key),onMouseleave:n[9]||(n[9]=t=>xt("oneMouseType","")),onClick:e=>{return n="oneClickType",i=t.key,void xt(n,i);var n,i}},["divider"==t.key?(l(),f(m(x),{key:0})):"outSetting"==t.key?(l(),s(u,{key:1},[p(" 第二层外显设置 "),d(m(F),{trigger:"click","show-arrow":!1,placement:"right-start",show:bt.isOutSetting,onClickoutside:n[7]||(n[7]=t=>_t("isOutSetting"))},{trigger:y((()=>[c("div",{class:"print-lite",onClick:n[5]||(n[5]=t=>Nt("isOutSetting"))},[c("span",W,k(t.label),1),d(m(M),{style:{background:"transparent"},component:m(N),size:"18"},null,8,["component"])])])),default:y((()=>[c("div",X,[(l(!0),s(u,null,v(m(Lt),(t=>(l(),s("div",{class:"print-li",key:t.key},[c("div",Z,[c("span",tt,k(t.label),1),d(m(j),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:y((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",et,[d(m(x)),c("div",nt,[d(m(L),{type:"primary",size:"small",onClick:Et},{default:y((()=>[g("保存")])),_:1}),d(m(j),{checked:m(Mt),"onUpdate:checked":n[6]||(n[6]=t=>h(Mt)?Mt.value=t:null)},{default:y((()=>[g("全选")])),_:1},8,["checked"])])])])])),_:2},1032,["show"])],2112)):(l(),s(u,{key:2},[p(" 第二层功能操作 "),c("div",it,[c("span",{class:"label bold",onClick:e=>Ht(t.templateCode,t.templateId,t.key,!1)},k(t.label),9,rt),d(m(F),{trigger:"click","show-arrow":!1,placement:"right-start",show:bt[t.key],onClickoutside:e=>_t(t.key)},{trigger:y((()=>[d(m(M),{component:m(D),size:"18",onClick:e=>Nt(t.key)},null,8,["component","onClick"])])),default:y((()=>[c("div",at,[(l(!0),s(u,null,v(m(kt),(e=>(l(),s("div",{class:P(["print-li",ht.twoMouseType==e.key?"active":""]),key:e.key,onMouseenter:t=>xt("twoMouseType",e.key),onMouseleave:n[8]||(n[8]=t=>xt("twoMouseType",""))},[c("div",lt,[c("span",{class:"label",onClick:n=>qt(e.key,t,!1)},k(e.label),9,st)])],42,ot)))),128))])])),_:2},1032,["show","onClickoutside"])])],2112))],42,Q)))),128))])])),_:3},8,["show"])],2112))]),d(V,O(e.$attrs,{modelValue:ft.identityVerification.visible,"onUpdate:modelValue":n[11]||(n[11]=t=>ft.identityVerification.visible=t),formatId:ft.currentFormatId,templateId:m(St),onSuccess:ne}),null,16,["modelValue","formatId","templateId"])],64))}});export{ut as default};
1
+ import{defineComponent as t,inject as e,ref as n,reactive as i,computed as r,onMounted as a,watch as l,openBlock as o,createElementBlock as s,Fragment as u,createElementVNode as c,createCommentVNode as p,createVNode as d,unref as m,withCtx as v,renderList as y,createBlock as f,createTextVNode as g,toDisplayString as k,isRef as h,renderSlot as b,withModifiers as w,normalizeClass as P,mergeProps as O}from"vue";import{isObject as S}from"@vue/shared";import{useMessage as C,NButtonGroup as I,NDropdown as T,NButton as L,NIcon as M,NPopover as F,NCheckbox as j,NDivider as x}from"naive-ui";import{PrintOutline as E,SettingsOutline as N,ChevronDownSharp as _,ArrowForwardOutline as D}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as z}from"../constants/index.js";import{Print as J}from"../utils/print.js";import{isIReport as U}from"../utils/browserPrint.js";import V from"./IdentityVerification.vue.js";import{format as A}from"date-fns";import"../api.js";const K={class:"newprint-button-outer"},B=c("span",{class:"label bold"},"外显设置",-1),R={class:"newprint-button-poperOver"},H={class:"print-lite"},q={class:"label bold"},G={class:"print-li"},Y={class:"print-lite"},$={class:"newprint-button-poperOver"},Q=["onMouseenter","onClick"],W={class:"label bold"},X={class:"newprint-button-poperOver"},Z={class:"print-lite"},tt={class:"label bold"},et={class:"print-li"},nt={class:"print-lite"},it={class:"print-lite"},rt=["onClick"],at={class:"newprint-button-poperOver"},lt=["onMouseenter"],ot={class:"print-lite"},st=["onClick"];var ut=t({__name:"NewPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number,default:1},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,isShowOutSetting:!0,customProps:{},outerPrintKeys:[]})}},setup(t,{expose:ut}){const ct=t,pt=[{label:"分割线",key:"divider"},{label:"外显设置",key:"outSetting"}],dt=C();let mt;const vt=e(z),yt=n(""),ft=i({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1});let gt=n([]),kt=n([{label:ct.pdfLoadText,key:"downloadPdf"},{label:ct.previewText,key:"previewText"},{label:ct.formatEditText,key:"formatEditText"},{label:"重置打印机",key:"resetPrinter"}]);const ht=i({oneMouseType:"",oneClickType:"",twoMouseType:""}),bt=i({oneShow:!1,isOperation:!1,isOutSetting:!1}),wt=n([]),Pt=n([]),Ot=r((()=>{if(!ft.currentFormatId)return{};let t=ft.currentFormatId;return ft.formatList.find((e=>e.id===t))}));r((()=>{var t;return(null==(t=Ot.value)?void 0:t.name)||"格式选择"}));const St=r((()=>{let t=ft.formatList.find((t=>t.id===ft.currentFormatId));return null==t?void 0:t.templateId})),Ct=r((()=>{var t;return null==(t=ct.newPrintSetting)?void 0:t.isShowPrintAll})),It=r((()=>{var t;return null==(t=ct.newPrintSetting)?void 0:t.isShowOutSetting})),Tt=r((()=>{var t;return(null==(t=ct.newPrintSetting)?void 0:t.customProps)||{}})),Lt=r((()=>{const t=pt.map((t=>t.key));return gt.value.filter((e=>!t.includes(e.key)))})),Mt=r({get:()=>Lt.value.every((t=>t.selected)),set(t){Lt.value.forEach((e=>{e.selected=t}))}}),Ft=async()=>{var t,e;(null==(e=null==(t=ct.newPrintSetting)?void 0:t.outerPrintKeys)?void 0:e.length)||await te(),bt.oneShow=!0},jt=async t=>{if(ct.directPrint){if(ft.spinning)return;return"button"===t?void(Ct.value?await ie():Ft()):Ft()}return Ft()},xt=(t,e)=>{ht[t]=e},Et=()=>{wt.value=gt.value.filter((t=>!t.selected)),Pt.value=Lt.value.filter((t=>t.selected)),_t("oneShow"),_t("isOutSetting"),vt("saveOuterPrint",Pt.value)},Nt=t=>{bt[t]=!0},_t=t=>{ht.oneClickType="",bt[t]=!1,"isOutSetting"==t&&(bt.isOutSetting=!1)},Dt=(t,e)=>{Kt(!1);let n={type:e,formatId:ft.currentFormatId,templateId:St.value};vt("success",t,n)},zt=t=>{Kt(!1),vt("error",t),S(t)&&"notInstalledApp"===t.type&&dt.error(t.message)},Jt=t=>{Kt(!1),vt("cancel",t)},Ut=t=>{vt("error",{message:"前置条件执行错误",type:t,preExecution:!0})},Vt=()=>JSON.stringify({...ct.token?{token:ct.token}:{}}),At=(t=[],e)=>{var n,i;let r={},a={};if((null==(n=ft.templateParams[e].customizeDataset)?void 0:n.length)>0){const e=(null==(i=Object.keys(t[0].datasetData||{}))?void 0:i[0])||"",n=JSON.stringify(t.map((t=>JSON.parse(t.datasetData[e]))));a={datasetData:{}},a.datasetData[e]=n}else Object.keys(t[0]).forEach((e=>{a[e]=[],t.forEach((t=>{a[e].includes(t[e])||a[e].push(t[e])})),a[e]=a[e].join(",")}));return r=Object.assign({},JSON.parse(Vt()),Tt.value,a),JSON.stringify(r)},Kt=(t,e)=>{if(ft.isClickOuterPrint){if(t&&e){const n=Pt.value.find((t=>t.key==e));return void(n&&(n.isLoading=t))}Pt.value.forEach((t=>{t.isLoading=!1}))}else ft.spinning=t},Bt=()=>ft.isClickOuterPrint?Pt.value.some((t=>t.isLoading)):ft.spinning,Rt=(t,e,n,i)=>{const r=ft.printParams[t];ft.isClickOuterPrint=i,Ht(r,t,e,n)},Ht=async(t=[],e,n,i,r)=>{let a=t.length;const l=async t=>{try{--a<=0&&Dt(t,"print")}catch(t){console.log("error",t)}};ct.showLoading&&Bt()&&!r||(Kt(!0,i),ct.prevFn("print").then((()=>{ft.curPrintParamList=t;const r={formatId:i,templateId:n,authorizationKey:yt.value,printdlgshow:ct.printdlgshow,signature:ct.signature,copies:ct.printCopies};if("MULTI"===ct.strategy)for(let e=0;e<t.length;e++)e>0&&(r.printdlgshow="0"),mt.printDirect({...r,params:Object.assign({},JSON.parse(Vt()),Tt.value,t[e])},l,zt,Jt);else mt.printDirect({...r,params:At(t,e)},(t=>{Dt(t,"print")}),zt,Jt)})).catch((()=>{Ut("print"),Kt(!1)})).finally((()=>{ft.visible=!1})))},qt=async(t,{templateCode:e,templateId:n,key:i},r)=>{const a=ft.printParams[e];switch(ft.isClickOuterPrint=r,t){case"previewText":(async(t=[],e,n,i)=>{ct.showLoading&&Bt()||(Kt(!0,i),ct.prevFn("preview").then((()=>{ft.curPrintParamList=t;const r="MULTI"===ct.strategy?Object.assign({},JSON.parse(Vt()),Tt.value,t[0]):At(t,e),a={formatId:i,templateId:n,authorizationKey:yt.value,params:r,btnprint:ct.btnprint,signature:ct.signature};mt.preview(a,(t=>{Dt(t,"preview")}),zt)})).catch((()=>{Ut("preview"),Kt(!1)})).finally((()=>{ft.visible=!1})))})(a,e,n,i);break;case"formatEditText":((t=[],e,n,i)=>{ct.showLoading&&Bt()||(Kt(!0,i),ct.prevFn("edit").then((()=>{ft.curPrintParamList=t,ft.currentFormatId=i,ft.identityVerification.visible=!0})).catch((()=>{Ut("edit")})).finally((()=>{Kt(!1)})))})(a,0,0,i);break;case"downloadPdf":(async(t=[],e,n,i)=>{ct.showLoading&&Bt()||(Kt(!0,i),ct.prevFn("download").then((()=>{ft.curPrintParamList=t;const r="MULTI"===ct.strategy?Object.assign({},JSON.parse(Vt()),Tt.value,t[0]):At(t,e),a={formatId:i,templateId:n,authorizationKey:yt.value,print:{print:"1",type:"1"},params:r,signature:ct.signature};mt.downloadPDF(a,(t=>Dt(t,"preview")),zt)})).catch((()=>{Ut("download"),Kt(!1)})).finally((()=>{ft.visible=!1})))})(a,e,n,i)}},Gt=()=>{},Yt=(t,e=[])=>{let n={};return e.forEach((e=>{n=Object.assign({},Wt(n,e,t))})),n},$t=(t,e,n)=>{const i={};return e.forEach((e=>{let r=((t,e)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let i=e;return Object.keys(n).includes(t.type)&&e&&e instanceof Date&&(i=A(e,n[t.type])),(null==t?void 0:t.defaultValue)||i})(e,t[e[n]]);t[e[n]]&&r&&(i[e[n]]=r)})),i},Qt=({customizeDataset:t=[],param:e=[]},n={})=>{let i={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;i.datasetData||(i.datasetData={}),i.datasetData[t.name]=JSON.stringify($t(n,e,"fieldName"))})),i=Object.assign({},i,$t(n,e,"key")),i},Wt=(t,e,n)=>{if(e.templateNumbers){for(let i=0;i<e.templateNumbers.length;i++){const r=e.templateNumbers[i],a=n[r];if(!a)return dt.error("当前勾选的数据没有匹配的模板"),t;t[r]||(t[r]=[]),t[r].push(Qt(a,e))}return t}const i=Object.keys(n);for(let r=0;r<i.length;r++){const a=i[r],l=n[a];if(!l)return dt.error("当前勾选的数据没有匹配的模板"),t;t[a]||(t[a]=[]),t[a].push(Qt(l,e))}return t},Xt=async t=>{ft.formatList=t?(t=>{let e=[];return t&&t.forEach((t=>{if(!t.format)return!1;e.push(...t.format.map((e=>Object.assign({},e,{templateName:t.name}))))})),e})(t.obj):[],(()=>{var t,e,n;const i=ft.formatList.map((t=>({templateCode:t.number,templateId:t.templateId,label:t.name,key:t.id,selected:!1,isLoading:!1})));gt.value.unshift(...i),It.value&&gt.value.push(...pt),(null==(e=null==(t=ct.newPrintSetting)?void 0:t.outerPrintKeys)?void 0:e.length)>0&&(gt.value.forEach((t=>{var e;(null==(e=ct.newPrintSetting)?void 0:e.outerPrintKeys.includes(t.key))&&(t.selected=!0)})),Pt.value=gt.value.filter((t=>t.selected))),wt.value=gt.value.filter((t=>!t.selected)),ct.hideButtons.length>0&&(kt.value=kt.value.filter((t=>!ct.hideButtons.includes(t.key))));const r=sessionStorage.getItem("portal");if(r){const t=JSON.parse(r),e=(null==(n=null==t?void 0:t.user)?void 0:n.currentRoleResourceObj)||{},i=Object.keys(e);i.includes("RY7.2.21.1.M2.G94181E")||(kt.value=kt.value.filter((t=>"downloadPdf"!=t.key))),i.includes("RY7.2.21.1.M2.G33633A")||(kt.value=kt.value.filter((t=>"formatEditText"!=t.key)))}})(),ft.templateParams=(t=>{let e={};return t&&t.forEach((t=>{if(!t.templateConfig)return!1;e[t.number]=t.templateConfig})),e})(t.obj),ft.printParams=Yt(ft.templateParams,ct.params)},Zt=async()=>{var t;if(ft.isInited)return!0;ft.isInited=!0,ft.spinning=!0,(()=>{if(mt)return!1;mt=new J})();const e=await ct.queryPrintFormatByNumber();return await Xt(e),(null==(t=e.obj)?void 0:t.length)>0&&(yt.value=e.obj[0].authorizationKey||""),ft.spinning=!1,!0},te=async(t=!0)=>{var e,n;if(await ct.clickPrevFn())if((null==(e=ct.params)?void 0:e.length)||(null==(n=ct.printParams)?void 0:n.length)){if(!ft.visible){if(!await Zt())return!1}t&&(ft.visible=!ft.visible)}else dt.warning(ct.noDataMsg)},ee=()=>{ft.watchPrintParamsReformatFn&&ft.watchPrintParamsReformatFn(),ft.isInited?ft.printParams=Yt(ft.templateParams,ct.params):ft.watchPrintParamsReformatFn=()=>l((()=>ft.isInited),(t=>{if(!t)return!1;ee()}))},ne=t=>{if(ft.identityVerification.visible=!1,U(ft.currentFormatId))return Dt(null,"edit");const e={formatId:ft.currentFormatId,templateId:St.value,params:Object.assign({},JSON.parse(Vt()),Tt.value,ft.curPrintParamList[0]),token:t};mt.editPrintFormat(e,(t=>{Dt(t,"edit")}),zt)};async function ie(){await te(!1),(()=>{const t=Object.keys(ft.printParams);ft.isClickOuterPrint=!1;for(let e=0;e<t.length;e++){const n=t[e],i=ft.printParams[n],r=ft.formatList.filter((t=>t.number==n));r&&r.length>0&&r.forEach((t=>{Ht(i,t.number,t.templateId,t.id,!0)}))}})()}return a((()=>{ft.isInited=!1})),l((()=>ct.params),(t=>{if(!(null==t?void 0:t.length))return!1;ee()}),{deep:!0}),l((()=>{var t;return null==(t=ct.newPrintSetting)?void 0:t.outerPrintKeys}),(async t=>{(null==t?void 0:t.length)>0&&await te(!1)}),{deep:!0,immediate:!0}),ut({directPrint:ie}),(e,n)=>(o(),s(u,null,[c("div",K,[p(" 外显按钮集合 "),d(m(I),null,{default:v((()=>[(o(!0),s(u,null,y(Pt.value,(e=>(o(),f(m(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:Gt,options:m(kt),onSelect:t=>qt(t,e,!0)},{default:v((()=>[d(m(L),{loading:t.showLoading&&e.isLoading,onClick:t=>Rt(e.templateCode,e.templateId,e.key,!0)},{icon:v((()=>[d(m(M),{component:m(E),size:"18"},null,8,["component"])])),default:v((()=>[g(" "+k(e.label),1)])),_:2},1032,["loading","onClick"])])),_:2},1032,["options","onSelect"])))),128))])),_:1}),p(' <n-button-group>\r\n\t\t\t<n-popover\r\n\t\t\t\tv-for="outer in outerPrintItems"\r\n :key="outer.key"\r\n\t\t\t\ttrigger="hover"\r\n\t\t\t\t:show-arrow="false"\r\n\t\t\t\t:show="downlistPopover.isOperation"\r\n\t\t\t\t@clickoutside="handleClickOutHide(\'isOperation\')"\r\n\t\t\t>\r\n\t\t\t\t<template #trigger>\r\n\t\t\t\t\t<n-button\r\n\t\t\t\t\t\t@mouseenter="delayShowPopover(\'isOperation\')"\r\n\t\t\t\t\t\t@mouseleave="handleClickOutHide(\'isOperation\')"\r\n\t\t\t\t\t\t@click="console.log(33)"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t<n-icon :component="PrintOutline" size="18"></n-icon>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t<span class="label bold">{{ outer.label }}</span>\r\n\t\t\t\t\t</n-button>\r\n\t\t\t\t</template>\r\n\t\t\t\t<div class="newprint-button-poperOver">\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tclass="print-li"\r\n\t\t\t\t\t\tv-for="operation in operations"\r\n\t\t\t\t\t\t:key="operation.key"\r\n\t\t\t\t\t\t:class="downlistOperation.twoMouseType==operation.key ? \'active\' : \'\' "\r\n\t\t\t\t\t\t@mouseenter="handleTypeChange(\'twoMouseType\', operation.key)"\r\n\t\t\t\t\t\t@mouseleave="handleTypeChange(\'twoMouseType\', \'\')"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<div class="print-lite">\r\n\t\t\t\t\t\t\t<span class="label"> {{ operation.label }} </span>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</n-popover>\r\n\t\t</n-button-group> '),p(" 外显设置按钮 "),ft.isInited&&Pt.value.length>0&&Pt.value.length==m(Lt).length&&m(It)?(o(),f(m(F),{key:0,trigger:"click","show-arrow":!1,show:bt.isOutSetting,onClickoutside:n[2]||(n[2]=t=>_t("isOutSetting"))},{trigger:v((()=>[d(m(L),{onClick:n[0]||(n[0]=t=>Nt("isOutSetting"))},{default:v((()=>[B,d(m(M),{style:{"margin-left":"8px"},component:m(N),size:"18"},null,8,["component"])])),_:1})])),default:v((()=>[c("div",R,[(o(!0),s(u,null,y(m(Lt),(t=>(o(),s("div",{class:"print-li",key:t.key},[c("div",H,[c("span",q,k(t.label),1),d(m(j),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:v((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",G,[d(m(x)),c("div",Y,[d(m(L),{type:"primary",size:"small",onClick:Et},{default:v((()=>[g("保存")])),_:1}),d(m(j),{checked:m(Mt),"onUpdate:checked":n[1]||(n[1]=t=>h(Mt)?Mt.value=t:null)},{default:v((()=>[g("全选")])),_:1},8,["checked"])])])])])),_:1},8,["show"])):(o(),s(u,{key:1},[p(" 打印全部按钮 "),d(m(F),{trigger:"click","show-arrow":!1,show:bt.oneShow,onClickoutside:n[10]||(n[10]=t=>_t("oneShow"))},{trigger:v((()=>[b(e.$slots,"button",{handleClickPrintBtn:te,printSpinning:ft.spinning,printbtnText:t.btnText,printVisible:ft.visible},(()=>[d(m(I),{class:"newprint-button-component",onClick:n[4]||(n[4]=w((()=>jt("icon")),["stop"]))},{default:v((()=>[d(m(L),{loading:t.showLoading&&ft.spinning,onClick:n[3]||(n[3]=w((()=>jt("button")),["stop"]))},{icon:v((()=>[d(m(M),{component:m(E),size:"18"},null,8,["component"])])),default:v((()=>[g(" "+k(m(Ct)?"打印全部":t.btnText),1)])),_:1},8,["loading"]),d(m(L),{class:"icon-select"},{icon:v((()=>[d(m(M),{component:m(_),size:"18"},null,8,["component"])])),_:1})])),_:1})]))])),default:v((()=>[c("div",$,[(o(!0),s(u,null,y(wt.value,(t=>(o(),s("div",{class:P(["print-li",ht.oneMouseType==t.key||ht.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>xt("oneMouseType",t.key),onMouseleave:n[9]||(n[9]=t=>xt("oneMouseType","")),onClick:e=>{return n="oneClickType",i=t.key,void xt(n,i);var n,i}},["divider"==t.key?(o(),f(m(x),{key:0})):"outSetting"==t.key?(o(),s(u,{key:1},[p(" 第二层外显设置 "),d(m(F),{trigger:"click","show-arrow":!1,placement:"right-start",show:bt.isOutSetting,onClickoutside:n[7]||(n[7]=t=>_t("isOutSetting"))},{trigger:v((()=>[c("div",{class:"print-lite",onClick:n[5]||(n[5]=t=>Nt("isOutSetting"))},[c("span",W,k(t.label),1),d(m(M),{style:{background:"transparent"},component:m(N),size:"18"},null,8,["component"])])])),default:v((()=>[c("div",X,[(o(!0),s(u,null,y(m(Lt),(t=>(o(),s("div",{class:"print-li",key:t.key},[c("div",Z,[c("span",tt,k(t.label),1),d(m(j),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:v((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",et,[d(m(x)),c("div",nt,[d(m(L),{type:"primary",size:"small",onClick:Et},{default:v((()=>[g("保存")])),_:1}),d(m(j),{checked:m(Mt),"onUpdate:checked":n[6]||(n[6]=t=>h(Mt)?Mt.value=t:null)},{default:v((()=>[g("全选")])),_:1},8,["checked"])])])])])),_:2},1032,["show"])],2112)):(o(),s(u,{key:2},[p(" 第二层功能操作 "),c("div",it,[c("span",{class:"label bold",onClick:e=>Rt(t.templateCode,t.templateId,t.key,!1)},k(t.label),9,rt),d(m(F),{trigger:"click","show-arrow":!1,placement:"right-start",show:bt[t.key],onClickoutside:e=>_t(t.key)},{trigger:v((()=>[d(m(M),{component:m(D),size:"18",onClick:e=>Nt(t.key)},null,8,["component","onClick"])])),default:v((()=>[c("div",at,[(o(!0),s(u,null,y(m(kt),(e=>(o(),s("div",{class:P(["print-li",ht.twoMouseType==e.key?"active":""]),key:e.key,onMouseenter:t=>xt("twoMouseType",e.key),onMouseleave:n[8]||(n[8]=t=>xt("twoMouseType",""))},[c("div",ot,[c("span",{class:"label",onClick:n=>qt(e.key,t,!1)},k(e.label),9,st)])],42,lt)))),128))])])),_:2},1032,["show","onClickoutside"])])],2112))],42,Q)))),128))])])),_:3},8,["show"])],2112))]),d(V,O(e.$attrs,{modelValue:ft.identityVerification.visible,"onUpdate:modelValue":n[11]||(n[11]=t=>ft.identityVerification.visible=t),formatId:ft.currentFormatId,templateId:m(St),onSuccess:ne}),null,16,["modelValue","formatId","templateId"])],64))}});export{ut as default};
@@ -4181,6 +4181,10 @@ export declare const CallbackMaps: Map<string, {
4181
4181
  bodyWidth?: number | ((index: number) => number) | undefined;
4182
4182
  bodyMinWidth?: number | ((index: number) => number) | undefined;
4183
4183
  } | undefined;
4184
+ pagerScroll?: {
4185
+ enable?: boolean | undefined;
4186
+ capacity?: number | undefined;
4187
+ } | undefined;
4184
4188
  onFormChange?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
4185
4189
  onCopy?: ((params: import("vxe-table").VxeTableDefines.CopyEventParams) => void) | undefined;
4186
4190
  onCut?: ((params: import("vxe-table").VxeTableDefines.CutEventParams) => void) | undefined;
@@ -7746,6 +7750,10 @@ export declare const CallbackMaps: Map<string, {
7746
7750
  bodyWidth?: number | ((index: number) => number) | undefined;
7747
7751
  bodyMinWidth?: number | ((index: number) => number) | undefined;
7748
7752
  } | undefined;
7753
+ pagerScroll?: {
7754
+ enable?: boolean | undefined;
7755
+ capacity?: number | undefined;
7756
+ } | undefined;
7749
7757
  onFormChange?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
7750
7758
  onSettingClick?: (() => void) | undefined;
7751
7759
  onFormClick?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
@@ -175,6 +175,9 @@ declare const _default: import("vue").DefineComponent<{
175
175
  modelValue: unknown[];
176
176
  componentData: Record<string, any>;
177
177
  } & {
178
+ /**
179
+ * 改变弹窗大小
180
+ */
178
181
  itemKey?: string | Function | undefined;
179
182
  }>, {
180
183
  move: Function;
@@ -699,6 +699,9 @@ declare const _default: import("vue").DefineComponent<{
699
699
  handleInitConditions: () => Promise<void>;
700
700
  validate: () => Promise<unknown>;
701
701
  saveAdd: () => void;
702
+ /**
703
+ * 改变展示方式
704
+ */
702
705
  cancelSaveAdd: () => void;
703
706
  checkActionList: () => boolean;
704
707
  NSpin: any;
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function f(f,u,d,m,h){const{computedX:v,getXValue:p}=a(u),{originX:g,endX:x,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:w,borderStyle:Y,treeData:y,xAxis:S,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=u,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:l}=C.data||{},{startLine:s,endLine:a}=e;n=r(o,{fontSize:12,...l,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const c=E(n,e,i);n&&(n.set(c),n.origin={data:t},$(n),s&&(s.text=n),a&&(a.text=n))}return n}function E(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function M(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:c,halfY:f}=e;if(!s||s<g||s>x)return;const{lineStyle:u}=C.data||{};let d;const m={left:s,top:f};d=i?r("circle",{fill:u.stroke,...m}):n?r(">",{fill:u.stroke,...m,fontSize:18}):l([s,a,s,f],u);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),v=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return v.isLeft=o,v.isCustomIcon=i,$(v),v}function $(t){I.hovered&&(t.on("mouseover",(()=>{D(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=E(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&D(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};d("change",e)}})))}function D(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=p(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.sourceData=[{type:"tree",startTime:r,endTime:s,value:l.value}],m.isTarget=!0,m.show=!0}s(f,{...u,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a,style:c,marginBottom:u}=S;if(!l)return;const d=[],m=X+(u?l-u:l/2),h=u?"bottom":"center";r.forEach(((t,i)=>{const n=s+i*L*a;d.push(e([n,m],{value:t.slice(11,16),originY:h,...c}))}));const v=d.length>0?new t.Group([...d],{...i,objectCaching:!1}):null;v&&f.value.add(v);const p=new t.Rect({width:w,height:l,left:0,top:X,...n,originX:"left",originY:"top",...Y});f.value.add(p);const{show:g=!0}=C;if(!g)return;const y=e([x+(w-x)/2,m],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});f.value.add(y)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:u,left:d,top:m,title:h=""}=i,p={value:h,...r};(null==(n=i.children)?void 0:n.length)?(p.value=h.split("").join("\n"),t(i.children)):(p.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=C.data||{},i=t.top,n=i+k,o=n-k/2,r={y1:i,y2:n,halfY:o};let s=null;const a=c(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:c,continue:f}=t,[u,d]=c,m=u&&v(u),h=d&&v(d),p=M({...r,x:m},{isCustomIcon:!h&&!f,isContinue:!1,isLeft:!0}),L=M({...r,x:h},{isCustomIcon:!1,isContinue:!!f});let X;if((p||m<g)&&(L||h>x)){X=l([p?m:g,o,L?h:x,o],e)}const C={startLine:p,centerLine:X,endLine:L};let w,Y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e,{startLine:r,endLine:s}=t||{};if(n){n.origin=i;const t={x1:g,x2:l?l.left:x};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:g,x2:x};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(s,C,Object.assign({},a,{data:t,index:i})),s&&(w=A(n[i-1],s,o)),i===n.length-1&&(Y=A(t,C,o)),s=C,X&&z.add(X),p&&z.add(p),L&&z.add(L),w&&z.add(w),Y&&z.add(Y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=x+(w-x)/2,l=e([o,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle}),r=w-Y.strokeWidth;o+l.width>r&&l.set({originX:"right",left:r});l&&f.value.add(l)}(i)),s.push(o({width:a,height:u,...Y},p,{left:d,top:m},!0))}))}(y);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&f.value.add(a),z.size&&f.value.add(...z)}()}export{f as useTop};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e,drawText as i,defaultRectStyle as n,drawTextGroup as o,drawLine as r,drawPoint as l}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as c}from"../useScaleColumn.js";import"vue";import{getScaleNumberList as f}from"../../utils/index.js";import{isArray as u,cloneDeep as d}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function m(m,h,p,g,v){const{computedX:x,getXValue:L}=a(h),{originX:X,endX:C,xCellWidth:w,originYXAxis:y,top:Y,canvasWidth:S,borderStyle:j,treeData:b,xAxis:G,topGridYNumber:k,topGridOriginY:E,topGridYCellHeight:I,topGridEndY:M,event:z}=h,A=new Set;function $(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:r}=Y.dataStyle||{},{startLine:s,endLine:a}=e;n=l(o,{fontSize:12,...r,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const c=V(n,e,i);n&&(n.set(c),n.origin={data:t},N(n),s&&(s.text=n),a&&(a.text=n))}return n}function V(t,e,i){const n=t.width+1,{startLine:o,centerLine:r,endLine:l}=e,s={top:i,originX:"center",originY:"center"};return r&&n<=r.width?s.left=r.x1+r.width/2:l&&n<=l.limitX.x2-l.left?(s.originX="left",s.left=l.left+1):o&&!l&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):r?(s.originY="top",s.left=r.x1+r.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function D(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:c,halfY:f}=e;if(!s||s<X||s>C)return;const{lineStyle:u}=Y.dataStyle||{};let d;const m={left:s,top:f};d=i?l("circle",{fill:u.stroke,...m}):n?l(">",{fill:u.stroke,...m,fontSize:18}):r([s,a,s,f],u);const h=new t.Rect({width:w,height:I,fill:"transparent",left:s-w/2,top:a}),p=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return p.isLeft=o,p.isCustomIcon=i,N(p),p}function N(t){z.hovered&&(t.on("mouseover",(()=>{T(t,"hover")})),t.on("mouseout",(()=>{g.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=V(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),z.hovered&&T(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};p("change",e)}})))}function T(t,e="moving"){var i,n,o;const{data:r}=t.origin;g.point={x:t.left,y:t.top};let[l="",s=""]=r.time||[];if("moving"===e){const e=L(t.left);t.isLeft?l=e:s=e,r.time=[l,s],t.text&&(t.text.origin.data.time=[l,s])}g.list=[`开始时间 ${l}`,`结束时间 ${s}`,`流速 ${(null==(i=r.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=r.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=r.value)?void 0:o.total)||""}`],g.sourceData=[{type:"tree",startTime:l,endTime:s,value:r.value}],g.isTarget=!0,g.show=!0}s(m,{...h,gridYNumber:k,originY:E,yCellHeight:I,endY:M}),function(){const{height:o,list:r,left:l,spaceValue:s,style:a,marginBottom:c}=G;if(!o)return;const f=[],u=y+(c?o-c:o/2),d=c?"bottom":"center";r.forEach(((t,e)=>{const n=l+e*w*s;f.push(i([n,u],{value:t.slice(11,16),originY:d,...a}))}));const h=f.length>0?new t.Group([...f],{...e,objectCaching:!1}):null;h&&m.value.add(h);const p=new t.Rect({width:S,height:o,left:0,top:y,...n,originX:"left",originY:"top",...j});m.value.add(p);const{show:g=!0}=Y}(),function(){var i;const n=(null==(i=null==Y?void 0:Y.tree)?void 0:i.textStyle)||{},l=[];!function t(e){e.forEach((e=>{var i;const{width:s,height:a,left:c,top:f,title:u=""}=e,m={value:u,...n};(null==(i=e.children)?void 0:i.length)?(m.value=u.split("").join("\n"),t(e.children)):(m.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=Y.dataStyle||{},i=t.top,n=i+I,o=n-I/2,l={y1:i,y2:n,halfY:o};let s=null;const a=d(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:c,continue:f}=t,[u,d]=c,m=u&&x(u),h=d&&x(d),p=D({...l,x:m},{isCustomIcon:!h&&!f,isContinue:!1,isLeft:!0}),g=D({...l,x:h},{isCustomIcon:!1,isContinue:!!f});let v;if((p||m<X)&&(g||h>C)){v=r([p?m:X,o,g?h:C,o],e)}const L={startLine:p,centerLine:v,endLine:g};let w,y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:r}=e,{startLine:l,endLine:s}=t||{};if(n){n.origin=i;const t={x1:X,x2:r?r.left:C};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):l&&(t.x1=l.left,l.limitX.x2=n.left,n.prevLine=l,l.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(r){r.origin=i;const t={x1:n?n.left:X,x2:C};r.limitX=t,o&&(r.centerLine=o)}n&&r&&(n.nearLine=r,r.nearLine=n)}(s,L,Object.assign({},a,{data:t,index:i})),s&&(w=$(n[i-1],s,o)),i===n.length-1&&(y=$(t,L,o)),s=L,v&&A.add(v),p&&A.add(p),g&&A.add(g),w&&A.add(w),y&&A.add(y)}))}(e)),l.push(o({width:s,height:a,...j},m,{left:c,top:f},!0))}))}(b);const s=l.length>0?new t.Group([...l],{...e,objectCaching:!1}):null;s&&m.value.add(s),A.size&&m.value.add(...A)}(),function(){const{show:i=!0,range:n,spaceValue:o=.5,spaceGridNumber:r=1,style:l,margin:s=5}=(null==Y?void 0:Y.scaleValue)||{};if(!i||!u(n))return;const a=f(n,o),d=[];if(a.forEach(((t,e)=>{if(0===e||e===a.length-1)return;const i=M-e*I*r;Math.abs(i-E)<1||d.push(c(String(t),{style:l,position:"right"},C+s,i))})),!d.length)return;const h=new t.Group(d,{objectCaching:!1,...e});m.value.add(h)}()}export{m as useTop};
@@ -3214,6 +3214,10 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
3214
3214
  bodyWidth?: number | ((index: number) => number) | undefined;
3215
3215
  bodyMinWidth?: number | ((index: number) => number) | undefined;
3216
3216
  } | undefined;
3217
+ pagerScroll?: {
3218
+ enable?: boolean | undefined;
3219
+ capacity?: number | undefined;
3220
+ } | undefined;
3217
3221
  onFormChange?: ((payload_0: import("../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
3218
3222
  onCopy?: ((params: import("vxe-table").VxeTableDefines.CopyEventParams) => void) | undefined;
3219
3223
  onCut?: ((params: import("vxe-table").VxeTableDefines.CutEventParams) => void) | undefined;
@@ -6779,6 +6783,10 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
6779
6783
  bodyWidth?: number | ((index: number) => number) | undefined;
6780
6784
  bodyMinWidth?: number | ((index: number) => number) | undefined;
6781
6785
  } | undefined;
6786
+ pagerScroll?: {
6787
+ enable?: boolean | undefined;
6788
+ capacity?: number | undefined;
6789
+ } | undefined;
6782
6790
  onFormChange?: ((payload_0: import("../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
6783
6791
  onSettingClick?: (() => void) | undefined;
6784
6792
  onFormClick?: ((payload_0: import("../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
@@ -3215,6 +3215,10 @@ declare const _default: import("vue").DefineComponent<{
3215
3215
  bodyWidth?: number | ((index: number) => number) | undefined;
3216
3216
  bodyMinWidth?: number | ((index: number) => number) | undefined;
3217
3217
  } | undefined;
3218
+ pagerScroll?: {
3219
+ enable?: boolean | undefined;
3220
+ capacity?: number | undefined;
3221
+ } | undefined;
3218
3222
  onFormChange?: ((payload_0: import("../../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
3219
3223
  onCopy?: ((params: import("vxe-table").VxeTableDefines.CopyEventParams) => void) | undefined;
3220
3224
  onCut?: ((params: import("vxe-table").VxeTableDefines.CutEventParams) => void) | undefined;
@@ -6780,6 +6784,10 @@ declare const _default: import("vue").DefineComponent<{
6780
6784
  bodyWidth?: number | ((index: number) => number) | undefined;
6781
6785
  bodyMinWidth?: number | ((index: number) => number) | undefined;
6782
6786
  } | undefined;
6787
+ pagerScroll?: {
6788
+ enable?: boolean | undefined;
6789
+ capacity?: number | undefined;
6790
+ } | undefined;
6783
6791
  onFormChange?: ((payload_0: import("../../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
6784
6792
  onSettingClick?: (() => void) | undefined;
6785
6793
  onFormClick?: ((payload_0: import("../../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,provide as o,ref as a,toRaw as l,watch as r,resolveComponent as n,openBlock as s,createElementBlock as i,mergeProps as u,unref as c,createBlock as d,resolveDynamicComponent as f,createElementVNode as m,normalizeStyle as p,createVNode as v,withCtx as b,createSlots as h,renderList as g,createCommentVNode as x,renderSlot as y,normalizeProps as k,guardReactiveProps as C}from"vue";import{useTheme as D,createOpacityColor as j}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as $}from"@vueuse/core";import"date-fns";import{isString as I,isEqualWith as w,isFunction as q,pick as R}from"lodash-es";import{useFormAsyncQueue as H,presetRequestHandler as T}from"../../../shared/hooks/useFormRequest/index.js";import{promiseTimeout as _}from"@vueuse/shared";import{hex2rgba as P,widthAppend as A,uuidGenerator as L}from"../../../shared/utils/index.js";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NConfigProvider as S}from"naive-ui";import{useVersion as F}from"../../../shared/hooks/useVersion.js";import{VxeTableEventNameList as O,InjectionIhoTableEmits as B,InjectionTableAsyncQueue as E,InjectionIhoTableAnnotation as N,InjectionIhoTableUUID as V,InjectionIhoTableInstance as W,InjectionIhoTableConfig as z,InjectionIhoTableFieldList as G,InjectionIhoTableHandler as J}from"./constants/index.js";import{createTableHooks as K,applyTableConfigHooks as M,applyTableFieldHooks as Q,createTableEventHandlers as U,createDomInsertComponent as X,createDataTransfer as Y}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as Z}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as ee}from"./utils/index.js";const te=["id"];var oe=e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object},requestInstance:{type:Object},uniqueCacheData:{type:Boolean,default:!1},parallelism:{type:Number,default:3}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...O],setup(e,{expose:O,emit:oe}){var ae,le;const re=e,ne=t((()=>{const e=D({"--c-border-color":"#d0d0d0","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#e6e6e6","--c-stripe-color":"#f6f6f6"}).value;return e["--c-primary-color-opacity3"]=j(...P(e["--c-primary-color"]+""),.3),e})),se=t((()=>{var e,t;const o=null!=(t=null==(e=re.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===o?"100%":I(o)&&(o.includes("calc")||o.endsWith("%"))?o:A(o)}})),ie=Z(),ue=function(e,...t){oe(e,...t);const o=c(pe)[ee(e)];q(o)&&o(...t),ie.trigger(e,...t)};o(B,ue);const ce=H(t((()=>re.requestInstance)),t((()=>!!re.uniqueCacheData))).create(re.parallelism,{beforeRequest:(e,t)=>t,afterRequest:(e,t)=>T(t)});o(E,ce);const de=K();o(N,t((()=>re.annotation)));const fe=L();o(V,fe);const me=a();o(W,me);const pe=a({uuid:null!=(le=null==(ae=re.tableConfig)?void 0:ae.uuid)?le:fe});o(z,pe);const ve=$(be,10);function be(){var e,t;pe.value=M(de,{...re.tableConfig,uuid:null!=(t=null==(e=re.tableConfig)?void 0:e.uuid)?t:fe},{$table:me,emits:ue,globProps:re})}const he=a([]);o(G,he);const ge=$(xe,10);function xe(){const e=Q(de,re.fieldList,pe.value,{$table:me,emits:ue,globProps:re});w(e,l(he.value),((e,t)=>{if(q(e)&&q(t))return e.toString()===t.toString()}))||(he.value=e)}const ye=Y(de,pe,me),ke=a([]);async function Ce(){var e,t;const o=await ye(re.tableData),a=null==(e=me.value)?void 0:e.getTableData().fullData;if(a){let e=0;if(!(a.some((t=>{var a;if(!(null==(a=me.value)?void 0:a.isInsertByRow(t))){if(t!==o[e])return!0;e++}}))||e!==o.length))return}ke.value=o,null==(t=me.value)||t.recalculate(!0)}const De={updateTableDataRef:$(Ce,10),updateConfigRef:ve,updateFieldListRef:ge};o(J,De);const je=U({hooks:de,config:pe,$table:me,context:De,emits:ue,globProps:re}),$e=t((()=>({...pe.value,...je})));let Ie=!1,we=!1,qe=!1;const Re=$((()=>{Ie&&be(),we&&xe(),qe&&Ce(),Ie=!1,we=!1,qe=!1}),10);r((()=>re.tableConfig),(()=>{Ie=!0,we=!0,qe=!0,Re()}),{deep:!0}),r((()=>re.fieldList),(()=>{we=!0,qe=!0,Re()}),{deep:!0}),r([()=>[...re.tableData],()=>{var e;return null==(e=re.tableData)?void 0:e.length}],(()=>{qe=!0,Re()})),r([()=>re.tableData,()=>{var e;return null==(e=re.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=pe.value.treeConfig)?void 0:e.expandAll)&&(await _(11),null==(t=me.value)||t.setAllTreeExpand(!0))})),be(),xe(),Ce();const{header:He,footer:Te}=X(de);function _e(e){return R(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return O({$table:me,async loadData(e){var t;null==(t=me.value)||t.loadData(await ye(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=me.value)||e.loadColumn([]),null==(t=me.value)||t.loadData([]),be(),xe(),Ce()},verticalTable:{update:()=>{}},...de.exposeHooks.expose.call({},pe,{$table:me,emits:ue,globProps:re,...De})}),de.setupHooks.setup.call(pe,he,{$table:me,emits:ue,globProps:re}),(e,t)=>{const o=n("vxe-grid");return s(),i("section",u({class:"iho-table",id:c(fe),style:c(ne)},c(F)()),[(s(),d(f(c(He)))),m("section",{style:p(c(se))},[v(c(S),{abstract:"",namespace:"vxe-table--ignore-clear"},{default:b((()=>[v(o,u({ref_key:"$table",ref:me},c($e),{columns:he.value,data:ke.value}),h({_:2},[g(e.$slots,((t,o)=>({name:o,fn:b((t=>[x(" 实际上所有的vxe-grid插槽都支持 "),y(e.$slots,o,k(C(_e(t))))]))})))]),1040,["columns","data"])])),_:3})],4),(s(),d(f(c(Te))))],16,te)}}});export{oe as default};
1
+ import{defineComponent as e,computed as t,provide as o,ref as a,toRaw as l,watch as r,resolveComponent as n,openBlock as s,createElementBlock as i,mergeProps as u,unref as c,createBlock as d,resolveDynamicComponent as f,createElementVNode as m,normalizeStyle as p,createVNode as v,withCtx as b,createSlots as h,renderList as g,createCommentVNode as x,renderSlot as y,normalizeProps as k,guardReactiveProps as C}from"vue";import{useTheme as D,createOpacityColor as j}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as $}from"@vueuse/core";import"date-fns";import{isString as I,isEqualWith as w,isFunction as q,pick as R}from"lodash-es";import{useFormAsyncQueue as H,presetRequestHandler as T}from"../../../shared/hooks/useFormRequest/index.js";import{promiseTimeout as _}from"@vueuse/shared";import{hex2rgba as P,widthAppend as A,uuidGenerator as L}from"../../../shared/utils/index.js";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NConfigProvider as S}from"naive-ui";import{useVersion as F}from"../../../shared/hooks/useVersion.js";import{VxeTableEventNameList as O,InjectionIhoTableEmits as B,InjectionTableAsyncQueue as E,InjectionIhoTableAnnotation as N,InjectionIhoTableUUID as V,InjectionIhoTableInstance as W,InjectionIhoTableConfig as z,InjectionIhoTableFieldList as G,InjectionIhoTableHandler as J,InjectionIhoTableGlobProps as K}from"./constants/index.js";import{createTableHooks as M,applyTableConfigHooks as Q,applyTableFieldHooks as U,createTableEventHandlers as X,createDomInsertComponent as Y,createDataTransfer as Z}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as ee}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as te}from"./utils/index.js";const oe=["id"];var ae=e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object},requestInstance:{type:Object},uniqueCacheData:{type:Boolean,default:!1},parallelism:{type:Number,default:3}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...O],setup(e,{expose:O,emit:ae}){var le,re;const ne=e,se=t((()=>{const e=D({"--c-border-color":"#d0d0d0","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#e6e6e6","--c-stripe-color":"#f6f6f6"}).value;return e["--c-primary-color-opacity3"]=j(...P(e["--c-primary-color"]+""),.3),e})),ie=t((()=>{var e,t;const o=null!=(t=null==(e=ne.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===o?"100%":I(o)&&(o.includes("calc")||o.endsWith("%"))?o:A(o)}})),ue=ee(),ce=function(e,...t){ae(e,...t);const o=c(ve)[te(e)];q(o)&&o(...t),ue.trigger(e,...t)};o(B,ce);const de=H(t((()=>ne.requestInstance)),t((()=>!!ne.uniqueCacheData))).create(ne.parallelism,{beforeRequest:(e,t)=>t,afterRequest:(e,t)=>T(t)});o(E,de);const fe=M();o(N,t((()=>ne.annotation)));const me=L();o(V,me);const pe=a();o(W,pe);const ve=a({uuid:null!=(re=null==(le=ne.tableConfig)?void 0:le.uuid)?re:me});o(z,ve);const be=$(he,10);function he(){var e,t;ve.value=Q(fe,{...ne.tableConfig,uuid:null!=(t=null==(e=ne.tableConfig)?void 0:e.uuid)?t:me},{$table:pe,emits:ce,globProps:ne})}const ge=a([]);o(G,ge);const xe=$(ye,10);function ye(){const e=U(fe,ne.fieldList,ve.value,{$table:pe,emits:ce,globProps:ne});w(e,l(ge.value),((e,t)=>{if(q(e)&&q(t))return e.toString()===t.toString()}))||(ge.value=e)}const ke=Z(fe,ve,pe),Ce=a([]);async function De(){var e,t;const o=await ke(ne.tableData),a=null==(e=pe.value)?void 0:e.getTableData().fullData;if(a){let e=0;if(!(a.some((t=>{var a;if(!(null==(a=pe.value)?void 0:a.isInsertByRow(t))){if(t!==o[e])return!0;e++}}))||e!==o.length))return}Ce.value=o,null==(t=pe.value)||t.recalculate(!0)}const je={updateTableDataRef:$(De,10),updateConfigRef:be,updateFieldListRef:xe};o(J,je),o(K,ne);const $e=X({hooks:fe,config:ve,$table:pe,context:je,emits:ce,globProps:ne}),Ie=t((()=>({...ve.value,...$e})));let we=!1,qe=!1,Re=!1;const He=$((()=>{we&&he(),qe&&ye(),Re&&De(),we=!1,qe=!1,Re=!1}),10);r((()=>ne.tableConfig),(()=>{we=!0,qe=!0,Re=!0,He()}),{deep:!0}),r((()=>ne.fieldList),(()=>{qe=!0,Re=!0,He()}),{deep:!0}),r([()=>[...ne.tableData],()=>{var e;return null==(e=ne.tableData)?void 0:e.length}],(()=>{Re=!0,He()})),r([()=>ne.tableData,()=>{var e;return null==(e=ne.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=ve.value.treeConfig)?void 0:e.expandAll)&&(await _(11),null==(t=pe.value)||t.setAllTreeExpand(!0))})),he(),ye(),De();const{header:Te,footer:_e}=Y(fe);function Pe(e){return R(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return O({$table:pe,async loadData(e){var t;null==(t=pe.value)||t.loadData(await ke(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=pe.value)||e.loadColumn([]),null==(t=pe.value)||t.loadData([]),he(),ye(),De()},verticalTable:{update:()=>{}},...fe.exposeHooks.expose.call({},ve,{$table:pe,emits:ce,globProps:ne,...je})}),fe.setupHooks.setup.call(ve,ge,{$table:pe,emits:ce,globProps:ne}),(e,t)=>{const o=n("vxe-grid");return s(),i("section",u({class:"iho-table",id:c(me),style:c(se)},c(F)()),[(s(),d(f(c(Te)))),m("section",{style:p(c(ie))},[v(c(S),{abstract:"",namespace:"vxe-table--ignore-clear"},{default:b((()=>[v(o,u({ref_key:"$table",ref:pe},c(Ie),{columns:ge.value,data:Ce.value}),h({_:2},[g(e.$slots,((t,o)=>({name:o,fn:b((t=>[x(" 实际上所有的vxe-grid插槽都支持 "),y(e.$slots,o,k(C(Pe(t))))]))})))]),1040,["columns","data"])])),_:3})],4),(s(),d(f(c(_e))))],16,oe)}}});export{ae as default};
@@ -3,7 +3,7 @@ import { Nullable, UndefinedAble } from '../../../../shared/types';
3
3
  import { ComputedRef, InjectionKey, Ref } from 'vue';
4
4
  import { VxeTableInstance } from 'vxe-table';
5
5
  import { AnnotationItem } from '../../../../components/annotation-edit/src/type';
6
- import { IhoTableConfig, IhoTableEmits, IhoTableFieldItem, IhoTableHandler } from '../../../../components/iho-table';
6
+ import { IhoTableConfig, IhoTableEmits, IhoTableFieldItem, IhoTableHandler, IhoTableProps } from '../../../../components/iho-table';
7
7
  import { IhoTableEventListener } from '../../../../components/iho-table/src/hooks/tapHooks/useEventHooks';
8
8
  export declare enum WIDGET_TYPE {
9
9
  DEFAULT = "DEFAULT",
@@ -83,5 +83,6 @@ export declare const InjectionIhoTableAnnotation: InjectionKey<ComputedRef<Nulla
83
83
  export declare const InjectionIhoTableUUID: InjectionKey<string>;
84
84
  export declare const InjectionIhoTableInstance: InjectionKey<Ref<UndefinedAble<VxeTableInstance>>>;
85
85
  export declare const InjectionIhoTableHandler: InjectionKey<IhoTableHandler>;
86
+ export declare const InjectionIhoTableGlobProps: InjectionKey<IhoTableProps>;
86
87
  export declare const InjectionIhoTableEventListener: InjectionKey<IhoTableEventListener>;
87
88
  export declare const InjectionTableAsyncQueue: InjectionKey<FormRequestDefine.FormAsyncQueue>;
@@ -1 +1 @@
1
- import{eventListener2EventName as e}from"../utils/index.js";var o=(e=>(e.DEFAULT="DEFAULT",e.PICTURE="PICTURE",e.FILE="FILE",e.MONEY="MONEY",e.HEADPORTRAIT="HEADPORTRAIT",e.LABEL="LABEL",e.TELEPHONE="TELEPHONE",e.BIRTHDAY="BIRTHDAY",e.MULTISELECT="MULTISELECT",e.CASCADE="CASCADE",e.SEARCH_TREE="SEARCH_TREE",e.COLOR="COLOR",e.EVALUATE="EVALUATE",e.MAP="MAP",e.VIDEO="VIDEO",e.SYSTEMFIELDS="SYSTEMFIELDS",e.PERCENTAGE="PERCENTAGE",e.HTML="HTML",e.CANDIDATE_COMPONENTS="CANDIDATE_COMPONENTS",e.TASKDATE="TASKDATE",e.AGE="AGE",e.STATUS="STATUS",e.WEBSITE="WEBSITE",e.IDCARD="IDCARD",e.COUNTDOWN="COUNTDOWN",e.DURATION="DURATION",e.COMBINATION="COMBINATION",e.PASSWORD="PASSWORD",e.QR_CODE="QR_CODE",e.CUSTOMER_NAME="CUSTOMER_NAME",e.BANK_CARD="BANK_CARD",e.SEQUENCE="SEQUENCE",e))(o||{});const n=Object.freeze(["onKeydownStart","onKeydown","onKeydownEnd","onPaste","onCopy","onCut","onCurrentChange","onRadioChange","onCheckboxChange","onCheckboxAll","onCheckboxRangeStart","onCheckboxRangeChange","onCheckboxRangeEnd","onCellClick","onCellDblclick","onCellMenu","onCellMouseenter","onCellMouseleave","onHeaderCellClick","onHeaderCellDblclick","onHeaderCellMenu","onFooterCellClick","onFooterCellDblclick","onFooterCellMenu","onSortChange","onFilterChange","onFilterVisible","onResizableChange","onToggleRowExpand","onToggleTreeExpand","onMenuClick","onEditClosed","onEditActived","onEditDisabled","onValidError","onScroll","onCustom","onOpenFnr","onFnrChange","onFnrFind","onFnrFindAll","onFnrReplace","onFnrReplaceAll","onCellAreaCopy","onCellAreaCut","onCellAreaPaste","onCellAreaMerge","onClearCellAreaMerge","onHeaderCellAreaSelection","onCellAreaSelectionStart","onCellAreaSelectionDrag","onCellAreaSelectionEnd","onCellAreaExtensionStart","onCellAreaExtensionDrag","onCellAreaExtensionEnd","onCellAreaArrowsStart","onCellAreaArrowsEnd","onActiveCellChangeStart","onActiveCellChangeEnd","onPageChange"]),E=n.map(e),l=Object.freeze(["firstRowGroup","secondRowGroup","thirdRowGroup","fourthRowGroup","fifthRowGroup","sixthRowGroup","seventhRowGroup","eighthRowGroup","ninthRowGroup","tenthRowGroup"]),C=-1/0,A=1/0;var T=(e=>(e.INPUT="INPUT",e.SEPARATE="SEPARATE",e.SELECT="SELECT",e.SELECT_MORE="SELECT_MORE",e.DATE="DATE",e.TIME="TIME",e.NUMBER="NUMBER",e.RADIO="RADIO",e.SWITCH="SWITCH",e.LEVEL_SEARCH_CASCADE="LEVEL_SEARCH_CASCADE",e))(T||{}),r=(e=>(e[e.NEGATIVE=0]="NEGATIVE",e[e.POSITIVE=1]="POSITIVE",e))(r||{}),t=(e=>(e.NEGATIVE="0",e.POSITIVE="1",e))(t||{}),a=(e=>(e.NOT_TREE="0",e.UNKNOWN="1",e.TRANSFORM_TREE_TYPE="2",e.TRANSFORM_WITH_SPAN_METHOD="3",e))(a||{}),S=(e=>(e[e.left=1]="left",e[e.right=2]="right",e))(S||{});const R=["formChange","settingClick","formClick","keyboard","rowDrag"],i=[...R,...E],I=Symbol("injectionIhoTableConfig"),D=Symbol("injectionIhoTableFieldList"),O=Symbol("InjectionIhoTableEmits"),c=Symbol("InjectionIhoTableAnnotation"),N=Symbol("InjectionIhoTableUUID"),h=Symbol("InjectionIhoTableInstance"),M=Symbol("InjectionIhoTableHandler"),b=Symbol("InjectionIhoTableEventListener"),L=Symbol("InjectionTableAsyncQueue");export{T as EDITABLE_WIDGET_TYPE,C as HIGHEST_PRIORITY,S as IHO_TABLE_FIXED_STATUS,r as IHO_TABLE_NUMBER_STATUS,t as IHO_TABLE_STRING_STATUS,a as IHO_TABLE_TREE_TYPE,R as IhoTableCustomEventNameTuple,i as IhoTableEventNameTuple,l as IhoTableRowGroupSequence,c as InjectionIhoTableAnnotation,I as InjectionIhoTableConfig,O as InjectionIhoTableEmits,b as InjectionIhoTableEventListener,D as InjectionIhoTableFieldList,M as InjectionIhoTableHandler,h as InjectionIhoTableInstance,N as InjectionIhoTableUUID,L as InjectionTableAsyncQueue,A as LOWEST_PRIORITY,n as VxeEventListenerNameList,E as VxeTableEventNameList,o as WIDGET_TYPE};
1
+ import{eventListener2EventName as e}from"../utils/index.js";var o=(e=>(e.DEFAULT="DEFAULT",e.PICTURE="PICTURE",e.FILE="FILE",e.MONEY="MONEY",e.HEADPORTRAIT="HEADPORTRAIT",e.LABEL="LABEL",e.TELEPHONE="TELEPHONE",e.BIRTHDAY="BIRTHDAY",e.MULTISELECT="MULTISELECT",e.CASCADE="CASCADE",e.SEARCH_TREE="SEARCH_TREE",e.COLOR="COLOR",e.EVALUATE="EVALUATE",e.MAP="MAP",e.VIDEO="VIDEO",e.SYSTEMFIELDS="SYSTEMFIELDS",e.PERCENTAGE="PERCENTAGE",e.HTML="HTML",e.CANDIDATE_COMPONENTS="CANDIDATE_COMPONENTS",e.TASKDATE="TASKDATE",e.AGE="AGE",e.STATUS="STATUS",e.WEBSITE="WEBSITE",e.IDCARD="IDCARD",e.COUNTDOWN="COUNTDOWN",e.DURATION="DURATION",e.COMBINATION="COMBINATION",e.PASSWORD="PASSWORD",e.QR_CODE="QR_CODE",e.CUSTOMER_NAME="CUSTOMER_NAME",e.BANK_CARD="BANK_CARD",e.SEQUENCE="SEQUENCE",e))(o||{});const n=Object.freeze(["onKeydownStart","onKeydown","onKeydownEnd","onPaste","onCopy","onCut","onCurrentChange","onRadioChange","onCheckboxChange","onCheckboxAll","onCheckboxRangeStart","onCheckboxRangeChange","onCheckboxRangeEnd","onCellClick","onCellDblclick","onCellMenu","onCellMouseenter","onCellMouseleave","onHeaderCellClick","onHeaderCellDblclick","onHeaderCellMenu","onFooterCellClick","onFooterCellDblclick","onFooterCellMenu","onSortChange","onFilterChange","onFilterVisible","onResizableChange","onToggleRowExpand","onToggleTreeExpand","onMenuClick","onEditClosed","onEditActived","onEditDisabled","onValidError","onScroll","onCustom","onOpenFnr","onFnrChange","onFnrFind","onFnrFindAll","onFnrReplace","onFnrReplaceAll","onCellAreaCopy","onCellAreaCut","onCellAreaPaste","onCellAreaMerge","onClearCellAreaMerge","onHeaderCellAreaSelection","onCellAreaSelectionStart","onCellAreaSelectionDrag","onCellAreaSelectionEnd","onCellAreaExtensionStart","onCellAreaExtensionDrag","onCellAreaExtensionEnd","onCellAreaArrowsStart","onCellAreaArrowsEnd","onActiveCellChangeStart","onActiveCellChangeEnd","onPageChange"]),E=n.map(e),l=Object.freeze(["firstRowGroup","secondRowGroup","thirdRowGroup","fourthRowGroup","fifthRowGroup","sixthRowGroup","seventhRowGroup","eighthRowGroup","ninthRowGroup","tenthRowGroup"]),C=-1/0,A=1/0;var T=(e=>(e.INPUT="INPUT",e.SEPARATE="SEPARATE",e.SELECT="SELECT",e.SELECT_MORE="SELECT_MORE",e.DATE="DATE",e.TIME="TIME",e.NUMBER="NUMBER",e.RADIO="RADIO",e.SWITCH="SWITCH",e.LEVEL_SEARCH_CASCADE="LEVEL_SEARCH_CASCADE",e))(T||{}),r=(e=>(e[e.NEGATIVE=0]="NEGATIVE",e[e.POSITIVE=1]="POSITIVE",e))(r||{}),t=(e=>(e.NEGATIVE="0",e.POSITIVE="1",e))(t||{}),a=(e=>(e.NOT_TREE="0",e.UNKNOWN="1",e.TRANSFORM_TREE_TYPE="2",e.TRANSFORM_WITH_SPAN_METHOD="3",e))(a||{}),S=(e=>(e[e.left=1]="left",e[e.right=2]="right",e))(S||{});const I=["formChange","settingClick","formClick","keyboard","rowDrag"],i=[...I,...E],R=Symbol("injectionIhoTableConfig"),D=Symbol("injectionIhoTableFieldList"),O=Symbol("InjectionIhoTableEmits"),c=Symbol("InjectionIhoTableAnnotation"),N=Symbol("InjectionIhoTableUUID"),h=Symbol("InjectionIhoTableInstance"),b=Symbol("InjectionIhoTableHandler"),M=Symbol("InjectionIhoTableGlobProps"),L=Symbol("InjectionIhoTableEventListener"),d=Symbol("InjectionTableAsyncQueue");export{T as EDITABLE_WIDGET_TYPE,C as HIGHEST_PRIORITY,S as IHO_TABLE_FIXED_STATUS,r as IHO_TABLE_NUMBER_STATUS,t as IHO_TABLE_STRING_STATUS,a as IHO_TABLE_TREE_TYPE,I as IhoTableCustomEventNameTuple,i as IhoTableEventNameTuple,l as IhoTableRowGroupSequence,c as InjectionIhoTableAnnotation,R as InjectionIhoTableConfig,O as InjectionIhoTableEmits,L as InjectionIhoTableEventListener,D as InjectionIhoTableFieldList,M as InjectionIhoTableGlobProps,b as InjectionIhoTableHandler,h as InjectionIhoTableInstance,N as InjectionIhoTableUUID,d as InjectionTableAsyncQueue,A as LOWEST_PRIORITY,n as VxeEventListenerNameList,E as VxeTableEventNameList,o as WIDGET_TYPE};
@@ -1 +1 @@
1
- import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./defaultConfigPlugin.js";import*as t from"./defaultValuePlugin.js";import*as l from"./dragScrollPlugin.js";import*as d from"./filterDaterangeRenderPlugin/index.js";import*as g from"./filterRenderPlugin/index.js";import*as o from"./filterVisibleEventPlugin.js";import*as u from"./forceArrowKeyPlugin.js";import*as a from"./headerPlugin.js";import*as P from"./highLightSetPlugin.js";import*as m from"./keyboardEventPlugin.js";import*as f from"./lowCodeFieldAdaptorPlugin.js";import*as p from"./maxCheckSizePlugin.js";import*as x from"./operationalFormPlugin.js";import*as j from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as b from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as c from"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js";import*as R from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as w from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as h from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as W from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as v from"./rendererPlugins/editableWidgets/switchRendererPlugin.js";import*as S from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as k from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as C from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as y from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as A from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as E from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as D from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as F from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as T from"./rowClickPlugin.js";import*as V from"./rowDragPlugin.js";import*as q from"./rowGroupSettingPlugin/index.js";import*as z from"./varialbleHeightPlugin.js";import*as G from"./verticalTablePlugin/index.js";import*as H from"./virtualTreePlugin.js";import*as I from"./wordbookSettingPlugin.js";import{separateMetaModule as K}from"../../../../shared/utils/index.js";var L=K(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin.ts":r,"./colorAndIconPlugin.ts":i,"./copyPastePlugin.ts":n,"./defaultConfigPlugin.ts":s,"./defaultValuePlugin.ts":t,"./dragScrollPlugin.ts":l,"./filterDaterangeRenderPlugin/index.tsx":d,"./filterRenderPlugin/index.tsx":g,"./filterVisibleEventPlugin.ts":o,"./forceArrowKeyPlugin.ts":u,"./headerPlugin.tsx":a,"./highLightSetPlugin.tsx":P,"./keyboardEventPlugin.ts":m,"./lowCodeFieldAdaptorPlugin.tsx":f,"./maxCheckSizePlugin.ts":p,"./operationalFormPlugin.ts":x,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":j,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":b,"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.tsx":c,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":R,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":w,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":h,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":W,"./rendererPlugins/editableWidgets/switchRendererPlugin.tsx":v,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":S,"./rendererPlugins/widgets/checkRendererPlugin.tsx":k,"./rendererPlugins/widgets/colorRendererPlugin.tsx":C,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":y,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":A,"./rendererPlugins/widgets/labelRendererPlugin.tsx":E,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":D,"./rendererPlugins/widgets/seqRendererPlugin.tsx":F,"./rowClickPlugin.ts":T,"./rowDragPlugin.ts":V,"./rowGroupSettingPlugin/index.ts":q,"./varialbleHeightPlugin.tsx":z,"./verticalTablePlugin/index.ts":G,"./virtualTreePlugin.ts":H,"./wordbookSettingPlugin.ts":I}));export{L as default};
1
+ import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./defaultConfigPlugin.js";import*as t from"./defaultValuePlugin.js";import*as l from"./dragScrollPlugin.js";import*as d from"./filterDaterangeRenderPlugin/index.js";import*as g from"./filterRenderPlugin/index.js";import*as o from"./filterVisibleEventPlugin.js";import*as u from"./forceArrowKeyPlugin.js";import*as a from"./headerPlugin.js";import*as P from"./highLightSetPlugin.js";import*as m from"./keyboardEventPlugin.js";import*as f from"./lowCodeFieldAdaptorPlugin.js";import*as p from"./maxCheckSizePlugin.js";import*as x from"./operationalFormPlugin.js";import*as j from"./pagerScrollPlugin/index.js";import*as c from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as b from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as R from"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js";import*as w from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as h from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as W from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as S from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as v from"./rendererPlugins/editableWidgets/switchRendererPlugin.js";import*as k from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as C from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as y from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as A from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as E from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as D from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as F from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as T from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as V from"./rowClickPlugin.js";import*as q from"./rowDragPlugin.js";import*as z from"./rowGroupSettingPlugin/index.js";import*as G from"./varialbleHeightPlugin.js";import*as H from"./verticalTablePlugin/index.js";import*as I from"./virtualTreePlugin.js";import*as K from"./wordbookSettingPlugin.js";import{separateMetaModule as L}from"../../../../shared/utils/index.js";var O=L(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin.ts":r,"./colorAndIconPlugin.ts":i,"./copyPastePlugin.ts":n,"./defaultConfigPlugin.ts":s,"./defaultValuePlugin.ts":t,"./dragScrollPlugin.ts":l,"./filterDaterangeRenderPlugin/index.tsx":d,"./filterRenderPlugin/index.tsx":g,"./filterVisibleEventPlugin.ts":o,"./forceArrowKeyPlugin.ts":u,"./headerPlugin.tsx":a,"./highLightSetPlugin.tsx":P,"./keyboardEventPlugin.ts":m,"./lowCodeFieldAdaptorPlugin.tsx":f,"./maxCheckSizePlugin.ts":p,"./operationalFormPlugin.ts":x,"./pagerScrollPlugin/index.ts":j,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":c,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":b,"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.tsx":R,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":w,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":h,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":W,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":S,"./rendererPlugins/editableWidgets/switchRendererPlugin.tsx":v,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":k,"./rendererPlugins/widgets/checkRendererPlugin.tsx":C,"./rendererPlugins/widgets/colorRendererPlugin.tsx":y,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":A,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":E,"./rendererPlugins/widgets/labelRendererPlugin.tsx":D,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":F,"./rendererPlugins/widgets/seqRendererPlugin.tsx":T,"./rowClickPlugin.ts":V,"./rowDragPlugin.ts":q,"./rowGroupSettingPlugin/index.ts":z,"./varialbleHeightPlugin.tsx":G,"./verticalTablePlugin/index.ts":H,"./virtualTreePlugin.ts":I,"./wordbookSettingPlugin.ts":K}));export{O as default};
@@ -0,0 +1 @@
1
+ export declare function pagerScrollPlugin(): import("../../../../../components/iho-table").TablePlugin;
@@ -0,0 +1 @@
1
+ import{useThrottleFn as e,useElementSize as t}from"@vueuse/core";import{h as a,ref as l,onMounted as r,onBeforeUnmount as o}from"vue";import"../../../index.js";import{LOWEST_PRIORITY as u}from"../../constants/index.js";import{isPagerScrollEnable as n,scrollStateMap as i,isTreeTable as c,pageCapacityCalc as d}from"./utils.js";import s from"./pagerScroll.vue.js";import{defineTablePlugin as p}from"../../hooks/useTablePlugin.js";function g(){const g="pagerScrollPlugin";return p({name:g,apply(p){p.configHooks.config.tap(g,((t,{$table:a})=>{if(!n(t)||!t.uuid)return t;const l=i.getItemFromUUID(t.uuid);return l.config=t,t.onWheel=e((async e=>{var r,o,u,c,d,s,p;if(!n(t)||!t.uuid)return;const g=l.tBodyWrapper;if(!g)return;if(!(g.scrollHeight>g.clientHeight))return;let f=v;if(g.scrollHeight-g.clientHeight<v&&(f=(g.scrollHeight-g.clientHeight)/2),e.deltaY<0){if(g.scrollTop<f){const{capacityInfo:e,currentPage:t=0}=l;if(!e)return;t>0&&(l.currentPage=t-1,await(null==(r=a.value)?void 0:r.loadData([])),await(null==(o=a.value)?void 0:o.loadData(e[t-1].pageData)),await(null==(u=a.value)?void 0:u.setAllTreeExpand(!0)),null==(c=a.value)||c.scrollTo(null,9999))}}else if(g.scrollHeight-g.scrollTop-g.clientHeight<f){const e=i.getItemFromUUID(t.uuid),{capacityInfo:l,currentPage:r=0}=e;if(!l)return;r<l.length-1&&(e.currentPage=r+1,await(null==(d=a.value)?void 0:d.loadData([])),await(null==(s=a.value)?void 0:s.loadData(l[r+1].pageData)),await(null==(p=a.value)?void 0:p.setAllTreeExpand(!0)))}}),500),t.columnConfig={...t.columnConfig,seqSlotFn(e){var a,r,o,u,n,i;const{rowIndex:d,seq:s}=e;if(c(t)){const e=null!=(r=null==(a=t.treeConfig)?void 0:a.parentField)?r:"parentId";return(null!=(u=null==(o=l.capacityInfo)?void 0:o.reduce(((t,a,r)=>r<l.currentPage?t+a.pageData.filter((t=>!t[e])).length:t),0))?u:0)+ +s}return(null!=(i=null==(n=l.capacityInfo)?void 0:n.reduce(((e,t,a)=>a<l.currentPage?e+t.pageData.length:e),0))?i:0)+d+1}},t.scrollY={...t.scrollY,enabled:!1},t}));const v=3;p.dataHooks.dataList.tap({name:g,stage:u},((e,t)=>{var a,l;if(!n(t)||!t.uuid)return e;const r=i.getItemFromUUID(t.uuid);return r.dataList=e,r.capacityInfo=d(e,t),r.currentPage=0,null!=(l=null==(a=r.capacityInfo[0])?void 0:a.pageData)?l:[]})),p.domInsertHooks.footer.tap(g,(e=>(e.push(a(s)),e))),p.setupHooks.setup.tap(g,(e=>{if(!e.value.uuid)return;const a=l(null),u=l(null),{height:c}=t(a),{height:d}=t(u),s=i.getItemFromUUID(e.value.uuid);s.tBodyHeight=c,s.tHeaderHeight=d,s.tBodyWrapper=a,r((()=>{n(e.value)&&e.value.uuid&&function(){const t=document.querySelector(`#${e.value.uuid} .vxe-table--main-wrapper`);if(!t)return;a.value=t.querySelector(".vxe-table--body-wrapper"),u.value=t.querySelector(".vxe-table--header-wrapper")}()})),o((()=>{e.value.uuid&&i.removeItemFromUUID(e.value.uuid)}))}))}})}export{g as pagerScrollPlugin};
@@ -0,0 +1,25 @@
1
+ import { widthAppend } from '../../../../../shared/utils';
2
+ declare const _default: import("vue").DefineComponent<{}, {
3
+ configRef: import("vue").Ref<import("../../types").IhoTableConfig>;
4
+ $table: import("vue").Ref<import("../../../..").UndefinedAble<import("vxe-table").VxeTableInstance>>;
5
+ eventListener: import("../../hooks/tapHooks/useEventHooks").IhoTableEventListener;
6
+ globProps: Partial<{
7
+ tableConfig: import("../../types").IhoTableConfig;
8
+ fieldList: import("../../types").IhoTableFieldItem[];
9
+ tableData: import("../../../..").AnyObject[];
10
+ annotation: Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>;
11
+ }>;
12
+ enable: import("vue").ComputedRef<boolean>;
13
+ scrollWrapper: import("vue").Ref<HTMLElement | undefined>;
14
+ placeholderHeight: import("vue").ComputedRef<number>;
15
+ tBodyWrapper: import("vue").Ref<HTMLElement | null>;
16
+ tHeaderWrapper: import("vue").Ref<HTMLElement | null>;
17
+ tBodyHeight: import("vue").Ref<number>;
18
+ tHeaderHeight: import("vue").Ref<number>;
19
+ calcRectInfo: () => void;
20
+ onWheel: () => Promise<void>;
21
+ isDragging: boolean;
22
+ onScroll: () => void;
23
+ widthAppend: typeof widthAppend;
24
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
25
+ export default _default;
@@ -0,0 +1 @@
1
+ import r from"./pagerScroll.vue2.js";import e from"../../../../../_virtual/_plugin-vue_export-helper.js";var l=e(r,[["__file","pagerScroll.vue"]]);export{l as default};
@@ -0,0 +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:D}=m(),S=l(h),T=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=S.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=S.tableData)?void 0:a.length)?n:0)})),j=r(null),U=r(null),{height:k}=d(j),{height:q}=d(U);a((()=>{T.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")}()})),D.addEventListener("scroll",f((({scrollTop:e})=>{var l,t;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));const C=f((async function(){var e,l,t,r,a,o;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 W=!1;g(window,"mousedown",(()=>{W=!0})),g(window,"mouseup",(()=>{W=!1}));const E=function(){W&&C()};return(e,l)=>o(T)?(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(C)&&o(C)(...e)),onScroll:E},[s("div",{class:"iho-table__pagerScrollPlaceholder",style:i({height:o(p)(o(P))})},null,4)],36)):v("v-if",!0)}});export{b as default};
@@ -0,0 +1,16 @@
1
+ import { AnyObject } from '../../../../../shared/types';
2
+ import { Ref } from 'vue';
3
+ import { IhoTableConfig } from '../../../../../components/iho-table';
4
+ export declare type ScrollState = Partial<{
5
+ dataList: AnyObject[];
6
+ capacityInfo: {
7
+ pageData: AnyObject[];
8
+ percent: number;
9
+ }[];
10
+ currentPage: number;
11
+ config: IhoTableConfig;
12
+ tBodyHeight: Ref<number>;
13
+ tHeaderHeight: Ref<number>;
14
+ scrollPending: boolean;
15
+ tBodyWrapper: Ref<HTMLElement | null>;
16
+ }>;
@@ -0,0 +1,51 @@
1
+ import { AnyObject } from '../../../../../shared/types';
2
+ import { IhoTableConfig } from '../../../../../components/iho-table';
3
+ export declare const scrollStateMap: {
4
+ uuidMap: Map<string, Partial<{
5
+ dataList: AnyObject[];
6
+ capacityInfo: {
7
+ pageData: AnyObject[];
8
+ percent: number;
9
+ }[];
10
+ currentPage: number;
11
+ config: IhoTableConfig;
12
+ tBodyHeight: import("vue").Ref<number>;
13
+ tHeaderHeight: import("vue").Ref<number>;
14
+ scrollPending: boolean;
15
+ tBodyWrapper: import("vue").Ref<HTMLElement | null>;
16
+ }>>;
17
+ getItemFromUUID: (uuid: string) => Partial<{
18
+ dataList: AnyObject[];
19
+ capacityInfo: {
20
+ pageData: AnyObject[];
21
+ percent: number;
22
+ }[];
23
+ currentPage: number;
24
+ config: IhoTableConfig;
25
+ tBodyHeight: import("vue").Ref<number>;
26
+ tHeaderHeight: import("vue").Ref<number>;
27
+ scrollPending: boolean;
28
+ tBodyWrapper: import("vue").Ref<HTMLElement | null>;
29
+ }>;
30
+ setItemFromUUID: (uuid: string, value: Partial<{
31
+ dataList: AnyObject[];
32
+ capacityInfo: {
33
+ pageData: AnyObject[];
34
+ percent: number;
35
+ }[];
36
+ currentPage: number;
37
+ config: IhoTableConfig;
38
+ tBodyHeight: import("vue").Ref<number>;
39
+ tHeaderHeight: import("vue").Ref<number>;
40
+ scrollPending: boolean;
41
+ tBodyWrapper: import("vue").Ref<HTMLElement | null>;
42
+ }>) => void;
43
+ removeItemFromUUID: (uuid: string) => void;
44
+ };
45
+ export declare function isPagerScrollEnable(config: IhoTableConfig): boolean;
46
+ export declare function isParentRow(config: IhoTableConfig, row: AnyObject): any;
47
+ export declare function isTreeTable(config: IhoTableConfig): boolean;
48
+ export declare function pageCapacityCalc(dataList: AnyObject[], config: IhoTableConfig): {
49
+ pageData: AnyObject[];
50
+ percent: number;
51
+ }[];
@@ -0,0 +1 @@
1
+ import{isArray as e}from"lodash-es";import{useUUIDMap as n}from"../../utils/index.js";const t=n((()=>({})));function l(e){var n;return!!(null==(n=e.pagerScroll)?void 0:n.enable)}function r(n,t){var l,r;const i=(null==(l=n.treeConfig)?void 0:l.children)||"children",h=(null==(r=n.treeConfig)?void 0:r.hasChild)||"hasChild";return e(t[i])||t[h]}function i(e){return[2,3,"2","3"].includes(e.isTree)}function h(n,t){var l,r;const h=(null==(l=t.pagerScroll)?void 0:l.capacity)||40,o=(null==(r=t.treeConfig)?void 0:r.children)||"children";if(!i(t))return n.reduce(((e,n)=>{let t=e[e.length-1];return(!t||t.length>=h)&&(t=[],e.push(t)),t.push(n),e}),[]).map((e=>({pageData:e,percent:e.length/n.length})));const u=[];for(let t=0;t<n.length;t++){const l=n[t];let r=u[u.length-1];(!r||r.length>=h)&&(r=[],u.push(r)),e(l[o])?(r.push(l),r.push(...n.slice(t+1,t+1+l[o].length)),t+=l[o].length):r.push(l)}return u.map((e=>({pageData:e,percent:e.length/n.length})))}export{l as isPagerScrollEnable,r as isParentRow,i as isTreeTable,h as pageCapacityCalc,t as scrollStateMap};
@@ -1 +1 @@
1
- import{isFunction as e}from"lodash-es";import{basicParamsConvert as r,isVerticalHeader as o,getHeaderDepthByField as a}from"../utils.js";import{useUUIDMap as t}from"../../../../utils/index.js";const s=(s,i,l)=>{s.config.tap("vertical-rowClassName",(s=>{const n=l(s.uuid);if(!n)return s;const{originalTableConfig:u}=n;if(!u||!u.rowClassName)return s;const m=t((()=>[]),!1);return i.dataHooks.data.tap("vertical-rowClassName",((e,r,{index:o})=>{r.uuid&&(m.getItemFromUUID(r.uuid)[o]=e)})),i.setupHooks.setup.tap("vertical-rowClassName",(e=>{e.value.uuid&&m.removeItemFromUUID(e.value.uuid)})),s.cellClassName=o=>{const a=r(o,n);if("header"===a.type)return;const{rowClassName:t}=u;return e(t)?t(a):t},s.headerCellClassName=r=>{var t;if("header"===(o(r.column.field)?"header":"body"))return;const s={},i=null==(t=n.originalTableConfig)?void 0:t.uuid;if(i){const e=a(r.column.field);s.row=m.getItemFromUUID(i)[e],s.rowIndex=s.$rowIndex=s._rowIndex=e}const{rowClassName:l}=u;return e(l)?l(s):l},s}))};export{s as useRowClassName};
1
+ import{isFunction as e}from"lodash-es";import{onBeforeUnmount as r}from"vue";import{basicParamsConvert as o,isVerticalHeader as t,getHeaderDepthByField as a}from"../utils.js";import{useUUIDMap as s}from"../../../../utils/index.js";const i=(i,l,n)=>{i.config.tap("vertical-rowClassName",(i=>{const u=n(i.uuid);if(!u)return i;const{originalTableConfig:m}=u;if(!m||!m.rowClassName)return i;const d=s((()=>[]),!1);return l.dataHooks.data.tap("vertical-rowClassName",((e,r,{index:o})=>{r.uuid&&(d.getItemFromUUID(r.uuid)[o]=e)})),l.setupHooks.setup.tap("vertical-rowClassName",(e=>{r((()=>{e.value.uuid&&d.removeItemFromUUID(e.value.uuid)}))})),i.cellClassName=r=>{const t=o(r,u);if("header"===t.type)return;const{rowClassName:a}=m;return e(a)?a(t):a},i.headerCellClassName=r=>{var o;if("header"===(t(r.column.field)?"header":"body"))return;const s={},i=null==(o=u.originalTableConfig)?void 0:o.uuid;if(i){const e=a(r.column.field);s.row=d.getItemFromUUID(i)[e],s.rowIndex=s.$rowIndex=s._rowIndex=e}const{rowClassName:l}=m;return e(l)?l(s):l},i}))};export{i as useRowClassName};
@@ -89,6 +89,10 @@ export declare type IhoTableConfig = VxeTableProps & Partial<{
89
89
  bodyWidth?: number | ((index: number) => number);
90
90
  bodyMinWidth?: number | ((index: number) => number);
91
91
  };
92
+ pagerScroll: Partial<{
93
+ enable: boolean;
94
+ capacity: number;
95
+ }>;
92
96
  [K: string]: unknown;
93
97
  }> &
94
98
  /**
@@ -13,6 +13,7 @@ export declare function getRowHeight(): number;
13
13
  export declare function eventListener2EventName<T extends string>(eventListenerName: T): EventListenerToEventName<T>;
14
14
  export declare function eventName2EventListener<T extends string>(eventName: T): EventNameToEventListener<T>;
15
15
  export declare function useUUIDMap<T>(creator: () => T, isReactive?: boolean): {
16
+ uuidMap: Map<string, T>;
16
17
  getItemFromUUID: (uuid: string) => T;
17
18
  setItemFromUUID: (uuid: string, value: T) => void;
18
19
  removeItemFromUUID: (uuid: string) => void;
@@ -1 +1 @@
1
- import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as o}from"vue";import{jsonParse as i}from"../../../../shared/utils/index.js";import{promiseTimeout as l}from"@vueuse/shared";import{parse as u,isValid as a,compareDesc as c}from"date-fns";import{isNumber as d,isFunction as s,isString as f,isObject as p,isArray as m}from"lodash-es";import{InjectionIhoTableConfig as v,InjectionIhoTableEmits as h,IHO_TABLE_STRING_STATUS as I,IHO_TABLE_NUMBER_STATUS as g,IHO_TABLE_TREE_TYPE as E,EDITABLE_WIDGET_TYPE as T,InjectionIhoTableUUID as w}from"../constants/index.js";import{getSeparateInfo as R}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function C(e){return console.warn(`[IhoTable]: ${e}`)}const S=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function F(){var e,t,r;const o=n(v);return o||C("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(e=null==o?void 0:o.value)?void 0:e.rowConfig)?void 0:t.height)?r:32}function P(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function D(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function b(n,t=!0){const r=t?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||n()).get(e)},setItemFromUUID:function(e,n){r.set(e,n)},removeItemFromUUID:function(e){r.delete(e)}}}async function A(e,n,r,o,i=2){const u=function(){var i;const l=null==(i=t(o))?void 0:i.getColumnByField(e.field);if(!l)return;const u=x(l);return u?s(u.separateWidth)?u.separateWidth({column:l,row:n,rowIndex:r,$table:t(o)}):d(u.separateWidth)?u.separateWidth:l.renderWidth:l.renderWidth}();return d(u)&&u>0?u:i<=0?function(){const n=+e.colWidth;return d(n)?n:64}():(await l(0),A(e,n,r,o,i-1))}function O(e){const o=n(h);function i(){var n;const r=t(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(n=r.column.editRender)?void 0:n.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function l(e={}){o("formChange",{...i(),...r(e)})}function u(e={}){o("formClick",{...i(),...r(e)})}return{emitFormChange:function(){l()},emitFormClick:function(){u()},emitFormChangeWithParams:l,emitFormClickWithParams:u}}function x(e){var n;return null==(n=e.editRender)?void 0:n.props}const $=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:t,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(t[r.field]);const i=n(w),l=R(i,t);if(!l)return c(t[r.field]);const{originalData:u=t,isLastRow:a}=l;return c(a?u[r.field]:null);function c(e){return[o("span",{title:j(r,e),class:"iho-table__colorAndIcon"},[e])]}}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...O(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){if(U(e))return!0;let n=e.fieldSetting;return f(n)&&(n=i(n||"")),p(n)&&((t=n).notParticipatingSearch!==I.POSITIVE&&"manual"===(null==(r=t.mapping)?void 0:r.type));var t,r},hasDateFiler(e){var n;return null==(n=null==e?void 0:e.filterSetting)?void 0:n.daterange},hasTitlePrefix(e){var n,t;return e&&((null==(n=e.titlePrefix)?void 0:n.content)||(null==(t=e.titlePrefix)?void 0:t.useHTML))}}),N=Object.freeze({isPositive:e=>e===g.POSITIVE||e===I.POSITIVE,isNegative:e=>e===g.NEGATIVE||e===I.NEGATIVE,notPositive:e=>e!==g.POSITIVE&&e!==I.POSITIVE,notNegative:e=>e!==g.NEGATIVE&&e!==I.NEGATIVE});function H(e){return[E.TRANSFORM_WITH_SPAN_METHOD,E.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function V(e){return f(e)&&!!e.match(/^###\{[^{}]+}$/)}function W(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function _(e,n){if(e.$__SEPARATE||!n.editRender||!n.editRender.props)return e[n.field];const{fieldSetting:t}=n.editRender.props;if(!f(t))return e[n.field];const{mergedFeildExpression:r}=i(t);return r&&f(r)?r.replace(/#{(.+?)}/g,(function(n,t){let r=t?e[t.trim()]:null;V(r)&&(r=W(r).change_text);return r||(null==r?"--":r)})):e[n.field]}const y=["SEARCH","SELECT","RADIO","CHECKBOX"];function U(e){return e.notParticipatingSearch===g.NEGATIVE&&y.includes(S.getCellType(e))&&m(e.options)&&e.options.length}function j(e,n=""){return"tooltip"!==e.showOverflow&&f(n)?n:""}function M(e,n){var r,o,i;n=t(n)||"";const l=null!=(o=null==(r=e.editRender)?void 0:r.props)?o:{},c=u(n,(null==(i=null==l?void 0:l.componentProps)?void 0:i.valueFormat)||"HH:mm",new Date);return!a(c)}function G(e,n,r){var o,i;const l=null!=(i=null==(o=e.editRender)?void 0:o.props)?i:{};return r=t(r)||"",!a(new Date(r))||f(l.connectField)&&n[l.connectField]&&(l.isStartDate&&c(new Date(r),new Date(n[l.connectField]))<0||l.isEndDate&&c(new Date(r),new Date(n[l.connectField]))>0)}function L(e){var n,t;return(!0===e.variableHeight||"1"===e.variableHeight)&&(null!=(t=null==(n=e.editRender)?void 0:n.name)?t:S.getCellType(e))!==T.SEPARATE}function k(e){const n=e.internalData.tableFullColumn;return!!m(n)&&n.some((e=>{var n,t;return L(null!=(t=null==(n=e.editRender)?void 0:n.props)?t:{})}))}export{$ as IhoTableRenderHelper,N as IhoTableStatusHelper,S as IhoTableUtils,C as IhoTableWarn,P as eventListener2EventName,D as eventName2EventListener,A as getColumnRenderWidth,x as getLowCodeFieldFromField,F as getRowHeight,j as getTitle,U as isCompatibleColumn,G as isInvalidDate,M as isInvalidTime,V as isRichContent,H as isTransformTreeType,L as isVariableHeightColumn,k as isVariableHeightTable,_ as parseMergeField,W as parseRichContent,O as useIhoTableFormEvent,b as useUUIDMap};
1
+ import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as o}from"vue";import{jsonParse as i}from"../../../../shared/utils/index.js";import{promiseTimeout as l}from"@vueuse/shared";import{parse as u,isValid as a,compareDesc as c}from"date-fns";import{isNumber as d,isFunction as s,isString as f,isObject as p,isArray as m}from"lodash-es";import{InjectionIhoTableConfig as v,InjectionIhoTableEmits as h,IHO_TABLE_STRING_STATUS as I,IHO_TABLE_NUMBER_STATUS as g,IHO_TABLE_TREE_TYPE as E,EDITABLE_WIDGET_TYPE as T,InjectionIhoTableUUID as w}from"../constants/index.js";import{getSeparateInfo as R}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function C(e){return console.warn(`[IhoTable]: ${e}`)}const S=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function F(){var e,t,r;const o=n(v);return o||C("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(e=null==o?void 0:o.value)?void 0:e.rowConfig)?void 0:t.height)?r:32}function P(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function D(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function b(n,t=!0){const r=t?e(new Map):new Map;return{uuidMap:r,getItemFromUUID:function(e){return r.get(e)||r.set(e,n()),r.get(e)},setItemFromUUID:function(e,n){r.set(e,n)},removeItemFromUUID:function(e){r.delete(e)}}}async function A(e,n,r,o,i=2){const u=function(){var i;const l=null==(i=t(o))?void 0:i.getColumnByField(e.field);if(!l)return;const u=x(l);return u?s(u.separateWidth)?u.separateWidth({column:l,row:n,rowIndex:r,$table:t(o)}):d(u.separateWidth)?u.separateWidth:l.renderWidth:l.renderWidth}();return d(u)&&u>0?u:i<=0?function(){const n=+e.colWidth;return d(n)?n:64}():(await l(0),A(e,n,r,o,i-1))}function O(e){const o=n(h);function i(){var n;const r=t(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(n=r.column.editRender)?void 0:n.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function l(e={}){o("formChange",{...i(),...r(e)})}function u(e={}){o("formClick",{...i(),...r(e)})}return{emitFormChange:function(){l()},emitFormClick:function(){u()},emitFormChangeWithParams:l,emitFormClickWithParams:u}}function x(e){var n;return null==(n=e.editRender)?void 0:n.props}const $=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:t,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(t[r.field]);const i=n(w),l=R(i,t);if(!l)return c(t[r.field]);const{originalData:u=t,isLastRow:a}=l;return c(a?u[r.field]:null);function c(e){return[o("span",{title:U(r,e),class:"iho-table__colorAndIcon"},[e])]}}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...O(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){if(M(e))return!0;let n=e.fieldSetting;return f(n)&&(n=i(n||"")),p(n)&&((t=n).notParticipatingSearch!==I.POSITIVE&&"manual"===(null==(r=t.mapping)?void 0:r.type));var t,r},hasDateFiler(e){var n;return null==(n=null==e?void 0:e.filterSetting)?void 0:n.daterange},hasTitlePrefix(e){var n,t;return e&&((null==(n=e.titlePrefix)?void 0:n.content)||(null==(t=e.titlePrefix)?void 0:t.useHTML))}}),N=Object.freeze({isPositive:e=>e===g.POSITIVE||e===I.POSITIVE,isNegative:e=>e===g.NEGATIVE||e===I.NEGATIVE,notPositive:e=>e!==g.POSITIVE&&e!==I.POSITIVE,notNegative:e=>e!==g.NEGATIVE&&e!==I.NEGATIVE});function H(e){return[E.TRANSFORM_WITH_SPAN_METHOD,E.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function V(e){return f(e)&&!!e.match(/^###\{[^{}]+}$/)}function W(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function _(e,n){if(e.$__SEPARATE||!n.editRender||!n.editRender.props)return e[n.field];const{fieldSetting:t}=n.editRender.props;if(!f(t))return e[n.field];const{mergedFeildExpression:r}=i(t);return r&&f(r)?r.replace(/#{(.+?)}/g,(function(n,t){let r=t?e[t.trim()]:null;V(r)&&(r=W(r).change_text);return r||(null==r?"--":r)})):e[n.field]}const y=["SEARCH","SELECT","RADIO","CHECKBOX"];function M(e){return e.notParticipatingSearch===g.NEGATIVE&&y.includes(S.getCellType(e))&&m(e.options)&&e.options.length}function U(e,n=""){return"tooltip"!==e.showOverflow&&f(n)?n:""}function j(e,n){var r,o,i;n=t(n)||"";const l=null!=(o=null==(r=e.editRender)?void 0:r.props)?o:{},c=u(n,(null==(i=null==l?void 0:l.componentProps)?void 0:i.valueFormat)||"HH:mm",new Date);return!a(c)}function G(e,n,r){var o,i;const l=null!=(i=null==(o=e.editRender)?void 0:o.props)?i:{};return r=t(r)||"",!a(new Date(r))||f(l.connectField)&&n[l.connectField]&&(l.isStartDate&&c(new Date(r),new Date(n[l.connectField]))<0||l.isEndDate&&c(new Date(r),new Date(n[l.connectField]))>0)}function L(e){var n,t;return(!0===e.variableHeight||"1"===e.variableHeight)&&(null!=(t=null==(n=e.editRender)?void 0:n.name)?t:S.getCellType(e))!==T.SEPARATE}function k(e){const n=e.internalData.tableFullColumn;return!!m(n)&&n.some((e=>{var n,t;return L(null!=(t=null==(n=e.editRender)?void 0:n.props)?t:{})}))}export{$ as IhoTableRenderHelper,N as IhoTableStatusHelper,S as IhoTableUtils,C as IhoTableWarn,P as eventListener2EventName,D as eventName2EventListener,A as getColumnRenderWidth,x as getLowCodeFieldFromField,F as getRowHeight,U as getTitle,M as isCompatibleColumn,G as isInvalidDate,j as isInvalidTime,V as isRichContent,H as isTransformTreeType,L as isVariableHeightColumn,k as isVariableHeightTable,_ as parseMergeField,W as parseRichContent,O as useIhoTableFormEvent,b as useUUIDMap};