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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  2. package/es/components/callback/src/components/render/popupMaps.d.ts +0 -4
  3. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +1 -0
  4. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  5. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  6. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  7. package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
  8. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  9. package/es/components/field-set/src/components/Row.vue.d.ts +1 -1
  10. package/es/components/form-config/index.d.ts +0 -8
  11. package/es/components/form-config/src/FormConfig.vue.d.ts +0 -8
  12. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +0 -4
  13. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +0 -4
  14. package/es/components/form-render/index.d.ts +0 -4
  15. package/es/components/form-render/src/FormRender.vue.d.ts +0 -4
  16. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  17. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +0 -4
  18. package/es/components/iho-table/src/plugins/pagerScrollPlugin/index.js +1 -1
  19. package/es/components/iho-table/src/plugins/stickyFixedPlugin.js +1 -1
  20. package/es/components/iho-table/style/index.css +1 -1
  21. package/es/components/index.css +1 -1
  22. package/es/components/info-header/index.d.ts +0 -8
  23. package/es/components/info-header/src/InfoHeader.vue.d.ts +0 -8
  24. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +0 -4
  25. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +0 -4
  26. package/es/components/shortcut-setter/index.d.ts +0 -4
  27. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +0 -4
  28. package/es/shared/package.json.js +1 -1
  29. package/package.json +2 -2
@@ -1 +1 @@
1
- import{defineComponent as t,inject as e,ref as n,reactive as r,computed as i,onMounted as a,watch as l,openBlock as o,createElementBlock as s,Fragment as u,createElementVNode as c,createCommentVNode as d,createVNode as p,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 F,NPopover as j,NCheckbox as M,NDivider as N}from"naive-ui";import{PrintOutline as x,SettingsOutline as E,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"},rt=["onClick"],it={class:"newprint-button-poperOver"},at=["onMouseenter"],lt={class:"print-lite"},ot=["onClick"];var st=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:[],defaultFormatId:""})}},setup(t,{expose:st}){const ut=t,ct=[{label:"分割线",key:"divider"},{label:"外显设置",key:"outSetting"}],dt=C();let pt;const mt=e(z),yt=n(""),vt=r({spinning:!1,visible:!1,formatList:[],templateParams:[],printParams:[],originParams:{},currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1,curPrintParamList:[]});let ft=n([]),gt=n([{label:ut.pdfLoadText,key:"downloadPdf"},{label:ut.previewText,key:"previewText"},{label:ut.formatEditText,key:"formatEditText"},{label:"重置打印机",key:"resetPrinter"}]);const kt=r({oneMouseType:"",oneClickType:"",twoMouseType:""}),ht=r({oneShow:!1,isOperation:!1,isOutSetting:!1}),bt=n([]),wt=n([]),Pt=i((()=>{if(!vt.currentFormatId)return{};let t=vt.currentFormatId;return vt.formatList.find((e=>e.id===t))}));i((()=>{var t;return(null==(t=Pt.value)?void 0:t.name)||"格式选择"}));const Ot=i((()=>{let t=vt.formatList.find((t=>t.id===vt.currentFormatId));return null==t?void 0:t.templateId})),St=i((()=>{let t=vt.formatList.find((t=>t.id===vt.currentFormatId));return null==t?void 0:t.number})),Ct=i((()=>{var t;return null==(t=ut.newPrintSetting)?void 0:t.isShowPrintAll})),It=i((()=>{var t;return null==(t=ut.newPrintSetting)?void 0:t.isShowOutSetting})),Tt=i((()=>{var t;return(null==(t=ut.newPrintSetting)?void 0:t.customProps)||{}})),Lt=i((()=>{var t;return(null==(t=ut.newPrintSetting)?void 0:t.defaultFormatId)||""})),Ft=i((()=>{const t=ct.map((t=>t.key));return ft.value.filter((e=>!t.includes(e.key)))})),jt=i({get:()=>Ft.value.every((t=>t.selected)),set(t){Ft.value.forEach((e=>{e.selected=t}))}}),Mt=async()=>{var t,e;(null==(e=null==(t=ut.newPrintSetting)?void 0:t.outerPrintKeys)?void 0:e.length)||await re(),ht.oneShow=!0},Nt=async t=>{if(ut.directPrint){if(vt.spinning)return;return"button"===t?void(Ct.value?await ae():Lt.value?async function(t){await re(!1);const e=bt.value.find((e=>e.key==t));e&&Ht(e.templateCode,e.templateId,e.key,!1)}(Lt.value):Mt()):Mt()}return Mt()},xt=(t,e)=>{kt[t]=e},Et=()=>{bt.value=ft.value.filter((t=>!t.selected)),wt.value=Ft.value.filter((t=>t.selected)),Dt("oneShow"),Dt("isOutSetting"),mt("saveOuterPrint",wt.value)},_t=t=>{ht[t]=!0},Dt=t=>{kt.oneClickType="",ht[t]=!1,"isOutSetting"==t&&(ht.isOutSetting=!1)},zt=(t,e)=>{Bt(!1);let n={type:e,formatId:vt.currentFormatId,templateId:(null==t?void 0:t.templateId)||Ot.value,templateCode:(null==t?void 0:t.templateCode)||St.value};mt("success",t,n)},Jt=t=>{Bt(!1),mt("error",t),S(t)&&"notInstalledApp"===t.type&&dt.error(t.message)},Ut=t=>{Bt(!1),mt("cancel",t)},Vt=t=>{mt("error",{message:"前置条件执行错误",type:t,preExecution:!0})},At=()=>JSON.stringify({...ut.token?{token:ut.token}:{}}),Kt=(t=[],e)=>{var n,r;let i={},a={};if((null==(n=vt.templateParams[e].customizeDataset)?void 0:n.length)>0){const e=(null==(r=Object.keys(t[0].datasetData||{}))?void 0:r[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 i=Object.assign({},JSON.parse(At()),Tt.value,a),JSON.stringify(i)},Bt=(t,e)=>{if(vt.isClickOuterPrint){if(t&&e){const n=wt.value.find((t=>t.key==e));return void(n&&(n.isLoading=t))}wt.value.forEach((t=>{t.isLoading=!1}))}else vt.spinning=t},Rt=()=>vt.isClickOuterPrint?wt.value.some((t=>t.isLoading)):vt.spinning,Ht=(t,e,n,r)=>{const i=vt.printParams[t];if(!i)return;vt.isClickOuterPrint=r,vt.currentFormatId=n;const a=vt.originParams[t]||[];qt(i,t,e,n,a)},qt=async(t=[],e,n,r,i=[],a)=>{let l=t.length;const o=async t=>{try{--l<=0&&zt(t,"print")}catch(t){console.log("error",t)}};ut.showLoading&&Rt()&&!a||(Bt(!0,r),ut.prevFn("print").then((()=>{vt.curPrintParamList=t;const a={formatId:r,templateId:n,authorizationKey:yt.value,printdlgshow:ut.printdlgshow,signature:ut.signature,copies:ut.printCopies};if("MULTI"===ut.strategy)for(let e=0;e<t.length;e++){e>0&&(a.printdlgshow="0");const n=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,t[e]));pt.printDirect({...a,params:n},o,Jt,Ut)}else pt.printDirect({...a,params:Kt(t,e)},(t=>{t.params=i,t.templateCode=e,t.templateId=n,zt(t,"print")}),Jt,Ut)})).catch((()=>{Vt("print"),Bt(!1)})).finally((()=>{vt.visible=!1})))},Gt=async(t,{templateCode:e,templateId:n,key:r},i)=>{const a=vt.printParams[e];if(a)switch(vt.isClickOuterPrint=i,vt.currentFormatId=r,t){case"previewText":(async(t=[],e,n,r)=>{ut.showLoading&&Rt()||(Bt(!0,r),ut.prevFn("preview").then((()=>{vt.curPrintParamList=t;const i=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,t[0])),a="MULTI"===ut.strategy?i:Kt(t,e),l={formatId:r,templateId:n,authorizationKey:yt.value,params:a,btnprint:ut.btnprint,signature:ut.signature};pt.preview(l,(t=>{zt(t,"preview")}),Jt)})).catch((()=>{Vt("preview"),Bt(!1)})).finally((()=>{vt.visible=!1})))})(a,e,n,r);break;case"formatEditText":((t=[],e,n,r)=>{ut.showLoading&&Rt()||(Bt(!0,r),ut.prevFn("edit").then((()=>{vt.curPrintParamList=t,vt.currentFormatId=r,vt.identityVerification.visible=!0})).catch((()=>{Vt("edit")})).finally((()=>{Bt(!1)})))})(a,0,0,r);break;case"downloadPdf":(async(t=[],e,n,r)=>{ut.showLoading&&Rt()||(Bt(!0,r),ut.prevFn("download").then((()=>{vt.curPrintParamList=t;const i=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,t[0])),a="MULTI"===ut.strategy?i:Kt(t,e),l={formatId:r,templateId:n,authorizationKey:yt.value,print:{print:"1",type:"1"},params:a,signature:ut.signature};pt.downloadPDF(l,(t=>zt(t,"preview")),Jt)})).catch((()=>{Vt("download"),Bt(!1)})).finally((()=>{vt.visible=!1})))})(a,e,n,r);break;case"resetPrinter":(async(t=[],e,n,r)=>{if(ut.showLoading&&Rt())return;Bt(!0,r);const i=await pt.resetPrinter(r);Bt(!1),"success"!=(null==i?void 0:i.result)?dt.warning("重置打印机失败"):dt.success(i.message||"重置打印机成功")})(a,0,0,r)}},Yt=()=>{},$t=(t,e=[])=>{let n={};return(e=e||[]).forEach((e=>{n=Object.assign({},Zt(n,e,t))})),n},Qt=(t,e=[])=>{let n={};return(e=e||[]).forEach((e=>{n=Object.assign({},te(n,e,t))})),n},Wt=(t,e,n)=>{const r={};return e.forEach((e=>{let i=((t,e)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let r=e;return Object.keys(n).includes(t.type)&&e&&e instanceof Date&&(r=A(e,n[t.type])),(null==t?void 0:t.defaultValue)||r})(e,t[e[n]]);t[e[n]]&&i&&(r[e[n]]=i)})),r},Xt=({customizeDataset:t=[],param:e=[]},n={})=>{let r={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;r.datasetData||(r.datasetData={}),r.datasetData[t.name]=JSON.stringify(Wt(n,e,"fieldName"))})),r=Object.assign({},r,Wt(n,e,"key")),r},Zt=(t,e,n)=>{if(e.templateNumbers){for(let r=0;r<e.templateNumbers.length;r++){const i=e.templateNumbers[r],a=n[i];if(!a)return dt.error("当前勾选的数据没有匹配的模板"),t;t[i]||(t[i]=[]),t[i].push(Xt(a,e))}return t}const r=Object.keys(n);for(let i=0;i<r.length;i++){const a=r[i],l=n[a];if(!l)return dt.error("当前勾选的数据没有匹配的模板"),t;t[a]||(t[a]=[]),t[a].push(Xt(l,e))}return t},te=(t,e,n)=>{if(e.templateNumbers){for(let r=0;r<e.templateNumbers.length;r++){const i=e.templateNumbers[r];if(!n[i])return dt.error("当前勾选的数据没有匹配的模板"),t;t[i]||(t[i]=[]),t[i].push(e)}return t}const r=Object.keys(n);for(let i=0;i<r.length;i++){const a=r[i];if(!n[a])return dt.error("当前勾选的数据没有匹配的模板"),t;t[a]||(t[a]=[]),t[a].push(e)}return t},ee=async t=>{vt.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 r=vt.formatList.map((t=>({templateCode:t.number,templateId:t.templateId,label:t.name,key:t.id,selected:!1,isLoading:!1})));ft.value.unshift(...r),It.value&&ft.value.push(...ct),(null==(e=null==(t=ut.newPrintSetting)?void 0:t.outerPrintKeys)?void 0:e.length)>0&&(ft.value.forEach((t=>{var e;(null==(e=ut.newPrintSetting)?void 0:e.outerPrintKeys.includes(t.key))&&(t.selected=!0)})),wt.value=ft.value.filter((t=>t.selected))),bt.value=ft.value.filter((t=>!t.selected)),ut.hideButtons.length>0&&(gt.value=gt.value.filter((t=>!ut.hideButtons.includes(t.key))));const i=sessionStorage.getItem("portal");if(i){const t=JSON.parse(i),e=(null==(n=null==t?void 0:t.user)?void 0:n.currentRoleResourceObj)||{},r=Object.keys(e);r.includes("RY7.2.21.1.M2.G94181E")||(gt.value=gt.value.filter((t=>"downloadPdf"!=t.key))),r.includes("RY7.2.21.1.M2.G33633A")||(gt.value=gt.value.filter((t=>"formatEditText"!=t.key)))}})(),vt.templateParams=(t=>{let e={};return t&&t.forEach((t=>{if(!t.templateConfig)return!1;e[t.number]=t.templateConfig})),e})(t.obj),vt.printParams=$t(vt.templateParams,ut.params),vt.originParams=Qt(vt.templateParams,ut.params)},ne=async()=>{var t;if(vt.isInited)return!0;vt.isInited=!0,vt.spinning=!0,(()=>{if(pt)return!1;pt=new J})();const e=await ut.queryPrintFormatByNumber();return await ee(e),(null==(t=e.obj)?void 0:t.length)>0&&(yt.value=e.obj[0].authorizationKey||""),vt.spinning=!1,!0},re=async(t=!0)=>{if(await ut.clickPrevFn()){if(!vt.visible){if(!await ne())return!1}t&&(vt.visible=!vt.visible)}},ie=t=>{if(vt.identityVerification.visible=!1,U(vt.currentFormatId))return zt(null,"edit");const e=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,vt.curPrintParamList[0])),n="MULTI"===ut.strategy?e:Kt(vt.curPrintParamList,St.value),r={formatId:vt.currentFormatId,templateId:Ot.value,params:n,token:t};pt.editPrintFormat(r,(t=>{zt(t,"edit")}),Jt)};async function ae(){await re(!1),(()=>{const t=Object.keys(vt.printParams);vt.isClickOuterPrint=!1;const e=vt.originParams;for(let n=0;n<t.length;n++){const r=t[n],i=vt.printParams[r],a=e[r]||[],l=vt.formatList.filter((t=>t.number==r));l&&l.length>0&&l.forEach((t=>{vt.currentFormatId=t.id,qt(i,t.number,t.templateId,t.id,a,!0)}))}})()}return a((()=>{vt.isInited=!1})),l((()=>ut.params),(t=>{Object.keys(vt.templateParams).length>0&&(vt.printParams=$t(vt.templateParams,ut.params),vt.originParams=Qt(vt.templateParams,ut.params))}),{deep:!0}),l((()=>{var t;return null==(t=ut.newPrintSetting)?void 0:t.outerPrintKeys}),(async t=>{(null==t?void 0:t.length)>0&&await re(!1)}),{deep:!0,immediate:!0}),st({directPrint:ae}),(e,n)=>(o(),s(u,null,[c("div",K,[d(" 外显按钮集合 "),p(m(I),null,{default:y((()=>[(o(!0),s(u,null,v(wt.value,(e=>{return o(),f(m(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:Yt,options:(n=m(gt),r=e,vt.printParams[r.templateCode]?n:[]),onSelect:t=>Gt(t,e,!0)},{default:y((()=>[p(m(L),{disabled:!vt.printParams[e.templateCode],loading:t.showLoading&&e.isLoading,onClick:t=>Ht(e.templateCode,e.templateId,e.key,!0)},{icon:y((()=>[p(m(F),{component:m(x),size:"18"},null,8,["component"])])),default:y((()=>[g(" "+k(e.label),1)])),_:2},1032,["disabled","loading","onClick"])])),_:2},1032,["options","onSelect"]);var n,r})),128))])),_:1}),d(' <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> '),d(" 外显设置按钮 "),wt.value.length>0&&wt.value.length==m(Ft).length&&m(It)?(o(),f(m(j),{key:0,trigger:"click","show-arrow":!1,show:ht.isOutSetting,onClickoutside:n[2]||(n[2]=t=>Dt("isOutSetting"))},{trigger:y((()=>[p(m(L),{onClick:n[0]||(n[0]=t=>_t("isOutSetting"))},{default:y((()=>[B,p(m(F),{style:{"margin-left":"8px"},component:m(E),size:"18"},null,8,["component"])])),_:1})])),default:y((()=>[c("div",R,[(o(!0),s(u,null,v(m(Ft),(t=>(o(),s("div",{class:"print-li",key:t.key},[c("div",H,[c("span",q,k(t.label),1),p(m(M),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:y((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",G,[p(m(N)),c("div",Y,[p(m(L),{type:"primary",size:"small",onClick:Et},{default:y((()=>[g("保存")])),_:1}),p(m(M),{checked:m(jt),"onUpdate:checked":n[1]||(n[1]=t=>h(jt)?jt.value=t:null)},{default:y((()=>[g("全选")])),_:1},8,["checked"])])])])])),_:1},8,["show"])):(o(),s(u,{key:1},[d(" 打印全部按钮 "),p(m(j),{trigger:"click","show-arrow":!1,show:ht.oneShow,onClickoutside:n[10]||(n[10]=t=>Dt("oneShow"))},{trigger:y((()=>[b(e.$slots,"button",{handleClickPrintBtn:re,printSpinning:vt.spinning,printbtnText:t.btnText,printVisible:vt.visible},(()=>[p(m(I),{class:"newprint-button-component",onClick:n[4]||(n[4]=w((()=>Nt("icon")),["stop"]))},{default:y((()=>[p(m(L),{loading:t.showLoading&&vt.spinning,onClick:n[3]||(n[3]=w((()=>Nt("button")),["stop"]))},{icon:y((()=>[p(m(F),{component:m(x),size:"18"},null,8,["component"])])),default:y((()=>[g(" "+k(m(Ct)?"打印全部":t.btnText),1)])),_:1},8,["loading"]),p(m(L),{class:"icon-select"},{icon:y((()=>[p(m(F),{component:m(_),size:"18"},null,8,["component"])])),_:1})])),_:1})]))])),default:y((()=>[c("div",$,[(o(!0),s(u,null,v(bt.value,(t=>(o(),s("div",{class:P(["print-li",kt.oneMouseType==t.key||kt.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>xt("oneMouseType",t.key),onMouseleave:n[9]||(n[9]=t=>xt("oneMouseType","")),onClick:e=>((t,e,n)=>{if(!vt.printParams[n.templateCode])return[];xt(t,e)})("oneClickType",t.key,t)},["divider"==t.key?(o(),f(m(N),{key:0})):"outSetting"==t.key?(o(),s(u,{key:1},[d(" 第二层外显设置 "),p(m(j),{trigger:"click","show-arrow":!1,placement:"right-start",show:ht.isOutSetting,onClickoutside:n[7]||(n[7]=t=>Dt("isOutSetting"))},{trigger:y((()=>[c("div",{class:"print-lite",onClick:n[5]||(n[5]=t=>_t("isOutSetting"))},[c("span",W,k(t.label),1),p(m(F),{style:{background:"transparent"},component:m(E),size:"18"},null,8,["component"])])])),default:y((()=>[c("div",X,[(o(!0),s(u,null,v(m(Ft),(t=>(o(),s("div",{class:"print-li",key:t.key},[c("div",Z,[c("span",tt,k(t.label),1),p(m(M),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:y((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",et,[p(m(N)),c("div",nt,[p(m(L),{type:"primary",size:"small",onClick:Et},{default:y((()=>[g("保存")])),_:1}),p(m(M),{checked:m(jt),"onUpdate:checked":n[6]||(n[6]=t=>h(jt)?jt.value=t:null)},{default:y((()=>[g("全选")])),_:1},8,["checked"])])])])])),_:2},1032,["show"])],2112)):(o(),s(u,{key:2},[d(" 第二层功能操作 "),c("div",{class:P(["print-lite",vt.printParams[t.templateCode]?"":"isDisabled"])},[c("span",{class:"label bold",onClick:e=>Ht(t.templateCode,t.templateId,t.key,!1)},k(t.label),9,rt),vt.printParams[t.templateCode]?(o(),f(m(j),{key:0,trigger:"click","show-arrow":!1,placement:"right-start",show:ht[t.key],onClickoutside:e=>Dt(t.key)},{trigger:y((()=>[p(m(F),{component:m(D),size:"18",onClick:e=>_t(t.key)},null,8,["component","onClick"])])),default:y((()=>[c("div",it,[(o(!0),s(u,null,v(m(gt),(e=>(o(),s("div",{class:P(["print-li",kt.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=>Gt(e.key,t,!1)},k(e.label),9,ot)])],42,at)))),128))])])),_:2},1032,["show","onClickoutside"])):d("v-if",!0)],2)],2112))],42,Q)))),128))])])),_:3},8,["show"])],2112))]),p(V,O(e.$attrs,{modelValue:vt.identityVerification.visible,"onUpdate:modelValue":n[11]||(n[11]=t=>vt.identityVerification.visible=t),formatId:vt.currentFormatId,templateId:m(Ot),onSuccess:ie}),null,16,["modelValue","formatId","templateId"])],64))}});export{st as default};
1
+ import{defineComponent as t,inject as e,ref as n,reactive as r,computed as i,onMounted as a,watch as l,openBlock as o,createElementBlock as s,Fragment as u,createElementVNode as c,createCommentVNode as d,createVNode as p,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 F,NPopover as j,NCheckbox as M,NDivider as N}from"naive-ui";import{PrintOutline as x,SettingsOutline as E,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"},rt=["onClick"],it={class:"newprint-button-poperOver"},at=["onMouseenter"],lt={class:"print-lite"},ot=["onClick"];var st=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:[],defaultFormatId:""})}},setup(t,{expose:st}){const ut=t,ct=[{label:"分割线",key:"divider"},{label:"外显设置",key:"outSetting"}],dt=C();let pt;const mt=e(z),yt=n(""),vt=r({spinning:!1,visible:!1,formatList:[],templateParams:[],printParams:[],originParams:{},currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1,curPrintParamList:[]});let ft=n([]),gt=n([{label:ut.pdfLoadText,key:"downloadPdf"},{label:ut.previewText,key:"previewText"},{label:ut.formatEditText,key:"formatEditText"},{label:"重置打印机",key:"resetPrinter"}]);const kt=r({oneMouseType:"",oneClickType:"",twoMouseType:""}),ht=r({oneShow:!1,isOperation:!1,isOutSetting:!1}),bt=n([]),wt=n([]),Pt=i((()=>{if(!vt.currentFormatId)return{};let t=vt.currentFormatId;return vt.formatList.find((e=>e.id===t))}));i((()=>{var t;return(null==(t=Pt.value)?void 0:t.name)||"格式选择"}));const Ot=i((()=>{let t=vt.formatList.find((t=>t.id===vt.currentFormatId));return null==t?void 0:t.templateId})),St=i((()=>{let t=vt.formatList.find((t=>t.id===vt.currentFormatId));return null==t?void 0:t.number})),Ct=i((()=>{var t;return null==(t=ut.newPrintSetting)?void 0:t.isShowPrintAll})),It=i((()=>{var t;return null==(t=ut.newPrintSetting)?void 0:t.isShowOutSetting})),Tt=i((()=>{var t;return(null==(t=ut.newPrintSetting)?void 0:t.customProps)||{}})),Lt=i((()=>{var t;return(null==(t=ut.newPrintSetting)?void 0:t.defaultFormatId)||""})),Ft=i((()=>{const t=ct.map((t=>t.key));return ft.value.filter((e=>!t.includes(e.key)))})),jt=i({get:()=>Ft.value.every((t=>t.selected)),set(t){Ft.value.forEach((e=>{e.selected=t}))}}),Mt=async()=>{var t,e;(null==(e=null==(t=ut.newPrintSetting)?void 0:t.outerPrintKeys)?void 0:e.length)||await re(),ht.oneShow=!0},Nt=async t=>{if(ut.directPrint){if(vt.spinning)return;return"button"===t?void(Ct.value?await ae():Lt.value?async function(t){await re(!1);const e=bt.value.find((e=>e.key==t));e&&Ht(e.templateCode,e.templateId,e.key,!1)}(Lt.value):Mt()):Mt()}return Mt()},xt=(t,e)=>{kt[t]=e},Et=()=>{bt.value=ft.value.filter((t=>!t.selected)),wt.value=Ft.value.filter((t=>t.selected)),Dt("oneShow"),Dt("isOutSetting"),mt("saveOuterPrint",wt.value)},_t=t=>{ht[t]=!0},Dt=t=>{kt.oneClickType="",ht[t]=!1,"isOutSetting"==t&&(ht.isOutSetting=!1)},zt=(t,e)=>{Bt(!1);let n={type:e,formatId:vt.currentFormatId,templateId:(null==t?void 0:t.templateId)||Ot.value,templateCode:(null==t?void 0:t.templateCode)||St.value};mt("success",t,n)},Jt=t=>{Bt(!1),mt("error",t),S(t)&&"notInstalledApp"===t.type&&dt.error(t.message)},Ut=t=>{Bt(!1),mt("cancel",t)},Vt=t=>{mt("error",{message:"前置条件执行错误",type:t,preExecution:!0})},At=()=>JSON.stringify({...ut.token?{token:ut.token}:{}}),Kt=(t=[],e)=>{var n,r;let i={},a={};if((null==(n=vt.templateParams[e].customizeDataset)?void 0:n.length)>0){const e=(null==(r=Object.keys(t[0].datasetData||{}))?void 0:r[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 i=Object.assign({},JSON.parse(At()),Tt.value,a),JSON.stringify(i)},Bt=(t,e)=>{if(vt.isClickOuterPrint){if(t&&e){const n=wt.value.find((t=>t.key==e));return void(n&&(n.isLoading=t))}wt.value.forEach((t=>{t.isLoading=!1}))}else vt.spinning=t},Rt=()=>vt.isClickOuterPrint?wt.value.some((t=>t.isLoading)):vt.spinning,Ht=(t,e,n,r)=>{const i=vt.printParams[t];if(!i)return;vt.isClickOuterPrint=r,vt.currentFormatId=n;const a=vt.originParams[t]||[];qt(i,t,e,n,a)},qt=async(t=[],e,n,r,i=[],a)=>{let l=t.length;const o=async t=>{try{--l<=0&&zt(t,"print")}catch(t){console.log("error",t)}};ut.showLoading&&Rt()&&!a||(Bt(!0,r),ut.prevFn("print").then((()=>{vt.curPrintParamList=t;const a={formatId:r,templateId:n,authorizationKey:yt.value,printdlgshow:ut.printdlgshow,signature:ut.signature,copies:ut.printCopies};if("MULTI"===ut.strategy)for(let e=0;e<t.length;e++){e>0&&(a.printdlgshow="0");const n=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,t[e]));pt.printDirect({...a,params:n},o,Jt,Ut)}else pt.printDirect({...a,params:Kt(t,e)},(t=>{t.params=i,t.templateCode=e,t.templateId=n,zt(t,"print")}),Jt,Ut)})).catch((()=>{Vt("print"),Bt(!1)})).finally((()=>{vt.visible=!1})))},Gt=async(t,{templateCode:e,templateId:n,key:r},i)=>{const a=vt.printParams[e];if(a)switch(vt.isClickOuterPrint=i,vt.currentFormatId=r,t){case"previewText":(async(t=[],e,n,r)=>{ut.showLoading&&Rt()||(Bt(!0,r),ut.prevFn("preview").then((()=>{vt.curPrintParamList=t;const i=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,t[0])),a="MULTI"===ut.strategy?i:Kt(t,e),l={formatId:r,templateId:n,authorizationKey:yt.value,params:a,btnprint:ut.btnprint,signature:ut.signature};pt.preview(l,(t=>{zt(t,"preview")}),Jt)})).catch((()=>{Vt("preview"),Bt(!1)})).finally((()=>{vt.visible=!1})))})(a,e,n,r);break;case"formatEditText":((t=[],e,n,r)=>{ut.showLoading&&Rt()||(Bt(!0,r),ut.prevFn("edit").then((()=>{vt.curPrintParamList=t,vt.currentFormatId=r,vt.identityVerification.visible=!0})).catch((()=>{Vt("edit")})).finally((()=>{Bt(!1)})))})(a,0,0,r);break;case"downloadPdf":(async(t=[],e,n,r)=>{ut.showLoading&&Rt()||(Bt(!0,r),ut.prevFn("download").then((()=>{vt.curPrintParamList=t;const i=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,t[0])),a="MULTI"===ut.strategy?i:Kt(t,e),l={formatId:r,templateId:n,authorizationKey:yt.value,print:{print:"1",type:"1"},params:a,signature:ut.signature};pt.downloadPDF(l,(t=>zt(t,"preview")),Jt)})).catch((()=>{Vt("download"),Bt(!1)})).finally((()=>{vt.visible=!1})))})(a,e,n,r);break;case"resetPrinter":(async(t=[],e,n,r)=>{if(ut.showLoading&&Rt())return;Bt(!0,r);const i=await pt.resetPrinter(r);Bt(!1),"success"!=(null==i?void 0:i.result)?dt.warning("重置打印机失败"):dt.success(i.message||"重置打印机成功")})(a,0,0,r)}},Yt=()=>{},$t=(t,e=[])=>{let n={};return(e=e||[]).forEach((e=>{n=Object.assign({},Zt(n,e,t))})),n},Qt=(t,e=[])=>{let n={};return(e=e||[]).forEach((e=>{n=Object.assign({},te(n,e,t))})),n},Wt=(t,e,n)=>{const r={};return e.forEach((e=>{let i=((t,e)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let r=e;return Object.keys(n).includes(t.type)&&e&&e instanceof Date&&(r=A(e,n[t.type])),(null==t?void 0:t.defaultValue)||r})(e,t[e[n]]);t[e[n]]&&i&&(r[e[n]]=i)})),r},Xt=({customizeDataset:t=[],param:e=[]},n={})=>{let r={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;r.datasetData||(r.datasetData={}),r.datasetData[t.name]=JSON.stringify(Wt(n,e,"fieldName"))})),r=Object.assign({},r,Wt(n,e,"key")),r},Zt=(t,e,n)=>{if(e.templateNumbers){for(let r=0;r<e.templateNumbers.length;r++){const i=e.templateNumbers[r],a=n[i];if(!a)return dt.error("当前勾选的数据没有匹配的模板"),t;t[i]||(t[i]=[]),t[i].push(Xt(a,e))}return t}const r=Object.keys(n);for(let i=0;i<r.length;i++){const a=r[i],l=n[a];if(!l)return dt.error("当前勾选的数据没有匹配的模板"),t;t[a]||(t[a]=[]),t[a].push(Xt(l,e))}return t},te=(t,e,n)=>{if(e.templateNumbers){for(let r=0;r<e.templateNumbers.length;r++){const i=e.templateNumbers[r];if(!n[i])return dt.error("当前勾选的数据没有匹配的模板"),t;t[i]||(t[i]=[]),t[i].push(e)}return t}const r=Object.keys(n);for(let i=0;i<r.length;i++){const a=r[i];if(!n[a])return dt.error("当前勾选的数据没有匹配的模板"),t;t[a]||(t[a]=[]),t[a].push(e)}return t},ee=async t=>{vt.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 r=vt.formatList.map((t=>({templateCode:t.number,templateId:t.templateId,label:t.name,key:t.id,selected:!1,isLoading:!1})));ft.value.unshift(...r),It.value&&ft.value.push(...ct),(null==(e=null==(t=ut.newPrintSetting)?void 0:t.outerPrintKeys)?void 0:e.length)>0&&(ft.value.forEach((t=>{var e;(null==(e=ut.newPrintSetting)?void 0:e.outerPrintKeys.includes(t.key))&&(t.selected=!0)})),wt.value=ft.value.filter((t=>t.selected))),bt.value=ft.value.filter((t=>!t.selected)),ut.hideButtons.length>0&&(gt.value=gt.value.filter((t=>!ut.hideButtons.includes(t.key))));const i=sessionStorage.getItem("portal");if(i){const t=JSON.parse(i),e=(null==(n=null==t?void 0:t.user)?void 0:n.currentRoleResourceObj)||{},r=Object.keys(e);r.includes("RY7.2.21.1.M2.G94181E")||(gt.value=gt.value.filter((t=>"downloadPdf"!=t.key))),r.includes("RY7.2.21.1.M2.G33633A")||(gt.value=gt.value.filter((t=>"formatEditText"!=t.key)))}})(),vt.templateParams=(t=>{let e={};return t&&t.forEach((t=>{if(!t.templateConfig)return!1;e[t.number]=t.templateConfig})),e})(t.obj),vt.printParams=$t(vt.templateParams,ut.params),vt.originParams=Qt(vt.templateParams,ut.params)},ne=async()=>{var t;if(vt.isInited)return!0;vt.isInited=!0,vt.spinning=!0,(()=>{if(pt)return!1;pt=new J})();const e=await ut.queryPrintFormatByNumber();return await ee(e),(null==(t=e.obj)?void 0:t.length)>0&&(yt.value=e.obj[0].authorizationKey||""),vt.spinning=!1,!0},re=async(t=!0)=>{if(await ut.clickPrevFn()){if(!vt.visible){if(!await ne())return!1}t&&(vt.visible=!vt.visible)}},ie=t=>{if(vt.identityVerification.visible=!1,U(vt.currentFormatId))return zt(null,"edit");const e=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,vt.curPrintParamList[0])),n="MULTI"===ut.strategy?e:Kt(vt.curPrintParamList,St.value),r={formatId:vt.currentFormatId,templateId:Ot.value,params:n,token:t};pt.editPrintFormat(r,(t=>{zt(t,"edit")}),Jt)};async function ae(){await re(!1),(()=>{const t=Object.keys(vt.printParams);vt.isClickOuterPrint=!1;const e=vt.originParams;for(let n=0;n<t.length;n++){const r=t[n],i=vt.printParams[r],a=e[r]||[],l=vt.formatList.filter((t=>t.number==r));l&&l.length>0&&l.forEach((t=>{vt.currentFormatId=t.id,qt(i,t.number,t.templateId,t.id,a,!0)}))}})()}return a((()=>{vt.isInited=!1})),l((()=>ut.params),(t=>{Object.keys(vt.templateParams).length>0&&(vt.printParams=$t(vt.templateParams,ut.params),vt.originParams=Qt(vt.templateParams,ut.params))}),{deep:!0}),l((()=>{var t;return null==(t=ut.newPrintSetting)?void 0:t.outerPrintKeys}),(async t=>{(null==t?void 0:t.length)>0&&await re(!1)}),{deep:!0,immediate:!0}),st({directPrint:ae}),(e,n)=>(o(),s(u,null,[c("div",K,[d(" 外显按钮集合 "),p(m(I),null,{default:y((()=>[(o(!0),s(u,null,v(wt.value,(e=>{return o(),f(m(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:Yt,options:(n=m(gt),r=e,vt.printParams[r.templateCode]?n:[]),onSelect:t=>Gt(t,e,!0)},{default:y((()=>[p(m(L),{disabled:!vt.printParams[e.templateCode],loading:t.showLoading&&e.isLoading,onClick:t=>Ht(e.templateCode,e.templateId,e.key,!0)},{icon:y((()=>[p(m(F),{component:m(x),size:"18"},null,8,["component"])])),default:y((()=>[g(" "+k(e.label),1)])),_:2},1032,["disabled","loading","onClick"])])),_:2},1032,["options","onSelect"]);var n,r})),128))])),_:1}),d(' <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> '),d(" 外显设置按钮 "),wt.value.length>0&&wt.value.length==m(Ft).length&&m(It)?(o(),f(m(j),{key:0,trigger:"click","show-arrow":!1,show:ht.isOutSetting,onClickoutside:n[2]||(n[2]=t=>Dt("isOutSetting"))},{trigger:y((()=>[p(m(L),{onClick:n[0]||(n[0]=t=>_t("isOutSetting"))},{default:y((()=>[B,p(m(F),{style:{"margin-left":"8px"},component:m(E),size:"18"},null,8,["component"])])),_:1})])),default:y((()=>{var t;return[c("div",R,[(o(!0),s(u,null,v(m(Ft),(t=>(o(),s("div",{class:"print-li",key:t.key},[c("div",H,[c("span",q,k(t.label),1),p(m(M),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:y((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",G,[p(m(N)),c("div",Y,[p(m(L),{type:"primary",size:"small",onClick:Et},{default:y((()=>[g("保存")])),_:1}),(null==(t=m(Ft))?void 0:t.length)>1?(o(),f(m(M),{key:0,checked:m(jt),"onUpdate:checked":n[1]||(n[1]=t=>h(jt)?jt.value=t:null)},{default:y((()=>[g("全选")])),_:1},8,["checked"])):d("v-if",!0)])])])]})),_:1},8,["show"])):(o(),s(u,{key:1},[d(" 打印全部按钮 "),p(m(j),{trigger:"click","show-arrow":!1,show:ht.oneShow,onClickoutside:n[10]||(n[10]=t=>Dt("oneShow"))},{trigger:y((()=>[b(e.$slots,"button",{handleClickPrintBtn:re,printSpinning:vt.spinning,printbtnText:t.btnText,printVisible:vt.visible},(()=>[p(m(I),{class:"newprint-button-component",onClick:n[4]||(n[4]=w((()=>Nt("icon")),["stop"]))},{default:y((()=>[p(m(L),{loading:t.showLoading&&vt.spinning,onClick:n[3]||(n[3]=w((()=>Nt("button")),["stop"]))},{icon:y((()=>[p(m(F),{component:m(x),size:"18"},null,8,["component"])])),default:y((()=>[g(" "+k(m(Ct)?"打印全部":t.btnText),1)])),_:1},8,["loading"]),p(m(L),{class:"icon-select"},{icon:y((()=>[p(m(F),{component:m(_),size:"18"},null,8,["component"])])),_:1})])),_:1})]))])),default:y((()=>[c("div",$,[(o(!0),s(u,null,v(bt.value,(t=>(o(),s("div",{class:P(["print-li",kt.oneMouseType==t.key||kt.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>xt("oneMouseType",t.key),onMouseleave:n[9]||(n[9]=t=>xt("oneMouseType","")),onClick:e=>((t,e,n)=>{if(!vt.printParams[n.templateCode])return[];xt(t,e)})("oneClickType",t.key,t)},["divider"==t.key?(o(),f(m(N),{key:0})):"outSetting"==t.key?(o(),s(u,{key:1},[d(" 第二层外显设置 "),p(m(j),{trigger:"click","show-arrow":!1,placement:"right-start",show:ht.isOutSetting,onClickoutside:n[7]||(n[7]=t=>Dt("isOutSetting"))},{trigger:y((()=>[c("div",{class:"print-lite",onClick:n[5]||(n[5]=t=>_t("isOutSetting"))},[c("span",W,k(t.label),1),p(m(F),{style:{background:"transparent"},component:m(E),size:"18"},null,8,["component"])])])),default:y((()=>{var t;return[c("div",X,[(o(!0),s(u,null,v(m(Ft),(t=>(o(),s("div",{class:"print-li",key:t.key},[c("div",Z,[c("span",tt,k(t.label),1),p(m(M),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:y((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",et,[p(m(N)),c("div",nt,[p(m(L),{type:"primary",size:"small",onClick:Et},{default:y((()=>[g("保存")])),_:1}),(null==(t=m(Ft))?void 0:t.length)>1?(o(),f(m(M),{key:0,checked:m(jt),"onUpdate:checked":n[6]||(n[6]=t=>h(jt)?jt.value=t:null)},{default:y((()=>[g("全选")])),_:1},8,["checked"])):d("v-if",!0)])])])]})),_:2},1032,["show"])],2112)):(o(),s(u,{key:2},[d(" 第二层功能操作 "),c("div",{class:P(["print-lite",vt.printParams[t.templateCode]?"":"isDisabled"])},[c("span",{class:"label bold",onClick:e=>Ht(t.templateCode,t.templateId,t.key,!1)},k(t.label),9,rt),vt.printParams[t.templateCode]?(o(),f(m(j),{key:0,trigger:"click","show-arrow":!1,placement:"right-start",show:ht[t.key],onClickoutside:e=>Dt(t.key)},{trigger:y((()=>[p(m(F),{component:m(D),size:"18",onClick:e=>_t(t.key)},null,8,["component","onClick"])])),default:y((()=>[c("div",it,[(o(!0),s(u,null,v(m(gt),(e=>(o(),s("div",{class:P(["print-li",kt.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=>Gt(e.key,t,!1)},k(e.label),9,ot)])],42,at)))),128))])])),_:2},1032,["show","onClickoutside"])):d("v-if",!0)],2)],2112))],42,Q)))),128))])])),_:3},8,["show"])],2112))]),p(V,O(e.$attrs,{modelValue:vt.identityVerification.visible,"onUpdate:modelValue":n[11]||(n[11]=t=>vt.identityVerification.visible=t),formatId:vt.currentFormatId,templateId:m(Ot),onSuccess:ie}),null,16,["modelValue","formatId","templateId"])],64))}});export{st as default};
@@ -195,7 +195,6 @@ export declare const CallbackMaps: Map<string, {
195
195
  type: (BooleanConstructor | NumberConstructor)[];
196
196
  default: boolean;
197
197
  };
198
- incrementalRender: BooleanConstructor;
199
198
  }, {
200
199
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
201
200
  fieldList: {
@@ -387,7 +386,6 @@ export declare const CallbackMaps: Map<string, {
387
386
  type: (BooleanConstructor | NumberConstructor)[];
388
387
  default: boolean;
389
388
  };
390
- incrementalRender: BooleanConstructor;
391
389
  }>> & {
392
390
  onFormChange?: ((...args: any[]) => any) | undefined;
393
391
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -932,7 +930,6 @@ export declare const CallbackMaps: Map<string, {
932
930
  type: (BooleanConstructor | NumberConstructor)[];
933
931
  default: boolean;
934
932
  };
935
- incrementalRender: BooleanConstructor;
936
933
  }>> & {
937
934
  onFormChange?: ((...args: any[]) => any) | undefined;
938
935
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -963,7 +960,6 @@ export declare const CallbackMaps: Map<string, {
963
960
  linebarTextDirection: "horizontal" | "vertical";
964
961
  autoWidth: number | boolean;
965
962
  operationalFormInit: boolean;
966
- incrementalRender: boolean;
967
963
  }>;
968
964
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
969
965
  props: {
@@ -15,4 +15,5 @@ export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObje
15
15
  getContainPoints: (gridPoints?: never[]) => IObject[];
16
16
  showDialog: (callback: Function) => void;
17
17
  removeCurrentSelection: () => void;
18
+ pauseFlickerPoint: import("@vueuse/shared").Fn;
18
19
  };
@@ -1 +1 @@
1
- import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as s}from"../useEvent.js";import{useCommon as a}from"../useCommon.js";import{getPointRange as f,getIndex as u,isEffectiveNode as c,getTime as p}from"../../utils/index.js";import{cloneDeep as d,last as m,omit as v,flatten as g}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import{useIntervalFn as y}from"@vueuse/core";function h(h,k,x,L,P,w){const{computedX:b,computedY:A,getXValue:I,getYValue:C}=r(k),{xCellWidth:K,pointSelectionStyle:E,originX:j,endX:T,originY:X,endY:V,event:Y,scaleValues:M,xAxis:S,startTime:D,timeXCell:O,itemList:$,dialog:F,topGridOriginY:_,topGridEndY:z}=k,G=new Map,N=new Set,J=d(M);let q=[],R=null;const W=new Set;l(h,k);const{getEqualXTypes:B,handleAddPrevent:H,setPrevAndNextPoint:Q,getPointEventProps:U}=a(h,x,k),{pause:Z,resume:ee}=y((()=>{!function(){if(!W.size)return;for(const e of W)e.set("opacity",1===e.opacity?.5:1);h.value.renderAll()}()}),800);function te(){J.forEach((e=>{const{range:t=[],spaceValue:n}=e;n&&(t[0]||t[1])&&e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function s({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=A(t.type,t.range,n),s=i([j,r,T,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});Y.hovered&&o&&(s.on("mousemove",(({pointer:e})=>{L.point={...e||{x:s.left,y:s.top}},L.list=[`${o} ${n}${t.unit||""}`],L.show=!0})),s.on("mouseout",(()=>{L.show=!1}))),h.value.add(s)}s(n),s(o),s(l),s(r)}(t,e),le(t,n,e))}))}))}function ne(e=[]){if(!(null==R?void 0:R.areaPos))return[];const{startPos:t,endPos:n}=R.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:me()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function ie(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),oe()},onNegativeClick:()=>oe(),onClose:()=>oe()})}function oe(){R&&h.value.remove(R),R=null}function le(e,t,n){var l;const{type:r,unit:s,dataList:a=[]}=n,f=[];G.set(e.key,[]),function(e,t){W.size&&[...W].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&W.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,u)=>{!function(e,l,u,c){var p;let d,g,y=c;l.key&&(y=a.find((e=>e.key===l.key)));const{pointAttr:k={},lineAttr:P={},title:w="",key:b,type:A="circle"}=y,E=de(c.list[u+1],n);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(g=i([...e,...E],P));const j=f[u-1],T={origin:{data:l,title:w,key:c.key,selfKey:b,unit:s,type:r,dataIndex:t,index:u,lineAttr:P},__type:"main",leftLine:j,rightLine:g,...k,...U()};e&&(j||(T.leftLine=null),d=o(A,{left:e[0],top:e[1],...T}));f.push(g),d&&(d.originLeft=d.left,d.originTop=d.top,function(e){Y.hovered&&(e.on("mouseover",(()=>{ce(e,"hover")})),e.on("mouseout",(()=>{L.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{pe(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),Y.hovered&&ce(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:s,top:a,origin:f}=e,u=~~((s-l)/K);if(s>l+K){if(0===q.length){se(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const c=l+K*u;if(q.every((e=>e.left!==c))){const t=I(c),n=C(f.type,a);q.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:c,top:a}),se(e,[...e.prevPointer,c,a])}if(q.length<u&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+K*l,r=q.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=q.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const s=JSON.parse(JSON.stringify(r)),a=q[l-1]||{left:n,top:i},f=~~((r.left-(t-K))/K),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:I(t),value:C(o.type,s.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},q.splice(l,0,s),se(e,[a.left,a.top,s.left,s.top])}}l++}}(e,u),e.nextPoint){const t=G.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=K/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<s?re(e,"#999"):re(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(q.length>0&&i<q[q.length-1].left){for(const e of N)e.left>i&&(e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e));if(q=q.filter((e=>e.left<=i)),0===q.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of N)e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e)}if(q.length>0){const t=m(q);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(L.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:I(e.left),value:C(t,e.top)}};if(h.value.discardActiveObject(),q.length>0){const l=J.find((e=>e.type===t));let r=-1;const s=q.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void fe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=s.findIndex((e=>e.time===n.time));o>-1?s[o].value=n.value:s.push({...m(s),time:n.time,value:n.value})}const a=l.dataList.findIndex((e=>e.key===n));x("add",{...v(o,["index","selfKey","lineAttr"]),dataIndex:a,key:n,data:s}),ae({...o,data:s,coincideIndex:r})}else x("change",{...v(o,["selfKey","lineAttr"]),key:n}),ae(o,"change")}}))}(d),null==(p=G.get(c.key))||p.push(d))}(de(l,n),l,u,e)})),Promise.all(G.get(e.key)).then((t=>{const n=f.filter((e=>e));Q(t),h.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||W.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function re(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function se(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,N.add(l),h.value.add(r,l)}))}function ae(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:s}=e;let{dataIndex:a}=e;const f=J.find((e=>e.type===r)),c=f.dataList.find(((e,t)=>(a=t,e.key===l)));switch(t){case"remove":c.list.splice(o,n),c.list[o-1]&&(c.list[o-1].breakpoint=!0);break;case"change":c.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=u(e,c.list),n=Array.isArray(i)?i:[i];c.list.splice(t,s>-1?s-t+1:0,...n);break}}fe({dataIndex:a,scaleValue:f})}function fe(e){var t,n,i;if(N.size&&(null==(t=h.value)||t.remove(...ue([...N]))),N.clear(),q=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=h.value)||n.remove(...ue(G.get(o.key))),G.delete(o.key),le(o,t,i)}else G.size&&(null==(i=h.value)||i.remove(...ue(me()))),G.clear(),te()}function ue(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function ce(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:r}=e.origin;L.point={x:e.left,y:e.top};const s=I(e.left),a=`${"hover"===t?o.value:C(i,e.top)}`;L.list=[`${n} ${a}${l||""}`,`时间 ${s.slice(-5)}`],L.sourceData=[{type:i,title:n,unit:l,key:r,time:s,value:a}],L.isTarget=!0,L.show=!0}function pe(e){e.setCoords();const t=6e4/O,n=e.prevPoint?e.prevPoint.left+t:j,i=T;e.top<X&&e.set("top",X),e.top>V&&e.set("top",V),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function de(e,t){if(c(e)&&function(e){const t=Date.parse(m(S.list)),n=p(e);return n>=D&&n<=t}(e.time)){const n=b(e.time),i=A(t.type,t.range,e.value);return[n,i<X?X:i>V?V:i]}}function me(){return g(Array.from(G.values()))}return e((()=>{Z()})),te(),function(){if(!Y.evented)return;let e=!1,i={x:0,y:0};h.value.on("mouse:up",(t=>{if(3===t.button&&function(e){L.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=j&&t<=T&&n>=X&&n<=V)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);me().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&P.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===P.list.length&&(P.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{B(me(),t,"key",2*K).includes(n.linkKey||n.key)||P.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===P.list.length&&(P.show=!1,H("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(P,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=ne();t.length>0?ie((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ae(n[0],"remove",n.length),n.map((e=>({...v(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);x("remove",e)})):s.emit(R)}})),h.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),h.value.on("mouse:move",(o=>{if(function(e){if(!w||P.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;L.movable=!1,(i<j||i>T)&&(L.show=!1);if(!t&&i>=j&&i<=T){const e=o>=X&&o<=V,l=o>=_&&o<=z;if(e||l){const l=I(i);L.sourceData=e?J.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:C(t,o)}})):[{type:"tree",time:l}],L.isTarget=!!t,L.point=n,L.movable=!0}else L.show=!1}}(o),!e)return;const{x:l,y:r}=i,{x:s,y:a}=o.pointer;R&&h.value.remove(R),R=new t.Rect({...n,fill:"#CAF982",opacity:.4,...E,left:l,top:r,width:s-l,height:a-r,objectCaching:!0}),R.areaPos={startPos:i,endPos:o.pointer},h.value.add(R)}))}(),{redrawPoints:fe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(x("remove",n),ae(n,"remove")):(Object.assign(n,{data:{time:I(e.pointer.x),value:C(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),x("add",n),ae({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:pe,setPopup:ce,updateData:ae,getGridPoints:me,getContainPoints:ne,showDialog:ie,removeCurrentSelection:oe}}export{h as useCenter};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t,drawLine as n,drawPoint as i}from"../useDraw.js";import{useGrid as o}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import{bus as r}from"../useEvent.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getPointRange as a,getIndex as f,isEffectiveNode as u,getTime as c}from"../../utils/index.js";import{cloneDeep as p,last as d,omit as m,flatten as v}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import{useIntervalFn as g}from"@vueuse/core";function y(y,h,k,x,L,P){const{computedX:w,computedY:b,getXValue:A,getYValue:I}=l(h),{xCellWidth:C,pointSelectionStyle:K,originX:E,endX:j,originY:T,endY:X,event:V,scaleValues:Y,xAxis:M,startTime:S,timeXCell:D,itemList:F,dialog:O,topGridOriginY:$,topGridEndY:_}=h,z=new Map,G=new Set,N=p(Y);let J=[],q=null;const R=new Set;o(y,h);const{getEqualXTypes:W,handleAddPrevent:B,setPrevAndNextPoint:H,getPointEventProps:Q}=s(y,k,h),{pause:U,resume:Z}=g((()=>{!function(){if(!R.size)return;for(const e of R)e.set("opacity",1===e.opacity?.5:1);y.value.renderAll()}()}),800);function ee(){N.forEach((e=>{const{range:t=[],spaceValue:i}=e;i&&(t[0]||t[1])&&e.dataList.forEach(((t,i)=>{t.show&&(!function(e,t){const{max:i={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function s({show:e=!1,value:i,name:o,lineStyle:l}){if(!e||!i)return;const r=b(t.type,t.range,i),s=n([E,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});V.hovered&&o&&(s.on("mousemove",(({pointer:e})=>{x.point={...e||{x:s.left,y:s.top}},x.list=[`${o} ${i}${t.unit||""}`],x.show=!0})),s.on("mouseout",(()=>{x.show=!1}))),y.value.add(s)}s(i),s(o),s(l),s(r)}(t,e),oe(t,i,e))}))}))}function te(e=[]){if(!(null==q?void 0:q.areaPos))return[];const{startPos:t,endPos:n}=q.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:de()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function ne(e){O.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),ie()},onNegativeClick:()=>ie(),onClose:()=>ie()})}function ie(){q&&y.value.remove(q),q=null}function oe(e,t,o){var l;const{type:r,unit:s,dataList:a=[]}=o,f=[];z.set(e.key,[]),function(e,t){R.size&&[...R].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&R.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,u)=>{!function(e,l,u,c){var p;let v,g,h=c;l.key&&(h=a.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:w="",key:b,type:K="circle"}=h,E=pe(c.list[u+1],o);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(g=n([...e,...E],P));const j=f[u-1],T={origin:{data:l,title:w,key:c.key,selfKey:b,unit:s,type:r,dataIndex:t,index:u,lineAttr:P},__type:"main",leftLine:j,rightLine:g,...L,...Q()};e&&(j||(T.leftLine=null),v=i(K,{left:e[0],top:e[1],...T}));f.push(g),v&&(v.originLeft=v.left,v.originTop=v.top,function(e){V.hovered&&(e.on("mouseover",(()=>{ue(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ce(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),V.hovered&&ue(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:s,top:a,origin:f}=e,u=~~((s-l)/C);if(s>l+C){if(0===J.length){re(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const c=l+C*u;if(J.every((e=>e.left!==c))){const t=A(c),n=I(f.type,a);J.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:c,top:a}),re(e,[...e.prevPointer,c,a])}if(J.length<u&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+C*l,r=J.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=J.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const s=JSON.parse(JSON.stringify(r)),a=J[l-1]||{left:n,top:i},f=~~((r.left-(t-C))/C),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:A(t),value:I(o.type,s.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},J.splice(l,0,s),re(e,[a.left,a.top,s.left,s.top])}}l++}}(e,u),e.nextPoint){const t=z.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=C/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<s?le(e,"#999"):le(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(J.length>0&&i<J[J.length-1].left){for(const e of G)e.left>i&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(J=J.filter((e=>e.left<=i)),0===J.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of G)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(J.length>0){const t=d(J);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:A(e.left),value:I(t,e.top)}};if(y.value.discardActiveObject(),J.length>0){const l=N.find((e=>e.type===t));let r=-1;const s=J.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void ae({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=s.findIndex((e=>e.time===n.time));o>-1?s[o].value=n.value:s.push({...d(s),time:n.time,value:n.value})}const a=l.dataList.findIndex((e=>e.key===n));k("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:a,key:n,data:s}),se({...o,data:s,coincideIndex:r})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),se(o,"change")}}))}(v),null==(p=z.get(c.key))||p.push(v))}(pe(l,o),l,u,e)})),Promise.all(z.get(e.key)).then((t=>{const n=f.filter((e=>e));H(t),y.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||R.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function le(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function re(e,t){const[,,i,o]=t;e.clone((l=>{l.set({left:i,top:o,scaleX:1,scaleY:1}),e.prevPointer=[i,o];const r=n(t,e.origin.lineAttr);l.leftLine=r,G.add(l),y.value.add(r,l)}))}function se(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:s}=e;let{dataIndex:a}=e;const u=N.find((e=>e.type===r)),c=u.dataList.find(((e,t)=>(a=t,e.key===l)));switch(t){case"remove":c.list.splice(o,n),c.list[o-1]&&(c.list[o-1].breakpoint=!0);break;case"change":c.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=f(e,c.list),n=Array.isArray(i)?i:[i];c.list.splice(t,s>-1?s-t+1:0,...n);break}}ae({dataIndex:a,scaleValue:u})}function ae(e){var t,n,i;if(G.size&&(null==(t=y.value)||t.remove(...fe([...G]))),G.clear(),J=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=y.value)||n.remove(...fe(z.get(o.key))),z.delete(o.key),oe(o,t,i)}else z.size&&(null==(i=y.value)||i.remove(...fe(de()))),z.clear(),ee()}function fe(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function ue(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:r}=e.origin;x.point={x:e.left,y:e.top};const s=A(e.left),a=`${"hover"===t?o.value:I(i,e.top)}`;x.list=[`${n} ${a}${l||""}`,`时间 ${s.slice(-5)}`],x.sourceData=[{type:i,title:n,unit:l,key:r,time:s,value:a}],x.isTarget=!0,x.show=!0}function ce(e){e.setCoords();const t=6e4/D,n=e.prevPoint?e.prevPoint.left+t:E,i=j;e.top<T&&e.set("top",T),e.top>X&&e.set("top",X),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function pe(e,t){if(u(e)&&function(e){const t=Date.parse(d(M.list)),n=c(e);return n>=S&&n<=t}(e.time)){const n=w(e.time),i=b(t.type,t.range,e.value);return[n,i<T?T:i>X?X:i]}}function de(){return v(Array.from(z.values()))}return ee(),function(){if(!V.evented)return;let n=!1,i={x:0,y:0};y.value.on("mouse:up",(e=>{if(3===e.button&&function(e){x.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=E&&t<=j&&n>=T&&n<=X)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=a(e.target);de().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&L.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===L.list.length&&(L.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),F.forEach((n=>{W(de(),t,"key",2*C).includes(n.linkKey||n.key)||L.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===L.list.length&&(L.show=!1,B("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(L,{point:e,show:!0,target:t,list:n})}}(e),1===e.button&&n){n=!1;const e=te();e.length>0?ne((()=>{const t=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return se(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(e);k("remove",t)})):r.emit(q)}})),y.value.on("mouse:down",(e=>{1!==e.button||e.target||(n=!0,i=e.pointer)})),y.value.on("mouse:move",(o=>{if(function(e){if(!P||L.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;x.movable=!1,(i<E||i>j)&&(x.show=!1);if(!t&&i>=E&&i<=j){const e=o>=T&&o<=X,l=o>=$&&o<=_;if(e||l){const l=A(i);x.sourceData=e?N.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:I(t,o)}})):[{type:"tree",time:l}],x.isTarget=!!t,x.point=n,x.movable=!0}else x.show=!1}}(o),!n)return;const{x:l,y:r}=i,{x:s,y:a}=o.pointer;q&&y.value.remove(q),q=new e.Rect({...t,fill:"#CAF982",opacity:.4,...K,left:l,top:r,width:s-l,height:a-r,objectCaching:!0}),q.areaPos={startPos:i,endPos:o.pointer},y.value.add(q)}))}(),{redrawPoints:ae,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(k("remove",n),se(n,"remove")):(Object.assign(n,{data:{time:A(e.pointer.x),value:I(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),k("add",n),se({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:ce,setPopup:ue,updateData:se,getGridPoints:de,getContainPoints:te,showDialog:ne,removeCurrentSelection:ie,pauseFlickerPoint:U}}export{y as useCenter};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as o,watch as l}from"vue";import{useDialog as n}from"naive-ui";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as s}from"date-fns";import{getChildrenSize as d}from"../../utils/index.js";import{cloneDeep as c,range as p,flatten as m}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as h}from"./useTop.js";import{useLeft as f}from"./useLeft.js";import{useCenter as g}from"./useCenter.js";import{useOther as w}from"./useOther.js";function y(y,b,x,j,C,Y,H){var S;const T=n(),D=e(),A=e(),M=e();let X=null;const G=d((null==(S=b.data.top)?void 0:S.treeData)||[]),N=t((()=>b.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),V=t((()=>{var e;return null!=(e=b.data.left.width)?e:0})),k=t((()=>{const{grid:e}=b.data;return e.mainXCell*e.subXCell})),P=t((()=>{const{grid:e}=b.data;return e.mainYCell*e.subYCell})),L=t((()=>{const{show:e=!0,tree:t={}}=b.data.top;if(!e)return 0;const{rowNumber:a=G}=t;return G<a?a:G})),O=t((()=>b.data.top.tree.cellHeight)),E=t((()=>O.value*L.value)),W=t((()=>le(ie("drug")||"top"))),I=t((()=>W.value+E.value)),q=t((()=>{var e;return Date.parse((null==(e=b.data.xAxis)?void 0:e.startTime)||s(new Date,"yyyy-MM-dd HH:mm:ss"))})),z=t((()=>{const e=c(b.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=p(k.value/t+1).map((r=>0===r?e.startTime:s(new Date(q.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:V.value}})),B=function(){const{show:e=!0,tree:t={}}=b.data.top;if(!e)return[];const a=c(b.data.top.treeData);let r=0;const{cellWidth:i,cellHeight:o}=b.data.top.tree,{rowNumber:l=G}=t;G<l&&a.push(...p(l-G).map((()=>({}))));return function e(t,a=0){t.forEach((t=>{var l;const n={top:r*o+W.value,left:a*i,width:i,height:o};if(r++,null==(l=t.children)?void 0:l.length){r--;const i=d(t.children);n.height=i*o,e(t.children,a+1)}else n.width=V.value-n.left;Object.assign(t,n)}))}(a),a}(),F=t((()=>le(ie("xAxis")||"center"))),J=t((()=>{var e;const{width:t,right:a}=b.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),K=t((()=>le(ie("intraoperatively")||"bottom"))),Q=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=b.data.other)?void 0:e.mark)||{};return t&&a?a:0})),R=t((()=>K.value+(b.data.height-E.value-z.value.height-Q.value))),U=t((()=>(J.value-V.value)/k.value)),Z=t((()=>(R.value-K.value)/P.value)),$=t((()=>z.value.spaceTimeStamp/U.value)),_=t((()=>{const{scaleValues:e}=b.data;return m(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),ee=t((()=>ne("pulse"))),te=t((()=>ne("temperature"))),ae=t((()=>{var e;return(null==(e=b.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),re=a({canvasWidth:b.data.width,canvasHeight:b.data.height,borderStyle:{...u,...b.data.borderStyle},pointSelectionStyle:b.data.pointSelectionStyle||{},grid:b.data.grid,top:b.data.top,left:b.data.left,other:b.data.other,topGridYNumber:r(L),topGridYCellHeight:r(O),topGridOriginY:r(W),topGridEndY:r(I),treeData:B,xAxis:r(z),originYXAxis:r(F),startTime:r(q),timeXCell:r($),gridXNumber:r(k),gridYNumber:r(P),xCellWidth:r(U),yCellHeight:r(Z),originX:r(V),endX:r(J),originY:r(K),endY:r(R),markHeight:r(Q),itemList:r(_),scaleValues:b.data.scaleValues,pulseYCell:r(ee),temperatureYCell:r(te),event:r(ae),dialog:T});function ie(e){let t="";return Object.entries(N.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function oe(e){const t=N.value[e],a=z.value.height;switch(t){case"drug":return E.value;case"xAxis":return a;default:return b.data.height-E.value-a}}function le(e){switch(e){case"top":return 0;case"center":return oe("top");default:return oe("top")+oe("center")}}function ne(e){const{scaleValues:t}=b.data,a=t.find((t=>t.type===e));return Z.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await o(),h(y,re,x,C);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:n,showDialog:u,removeCurrentSelection:s}=g(y,re,x,C,Y,H);f(y,re,x,C,a,r,i,l);const{clickMenu:d}=w(y,re,x,C,Y,a,n,u,s);A.value=e,M.value=e=>{const{item:a}=e;a.type&&v.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),H&&l((()=>null==C?void 0:C.point),(()=>{C.movable?(C.show=!0,X&&clearTimeout(X),X=setTimeout((()=>{C.show=!1,C.movable=!1}),3e3)):X&&clearTimeout(X)}),{deep:!0}),{propItems:re,redrawPoints:A,select:D,clickMenu:M}}export{y as useSurgicalAnesthesiaChart};
1
+ import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as o,onBeforeUnmount as l,watch as n}from"vue";import{useDialog as u}from"naive-ui";import{defaultBorderStyle as s}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as d}from"date-fns";import{getChildrenSize as c}from"../../utils/index.js";import{cloneDeep as p,range as m,flatten as v}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{OTHER_MENU as h}from"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as f}from"./useTop.js";import{useLeft as g}from"./useLeft.js";import{useCenter as w}from"./useCenter.js";import{useOther as y}from"./useOther.js";function b(b,x,j,C,Y,H,S){var T;const D=u(),A=e(),M=e(),X=e(),k=e();let G=null;const N=c((null==(T=x.data.top)?void 0:T.treeData)||[]),P=t((()=>x.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),V=t((()=>{var e;return null!=(e=x.data.left.width)?e:0})),L=t((()=>{const{grid:e}=x.data;return e.mainXCell*e.subXCell})),O=t((()=>{const{grid:e}=x.data;return e.mainYCell*e.subYCell})),E=t((()=>{const{show:e=!0,tree:t={}}=x.data.top;if(!e)return 0;const{rowNumber:a=N}=t;return N<a?a:N})),W=t((()=>x.data.top.tree.cellHeight)),I=t((()=>W.value*E.value)),F=t((()=>ue(le("drug")||"top"))),q=t((()=>F.value+I.value)),z=t((()=>{var e;return Date.parse((null==(e=x.data.xAxis)?void 0:e.startTime)||d(new Date,"yyyy-MM-dd HH:mm:ss"))})),B=t((()=>{const e=p(x.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=m(L.value/t+1).map((r=>0===r?e.startTime:d(new Date(z.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:V.value}})),J=function(){const{show:e=!0,tree:t={}}=x.data.top;if(!e)return[];const a=p(x.data.top.treeData);let r=0;const{cellWidth:i,cellHeight:o}=x.data.top.tree,{rowNumber:l=N}=t;N<l&&a.push(...m(l-N).map((()=>({}))));return function e(t,a=0){t.forEach((t=>{var l;const n={top:r*o+F.value,left:a*i,width:i,height:o};if(r++,null==(l=t.children)?void 0:l.length){r--;const i=c(t.children);n.height=i*o,e(t.children,a+1)}else n.width=V.value-n.left;Object.assign(t,n)}))}(a),a}(),K=t((()=>ue(le("xAxis")||"center"))),Q=t((()=>{var e;const{width:t,right:a}=x.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),R=t((()=>ue(le("intraoperatively")||"bottom"))),U=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=x.data.other)?void 0:e.mark)||{};return t&&a?a:0})),Z=t((()=>R.value+(x.data.height-I.value-B.value.height-U.value))),$=t((()=>(Q.value-V.value)/L.value)),_=t((()=>(Z.value-R.value)/O.value)),ee=t((()=>B.value.spaceTimeStamp/$.value)),te=t((()=>{const{scaleValues:e}=x.data;return v(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),ae=t((()=>se("pulse"))),re=t((()=>se("temperature"))),ie=t((()=>{var e;return(null==(e=x.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),oe=a({canvasWidth:x.data.width,canvasHeight:x.data.height,borderStyle:{...s,...x.data.borderStyle},pointSelectionStyle:x.data.pointSelectionStyle||{},grid:x.data.grid,top:x.data.top,left:x.data.left,other:x.data.other,topGridYNumber:r(E),topGridYCellHeight:r(W),topGridOriginY:r(F),topGridEndY:r(q),treeData:J,xAxis:r(B),originYXAxis:r(K),startTime:r(z),timeXCell:r(ee),gridXNumber:r(L),gridYNumber:r(O),xCellWidth:r($),yCellHeight:r(_),originX:r(V),endX:r(Q),originY:r(R),endY:r(Z),markHeight:r(U),itemList:r(te),scaleValues:x.data.scaleValues,pulseYCell:r(ae),temperatureYCell:r(re),event:r(ie),dialog:D});function le(e){let t="";return Object.entries(P.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ne(e){const t=P.value[e],a=B.value.height;switch(t){case"drug":return I.value;case"xAxis":return a;default:return x.data.height-I.value-a}}function ue(e){switch(e){case"top":return 0;case"center":return ne("top");default:return ne("top")+ne("center")}}function se(e){const{scaleValues:t}=x.data,a=t.find((t=>t.type===e));return _.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await o(),f(b,oe,j,Y);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:n,showDialog:u,removeCurrentSelection:s,pauseFlickerPoint:d}=w(b,oe,j,Y,H,S);k.value=d,g(b,oe,j,Y,a,r,i,l);const{clickMenu:c}=y(b,oe,j,Y,H,a,n,u,s);M.value=e,X.value=e=>{const{item:a}=e;a.type&&h.map((e=>e.type)).includes(a.type)?c(e):t(e)}})),l((()=>{k.value()})),S&&n((()=>null==Y?void 0:Y.point),(()=>{Y.movable?(Y.show=!0,G&&clearTimeout(G),G=setTimeout((()=>{Y.show=!1,Y.movable=!1}),3e3)):G&&clearTimeout(G)}),{deep:!0}),{propItems:oe,redrawPoints:M,select:A,clickMenu:X}}export{b as useSurgicalAnesthesiaChart};
@@ -475,9 +475,9 @@ declare const _default: import("vue").DefineComponent<{
475
475
  hide: boolean;
476
476
  }>;
477
477
  draggable: boolean;
478
+ isHighlightRow: boolean;
478
479
  idx: number;
479
480
  isHighlight: boolean;
480
- isHighlightRow: boolean;
481
481
  isFieldSet: boolean;
482
482
  fieldDescribeMode: "column" | "tooltip";
483
483
  }>;
@@ -496,9 +496,9 @@ declare const _default: import("vue").DefineComponent<{
496
496
  hide: boolean;
497
497
  }>;
498
498
  draggable: boolean;
499
+ isHighlightRow: boolean;
499
500
  idx: number;
500
501
  isHighlight: boolean;
501
- isHighlightRow: boolean;
502
502
  isFieldSet: boolean;
503
503
  fieldDescribeMode: "column" | "tooltip";
504
504
  }>;
@@ -613,9 +613,9 @@ declare const _default: import("vue").DefineComponent<{
613
613
  hide: boolean;
614
614
  }>;
615
615
  draggable: boolean;
616
+ isHighlightRow: boolean;
616
617
  idx: number;
617
618
  isHighlight: boolean;
618
- isHighlightRow: boolean;
619
619
  isFieldSet: boolean;
620
620
  fieldDescribeMode: "column" | "tooltip";
621
621
  }>;
@@ -317,9 +317,9 @@ declare const _default: import("vue").DefineComponent<{
317
317
  hide: boolean;
318
318
  }>;
319
319
  draggable: boolean;
320
+ isHighlightRow: boolean;
320
321
  idx: number;
321
322
  isHighlight: boolean;
322
- isHighlightRow: boolean;
323
323
  isFieldSet: boolean;
324
324
  fieldDescribeMode: "column" | "tooltip";
325
325
  }>;
@@ -599,7 +599,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
599
599
  type: (BooleanConstructor | NumberConstructor)[];
600
600
  default: boolean;
601
601
  };
602
- incrementalRender: BooleanConstructor;
603
602
  }, {
604
603
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
605
604
  fieldList: {
@@ -791,7 +790,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
791
790
  type: (BooleanConstructor | NumberConstructor)[];
792
791
  default: boolean;
793
792
  };
794
- incrementalRender: BooleanConstructor;
795
793
  }>> & {
796
794
  onFormChange?: ((...args: any[]) => any) | undefined;
797
795
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -1336,7 +1334,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1336
1334
  type: (BooleanConstructor | NumberConstructor)[];
1337
1335
  default: boolean;
1338
1336
  };
1339
- incrementalRender: BooleanConstructor;
1340
1337
  }>> & {
1341
1338
  onFormChange?: ((...args: any[]) => any) | undefined;
1342
1339
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -1367,7 +1364,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1367
1364
  linebarTextDirection: "horizontal" | "vertical";
1368
1365
  autoWidth: number | boolean;
1369
1366
  operationalFormInit: boolean;
1370
- incrementalRender: boolean;
1371
1367
  }>;
1372
1368
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
1373
1369
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -7170,7 +7166,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
7170
7166
  type: (BooleanConstructor | NumberConstructor)[];
7171
7167
  default: boolean;
7172
7168
  };
7173
- incrementalRender: BooleanConstructor;
7174
7169
  }, {
7175
7170
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
7176
7171
  fieldList: {
@@ -7362,7 +7357,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
7362
7357
  type: (BooleanConstructor | NumberConstructor)[];
7363
7358
  default: boolean;
7364
7359
  };
7365
- incrementalRender: BooleanConstructor;
7366
7360
  }>> & {
7367
7361
  onFormChange?: ((...args: any[]) => any) | undefined;
7368
7362
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -7907,7 +7901,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
7907
7901
  type: (BooleanConstructor | NumberConstructor)[];
7908
7902
  default: boolean;
7909
7903
  };
7910
- incrementalRender: BooleanConstructor;
7911
7904
  }>> & {
7912
7905
  onFormChange?: ((...args: any[]) => any) | undefined;
7913
7906
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -7938,7 +7931,6 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
7938
7931
  linebarTextDirection: "horizontal" | "vertical";
7939
7932
  autoWidth: number | boolean;
7940
7933
  operationalFormInit: boolean;
7941
- incrementalRender: boolean;
7942
7934
  }>;
7943
7935
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
7944
7936
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -602,7 +602,6 @@ declare const _default: import("vue").DefineComponent<{
602
602
  type: (BooleanConstructor | NumberConstructor)[];
603
603
  default: boolean;
604
604
  };
605
- incrementalRender: BooleanConstructor;
606
605
  }, {
607
606
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
608
607
  fieldList: {
@@ -794,7 +793,6 @@ declare const _default: import("vue").DefineComponent<{
794
793
  type: (BooleanConstructor | NumberConstructor)[];
795
794
  default: boolean;
796
795
  };
797
- incrementalRender: BooleanConstructor;
798
796
  }>> & {
799
797
  onFormChange?: ((...args: any[]) => any) | undefined;
800
798
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -1339,7 +1337,6 @@ declare const _default: import("vue").DefineComponent<{
1339
1337
  type: (BooleanConstructor | NumberConstructor)[];
1340
1338
  default: boolean;
1341
1339
  };
1342
- incrementalRender: BooleanConstructor;
1343
1340
  }>> & {
1344
1341
  onFormChange?: ((...args: any[]) => any) | undefined;
1345
1342
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -1370,7 +1367,6 @@ declare const _default: import("vue").DefineComponent<{
1370
1367
  linebarTextDirection: "horizontal" | "vertical";
1371
1368
  autoWidth: number | boolean;
1372
1369
  operationalFormInit: boolean;
1373
- incrementalRender: boolean;
1374
1370
  }>;
1375
1371
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
1376
1372
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -7173,7 +7169,6 @@ declare const _default: import("vue").DefineComponent<{
7173
7169
  type: (BooleanConstructor | NumberConstructor)[];
7174
7170
  default: boolean;
7175
7171
  };
7176
- incrementalRender: BooleanConstructor;
7177
7172
  }, {
7178
7173
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
7179
7174
  fieldList: {
@@ -7365,7 +7360,6 @@ declare const _default: import("vue").DefineComponent<{
7365
7360
  type: (BooleanConstructor | NumberConstructor)[];
7366
7361
  default: boolean;
7367
7362
  };
7368
- incrementalRender: BooleanConstructor;
7369
7363
  }>> & {
7370
7364
  onFormChange?: ((...args: any[]) => any) | undefined;
7371
7365
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -7910,7 +7904,6 @@ declare const _default: import("vue").DefineComponent<{
7910
7904
  type: (BooleanConstructor | NumberConstructor)[];
7911
7905
  default: boolean;
7912
7906
  };
7913
- incrementalRender: BooleanConstructor;
7914
7907
  }>> & {
7915
7908
  onFormChange?: ((...args: any[]) => any) | undefined;
7916
7909
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -7941,7 +7934,6 @@ declare const _default: import("vue").DefineComponent<{
7941
7934
  linebarTextDirection: "horizontal" | "vertical";
7942
7935
  autoWidth: number | boolean;
7943
7936
  operationalFormInit: boolean;
7944
- incrementalRender: boolean;
7945
7937
  }>;
7946
7938
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
7947
7939
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -211,7 +211,6 @@ declare const _default: import("vue").DefineComponent<{}, {
211
211
  type: (BooleanConstructor | NumberConstructor)[];
212
212
  default: boolean;
213
213
  };
214
- incrementalRender: BooleanConstructor;
215
214
  }, {
216
215
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
217
216
  fieldList: {
@@ -403,7 +402,6 @@ declare const _default: import("vue").DefineComponent<{}, {
403
402
  type: (BooleanConstructor | NumberConstructor)[];
404
403
  default: boolean;
405
404
  };
406
- incrementalRender: BooleanConstructor;
407
405
  }>> & {
408
406
  onFormChange?: ((...args: any[]) => any) | undefined;
409
407
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -948,7 +946,6 @@ declare const _default: import("vue").DefineComponent<{}, {
948
946
  type: (BooleanConstructor | NumberConstructor)[];
949
947
  default: boolean;
950
948
  };
951
- incrementalRender: BooleanConstructor;
952
949
  }>> & {
953
950
  onFormChange?: ((...args: any[]) => any) | undefined;
954
951
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -979,7 +976,6 @@ declare const _default: import("vue").DefineComponent<{}, {
979
976
  linebarTextDirection: "horizontal" | "vertical";
980
977
  autoWidth: number | boolean;
981
978
  operationalFormInit: boolean;
982
- incrementalRender: boolean;
983
979
  }>;
984
980
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
985
981
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -5688,7 +5688,6 @@ declare const _default: import("vue").DefineComponent<{
5688
5688
  type: (BooleanConstructor | NumberConstructor)[];
5689
5689
  default: boolean;
5690
5690
  };
5691
- incrementalRender: BooleanConstructor;
5692
5691
  }, {
5693
5692
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
5694
5693
  fieldList: {
@@ -5880,7 +5879,6 @@ declare const _default: import("vue").DefineComponent<{
5880
5879
  type: (BooleanConstructor | NumberConstructor)[];
5881
5880
  default: boolean;
5882
5881
  };
5883
- incrementalRender: BooleanConstructor;
5884
5882
  }>> & {
5885
5883
  onFormChange?: ((...args: any[]) => any) | undefined;
5886
5884
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -6425,7 +6423,6 @@ declare const _default: import("vue").DefineComponent<{
6425
6423
  type: (BooleanConstructor | NumberConstructor)[];
6426
6424
  default: boolean;
6427
6425
  };
6428
- incrementalRender: BooleanConstructor;
6429
6426
  }>> & {
6430
6427
  onFormChange?: ((...args: any[]) => any) | undefined;
6431
6428
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -6456,7 +6453,6 @@ declare const _default: import("vue").DefineComponent<{
6456
6453
  linebarTextDirection: "horizontal" | "vertical";
6457
6454
  autoWidth: number | boolean;
6458
6455
  operationalFormInit: boolean;
6459
- incrementalRender: boolean;
6460
6456
  }>;
6461
6457
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
6462
6458
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -198,7 +198,6 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
198
198
  type: (BooleanConstructor | NumberConstructor)[];
199
199
  default: boolean;
200
200
  };
201
- incrementalRender: BooleanConstructor;
202
201
  }, {
203
202
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
204
203
  fieldList: {
@@ -390,7 +389,6 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
390
389
  type: (BooleanConstructor | NumberConstructor)[];
391
390
  default: boolean;
392
391
  };
393
- incrementalRender: BooleanConstructor;
394
392
  }>> & {
395
393
  onFormChange?: ((...args: any[]) => any) | undefined;
396
394
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -935,7 +933,6 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
935
933
  type: (BooleanConstructor | NumberConstructor)[];
936
934
  default: boolean;
937
935
  };
938
- incrementalRender: BooleanConstructor;
939
936
  }>> & {
940
937
  onFormChange?: ((...args: any[]) => any) | undefined;
941
938
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -966,7 +963,6 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
966
963
  linebarTextDirection: "horizontal" | "vertical";
967
964
  autoWidth: number | boolean;
968
965
  operationalFormInit: boolean;
969
- incrementalRender: boolean;
970
966
  }>;
971
967
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
972
968
  export default FormRender;
@@ -193,7 +193,6 @@ declare const _default: import("vue").DefineComponent<{
193
193
  type: (BooleanConstructor | NumberConstructor)[];
194
194
  default: boolean;
195
195
  };
196
- incrementalRender: BooleanConstructor;
197
196
  }, {
198
197
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
199
198
  fieldList: {
@@ -385,7 +384,6 @@ declare const _default: import("vue").DefineComponent<{
385
384
  type: (BooleanConstructor | NumberConstructor)[];
386
385
  default: boolean;
387
386
  };
388
- incrementalRender: BooleanConstructor;
389
387
  }>> & {
390
388
  onFormChange?: ((...args: any[]) => any) | undefined;
391
389
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -930,7 +928,6 @@ declare const _default: import("vue").DefineComponent<{
930
928
  type: (BooleanConstructor | NumberConstructor)[];
931
929
  default: boolean;
932
930
  };
933
- incrementalRender: BooleanConstructor;
934
931
  }>> & {
935
932
  onFormChange?: ((...args: any[]) => any) | undefined;
936
933
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -961,6 +958,5 @@ declare const _default: import("vue").DefineComponent<{
961
958
  linebarTextDirection: "horizontal" | "vertical";
962
959
  autoWidth: number | boolean;
963
960
  operationalFormInit: boolean;
964
- incrementalRender: boolean;
965
961
  }>;
966
962
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,provide as t,computed as r,onUnmounted as a,openBlock as s,createBlock as i,unref as l,mergeProps as n,withCtx as m,createElementBlock as d,createVNode as p,isRef as u,Fragment as c,renderList as f,createCommentVNode as h,createElementVNode as y,normalizeStyle as g,toDisplayString as b,renderSlot as j}from"vue";import{useTheme as v}from"../../../shared/hooks/useTheme.js";import{useElementSize as k}from"@vueuse/core";import"date-fns";import{isNumber as F,cloneDeep as C}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NForm as S,NTabs as w,NTabPane as H,NConfigProvider as x}from"naive-ui";import{useVersion as B}from"../../../shared/hooks/useVersion.js";import{createForm as A,onFormMount as L,onFieldValueChange as R,onFieldMount as O,onFieldUnmount as V,onFieldReact as I}from"@formily/core";import{Path as _}from"@formily/path";import{FormProvider as D,FormConsumer as N}from"@formily/vue";import{InjectionFormColumnWidth as T,InjectionFormLifeCycleCaller as W,InjectionFormGraph as U}from"./constants/index.js";import{createObjSchema as q}from"./utils/schema.js";import{useAnchor as E}from"./hooks/useAnchor.js";import{useAutoHidden as G}from"./hooks/useAutoHidden.js";import"../index.js";import{useComplexOptionsSpan as M}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as K}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{useFieldVisitor as P}from"./hooks/useFieldVisitor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import{useFormDomEvent as J,useFormExposeEvent as $}from"./hooks/useFormEvent.js";import{useFormGraph as Q}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";import{useNewLowCodeReactions as ae}from"./hooks/useNewLowCodeReactions.js";const se={key:0,style:{height:"54px"}},ie={style:{"white-space":"pre"}};var le=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},annotationShortcuts:{type:Array},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},autoExpand:Boolean,lowCodeReactions:{type:Array},newLowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},labelPlacementOverwrite:Boolean,outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean,wordSplitFilter:{type:Boolean,default:!0},selectMode:Boolean,selectedFields:{type:Array},linebarDirection:{type:String,default:"vertical"},linebarTextDirection:{type:String,default:"horizontal"},linebarWidth:{type:[Number,String],default:120},autoWidth:{type:[Boolean,Number],default:!1},incrementalRender:Boolean},emits:["formChange","annotationChange","scroll","update:selectedFields","linebarChange"],setup(e,{expose:le,emit:ne}){const me=e,de=v(),{nuiThemeOverrides:pe}=oe();Y();const ue=o(),{width:ce}=k(ue);t(T,r((()=>ce.value?(ce.value-16*(me.column-1))/24:0)));const fe=r((()=>F(me.maxHeight)?me.maxHeight+"px":me.maxHeight)),{SchemaField:he,businessCollector:ye,formItemDepsCollector:ge,changeContextCollector:be,formUUID:je}=z(me,ne),{anchorBarRef:ve,currentAnchor:ke,updateAnchorList:Fe,anchorIdList:Ce,onScroll:Se}=E(me,ne,ue,ge),{callLifeCycle:we}=X(me);t(W,we),we("onSetup");const{trigger:He}=G(),{observeFormGraph:xe,setGraph:Be,removeGraph:Ae}=Q();t(U,xe);const{lowCodeEventTrigger:Le}=Z(),Re=A({initialValues:me.initialData,effects(e){const o={};L((()=>{Object.assign(o,C(e.values))})),R("*",(t=>{const r=_.getIn(o,t.path);_.setIn(o,t.path,t.value);const a=t.props.name.toString();ye.trigger(e,a),ge.trigger(t.path),ne("formChange",{fieldInstance:t,fieldKey:a,oldValue:r,fieldName:t.title,value:t.value,context:be.getContext(a,t.value)}),Le(t),Oe(a),Ve(a),Ie.trigger(a),_e.trigger(a,t.value)})),O("*",Be),O("*",(e=>{const o=e.props.name.toString();Oe(o),Ve(o),me.operationalFormInit&&Ie.trigger(o)})),V("*",Ae),I("*",(e=>He(e,me.linebarAutoHidden))),L((e=>e.query("*").forEach((e=>He(e,me.linebarAutoHidden))))),me.anchor&&I("*",Fe)}}),{lowCodeReactionsHandler:Oe}=ee(r((()=>me.lowCodeReactions)),Re),{newLowCodeReactionsHandler:Ve}=ae(r((()=>me.newLowCodeReactions)),Re),Ie=te(me,Re),_e=re().create(Re,be),{schemaAdaptor:De}=K(ye,me.lifeCycle);let Ne=me.fieldList||[];const Te=r((()=>me.schema?me.schema:me.fieldList?(Ne=P().traverse(C(me.fieldList),me.fieldVisitor),q(De(Ne,me))):q({}))),{onKeydown:We}=J({formModel:Re,formRenderRef:ue,props:me,formUUID:je}),{clearSpan:Ue}=M();a((()=>Ue(je)));const qe=$({formModel:Re,formRenderRef:ue,formItemDepsCollector:ge,businessCollector:ye,wordbookSettingHandler:_e,operationalFormHandler:Ie,getFieldList:()=>Ne,formUUID:je,changeContextCollector:be});return le({formModel:Re,validate:(e="*",o={})=>qe.validate(e,o),getFormValues:(e=!0)=>qe.getFormValues(e),setFormValues:async(e,o={})=>qe.setFormValues(e,o),setFieldState(e,o){qe.setFieldState(e,o)},resetFields(e="*"){qe.resetFields(e)},queryWidget:async e=>qe.queryWidget(e),getFieldList:()=>Ne,applySelectedSetting:e=>qe.applySelectedSetting(e),async reload(){console.error("reload function is abstract,it should be overwrite!")},getTextFormValues:()=>qe.getTextFormValues()}),(o,t)=>(s(),i(l(S),n({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:l(de)},l(B)(),{uuid:l(je)}),{default:m((()=>[e.anchor?(s(),d("section",se,[p(l(w),{value:l(ke),"onUpdate:value":t[0]||(t[0]=e=>u(ke)?ke.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ve},{default:m((()=>[(s(!0),d(c,null,f(l(Ce),(e=>(s(),i(l(H),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):h("v-if",!0),p(l(x),{"theme-overrides":l(pe)},{default:m((()=>[y("section",{class:"form-render__wrapper",style:g({"--column":e.column,"--form-height":l(fe)}),ref_key:"formRenderRef",ref:ue,onScroll:t[1]||(t[1]=(...e)=>l(Se)&&l(Se)(...e)),onKeydownCapture:t[2]||(t[2]=(...e)=>l(We)&&l(We)(...e))},[p(l(D),{form:l(Re)},{default:m((()=>[p(l(he),{schema:l(Te)},null,8,["schema"]),e.consumer?(s(),i(l(N),{key:0},{default:m((({form:e})=>[y("div",ie,b(JSON.stringify(e.values,null,2)),1)])),_:1})):h("v-if",!0),j(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style","uuid"]))}});export{le as default};
1
+ import{defineComponent as e,ref as o,provide as t,computed as r,onUnmounted as a,openBlock as s,createBlock as i,unref as l,mergeProps as n,withCtx as m,createElementBlock as d,createVNode as p,isRef as u,Fragment as c,renderList as f,createCommentVNode as h,createElementVNode as y,normalizeStyle as g,toDisplayString as b,renderSlot as j}from"vue";import{useTheme as v}from"../../../shared/hooks/useTheme.js";import{useElementSize as k}from"@vueuse/core";import"date-fns";import{isNumber as F,cloneDeep as C}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NForm as S,NTabs as w,NTabPane as H,NConfigProvider as x}from"naive-ui";import{useVersion as A}from"../../../shared/hooks/useVersion.js";import{createForm as B,onFormMount as L,onFieldValueChange as R,onFieldMount as O,onFieldUnmount as V,onFieldReact as I}from"@formily/core";import{Path as _}from"@formily/path";import{FormProvider as D,FormConsumer as N}from"@formily/vue";import{InjectionFormColumnWidth as T,InjectionFormLifeCycleCaller as W,InjectionFormGraph as U}from"./constants/index.js";import{createObjSchema as q}from"./utils/schema.js";import{useAnchor as E}from"./hooks/useAnchor.js";import{useAutoHidden as G}from"./hooks/useAutoHidden.js";import"../index.js";import{useComplexOptionsSpan as M}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as K}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{useFieldVisitor as P}from"./hooks/useFieldVisitor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import{useFormDomEvent as J,useFormExposeEvent as $}from"./hooks/useFormEvent.js";import{useFormGraph as Q}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";import{useNewLowCodeReactions as ae}from"./hooks/useNewLowCodeReactions.js";const se={key:0,style:{height:"54px"}},ie={style:{"white-space":"pre"}};var le=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},annotationShortcuts:{type:Array},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},autoExpand:Boolean,lowCodeReactions:{type:Array},newLowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},labelPlacementOverwrite:Boolean,outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean,wordSplitFilter:{type:Boolean,default:!0},selectMode:Boolean,selectedFields:{type:Array},linebarDirection:{type:String,default:"vertical"},linebarTextDirection:{type:String,default:"horizontal"},linebarWidth:{type:[Number,String],default:120},autoWidth:{type:[Boolean,Number],default:!1}},emits:["formChange","annotationChange","scroll","update:selectedFields","linebarChange"],setup(e,{expose:le,emit:ne}){const me=e,de=v(),{nuiThemeOverrides:pe}=oe();Y();const ue=o(),{width:ce}=k(ue);t(T,r((()=>ce.value?(ce.value-16*(me.column-1))/24:0)));const fe=r((()=>F(me.maxHeight)?me.maxHeight+"px":me.maxHeight)),{SchemaField:he,businessCollector:ye,formItemDepsCollector:ge,changeContextCollector:be,formUUID:je}=z(me,ne),{anchorBarRef:ve,currentAnchor:ke,updateAnchorList:Fe,anchorIdList:Ce,onScroll:Se}=E(me,ne,ue,ge),{callLifeCycle:we}=X(me);t(W,we),we("onSetup");const{trigger:He}=G(),{observeFormGraph:xe,setGraph:Ae,removeGraph:Be}=Q();t(U,xe);const{lowCodeEventTrigger:Le}=Z(),Re=B({initialValues:me.initialData,effects(e){const o={};L((()=>{Object.assign(o,C(e.values))})),R("*",(t=>{const r=_.getIn(o,t.path);_.setIn(o,t.path,t.value);const a=t.props.name.toString();ye.trigger(e,a),ge.trigger(t.path),ne("formChange",{fieldInstance:t,fieldKey:a,oldValue:r,fieldName:t.title,value:t.value,context:be.getContext(a,t.value)}),Le(t),Oe(a),Ve(a),Ie.trigger(a),_e.trigger(a,t.value)})),O("*",Ae),O("*",(e=>{const o=e.props.name.toString();Oe(o),Ve(o),me.operationalFormInit&&Ie.trigger(o)})),V("*",Be),I("*",(e=>He(e,me.linebarAutoHidden))),L((e=>e.query("*").forEach((e=>He(e,me.linebarAutoHidden))))),me.anchor&&I("*",Fe)}}),{lowCodeReactionsHandler:Oe}=ee(r((()=>me.lowCodeReactions)),Re),{newLowCodeReactionsHandler:Ve}=ae(r((()=>me.newLowCodeReactions)),Re),Ie=te(me,Re),_e=re().create(Re,be),{schemaAdaptor:De}=K(ye,me.lifeCycle);let Ne=me.fieldList||[];const Te=r((()=>me.schema?me.schema:me.fieldList?(Ne=P().traverse(C(me.fieldList),me.fieldVisitor),q(De(Ne,me))):q({}))),{onKeydown:We}=J({formModel:Re,formRenderRef:ue,props:me,formUUID:je}),{clearSpan:Ue}=M();a((()=>Ue(je)));const qe=$({formModel:Re,formRenderRef:ue,formItemDepsCollector:ge,businessCollector:ye,wordbookSettingHandler:_e,operationalFormHandler:Ie,getFieldList:()=>Ne,formUUID:je,changeContextCollector:be});return le({formModel:Re,validate:(e="*",o={})=>qe.validate(e,o),getFormValues:(e=!0)=>qe.getFormValues(e),setFormValues:async(e,o={})=>qe.setFormValues(e,o),setFieldState(e,o){qe.setFieldState(e,o)},resetFields(e="*"){qe.resetFields(e)},queryWidget:async e=>qe.queryWidget(e),getFieldList:()=>Ne,applySelectedSetting:e=>qe.applySelectedSetting(e),async reload(){console.error("reload function is abstract,it should be overwrite!")},getTextFormValues:()=>qe.getTextFormValues()}),(o,t)=>(s(),i(l(S),n({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:l(de)},l(A)(),{uuid:l(je)}),{default:m((()=>[e.anchor?(s(),d("section",se,[p(l(w),{value:l(ke),"onUpdate:value":t[0]||(t[0]=e=>u(ke)?ke.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ve},{default:m((()=>[(s(!0),d(c,null,f(l(Ce),(e=>(s(),i(l(H),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):h("v-if",!0),p(l(x),{"theme-overrides":l(pe)},{default:m((()=>[y("section",{class:"form-render__wrapper",style:g({"--column":e.column,"--form-height":l(fe)}),ref_key:"formRenderRef",ref:ue,onScroll:t[1]||(t[1]=(...e)=>l(Se)&&l(Se)(...e)),onKeydownCapture:t[2]||(t[2]=(...e)=>l(We)&&l(We)(...e))},[p(l(D),{form:l(Re)},{default:m((()=>[p(l(he),{schema:l(Te)},null,8,["schema"]),e.consumer?(s(),i(l(N),{key:0},{default:m((({form:e})=>[y("div",ie,b(JSON.stringify(e.values,null,2)),1)])),_:1})):h("v-if",!0),j(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style","uuid"]))}});export{le as default};