cnhis-design-vue 3.2.10-beta.1 → 3.2.10-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/ai-chat/index.d.ts +2 -2
- package/es/components/ai-chat/src/Index.vue.d.ts +2 -2
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +2 -2
- 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/style/index.css +1 -1
- package/es/components/base-search/index.d.ts +2 -0
- package/es/components/base-search/src/index.vue.d.ts +2 -0
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/classification/index.d.ts +1 -1
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +1 -1
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +1 -1
- package/es/components/classification/src/index.vue.d.ts +1 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +2 -2
- package/es/components/field-set/src/FieldFilter.vue.d.ts +2 -2
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +2 -2
- package/es/components/field-set/src/components/table-row.vue.d.ts +2 -2
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/form-config/index.d.ts +3 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +3 -3
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -3
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/components/renderer/text.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/text.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -1
- package/es/components/form-render/src/types/index.d.ts +4 -3
- package/es/components/form-render/src/utils/index.d.ts +2 -0
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-chat/index.d.ts +1 -1
- package/es/components/iho-chat/src/Index.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +1 -1
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/quick-search/index.d.ts +3 -0
- package/es/components/quick-search/src/index.vue.d.ts +3 -0
- package/es/components/scale-view/src/components/formitem/r-upload.d.ts +4 -4
- package/es/components/scale-view/src/components/formitem/r-upload.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +10 -8
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +1 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/bi-filter/helpers/options.d.ts +1 -7
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/SelectTreeDynamic.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectTreeDynamic.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +5 -5
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.d.ts +3 -49
- package/es/components/table-filter/src/components/render-widget/helpers/enums.d.ts +1 -18
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +5 -5
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +1 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useMixins.d.ts +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +2 -0
- package/es/components/vod-chunk-upload/index.d.ts +2 -0
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue.d.ts +18 -4
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/hooks/upload-data.d.ts +5 -1
- package/es/components/vod-chunk-upload/src/hooks/upload-data.js +1 -1
- package/es/components/vod-chunk-upload/src/hooks/vod-computed.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +2 -0
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -74,13 +74,13 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
74
74
|
emit: (event: string, ...args: any[]) => void;
|
75
75
|
shortcutList: any;
|
76
76
|
state: any;
|
77
|
-
|
77
|
+
isSmall: any;
|
78
78
|
audioTimed: any;
|
79
79
|
content: import("vue").Ref<string>;
|
80
|
-
isSmall: import("vue").ComputedRef<boolean>;
|
81
80
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
82
81
|
recorderStart: () => Promise<void>;
|
83
82
|
recorderStop: () => Promise<void>;
|
83
|
+
isValidJSON: (str: string) => boolean;
|
84
84
|
getShortcutName: (item: string | import("../../shared/types").AnyObject) => any;
|
85
85
|
handleShortcut: (item: string | import("../../shared/types").AnyObject) => void;
|
86
86
|
handleKeyDown: (event: KeyboardEvent) => void;
|
@@ -76,13 +76,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
76
76
|
emit: (event: string, ...args: any[]) => void;
|
77
77
|
shortcutList: any;
|
78
78
|
state: any;
|
79
|
-
|
79
|
+
isSmall: any;
|
80
80
|
audioTimed: any;
|
81
81
|
content: import("vue").Ref<string>;
|
82
|
-
isSmall: import("vue").ComputedRef<boolean>;
|
83
82
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
84
83
|
recorderStart: () => Promise<void>;
|
85
84
|
recorderStop: () => Promise<void>;
|
85
|
+
isValidJSON: (str: string) => boolean;
|
86
86
|
getShortcutName: (item: string | AnyObject) => any;
|
87
87
|
handleShortcut: (item: string | AnyObject) => void;
|
88
88
|
handleKeyDown: (event: KeyboardEvent) => void;
|
@@ -5,13 +5,13 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
5
5
|
emit: (event: string, ...args: any[]) => void;
|
6
6
|
shortcutList: any;
|
7
7
|
state: any;
|
8
|
-
|
8
|
+
isSmall: any;
|
9
9
|
audioTimed: any;
|
10
10
|
content: import("vue").Ref<string>;
|
11
|
-
isSmall: import("vue").ComputedRef<boolean>;
|
12
11
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
13
12
|
recorderStart: () => Promise<void>;
|
14
13
|
recorderStop: () => Promise<void>;
|
14
|
+
isValidJSON: (str: string) => boolean;
|
15
15
|
getShortcutName: (item: string | AnyObject) => any;
|
16
16
|
handleShortcut: (item: string | AnyObject) => void;
|
17
17
|
handleKeyDown: (event: KeyboardEvent) => void;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as n,ref as t,computed as o,watch as l,onBeforeUnmount as i,openBlock as a,createElementBlock as s,normalizeClass as r,unref as d,Fragment as c,renderList as u,createBlock as
|
1
|
+
import{defineComponent as e,inject as n,ref as t,computed as o,watch as l,onBeforeUnmount as i,openBlock as a,createElementBlock as s,normalizeClass as r,unref as d,Fragment as c,renderList as u,createBlock as f,withCtx as p,createTextVNode as v,toDisplayString as k,createCommentVNode as m,createElementVNode as b,createVNode as h,getCurrentInstance as w}from"vue";import{NButton as y,NInput as g,NIcon as x}from"naive-ui";import{PaperPlane as S}from"@vicons/ionicons5";import{InjectionAIChatEmits as C,InjectionAIChat as K}from"../types/index.js";import _ from"../../../audio-sdk/src/audioSDK.js";import{isString as j}from"lodash-es";const z={key:0,class:"menu-box fillet-8"},M={class:"input-wrapper fillet-10"},E=b("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),b("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),b("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),N={class:"btn-box"},R=["disabled"];var D=e({__name:"ChatFooter",setup(e){const D=_.create(),F=n(C),{shortcutList:J,state:O,isSmall:T,audioTimed:U}=n(K),B=t(""),I=o((()=>!B.value.replace(/( |\s|<br>)+/g,"")));async function L(){await D.recorderStart(w(),{onStop:P,allowPunctuationMark:!1,timed:U.value||10,realTimeRecognition:!0})}async function P(){try{const e=await D.recorderStop();if("success"!==e.result)return;const{text:n}=e.data;B.value=n}catch(e){console.log(e)}}function V(e){var n,t;if(j(e))return e;const o=null==(t=null==(n=null==e?void 0:e.contents)?void 0:n[0])?void 0:t.content;return(function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(o)?JSON.parse(o):{}).instructionName}function q(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),A()))}function A(){I.value||(O.beingSent=!0,O.sendContent=B.value,B.value="")}return l((()=>O.sendContent),(e=>{e&&!O.beingSent&&(B.value=e)})),i((()=>{D.destroy()})),(e,n)=>(a(),s("section",{class:r(["chat-footer",d(O).beingSent?"disabled":""])},[d(J)&&d(J).length>0?(a(),s("div",z,[(a(!0),s(c,null,u(d(J),(e=>(a(),f(d(y),{secondary:"",size:"small",round:d(T),key:V(e),onClick:()=>function(e){var n;if(j(e))B.value=e;else{const t=null==(n=null==e?void 0:e.contents)?void 0:n[0];F("button-click",{msgItem:t,item:e})}}(e)},{default:p((()=>[v(k(V(e)),1)])),_:2},1032,["round","onClick"])))),128))])):m("v-if",!0),b("div",M,[d(T)?(a(),f(d(g),{key:0,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:d(O).beingSent,value:B.value,"onUpdate:value":n[0]||(n[0]=e=>B.value=e),onKeydown:q},{suffix:p((()=>[h(d(y),{text:"",disabled:d(O).beingSent,onClick:L},{icon:p((()=>[h(d(x),{size:"30"},{default:p((()=>[E])),_:1})])),_:1},8,["disabled"]),h(d(y),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:d(I),onClick:A},{icon:p((()=>[h(d(x),{color:"#fff",size:"20",component:d(S)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(a(),s(c,{key:1},[h(d(g),{type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:d(O).beingSent,autosize:{minRows:2,maxRows:7},value:B.value,"onUpdate:value":n[1]||(n[1]=e=>B.value=e),onKeydown:q},null,8,["disabled","value"]),b("div",N,[b("span",{class:r(["btn-send","gradient","fillet-8",d(I)?"disabled":""]),disabled:d(I),onClick:A},[h(d(x),{color:"#fff",size:"22",component:d(S)},null,8,["component"])],10,R)])],64))])],2))}});export{D as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as
|
1
|
+
import{defineComponent as e,inject as t,ref as n,computed as l,watch as a,createVNode as s,createTextVNode as o,mergeProps as i,isVNode as r}from"vue";import{NAvatar as u,NSpin as c,NButton as d,NSpace as m,NIcon 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{ChevronForward as x}from"@vicons/ionicons5";import{useScrollLoading as k}from"../../../../shared/hooks/useScrollLoading.js";function S(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!r(e)}var j=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:r,slots:j,emit:C}){const I=t(v),{userAvatar:E,queryData:T,state:_,queryRecord:z,defaultShortcutList:w,hideInput:M=!1,isSmall:N}=t(f),O=n(null),A=n([]),q=n(!1),H=l((()=>N.value?h:g)),J={page:0,hasMore:!0};async function L(e=!1){if(!J.hasMore)return;J.page++,1==J.page&&(A.value=[]);const{records:t,rows:n}=await z.value({page:J.page});b(n)&&A.value.length<=+t&&(A.value=J.page>1?[...A.value,...n]:n,D(),A.value.length>=+t&&(e&&(q.value=!0),J.hasMore=!1,console.log("没有更多消息了")))}function D(){A.value.forEach((e=>{e.buttonType&&(e.disabled=!0),e.contents.forEach((e=>e.disabled=!0))}))}function R(e){const{item:t,msgItem:n,fieldItem:l}=e;if(n)return I("button-click",{item:t,msgItem:n,fieldItem:l}),void A.value.forEach((e=>e.contents.forEach((e=>e.disabled=!0))));A.value.forEach((e=>e.buttonType&&(e.disabled=!0))),t.link||(_.beingSent=!0,_.sendContent="确定")}function B(e,t){const{contentType:n,content:l=""}=t;if("json"!==n||!function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(l))return null;const a=JSON.parse(l),i=["journaling","dashboard"].includes(a.buttonType);return s("div",{class:"card"},[[s("p",null,[a.title]),i?a.fields.map((n=>s(d,{class:"link-btn",style:"--n-height: 36px",secondary:!0,"icon-placement":"right",onClick:()=>R({item:e,msgItem:t,fieldItem:n})},{default:()=>n.name,icon:()=>s(p,{component:x},null)}))):[s("div",{class:"card-body"},[s("p",{class:"card-body__head"},[a.instructionName]),s("div",{class:"card-body__content"},[a.fields.map((e=>s("div",null,[s("span",{class:"label"},[e.name]),o(":"),s("span",null,[e.value])])))])]),s(d,{style:"margin-top: 10px;width: 100%;--n-height: 36px;font-size: 15px",secondary:!0,class:"gradient",disabled:t.disabled,onClick:()=>R({item:e,msgItem:t})},{default:()=>[a.buttonName]})]]])}function F(e,t){const{contents:n=[],buttonType:l=""}=e,a=B(e,n[t]);if(a)return a;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(d,i({style:"margin-top: 5px",secondary:!0,class:"gradient",disabled:e.disabled},e.link?{tag:"a",href:e.link,target:"_blank"}:{},{onClick:()=>R({item:e})}),{default:()=>[o("确定")]})]:null]}function G({role:e=""}){return"user"===e}function K(){let e;return s("div",{class:"message-item"},[s(u,{round:!0,size:N.value?64:40,src:H.value},null),s("div",{class:"content-box"},[s("div",{class:"content fillet-10 default"},[s("h2",null,[o("Hi,我是你的AI助理")]),s("p",null,[o("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),s("br",null,null),o("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),b(w.value)&&w.value.length>0?[s("p",{style:"margin: 5px 0 5px"},[o("你可以试着问我:")]),s(m,{"wrap-item":!1},S(e=w.value.map((e=>s(d,{size:"large",secondary:!0,onClick:()=>_.sendContent=e,disabled:_.beingSent},S(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])])}return k(O,(()=>{L()}),M.value?"bottom":"top"),L(!0),a((()=>_.beingSent),(async e=>{var t;if(e){null==(t=O.value)||t.scrollTo({top:0,behavior:"auto"}),A.value.unshift({contents:[{role:"user",content:_.sendContent}]}),D();const e=await T.value({content:_.sendContent,contentType:"text"});b(null==e?void 0:e.contents)&&A.value.unshift(e),_.beingSent=!1,_.sendContent=""}})),()=>s("section",{class:"chat-main",ref:O,style:{"flex-direction":M.value?"column":"column-reverse"}},[[_.beingSent?s("div",{class:"message-item"},[[N.value?null:s(u,{round:!0,size:40,src:H.value},null),s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(c,{size:22,stroke:"#4170EE"},null),s("span",null,[o("正在加载中,请稍等...")])])])]]):null,A.value.map((e=>e.contents.map(((t,n)=>s("div",{class:"message-item"},[[N.value?null:s(u,{round:!0,size:40,src:G(t)?E.value:H.value},null),s("div",{class:["content-box",G(t)?"mine":""]},[s("div",{class:"content"},[y(t.render)?t.render():F(e,n)])])]]))))),q.value?K():null]])}});export{j as default};
|
@@ -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;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 .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;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
|
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}
|
@@ -75,6 +75,7 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
75
75
|
advanceColWidth: number | null | undefined;
|
76
76
|
accurateSearch: any;
|
77
77
|
extendKey: string;
|
78
|
+
extendType: string;
|
78
79
|
}[];
|
79
80
|
transformParams: (paramsList: any[]) => any;
|
80
81
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -152,6 +153,7 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
152
153
|
accurateSearch?: any;
|
153
154
|
isAccurateSearchVal?: boolean | undefined;
|
154
155
|
extendKey?: string | undefined;
|
156
|
+
extendType?: string | undefined;
|
155
157
|
}[]>;
|
156
158
|
filterChangeFnList: import("vue").Ref<any[]>;
|
157
159
|
showQuickSearch: import("vue").ComputedRef<boolean>;
|
@@ -76,6 +76,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
76
76
|
advanceColWidth: number | null | undefined;
|
77
77
|
accurateSearch: any;
|
78
78
|
extendKey: string;
|
79
|
+
extendType: string;
|
79
80
|
}[];
|
80
81
|
transformParams: (paramsList: any[]) => any;
|
81
82
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -153,6 +154,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
153
154
|
accurateSearch?: any;
|
154
155
|
isAccurateSearchVal?: boolean | undefined;
|
155
156
|
extendKey?: string | undefined;
|
157
|
+
extendType?: string | undefined;
|
156
158
|
}[]>;
|
157
159
|
filterChangeFnList: import("vue").Ref<any[]>;
|
158
160
|
showQuickSearch: import("vue").ComputedRef<boolean>;
|
@@ -1 +1 @@
|
|
1
|
-
import t from"axios";import{cloneDeep as e,isArray as i}from"lodash-es";import{IdentityVerificationDialog as r,PreviewDialog as s}from"./dialog.js";import{isIReport as a,getFileUrl as n,useBrowserPrint as o}from"./browserPrint.js";import{getCurrentInstance as l}from"vue";import{uuidGenerator as c}from"../../../../shared/utils/index.js";import{format as h}from"date-fns";import{io as p}from"socket.io-client";const u=String(navigator.platform).toLowerCase().includes("linux"),m=t.create({timeout:6e4,withCredentials:!1}),d=`${window.location.protocol}//${window.location.host}`,g=`${d}/fdp-api/print/assembly/printIReport`,y=`${d}/bi-api/reprot/print/open/client/printIReportForBase64`,f=`${d}/bi-api/reprot/print/open/client/printIReportForHex`,w=`${d}/bi-api/reprot/print/open/client/previewIReport`,v=`${d}/bi-api/reprot/print/open/client/getRemote`,P=`${d}/printService/file`;let _=null;class b{constructor(){var t,e,i;if(this.webview=null,this.dialog=new r,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.printDomesticOrigin="http://127.0.0.1:17521",this.isRemote=!1,this.CMonitor=null,this.queryServicesParams=null,this.isConnectHiPrint=!1,this.clientInfo=null,this.printerList=[],this.hiPrintSocket=null,this.base64Fragment="",this._successCallbackFn=null,this._errorCallbackFn=null,this._cancelCallbackFn=null,this.messageHandlerQueue=[],this.getIReportFormatId=(t,e)=>t?e.split("_")[1]:e,_)return _;_=this;const a=window;this.CMonitor=a.$CMonitor;try{this.webview=a.top?null==(t=a.top.chrome)?void 0:t.webview:null==(e=a.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(i=a.chrome)?void 0:i.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf","resetprint"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:r,reject:s}=e;try{if("resetprint"===(null==i?void 0:i.cmd))return void r({result:(null==i?void 0:i.res)?"success":"fail"});r(i.res||"")}catch(t){s(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}_initDomesticSystem(t){try{if(this.hiPrintSocket)return this.isConnectHiPrint;this.hiPrintSocket=p(this.printDomesticOrigin,{reconnection:!1,transports:["websocket"],auth:{token:"no-use-vue-plugin-hiprint"}}),this.hiPrintSocket&&(this.hiPrintSocket.on("connect",(()=>{this.isConnectHiPrint=!0})),this.hiPrintSocket.on("disconnect",(()=>{this.isConnectHiPrint=!1,this.hiPrintSocket=null})),this.hiPrintSocket.on("clientInfo",(t=>{console.log("获取到客户端信息>>>>>",t),t.clientUrl&&(this.clientInfo=t)})),this.hiPrintSocket.on("printerList",(e=>{console.log("获取到打印机列表信息>>>>>",e),this.printerList=e,t&&t(!0)})),this.hiPrintSocket.on("success",(t=>{console.log("打印成功>>>>>",t),this.base64Fragment="",this._successCallbackFn&&this._successCallbackFn(t)})),this.hiPrintSocket.on("replayPrinterTemplate",(t=>{console.log("获取到数据的回复>>>>>",t),t&&this.hiPrintSocket.emit("news",t)})),this.hiPrintSocket.on("error",(t=>{console.log("打印失败>>>>>",t),this.base64Fragment="","cancel"==(null==t?void 0:t.result)?this._cancelCallbackFn&&this._cancelCallbackFn(t):this._errorCallbackFn&&this._errorCallbackFn(t)})))}catch(e){console.log("ihoPrint系统连接失败",e),t&&t(!1)}}async getPicAndUpload(t){try{const e=t=>"[object Object]"===Object.prototype.toString.call(t);if("success"===(null==t?void 0:t.result)&&"Y"==(null==t?void 0:t.uploadTemplateFlag)&&!(null==t?void 0:t.filebase64)&&this.queryServicesParams){const t=e(this.queryServicesParams.params)?this.queryServicesParams.params:JSON.parse(this.queryServicesParams.params);t.uploadTemplateFlag="Y",this.queryServicesParams.params=JSON.stringify(t),this.queryServicesParams.cmdid="7",this.queryServicesParams.print={print:1,type:6,zip:0},this.queryServicesParams.paramsArr=[{params:JSON.stringify(t)}];await this._queryBase64ServicesPrint(this.queryServicesParams)}}catch(t){console.log(t)}finally{this.queryServicesParams=null}}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=c();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,r)=>{this.messageHandlerQueue.push({resolve:i,reject:r,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,r)=>{this.messageHandlerQueue.push({resolve:i,reject:r,id:t}),this.webview.postMessage(e)})),new Promise(((e,r)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),r({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testDomesticSystemConnection(){return new Promise((t=>{m({url:`${this.printDomesticOrigin}/test`,method:"get",withCredentials:!1,params:{}}).then((({data:e})=>{e.status?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{m({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}async resetPrinter(t,e){const i=a(t),r=this.getIReportFormatId(i,t);if(i&&(u||2==e)){return await this._testDomesticSystemConnection()?m({url:`${this.printDomesticOrigin}/resetPrint`,method:"get",withCredentials:!1,params:{formatId:r}}).then((({data:t})=>t.status?{type:"resetSuccess",result:"success",message:null==t?void 0:t.message}:{type:"resetError",result:"error",message:null==t?void 0:t.message})).catch((t=>({type:"resetError",result:"error",message:"重置打印机错误"}))):{type:"notOpenedApp",result:"error",message:"请开启ihoPrint客户端"}}return this.webview?this.postMessage({exec:"resetprint",data:{formatID:r}}):m({url:`${this.printOrigin}/services/printset`,method:"get",withCredentials:!1,params:{inputdata:r}}).then((({data:t})=>t))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_queryBase64ServicesPrint(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):m({url:"/services/Printqueue",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:r(i)}):m({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[r]}).then((({data:t})=>t));function r(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e,i){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:"error",errinfo:t}),!1}if("success"!==t.result){const r=t.message||t.Message;this._handleMonitorNotify(r);const s={type:"printError",message:r,result:t.result,errinfo:t.errinfo};return"cancel"==t.result?(i&&i({type:"printCancel",message:r,result:t.result,errinfo:t.errinfo}),!1):(null==e||e(s),!1)}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件",result:"error"}),!1)}async _handleEventQueryPrintData(t,e,i,r,s){const a={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:r},n=await this._queryServicesPrint(a);return this._handleQueryPrintDataResult(n,e,s)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({result:"error",type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,svrUpdateIp:i,params:r,paramsArr:s,cmdid:a,print:n,signature:o,copies:l,printdlgshow:c="0",nobillnode:p="1",btnprint:u="1",messageTimeout:m=0}){const d={templateId:t,formatId:e,svrUpdateIp:i,params:r,cmdid:a,nobillnode:p,printdlgshow:c,btnprint:u,copies:l,messageTimeout:m,...o?{signature:o}:{}};if(s&&(d.paramsArr=s),n){try{n=JSON.parse(n)}catch(t){}d.print=n}else if(this.isRemote){const t=h(new Date,"yyyyMMddHHmmss");d.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return this.queryServicesParams=d,await this._queryServicesPrint(d)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:r,messageTimeout:s=0}){const a={};let n={};try{n=Object.assign({},a,JSON.parse(i))}catch(t){n=a}const o={templateId:t,formatId:e,cmdid:"9",token:r,params:JSON.stringify(n),messageTimeout:s};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await m({method:"get",url:v})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=d+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await m({method:"post",url:g,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}paramsSerializer(t){return Object.keys(t).forEach((e=>{const i=t[e];t[e]=i,"biParams"==e&&(t[e]=encodeURIComponent(i))})),t}async _queryPrintForBase64(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:a}=await m({method:"post",url:y,params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return a}async _queryPrintForBase16(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:a}=await m({method:"post",url:f,params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return a}async _queryPrintForPdf(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:a}=await m({method:"post",url:w,responseType:"blob",params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return a}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,r=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),s=r[r.length-2],a=r[r.length-1],l=await n(`${P}/${s}/${a}`),c=o(null,e,l);if("preview"===e)return c}}_base64ToBlob(t,e){const i=window.atob(t);let r=i.length;const s=new Uint8Array(r);for(;r--;)s[r]=i.charCodeAt(r);return new Blob([s],{type:e})}async preview({iReportExecuteMode:t,templateId:e,formatId:i,params:r="",paramsArr:s,authorizationKey:n,signature:c,btnprint:h,messageTimeout:p=0},m,d){const g=a(i),y=this.getIReportFormatId(g,i);if(g&&(u||2==t)){const t=await this._queryPrintForPdf(e,y,r,n);if(!t)return null==d?void 0:d({type:"queryPrintDataFailure",result:"error",message:"获取文件失败!"});const i=o(t,"preview");return this.instance||(this.instance=l()),this.showPreview(this.instance,i),null==m?void 0:m({result:"success",message:"",file:t})}await this._queryProxyOrigin();const f=await this._testConnection();if(!this._handleResultTest(f,d))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:y,params:r,paramsArr:s,cmdid:this.isRemote?"7":"8",signature:c,btnprint:h,messageTimeout:p}),i=this._handleResult(t,d);if(!i)return!1;if(this.isRemote){const t=await this._browserPrint(i,"preview");this.instance||(this.instance=l()),this.showPreview(this.instance,t)}await this.getPicAndUpload(i),null==m||m(i)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e,result:"error"}:{message:e,result:"error"};null==d||d(i),this._handleMonitorNotify(i)}}async printSync(t,e,i){const r=t.map((t=>{const e={params:"",printdlgshow:"0",nobillnode:"1",btnprint:"1",...t,cmdid:"7",...t.signature?{signature:t.signature}:{}};if(e.print)try{e.print=JSON.parse(e.print)}catch(t){}return{inputData:e}}));try{const t=c(),s=await this.messageCollect(t,{exec:"printA",data:r});if(s&&Array.isArray(s)){s.some((t=>"success"===t.res.result))?null==e||e(s):(null==i||i(s),this._handleMonitorNotify(s))}else{const t="打印命令返回无效数据";this._handleMonitorNotify(s||""),null==i||i({type:"printError",message:t,result:"error",errinfo:t})}}catch(t){const e={error:t,result:"error",message:"打印失败"};null==i||i(e),this._handleMonitorNotify(e)}}async printDirect({iReportExecuteMode:t,templateId:e,formatId:i,params:r="",paramsArr:s,authorizationKey:n,print:o,signature:l,printdlgshow:c,nobillnode:h,copies:p,svrUpdateIp:m,isDownloadFile:d=!0,messageTimeout:g=0},y,f,w,v="printDirect"){const P=a(i),_=this.getIReportFormatId(P,i);if(P&&(u||2==t)){if(!await this._testDomesticSystemConnection())return void f({type:"notOpenedApp",result:"error",message:"请开启ihoPrint客户端"});return void(this._initDomesticSystem((async t=>{t?await this.printToHiPrint({templateId:e,formatId:_,params:r,authorizationKey:n},y,f,w):f({type:"connectAppFail",result:"error",message:"连接ihoPrint客户端失败"})}))&&await this.printToHiPrint({templateId:e,formatId:_,params:r,authorizationKey:n},y,f,w))}await this._queryProxyOrigin();const b=await this._testConnection();if(!this._handleResultTest(b,f))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:_,params:r,paramsArr:s,cmdid:"7",print:o,signature:l,printdlgshow:c,nobillnode:h,copies:p,svrUpdateIp:m,messageTimeout:g}),i=this._handleResult(t,f,w);if(!i)return!1;d&&["downloadPDF"].includes(v)&&await this._browserPrint(i,v),null==y||y(i)}catch(t){const e="printDirect"===v?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e,result:"error"}:{message:e,result:"error"};null==f||f(i),this._handleMonitorNotify(i)}}async printToHiPrint({templateId:t,formatId:e,params:i,authorizationKey:r},s,a,n){const o=await this._queryPrintForBase64(t,e,i,r);if(!o.success)return a({message:o.resultMsg,result:"error"});const{base64:l,formatId:c}=o.map;this.base64Fragment=l,this._successCallbackFn=s,this._errorCallbackFn=a,n&&(this._cancelCallbackFn=n),this.hiPrintSocket.emit("news",{printerList:this.printerList,type:"askPrinterTemplate",markTemplateId:c,pdf_stream:this.base64Fragment})}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):m.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}async downloadPDF(t,r,s){var n;const o=e(t);if(this.webview&&this.downloadPath&&(Reflect.has(o,"print")||Reflect.set(o,"print",{print:"1",type:"1"}),!o.print.filename)){const t=h(new Date,"yyyy-MM-dd"),e=c(),i=h(new Date,"yyyyMMddHHmmss")+e;o.print.filename=`${this.downloadPath}/${t}/${i}/${i}`.replace(/\\/g,"/")}const l=a(o.formatId);if(o.formatId=this.getIReportFormatId(l,o.formatId),l&&(u||2==o.iReportExecuteMode)){const t=await this._queryPrintForBase16(o.templateId||"",o.formatId,o.params||"",o.authorizationKey);return(null==t?void 0:t.success)?r({filebase64:null==(n=null==t?void 0:t.map)?void 0:n.hex,isIreport:!0}):null==s?void 0:s({type:"queryPrintDataFailure",result:"error",message:"获取文件失败!"})}this.printDirect(o,(async t=>{t||s({result:"error",message:""});const e=this,a=await async function(t){const r=[],s=JSON.parse(t);if(!i(s))return await e._downloadPDF("");if(1===s.length)return await e._downloadPDF(s[0]||"");for(let t=0,i=s.length;t<i;t++)r.push(await e._downloadPDF(s[t]||""));return r}(t.filedir);r(a,t)}),(t=>s(t)),(t=>{console.log(t)}),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:r=0},s,a){const n=await this._testConnection();if(!this._handleResultTest(n,a))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:r},void 0,a);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,a);if(!l)return!1;s&&s(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:r=0},s,a){const n=await this._testConnection();if(!this._handleResultTest(n,a))return!1;const o=await this._handleEventQueryPrintData(t,e,i,r,a);return!!o&&(s&&s(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},r,s){const a=await this._testConnection();if(!this._handleResultTest(a,s))return!1;const n=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(n,s);return!!o&&(r&&r(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:r,messageTimeout:s=0},a,n){const o=await this._testConnection();if(!this._handleResultTest(o,n))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:r,messageTimeout:s}),c=this._handleResult(l,n);if(!c)return!1;a&&a(c)}async addPrintFormat({templateId:t,params:e,token:i},r,s){const a=await this._testConnection();if(!this._handleResultTest(a,s))return!1;const n=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(n,s);if(!o)return!1;r&&r(o)}}export{b as Print};
|
1
|
+
import t from"axios";import{cloneDeep as e,isArray as i}from"lodash-es";import{IdentityVerificationDialog as r,PreviewDialog as s}from"./dialog.js";import{isIReport as a,getFileUrl as n,useBrowserPrint as o}from"./browserPrint.js";import{getCurrentInstance as l}from"vue";import{uuidGenerator as c}from"../../../../shared/utils/index.js";import{format as h}from"date-fns";import{io as p}from"socket.io-client";const u=String(navigator.platform).toLowerCase().includes("linux"),m=t.create({timeout:6e4,withCredentials:!1}),d=`${window.location.protocol}//${window.location.host}`,g=`${d}/fdp-api/print/assembly/printIReport`,y=`${d}/bi-api/reprot/print/open/client/printIReportForBase64`,f=`${d}/bi-api/reprot/print/open/client/printIReportForHex`,w=`${d}/bi-api/reprot/print/open/client/previewIReport`,v=`${d}/bi-api/reprot/print/open/client/getRemote`,P=`${d}/printService/file`;let _=null;class b{constructor(){var t,e,i;if(this.webview=null,this.dialog=new r,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.printDomesticOrigin="http://127.0.0.1:17521",this.isRemote=!1,this.CMonitor=null,this.queryServicesParams=null,this.isConnectHiPrint=!1,this.clientInfo=null,this.printerList=[],this.hiPrintSocket=null,this.base64Fragment="",this._successCallbackFn=null,this._errorCallbackFn=null,this._cancelCallbackFn=null,this.messageHandlerQueue=[],this.getIReportFormatId=(t,e)=>t?e.split("_")[1]:e,_)return _;_=this;const a=window;this.CMonitor=a.$CMonitor;try{this.webview=a.top?null==(t=a.top.chrome)?void 0:t.webview:null==(e=a.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(i=a.chrome)?void 0:i.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf","resetprint"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:r,reject:s}=e;try{if("resetprint"===(null==i?void 0:i.cmd))return void r({result:(null==i?void 0:i.res)?"success":"fail"});r(i.res||"")}catch(t){s(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}_initDomesticSystem(t){try{if(this.hiPrintSocket)return this.isConnectHiPrint;this.hiPrintSocket=p(this.printDomesticOrigin,{reconnection:!1,transports:["websocket"],auth:{token:"no-use-vue-plugin-hiprint"}}),this.hiPrintSocket&&(this.hiPrintSocket.on("connect",(()=>{this.isConnectHiPrint=!0})),this.hiPrintSocket.on("disconnect",(()=>{this.isConnectHiPrint=!1,this.hiPrintSocket=null})),this.hiPrintSocket.on("clientInfo",(t=>{console.log("获取到客户端信息>>>>>",t),t.clientUrl&&(this.clientInfo=t)})),this.hiPrintSocket.on("printerList",(e=>{console.log("获取到打印机列表信息>>>>>",e),this.printerList=e,t&&t(!0)})),this.hiPrintSocket.on("success",(t=>{console.log("打印成功>>>>>",t),this.base64Fragment="",this._successCallbackFn&&this._successCallbackFn(t)})),this.hiPrintSocket.on("replayPrinterTemplate",(t=>{console.log("获取到数据的回复>>>>>",t),t&&this.hiPrintSocket.emit("news",t)})),this.hiPrintSocket.on("error",(t=>{console.log("打印失败>>>>>",t),this.base64Fragment="","cancel"==(null==t?void 0:t.result)?this._cancelCallbackFn&&this._cancelCallbackFn(t):this._errorCallbackFn&&this._errorCallbackFn(t)})))}catch(e){console.log("ihoPrint系统连接失败",e),t&&t(!1)}}async getPicAndUpload(t){try{const e=t=>"[object Object]"===Object.prototype.toString.call(t);if("success"===(null==t?void 0:t.result)&&"Y"==(null==t?void 0:t.uploadTemplateFlag)&&!(null==t?void 0:t.filebase64)&&this.queryServicesParams){const t=e(this.queryServicesParams.params)?this.queryServicesParams.params:JSON.parse(this.queryServicesParams.params);t.uploadTemplateFlag="Y",this.queryServicesParams.params=JSON.stringify(t),this.queryServicesParams.cmdid="7",this.queryServicesParams.print={print:1,type:6,zip:0},this.queryServicesParams.paramsArr=[{params:JSON.stringify(t)}];await this._queryBase64ServicesPrint(this.queryServicesParams)}}catch(t){console.log(t)}finally{this.queryServicesParams=null}}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=c();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,r)=>{this.messageHandlerQueue.push({resolve:i,reject:r,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,r)=>{this.messageHandlerQueue.push({resolve:i,reject:r,id:t}),this.webview.postMessage(e)})),new Promise(((e,r)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),r({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testDomesticSystemConnection(){return new Promise((t=>{m({url:`${this.printDomesticOrigin}/test`,method:"get",withCredentials:!1,params:{}}).then((({data:e})=>{e.status?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{m({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}async resetPrinter(t,e){const i=a(t),r=this.getIReportFormatId(i,t);if(i&&(u||2==e)){return await this._testDomesticSystemConnection()?m({url:`${this.printDomesticOrigin}/resetPrint`,method:"get",withCredentials:!1,params:{formatId:r}}).then((({data:t})=>t.status?{type:"resetSuccess",result:"success",message:null==t?void 0:t.message}:{type:"resetError",result:"error",message:null==t?void 0:t.message})).catch((t=>({type:"resetError",result:"error",message:"重置打印机错误"}))):{type:"notOpenedApp",result:"error",message:"请开启ihoPrint客户端"}}return this.webview?this.postMessage({exec:"resetprint",data:{formatID:r}}):m({url:`${this.printOrigin}/services/printset`,method:"get",withCredentials:!1,params:{inputdata:r}}).then((({data:t})=>t))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_queryBase64ServicesPrint(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):m({url:this.printOrigin+"/services/Printqueue",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:r(i)}):m({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[r]}).then((({data:t})=>t));function r(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e,i){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:"error",errinfo:t}),!1}if("success"!==t.result){const r=t.message||t.Message;this._handleMonitorNotify(r);const s={type:"printError",message:r,result:t.result,errinfo:t.errinfo};return"cancel"==t.result?(i&&i({type:"printCancel",message:r,result:t.result,errinfo:t.errinfo}),!1):(null==e||e(s),!1)}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件",result:"error"}),!1)}async _handleEventQueryPrintData(t,e,i,r,s){const a={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:r},n=await this._queryServicesPrint(a);return this._handleQueryPrintDataResult(n,e,s)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({result:"error",type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,svrUpdateIp:i,params:r,paramsArr:s,cmdid:a,print:n,signature:o,copies:l,printdlgshow:c="0",nobillnode:p="1",btnprint:u="1",messageTimeout:m=0}){const d={templateId:t,formatId:e,svrUpdateIp:i,params:r,cmdid:a,nobillnode:p,printdlgshow:c,btnprint:u,copies:l,messageTimeout:m,...o?{signature:o}:{}};if(s&&(d.paramsArr=s),n){try{n=JSON.parse(n)}catch(t){}d.print=n}else if(this.isRemote){const t=h(new Date,"yyyyMMddHHmmss");d.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return this.queryServicesParams=d,await this._queryServicesPrint(d)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:r,messageTimeout:s=0}){const a={};let n={};try{n=Object.assign({},a,JSON.parse(i))}catch(t){n=a}const o={templateId:t,formatId:e,cmdid:"9",token:r,params:JSON.stringify(n),messageTimeout:s};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await m({method:"get",url:v})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=d+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await m({method:"post",url:g,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}paramsSerializer(t){return Object.keys(t).forEach((e=>{const i=t[e];t[e]=i,"biParams"==e&&(t[e]=encodeURIComponent(i))})),t}async _queryPrintForBase64(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:a}=await m({method:"post",url:y,params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return a}async _queryPrintForBase16(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:a}=await m({method:"post",url:f,params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return a}async _queryPrintForPdf(t,e,i="",r){const s="object"==typeof i?i:JSON.parse(i),{data:a}=await m({method:"post",url:w,responseType:"blob",params:{id:t,formatId:e,params:this.paramsSerializer(s),authorizationKey:r}})||{};return a}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,r=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),s=r[r.length-2],a=r[r.length-1],l=await n(`${P}/${s}/${a}`),c=o(null,e,l);if("preview"===e)return c}}_base64ToBlob(t,e){const i=window.atob(t);let r=i.length;const s=new Uint8Array(r);for(;r--;)s[r]=i.charCodeAt(r);return new Blob([s],{type:e})}async preview({iReportExecuteMode:t,templateId:e,formatId:i,params:r="",paramsArr:s,authorizationKey:n,signature:c,btnprint:h,messageTimeout:p=0},m,d){const g=a(i),y=this.getIReportFormatId(g,i);if(g&&(u||2==t)){const t=await this._queryPrintForPdf(e,y,r,n);if(!t)return null==d?void 0:d({type:"queryPrintDataFailure",result:"error",message:"获取文件失败!"});const i=o(t,"preview");return this.instance||(this.instance=l()),this.showPreview(this.instance,i),null==m?void 0:m({result:"success",message:"",file:t})}await this._queryProxyOrigin();const f=await this._testConnection();if(!this._handleResultTest(f,d))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:y,params:r,paramsArr:s,cmdid:this.isRemote?"7":"8",signature:c,btnprint:h,messageTimeout:p}),i=this._handleResult(t,d);if(!i)return!1;if(this.isRemote){const t=await this._browserPrint(i,"preview");this.instance||(this.instance=l()),this.showPreview(this.instance,t)}await this.getPicAndUpload(i),null==m||m(i)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e,result:"error"}:{message:e,result:"error"};null==d||d(i),this._handleMonitorNotify(i)}}async printSync(t,e,i){const r=t.map((t=>{const e={params:"",printdlgshow:"0",nobillnode:"1",btnprint:"1",...t,cmdid:"7",...t.signature?{signature:t.signature}:{}};if(e.print)try{e.print=JSON.parse(e.print)}catch(t){}return{inputData:e}}));try{const t=c(),s=await this.messageCollect(t,{exec:"printA",data:r});if(s&&Array.isArray(s)){s.some((t=>"success"===t.res.result))?null==e||e(s):(null==i||i(s),this._handleMonitorNotify(s))}else{const t="打印命令返回无效数据";this._handleMonitorNotify(s||""),null==i||i({type:"printError",message:t,result:"error",errinfo:t})}}catch(t){const e={error:t,result:"error",message:"打印失败"};null==i||i(e),this._handleMonitorNotify(e)}}async printDirect({iReportExecuteMode:t,templateId:e,formatId:i,params:r="",paramsArr:s,authorizationKey:n,print:o,signature:l,printdlgshow:c,nobillnode:h,copies:p,svrUpdateIp:m,isDownloadFile:d=!0,messageTimeout:g=0},y,f,w,v="printDirect"){const P=a(i),_=this.getIReportFormatId(P,i);if(P&&(u||2==t)){if(!await this._testDomesticSystemConnection())return void f({type:"notOpenedApp",result:"error",message:"请开启ihoPrint客户端"});return void(this._initDomesticSystem((async t=>{t?await this.printToHiPrint({templateId:e,formatId:_,params:r,authorizationKey:n},y,f,w):f({type:"connectAppFail",result:"error",message:"连接ihoPrint客户端失败"})}))&&await this.printToHiPrint({templateId:e,formatId:_,params:r,authorizationKey:n},y,f,w))}await this._queryProxyOrigin();const b=await this._testConnection();if(!this._handleResultTest(b,f))return!1;try{const t=await this._handleEventDirect({templateId:e,formatId:_,params:r,paramsArr:s,cmdid:"7",print:o,signature:l,printdlgshow:c,nobillnode:h,copies:p,svrUpdateIp:m,messageTimeout:g}),i=this._handleResult(t,f,w);if(!i)return!1;d&&["downloadPDF"].includes(v)&&await this._browserPrint(i,v),null==y||y(i)}catch(t){const e="printDirect"===v?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e,result:"error"}:{message:e,result:"error"};null==f||f(i),this._handleMonitorNotify(i)}}async printToHiPrint({templateId:t,formatId:e,params:i,authorizationKey:r},s,a,n){const o=await this._queryPrintForBase64(t,e,i,r);if(!o.success)return a({message:o.resultMsg,result:"error"});const{base64:l,formatId:c}=o.map;this.base64Fragment=l,this._successCallbackFn=s,this._errorCallbackFn=a,n&&(this._cancelCallbackFn=n),this.hiPrintSocket.emit("news",{printerList:this.printerList,type:"askPrinterTemplate",markTemplateId:c,pdf_stream:this.base64Fragment})}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):m.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}async downloadPDF(t,r,s){var n;const o=e(t);if(this.webview&&this.downloadPath&&(Reflect.has(o,"print")||Reflect.set(o,"print",{print:"1",type:"1"}),!o.print.filename)){const t=h(new Date,"yyyy-MM-dd"),e=c(),i=h(new Date,"yyyyMMddHHmmss")+e;o.print.filename=`${this.downloadPath}/${t}/${i}/${i}`.replace(/\\/g,"/")}const l=a(o.formatId);if(o.formatId=this.getIReportFormatId(l,o.formatId),l&&(u||2==o.iReportExecuteMode)){const t=await this._queryPrintForBase16(o.templateId||"",o.formatId,o.params||"",o.authorizationKey);return(null==t?void 0:t.success)?r({filebase64:null==(n=null==t?void 0:t.map)?void 0:n.hex,isIreport:!0}):null==s?void 0:s({type:"queryPrintDataFailure",result:"error",message:"获取文件失败!"})}this.printDirect(o,(async t=>{t||s({result:"error",message:""});const e=this,a=await async function(t){const r=[],s=JSON.parse(t);if(!i(s))return await e._downloadPDF("");if(1===s.length)return await e._downloadPDF(s[0]||"");for(let t=0,i=s.length;t<i;t++)r.push(await e._downloadPDF(s[t]||""));return r}(t.filedir);r(a,t)}),(t=>s(t)),(t=>{console.log(t)}),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:r=0},s,a){const n=await this._testConnection();if(!this._handleResultTest(n,a))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:r},void 0,a);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,a);if(!l)return!1;s&&s(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:r=0},s,a){const n=await this._testConnection();if(!this._handleResultTest(n,a))return!1;const o=await this._handleEventQueryPrintData(t,e,i,r,a);return!!o&&(s&&s(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},r,s){const a=await this._testConnection();if(!this._handleResultTest(a,s))return!1;const n=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(n,s);return!!o&&(r&&r(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:r,messageTimeout:s=0},a,n){const o=await this._testConnection();if(!this._handleResultTest(o,n))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:r,messageTimeout:s}),c=this._handleResult(l,n);if(!c)return!1;a&&a(c)}async addPrintFormat({templateId:t,params:e,token:i},r,s){const a=await this._testConnection();if(!this._handleResultTest(a,s))return!1;const n=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(n,s);if(!o)return!1;r&&r(o)}}export{b as Print};
|
@@ -1746,7 +1746,7 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
1746
1746
|
}>>;
|
1747
1747
|
getDynamicSelectData: (params: any, filterApiConfig: any) => Promise<any>;
|
1748
1748
|
emit: (event: "update:modelValue", ...args: any[]) => void;
|
1749
|
-
options: import("vue").Ref<
|
1749
|
+
options: import("vue").Ref<any[]>;
|
1750
1750
|
filterApiConfig: import("../../shared/types").AnyObject;
|
1751
1751
|
classifyFilterList: import("vue").Ref<import("../../shared/types").AnyObject[]>;
|
1752
1752
|
optionSetting: import("vue").ComputedRef<any>;
|
@@ -1210,7 +1210,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1210
1210
|
}>>;
|
1211
1211
|
getDynamicSelectData: (params: any, filterApiConfig: any) => Promise<any>;
|
1212
1212
|
emit: (event: "update:modelValue", ...args: any[]) => void;
|
1213
|
-
options: import("vue").Ref<
|
1213
|
+
options: import("vue").Ref<any[]>;
|
1214
1214
|
filterApiConfig: import("../../../../../shared/types").AnyObject;
|
1215
1215
|
classifyFilterList: import("vue").Ref<import("../../../../../shared/types").AnyObject[]>;
|
1216
1216
|
optionSetting: import("vue").ComputedRef<any>;
|
@@ -1504,7 +1504,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1504
1504
|
}>>;
|
1505
1505
|
getDynamicSelectData: (params: any, filterApiConfig: any) => Promise<any>;
|
1506
1506
|
emit: (event: "update:modelValue", ...args: any[]) => void;
|
1507
|
-
options: import("vue").Ref<
|
1507
|
+
options: import("vue").Ref<any[]>;
|
1508
1508
|
filterApiConfig: import("../../../../../shared/types").AnyObject;
|
1509
1509
|
classifyFilterList: import("vue").Ref<import("../../../../../shared/types").AnyObject[]>;
|
1510
1510
|
optionSetting: import("vue").ComputedRef<any>;
|
@@ -1748,7 +1748,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1748
1748
|
}>>;
|
1749
1749
|
getDynamicSelectData: (params: any, filterApiConfig: any) => Promise<any>;
|
1750
1750
|
emit: (event: "update:modelValue", ...args: any[]) => void;
|
1751
|
-
options: import("vue").Ref<
|
1751
|
+
options: import("vue").Ref<any[]>;
|
1752
1752
|
filterApiConfig: AnyObject;
|
1753
1753
|
classifyFilterList: import("vue").Ref<AnyObject[]>;
|
1754
1754
|
optionSetting: import("vue").ComputedRef<any>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as a,computed as l,onBeforeUnmount as n,watch as o,openBlock as r,createBlock as u,unref as
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as a,computed as l,onBeforeUnmount as n,watch as o,openBlock as r,createBlock as u,unref as d,isRef as s,createSlots as i,renderList as p,withCtx as c,renderSlot as y,nextTick as f}from"vue";import{NDatePicker as m}from"naive-ui";import"../../../shared/utils/index.js";import{useDateTime as v,handleInputEvent as h}from"../../../shared/hooks/useDateTime.js";import{isArray as g,isEqual as w,isString as D,isNumber as k}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{format as V,sub as S,startOfDay as _,endOfDay as A}from"date-fns";var I=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:[String,Array]},placeholder:{type:String},allowedInvalidValue:{type:String},to:{type:[Object,String,Boolean],default:"body"},holidays:{type:Array,default:()=>[]},type:{type:String,default:"date"}},emits:["update:formatted-value"],setup(e,{expose:I,emit:M}){const R=e,C=t(),$=a(null),b=a(null),j=a();let P="";const U=l({get:()=>z(R.formattedValue)?null:R.formattedValue,set(e){g(e)&&g(P)&&w(P,e)||P===e||(M("update:formatted-value",e,D(e)?Date.parse(e):g(e)?[Date.parse(e[0]),Date.parse(e[1])]:null),P=e)}}),q=l((()=>R.type.includes("datetime"))),x=l((()=>Reflect.get(C,"format")?C.format:q.value?"yyyy-MM-dd HH:mm:ss":"month"===R.type?"yyyy-MM":"year"===R.type?"yyyy":"yyyy-MM-dd")),E=l((()=>q.value?x.value.split(" "):"")),{focus:F,blur:H,handleConfirm:L}=v($,{formatRef:x,attrs:{...C,type:R.type},emit:M,allowedInvalidValue:R.allowedInvalidValue});async function B(e){!async function(e){var t;if(!e||!R.holidays.length)return;await f();const a=null==(t=$.value)?void 0:t.panelInstRef;if(!a)return;const l=a.$el;if(!l)return;O(),"daterange"===R.type?Y.push(n((()=>a.startDateArray),".n-date-panel-calendar--start .n-date-panel-dates>div"),n((()=>a.endDateArray),".n-date-panel-calendar--end .n-date-panel-dates>div")):"date"===R.type&&Y.push(n((()=>a.dateArray),".n-date-panel-calendar .n-date-panel-dates>div"));function n(e,t){const a=[],n=o(e,(e=>{a.forEach((e=>e.classList.remove("c-date-picker__holiday"))),a.length=0,g(e)&&Array.from(l.querySelectorAll(t)).forEach(((t,l)=>{const{ts:n}=e[l]||{};if(!k(n))return;const o=new Date(n);R.holidays.some((e=>e.getDate()===o.getDate()&&e.getMonth()===o.getMonth()&&e.getFullYear()===o.getFullYear()))&&(f((()=>t.classList.add("c-date-picker__holiday"))),a.push(t))}))}),{immediate:!0,deep:!0});return()=>{n(),a.length=0}}}(e),e&&q.value&&(await f(),async function e(t=0){var a;t>2||(b.value=null==(a=$.value)?void 0:a.panelInstRef,b.value?v(b,{formatRef:E,attrs:{...C,type:R.type},isPanel:!0}):(await f(),e(++t)))}())}const Y=[];function O(){Y.forEach((e=>e())),Y.length=0}async function T(...e){var t,a,l,n,o,r;const u=null==(n=null==(l=null==(a=null==(t=$.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(R.type.includes("range")?null==(o=R.onConfirm)||o.call(R,...e):(await f(),u.focus(),L(u),u.blur(),null==(r=R.onConfirm)||r.call(R,Date.parse(u.value),u.value)),!(null==u?void 0:u.value)||!R.updateUnchangedValue||R.type.includes("range"))return;const d=u.value;h(u,V(new Date,x.value)),h(u,d)}function z(e){return R.allowedInvalidValue&&R.allowedInvalidValue===e}return n(O),o((()=>R.formattedValue),(e=>{j.value=z(e)?e:R.placeholder?R.placeholder:"选择日期时间",z(e)||(P=e)}),{immediate:!0}),I({$datePicker:$,focus:F,blur:H,setShortcutValue:async function(e){if(!R.type||!R.type.includes("range")||!$.value)return;const t=$.value.$el.querySelectorAll(".n-input__input-el");let a,l;const n=new Date;if("week"===e){const e=S(n,{weeks:1});a=V(_(e),x.value)}else{const e=S(n,{months:1});a=V(_(e),x.value)}l=V(A(n),x.value),h(t[0],a),await f(),h(t[1],l)}}),(t,a)=>(r(),u(d(m),{ref_key:"datePickerRef",ref:$,"onUpdate:show":B,onConfirm:T,placeholder:j.value,to:e.to,type:e.type,"formatted-value":d(U),"onUpdate:formatted-value":a[0]||(a[0]=e=>s(U)?U.value=e:null)},i({_:2},[p(t.$slots,((e,a)=>({name:a,fn:c((()=>[y(t.$slots,a)]))})))]),1032,["placeholder","to","type","formatted-value"]))}});export{I as default};
|
@@ -363,7 +363,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
363
363
|
label: string;
|
364
364
|
value: number;
|
365
365
|
}[];
|
366
|
-
getSelectText: (field: string) =>
|
366
|
+
getSelectText: (field: string) => any;
|
367
367
|
selectProps: (field: string) => {
|
368
368
|
valueField: string;
|
369
369
|
labelField: string;
|
@@ -527,9 +527,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
527
527
|
}>;
|
528
528
|
developMode: boolean;
|
529
529
|
draggable: boolean;
|
530
|
+
isHighlightRow: boolean;
|
530
531
|
idx: number;
|
531
532
|
isHighlight: boolean;
|
532
|
-
isHighlightRow: boolean;
|
533
533
|
isFieldSet: boolean;
|
534
534
|
fieldDescribeMode: "column" | "tooltip";
|
535
535
|
hideExpressionOption: AnyObject[];
|
@@ -385,7 +385,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
385
385
|
label: string;
|
386
386
|
value: number;
|
387
387
|
}[];
|
388
|
-
getSelectText: (field: string) =>
|
388
|
+
getSelectText: (field: string) => any;
|
389
389
|
selectProps: (field: string) => {
|
390
390
|
valueField: string;
|
391
391
|
labelField: string;
|
@@ -549,9 +549,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
549
549
|
}>;
|
550
550
|
developMode: boolean;
|
551
551
|
draggable: boolean;
|
552
|
+
isHighlightRow: boolean;
|
552
553
|
idx: number;
|
553
554
|
isHighlight: boolean;
|
554
|
-
isHighlightRow: boolean;
|
555
555
|
isFieldSet: boolean;
|
556
556
|
fieldDescribeMode: "column" | "tooltip";
|
557
557
|
hideExpressionOption: AnyObject[];
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,reactive as
|
1
|
+
import{defineComponent as e,ref as t,reactive as i,watch as l,openBlock as a,createElementBlock as d,createElementVNode as r,Fragment as s,renderList as o,normalizeStyle as c,unref as n,createBlock as u,withCtx as p,createTextVNode as m,toDisplayString as f,createCommentVNode as h,createVNode as v,mergeProps as k,renderSlot as b}from"vue";import{NCheckbox as x,NPopconfirm as y,NButton as g}from"naive-ui";import _ from"../../../shared/components/VueDraggable/src/vuedraggable.js";import w from"./components/table-row.vue.js";import{cloneDeep as A}from"lodash-es";import{isShowExplicitRequired as F,setStyle as j}from"./utils/index.js";import{COLUMNLIST_MAP as C}from"./constants/filter.js";const R={class:"main-wrapper"},q={class:"main-wrapper__table"},V={class:"main-wrapper__table-header"},H={class:"main-wrapper__table-body",ref:"tableBodyRef"},S=["tabindex"],U={key:0,class:"main-wrapper__table-footer"};var E=e({__name:"FieldFilter",props:{footerFlag:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:E,emit:L}){const T=e,B=t([]),O=t([]),D=i({columns:B,data:O,onUpdateChecked:function({checked:e,column:t}){const i=!e||G(t.field);t.checkedAll=!i}}),N=()=>{L("save")},P=()=>{L("close")};function $(){O.value=A(T.defaultList),z(),L("reset")}function z(){B.value=Object.entries(C).map((([e,t])=>{const i=function(e){return e?["isShowSearch","filterExplicit","explicitRequired"].includes(e)?"checkbox":["optionType","defaultValue"].includes(e)?"select":["customTitle"].includes(e)?"input":["width"].includes(e)?"inputNumber":"text":"text"}(e),l={isShow:!0,title:t,type:i,field:e};return"checkbox"===i&&Object.assign(l,{checkedAll:!G(e),disabledAll:!1,isHeadCheckHide:["filterExplicit","explicitRequired"].includes(e)}),l}))}function G(e){return O.value.some((t=>("explicitRequired"!==e||F(t))&&!t[e]))}return l((()=>T.defaultList),(e=>{e.length>0&&(O.value=A(e),z())}),{immediate:!0,deep:!0}),E({getTableFields:()=>O.value}),(t,i)=>(a(),d("div",R,[r("div",q,[r("div",V,[(a(!0),d(s,null,o(B.value,((e,t)=>(a(),d(s,{key:t},[e.isShow?(a(),d("span",{key:0,class:"table-cell",style:c(n(j)(e,t))},[r("span",null,["checkbox"!==e.type||e.isHeadCheckHide?(a(),d(s,{key:1},[m(f(e.title),1)],64)):(a(),u(n(x),{key:0,checked:e.checkedAll,"onUpdate:checked":[t=>e.checkedAll=t,t=>{return i=t,l=e.field,void O.value.forEach((e=>{("explicitRequired"!==l||"explicitRequired"===l&&F(e))&&(e[l]=i)}));var i,l}],disabled:e.disabledAll},{default:p((()=>[m(f(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"]))])],4)):h("v-if",!0)],64)))),128))]),r("div",H,[v(n(_),{modelValue:O.value,"onUpdate:modelValue":i[0]||(i[0]=e=>O.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:t})=>[e.hide?h("v-if",!0):(a(),d("div",{key:0,class:"item",tabindex:t},[v(w,k(D,{element:e,idx:t+1}),null,16,["element","idx"])],8,S))])),_:1},8,["modelValue"])],512)]),e.footerFlag?(a(),d("div",U,[h(" 底部按钮插槽 "),b(t.$slots,"fieldFilterFooter",{},(()=>[v(n(y),{onPositiveClick:$},{trigger:p((()=>[v(n(g),{style:{"margin-right":"8px"}},{default:p((()=>[m("恢复默认设置")])),_:1})])),default:p((()=>[m(" 确认要恢复系统默认设置吗? ")])),_:1}),v(n(g),{style:{"margin-right":"8px"},onClick:P},{default:p((()=>[m("取消")])),_:1}),v(n(g),{type:"primary",onClick:N},{default:p((()=>[m("保存")])),_:1})]))])):h("v-if",!0)]))}});export{E as default};
|
@@ -553,7 +553,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
553
553
|
label: string;
|
554
554
|
value: number;
|
555
555
|
}[];
|
556
|
-
getSelectText: (field: string) =>
|
556
|
+
getSelectText: (field: string) => any;
|
557
557
|
selectProps: (field: string) => {
|
558
558
|
valueField: string;
|
559
559
|
labelField: string;
|
@@ -717,9 +717,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
717
717
|
}>;
|
718
718
|
developMode: boolean;
|
719
719
|
draggable: boolean;
|
720
|
+
isHighlightRow: boolean;
|
720
721
|
idx: number;
|
721
722
|
isHighlight: boolean;
|
722
|
-
isHighlightRow: boolean;
|
723
723
|
isFieldSet: boolean;
|
724
724
|
fieldDescribeMode: "column" | "tooltip";
|
725
725
|
hideExpressionOption: AnyObject[];
|
@@ -216,7 +216,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
216
216
|
label: string;
|
217
217
|
value: number;
|
218
218
|
}[];
|
219
|
-
getSelectText: (field: string) =>
|
219
|
+
getSelectText: (field: string) => any;
|
220
220
|
selectProps: (field: string) => {
|
221
221
|
valueField: string;
|
222
222
|
labelField: string;
|
@@ -380,9 +380,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
380
380
|
}>;
|
381
381
|
developMode: boolean;
|
382
382
|
draggable: boolean;
|
383
|
+
isHighlightRow: boolean;
|
383
384
|
idx: number;
|
384
385
|
isHighlight: boolean;
|
385
|
-
isHighlightRow: boolean;
|
386
386
|
isFieldSet: boolean;
|
387
387
|
fieldDescribeMode: "column" | "tooltip";
|
388
388
|
hideExpressionOption: AnyObject[];
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,openBlock as t,createElementBlock as l,Fragment as i,renderList as n,normalizeStyle as
|
1
|
+
import{defineComponent as e,openBlock as t,createElementBlock as l,Fragment as i,renderList as n,normalizeStyle as o,unref as r,createBlock as a,withCtx as d,createVNode as u,createCommentVNode as s,createElementVNode as c,toDisplayString as f,resolveDynamicComponent as p,normalizeClass as m,withDirectives as v,vShow as y,mergeProps as h,createTextVNode as g}from"vue";import{NTooltip as b,NIcon as k,NCheckbox as x,NPopover as E,NSpace as S,NSelect as T,NColorPicker as D,NInput as w,NInputNumber as O,NPopconfirm as C}from"naive-ui";import{setStyle as R,setColorInfo as M,isShowExplicitRequired as N,isDisable as U}from"../utils/index.js";import{ReorderTwoOutline as F,HelpCircleOutline as P,CaretDownOutline as _,CreateOutline as j,TrashOutline as A}from"@vicons/ionicons5";import{isFunction as L,isArray as H,range as I}from"lodash-es";import{COLOR_MAP as V}from"../constants/index.js";import{WIDGET_MAP as B,SELECT_TYPE as W,WIDGET_TYPE as q,SELECT_MAP as K,SELECT_DEFAULT_MAP as $,DATE_MAP as z,DATETIME_MAP as G}from"../constants/filter.js";const J={class:"row"},Q=["title"],X=c("span",null,"拖拽调整顺序",-1),Y={key:0};var Z=e({__name:"table-row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1},data:{type:Array,default:()=>[]},isHighlight:{type:Boolean},index:{type:Number,default:0},isHighlightRow:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},isFieldSet:{type:Boolean,default:!1},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object},hideExpressionOption:{type:Array,default:()=>[]},primaryKey:{type:String,default:"id"},titleRender:{type:Function}},emits:["updateChecked","edit"],setup(e,{emit:Z}){const ee=e,te=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],le=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],ie=[{label:"字体",value:"font"},{label:"背景",value:"background"}],ne=Object.entries(V).map((([e])=>e));function oe(){ee.data.splice(ee.index,1)}function re(){Z("edit",ee.element)}function ae(){var e;return ee.element.feildDescribe||(null==(e=ee.element.settingObj)?void 0:e.fieldDescDev)}function de(e){return"seq"===e?ee.idx:"type"===e?B[ee.element[e]]:ee.element[e]}function ue(e){if("defaultValue"===e){const{optionType:e}=ee.element;return e===W.SELECT_MULTIPLE}return!1}function se(e){if("0001"==ee.element.id&&"fixedWay"!=e)return!1;const{isConfiguredHeaderFilter:t}=ee.element;return"isShowHeaderFilter"===e?!!t:!(["explicitRequired","defaultValue"].includes(e)&&![q.DATE,q.DATETIME,q.SELECT].includes(ee.element.type)||["editable"].includes(e)&&ee.element[`${e}Hide`])}function ce(e){return["explicitRequired","defaultValue"].includes(e)?N(ee.element):!["isSum","isAvg"].includes(e)||"NUMBER"===ee.element.fieldType}function fe(e){const{relation:t}=ee.element;return"isSearch"===e&&H(null==t?void 0:t.fieldList)&&t.fieldList.length>0}function pe(e){var t,l;return"optionType"===e?(null==(l=null==(t=ee.element)?void 0:t.optionTypeConfig)?void 0:l.option)?"":ee.element[e]&&ee.element.type===q.SELECT?K[ee.element[e]]:" ":"hideExpression"===e?"PASSWORD"===ee.element.attrType?"密码无需设置":ee.element.name===ee.primaryKey||ee.element.columnName===ee.primaryKey?"主键不可设置":ee.element.disableDesensitization||ee.element[`${e}Disabled`]?"不支持脱敏设置":void 0:void 0}function me(e){const t={valueField:"value",labelField:"label"};return"hideExpression"===e&&(t.valueField="ruleId",t.labelField="name"),t}function ve(e){var t,l;switch(e.field){case"fixedWay":return te;case"sortDirection":return le;case"sortPriority":return function(){const e=I(1,ee.data.length+1).map((e=>({label:e.toString(),value:e}))),t=ee.data.filter((e=>!!e.sortPriority&&e.uuid!==ee.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!t.includes(e.value)))}();case"colorScope":return ie;case"hideExpression":return null==(t=ee.hideExpressionOption)?void 0:t.map((e=>({...e,ruleId:`ruleId#${e.code}`})));case"optionType":return(null==(l=ee.element.optionTypeConfig)?void 0:l.option)||[];case"defaultValue":{const{relatedFields:e=[]}=ee.element.optionTypeConfig||{},t=e.find((e=>"defaultValue"===e.field));if(L(null==t?void 0:t.getOption))return t.getOption(ee.element);const{type:l,optionInfo:i}=ee.element;return l===q.SELECT?H(null==i?void 0:i.list)&&i.list.length>0?i.list.map((e=>({...e,label:e.name}))):Object.entries($).map((([e,t])=>({value:e,label:t}))):l===q.DATE?Object.entries(z).map((([e,t])=>({value:e,label:t}))):l===q.DATETIME?Object.entries(G).map((([e,t])=>({value:e,label:t}))):[]}default:return[]}}function ye(e){var t;if(1==ee.element.defaultMark||"color"===e.type&&ee.isHighlightRow)return!0;if("checkbox"===e.type){if("show"===e.field&&e.fieldShowMaxValue)return!ee.element[e.field]&&(null==(t=ee.data.filter((t=>t[e.field])))?void 0:t.length)===e.fieldShowMaxValue;if(["isSearch","isSum","isAvg"].includes(e.field)){if(Reflect.has(ee.element,"isMerge"))return 1==ee.element.isMerge;if("isSearch"===e.field&&Reflect.has(ee.element,"notParticipatingSearch"))return 1==ee.element.notParticipatingSearch}return U(ee.element,e.field)}if("sortPriority"===e.field){const{sortDirection:e}=ee.element;return!e||"NONE"===e}return U(ee.element,e.field)}function he(e){return["title","result"].includes(e.field)&&ee.element.style||{}}return(N,U)=>(t(),l("div",J,[(t(!0),l(i,null,n(e.columns,((N,H)=>{return t(),l(i,{key:H},[N.isShow?(t(),l("span",{key:0,class:"table-cell",title:e.element[N.field],style:o(r(R)(N,H,e.columnWidthProps))},["text"===N.type?(t(),l(i,{key:0},[0===H?(t(),l(i,{key:0},[!e.isFieldSet||e.draggable&&e.isFieldSet?(t(),a(r(b),{key:0,trigger:"hover"},{trigger:d((()=>[u(r(k),{style:{"margin-right":"5px",top:"2px"},component:r(F)},null,8,["component"])])),default:d((()=>[X])),_:1})):s("v-if",!0),(I=N.field,"title"===I&&("tooltip"===ee.fieldDescribeMode&&ee.element.feildDescribe||ee.developMode&&(null==(V=ee.element.settingObj)?void 0:V.fieldDescDev))?(t(),a(r(b),{key:1,trigger:"hover"},{trigger:d((()=>[u(r(k),{style:{"margin-right":"5px",top:"2px"},component:r(P)},null,8,["component"])])),default:d((()=>[c("span",null,f(ae()),1)])),_:1})):s("v-if",!0)),r(L)(e.titleRender)?(t(),a(p((()=>e.titleRender(e.element))),{key:2})):s("v-if",!0)],64)):s("v-if",!0),0===H&&r(L)(e.titleRender)?s("v-if",!0):(t(),l("span",{key:1,class:m([e.isHighlight&&"title"===N.field?"highlight":""]),style:o(he(N))},f(de(N.field)),7))],64)):s("v-if",!0),"checkbox"===N.type&&se(N.field)?(t(),l(i,{key:1},[v(u(r(x),{disabled:ye(N),checked:e.element[N.field],"onUpdate:checked":[t=>e.element[N.field]=t,e=>function(e,t){Z("updateChecked",{checked:e,column:t})}(e,N)]},null,8,["disabled","checked","onUpdate:checked"]),[[y,ce(N.field)]]),fe(N.field)?(t(),a(r(E),{key:0,placement:"right-start","show-arrow":!1},{trigger:d((()=>[u(r(k),{style:{"margin-left":"5px",top:"2px"},component:r(_)},null,8,["component"])])),default:d((()=>[c("div",null,[c("span",null,f(e.element.relation.tableName),1),u(r(S),{"wrap-item":!1,vertical:""},{default:d((()=>[(t(!0),l(i,null,n(e.element.relation.fieldList,(e=>v((t(),a(r(x),{key:e.id,checked:e.checked,"onUpdate:checked":t=>e.checked=t,label:e.title},null,8,["checked","onUpdate:checked","label"])),[[y,"0001"!==e.sid]]))),128))])),_:1})])])),_:1})):s("v-if",!0)],64)):s("v-if",!0),"select"===N.type&&se(N.field)?(t(),l(i,{key:2},[pe(N.field)?(t(),l("span",Y,f(pe(N.field)),1)):v((t(),a(r(T),h({key:1},me(N.field),{clearable:"",multiple:ue(N.field),disabled:ye(N),value:e.element[N.field],"onUpdate:value":[t=>e.element[N.field]=t,e=>function(e,t){if("sortDirection"!==t.field||"NONE"!==e&&e||(ee.element.sortPriority=null),"colorScope"===t.field&&M(ee.element),"optionType"===t.field){const{relatedFields:e=[]}=ee.element.optionTypeConfig||{};e.forEach((e=>{ee.element[e.field]=null}))}}(e,N)],options:ve(N)}),null,16,["multiple","disabled","value","onUpdate:value","options"])),[[y,ce(N.field)]])],64)):s("v-if",!0),"color"===N.type?(t(),a(r(D),{key:3,class:"c-field-set__color-picker",clearable:"",disabled:ye(N),value:e.element[N.field],"onUpdate:value":[t=>e.element[N.field]=t,U[0]||(U[0]=t=>r(M)(e.element))],"show-preview":"",modes:["hex"],swatches:r(ne)},null,8,["disabled","value","onUpdate:value","swatches"])):s("v-if",!0),"input"===N.type?v((t(),a(r(w),{key:4,value:e.element[N.field],"onUpdate:value":t=>e.element[N.field]=t,clearable:""},null,8,["value","onUpdate:value"])),[[y,"0001"!=e.element.id]]):s("v-if",!0),"inputNumber"===N.type?(t(),a(r(O),{key:5,value:e.element[N.field],"onUpdate:value":t=>e.element[N.field]=t},null,8,["value","onUpdate:value"])):s("v-if",!0),"custom"===N.type&&r(L)(N.contentRender)?(t(),a(p((()=>N.contentRender(N,e.element))),{key:6})):s("v-if",!0),"custom"===N.type&&"opt"===N.field&&1!=e.element.defaultMark?(t(),l(i,{key:7},[u(r(b),{trigger:"hover"},{trigger:d((()=>[u(r(k),{component:r(j),onClick:re},null,8,["component"])])),default:d((()=>[g(" 编辑 ")])),_:1}),u(r(C),{onPositiveClick:oe},{trigger:d((()=>[u(r(b),{trigger:"hover"},{trigger:d((()=>[u(r(k),{component:r(A)},null,8,["component"])])),default:d((()=>[g(" 删除 ")])),_:1})])),default:d((()=>[g(" 是否确认删除? ")])),_:1})],64)):s("v-if",!0)],12,Q)):s("v-if",!0)],64);var I,V})),128))]))}});export{Z as default};
|
@@ -1900,7 +1900,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
1900
1900
|
prefix?: string | import("../../shared/types").AnyObject | (() => any) | undefined;
|
1901
1901
|
suffix?: string | import("../../shared/types").AnyObject | (() => any) | undefined;
|
1902
1902
|
allowSlash?: string | boolean | undefined;
|
1903
|
-
allowModify?: "
|
1903
|
+
allowModify?: import("..").FormCommonState | undefined;
|
1904
1904
|
show_key?: string | undefined;
|
1905
1905
|
whiteList?: string[] | undefined;
|
1906
1906
|
bordered?: string | boolean | undefined;
|
@@ -2148,7 +2148,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
2148
2148
|
prefix?: string | import("../../shared/types").AnyObject | (() => any) | undefined;
|
2149
2149
|
suffix?: string | import("../../shared/types").AnyObject | (() => any) | undefined;
|
2150
2150
|
allowSlash?: string | boolean | undefined;
|
2151
|
-
allowModify?: "
|
2151
|
+
allowModify?: import("..").FormCommonState | undefined;
|
2152
2152
|
show_key?: string | undefined;
|
2153
2153
|
whiteList?: string[] | undefined;
|
2154
2154
|
bordered?: string | boolean | undefined;
|
@@ -2367,7 +2367,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
2367
2367
|
prefix?: string | import("../../shared/types").AnyObject | (() => any) | undefined;
|
2368
2368
|
suffix?: string | import("../../shared/types").AnyObject | (() => any) | undefined;
|
2369
2369
|
allowSlash?: string | boolean | undefined;
|
2370
|
-
allowModify?: "
|
2370
|
+
allowModify?: import("..").FormCommonState | undefined;
|
2371
2371
|
show_key?: string | undefined;
|
2372
2372
|
whiteList?: string[] | undefined;
|
2373
2373
|
bordered?: string | boolean | undefined;
|
@@ -1903,7 +1903,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1903
1903
|
prefix?: string | import("../../../shared/types").AnyObject | (() => any) | undefined;
|
1904
1904
|
suffix?: string | import("../../../shared/types").AnyObject | (() => any) | undefined;
|
1905
1905
|
allowSlash?: string | boolean | undefined;
|
1906
|
-
allowModify?: "
|
1906
|
+
allowModify?: import("../../../components/form-render").FormCommonState | undefined;
|
1907
1907
|
show_key?: string | undefined;
|
1908
1908
|
whiteList?: string[] | undefined;
|
1909
1909
|
bordered?: string | boolean | undefined;
|
@@ -2151,7 +2151,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2151
2151
|
prefix?: string | import("../../../shared/types").AnyObject | (() => any) | undefined;
|
2152
2152
|
suffix?: string | import("../../../shared/types").AnyObject | (() => any) | undefined;
|
2153
2153
|
allowSlash?: string | boolean | undefined;
|
2154
|
-
allowModify?: "
|
2154
|
+
allowModify?: import("../../../components/form-render").FormCommonState | undefined;
|
2155
2155
|
show_key?: string | undefined;
|
2156
2156
|
whiteList?: string[] | undefined;
|
2157
2157
|
bordered?: string | boolean | undefined;
|
@@ -2370,7 +2370,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2370
2370
|
prefix?: string | import("../../../shared/types").AnyObject | (() => any) | undefined;
|
2371
2371
|
suffix?: string | import("../../../shared/types").AnyObject | (() => any) | undefined;
|
2372
2372
|
allowSlash?: string | boolean | undefined;
|
2373
|
-
allowModify?: "
|
2373
|
+
allowModify?: import("../../../components/form-render").FormCommonState | undefined;
|
2374
2374
|
show_key?: string | undefined;
|
2375
2375
|
whiteList?: string[] | undefined;
|
2376
2376
|
bordered?: string | boolean | undefined;
|