cnhis-design-vue 3.2.15-release.5 → 3.2.16-beta.8
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.
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/branch-notice/src/canstants.js +1 -1
- package/es/components/button-print/index.d.ts +6 -13
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +6 -13
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +6 -13
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/button-print/style/index.css +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +10 -0
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/expand-field/index.d.ts +26 -0
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +26 -0
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +26 -0
- package/es/components/expand-field/src/components/form.vue.d.ts +26 -0
- package/es/components/expand-field/src/index.vue.d.ts +26 -0
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/form-config/index.d.ts +30 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +30 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +10 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +10 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +10 -0
- package/es/components/form-render/index.d.ts +10 -0
- package/es/components/form-render/src/FormRender.vue.d.ts +10 -0
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +10 -0
- package/es/components/form-render/src/components/renderer/input.d.ts +9 -1
- package/es/components/form-render/src/components/renderer/input.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/iho-chat/index.d.ts +181 -23
- package/es/components/iho-chat/src/Index.vue.d.ts +181 -23
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +24 -12
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +150 -7
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +12 -6
- package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +137 -0
- package/es/components/iho-chat/src/components/MessageEvent.vue.js +1 -0
- package/es/components/iho-chat/src/components/MessageEvent.vue2.js +1 -0
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +6 -3
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +13 -6
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/constants/index.d.ts +2 -1
- package/es/components/iho-chat/src/constants/index.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +2 -2
- package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
- package/es/components/iho-chat/src/utils/asyncQueue.d.ts +10 -0
- package/es/components/iho-chat/src/utils/asyncQueue.js +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +14 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +20 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +20 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +10 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +10 -0
- package/es/components/select-person/index.d.ts +26 -0
- package/es/components/select-person/src/SelectPerson.vue.d.ts +14 -0
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/index.vue.d.ts +26 -0
- package/es/components/select-person/src/index.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +10 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +10 -0
- package/es/shared/hooks/useDateTime.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as t,ref as a,reactive as l,computed as n,watch as o,createVNode as i}from"vue";import{NForm as s,NFormItem as r,NInput as u,NIcon as d,NButton as c}from"naive-ui";import{InjectionAIChat as v}from"../types/index.js";import"../../../index.js";import{cloneDeep as p,isArray as m,omit as f}from"lodash-es";import{isValidJSON as g}from"../utils/index.js";import{ChevronDown as b,ChevronForward as h}from"@vicons/ionicons5";import{useTheme as y}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import
|
1
|
+
import{defineComponent as e,inject as t,ref as a,reactive as l,computed as n,watch as o,createVNode as i}from"vue";import{NForm as s,NFormItem as r,NInput as u,NIcon as d,NButton as c}from"naive-ui";import{InjectionAIChat as v}from"../types/index.js";import"../../../index.js";import{cloneDeep as p,isArray as m,omit as f}from"lodash-es";import{isValidJSON as g}from"../utils/index.js";import{ChevronDown as b,ChevronForward as h}from"@vicons/ionicons5";import{useTheme as y}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import E from"../../../form-render/index.js";import I from"../../../template-render/index.js";var k=e({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},selectParams:{type:Object},configs:{type:Object},msgId:{type:String}},emits:["button-click"],setup(e,{attrs:k,slots:x,emit:_}){const T={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATE",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},C=y(),{patientInfo:P,state:w,axiosInstance:O,isSmall:S,appId:j}=t(v),M=a([]),R=a(),L=a(),N=l({vaa05:""}),q=a(),A=n((()=>{var t,a;return!!(null==(a=null==(t=e.msgItem)?void 0:t.content)?void 0:a.body)})),H=e.msgItem.content,B={},F=l(p(H.data||{})),K={beforeRequest(e,t,a){(null==t?void 0:t.params)&&(t.params.vaa05=L.value.selectedPatient.vaa01),t&&Reflect.has(t,"configs")&&(t.configs=L.value.selectedPatient)}};function U(e){const{eventName:t,data:a}=e;t&&_("button-click",{buttonInfo:a,isBI:!0})}function D(e){F[e.button.id+"Disabled"]="1",_("button-click",{buttonInfo:{...f(e.button,["props"]),data:e.data}})}function J(){var t;if(!L.value)return null;function a(){e.msgItem.disabled||(w.showPatient=!0)}return i(s,{class:"form-render",ref:q,"require-mark-placement":"left",disabled:e.msgItem.disabled,model:N,rules:{vaa05:{required:L.value.required,message:L.value.name+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.146"))||"为必填"),trigger:["input"]}}},{default:()=>[i(r,{label:L.value.name,path:"vaa05",class:"form-render__formItem",style:"--n-feedback-height: 16px; --n-feedback-padding: 0px; --n-feedback-font-size: 12px"},{default:()=>{var e;return[i(u,{style:"--n-text-color-disabled: #000; --n-placeholder-color-disabled: #000;--n-padding-left: 8px; --n-padding-right: 8px",readonly:!0,value:N.vaa05,placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.147"))||"请选择",onClick:a},{suffix:()=>i(d,{color:"#c2c2c2",component:b},null)})]}})]})}async function z(t,a){var l,n;try{const o=a||R.value.getFormValues();await(null==(l=R.value)?void 0:l.validate()),H.body.items.forEach((e=>{var t;"vaa05"===e.code?(e._value=w.selectedPatientLabel,e.value=L.value.selectedPatient.vaa01||e.value):o[e.code]&&(e.value=o[e.code]),(null==(t=B[e.code])?void 0:t[0])&&(e.options=B[e.code])})),w.loading=!0,_("button-click",{values:o,buttonInfo:t,patient:(null==(n=L.value)?void 0:n.selectedPatient)||e.configs,isForm:!0})}catch(e){w.loading=!1}}function V(e){const{fieldInstance:t,context:a,value:l,fieldKey:n}=e;"REMOTE_SEARCH"===t.componentType&&(null==l?void 0:l.length)&&(B[n]=[null==a?void 0:a.currentOption])}function X(){_("button-click",{showMore:!0})}function G(){var e;if("1834043761964638208"!==(null==(e=H.settings)?void 0:e.id)||!H.data)return null;const t=JSON.parse(H.settings.setting),a=e=>{var t;let l="";for(let n=0;n<e.length;n++){const o=e[n];if(o.setting.scopeKey){l=o.setting.scopeKey;break}if((null==(t=o.childrens)?void 0:t.length)&&(l=a(o.childrens),l))break}return l},l=a(t.templates);return!l||!g(H.data[l])||JSON.parse(H.data[l]).length<=5?null:(g(F[l])&&(F[l]=JSON.parse(F[l]).slice(0,5)),i(c,{block:!0,text:!0,"icon-placement":"right",color:C.value["--c-primary-color"],style:"margin-top: 10px",onClick:X},{icon:()=>i(d,{component:h},null),default:()=>"查看更多"}))}return A.value&&(M.value=(H.body.items||[]).map((t=>{var a,l,n;if("vaa05"===t.code&&!S.value)return L.value={...t},t._value?N.vaa05=t._value:(null==(a=t.options)?void 0:a.length)&&t.value&&(N.vaa05=null==(l=t.options.find((e=>e.value===t.value)))?void 0:l.label,L.value.selectedPatient=e.configs),null;const o={html_type:T[t.type]||t.type,val_key:t.code,name:t.name,elem_width:12,default_val:t.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(n=t.labelField)?n:"label"},option:[],is_null:t.required?"0":"1",is_edit:e.msgItem.disabled?"0":"1",componentProps:{},multi_select:"MULTI_SELECT"===t.type?"0":"1"};if("DATETIME"===t.type&&(o.date_format="yyyy-MM-dd HH:mm:ss"),"REMOTE_SEARCH"===o.html_type){if(o.componentProps={fallbackOption:!1},o.option=t.options||[],o.default_val=null,t.value&&m(t.options)&&t.options.length>0){t.options.find((e=>(null==e?void 0:e.value)===t.value))&&(o.default_val=t.value)}if(Object.assign(o.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{...e.selectParams,code:t.code,source:S.value?"inner":"global",...S.value?{appId:j.value}:{},configs:P.value.info||w.selectedPatient},dependKey:[]}),t.dependencies){const e=t.dependencies.split(",");o.urlConfig.dependKey=e,e.includes("vaa05")&&(o.urlConfig.params.params={vaa05:""})}}return o})).filter((e=>!!e))),o((()=>w.showPatient),(t=>{!e.msgItem.disabled&&A.value&&!t&&w.selectedPatientLabel&&L.value&&(N.vaa05=w.selectedPatientLabel,L.value.selectedPatient={...w.selectedPatientForm})})),()=>{var t;return i("div",{class:"card"},[A.value?[i("p",null,[H.title||H.header.title]),i("div",{class:"form-box"},[[J(),i(E,{"request-instance":{get:O.get,post:O.post},"life-cycle":K,column:12,ref:R,"field-list":M.value,onFormChange:V},null)]]),H.footer.buttons.map((t=>function(t){const a={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},l=A.value?{...a,marginTop:"0"}:a;return i(c,{id:e.msgId,style:l,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){var e;if(A.value){if(!R.value)return;try{L.value?null==(e=q.value)||e.validate((async e=>{var a,l;if(!e){const e=null==(l=(a=R.value).getFormValues)?void 0:l.call(a);Object.assign(e,{vaa05:L.value.selectedPatient.vaa01}),await z(t,e)}})):await z(t)}catch(e){}}else _("button-click")}},{default:()=>[A.value?null==t?void 0:t.text:H.buttonName]})}(t)))]:[i(I,{config:g(null==(t=H.settings)?void 0:t.setting)?JSON.parse(H.settings.setting):null,data:F,"onModule-click":U,"onButton-click":D},null),G()]])}}});export{k as default};
|
@@ -1 +1 @@
|
|
1
|
-
const _={CARD_WIDTH:
|
1
|
+
const _={CARD_WIDTH:130,CARD_HEIGHT:74,CARD_X_SPACE:40,CARD_Y_SPACE:60,BRANCH_POINT_RADIUS:8,LINE_WIDTH:4};export{_ as BRANCH_NOTICE_CONSTANTS};
|
@@ -270,10 +270,6 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
270
270
|
default: () => Promise<{}>;
|
271
271
|
type: FunctionConstructor;
|
272
272
|
};
|
273
|
-
queryTemplateParams: {
|
274
|
-
default: () => Promise<{}>;
|
275
|
-
type: FunctionConstructor;
|
276
|
-
};
|
277
273
|
strategy: {
|
278
274
|
default: string;
|
279
275
|
type: StringConstructor;
|
@@ -336,6 +332,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
336
332
|
defaultFormatId: string;
|
337
333
|
shortcut: {};
|
338
334
|
buttonProps: {};
|
335
|
+
showMaxHeight: null;
|
339
336
|
};
|
340
337
|
};
|
341
338
|
svrUpdateIp: {
|
@@ -388,10 +385,6 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
388
385
|
default: () => Promise<{}>;
|
389
386
|
type: FunctionConstructor;
|
390
387
|
};
|
391
|
-
queryTemplateParams: {
|
392
|
-
default: () => Promise<{}>;
|
393
|
-
type: FunctionConstructor;
|
394
|
-
};
|
395
388
|
strategy: {
|
396
389
|
default: string;
|
397
390
|
type: StringConstructor;
|
@@ -454,6 +447,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
454
447
|
defaultFormatId: string;
|
455
448
|
shortcut: {};
|
456
449
|
buttonProps: {};
|
450
|
+
showMaxHeight: null;
|
457
451
|
};
|
458
452
|
};
|
459
453
|
svrUpdateIp: {
|
@@ -482,6 +476,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
482
476
|
isPrintAllType: import("vue").ComputedRef<any>;
|
483
477
|
shortcutSettings: import("vue").ComputedRef<any>;
|
484
478
|
buttonProps: import("vue").ComputedRef<any>;
|
479
|
+
showMaxHeight: import("vue").ComputedRef<any>;
|
480
|
+
printAllFormatIds: import("vue").ComputedRef<any>;
|
481
|
+
positionElement: import("vue").ComputedRef<any>;
|
485
482
|
printAllShortcut: import("vue").ComputedRef<any>;
|
486
483
|
showSettingItems: import("vue").ComputedRef<import("../../shared/types").AnyObject[]>;
|
487
484
|
isSelectedAll: import("vue").WritableComputedRef<boolean>;
|
@@ -759,10 +756,6 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
759
756
|
default: () => Promise<{}>;
|
760
757
|
type: FunctionConstructor;
|
761
758
|
};
|
762
|
-
queryTemplateParams: {
|
763
|
-
default: () => Promise<{}>;
|
764
|
-
type: FunctionConstructor;
|
765
|
-
};
|
766
759
|
strategy: {
|
767
760
|
default: string;
|
768
761
|
type: StringConstructor;
|
@@ -825,6 +818,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
825
818
|
defaultFormatId: string;
|
826
819
|
shortcut: {};
|
827
820
|
buttonProps: {};
|
821
|
+
showMaxHeight: null;
|
828
822
|
};
|
829
823
|
};
|
830
824
|
svrUpdateIp: {
|
@@ -839,7 +833,6 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
839
833
|
formatEditText: string;
|
840
834
|
prevFn: Function;
|
841
835
|
queryPrintFormatByNumber: Function;
|
842
|
-
queryTemplateParams: Function;
|
843
836
|
strategy: string;
|
844
837
|
clickPrevFn: Function;
|
845
838
|
noDataMsg: string;
|
@@ -276,10 +276,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
276
276
|
default: () => Promise<{}>;
|
277
277
|
type: FunctionConstructor;
|
278
278
|
};
|
279
|
-
queryTemplateParams: {
|
280
|
-
default: () => Promise<{}>;
|
281
|
-
type: FunctionConstructor;
|
282
|
-
};
|
283
279
|
strategy: {
|
284
280
|
default: string;
|
285
281
|
type: StringConstructor;
|
@@ -342,6 +338,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
342
338
|
defaultFormatId: string;
|
343
339
|
shortcut: {};
|
344
340
|
buttonProps: {};
|
341
|
+
showMaxHeight: null;
|
345
342
|
};
|
346
343
|
};
|
347
344
|
svrUpdateIp: {
|
@@ -394,10 +391,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
394
391
|
default: () => Promise<{}>;
|
395
392
|
type: FunctionConstructor;
|
396
393
|
};
|
397
|
-
queryTemplateParams: {
|
398
|
-
default: () => Promise<{}>;
|
399
|
-
type: FunctionConstructor;
|
400
|
-
};
|
401
394
|
strategy: {
|
402
395
|
default: string;
|
403
396
|
type: StringConstructor;
|
@@ -460,6 +453,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
460
453
|
defaultFormatId: string;
|
461
454
|
shortcut: {};
|
462
455
|
buttonProps: {};
|
456
|
+
showMaxHeight: null;
|
463
457
|
};
|
464
458
|
};
|
465
459
|
svrUpdateIp: {
|
@@ -488,6 +482,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
488
482
|
isPrintAllType: import("vue").ComputedRef<any>;
|
489
483
|
shortcutSettings: import("vue").ComputedRef<any>;
|
490
484
|
buttonProps: import("vue").ComputedRef<any>;
|
485
|
+
showMaxHeight: import("vue").ComputedRef<any>;
|
486
|
+
printAllFormatIds: import("vue").ComputedRef<any>;
|
487
|
+
positionElement: import("vue").ComputedRef<any>;
|
491
488
|
printAllShortcut: import("vue").ComputedRef<any>;
|
492
489
|
showSettingItems: import("vue").ComputedRef<AnyObject[]>;
|
493
490
|
isSelectedAll: import("vue").WritableComputedRef<boolean>;
|
@@ -765,10 +762,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
765
762
|
default: () => Promise<{}>;
|
766
763
|
type: FunctionConstructor;
|
767
764
|
};
|
768
|
-
queryTemplateParams: {
|
769
|
-
default: () => Promise<{}>;
|
770
|
-
type: FunctionConstructor;
|
771
|
-
};
|
772
765
|
strategy: {
|
773
766
|
default: string;
|
774
767
|
type: StringConstructor;
|
@@ -831,6 +824,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
831
824
|
defaultFormatId: string;
|
832
825
|
shortcut: {};
|
833
826
|
buttonProps: {};
|
827
|
+
showMaxHeight: null;
|
834
828
|
};
|
835
829
|
};
|
836
830
|
svrUpdateIp: {
|
@@ -845,7 +839,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
845
839
|
formatEditText: string;
|
846
840
|
prevFn: Function;
|
847
841
|
queryPrintFormatByNumber: Function;
|
848
|
-
queryTemplateParams: Function;
|
849
842
|
strategy: string;
|
850
843
|
clickPrevFn: Function;
|
851
844
|
noDataMsg: string;
|
@@ -41,10 +41,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
41
41
|
default: () => Promise<{}>;
|
42
42
|
type: FunctionConstructor;
|
43
43
|
};
|
44
|
-
queryTemplateParams: {
|
45
|
-
default: () => Promise<{}>;
|
46
|
-
type: FunctionConstructor;
|
47
|
-
};
|
48
44
|
strategy: {
|
49
45
|
default: string;
|
50
46
|
type: StringConstructor;
|
@@ -107,6 +103,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
107
103
|
defaultFormatId: string;
|
108
104
|
shortcut: {};
|
109
105
|
buttonProps: {};
|
106
|
+
showMaxHeight: null;
|
110
107
|
};
|
111
108
|
};
|
112
109
|
svrUpdateIp: {
|
@@ -162,10 +159,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
162
159
|
default: () => Promise<{}>;
|
163
160
|
type: FunctionConstructor;
|
164
161
|
};
|
165
|
-
queryTemplateParams: {
|
166
|
-
default: () => Promise<{}>;
|
167
|
-
type: FunctionConstructor;
|
168
|
-
};
|
169
162
|
strategy: {
|
170
163
|
default: string;
|
171
164
|
type: StringConstructor;
|
@@ -228,6 +221,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
228
221
|
defaultFormatId: string;
|
229
222
|
shortcut: {};
|
230
223
|
buttonProps: {};
|
224
|
+
showMaxHeight: null;
|
231
225
|
};
|
232
226
|
};
|
233
227
|
svrUpdateIp: {
|
@@ -256,6 +250,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
256
250
|
isPrintAllType: import("vue").ComputedRef<any>;
|
257
251
|
shortcutSettings: import("vue").ComputedRef<any>;
|
258
252
|
buttonProps: import("vue").ComputedRef<any>;
|
253
|
+
showMaxHeight: import("vue").ComputedRef<any>;
|
254
|
+
printAllFormatIds: import("vue").ComputedRef<any>;
|
255
|
+
positionElement: import("vue").ComputedRef<any>;
|
259
256
|
printAllShortcut: import("vue").ComputedRef<any>;
|
260
257
|
showSettingItems: import("vue").ComputedRef<AnyObject[]>;
|
261
258
|
isSelectedAll: import("vue").WritableComputedRef<boolean>;
|
@@ -536,10 +533,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
536
533
|
default: () => Promise<{}>;
|
537
534
|
type: FunctionConstructor;
|
538
535
|
};
|
539
|
-
queryTemplateParams: {
|
540
|
-
default: () => Promise<{}>;
|
541
|
-
type: FunctionConstructor;
|
542
|
-
};
|
543
536
|
strategy: {
|
544
537
|
default: string;
|
545
538
|
type: StringConstructor;
|
@@ -602,6 +595,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
602
595
|
defaultFormatId: string;
|
603
596
|
shortcut: {};
|
604
597
|
buttonProps: {};
|
598
|
+
showMaxHeight: null;
|
605
599
|
};
|
606
600
|
};
|
607
601
|
svrUpdateIp: {
|
@@ -616,7 +610,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
616
610
|
formatEditText: string;
|
617
611
|
prevFn: Function;
|
618
612
|
queryPrintFormatByNumber: Function;
|
619
|
-
queryTemplateParams: Function;
|
620
613
|
strategy: string;
|
621
614
|
clickPrevFn: Function;
|
622
615
|
noDataMsg: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as t,inject as n,ref as i,reactive as a,computed as r,onMounted as l,onBeforeUnmount as o,watch as s,openBlock as u,createElementBlock as d,Fragment as c,createCommentVNode as p,createVNode as m,unref as v,withCtx as g,renderList as y,createBlock as f,mergeProps as w,createTextVNode as h,toDisplayString as k,isRef as b,renderSlot as P,withModifiers as C,normalizeClass as S}from"vue";import{isObject as L}from"@vue/shared";import{useMessage as I,NButtonGroup as O,NDropdown as T,NButton as j,NIcon as M,NPopover as x,NCheckbox as E,NDivider as F}from"naive-ui";import{PrintOutline as B,SettingsOutline as N,ChevronDownSharp as _,ArrowForwardOutline as D}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as R}from"../constants/index.js";import{Print as J}from"../utils/print.js";import{isIReport as U}from"../utils/browserPrint.js";import z from"./IdentityVerification.vue.js";import{format as A}from"date-fns";import"../api.js";import"../../../shortcut-provider/index.js";import{encapBrowserLog as K}from"../../../../shared/utils/index.js";import{useShortcuts as V}from"../../../shortcut-provider/src/hooks/useShortcuts.js";var G,q,Y,H,$,Q,W;const X={class:"newprint-button-outer"},Z={key:0,class:"newprint-button-outer__shortcut"},ee=e("span",{class:"label bold"},(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.473"))||"外显设置",-1),te={class:"newprint-button-poperOver"},ne={class:"print-lite"},ie={class:"label bold"},ae={class:"print-li"},re={class:"print-lite"},le={key:0,class:"newprint-button-outer__shortcut"},oe={class:"newprint-button-poperOver"},se=["onMouseenter","onClick"],ue={class:"label bold"},de={class:"newprint-button-poperOver"},ce={class:"print-lite"},pe={class:"label bold"},me={class:"print-li"},ve={class:"print-lite"},ge=["onClick"],ye={key:0,class:"newprint-button-outer__shortcut"},fe={class:"newprint-button-poperOver"},we=["onMouseenter"],he={class:"print-lite"},ke=["onClick"];var be=t({__name:"NewPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.478"))||"打印",type:String},printText:{default:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.479"))||"直接打印",type:String},previewText:{default:(null==(H=window.getLanguageByCode)?void 0:H.call(window,"10010.1.480"))||"打印预览",type:String},pdfLoadText:{default:(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.481"))||"下载pdf",type:String},formatEditText:{default:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.482"))||"格式编辑",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:(null==(W=window.getLanguageByCode)?void 0:W.call(window,"10010.1.483"))||"请选中需要打印的数据",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},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,printAllType:1,isShowOutSetting:!0,customProps:{},outerPrintKeys:[],defaultFormatId:"",shortcut:{},buttonProps:{}})},svrUpdateIp:{type:String}},setup(t,{expose:G}){var q,Y,H;const $=t;String(navigator.platform).toLowerCase().includes("linux");const Q=[{label:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.476"))||"分割线",key:"divider"},{label:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.473"))||"外显设置",key:"outSetting"}],W=I();let be;const Pe=n(R),Ce=i(""),Se=a({spinning:!1,visible:!1,formatList:[],templateParams:[],printParams:[],originParams:{},currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1,curPrintParamList:[],iReportExecuteMode:1}),Le=i({});let Ie=i([]),Oe=i([{label:$.previewText,key:"previewText"},{label:$.pdfLoadText,key:"downloadPdf"},{label:$.formatEditText,key:"formatEditText"},{label:(null==(H=window.getLanguageByCode)?void 0:H.call(window,"10010.1.484"))||"重置打印机",key:"resetPrinter"}]);const Te=a({oneMouseType:"",oneClickType:"",twoMouseType:""}),je=a({oneShow:!1,isOperation:!1,isOutSetting:!1}),Me=i([]),xe=i([]),Ee=r((()=>{if(!Se.currentFormatId)return{};let e=Se.currentFormatId;return Se.formatList.find((t=>t.id===e))}));r((()=>{var e,t;return(null==(e=Ee.value)?void 0:e.name)||(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.485"))||"格式选择"}));const Fe=r((()=>{let e=Se.formatList.find((e=>e.id===Se.currentFormatId));return null==e?void 0:e.templateId})),Be=r((()=>{let e=Se.formatList.find((e=>e.id===Se.currentFormatId));return null==e?void 0:e.number})),Ne=r((()=>{var e;return null==(e=$.newPrintSetting)?void 0:e.isShowPrintAll})),_e=r((()=>{var e;return null==(e=$.newPrintSetting)?void 0:e.isShowOutSetting})),De=r((()=>{var e;return(null==(e=$.newPrintSetting)?void 0:e.customProps)||{}})),Re=r((()=>{var e;return(null==(e=$.newPrintSetting)?void 0:e.defaultFormatId)||""})),Je=r((()=>{var e;return(null==(e=$.newPrintSetting)?void 0:e.printAllType)||1})),Ue=r((()=>{var e;return(null==(e=$.newPrintSetting)?void 0:e.shortcut)||{}})),ze=r((()=>{var e;return(null==(e=$.newPrintSetting)?void 0:e.buttonProps)||{}})),Ae=r((()=>{var e,t;const n=Object.keys(Ue.value);if(n.length>0){if(Re.value&&n.includes(Re.value))return(null==(e=Ue.value[Re.value])?void 0:e.shortcutLabel)||"";if(n.includes("all"))return(null==(t=Ue.value.all)?void 0:t.shortcutLabel)||""}return""})),Ke=r((()=>{const e=Q.map((e=>e.key));return Ie.value.filter((t=>!e.includes(t.key)))})),Ve=r({get:()=>Ke.value.every((e=>e.selected)),set(e){Ke.value.forEach((t=>{t.selected=e}))}}),Ge=async()=>{var e,t;(null==(t=null==(e=$.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)||await ht(),je.oneShow=!0},qe=async e=>{if($.directPrint){if(Se.spinning)return;return"button"===e?void(Ne.value?await Pt():Re.value?async function(e){await ht(!1);const t=Me.value.find((t=>t.key==e));t&<(t.templateCode,t.templateId,t.key,!1)}(Re.value):Ge()):Ge()}return Ge()},Ye=(e,t)=>Se.printParams[t.templateCode]?U(t.key)?e.filter((e=>"formatEditText"!=e.key)):e:[],He=(e,t)=>{Te[e]=t},$e=()=>{Me.value=Ie.value.filter((e=>!e.selected)),xe.value=Ke.value.filter((e=>e.selected)),We("oneShow"),We("isOutSetting"),Pe("saveOuterPrint",xe.value)},Qe=e=>{je[e]=!0},We=e=>{Te.oneClickType="",je[e]=!1,"isOutSetting"==e&&(je.isOutSetting=!1)},Xe=(e,t)=>{at(!1);let n={type:t,formatId:Se.currentFormatId,templateId:(null==e?void 0:e.templateId)||Fe.value,templateCode:(null==e?void 0:e.templateCode)||Be.value};K({type:"进入成功的回调",info:n},"PRINT-SDK"),Pe("success",e,n)},Ze=e=>{at(!1),K({type:"进入失败的回调",res:e},"PRINT-SDK"),Pe("error",e),L(e)&&"notInstalledApp"===e.type&&W.error(e.message)},et=e=>{at(!1),Pe("cancel",e)},tt=e=>{var t;const n={message:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.486"))||"前置条件执行错误",type:e,preExecution:!0};Pe("error",n)},nt=()=>JSON.stringify({...$.token?{token:$.token}:{}}),it=(e=[],t)=>{var n,i;let a={},r={};if((null==(n=Se.templateParams[t].customizeDataset)?void 0:n.length)>0){const t=(null==(i=Object.keys(e[0].datasetData||{}))?void 0:i[0])||"",n=JSON.stringify(e.map((e=>JSON.parse(e.datasetData[t]))));r={datasetData:{}},r.datasetData[t]=n}else Object.keys(e[0]).forEach((t=>{r[t]=[],e.forEach((e=>{r[t].includes(e[t])||r[t].push(e[t])})),r[t]=r[t].join(",")}));return a=Object.assign({},JSON.parse(nt()),De.value,r),JSON.stringify(a)},at=(e,t)=>{if(Se.isClickOuterPrint){if(e&&t){const n=xe.value.find((e=>e.key==t));return void(n&&(n.isLoading=e))}xe.value.forEach((e=>{e.isLoading=!1}))}else Se.spinning=e},rt=()=>Se.isClickOuterPrint?xe.value.some((e=>e.isLoading)):Se.spinning,lt=(e,t,n,i)=>{const a=Se.printParams[e];if(!a)return;Se.isClickOuterPrint=i,Se.currentFormatId=n;const r=Se.originParams[e]||[];ot(a,e,t,n,r)},ot=async(e=[],t,n,i,a=[],r)=>{let l=e.length;const o=async e=>{try{--l<=0&&Xe(e,"print")}catch(e){console.log("error",e)}};$.showLoading&&rt()&&!r||(at(!0,i),$.prevFn("print",{formatId:i,templateId:n}).then((()=>{Se.curPrintParamList=e;const r={formatId:i,iReportExecuteMode:Se.iReportExecuteMode,templateId:n,authorizationKey:Ce.value,printdlgshow:$.printdlgshow,signature:$.signature,copies:$.printCopies,svrUpdateIp:$.svrUpdateIp};if("MULTI"===$.strategy)for(let t=0;t<e.length;t++){t>0&&(r.printdlgshow="0");const n=JSON.stringify(Object.assign({},JSON.parse(nt()),De.value,e[t]));be.printDirect({...r,params:n},o,Ze,et)}else be.printDirect({...r,params:it(e,t)},(e=>{e.params=a,e.templateCode=t,e.templateId=n,Xe(e,"print")}),Ze,et)})).catch((()=>{tt("print"),at(!1)})).finally((()=>{Se.visible=!1})))},st=async(e,{templateCode:t,templateId:n,key:i},a)=>{const r=Se.printParams[t];if(r)switch(Se.isClickOuterPrint=a,Se.currentFormatId=i,e){case"previewText":(async(e=[],t,n,i)=>{$.showLoading&&rt()||(at(!0,i),$.prevFn("preview",{formatId:i,templateId:n}).then((()=>{Se.curPrintParamList=e;const a=JSON.stringify(Object.assign({},JSON.parse(nt()),De.value,e[0])),r="MULTI"===$.strategy?a:it(e,t),l={formatId:i,templateId:n,iReportExecuteMode:Se.iReportExecuteMode,authorizationKey:Ce.value,params:r,btnprint:$.btnprint,signature:$.signature};be.preview(l,(e=>{Xe(e,"preview")}),Ze)})).catch((()=>{tt("preview"),at(!1)})).finally((()=>{Se.visible=!1})))})(r,t,n,i);break;case"formatEditText":((e=[],t,n,i)=>{$.showLoading&&rt()||(at(!0,i),$.prevFn("edit",{formatId:i,templateId:n}).then((()=>{Se.curPrintParamList=e,Se.currentFormatId=i,Se.identityVerification.visible=!0})).catch((()=>{tt("edit")})).finally((()=>{at(!1)})))})(r,0,n,i);break;case"downloadPdf":(async(e=[],t,n,i)=>{$.showLoading&&rt()||(at(!0,i),$.prevFn("download",{formatId:i,templateId:n}).then((()=>{Se.curPrintParamList=e;const a=JSON.stringify(Object.assign({},JSON.parse(nt()),De.value,e[0])),r="MULTI"===$.strategy?a:it(e,t),l={formatId:i,templateId:n,iReportExecuteMode:Se.iReportExecuteMode,authorizationKey:Ce.value,print:{print:"1",type:"1",resolution:null==$?void 0:$.resolution},params:r,signature:$.signature};be.downloadPDF(l,(e=>Xe(e,"preview")),Ze)})).catch((()=>{tt("download"),at(!1)})).finally((()=>{Se.visible=!1})))})(r,t,n,i);break;case"resetPrinter":(async(e=[],t,n,i)=>{var a,r,l;if(!$.showLoading||!rt()){at(!0,i);try{const e=await be.resetPrinter(i,Se.iReportExecuteMode);if(at(!1),"success"==(null==e?void 0:e.result))return void W.success((null==e?void 0:e.message)||(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.487"))||"重置打印机成功");W.warning((null==e?void 0:e.message)||(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.488"))||"重置打印机失败")}catch(e){at(!1),W.warning((null==e?void 0:e.message)||(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.488"))||"重置打印机失败")}}})(r,0,0,i)}},ut=()=>{},dt=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},vt(n,t,e))})),n},ct=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},gt(n,t,e))})),n},pt=(e,t,n)=>{const i={};return t.forEach((t=>{let a=((e,t)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let i=t;return Object.keys(n).includes(e.type)&&t&&t instanceof Date&&(i=A(t,n[e.type])),(null==e?void 0:e.defaultValue)||i})(t,e[t[n]]);e[t[n]]&&a&&(i[t[n]]=a)})),i},mt=({customizeDataset:e=[],param:t=[]},n={})=>{let i={};return e.forEach((e=>{const t=e.dataSetting[0].selectFieldList;i.datasetData||(i.datasetData={}),i.datasetData[e.name]=JSON.stringify(pt(n,t,"fieldName"))})),i=Object.assign({},i,pt(n,t,"key")),i},vt=(e,t,n)=>{if(t.templateNumbers){for(let i=0;i<t.templateNumbers.length;i++){const a=t.templateNumbers[i],r=n[a];if(!r)return e;e[a]||(e[a]=[]),e[a].push(mt(r,t))}return e}const i=Object.keys(n);for(let a=0;a<i.length;a++){const r=i[a],l=n[r];if(!l)return e;e[r]||(e[r]=[]),e[r].push(mt(l,t))}return e},gt=(e,t,n)=>{if(t.templateNumbers){for(let i=0;i<t.templateNumbers.length;i++){const a=t.templateNumbers[i];if(!n[a])return e;e[a]||(e[a]=[]),e[a].push(t)}return e}const i=Object.keys(n);for(let a=0;a<i.length;a++){const r=i[a];if(!n[r])return e;e[r]||(e[r]=[]),e[r].push(t)}return e},yt=async e=>{var t;Se.formatList=e?(e=>{let t=[];return e&&e.forEach((e=>{if(!e.format)return!1;t.push(...e.format.map((t=>Object.assign({},t,{templateName:e.name}))))})),t})(e.obj):[],Se.iReportExecuteMode=(null==(t=null==e?void 0:e.obj)?void 0:t.length)>0&&e.obj[0].iReportExecuteMode||1,(()=>{var e,t,n;const i=Object.keys(Ue.value),a=Se.formatList.map((e=>{const t={templateCode:e.number,templateId:e.templateId,label:e.name,key:e.id,selected:!1,isLoading:!1};if(i.includes(e.id)){const n=Ue.value[e.id];n&&(t.shortcutLabel=n.shortcutLabel)}return t}));Ie.value.unshift(...a),_e.value&&Ie.value.push(...Q),(null==(t=null==(e=$.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)>0&&(Ie.value.forEach((e=>{var t;(null==(t=$.newPrintSetting)?void 0:t.outerPrintKeys.includes(e.key))&&(e.selected=!0)})),xe.value=Ie.value.filter((e=>e.selected))),Me.value=Ie.value.filter((e=>!e.selected)),$.hideButtons.length>0&&(Oe.value=Oe.value.filter((e=>!$.hideButtons.includes(e.key))));const r=sessionStorage.getItem("portal");if(r){const e=JSON.parse(r),t=(null==(n=null==e?void 0:e.user)?void 0:n.currentRoleResourceObj)||{},i=Object.keys(t);i.includes("RY7.2.21.1.M2.G94181E")||(Oe.value=Oe.value.filter((e=>"downloadPdf"!=e.key))),i.includes("RY7.2.21.1.M2.G33633A")||(Oe.value=Oe.value.filter((e=>"formatEditText"!=e.key))),i.includes("RY7.2.21.1.M2.G99314S")||(Oe.value=Oe.value.filter((e=>"resetPrinter"!=e.key)))}})(),Se.templateParams=(e=>{let t={};return e&&e.forEach((e=>{if(!e.templateConfig)return!1;t[e.number]=e.templateConfig})),t})(e.obj),Se.printParams=dt(Se.templateParams,$.params),Se.originParams=ct(Se.templateParams,$.params),wt()},ft=async()=>{var e;if(Se.isInited)return!0;Se.isInited=!0,Se.spinning=!0,(()=>{if(be)return!1;be=new J})();const t=await $.queryPrintFormatByNumber();return await yt(t),(null==(e=t.obj)?void 0:e.length)>0&&(Ce.value=t.obj[0].authorizationKey||""),Se.spinning=!1,!0},wt=async()=>{const e=Object.keys(Ue.value);if(e.length>0)for(let t=0;t<e.length;t++){const n=e[t],i=Ue.value[n],{stop:a,signature:r}=V().register({label:i.code,shortcutSignature:i.shortcutKey,operation:["state","reset"],callback(){"all"==n&&qe("button");const e=Ke.value.map((e=>e.key)),t=Se.originParams;if(e.includes(n)){const e=Ke.value.find((e=>e.key==n));if(e){const n=Se.printParams[null==e?void 0:e.templateCode],i=t[null==e?void 0:e.templateCode]||[];ot(n,e.templateCode,e.templateId,e.key,i)}}}});Le.value[n]=a}},ht=async(e=!0)=>{if(await $.clickPrevFn()){if(!Se.visible){if(!await ft())return!1}e&&(Se.visible=!Se.visible)}},kt=e=>{if(Se.identityVerification.visible=!1,U(Se.currentFormatId))return Xe({result:"success",message:""},"edit");const t=JSON.stringify(Object.assign({},JSON.parse(nt()),De.value,Se.curPrintParamList[0])),n="MULTI"===$.strategy?t:it(Se.curPrintParamList,Be.value),i={formatId:Se.currentFormatId,templateId:Fe.value,params:n,token:e};be.editPrintFormat(i,(e=>{Xe(e,"edit")}),Ze)},bt=(e,t)=>{const n=xe.value[t+1];return t<xe.value.length-1&&!Se.printParams[e.templateCode]&&Se.printParams[n.templateCode]};async function Pt(){await ht(!1),(()=>{const e=Object.keys(Se.printParams);Se.isClickOuterPrint=!1;const t=Se.originParams;if(1==Je.value)for(let n=0;n<e.length;n++){const i=e[n],a=Se.printParams[i],r=t[i]||[],l=Se.formatList.filter((e=>e.number==i));l&&l.length>0&&l.forEach((e=>{Se.currentFormatId=e.id,ot(a,e.number,e.templateId,e.id,r,!0)}))}2==Je.value&&xe.value.forEach((e=>{const n=Se.printParams[e.templateCode],i=t[e.templateCode]||[];Se.currentFormatId=e.key,ot(n,e.templateCode,e.templateId,e.key,i,!0)}))})()}return l((()=>{Se.isInited=!1})),o((()=>{const e=Object.keys(Le.value);e.length>0&&e.forEach((e=>{Le.value[e]&&Le.value[e]()}))})),s((()=>$.params),(e=>{Object.keys(Se.templateParams).length>0&&(Se.printParams=dt(Se.templateParams,$.params),Se.originParams=ct(Se.templateParams,$.params))}),{deep:!0}),s((()=>{var e;return null==(e=$.newPrintSetting)?void 0:e.outerPrintKeys}),(async e=>{(null==e?void 0:e.length)>0&&await ht(!1)}),{deep:!0,immediate:!0}),G({directPrint:Pt}),(n,i)=>(u(),d(c,null,[e("div",X,[p(" 外显按钮集合 "),m(v(O),{class:"outButtonGroup"},{default:g((()=>[(u(!0),d(c,null,y(xe.value,((e,n)=>(u(),f(v(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:ut,options:Ye(v(Oe),e),onSelect:t=>st(t,e,!0)},{default:g((()=>[m(v(j),w(v(ze),{disabled:!Se.printParams[e.templateCode],loading:t.showLoading&&e.isLoading,onClick:t=>lt(e.templateCode,e.templateId,e.key,!0),class:n==xe.value.length-1?"outerLastButton":bt(e,n)?"isPrintDisabled":""}),{icon:g((()=>[m(v(M),{component:v(B),size:"18"},null,8,["component"])])),default:g((()=>[h(" "+k(e.label)+" ",1),e.shortcutLabel?(u(),d("span",Z,k(e.shortcutLabel),1)):p("v-if",!0)])),_:2},1040,["disabled","loading","onClick","class"])])),_:2},1032,["options","onSelect"])))),128))])),_:1}),p(" 外显设置按钮 "),xe.value.length>0&&xe.value.length==v(Ke).length&&v(_e)&&2!=v(Je)?(u(),f(v(x),{key:0,trigger:"click","show-arrow":!1,show:je.isOutSetting,onClickoutside:i[2]||(i[2]=e=>We("isOutSetting"))},{trigger:g((()=>[m(v(j),w(v(ze),{class:xe.value.length>0?"printAllLeftCls":"",onClick:i[0]||(i[0]=e=>Qe("isOutSetting"))}),{default:g((()=>[ee,m(v(M),{style:{"margin-left":"8px"},component:v(N),size:"18"},null,8,["component"])])),_:1},16,["class"])])),default:g((()=>[e("div",te,[(u(!0),d(c,null,y(v(Ke),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ne,[e("span",ie,k(t.label),1),m(v(E),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",ae,[m(v(F)),e("div",re,[m(v(j),{type:"primary",size:"small",onClick:$e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ke)&&v(Ke).length>1?(u(),f(v(E),{key:0,checked:v(Ve),"onUpdate:checked":i[1]||(i[1]=e=>b(Ve)?Ve.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])])])),_:1},8,["show"])):(u(),d(c,{key:1},[p(" 打印全部按钮 "),m(v(x),{trigger:"click","show-arrow":!1,show:je.oneShow,onClickoutside:i[10]||(i[10]=e=>We("oneShow"))},{trigger:g((()=>[P(n.$slots,"button",{handleClickPrintBtn:Ge,handlePrintBySetting:()=>qe("button"),printSpinning:Se.spinning,printbtnText:t.btnText,printVisible:Se.visible},(()=>[m(v(O),{class:"newprint-button-component",onClick:i[4]||(i[4]=C((()=>qe("icon")),["stop"]))},{default:g((()=>[m(v(j),w({loading:t.showLoading&&Se.spinning},v(ze),{onClick:i[3]||(i[3]=C((()=>qe("button")),["stop"])),class:xe.value.length>0?"printAllLeftCls":""}),{icon:g((()=>[m(v(M),{component:v(B),size:"18"},null,8,["component"])])),default:g((()=>{var e;return[h(" "+k(v(Ne)?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.475"))||"打印全部":t.btnText)+" ",1),v(Ae)?(u(),d("span",le,k(v(Ae)),1)):p("v-if",!0)]})),_:1},16,["loading","class"]),m(v(j),w({class:"icon-select"},v(ze)),{icon:g((()=>[m(v(M),{component:v(_),size:"18"},null,8,["component"])])),_:1},16)])),_:1})]))])),default:g((()=>[e("div",oe,[(u(!0),d(c,null,y(Me.value,(t=>(u(),d("div",{class:S(["print-li",Te.oneMouseType==t.key||Te.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>He("oneMouseType",t.key),onMouseleave:i[9]||(i[9]=e=>He("oneMouseType","")),onClick:e=>((e,t,n)=>{if(!Se.printParams[n.templateCode])return[];He(e,t)})("oneClickType",t.key,t)},["divider"==t.key?(u(),f(v(F),{key:0})):"outSetting"==t.key?(u(),d(c,{key:1},[p(" 第二层外显设置 "),m(v(x),{trigger:"click","show-arrow":!1,placement:"right-start",show:je.isOutSetting,onClickoutside:i[7]||(i[7]=e=>We("isOutSetting"))},{trigger:g((()=>[e("div",{class:"print-lite",onClick:i[5]||(i[5]=e=>Qe("isOutSetting"))},[e("span",ue,k(t.label),1),m(v(M),{color:xe.value.length>0?"#2563F4":"",component:v(N),size:"18"},null,8,["color","component"])])])),default:g((()=>[e("div",de,[(u(!0),d(c,null,y(v(Ke),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ce,[e("span",pe,k(t.label),1),m(v(E),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",me,[m(v(F)),e("div",ve,[m(v(j),{type:"primary",size:"small",onClick:$e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ke)&&v(Ke).length>1?(u(),f(v(E),{key:0,checked:v(Ve),"onUpdate:checked":i[6]||(i[6]=e=>b(Ve)?Ve.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])])])),_:2},1032,["show"])],2112)):(u(),d(c,{key:2},[p(" 第二层功能操作 "),e("div",{class:S(["print-lite",Se.printParams[t.templateCode]?"":"isDisabled"])},[e("span",{class:"label bold",onClick:e=>lt(t.templateCode,t.templateId,t.key,!1)},[h(k(t.label)+" ",1),t.shortcutLabel?(u(),d("span",ye,k(t.shortcutLabel),1)):p("v-if",!0)],8,ge),Se.printParams[t.templateCode]?(u(),f(v(x),{key:0,trigger:"click","show-arrow":!1,placement:"right-start",show:je[t.key],onClickoutside:e=>We(t.key)},{trigger:g((()=>[m(v(M),{component:v(D),size:"18",onClick:e=>Qe(t.key)},null,8,["component","onClick"])])),default:g((()=>[e("div",fe,[(u(!0),d(c,null,y(Ye(v(Oe),t),(n=>(u(),d("div",{class:S(["print-li",Te.twoMouseType==n.key?"active":""]),key:n.key,onMouseenter:e=>He("twoMouseType",n.key),onMouseleave:i[8]||(i[8]=e=>He("twoMouseType",""))},[e("div",he,[e("span",{class:"label",onClick:e=>st(n.key,t,!1)},k(n.label),9,ke)])],42,we)))),128))])])),_:2},1032,["show","onClickoutside"])):p("v-if",!0)],2)],2112))],42,se)))),128))])])),_:3},8,["show"])],2112))]),m(z,w(n.$attrs,{modelValue:Se.identityVerification.visible,"onUpdate:modelValue":i[11]||(i[11]=e=>Se.identityVerification.visible=e),formatId:Se.currentFormatId,templateId:v(Fe),onSuccess:kt}),null,16,["modelValue","formatId","templateId"])],64))}});export{be as default};
|
1
|
+
import{createElementVNode as e,defineComponent as t,inject as n,ref as i,reactive as a,computed as r,onMounted as l,onBeforeUnmount as o,watch as s,openBlock as u,createElementBlock as d,Fragment as c,createCommentVNode as p,createVNode as m,unref as v,withCtx as g,renderList as y,createBlock as f,mergeProps as w,createTextVNode as h,toDisplayString as k,normalizeStyle as b,isRef as P,renderSlot as C,withModifiers as S,normalizeClass as I}from"vue";import{isObject as L}from"@vue/shared";import{useMessage as O,NButtonGroup as x,NDropdown as T,NButton as j,NIcon as M,NPopover as E,NCheckbox as F,NDivider as B}from"naive-ui";import{PrintOutline as N,SettingsOutline as _,ChevronDownSharp as D,ArrowForwardOutline as R}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as J}from"../constants/index.js";import{Print as U}from"../utils/print.js";import{isIReport as z}from"../utils/browserPrint.js";import A from"./IdentityVerification.vue.js";import{format as K}from"date-fns";import"../api.js";import"../../../shortcut-provider/index.js";import{encapBrowserLog as V}from"../../../../shared/utils/index.js";import{useShortcuts as H}from"../../../shortcut-provider/src/hooks/useShortcuts.js";var $,G,Y,q,Q,W,X;const Z={class:"newprint-button-outer"},ee={key:0,class:"newprint-button-outer__shortcut"},te=e("span",{class:"label bold"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.473"))||"外显设置",-1),ne={class:"print-lite"},ie={class:"label bold"},ae={class:"print-li"},re={class:"print-lite"},le={key:0,class:"newprint-button-outer__shortcut"},oe=["onMouseenter","onClick"],se={class:"label bold"},ue={class:"print-lite"},de={class:"label bold"},ce={class:"print-li"},pe={class:"print-lite"},me=["onClick"],ve={key:0,class:"newprint-button-outer__shortcut"},ge={class:"newprint-button-poperOver"},ye=["onMouseenter"],fe={class:"print-lite"},we=["onClick"];var he=t({__name:"NewPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.478"))||"打印",type:String},printText:{default:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.479"))||"直接打印",type:String},previewText:{default:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.480"))||"打印预览",type:String},pdfLoadText:{default:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.481"))||"下载pdf",type:String},formatEditText:{default:(null==(W=window.getLanguageByCode)?void 0:W.call(window,"10010.1.482"))||"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:(null==(X=window.getLanguageByCode)?void 0:X.call(window,"10010.1.483"))||"请选中需要打印的数据",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},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,printAllType:1,isShowOutSetting:!0,customProps:{},outerPrintKeys:[],defaultFormatId:"",shortcut:{},buttonProps:{},showMaxHeight:null})},svrUpdateIp:{type:String}},setup(t,{expose:$}){var G,Y,q;const Q=t;String(navigator.platform).toLowerCase().includes("linux");const W=[{label:(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.476"))||"分割线",key:"divider"},{label:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.473"))||"外显设置",key:"outSetting"}],X=O();let he;const ke=n(J),be=i(""),Pe=a({spinning:!1,visible:!1,formatList:[],templateParams:[],printParams:[],originParams:{},currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1,curPrintParamList:[],iReportExecuteMode:1}),Ce=i({});let Se=i([]),Ie=i([{label:Q.previewText,key:"previewText"},{label:Q.pdfLoadText,key:"downloadPdf"},{label:Q.formatEditText,key:"formatEditText"},{label:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.484"))||"重置打印机",key:"resetPrinter"}]);const Le=a({oneMouseType:"",oneClickType:"",twoMouseType:""}),Oe=a({oneShow:!1,isOperation:!1,isOutSetting:!1}),xe=i([]),Te=i([]),je=r((()=>{if(!Pe.currentFormatId)return{};let e=Pe.currentFormatId;return Pe.formatList.find((t=>t.id===e))}));r((()=>{var e,t;return(null==(e=je.value)?void 0:e.name)||(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.485"))||"格式选择"}));const Me=r((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.templateId})),Ee=r((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.number})),Fe=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.isShowPrintAll})),Be=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.isShowOutSetting})),Ne=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.customProps)||{}})),_e=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.defaultFormatId)||""})),De=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.printAllType)||1})),Re=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.shortcut)||{}})),Je=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.buttonProps)||{}})),Ue=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.showMaxHeight)||{}})),ze=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.printAllFormatIds)||[]})),Ae=r((()=>{var e,t;return void 0===(null==(e=Q.newPrintSetting)?void 0:e.positionElement)?"body":null==(t=Q.newPrintSetting)?void 0:t.positionElement})),Ke=r((()=>{var e,t;const n=Object.keys(Re.value);if(n.length>0){if(_e.value&&n.includes(_e.value))return(null==(e=Re.value[_e.value])?void 0:e.shortcutLabel)||"";if(n.includes("all"))return(null==(t=Re.value.all)?void 0:t.shortcutLabel)||""}return""})),Ve=r((()=>{const e=W.map((e=>e.key));return Se.value.filter((t=>!e.includes(t.key)))})),He=r({get:()=>Ve.value.every((e=>e.selected)),set(e){Ve.value.forEach((t=>{t.selected=e}))}}),$e=async()=>{var e,t;(null==(t=null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)||await kt(),Oe.oneShow=!0},Ge=async e=>{if(Q.directPrint){if(Pe.spinning)return;return"button"===e?void(Fe.value?await Ct():_e.value?async function(e){await kt(!1);const t=xe.value.find((t=>t.key==e));t&&ot(t.templateCode,t.templateId,t.key,!1)}(_e.value):$e()):$e()}return $e()},Ye=(e,t)=>Pe.printParams[t.templateCode]?z(t.key)?e.filter((e=>"formatEditText"!=e.key)):e:[],qe=(e,t)=>{Le[e]=t},Qe=()=>{xe.value=Se.value.filter((e=>!e.selected)),Te.value=Ve.value.filter((e=>e.selected)),Xe("oneShow"),Xe("isOutSetting"),ke("saveOuterPrint",Te.value)},We=e=>{Oe[e]=!0},Xe=e=>{Le.oneClickType="",Oe[e]=!1,"isOutSetting"==e&&(Oe.isOutSetting=!1)},Ze=(e,t)=>{rt(!1);let n={type:t,formatId:Pe.currentFormatId,templateId:(null==e?void 0:e.templateId)||Me.value,templateCode:(null==e?void 0:e.templateCode)||Ee.value};V({type:"进入成功的回调",info:n},"PRINT-SDK"),ke("success",e,n)},et=e=>{rt(!1),V({type:"进入失败的回调",res:e},"PRINT-SDK"),ke("error",e),L(e)&&"notInstalledApp"===e.type&&X.error(e.message)},tt=e=>{rt(!1),ke("cancel",e)},nt=e=>{var t;const n={message:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.486"))||"前置条件执行错误",type:e,preExecution:!0};ke("error",n)},it=()=>JSON.stringify({...Q.token?{token:Q.token}:{}}),at=(e=[],t)=>{var n,i;let a={},r={};if((null==(n=Pe.templateParams[t].customizeDataset)?void 0:n.length)>0){const t=(null==(i=Object.keys(e[0].datasetData||{}))?void 0:i[0])||"",n=JSON.stringify(e.map((e=>JSON.parse(e.datasetData[t]))));r={datasetData:{}},r.datasetData[t]=n}else Object.keys(e[0]).forEach((t=>{r[t]=[],e.forEach((e=>{r[t].includes(e[t])||r[t].push(e[t])})),r[t]=r[t].join(",")}));return a=Object.assign({},JSON.parse(it()),r,Ne.value),JSON.stringify(a)},rt=(e,t)=>{if(Pe.isClickOuterPrint){if(e&&t){const n=Te.value.find((e=>e.key==t));return void(n&&(n.isLoading=e))}Te.value.forEach((e=>{e.isLoading=!1}))}else Pe.spinning=e},lt=()=>Pe.isClickOuterPrint?Te.value.some((e=>e.isLoading)):Pe.spinning,ot=(e,t,n,i)=>{const a=Pe.printParams[e];if(!a)return;Pe.isClickOuterPrint=i,Pe.currentFormatId=n;const r=Pe.originParams[e]||[];st(a,e,t,n,r)},st=async(e=[],t,n,i,a=[],r)=>{let l=e.length;const o=async e=>{try{--l<=0&&Ze(e,"print")}catch(e){console.log("error",e)}};Q.showLoading&<()&&!r||(rt(!0,i),Q.prevFn("print",{formatId:i,templateId:n,params:e}).then((()=>{var r;Pe.curPrintParamList=e;const l=(null==(r=Ne.value)?void 0:r.printdlgshow)||Q.printdlgshow,s={formatId:i,iReportExecuteMode:Pe.iReportExecuteMode,templateId:n,authorizationKey:be.value,printdlgshow:l,signature:Q.signature,copies:Q.printCopies,svrUpdateIp:Q.svrUpdateIp};if("MULTI"===Q.strategy)for(let t=0;t<e.length;t++){t>0&&(s.printdlgshow="0");const n=JSON.stringify(Object.assign({},JSON.parse(it()),e[t],Ne.value));he.printDirect({...s,params:n},o,et,tt)}else he.printDirect({...s,params:at(e,t)},(e=>{e.params=a,e.templateCode=t,e.templateId=n,Ze(e,"print")}),et,tt)})).catch((()=>{nt("print"),rt(!1)})).finally((()=>{Pe.visible=!1})))},ut=async(e,{templateCode:t,templateId:n,key:i},a)=>{const r=Pe.printParams[t];if(r)switch(Pe.isClickOuterPrint=a,Pe.currentFormatId=i,e){case"previewText":(async(e=[],t,n,i)=>{Q.showLoading&<()||(rt(!0,i),Q.prevFn("preview",{formatId:i,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e;const a=JSON.stringify(Object.assign({},JSON.parse(it()),e[0],Ne.value)),r="MULTI"===Q.strategy?a:at(e,t),l={formatId:i,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,params:r,btnprint:Q.btnprint,signature:Q.signature};he.preview(l,(e=>{Ze(e,"preview")}),et)})).catch((()=>{nt("preview"),rt(!1)})).finally((()=>{Pe.visible=!1})))})(r,t,n,i);break;case"formatEditText":((e=[],t,n,i)=>{Q.showLoading&<()||(rt(!0,i),Q.prevFn("edit",{formatId:i,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e,Pe.currentFormatId=i,Pe.identityVerification.visible=!0})).catch((()=>{nt("edit")})).finally((()=>{rt(!1)})))})(r,0,n,i);break;case"downloadPdf":(async(e=[],t,n,i)=>{Q.showLoading&<()||(rt(!0,i),Q.prevFn("download",{formatId:i,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e;const a=JSON.stringify(Object.assign({},JSON.parse(it()),e[0],Ne.value)),r="MULTI"===Q.strategy?a:at(e,t),l={formatId:i,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,print:{print:"1",type:"1",resolution:null==Q?void 0:Q.resolution},params:r,signature:Q.signature};he.downloadPDF(l,(e=>Ze(e,"preview")),et)})).catch((()=>{nt("download"),rt(!1)})).finally((()=>{Pe.visible=!1})))})(r,t,n,i);break;case"resetPrinter":(async(e=[],t,n,i)=>{var a,r,l;if(!Q.showLoading||!lt()){rt(!0,i);try{const e=await he.resetPrinter(i,Pe.iReportExecuteMode);if(rt(!1),"success"==(null==e?void 0:e.result))return void X.success((null==e?void 0:e.message)||(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.487"))||"重置打印机成功");X.warning((null==e?void 0:e.message)||(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.488"))||"重置打印机失败")}catch(e){rt(!1),X.warning((null==e?void 0:e.message)||(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.488"))||"重置打印机失败")}}})(r,0,0,i)}},dt=()=>{},ct=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},gt(n,t,e))})),n},pt=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},yt(n,t,e))})),n},mt=(e,t,n)=>{const i={};return t.forEach((t=>{let a=((e,t)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let i=t;return Object.keys(n).includes(e.type)&&t&&t instanceof Date&&(i=K(t,n[e.type])),(null==e?void 0:e.defaultValue)||i})(t,e[t[n]]);e[t[n]]&&a&&(i[t[n]]=a)})),i},vt=({customizeDataset:e=[],param:t=[]},n={})=>{let i={};return e.forEach((e=>{const t=e.dataSetting[0].selectFieldList;i.datasetData||(i.datasetData={}),i.datasetData[e.name]=JSON.stringify(mt(n,t,"fieldName"))})),i=Object.assign({},i,mt(n,t,"key")),i},gt=(e,t,n)=>{if(t.templateNumbers){for(let i=0;i<t.templateNumbers.length;i++){const a=t.templateNumbers[i],r=n[a];if(!r)return e;e[a]||(e[a]=[]),e[a].push(vt(r,t))}return e}const i=Object.keys(n);for(let a=0;a<i.length;a++){const r=i[a],l=n[r];if(!l)return e;e[r]||(e[r]=[]),e[r].push(vt(l,t))}return e},yt=(e,t,n)=>{if(t.templateNumbers){for(let i=0;i<t.templateNumbers.length;i++){const a=t.templateNumbers[i];if(!n[a])return e;e[a]||(e[a]=[]),e[a].push(t)}return e}const i=Object.keys(n);for(let a=0;a<i.length;a++){const r=i[a];if(!n[r])return e;e[r]||(e[r]=[]),e[r].push(t)}return e},ft=async e=>{var t;Pe.formatList=e?(e=>{let t=[];return e&&e.forEach((e=>{if(!e.format)return!1;t.push(...e.format.map((t=>Object.assign({},t,{templateName:e.name}))))})),t})(e.obj):[],Pe.iReportExecuteMode=(null==(t=null==e?void 0:e.obj)?void 0:t.length)>0&&e.obj[0].iReportExecuteMode||1,(()=>{var e,t,n;const i=Object.keys(Re.value),a=Pe.formatList.map((e=>{const t={templateCode:e.number,templateId:e.templateId,label:e.name,key:e.id,selected:!1,isLoading:!1};if(i.includes(e.id)){const n=Re.value[e.id];n&&(t.shortcutLabel=n.shortcutLabel)}return t}));Se.value.unshift(...a),Be.value&&Se.value.push(...W),(null==(t=null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)>0&&(Se.value.forEach((e=>{var t;(null==(t=Q.newPrintSetting)?void 0:t.outerPrintKeys.includes(e.key))&&(e.selected=!0)})),Te.value=Se.value.filter((e=>e.selected))),xe.value=Se.value.filter((e=>!e.selected)),Q.hideButtons.length>0&&(Ie.value=Ie.value.filter((e=>!Q.hideButtons.includes(e.key))));const r=sessionStorage.getItem("portal");if(r){const e=JSON.parse(r),t=(null==(n=null==e?void 0:e.user)?void 0:n.currentRoleResourceObj)||{},i=Object.keys(t);i.includes("RY7.2.21.1.M2.G94181E")||(Ie.value=Ie.value.filter((e=>"downloadPdf"!=e.key))),i.includes("RY7.2.21.1.M2.G33633A")||(Ie.value=Ie.value.filter((e=>"formatEditText"!=e.key))),i.includes("RY7.2.21.1.M2.G99314S")||(Ie.value=Ie.value.filter((e=>"resetPrinter"!=e.key)))}})(),Pe.templateParams=(e=>{let t={};return e&&e.forEach((e=>{if(!e.templateConfig)return!1;t[e.number]=e.templateConfig})),t})(e.obj),Pe.printParams=ct(Pe.templateParams,Q.params),Pe.originParams=pt(Pe.templateParams,Q.params),ht()},wt=async()=>{var e;if(Pe.isInited)return!0;Pe.isInited=!0,Pe.spinning=!0,(()=>{if(he)return!1;he=new U})();const t=await Q.queryPrintFormatByNumber();return await ft(t),(null==(e=t.obj)?void 0:e.length)>0&&(be.value=t.obj[0].authorizationKey||""),Pe.spinning=!1,!0},ht=async()=>{const e=Object.keys(Re.value);if(e.length>0)for(let t=0;t<e.length;t++){const n=e[t],i=Re.value[n],{stop:a,signature:r}=H().register({label:i.code,shortcutSignature:i.shortcutKey,operation:["state","reset"],callback(){"all"==n&&Ge("button");const e=Ve.value.map((e=>e.key)),t=Pe.originParams;if(e.includes(n)){const e=Ve.value.find((e=>e.key==n));if(e){const n=Pe.printParams[null==e?void 0:e.templateCode],i=t[null==e?void 0:e.templateCode]||[];st(n,e.templateCode,e.templateId,e.key,i)}}}});Ce.value[n]=a}},kt=async(e=!0)=>{if(await Q.clickPrevFn()){if(!Pe.visible){if(!await wt())return!1}e&&(Pe.visible=!Pe.visible)}},bt=e=>{if(Pe.identityVerification.visible=!1,z(Pe.currentFormatId))return Ze({result:"success",message:""},"edit");const t=JSON.stringify(Object.assign({},JSON.parse(it()),Pe.curPrintParamList[0],Ne.value)),n="MULTI"===Q.strategy?t:at(Pe.curPrintParamList,Ee.value),i={formatId:Pe.currentFormatId,templateId:Me.value,params:n,token:e};he.editPrintFormat(i,(e=>{Ze(e,"edit")}),et)},Pt=(e,t)=>{const n=Te.value[t+1];return t<Te.value.length-1&&!Pe.printParams[e.templateCode]&&Pe.printParams[n.templateCode]};async function Ct(){await kt(!1),(()=>{var e;const t=Object.keys(Pe.printParams);Pe.isClickOuterPrint=!1;const n=Pe.originParams;if((null==(e=Object.keys(ze.value))?void 0:e.length)>0)Se.value.forEach((e=>{if(ze.value.includes(e.key)){const t=Pe.printParams[e.templateCode],i=n[e.templateCode]||[];Pe.currentFormatId=e.key,st(t,e.templateCode,e.templateId,e.key,i,!0)}}));else{if(1==De.value)for(let e=0;e<t.length;e++){const i=t[e],a=Pe.printParams[i],r=n[i]||[],l=Pe.formatList.filter((e=>e.number==i));l&&l.length>0&&l.forEach((e=>{Pe.currentFormatId=e.id,st(a,e.number,e.templateId,e.id,r,!0)}))}2==De.value&&Te.value.forEach((e=>{const t=Pe.printParams[e.templateCode],i=n[e.templateCode]||[];Pe.currentFormatId=e.key,st(t,e.templateCode,e.templateId,e.key,i,!0)}))}})()}return l((()=>{Pe.isInited=!1})),o((()=>{const e=Object.keys(Ce.value);e.length>0&&e.forEach((e=>{Ce.value[e]&&Ce.value[e]()}))})),s((()=>Q.params),(e=>{Object.keys(Pe.templateParams).length>0&&(Pe.printParams=ct(Pe.templateParams,Q.params),Pe.originParams=pt(Pe.templateParams,Q.params))}),{deep:!0}),s((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys}),(async e=>{(null==e?void 0:e.length)>0&&await kt(!1)}),{deep:!0,immediate:!0}),$({directPrint:Ct}),(n,i)=>(u(),d(c,null,[e("div",Z,[p(" 外显按钮集合 "),m(v(x),{class:"outButtonGroup"},{default:g((()=>[(u(!0),d(c,null,y(Te.value,((e,n)=>(u(),f(v(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:dt,options:Ye(v(Ie),e),onSelect:t=>ut(t,e,!0)},{default:g((()=>[m(v(j),w(v(Je),{disabled:!Pe.printParams[e.templateCode],loading:t.showLoading&&e.isLoading,onClick:t=>ot(e.templateCode,e.templateId,e.key,!0),class:n==Te.value.length-1?"outerLastButton":Pt(e,n)?"isPrintDisabled":""}),{icon:g((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:g((()=>[h(" "+k(e.label)+" ",1),e.shortcutLabel?(u(),d("span",ee,k(e.shortcutLabel),1)):p("v-if",!0)])),_:2},1040,["disabled","loading","onClick","class"])])),_:2},1032,["options","onSelect"])))),128))])),_:1}),p(" 外显设置按钮 "),Te.value.length>0&&Te.value.length==v(Ve).length&&v(Be)&&2!=v(De)?(u(),f(v(E),{key:0,trigger:"click",to:v(Ae),"show-arrow":!1,show:Oe.isOutSetting,onClickoutside:i[2]||(i[2]=e=>Xe("isOutSetting"))},{trigger:g((()=>[m(v(j),w(v(Je),{class:Te.value.length>0?"printAllLeftCls":"",onClick:i[0]||(i[0]=e=>We("isOutSetting"))}),{default:g((()=>[te,m(v(M),{style:{"margin-left":"8px"},component:v(_),size:"18"},null,8,["component"])])),_:1},16,["class"])])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v(Ve),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ne,[e("span",ie,k(t.label),1),m(v(F),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",ae,[m(v(B)),e("div",re,[m(v(j),{type:"primary",size:"small",onClick:Qe},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ve)&&v(Ve).length>1?(u(),f(v(F),{key:0,checked:v(He),"onUpdate:checked":i[1]||(i[1]=e=>P(He)?He.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])],4)])),_:1},8,["to","show"])):(u(),d(c,{key:1},[p(" 打印全部按钮 "),m(v(E),{trigger:"click","show-arrow":!1,to:v(Ae),show:Oe.oneShow,onClickoutside:i[10]||(i[10]=e=>Xe("oneShow"))},{trigger:g((()=>[C(n.$slots,"button",{handleClickPrintBtn:$e,handlePrintBySetting:()=>Ge("button"),printSpinning:Pe.spinning,printbtnText:t.btnText,printVisible:Pe.visible},(()=>[m(v(x),{class:"newprint-button-component",onClick:i[4]||(i[4]=S((()=>Ge("icon")),["stop"]))},{default:g((()=>[m(v(j),w({loading:t.showLoading&&Pe.spinning},v(Je),{onClick:i[3]||(i[3]=S((()=>Ge("button")),["stop"])),class:Te.value.length>0?"printAllLeftCls":""}),{icon:g((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:g((()=>{var e;return[h(" "+k(v(Fe)?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.475"))||"打印全部":t.btnText)+" ",1),v(Ke)?(u(),d("span",le,k(v(Ke)),1)):p("v-if",!0)]})),_:1},16,["loading","class"]),m(v(j),w({class:"icon-select"},v(Je)),{icon:g((()=>[m(v(M),{component:v(D),size:"18"},null,8,["component"])])),_:1},16)])),_:1})]))])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(xe.value,(t=>(u(),d("div",{class:I(["print-li",Le.oneMouseType==t.key||Le.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>qe("oneMouseType",t.key),onMouseleave:i[9]||(i[9]=e=>qe("oneMouseType","")),onClick:e=>((e,t,n)=>{if(!Pe.printParams[n.templateCode])return[];qe(e,t)})("oneClickType",t.key,t)},["divider"==t.key?(u(),f(v(B),{key:0})):"outSetting"==t.key?(u(),d(c,{key:1},[p(" 第二层外显设置 "),m(v(E),{trigger:"click","show-arrow":!1,to:v(Ae),placement:"right-start",show:Oe.isOutSetting,onClickoutside:i[7]||(i[7]=e=>Xe("isOutSetting"))},{trigger:g((()=>[e("div",{class:"print-lite",onClick:i[5]||(i[5]=e=>We("isOutSetting"))},[e("span",se,k(t.label),1),m(v(M),{color:Te.value.length>0?"#2563F4":"",component:v(_),size:"18"},null,8,["color","component"])])])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v(Ve),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ue,[e("span",de,k(t.label),1),m(v(F),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",ce,[m(v(B)),e("div",pe,[m(v(j),{type:"primary",size:"small",onClick:Qe},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ve)&&v(Ve).length>1?(u(),f(v(F),{key:0,checked:v(He),"onUpdate:checked":i[6]||(i[6]=e=>P(He)?He.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])],4)])),_:2},1032,["to","show"])],2112)):(u(),d(c,{key:2},[p(" 第二层功能操作 "),e("div",{class:I(["print-lite",Pe.printParams[t.templateCode]?"":"isDisabled"])},[e("span",{class:"label bold",onClick:e=>ot(t.templateCode,t.templateId,t.key,!1)},[h(k(t.label)+" ",1),t.shortcutLabel?(u(),d("span",ve,k(t.shortcutLabel),1)):p("v-if",!0)],8,me),Pe.printParams[t.templateCode]?(u(),f(v(E),{key:0,trigger:"click","show-arrow":!1,to:v(Ae),placement:"right-start",show:Oe[t.key],onClickoutside:e=>Xe(t.key)},{trigger:g((()=>[m(v(M),{component:v(R),size:"18",onClick:e=>We(t.key)},null,8,["component","onClick"])])),default:g((()=>[e("div",ge,[(u(!0),d(c,null,y(Ye(v(Ie),t),(n=>(u(),d("div",{class:I(["print-li",Le.twoMouseType==n.key?"active":""]),key:n.key,onMouseenter:e=>qe("twoMouseType",n.key),onMouseleave:i[8]||(i[8]=e=>qe("twoMouseType",""))},[e("div",fe,[e("span",{class:"label",onClick:e=>ut(n.key,t,!1)},k(n.label),9,we)])],42,ye)))),128))])])),_:2},1032,["to","show","onClickoutside"])):p("v-if",!0)],2)],2112))],42,oe)))),128))],4)])),_:3},8,["to","show"])],2112))]),m(A,w(n.$attrs,{modelValue:Pe.identityVerification.visible,"onUpdate:modelValue":i[11]||(i[11]=e=>Pe.identityVerification.visible=e),formatId:Pe.currentFormatId,templateId:v(Me),onSuccess:bt}),null,16,["modelValue","formatId","templateId"])],64))}});export{he as default};
|
@@ -1 +1 @@
|
|
1
|
-
.dropdown-button{border-color:#d5d5d5!important;color:#212121;padding-right:0}.dropdown-button .n-button__content{height:100%}.dropdown-button .n-button__content .n-icon{align-items:center;display:flex;height:100%;justify-content:center;padding-right:10px;width:30px}.c-dropdown .n-dropdown-menu-wrapper span.active{color:#5585f5}.login-form-button{border-radius:24px;color:#fff;font-size:16px;height:50px;width:100%}.login-form-button-print{padding-top:15px}.login-form-button-print .n-input{border-radius:6px;color:#757575;font-size:14px;height:50px;line-height:50px}.c-button-print-modal .n-form-item-feedback-wrapper{display:none}.c-button-preview-modal{max-width:none!important}.c-button-preview-modal .n-dialog__content{height:98%}.newprint-button-component .icon-select{padding:0 8px!important}.newprint-button-poperOver{border-radius:3px}.newprint-button-poperOver .bold{font-weight:700}.newprint-button-poperOver .isDisabled{color:#999;cursor:default}.newprint-button-poperOver .print-li{overflow:hidden}.newprint-button-poperOver .print-li .n-divider{margin-bottom:6px;margin-top:6px}.newprint-button-poperOver .print-li .print-lite{align-items:center;border-radius:3px;cursor:pointer;display:flex;height:32px;justify-content:space-between;margin:3px 0}.newprint-button-poperOver .print-li .print-lite .label{padding:0 8px;white-space:nowrap}.newprint-button-poperOver .print-li .print-lite .n-icon{align-items:center;border-radius:0 3px 3px 0;display:flex;height:100%;justify-content:center;width:30px}.newprint-button-poperOver .print-li .print-lite .n-checkbox{white-space:nowrap}.newprint-button-poperOver .print-li.active{color:#2563f4}.newprint-button-poperOver .print-li.active .print-lite{background:rgba(37,99,244,.1)}.newprint-button-poperOver .print-li.active .n-icon{background:rgba(37,99,244,.15)}.newprint-button-outer{align-items:center;display:flex}.newprint-button-outer .outButtonGroup .isPrintDisabled .n-button__border{border-right-width:0!important}.newprint-button-outer .outButtonGroup .n-button.n-button--disabled+.n-button.n-button--default-type:not(.n-button--disabled) .n-button__border{border-left-width:1px!important}.newprint-button-outer .outerLastButton .n-button__border{border-bottom-right-radius:0;border-right:none;border-top-right-radius:0}.newprint-button-outer .outerLastButton:hover .n-button__state-border{border-bottom-right-radius:0;border-top-right-radius:0}.newprint-button-outer .printAllLeftCls .n-button__border,.newprint-button-outer .printAllLeftCls:hover .n-button__state-border{border-bottom-left-radius:0;border-top-left-radius:0}.newprint-button-outer__shortcut{color:#76797f}
|
1
|
+
.dropdown-button{border-color:#d5d5d5!important;color:#212121;padding-right:0}.dropdown-button .n-button__content{height:100%}.dropdown-button .n-button__content .n-icon{align-items:center;display:flex;height:100%;justify-content:center;padding-right:10px;width:30px}.c-dropdown .n-dropdown-menu-wrapper span.active{color:#5585f5}.login-form-button{border-radius:24px;color:#fff;font-size:16px;height:50px;width:100%}.login-form-button-print{padding-top:15px}.login-form-button-print .n-input{border-radius:6px;color:#757575;font-size:14px;height:50px;line-height:50px}.c-button-print-modal .n-form-item-feedback-wrapper{display:none}.c-button-preview-modal{max-width:none!important}.c-button-preview-modal .n-dialog__content{height:98%}.newprint-button-component .icon-select{padding:0 8px!important}.newprint-button-poperOver{border-radius:3px;overflow-y:auto}.newprint-button-poperOver .bold{font-weight:700}.newprint-button-poperOver .isDisabled{color:#999;cursor:default}.newprint-button-poperOver .print-li{overflow:hidden}.newprint-button-poperOver .print-li .n-divider{margin-bottom:6px;margin-top:6px}.newprint-button-poperOver .print-li .print-lite{align-items:center;border-radius:3px;cursor:pointer;display:flex;height:32px;justify-content:space-between;margin:3px 0}.newprint-button-poperOver .print-li .print-lite .label{padding:0 8px;white-space:nowrap}.newprint-button-poperOver .print-li .print-lite .n-icon{align-items:center;border-radius:0 3px 3px 0;display:flex;height:100%;justify-content:center;width:30px}.newprint-button-poperOver .print-li .print-lite .n-checkbox{white-space:nowrap}.newprint-button-poperOver .print-li.active{color:#2563f4}.newprint-button-poperOver .print-li.active .print-lite{background:rgba(37,99,244,.1)}.newprint-button-poperOver .print-li.active .n-icon{background:rgba(37,99,244,.15)}.newprint-button-outer{align-items:center;display:flex;overflow-x:auto}.newprint-button-outer .outButtonGroup .isPrintDisabled .n-button__border{border-right-width:0!important}.newprint-button-outer .outButtonGroup .n-button.n-button--disabled+.n-button.n-button--default-type:not(.n-button--disabled) .n-button__border{border-left-width:1px!important}.newprint-button-outer .outerLastButton .n-button__border{border-bottom-right-radius:0;border-right:none;border-top-right-radius:0}.newprint-button-outer .outerLastButton:hover .n-button__state-border{border-bottom-right-radius:0;border-top-right-radius:0}.newprint-button-outer .printAllLeftCls .n-button__border,.newprint-button-outer .printAllLeftCls:hover .n-button__state-border{border-bottom-left-radius:0;border-top-left-radius:0}.newprint-button-outer__shortcut{color:#76797f}
|
@@ -203,6 +203,9 @@ export declare const CallbackMaps: Map<string, {
|
|
203
203
|
type: import("vue").PropType<"default" | "tooltip">;
|
204
204
|
default: string;
|
205
205
|
};
|
206
|
+
fixMemoLeak: {
|
207
|
+
type: BooleanConstructor;
|
208
|
+
};
|
206
209
|
}, {
|
207
210
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
208
211
|
fieldList: {
|
@@ -402,6 +405,9 @@ export declare const CallbackMaps: Map<string, {
|
|
402
405
|
type: import("vue").PropType<"default" | "tooltip">;
|
403
406
|
default: string;
|
404
407
|
};
|
408
|
+
fixMemoLeak: {
|
409
|
+
type: BooleanConstructor;
|
410
|
+
};
|
405
411
|
}>> & {
|
406
412
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
407
413
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -959,6 +965,9 @@ export declare const CallbackMaps: Map<string, {
|
|
959
965
|
type: import("vue").PropType<"default" | "tooltip">;
|
960
966
|
default: string;
|
961
967
|
};
|
968
|
+
fixMemoLeak: {
|
969
|
+
type: BooleanConstructor;
|
970
|
+
};
|
962
971
|
}>> & {
|
963
972
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
964
973
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -992,6 +1001,7 @@ export declare const CallbackMaps: Map<string, {
|
|
992
1001
|
feedbackType: "default" | "tooltip";
|
993
1002
|
operationalFormInit: boolean;
|
994
1003
|
incrementalRender: boolean;
|
1004
|
+
fixMemoLeak: boolean;
|
995
1005
|
}>;
|
996
1006
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
997
1007
|
props: {
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as a,computed as l,onBeforeUnmount as n,watch as o,openBlock as r,createBlock as u,unref as s,isRef as d,createSlots as i,renderList as p,withCtx as c,renderSlot as y,nextTick as f}from"vue";import{promiseTimeout as v}from"@vueuse/shared";import{NDatePicker as m}from"naive-ui";import"../../../shared/utils/index.js";import{useDateTime as h,handleInputEvent as
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as a,computed as l,onBeforeUnmount as n,watch as o,openBlock as r,createBlock as u,unref as s,isRef as d,createSlots as i,renderList as p,withCtx as c,renderSlot as y,nextTick as f}from"vue";import{promiseTimeout as v}from"@vueuse/shared";import{NDatePicker as m}from"naive-ui";import"../../../shared/utils/index.js";import{useDateTime as h,handleInputEvent as D}from"../../../shared/hooks/useDateTime.js";import{isArray as g,isEqual as w,isString as b,isFunction as k,isNumber as V}from"lodash-es";import"@vue/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{subYears as S,addYears as _,isWithinInterval as A,format as I,sub as M,startOfDay as R,endOfDay as C}from"date-fns";var $=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:[String,Array]},placeholder:{type:String},allowedInvalidValue:{type:String},to:{type:[Object,String,Boolean],default:"body"},holidays:{type:Array,default:()=>[]},type:{type:String,default:"date"},isDateDisabled:{type:Function}},emits:["update:formatted-value"],setup(e,{expose:$,emit:j}){const F=e,P=t(),U=a(null),q=a(null),x=a();let E="";const H=l({get:()=>W(F.formattedValue)?null:F.formattedValue,set(e){g(e)&&g(E)&&w(E,e)||E===e||(j("update:formatted-value",e,b(e)?Date.parse(e):g(e)?[Date.parse(e[0]),Date.parse(e[1])]:null),E=e)}}),L=l((()=>F.type.includes("datetime"))),B=l((()=>Reflect.get(P,"format")?P.format:L.value?"yyyy-MM-dd HH:mm:ss":"month"===F.type?"yyyy-MM":"year"===F.type?"yyyy":"yyyy-MM-dd")),Y=l((()=>L.value?B.value.split(" "):"")),O=l((()=>{const e=e=>{const t=new Date(e),a=new Date,l=S(a,150),n=_(a,150);return!A(t,{start:l,end:n})};return k(F.isDateDisabled)?(t,...a)=>{var l;return(null==(l=F.isDateDisabled)?void 0:l.call(F,t,...a))||e(t)}:e})),{focus:T,blur:z,handleConfirm:G}=h(U,{formatRef:B,attrs:{...P,type:F.type,isDateDisabled:O.value},emit:j,allowedInvalidValue:F.allowedInvalidValue});async function J(e){!async function(e){var t;if(!e||!F.holidays.length)return;await v(0);const a=null==(t=U.value)?void 0:t.panelInstRef;if(!a)return;const l=a.$el;if(!l)return;N(),"daterange"===F.type?K.push(n((()=>a.startDateArray),".n-date-panel-calendar--start .n-date-panel-dates>div"),n((()=>a.endDateArray),".n-date-panel-calendar--end .n-date-panel-dates>div")):"date"===F.type&&K.push(n((()=>a.dateArray),".n-date-panel-calendar .n-date-panel-dates>div"));function n(e,t){const a=[],n=o(e,(e=>{a.forEach((e=>e.classList.remove("c-date-picker__holiday"))),a.length=0,g(e)&&Array.from(l.querySelectorAll(t)).forEach(((t,l)=>{const{ts:n}=e[l]||{};if(!V(n))return;const o=new Date(n);F.holidays.some((e=>e.getDate()===o.getDate()&&e.getMonth()===o.getMonth()&&e.getFullYear()===o.getFullYear()))&&(f((()=>t.classList.add("c-date-picker__holiday"))),a.push(t))}))}),{immediate:!0,deep:!0});return()=>{n(),a.length=0}}}(e),e&&L.value&&(await f(),async function e(t=0){var a;t>2||(q.value=null==(a=U.value)?void 0:a.panelInstRef,q.value?h(q,{formatRef:Y,attrs:{...P,type:F.type,isDateDisabled:O.value},isPanel:!0}):(await f(),e(++t)))}())}const K=[];function N(){K.forEach((e=>e())),K.length=0}async function Q(...e){var t,a,l,n,o,r;const u=null==(n=null==(l=null==(a=null==(t=U.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(F.type.includes("range")?null==(o=F.onConfirm)||o.call(F,...e):(await f(),u.focus(),G(u),u.blur(),null==(r=F.onConfirm)||r.call(F,Date.parse(u.value),u.value)),!(null==u?void 0:u.value)||!F.updateUnchangedValue||F.type.includes("range"))return;const s=u.value;D(u,I(new Date,B.value)),D(u,s)}function W(e){return F.allowedInvalidValue&&F.allowedInvalidValue===e}return n(N),o((()=>F.formattedValue),(e=>{x.value=W(e)?e:F.placeholder?F.placeholder:"选择日期时间",W(e)||(E=e)}),{immediate:!0}),$({$datePicker:U,focus:T,blur:z,setShortcutValue:async function(e){if(!F.type||!F.type.includes("range")||!U.value)return;const t=U.value.$el.querySelectorAll(".n-input__input-el");let a,l;const n=new Date;if("week"===e){const e=M(n,{weeks:1});a=I(R(e),B.value)}else{const e=M(n,{months:1});a=I(R(e),B.value)}l=I(C(n),B.value),D(t[0],a),await f(),D(t[1],l)}}),(t,a)=>(r(),u(s(m),{ref_key:"datePickerRef",ref:U,"onUpdate:show":J,onConfirm:Q,placeholder:x.value,to:e.to,type:e.type,"formatted-value":s(H),"onUpdate:formatted-value":a[0]||(a[0]=e=>d(H)?H.value=e:null),"is-date-disabled":s(O)},i({_:2},[p(t.$slots,((e,a)=>({name:a,fn:c((()=>[y(t.$slots,a)]))})))]),1032,["placeholder","to","type","formatted-value","is-date-disabled"]))}});export{$ as default};
|
@@ -521,6 +521,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
521
521
|
forceShowSelectAll: {
|
522
522
|
type: BooleanConstructor;
|
523
523
|
};
|
524
|
+
uncheckableField: {
|
525
|
+
type: StringConstructor;
|
526
|
+
};
|
524
527
|
}, {
|
525
528
|
$attrs: {
|
526
529
|
[x: string]: unknown;
|
@@ -626,6 +629,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
626
629
|
forceShowSelectAll: {
|
627
630
|
type: BooleanConstructor;
|
628
631
|
};
|
632
|
+
uncheckableField: {
|
633
|
+
type: StringConstructor;
|
634
|
+
};
|
629
635
|
}>> & {
|
630
636
|
onCheck?: ((...args: any[]) => any) | undefined;
|
631
637
|
onCheckWithLevel?: ((...args: any[]) => any) | undefined;
|
@@ -1077,6 +1083,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
1077
1083
|
forceShowSelectAll: {
|
1078
1084
|
type: BooleanConstructor;
|
1079
1085
|
};
|
1086
|
+
uncheckableField: {
|
1087
|
+
type: StringConstructor;
|
1088
|
+
};
|
1080
1089
|
}, {
|
1081
1090
|
searchFilterBase: {
|
1082
1091
|
isOpen: boolean;
|
@@ -1178,6 +1187,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
1178
1187
|
forceShowSelectAll: {
|
1179
1188
|
type: BooleanConstructor;
|
1180
1189
|
};
|
1190
|
+
uncheckableField: {
|
1191
|
+
type: StringConstructor;
|
1192
|
+
};
|
1181
1193
|
}>> & {}>>;
|
1182
1194
|
emit: any;
|
1183
1195
|
keyword: import("vue").Ref<string>;
|
@@ -1216,6 +1228,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
1216
1228
|
itemHeight: number;
|
1217
1229
|
}>;
|
1218
1230
|
wordbookChildExpandkeys: import("vue").ComputedRef<string[]>;
|
1231
|
+
styleObject: import("vue").ComputedRef<{
|
1232
|
+
height: string;
|
1233
|
+
}>;
|
1219
1234
|
caculateTagData: import("vue").ComputedRef<any>;
|
1220
1235
|
treeDataMiddle: any;
|
1221
1236
|
checkedKeysMiddle: any;
|
@@ -1234,6 +1249,7 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
1234
1249
|
setAllCheckedKeys: (tree: import("naive-ui").TreeOption, cb?: any) => void;
|
1235
1250
|
setAllCheckedKeysWithChild: (item: import("naive-ui").TreeOption, cb?: any) => void;
|
1236
1251
|
setAllCheckedKeysWithParent: (item: import("naive-ui").TreeOption, cb?: any) => void;
|
1252
|
+
setAllCheckedKeysWithAll: (item: import("naive-ui").TreeOption, cb?: any) => void;
|
1237
1253
|
queryLoadChildNode: (node: import("naive-ui").TreeOption) => Promise<import("../../shared/types").AnyObject>;
|
1238
1254
|
setDisabled: (data: import("naive-ui").TreeOption) => void;
|
1239
1255
|
renderLabel: ({ option }: {
|
@@ -1248,6 +1264,7 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
1248
1264
|
setTreeCheckd: (tree: import("naive-ui").TreeOption[], checked: boolean) => void;
|
1249
1265
|
setCheckdWithChild: (tree: import("naive-ui").TreeOption[], checked: boolean) => void;
|
1250
1266
|
setCheckdWithParent: (tree: import("naive-ui").TreeOption[], checked: boolean) => void;
|
1267
|
+
setCheckdWithAll: (tree: import("naive-ui").TreeOption[], checked: boolean) => void;
|
1251
1268
|
checkedAllChange: (checked: boolean) => void;
|
1252
1269
|
uniq: (arr: {
|
1253
1270
|
[key: string]: any;
|
@@ -1596,6 +1613,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
1596
1613
|
forceShowSelectAll: {
|
1597
1614
|
type: BooleanConstructor;
|
1598
1615
|
};
|
1616
|
+
uncheckableField: {
|
1617
|
+
type: StringConstructor;
|
1618
|
+
};
|
1599
1619
|
}>>, {
|
1600
1620
|
data: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & import("../../shared/types").AnyObject)[];
|
1601
1621
|
defaultList: ((string | number) | {
|
@@ -1730,6 +1750,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
1730
1750
|
forceShowSelectAll: {
|
1731
1751
|
type: BooleanConstructor;
|
1732
1752
|
};
|
1753
|
+
uncheckableField: {
|
1754
|
+
type: StringConstructor;
|
1755
|
+
};
|
1733
1756
|
}>> & {
|
1734
1757
|
onCheck?: ((...args: any[]) => any) | undefined;
|
1735
1758
|
onCheckWithLevel?: ((...args: any[]) => any) | undefined;
|
@@ -1839,6 +1862,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
1839
1862
|
forceShowSelectAll: {
|
1840
1863
|
type: BooleanConstructor;
|
1841
1864
|
};
|
1865
|
+
uncheckableField: {
|
1866
|
+
type: StringConstructor;
|
1867
|
+
};
|
1842
1868
|
}>> & {
|
1843
1869
|
onCheck?: ((...args: any[]) => any) | undefined;
|
1844
1870
|
onCheckWithLevel?: ((...args: any[]) => any) | undefined;
|