UNPKG

goldpankit

Version:

GoldPanKit是一款极速研发套件,可在套件中快速构建各类技术框架和项目。开源作者可发布自己的项目,并为其设定金额,实现开源项目的盈利。

2 lines (1 loc) 4.75 kB
import{_ as P,O as w,E as I,s as S,d as C,r as c,o as r,c as i,a as t,t as s,b as o,w as n,e as p,F as g,f as U,g as W,m as D,h as N,i as v,j as k,p as E,k as F}from"./index-10e8cffd.js";const B={name:"UserProjects",components:{OperaProjectWindow:w,Empty:I},data(){return{projects:[]}},methods:{search(){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(()=>{C(e.id).then(()=>{this.search()}).catch(l=>{this.$tip.apiFailed(l)})}).catch(()=>{})}},created(){this.search()}},O={class:"user-projects"},V={class:"title"},A={key:0},L={class:"avatar"},z={class:"info"},R={class:"opera"};function T(e,l,b,j,_,d){const u=c("Plus"),h=c("el-icon"),m=c("el-button"),f=c("Empty"),$=c("OperaProjectWindow");return r(),i("div",O,[t("div",V,[t("h2",null,s(e.$t("project.myProjects")),1),o(m,{type:"primary",onClick:l[0]||(l[0]=a=>e.$refs.operaProjectWindow.open())},{default:n(()=>[o(h,{size:14,style:{"margin-right":"5px"}},{default:n(()=>[o(u)]),_:1}),p(" "+s(e.$t("project.createProject")),1)]),_:1})]),_.projects.length>0?(r(),i("ul",A,[(r(!0),i(g,null,U(_.projects,a=>(r(),i("li",{key:a.id},[t("div",L,s(a.name.substring(0,1)),1),t("div",z,[t("h3",null,s(a.name),1),t("p",null,s(a.codespace),1),t("p",null,s(a.remark),1)]),t("div",R,[o(m,{size:"small",icon:"Edit",onClick:y=>d.editProject(a)},{default:n(()=>[p(s(e.$t("common.edit")),1)]),_:2},1032,["onClick"]),o(m,{type:"danger",text:"",onClick:y=>d.deleteProject(a)},{default:n(()=>[p(s(e.$t("common.delete")),1)]),_:2},1032,["onClick"])])]))),128))])):(r(),W(f,{key:1,description:e.$t("project.noProjects")},null,8,["description"])),o($,{ref:"operaProjectWindow",onSuccess:d.search},null,8,["onSuccess"])])}const M=P(B,[["render",T],["__scopeId","data-v-72f2fdf9"]]);const q={components:{UserProjects:M},data(){return{logoutData:{isWorking:!1}}},computed:{...D(["userInfo"])},methods:{...N(["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}))}}},G=e=>(E("data-v-85b80671"),e=e(),F(),e),H={class:"page"},J={class:"wrap"},K={class:"line"},Q={key:0},X=G(()=>t("p",{class:"login-tip-wrap"},[p(" 当前未登录,"),t("em",null,"去登录!")],-1)),Y={key:0},Z={class:"line gap-top"},x={key:0,class:"line gap-top"},ee={class:"project-wrap"};function te(e,l,b,j,_,d){const u=c("router-link"),h=c("el-button"),m=c("Right"),f=c("el-icon"),$=c("UserProjects");return r(),i("div",H,[t("div",J,[t("div",K,[o(u,{to:{name:"PublicServices"},class:"module public-space"},{default:n(()=>[t("h2",null,s(e.$t("service.publicServices")),1),t("p",null,s(e.$t("service.publicServiceIntroduce")),1)]),_:1}),t("a",{onClick:l[2]||(l[2]=(...a)=>d.toUserProfile&&d.toUserProfile(...a)),class:"module profile"},[e.userInfo==null?(r(),i(g,{key:0},[e.userInfo==null?(r(),i("h2",Q,s(e.$t("user.account")),1)):v("",!0),X],64)):(r(),i(g,{key:1},[t("h2",null,s(e.getUserDisplayName(e.userInfo)),1),e.userInfo!=null?(r(),i("ul",Y,[t("li",null,[o(h,{icon:"UserFilled",onClick:l[0]||(l[0]=k(a=>e.$router.push({name:"UserProfile"}),["stop"]))},{default:n(()=>[p(s(e.$t("user.profile")),1)]),_:1})]),t("li",null,[o(h,{disabled:_.logoutData.isWorking,onClick:l[1]||(l[1]=k(a=>e.$router.push({name:"UpdatePwd"}),["stop"]))},{default:n(()=>[p("修改密码")]),_:1},8,["disabled"])])])):v("",!0),o(h,{class:"button-logout",disabled:_.logoutData.isWorking,link:"",onClick:k(d.doLogout,["stop"])},{default:n(()=>[p(s(e.$t("user.logout")),1),o(f,null,{default:n(()=>[o(m)]),_:1})]),_:1},8,["disabled","onClick"])],64))])]),t("div",Z,[o(u,{class:"module workbench",to:{name:"Workbench"}},{default:n(()=>[t("h2",null,s(e.$t("space.workbench")),1),t("p",null,s(e.$t("space.workbenchIntroduce")),1)]),_:1}),o(u,{to:{name:"Databases"},class:"module database"},{default:n(()=>[t("h2",null,s(e.$t("database.databases")),1),t("p",null,s(e.$t("database.databaseIntroduce")),1)]),_:1})]),e.userInfo!=null&&e.userInfo.isDeveloper?(r(),i("div",x,[o(u,{to:{name:"CreateSpace"},class:"module new-space"},{default:n(()=>[t("h2",null,s(e.$t("space.createNewSpace")),1),t("p",null,s(e.$t("space.createNewSpaceIntroduce")),1)]),_:1}),o(u,{class:"module private-services",to:{name:"UserServices"}},{default:n(()=>[t("h2",null,s(e.$t("user.leasedAndPrivateServices")),1),t("p",null,s(e.$t("user.leasedAndPrivateServiceIntroduce")),1)]),_:1})])):v("",!0),t("div",ee,[o($)])])])}const oe=P(q,[["render",te],["__scopeId","data-v-85b80671"]]);export{oe as default};