2 lines
28 KiB
JavaScript
2 lines
28 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-08583192"],{"06f5":function(e,t,i){},"0a6a":function(e,t,i){},1392:function(e,t,i){"use strict";var s=function(){var e=this,t=e._self._c;return t("el-row",[t("el-col",{attrs:{span:24}},[t("el-card",[t("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v(e._s(e.$t("viewServiceInfo.title")))]),t("div",{staticStyle:{float:"right"}},[2!==e.viewServiceInfo.index?t("el-button",{staticStyle:{"margin-right":"10px"},attrs:{type:"primary",size:"small"},on:{click:function(t){return e._openSelectServiceInfoModel()}}},[t("i",{staticClass:"el-icon-search"}),e._v(" "+e._s(e.$t("viewServiceInfo.selectService"))+" ")]):e._e(),2!==e.viewServiceInfo.index?t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e._openAddServiceInfoModel()}}},[t("i",{staticClass:"el-icon-plus"}),e._v(" "+e._s(e.$t("viewServiceInfo.addService"))+" ")]):e._e()],1)]),t("div",{staticClass:"ibox-content"},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewServiceInfo.serviceId"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewServiceInfo.serviceId))])])]),t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewServiceInfo.serviceName"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewServiceInfo.name))])])]),t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewServiceInfo.serviceCode"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewServiceInfo.serviceCode))])])])],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewServiceInfo.messageQueue"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewServiceInfo.messageQueueName))])])]),t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewServiceInfo.isInstance"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewServiceInfo.isInstance))])])]),t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewServiceInfo.url"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewServiceInfo.url))])])])],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewServiceInfo.method"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewServiceInfo.method))])])]),t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewServiceInfo.timeout"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewServiceInfo.timeout))])])]),t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewServiceInfo.retryCount"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewServiceInfo.retryCount))])])])],1)],1)])],1),t("choose-service",{ref:"chooseService",attrs:{"emit-choose-service":"viewServiceInfo","emit-load-data":"viewServiceInfo"}}),t("add-service",{ref:"addService",attrs:{"call-back-listener":"viewServiceInfo","call-back-function":"chooseService"}})],1)},a=[],o=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("chooseService.title"),visible:e.dialogVisible,width:"80%","before-close":e.handleClose},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:24}},[t("el-card",[t("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:19}}),t("el-col",{attrs:{span:5}},[t("el-input-group",[t("el-input",{attrs:{placeholder:e.$t("chooseService.searchPlaceholder"),clearable:""},model:{value:e.chooseServiceInfo.searchName,callback:function(t){e.$set(e.chooseServiceInfo,"searchName",t)},expression:"chooseServiceInfo.searchName"}}),t("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function(t){return e.queryServices()}},slot:"append"})],1)],1)],1)],1),t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.chooseServiceInfo.services,border:""}},[t("el-table-column",{attrs:{prop:"name",label:e.$t("chooseService.serviceName"),align:"center"}}),t("el-table-column",{attrs:{prop:"serviceCode",label:e.$t("chooseService.serviceCode"),align:"center"}}),t("el-table-column",{attrs:{prop:"method",label:e.$t("chooseService.method"),align:"center"}}),t("el-table-column",{attrs:{label:e.$t("chooseService.operation"),width:"120",align:"center"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){return e.chooseService(i.row)}}},[e._v(e._s(e.$t("chooseService.select")))])]}}])})],1)],1)],1)],1)],1)},r=[],n=i("9d2a"),l={name:"ChooseService",props:{emitChooseService:String,emitLoadData:String},data(){return{dialogVisible:!1,chooseServiceInfo:{services:[],searchName:""}}},methods:{open(){this.dialogVisible=!0,this.resetSearch(),this._loadAllServiceInfo(1,10,"")},handleClose(){this.dialogVisible=!1},resetSearch(){this.chooseServiceInfo.searchName=""},async _loadAllServiceInfo(e,t,i){try{const s={page:e,row:t,name:i},a=await Object(n["b"])(s);this.chooseServiceInfo.services=a.data}catch(s){console.error("Failed to load services:",s)}},queryServices(){this._loadAllServiceInfo(1,10,this.chooseServiceInfo.searchName)},chooseService(e){this.$emit(this.emitChooseService,"chooseService",e),this.$emit(this.emitLoadData,"listServiceData",{serviceId:e.serviceId}),this.handleClose()}}},c=l,d=(i("964e"),i("2877")),p=Object(d["a"])(c,o,r,!1,null,"67daa848",null),u=p.exports,v=i("d515"),f={name:"ViewServiceInfo",components:{ChooseService:u,AddService:v["a"]},props:{callBackListener:String,callBackFunction:String},data(){return{viewServiceInfo:{index:0,serviceId:"",flowComponent:"Service",name:"",serviceCode:"",messageQueueName:"",isInstance:"",url:"",method:"",timeout:"",retryCount:""}}},created(){},methods:{_openSelectServiceInfoModel(){this.$refs.chooseService.open()},_openAddServiceInfoModel(){this.$refs.addService.open()},onIndex(e){this.viewServiceInfo.index=e}}},m=f,h=(i("df11"),Object(d["a"])(m,s,a,!1,null,"859fa8b6",null));t["a"]=h.exports},"28e5":function(e,t,i){"use strict";i("8d22")},"2dec":function(e,t,i){},"5d88":function(e,t,i){"use strict";i("7b17")},"7b17":function(e,t,i){},"7e2c":function(e,t,i){},"83e4":function(e,t,i){},"8d22":function(e,t,i){},9212:function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"java110_step"},[t("el-steps",{attrs:{active:e.serviceBindingInfo.index,"finish-status":"success"}},[t("el-step",{attrs:{title:"选择应用"}}),t("el-step",{attrs:{title:"选择服务"}}),t("el-step",{attrs:{title:"扩展信息"}})],1)],1),0===e.serviceBindingInfo.index?t("div",[t("view-app-info",{ref:"viewAppInfo",attrs:{"call-back-listener":"serviceBinding","call-back-function":"notify","need-show-add-app-button":!0}})],1):e._e(),1===e.serviceBindingInfo.index?t("div",[t("view-service-info",{ref:"viewServiceInfo",attrs:{"call-back-listener":"serviceBinding","call-back-function":"notify"}})],1):e._e(),2===e.serviceBindingInfo.index?t("div",[t("add-route-view",{ref:"addRouteView",attrs:{"call-back-listener":"serviceBinding","call-back-function":"notify"}})],1):e._e(),t("el-row",[t("el-col",{attrs:{span:22,offset:1}},[t("div",{staticStyle:{"margin-bottom":"10px","text-align":"right"}},[t("el-button",{attrs:{type:"info"},on:{click:function(t){return e._prevStep()}}},[e._v(" "+e._s(e.$t("serviceBinding.prevStep"))+" ")]),2!==e.serviceBindingInfo.index?t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"primary"},on:{click:function(t){return e._nextStep()}}},[e._v(" "+e._s(e.$t("serviceBinding.nextStep"))+" ")]):e._e(),2===e.serviceBindingInfo.index?t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"primary"},on:{click:function(t){return e._finishStep()}}},[e._v(" "+e._s(e.$t("serviceBinding.finish"))+" ")]):e._e()],1)])],1)],1)},a=[],o=function(){var e=this,t=e._self._c;return t("el-row",[t("el-col",{attrs:{span:24}},[t("el-card",[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v(e._s(e.$t("viewAppInfo.title")))]),t("div",[2!==e.viewAppInfo.index?t("el-button",{staticStyle:{"margin-right":"10px"},attrs:{type:"primary",size:"small"},on:{click:function(t){return e._openSelectAppInfoModel()}}},[t("i",{staticClass:"el-icon-search"}),e._v(" "+e._s(e.$t("viewAppInfo.selectApp"))+" ")]):e._e(),2!==e.viewAppInfo.index&&e.viewAppInfo.needShowAddAppButton?t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e._openAddAppInfoModel()}}},[t("i",{staticClass:"el-icon-plus"}),e._v(" "+e._s(e.$t("viewAppInfo.addApp"))+" ")]):e._e()],1)]),t("div",{},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewAppInfo.appId"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewAppInfo.appId))])])]),t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewAppInfo.appName"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewAppInfo.name))])])]),t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewAppInfo.securityCode"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewAppInfo.securityCode))])])])],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewAppInfo.whiteList"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewAppInfo.whileListIp))])])]),t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewAppInfo.blackList"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewAppInfo.blackListIp))])])]),t("el-col",{attrs:{span:8}},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"el-form-item__label"},[e._v(" "+e._s(e.$t("viewAppInfo.remark"))+": ")]),t("label",{staticClass:"el-form-item__content"},[e._v(e._s(e.viewAppInfo.remark))])])])],1)],1)])],1),t("choose-app",{ref:"chooseApp",attrs:{"emit-choose-app":"viewAppInfo","emit-load-data":"viewAppInfo"}}),t("add-app",{ref:"addApp",attrs:{"call-back-listener":"viewAppInfo","call-back-function":"chooseApp"}})],1)},r=[],n=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("chooseApp.selectApp"),visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:24}},[t("el-input-group",[t("el-input",{attrs:{placeholder:e.$t("chooseApp.inputAppName")},model:{value:e.chooseAppInfo._currentAppName,callback:function(t){e.$set(e.chooseAppInfo,"_currentAppName",t)},expression:"chooseAppInfo._currentAppName"}}),t("el-button-group",{attrs:{slot:"append"},slot:"append"},[t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.queryApps()}}},[e._v(" "+e._s(e.$t("chooseApp.query"))+" ")])],1)],1)],1)],1),t("el-table",{staticStyle:{width:"100%","margin-top":"15px"},attrs:{data:e.chooseAppInfo.apps,border:""}},[t("el-table-column",{attrs:{prop:"appId",label:e.$t("chooseApp.appId")}}),t("el-table-column",{attrs:{prop:"name",label:e.$t("chooseApp.appName")}}),t("el-table-column",{attrs:{label:e.$t("chooseApp.operation"),width:"120"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.chooseApp(i.row)}}},[e._v(" "+e._s(e.$t("chooseApp.select"))+" ")])]}}])})],1),t("el-pagination",{attrs:{"current-page":e.currentPage,"page-size":e.pageSize,layout:"total, prev, pager, next",total:e.total},on:{"current-change":e.handleCurrentChange}})],1)},l=[],c=i("b775");function d(e){return new Promise((t,i)=>{Object(c["a"])({url:"/app.listApps",method:"get",params:e}).then(e=>{const i=e.data;t(i)}).catch(e=>{i(e)})})}var p={name:"ChooseApp",data(){return{dialogVisible:!1,chooseAppInfo:{apps:[],_currentAppName:""},currentPage:1,pageSize:10,total:0}},methods:{open(){this.dialogVisible=!0,this._refreshChooseAppInfo(),this._loadAllAppInfo(1,10,"")},async _loadAllAppInfo(e,t,i){try{const s={page:e,row:t,name:i},a=await d(s);this.chooseAppInfo.apps=a.data,this.total=a.records}catch(s){console.error("请求失败:",s)}},chooseApp(e){e.appName=e.name,this.$emit("chooseApp",e),this.dialogVisible=!1},queryApps(){this._loadAllAppInfo(1,10,this.chooseAppInfo._currentAppName)},_refreshChooseAppInfo(){this.chooseAppInfo._currentAppName=""},handleCurrentChange(e){this.currentPage=e,this._loadAllAppInfo(this.currentPage,this.pageSize)},handleClose(){this._refreshChooseAppInfo()}}},u=p,v=(i("ba60"),i("2877")),f=Object(v["a"])(u,n,l,!1,null,"752087fb",null),m=f.exports,h=i("fc4e"),b={name:"ViewAppInfo",components:{ChooseApp:m,AddApp:h["a"]},props:{callBackListener:String,callBackFunction:String,needShowAddAppButton:{type:Boolean,default:!0}},data(){return{viewAppInfo:{index:0,flowComponent:"App",appId:"",name:"",securityCode:"",whileListIp:"",blackListIp:"",remark:"",needShowAddAppButton:this.needShowAddAppButton}}},created(){this.$on("viewAppInfo","chooseApp",e=>{this.$copyObject(e,this.viewAppInfo),this.$emit(this.callBackListener,this.callBackFunction,this.viewAppInfo)})},methods:{_openSelectAppInfoModel(){this.$refs.chooseApp.open()},_openAddAppInfoModel(){this.$refs.addApp.open()},onIndex(e){this.viewAppInfo.index=e}}},I=b,g=(i("28e5"),Object(v["a"])(I,o,r,!1,null,"0501f73f",null)),_=g.exports,S=i("1392"),w=function(){var e=this,t=e._self._c;return t("el-row",[t("el-col",{attrs:{span:24}},[t("el-card",[t("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v(e._s(e.$t("addRouteView.title")))])]),t("el-form",{ref:"addRouteForm",attrs:{model:e.addRouteViewInfo,rules:e.rules,"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("addRouteView.orderType"),prop:"orderTypeCd"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("addRouteView.orderTypePlaceholder")},model:{value:e.addRouteViewInfo.orderTypeCd,callback:function(t){e.$set(e.addRouteViewInfo,"orderTypeCd",t)},expression:"addRouteViewInfo.orderTypeCd"}},[t("el-option",{attrs:{value:"Q",label:e.$t("addRouteView.query")}}),t("el-option",{attrs:{value:"D",label:e.$t("addRouteView.businessAccept")}})],1)],1),t("el-form-item",{attrs:{label:e.$t("addRouteView.invokeLimitTimes"),prop:"invokeLimitTimes"}},[t("el-input",{attrs:{placeholder:e.$t("addRouteView.invokeLimitTimesPlaceholder")},model:{value:e.addRouteViewInfo.invokeLimitTimes,callback:function(t){e.$set(e.addRouteViewInfo,"invokeLimitTimes",e._n(t))},expression:"addRouteViewInfo.invokeLimitTimes"}})],1),t("el-form-item",{attrs:{label:e.$t("addRouteView.invokeModel"),prop:"invokeModel"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("addRouteView.invokeModelPlaceholder")},model:{value:e.addRouteViewInfo.invokeModel,callback:function(t){e.$set(e.addRouteViewInfo,"invokeModel",t)},expression:"addRouteViewInfo.invokeModel"}},[t("el-option",{attrs:{value:"S",label:e.$t("addRouteView.syncMode")}}),t("el-option",{attrs:{value:"A",label:e.$t("addRouteView.asyncMode")}})],1)],1)],1)],1)],1)],1)},A=[],$={name:"AddRouteView",props:{callBackListener:String,callBackFunction:String},data(){return{addRouteViewInfo:{flowComponent:"addRouteView",orderTypeCd:"",invokeLimitTimes:1e3,invokeModel:"S"},rules:{orderTypeCd:[{required:!0,message:this.$t("addRouteView.orderTypeRequired"),trigger:"change"},{min:1,max:4,message:this.$t("addRouteView.orderTypeLength"),trigger:"blur"}],invokeLimitTimes:[{required:!0,message:this.$t("addRouteView.invokeLimitTimesRequired"),trigger:"blur"},{type:"number",message:this.$t("addRouteView.invokeLimitTimesNumber"),trigger:"blur"}],invokeModel:[{required:!0,message:this.$t("addRouteView.invokeModelRequired"),trigger:"change"},{max:50,message:this.$t("addRouteView.invokeModelLength"),trigger:"blur"}]}}},watch:{addRouteViewInfo:{deep:!0,handler(e){console.log(e),this.saveAddRouteInfo()}}},methods:{saveAddRouteInfo(){this.$refs.addRouteForm.validate(e=>{e&&this.$emit(this.callBackListener,this.callBackFunction,this.addRouteViewInfo)})},onIndex(e){console.log(e),this.addRouteViewInfo.index=e}}},C=$,y=(i("5d88"),Object(v["a"])(C,w,A,!1,null,"15df9bf6",null)),k=y.exports,x=i("9d2a"),V={name:"ServiceBinding",components:{ViewAppInfo:_,ViewServiceInfo:S["a"],AddRouteView:k},data(){return{serviceBindingInfo:{index:0,infos:[]}}},created(){this.$nextTick(()=>{this.$on("serviceBinding","notify",e=>{this.serviceBindingInfo.infos[this.serviceBindingInfo.index]=e})})},methods:{_prevStep(){this.serviceBindingInfo.index>0&&(this.serviceBindingInfo.index--,this.$refs.viewAppInfo&&this.$refs.viewAppInfo.onIndex(this.serviceBindingInfo.index),this.$refs.viewServiceInfo&&this.$refs.viewServiceInfo.onIndex(this.serviceBindingInfo.index),this.$refs.addRouteView&&this.$refs.addRouteView.onIndex(this.serviceBindingInfo.index))},_nextStep(){const e=this.serviceBindingInfo.infos[this.serviceBindingInfo.index];e?this.serviceBindingInfo.index<2&&(this.serviceBindingInfo.index++,this.$refs.viewAppInfo&&this.$refs.viewAppInfo.onIndex(this.serviceBindingInfo.index),this.$refs.viewServiceInfo&&this.$refs.viewServiceInfo.onIndex(this.serviceBindingInfo.index),this.$refs.addRouteView&&this.$refs.addRouteView.onIndex(this.serviceBindingInfo.index)):this.$message.error(this.$t("serviceBinding.pleaseSelectRequired"))},async _finishStep(){const e=this.serviceBindingInfo.infos[this.serviceBindingInfo.index];if(e)try{const e={data:this.serviceBindingInfo.infos};await Object(x["a"])(e),this.$message.success(this.$t("serviceBinding.processSuccess")),this.$router.go(-1)}catch(t){this.$message.error(t.message||this.$t("serviceBinding.processFailed"))}else this.$message.error(this.$t("serviceBinding.pleaseSelectRequired"))}}},B=V,L=(i("a37e"),Object(v["a"])(B,s,a,!1,null,"9ec7f2aa",null));t["default"]=L.exports},"964e":function(e,t,i){"use strict";i("2dec")},"9d2a":function(e,t,i){"use strict";i.d(t,"c",(function(){return a})),i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return r}));var s=i("b775");function a(e){return new Promise((t,i)=>{Object(s["a"])({url:"/app.saveApp",method:"post",data:e}).then(e=>{const i=e.data;t(i)}).catch(e=>{i(e)})})}function o(e){return new Promise((t,i)=>{Object(s["a"])({url:"/service.listServices",method:"get",params:e}).then(e=>{const i=e.data;t(i)}).catch(e=>{i(e)})})}function r(e){return new Promise((t,i)=>{Object(s["a"])({url:"/service.bindingService",method:"post",data:e}).then(e=>{const i=e.data;t(i)}).catch(e=>{i(e)})})}},a37e:function(e,t,i){"use strict";i("06f5")},ba60:function(e,t,i){"use strict";i("83e4")},d515:function(e,t,i){"use strict";var s=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("addService.addService"),visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("el-form",{ref:"addServiceForm",attrs:{model:e.addServiceInfo,rules:e.rules,"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("addService.serviceName"),prop:"name"}},[t("el-input",{attrs:{placeholder:e.$t("addService.enterServiceName"),clearable:""},model:{value:e.addServiceInfo.name,callback:function(t){e.$set(e.addServiceInfo,"name",t)},expression:"addServiceInfo.name"}})],1),t("el-form-item",{attrs:{label:e.$t("addService.serviceCode"),prop:"serviceCode"}},[t("el-input",{attrs:{placeholder:e.$t("addService.enterServiceCode"),clearable:""},model:{value:e.addServiceInfo.serviceCode,callback:function(t){e.$set(e.addServiceInfo,"serviceCode",t)},expression:"addServiceInfo.serviceCode"}})],1),t("el-form-item",{attrs:{label:e.$t("addService.serviceUrl"),prop:"url"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("addService.selectServiceUrl")},model:{value:e.addServiceInfo.url,callback:function(t){e.$set(e.addServiceInfo,"url",t)},expression:"addServiceInfo.url"}},e._l(e.addServiceInfo.services,(function(e,i){return t("el-option",{key:i,attrs:{label:e.name,value:e.statusCd}})})),1)],1),t("el-form-item",{attrs:{label:e.$t("addService.serviceMethod"),prop:"method"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("addService.selectServiceMethod")},model:{value:e.addServiceInfo.method,callback:function(t){e.$set(e.addServiceInfo,"method",t)},expression:"addServiceInfo.method"}},[t("el-option",{attrs:{value:"GET",label:"http get"}}),t("el-option",{attrs:{value:"POST",label:"http post"}})],1)],1),t("el-form-item",{attrs:{label:e.$t("addService.timeout"),prop:"timeout"}},[t("el-input",{attrs:{placeholder:e.$t("addService.enterTimeout"),clearable:""},model:{value:e.addServiceInfo.timeout,callback:function(t){e.$set(e.addServiceInfo,"timeout",t)},expression:"addServiceInfo.timeout"}})],1),t("el-form-item",{attrs:{label:e.$t("addService.retryCount"),prop:"retryCount"}},[t("el-input",{attrs:{placeholder:e.$t("addService.enterRetryCount"),clearable:""},model:{value:e.addServiceInfo.retryCount,callback:function(t){e.$set(e.addServiceInfo,"retryCount",t)},expression:"addServiceInfo.retryCount"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(e._s(e.$t("common.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.saveServiceInfo}},[e._v(e._s(e.$t("common.save")))])],1)],1)},a=[],o=i("7323"),r=i("e225"),n={name:"AddService",data(){return{dialogVisible:!1,addServiceInfo:{name:"",serviceCode:"",businessTypeCd:"API",seq:"1",messageQueueName:"",isInstance:"CMD",url:"http://iot-community",method:"",timeout:"60",retryCount:"3",provideAppId:"8000418002",services:[]},rules:{name:[{required:!0,message:this.$t("addService.serviceNameRequired"),trigger:"blur"},{max:200,message:this.$t("addService.serviceNameMaxLength"),trigger:"blur"}],serviceCode:[{required:!0,message:this.$t("addService.serviceCodeRequired"),trigger:"blur"},{min:2,max:100,message:this.$t("addService.serviceCodeLength"),trigger:"blur"}],method:[{required:!0,message:this.$t("addService.methodRequired"),trigger:"change"}],timeout:[{required:!0,message:this.$t("addService.timeoutRequired"),trigger:"blur"},{pattern:/^\d+$/,message:this.$t("addService.timeoutNumber"),trigger:"blur"}],retryCount:[{required:!0,message:this.$t("addService.retryCountRequired"),trigger:"blur"},{pattern:/^\d+$/,message:this.$t("addService.retryCountNumber"),trigger:"blur"}]}}},methods:{open(){this.dialogVisible=!0,this.getDictData()},async getDictData(){try{const{data:e}=await Object(o["e"])("c_service","url");this.addServiceInfo.services=e}catch(e){console.error("获取字典数据失败:",e)}},handleClose(){this.$refs.addServiceForm.resetFields(),this.addServiceInfo={name:"",serviceCode:"",businessTypeCd:"API",seq:"1",messageQueueName:"",isInstance:"CMD",url:"http://iot-community",method:"",timeout:"60",retryCount:"3",provideAppId:"8000418002",services:[]}},saveServiceInfo(){this.$refs.addServiceForm.validate(async e=>{if(e)try{await Object(r["d"])(this.addServiceInfo),this.$message.success(this.$t("addService.saveSuccess")),this.dialogVisible=!1,this.$emit("success")}catch(t){console.error("保存服务失败:",t)}})}}},l=n,c=i("2877"),d=Object(c["a"])(l,s,a,!1,null,null,null);t["a"]=d.exports},df11:function(e,t,i){"use strict";i("0a6a")},e225:function(e,t,i){"use strict";i.d(t,"c",(function(){return a})),i.d(t,"d",(function(){return o})),i.d(t,"e",(function(){return r})),i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return l}));var s=i("b775");function a(e){return new Promise((t,i)=>{Object(s["a"])({url:"/service.listServices",method:"get",params:e}).then(e=>{const i=e.data;t(i)}).catch(e=>{i(e)})})}function o(e){return new Promise((t,i)=>{Object(s["a"])({url:"/service.saveService",method:"post",data:e}).then(e=>{const i=e.data;t(i)}).catch(e=>{i(e)})})}function r(e){return new Promise((t,i)=>{Object(s["a"])({url:"/service.updateService",method:"post",data:e}).then(e=>{const i=e.data;t(i)}).catch(e=>{i(e)})})}function n(e){return new Promise((t,i)=>{Object(s["a"])({url:"/service.deleteService",method:"post",data:e}).then(e=>{const i=e.data;t(i)}).catch(e=>{i(e)})})}function l(e){return new Promise((t,i)=>{Object(s["a"])({url:"/app.listApps",method:"get",params:e}).then(e=>{const i=e.data;t(i.apps[0])}).catch(e=>{i(e)})})}},e9f9:function(e,t,i){"use strict";i("7e2c")},fc4e:function(e,t,i){"use strict";var s=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("addApp.title"),visible:e.dialogVisible,width:"70%","before-close":e.handleClose},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("el-form",{ref:"addAppForm",attrs:{model:e.addAppInfo,rules:e.rules}},[t("el-form-item",{attrs:{label:e.$t("addApp.appName"),prop:"name"}},[t("el-input",{attrs:{placeholder:e.$t("addApp.appNamePlaceholder")},model:{value:e.addAppInfo.name,callback:function(t){e.$set(e.addAppInfo,"name",t)},expression:"addAppInfo.name"}})],1),t("el-form-item",{attrs:{label:e.$t("addApp.securityCode"),prop:"securityCode"}},[t("el-input",{attrs:{placeholder:e.$t("addApp.securityCodePlaceholder")},model:{value:e.addAppInfo.securityCode,callback:function(t){e.$set(e.addAppInfo,"securityCode",t)},expression:"addAppInfo.securityCode"}})],1),t("el-form-item",{attrs:{label:e.$t("addApp.whiteList"),prop:"whileListIp"}},[t("el-input",{attrs:{placeholder:e.$t("addApp.whiteListPlaceholder")},model:{value:e.addAppInfo.whileListIp,callback:function(t){e.$set(e.addAppInfo,"whileListIp",t)},expression:"addAppInfo.whileListIp"}})],1),t("el-form-item",{attrs:{label:e.$t("addApp.blackList"),prop:"blackListIp"}},[t("el-input",{attrs:{placeholder:e.$t("addApp.blackListPlaceholder")},model:{value:e.addAppInfo.blackListIp,callback:function(t){e.$set(e.addAppInfo,"blackListIp",t)},expression:"addAppInfo.blackListIp"}})],1),t("el-form-item",{attrs:{label:e.$t("addApp.remark"),prop:"remark"}},[t("el-input",{attrs:{type:"textarea",placeholder:e.$t("addApp.remarkPlaceholder")},model:{value:e.addAppInfo.remark,callback:function(t){e.$set(e.addAppInfo,"remark",t)},expression:"addAppInfo.remark"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v(e._s(e.$t("common.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.saveAppInfo}},[e._v(e._s(e.$t("common.save")))])],1)],1)},a=[],o=i("9d2a"),r={name:"AddApp",props:{callBackListener:String,callBackFunction:String},data(){return{dialogVisible:!1,addAppInfo:{appId:"",name:"",securityCode:"",whileListIp:"",blackListIp:"",remark:""},rules:{name:[{required:!0,message:this.$t("addApp.appNameRequired"),trigger:"blur"},{min:2,max:50,message:this.$t("addApp.appNameLength"),trigger:"blur"}],securityCode:[{max:64,message:this.$t("addApp.securityCodeLength"),trigger:"blur"}],whileListIp:[{max:200,message:this.$t("addApp.whiteListLength"),trigger:"blur"}],blackListIp:[{max:200,message:this.$t("addApp.blackListLength"),trigger:"blur"}],remark:[{max:200,message:this.$t("addApp.remarkLength"),trigger:"blur"}]}}},methods:{open(){this.dialogVisible=!0,this.clearAddAppInfo()},handleClose(){this.dialogVisible=!1},clearAddAppInfo(){this.addAppInfo={name:"",securityCode:"",whileListIp:"",blackListIp:"",remark:""},this.$refs.addAppForm&&this.$refs.addAppForm.resetFields()},saveAppInfo(){this.$refs.addAppForm.validate(async e=>{if(e)try{if(this.callBackListener)return this.$emit(this.callBackListener,this.callBackFunction,this.addAppInfo),void this.handleClose();await Object(o["c"])(this.addAppInfo),this.$message.success(this.$t("addApp.saveSuccess")),this.handleClose(),this.$emit("success")}catch(t){this.$message.error(t.message||this.$t("addApp.saveFailed"))}})}}},n=r,l=(i("e9f9"),i("2877")),c=Object(l["a"])(n,s,a,!1,null,"68c9af13",null);t["a"]=c.exports}}]);
|
||
//# sourceMappingURL=chunk-08583192.6156fc3d.js.map
|