test_lgq/niucloud/public/admin/assets/code-8e37957e.js

2 lines
6.2 KiB
JavaScript
Raw Permalink Normal View History

2024-01-24 17:36:08 +08:00
import{d as K,O as Q,f as Z,r,n as ee,h as w,c as B,a as u,t as p,u as o,e as a,w as i,N as e,i as h,y as ae,I as te,B as R,a8 as k,aD as le,aE as oe,E as ne,ah as se,ai as ie,aj as pe,at as ce,$ as de,W as re,X as ue,Y as me,aa as _e,a0 as fe,_ as ge}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css */import{_ as he}from"./index.vue_vue_type_style_index_0_lang-cd8f78e9.js";import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css */import{g as ve,a as be,b as we,s as xe,c as Ve}from"./weapp-4d690662.js";import{a as Ce}from"./module-874b1348.js";/* empty css */const ye={class:"main-container min-h-[300px] p-5"},Te={class:"flex justify-between items-center mb-[20px]"},Ee={class:"text-[20px]"},Be={class:"mt-[50px]"},ke={key:0,class:"text-error"},Ue={key:0,class:""},We={class:"mt-[16px] flex justify-end"},ze={class:"dialog-footer"},De=K({__name:"code",setup(Ne){const F=Q(),x=Z(),I=F.meta.title,V=r(!1),t=ee({page:1,limit:10,total:0,loading:!1,data:[]}),c=r({desc:"",code:"",path:"",content:""}),C=r("");Ce().then(n=>{n.data.data&&n.data.data.auth_code&&(C.value=n.data.data.auth_code,T())}).catch(()=>{});const U=r({app_id:"",app_secret:""});ve().then(n=>{U.value=n.data});const y=r("/channel/weapp/code"),P=n=>{x.push({path:y.value})},W=r(null),m=(n=1)=>{t.loading=!0,t.page=n,we({page:t.page,limit:t.limit}).then(l=>{t.loading=!1,t.data=l.data.data,t.total=l.data.total,n==1&&t.data.length&&t.data[0].status==0&&D(t.data[0].task_key)}).catch(()=>{t.loading=!1})};m();const L=()=>{W.value.clearValidate()},_=r(!1),z=()=>{if(!C.value){M();return}if(!U.value.app_id){$();return}_.value||(_.value=!0,v.value="",xe(c.value).then(n=>{m(),T(),_.value=!1}).catch(()=>{_.value=!1}))},j=()=>{k.alert(e("localInsertTips"),e("warning"),{confirmButtonText:e("confirm")})},v=r(""),T=()=>{C.value&&be().then(n=>{n.data&&(v.value=`<img src="${n.data}" class="w-[150px]">`)}).catch()},D=n=>{Ve(n).then(l=>{const d=l.data.data??[];if(d[0]&&d[0].length){const f=d[0][d[0].length-1];if(f.code==0){m();return}if(f.code==1&&f.percent==100){m(),T();return}setTimeout(()=>{D(n)},2e3)}})},M=()=>{k.confirm(e("authTips"),e("warning"),{distinguishCancelAndClose:!0,confirmButtonText:e("toBind"),cancelButtonText:e("toNiucloud")}).then(()=>{x.push({path:"/app/authorize"})}).catch(n=>{n==="cancel"&&window.open("https://www.niucloud.com/app")})},$=()=>{k.confirm(e("weappTips"),e("warning"),{confirmButtonText:e("toSetting"),cancelButtonText:e("cancel")}).then(()=>{x.push({path:"/channel/weapp/config"})}).catch(n=>{})};return(n,l)=>{const d=le,f=oe,g=ne,b=se,A=ie,S=pe,O=ce,X=de,N=re,E=ue,Y=he,q=me,G=_e,H=fe;return w(),B("div",ye,[u("div",Te,[u("span",Ee,p(o(I)),1)]),a(f,{modelValue:y.value,"onUpdate:modelValue":l[0]||(l[0]=s=>y.value=s),class:"demo-tabs",onTabChange:P},{default:i(()=>[a(d,{label:o(e)("weappAccessFlow"),name:"/channel/weapp"},null,8,["label"]),a(d,{label:o(e)("subscribeMessage"),name:"/channel/weapp/message"},null,8,["label"]),a(d,{label:o(e)("weappRelease"),name:"/channel/weapp/code"},null,8,["label"])]),_:1},8,["modelValue"]),a(X,{class:"box-card !border-none",shadow:"never"},{default:i(()=>[u("div",Be,[a(g,{type:"primary",onClick:z,loading:_.value,disabled:t.loading},{default:i(()=>[h(p(o(e)("cloudRelease")),1)]),_:1},8,["loading","disabled"]),a(g,{onClick:j,disabled:t.loading},{default:i(()=>[h(p(o(e)("localRelease")),1)]),_:1},8,["disabled"])]),ae((w(),te(S,{class:"mt-[15px]",data:t.data,size:"default"},{empty:i(()=>[u("span",null,p(o(e)("emptyData")),1)]),default:i(()=>[a(b,{prop:"version",label:o(e)("code"),align:"left"},null,8,["label"]),a(b,{prop:"status_name",label:o(e)(