cnhis-design-vue 3.2.9-beta.8 → 3.2.9-release.3

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 (111) hide show
  1. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  2. package/es/components/base-search/index.d.ts +2 -0
  3. package/es/components/base-search/src/index.vue.d.ts +2 -0
  4. package/es/components/button-print/index.d.ts +30 -13
  5. package/es/components/button-print/src/ButtonPrint.vue.d.ts +30 -13
  6. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  7. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +9 -4
  8. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  9. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -4
  10. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  11. package/es/components/button-print/src/utils/print.d.ts +8 -6
  12. package/es/components/button-print/src/utils/print.js +1 -1
  13. package/es/components/classification/index.d.ts +87 -0
  14. package/es/components/classification/src/components/search-filter/index.vue.d.ts +87 -0
  15. package/es/components/classification/src/components/set-classification/index.vue.d.ts +87 -0
  16. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  17. package/es/components/classification/src/index.vue.d.ts +87 -0
  18. package/es/components/date-picker/index.d.ts +29 -0
  19. package/es/components/date-picker/src/DatePicker.vue.d.ts +30 -1
  20. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  23. package/es/components/field-set/index.d.ts +8 -1
  24. package/es/components/field-set/src/FieldColor.vue.d.ts +89 -6
  25. package/es/components/field-set/src/FieldColor.vue2.js +1 -1
  26. package/es/components/field-set/src/FieldFilter.vue.d.ts +31 -6
  27. package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
  28. package/es/components/field-set/src/FieldSet.vue.d.ts +73 -30
  29. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  30. package/es/components/field-set/src/Index.vue.d.ts +8 -1
  31. package/es/components/field-set/src/Index.vue2.js +1 -1
  32. package/es/components/field-set/src/TableStyle.vue2.js +1 -1
  33. package/es/components/field-set/src/components/condition.vue.d.ts +29 -0
  34. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +58 -0
  35. package/es/components/field-set/src/components/edit-filter.vue.d.ts +29 -0
  36. package/es/components/field-set/src/components/table-row.vue.d.ts +28 -1
  37. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  38. package/es/components/field-set/src/types/index.d.ts +4 -3
  39. package/es/components/field-set/src/utils/index.js +1 -1
  40. package/es/components/field-set/style/index.css +1 -1
  41. package/es/components/form-render/src/components/renderer/select.d.ts +2 -1
  42. package/es/components/form-render/src/components/renderer/select.js +1 -1
  43. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  44. package/es/components/iho-chat/index.d.ts +316 -6
  45. package/es/components/iho-chat/src/Index.vue.d.ts +316 -6
  46. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  47. package/es/components/iho-chat/src/api/index.js +1 -1
  48. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +5 -0
  49. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  50. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +121 -1
  51. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  52. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +6 -0
  53. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  54. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +160 -2
  55. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +122 -0
  56. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  57. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +29 -0
  58. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  59. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +6 -1
  60. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  61. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  62. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +5 -0
  63. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  64. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +1 -3
  65. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  66. package/es/components/iho-chat/src/constants/index.d.ts +2 -1
  67. package/es/components/iho-chat/src/constants/index.js +1 -1
  68. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
  69. package/es/components/iho-chat/src/hooks/useSession.js +1 -1
  70. package/es/components/iho-chat/src/hooks/useState.d.ts +6 -0
  71. package/es/components/iho-chat/src/hooks/useState.js +1 -1
  72. package/es/components/iho-chat/src/types/index.d.ts +3 -1
  73. package/es/components/iho-chat/src/types/index.js +1 -1
  74. package/es/components/iho-chat/src/utils/chatSock.js +1 -1
  75. package/es/components/iho-chat/style/index.css +1 -1
  76. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +29 -0
  77. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +29 -0
  78. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.js +1 -1
  79. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useRowHeight.d.ts +2 -0
  80. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useRowHeight.js +1 -0
  81. package/es/components/iho-table/src/types/index.d.ts +3 -0
  82. package/es/components/iho-table/style/index.css +1 -1
  83. package/es/components/index.css +1 -1
  84. package/es/components/quick-search/index.d.ts +3 -0
  85. package/es/components/quick-search/src/index.vue.d.ts +3 -0
  86. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  87. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +29 -0
  88. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +29 -0
  89. package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +29 -0
  90. package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +29 -0
  91. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +58 -0
  92. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +29 -0
  93. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +29 -0
  94. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +58 -0
  95. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +58 -0
  96. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +29 -0
  97. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +29 -0
  98. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +29 -0
  99. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +29 -0
  100. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +116 -0
  101. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +116 -0
  102. package/es/components/table-filter/src/hooks/useAdvanced.d.ts +1 -0
  103. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  104. package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
  105. package/es/components/table-filter/src/types/index.d.ts +2 -0
  106. package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +1 -1
  107. package/es/env.d.ts +25 -25
  108. package/es/shared/package.json.js +1 -1
  109. package/es/shared/utils/index.d.ts +1 -0
  110. package/es/shared/utils/index.js +1 -1
  111. package/package.json +2 -2
@@ -96,7 +96,6 @@ declare const _default: import("vue").DefineComponent<{
96
96
  };
97
97
  printCopies: {
98
98
  type: NumberConstructor;
99
- default: number;
100
99
  };
101
100
  resolution: {
102
101
  type: NumberConstructor;
@@ -108,6 +107,9 @@ declare const _default: import("vue").DefineComponent<{
108
107
  placement: {
109
108
  type: StringConstructor;
110
109
  };
110
+ svrUpdateIp: {
111
+ type: StringConstructor;
112
+ };
111
113
  }, {
112
114
  $attrs: {
113
115
  [x: string]: unknown;
@@ -210,7 +212,6 @@ declare const _default: import("vue").DefineComponent<{
210
212
  };
211
213
  printCopies: {
212
214
  type: NumberConstructor;
213
- default: number;
214
215
  };
215
216
  resolution: {
216
217
  type: NumberConstructor;
@@ -222,6 +223,9 @@ declare const _default: import("vue").DefineComponent<{
222
223
  placement: {
223
224
  type: StringConstructor;
224
225
  };
226
+ svrUpdateIp: {
227
+ type: StringConstructor;
228
+ };
225
229
  }>> & {}>>;
226
230
  emit: any;
227
231
  defaultFormatInfo: AnyObject;
@@ -553,7 +557,6 @@ declare const _default: import("vue").DefineComponent<{
553
557
  };
554
558
  printCopies: {
555
559
  type: NumberConstructor;
556
- default: number;
557
560
  };
558
561
  resolution: {
559
562
  type: NumberConstructor;
@@ -565,6 +568,9 @@ declare const _default: import("vue").DefineComponent<{
565
568
  placement: {
566
569
  type: StringConstructor;
567
570
  };
571
+ svrUpdateIp: {
572
+ type: StringConstructor;
573
+ };
568
574
  }>>, {
569
575
  params: AnyObject[];
570
576
  btnText: string;
@@ -588,7 +594,6 @@ declare const _default: import("vue").DefineComponent<{
588
594
  }>;
589
595
  showLoading: boolean;
590
596
  hideButtons: unknown[];
591
- printCopies: number;
592
597
  printCustomProps: Record<string, any>;
593
598
  }>;
594
599
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as t,useAttrs as e,inject as n,ref as i,reactive as r,computed as a,onMounted as o,watch as l,openBlock as s,createElementBlock as p,Fragment as d,createVNode as u,unref as m,withCtx as c,renderSlot as f,withModifiers as v,createTextVNode as y,toDisplayString as g,mergeProps as b}from"vue";import{isObject as I}from"@vue/shared";import{useMessage as h,NDropdown as P,NButton as w,NIcon as F}from"naive-ui";import{ChevronDown as k}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as x}from"../constants/index.js";import{Print as T}from"../utils/print.js";import{isIReport as S}from"../utils/browserPrint.js";import E from"./IdentityVerification.vue.js";import{format as j}from"date-fns";import{savePrivateFormatApi as M,getPrivateFormatApi as O}from"../api.js";var L=t({__name:"OldPrintComponent",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},noDefaultFormatMsg:{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},resolution:{type:Number},printCustomProps:{type:Object,default:()=>({})},placement:{type:String}},setup(t,{expose:L}){var D;const R=t,C=e(),N=h();let V;const B=n(x),z={},A=i(""),J=r({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,iReportExecuteMode:1});let U=i([{label:R.printText,key:"printText"},{label:R.previewText,key:"previewText"},{label:R.pdfLoadText,key:"downloadPdf"},{label:R.formatEditText,key:"formatEditText"},...(null==(D=R.externalOptionConfig)?void 0:D.options)||[]]);const q=a((()=>{if(!J.currentFormatId)return{};let t=J.currentFormatId;return J.formatList.find((e=>e.id===t))})),K=a((()=>{var t;return(null==(t=q.value)?void 0:t.name)||"格式选择"})),_=a((()=>{let t=J.formatList.find((t=>t.id===J.currentFormatId));return null==t?void 0:t.templateId})),G=async t=>{if(R.directPrint){if(J.spinning)return;return"button"===t?void await ut():st()}return st()},H=t=>u("span",{class:{active:t.key===J.currentFormatId}},[t.label]),Y=(t,e)=>{J.spinning=!1;let n={type:e,formatId:J.currentFormatId,templateId:_.value};B("success",t,n)},$=t=>{J.spinning=!1,B("error",t),I(t)&&"notInstalledApp"===t.type&&N.error(t.message)},Q=t=>{J.spinning=!1,B("cancel",t)},W=t=>{B("error",{message:"前置条件执行错误",type:t,preExecution:!0})},X=(t=0)=>{var e;const n=(null==(e=R.printParams)?void 0:e.length)?R.printParams[t]:J.printParams[t];return JSON.stringify({...n||{},...R.token?{token:R.token}:{},...R.printCustomProps||{}})},Z=()=>{var t,e;let n={},i={};if(null==(t=J.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(J.printParams[0].datasetData||{}))?void 0:e[0])||"",n=JSON.stringify(J.printParams.map((e=>JSON.parse(e.datasetData[t]))));i={datasetData:{}},i.datasetData[t]=n}else Object.keys(J.printParams[0]).forEach((t=>{i[t]=[],J.printParams.forEach((e=>{i[t].includes(e[t])||i[t].push(e[t])})),i[t]=i[t].join(",")}));return n=Object.assign({},JSON.parse(X(0)),i),JSON.stringify(n)},tt=((t,e,n=!0)=>{let i=null;return function(...r){i&&clearTimeout(i),n&&!i&&t.apply(null,r),i=setTimeout((()=>{i=null,!n&&t.apply(null,r)}),e)}})((()=>{let t=J.printParams.length;const e=async e=>{try{--t<=0&&Y(e,"print")}catch(t){console.log("error",t)}};R.showLoading&&J.spinning||(J.spinning=!0,R.prevFn("print",{formatId:J.currentFormatId,templateId:_.value}).then((()=>{const t={iReportExecuteMode:J.iReportExecuteMode,formatId:J.currentFormatId,templateId:_.value,authorizationKey:A.value,printdlgshow:R.printdlgshow,signature:R.signature,copies:R.printCopies};if("MULTI"===R.strategy)for(let n=0;n<J.printParams.length;n++)n>0&&(t.printdlgshow="0"),V.printDirect({...t,params:X(n)},e,$,Q);else V.printDirect({...t,params:Z()},(t=>{Y(t,"print")}),$,Q)})).catch((()=>{W("print"),J.spinning=!1})).finally((()=>{J.visible=!1})))}),800,!0),et=async(t,e)=>{var n,i;switch(t){case"printText":tt();break;case"previewText":(async()=>{R.showLoading&&J.spinning||(J.spinning=!0,R.prevFn("preview",{formatId:J.currentFormatId,templateId:_.value}).then((()=>{const t="MULTI"===R.strategy?X():Z(),e={formatId:J.currentFormatId,iReportExecuteMode:J.iReportExecuteMode,templateId:_.value,authorizationKey:A.value,params:t,btnprint:R.btnprint,signature:R.signature};V.preview(e,(t=>{Y(t,"preview")}),$)})).catch((()=>{W("preview"),J.spinning=!1})).finally((()=>{J.visible=!1})))})();break;case"formatEditText":R.showLoading&&J.spinning||(J.spinning=!0,R.prevFn("edit",{formatId:J.currentFormatId,templateId:_.value}).then((()=>{J.identityVerification.visible=!0})).catch((()=>{W("edit")})).finally((()=>{J.visible=!1,J.spinning=!1})));break;case"downloadPdf":(async()=>{R.showLoading&&J.spinning||(J.spinning=!0,R.prevFn("download",{formatId:J.currentFormatId,templateId:_.value}).then((()=>{const t="MULTI"===R.strategy?X():Z(),e={formatId:J.currentFormatId,iReportExecuteMode:J.iReportExecuteMode,templateId:_.value,authorizationKey:A.value,print:{print:"1",type:"1",resolution:null==R?void 0:R.resolution},params:t,signature:R.signature};V.downloadPDF(e,(t=>Y(t,"preview")),$)})).catch((()=>{W("download"),J.spinning=!1})).finally((()=>{J.visible=!1})))})();break;default:{J.visible=!1;const r=J.formatList.find((e=>e.id===t))||{};if(Object.keys(r).length>0){J.currentFormatId=t;const[e]=U.value;e.label=(null==r?void 0:r.name)||e.label,await M({formatForms:[{...r}],name:z.name||r.templateName,number:z.number||r.number,templateId:z.templateId||r.templateId,...z.id?{id:z.id}:{}},{token:R.token})}else null==(i=null==(n=R.externalOptionConfig)?void 0:n.onSelect)||i.call(n,t,e);break}}},nt=()=>{J.visible=!1,B("clickoutside")},it=()=>(J.isInited=!1,J.spinning=!1,setTimeout((()=>{J.visible=!1}),0),!1),rt=(t,e,n)=>{const i={};return e.forEach((e=>{let r=((t,e)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let i=e;return Object.keys(n).includes(t.type)&&e&&e instanceof Date&&(i=j(e,n[t.type])),(null==t?void 0:t.defaultValue)||i})(e,t[e[n]]);t[e[n]]&&r&&(i[e[n]]=r)})),i},at=({customizeDataset:t=[],param:e=[]},n=[])=>n.map((n=>{let i={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;i.datasetData={[t.name]:JSON.stringify(rt(n,e,"fieldName"))}})),i=Object.assign({},i,rt(n,e,"key")),i})),ot=async t=>{var e,n;if(J.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):[],J.iReportExecuteMode=(null==(e=null==t?void 0:t.obj)?void 0:e.length)>0&&t.obj[0].iReportExecuteMode||1,J.currentFormatId=await(async(t,e)=>{var n;if(!(null==t?void 0:t.length))return"";if(!C.isDoc){const{data:e}=await O({templateId:t[0].templateId},{token:R.token});if("SUCCESS"===e.result){const{formatForms:i=[]}=e.map||{};Object.assign(z,e.map||{});const r=null==(n=null==i?void 0:i[0])?void 0:n.id;if(r&&t.map((t=>t.id)).includes(r))return r}}const i=t.find((t=>1==t[e]));return(null==i?void 0:i.id)||t[0].id})(J.formatList,"defaultFlag"),!J.currentFormatId)return U.value=[],N.error(R.noDefaultFormatMsg),it();(()=>{var t;const e=J.formatList.map((t=>({label:t.name,key:t.id})));U.value.unshift({label:K.value,key:"format",children:e}),R.hideButtons.length>0&&(U.value=U.value.filter((t=>!R.hideButtons.includes(t.key))));const n=sessionStorage.getItem("portal");if(n){const e=JSON.parse(n),i=(null==(t=null==e?void 0:e.user)?void 0:t.currentRoleResourceObj)||{},r=Object.keys(i);r.includes("RY7.2.21.1.M2.G94181E")||(U.value=U.value.filter((t=>"downloadPdf"!=t.key))),r.includes("RY7.2.21.1.M2.G33633A")||(U.value=U.value.filter((t=>"formatEditText"!=t.key)))}})();let i=null==(n=await R.queryTemplateParams())?void 0:n.obj;if(!i||!_.value)return N.error("获取打印模板失败,请联系管理员!"),it();J.templateParams=i,J.printParams=at(J.templateParams,R.params)},lt=async()=>{var t;if(J.isInited)return!0;J.isInited=!0,J.spinning=!0,(()=>{if(V)return!1;V=new T})();const e=await R.queryPrintFormatByNumber();return await ot(e),(null==(t=e.obj)?void 0:t.length)>0&&(A.value=e.obj[0].authorizationKey||""),J.spinning=!1,!0},st=async(t=!0)=>{var e,n;if(await R.clickPrevFn())if((null==(e=R.params)?void 0:e.length)||(null==(n=R.printParams)?void 0:n.length)){if(!J.visible){if(!await lt())return!1}t&&(J.visible=!J.visible)}else N.warning(R.noDataMsg)},pt=()=>{J.watchPrintParamsReformatFn&&J.watchPrintParamsReformatFn(),J.isInited?J.printParams=at(J.templateParams,R.params):J.watchPrintParamsReformatFn=()=>l((()=>J.isInited),(t=>{if(!t)return!1;pt()}))},dt=t=>{if(J.identityVerification.visible=!1,S(J.currentFormatId))return Y(null,"edit");const e={formatId:J.currentFormatId,templateId:_.value,params:X(),token:t};V.editPrintFormat(e,(t=>{Y(t,"edit")}),$)};async function ut(){await st(!1),tt()}return o((()=>{J.isInited=!1})),l((()=>R.params),(t=>{if(!(null==t?void 0:t.length))return!1;pt()}),{deep:!0}),L({directPrint:ut}),(e,n)=>(s(),p(d,null,[u(m(P),{class:"c-dropdown",placement:t.placement,trigger:"click",show:J.visible,onClickoutside:nt,options:m(U),onSelect:et,"render-label":H},{default:c((()=>[f(e.$slots,"button",{handleClickPrintBtn:st,printSpinning:J.spinning,printbtnText:t.btnText,printVisible:J.visible},(()=>[u(m(w),{class:"dropdown-button",loading:t.showLoading&&J.spinning,onClick:n[1]||(n[1]=v((()=>G("button")),["stop"]))},{default:c((()=>[y(g(t.btnText)+" ",1),u(m(F),{component:m(k),size:"18",style:{"margin-left":"5px"},onClick:n[0]||(n[0]=v((()=>G("icon")),["stop"]))},null,8,["component"])])),_:1},8,["loading"])]))])),_:3},8,["placement","show","options"]),u(E,b(m(C),{modelValue:J.identityVerification.visible,"onUpdate:modelValue":n[2]||(n[2]=t=>J.identityVerification.visible=t),formatId:J.currentFormatId,templateId:m(_),onSuccess:dt}),null,16,["modelValue","formatId","templateId"])],64))}});export{L as default};
1
+ import{defineComponent as t,useAttrs as e,inject as n,ref as r,reactive as i,computed as a,onMounted as o,watch as l,openBlock as s,createElementBlock as p,Fragment as d,createVNode as u,unref as m,withCtx as c,renderSlot as f,withModifiers as v,createTextVNode as y,toDisplayString as g,mergeProps as b}from"vue";import{isObject as I}from"@vue/shared";import{useMessage as h,NDropdown as P,NButton as w,NIcon as F}from"naive-ui";import{ChevronDown as k}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as x}from"../constants/index.js";import{Print as T}from"../utils/print.js";import{isIReport as S}from"../utils/browserPrint.js";import E from"./IdentityVerification.vue.js";import{format as j}from"date-fns";import{savePrivateFormatApi as M,getPrivateFormatApi as O}from"../api.js";var L=t({__name:"OldPrintComponent",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},noDefaultFormatMsg:{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},resolution:{type:Number},printCustomProps:{type:Object,default:()=>({})},placement:{type:String},svrUpdateIp:{type:String}},setup(t,{expose:L}){var D;const R=t,C=e(),N=h();let V;const U=n(x),B={},z=r(""),A=i({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,iReportExecuteMode:1});let J=r([{label:R.printText,key:"printText"},{label:R.previewText,key:"previewText"},{label:R.pdfLoadText,key:"downloadPdf"},{label:R.formatEditText,key:"formatEditText"},...(null==(D=R.externalOptionConfig)?void 0:D.options)||[]]);const q=a((()=>{if(!A.currentFormatId)return{};let t=A.currentFormatId;return A.formatList.find((e=>e.id===t))})),K=a((()=>{var t;return(null==(t=q.value)?void 0:t.name)||"格式选择"})),_=a((()=>{let t=A.formatList.find((t=>t.id===A.currentFormatId));return null==t?void 0:t.templateId})),G=async t=>{if(R.directPrint){if(A.spinning)return;return"button"===t?void await ut():st()}return st()},H=t=>u("span",{class:{active:t.key===A.currentFormatId}},[t.label]),Y=(t,e)=>{A.spinning=!1;let n={type:e,formatId:A.currentFormatId,templateId:_.value};U("success",t,n)},$=t=>{A.spinning=!1,U("error",t),I(t)&&"notInstalledApp"===t.type&&N.error(t.message)},Q=t=>{A.spinning=!1,U("cancel",t)},W=t=>{U("error",{message:"前置条件执行错误",type:t,preExecution:!0})},X=(t=0)=>{var e;const n=(null==(e=R.printParams)?void 0:e.length)?R.printParams[t]:A.printParams[t];return JSON.stringify({...n||{},...R.token?{token:R.token}:{},...R.printCustomProps||{}})},Z=()=>{var t,e;let n={},r={};if(null==(t=A.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(A.printParams[0].datasetData||{}))?void 0:e[0])||"",n=JSON.stringify(A.printParams.map((e=>JSON.parse(e.datasetData[t]))));r={datasetData:{}},r.datasetData[t]=n}else Object.keys(A.printParams[0]).forEach((t=>{r[t]=[],A.printParams.forEach((e=>{r[t].includes(e[t])||r[t].push(e[t])})),r[t]=r[t].join(",")}));return n=Object.assign({},JSON.parse(X(0)),r),JSON.stringify(n)},tt=((t,e,n=!0)=>{let r=null;return function(...i){r&&clearTimeout(r),n&&!r&&t.apply(null,i),r=setTimeout((()=>{r=null,!n&&t.apply(null,i)}),e)}})((()=>{let t=A.printParams.length;const e=async e=>{try{--t<=0&&Y(e,"print")}catch(t){console.log("error",t)}};R.showLoading&&A.spinning||(A.spinning=!0,R.prevFn("print",{formatId:A.currentFormatId,templateId:_.value}).then((()=>{const t={iReportExecuteMode:A.iReportExecuteMode,formatId:A.currentFormatId,templateId:_.value,authorizationKey:z.value,printdlgshow:R.printdlgshow,signature:R.signature,copies:R.printCopies,svrUpdateIp:R.svrUpdateIp};if("MULTI"===R.strategy)for(let n=0;n<A.printParams.length;n++)n>0&&(t.printdlgshow="0"),V.printDirect({...t,params:X(n)},e,$,Q);else V.printDirect({...t,params:Z()},(t=>{Y(t,"print")}),$,Q)})).catch((()=>{W("print"),A.spinning=!1})).finally((()=>{A.visible=!1})))}),800,!0),et=async(t,e)=>{var n,r;switch(t){case"printText":tt();break;case"previewText":(async()=>{R.showLoading&&A.spinning||(A.spinning=!0,R.prevFn("preview",{formatId:A.currentFormatId,templateId:_.value}).then((()=>{const t="MULTI"===R.strategy?X():Z(),e={formatId:A.currentFormatId,iReportExecuteMode:A.iReportExecuteMode,templateId:_.value,authorizationKey:z.value,params:t,btnprint:R.btnprint,signature:R.signature};V.preview(e,(t=>{Y(t,"preview")}),$)})).catch((()=>{W("preview"),A.spinning=!1})).finally((()=>{A.visible=!1})))})();break;case"formatEditText":R.showLoading&&A.spinning||(A.spinning=!0,R.prevFn("edit",{formatId:A.currentFormatId,templateId:_.value}).then((()=>{A.identityVerification.visible=!0})).catch((()=>{W("edit")})).finally((()=>{A.visible=!1,A.spinning=!1})));break;case"downloadPdf":(async()=>{R.showLoading&&A.spinning||(A.spinning=!0,R.prevFn("download",{formatId:A.currentFormatId,templateId:_.value}).then((()=>{const t="MULTI"===R.strategy?X():Z(),e={formatId:A.currentFormatId,iReportExecuteMode:A.iReportExecuteMode,templateId:_.value,authorizationKey:z.value,print:{print:"1",type:"1",resolution:null==R?void 0:R.resolution},params:t,signature:R.signature};V.downloadPDF(e,(t=>Y(t,"preview")),$)})).catch((()=>{W("download"),A.spinning=!1})).finally((()=>{A.visible=!1})))})();break;default:{A.visible=!1;const i=A.formatList.find((e=>e.id===t))||{};if(Object.keys(i).length>0){A.currentFormatId=t;const[e]=J.value;e.label=(null==i?void 0:i.name)||e.label,await M({formatForms:[{...i}],name:B.name||i.templateName,number:B.number||i.number,templateId:B.templateId||i.templateId,...B.id?{id:B.id}:{}},{token:R.token})}else null==(r=null==(n=R.externalOptionConfig)?void 0:n.onSelect)||r.call(n,t,e);break}}},nt=()=>{A.visible=!1,U("clickoutside")},rt=()=>(A.isInited=!1,A.spinning=!1,setTimeout((()=>{A.visible=!1}),0),!1),it=(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=j(e,n[t.type])),(null==t?void 0:t.defaultValue)||r})(e,t[e[n]]);t[e[n]]&&i&&(r[e[n]]=i)})),r},at=({customizeDataset:t=[],param:e=[]},n=[])=>n.map((n=>{let r={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;r.datasetData={[t.name]:JSON.stringify(it(n,e,"fieldName"))}})),r=Object.assign({},r,it(n,e,"key")),r})),ot=async t=>{var e,n;if(A.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):[],A.iReportExecuteMode=(null==(e=null==t?void 0:t.obj)?void 0:e.length)>0&&t.obj[0].iReportExecuteMode||1,A.currentFormatId=await(async(t,e)=>{var n;if(!(null==t?void 0:t.length))return"";if(!C.isDoc){const{data:e}=await O({templateId:t[0].templateId},{token:R.token});if("SUCCESS"===e.result){const{formatForms:r=[]}=e.map||{};Object.assign(B,e.map||{});const i=null==(n=null==r?void 0:r[0])?void 0:n.id;if(i&&t.map((t=>t.id)).includes(i))return i}}const r=t.find((t=>1==t[e]));return(null==r?void 0:r.id)||t[0].id})(A.formatList,"defaultFlag"),!A.currentFormatId)return J.value=[],N.error(R.noDefaultFormatMsg),rt();(()=>{var t;const e=A.formatList.map((t=>({label:t.name,key:t.id})));J.value.unshift({label:K.value,key:"format",children:e}),R.hideButtons.length>0&&(J.value=J.value.filter((t=>!R.hideButtons.includes(t.key))));const n=sessionStorage.getItem("portal");if(n){const e=JSON.parse(n),r=(null==(t=null==e?void 0:e.user)?void 0:t.currentRoleResourceObj)||{},i=Object.keys(r);i.includes("RY7.2.21.1.M2.G94181E")||(J.value=J.value.filter((t=>"downloadPdf"!=t.key))),i.includes("RY7.2.21.1.M2.G33633A")||(J.value=J.value.filter((t=>"formatEditText"!=t.key)))}})();let r=null==(n=await R.queryTemplateParams())?void 0:n.obj;if(!r||!_.value)return N.error("获取打印模板失败,请联系管理员!"),rt();A.templateParams=r,A.printParams=at(A.templateParams,R.params)},lt=async()=>{var t;if(A.isInited)return!0;A.isInited=!0,A.spinning=!0,(()=>{if(V)return!1;V=new T})();const e=await R.queryPrintFormatByNumber();return await ot(e),(null==(t=e.obj)?void 0:t.length)>0&&(z.value=e.obj[0].authorizationKey||""),A.spinning=!1,!0},st=async(t=!0)=>{var e,n;if(await R.clickPrevFn())if((null==(e=R.params)?void 0:e.length)||(null==(n=R.printParams)?void 0:n.length)){if(!A.visible){if(!await lt())return!1}t&&(A.visible=!A.visible)}else N.warning(R.noDataMsg)},pt=()=>{A.watchPrintParamsReformatFn&&A.watchPrintParamsReformatFn(),A.isInited?A.printParams=at(A.templateParams,R.params):A.watchPrintParamsReformatFn=()=>l((()=>A.isInited),(t=>{if(!t)return!1;pt()}))},dt=t=>{if(A.identityVerification.visible=!1,S(A.currentFormatId))return Y(null,"edit");const e={formatId:A.currentFormatId,templateId:_.value,params:X(),token:t};V.editPrintFormat(e,(t=>{Y(t,"edit")}),$)};async function ut(){await st(!1),tt()}return o((()=>{A.isInited=!1})),l((()=>R.params),(t=>{if(!(null==t?void 0:t.length))return!1;pt()}),{deep:!0}),L({directPrint:ut}),(e,n)=>(s(),p(d,null,[u(m(P),{class:"c-dropdown",placement:t.placement,trigger:"click",show:A.visible,onClickoutside:nt,options:m(J),onSelect:et,"render-label":H},{default:c((()=>[f(e.$slots,"button",{handleClickPrintBtn:st,printSpinning:A.spinning,printbtnText:t.btnText,printVisible:A.visible},(()=>[u(m(w),{class:"dropdown-button",loading:t.showLoading&&A.spinning,onClick:n[1]||(n[1]=v((()=>G("button")),["stop"]))},{default:c((()=>[y(g(t.btnText)+" ",1),u(m(F),{component:m(k),size:"18",style:{"margin-left":"5px"},onClick:n[0]||(n[0]=v((()=>G("icon")),["stop"]))},null,8,["component"])])),_:1},8,["loading"])]))])),_:3},8,["placement","show","options"]),u(E,b(m(C),{modelValue:A.identityVerification.visible,"onUpdate:modelValue":n[2]||(n[2]=t=>A.identityVerification.visible=t),formatId:A.currentFormatId,templateId:m(_),onSuccess:dt}),null,16,["modelValue","formatId","templateId"])],64))}});export{L as default};
@@ -19,6 +19,7 @@ export declare class Print {
19
19
  private base64Fragment;
20
20
  private _successCallbackFn;
21
21
  private _errorCallbackFn;
22
+ private _cancelCallbackFn;
22
23
  constructor();
23
24
  private readonly messageHandlerQueue;
24
25
  private messageHandler;
@@ -35,7 +36,7 @@ export declare class Print {
35
36
  showPreview(...args: Parameters<PreviewDialog['show']>): Promise<string>;
36
37
  _testDomesticSystemConnection(): Promise<unknown>;
37
38
  _testConnection(): Promise<unknown>;
38
- resetPrinter(formatId: string): Promise<any>;
39
+ resetPrinter(originFormatId: string, iReportExecuteMode: number): Promise<any>;
39
40
  _queryServicesPrint(params: AnyObject): Promise<any>;
40
41
  _queryBase64ServicesPrint(params: AnyObject): Promise<any>;
41
42
  _callPrintWithFile(queryParams: AnyObject): Promise<any>;
@@ -54,25 +55,26 @@ export declare class Print {
54
55
  pageCount: any;
55
56
  formatId: string;
56
57
  };
57
- _handleEventDirect({ templateId, formatId, params, paramsArr, cmdid, print, signature, copies, printdlgshow, nobillnode, btnprint, messageTimeout }: AnyObject): Promise<any>;
58
+ _handleEventDirect({ templateId, formatId, svrUpdateIp, params, paramsArr, cmdid, print, signature, copies, printdlgshow, nobillnode, btnprint, messageTimeout }: AnyObject): Promise<any>;
58
59
  _handleEventEditFormat({ templateId, formatId, params, token, messageTimeout }: AnyObject): Promise<any>;
59
60
  _queryProxyOrigin(): Promise<void>;
60
61
  _queryPrintFile(formatId: string, params?: string): Promise<any>;
61
62
  paramsSerializer(params: AnyObject): AnyObject;
62
63
  getIReportFormatId: (isIReport: boolean, formatId: string) => string;
63
64
  _queryPrintForBase64(templateId: string, formatId: string, params: string | undefined, authorizationKey: String): Promise<any>;
65
+ _queryPrintForBase16(templateId: string, formatId: string, params: string | undefined, authorizationKey: String): Promise<any>;
64
66
  _queryPrintForPdf(templateId: string, formatId: string, params: string | undefined, authorizationKey: String): Promise<any>;
65
67
  _browserPrint(result: AnyObject, mode: string): Promise<string | void>;
66
68
  _base64ToBlob(fileBase64: string, fileType: string): Blob;
67
- preview({ iReportExecuteMode, templateId, formatId, params, paramsArr, authorizationKey, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<any>;
69
+ preview({ iReportExecuteMode, templateId, formatId: originFormatId, params, paramsArr, authorizationKey, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<any>;
68
70
  printSync(data: AnyObject[], successCallbackFn: AnyFn, errorCallbackFn: AnyFn): Promise<void>;
69
- printDirect({ iReportExecuteMode, templateId, formatId, params, paramsArr, authorizationKey, print, signature, printdlgshow, nobillnode, copies, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn, mode?: string): Promise<false | undefined>;
70
- printToHiPrint({ templateId, formatId, params, authorizationKey }: any, successCallbackFn: AnyFn, errorCallbackFn: AnyFn): Promise<any>;
71
+ printDirect({ iReportExecuteMode, templateId, formatId: originFormatId, params, paramsArr, authorizationKey, print, signature, printdlgshow, nobillnode, copies, svrUpdateIp, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn, mode?: string): Promise<false | undefined>;
72
+ printToHiPrint({ templateId, formatId, params, authorizationKey }: any, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn): Promise<any>;
71
73
  private _downloadPDF;
72
74
  /**
73
75
  * 下载pdf
74
76
  */
75
- downloadPDF(params: AnyObject, onResolve: AnyFn, onReject: AnyFn): Promise<any>;
77
+ downloadPDF(paramsObj: AnyObject, onResolve: AnyFn, onReject: AnyFn): Promise<any>;
76
78
  print({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | undefined>;
77
79
  queryPrintData({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | {
78
80
  file: any;
@@ -1 +1 @@
1
- import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as s}from"./dialog.js";import{getFileUrl as r,useBrowserPrint as n,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{format as c}from"date-fns";import{io as h}from"socket.io-client";const m=String(navigator.platform).toLowerCase().includes("linux"),p=t.create({timeout:6e4,withCredentials:!1}),d=`${window.location.protocol}//${window.location.host}`,u=`${d}/fdp-api/print/assembly/printIReport`,f=`${d}/bi-api/reprot/print/open/client/printIReportForBase64`,g=`${d}/bi-api/reprot/print/open/client/previewIReport`,w=`${d}/bi-api/reprot/print/open/client/getRemote`,y=`${d}/printService/file`;let P=null;class v{constructor(){var t,e,r;if(this.webview=null,this.dialog=new i,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.printDomesticOrigin="http://127.0.0.1:17521",this.isRemote=!1,this.CMonitor=null,this.queryServicesParams=null,this.isConnectHiPrint=!1,this.clientInfo=null,this.printerList=[],this.hiPrintSocket=null,this.base64Fragment="",this._successCallbackFn=null,this._errorCallbackFn=null,this.messageHandlerQueue=[],this.getIReportFormatId=(t,e)=>t?e.split("_")[1]:e,P)return P;P=this;const n=window;this.CMonitor=n.$CMonitor;try{this.webview=n.top?null==(t=n.top.chrome)?void 0:t.webview:null==(e=n.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(r=n.chrome)?void 0:r.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf","resetprint"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:s,reject:r}=e;try{if("resetprint"===(null==i?void 0:i.cmd))return void s({result:(null==i?void 0:i.res)?"success":"fail"});s(i.res||"")}catch(t){r(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}_initDomesticSystem(t){try{if(this.hiPrintSocket)return this.isConnectHiPrint;this.hiPrintSocket=h(this.printDomesticOrigin,{reconnection:!1,transports:["websocket"],auth:{token:"no-use-vue-plugin-hiprint"}}),this.hiPrintSocket&&(this.hiPrintSocket.on("connect",(()=>{this.isConnectHiPrint=!0})),this.hiPrintSocket.on("disconnect",(()=>{this.isConnectHiPrint=!1,this.hiPrintSocket=null})),this.hiPrintSocket.on("clientInfo",(t=>{console.log("获取到客户端信息>>>>>",t),t.clientUrl&&(this.clientInfo=t)})),this.hiPrintSocket.on("printerList",(e=>{console.log("获取到打印机列表信息>>>>>",e),this.printerList=e,t&&t(!0)})),this.hiPrintSocket.on("success",(t=>{console.log("打印成功>>>>>",t),this.base64Fragment="",this._successCallbackFn&&this._successCallbackFn(t)})),this.hiPrintSocket.on("replayPrinterTemplate",(t=>{console.log("获取到数据的回复>>>>>",t),t&&this.hiPrintSocket.emit("news",t)})),this.hiPrintSocket.on("error",(t=>{console.log("打印失败>>>>>",t),this.base64Fragment="",this._errorCallbackFn&&this._errorCallbackFn(t)})))}catch(e){console.log("hiprint系统连接失败",e),t&&t(!1)}}async getPicAndUpload(t){try{const e=t=>"[object Object]"===Object.prototype.toString.call(t);if("success"===(null==t?void 0:t.result)&&"Y"==(null==t?void 0:t.uploadTemplateFlag)&&!(null==t?void 0:t.filebase64)&&this.queryServicesParams){const t=e(this.queryServicesParams.params)?this.queryServicesParams.params:JSON.parse(this.queryServicesParams.params);t.uploadTemplateFlag="Y",this.queryServicesParams.params=JSON.stringify(t),this.queryServicesParams.cmdid="7",this.queryServicesParams.print={print:1,type:6,zip:0},this.queryServicesParams.paramsArr=[{params:JSON.stringify(t)}];await this._queryBase64ServicesPrint(this.queryServicesParams)}}catch(t){console.log(t)}finally{this.queryServicesParams=null}}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=l();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)})),new Promise(((e,s)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),s({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testDomesticSystemConnection(){return new Promise((t=>{p({url:`${this.printDomesticOrigin}/test`,method:"get",withCredentials:!1,params:{}}).then((({data:e})=>{e.status?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{p({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}resetPrinter(t){return this.webview?this.postMessage({exec:"resetprint",data:{formatID:t}}):p({url:`${this.printOrigin}/services/printset`,method:"get",withCredentials:!1,params:{inputdata:t}}).then((({data:t})=>t))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_queryBase64ServicesPrint(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):p({url:"/services/Printqueue",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:s(i)}):p({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[s]}).then((({data:t})=>t));function s(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e,i){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:!1,errinfo:t}),!1}if("success"!==t.result){const s=t.message||t.Message;this._handleMonitorNotify(s);const r={type:"printError",message:s,result:t.result,errinfo:t.errinfo};return"cancel"==t.result?(i&&i({type:"printCancel",message:s,result:t.result,errinfo:t.errinfo}),!1):(null==e||e(r),!1)}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,s,r){const n={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:s},a=await this._queryServicesPrint(n);return this._handleQueryPrintDataResult(a,e,r)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,paramsArr:s,cmdid:r,print:n,signature:a,copies:o=1,printdlgshow:l="0",nobillnode:h="1",btnprint:m="1",messageTimeout:p=0}){const d={templateId:t,formatId:e,params:i,cmdid:r,nobillnode:h,printdlgshow:l,btnprint:m,copies:o,messageTimeout:p,...a?{signature:a}:{}};if(s&&(d.paramsArr=s),n){try{n=JSON.parse(n)}catch(t){}d.print=n}else if(this.isRemote){const t=c(new Date,"yyyyMMddHHmmss");d.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return this.queryServicesParams=d,await this._queryServicesPrint(d)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:s,messageTimeout:r=0}){const n={};let a={};try{a=Object.assign({},n,JSON.parse(i))}catch(t){a=n}const o={templateId:t,formatId:e,cmdid:"9",token:s,params:JSON.stringify(a),messageTimeout:r};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await p({method:"get",url:w})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=d+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await p({method:"post",url:u,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}paramsSerializer(t){return Object.keys(t).forEach((e=>{const i=t[e];t[e]=i,"biParams"==e&&(t[e]=encodeURIComponent(i))})),t}async _queryPrintForBase64(t,e,i="",s){const r="object"==typeof i?i:JSON.parse(i),{data:n}=await p({method:"post",url:f,params:{id:t,formatId:e,params:this.paramsSerializer(r),authorizationKey:s}})||{};return n}async _queryPrintForPdf(t,e,i="",s){const r="object"==typeof i?i:JSON.parse(i),{data:n}=await p({method:"post",url:g,responseType:"blob",params:{id:t,formatId:e,params:this.paramsSerializer(r),authorizationKey:s}})||{};return n}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,s=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=s[s.length-2],o=s[s.length-1],l=await r(`${y}/${a}/${o}`),c=n(null,e,l);if("preview"===e)return c}}_base64ToBlob(t,e){const i=window.atob(t);let s=i.length;const r=new Uint8Array(s);for(;s--;)r[s]=i.charCodeAt(s);return new Blob([r],{type:e})}async preview({iReportExecuteMode:t,templateId:e,formatId:i,params:s="",paramsArr:r,authorizationKey:l,signature:c,btnprint:h,messageTimeout:p=0},d,u){const f=a(i);if(i=this.getIReportFormatId(f,i),f&&(m||2==t)){const t=await this._queryPrintForPdf(e,i,s,l);if(!t)return null==u?void 0:u("获取文件失败!");const r=n(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,r),null==d?void 0:d({file:t})}await this._queryProxyOrigin();const g=await this._testConnection();if(!this._handleResultTest(g,u))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:i,params:s,paramsArr:r,cmdid:this.isRemote?"7":"8",signature:c,btnprint:h,messageTimeout:p}),n=this._handleResult(t,u);if(!n)return!1;if(this.isRemote){const t=await this._browserPrint(n,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}await this.getPicAndUpload(n),null==d||d(n)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==u||u(i),this._handleMonitorNotify(i)}}async printSync(t,e,i){const s=t.map((t=>{const e={params:"",printdlgshow:"0",nobillnode:"1",btnprint:"1",...t,cmdid:"7",...t.signature?{signature:t.signature}:{}};if(e.print)try{e.print=JSON.parse(e.print)}catch(t){}return{inputData:e}}));try{const t=l(),r=await this.messageCollect(t,{exec:"printA",data:s});if(r&&Array.isArray(r)){r.some((t=>"success"===t.res.result))?null==e||e(r):(null==i||i(r),this._handleMonitorNotify(r))}else{const t="打印命令返回无效数据";this._handleMonitorNotify(r||""),null==i||i({type:"printError",message:t,result:!1,errinfo:t})}}catch(t){const e={error:t,message:"打印失败"};null==i||i(e),this._handleMonitorNotify(e)}}async printDirect({iReportExecuteMode:t,templateId:e,formatId:i,params:s="",paramsArr:r,authorizationKey:n,print:o,signature:l,printdlgshow:c,nobillnode:h,copies:p=1,isDownloadFile:d=!0,messageTimeout:u=0},f,g,w,y="printDirect"){const P=a(i);if(i=this.getIReportFormatId(P,i),P&&(m||2==t)){if(!await this._testDomesticSystemConnection())return void g({type:"notOpenedApp",result:"error",message:"请开启hiPrint客户端"});return void(this._initDomesticSystem((async t=>{t?await this.printToHiPrint({templateId:e,formatId:i,params:s,authorizationKey:n},f,g):g({type:"connectAppFail",result:"error",message:"连接hiPrint客户端失败"})}))&&await this.printToHiPrint({templateId:e,formatId:i,params:s,authorizationKey:n},f,g))}await this._queryProxyOrigin();const v=await this._testConnection();if(!this._handleResultTest(v,g))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:i,params:s,paramsArr:r,cmdid:"7",print:o,signature:l,printdlgshow:c,nobillnode:h,copies:p,messageTimeout:u}),n=this._handleResult(t,g,w);if(!n)return!1;d&&["downloadPDF"].includes(y)&&await this._browserPrint(n,y),null==f||f(n)}catch(t){const e="printDirect"===y?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==g||g(i),this._handleMonitorNotify(i)}}async printToHiPrint({templateId:t,formatId:e,params:i,authorizationKey:s},r,n){const a=await this._queryPrintForBase64(t,e,i,s);if(!a.success)return n({message:a.resultMsg});const{base64:o,formatId:l}=a.map;this.base64Fragment=o,this._successCallbackFn=r,this._errorCallbackFn=n,this.hiPrintSocket.emit("news",{printerList:this.printerList,type:"askPrinterTemplate",markTemplateId:l,pdf_stream:this.base64Fragment})}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):p.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}async downloadPDF(t,i,s){if(this.webview&&this.downloadPath&&(Reflect.has(t,"print")||Reflect.set(t,"print",{print:"1",type:"1"}),!t.print.filename)){const e=c(new Date,"yyyy-MM-dd"),i=l(),s=c(new Date,"yyyyMMddHHmmss")+i;t.print.filename=`${this.downloadPath}/${e}/${s}/${s}`.replace(/\\/g,"/")}const r=a(t.formatId);if(t.formatId=this.getIReportFormatId(r,t.formatId),r&&(m||2==t.iReportExecuteMode)){const e=await this._queryPrintForPdf(t.templateId||"",t.formatId,t.params||"",t.authorizationKey);return e?(n(e,"downloadPDF"),i({file:e})):null==s?void 0:s("获取文件失败!")}this.printDirect(t,(async t=>{t||s(null);const r=this,n=await async function(t){const i=[],s=JSON.parse(t);if(!e(s))return await r._downloadPDF("");if(1===s.length)return await r._downloadPDF(s[0]||"");for(let t=0,e=s.length;t<e;t++)i.push(await r._downloadPDF(s[t]||""));return i}(t.filedir);i(n,t)}),(t=>s(t)),(t=>{console.log(t)}),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:s=0},r,n){const a=await this._testConnection();if(!this._handleResultTest(a,n))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:s},void 0,n);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,n);if(!l)return!1;r&&r(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:s=0},r,n){const a=await this._testConnection();if(!this._handleResultTest(a,n))return!1;const o=await this._handleEventQueryPrintData(t,e,i,s,n);return!!o&&(r&&r(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},s,r){const n=await this._testConnection();if(!this._handleResultTest(n,r))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,r);return!!o&&(s&&s(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:r=0},n,a){const o=await this._testConnection();if(!this._handleResultTest(o,a))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:r}),c=this._handleResult(l,a);if(!c)return!1;n&&n(c)}async addPrintFormat({templateId:t,params:e,token:i},s,r){const n=await this._testConnection();if(!this._handleResultTest(n,r))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,r);if(!o)return!1;s&&s(o)}}export{v as Print};
1
+ import t from"axios";import{cloneDeep as e,isArray as i}from"lodash-es";import{IdentityVerificationDialog as r,PreviewDialog as s}from"./dialog.js";import{isIReport as a,getFileUrl as n,useBrowserPrint as o}from"./browserPrint.js";import{getCurrentInstance as l}from"vue";import{uuidGenerator as c}from"../../../../shared/utils/index.js";import{format as h}from"date-fns";import{io as p}from"socket.io-client";const u=String(navigator.platform).toLowerCase().includes("linux"),m=t.create({timeout:6e4,withCredentials:!1}),d=`${window.location.protocol}//${window.location.host}`,g=`${d}/fdp-api/print/assembly/printIReport`,y=`${d}/bi-api/reprot/print/open/client/printIReportForBase64`,f=`${d}/bi-api/reprot/print/open/client/printIReportForHex`,w=`${d}/bi-api/reprot/print/open/client/previewIReport`,v=`${d}/bi-api/reprot/print/open/client/getRemote`,P=`${d}/printService/file`;let _=null;class b{constructor(){var t,e,i;if(this.webview=null,this.dialog=new r,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.printDomesticOrigin="http://127.0.0.1:17521",this.isRemote=!1,this.CMonitor=null,this.queryServicesParams=null,this.isConnectHiPrint=!1,this.clientInfo=null,this.printerList=[],this.hiPrintSocket=null,this.base64Fragment="",this._successCallbackFn=null,this._errorCallbackFn=null,this._cancelCallbackFn=null,this.messageHandlerQueue=[],this.getIReportFormatId=(t,e)=>t?e.split("_")[1]:e,_)return _;_=this;const a=window;this.CMonitor=a.$CMonitor;try{this.webview=a.top?null==(t=a.top.chrome)?void 0:t.webview:null==(e=a.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(i=a.chrome)?void 0:i.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf","resetprint"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:r,reject:s}=e;try{if("resetprint"===(null==i?void 0:i.cmd))return void r({result:(null==i?void 0:i.res)?"success":"fail"});r(i.res||"")}catch(t){s(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}_initDomesticSystem(t){try{if(this.hiPrintSocket)return this.isConnectHiPrint;this.hiPrintSocket=p(this.printDomesticOrigin,{reconnection:!1,transports:["websocket"],auth:{token:"no-use-vue-plugin-hiprint"}}),this.hiPrintSocket&&(this.hiPrintSocket.on("connect",(()=>{this.isConnectHiPrint=!0})),this.hiPrintSocket.on("disconnect",(()=>{this.isConnectHiPrint=!1,this.hiPrintSocket=null})),this.hiPrintSocket.on("clientInfo",(t=>{console.log("获取到客户端信息>>>>>",t),t.clientUrl&&(this.clientInfo=t)})),this.hiPrintSocket.on("printerList",(e=>{console.log("获取到打印机列表信息>>>>>",e),this.printerList=e,t&&t(!0)})),this.hiPrintSocket.on("success",(t=>{console.log("打印成功>>>>>",t),this.base64Fragment="",this._successCallbackFn&&this._successCallbackFn(t)})),this.hiPrintSocket.on("replayPrinterTemplate",(t=>{console.log("获取到数据的回复>>>>>",t),t&&this.hiPrintSocket.emit("news",t)})),this.hiPrintSocket.on("error",(t=>{console.log("打印失败>>>>>",t),this.base64Fragment="","cancel"==(null==t?void 0:t.result)?this._cancelCallbackFn&&this._cancelCallbackFn(t):this._errorCallbackFn&&this._errorCallbackFn(t)})))}catch(e){console.log("ihoPrint系统连接失败",e),t&&t(!1)}}async getPicAndUpload(t){try{const e=t=>"[object Object]"===Object.prototype.toString.call(t);if("success"===(null==t?void 0:t.result)&&"Y"==(null==t?void 0:t.uploadTemplateFlag)&&!(null==t?void 0:t.filebase64)&&this.queryServicesParams){const t=e(this.queryServicesParams.params)?this.queryServicesParams.params:JSON.parse(this.queryServicesParams.params);t.uploadTemplateFlag="Y",this.queryServicesParams.params=JSON.stringify(t),this.queryServicesParams.cmdid="7",this.queryServicesParams.print={print:1,type:6,zip:0},this.queryServicesParams.paramsArr=[{params:JSON.stringify(t)}];await this._queryBase64ServicesPrint(this.queryServicesParams)}}catch(t){console.log(t)}finally{this.queryServicesParams=null}}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=c();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,r)=>{this.messageHandlerQueue.push({resolve:i,reject:r,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,r)=>{this.messageHandlerQueue.push({resolve:i,reject:r,id:t}),this.webview.postMessage(e)})),new Promise(((e,r)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),r({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testDomesticSystemConnection(){return new Promise((t=>{m({url:`${this.printDomesticOrigin}/test`,method:"get",withCredentials:!1,params:{}}).then((({data:e})=>{e.status?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{m({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}async resetPrinter(t,e){const i=a(t),r=this.getIReportFormatId(i,t);if(i&&(u||2==e)){return await this._testDomesticSystemConnection()?m({url:`${this.printDomesticOrigin}/resetPrint`,method:"get",withCredentials:!1,params:{formatId:r}}).then((({data:t})=>t.status?{type:"resetSuccess",result:"success",message:null==t?void 0:t.message}:{type:"resetError",result:"error",message:null==t?void 0:t.message})).catch((t=>({type:"resetError",result:"error",message:"重置打印机错误"}))):{type:"notOpenedApp",result:"error",message:"请开启ihoPrint客户端"}}return this.webview?this.postMessage({exec:"resetprint",data:{formatID:r}}):m({url:`${this.printOrigin}/services/printset`,method:"get",withCredentials:!1,params:{inputdata:r}}).then((({data:t})=>t))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_queryBase64ServicesPrint(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):m({url:"/services/Printqueue",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:r(i)}):m({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[r]}).then((({data:t})=>t));function r(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e,i){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:"error",errinfo:t}),!1}if("success"!==t.result){const r=t.message||t.Message;this._handleMonitorNotify(r);const s={type:"printError",message:r,result:t.result,errinfo:t.errinfo};return"cancel"==t.result?(i&&i({type:"printCancel",message:r,result:t.result,errinfo:t.errinfo}),!1):(null==e||e(s),!1)}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件",result:"error"}),!1)}async _handleEventQueryPrintData(t,e,i,r,s){const a={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:r},n=await this._queryServicesPrint(a);return this._handleQueryPrintDataResult(n,e,s)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({result:"error",type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,svrUpdateIp:i,params:r,paramsArr:s,cmdid:a,print:n,signature:o,copies:l,printdlgshow:c="0",nobillnode:p="1",btnprint:u="1",messageTimeout:m=0}){const d={templateId:t,formatId:e,svrUpdateIp:i,params:r,cmdid:a,nobillnode:p,printdlgshow:c,btnprint:u,copies:l,messageTimeout:m,...o?{signature:o}:{}};if(s&&(d.paramsArr=s),n){try{n=JSON.parse(n)}catch(t){}d.print=n}else if(this.isRemote){const t=h(new Date,"yyyyMMddHHmmss");d.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return this.queryServicesParams=d,await this._queryServicesPrint(d)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:r,messageTimeout:s=0}){const a={};let n={};try{n=Object.assign({},a,JSON.parse(i))}catch(t){n=a}const o={templateId:t,formatId:e,cmdid:"9",token:r,params:JSON.stringify(n),messageTimeout:s};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await m({method:"get",url:v})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=d+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await m({method:"post",url:g,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}paramsSerializer(t){return Object.keys(t).forEach((e=>{const i=t[e];t[e]=i,"biParams"==e&&(t[e]=encodeURIComponent(i))})),t}async _queryPrintForBase64(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:a}=await m({method:"post",url:y,params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return a}async _queryPrintForBase16(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:a}=await m({method:"post",url:f,params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return a}async _queryPrintForPdf(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:a}=await m({method:"post",url:w,responseType:"blob",params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return a}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,r=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),s=r[r.length-2],a=r[r.length-1],l=await n(`${P}/${s}/${a}`),c=o(null,e,l);if("preview"===e)return c}}_base64ToBlob(t,e){const i=window.atob(t);let r=i.length;const s=new Uint8Array(r);for(;r--;)s[r]=i.charCodeAt(r);return new Blob([s],{type:e})}async preview({iReportExecuteMode:t,templateId:e,formatId:i,params:r="",paramsArr:s,authorizationKey:n,signature:c,btnprint:h,messageTimeout:p=0},m,d){const g=a(i),y=this.getIReportFormatId(g,i);if(g&&(u||2==t)){const t=await this._queryPrintForPdf(e,y,r,n);if(!t)return null==d?void 0:d({type:"queryPrintDataFailure",result:"error",message:"获取文件失败!"});const i=o(t,"preview");return this.instance||(this.instance=l()),this.showPreview(this.instance,i),null==m?void 0:m({result:"success",message:"",file:t})}await this._queryProxyOrigin();const f=await this._testConnection();if(!this._handleResultTest(f,d))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:y,params:r,paramsArr:s,cmdid:this.isRemote?"7":"8",signature:c,btnprint:h,messageTimeout:p}),i=this._handleResult(t,d);if(!i)return!1;if(this.isRemote){const t=await this._browserPrint(i,"preview");this.instance||(this.instance=l()),this.showPreview(this.instance,t)}await this.getPicAndUpload(i),null==m||m(i)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e,result:"error"}:{message:e,result:"error"};null==d||d(i),this._handleMonitorNotify(i)}}async printSync(t,e,i){const r=t.map((t=>{const e={params:"",printdlgshow:"0",nobillnode:"1",btnprint:"1",...t,cmdid:"7",...t.signature?{signature:t.signature}:{}};if(e.print)try{e.print=JSON.parse(e.print)}catch(t){}return{inputData:e}}));try{const t=c(),s=await this.messageCollect(t,{exec:"printA",data:r});if(s&&Array.isArray(s)){s.some((t=>"success"===t.res.result))?null==e||e(s):(null==i||i(s),this._handleMonitorNotify(s))}else{const t="打印命令返回无效数据";this._handleMonitorNotify(s||""),null==i||i({type:"printError",message:t,result:"error",errinfo:t})}}catch(t){const e={error:t,result:"error",message:"打印失败"};null==i||i(e),this._handleMonitorNotify(e)}}async printDirect({iReportExecuteMode:t,templateId:e,formatId:i,params:r="",paramsArr:s,authorizationKey:n,print:o,signature:l,printdlgshow:c,nobillnode:h,copies:p,svrUpdateIp:m,isDownloadFile:d=!0,messageTimeout:g=0},y,f,w,v="printDirect"){const P=a(i),_=this.getIReportFormatId(P,i);if(P&&(u||2==t)){if(!await this._testDomesticSystemConnection())return void f({type:"notOpenedApp",result:"error",message:"请开启ihoPrint客户端"});return void(this._initDomesticSystem((async t=>{t?await this.printToHiPrint({templateId:e,formatId:_,params:r,authorizationKey:n},y,f,w):f({type:"connectAppFail",result:"error",message:"连接ihoPrint客户端失败"})}))&&await this.printToHiPrint({templateId:e,formatId:_,params:r,authorizationKey:n},y,f,w))}await this._queryProxyOrigin();const b=await this._testConnection();if(!this._handleResultTest(b,f))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:_,params:r,paramsArr:s,cmdid:"7",print:o,signature:l,printdlgshow:c,nobillnode:h,copies:p,svrUpdateIp:m,messageTimeout:g}),i=this._handleResult(t,f,w);if(!i)return!1;d&&["downloadPDF"].includes(v)&&await this._browserPrint(i,v),null==y||y(i)}catch(t){const e="printDirect"===v?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e,result:"error"}:{message:e,result:"error"};null==f||f(i),this._handleMonitorNotify(i)}}async printToHiPrint({templateId:t,formatId:e,params:i,authorizationKey:r},s,a,n){const o=await this._queryPrintForBase64(t,e,i,r);if(!o.success)return a({message:o.resultMsg,result:"error"});const{base64:l,formatId:c}=o.map;this.base64Fragment=l,this._successCallbackFn=s,this._errorCallbackFn=a,n&&(this._cancelCallbackFn=n),this.hiPrintSocket.emit("news",{printerList:this.printerList,type:"askPrinterTemplate",markTemplateId:c,pdf_stream:this.base64Fragment})}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):m.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}async downloadPDF(t,r,s){var n;const o=e(t);if(this.webview&&this.downloadPath&&(Reflect.has(o,"print")||Reflect.set(o,"print",{print:"1",type:"1"}),!o.print.filename)){const t=h(new Date,"yyyy-MM-dd"),e=c(),i=h(new Date,"yyyyMMddHHmmss")+e;o.print.filename=`${this.downloadPath}/${t}/${i}/${i}`.replace(/\\/g,"/")}const l=a(o.formatId);if(o.formatId=this.getIReportFormatId(l,o.formatId),l&&(u||2==o.iReportExecuteMode)){const t=await this._queryPrintForBase16(o.templateId||"",o.formatId,o.params||"",o.authorizationKey);return(null==t?void 0:t.success)?r({filebase64:null==(n=null==t?void 0:t.map)?void 0:n.hex,isIreport:!0}):null==s?void 0:s({type:"queryPrintDataFailure",result:"error",message:"获取文件失败!"})}this.printDirect(o,(async t=>{t||s({result:"error",message:""});const e=this,a=await async function(t){const r=[],s=JSON.parse(t);if(!i(s))return await e._downloadPDF("");if(1===s.length)return await e._downloadPDF(s[0]||"");for(let t=0,i=s.length;t<i;t++)r.push(await e._downloadPDF(s[t]||""));return r}(t.filedir);r(a,t)}),(t=>s(t)),(t=>{console.log(t)}),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:r=0},s,a){const n=await this._testConnection();if(!this._handleResultTest(n,a))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:r},void 0,a);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,a);if(!l)return!1;s&&s(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:r=0},s,a){const n=await this._testConnection();if(!this._handleResultTest(n,a))return!1;const o=await this._handleEventQueryPrintData(t,e,i,r,a);return!!o&&(s&&s(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},r,s){const a=await this._testConnection();if(!this._handleResultTest(a,s))return!1;const n=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(n,s);return!!o&&(r&&r(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:r,messageTimeout:s=0},a,n){const o=await this._testConnection();if(!this._handleResultTest(o,n))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:r,messageTimeout:s}),c=this._handleResult(l,n);if(!c)return!1;a&&a(c)}async addPrintFormat({templateId:t,params:e,token:i},r,s){const a=await this._testConnection();if(!this._handleResultTest(a,s))return!1;const n=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(n,s);if(!o)return!1;r&&r(o)}}export{b as Print};
@@ -833,6 +833,14 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
833
833
  type: import("vue").PropType<string | false | HTMLElement>;
834
834
  default: string;
835
835
  };
836
+ holidays: {
837
+ type: import("vue").PropType<Date[]>;
838
+ default: () => never[];
839
+ };
840
+ type: {
841
+ type: StringConstructor;
842
+ default: string;
843
+ };
836
844
  }, {
837
845
  attrs: {
838
846
  [x: string]: unknown;
@@ -857,6 +865,14 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
857
865
  type: import("vue").PropType<string | false | HTMLElement>;
858
866
  default: string;
859
867
  };
868
+ holidays: {
869
+ type: import("vue").PropType<Date[]>;
870
+ default: () => never[];
871
+ };
872
+ type: {
873
+ type: StringConstructor;
874
+ default: string;
875
+ };
860
876
  }>> & {
861
877
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
862
878
  }>>;
@@ -873,6 +889,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
873
889
  blur: () => any;
874
890
  handleConfirm: (target: HTMLInputElement) => void;
875
891
  onUpdateShow: (show: boolean) => Promise<void>;
892
+ watchers: import("../../shared/types").AnyFn[];
893
+ stopWatcher: () => void;
894
+ setHoliday: (show: boolean) => Promise<void>;
876
895
  onConfirm: (...args: any[]) => Promise<void>;
877
896
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
878
897
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -897,11 +916,21 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
897
916
  type: import("vue").PropType<string | false | HTMLElement>;
898
917
  default: string;
899
918
  };
919
+ holidays: {
920
+ type: import("vue").PropType<Date[]>;
921
+ default: () => never[];
922
+ };
923
+ type: {
924
+ type: StringConstructor;
925
+ default: string;
926
+ };
900
927
  }>> & {
901
928
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
902
929
  }, {
930
+ type: string;
903
931
  updateUnchangedValue: boolean;
904
932
  to: string | false | HTMLElement;
933
+ holidays: Date[];
905
934
  }>>;
906
935
  NSelect: any;
907
936
  WidgetValEnums: {
@@ -1495,6 +1524,14 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1495
1524
  type: import("vue").PropType<string | false | HTMLElement>;
1496
1525
  default: string;
1497
1526
  };
1527
+ holidays: {
1528
+ type: import("vue").PropType<Date[]>;
1529
+ default: () => never[];
1530
+ };
1531
+ type: {
1532
+ type: StringConstructor;
1533
+ default: string;
1534
+ };
1498
1535
  }, {
1499
1536
  attrs: {
1500
1537
  [x: string]: unknown;
@@ -1519,6 +1556,14 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1519
1556
  type: import("vue").PropType<string | false | HTMLElement>;
1520
1557
  default: string;
1521
1558
  };
1559
+ holidays: {
1560
+ type: import("vue").PropType<Date[]>;
1561
+ default: () => never[];
1562
+ };
1563
+ type: {
1564
+ type: StringConstructor;
1565
+ default: string;
1566
+ };
1522
1567
  }>> & {
1523
1568
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1524
1569
  }>>;
@@ -1535,6 +1580,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1535
1580
  blur: () => any;
1536
1581
  handleConfirm: (target: HTMLInputElement) => void;
1537
1582
  onUpdateShow: (show: boolean) => Promise<void>;
1583
+ watchers: import("../../shared/types").AnyFn[];
1584
+ stopWatcher: () => void;
1585
+ setHoliday: (show: boolean) => Promise<void>;
1538
1586
  onConfirm: (...args: any[]) => Promise<void>;
1539
1587
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
1540
1588
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -1559,11 +1607,21 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1559
1607
  type: import("vue").PropType<string | false | HTMLElement>;
1560
1608
  default: string;
1561
1609
  };
1610
+ holidays: {
1611
+ type: import("vue").PropType<Date[]>;
1612
+ default: () => never[];
1613
+ };
1614
+ type: {
1615
+ type: StringConstructor;
1616
+ default: string;
1617
+ };
1562
1618
  }>> & {
1563
1619
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1564
1620
  }, {
1621
+ type: string;
1565
1622
  updateUnchangedValue: boolean;
1566
1623
  to: string | false | HTMLElement;
1624
+ holidays: Date[];
1567
1625
  }>>;
1568
1626
  WidgetValEnums: {
1569
1627
  CUSTOM: string;
@@ -1958,6 +2016,14 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1958
2016
  type: import("vue").PropType<string | false | HTMLElement>;
1959
2017
  default: string;
1960
2018
  };
2019
+ holidays: {
2020
+ type: import("vue").PropType<Date[]>;
2021
+ default: () => never[];
2022
+ };
2023
+ type: {
2024
+ type: StringConstructor;
2025
+ default: string;
2026
+ };
1961
2027
  }, {
1962
2028
  attrs: {
1963
2029
  [x: string]: unknown;
@@ -1982,6 +2048,14 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1982
2048
  type: import("vue").PropType<string | false | HTMLElement>;
1983
2049
  default: string;
1984
2050
  };
2051
+ holidays: {
2052
+ type: import("vue").PropType<Date[]>;
2053
+ default: () => never[];
2054
+ };
2055
+ type: {
2056
+ type: StringConstructor;
2057
+ default: string;
2058
+ };
1985
2059
  }>> & {
1986
2060
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1987
2061
  }>>;
@@ -1998,6 +2072,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1998
2072
  blur: () => any;
1999
2073
  handleConfirm: (target: HTMLInputElement) => void;
2000
2074
  onUpdateShow: (show: boolean) => Promise<void>;
2075
+ watchers: import("../../shared/types").AnyFn[];
2076
+ stopWatcher: () => void;
2077
+ setHoliday: (show: boolean) => Promise<void>;
2001
2078
  onConfirm: (...args: any[]) => Promise<void>;
2002
2079
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
2003
2080
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -2022,11 +2099,21 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
2022
2099
  type: import("vue").PropType<string | false | HTMLElement>;
2023
2100
  default: string;
2024
2101
  };
2102
+ holidays: {
2103
+ type: import("vue").PropType<Date[]>;
2104
+ default: () => never[];
2105
+ };
2106
+ type: {
2107
+ type: StringConstructor;
2108
+ default: string;
2109
+ };
2025
2110
  }>> & {
2026
2111
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
2027
2112
  }, {
2113
+ type: string;
2028
2114
  updateUnchangedValue: boolean;
2029
2115
  to: string | false | HTMLElement;
2116
+ holidays: Date[];
2030
2117
  }>>;
2031
2118
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
2032
2119
  componentCfg: {
@@ -297,6 +297,14 @@ declare const _default: import("vue").DefineComponent<{
297
297
  type: import("vue").PropType<string | false | HTMLElement>;
298
298
  default: string;
299
299
  };
300
+ holidays: {
301
+ type: import("vue").PropType<Date[]>;
302
+ default: () => never[];
303
+ };
304
+ type: {
305
+ type: StringConstructor;
306
+ default: string;
307
+ };
300
308
  }, {
301
309
  attrs: {
302
310
  [x: string]: unknown;
@@ -321,6 +329,14 @@ declare const _default: import("vue").DefineComponent<{
321
329
  type: import("vue").PropType<string | false | HTMLElement>;
322
330
  default: string;
323
331
  };
332
+ holidays: {
333
+ type: import("vue").PropType<Date[]>;
334
+ default: () => never[];
335
+ };
336
+ type: {
337
+ type: StringConstructor;
338
+ default: string;
339
+ };
324
340
  }>> & {
325
341
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
326
342
  }>>;
@@ -337,6 +353,9 @@ declare const _default: import("vue").DefineComponent<{
337
353
  blur: () => any;
338
354
  handleConfirm: (target: HTMLInputElement) => void;
339
355
  onUpdateShow: (show: boolean) => Promise<void>;
356
+ watchers: import("../../../../../shared/types").AnyFn[];
357
+ stopWatcher: () => void;
358
+ setHoliday: (show: boolean) => Promise<void>;
340
359
  onConfirm: (...args: any[]) => Promise<void>;
341
360
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
342
361
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -361,11 +380,21 @@ declare const _default: import("vue").DefineComponent<{
361
380
  type: import("vue").PropType<string | false | HTMLElement>;
362
381
  default: string;
363
382
  };
383
+ holidays: {
384
+ type: import("vue").PropType<Date[]>;
385
+ default: () => never[];
386
+ };
387
+ type: {
388
+ type: StringConstructor;
389
+ default: string;
390
+ };
364
391
  }>> & {
365
392
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
366
393
  }, {
394
+ type: string;
367
395
  updateUnchangedValue: boolean;
368
396
  to: string | false | HTMLElement;
397
+ holidays: Date[];
369
398
  }>>;
370
399
  NSelect: any;
371
400
  WidgetValEnums: {
@@ -959,6 +988,14 @@ declare const _default: import("vue").DefineComponent<{
959
988
  type: import("vue").PropType<string | false | HTMLElement>;
960
989
  default: string;
961
990
  };
991
+ holidays: {
992
+ type: import("vue").PropType<Date[]>;
993
+ default: () => never[];
994
+ };
995
+ type: {
996
+ type: StringConstructor;
997
+ default: string;
998
+ };
962
999
  }, {
963
1000
  attrs: {
964
1001
  [x: string]: unknown;
@@ -983,6 +1020,14 @@ declare const _default: import("vue").DefineComponent<{
983
1020
  type: import("vue").PropType<string | false | HTMLElement>;
984
1021
  default: string;
985
1022
  };
1023
+ holidays: {
1024
+ type: import("vue").PropType<Date[]>;
1025
+ default: () => never[];
1026
+ };
1027
+ type: {
1028
+ type: StringConstructor;
1029
+ default: string;
1030
+ };
986
1031
  }>> & {
987
1032
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
988
1033
  }>>;
@@ -999,6 +1044,9 @@ declare const _default: import("vue").DefineComponent<{
999
1044
  blur: () => any;
1000
1045
  handleConfirm: (target: HTMLInputElement) => void;
1001
1046
  onUpdateShow: (show: boolean) => Promise<void>;
1047
+ watchers: import("../../../../../shared/types").AnyFn[];
1048
+ stopWatcher: () => void;
1049
+ setHoliday: (show: boolean) => Promise<void>;
1002
1050
  onConfirm: (...args: any[]) => Promise<void>;
1003
1051
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
1004
1052
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -1023,11 +1071,21 @@ declare const _default: import("vue").DefineComponent<{
1023
1071
  type: import("vue").PropType<string | false | HTMLElement>;
1024
1072
  default: string;
1025
1073
  };
1074
+ holidays: {
1075
+ type: import("vue").PropType<Date[]>;
1076
+ default: () => never[];
1077
+ };
1078
+ type: {
1079
+ type: StringConstructor;
1080
+ default: string;
1081
+ };
1026
1082
  }>> & {
1027
1083
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1028
1084
  }, {
1085
+ type: string;
1029
1086
  updateUnchangedValue: boolean;
1030
1087
  to: string | false | HTMLElement;
1088
+ holidays: Date[];
1031
1089
  }>>;
1032
1090
  WidgetValEnums: {
1033
1091
  CUSTOM: string;
@@ -1422,6 +1480,14 @@ declare const _default: import("vue").DefineComponent<{
1422
1480
  type: import("vue").PropType<string | false | HTMLElement>;
1423
1481
  default: string;
1424
1482
  };
1483
+ holidays: {
1484
+ type: import("vue").PropType<Date[]>;
1485
+ default: () => never[];
1486
+ };
1487
+ type: {
1488
+ type: StringConstructor;
1489
+ default: string;
1490
+ };
1425
1491
  }, {
1426
1492
  attrs: {
1427
1493
  [x: string]: unknown;
@@ -1446,6 +1512,14 @@ declare const _default: import("vue").DefineComponent<{
1446
1512
  type: import("vue").PropType<string | false | HTMLElement>;
1447
1513
  default: string;
1448
1514
  };
1515
+ holidays: {
1516
+ type: import("vue").PropType<Date[]>;
1517
+ default: () => never[];
1518
+ };
1519
+ type: {
1520
+ type: StringConstructor;
1521
+ default: string;
1522
+ };
1449
1523
  }>> & {
1450
1524
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1451
1525
  }>>;
@@ -1462,6 +1536,9 @@ declare const _default: import("vue").DefineComponent<{
1462
1536
  blur: () => any;
1463
1537
  handleConfirm: (target: HTMLInputElement) => void;
1464
1538
  onUpdateShow: (show: boolean) => Promise<void>;
1539
+ watchers: import("../../../../../shared/types").AnyFn[];
1540
+ stopWatcher: () => void;
1541
+ setHoliday: (show: boolean) => Promise<void>;
1465
1542
  onConfirm: (...args: any[]) => Promise<void>;
1466
1543
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
1467
1544
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -1486,11 +1563,21 @@ declare const _default: import("vue").DefineComponent<{
1486
1563
  type: import("vue").PropType<string | false | HTMLElement>;
1487
1564
  default: string;
1488
1565
  };
1566
+ holidays: {
1567
+ type: import("vue").PropType<Date[]>;
1568
+ default: () => never[];
1569
+ };
1570
+ type: {
1571
+ type: StringConstructor;
1572
+ default: string;
1573
+ };
1489
1574
  }>> & {
1490
1575
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1491
1576
  }, {
1577
+ type: string;
1492
1578
  updateUnchangedValue: boolean;
1493
1579
  to: string | false | HTMLElement;
1580
+ holidays: Date[];
1494
1581
  }>>;
1495
1582
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1496
1583
  componentCfg: {