goldpankit
Version:
GoldPanKit是一款极速研发套件,可在套件中快速构建各类技术框架和项目。开源作者可发布自己的项目,并为其设定金额,实现开源项目的盈利。
2 lines (1 loc) • 7.59 kB
JavaScript
import{_ as D,M as z,S as I,m as E,q as F,a0 as B,a1 as N,r,z as M,A as u,o as p,c as h,a as l,b as n,w as g,j as m,t as o,F as q,I as c,J as v,h as b,e as f}from"./index-ae815648.js";import{S as O,V as U,P as A,B as H,I as J,a as R}from"./SystemVariableTable-fba5e077.js";import{S as G,s as K,d as L,e as Q}from"./PluginSelector-38ccc852.js";import{S as X}from"./ServiceTitle-908a4dda.js";import"./CompilerSelect-5c6f4d90.js";import"./service-39ac4673.js";import"./QueryModelView-7a33e538.js";import"./InnerRouterViewWindow-2efc1485.js";import"./service.version-35b857d8.js";const Y={components:{ServiceTitle:X,SystemVariableTable:O,ServiceCodeErrorWindow:G,MarkdownEditor:z,Variables:U,PublishWindow:A,BasicSetting:H,InitializeView:J,DirectorySelect:I,SettingFiles:R},data(){return{isWorking:{compile:!1,cleanCompile:!1},route:{space:null,service:null,plugin:null},loading:!0,currentTab:"basic",plugin:null,pluginConfig:null}},computed:{...E(["currentProject","currentProjectDetail","currentDatabase","installData"]),initialized(){return this.pluginConfig!=null&&this.pluginConfig.version!=null},compileTip(){return this.currentProjectDetail!=null?this.$t("service.settings.compileTipWithProject",{project:this.currentProjectDetail.name}):this.$t("service.settings.compileTip")},cleanCompileTip(){return this.currentProjectDetail!=null?this.$t("service.settings.cleanCompileTipWithProject",{project:this.currentProjectDetail.name}):this.$t("service.settings.cleanCompileTip")}},methods:{...F(["setInstallData"]),saveConfig(){K({...this.route,readme:this.plugin.description}).catch(i=>{this.$tip.apiFailed(i)})},fetchProfile(){this.loading=!0,L({spaceName:this.route.space,serviceName:this.route.service,pluginName:this.route.plugin}).then(i=>{this.plugin=i}).then(()=>Q({space:this.route.space,service:this.route.service,plugin:this.route.plugin})).then(i=>{i!=null&&(this.pluginConfig=i,this.pluginConfig.label=this.pluginConfig.label||this.pluginConfig.name,this.plugin.label=this.pluginConfig.label,this.plugin.description=i.readme)}).catch(i=>{this.$tip.apiFailed(i)}).finally(()=>{this.loading=!1})},compile(){this.isWorking.compile||this.currentProject==null||this.currentProject===""||(this.isWorking.compile=!0,B({...this.route,serviceType:"COMMON",projectId:this.currentProject,database:this.currentDatabase,variables:this.$refs.variables.getVariables()}).then(i=>{this.setInstallData(i),this.$tip.success(this.$t("common.compileSuccessfully"))}).catch(i=>{if(i.code===6e3){this.$refs.serviceCodeErrorWindow.open(i.errorData);return}if(i.code===5111){this.error(`您当前项目服务版本过低,当前插件至少需要将项目服务升级到v${i.errorData}才可安装!`);return}this.$tip.apiFailed(i)}).finally(()=>{this.isWorking.compile=!1}))},cleanCompile(){this.isWorking.cleanCompile||this.currentProject==null||this.currentProject===""||(this.isWorking.cleanCompile=!0,N({...this.route,projectId:this.currentProject,database:this.currentDatabase,variables:this.$refs.variables.getVariables()}).then(i=>{this.$tip.success("Clean Compile successfully."),this.setInstallData(i)}).catch(i=>{if(i.code===6e3){this.$refs.serviceCodeErrorWindow.open(i.errorData);return}this.$tip.apiFailed(i)}).finally(()=>{this.isWorking.cleanCompile=!1}))}},created(){this.route.space=this.$route.query.space,this.route.service=this.$route.query.service,this.route.plugin=this.$route.query.plugin,this.fetchProfile()}},Z={class:"wrap"},x={class:"header-wrap"},$={class:"header"},ee={key:0,class:"opera"},ie={key:0,class:"text-info-1 service-path"},se={class:"main"},te={class:"tabs"},re={class:"tab-content"};function le(i,s,ne,oe,e,t){const _=r("ServiceTitle"),d=r("el-button"),C=r("el-popover"),T=r("BasicSetting"),k=r("MarkdownEditor"),y=r("Variables"),w=r("SettingFiles"),S=r("SystemVariableTable"),P=r("InitializeView"),W=r("PublishWindow"),j=r("ServiceCodeErrorWindow"),V=M("loading");return e.plugin!=null?u((p(),h("div",{key:0,class:c(["page",{"page-un-initialize":!t.initialized}])},[l("div",Z,[l("div",x,[l("div",$,[n(_,{space:e.plugin.space.name,service:e.plugin.service.name,"service-label":e.plugin.service.label,plugin:e.plugin.name,"plugin-label":e.plugin.label,"with-new-page":!0},null,8,["space","service","service-label","plugin","plugin-label"]),t.initialized?(p(),h("div",ee,[n(C,{placement:"top-start",title:i.$t("service.settings.compileTipTitle"),width:200,trigger:"hover",content:t.compileTip},{reference:g(()=>[n(d,{type:"primary",class:c({"is-disabled":i.currentProject==null||e.isWorking.compile}),loading:e.isWorking.compile,onClick:t.compile},{default:g(()=>[f(o(i.$t("service.settings.compile")),1)]),_:1},8,["class","loading","onClick"])]),_:1},8,["title","content"]),n(C,{placement:"top-start",title:i.$t("service.settings.cleanCompileTipTitle"),width:200,trigger:"hover",content:t.cleanCompileTip},{reference:g(()=>[n(d,{type:"primary",class:c({"is-disabled":i.currentProject==null||e.isWorking.cleanCompile}),loading:e.isWorking.cleanCompile,onClick:t.cleanCompile},{default:g(()=>[f(o(i.$t("service.settings.cleanCompile")),1)]),_:1},8,["class","loading","onClick"])]),_:1},8,["title","content"]),n(d,{type:"important",onClick:s[0]||(s[0]=a=>i.$refs.publishWindow.open(e.route.space,e.route.service,e.route.plugin))},{default:g(()=>[f(o(i.$t("service.settings.publish")),1)]),_:1})])):m("",!0)]),t.initialized?(p(),h("p",ie,o(i.$t("service.settings.at"))+" "+o(e.plugin.local.codespace),1)):m("",!0)]),l("div",se,[t.initialized?(p(),h(q,{key:0},[l("ul",te,[l("li",{class:c({selected:e.currentTab==="basic"}),onClick:s[1]||(s[1]=a=>e.currentTab="basic")},o(i.$t("plugin.settings2")),3),l("li",{class:c({selected:e.currentTab==="readme"}),onClick:s[2]||(s[2]=a=>e.currentTab="readme")},o(i.$t("plugin.readme")),3),l("li",{class:c({selected:e.currentTab==="variables"}),onClick:s[3]||(s[3]=a=>e.currentTab="variables")},o(i.$t("service.settings.variables")),3),l("li",{class:c({selected:e.currentTab==="files"}),onClick:s[4]||(s[4]=a=>e.currentTab="files")},o(i.$t("service.settings.files")),3),l("li",{class:c({selected:e.currentTab==="system_variables"}),onClick:s[5]||(s[5]=a=>e.currentTab="system_variables")},o(i.$t("service.settings.systemVariables")),3)]),l("div",re,[u(n(T,{space:e.route.space,service:e.route.service,plugin:e.route.plugin,"service-config":e.pluginConfig,onCloneSuccess:t.fetchProfile},null,8,["space","service","plugin","service-config","onCloneSuccess"]),[[v,e.currentTab==="basic"]]),e.plugin.description!=null?u((p(),b(k,{key:0,modelValue:e.plugin.description,"onUpdate:modelValue":[s[6]||(s[6]=a=>e.plugin.description=a),t.saveConfig],placeholder:i.$t("service.settings.serviceReadmeHolder")},null,8,["modelValue","placeholder","onUpdate:modelValue"])),[[v,e.currentTab==="readme"]]):m("",!0),u(n(y,{ref:"variables",space:e.route.space,service:e.route.service,plugin:e.route.plugin},null,8,["space","service","plugin"]),[[v,e.currentTab==="variables"]]),u(n(w,{space:e.route.space,service:e.route.service,plugin:e.route.plugin},null,8,["space","service","plugin"]),[[v,e.currentTab==="files"]]),e.currentTab==="system_variables"?(p(),b(S,{key:1})):m("",!0)])],64)):(p(),b(P,{key:1,"space-name":e.plugin.space.name,"service-name":e.plugin.service.name,"plugin-name":e.plugin.name,"plugin-label":e.plugin.label,onInitialized:t.fetchProfile},null,8,["space-name","service-name","plugin-name","plugin-label","onInitialized"]))])]),n(W,{ref:"publishWindow"},null,512),n(j,{ref:"serviceCodeErrorWindow"},null,512)],2)),[[V,e.loading]]):m("",!0)}const be=D(Y,[["render",le],["__scopeId","data-v-ed393e1c"]]);export{be as default};