goldpankit
Version:
GoldPanKit是一款极速研发套件,可在套件中快速构建各类技术框架和项目。开源作者可发布自己的项目,并为其设定金额,实现开源项目的盈利。
2 lines (1 loc) • 4.79 kB
JavaScript
import{_ as b,O as I,E as C,f as S,d as U,r as c,o as a,c as r,a as t,t as o,b as s,w as l,e as u,F as v,g as W,h as D,m as N,i as E,j as $,k as g,p as F,l as z}from"./index-d9f3c27d.js";const A={name:"UserProjects",components:{OperaProjectWindow:I,Empty:C},data(){return{projects:[]}},methods:{fetchAll(){S().then(e=>{this.projects=e}).catch(e=>{this.$tip.apiFailed(e)})},editProject(e){this.$refs.operaProjectWindow.open(e)},deleteProject(e){this.deleteConfirm(this.$t("project.deleteTip",{value:`「${e.name}」`})).then(()=>{U(e.id).then(()=>{this.fetchAll()}).catch(i=>{this.$tip.apiFailed(i)})}).catch(()=>{})}},created(){this.fetchAll()}},B={class:"user-projects"},O={class:"title"},V={key:0},L={class:"avatar"},R={class:"info"},T={class:"opera"};function M(e,i,j,w,h,d){const p=c("Plus"),m=c("el-icon"),_=c("el-button"),f=c("Empty"),k=c("OperaProjectWindow");return a(),r("div",B,[t("div",O,[t("h2",null,o(e.$t("project.myProjects")),1),s(_,{type:"primary",onClick:i[0]||(i[0]=n=>e.$refs.operaProjectWindow.open())},{default:l(()=>[s(m,{size:14,style:{"margin-right":"5px"}},{default:l(()=>[s(p)]),_:1}),u(" "+o(e.$t("project.createProject")),1)]),_:1})]),h.projects.length>0?(a(),r("ul",V,[(a(!0),r(v,null,W(h.projects,n=>(a(),r("li",{key:n.id},[t("div",L,o(n.name.substring(0,1)),1),t("div",R,[t("h3",null,o(n.name),1),t("p",null,o(n.codespace),1),t("p",null,o(n.remark),1)]),t("div",T,[s(_,{type:"primary",size:"small",onClick:y=>e.$router.push({name:"Databases",params:{projectId:n.id}})},{default:l(()=>[u("数据库")]),_:2},1032,["onClick"]),s(_,{size:"small",icon:"Edit",onClick:y=>d.editProject(n)},{default:l(()=>[u(o(e.$t("common.edit")),1)]),_:2},1032,["onClick"]),s(_,{type:"danger",text:"",onClick:y=>d.deleteProject(n)},{default:l(()=>[u(o(e.$t("common.delete")),1)]),_:2},1032,["onClick"])])]))),128))])):(a(),D(f,{key:1,description:e.$t("project.noProjects")},null,8,["description"])),s(k,{ref:"operaProjectWindow",onSuccess:e.search},null,8,["onSuccess"])])}const q=b(A,[["render",M],["__scopeId","data-v-7c4796ff"]]);const G={components:{UserProjects:q},data(){return{logoutData:{isWorking:!1}}},computed:{...N(["userInfo"])},methods:{...E(["logout"]),toUserProfile(){this.userInfo==null&&this.$router.push({name:"SignIn"})},doLogout(){this.logoutData.isWorking||(this.logoutData.isWorking=!0,this.logout().then(()=>{this.$router.push({name:"SignIn"})}).catch(e=>{this.$tip.apiFailed(e)}).finally(()=>{this.logoutData.isWorking=!1}))}}},P=e=>(F("data-v-21b585a4"),e=e(),z(),e),H={class:"page"},J={class:"wrap"},K={class:"line"},Q={key:0},X=P(()=>t("p",{class:"login-tip-wrap"},[u(" 当前未登录,"),t("em",null,"去登录!")],-1)),Y={key:0},Z={class:"line gap-top"},x={key:0,class:"line gap-top"},ee=P(()=>t("h2",null,"我的服务和插件",-1)),te=P(()=>t("p",null,"点击此处可查看自己创建的服务和插件",-1)),oe={class:"project-wrap"};function se(e,i,j,w,h,d){const p=c("router-link"),m=c("el-button"),_=c("Right"),f=c("el-icon"),k=c("UserProjects");return a(),r("div",H,[t("div",J,[t("div",K,[s(p,{to:{name:"PublicServices"},class:"module public-space"},{default:l(()=>[t("h2",null,o(e.$t("service.publicServices")),1),t("p",null,o(e.$t("service.publicServiceIntroduce")),1)]),_:1}),t("a",{onClick:i[2]||(i[2]=(...n)=>d.toUserProfile&&d.toUserProfile(...n)),class:"module profile"},[e.userInfo==null?(a(),r(v,{key:0},[e.userInfo==null?(a(),r("h2",Q,o(e.$t("user.account")),1)):$("",!0),X],64)):(a(),r(v,{key:1},[t("h2",null,o(e.getUserDisplayName(e.userInfo)),1),e.userInfo!=null?(a(),r("ul",Y,[t("li",null,[s(m,{size:"default",icon:"UserFilled",onClick:i[0]||(i[0]=g(n=>e.$router.push({name:"UserProfile"}),["stop"]))},{default:l(()=>[u(o(e.$t("user.profile")),1)]),_:1})]),t("li",null,[s(m,{size:"default",disabled:h.logoutData.isWorking,onClick:i[1]||(i[1]=g(n=>e.$router.push({name:"UpdatePwd"}),["stop"]))},{default:l(()=>[u("修改密码")]),_:1},8,["disabled"])])])):$("",!0),s(m,{class:"button-logout",disabled:h.logoutData.isWorking,link:"",onClick:g(d.doLogout,["stop"])},{default:l(()=>[u(o(e.$t("user.logout")),1),s(f,null,{default:l(()=>[s(_)]),_:1})]),_:1},8,["disabled","onClick"])],64))])]),t("div",Z,[s(p,{class:"module workbench",to:{name:"Workbench"}},{default:l(()=>[t("h2",null,o(e.$t("space.workbench")),1),t("p",null,o(e.$t("space.workbenchIntroduce")),1)]),_:1})]),e.userInfo!=null&&e.userInfo.isDeveloper?(a(),r("div",x,[s(p,{to:{name:"CreateSpace"},class:"module new-space"},{default:l(()=>[t("h2",null,o(e.$t("space.createNewSpace")),1),t("p",null,o(e.$t("space.createNewSpaceIntroduce")),1)]),_:1}),s(p,{class:"module private-services",to:{name:"UserServices"}},{default:l(()=>[ee,te]),_:1})])):$("",!0),t("div",oe,[s(k)])])])}const le=b(G,[["render",se],["__scopeId","data-v-21b585a4"]]);export{le as default};