test_lgq/niucloud/public/admin/assets/route-6b8d21ba.js

2 lines
7.0 KiB
JavaScript
Raw Normal View History

2024-01-24 17:36:08 +08:00
import{d as K,n as V,f as Q,O as Z,r as c,aL as ee,s as ae,a4 as $,N as o,q as te,h as k,c as le,e as l,w as n,a as h,t as r,u as s,i as f,y as oe,I as D,B as z,W as se,X as ne,E as ie,Y as re,$ as pe,ah as me,aj as de,at as ue,aD as ce,aE as _e,aa as he,a0 as fe}from"./index-4dcc0234.js";/* empty css *//* empty css */import{_ as ge}from"./index-742b412a.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 */import"./el-form-item-4ed993c7.js";import{f as ve,m as ye,n as be,o as we}from"./diy-aa30030c.js";import{p as Ve}from"./sys-8ead7f22.js";/* empty css */import"./index.vue_vue_type_style_index_0_lang-5c6c00d9.js";import"./attachment-c69dd9fd.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-9285296e.js";/* empty css */const ke={class:"main-container"},xe={class:"flex justify-between items-center"},De={class:"text-[20px]"},Ce={class:"mr-[10px]"},Ee={class:"mr-[10px]"},Re={class:"mt-[16px] flex justify-end"},Se={class:"dialog-footer"},da=K({__name:"route",setup(Pe){const B=V({});Q();const I=Z().meta.title;c(),c(!1);const i=V({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{title:""}}),x=c("");(async()=>{x.value=(await Ve()).data.wap_url})();const g=(a=1)=>{i.loading=!0,i.page=a,ye({page:i.page,limit:i.limit,...i.searchParam}).then(e=>{i.loading=!1;const d=Math.ceil(e.data.length/i.limit),_=JSON.parse(JSON.stringify(e.data)),u=[];for(let y=0;y<d;y++)u[y]=_.splice(0,i.limit);i.data=u[i.page-1],i.total=e.data.length}).catch(()=>{i.loading=!1})};g(),ve({}).then(a=>{for(const e in a.data)B[e]=a.data[e]});const C=c(),{copy:O,isSupported:j,copied:E}=ee(),R=a=>{j.value||$({message:o("notSupportCopy"),type:"warning"}),O(a)};ae(E,()=>{E.value&&$({message:o("copySuccess"),type:"success"})});const p=c("wechat"),S=c(""),P=c(0),v=V({title:"",name:"",page:"",is_share:0,sort:0}),m=V({wechat:{title:"",desc:"",url:""},weapp:{title:"",url:""}}),b=c(!1),J=te(()=>({})),U=c(),L=async a=>{const e=(await be({name:a.name})).data;e.title&&(a.id=e.id,a.title=e.title,a.name=e.name,a.page=e.page,a.is_share=e.is_share,a.sort=e.sort,a.share=e.share),v.title=a.title,v.name=a.name,v.page=a.page,v.is_share=a.is_share,v.sort=a.sort,P.value=a.id,S.value=a.title;const d=a.share?JSON.parse(a.share):{wechat:{title:"",desc:"",url:""},weapp:{title:"",url:""}};d&&(m.wechat=d.wechat,m.weapp=d.weapp),b.value=!0},M=async a=>{a&&await a.validate(async e=>{e&&we({id:P.value,share:JSON.stringify(m),...v}).then(()=>{g(),b.value=!1}).catch(()=>{})})},q=a=>{a&&(a.resetFields(),g())};return(a,e)=>{const d=se,_=ne,u=ie,y=re,F=pe,w=me,A=de,G=ue,T=ce,W=_e,X=ge,Y=he,H=fe;return k(),le("div",ke,[l(F,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[h("div",xe,[h("span",De,r(s(I)),1)]),l(F,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:n(()=>[l(y,{inline:!0,model:i.searchParam,ref_key:"searchFormDiyRouteRef",ref:C},{default:n(()=>[l(_,{label:s(o)("title"),prop:"title"},{default:n(()=>[l(d,{modelValue:i.searchParam.title,"onUpdate:modelValue":e[0]||(e[0]=t=>i.searchParam.title=t),placeholder:s(o)("titlePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(_,null,{default:n(()=>[l(u,{type:"primary",onClick:e[1]||(e[1]=t=>g())},{default:n(()=>[f(r(s(o)("search")),1)]),_:1}),l(u,{onClick:e[2]||(e[2]=t=>q(C.value))},{default:n(()=>[f(r(s(o)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),oe((k(),D(A,{data:i.data,size:"large"}