2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b8a3e10c"],{"59fe":function(e,t,a){},"88c1":function(e,t,a){},9192:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e._self._c;return t("div",["centralizedPurchase"===e.centralizedPurchaseInfo.component?t("el-row",[t("el-col",{staticClass:"padding-right-0",attrs:{span:4}},[t("div",{staticClass:"bg-white treeview"},[t("ul",{staticClass:"list-group text-center"},e._l(e.centralizedPurchaseInfo.asGroups,(function(a,s){return t("li",{key:s,staticClass:"list-group-item node-orgTree",class:{"vc-node-selected":e.centralizedPurchaseInfo.conditions.asGroupId===a.avgId},on:{click:function(t){return e.swatch(a)}}},[e._v(" "+e._s(a.avgName)+" ")])})),0)])]),t("el-col",{attrs:{span:20}},["centralizedPurchase"===e.centralizedPurchaseInfo.component?t("el-row",[t("el-col",{attrs:{span:24}},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v(e._s(e.$t("centralizedPurchase.queryCondition")))])]),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:6}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("centralizedPurchase.selectServiceType")},model:{value:e.centralizedPurchaseInfo.conditions.asType,callback:function(t){e.$set(e.centralizedPurchaseInfo.conditions,"asType",t)},expression:"centralizedPurchaseInfo.conditions.asType"}},e._l(e.serviceTypes,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),t("el-col",{attrs:{span:6}},[t("el-input",{attrs:{placeholder:e.$t("centralizedPurchase.inputServiceName")},model:{value:e.centralizedPurchaseInfo.conditions.asName,callback:function(t){e.$set(e.centralizedPurchaseInfo.conditions,"asName",t)},expression:"centralizedPurchaseInfo.conditions.asName"}})],1),t("el-col",{attrs:{span:6}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("centralizedPurchase.selectStatus")},model:{value:e.centralizedPurchaseInfo.conditions.state,callback:function(t){e.$set(e.centralizedPurchaseInfo.conditions,"state",t)},expression:"centralizedPurchaseInfo.conditions.state"}},e._l(e.statusOptions,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),t("el-col",{attrs:{span:6}},[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e._queryAppServiceMethod()}}},[t("i",{staticClass:"el-icon-search"}),e._v(" "+e._s(e.$t("centralizedPurchase.search"))+" ")])],1)],1)],1)],1)],1):e._e(),t("el-row",[t("el-col",{attrs:{span:24}},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v(e._s(e.$t("centralizedPurchase.appService")))]),t("div",{staticStyle:{float:"right"}},[t("el-button-group",[t("el-button",{attrs:{size:"small"},on:{click:function(t){return e._restartMoreApps()}}},[e._v(" "+e._s(e.$t("centralizedPurchase.restartAll"))+" ")]),t("el-button",{attrs:{size:"small"},on:{click:function(t){return e._openAddAppServiceModal()}}},[e._v(" "+e._s(e.$t("centralizedPurchase.addService"))+" ")]),t("el-button",{attrs:{size:"small"},on:{click:function(t){return e._openFasterDeploy()}}},[e._v(" "+e._s(e.$t("centralizedPurchase.quickDeploy"))+" ")]),t("el-button",{attrs:{size:"small"},on:{click:function(t){return e._importYaml()}}},[e._v(" "+e._s(e.$t("centralizedPurchase.import"))+" ")]),t("el-button",{attrs:{size:"small"},on:{click:function(t){return e._exportYaml()}}},[e._v(" "+e._s(e.$t("centralizedPurchase.export"))+" ")])],1)],1)]),t("centralized-purchase-table",{attrs:{data:e.centralizedPurchaseInfo.goods},on:{control:e._openControl,copy:e._copyAppService,upgrade:e._upgradeAppService,start:e._startAppService,stop:e._stopAppService,delete:e._openDeleteAppServiceModel,log:e._openDockerLog}}),t("el-pagination",{staticStyle:{"margin-top":"20px","text-align":"right"},attrs:{"current-page":e.centralizedPurchaseInfo.conditions.page,"page-size":e.centralizedPurchaseInfo.conditions.row,layout:"total, prev, pager, next",total:e.centralizedPurchaseInfo.total},on:{"current-change":e.handleCurrentChange}})],1)],1)],1)],1)],1):e._e()],1)},r=[],i=a("7323"),c=a("b775");function n(e){return new Promise((t,a)=>{Object(c["a"])({url:"/appService.getAppService",method:"get",params:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}function o(e){return new Promise((t,a)=>{Object(c["a"])({url:"/appService.getAppVarGroup",method:"get",params:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}var l=function(){var e=this,t=e._self._c;return t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.data,border:"",stripe:"",size:"small"}},[t("el-table-column",{attrs:{prop:"asTypeName",label:e.$t("centralizedPurchase.serviceType"),align:"center"}}),t("el-table-column",{attrs:{prop:"asName",label:e.$t("centralizedPurchase.appName"),align:"center"}}),t("el-table-column",{attrs:{prop:"asCount",label:e.$t("centralizedPurchase.replicas"),align:"center"}}),t("el-table-column",{attrs:{label:e.$t("centralizedPurchase.image"),align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.imagesName)+":"+e._s(t.row.imagesVersion)+" ")]}}])}),t("el-table-column",{attrs:{label:e.$t("centralizedPurchase.createTime"),align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.formatUTCTime(t.row.createTime))+" ")]}}])}),t("el-table-column",{attrs:{label:e.$t("centralizedPurchase.status"),align:"center"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-tag",{attrs:{type:e.getStatusTagType(a.row.state),size:"small"}},[e._v(" "+e._s(a.row.stateName)+" ")])]}}])}),t("el-table-column",{attrs:{label:e.$t("centralizedPurchase.operations"),align:"center",width:"400"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.$emit("control",a.row)}}},[e._v(" "+e._s(e.$t("centralizedPurchase.console"))+" ")]),t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.$emit("upgrade",a.row)}}},[e._v(" "+e._s(e.$t("centralizedPurchase.upgradeDowngrade"))+" ")]),"10012"===a.row.state?t("el-button",{attrs:{size:"mini",type:"success"},on:{click:function(t){return e.$emit("start",a.row)}}},[e._v(" "+e._s(e.$t("centralizedPurchase.start"))+" ")]):t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.$emit("stop",a.row)}}},[e._v(" "+e._s(e.$t("centralizedPurchase.stop"))+" ")]),t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.$emit("copy",a.row)}}},[e._v(" "+e._s(e.$t("centralizedPurchase.copy"))+" ")]),"10012"===a.row.state?t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.$emit("delete",a.row)}}},[e._v(" "+e._s(e.$t("centralizedPurchase.delete"))+" ")]):e._e(),"10012"!==a.row.state?t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.$emit("log",a.row)}}},[e._v(" "+e._s(e.$t("centralizedPurchase.logs"))+" ")]):e._e()],1)]}}])})],1)},p=[],u={name:"CentralizedPurchaseTable",props:{data:{type:Array,default:()=>[]}},methods:{formatUTCTime(e){return e?new Date(e).toLocaleString():""},getStatusTagType(e){switch(e){case"10015":return"success";case"10014":return"warning";default:return"danger"}}}},d=u,h=(a("d6055"),a("2877")),_=Object(h["a"])(d,l,p,!1,null,"9f34acec",null),m=_.exports,v={name:"CentralizedPurchase",components:{CentralizedPurchaseTable:m},data(){return{DEFAULT_PAGE:1,DEFAULT_ROWS:10,centralizedPurchaseInfo:{goods:[],total:0,records:1,moreCondition:!1,component:"centralizedPurchase",asId:"",asGroups:[],conditions:{asName:"",asType:"",asCount:"",asGroupId:"",state:"",page:1,row:10}},serviceTypes:[],statusOptions:[]}},created(){this._initMethod(),this._initEvent(),this.getDictData()},methods:{async getDictData(){try{const{data:e}=await Object(i["e"])("app_service","as_type"),{data:t}=await Object(i["e"])("app_service","state");this.serviceTypes=e,this.statusOptions=t}catch(e){console.error("获取字典数据失败:",e)}},_initMethod(){this._listListAppVarGroups()},_initEvent(){this.$on("centralizedPurchase","listAppService",e=>{console.log(e),this.centralizedPurchaseInfo.component="centralizedPurchase",this._listAppServices(this.DEFAULT_PAGE,this.DEFAULT_ROWS)})},async _listAppServices(e,t){this.centralizedPurchaseInfo.conditions.page=e,this.centralizedPurchaseInfo.conditions.row=t;try{const e=await n(this.centralizedPurchaseInfo.conditions);this.centralizedPurchaseInfo.total=e.total,this.centralizedPurchaseInfo.records=e.records,this.centralizedPurchaseInfo.goods=e.data}catch(a){console.error("请求失败处理",a)}},async _listListAppVarGroups(){try{const e=await o({page:1,row:50});this.centralizedPurchaseInfo.asGroups=e.data,e.data.length>0&&(this.centralizedPurchaseInfo.conditions.asGroupId=e.data[0].avgId,this._listAppServices(this.DEFAULT_PAGE,this.DEFAULT_ROWS))}catch(e){console.error("请求失败处理",e)}},handleCurrentChange(e){this.DEFAULT_PAGE=e,this._listAppServices(e,this.DEFAULT_ROWS)},_openAddAppServiceModal(){this.centralizedPurchaseInfo.component="addAppService",this.$emit("addAppService","openAddAppServiceModal",{})},_openControl(e){this.$router.push("/pages/admin/appServiceControl?asId="+e.asId)},_copyAppService(e){this.$emit("copyAppService","openCopyAppServiceModal",e)},_upgradeAppService(e){this.$emit("upgradeAppService","openUpgradeAppServiceModal",e)},_openDeleteAppServiceModel(e){this.$emit("deleteAppService","openDeleteAppServiceModal",e)},_queryAppServiceMethod(){this._listAppServices(this.DEFAULT_PAGE,this.DEFAULT_ROWS)},_moreCondition(){console.log(this.centralizedPurchaseInfo.moreCondition),this.centralizedPurchaseInfo.moreCondition=!this.centralizedPurchaseInfo.moreCondition},async _startAppService(e){try{await this.$http.post("/appService/startAppService",e),this.$message.success(this.$t("centralizedPurchase.startSuccess")),this.$emit("centralizedPurchase","listAppService",{})}catch(t){this.$message.error(t.message)}},async _stopAppService(e){try{await this.$http.post("/appService/stopAppService",e),this.$message.success(this.$t("centralizedPurchase.stopSuccess")),this.$emit("centralizedPurchase","listAppService",{})}catch(t){this.$message.error(t.message)}},_openFasterDeploy(){this.$router.push("/pages/admin/fasterDeploy")},_exportYaml(){this.$emit("selectAppService","openSelectAppService",{asGroupId:this.centralizedPurchaseInfo.conditions.asGroupId,callBack:this._doExportYaml})},_doExportYaml(e){window.location.href="/app/appService/exportAppService?asIds="+e},_importYaml(){this.$emit("importAppService","openImportAppServiceModal",{})},_restartMoreApps(){this.$emit("selectAppService","openSelectAppService",{asGroupId:this.centralizedPurchaseInfo.conditions.asGroupId,callBack:this._doRestartMoreApps})},async _doRestartMoreApps(e){try{await this.$http.post("/appService/restartAppServices",{asIds:e}),this.$message.success(this.$t("centralizedPurchase.restartRequestSent")),this.$emit("centralizedPurchase","listAppService",{})}catch(t){this.$message.error(t.message)}},_openDockerLog(e){this.$emit("chooseHostContainer","openChooseHostContainerModel",e)},swatch(e){this.centralizedPurchaseInfo.conditions.asGroupId=e.avgId,this._listAppServices(1,this.DEFAULT_ROWS)}}},f=v,z=(a("ec4b"),Object(h["a"])(f,s,r,!1,null,"949b0b3e",null));t["default"]=z.exports},d6055:function(e,t,a){"use strict";a("59fe")},ec4b:function(e,t,a){"use strict";a("88c1")}}]);
|
|
//# sourceMappingURL=chunk-b8a3e10c.fd6cb9c2.js.map
|