cnhis-design-vue 3.2.11-release.3 → 3.2.12-release.1
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/README.md +87 -87
- package/es/components/ai-chat/index.d.ts +92 -1
- package/es/components/ai-chat/src/Index.vue.d.ts +93 -2
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatCard.d.ts +18 -0
- package/es/components/ai-chat/src/components/ChatCard.js +1 -0
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +75 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatPrompt.vue.d.ts +45 -0
- package/es/components/ai-chat/src/components/ChatPrompt.vue.js +1 -0
- package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -0
- package/es/components/ai-chat/src/types/index.d.ts +14 -0
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/button-print/index.d.ts +3 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +3 -0
- package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +1 -0
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +2 -0
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +4 -0
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/form-config/index.d.ts +233 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +233 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +319 -85
- package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
- package/es/components/form-config/src/types/index.d.ts +4 -0
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-table/index.d.ts +4 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +4 -0
- package/es/components/iho-table/src/constants/index.d.ts +4 -0
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +15 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +2 -7
- package/es/components/select-label/index.d.ts +2 -7
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue.d.ts +2 -7
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue.d.ts +2 -7
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue.d.ts +2 -7
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -1
- package/es/components/select-label/src/index.vue.d.ts +2 -7
- package/es/components/select-label/src/types/index.d.ts +2 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/ai__avatar.png.js +1 -1
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/logo.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as t,ref as n,computed as l,watch as
|
1
|
+
import{defineComponent as e,inject as t,ref as n,computed as l,watch as o,nextTick as a,createVNode as s,createTextVNode as r,mergeProps as i,isVNode as u}from"vue";import{NAvatar as c,NSpin as d,NButton as m,NSpace as p}from"naive-ui";import{InjectionAIChatEmits as v,InjectionAIChat as f}from"../types/index.js";import g from"../../../../shared/assets/img/ai__avatar.png.js";import h from"../../../../shared/assets/img/logo.png.js";import{isArray as b,isFunction as y}from"lodash-es";import"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as C}from"../../../../shared/hooks/useScrollLoading.js";import k from"./ChatCard.js";function j(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var x=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:u,slots:x,emit:S}){const I=t(v),{userAvatar:E,queryData:T,state:w,queryRecord:z,defaultShortcutList:M,hideInput:A=!1,isSmall:O}=t(f),_=n(null),q=n([]),H=n(!1),L=l((()=>O.value?h:g)),B={page:0,hasMore:!0};async function D(e=!1){if(!B.hasMore)return;B.page++,1==B.page&&(q.value=[]);const{records:t,rows:n}=await z.value({page:B.page});b(n)&&q.value.length<=+t&&(q.value=B.page>1?[...q.value,...n]:n,J(),q.value.length>=+t&&(e&&(H.value=!0),B.hasMore=!1,console.log("没有更多消息了")))}function J(){q.value.forEach((e=>{e.buttonType&&(e.disabled=!0),e.contents.forEach((e=>e.disabled=!0))}))}function N(e){const{item:t,msgItem:n,fieldItem:l}=e;if(n)return I("button-click",{item:t,msgItem:n,fieldItem:l}),void q.value.forEach((e=>e.contents.forEach((e=>e.disabled=!0))));q.value.forEach((e=>e.buttonType&&(e.disabled=!0))),t.link||(w.beingSent=!0,w.sendContent="确定")}function P(e,t){const{contentType:n,content:l=""}=t;return"json"===n&&function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(l)?s(k,{msgItem:t,"onButton-click":n=>N({item:e,msgItem:t,...n?{fieldItem:n}:{}})},null):null}function R(e,t){const{contents:n=[],buttonType:l=""}=e,o=P(e,n[t]);if(o)return o;return[n[t].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,t,n)=>[e,t===n.length-1?null:s("br",null,null)])),l&&0===t?[s("br",null,null),s(m,i({style:"margin-top: 5px",secondary:!0,class:"gradient",disabled:e.disabled},e.link?{tag:"a",href:e.link,target:"_blank"}:{},{onClick:()=>N({item:e})}),{default:()=>[r("确定")]})]:null]}function F({role:e=""}){return"user"===e}function G(){let e;return s("div",{class:"message-item"},[s(c,{round:!0,size:O.value?64:40,src:L.value},null),s("div",{class:"content-box"},[s("div",{class:"content fillet-10 default"},[s("h2",null,[r("Hi,我是你的AI助理")]),s("p",null,[r("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),s("br",null,null),r("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),b(M.value)&&M.value.length>0?[s("p",{style:"margin: 5px 0 5px"},[r("你可以试着问我:")]),s(p,{"wrap-item":!1},j(e=M.value.map((e=>s(m,{size:"large",secondary:!0,onClick:()=>w.sendContent=e,disabled:w.beingSent},j(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])])}return C(_,(()=>{D()}),A.value?"bottom":"top"),D(!0),o((()=>w.beingSent),(async e=>{var t,n;if(e){q.value.unshift({contents:[{role:"user",content:w.sendContent}]}),null==(t=_.value)||t.scrollTo({top:0,behavior:"auto"}),J();const e=w.selectedCommand,l=w.selectedPrompt;w.selectedCommand=null;const o=await T.value({content:w.sendContent,contentType:"text",command:e,prompt:l});b(null==o?void 0:o.contents)&&(q.value.unshift(o),await a(),null==(n=_.value)||n.scrollTo({top:0,behavior:"auto"})),w.beingSent=!1,w.sendContent=""}})),()=>s("section",{class:"chat-main",ref:_,style:{"flex-direction":A.value?"column":"column-reverse"}},[[w.beingSent?s("div",{class:"message-item"},[[O.value?null:s(c,{round:!0,size:40,src:L.value},null),s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(d,{size:22,stroke:"#4170EE"},null),s("span",null,[r("正在加载中,请稍等...")])])])]]):null,q.value.map((e=>e.contents.map(((t,n)=>s("div",{class:"message-item"},[[O.value?null:s(c,{round:!0,size:40,src:F(t)?E.value:L.value},null),s("div",{class:["content-box",F(t)?"mine":""]},[s("div",{class:"content"},[y(t.render)?t.render():R(e,n)])])]]))))),H.value?G():null]])}});export{x as default};
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { AnyObject } from '../../../../shared/types';
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
3
|
+
show: {
|
4
|
+
type: BooleanConstructor;
|
5
|
+
};
|
6
|
+
}, {
|
7
|
+
pageInfo: {
|
8
|
+
page: number;
|
9
|
+
hasMore: boolean;
|
10
|
+
};
|
11
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
12
|
+
show: {
|
13
|
+
type: BooleanConstructor;
|
14
|
+
};
|
15
|
+
}>> & {
|
16
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
17
|
+
}>>;
|
18
|
+
emit: (event: "update:show", ...args: any[]) => void;
|
19
|
+
queryPrompt: any;
|
20
|
+
state: any;
|
21
|
+
listRef: import("vue").Ref<any>;
|
22
|
+
keyword: import("vue").Ref<string>;
|
23
|
+
list: import("vue").Ref<AnyObject[]>;
|
24
|
+
showNoData: import("vue").ComputedRef<boolean>;
|
25
|
+
handleInput: () => void;
|
26
|
+
handleSearch: () => Promise<void>;
|
27
|
+
resetAndSearch: () => void;
|
28
|
+
select: (item: AnyObject) => void;
|
29
|
+
NDrawer: any;
|
30
|
+
NDrawerContent: any;
|
31
|
+
NIcon: any;
|
32
|
+
NInput: any;
|
33
|
+
NButton: any;
|
34
|
+
CloseOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
35
|
+
SearchOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
36
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
37
|
+
show: {
|
38
|
+
type: BooleanConstructor;
|
39
|
+
};
|
40
|
+
}>> & {
|
41
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
42
|
+
}, {
|
43
|
+
show: boolean;
|
44
|
+
}>;
|
45
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import r from"./ChatPrompt.vue2.js";import t from"../../../../_virtual/_plugin-vue_export-helper.js";var e=t(r,[["__file","ChatPrompt.vue"]]);export{e as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as e,inject as o,ref as t,computed as a,watch as s,openBlock as r,createBlock as l,unref as n,withCtx as p,createVNode as u,createElementVNode as i,createElementBlock as c,Fragment as m,renderList as d,toDisplayString as h,withDirectives as v,vShow as f}from"vue";import{NDrawer as w,NDrawerContent as g,NButton as k,NIcon as C,NInput as y}from"naive-ui";import{CloseOutline as _,SearchOutline as j}from"@vicons/ionicons5";import{isFunction as x}from"lodash-es";import"../../../../shared/utils/index.js";import{useDebounceFn as M}from"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as b}from"../../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as P}from"../types/index.js";const R={class:"title"},S=i("span",null,"发现提示词",-1),U=["onClick"];var q=e({__name:"ChatPrompt",props:{show:{type:Boolean}},emits:["update:show"],setup(e,{emit:q}){const z=e,B={page:0,hasMore:!0},{queryPrompt:H,state:I}=o(P),L=t(),O=t(""),T=t([]),$=a((()=>!T.value.length&&!!(O.value||"").replace(/^\s+|\s+$/g,""))),A=M(E,500);async function D(){try{if(!B.hasMore||!x(H.value))return;B.page++,1==B.page&&(T.value=[]);const e=await H.value({keyword:O.value,page:B.page});T.value.length<=+e.records&&(T.value=B.page>1?T.value.concat(e.rows):e.rows,T.value.length>=+e.records&&(B.hasMore=!1))}catch(e){}}function E(){Object.assign(B,{page:0,hasMore:!0}),D()}return b(L,(()=>{D()})),s((()=>z.show),(e=>{e&&(O.value="",E())})),(o,t)=>(r(),l(n(w),{placement:"bottom",height:"70%","trap-focus":!1,to:"#"+n(I).id,show:e.show,"content-class":"prompt-wrapper",onMaskClick:t[2]||(t[2]=()=>q("update:show",!1))},{default:p((()=>[u(n(g),null,{header:p((()=>[i("div",R,[S,u(n(k),{text:"",onClick:t[0]||(t[0]=()=>q("update:show",!1))},{default:p((()=>[u(n(C),{size:"20",component:n(_)},null,8,["component"])])),_:1})]),u(n(y),{ref:"inputRef",clearable:"",autofocus:"",value:O.value,"onUpdate:value":[t[1]||(t[1]=e=>O.value=e),n(A)]},{prefix:p((()=>[u(n(C),{component:n(j)},null,8,["component"])])),_:1},8,["value","onUpdate:value"])])),default:p((()=>[i("div",{class:"list-wrapper",ref_key:"listRef",ref:L},[(r(!0),c(m,null,d(T.value,(e=>(r(),c("div",{class:"item",key:e.promptId,onClick:()=>function(e){q("update:show",!1),I.selectedPrompt=e,I.sendContent=e.promptContent}(e)},[i("p",null,h(e.promptTitle),1),i("p",null,h(e.promptContent),1)],8,U)))),128)),v(i("div",null,"找不到相关的结果",512),[[f,n($)]])],512)])),_:1})])),_:1},8,["to","show"]))}});export{q as default};
|
@@ -27,3 +27,17 @@ export type QueryRecord = (props: {
|
|
27
27
|
records: number;
|
28
28
|
rows: MessageList;
|
29
29
|
}>;
|
30
|
+
export type CommandItem = {
|
31
|
+
shortcutTitle: string;
|
32
|
+
shortcutId: string;
|
33
|
+
shortcutDescription?: string;
|
34
|
+
children?: CommandItem[];
|
35
|
+
[key: string]: any;
|
36
|
+
};
|
37
|
+
export type QueryPrompt = (props: {
|
38
|
+
keyword: string;
|
39
|
+
page: number;
|
40
|
+
}) => Promise<{
|
41
|
+
rows: AnyObject[];
|
42
|
+
records: number;
|
43
|
+
}>;
|
@@ -1 +1 @@
|
|
1
|
-
.c-recording-wrapper{align-items:center;background-color:#fff;border-radius:10px;bottom:100px;display:flex;height:350px;justify-content:center;left:calc(50% - 250px);position:fixed;width:500px}@keyframes toScale{0%{transform:translateX(-50%) translateY(-50%) scale(1)}to{transform:translateX(-50%) translateY(-50%) scale(1.5)}}.c-recording-wrapper .content{font-size:18px;position:absolute;text-align:center;top:20px}.c-recording-wrapper .animation{animation:toScale 1s infinite;background-color:#5585f54d;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) scale(1);z-index:-1}.c-recording-wrapper .animation,.c-recording-wrapper .icon-box{align-items:center;border-radius:50%;display:flex;height:90px;justify-content:center;width:90px}.c-recording-wrapper .icon-box{background-color:#5585f5;cursor:pointer}.c-recording-wrapper .tip{bottom:20px;position:absolute}.ai-chat{background:linear-gradient(135deg,#c9dbfb,#c9dbfb 20%,rgba(237,237,253,.5) 70%,rgba(151,97,251,.2));display:flex;flex-flow:column nowrap;font-size:14px;height:100%;padding:45px 0 60px;width:100%}.ai-chat,.ai-chat *{box-sizing:border-box}.ai-chat .fillet-10{border-radius:10px}.ai-chat .fillet-8{border-radius:8px}.ai-chat .n-avatar{background-color:var(--c-primary-color)}.ai-chat .gradient{background:linear-gradient(178deg,#8f66f7,#4170ee);color:#fff}.ai-chat .gradient:active,.ai-chat .gradient:focus,.ai-chat .gradient:hover{color:#fff}.ai-chat .chat-main{display:flex;flex:1;flex-flow:column-reverse nowrap;overflow-y:auto;padding:0 130px 0 82px;row-gap:16px}.ai-chat .chat-main::-webkit-scrollbar{width:5px}.ai-chat .chat-main::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-main::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-main .message-item{column-gap:8px;display:flex;flex-flow:row nowrap}.ai-chat .chat-main .message-item:first-child{margin-bottom:auto}.ai-chat .chat-main .message-item .n-avatar{flex-shrink:0}.ai-chat .chat-main .message-item .content-box .content{background:#fff;border-radius:10px;flex:unset;padding:10px 12px}.ai-chat .chat-main .message-item .content-box .content .card{width:236px}.ai-chat .chat-main .message-item .content-box .content .card>p{font-size:14px;line-height:19px}.ai-chat .chat-main .message-item .content-box .content .card .link-btn{display:flex;flex-flow:row wrap;font-size:14px;justify-content:space-between;margin-top:10px;width:100%}.ai-chat .chat-main .message-item .content-box .content .card .link-btn .n-button__content{display:unset;flex:1;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-main .message-item .content-box .content .card .card-body{border:1px solid #d5d5d5;border-radius:8px;margin-top:5px;overflow:hidden}.ai-chat .chat-main .message-item .content-box .content .card .card-body__head{background:rgba(65,112,238,.14);line-height:36px;padding:0 15px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content{padding:10px 6px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div{display:flex;font-size:12px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div .label{flex:0 0 60px;text-align:right}.ai-chat .chat-main .message-item .content-box .content.default h2{font-size:22px;font-weight:500;margin:10px 0}.ai-chat .chat-main .message-item .content-box .content.loading{align-items:center;color:#999;column-gap:10px;display:flex}.ai-chat .chat-main .message-item .content-box.mine .content{background:hsla(0,0%,100%,.48);border-radius:8px}.ai-chat .chat-footer{padding:30px 130px 0}.ai-chat .chat-footer.disabled{cursor:not-allowed}.ai-chat .chat-footer .menu-box{background:#fff;column-gap:8px;display:flex;margin-bottom:8px;overflow-x:auto;padding:10px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{width:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{height:5px}.ai-chat .chat-footer .input-wrapper{background:#fff;box-shadow:0 3px 4px 0 rgba(0,0,0,.1);padding:15px 20px}.ai-chat .chat-footer .input-wrapper .n-input__border,.ai-chat .chat-footer .input-wrapper .n-input__state-border{border:none}.ai-chat .chat-footer .input-wrapper .n-input:not(.n-input--disabled).n-input--focus .n-input__state-border{box-shadow:unset}.ai-chat .chat-footer .input-wrapper .btn-box{display:flex;justify-content:flex-end}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send{align-items:center;cursor:pointer;display:flex;height:46px;justify-content:center;width:58px}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send.disabled{cursor:not-allowed;opacity:.5}.ai-chat--small{padding:20px 0 44px}.ai-chat--small .chat-main{padding:0 20px 10px}.ai-chat--small .chat-main .message-item{display:unset}.ai-chat--small .chat-main .message-item .n-avatar{background:transparent}.ai-chat--small .chat-main .message-item .content-box{display:flex;flex-flow:row nowrap}.ai-chat--small .chat-main .message-item .content-box .content{border-radius:3px 14px 14px;max-width:calc(100% - 55px)}.ai-chat--small .chat-main .message-item .content-box .content.default{border-radius:4px 16px 16px}.ai-chat--small .chat-main .message-item .content-box.mine{flex-flow:row-reverse nowrap}.ai-chat--small .chat-main .message-item .content-box.mine .content{background:#5874dc;border-radius:14px 0 14px 14px;color:#fff}.ai-chat--small .chat-footer{padding:10px 20px 0}.ai-chat--small .chat-footer .menu-box{background:none;padding:0}.ai-chat--small .chat-footer .menu-box .n-button{background:#fff}.ai-chat--small .chat-footer .input-wrapper{border-radius:24px;box-shadow:0 0 6px 0 hsla(240,9%,85%,.74);padding:0}
|
1
|
+
.c-recording-wrapper{align-items:center;background-color:#fff;border-radius:10px;bottom:100px;display:flex;height:350px;justify-content:center;left:calc(50% - 250px);position:fixed;width:500px}@keyframes toScale{0%{transform:translateX(-50%) translateY(-50%) scale(1)}to{transform:translateX(-50%) translateY(-50%) scale(1.5)}}.c-recording-wrapper .content{font-size:18px;position:absolute;text-align:center;top:20px}.c-recording-wrapper .animation{animation:toScale 1s infinite;background-color:#5585f54d;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) scale(1);z-index:-1}.c-recording-wrapper .animation,.c-recording-wrapper .icon-box{align-items:center;border-radius:50%;display:flex;height:90px;justify-content:center;width:90px}.c-recording-wrapper .icon-box{background-color:#5585f5;cursor:pointer}.c-recording-wrapper .tip{bottom:20px;position:absolute}.ai-chat{background:linear-gradient(135deg,#c9dbfb,#c9dbfb 20%,rgba(237,237,253,.5) 70%,rgba(151,97,251,.2));display:flex;flex-flow:column nowrap;font-size:14px;height:100%;padding:45px 0 60px;position:relative;width:100%}.ai-chat,.ai-chat *{box-sizing:border-box}.ai-chat .fillet-10{border-radius:10px}.ai-chat .fillet-8{border-radius:8px}.ai-chat .n-avatar{background-color:var(--c-primary-color)}.ai-chat .gradient{background:linear-gradient(178deg,#8f66f7,#4170ee);color:#fff}.ai-chat .gradient:active,.ai-chat .gradient:focus,.ai-chat .gradient:hover{color:#fff}.ai-chat .chat-main{display:flex;flex:1;flex-flow:column-reverse nowrap;overflow-y:auto;padding:0 130px 0 82px;row-gap:16px}.ai-chat .chat-main::-webkit-scrollbar{width:5px}.ai-chat .chat-main::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-main::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-main .message-item{column-gap:8px;display:flex;flex-flow:row nowrap}.ai-chat .chat-main .message-item:first-child{margin-bottom:auto}.ai-chat .chat-main .message-item .n-avatar{flex-shrink:0}.ai-chat .chat-main .message-item .content-box .content{background:#fff;border-radius:10px;flex:unset;padding:10px 12px}.ai-chat .chat-main .message-item .content-box .content .card{width:236px}.ai-chat .chat-main .message-item .content-box .content .card>p{font-size:14px;line-height:19px}.ai-chat .chat-main .message-item .content-box .content .card .link-btn{display:flex;flex-flow:row wrap;font-size:14px;justify-content:space-between;margin-top:10px;width:100%}.ai-chat .chat-main .message-item .content-box .content .card .link-btn .n-button__content{display:unset;flex:1;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-main .message-item .content-box .content .card .card-body{border:1px solid #d5d5d5;border-radius:8px;margin-top:5px;overflow:hidden}.ai-chat .chat-main .message-item .content-box .content .card .card-body__head{background:rgba(65,112,238,.14);line-height:36px;padding:0 15px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content{padding:10px 6px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div{display:flex;font-size:12px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div .label{flex:0 0 60px;text-align:right}.ai-chat .chat-main .message-item .content-box .content .card .patient-info{border-top:1px solid #e5e5e5;margin-top:5px}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item{margin:5px 0 0 5px}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item:last-child{margin-bottom:0}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item p:first-child{font-weight:700}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item p:last-child{color:#888}.ai-chat .chat-main .message-item .content-box .content.default h2{font-size:22px;font-weight:500;margin:10px 0}.ai-chat .chat-main .message-item .content-box .content.loading{align-items:center;color:#999;column-gap:10px;display:flex}.ai-chat .chat-main .message-item .content-box.mine .content{background:hsla(0,0%,100%,.48);border-radius:8px}.ai-chat .chat-footer{padding:30px 130px 0}.ai-chat .chat-footer.disabled{cursor:not-allowed}.ai-chat .chat-footer .menu-box{background:#fff;column-gap:8px;display:flex;margin-bottom:8px;overflow-x:auto;padding:10px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{width:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{height:5px}.ai-chat .chat-footer .input-wrapper{background:#fff;box-shadow:0 3px 4px 0 rgba(0,0,0,.1);padding:15px 20px}.ai-chat .chat-footer .input-wrapper .n-input__border,.ai-chat .chat-footer .input-wrapper .n-input__state-border{border:none}.ai-chat .chat-footer .input-wrapper .n-input:not(.n-input--disabled).n-input--focus .n-input__state-border{box-shadow:unset}.ai-chat .chat-footer .input-wrapper .btn-box{display:flex;justify-content:flex-end}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send{align-items:center;cursor:pointer;display:flex;height:46px;justify-content:center;width:58px}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send.disabled{cursor:not-allowed;opacity:.5}.ai-chat .chat-footer .command-box{display:flex;flex-flow:column nowrap;height:100%}.ai-chat .chat-footer .command-box__header{display:flex}.ai-chat .chat-footer .command-box__header .title{color:#999}.ai-chat .chat-footer .command-box__menu{flex:1;overflow-y:auto}.ai-chat .chat-footer .command-box__menu .menu-item{align-items:center;display:flex;padding:8px 0 8px 5px}.ai-chat .chat-footer .command-box__menu .menu-item .remark{color:#999;flex:1;font-size:12px;margin-left:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-footer .command-box__menu .menu-item .n-icon{margin-left:auto}.ai-chat .chat-footer .command-box__menu .menu-item:hover{background:#e5e5e5;border-radius:5px}.ai-chat .chat-footer .command-box__menu .menu-item.selectable{position:relative}.ai-chat .chat-footer .command-box__menu .menu-item.selectable .label{color:var(--c-primary-color);margin-left:30px}.ai-chat .chat-footer .command-box__menu .menu-item.selectable:before{background:#d5d5d5;border-radius:5px;content:"/";height:20px;left:5px;line-height:20px;position:absolute;text-align:center;top:10px;width:20px}.ai-chat--small{padding:20px 0 44px}.ai-chat--small .chat-main{padding:0 20px 10px}.ai-chat--small .chat-main .message-item{display:unset}.ai-chat--small .chat-main .message-item .n-avatar{background:transparent}.ai-chat--small .chat-main .message-item .content-box{display:flex;flex-flow:row nowrap}.ai-chat--small .chat-main .message-item .content-box .content{border-radius:3px 14px 14px;max-width:calc(100% - 55px)}.ai-chat--small .chat-main .message-item .content-box .content.default{border-radius:4px 16px 16px}.ai-chat--small .chat-main .message-item .content-box.mine{flex-flow:row-reverse nowrap}.ai-chat--small .chat-main .message-item .content-box.mine .content{background:#5874dc;border-radius:14px 0 14px 14px;color:#fff}.ai-chat--small .chat-footer{padding:10px 20px 0}.ai-chat--small .chat-footer .menu-box{background:none;padding:0}.ai-chat--small .chat-footer .menu-box .n-button{background:#fff}.ai-chat--small .chat-footer .input-wrapper{border-radius:24px;box-shadow:0 0 6px 0 hsla(240,9%,85%,.74);padding:0}.ai-chat .prompt-wrapper{background:linear-gradient(135deg,#ecf3ff,#ecf3ff 20%,rgba(237,237,253,.5) 70%,rgba(203,175,255,.3))}.ai-chat .prompt-wrapper .n-drawer-header{padding:15px}.ai-chat .prompt-wrapper .n-drawer-header__main{width:100%}.ai-chat .prompt-wrapper .n-drawer-header__main .title{display:flex;font-size:14px}.ai-chat .prompt-wrapper .n-drawer-header__main .title .n-button{margin-left:auto}.ai-chat .prompt-wrapper .n-drawer-header__main .n-input{margin-top:10px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper{padding:0 10px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper{align-content:flex-start;display:flex;flex-wrap:wrap;height:100%;overflow-y:auto}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper::-webkit-scrollbar{width:5px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper .item{background:#fff;border-radius:10px;box-sizing:border-box;break-inside:avoid;cursor:pointer;margin:5px;padding:10px;width:calc(50% - 10px)}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper .item:hover{background-image:linear-gradient(#ecf3ff,#fff 40%,#fff)}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper .item p:last-child{color:#999;font-size:12px}
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
declare module 'bpmn-js/lib/Viewer';
|
@@ -0,0 +1 @@
|
|
1
|
+
declare module 'bpmn-js/lib/features/modeling';
|
@@ -0,0 +1 @@
|
|
1
|
+
declare module 'diagram-js/lib/navigation/movecanvas';
|
@@ -341,6 +341,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
341
341
|
type: StringConstructor;
|
342
342
|
};
|
343
343
|
}, {
|
344
|
+
isDomestic: boolean;
|
344
345
|
baseDownListSetting: {
|
345
346
|
label: string;
|
346
347
|
key: string;
|
@@ -961,6 +962,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
961
962
|
printInstance: import("./src/utils").Print | null;
|
962
963
|
downloadPdfCode: string;
|
963
964
|
formatEditTextCode: string;
|
965
|
+
isDomestic: boolean;
|
964
966
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
965
967
|
printParams: {
|
966
968
|
type: import("vue").PropType<import("../../shared/types").AnyObject[]>;
|
@@ -1086,6 +1088,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
1086
1088
|
iReportExecuteMode: number;
|
1087
1089
|
};
|
1088
1090
|
options: import("vue").Ref<import("../../shared/types").AnyObject[]>;
|
1091
|
+
tempOptions: import("vue").Ref<import("../../shared/types").AnyObject[]>;
|
1089
1092
|
currentFormatItem: import("vue").ComputedRef<{} | undefined>;
|
1090
1093
|
formatTitle: import("vue").ComputedRef<any>;
|
1091
1094
|
getTemplateIdByFormatId: import("vue").ComputedRef<any>;
|
@@ -347,6 +347,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
347
347
|
type: StringConstructor;
|
348
348
|
};
|
349
349
|
}, {
|
350
|
+
isDomestic: boolean;
|
350
351
|
baseDownListSetting: {
|
351
352
|
label: string;
|
352
353
|
key: string;
|
@@ -967,6 +968,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
967
968
|
printInstance: import("./utils").Print | null;
|
968
969
|
downloadPdfCode: string;
|
969
970
|
formatEditTextCode: string;
|
971
|
+
isDomestic: boolean;
|
970
972
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
971
973
|
printParams: {
|
972
974
|
type: PropType<AnyObject[]>;
|
@@ -1092,6 +1094,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1092
1094
|
iReportExecuteMode: number;
|
1093
1095
|
};
|
1094
1096
|
options: import("vue").Ref<AnyObject[]>;
|
1097
|
+
tempOptions: import("vue").Ref<AnyObject[]>;
|
1095
1098
|
currentFormatItem: import("vue").ComputedRef<{} | undefined>;
|
1096
1099
|
formatTitle: import("vue").ComputedRef<any>;
|
1097
1100
|
getTemplateIdByFormatId: import("vue").ComputedRef<any>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,reactive as a,watch as l,openBlock as o,createBlock as u,unref as
|
1
|
+
import{defineComponent as e,ref as t,reactive as a,watch as l,openBlock as o,createBlock as u,unref as n,normalizeStyle as r,withCtx as s,createElementVNode as i,mergeProps as d,createVNode as c,withKeys as p,createTextVNode as m}from"vue";import{useMessage as v,NModal as f,NForm as y,NFormItem as w,NInput as g,NButton as h}from"naive-ui";import _ from"./EditFormat.vue.js";const k={class:"content"};var I=e({__name:"IdentityVerification",props:{verifyUser:{type:Function,default:()=>Promise.resolve()},identityVerificationTitle:{default:"打印服务身份校验"},modelValue:{type:Boolean},formatId:null,templateId:null},emits:["update:modelValue","success","close"],setup(e,{emit:I}){const V=e,x=v(),C={account:"",password:""},b=t(null),K=t(!1),U=t("");let S=a({...C});const F={account:{required:!0,message:"请输入账号"},password:{required:!0,message:"请输入密码"}},j="416px",q=t(null),E=()=>{I("update:modelValue",!1),I("close")},N=t(!1),P=()=>{var e;null==(e=q.value)||e.validate((e=>{if(e)return console.log(e),!1;(async()=>{var e;try{N.value=!0;const{data:t={}}=await V.verifyUser(S)||{};if("SUCCESS"!==t.result)return x.error(t.resultMsg||"身份校验失败,请重试!"),!1;I("success",null==(e=t.map)?void 0:e.token)}finally{N.value=!1}})()}))},R=async()=>{var e,t;try{N.value=!0;if(!await(null==(t=b.value)?void 0:t.submit({authorizationKey:U.value,id:null==(e=V.formatId)?void 0:e.split("_")[1],templateId:V.templateId,datasourceName:null,dataSourceId:null})))return!1;I("success",U.value)}finally{N.value=!1}};return l((()=>V.modelValue),(e=>{e||Object.assign(S,C)})),(t,a)=>(o(),u(n(f),{preset:"dialog",title:K.value?"编辑":e.identityVerificationTitle,class:"standard-modal standard-modal-white authentication-modal c-button-print-modal",show:e.modelValue,"close-on-esc":!1,"show-icon":!1,style:r({width:j,overflowY:"auto"}),"positive-text":K.value?"确认":"","negative-text":K.value?"取消":"",onClose:E,onNegativeClick:E,onPositiveClick:R},{default:s((()=>[i("div",k,[K.value?(o(),u(_,d({key:0,ref_key:"editFormRef",ref:b},t.$attrs,{formatId:e.formatId,token:U.value}),null,16,["formatId","token"])):(o(),u(n(y),{key:1,class:"login-form-button-print",ref_key:"formRef",ref:q,model:n(S),rules:F},{default:s((()=>[c(n(w),{path:"account"},{default:s((()=>[c(n(g),{value:n(S).account,"onUpdate:value":a[0]||(a[0]=e=>n(S).account=e),placeholder:"请输入账号",onKeyup:p(P,["enter"])},null,8,["value","onKeyup"])])),_:1}),c(n(w),{path:"password"},{default:s((()=>[c(n(g),{type:"password","input-props":{autocomplete:"on",name:"password"},value:n(S).password,"onUpdate:value":a[1]||(a[1]=e=>n(S).password=e),placeholder:"请输入密码",onKeyup:p(P,["enter"])},null,8,["value","onKeyup"])])),_:1}),c(n(w),null,{default:s((()=>[c(n(h),{loading:N.value,type:"primary",class:"login-form-button",onClick:P},{default:s((()=>[m("登录")])),_:1},8,["loading"])])),_:1})])),_:1},8,["model"]))])])),_:1},8,["title","show","style","positive-text","negative-text"]))}});export{I as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as t,ref as n,reactive as r,computed as i,onMounted as a,onBeforeUnmount as l,watch as o,openBlock as s,createElementBlock as u,Fragment as c,createElementVNode as d,createCommentVNode as p,createVNode as m,unref as v,withCtx as y,renderList as f,createBlock as g,normalizeClass as h,createTextVNode as k,toDisplayString as b,isRef as P,renderSlot as w,withModifiers as S,mergeProps as I}from"vue";import{isObject as O}from"@vue/shared";import{useMessage as C,NButtonGroup as L,NDropdown as T,NButton as j,NIcon as M,NPopover as x,NCheckbox as E,NDivider as F}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 K from"./IdentityVerification.vue.js";import{format as A}from"date-fns";import"../api.js";import"../../../shortcut-provider/index.js";import{encapBrowserLog as V}from"../../../../shared/utils/index.js";import{useShortcuts as B}from"../../../shortcut-provider/src/hooks/useShortcuts.js";const q={class:"newprint-button-outer"},G={key:0,class:"newprint-button-outer__shortcut"},Y=d("span",{class:"label bold"},"外显设置",-1),H={class:"newprint-button-poperOver"},$={class:"print-lite"},Q={class:"label bold"},W={class:"print-li"},X={class:"print-lite"},Z={key:0,class:"newprint-button-outer__shortcut"},ee={class:"newprint-button-poperOver"},te=["onMouseenter","onClick"],ne={class:"label bold"},re={class:"newprint-button-poperOver"},ie={class:"print-lite"},ae={class:"label bold"},le={class:"print-li"},oe={class:"print-lite"},se=["onClick"],ue={key:0,class:"newprint-button-outer__shortcut"},ce={class:"newprint-button-poperOver"},de=["onMouseenter"],pe={class:"print-lite"},me=["onClick"];var ve=e({__name:"NewPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number},resolution:{type:Number},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,printAllType:1,isShowOutSetting:!0,customProps:{},outerPrintKeys:[],defaultFormatId:"",shortcut:{}})},svrUpdateIp:{type:String}},setup(e,{expose:ve}){const ye=e,fe=[{label:"分割线",key:"divider"},{label:"外显设置",key:"outSetting"}],ge=C();let he;const ke=t(J),be=n(""),Pe=r({spinning:!1,visible:!1,formatList:[],templateParams:[],printParams:[],originParams:{},currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1,curPrintParamList:[],iReportExecuteMode:1}),we=n({});let Se=n([]),Ie=n([{label:ye.previewText,key:"previewText"},{label:ye.pdfLoadText,key:"downloadPdf"},{label:ye.formatEditText,key:"formatEditText"},{label:"重置打印机",key:"resetPrinter"}]);const Oe=r({oneMouseType:"",oneClickType:"",twoMouseType:""}),Ce=r({oneShow:!1,isOperation:!1,isOutSetting:!1}),Le=n([]),Te=n([]),je=i((()=>{if(!Pe.currentFormatId)return{};let e=Pe.currentFormatId;return Pe.formatList.find((t=>t.id===e))}));i((()=>{var e;return(null==(e=je.value)?void 0:e.name)||"格式选择"}));const Me=i((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.templateId})),xe=i((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.number})),Ee=i((()=>{var e;return null==(e=ye.newPrintSetting)?void 0:e.isShowPrintAll})),Fe=i((()=>{var e;return null==(e=ye.newPrintSetting)?void 0:e.isShowOutSetting})),Ne=i((()=>{var e;return(null==(e=ye.newPrintSetting)?void 0:e.customProps)||{}})),_e=i((()=>{var e;return(null==(e=ye.newPrintSetting)?void 0:e.defaultFormatId)||""})),De=i((()=>{var e;return(null==(e=ye.newPrintSetting)?void 0:e.printAllType)||1})),Re=i((()=>{var e;return(null==(e=ye.newPrintSetting)?void 0:e.shortcut)||{}})),Je=i((()=>{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""})),Ue=i((()=>{const e=fe.map((e=>e.key));return Se.value.filter((t=>!e.includes(t.key)))})),ze=i({get:()=>Ue.value.every((e=>e.selected)),set(e){Ue.value.forEach((t=>{t.selected=e}))}}),Ke=async()=>{var e,t;(null==(t=null==(e=ye.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)||await vt(),Ce.oneShow=!0},Ae=async e=>{if(ye.directPrint){if(Pe.spinning)return;return"button"===e?void(Ee.value?await gt():_e.value?async function(e){await vt(!1);const t=Le.value.find((t=>t.key==e));t&&tt(t.templateCode,t.templateId,t.key,!1)}(_e.value):Ke()):Ke()}return Ke()},Ve=(e,t)=>{Oe[e]=t},Be=()=>{Le.value=Se.value.filter((e=>!e.selected)),Te.value=Ue.value.filter((e=>e.selected)),Ge("oneShow"),Ge("isOutSetting"),ke("saveOuterPrint",Te.value)},qe=e=>{Ce[e]=!0},Ge=e=>{Oe.oneClickType="",Ce[e]=!1,"isOutSetting"==e&&(Ce.isOutSetting=!1)},Ye=(e,t)=>{Ze(!1);let n={type:t,formatId:Pe.currentFormatId,templateId:(null==e?void 0:e.templateId)||Me.value,templateCode:(null==e?void 0:e.templateCode)||xe.value};V({type:"进入成功的回调",res:e,info:n},"PRINT-SDK"),ke("success",e,n)},He=e=>{Ze(!1),V({type:"进入失败的回调",res:e},"PRINT-SDK"),ke("error",e),O(e)&&"notInstalledApp"===e.type&&ge.error(e.message)},$e=e=>{Ze(!1),ke("cancel",e)},Qe=e=>{ke("error",{message:"前置条件执行错误",type:e,preExecution:!0})},We=()=>JSON.stringify({...ye.token?{token:ye.token}:{}}),Xe=(e=[],t)=>{var n,r;let i={},a={};if((null==(n=Pe.templateParams[t].customizeDataset)?void 0:n.length)>0){const t=(null==(r=Object.keys(e[0].datasetData||{}))?void 0:r[0])||"",n=JSON.stringify(e.map((e=>JSON.parse(e.datasetData[t]))));a={datasetData:{}},a.datasetData[t]=n}else Object.keys(e[0]).forEach((t=>{a[t]=[],e.forEach((e=>{a[t].includes(e[t])||a[t].push(e[t])})),a[t]=a[t].join(",")}));return i=Object.assign({},JSON.parse(We()),Ne.value,a),JSON.stringify(i)},Ze=(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},et=()=>Pe.isClickOuterPrint?Te.value.some((e=>e.isLoading)):Pe.spinning,tt=(e,t,n,r)=>{const i=Pe.printParams[e];if(!i)return;Pe.isClickOuterPrint=r,Pe.currentFormatId=n;const a=Pe.originParams[e]||[];nt(i,e,t,n,a)},nt=async(e=[],t,n,r,i=[],a)=>{V({type:"点击打印的入参",templateCode:t,templateId:n,formatId:r,printToParam:i},"PRINT-SDK");let l=e.length;const o=async e=>{try{--l<=0&&Ye(e,"print")}catch(e){console.log("error",e)}};ye.showLoading&&et()&&!a||(Ze(!0,r),ye.prevFn("print",{formatId:r,templateId:n}).then((()=>{Pe.curPrintParamList=e;const a={formatId:r,iReportExecuteMode:Pe.iReportExecuteMode,templateId:n,authorizationKey:be.value,printdlgshow:ye.printdlgshow,signature:ye.signature,copies:ye.printCopies,svrUpdateIp:ye.svrUpdateIp};if(V({type:"准备开始打印",queryParams:a,printToParam:i},"PRINT-SDK"),"MULTI"===ye.strategy)for(let t=0;t<e.length;t++){t>0&&(a.printdlgshow="0");const n=JSON.stringify(Object.assign({},JSON.parse(We()),Ne.value,e[t]));he.printDirect({...a,params:n},o,He,$e)}else he.printDirect({...a,params:Xe(e,t)},(e=>{e.params=i,e.templateCode=t,e.templateId=n,Ye(e,"print")}),He,$e)})).catch((()=>{Qe("print"),Ze(!1)})).finally((()=>{Pe.visible=!1})))},rt=async(e,{templateCode:t,templateId:n,key:r},i)=>{const a=Pe.printParams[t];if(a)switch(Pe.isClickOuterPrint=i,Pe.currentFormatId=r,e){case"previewText":(async(e=[],t,n,r)=>{ye.showLoading&&et()||(Ze(!0,r),ye.prevFn("preview",{formatId:r,templateId:n}).then((()=>{Pe.curPrintParamList=e;const i=JSON.stringify(Object.assign({},JSON.parse(We()),Ne.value,e[0])),a="MULTI"===ye.strategy?i:Xe(e,t),l={formatId:r,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,params:a,btnprint:ye.btnprint,signature:ye.signature};he.preview(l,(e=>{Ye(e,"preview")}),He)})).catch((()=>{Qe("preview"),Ze(!1)})).finally((()=>{Pe.visible=!1})))})(a,t,n,r);break;case"formatEditText":((e=[],t,n,r)=>{ye.showLoading&&et()||(Ze(!0,r),ye.prevFn("edit",{formatId:r,templateId:n}).then((()=>{Pe.curPrintParamList=e,Pe.currentFormatId=r,Pe.identityVerification.visible=!0})).catch((()=>{Qe("edit")})).finally((()=>{Ze(!1)})))})(a,0,n,r);break;case"downloadPdf":(async(e=[],t,n,r)=>{ye.showLoading&&et()||(Ze(!0,r),ye.prevFn("download",{formatId:r,templateId:n}).then((()=>{Pe.curPrintParamList=e;const i=JSON.stringify(Object.assign({},JSON.parse(We()),Ne.value,e[0])),a="MULTI"===ye.strategy?i:Xe(e,t),l={formatId:r,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,print:{print:"1",type:"1",resolution:null==ye?void 0:ye.resolution},params:a,signature:ye.signature};he.downloadPDF(l,(e=>Ye(e,"preview")),He)})).catch((()=>{Qe("download"),Ze(!1)})).finally((()=>{Pe.visible=!1})))})(a,t,n,r);break;case"resetPrinter":(async(e=[],t,n,r)=>{if(!ye.showLoading||!et()){Ze(!0,r);try{const e=await he.resetPrinter(r,Pe.iReportExecuteMode);if(Ze(!1),"success"==(null==e?void 0:e.result))return void ge.success(e.message||"重置打印机成功");ge.warning("重置打印机失败")}catch(e){Ze(!1),ge.warning((null==e?void 0:e.message)||"重置打印机失败")}}})(a,0,0,r)}},it=()=>{},at=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},ut(n,t,e))})),n},lt=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},ct(n,t,e))})),n},ot=(e,t,n)=>{const r={};return t.forEach((t=>{let i=((e,t)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let r=t;return Object.keys(n).includes(e.type)&&t&&t instanceof Date&&(r=A(t,n[e.type])),(null==e?void 0:e.defaultValue)||r})(t,e[t[n]]);e[t[n]]&&i&&(r[t[n]]=i)})),r},st=({customizeDataset:e=[],param:t=[]},n={})=>{let r={};return e.forEach((e=>{const t=e.dataSetting[0].selectFieldList;r.datasetData||(r.datasetData={}),r.datasetData[e.name]=JSON.stringify(ot(n,t,"fieldName"))})),r=Object.assign({},r,ot(n,t,"key")),r},ut=(e,t,n)=>{if(t.templateNumbers){for(let r=0;r<t.templateNumbers.length;r++){const i=t.templateNumbers[r],a=n[i];if(!a)return ge.error("当前勾选的数据没有匹配的模板"),e;e[i]||(e[i]=[]),e[i].push(st(a,t))}return e}const r=Object.keys(n);for(let i=0;i<r.length;i++){const a=r[i],l=n[a];if(!l)return ge.error("当前勾选的数据没有匹配的模板"),e;e[a]||(e[a]=[]),e[a].push(st(l,t))}return e},ct=(e,t,n)=>{if(t.templateNumbers){for(let r=0;r<t.templateNumbers.length;r++){const i=t.templateNumbers[r];if(!n[i])return ge.error("当前勾选的数据没有匹配的模板"),e;e[i]||(e[i]=[]),e[i].push(t)}return e}const r=Object.keys(n);for(let i=0;i<r.length;i++){const a=r[i];if(!n[a])return ge.error("当前勾选的数据没有匹配的模板"),e;e[a]||(e[a]=[]),e[a].push(t)}return e},dt=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 r=Object.keys(Re.value),i=Pe.formatList.map((e=>{const t={templateCode:e.number,templateId:e.templateId,label:e.name,key:e.id,selected:!1,isLoading:!1};if(r.includes(e.id)){const n=Re.value[e.id];n&&(t.shortcutLabel=n.shortcutLabel)}return t}));Se.value.unshift(...i),Fe.value&&Se.value.push(...fe),(null==(t=null==(e=ye.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)>0&&(Se.value.forEach((e=>{var t;(null==(t=ye.newPrintSetting)?void 0:t.outerPrintKeys.includes(e.key))&&(e.selected=!0)})),Te.value=Se.value.filter((e=>e.selected))),Le.value=Se.value.filter((e=>!e.selected)),ye.hideButtons.length>0&&(Ie.value=Ie.value.filter((e=>!ye.hideButtons.includes(e.key))));const a=sessionStorage.getItem("portal");if(a){const e=JSON.parse(a),t=(null==(n=null==e?void 0:e.user)?void 0:n.currentRoleResourceObj)||{},r=Object.keys(t);r.includes("RY7.2.21.1.M2.G94181E")||(Ie.value=Ie.value.filter((e=>"downloadPdf"!=e.key))),r.includes("RY7.2.21.1.M2.G33633A")||(Ie.value=Ie.value.filter((e=>"formatEditText"!=e.key))),r.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=at(Pe.templateParams,ye.params),Pe.originParams=lt(Pe.templateParams,ye.params),mt()},pt=async()=>{var e;if(Pe.isInited)return!0;Pe.isInited=!0,Pe.spinning=!0,(()=>{if(he)return!1;he=new U})();const t=await ye.queryPrintFormatByNumber();return await dt(t),(null==(e=t.obj)?void 0:e.length)>0&&(be.value=t.obj[0].authorizationKey||""),Pe.spinning=!1,!0},mt=async()=>{const e=Object.keys(Re.value);if(e.length>0)for(let t=0;t<e.length;t++){const n=e[t],r=Re.value[n],{stop:i,signature:a}=B().register({label:r.code,shortcutSignature:r.shortcutKey,operation:["state","reset"],callback(){"all"==n&&Ae("button");const e=Ue.value.map((e=>e.key)),t=Pe.originParams;if(e.includes(n)){const e=Ue.value.find((e=>e.key==n));if(e){const n=Pe.printParams[null==e?void 0:e.templateCode],r=t[null==e?void 0:e.templateCode]||[];nt(n,e.templateCode,e.templateId,e.key,r)}}}});we.value[n]=i}},vt=async(e=!0)=>{if(await ye.clickPrevFn()){if(!Pe.visible){if(!await pt())return!1}e&&(Pe.visible=!Pe.visible)}},yt=e=>{if(Pe.identityVerification.visible=!1,z(Pe.currentFormatId))return Ye({result:"success",message:""},"edit");const t=JSON.stringify(Object.assign({},JSON.parse(We()),Ne.value,Pe.curPrintParamList[0])),n="MULTI"===ye.strategy?t:Xe(Pe.curPrintParamList,xe.value),r={formatId:Pe.currentFormatId,templateId:Me.value,params:n,token:e};he.editPrintFormat(r,(e=>{Ye(e,"edit")}),He)},ft=(e,t)=>{const n=Te.value[t+1];return t<Te.value.length-1&&!Pe.printParams[e.templateCode]&&Pe.printParams[n.templateCode]};async function gt(){await vt(!1),(()=>{const e=Object.keys(Pe.printParams);Pe.isClickOuterPrint=!1;const t=Pe.originParams;if(1==De.value)for(let n=0;n<e.length;n++){const r=e[n],i=Pe.printParams[r],a=t[r]||[],l=Pe.formatList.filter((e=>e.number==r));l&&l.length>0&&l.forEach((e=>{Pe.currentFormatId=e.id,nt(i,e.number,e.templateId,e.id,a,!0)}))}2==De.value&&Te.value.forEach((e=>{const n=Pe.printParams[e.templateCode],r=t[e.templateCode]||[];Pe.currentFormatId=e.key,nt(n,e.templateCode,e.templateId,e.key,r,!0)}))})()}return a((()=>{Pe.isInited=!1,vt()})),l((()=>{const e=Object.keys(we.value);e.length>0&&e.forEach((e=>{we.value[e]&&we.value[e]()}))})),o((()=>ye.params),(e=>{Object.keys(Pe.templateParams).length>0&&(Pe.printParams=at(Pe.templateParams,ye.params),Pe.originParams=lt(Pe.templateParams,ye.params))}),{deep:!0}),o((()=>{var e;return null==(e=ye.newPrintSetting)?void 0:e.outerPrintKeys}),(async e=>{(null==e?void 0:e.length)>0&&await vt(!1)}),{deep:!0,immediate:!0}),ve({directPrint:gt}),(t,n)=>(s(),u(c,null,[d("div",q,[p(" 外显按钮集合 "),m(v(L),{class:"outButtonGroup"},{default:y((()=>[(s(!0),u(c,null,f(Te.value,((t,n)=>{return s(),g(v(T),{key:t.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:it,options:(r=v(Ie),i=t,Pe.printParams[i.templateCode]?r:[]),onSelect:e=>rt(e,t,!0)},{default:y((()=>[m(v(j),{disabled:!Pe.printParams[t.templateCode],loading:e.showLoading&&t.isLoading,onClick:e=>tt(t.templateCode,t.templateId,t.key,!0),class:h(n==Te.value.length-1?"outerLastButton":ft(t,n)?"isPrintDisabled":"")},{icon:y((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:y((()=>[k(" "+b(t.label)+" ",1),t.shortcutLabel?(s(),u("span",G,b(t.shortcutLabel),1)):p("v-if",!0)])),_:2},1032,["disabled","loading","onClick","class"])])),_:2},1032,["options","onSelect"]);var r,i})),128))])),_:1}),p(" 外显设置按钮 "),Te.value.length>0&&Te.value.length==v(Ue).length&&v(Fe)&&2!=v(De)?(s(),g(v(x),{key:0,trigger:"click","show-arrow":!1,show:Ce.isOutSetting,onClickoutside:n[2]||(n[2]=e=>Ge("isOutSetting"))},{trigger:y((()=>[m(v(j),{class:h(Te.value.length>0?"printAllLeftCls":""),onClick:n[0]||(n[0]=e=>qe("isOutSetting"))},{default:y((()=>[Y,m(v(M),{style:{"margin-left":"8px"},component:v(_),size:"18"},null,8,["component"])])),_:1},8,["class"])])),default:y((()=>[d("div",H,[(s(!0),u(c,null,f(v(Ue),(e=>(s(),u("div",{class:"print-li",key:e.key},[d("div",$,[d("span",Q,b(e.label),1),m(v(E),{checked:e.selected,"onUpdate:checked":t=>e.selected=t},{default:y((()=>[k("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),d("div",W,[m(v(F)),d("div",X,[m(v(j),{type:"primary",size:"small",onClick:Be},{default:y((()=>[k("保存")])),_:1}),v(Ue)&&v(Ue).length>1?(s(),g(v(E),{key:0,checked:v(ze),"onUpdate:checked":n[1]||(n[1]=e=>P(ze)?ze.value=e:null)},{default:y((()=>[k("全选")])),_:1},8,["checked"])):p("v-if",!0)])])])])),_:1},8,["show"])):(s(),u(c,{key:1},[p(" 打印全部按钮 "),m(v(x),{trigger:"click","show-arrow":!1,show:Ce.oneShow,onClickoutside:n[10]||(n[10]=e=>Ge("oneShow"))},{trigger:y((()=>[w(t.$slots,"button",{handleClickPrintBtn:vt,printSpinning:Pe.spinning,printbtnText:e.btnText,printVisible:Pe.visible},(()=>[m(v(L),{class:"newprint-button-component",onClick:n[4]||(n[4]=S((()=>Ae("icon")),["stop"]))},{default:y((()=>[m(v(j),{loading:e.showLoading&&Pe.spinning,onClick:n[3]||(n[3]=S((()=>Ae("button")),["stop"])),class:h(Te.value.length>0?"printAllLeftCls":"")},{icon:y((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:y((()=>[k(" "+b(v(Ee)?"打印全部":e.btnText)+" ",1),v(Je)?(s(),u("span",Z,b(v(Je)),1)):p("v-if",!0)])),_:1},8,["loading","class"]),m(v(j),{class:"icon-select"},{icon:y((()=>[m(v(M),{component:v(D),size:"18"},null,8,["component"])])),_:1})])),_:1})]))])),default:y((()=>[d("div",ee,[(s(!0),u(c,null,f(Le.value,(e=>(s(),u("div",{class:h(["print-li",Oe.oneMouseType==e.key||Oe.oneClickType==e.key?"active":""]),key:e.key,onMouseenter:t=>Ve("oneMouseType",e.key),onMouseleave:n[9]||(n[9]=e=>Ve("oneMouseType","")),onClick:t=>((e,t,n)=>{if(!Pe.printParams[n.templateCode])return[];Ve(e,t)})("oneClickType",e.key,e)},["divider"==e.key?(s(),g(v(F),{key:0})):"outSetting"==e.key?(s(),u(c,{key:1},[p(" 第二层外显设置 "),m(v(x),{trigger:"click","show-arrow":!1,placement:"right-start",show:Ce.isOutSetting,onClickoutside:n[7]||(n[7]=e=>Ge("isOutSetting"))},{trigger:y((()=>[d("div",{class:"print-lite",onClick:n[5]||(n[5]=e=>qe("isOutSetting"))},[d("span",ne,b(e.label),1),m(v(M),{color:Te.value.length>0?"#2563F4":"",component:v(_),size:"18"},null,8,["color","component"])])])),default:y((()=>[d("div",re,[(s(!0),u(c,null,f(v(Ue),(e=>(s(),u("div",{class:"print-li",key:e.key},[d("div",ie,[d("span",ae,b(e.label),1),m(v(E),{checked:e.selected,"onUpdate:checked":t=>e.selected=t},{default:y((()=>[k("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),d("div",le,[m(v(F)),d("div",oe,[m(v(j),{type:"primary",size:"small",onClick:Be},{default:y((()=>[k("保存")])),_:1}),v(Ue)&&v(Ue).length>1?(s(),g(v(E),{key:0,checked:v(ze),"onUpdate:checked":n[6]||(n[6]=e=>P(ze)?ze.value=e:null)},{default:y((()=>[k("全选")])),_:1},8,["checked"])):p("v-if",!0)])])])])),_:2},1032,["show"])],2112)):(s(),u(c,{key:2},[p(" 第二层功能操作 "),d("div",{class:h(["print-lite",Pe.printParams[e.templateCode]?"":"isDisabled"])},[d("span",{class:"label bold",onClick:t=>tt(e.templateCode,e.templateId,e.key,!1)},[k(b(e.label)+" ",1),e.shortcutLabel?(s(),u("span",ue,b(e.shortcutLabel),1)):p("v-if",!0)],8,se),Pe.printParams[e.templateCode]?(s(),g(v(x),{key:0,trigger:"click","show-arrow":!1,placement:"right-start",show:Ce[e.key],onClickoutside:t=>Ge(e.key)},{trigger:y((()=>[m(v(M),{component:v(R),size:"18",onClick:t=>qe(e.key)},null,8,["component","onClick"])])),default:y((()=>[d("div",ce,[(s(!0),u(c,null,f(v(Ie),(t=>(s(),u("div",{class:h(["print-li",Oe.twoMouseType==t.key?"active":""]),key:t.key,onMouseenter:e=>Ve("twoMouseType",t.key),onMouseleave:n[8]||(n[8]=e=>Ve("twoMouseType",""))},[d("div",pe,[d("span",{class:"label",onClick:n=>rt(t.key,e,!1)},b(t.label),9,me)])],42,de)))),128))])])),_:2},1032,["show","onClickoutside"])):p("v-if",!0)],2)],2112))],42,te)))),128))])])),_:3},8,["show"])],2112))]),m(K,I(t.$attrs,{modelValue:Pe.identityVerification.visible,"onUpdate:modelValue":n[11]||(n[11]=e=>Pe.identityVerification.visible=e),formatId:Pe.currentFormatId,templateId:v(Me),onSuccess:yt}),null,16,["modelValue","formatId","templateId"])],64))}});export{ve as default};
|
1
|
+
import{defineComponent as e,inject as t,ref as n,reactive as i,computed as r,onMounted as a,onBeforeUnmount as l,watch as o,openBlock as s,createElementBlock as u,Fragment as c,createElementVNode as d,createCommentVNode as p,createVNode as m,unref as v,withCtx as f,renderList as y,createBlock as g,normalizeClass as h,createTextVNode as k,toDisplayString as b,isRef as P,renderSlot as w,withModifiers as S,mergeProps as I}from"vue";import{isObject as O}from"@vue/shared";import{useMessage as C,NButtonGroup as L,NDropdown as T,NButton as j,NIcon as M,NPopover as x,NCheckbox as E,NDivider as F}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 B}from"../../../shortcut-provider/src/hooks/useShortcuts.js";const G={class:"newprint-button-outer"},q={key:0,class:"newprint-button-outer__shortcut"},Y=d("span",{class:"label bold"},"外显设置",-1),H={class:"newprint-button-poperOver"},$={class:"print-lite"},Q={class:"label bold"},W={class:"print-li"},X={class:"print-lite"},Z={key:0,class:"newprint-button-outer__shortcut"},ee={class:"newprint-button-poperOver"},te=["onMouseenter","onClick"],ne={class:"label bold"},ie={class:"newprint-button-poperOver"},re={class:"print-lite"},ae={class:"label bold"},le={class:"print-li"},oe={class:"print-lite"},se=["onClick"],ue={key:0,class:"newprint-button-outer__shortcut"},ce={class:"newprint-button-poperOver"},de=["onMouseenter"],pe={class:"print-lite"},me=["onClick"];var ve=e({__name:"NewPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number},resolution:{type:Number},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,printAllType:1,isShowOutSetting:!0,customProps:{},outerPrintKeys:[],defaultFormatId:"",shortcut:{}})},svrUpdateIp:{type:String}},setup(e,{expose:ve}){const fe=e,ye=String(navigator.platform).toLowerCase().includes("linux"),ge=[{label:"分割线",key:"divider"},{label:"外显设置",key:"outSetting"}],he=C();let ke;const be=t(J),Pe=n(""),we=i({spinning:!1,visible:!1,formatList:[],templateParams:[],printParams:[],originParams:{},currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1,curPrintParamList:[],iReportExecuteMode:1}),Se=n({});let Ie=n([]),Oe=n([{label:fe.previewText,key:"previewText"},{label:fe.pdfLoadText,key:"downloadPdf"},{label:fe.formatEditText,key:"formatEditText"},{label:"重置打印机",key:"resetPrinter"}]);const Ce=i({oneMouseType:"",oneClickType:"",twoMouseType:""}),Le=i({oneShow:!1,isOperation:!1,isOutSetting:!1}),Te=n([]),je=n([]),Me=r((()=>{if(!we.currentFormatId)return{};let e=we.currentFormatId;return we.formatList.find((t=>t.id===e))}));r((()=>{var e;return(null==(e=Me.value)?void 0:e.name)||"格式选择"}));const xe=r((()=>{let e=we.formatList.find((e=>e.id===we.currentFormatId));return null==e?void 0:e.templateId})),Ee=r((()=>{let e=we.formatList.find((e=>e.id===we.currentFormatId));return null==e?void 0:e.number})),Fe=r((()=>{var e;return null==(e=fe.newPrintSetting)?void 0:e.isShowPrintAll})),Ne=r((()=>{var e;return null==(e=fe.newPrintSetting)?void 0:e.isShowOutSetting})),_e=r((()=>{var e;return(null==(e=fe.newPrintSetting)?void 0:e.customProps)||{}})),De=r((()=>{var e;return(null==(e=fe.newPrintSetting)?void 0:e.defaultFormatId)||""})),Re=r((()=>{var e;return(null==(e=fe.newPrintSetting)?void 0:e.printAllType)||1})),Je=r((()=>{var e;return(null==(e=fe.newPrintSetting)?void 0:e.shortcut)||{}})),Ue=r((()=>{var e,t;const n=Object.keys(Je.value);if(n.length>0){if(De.value&&n.includes(De.value))return(null==(e=Je.value[De.value])?void 0:e.shortcutLabel)||"";if(n.includes("all"))return(null==(t=Je.value.all)?void 0:t.shortcutLabel)||""}return""})),ze=r((()=>{const e=ge.map((e=>e.key));return Ie.value.filter((t=>!e.includes(t.key)))})),Ae=r({get:()=>ze.value.every((e=>e.selected)),set(e){ze.value.forEach((t=>{t.selected=e}))}}),Ke=async()=>{var e,t;(null==(t=null==(e=fe.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)||await yt(),Le.oneShow=!0},Ve=async e=>{if(fe.directPrint){if(we.spinning)return;return"button"===e?void(Fe.value?await kt():De.value?async function(e){await yt(!1);const t=Te.value.find((t=>t.key==e));t&&it(t.templateCode,t.templateId,t.key,!1)}(De.value):Ke()):Ke()}return Ke()},Be=(e,t)=>we.printParams[t.templateCode]?z(t.key)&&(ye||2==we.iReportExecuteMode)?e.filter((e=>"formatEditText"!=e.key)):e:[],Ge=(e,t)=>{Ce[e]=t},qe=()=>{Te.value=Ie.value.filter((e=>!e.selected)),je.value=ze.value.filter((e=>e.selected)),He("oneShow"),He("isOutSetting"),be("saveOuterPrint",je.value)},Ye=e=>{Le[e]=!0},He=e=>{Ce.oneClickType="",Le[e]=!1,"isOutSetting"==e&&(Le.isOutSetting=!1)},$e=(e,t)=>{tt(!1);let n={type:t,formatId:we.currentFormatId,templateId:(null==e?void 0:e.templateId)||xe.value,templateCode:(null==e?void 0:e.templateCode)||Ee.value};V({type:"进入成功的回调",info:n},"PRINT-SDK"),be("success",e,n)},Qe=e=>{tt(!1),V({type:"进入失败的回调",res:e},"PRINT-SDK"),be("error",e),O(e)&&"notInstalledApp"===e.type&&he.error(e.message)},We=e=>{tt(!1),be("cancel",e)},Xe=e=>{be("error",{message:"前置条件执行错误",type:e,preExecution:!0})},Ze=()=>JSON.stringify({...fe.token?{token:fe.token}:{}}),et=(e=[],t)=>{var n,i;let r={},a={};if((null==(n=we.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]))));a={datasetData:{}},a.datasetData[t]=n}else Object.keys(e[0]).forEach((t=>{a[t]=[],e.forEach((e=>{a[t].includes(e[t])||a[t].push(e[t])})),a[t]=a[t].join(",")}));return r=Object.assign({},JSON.parse(Ze()),_e.value,a),JSON.stringify(r)},tt=(e,t)=>{if(we.isClickOuterPrint){if(e&&t){const n=je.value.find((e=>e.key==t));return void(n&&(n.isLoading=e))}je.value.forEach((e=>{e.isLoading=!1}))}else we.spinning=e},nt=()=>we.isClickOuterPrint?je.value.some((e=>e.isLoading)):we.spinning,it=(e,t,n,i)=>{const r=we.printParams[e];if(!r)return;we.isClickOuterPrint=i,we.currentFormatId=n;const a=we.originParams[e]||[];rt(r,e,t,n,a)},rt=async(e=[],t,n,i,r=[],a)=>{let l=e.length;const o=async e=>{try{--l<=0&&$e(e,"print")}catch(e){console.log("error",e)}};fe.showLoading&&nt()&&!a||(tt(!0,i),fe.prevFn("print",{formatId:i,templateId:n}).then((()=>{we.curPrintParamList=e;const a={formatId:i,iReportExecuteMode:we.iReportExecuteMode,templateId:n,authorizationKey:Pe.value,printdlgshow:fe.printdlgshow,signature:fe.signature,copies:fe.printCopies,svrUpdateIp:fe.svrUpdateIp};if("MULTI"===fe.strategy)for(let t=0;t<e.length;t++){t>0&&(a.printdlgshow="0");const n=JSON.stringify(Object.assign({},JSON.parse(Ze()),_e.value,e[t]));ke.printDirect({...a,params:n},o,Qe,We)}else ke.printDirect({...a,params:et(e,t)},(e=>{e.params=r,e.templateCode=t,e.templateId=n,$e(e,"print")}),Qe,We)})).catch((()=>{Xe("print"),tt(!1)})).finally((()=>{we.visible=!1})))},at=async(e,{templateCode:t,templateId:n,key:i},r)=>{const a=we.printParams[t];if(a)switch(we.isClickOuterPrint=r,we.currentFormatId=i,e){case"previewText":(async(e=[],t,n,i)=>{fe.showLoading&&nt()||(tt(!0,i),fe.prevFn("preview",{formatId:i,templateId:n}).then((()=>{we.curPrintParamList=e;const r=JSON.stringify(Object.assign({},JSON.parse(Ze()),_e.value,e[0])),a="MULTI"===fe.strategy?r:et(e,t),l={formatId:i,templateId:n,iReportExecuteMode:we.iReportExecuteMode,authorizationKey:Pe.value,params:a,btnprint:fe.btnprint,signature:fe.signature};ke.preview(l,(e=>{$e(e,"preview")}),Qe)})).catch((()=>{Xe("preview"),tt(!1)})).finally((()=>{we.visible=!1})))})(a,t,n,i);break;case"formatEditText":((e=[],t,n,i)=>{fe.showLoading&&nt()||(tt(!0,i),fe.prevFn("edit",{formatId:i,templateId:n}).then((()=>{we.curPrintParamList=e,we.currentFormatId=i,we.identityVerification.visible=!0})).catch((()=>{Xe("edit")})).finally((()=>{tt(!1)})))})(a,0,n,i);break;case"downloadPdf":(async(e=[],t,n,i)=>{fe.showLoading&&nt()||(tt(!0,i),fe.prevFn("download",{formatId:i,templateId:n}).then((()=>{we.curPrintParamList=e;const r=JSON.stringify(Object.assign({},JSON.parse(Ze()),_e.value,e[0])),a="MULTI"===fe.strategy?r:et(e,t),l={formatId:i,templateId:n,iReportExecuteMode:we.iReportExecuteMode,authorizationKey:Pe.value,print:{print:"1",type:"1",resolution:null==fe?void 0:fe.resolution},params:a,signature:fe.signature};ke.downloadPDF(l,(e=>$e(e,"preview")),Qe)})).catch((()=>{Xe("download"),tt(!1)})).finally((()=>{we.visible=!1})))})(a,t,n,i);break;case"resetPrinter":(async(e=[],t,n,i)=>{if(!fe.showLoading||!nt()){tt(!0,i);try{const e=await ke.resetPrinter(i,we.iReportExecuteMode);if(tt(!1),"success"==(null==e?void 0:e.result))return void he.success(e.message||"重置打印机成功");he.warning("重置打印机失败")}catch(e){tt(!1),he.warning((null==e?void 0:e.message)||"重置打印机失败")}}})(a,0,0,i)}},lt=()=>{},ot=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},dt(n,t,e))})),n},st=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},pt(n,t,e))})),n},ut=(e,t,n)=>{const i={};return t.forEach((t=>{let r=((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]]&&r&&(i[t[n]]=r)})),i},ct=({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(ut(n,t,"fieldName"))})),i=Object.assign({},i,ut(n,t,"key")),i},dt=(e,t,n)=>{if(t.templateNumbers){for(let i=0;i<t.templateNumbers.length;i++){const r=t.templateNumbers[i],a=n[r];if(!a)return e;e[r]||(e[r]=[]),e[r].push(ct(a,t))}return e}const i=Object.keys(n);for(let r=0;r<i.length;r++){const a=i[r],l=n[a];if(!l)return e;e[a]||(e[a]=[]),e[a].push(ct(l,t))}return e},pt=(e,t,n)=>{if(t.templateNumbers){for(let i=0;i<t.templateNumbers.length;i++){const r=t.templateNumbers[i];if(!n[r])return e;e[r]||(e[r]=[]),e[r].push(t)}return e}const i=Object.keys(n);for(let r=0;r<i.length;r++){const a=i[r];if(!n[a])return e;e[a]||(e[a]=[]),e[a].push(t)}return e},mt=async e=>{var t;we.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):[],we.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(Je.value),r=we.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=Je.value[e.id];n&&(t.shortcutLabel=n.shortcutLabel)}return t}));Ie.value.unshift(...r),Ne.value&&Ie.value.push(...ge),(null==(t=null==(e=fe.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)>0&&(Ie.value.forEach((e=>{var t;(null==(t=fe.newPrintSetting)?void 0:t.outerPrintKeys.includes(e.key))&&(e.selected=!0)})),je.value=Ie.value.filter((e=>e.selected))),Te.value=Ie.value.filter((e=>!e.selected)),fe.hideButtons.length>0&&(Oe.value=Oe.value.filter((e=>!fe.hideButtons.includes(e.key))));const a=sessionStorage.getItem("portal");if(a){const e=JSON.parse(a),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)))}})(),we.templateParams=(e=>{let t={};return e&&e.forEach((e=>{if(!e.templateConfig)return!1;t[e.number]=e.templateConfig})),t})(e.obj),we.printParams=ot(we.templateParams,fe.params),we.originParams=st(we.templateParams,fe.params),ft()},vt=async()=>{var e;if(we.isInited)return!0;we.isInited=!0,we.spinning=!0,(()=>{if(ke)return!1;ke=new U})();const t=await fe.queryPrintFormatByNumber();return await mt(t),(null==(e=t.obj)?void 0:e.length)>0&&(Pe.value=t.obj[0].authorizationKey||""),we.spinning=!1,!0},ft=async()=>{const e=Object.keys(Je.value);if(e.length>0)for(let t=0;t<e.length;t++){const n=e[t],i=Je.value[n],{stop:r,signature:a}=B().register({label:i.code,shortcutSignature:i.shortcutKey,operation:["state","reset"],callback(){"all"==n&&Ve("button");const e=ze.value.map((e=>e.key)),t=we.originParams;if(e.includes(n)){const e=ze.value.find((e=>e.key==n));if(e){const n=we.printParams[null==e?void 0:e.templateCode],i=t[null==e?void 0:e.templateCode]||[];rt(n,e.templateCode,e.templateId,e.key,i)}}}});Se.value[n]=r}},yt=async(e=!0)=>{if(await fe.clickPrevFn()){if(!we.visible){if(!await vt())return!1}e&&(we.visible=!we.visible)}},gt=e=>{if(we.identityVerification.visible=!1,z(we.currentFormatId))return $e({result:"success",message:""},"edit");const t=JSON.stringify(Object.assign({},JSON.parse(Ze()),_e.value,we.curPrintParamList[0])),n="MULTI"===fe.strategy?t:et(we.curPrintParamList,Ee.value),i={formatId:we.currentFormatId,templateId:xe.value,params:n,token:e};ke.editPrintFormat(i,(e=>{$e(e,"edit")}),Qe)},ht=(e,t)=>{const n=je.value[t+1];return t<je.value.length-1&&!we.printParams[e.templateCode]&&we.printParams[n.templateCode]};async function kt(){await yt(!1),(()=>{const e=Object.keys(we.printParams);we.isClickOuterPrint=!1;const t=we.originParams;if(1==Re.value)for(let n=0;n<e.length;n++){const i=e[n],r=we.printParams[i],a=t[i]||[],l=we.formatList.filter((e=>e.number==i));l&&l.length>0&&l.forEach((e=>{we.currentFormatId=e.id,rt(r,e.number,e.templateId,e.id,a,!0)}))}2==Re.value&&je.value.forEach((e=>{const n=we.printParams[e.templateCode],i=t[e.templateCode]||[];we.currentFormatId=e.key,rt(n,e.templateCode,e.templateId,e.key,i,!0)}))})()}return a((()=>{we.isInited=!1,yt()})),l((()=>{const e=Object.keys(Se.value);e.length>0&&e.forEach((e=>{Se.value[e]&&Se.value[e]()}))})),o((()=>fe.params),(e=>{Object.keys(we.templateParams).length>0&&(we.printParams=ot(we.templateParams,fe.params),we.originParams=st(we.templateParams,fe.params))}),{deep:!0}),o((()=>{var e;return null==(e=fe.newPrintSetting)?void 0:e.outerPrintKeys}),(async e=>{(null==e?void 0:e.length)>0&&await yt(!1)}),{deep:!0,immediate:!0}),ve({directPrint:kt}),(t,n)=>(s(),u(c,null,[d("div",G,[p(" 外显按钮集合 "),m(v(L),{class:"outButtonGroup"},{default:f((()=>[(s(!0),u(c,null,y(je.value,((t,n)=>(s(),g(v(T),{key:t.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:lt,options:Be(v(Oe),t),onSelect:e=>at(e,t,!0)},{default:f((()=>[m(v(j),{disabled:!we.printParams[t.templateCode],loading:e.showLoading&&t.isLoading,onClick:e=>it(t.templateCode,t.templateId,t.key,!0),class:h(n==je.value.length-1?"outerLastButton":ht(t,n)?"isPrintDisabled":"")},{icon:f((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:f((()=>[k(" "+b(t.label)+" ",1),t.shortcutLabel?(s(),u("span",q,b(t.shortcutLabel),1)):p("v-if",!0)])),_:2},1032,["disabled","loading","onClick","class"])])),_:2},1032,["options","onSelect"])))),128))])),_:1}),p(" 外显设置按钮 "),je.value.length>0&&je.value.length==v(ze).length&&v(Ne)&&2!=v(Re)?(s(),g(v(x),{key:0,trigger:"click","show-arrow":!1,show:Le.isOutSetting,onClickoutside:n[2]||(n[2]=e=>He("isOutSetting"))},{trigger:f((()=>[m(v(j),{class:h(je.value.length>0?"printAllLeftCls":""),onClick:n[0]||(n[0]=e=>Ye("isOutSetting"))},{default:f((()=>[Y,m(v(M),{style:{"margin-left":"8px"},component:v(_),size:"18"},null,8,["component"])])),_:1},8,["class"])])),default:f((()=>[d("div",H,[(s(!0),u(c,null,y(v(ze),(e=>(s(),u("div",{class:"print-li",key:e.key},[d("div",$,[d("span",Q,b(e.label),1),m(v(E),{checked:e.selected,"onUpdate:checked":t=>e.selected=t},{default:f((()=>[k("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),d("div",W,[m(v(F)),d("div",X,[m(v(j),{type:"primary",size:"small",onClick:qe},{default:f((()=>[k("保存")])),_:1}),v(ze)&&v(ze).length>1?(s(),g(v(E),{key:0,checked:v(Ae),"onUpdate:checked":n[1]||(n[1]=e=>P(Ae)?Ae.value=e:null)},{default:f((()=>[k("全选")])),_:1},8,["checked"])):p("v-if",!0)])])])])),_:1},8,["show"])):(s(),u(c,{key:1},[p(" 打印全部按钮 "),m(v(x),{trigger:"click","show-arrow":!1,show:Le.oneShow,onClickoutside:n[10]||(n[10]=e=>He("oneShow"))},{trigger:f((()=>[w(t.$slots,"button",{handleClickPrintBtn:yt,printSpinning:we.spinning,printbtnText:e.btnText,printVisible:we.visible},(()=>[m(v(L),{class:"newprint-button-component",onClick:n[4]||(n[4]=S((()=>Ve("icon")),["stop"]))},{default:f((()=>[m(v(j),{loading:e.showLoading&&we.spinning,onClick:n[3]||(n[3]=S((()=>Ve("button")),["stop"])),class:h(je.value.length>0?"printAllLeftCls":"")},{icon:f((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:f((()=>[k(" "+b(v(Fe)?"打印全部":e.btnText)+" ",1),v(Ue)?(s(),u("span",Z,b(v(Ue)),1)):p("v-if",!0)])),_:1},8,["loading","class"]),m(v(j),{class:"icon-select"},{icon:f((()=>[m(v(M),{component:v(D),size:"18"},null,8,["component"])])),_:1})])),_:1})]))])),default:f((()=>[d("div",ee,[(s(!0),u(c,null,y(Te.value,(e=>(s(),u("div",{class:h(["print-li",Ce.oneMouseType==e.key||Ce.oneClickType==e.key?"active":""]),key:e.key,onMouseenter:t=>Ge("oneMouseType",e.key),onMouseleave:n[9]||(n[9]=e=>Ge("oneMouseType","")),onClick:t=>((e,t,n)=>{if(!we.printParams[n.templateCode])return[];Ge(e,t)})("oneClickType",e.key,e)},["divider"==e.key?(s(),g(v(F),{key:0})):"outSetting"==e.key?(s(),u(c,{key:1},[p(" 第二层外显设置 "),m(v(x),{trigger:"click","show-arrow":!1,placement:"right-start",show:Le.isOutSetting,onClickoutside:n[7]||(n[7]=e=>He("isOutSetting"))},{trigger:f((()=>[d("div",{class:"print-lite",onClick:n[5]||(n[5]=e=>Ye("isOutSetting"))},[d("span",ne,b(e.label),1),m(v(M),{color:je.value.length>0?"#2563F4":"",component:v(_),size:"18"},null,8,["color","component"])])])),default:f((()=>[d("div",ie,[(s(!0),u(c,null,y(v(ze),(e=>(s(),u("div",{class:"print-li",key:e.key},[d("div",re,[d("span",ae,b(e.label),1),m(v(E),{checked:e.selected,"onUpdate:checked":t=>e.selected=t},{default:f((()=>[k("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),d("div",le,[m(v(F)),d("div",oe,[m(v(j),{type:"primary",size:"small",onClick:qe},{default:f((()=>[k("保存")])),_:1}),v(ze)&&v(ze).length>1?(s(),g(v(E),{key:0,checked:v(Ae),"onUpdate:checked":n[6]||(n[6]=e=>P(Ae)?Ae.value=e:null)},{default:f((()=>[k("全选")])),_:1},8,["checked"])):p("v-if",!0)])])])])),_:2},1032,["show"])],2112)):(s(),u(c,{key:2},[p(" 第二层功能操作 "),d("div",{class:h(["print-lite",we.printParams[e.templateCode]?"":"isDisabled"])},[d("span",{class:"label bold",onClick:t=>it(e.templateCode,e.templateId,e.key,!1)},[k(b(e.label)+" ",1),e.shortcutLabel?(s(),u("span",ue,b(e.shortcutLabel),1)):p("v-if",!0)],8,se),we.printParams[e.templateCode]?(s(),g(v(x),{key:0,trigger:"click","show-arrow":!1,placement:"right-start",show:Le[e.key],onClickoutside:t=>He(e.key)},{trigger:f((()=>[m(v(M),{component:v(R),size:"18",onClick:t=>Ye(e.key)},null,8,["component","onClick"])])),default:f((()=>[d("div",ce,[(s(!0),u(c,null,y(Be(v(Oe),e),(t=>(s(),u("div",{class:h(["print-li",Ce.twoMouseType==t.key?"active":""]),key:t.key,onMouseenter:e=>Ge("twoMouseType",t.key),onMouseleave:n[8]||(n[8]=e=>Ge("twoMouseType",""))},[d("div",pe,[d("span",{class:"label",onClick:n=>at(t.key,e,!1)},b(t.label),9,me)])],42,de)))),128))])])),_:2},1032,["show","onClickoutside"])):p("v-if",!0)],2)],2112))],42,te)))),128))])])),_:3},8,["show"])],2112))]),m(A,I(t.$attrs,{modelValue:we.identityVerification.visible,"onUpdate:modelValue":n[11]||(n[11]=e=>we.identityVerification.visible=e),formatId:we.currentFormatId,templateId:v(xe),onSuccess:gt}),null,16,["modelValue","formatId","templateId"])],64))}});export{ve as default};
|
@@ -118,6 +118,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
118
118
|
printInstance: Print | null;
|
119
119
|
downloadPdfCode: string;
|
120
120
|
formatEditTextCode: string;
|
121
|
+
isDomestic: boolean;
|
121
122
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
122
123
|
printParams: {
|
123
124
|
type: PropType<AnyObject[]>;
|
@@ -246,6 +247,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
246
247
|
iReportExecuteMode: number;
|
247
248
|
};
|
248
249
|
options: import("vue").Ref<AnyObject[]>;
|
250
|
+
tempOptions: import("vue").Ref<AnyObject[]>;
|
249
251
|
currentFormatItem: import("vue").ComputedRef<{} | undefined>;
|
250
252
|
formatTitle: import("vue").ComputedRef<any>;
|
251
253
|
getTemplateIdByFormatId: import("vue").ComputedRef<any>;
|
@@ -1 +1 @@
|
|
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};
|
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 x}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as k}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 M}from"date-fns";import{savePrivateFormatApi as j,getPrivateFormatApi as O}from"../api.js";import{cloneDeep as L}from"lodash";var R=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:R}){var D;const C=t,N=e(),V=h();let U;const B=String(navigator.platform).toLowerCase().includes("linux"),z=n(k),A={},J=r(""),q=i({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,iReportExecuteMode:1});let K=r([{label:C.printText,key:"printText"},{label:C.previewText,key:"previewText"},{label:C.pdfLoadText,key:"downloadPdf"},{label:C.formatEditText,key:"formatEditText"},...(null==(D=C.externalOptionConfig)?void 0:D.options)||[]]);const _=r([]),G=a((()=>{if(!q.currentFormatId)return{};let t=q.currentFormatId;return q.formatList.find((e=>e.id===t))})),H=a((()=>{var t;return(null==(t=G.value)?void 0:t.name)||"格式选择"})),Y=a((()=>{let t=q.formatList.find((t=>t.id===q.currentFormatId));return null==t?void 0:t.templateId})),$=async t=>{if(C.directPrint){if(q.spinning)return;return"button"===t?void await ft():ut()}return ut()},Q=t=>u("span",{class:{active:t.key===q.currentFormatId}},[t.label]),W=(t,e)=>{q.spinning=!1;let n={type:e,formatId:q.currentFormatId,templateId:Y.value};z("success",t,n)},X=t=>{q.spinning=!1,z("error",t),I(t)&&"notInstalledApp"===t.type&&V.error(t.message)},Z=t=>{q.spinning=!1,z("cancel",t)},tt=t=>{z("error",{message:"前置条件执行错误",type:t,preExecution:!0})},et=(t=0)=>{var e;const n=(null==(e=C.printParams)?void 0:e.length)?C.printParams[t]:q.printParams[t];return JSON.stringify({...n||{},...C.token?{token:C.token}:{},...C.printCustomProps||{}})},nt=()=>{var t,e;let n={},r={};if(null==(t=q.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(q.printParams[0].datasetData||{}))?void 0:e[0])||"",n=JSON.stringify(q.printParams.map((e=>JSON.parse(e.datasetData[t]))));r={datasetData:{}},r.datasetData[t]=n}else Object.keys(q.printParams[0]).forEach((t=>{r[t]=[],q.printParams.forEach((e=>{r[t].includes(e[t])||r[t].push(e[t])})),r[t]=r[t].join(",")}));return n=Object.assign({},JSON.parse(et(0)),r),JSON.stringify(n)},rt=((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=q.printParams.length;const e=async e=>{try{--t<=0&&W(e,"print")}catch(t){console.log("error",t)}};C.showLoading&&q.spinning||(q.spinning=!0,C.prevFn("print",{formatId:q.currentFormatId,templateId:Y.value}).then((()=>{const t={iReportExecuteMode:q.iReportExecuteMode,formatId:q.currentFormatId,templateId:Y.value,authorizationKey:J.value,printdlgshow:C.printdlgshow,signature:C.signature,copies:C.printCopies,svrUpdateIp:C.svrUpdateIp};if("MULTI"===C.strategy)for(let n=0;n<q.printParams.length;n++)n>0&&(t.printdlgshow="0"),U.printDirect({...t,params:et(n)},e,X,Z);else U.printDirect({...t,params:nt()},(t=>{W(t,"print")}),X,Z)})).catch((()=>{tt("print"),q.spinning=!1})).finally((()=>{q.visible=!1})))}),800,!0),it=async(t,e)=>{var n,r;switch(t){case"printText":rt();break;case"previewText":(async()=>{C.showLoading&&q.spinning||(q.spinning=!0,C.prevFn("preview",{formatId:q.currentFormatId,templateId:Y.value}).then((()=>{const t="MULTI"===C.strategy?et():nt(),e={formatId:q.currentFormatId,iReportExecuteMode:q.iReportExecuteMode,templateId:Y.value,authorizationKey:J.value,params:t,btnprint:C.btnprint,signature:C.signature};U.preview(e,(t=>{W(t,"preview")}),X)})).catch((()=>{tt("preview"),q.spinning=!1})).finally((()=>{q.visible=!1})))})();break;case"formatEditText":C.showLoading&&q.spinning||(q.spinning=!0,C.prevFn("edit",{formatId:q.currentFormatId,templateId:Y.value}).then((()=>{q.identityVerification.visible=!0})).catch((()=>{tt("edit")})).finally((()=>{q.visible=!1,q.spinning=!1})));break;case"downloadPdf":(async()=>{C.showLoading&&q.spinning||(q.spinning=!0,C.prevFn("download",{formatId:q.currentFormatId,templateId:Y.value}).then((()=>{const t="MULTI"===C.strategy?et():nt(),e={formatId:q.currentFormatId,iReportExecuteMode:q.iReportExecuteMode,templateId:Y.value,authorizationKey:J.value,print:{print:"1",type:"1",resolution:null==C?void 0:C.resolution},params:t,signature:C.signature};U.downloadPDF(e,(t=>W(t,"preview")),X)})).catch((()=>{tt("download"),q.spinning=!1})).finally((()=>{q.visible=!1})))})();break;default:{q.visible=!1;const i=q.formatList.find((e=>e.id===t))||{};if(Object.keys(i).length>0){S(t)&&(B||2==q.iReportExecuteMode)?K.value=_.value.filter((t=>"formatEditText"!=t.key)):K.value=_.value,q.currentFormatId=t;const[e]=K.value;e.label=(null==i?void 0:i.name)||e.label,await j({formatForms:[{...i}],name:A.name||i.templateName,number:A.number||i.number,templateId:A.templateId||i.templateId,...A.id?{id:A.id}:{}},{token:C.token})}else null==(r=null==(n=C.externalOptionConfig)?void 0:n.onSelect)||r.call(n,t,e);break}}},at=()=>{q.visible=!1,z("clickoutside")},ot=()=>(q.isInited=!1,q.spinning=!1,setTimeout((()=>{q.visible=!1}),0),!1),lt=(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=M(e,n[t.type])),(null==t?void 0:t.defaultValue)||r})(e,t[e[n]]);t[e[n]]&&i&&(r[e[n]]=i)})),r},st=({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(lt(n,e,"fieldName"))}})),r=Object.assign({},r,lt(n,e,"key")),r})),pt=async t=>{var e,n;if(q.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):[],q.iReportExecuteMode=(null==(e=null==t?void 0:t.obj)?void 0:e.length)>0&&t.obj[0].iReportExecuteMode||1,q.currentFormatId=await(async(t,e)=>{var n;if(!(null==t?void 0:t.length))return"";if(!N.isDoc){const{data:e}=await O({templateId:t[0].templateId},{token:C.token});if("SUCCESS"===e.result){const{formatForms:r=[]}=e.map||{};Object.assign(A,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})(q.formatList,"defaultFlag"),!q.currentFormatId)return K.value=[],V.error(C.noDefaultFormatMsg),ot();(()=>{var t;const e=q.formatList.map((t=>({label:t.name,key:t.id})));K.value.unshift({label:H.value,key:"format",children:e}),C.hideButtons.length>0&&(K.value=K.value.filter((t=>!C.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")||(K.value=K.value.filter((t=>"downloadPdf"!=t.key))),i.includes("RY7.2.21.1.M2.G33633A")||(K.value=K.value.filter((t=>"formatEditText"!=t.key)))}_.value=L(K.value),S(q.currentFormatId)&&(B||2==q.iReportExecuteMode)&&(K.value=_.value.filter((t=>"formatEditText"!=t.key)))})();let r=null==(n=await C.queryTemplateParams())?void 0:n.obj;if(!r||!Y.value)return V.error("获取打印模板失败,请联系管理员!"),ot();q.templateParams=r,q.printParams=st(q.templateParams,C.params)},dt=async()=>{var t;if(q.isInited)return!0;q.isInited=!0,q.spinning=!0,(()=>{if(U)return!1;U=new T})();const e=await C.queryPrintFormatByNumber();return await pt(e),(null==(t=e.obj)?void 0:t.length)>0&&(J.value=e.obj[0].authorizationKey||""),q.spinning=!1,!0},ut=async(t=!0)=>{var e,n;if(await C.clickPrevFn())if((null==(e=C.params)?void 0:e.length)||(null==(n=C.printParams)?void 0:n.length)){if(!q.visible){if(!await dt())return!1}t&&(q.visible=!q.visible)}else V.warning(C.noDataMsg)},mt=()=>{q.watchPrintParamsReformatFn&&q.watchPrintParamsReformatFn(),q.isInited?q.printParams=st(q.templateParams,C.params):q.watchPrintParamsReformatFn=()=>l((()=>q.isInited),(t=>{if(!t)return!1;mt()}))},ct=t=>{if(q.identityVerification.visible=!1,S(q.currentFormatId))return W(null,"edit");const e={formatId:q.currentFormatId,templateId:Y.value,params:et(),token:t};U.editPrintFormat(e,(t=>{W(t,"edit")}),X)};async function ft(){await ut(!1),rt()}return o((()=>{q.isInited=!1})),l((()=>C.params),(t=>{if(!(null==t?void 0:t.length))return!1;mt()}),{deep:!0}),R({directPrint:ft}),(e,n)=>(s(),p(d,null,[u(m(P),{class:"c-dropdown",placement:t.placement,trigger:"click",show:q.visible,onClickoutside:at,options:m(K),onSelect:it,"render-label":Q},{default:c((()=>[f(e.$slots,"button",{handleClickPrintBtn:ut,printSpinning:q.spinning,printbtnText:t.btnText,printVisible:q.visible},(()=>[u(m(w),{class:"dropdown-button",loading:t.showLoading&&q.spinning,onClick:n[1]||(n[1]=v((()=>$("button")),["stop"]))},{default:c((()=>[y(g(t.btnText)+" ",1),u(m(F),{component:m(x),size:"18",style:{"margin-left":"5px"},onClick:n[0]||(n[0]=v((()=>$("icon")),["stop"]))},null,8,["component"])])),_:1},8,["loading"])]))])),_:3},8,["placement","show","options"]),u(E,b(m(N),{modelValue:q.identityVerification.visible,"onUpdate:modelValue":n[2]||(n[2]=t=>q.identityVerification.visible=t),formatId:q.currentFormatId,templateId:m(Y),onSuccess:ct}),null,16,["modelValue","formatId","templateId"])],64))}});export{R as default};
|
@@ -4236,6 +4236,8 @@ export declare const CallbackMaps: Map<string, {
|
|
4236
4236
|
stickyFixedConfig?: {
|
4237
4237
|
enable?: boolean | undefined;
|
4238
4238
|
} | undefined;
|
4239
|
+
tableRowHeight?: string | number | undefined;
|
4240
|
+
tableHeaderRowHeight?: string | number | undefined;
|
4239
4241
|
onFormChange?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
|
4240
4242
|
onScroll?: ((params: import("vxe-table").VxeTableDefines.ScrollEventParams) => void) | undefined;
|
4241
4243
|
onKeydown?: ((params: import("vxe-table").VxeTableDefines.KeydownEventParams) => void) | undefined;
|
@@ -7812,6 +7814,8 @@ export declare const CallbackMaps: Map<string, {
|
|
7812
7814
|
stickyFixedConfig?: {
|
7813
7815
|
enable?: boolean | undefined;
|
7814
7816
|
} | undefined;
|
7817
|
+
tableRowHeight?: string | number | undefined;
|
7818
|
+
tableHeaderRowHeight?: string | number | undefined;
|
7815
7819
|
onFormChange?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
|
7816
7820
|
onSettingClick?: (() => void) | undefined;
|
7817
7821
|
onFormClick?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,drawArrow as n,drawPoint as i,defaultStyle as o,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as h,drawScaleLine as f}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as m,getTime as v,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k,last as b,range as x}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as w}from"date-fns";import"naive-ui";import"@vueuse/core";function S(S,C,j,P,I){const{computedX:E,computedY:T,getXValue:X,getYValue:A}=u(C),{getEqualXTypes:L,handleAddPrevent:Y,isGridLimit:M,setPrevAndNextPoint:H,getPointEventProps:z}=p(S,j,C),{xAxis:G,grid:W,originX:D,originY:N,xCellWidth:O,endY:R,startTime:V,leftAddAreaWidth:B,leftScales:F,rightScales:$,yCellHeight:q,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:_,originYCervix:tt,other:et,canvasHeight:nt,scalebarBorder:it}=C,ot=k(K),rt=new Set;function lt(){ot.filter((({showData:t=!0})=>t)).forEach(((t,s)=>{var a;const c=[],u=[],d=[];null==(a=t.data)||a.forEach(((a,h)=>{!function(a,h,f){let p,g;const{pointAttr:m={},lineAttr:v={},title:y="",key:k,type:b="circle",childbirthStyle:x={}}=t,w=t.data[f+1],C=dt(w,t);if(a&&C&&!h.breakpoint)g=e([...a,...C],{...v});else if(a&&!C&&!h.breakpoint){const n=dt(w,t);g=n?e([...a,...n],{...v}):null}let I,E;if(h.childbirth){const{type:t="arrow",style:e={}}=x;if("arrow"===t){const t=a[1]+q;I=n([a[0],a[1],t],e)}else I=i(t,{left:a[0],top:a[1],...e,...o,hoverCursor:"default"});E=r([a[0]+O/2,a[1]+q/2],{value:String(h.childbirth),...l,originX:"left",originY:"center",fill:e.stroke||e.fill,fontSize:e.fontSize||l.fontSize}),I&&d.push(I),d.push(E)}const T=u[f-1],L={origin:{data:h,title:y,key:k||"",dataIndex:s,index:f},leftLine:T,rightLine:g,childbirthIcon:I,childbirthText:E,...m,...z()};a&&(T||(L.leftLine=null),p=i(b,{left:a[0],top:a[1],...L}));u.push(g),p&&(!function(t){_.hovered&&(t.on("mouseover",(()=>{ut(t,"hover")})),t.on("mouseout",(()=>{P.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{ct(t),function(t){var e,n,i,o;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(n=t.rightLine)||n.setCoords().set({x1:t.left,y1:t.top}),null==(i=t.childbirthIcon)||i.setCoords().set({left:t.left,top:t.top}),null==(o=t.childbirthText)||o.setCoords().set({left:t.left+O/2,top:t.top+q/2})}(t),_.hovered&&ut(t)})),t.on("mouseup",(e=>{if(P.show=!1,1===e.button){const{key:e}=t.origin,n={...t.origin,data:{...t.origin.data,time:X(t.left),value:A(e,t.top)}};S.value.discardActiveObject(),j("change",n),st(n,"change")}}))}(p),c.push(p),rt.add(p))}(dt(a,t),a,h)})),Promise.all(c).then((t=>{const e=u.filter((t=>t));H(t),Promise.all(d).then((n=>{S.value.add(...e,...t,...n),t.forEach((t=>{null==t||t.bringToFront();const{childbirthIcon:e}=t;e&&Reflect.has(e,"zIndex")&&e.zIndex>0&&e.bringToFront()}))}))}))}))}function st(t,e="add"){const{dataIndex:n,data:i,index:o,key:r}=t,l=ot.find((t=>t.key===r));switch(e){case"remove":l.data.splice(o,1);break;case"change":l.data[o]=i;break;default:{const t=g(i.time,l.data);l.data.splice(t,0,i);break}}at()}function at(){var t;rt.size&&(null==(t=S.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.childbirthIcon)&&e.push(null==t?void 0:t.childbirthIcon),(null==t?void 0:t.childbirthText)&&e.push(null==t?void 0:t.childbirthText)})),e}([...rt]))),rt.clear(),lt()}function ct(t){const e=t.prevPoint?t.prevPoint.left:D,n=t.nextPoint?t.nextPoint.left:J;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<tt&&t.set("top",tt),t.top<N&&t.set("top",N),t.top>R&&t.set("top",R),t.left<e&&t.set("left",e),t.left>n&&t.set("left",n)}function ut(t,e="moving"){const{title:n,key:i,data:o}=t.origin;P.point={x:t.left,y:t.top},P.list=[`${n} ${"hover"===e?o.value:A(i,t.top)}`,`时间 ${X(t.left).slice(-5)}`],P.show=!0}function dt(t,e){if(m(t)&&function(t){const e=V+864e5,n=v(t);return n>=V&&n<=e}(t.time)){const n=E(t.time),i=T(e.key,e.range,t.value);return[n,i<N?N:i>R?R:i]}}function ht(t,e){return t+1>e[1]?e[0]:t+1}return c(S,C),function(){const e=it?{width:Q-B-Z-1,left:B}:{width:J-D-($.length?0:1),left:D},n=new t.Rect({...U,height:R-1,top:0,fill:"transparent",...e});S.value.add(n)}(),function(){function e(e,n="left"){let i="left"===n?B:J;e.forEach(((e,n)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:b,showMaxMinNumber:x}=e,w=[],C=[],j=i+u/2,P=y(s,c),I=P.length,{lineXMain:E,lineXSub:T,textLeft:X}=d(v,i,u);P.forEach(((t,n)=>{const i=R-n*q*k,o=0===n?R-8:n!==P.length-1||N||tt&&"FHR"!==m?i:N+8;!b||(0===n||n===I-1)&&!x||w.push(h(String(t),e,X,o)),C.push(...f(e,n,E,T,i,q,N,I,1))}));const A=[],L=it?new t.Rect({...a,strokeWidth:.5,width:u,height:R,left:j,top:R/2}):null;L&&A.push(L);const Y=r([j,N>0?N-q/2:q/2],{value:String(p),...l,...g});Y&&A.push(Y);const M=new t.Group([...C,...w,...A],{objectCaching:!1,...o});S.value.add(M),M.sendToBack(),i+=u}))}e(F),e($,"right")}(),function(){const{show:e,startTime:n,range:i=[0,23],position:s="top",style:a}=G.time,{show:c,range:u=[0,23],position:d,style:h={}}=G.processTime;if(e||c){const f=[],p=x(u[0],u[1]+1),g=[],m=[],v=q/2;for(let t=0;t<W.mainXCell;t++){if(e){const{textAlign:e="center"}=a,o=D+("center"===e?O/2:0),c=0===t&&"center"!==e?o+5:o,u=0===t?+n.slice(11,13):ht(b(f),i);f.push(u);const d="top"===s?N-v:R+v;g.push(r([c+t*O,d],{value:String(u),...l,...a})),t===W.mainXCell-1&&"center"!==e&&g.push(r([J-1,d],{value:String(ht(b(f),i)),...l,...a,originX:"center"!==e?"right":"center"}))}if(c&&t<=p.length){const{textAlign:e="center"}=h,n=D+("center"===e?O/2:0),i=0===t&&"center"!==e?n+5:n,o="top"===d?v:nt-v;m.push(r([i+t*O,o],{value:String(p[t]),...l,...h})),t===W.mainXCell-1&&"center"!==e&&m.push(r([J-1,o],{value:String(b(p)),...l,...a,originX:"center"!==e?"right":"center"}))}}const y=new t.Group([...g,...m],{objectCaching:!1,...o});S.value.add(y),S.value.sendToBack(y)}}(),function(){var t;const n=Object.values(et),i=[],o={},r=ot.find((t=>"cervix"===t.key&&t.show)),l=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function s(t,e){const{key:n,range:i}=r||{},o=T(n,i,10),l=[0,e],s=[-e/t,0],a=[(R-o-e)/t,R-o],c=[J-D,t*(J-D)+e];let u=[],d=[];function h([n,i]){return Math.abs(i-t*n-e)<=1}function f([t,e]){const[n,i]=[...p([t,e])];return n>=D&&n<=J&&i>=o&&i<=R}function p([t,e]){return[D+t,R-e]}return h(l)&&f(l)&&(u=p(l)),h(s)&&f(s)&&(u=p(s)),h(a)&&f(a)&&(d=p(a)),h(c)&&f(c)&&(d=p(c)),[...u,...d]}n.forEach((t=>{if(!t.show)return;const{key:n}=t;switch(n){case"fetalPresentation":{const{range:o,show:r}=ot.find((t=>t.key===n));if(r){const r=T(n,o,0);i.push(e([D,r,J,r],{...t}))}break}case"alert":if(l){const{key:n,range:a}=r||{},c=216e5,u={time:w(new Date(v(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[d,h]=[E(l.time)-D,R-T(n,a,l.value)],[f,p]=[E(u.time)-D,R-T(n,a,u.value)],g=(p-h)/(f-d),m=h-d*g,y=s(g,m);y.length>0&&(i.push(e(y,{...t})),Object.assign(o,{k:g,b:m}))}break;case"handling":if(l){const{k:n,b:r}=o,a=144e5,c=s(n,r-(E(w(new Date(v(l.time)+a),"yyyy-MM-dd HH:mm"))-E(l.time))*n);c.length>0&&i.push(e(c,{...t}))}}})),S.value.add(...i)}(),lt(),function(){function t(t,e){const n=ot.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:n,key:t.key},pointer:e}}C.event.evented&&S.value.on("mouse:up",(e=>{if(3===e.button){const{x:n=0,y:i=0}=e.pointer||{};n>=D&&n<=J&&i>=N&&i<=R&&(I.point={x:n,y:i},I.show=!0,e.target?(I.target=e.target,I.list=["删除节点"],[...rt].forEach((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&I.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(I.target=null,I.list=["新增节点"],ot.filter((t=>t.show)).forEach((o=>{if(!L([...rt],n,"key").includes(o.key)){if(["cervix","fetalPresentation"].includes(o.key)&&i<tt)return;I.list.push(t(o,e.pointer))}})),1===I.list.length&&(I.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=Q-Z/2;function e(t,e){if(!t.length)return;let i=N;const o=[];t.forEach((t=>{const n=t.title.split("").join("\n"),r=K.findIndex((e=>e.key===t.key)),{text:l,icon:a}=s(n,t,{text:{originY:"top",left:e,top:i},icon:{left:e,topY:i,originY:"top",origin:{type:t.type,dataIndex:r},...C.event}},"vertical");var c;i+=l.height+a.height+15,(c=a).on("moving",(()=>{c.set("originY","center"),M(c)?(ct(c),ut(c)):P.show=!1})),c.on("mouseup:before",(t=>{if(P.show=!1,0===t.e.button&&M(c))if(L([...rt],c.left,"key").includes(c.origin.key))Y("repeat");else{const t={data:{time:X(c.left),value:A(c.origin.key,c.top)},...c.origin};j("add",t),st(t)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(c)})),o.push(l,a)})),n(o),S.value.add(...o)}function n(t){const e=b(t),n=(R-N)/2,i=(e.height+e.top-N)/2;t.forEach((t=>{const e=t.top+n-i;t.set({top:e,originTop:e})}))}e(F,B/2),e($,t)}(),{clickMenu:function({item:t,target:e}){const n={...t.origin};"remove"===t.mode?(j("remove",n),st(n,"remove")):(Object.assign(n,{data:{time:X(t.pointer.x),value:A(t.origin.key,t.pointer.y)}}),j("add",n),st(n))},redrawPoints:at}}export{S as useBirthProcess};
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawPoint as n,defaultStyle as i,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as f,drawScaleNumber as d,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as b,last as k,range as j}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as w}from"date-fns";import"naive-ui";import"@vueuse/core";function x(x,S,C,P,E){const{computedX:X,computedY:O,getXValue:A,getYValue:L}=u(S),{getEqualXTypes:M,handleAddPrevent:Y,isGridLimit:H,setPrevAndNextPoint:T,getPointEventProps:I}=p(x,C,S),{xAxis:D,grid:G,originX:N,originY:W,xCellWidth:z,endY:V,startTime:B,leftAddAreaWidth:F,leftScales:R,rightScales:$,yCellHeight:q,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:_,originYCervix:ee,other:te,canvasHeight:oe,scalebarBorder:ne,padding:ie}=S,re=b(K),le=new Set;function se(){re.filter((({showData:e=!0})=>e)).forEach(((e,s)=>{var a;const c=[],u=[],f=[],{pointAttr:d={},lineAttr:h={},title:p="",key:g,type:v="circle",childbirthStyle:m={},surgicalDeliveryStyle:y={},dystociaStyle:b={}}=e;function k(r,l,s,a){if(l[s]){const{type:c="circle",style:u={},arrowStyle:d={}}=e[s+"Style"],p=X(l[s]),g=t([...r,p,r[1]],{...h,strokeDashArray:[4,2],...i}),v=n(c,{left:p,top:r[1],...u,...i}),m=r[1]+v.height/2,y="dystocia"===s?o([p,m+q,m],h,"up"):null;g&&(f.push(g),a[s+"Line"]={obj:g,type:"line",left:p-r[0]}),v&&(f.push(v),a[s]={obj:v,left:p-r[0]}),y&&(f.push(y),a[s+"Arrow"]={obj:y,left:p-r[0],moveHide:!0})}}null==(a=e.data)||a.forEach(((a,y)=>{!function(a,y,b){let j,S;const E=e.data[b+1],X=de(E,e);if(a&&X&&!y.breakpoint)S=t([...a,...X],{...h});else if(a&&!X&&!y.breakpoint){const o=de(E,e);S=o?t([...a,...o],{...h}):null}const O={};if("cervix"===g){let e,t;if(y.childbirth){const{type:s="arrow",style:c={}}=m;if("arrow"===s){const t=a[1]+q;e=o([a[0],a[1],t],c)}else e=n(s,{left:a[0],top:a[1],...c,...i,hoverCursor:"default"});t=r([a[0]+z/2,a[1]+q/2],{value:String(y.childbirth),...l,originX:"left",originY:"center",fill:c.stroke||c.fill,fontSize:c.fontSize||l.fontSize}),e&&(f.push(e),Object.assign(O,{childbirthIcon:{obj:e,type:s}})),t&&(f.push(t),Object.assign(O,{childbirthText:{obj:t,left:z/2,top:q/2}}))}}"fetalPresentation"===g&&(k(a,y,"surgicalDelivery",O),k(a,y,"dystocia",O));const M=u[b-1],Y={origin:{data:y,title:p,key:g||"",dataIndex:s,index:b},leftLine:M,rightLine:S,otherObj:O,...d,...I()};a&&(M||(Y.leftLine=null),j=n(v,{left:a[0],top:a[1],...Y}));u.push(S),j&&(!function(e){_.hovered&&(e.on("mouseover",(()=>{fe(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ue(e),function(e){var t,o;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:o,top:n=0,left:i=0,type:r="",moveHide:l}=t||{};o&&("line"===r?o.setCoords().set({x1:e.left,y1:e.top,x2:e.left+i,y2:e.top}):o.setCoords().set({left:e.left+i,top:e.top+n}),l&&(x.value.remove(o),delete e.otherObj.obj))}))}(e),_.hovered&&fe(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:A(e.left),value:L(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var n;(null==(n=e.otherObj[t])?void 0:n.obj)&&(o.data[t]=w(new Date(A(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),x.value.discardActiveObject(),C("change",o),ae(o,"change")}}))}(j),c.push(j),le.add(j))}(de(a,e),a,y)})),Promise.all(c).then((e=>{const t=u.filter((e=>e));T(e),Promise.all(f).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront();const{childbirthIcon:t}=e.otherObj||{};(null==t?void 0:t.obj)&&"arrow"!==(null==t?void 0:t.type)&&t.obj.bringToFront()}))}))}))}))}function ae(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=re.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ce()}function ce(){var e;le.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...le]))),le.clear(),se()}function ue(e){const t=e.prevPoint?e.prevPoint.left:N,o=e.nextPoint?e.nextPoint.left:J;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<ee&&e.set("top",ee),e.top<W&&e.set("top",W),e.top>V&&e.set("top",V),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function fe(e,t="moving"){const{title:o,key:n,data:i}=e.origin;P.point={x:e.left,y:e.top},P.list=[`${o} ${"hover"===t?i.value:L(n,e.top)}`,`时间 ${A(e.left).slice(-5)}`],P.show=!0}function de(e,t){if(v(e)&&function(e){const t=B+864e5,o=m(e);return o>=B&&o<=t}(e.time)){const o=X(e.time),n=O(t.key,t.range,e.value);return[o,n<W?W:n>V?V:n]}}function he(e,t){return e+1>t[1]?t[0]:e+1}return c(x,S),function(){const t=ne?{width:Q-F-Z-1,left:F}:{width:J-N-($.length?0:1),left:N},o=new e.Rect({...U,height:V-ie[0]-1,top:ie[0],fill:"transparent",...t});x.value.add(o)}(),function(){function t(t,o="left"){let n="left"===o?F:J;t.forEach(((t,o)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:k=!0,showMaxMinNumber:j=!0,showName:w=!0}=t,S=[],C=[],P=n+u/2,E=y(s,c),X=E.length,{lineXMain:O,lineXSub:A,textLeft:L}=f(m,n,u);E.forEach(((e,o)=>{const n=V-o*q*b,i=0===o?V-8:o!==E.length-1||!ie[0]||ee&&"FHR"!==v?n:W+8;!k||(0===o||o===X-1)&&!j||S.push(d(String(e),t,L,i)),C.push(...h(t,o,O,A,n,q,W,X,1))}));const M=[],Y=ne?new e.Rect({...a,strokeWidth:.5,width:u,height:V-ie[0],left:P,top:ie[0]+(V-ie[0])/2}):null;if(Y&&M.push(Y),w){const e=r([P,W-ie[0]>0?W-q/2:q/2],{value:String(p),...l,...g});e&&M.push(e)}const H=new e.Group([...C,...S,...M],{objectCaching:!1,...i});x.value.add(H),H.sendToBack(),n+=u}))}t(R),t($,"right")}(),function(){const{show:t,startTime:o,range:n=[0,23],position:s="top",style:a}=D.time,{show:c,range:u=[0,23],position:f,style:d={}}=D.processTime;if(t||c){const h=[],p=j(u[0],u[1]+1),g=[],v=[],m=q/2;for(let e=0;e<G.mainXCell;e++){if(t){const{textAlign:t="center"}=a,i=N+("center"===t?z/2:0),c=0===e&&"center"!==t?i+5:i,u=0===e?+o.slice(11,13):he(k(h),n);h.push(u);const f="top"===s?W-m:V+m;g.push(r([c+e*z,f],{value:String(u),...l,...a})),e===G.mainXCell-1&&"center"!==t&&g.push(r([J-1,f],{value:String(he(k(h),n)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=d,o=N+("center"===t?z/2:0),n=0===e&&"center"!==t?o+5:o,i="top"===f?m:oe-m;v.push(r([n+e*z,i],{value:String(p[e]),...l,...d})),e===G.mainXCell-1&&"center"!==t&&v.push(r([J-1,i],{value:String(k(p)),...l,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...v],{objectCaching:!1,...i});x.value.add(y),x.value.sendToBack(y)}}(),function(){var e;const o=Object.values(te),n=[],i={},r=re.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=O(o,n,10),l=[0,t],s=[-t/e,0],a=[(V-i-t)/e,V-i],c=[J-N,e*(J-N)+t];let u=[],f=[];function d([o,n]){return Math.abs(n-e*o-t)<=1}function h([e,t]){const[o,n]=[...p([e,t])];return o>=N&&o<=J&&n>=i&&n<=V}function p([e,t]){return[N+e,V-t]}return d(l)&&h(l)&&(u=p(l)),d(s)&&h(s)&&(u=p(s)),d(a)&&h(a)&&(f=p(a)),d(c)&&h(c)&&(f=p(c)),[...u,...f]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=re.find((e=>e.key===o));if(r){const r=O(o,i,0);n.push(t([N,r,J,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},c=216e5,u={time:w(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[X(l.time)-N,V-O(o,a,l.value)],[h,p]=[X(u.time)-N,V-O(o,a,u.value)],g=(p-d)/(h-f),v=d-f*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,c=s(o,r-(X(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-X(l.time))*o);c.length>0&&n.push(t(c,{...e}))}}})),x.value.add(...n)}(),se(),function(){function e(e,t){const o=re.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}S.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=N&&o<=J&&n>=W&&n<=V&&(E.point={x:o,y:n},E.show=!0,t.target?(E.target=t.target,E.list=["删除节点"],[...le].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&E.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(E.target=null,E.list=["新增节点"],re.filter((e=>e.show)).forEach((i=>{if(!M([...le],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<ee)return;E.list.push(e(i,t.pointer))}})),1===E.list.length&&(E.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=Q-Z/2;function t(e,t){if(!e.length)return;let n=W;const i=[];e.forEach((e=>{const o=(e.alias||e.title).split("").join("\n"),a=K.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,n],{value:o,...l,originY:"top",...e.titleStyle});o&&(n+=s.height+15,i.push(s))}else{const{text:r,icon:l}=s(o,e,{text:{originX:"center",originY:"top",left:t,top:n},icon:{left:t,topY:n,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...S.event}},"vertical");n+=r.height+l.height+15,(c=l).on("moving",(()=>{c.set("originY","center"),H(c)?(ue(c),fe(c)):P.show=!1})),c.on("mouseup:before",(e=>{if(P.show=!1,0===e.e.button&&H(c))if(M([...le],c.left,"key").includes(c.origin.key))Y("repeat");else{const e={data:{time:A(c.left),value:L(c.origin.key,c.top)},...c.origin};C("add",e),ae(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(c)})),i.push(r,l)}var c})),o(i),x.value.add(...i)}function o(e){const t=k(e),o=(V-W)/2,n=(t.height+t.top-W)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(R,F/2),t($,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(C("remove",o),ae(o,"remove")):(Object.assign(o,{data:{time:A(e.pointer.x),value:L(e.origin.key,e.pointer.y)}}),C("add",o),ae(o))},redrawPoints:ce}}export{x as useBirthProcess};
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as r}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as u}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as i}from"./useBirthProcess.js";function
|
1
|
+
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as r}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as u}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as i}from"./useBirthProcess.js";function n(n,d,s,o,v,c){const h=e({select:null,redrawPoints:null,clickMenu:null}),m=a((()=>d.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"left"===e&&a)))),f=a((()=>d.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"right"===e&&a)))),p=a((()=>{var e;return(null==(e=f.value)?void 0:e.length)?30:0})),g=a((()=>{var e;return 30+(null==(e=m.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),w=a((()=>{var e;const{width:a}=d.data,t=null==(e=f.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-p.value-t})),x=a((()=>d.data.grid.mainXCell)),y=a((()=>{const e=d.data.grid.mainYCell||14;return d.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),V=a((()=>(w.value-g.value)/x.value)),b=a((()=>[B("top")?0:5,B("bottom")?0:5])),k=a((()=>{const{height:e}=d.data,a=B();return(e-b.value.reduce(((e,a)=>e+a),0))/(y.value+a)})),C=a((()=>{const e=B("top");return k.value*e+b.value[0]})),j=a((()=>{var e;const{scaleValues:a}=d.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!C.value)return C.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return A.value-b.value[0]-l*r*k.value})),A=a((()=>{const{height:e}=d.data,a=B("bottom");return e-k.value*a-b.value[1]})),Y=a((()=>u(d.data.xAxis.time.startTime))),S=a((()=>36e5/V.value)),H=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"cervix"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),P=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"FHR"===e.key));return k.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"fetalPresentation"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),X=a((()=>{var e;return(null==(e=d.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}}));function B(e){const{xAxis:a}=d.data;return Object.values(a).reduce(((a,t)=>(t.show&&(!e||e&&t.position===e)&&a++,a)),0)}const F=e({canvasWidth:d.data.width,canvasHeight:d.data.height,borderStyle:{...r,...d.data.borderStyle||{}},selectionStyle:d.data.selectionStyle||{},grid:d.data.grid,other:d.data.other,originX:g.value,endX:w.value,originY:C.value,endY:A.value,xCellWidth:V.value,yCellHeight:k.value,gridXNumber:x.value,gridYNumber:y.value,xAxis:d.data.xAxis,leftScales:m.value,rightScales:f.value,leftAddAreaWidth:30,rightAddAreaWidth:p.value,startTime:Y.value,timeXCell:S.value,cervixYCell:H.value,FHRYCell:P.value,fetalPresentationYCell:R.value,scaleValues:d.data.scaleValues,event:X.value,originYCervix:j.value,scalebarBorder:!Reflect.has(d.data,"scalebarBorder")||d.data.scalebarBorder,padding:b.value});return t((()=>n.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=i(n,F,s,v,c);h.redrawPoints=a,h.clickMenu=e}()}),{immediate:!0}),{propItems:F,...l(h)}}export{n as useBirthProcessChart};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},i={stroke:"#000",strokeWidth:1,strokeUniform:!0,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...t},r={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...t};function c(t,i){return new e.Line(t,{...n,...i})}function l([t,i],n){return new e.Text(String(n.value),{...o,left:t,top:i,...n})}function s([i,n,r],o,s="down"){const a=c([i,n,i,r],{strokeWidth:1,stroke:o.fill}),g=l([i+.5,"up"===s?r-3:r+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===s?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...t,originX:"center",originY:"top",objectCaching:!1})}function a(i,n,c,l=!1){const s=new e.Rect({...r,...i,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=n,f=i.width/2,h=i.height/2,d=new e.Text(String(a),{...o,...n,..."left"==g||"right"==g?{originX:g,left:"left"==g?-f:f}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-h:h}:{}});return new e.Group([s,d],{objectCaching:!1,...t,...c})}function g(t){return new e.Circle({objectCaching:!1,strokeWidth:t.strokeWidth||1,stroke:t.stroke||"red",radius:t.radius||5,fill:"#fff"})}function u(t="circle",i){var n;const r={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,scale:1,...i},o=i.radius?(i.radius||5)+(i.strokeWidth||1):null!=(n=i.width)?n:0;switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,...r});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,...r});case"image":return new e.Image(i.element,r);case"yemai":{const t=()=>{const t=2*o,n={stroke:i.strokeX||"blue",strokeWidth:i.strokeWidthX||1,originX:"center",originY:"center"},r=new e.Line([0,o,t,o],n),c=new e.Line([o,0,o,t],n);return new e.Group([r,c])};return new e.Group([g(i),t()],r)}case"koumai":{const t=new e.Circle({objectCaching:!1,radius:i.radiusCircle||2,fill:i.fillCircle||"#000",originX:"center",originY:"center",left:o-.5,top:o-.5});return new e.Group([g(i),t],r)}case"circleAndText":{const t=new e.Text(String(i.text),{fontFamily:"微软雅黑",fontSize:r.fontSize||12,originX:"center",originY:"center",fill:i.stroke,left:o-.5,top:o-1,fontWeight:i.fontWeight||500,objectCaching:!1});return new e.Group([g(i),t],r)}default:return i&&Reflect.deleteProperty(i,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...r})}}function f(i,n,r,o="horizontal"){const c=new e.Text(String(i),{...t,objectCaching:!1,...n.titleStyle||{},originX:"left",originY:"bottom",lineHeight:1,fontSize:12,...r.text}),{top:l,topY:s,left:a,leftX:g}=r.icon,f=null!=l?l:"horizontal"===o?s-(c.height||30)/2-1:s+c.height+3,h=null!=a?a:g+c.width+5;return{text:c,icon:u(n.type,{...n.pointAttr,originY:"center",originX:"left",originLeft:h,originTop:f,...r.icon,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,isMenu:!0,...r.icon.origin},left:h,top:f})}}export{i as defaultBorderStyle,n as defaultLineStyle,r as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,s as drawArrow,c as drawLine,u as drawPoint,l as drawText,f as drawTextAndIconGroup,a as drawTextGroup};
|
1
|
+
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},i={stroke:"#000",strokeWidth:1,strokeUniform:!0,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...t},r={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...t};function c(t,i){return new e.Line(t,{...n,...i})}function l([t,i],n){return new e.Text(String(n.value),{...o,left:t,top:i,...n})}function s([i,n,r],o,s="down"){const a=c([i,n,i,r],{strokeWidth:o.strokeWidth||1,stroke:o.fill||o.stroke}),g=l([i+.5,"up"===s?r-3:r+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===s?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...t,originX:"center",originY:"top",objectCaching:!1})}function a(i,n,c,l=!1){const s=new e.Rect({...r,...i,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=n,f=i.width/2,h=i.height/2,d=new e.Text(String(a),{...o,...n,..."left"==g||"right"==g?{originX:g,left:"left"==g?-f:f}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-h:h}:{}});return new e.Group([s,d],{objectCaching:!1,...t,...c})}function g(t){return new e.Circle({objectCaching:!1,strokeWidth:t.strokeWidth||1,stroke:t.stroke||"red",radius:t.radius||5,fill:"#fff"})}function u(t="circle",i){var n;const r={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,scale:1,...i},o=i.radius?(i.radius||5)+(i.strokeWidth||1):null!=(n=i.width)?n:0;switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,...r});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,...r});case"image":return new e.Image(i.element,r);case"yemai":{const t=()=>{const t=2*o,n={stroke:i.strokeX||"blue",strokeWidth:i.strokeWidthX||1,originX:"center",originY:"center"},r=new e.Line([0,o,t,o],n),c=new e.Line([o,0,o,t],n);return new e.Group([r,c])};return new e.Group([g(i),t()],r)}case"koumai":{const t=new e.Circle({objectCaching:!1,radius:i.radiusCircle||2,fill:i.fillCircle||"#000",originX:"center",originY:"center",left:o-.5,top:o-.5});return new e.Group([g(i),t],r)}case"circleAndText":{const t=new e.Text(String(i.text),{fontFamily:"微软雅黑",fontSize:r.fontSize||12,originX:"center",originY:"center",fill:i.stroke,left:o-.5,top:o-1,fontWeight:i.fontWeight||500,objectCaching:!1});return new e.Group([g(i),t],r)}case"circleAndCircle":return u("koumai",i);default:return i&&Reflect.deleteProperty(i,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...r})}}function f(i,n,r,o="horizontal"){const c=new e.Text(String(i),{...t,objectCaching:!1,...n.titleStyle||{},originX:"left",originY:"bottom",lineHeight:1,fontSize:12,...r.text}),{top:l,topY:s,left:a,leftX:g}=r.icon,f=null!=l?l:"horizontal"===o?s-(c.height||30)/2-1:s+c.height+3,h=null!=a?a:g+c.width+5;return{text:c,icon:u(n.type,{...n.pointAttr,originY:"center",originX:"left",originLeft:h,originTop:f,...r.icon,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,isMenu:!0,...r.icon.origin},left:h,top:f})}}export{i as defaultBorderStyle,n as defaultLineStyle,r as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,s as drawArrow,c as drawLine,u as drawPoint,l as drawText,f as drawTextAndIconGroup,a as drawTextGroup};
|