test_lgq/niucloud/public/admin/assets/list-1e065b82.js

2 lines
9.0 KiB
JavaScript
Raw Permalink Normal View History

2024-01-24 17:36:08 +08:00
import{d as W,O as X,r as k,n as J,f as Q,h as i,c as h,e as l,w as r,a as m,t as p,u as s,i as c,N as a,F as C,G as V,I as g,y as Z,R as ee,B as ae,a4 as te,a8 as le,E as se,W as oe,X as re,as as ne,aF as ie,cK as pe,Y as de,$ as ue,ah as ce,aw as me,aj as _e,at as fe,a0 as he,_ as ge}from"./index-4dcc0234.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 *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";import{_ as ve}from"./site_logo-f276251b.js";import{i as be,s as ye,t as xe,v as ke,w as we,x as Pe}from"./site-ac963391.js";import{_ as Ce}from"./edit-site.vue_vue_type_script_setup_true_lang-1328d131.js";import{g as Ve}from"./addon-8fbd8692.js";/* empty css *//* empty css *//* empty css */import"./member_head-a897263d.js";import"./user-1e1ca1a9.js";const De={class:"main-container"},Ee={class:"flex justify-between items-center"},Se={class:"text-[20px]"},Ie={class:"mt-[20px]"},Le={class:"flex items-center"},Te=["src"],$e={key:1,class:"w-[50px] h-[50px] mr-[10px]",src:ve,alt:""},Fe={class:"flex flex flex-col"},Be={class:"flex items-center"},Ue={class:"flex flex flex-col"},Ye={key:0},Ne={key:1},Me={class:"mt-[16px] flex justify-end"},je=W({__name:"list",setup(ze){const D=X(),$=D.meta.title,b=k({all:[]}),E=k([]),o=J({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{keywords:"",group_id:"",app:"all",status:"",create_time:[],expire_time:[]}});o.searchParam.status=D.query.id||"",(async()=>{const n=await(await be({})).data;b.value.all=n,n.forEach((t,d)=>{b.value[t.app]||(b.value[t.app]=[]),b.value[t.app].push(t)})})(),(async()=>{E.value=await(await ye()).data})();const S=k(),F=n=>{n&&(n.resetFields(),_())},B=()=>{o.searchParam.group_id=""},I=k([]);Ve().then(({data:n})=>{I.value=n}).catch();const _=(n=1)=>{o.loading=!0,o.page=n,o.searchParam.app=o.searchParam.app=="all"?"":o.searchParam.app,xe({page:o.page,limit:o.limit,...o.searchParam}).then(t=>{o.loading=!1,o.data=t.data.data,o.total=t.data.total}).catch(()=>{o.loading=!1})};_();const U=Q(),x=k(null),Y=n=>{x.value.setFormData(),x.value.showDialog=!0},N=n=>{U.push({path:"/admin/site/info",query:{id:n.site_id}})},M=n=>{te({message:a("siteUrlDevelopMessage"),grouping:!0,type:"success"})},j=n=>{x.value.setFormData(n),x.value.showDialog=!0},z=n=>{window.localStorage.setItem("site.siteId",n.site_id),window.open(`${location.origin}/site/`)},R=(n,t)=>{n==1&&ke({site_id:t}).then(d=>{_()}),n==3&&we({site_id:t}).then(d=>{_()})},G=n=>{le.confirm(a("siteDeleteTips"),a("warning"),{confirmButtonText:a("confirm"),cancelButtonText:a("cancel"),type:"warning"}).then(()=>{Pe(n.site_id).then(t=>{_()}).catch(()=>{})})};return(n,t)=>{const d=se,H=oe,v=re,y=ne,w=ie,L=pe,O=de,T=ue,f=ce,P=me,q=_e,A=fe,K=he;return i(),h("div",De,[l(T,{class:"box-card !border-none",shadow:"never"},{default:r(()=>[m("div",Ee,[m("span",Se,p(s($)),1),l(d,{type:"primary",class:"w-[100px]",onClick:Y},{default:r(()=>[c(p(s(a)("addSite")),1)]),_:1})]),l(T,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:r(()=>[l(O,{inline:!0,model:o.searchParam,ref_key:"searchFormRef",ref:S},{default:r(()=>[l(v,{label:s(a)("siteName"),prop:"keywords"},{default:r(()=>[l(H,{modelValue:o.searchParam.keywords,"onUpdate:modelValue":t[0]||(t[0]=e=>o.searchParam.keywords=e),placeholder:s(a)("siteNamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(v,{label:s(a)("app"),prop:"app_id"},{default:r(()=>[l(w,{modelValue:o.searchParam.app,"onUpdate:modelValue":t[1]||(t[1]=e=>o.searchParam.app=e),clearable:"",onChange:B,placeholder:s(a)("appIdPlaceholder"),class:"input-width"},{default:r(()=>[l(y,{label:s(a)("selectP