2 lines
20 KiB
JavaScript
2 lines
20 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-18385b58"],{"0a6a":function(e,t,r){},1392:function(e,t,r){"use strict";var i=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=[],s=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(r){return[t("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){return e.chooseService(r.row)}}},[e._v(e._s(e.$t("chooseService.select")))])]}}])})],1)],1)],1)],1)],1)},o=[],c=r("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,r){try{const i={page:e,row:t,name:r},a=await Object(c["b"])(i);this.chooseServiceInfo.services=a.data}catch(i){console.error("Failed to load services:",i)}},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()}}},n=l,d=(r("964e"),r("2877")),v=Object(d["a"])(n,s,o,!1,null,"67daa848",null),u=v.exports,m=r("d515"),p={name:"ViewServiceInfo",components:{ChooseService:u,AddService:m["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}}},f=p,h=(r("df11"),Object(d["a"])(f,i,a,!1,null,"859fa8b6",null));t["a"]=h.exports},"2bc0":function(e,t,r){"use strict";r("6ea9")},"2dec":function(e,t,r){},"6ea9":function(e,t,r){},"805e":function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return s}));var i=r("b775");function a(e){return new Promise((t,r)=>{Object(i["a"])({url:"/service.listServices",method:"get",params:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function s(e){return new Promise((t,r)=>{Object(i["a"])({url:"/serviceProvide.saveServiceProvide",method:"post",data:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}},"8d08":function(e,t,r){"use strict";r.r(t);var i=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"java110_step"},[t("el-steps",{attrs:{active:e.activeStep,"finish-status":"success"}},[t("el-step",{attrs:{title:"选择服务"}}),t("el-step",{attrs:{title:"开发服务实现"}}),t("el-step",{attrs:{title:"备注信息"}})],1)],1),0==e.activeStep?t("div",[t("view-service-info",{ref:"viewServiceInfo",on:{notify:e.handleNotify}})],1):e._e(),1==e.activeStep?t("div",[t("dev-service-provide-view",{ref:"devServiceProvideView",on:{notify:e.handleNotify}})],1):e._e(),2==e.activeStep?t("div",[t("service-provide-remark-view",{ref:"serviceProvideRemarkView",on:{notify:e.handleNotify}})],1):e._e(),t("el-row",[t("el-col",{attrs:{span:22,offset:2}},[t("div",{staticStyle:{"margin-bottom":"10px","text-align":"right"}},[t("el-button",{attrs:{plain:""},on:{click:e.prevStep}},[e._v(" "+e._s(e.$t("devServiceProvide.prevStep"))+" ")]),2!=e.activeStep?t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"primary"},on:{click:e.nextStep}},[e._v(" "+e._s(e.$t("devServiceProvide.nextStep"))+" ")]):e._e(),2==e.activeStep?t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"primary"},on:{click:e.finishStep}},[e._v(" "+e._s(e.$t("devServiceProvide.finish"))+" ")]):e._e()],1)])],1)],1)},a=[],s=r("1392"),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:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v(e._s(e.$t("devServiceProvideView.title")))])]),t("el-form",{attrs:{model:e.serviceProvideForm,"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("devServiceProvideView.implementType"),required:""}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("devServiceProvideView.implementTypePlaceholder")},model:{value:e.serviceProvideForm.queryModel,callback:function(t){e.$set(e.serviceProvideForm,"queryModel",t)},expression:"serviceProvideForm.queryModel"}},[t("el-option",{attrs:{value:"1",label:e.$t("devServiceProvideView.sqlMethod")}}),t("el-option",{attrs:{value:"3",label:e.$t("devServiceProvideView.javaMethod")}}),t("el-option",{attrs:{value:"2",label:e.$t("devServiceProvideView.procedureMethod")}})],1)],1),t("el-form-item",{attrs:{label:e.$t("devServiceProvideView.params"),required:""}},[t("el-input",{attrs:{placeholder:e.$t("devServiceProvideView.paramsPlaceholder")},model:{value:e.serviceProvideForm.params,callback:function(t){e.$set(e.serviceProvideForm,"params",t)},expression:"serviceProvideForm.params"}})],1),1==e.serviceProvideForm.queryModel?t("el-form-item",{attrs:{label:e.$t("devServiceProvideView.sql")}},[t("el-input",{attrs:{type:"textarea",rows:15,placeholder:e.$t("devServiceProvideView.sqlPlaceholder")},model:{value:e.serviceProvideForm.sql,callback:function(t){e.$set(e.serviceProvideForm,"sql",t)},expression:"serviceProvideForm.sql"}})],1):e._e(),1==e.serviceProvideForm.queryModel?t("el-form-item",{attrs:{label:e.$t("devServiceProvideView.outputTemplate")}},[t("el-input",{attrs:{type:"textarea",rows:5,placeholder:e.$t("devServiceProvideView.outputTemplatePlaceholder")},model:{value:e.serviceProvideForm.template,callback:function(t){e.$set(e.serviceProvideForm,"template",t)},expression:"serviceProvideForm.template"}})],1):e._e(),2==e.serviceProvideForm.queryModel?t("el-form-item",{attrs:{label:e.$t("devServiceProvideView.procedure")}},[t("el-input",{attrs:{type:"textarea",rows:5,placeholder:e.$t("devServiceProvideView.procedurePlaceholder")},model:{value:e.serviceProvideForm.proc,callback:function(t){e.$set(e.serviceProvideForm,"proc",t)},expression:"serviceProvideForm.proc"}})],1):e._e(),3==e.serviceProvideForm.queryModel?t("el-form-item",{attrs:{label:e.$t("devServiceProvideView.javaCode")}},[t("el-input",{attrs:{type:"textarea",rows:20,placeholder:e.$t("devServiceProvideView.javaCodePlaceholder")},model:{value:e.serviceProvideForm.javaScript,callback:function(t){e.$set(e.serviceProvideForm,"javaScript",t)},expression:"serviceProvideForm.javaScript"}})],1):e._e()],1)],1)],1)],1)},c=[],l={name:"DevServiceProvideView",props:{index:{type:Number,default:0}},data(){return{serviceProvideForm:{flowComponent:"devServiceProvideView",queryModel:"",params:"",sql:"",template:"",proc:"",javaScript:""}}},watch:{serviceProvideForm:{deep:!0,handler(e){this.$emit("notify",e)}}},created(){console.log(this.index)}},n=l,d=r("2877"),v=Object(d["a"])(n,o,c,!1,null,null,null),u=v.exports,m=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("serviceProvideRemarkView.title")))])]),t("el-form",{attrs:{model:e.remarkForm,"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("serviceProvideRemarkView.description")}},[t("el-input",{attrs:{type:"textarea",rows:10,placeholder:e.$t("serviceProvideRemarkView.descriptionPlaceholder")},model:{value:e.remarkForm.description,callback:function(t){e.$set(e.remarkForm,"description",t)},expression:"remarkForm.description"}})],1)],1)],1)],1)],1)},p=[],f={name:"ServiceProvideRemarkView",props:{index:{type:Number,default:0}},data(){return{remarkForm:{flowComponent:"serviceProvideRemarkView",description:""}}},watch:{remarkForm:{deep:!0,handler(e){this.$emit("notify",e)}}},created(){console.log(this.index)}},h=f,S=Object(d["a"])(h,m,p,!1,null,null,null),b=S.exports,_=r("805e"),w={name:"DevServiceProvide",components:{ViewServiceInfo:s["a"],DevServiceProvideView:u,ServiceProvideRemarkView:b},data(){return{activeStep:0,stepInfos:[]}},methods:{handleNotify(e){console.log(e),this.stepInfos[this.activeStep]=e},prevStep(){this.activeStep>0&&this.activeStep--},nextStep(){const e=this.stepInfos[this.activeStep];e?this.activeStep++:this.$message.warning(this.$t("devServiceProvide.requiredInfo"))},async finishStep(){const e=this.stepInfos[this.activeStep];if(e)try{const e={data:this.stepInfos};await Object(_["b"])(e),this.$message.success(this.$t("devServiceProvide.success")),this.$router.go(-1)}catch(t){this.$message.error(t.message||this.$t("devServiceProvide.error"))}else this.$message.warning(this.$t("devServiceProvide.requiredInfo"))}}},g=w,$=(r("2bc0"),Object(d["a"])(g,i,a,!1,null,"9fed3adc",null));t["default"]=$.exports},"964e":function(e,t,r){"use strict";r("2dec")},"9d2a":function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return o}));var i=r("b775");function a(e){return new Promise((t,r)=>{Object(i["a"])({url:"/app.saveApp",method:"post",data:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function s(e){return new Promise((t,r)=>{Object(i["a"])({url:"/service.listServices",method:"get",params:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function o(e){return new Promise((t,r)=>{Object(i["a"])({url:"/service.bindingService",method:"post",data:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}},d515:function(e,t,r){"use strict";var i=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,r){return t("el-option",{key:r,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=[],s=r("7323"),o=r("e225"),c={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(s["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(o["d"])(this.addServiceInfo),this.$message.success(this.$t("addService.saveSuccess")),this.dialogVisible=!1,this.$emit("success")}catch(t){console.error("保存服务失败:",t)}})}}},l=c,n=r("2877"),d=Object(n["a"])(l,i,a,!1,null,null,null);t["a"]=d.exports},df11:function(e,t,r){"use strict";r("0a6a")},e225:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"d",(function(){return s})),r.d(t,"e",(function(){return o})),r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return l}));var i=r("b775");function a(e){return new Promise((t,r)=>{Object(i["a"])({url:"/service.listServices",method:"get",params:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function s(e){return new Promise((t,r)=>{Object(i["a"])({url:"/service.saveService",method:"post",data:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function o(e){return new Promise((t,r)=>{Object(i["a"])({url:"/service.updateService",method:"post",data:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function c(e){return new Promise((t,r)=>{Object(i["a"])({url:"/service.deleteService",method:"post",data:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function l(e){return new Promise((t,r)=>{Object(i["a"])({url:"/app.listApps",method:"get",params:e}).then(e=>{const r=e.data;t(r.apps[0])}).catch(e=>{r(e)})})}}}]);
|
||
//# sourceMappingURL=chunk-18385b58.74f0f7f1.js.map
|