y9-interface-platform/y9vue-interfacePlatform/interface/assets/interfaceRegister-7f9459b8.js

2 lines
31 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{E as H,a as wt,G as Vt,b as kt,w as Dt,u as ht,d as Rt,L as Tt,M as xt,s as qt,o as Ct,p as It,l as Et,t as Nt,r as Ut,q as Ot,c as Lt,v as Jt,K as Pt,H as zt}from"./element-plus-53a783a7.js";import"./vue-20eed888.js";import{u as Ft,b as re}from"./index-03a63030.js";import{u as Bt}from"./vue-i18n-d6e8419a.js";import{m as Xe,d as Re,b as _t,c as $t}from"./interface-6c1bedf7.js";import{g as At,a as Kt}from"./systemidentifier-26774e0a.js";import{i as Wt}from"./interfaceAuth-23f23afd.js";import{p as Ge}from"./parameterTable-f92cb2bf.js";import{b as Mt,u as jt}from"./vue-router-e03c3082.js";import{d as Ht,G as Xt,r as u,k as a,n as Te,ah as X,ai as xe,o as g,c as Ye,Q as Gt,e as n,P as o,a as h,b as S,U as G,S as w,u as J,L as Se,T as D,F as Yt}from"./@vue-e95c845e.js";import{_ as Qt}from"./y9plugin-components-412bad23.js";import"./lodash-es-2e98bc53.js";import"./@vueuse-409d7ed5.js";import"./@element-plus-57b52633.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-e13f206c.js";import"./axios-db0ed51e.js";import"./async-validator-20f92749.js";import"./memoize-one-297ddbcb.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-606f2ab9.js";import"./lodash-11751b8b.js";import"./pinia-22d008e7.js";import"./nprogress-e9cc33fd.js";/* empty css *//* empty css *//* empty css */import"./y9plugin-sso-6f4b3ca3.js";import"./y9plugin-watermark-e18d3181.js";import"./@intlify-d4a3a758.js";import"./v-viewer-decd5d79.js";import"./viewerjs-c43574b2.js";import"./vxe-table-3ccf2bcd.js";import"./xe-utils-90392958.js";import"./dom-zindex-d72a3c32.js";import"./request-6d47a533.js";import"./authInterface-473123dc.js";const Zt={style:{padding:"15px","background-color":"#ffffff"},"element-loading-text":"加载中..."},el={class:"btnDiv"},tl=Ht({__name:"interfaceRegister",props:{status:{type:String,default:()=>"其他"},isShow:{type:Boolean,default:()=>!0}},emits:["getDataListParent"],setup(Qe,{expose:Ze,emit:ll}){const P=Xt("sizeObjInfo"),R=u(!1);Ft(),Mt();const{t:l}=Bt(),et=u({});u();const ie=u([]),se=u([]),qe=u(),Ce=u(),tt=u(),Ie=u(),Ee=u(),Y=u(!1),lt=u("webService信息补充"),Q=u(!1),at=u("配置限流信息"),rt=u(!1),oe=u(),B=u("false"),V=u(!1),$=u("false"),C=u(),d=u(!0),Ne=u("0"),ue=u("0"),Ue=u(!0),_=u(),Oe=u("3"),Le=u(),Je=u("2"),Pe=u(),T=u("Rest"),we=u("N"),ne=u(),de=u(),A=u("get"),it=jt(),ze=u(""),Ve=u([]),Z=u([]),v=u({thresholdType:"0",limitTime:"",limitCount:"",thresholdVal:"",effect:"1",waitTime:""}),pe=Qe,me=(t,e,i)=>{let r=re("number",e,!0);r.valid?i():i(new Error(r.msg))},ee=u(),st=u({thresholdType:[{required:!0,message:a(()=>l("阈值类型不能为空")),trigger:"blur"}],limitTime:[{required:!0,message:a(()=>l("限定时间不能为空")),trigger:"blur"},{validator:me,trigger:"blur"}],limitCount:[{required:!0,message:a(()=>l("限定访问量不能为空")),trigger:"blur"},{validator:me,trigger:"blur"}],thresholdVal:[{required:!0,message:a(()=>l("阈值不能为空")),trigger:"blur"},{validator:me,trigger:"blur"}],effect:[{required:!0,message:a(()=>l("流控效果不能为空")),trigger:"blur"}],waitTime:[{required:!0,message:a(()=>l("超时时间不能为空")),trigger:"blur"},{validator:me,trigger:"blur"}]}),Fe=u({}),b=u({}),ot=u({webSpecification:[{required:!0,message:a(()=>l("webService规范协议不能为空")),trigger:"blur"}],nameSpace:[{required:!0,message:a(()=>l("命名空间不能为空")),trigger:"blur"}],method:[{required:!0,message:a(()=>l("调用方法名不能为空")),trigger:"blur"}]}),I=u(),Be=(t,e,i)=>{let r=re("nopreurl",e,!0);r.valid?i():i(new Error(r.msg))},ut=(t,e,i)=>{let r=re("special",e,!0);console.log(e),r.valid?i(new Error(r.msg)):i()},nt=(t,e,i)=>{let r=re("version",e,!0);if(!r.valid)i(new Error(r.msg));else{let c=e.substring(1).split(".");for(let f of c)isNaN(Number(f))&&i(new Error("版本格式错误,正确格式为V1.1.1错误格式为V1.01;V1..;V0.1等")),be(f)&&i(new Error("版本格式错误,正确格式为V1.1.1错误格式为V1.01;V1..;V0.1等")),Number(f).toString().length!=f.length&&i(new Error("版本格式错误,正确格式为V1.1.1错误格式为V1.01;V1..;V0.1等")),f<=0&&i(new Error("版本格式错误,正确格式为V1.1.1错误格式为V1.01;V1..;V0.1等"));i()}},dt=(t,e,i)=>{let r=re("phone",e,!0);r.valid?i():i(new Error(r.msg))};let E=u({show:!1,title:a(()=>l("新增接口")),margin:"5vh auto",showFooter:!0,onOkLoading:!0,visibleChange:t=>{t?Te(()=>{V.value&&_.value.initTableData()}):V.value&&_.value.restTable()}});const K=u({headerBackground:!0,pageConfig:!1,editConfig:{trigger:"click",enable:!0,mode:"cell"},editRules:{parameterKey:[{required:!0,message:a(()=>l("参数key不能为空")),trigger:"blur"}],parameterType:[{required:!0,message:a(()=>l("参数类型不能为空")),trigger:"blur"}],required:[{required:!0,message:a(()=>l("是否必填不能为空")),trigger:"blur"}]},height:200,keepSource:!0,columns:[{type:"checkbox",width:60,fixed:"left"},{type:"index",title:a(()=>l("序号")),width:80},{title:a(()=>l("参数key")),key:"parameterKey",editRender:{name:"input",useElement:!0}},{title:a(()=>l("参数类型")),key:"parameterType",editRender:{name:"select",useElement:!0,options:[{label:a(()=>l("String")),value:"String"},{label:a(()=>l("integer")),value:"integer"},{label:a(()=>l("double")),value:"double"},{label:a(()=>l("boolean")),value:"boolean"},{label:a(()=>l("number")),value:"number"}]}},{title:a(()=>l("是否必填")),key:"required",editRender:{name:"select",useElement:!0,options:[{value:"是",label:"是"},{value:"否",label:"否"}]}},{title:a(()=>l("参数描述")),key:"notes",editRender:{name:"input",useElement:!0}},{title:a(()=>l("操作")),width:100,fixed:"right",render:t=>{if(d.value)return X("div",[X("span",{onClick:()=>{le(t.parameterStatus,t.id)},class:"operate"},l("删除"))])}}],tableData:[]}),W=u({headerBackground:!0,pageConfig:!1,editConfig:{trigger:"click",enable:!0,mode:"cell"},height:200,editRules:{parameterKey:[{required:!0,message:a(()=>l("参数key不能为空")),trigger:"blur"}],parameterType:[{required:!0,message:a(()=>l("参数类型不能为空")),trigger:"blur"}],required:[{required:!0,message:a(()=>l("是否必填不能为空")),trigger:"blur"}]},keepSource:!0,columns:[{type:"checkbox",width:60,fixed:"left"},{type:"index",title:a(()=>l("序号")),width:80},{title:a(()=>l("参数key")),key:"parameterKey",editRender:{name:"input",useElement:!0}},{title:a(()=>l("参数类型")),key:"parameterType",editRender:{name:"select",useElement:!0,options:[{label:a(()=>l("String")),value:"String"},{label:a(()=>l("integer")),value:"integer"},{label:a(()=>l("double")),value:"double"},{label:a(()=>l("boolean")),value:"boolean"},{label:a(()=>l("number")),value:"number"}]}},{title:a(()=>l("是否必填")),key:"required",editRender:{name:"select",useElement:!0,options:[{value:"是",label:"是"},{value:"否",label:"否"}]}},{title:a(()=>l("参数描述")),key:"notes",editRender:{name:"input",useElement:!0}},{title:a(()=>l("操作")),width:100,fixed:"right",render:t=>{if(d.value)return X("div",[X("span",{onClick:()=>{le(t.parameterStatus,t.id)},class:"operate"},l("删除"))])}}],tableData:[]}),te=u({headerBackground:!0,pageConfig:!1,editConfig:{trigger:"click",enable:!0,mode:"cell",autoClear:!1},height:200,keepSource:!0,editRules:{parameterKey:[{required:!0,message:a(()=>l("参数key不能为空")),trigger:"blur"}],parameterType:[{required:!0,message:a(()=>l("参数类型不能为空")),trigger:"blur"}],required:[{required:!0,message:a(()=>l("是否必填不能为空")),trigger:"blur"}]},columns:[{type:"index",title:a(()=>l("序号")),width:80,fixed:"left"},{title:a(()=>l("参数key")),key:"parameterKey",editRender:{name:"input",useElement:!0}},{title:a(()=>l("参数类型")),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:a(()=>l("是否必填")),key:"required",editRender:{name:"select",useElement:!0,options:[{value:"是",label:"是"},{value:"否",label:"否"}]}},{title:a(()=>l("参数描述")),key:"notes",editRender:{name:"input",useElement:!0}},{title:a(()=>l("操作")),width:100,fixed:"right",render:t=>{if(d.value)return X("div",[X("span",{onClick:()=>{le(t.parameterStatus,t.id)},class:"operate"},l("删除"))])}}],tableData:[]}),_e=u({filtersValueCallBack:t=>{et.value=t},itemList:[{type:"slot",slotName:"slotBtns",span:24,justify:"flex-end"}],showBorder:!0});let y=u({model:{},rules:{interfaceName:[{required:!0,message:a(()=>l("接口名称不能为空")),trigger:"blur"},{validator:ut,trigger:"blur"}],interfaceUrl:[{required:!0,message:a(()=>l("接口调用地址不能为空")),trigger:"blur"},{validator:Be,trigger:"blur"}],interfaceType:[{required:!0,message:a(()=>l("接口类型不能为空")),trigger:"blur"}],interfaceMethod:[{required:!0,message:a(()=>l("请求方式不能为空")),trigger:"blur"}],networkAgreement:[{required:!0,message:a(()=>l("网络协议不能为空")),trigger:"blur"}],head:[{required:!0,message:a(()=>l("接口负责人不能为空")),trigger:"blur"}],headPhone:[{required:!0,message:a(()=>l("负责人联系方式不能为空")),trigger:"blur"},{validator:dt,trigger:"blur"}],deptInfo:[{required:!0,message:a(()=>l("接口负责单位不能为空")),trigger:"blur"}],isOverwrite:[{required:!0,message:a(()=>l("是否覆盖更新不能为空")),trigger:"blur"}],version:[{required:!0,message:a(()=>l("版本不能为空")),trigger:"blur"},{validator:nt,trigger:"blur"}],url:[{required:!0,message:a(()=>l("请输入链接地址")),trigger:"blur"},{validator:Be,trigger:"blur"}],illustrate:[{required:!0,message:a(()=>l("接口描述不能为空")),trigger:"blur"}],systemId:[{required:!0,message:a(()=>l("接口归属系统不能为空")),trigger:"blur"}],deptId:[{required:!0,message:a(()=>l("接口负责人单位不能为空")),trigger:"blur"}]},itemList:[{type:"input",label:a(()=>l("接口名称")),prop:"interfaceName",props:{maxlength:100,placeholder:"请输入接口名称"}},{type:"slot",label:a(()=>l("接口类型")),prop:"interfaceType",props:{slotName:"interfaceType"}},{type:"select",label:a(()=>l("网络协议")),prop:"networkAgreement",props:{options:[{label:a(()=>l("http")),value:"http"},{label:a(()=>l("https")),value:"https"}],events:{change:t=>{y.value.model=I.value.model;for(let e of y.value.itemList)e.prop=="interfaceUrl"&&(e.props.prependText=t+"://")}}}},{type:"input",label:a(()=>l("接口地址")),prop:"interfaceUrl",required:!0,props:{placeholder:"请输入接口地址例如www.baidu.com",maxlength:500,prependText:"http://"}},{type:"select",label:a(()=>l("请求方式")),prop:"interfaceMethod",props:{options:[{label:a(()=>l("get")),value:"get"},{label:a(()=>l("post")),value:"post"}],events:{change:t=>{A.value=t}}}},{type:"slot",label:a(()=>l("是否限流")),prop:"isLimit",props:{slotName:"isLimit"}},{type:"slot",label:a(()=>l("是否鉴权")),prop:"isLimit",props:{slotName:"isAuth"}},{type:"input",label:a(()=>l("接口负责人")),prop:"head",props:{maxlength:50}},{type:"input",label:a(()=>l("负责人联系方式")),prop:"headPhone",props:{placeholder:"请输入11位手机号",maxlength:11}},{type:"select",label:a(()=>l("接口负责人单位")),prop:"deptId",props:{maxlength:254,options:Ve.value,events:{change:t=>{y.value.model=I.value.model;let e={pid:t};y.value.model.systemName="",y.value.model.systemId="",At(e).then(i=>{Z.value=[];for(let r of i.data){let p={label:r.name,value:r.id};Z.value.push(p)}y.value.itemList[10].props.options=Z.value})}}}},{type:"select",label:a(()=>l("接口归属系统")),prop:"systemId",props:{maxlength:254,options:Z.value}},{type:"input",label:a(()=>l("版本")),prop:"version",props:{placeholder:"请输入版本号。例如V1.1.1",maxlength:50}},{type:"textarea",label:a(()=>l("接口描述")),prop:"illustrate",props:{rows:3,maxlength:500}},{type:"slot",label:a(()=>l("请求头参数")),prop:"",props:{slotName:"parameterHeader"}},{type:"slot",label:a(()=>l("请求参数")),prop:"",props:{slotName:"parameter"}},{type:"slot",label:a(()=>l("返回参数")),prop:"",props:{slotName:"parameterResponse"}},{type:"textarea",label:a(()=>l("备注")),prop:"notes",props:{rows:3,maxlength:254}}],descriptionsFormConfig:{labelWidth:"200px",labelAlign:"center"}});function $e(t){let e={id:""+Date.now(),parameterKey:"",parameterType:"",required:"",defaultVal:"",notes:"",parameterStatus:t,isItems:!1,pid:0,level:1};if(t==1){let i=z(t,!1);e.sort=i.length==0?1:i[i.length-1].sort+1,i.push(e),K.value.tableData=i}else if(t==2){let i=z(t,!1);e.sort=i.length==0?1:i[i.length-1].sort+1,i.push(e),W.value.tableData=i}else if(t==3){let i=z(t,!1);i.push(e),te.value.tableData=i}}const Ae=t=>{if(t==1)if(se.value.length!=0)for(let e of se.value)le(t,e);else H({type:"warning",message:(t==1?"请求头参数,":t==2?"请求参数,":t==3?"返回参数,":"")+"未选择数据,无法删除"});else if(t==2)if(ie.value.length!=0)for(let e of ie.value)le(t,e);else H({type:"warning",message:(t==1?"请求头参数,":t==2?"请求参数,":t==3?"返回参数,":"")+"未选择数据,无法删除"})};function z(t,e){let i=[],r=[];t==1?(i=qe.value.vxeTableRef.getRecordset().updateRecords,r=K.value.tableData):t==2?(i=Ce.value.vxeTableRef.getRecordset().updateRecords,r=W.value.tableData):t==3&&(i=tt.value.vxeTableRef.getRecordset().updateRecords,r=te.value.tableData);let p=[],c=0;for(let f of r)c<i.length&&f.id==i[c].id?(p.push(i[c]),c++):p.push(f);if(e){let f=1;for(let x of p){if(!ke(x.parameterKey))return H({type:"warning",message:(t==1?"请求头参数,":t==2?"请求参数,":t==3?"返回参数":"")+"第"+f+"行参数key不能为空"}),!1;if(!ke(x.parameterType))return H({type:"warning",message:(t==1?"请求头参数":t==2?"请求参数":t==3?"返回参数":"")+"第"+f+"行,参数类型不能为空"}),!1;if(!ke(x.required))return H({type:"warning",message:(t==1?"请求头参数":t==2?"请求参数":t==3?"返回参数":"")+"第"+f+"行,是否必填不能为空"}),!1;f++}}return p}function ke(t){return!(t==null||t==null||t=="")}function le(t,e){let i=[],r=[];if(t==1){i=z(t,!1);for(let p of i)p.id!=e&&r.push(p);K.value.tableData=r}else if(t==2){i=z(t,!1);for(let p of i)p.id!=e&&r.push(p);W.value.tableData=r}else if(t==3){i=z(t,!1);for(let p of i)p.id!=e&&r.push(p);te.value.tableData=r}}function pt(t){t==1?(Q.value=!0,v.value=JSON.parse(JSON.stringify(ee.value))):rt.value=!0}function Ke(t){if(t==1)Q.value=!1,v.value=JSON.parse(JSON.stringify(ee.value));else if(t==2){Y.value=!1;let e=JSON.parse(JSON.stringify(Fe.value));b.value.method=e.method,b.value.nameSpace=e.nameSpace,b.value.webSpecification=e.webSpecification}}function We(t){t==1?Ie.value.validate(e=>{if(e)Q.value=!1,ee.value=JSON.parse(JSON.stringify(v.value));else return!1}):t==2&&Ee.value.validate(e=>{if(e)Y.value=!1,Fe.value=JSON.parse(JSON.stringify(b.value));else return!1})}async function De(){y.value.model={},ge();let t=await Xe();y.value.model.id=t.data,Ne.value=t.data,oe.value=t.data;for(let e of y.value.itemList)e.props==null?e.props={disabled:!1}:e.props.disabled=!1;fe("[]",!1),ve(t),Te(()=>{V.value&&_.value.initTableData()})}De();async function mt(t){ge();let i=await Re({id:t});y.value.model=i.data;for(let r of y.value.itemList)r.props==null?r.props={disabled:!1}:r.props.disabled=!1;he(i.data),fe(i.data.parameters,!1),ve(i),E.value.title=a(()=>l("编辑接口信息")),E.value.okText="保存",E.value.show=!0}async function ft(t){ge();let e={id:t},i=await Re(e);y.value.model=i.data;for(let c of y.value.itemList)c.props==null?c.props={disabled:!1}:c.props.disabled=!1;he(i.data),fe(i.data.parameters,!1),ve(i);let r=await Xe(e);y.value.model.id=r.data,Ne.value=r.data,oe.value=r.data,ue.value="1";let p={type:"slot",label:a(()=>l("覆盖更新")),prop:"isOverwrite",props:{slotName:"isOverwrite"}};y.value.itemList.push(p),E.value.title=a(()=>l("接口版本升级维护信息")),E.value.okText="保存",E.value.show=!0}async function vt(t,e){ge();let r=await Re({id:t});y.value.model=r.data;for(let p of y.value.itemList)p.props==null?p.props={disabled:!0}:p.props.disabled=!0;he(r.data),fe(r.data.parameters,!0),ve(r),E.value.okText=!1,E.value.title=a(()=>l("查看接口信息")),E.value.show=!0,pe.isShow=e}function fe(t,e){let i=JSON.parse(t),r=[],p=[],c=[];for(let f of i)f.parameterStatus=="1"&&r.push(f),f.parameterStatus=="2"&&p.push(f),f.parameterStatus=="3"&&c.push(f);d.value=!e,K.value.editConfig=d.value?{trigger:"click",enable:!0,mode:"cell"}:!1,K.value.tableData=r,W.value.editConfig=d.value?{trigger:"click",enable:!0,mode:"cell"}:!1,W.value.tableData=p,te.value.editConfig=d.value?{trigger:"click",enable:!0,mode:"cell"}:!1,te.value.tableData=c}function ve(t){t.data.reqParameters!=null?de.value=JSON.parse(t.data.reqParameters):de.value=[],t.data.resParameters!=null?ne.value=JSON.parse(t.data.resParameters):ne.value=[]}function he(t,e){t.isLimit=="是"?B.value=!0:B.value=!1,t.isAuth=="是"?$.value=!0:$.value=!1,t.isLimitData=="是"?V.value=!0:V.value=!1,A.value=t.interfaceMethod,T.value=t.interfaceType,v.value=JSON.parse(t.limitInfo),ee.value=JSON.parse(t.limitInfo),C.value=t.parameterIds,oe.value=t.id}function ge(){T.value="Rest",v.value={thresholdType:"0",limitTime:"",limitCount:"",thresholdVal:"",effect:"1",waitTime:""},ee.value={thresholdType:"0",limitTime:"",limitCount:"",thresholdVal:"",effect:"1",waitTime:""},C.value="",Ue.value=!0,ue.value="0";let t=[];for(let e of y.value.itemList)e.prop!="isOverwrite"&&t.push(e);y.value.itemList=t}function F(t,e){wt.alert(e,t,{confirmButtonText:"确认"})}function Me(t,e){if(t!=null)for(let i of t)i.children instanceof Array&&Me(i.children,e),e.push(i)}const gt=()=>{Y.value=!0,console.log(I.value.model)},bt=()=>{var e;De(),((e=I.value)==null?void 0:e.elFormRef).resetFields()},yt=()=>{var e;R.value=!0;const t=(e=I.value)==null?void 0:e.elFormRef;I.value.model.interfaceType=T.value,console.log(I.value.model),t.validate(async i=>{if(i){let r=I.value.model;if(r.interfaceType!="Rest"){if(be(b.value.webSpecification)){F("webService补充信息确认","webService补充信息页面存在未填信息请确认"),R.value=!1;return}else if(b.value.webSpecification=="JAX-WS"&&(be(b.value.nameSpace)||be(b.value.method))){F("webService补充信息确认","webService补充信息页面存在未填信息请确认"),R.value=!1;return}}r.interfaceType!="Rest"&&(r.webSpecification=b.value.webSpecification,r.nameSpace=b.value.nameSpace,r.method=b.value.method),r.interfaceType=T.value,r.isOverwrite=we.value;let p=new FormData;if(V.value){let m=_.value.getCheckData();if(m==null||m.length==0){R.value=!1,F("权限参数确认","已经开启鉴权,请至少选择一项权限参数");return}C.value=m}r.limitInfo=JSON.stringify(v.value);let c=z(1,!0);if(typeof c=="boolean"){R.value=!1;return}r.parameters=JSON.stringify(c);let f=[],x="",N;if(A.value=="post"&&T.value=="Rest"){N=Pe.value.getTableData(),Me(N,f);for(let m of f)JSON.parse(m.isItems)||(x+=m.parameterKey+",")}else if(A.value=="get"||T.value!="Rest"){if(N=z(2,!0),typeof N=="boolean"){R.value=!1;return}for(let m of N)x+=m.parameterKey+","}if(V.value){let m=_.value.getCheckDataKeys(),ae=new Set;for(let k of m)ae.add(k);if(ae.size!=m.length){R.value=!1,F("权限参数确认","权限参数存在重复字段名称");return}let U="";for(let k of m)x.indexOf(k+",")==-1&&(U+=k+",");if(U.length!=0){U=U.substring(0,U.length-1),R.value=!1,F("权限参数确认","权限参数:"+U+"没有在请求参数列表中体现。");return}let O=new Map;if(f.length!=0)for(let k of f)O.set(k.parameterKey,k);else for(let k of N)O.set(k.parameterKey,k);let ye=!1;for(let k of m)O.get(k).required=="否"&&(O.get(k).required="是",ye=!0);if(ye){R.value=!1,F("是否必填确认","请求参数列表中对应的数据请求范围参数的是否必填项已经自动变更为是请确认,数据请求范围的参数都是必填的");return}}r.reqParameters=JSON.stringify(N);for(let m of Ve.value)m.value==r.deptId&&(r.deptInfo=m.label);for(let m of Z.value)m.value==r.systemId&&(r.systemName=m.label);let M=Le.value.getTableData();r.resParameters=JSON.stringify(M);for(let m in r)r[m]!=null&&m!="createTime"&&m!="updateTime"&&p.append(m,r[m]);r.isAuth=$.value==!0?"是":"否",r.isLimit=B.value==!0?"是":"否",r.isLimitData=V.value==!0?"是":"否",r.parameterIds=C.value==null?"":""+C.value,p.set("isAuth",$.value==!0?"是":"否"),p.set("isLimit",B.value==!0?"是":"否"),p.set("isLimitData",V.value==!0?"是":"否"),p.set("parameterIds",C.value==null?"":C.value);let q;ue.value=="0"?q=await _t(r):ue.value=="1"&&(q=await $t(r)),q.code==0&&(q.status=="success"?(H({message:"数据保存成功",type:"success"}),it.push({path:"registerInterface"}),Ue.value=!1):(R.value=!1,F("数据保存失败确认",q.msg)))}else R.value=!1})},ct=()=>{V.value&&Te(()=>{_.value.initTableData()})},be=t=>t==null||t==null||t=="";return Kt({parameterType:0}).then(t=>{for(let e of t.data){let i={label:e.name,value:e.id};Ve.value.push(i)}}),Ze({addDialog:De,edit:mt,view:vt,updateVersion:ft}),(t,e)=>{const i=Vt,r=kt,p=Dt,c=ht,f=xe("Warning"),x=Rt,N=Tt,M=xt,q=qt,m=Ct,ae=It,U=xe("y9VxeTable"),O=Et,ye=xe("y9Form"),k=Nt,ce=Ut,L=Ot,j=Lt,je=Jt,He=Pt,St=zt;return g(),Ye(Yt,null,[Gt((g(),Ye("div",Zt,[n(p,{gutter:20},{default:o(()=>[n(i,{span:20}),n(i,{span:4},{default:o(()=>[h("div",el,[d.value?(g(),S(r,{key:0,style:{"margin-bottom":"10px"},class:"el-button el-button--primary el-button--default global-btn-main",onClick:e[0]||(e[0]=s=>yt())},{default:o(()=>[e[42]||(e[42]=h("i",{class:"ri-send-plane-line"},null,-1)),h("span",null,G(t.$t("提交")),1)]),_:1})):w("",!0),d.value?(g(),S(r,{key:1,style:{"margin-bottom":"10px"},class:"el-button el-button--default global-btn-third",onClick:e[1]||(e[1]=s=>bt())},{default:o(()=>[e[43]||(e[43]=h("i",{class:"ri-refresh-line"},null,-1)),h("span",null,G(t.$t("重置")),1)]),_:1})):w("",!0)])]),_:1})]),_:1}),n(k,{height:"73vh"},{default:o(()=>[n(ye,{ref_key:"ruleFormRef",ref:I,config:J(y)},{isLimit:o(()=>[n(c,{disabled:!d.value,modelValue:B.value,"onUpdate:modelValue":e[2]||(e[2]=s=>B.value=s),"active-text":"是","inactive-text":"否"},null,8,["disabled","modelValue"]),B.value?(g(),S(N,{key:0,effect:"light",content:"点击配置限流信息",placement:"top-start"},{default:o(()=>[n(x,{class:"operate",onClick:e[3]||(e[3]=s=>pt("1"))},{default:o(()=>[n(f)]),_:1})]),_:1})):w("",!0)]),isAuth:o(()=>[n(c,{disabled:!d.value,modelValue:$.value,"onUpdate:modelValue":e[4]||(e[4]=s=>$.value=s),"active-text":"是","inactive-text":"否"},null,8,["disabled","modelValue"])]),isLimitData:o(()=>[n(c,{disabled:!d.value,modelValue:V.value,"onUpdate:modelValue":e[5]||(e[5]=s=>V.value=s),"active-text":"是","inactive-text":"否",onClick:ct},null,8,["disabled","modelValue"])]),interfaceType:o(()=>[n(q,{modelValue:T.value,"onUpdate:modelValue":e[7]||(e[7]=s=>T.value=s),disabled:!d.value},{default:o(()=>[n(M,{label:"Rest",value:"Rest"}),n(M,{label:"webService",value:"webService",onClick:e[6]||(e[6]=s=>gt())})]),_:1},8,["modelValue","disabled"])]),network:o(()=>[n(ae,{modelValue:ze.value,"onUpdate:modelValue":e[8]||(e[8]=s=>ze.value=s),disabled:""},{default:o(()=>[n(m,{label:"http",value:"http"}),n(m,{label:"https",value:"https"})]),_:1},8,["modelValue"])]),isOverwrite:o(()=>[n(q,{modelValue:we.value,"onUpdate:modelValue":e[9]||(e[9]=s=>we.value=s),onChange:e[10]||(e[10]=s=>{s=="Y"&&F("覆盖更新确认","覆盖更新将会在接口审批通过后替换原接口")})},{default:o(()=>[n(M,{label:"否",value:"N"}),n(M,{label:"是",value:"Y"})]),_:1},8,["modelValue"])]),parameterHeader:o(()=>[n(U,{ref_key:"editRequestHeaderRef",ref:qe,config:K.value,filterConfig:_e.value,selectedVal:se.value,"onUpdate:selectedVal":e[13]||(e[13]=s=>se.value=s)},{slotBtns:o(()=>[d.value?(g(),S(r,{key:0,size:J(P).buttonSize,style:Se({fontSize:J(P).baseFontSize}),class:"global-btn-main",type:"primary",onClick:e[11]||(e[11]=s=>$e("1"))},{default:o(()=>[e[44]||(e[44]=h("i",{class:"ri-add-line"},null,-1)),h("span",null,G(t.$t("新增")),1)]),_:1},8,["size","style"])):w("",!0),d.value?(g(),S(r,{key:1,size:J(P).buttonSize,style:Se({fontSize:J(P).baseFontSize}),class:"el-button el-button--default global-btn-third",type:"primary",onClick:e[12]||(e[12]=s=>Ae("1"))},{default:o(()=>[e[45]||(e[45]=h("i",{class:"ri-delete-bin-line"},null,-1)),h("span",null,G(t.$t("删除")),1)]),_:1},8,["size","style"])):w("",!0)]),_:1},8,["config","filterConfig","selectedVal"])]),parameter:o(()=>[pe.isShow?(g(),S(O,{key:0,"content-position":"left"},{default:o(()=>e[46]||(e[46]=[D("请求参数列表")])),_:1})):w("",!0),A.value=="get"||T.value!="Rest"?(g(),S(U,{key:1,ref_key:"editRequestRef",ref:Ce,config:W.value,filterConfig:_e.value,selectedVal:ie.value,"onUpdate:selectedVal":e[16]||(e[16]=s=>ie.value=s)},{slotBtns:o(()=>[d.value?(g(),S(r,{key:0,size:J(P).buttonSize,style:Se({fontSize:J(P).baseFontSize}),class:"global-btn-main",type:"primary",onClick:e[14]||(e[14]=s=>$e("2"))},{default:o(()=>[e[47]||(e[47]=h("i",{class:"ri-add-line"},null,-1)),h("span",null,G(t.$t("新增")),1)]),_:1},8,["size","style"])):w("",!0),d.value?(g(),S(r,{key:1,size:J(P).buttonSize,style:Se({fontSize:J(P).baseFontSize}),class:"el-button el-button--default global-btn-third",onClick:e[15]||(e[15]=s=>Ae("2"))},{default:o(()=>[e[48]||(e[48]=h("i",{class:"ri-delete-bin-line"},null,-1)),h("span",null,G(t.$t("删除")),1)]),_:1},8,["size","style"])):w("",!0)]),_:1},8,["config","filterConfig","selectedVal"])):w("",!0),A.value=="post"&&T.value=="Rest"?(g(),S(Ge,{key:2,ref_key:"requestParameterRef",ref:Pe,parameterStatus:Je.value,"onUpdate:parameterStatus":e[17]||(e[17]=s=>Je.value=s),data:de.value,"onUpdate:data":e[18]||(e[18]=s=>de.value=s),isView:d.value,"onUpdate:isView":e[19]||(e[19]=s=>d.value=s)},null,8,["parameterStatus","data","isView"])):w("",!0),V.value?(g(),S(O,{key:3,"content-position":"left"},{default:o(()=>e[49]||(e[49]=[D("数据请求范围("),h("span",{style:{color:"red"}},"此处选中的参数需要在上方请求参数列表出现。不可选择相同参数key的参数",-1),D("")])),_:1})):w("",!0),V.value?(g(),S(Wt,{key:4,isView:d.value,"onUpdate:isView":e[20]||(e[20]=s=>d.value=s),isShow:pe.isShow,"onUpdate:isShow":e[21]||(e[21]=s=>pe.isShow=s),isDisabled:V.value,"onUpdate:isDisabled":e[22]||(e[22]=s=>V.value=s),ref_key:"authRef",ref:_,interfaceId:oe.value,selectData:C.value,"onUpdate:selectData":e[23]||(e[23]=s=>C.value=s)},null,8,["isView","isShow","isDisabled","interfaceId","selectData"])):w("",!0)]),parameterResponse:o(()=>[n(Ge,{ref_key:"responseParameterRef",ref:Le,parameterStatus:Oe.value,"onUpdate:parameterStatus":e[24]||(e[24]=s=>Oe.value=s),data:ne.value,"onUpdate:data":e[25]||(e[25]=s=>ne.value=s),isView:d.value,"onUpdate:isView":e[26]||(e[26]=s=>d.value=s)},null,8,["parameterStatus","data","isView"])]),_:1},8,["config"])]),_:1})])),[[St,R.value]]),n(He,{modelValue:Q.value,"onUpdate:modelValue":e[35]||(e[35]=s=>Q.value=s),title:at.value},{footer:o(()=>[d.value?(g(),S(r,{key:0,class:"el-button el-button--primary el-button--default global-btn-main",onClick:e[33]||(e[33]=s=>We("1"))},{default:o(()=>e[58]||(e[58]=[D("确定")])),_:1})):w("",!0),n(r,{onClick:e[34]||(e[34]=s=>Ke("1"))},{default:o(()=>e[59]||(e[59]=[D("取消")])),_:1})]),default:o(()=>[n(O),n(je,{class:"limitClass",ref_key:"limitInfoRef",ref:Ie,model:v.value,"label-width":"140px",rules:st.value},{default:o(()=>[n(L,{label:"阈值类型",prop:"thresholdType"},{default:o(()=>[n(q,{modelValue:v.value.thresholdType,"onUpdate:modelValue":e[27]||(e[27]=s=>v.value.thresholdType=s),disabled:!d.value},{default:o(()=>[n(ce,{value:"0"},{default:o(()=>e[50]||(e[50]=[D("自定义")])),_:1}),n(ce,{value:"1"},{default:o(()=>e[51]||(e[51]=[D("QPS")])),_:1})]),_:1},8,["modelValue","disabled"])]),_:1}),v.value.thresholdType==0?(g(),S(L,{key:0,label:"限定时间",prop:"limitTime"},{default:o(()=>[n(j,{modelValue:v.value.limitTime,"onUpdate:modelValue":e[28]||(e[28]=s=>v.value.limitTime=s),disabled:!d.value,placeholder:"请输入,单位:秒",maxlength:"7"},{append:o(()=>e[52]||(e[52]=[D("秒")])),_:1},8,["modelValue","disabled"])]),_:1})):w("",!0),v.value.thresholdType==0?(g(),S(L,{key:1,label:"限定时间内访问量",prop:"limitCount"},{default:o(()=>[n(j,{modelValue:v.value.limitCount,"onUpdate:modelValue":e[29]||(e[29]=s=>v.value.limitCount=s),disabled:!d.value,placeholder:"请输入次数",maxlength:"7"},{append:o(()=>e[53]||(e[53]=[D("次数")])),_:1},8,["modelValue","disabled"])]),_:1})):w("",!0),v.value.thresholdType==1?(g(),S(L,{key:2,label:"阈值",prop:"thresholdVal"},{default:o(()=>[n(j,{modelValue:v.value.thresholdVal,"onUpdate:modelValue":e[30]||(e[30]=s=>v.value.thresholdVal=s),disabled:!d.value,placeholder:"请输入",maxlength:"7"},{append:o(()=>e[54]||(e[54]=[D("次数/秒")])),_:1},8,["modelValue","disabled"])]),_:1})):w("",!0),n(L,{label:"流控效果",prop:"effect"},{default:o(()=>[n(q,{modelValue:v.value.effect,"onUpdate:modelValue":e[31]||(e[31]=s=>v.value.effect=s),disabled:!d.value},{default:o(()=>[n(ce,{value:"1"},{default:o(()=>e[55]||(e[55]=[D("快速失败")])),_:1}),n(ce,{value:"3"},{default:o(()=>e[56]||(e[56]=[D("排队等候")])),_:1})]),_:1},8,["modelValue","disabled"])]),_:1}),v.value.effect==3?(g(),S(L,{key:3,label:"阻塞时间",prop:"waitTime"},{default:o(()=>[n(j,{modelValue:v.value.waitTime,"onUpdate:modelValue":e[32]||(e[32]=s=>v.value.waitTime=s),disabled:!d.value,placeholder:"请输入,单位:毫秒",maxlength:"9"},{append:o(()=>e[57]||(e[57]=[D("毫秒")])),_:1},8,["modelValue","disabled"])]),_:1})):w("",!0)]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"]),n(He,{modelValue:Y.value,"onUpdate:modelValue":e[41]||(e[41]=s=>Y.value=s),title:lt.value},{footer:o(()=>[d.value?(g(),S(r,{key:0,class:"el-button el-button--primary el-button--default global-btn-main",onClick:e[39]||(e[39]=s=>We("2"))},{default:o(()=>e[60]||(e[60]=[D("确定")])),_:1})):w("",!0),n(r,{onClick:e[40]||(e[40]=s=>Ke("2"))},{default:o(()=>e[61]||(e[61]=[D("取消")])),_:1})]),default:o(()=>[n(O),n(je,{ref_key:"webServiceRef",ref:Ee,model:b.value,"label-width":"155px",rules:ot.value},{default:o(()=>[n(L,{label:"webService规范协议",prop:"webSpecification"},{default:o(()=>[n(ae,{modelValue:b.value.webSpecification,"onUpdate:modelValue":e[36]||(e[36]=s=>b.value.webSpecification=s),placeholder:"请选择webService规范协议",disabled:!d.value},{default:o(()=>[n(m,{label:"JAX-WS",value:"JAX-WS"}),n(m,{label:"JAX-RS",value:"JAX-RS"})]),_:1},8,["modelValue","disabled"])]),_:1}),b.value.webSpecification=="JAX-WS"?(g(),S(L,{key:0,label:"命名空间",prop:"nameSpace"},{default:o(()=>[n(j,{modelValue:b.value.nameSpace,"onUpdate:modelValue":e[37]||(e[37]=s=>b.value.nameSpace=s),disabled:!d.value,placeholder:"请输入命名空间",maxlength:"300"},null,8,["modelValue","disabled"])]),_:1})):w("",!0),b.value.webSpecification=="JAX-WS"?(g(),S(L,{key:1,label:"调用方法名",prop:"method"},{default:o(()=>[n(j,{modelValue:b.value.method,"onUpdate:modelValue":e[38]||(e[38]=s=>b.value.method=s),disabled:!d.value,placeholder:"请输入调用方法名",maxlength:"300"},null,8,["modelValue","disabled"])]),_:1})):w("",!0)]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])],64)}}});const $l=Qt(tl,[["__scopeId","data-v-57188ec3"],["__file","E:/workSpaceJDK11/y9-interface-platform/y9vue-interfacePlatform/src/views/interface/interfaceRegister.vue"]]);export{$l as default};