import{_ as C}from"./index.76a66f15.js";import{bj as _,C as i,D as p,aJ as n,b2 as s,aV as o,E as v,bt as w,bs as x,bL as D,a$ as k,b1 as f,aG as u,b3 as r,b5 as m,bA as q,cg as I,c8 as A,bo as E,bv as L,bP as P}from"./arco.f3c60d68.js";const F={components:{Modal:_},data(){return{isShow:this.visible}},props:{visible:{type:Boolean,default:!1}},methods:{handleCancel(){this.$emit("cancel",!1)},handleOk(){this.$emit("ok",!1)}},watch:{visible:function(){this.isShow=this.visible}}};function G(l,t,B,S,e,a){const d=w,h=x,c=D,g=_;return i(),p("div",null,[n(g,{class:"update-modal",hideTitle:!1,"mask-closable":!0,visible:e.isShow,onOk:a.handleOk,onClose:a.handleCancel,onCancel:a.handleCancel,"title-align":"start",footer:!1,width:300,onBeforeClose:l.handleBeforeClose},{title:s(()=>[n(d,{style:{"font-size":"13px"}},{default:s(()=>[...t[0]||(t[0]=[o(" \u8054\u7CFB\u5BA2\u670D ",-1)])]),_:1})]),default:s(()=>[n(c,{class:"content-card",style:{"padding-top":"0"}},{default:s(()=>[n(h,{direction:"vertical",fill:"",style:{"text-align":"center"}},{default:s(()=>[t[2]||(t[2]=v("img",{src:"https://tuzhi.ltd/assets/img/service.png",style:{width:"160px",height:"160px"}},null,-1)),n(d,{style:{"font-size":"13px"}},{default:s(()=>[...t[1]||(t[1]=[o(" \u5FAE\u4FE1\u626B\u7801\u8054\u7CFB\u5BA2\u670D ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["visible","onOk","onClose","onCancel","onBeforeClose"])])}const J=C(F,[["render",G],["__scopeId","data-v-018e5ed3"]]);const H={components:{Modal:_,serviceModal:J},data(){return{modal:{service:!1},appData:{},isShow:this.visible,groupName:"",versionData:{version_now:"1.0.0",version_new_no:"1.0.0",logo:"",name:""},ing:!1,loading:!1,timer:null,step:1,progress:[{label:"\u4E0B\u8F7D\u66F4\u65B0\u5305\u4E2D\u2026",action:"download"},{label:"\u8986\u76D6\u66F4\u65B0\u6587\u4EF6\u4E2D\u2026",action:"unzip"},{label:"\u6267\u884C\u6570\u636E\u5E93\u66F4\u65B0\u4E2D\u2026",action:"sql"}]}},props:{visible:{type:Boolean,default:!1},appTag:{type:Boolean,default:!1},action:{type:Boolean,default:!1}},methods:{handleCancel(){this.visible?_.warning({title:"\u63D0\u793A",titleAlign:"start",content:"\u5173\u95ED\u5F39\u7A97\u5C06\u4F1A\u505C\u6B62\u64CD\u4F5C\uFF0C\u786E\u5B9A\u8981\u5173\u95ED\u5417\uFF1F",hideCancel:!1,onOk:()=>{this.ing=!1,this.$emit("cancel",!1)}}):(this.ing=!1,this.$emit("cancel",!1))},getVersionData(){this.loading=!0,this.$request.post("admin/app/project/app/newest",{license_token:localStorage.getItem("license_token"),tag:this.appTag}).then(l=>{this.versionData=l.data,this.loading=!1}).catch(l=>{this.loading=!1,this.versionData=!1,this.$message.error(l.msg)})},handle(){var l=this;if(!this.ing)return!1;this.$request.post("admin/app/project/app/"+this.progress[this.step-1].action,{license_token:localStorage.getItem("license_token"),tag:this.appTag}).then(t=>{this.step>=this.progress.length?(this.$message.success("\u5B89\u88C5\u5B8C\u6210"),setTimeout(function(){this.ing=!1,l.$emit("ok",!1)},1400)):(this.step++,this.handle())}).catch(t=>{this.ing=!1,this.step=0,this.$message.error(t.msg)})},start(){this.ing=!0,this.step=1,this.handle()}},watch:{visible:function(){this.isShow=this.visible,this.visible&&this.getVersionData()}}},K=["src"],Q={style:{width:"260px",margin:"0 auto"}};function R(l,t,B,S,e,a){const d=q,h=I,c=w,g=A,T=k("icon-double-right"),y=x,b=E,z=L,O=P,V=D,M=_,N=k("service-modal");return i(),p("div",null,[n(M,{class:"update-modal",hideTitle:!1,"mask-closable":!1,visible:e.isShow,onOk:l.handleOk,onClose:a.handleCancel,onCancel:a.handleCancel,"title-align":"start",footer:!1,width:360,onBeforeClose:l.handleBeforeClose},{title:s(()=>[...t[2]||(t[2]=[])]),default:s(()=>[n(V,{class:"content-card",style:{"padding-top":"0"}},{default:s(()=>[n(O,{loading:e.loading,tip:"\u52A0\u8F7D\u4E2D...",style:{width:"100%"}},{default:s(()=>[n(y,{direction:"vertical",fill:"",style:{"text-align":"center"}},{default:s(()=>[e.versionData.logo?(i(),p("img",{key:0,src:e.versionData.logo,style:{width:"70px",height:"70px"}},null,8,K)):(i(),f(d,{key:1})),e.ing?(i(),p(u,{key:2},[v("div",Q,[n(h,{"show-text":!1,percent:e.step/e.progress.length,steps:e.progress.length},null,8,["percent","steps"])]),n(c,{type:"secondary",style:{"font-size":"12px"}},{default:s(()=>[o(" \u3010"+r(e.step)+"/"+r(e.progress.length)+"\u3011"+r(e.progress[e.step-1].label),1)]),_:1})],64)):(i(),p(u,{key:3},[n(y,null,{default:s(()=>[e.versionData.version_now!="0.0.0"?(i(),p(u,{key:0},[n(g,{heading:6},{default:s(()=>[o(" v"+r(e.versionData.version_now),1)]),_:1}),n(T)],64)):m("",!0),n(g,{heading:6},{default:s(()=>[o(" v"+r(e.versionData.version_new_no),1)]),_:1})]),_:1}),n(c,{type:"secondary",style:{"font-size":"12px"}},{default:s(()=>[o(r(e.versionData.name),1)]),_:1})],64)),e.versionData.version_now!="0.0.0"?(i(),f(b,{key:4,onClick:a.start,loading:e.ing,long:"",type:"primary",style:{"margin-top":"20px"}},{default:s(()=>[o(r(e.ing==!0?"\u66F4\u65B0\u4E2D":"\u7ACB\u5373\u66F4\u65B0"),1)]),_:1},8,["onClick","loading"])):m("",!0),e.versionData.version_now=="0.0.0"?(i(),f(b,{key:5,onClick:a.start,loading:e.ing,long:"",type:"primary",style:{"margin-top":"20px"}},{default:s(()=>[o(r(e.ing==!0?"\u5B89\u88C5\u4E2D":"\u7ACB\u5373\u5B89\u88C5"),1)]),_:1},8,["onClick","loading"])):m("",!0),n(c,{type:"danger",style:{"font-size":"12px"}},{default:s(()=>[t[4]||(t[4]=o(" \u6CE8\u610F\uFF0C\u5347\u7EA7\u91C7\u7528\u8986\u76D6\u65B9\u5F0F\u6267\u884C\u3002\u64CD\u4F5C\u524D",-1)),t[5]||(t[5]=v("br",null,null,-1)),t[6]||(t[6]=o("\u5EFA\u8BAE\u5907\u4EFD\u6587\u4EF6\u4E0E\u6570\u636E\u5E93,\u51FA\u73B0\u95EE\u9898\u8BF7 ",-1)),n(z,{style:{"font-size":"12px"},onClick:t[0]||(t[0]=j=>e.modal.service=!0)},{default:s(()=>[...t[3]||(t[3]=[o("\u8054\u7CFB\u5BA2\u670D",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["loading"])]),_:1})]),_:1},8,["visible","onOk","onClose","onCancel","onBeforeClose"]),n(N,{visible:e.modal.service,onCancel:t[1]||(t[1]=j=>e.modal.service=!1)},null,8,["visible"])])}const X=C(H,[["render",R]]);export{X as i,J as s};