y9-interface-platform/y9vue-interfacePlatform/interface/assets/interfaceDialog-a751ab38.js

2 lines
33 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{y as et}from"./request-6d47a533.js";import{G as Vt,w as ht,B as Tt,b as tt,x as kt,H as It,E as xe,a as Rt,u as xt,d as qt,L as _t,M as Ct,s as Et,l as Lt,r as Nt,q as Ot,c as Bt,v as Ut,K as Pt,o as Ft,p as Jt}from"./element-plus-53a783a7.js";import"./vue-20eed888.js";import{u as At,b as me}from"./index-03a63030.js";import{u as at}from"./vue-i18n-d6e8419a.js";import{d as lt,G as rt,r as u,o as I,b as R,P as o,e as n,T as y,Q as Kt,a as Ce,U as Y,K as zt,S as x,k as r,n as Xe,ah as G,ai as qe,c as $t,u as re,L as Ye,i as Gt,F as Wt}from"./@vue-e95c845e.js";import{_ as it}from"./y9plugin-components-412bad23.js";import{b as Mt,c as Ht,m as Qe,d as _e,h as Xt}from"./interface-6c1bedf7.js";import{g as je,a as Yt}from"./systemidentifier-26774e0a.js";import{i as Qt}from"./interfaceAuth-23f23afd.js";import{p as Ze}from"./parameterTable-f92cb2bf.js";const Ee=et(),va=async T=>await Ee({url:"/api/rest/apply/getApplyInfoById",method:"GET",cType:!1,params:T}),ma=async T=>await Ee({url:"/api/rest/apply/getApplyListById",method:"GET",cType:!1,params:T}),ga=async T=>await Ee({url:"/api/rest/apply/downLoadSecret",method:"GET",cType:!1,params:T,responseType:"blob"}),ba=async T=>await Ee({url:"/api/rest/apply/findIsPass",method:"GET",cType:!1,params:T}),Le=et(),ya=async T=>await Le({url:"/api/rest/approve/getApproveList",method:"GET",cType:!1,params:T}),jt=async T=>await Le({url:"/api/rest/approve/getApproveById",method:"GET",cType:!1,params:T}),Zt=async T=>await Le({url:"/api/rest/approve/getApproveByInterfaceId",method:"GET",cType:!1,params:T}),ca=async T=>await Le({url:"/api/rest/approve/submit",method:"POST",cType:!1,JSON:!0,data:T}),ea=lt({__name:"flowShow",props:{openDialog:{type:Boolean,default:()=>!1},isView:{type:Boolean,default:()=>!1},type:{type:Boolean,default:()=>!1},interfaceId:{type:String},selectData:{type:String},applyType:{type:Boolean,default:()=>!1}},emits:["update:openDialog","update:selectData","update:type"],setup(T,{emit:Ne}){rt("sizeObjInfo"),At(),at(),u();const _=u([]),P=u(!0),a=T,Q=Ne,ge=u("审批详情"),be=u(1),Oe=u(0),j=u({}),ye=u("buttonDiv"),W=u("buttonDiv"),M=u(5),C=u(19);u("");const ce=u("N");function Be(V){be.value=1,_.value=[],j.value={},ye.value="buttonDiv",W.value="buttonDiv",Q("update:openDialog",!1),Q("update:type",!1)}function Z(V){Q("update:openDialog",!1),Q("update:type",!1)}function E(){P.value=!0,Oe.value=0;let V={id:a.interfaceId};a.type?(V.applyType=a.applyType,Zt(V).then(v=>{v.applyInfo!=null&&(j.value=v.applyInfo),v.data!=null&&(_.value=v.data,ce.value=v.data.isOver,console.log(_.value)),S()})):jt(V).then(v=>{v.applyInfo!=null&&(j.value=v.applyInfo),_.value=v.data,ce.value=v.data.isOver,S()})}function S(){let V=_.value;V.approveStatus=="不通过"?V.buttonDiv="buttonDiv refuseBtn":V.approveStatus=="通过"?V.buttonDiv="buttonDiv successBtn":V.buttonDiv="buttonDiv borderNone",P.value=!1}return(V,v)=>{const d=Vt,F=ht,ee=Tt,we=tt,J=kt,Se=It;return a.openDialog?(I(),R(J,{key:0,modelValue:a.openDialog,"onUpdate:modelValue":v[1]||(v[1]=ie=>a.openDialog=ie),title:ge.value,onClosed:Be,onOpened:E},{footer:o(()=>[n(we,{class:"el-button el-button--default global-btn-third",onClick:v[0]||(v[0]=ie=>Z("1"))},{default:o(()=>v[7]||(v[7]=[y("关闭")])),_:1})]),default:o(()=>[Kt((I(),R(ee,{class:"cardFont",shadow:"always"},{default:o(()=>[n(F,null,{default:o(()=>[n(d,{span:M.value},{default:o(()=>v[2]||(v[2]=[y("审批人员:")])),_:1},8,["span"]),n(d,{span:C.value},{default:o(()=>[Ce("div",null,Y(_.value.personName),1)]),_:1},8,["span"])]),_:1}),n(F,null,{default:o(()=>[n(d,{span:M.value},{default:o(()=>v[3]||(v[3]=[y("审批时间:")])),_:1},8,["span"]),n(d,{span:C.value},{default:o(()=>[Ce("div",null,Y(_.value.updateTime),1)]),_:1},8,["span"])]),_:1}),n(F,null,{default:o(()=>[n(d,{span:M.value},{default:o(()=>v[4]||(v[4]=[y("审批意见:")])),_:1},8,["span"]),n(d,{span:C.value},{default:o(()=>[Ce("div",{class:zt(_.value.buttonDiv)},Y(_.value.approveStatus),3)]),_:1},8,["span"])]),_:1}),n(F,null,{default:o(()=>[n(d,{span:M.value},{default:o(()=>v[5]||(v[5]=[y("审批说明:")])),_:1},8,["span"]),n(d,{span:C.value},{default:o(()=>[y(Y(_.value.illustrate),1)]),_:1},8,["span"])]),_:1}),n(F,null,{default:o(()=>[n(d,{span:M.value},{default:o(()=>v[6]||(v[6]=[y("备注:")])),_:1},8,["span"]),n(d,{span:C.value},{default:o(()=>[y(Y(_.value.notes),1)]),_:1},8,["span"])]),_:1})]),_:1})),[[Se,P.value]])]),_:1},8,["modelValue","title"])):x("",!0)}}});const wa=it(ea,[["__scopeId","data-v-be0995ab"],["__file","E:/workSpaceJDK11/y9-interface-platform/y9vue-interfacePlatform/src/views/interface/flowShow.vue"]]),ta=lt({__name:"interfaceDialog",props:{status:{type:String,default:()=>"其他"},isShow:{type:Boolean,default:()=>!0}},emits:["getDataListParent"],setup(T,{expose:Ne,emit:_}){const P=rt("sizeObjInfo"),{t:a}=at(),Q=u({});u();const ge=u(),be=u(),Oe=u(),j=u(),ye=u(),W=u(!1),M=u("webService信息补充"),C=u(!1),ce=u("配置限流信息"),Be=u(!1),Z=u(),E=u("false"),S=u("false"),V=u("false"),v=u(),d=u(!0),F=u("0"),ee=u("0"),we=u(!0),J=u(),Se=u("3"),ie=u(),Je=u("2"),Ae=u(),L=u("Rest"),Ue=u("N"),De=u(),Ve=u(),te=u("get"),Pe=u([]),A=u([]),ot=_,w=u({thresholdType:"0",limitTime:"",limitCount:"",thresholdVal:"",effect:"1",waitTime:""}),oe=T,he=(t,e,l)=>{let s=me("number",e,!0);s.valid?l():l(new Error(s.msg))},se=u(),st=u({thresholdType:[{required:!0,message:r(()=>a("阈值类型不能为空")),trigger:"blur"}],limitTime:[{required:!0,message:r(()=>a("限定时间不能为空")),trigger:"blur"},{validator:he,trigger:"blur"}],limitCount:[{required:!0,message:r(()=>a("限定访问量不能为空")),trigger:"blur"},{validator:he,trigger:"blur"}],thresholdVal:[{required:!0,message:r(()=>a("阈值不能为空")),trigger:"blur"},{validator:he,trigger:"blur"}],effect:[{required:!0,message:r(()=>a("流控效果不能为空")),trigger:"blur"}],waitTime:[{required:!0,message:r(()=>a("超时时间不能为空")),trigger:"blur"},{validator:he,trigger:"blur"}]}),Ke=u({}),h=u({}),ut=u({webSpecification:[{required:!0,message:r(()=>a("webService规范协议不能为空")),trigger:"blur"}],nameSpace:[{required:!0,message:r(()=>a("命名空间不能为空")),trigger:"blur"}],method:[{required:!0,message:r(()=>a("调用方法名不能为空")),trigger:"blur"}]}),ae=u(),ze=(t,e,l)=>{let s=me("nopreurl",e,!0);s.valid?l():l(new Error(s.msg))},nt=(t,e,l)=>{let s=me("special",e,!0);s.valid?l(new Error(s.msg)):l()},pt=(t,e,l)=>{let s=me("version",e,!0);if(!s.valid)l(new Error(s.msg));else{let c=e.substring(1).split(".");for(let p of c)isNaN(Number(p))&&l(new Error("版本格式错误,正确格式为V1.1.1错误格式为V1.01;V1..;V0.1等")),Ie(p)&&l(new Error("版本格式错误,正确格式为V1.1.1错误格式为V1.01;V1..;V0.1等")),Number(p).toString().length!=p.length&&l(new Error("版本格式错误,正确格式为V1.1.1错误格式为V1.01;V1..;V0.1等")),p<=0&&l(new Error("版本格式错误,正确格式为V1.1.1错误格式为V1.01;V1..;V0.1等"));l()}},dt=(t,e,l)=>{let s=me("phone",e,!0);s.valid?l():l(new Error(s.msg))};let k=u({show:!1,title:r(()=>a("新增接口")),margin:"5vh auto",showFooter:!0,onOkLoading:!0,onOk:t=>new Promise(async(e,l)=>{var f;const s=(f=ae.value)==null?void 0:f.elFormRef;ae.value.model.interfaceType=L.value,await s.validate(async c=>{if(c){let p=ae.value.model;if(p.interfaceType!="Rest"){if(Ie(h.value.webSpecification))return $("webService补充信息确认","webService补充信息页面存在未填信息请确认"),l(),!1;if(h.value.webSpecification=="JAX-WS"&&(Ie(h.value.nameSpace)||Ie(h.value.method)))return $("webService补充信息确认","webService补充信息页面存在未填信息请确认"),l(),!1}p.interfaceType!="Rest"&&(p.webSpecification=h.value.webSpecification,p.nameSpace=h.value.nameSpace,p.method=h.value.method),p.interfaceType=L.value,p.isOverwrite=Ue.value;let m=new FormData,D=[];if((S.value=="true"||S.value)&&(D=J.value.getCheckData(),D==null||D.length==0)){$("权限参数确认","已经开启鉴权,请至少选择一项权限参数"),l();return}v.value=D,p.limitInfo=JSON.stringify(w.value);let de=z(1,!0);if(typeof de=="boolean"){l();return}p.parameters=JSON.stringify(de);let O=[],fe="",B;if(te.value=="post"&&L.value=="Rest"){B=Ae.value.getTableData(),He(B,O);for(let g of O)JSON.parse(g.isItems)||(fe+=g.parameterKey+",")}else if(te.value=="get"||L.value!="Rest"){if(B=z(2,!0),typeof B=="boolean"){l();return}for(let g of B)fe+=g.parameterKey+","}if(S.value=="true"||S.value){let g=J.value.getCheckDataKeys(),ve=new Set;for(let i of g)ve.add(i);if(ve.size!=g.length){l(),$("权限参数确认","权限参数存在重复字段名称");return}let U="";for(let i of g)fe.indexOf(i+",")==-1&&(U+=i+",");if(U.length!=0){U=U.substring(0,U.length-1),l(),$("权限参数确认","权限参数:"+U+"没有在请求参数列表中体现。");return}let X=new Map;if(O.length!=0)for(let i of O)X.set(i.parameterKey,i);else for(let i of B)X.set(i.parameterKey,i);let Re=!1;for(let i of g)X.get(i).required=="否"&&(X.get(i).required="是",Re=!0);if(Re){l(),$("是否必填确认","请求参数列表中对应的数据请求范围参数的是否必填项已经自动变更为是请确认,数据请求范围的参数都是必填的");return}}p.reqParameters=JSON.stringify(B);for(let g of Pe.value)g.value==p.deptId&&(p.deptInfo=g.label);for(let g of A.value)g.value==p.systemId&&(p.systemName=g.label);let le=ie.value.getTableData();p.resParameters=JSON.stringify(le);for(let g in p)p[g]!=null&&g!="createTime"&&g!="updateTime"&&m.append(g,p[g]);p.isAuth=V.value==!0?"是":"否",p.isLimit=E.value==!0?"是":"否",p.isLimitData=S.value==!0?"是":"否",p.parameterIds=v.value==null?JSON.stringify([]):""+v.value,m.set("isAuth",V.value==!0?"是":"否"),m.set("isLimit",E.value==!0?"是":"否"),m.set("isLimitData",S.value==!0?"是":"否"),m.set("parameterIds",v.value==null?"":v.value);let q;ee.value=="0"?q=await Mt(p):ee.value=="1"&&(q=await Ht(p)),q.code==0&&(q.status=="success"?(xe({message:"数据保存成功",type:"success"}),we.value=!1,ot("getDataListParent"),e()):$("数据保存失败确认",q.msg)),l()}else l()})}),visibleChange:t=>{if(t)Xe(()=>{S.value&&J.value.initTableData()});else{let e=[];for(let l of b.value.itemList)l.prop!="interfaceFile"&&e.push(l);b.value.itemList=e,S.value&&J.value.restTable()}}});const N=u({headerBackground:!0,pageConfig:!1,editConfig:{trigger:"click",enable:!0,mode:"cell"},editRules:{parameterKey:[{required:!0,message:r(()=>a("参数key不能为空")),trigger:"blur"}],parameterType:[{required:!0,message:r(()=>a("参数类型不能为空")),trigger:"blur"}],required:[{required:!0,message:r(()=>a("是否必填不能为空")),trigger:"blur"}]},height:200,keepSource:!0,columns:[{type:"index",title:r(()=>a("序号")),width:80,fixed:"left"},{title:r(()=>a("参数key")),key:"parameterKey",editRender:{name:"input",useElement:!0}},{title:r(()=>a("参数类型")),key:"parameterType",editRender:{name:"select",useElement:!0,options:[{label:r(()=>a("String")),value:"String"},{label:r(()=>a("integer")),value:"integer"},{label:r(()=>a("double")),value:"double"},{label:r(()=>a("boolean")),value:"boolean"},{label:r(()=>a("number")),value:"number"}]}},{title:r(()=>a("是否必填")),key:"required",editRender:{name:"select",useElement:!0,options:[{value:"是",label:"是"},{value:"否",label:"否"}]}},{title:r(()=>a("参数描述")),key:"notes",editRender:{name:"input",useElement:!0}}],tableData:[]}),K=u({headerBackground:!0,pageConfig:!1,editConfig:{trigger:"click",enable:!0,mode:"cell"},height:200,editRules:{parameterKey:[{required:!0,message:r(()=>a("参数key不能为空")),trigger:"blur"}],parameterType:[{required:!0,message:r(()=>a("参数类型不能为空")),trigger:"blur"}],required:[{required:!0,message:r(()=>a("是否必填不能为空")),trigger:"blur"}]},keepSource:!0,columns:[{type:"index",title:r(()=>a("序号")),width:80,fixed:"left"},{title:r(()=>a("参数key")),key:"parameterKey",editRender:{name:"input",useElement:!0}},{title:r(()=>a("参数类型")),key:"parameterType",editRender:{name:"select",useElement:!0,options:[{label:r(()=>a("String")),value:"String"},{label:r(()=>a("integer")),value:"integer"},{label:r(()=>a("double")),value:"double"},{label:r(()=>a("boolean")),value:"boolean"},{label:r(()=>a("number")),value:"number"}]}},{title:r(()=>a("是否必填")),key:"required",editRender:{name:"select",useElement:!0,options:[{value:"是",label:"是"},{value:"否",label:"否"}]}},{title:r(()=>a("参数描述")),key:"notes",editRender:{name:"input",useElement:!0}}],tableData:[]}),H=u({headerBackground:!0,pageConfig:!1,editConfig:{trigger:"click",enable:!0,mode:"cell",autoClear:!1},height:200,keepSource:!0,editRules:{parameterKey:[{required:!0,message:r(()=>a("参数key不能为空")),trigger:"blur"}],parameterType:[{required:!0,message:r(()=>a("参数类型不能为空")),trigger:"blur"}],required:[{required:!0,message:r(()=>a("是否必填不能为空")),trigger:"blur"}]},columns:[{type:"index",title:r(()=>a("序号")),width:80,fixed:"left"},{title:r(()=>a("参数key")),key:"parameterKey",editRender:{name:"input",useElement:!0}},{title:r(()=>a("参数类型")),key:"parameterType",editRender:{name:"select",useElement:!0,options:[{value:"String",label:"String"},{value:"int",label:"int"},{value:"boolean",label:"boolean"},{value:"double",label:"double"}]}},{title:r(()=>a("是否必填")),key:"required",editRender:{name:"select",useElement:!0,options:[{value:"是",label:"是"},{value:"否",label:"否"}]}},{title:r(()=>a("参数描述")),key:"notes",editRender:{name:"input",useElement:!0}},{title:r(()=>a("操作")),width:100,fixed:"right",render:t=>{if(d.value)return G("div",[G("span",{onClick:()=>{Te(t.parameterStatus,t.id)},class:"operate"},a("删除"))])}}],tableData:[]}),$e=u({filtersValueCallBack:t=>{Q.value=t},itemList:[{type:"slot",slotName:"slotBtns",span:24,justify:"flex-end"}],showBorder:!0});let b=u({model:{},rules:{interfaceName:[{required:!0,message:r(()=>a("接口名称不能为空")),trigger:"blur"},{validator:nt,trigger:"blur"}],interfaceUrl:[{required:!0,message:r(()=>a("接口调用地址不能为空")),trigger:"blur"},{validator:ze,trigger:"blur"}],interfaceType:[{required:!0,message:r(()=>a("接口类型不能为空")),trigger:"blur"}],interfaceMethod:[{required:!0,message:r(()=>a("请求方式不能为空")),trigger:"blur"}],networkAgreement:[{required:!0,message:r(()=>a("网络协议不能为空")),trigger:"blur"}],head:[{required:!0,message:r(()=>a("接口负责人不能为空")),trigger:"blur"}],headPhone:[{required:!0,message:r(()=>a("接口负责人联系方式不能为空")),trigger:"blur"},{validator:dt,trigger:"blur"}],deptInfo:[{required:!0,message:r(()=>a("接口负责单位不能为空")),trigger:"blur"}],isOverwrite:[{required:!0,message:r(()=>a("是否覆盖更新不能为空")),trigger:"blur"}],version:[{required:!0,message:r(()=>a("版本不能为空")),trigger:"blur"},{validator:pt,trigger:"blur"}],url:[{required:!0,message:r(()=>a("请输入链接地址")),trigger:"blur"},{validator:ze,trigger:"blur"}],illustrate:[{required:!0,message:r(()=>a("接口描述不能为空")),trigger:"blur"}]},itemList:[{type:"input",label:r(()=>a("接口名称")),prop:"interfaceName",props:{maxlength:100}},{type:"slot",label:r(()=>a("接口类型")),prop:"interfaceType",props:{slotName:"interfaceType"}},{type:"select",label:r(()=>a("网络协议")),prop:"networkAgreement",props:{options:[{label:r(()=>a("http")),value:"http"},{label:r(()=>a("https")),value:"https"}],events:{change:t=>{b.value.model=ae.value.model;for(let e of b.value.itemList)e.prop=="interfaceUrl"&&(e.props.prependText=t+"://")}}}},{type:"input",label:r(()=>a("接口地址")),prop:"interfaceUrl",required:!0,props:{placeholder:"请输入接口地址例如www.baidu.com",maxlength:500,prependText:"http://"}},{type:"select",label:r(()=>a("请求方式")),prop:"interfaceMethod",props:{options:[{label:r(()=>a("get")),value:"get"},{label:r(()=>a("post")),value:"post"}],events:{change:t=>{te.value=t}}}},{type:"slot",label:r(()=>a("是否限流")),prop:"isLimit",props:{slotName:"isLimit"}},{type:"slot",label:r(()=>a("是否鉴权")),prop:"isLimit",props:{slotName:"isAuth"}},{type:"slot",label:r(()=>a("是否控制数据请求范围")),prop:"isLimitData",props:{slotName:"isLimitData"}},{type:"input",label:r(()=>a("接口负责人")),prop:"head",props:{maxlength:50}},{type:"input",label:r(()=>a("接口负责人联系方式")),prop:"headPhone",props:{placeholder:"请输入11位手机号",maxlength:11}},{type:"select",label:r(()=>a("接口负责人单位")),prop:"deptId",props:{maxlength:254,options:Pe.value,events:{change:t=>{b.value.model=ae.value.model;let e={pid:t};b.value.model.systemId="",je(e).then(l=>{A.value=[];for(let s of l.data){let f={label:s.name,value:s.id};A.value.push(f)}for(let s of b.value.itemList)s.prop=="systemId"&&(s.props.options=A.value)})}}}},{type:"select",label:r(()=>a("接口归属系统")),prop:"systemId",props:{maxlength:254,options:A.value}},{type:"input",label:r(()=>a("版本")),prop:"version",props:{placeholder:"请输入版本号。例如V1.1.1",maxlength:50}},{type:"textarea",label:r(()=>a("接口描述")),prop:"illustrate",props:{rows:3,maxlength:500}},{type:"slot",label:r(()=>a("请求头参数")),prop:"",props:{slotName:"parameterHeader"}},{type:"slot",label:r(()=>a("请求参数")),prop:"",props:{slotName:"parameter"}},{type:"slot",label:r(()=>a("返回参数")),prop:"",props:{slotName:"parameterResponse"}},{type:"textarea",label:r(()=>a("备注")),prop:"notes",props:{rows:3,maxlength:254}}],descriptionsFormConfig:{labelWidth:"200px",labelAlign:"center"}});function Ge(t){let e={id:""+Date.now(),parameterKey:"",parameterType:"",required:"",defaultVal:"",notes:"",parameterStatus:t,isItems:!1,pid:0,level:1};if(t==1){let l=z(t,!1);e.sort=l.length==0?1:l[l.length-1].sort+1,l.push(e),N.value.tableData=l}else if(t==2){let l=z(t,!1);e.sort=l.length==0?1:l[l.length-1].sort+1,l.push(e),K.value.tableData=l}else if(t==3){let l=z(t,!1);l.push(e),H.value.tableData=l}}function z(t,e){let l=[],s=[];t==1?(l=ge.value.vxeTableRef.getRecordset().updateRecords,s=N.value.tableData):t==2?(l=be.value.vxeTableRef.getRecordset().updateRecords,s=K.value.tableData):t==3&&(l=Oe.value.vxeTableRef.getRecordset().updateRecords,s=H.value.tableData);let f=[],c=0;for(let p of s)c<l.length&&p.id==l[c].id?(f.push(l[c]),c++):f.push(p);if(e){let p=1;for(let m of f){if(!Fe(m.parameterKey))return xe({type:"warning",message:(t==1?"请求头参数,":t==2?"请求参数,":t==3?"返回参数":"")+"第"+p+"行参数key不能为空"}),!1;if(!Fe(m.parameterType))return xe({type:"warning",message:(t==1?"请求头参数":t==2?"请求参数":t==3?"返回参数":"")+"第"+p+"行,参数类型不能为空"}),!1;if(!Fe(m.required))return xe({type:"warning",message:(t==1?"请求头参数":t==2?"请求参数":t==3?"返回参数":"")+"第"+p+"行,是否必填不能为空"}),!1;p++}}return f}function Fe(t){return!(t==null||t==null||t=="")}function Te(t,e){let l=[],s=[];if(t==1){l=z(t,!1);for(let f of l)f.id!=e&&s.push(f);N.value.tableData=s}else if(t==2){l=z(t,!1);for(let f of l)f.id!=e&&s.push(f);K.value.tableData=s}else if(t==3){l=z(t,!1);for(let f of l)f.id!=e&&s.push(f);H.value.tableData=s}}function ft(t){t==1?(C.value=!0,w.value=JSON.parse(JSON.stringify(se.value))):Be.value=!0}function We(t){if(t==1)C.value=!1,w.value=JSON.parse(JSON.stringify(se.value));else if(t==2){W.value=!1;let e=JSON.parse(JSON.stringify(Ke.value));h.value.method=e.method,h.value.nameSpace=e.nameSpace,h.value.webSpecification=e.webSpecification}}function Me(t){t==1?j.value.validate(e=>{if(e)C.value=!1,se.value=JSON.parse(JSON.stringify(w.value));else return!1}):t==2&&ye.value.validate(e=>{if(e)W.value=!1,Ke.value=JSON.parse(JSON.stringify(h.value));else return!1})}async function vt(){b.value.model={},pe();let t=await Qe();b.value.model.id=t.data,F.value=t.data,Z.value=t.data,E.value="false",S.value="false",V.value="false";for(let e of b.value.itemList)e.props==null?e.props={disabled:!1}:e.props.disabled=!1;ue("[]",!1),ne(t),k.value.okText="保存",k.value.title=r(()=>a("新增接口信息")),k.value.show=!0}async function mt(t){pe();let l=await _e({id:t});b.value.model=l.data;for(let s of b.value.itemList)s.props==null?s.props={disabled:!1}:s.props.disabled=!1;ke(l.data),ue(l.data.parameters,!1),ne(l),k.value.title=r(()=>a("编辑接口信息")),k.value.okText="保存",k.value.show=!0}async function gt(t){pe();let e={id:t},l=await _e(e);b.value.model=l.data;for(let c of b.value.itemList)c.props==null?c.props={disabled:!1}:c.props.disabled=!1;ke(l.data),ue(l.data.parameters,!1),ne(l);let s=await Qe(e);b.value.model.id=s.data,F.value=s.data,Z.value=s.data,ee.value="1";let f={type:"slot",label:r(()=>a("覆盖更新")),prop:"isOverwrite",props:{slotName:"isOverwrite"}};b.value.itemList.push(f),k.value.title=r(()=>a("接口版本升级维护信息")),k.value.okText="保存",k.value.show=!0}async function bt(t,e){pe();let s=await _e({id:t});b.value.model=s.data;for(let f of b.value.itemList)f.props==null?f.props={disabled:!0}:f.props.disabled=!0;ke(s.data),ue(s.data.parameters,!0),ne(s),k.value.okText=!1,k.value.title=r(()=>a("查看接口信息")),k.value.show=!0,oe.isShow=e}async function yt(t,e){pe();let s=await _e({id:t});b.value.model=s.data;let f=[];for(let c of b.value.itemList)if(c.props==null?c.props={disabled:!0}:c.props.disabled=!0,f.push(c),c.prop=="illustrate"){let p={type:"slot",label:r(()=>a("接口文档")),prop:"interfaceFile",props:{slotName:"interfaceFile"}};f.push(p)}b.value.itemList=f,ke(s.data),ue(s.data.parameters,!0),ne(s),k.value.okText=!1,k.value.title=r(()=>a("查看接口信息")),k.value.show=!0,oe.isShow=e}function ue(t,e){let l=JSON.parse(t),s=[],f=[],c=[];for(let m of l)m.parameterStatus=="1"&&s.push(m),m.parameterStatus=="2"&&f.push(m),m.parameterStatus=="3"&&c.push(m);d.value=!e,N.value.editConfig=d.value?{trigger:"click",enable:!0,mode:"cell"}:!1,N.value.tableData=s,K.value.editConfig=d.value?{trigger:"click",enable:!0,mode:"cell"}:!1,K.value.tableData=f,H.value.editConfig=d.value?{trigger:"click",enable:!0,mode:"cell"}:!1,H.value.tableData=c;let p=N.value.columns.length;if(d.value){let m={title:r(()=>a("操作")),width:100,fixed:"right",render:D=>{if(d.value)return G("div",[G("span",{onClick:()=>{Te(D.parameterStatus,D.id)},class:"operate"},a("删除"))])}};p==5&&N.value.columns.push(m)}if(d.value){let m={title:r(()=>a("操作")),width:100,fixed:"right",render:D=>{if(d.value)return G("div",[G("span",{onClick:()=>{Te(D.parameterStatus,D.id)},class:"operate"},a("删除"))])}};p==5&&K.value.columns.push(m)}if(d.value){let m={title:r(()=>a("操作")),width:100,fixed:"right",render:D=>{if(d.value)return G("div",[G("span",{onClick:()=>{Te(D.parameterStatus,D.id)},class:"operate"},a("删除"))])}};p==5&&H.value.columns.push(m)}d.value||p!=5&&(N.value.columns.pop(),K.value.columns.pop(),H.value.columns.pop())}function ne(t){t.data.reqParameters!=null?Ve.value=JSON.parse(t.data.reqParameters):Ve.value=[],t.data.resParameters!=null?De.value=JSON.parse(t.data.resParameters):De.value=[]}function ke(t,e){if(t.isLimit=="是"?E.value=!0:E.value=!1,t.isAuth=="是"?V.value=!0:V.value=!1,t.isLimitData=="是"?S.value=!0:S.value=!1,t.deptId!=null&&t.deptId!=null&&t.systemId!=null&&t.systemId!=null){let l={pid:t.deptId};je(l).then(s=>{A.value=[];for(let f of s.data){let c={label:f.name,value:f.id};A.value.push(c)}for(let f of b.value.itemList)f.prop=="systemId"&&(f.props.options=A.value)})}te.value=t.interfaceMethod,L.value=t.interfaceType,w.value=JSON.parse(t.limitInfo),se.value=JSON.parse(t.limitInfo),v.value=t.parameterIds,Z.value=t.id}function pe(){L.value="Rest",w.value={thresholdType:"0",limitTime:"",limitCount:"",thresholdVal:"",effect:"1",waitTime:""},se.value={thresholdType:"0",limitTime:"",limitCount:"",thresholdVal:"",effect:"1",waitTime:""},v.value="",we.value=!0,ee.value="0";let t=[];for(let e of b.value.itemList)e.prop!="isOverwrite"&&t.push(e);b.value.itemList=t}function $(t,e){Rt.alert(e,t,{confirmButtonText:"确认"})}function He(t,e){if(t!=null)for(let l of t)l.children instanceof Array&&He(l.children,e),e.push(l)}const ct=()=>{S.value&&Xe(()=>{J.value.initTableData()})},wt=()=>{W.value=!0},Ie=t=>t==null||t==null||t=="";let St={parameterType:0};const Dt=()=>{Xt(b.value.model.interfaceFileUrl).then(t=>{const e=[];e.push(t);const l=window.URL.createObjectURL(new Blob(e,{type:"application/pdf"}));window.open(l)})};return Yt(St).then(t=>{for(let e of t.data){let l={label:e.name,value:e.id};Pe.value.push(l)}}),Ne({addDialog:vt,edit:mt,view:bt,updateVersion:gt,approveView:yt}),(t,e)=>{const l=xt,s=qe("Warning"),f=qt,c=_t,p=Ct,m=Et,D=tt,de=qe("y9VxeTable"),O=Lt,fe=qe("y9Form"),B=qe("y9Dialog"),le=Nt,q=Ot,g=Bt,ve=Ut,U=Pt,X=Ft,Re=Jt;return I(),$t(Wt,null,[n(B,{config:re(k),"onUpdate:config":e[20]||(e[20]=i=>Gt(k)?k.value=i:k=i)},{default:o(()=>[n(fe,{ref_key:"ruleFormRef",ref:ae,config:re(b)},{isLimit:o(()=>[n(l,{disabled:!d.value,modelValue:E.value,"onUpdate:modelValue":e[0]||(e[0]=i=>E.value=i),"active-text":"是","inactive-text":"否"},null,8,["disabled","modelValue"]),E.value?(I(),R(c,{key:0,effect:"light",content:"点击配置限流信息",placement:"top-start"},{default:o(()=>[n(f,{class:"operate",onClick:e[1]||(e[1]=i=>ft("1"))},{default:o(()=>[n(s)]),_:1})]),_:1})):x("",!0)]),isAuth:o(()=>[n(l,{disabled:!d.value,modelValue:V.value,"onUpdate:modelValue":e[2]||(e[2]=i=>V.value=i),"active-text":"是","inactive-text":"否"},null,8,["disabled","modelValue"])]),isLimitData:o(()=>[n(l,{disabled:!d.value,modelValue:S.value,"onUpdate:modelValue":e[3]||(e[3]=i=>S.value=i),"active-text":"是","inactive-text":"否",onClick:ct},null,8,["disabled","modelValue"])]),interfaceType:o(()=>[n(m,{modelValue:L.value,"onUpdate:modelValue":e[5]||(e[5]=i=>L.value=i),disabled:!d.value},{default:o(()=>[n(p,{label:"Rest",value:"Rest"}),n(p,{label:"webService",value:"webService",onClick:e[4]||(e[4]=i=>wt())})]),_:1},8,["modelValue","disabled"])]),isOverwrite:o(()=>[n(m,{modelValue:Ue.value,"onUpdate:modelValue":e[6]||(e[6]=i=>Ue.value=i),onChange:e[7]||(e[7]=i=>{i=="Y"&&$("覆盖更新确认","覆盖更新将会在接口审批通过后替换原接口")})},{default:o(()=>[n(p,{label:"否",value:"N"}),n(p,{label:"是",value:"Y"})]),_:1},8,["modelValue"])]),parameterHeader:o(()=>[n(de,{ref_key:"editRequestHeaderRef",ref:ge,config:N.value,filterConfig:$e.value},{slotBtns:o(()=>[d.value?(I(),R(D,{key:0,size:re(P).buttonSize,style:Ye({fontSize:re(P).baseFontSize}),class:"global-btn-main",type:"primary",onClick:e[8]||(e[8]=i=>Ge("1"))},{default:o(()=>[y(Y(t.$t("新增")),1)]),_:1},8,["size","style"])):x("",!0)]),_:1},8,["config","filterConfig"])]),parameter:o(()=>[oe.isShow?(I(),R(O,{key:0,"content-position":"left"},{default:o(()=>e[36]||(e[36]=[y("请求参数列表")])),_:1})):x("",!0),te.value=="get"||L.value!="Rest"?(I(),R(de,{key:1,ref_key:"editRequestRef",ref:be,config:K.value,filterConfig:$e.value},{slotBtns:o(()=>[d.value?(I(),R(D,{key:0,size:re(P).buttonSize,style:Ye({fontSize:re(P).baseFontSize}),class:"global-btn-main",type:"primary",onClick:e[9]||(e[9]=i=>Ge("2"))},{default:o(()=>[y(Y(t.$t("新增")),1)]),_:1},8,["size","style"])):x("",!0)]),_:1},8,["config","filterConfig"])):x("",!0),te.value=="post"&&L.value=="Rest"?(I(),R(Ze,{key:2,ref_key:"requestParameterRef",ref:Ae,parameterStatus:Je.value,"onUpdate:parameterStatus":e[10]||(e[10]=i=>Je.value=i),data:Ve.value,"onUpdate:data":e[11]||(e[11]=i=>Ve.value=i),isView:d.value,"onUpdate:isView":e[12]||(e[12]=i=>d.value=i)},null,8,["parameterStatus","data","isView"])):x("",!0),S.value?(I(),R(O,{key:3,"content-position":"left"},{default:o(()=>e[37]||(e[37]=[y("数据请求范围("),Ce("span",{style:{color:"red"}},"此处选中的参数需要在上方请求参数列表出现。不可选择相同参数key的参数",-1),y("")])),_:1})):x("",!0),S.value?(I(),R(Qt,{key:4,isView:d.value,"onUpdate:isView":e[13]||(e[13]=i=>d.value=i),isShow:oe.isShow,"onUpdate:isShow":e[14]||(e[14]=i=>oe.isShow=i),isDisabled:S.value,"onUpdate:isDisabled":e[15]||(e[15]=i=>S.value=i),ref_key:"authRef",ref:J,interfaceId:Z.value,selectData:v.value,"onUpdate:selectData":e[16]||(e[16]=i=>v.value=i)},null,8,["isView","isShow","isDisabled","interfaceId","selectData"])):x("",!0)]),parameterResponse:o(()=>[n(Ze,{ref_key:"responseParameterRef",ref:ie,parameterStatus:Se.value,"onUpdate:parameterStatus":e[17]||(e[17]=i=>Se.value=i),data:De.value,"onUpdate:data":e[18]||(e[18]=i=>De.value=i),isView:d.value,"onUpdate:isView":e[19]||(e[19]=i=>d.value=i)},null,8,["parameterStatus","data","isView"])]),interfaceFile:o(()=>[n(D,{onClick:Dt},{default:o(()=>e[38]||(e[38]=[y("预览接口文档")])),_:1})]),_:1},8,["config"])]),_:1},8,["config"]),n(U,{modelValue:C.value,"onUpdate:modelValue":e[29]||(e[29]=i=>C.value=i),title:ce.value},{footer:o(()=>[d.value?(I(),R(D,{key:0,class:"el-button el-button--primary el-button--default global-btn-main",onClick:e[27]||(e[27]=i=>Me("1"))},{default:o(()=>e[47]||(e[47]=[y("确定")])),_:1})):x("",!0),n(D,{onClick:e[28]||(e[28]=i=>We("1"))},{default:o(()=>e[48]||(e[48]=[y("取消")])),_:1})]),default:o(()=>[n(O),n(ve,{ref_key:"limitInfoRef",ref:j,model:w.value,"label-width":"140px",rules:st.value},{default:o(()=>[n(q,{label:"阈值类型",prop:"thresholdType"},{default:o(()=>[n(m,{modelValue:w.value.thresholdType,"onUpdate:modelValue":e[21]||(e[21]=i=>w.value.thresholdType=i),disabled:!d.value},{default:o(()=>[n(le,{value:"0"},{default:o(()=>e[39]||(e[39]=[y("自定义")])),_:1}),n(le,{value:"1"},{default:o(()=>e[40]||(e[40]=[y("QPS")])),_:1})]),_:1},8,["modelValue","disabled"])]),_:1}),w.value.thresholdType==0?(I(),R(q,{key:0,label:"限定时间",prop:"limitTime"},{default:o(()=>[n(g,{modelValue:w.value.limitTime,"onUpdate:modelValue":e[22]||(e[22]=i=>w.value.limitTime=i),disabled:!d.value,placeholder:"请输入,单位:秒",maxlength:"7"},{append:o(()=>e[41]||(e[41]=[y("秒")])),_:1},8,["modelValue","disabled"])]),_:1})):x("",!0),w.value.thresholdType==0?(I(),R(q,{key:1,label:"限定时间内访问量",prop:"limitCount"},{default:o(()=>[n(g,{modelValue:w.value.limitCount,"onUpdate:modelValue":e[23]||(e[23]=i=>w.value.limitCount=i),disabled:!d.value,placeholder:"请输入次数",maxlength:"7"},{append:o(()=>e[42]||(e[42]=[y("次数")])),_:1},8,["modelValue","disabled"])]),_:1})):x("",!0),w.value.thresholdType==1?(I(),R(q,{key:2,label:"阈值",prop:"thresholdVal"},{default:o(()=>[n(g,{modelValue:w.value.thresholdVal,"onUpdate:modelValue":e[24]||(e[24]=i=>w.value.thresholdVal=i),disabled:!d.value,placeholder:"请输入",maxlength:"7"},{append:o(()=>e[43]||(e[43]=[y("次数/秒")])),_:1},8,["modelValue","disabled"])]),_:1})):x("",!0),n(q,{label:"流控效果",prop:"effect"},{default:o(()=>[n(m,{modelValue:w.value.effect,"onUpdate:modelValue":e[25]||(e[25]=i=>w.value.effect=i),disabled:!d.value},{default:o(()=>[n(le,{value:"1"},{default:o(()=>e[44]||(e[44]=[y("快速失败")])),_:1}),n(le,{value:"3"},{default:o(()=>e[45]||(e[45]=[y("排队等候")])),_:1})]),_:1},8,["modelValue","disabled"])]),_:1}),w.value.effect==3?(I(),R(q,{key:3,label:"超时时间",prop:"waitTime"},{default:o(()=>[n(g,{modelValue:w.value.waitTime,"onUpdate:modelValue":e[26]||(e[26]=i=>w.value.waitTime=i),disabled:!d.value,placeholder:"请输入,单位:毫秒",maxlength:"9"},{append:o(()=>e[46]||(e[46]=[y("毫秒")])),_:1},8,["modelValue","disabled"])]),_:1})):x("",!0)]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"]),n(U,{modelValue:W.value,"onUpdate:modelValue":e[35]||(e[35]=i=>W.value=i),title:M.value},{footer:o(()=>[d.value?(I(),R(D,{key:0,class:"el-button el-button--primary el-button--default global-btn-main",onClick:e[33]||(e[33]=i=>Me("2"))},{default:o(()=>e[49]||(e[49]=[y("确定")])),_:1})):x("",!0),n(D,{onClick:e[34]||(e[34]=i=>We("2"))},{default:o(()=>e[50]||(e[50]=[y("取消")])),_:1})]),default:o(()=>[n(O),n(ve,{ref_key:"webServiceRef",ref:ye,model:h.value,"label-width":"155px",rules:ut.value},{default:o(()=>[n(q,{label:"webService规范协议",prop:"webSpecification"},{default:o(()=>[n(Re,{modelValue:h.value.webSpecification,"onUpdate:modelValue":e[30]||(e[30]=i=>h.value.webSpecification=i),placeholder:"请选择webService规范协议",disabled:!d.value},{default:o(()=>[n(X,{label:"JAX-WS",value:"JAX-WS"}),n(X,{label:"JAX-RS",value:"JAX-RS"})]),_:1},8,["modelValue","disabled"])]),_:1}),h.value.webSpecification=="JAX-WS"?(I(),R(q,{key:0,label:"命名空间",prop:"nameSpace"},{default:o(()=>[n(g,{modelValue:h.value.nameSpace,"onUpdate:modelValue":e[31]||(e[31]=i=>h.value.nameSpace=i),disabled:!d.value,placeholder:"请输入命名空间",maxlength:"300"},null,8,["modelValue","disabled"])]),_:1})):x("",!0),h.value.webSpecification=="JAX-WS"?(I(),R(q,{key:1,label:"调用方法名",prop:"method"},{default:o(()=>[n(g,{modelValue:h.value.method,"onUpdate:modelValue":e[32]||(e[32]=i=>h.value.method=i),disabled:!d.value,placeholder:"请输入调用方法名",maxlength:"300"},null,8,["modelValue","disabled"])]),_:1})):x("",!0)]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])],64)}}});const Sa=it(ta,[["__file","E:/workSpaceJDK11/y9-interface-platform/y9vue-interfacePlatform/src/views/interface/interfaceDialog.vue"]]);export{ma as a,ba as b,jt as c,ga as d,ya as e,wa as f,va as g,Sa as i,ca as s};