Files
yusheng-admin/dist/static/js/hook-D8f-8M1Z.js
2025-10-23 11:07:17 +08:00

2 lines
3.1 KiB
JavaScript

var K=Object.defineProperty,M=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var L=(n,a,l)=>a in n?K(n,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[a]=l,f=(n,a)=>{for(var l in a||(a={}))$.call(a,l)&&L(n,l,a[l]);if(I)for(var l of I(a))q.call(a,l)&&L(n,l,a[l]);return n},y=(n,a)=>M(n,O(a));var p=(n,a,l)=>new Promise((b,o)=>{var h=t=>{try{r(l.next(t))}catch(g){o(g)}},c=t=>{try{r(l.throw(t))}catch(g){o(g)}},r=t=>t.done?b(t.value):Promise.resolve(t.value).then(h,c);r((l=l.apply(n,a)).next())});import{_ as J}from"./form.vue_vue_type_script_setup_true_lang-DSh6_f4W.js";import{n as i,b as x,r as P,aA as d,aK as N,ag as V}from"./index-CRmU-Qpi.js";import{I as j,J as B,K as E,L as G}from"./room-3H8Bx0CI.js";import"./index-An8nOBwL.js";function w(){const n=i(),a=i(!0),l=i([]),b=i(!1),o=i({search_name:""}),h=i([{label:"标签名称",prop:"search_name",type:"input"}]),c=i({total:0,pageSize:10,pageSizes:[10,20,50,100],currentPage:1,background:!0}),r=i([{label:"ID",prop:"id"},{label:"标签名称",prop:"label_name"},{label:"状态",prop:"status",cellRenderer:({row:s})=>x(P("el-tag"),{type:s.status===1?"success":"info"},{default:()=>[s.status===1?"显示":"隐藏"]})},{label:"标签图标",prop:"label_icon",cellRenderer:({row:s})=>x(P("el-image"),{fit:"cover","preview-teleported":!0,src:s.label_icon,"preview-src-list":Array.of(s.label_icon),class:"w-[60px] h-[24px] align-middle"},null)},{label:"创建时间",prop:"createtime"},{label:"操作",fixed:"right",width:210,slot:"operation"}]),t=s=>p(this,null,function*(){a.value=!0,o.value=f({},s);const{data:e,code:m}=yield j(y(f({},s),{page:c.value.currentPage,page_limit:c.value.pageSize}));m&&(l.value=e.lists,c.value.total=e.count,c.value.currentPage=e.page),a.value=!1});return{searchForm:o,searchLabel:h,onSearch:t,isShow:b,tableList:l,tableLabel:r,pagination:c,handleSizeChange:s=>{c.value.pageSize=s,t(o.value)},handleCurrentChange:s=>{c.value.currentPage=s,t(o.value)},loading:a,handleDelete:s=>p(this,null,function*(){const{code:e}=yield B({label_id:s.id});e&&(d(`您删除了标签名称为【${s.label_name}】的这条数据`,{type:"success"}),t(o.value))}),openDialog:(s="新增",e)=>{var m,R,S,C;N({title:`${s}标签`,props:{formInline:{label_name:(m=e==null?void 0:e.label_name)!=null?m:"",label_icon:(R=e==null?void 0:e.label_icon)!=null?R:"",label_icon_room:(S=e==null?void 0:e.label_icon_room)!=null?S:"",status:(C=e==null?void 0:e.status)!=null?C:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>V(J,{ref:n,formInline:null}),beforeSure:(z,{options:T})=>{const k=n.value.getRef(),v=T.props.formInline,A=u=>p(this,null,function*(){const{code:_}=yield E(u);_?(d("新增成功",{type:"success"}),t(o.value),z()):d("新增失败",{type:"error"})}),F=u=>p(this,null,function*(){const{code:_}=yield G(y(f({},u),{label_id:e.id}));_?(d("修改成功",{type:"success"}),t(o.value),z()):d("修改失败",{type:"error"})});k.validate(u=>{u&&(delete v.higherMenuOptions,s==="新增"?A(v):F(v))})}})}}}export{w as useData};