mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-07 05:28:10 +00:00
2 lines
3.9 KiB
JavaScript
2 lines
3.9 KiB
JavaScript
import{d as I,X as M,r as f,l as O,N as x,h as _,c as J,a as p,b as Q,e as n,w as s,aO as X,u as i,m as v,k as d,i as V,t as h,J as Y,am as q,Y as F,Q as G,D as H,ap as K,a5 as W,a6 as Z,a7 as ee,E as te,S as ae,M as le,_ as oe}from"./index-9f163f98.js";/* empty css *//* empty css *//* empty css *//* 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 */import{C as ne}from"./diy-3042ded9.js";const ie=["onClick"],se={class:"mt-[16px] flex"},de={class:"dialog-footer"},re=I({__name:"index",props:{modelValue:{type:Object,default:()=>({id:0,name:"",parent:"",title:"",url:""})},ignore:{type:Array,default:[]}},emits:["update:modelValue","confirm","success"],setup(w,{expose:E,emit:D}){const T=w,z=()=>{a.value={id:0,name:"",parent:"",title:"",url:""}},a=M({get(){return T.modelValue},set(l){D("update:modelValue",l)}});f();const e=O({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{name:""}}),U=f(),r=f(!1),k=()=>{r.value=!0,u()},u=(l=1)=>{e.loading=!0,e.page=l,ne({page:e.page,limit:e.limit,...e.searchParam}).then(t=>{e.loading=!1,e.data=t.data.data,e.data.forEach(c=>{c.checked=c.id==a.value.id}),e.total=t.data.total,b()}).catch(()=>{e.loading=!1})};u();const B=(l,t)=>{l?a.value.id=t.id:a.value.id=0,b()},b=()=>{q(()=>{for(let l=0;l<e.data.length;l++)e.data[l].checked=!1,a.value.id==e.data[l].id&&(e.data[l].checked=!0,Object.assign(a.value,e.data[l]))})},L=()=>{if(a.value.id==0){F({type:"warning",message:`${d("请选择页面")}`});return}a.value={id:a.value.id,name:a.value.name,parent:a.value.parent,title:a.value.title,url:a.value.url},r.value=!1};return E({show:k,showDialog:r}),(l,t)=>{const c=x("Close"),C=G,S=x("ArrowRight"),N=H,P=K,m=W,R=Z,$=ee,y=te,j=ae,A=le;return _(),J("div",null,[p("div",{onClick:k},[Q(l.$slots,"default",{},()=>[n(N,{modelValue:i(a).title,"onUpdate:modelValue":t[0]||(t[0]=o=>i(a).title=o),placeholder:i(d)("请选择跳转页面"),readonly:"",class:"link-input"},{suffix:s(()=>[p("div",{onClick:X(z,["stop"])},[i(a).name?(_(),v(C,{key:0},{default:s(()=>[n(c)]),_:1})):(_(),v(C,{key:1},{default:s(()=>[n(S)]),_:1}))],8,ie)]),_:1},8,["modelValue","placeholder"])],!0)]),n(j,{modelValue:r.value,"onUpdate:modelValue":t[5]||(t[5]=o=>r.value=o),title:i(d)("页面选择"),width:"850px","destroy-on-close":!0,"close-on-click-modal":!1},{footer:s(()=>[p("span",de,[n(y,{onClick:t[4]||(t[4]=o=>r.value=!1)},{default:s(()=>[V(h(i(d)("cancel")),1)]),_:1}),n(y,{type:"primary",onClick:L},{default:s(()=>[V(h(i(d)("confirm")),1)]),_:1})])]),default:s(()=>[Y((_(),v(R,{data:e.data,size:"large",ref_key:"timeListTableRef",ref:U,"max-height":"400"},{empty:s(()=>[p("span",null,h(e.loading?"":i(d)("emptyData")),1)]),default:s(()=>[n(m,{"min-width":"7%"},{default:s(({row:o})=>[n(P,{modelValue:o.checked,"onUpdate:modelValue":g=>o.checked=g,onChange:g=>B(g,o)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),n(m,{prop:"page_title",label:i(d)("页面名称"),"min-width":"25%"},null,8,["label"]),n(m,{prop:"type_name",label:i(d)("页面类型"),"min-width":"25%"},null,8,["label"]),n(m,{prop:"url",label:i(d)("页面路径"),"min-width":"25%"},null,8,["label"])]),_:1},8,["data"])),[[A,e.loading]]),p("div",se,[n($,{"current-page":e.page,"onUpdate:current-page":t[1]||(t[1]=o=>e.page=o),"page-size":e.limit,"onUpdate:page-size":t[2]||(t[2]=o=>e.limit=o),layout:"total, sizes, prev, pager, next, jumper",total:e.total,onSizeChange:t[3]||(t[3]=o=>u()),onCurrentChange:u},null,8,["current-page","page-size","total"])])]),_:1},8,["modelValue","title"])])}}});const De=oe(re,[["__scopeId","data-v-0e4db2d0"]]);export{De as default};
|