5 lines
6.0 KiB
Java
5 lines
6.0 KiB
Java
var u=(e,m,n)=>new Promise((r,s)=>{var a=t=>{try{i(n.next(t))}catch(d){s(d)}},l=t=>{try{i(n.throw(t))}catch(d){s(d)}},i=t=>t.done?r(t.value):Promise.resolve(t.value).then(a,l);i((n=n.apply(e,m)).next())});import{B as S}from"./index-BDvqZ5j4.js";import{B as A}from"./BasicForm-ClUSoD_-.js";import"./helper-DcLcf4v6.js";import{u as P}from"./useForm-D61zovon.js";import{f as V,c as B,b as N}from"./ThirdApp.api-DYcLsgfS.js";import{a as v}from"./useModal-DaJ3Bflg.js";import{e as F,r as h,y as g,z as I,A as R,K as k,H as _,f as E}from"./vue-vendor-DNhG1Cve.js";import{au as H}from"./index-X7Y8jykP.js";import{b as D}from"./index-CeNCCWzL.js";import"./BasicModal-xH56XuRZ.js";import"./ModalHeader-Sr8KwhJJ.js";import"./useTimeout-D5AmIBZw.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";import"./index-BzChaRPg.js";import"./useWindowSizeFn-C-0M9_Ul.js";import"./index-ByCwbQDV.js";import"./index-Upeu4GGa.js";import"./index-C4wWpZeQ.js";import"./index-M9QP6cvf.js";import"./Skeleton-CimgOdM7.js";import"./useScrollTo-0FPEw5-K.js";import"./useIntersectionObserver-BGOgyKyu.js";import"./useAppInject-DPZGPcR3.js";import"./index-CuWaQdlK.js";import"./index-DO7ZhK45.js";import"./BasicForm.vue_vue_type_style_index_0_lang-B29PWQy0.js";import"./index-saD4h7VJ.js";import"./useBreakpoint-DXhPW7nV.js";import"./useEventListener-BRXjwk7A.js";import"./breakpointEnum-BhAg6bcX.js";import"./uniqBy--vsL0WVB.js";const $=[{label:"id",field:"id",component:"Input",show:!1},{label:"thirdType",field:"thirdType",component:"Input",show:!1},{label:"CorpId/服务地址",field:"corpId",component:"Input",ifShow:({values:e})=>e.thirdType==="dingtalk"||e.thirdType==="kingdee",required:!0,componentProps:({formModel:e})=>({placeholder:(e==null?void 0:e.thirdType)==="kingdee"?"请输入金蝶服务地址,例如 https://xxx.xxx.com":"请输入CorpId"})},{label:"AgentId/账套ID",field:"agentId",component:"Input",required:!0,componentProps:({formModel:e})=>({placeholder:(e==null?void 0:e.thirdType)==="kingdee"?"请输入账套ID(可选业务标识)":"请输入AgentId"})},{label:"AppKey/AppId",field:"clientId",component:"Input",required:!0,componentProps:({formModel:e})=>({placeholder:(e==null?void 0:e.thirdType)==="kingdee"?"请输入金蝶AppId":"请输入AppKey"})},{label:"AppSecret",field:"clientSecret",component:"Input",required:!0,componentProps:({formModel:e})=>({placeholder:(e==null?void 0:e.thirdType)==="kingdee"?"请输入金蝶AppSecret":"请输入AppSecret"})},{label:"启用",field:"status",component:"Switch",componentProps:{checkedChildren:"关闭",checkedValue:1,unCheckedChildren:"开启",unCheckedValue:0},defaultValue:1},{label:"Stream事件推送",field:"streamEnabled",component:"Switch",ifShow:({values:e})=>e.thirdType==="dingtalk",componentProps:{checkedChildren:"已启用",checkedValue:1,unCheckedChildren:"未启用",unCheckedValue:0},helpMessage:"开启后,此应用的 AppKey/AppSecret 将用于接收钉钉 Stream 事件推送(审批结果等)。同一企业只需开启一个",defaultValue:0},{label:"限制接收节点",field:"streamReceiverEnabled",component:"Switch",ifShow:({values:e})=>e.thirdType==="dingtalk"&&e.streamEnabled===1,componentProps:{checkedChildren:"已限制",checkedValue:1,unCheckedChildren:"不限制",unCheckedValue:0},helpMessage:"开启后,仅下方白名单内的服务器会建立 Stream 连接并处理审批回调(推荐用 IP)",defaultValue:0},{label:"允许接收的IP",field:"streamDesignatedIps",component:"InputTextArea",ifShow:({values:e})=>e.thirdType==="dingtalk"&&e.streamEnabled===1&&e.streamReceiverEnabled===1,componentProps:{rows:2,placeholder:"多个 IP 用逗号分隔,例如 192.168.1.74(可参考页面展示的本机 IP)"}},{label:"允许接收的主机名",field:"streamDesignatedHosts",component:"Input",ifShow:({values:e})=>e.thirdType==="dingtalk"&&e.streamEnabled===1&&e.streamReceiverEnabled===1,componentProps:{placeholder:"可选,多个用逗号分隔(不如 IP 稳定)"}},{label:"集群Redis选主",field:"streamClusterMode",component:"Switch",ifShow:({values:e})=>e.thirdType==="dingtalk"&&e.streamEnabled===1,componentProps:{checkedChildren:"开启",checkedValue:1,unCheckedChildren:"关闭",unCheckedValue:0},helpMessage:"多实例共用同一 AppKey 时务必开启,避免多台服务器同时建连抢消息",defaultValue:1},{label:"租户id",field:"tenantId",component:"Input",show:!1}],x=F({name:"ThirdAppConfigModal",components:{BasicModal:S,BasicForm:A},setup(e,{emit:m}){const n=h("钉钉配置"),r=h(!1),s=h("本机 Stream 节点信息"),a=h(""),[l,{resetFields:i,setFieldsValue:t,validate:d}]=P({schemas:$,showActionButtonGroup:!1,labelCol:{span:24},wrapperCol:{span:24}}),[y,{setModalProps:f,closeModal:C}]=v(o=>u(null,null,function*(){if(f({confirmLoading:!0}),r.value=!1,a.value="",o.thirdType=="dingtalk"){n.value="钉钉配置";try{const p=yield B();if(p){r.value=!0;const b=Array.isArray(p.localIps)?p.localIps.join(", "):"",T=p.thisNodeReceiver?"是(本机将接收回调)":"否(本机不接收回调)";a.value=`主机名:${p.hostName||"-"}
|
||
本机IP:${b||"-"}
|
||
当前是否接收:${T}
|
||
提示:开启「限制接收节点」后,请将本机局域网 IP 填入「允许接收的IP」`}}catch(p){}}else o.thirdType=="kingdee"?n.value="金蝶配置":n.value="企业微信配置";yield i();let c=yield N({tenantId:o.tenantId,thirdType:o.thirdType});f({confirmLoading:!1}),c?yield t(c):yield t(o)}));function w(){return u(this,null,function*(){let o=yield d(),c=!1;o.id&&(c=!0),yield V(o,c),m("success"),C()})}return{title:n,showStreamNodeHint:r,streamNodeHintTitle:s,streamNodeHintDesc:a,registerForm:l,registerModal:y,handleSubmit:w}}});function K(e,m,n,r,s,a){const l=D,i=k("BasicForm"),t=k("BasicModal");return I(),g(t,{onRegister:e.registerModal,width:860,title:e.title,onOk:e.handleSubmit},{default:R(()=>[e.showStreamNodeHint?(I(),g(l,{key:0,type:"info","show-icon":"",style:{"margin-bottom":"12px"},message:e.streamNodeHintTitle,description:e.streamNodeHintDesc},null,8,["message","description"])):_("",!0),E(i,{onRegister:e.registerForm},null,8,["onRegister"])]),_:1},8,["onRegister","title","onOk"])}const ke=H(x,[["render",K]]);export{ke as default};
|