2 lines
3.1 KiB
JavaScript
2 lines
3.1 KiB
JavaScript
var V=Object.defineProperty,j=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var $=(l,n,s)=>n in l?V(l,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[n]=s,v=(l,n)=>{for(var s in n||(n={}))E.call(n,s)&&$(l,s,n[s]);if(O)for(var s of O(n))G.call(n,s)&&$(l,s,n[s]);return l},a=(l,n)=>j(l,B(n));var f=(l,n,s)=>new Promise((r,u)=>{var g=c=>{try{h(s.next(c))}catch(t){u(t)}},b=c=>{try{h(s.throw(c))}catch(t){u(t)}},h=c=>c.done?r(c.value):Promise.resolve(c.value).then(g,b);h((s=s.apply(l,n)).next())});import{_ as H}from"./form.vue_vue_type_script_setup_true_lang-BoAlLsu7.js";import{n as d,b as J,r as Q,aK as T,ag as U,aA as m}from"./index-CRmU-Qpi.js";import{a as W,d as X,c as Y,u as Z}from"./permission-DJnI7MjS.js";function ce(){const l=d(),n=d(!0),s=d([]),r=d(!1),u=d({total:0,pageSize:10,pageSizes:[10,20,50,100],currentPage:1,background:!0}),g=d({title:"",isPlatform:""}),b=d([{label:"标题",prop:"title",type:"input"},{label:"来源",prop:"isPlatform",type:"select",optionList:[{label:"平台发布",value:1},{label:"其他平台",value:0}]}]),c=d([{type:"index",index:i=>i+1},{label:"标题",prop:"title"},{label:"规则",prop:"name"},{label:"状态",prop:"status",cellRenderer:({row:i,props:e})=>J(Q("el-tag"),{type:i.status==="hidden"?"info":"success"},{default:()=>[`${i.status==="hidden"?"隐藏":"正常"}`]})},{label:"操作",fixed:"right",width:210,slot:"operation"}]),t=()=>f(this,null,function*(){n.value=!0;const{data:i,code:e}=yield W();e&&(s.value=i.rows.map(p=>a(v({},p),{hasChildren:!!p.childlist})),u.value.total=i.total),n.value=!1});return{searchForm:g,searchLabel:b,onSearch:t,isShow:r,tableList:s,tableLabel:c,pagination:u,handleSizeChange:i=>{u.value.pageSize=i,t()},handleCurrentChange:i=>{u.value.currentPage=i,t()},loading:n,openDialog:(i="新增",e)=>{var p,C,x,P,S,z,L,R,k,M,I;T({title:`${i}权限信息`,props:{formInline:{ismenu:(p=e==null?void 0:e.ismenu)!=null?p:1,pid:(C=e==null?void 0:e.pid)!=null?C:0,name:(x=e==null?void 0:e.name)!=null?x:"",title:(P=e==null?void 0:e.title)!=null?P:"",icon:(S=e==null?void 0:e.icon)!=null?S:"",condition:(z=e==null?void 0:e.condition)!=null?z:"",remark:(L=e==null?void 0:e.remark)!=null?L:"",weigh:(R=e==null?void 0:e.weigh)!=null?R:1,status:(k=e==null?void 0:e.status)!=null?k:"normal",url:(M=e==null?void 0:e.url)!=null?M:"",extend:(I=e==null?void 0:e.extend)!=null?I:""},higherMenuOptions:[{id:0,pid:0,title:"根节点"}].concat(s.value)},width:"40%",closeOnClickModal:!1,contentRenderer:()=>U(H,{ref:l,formInline:null}),beforeSure:(_,{options:q})=>{const A=l.value.getRef(),F=q.props.formInline,K=o=>f(this,null,function*(){const{code:y}=yield Y(o);y?(m("新增成功",{type:"success"}),t(),_()):m("新增失败",{type:"error"})}),N=o=>f(this,null,function*(){const{code:y}=yield Z(a(v({},o),{id:e.id}));y?(m("修改成功",{type:"success"}),t(),_()):m("修改失败",{type:"error"})});A.validate(o=>{o&&(i==="新增"?K(F):N(F))})}})},handleDelete:i=>f(this,null,function*(){const{code:e}=yield X({ids:i.id});e&&(m("删除成功",{type:"success"}),t())})}}export{ce as useData};
|