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

2 lines
3.6 KiB
JavaScript

var K=Object.defineProperty,j=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var x=(s,n,a)=>n in s?K(s,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[n]=a,H=(s,n)=>{for(var a in n||(n={}))B.call(n,a)&&x(s,a,n[a]);if($)for(var a of $(n))D.call(n,a)&&x(s,a,n[a]);return s},k=(s,n)=>j(s,q(n));var c=(s,n,a)=>new Promise((m,v)=>{var d=r=>{try{b(a.next(r))}catch(l){v(l)}},g=r=>{try{b(a.throw(r))}catch(l){v(l)}},b=r=>r.done?m(r.value):Promise.resolve(r.value).then(d,g);b((a=a.apply(s,n)).next())});import{n as i,aA as o,aK as F,ag as M}from"./index-CRmU-Qpi.js";import{g as E,d as G,a as J,b as N,c as Q,f as U,h as V,i as W}from"./system-CqYheEHE.js";import{_ as X}from"./typeForm.vue_vue_type_script_setup_true_lang-DQr3mbVi.js";import{_ as Y}from"./problemForm.vue_vue_type_script_setup_true_lang-CxLYiSAH.js";function oe(){const s=i(),n=i({}),a=i([{label:"ID",prop:"id"},{label:"标题",prop:"title"},{label:"内容",prop:"content"},{label:"发布人员",prop:"admin"},{label:"创建时间",prop:"createtime"},{label:"操作",fixed:"right",width:210,slot:"operation"}]),m=i(!0),v=i([]),d=i({id:0,type_name:""}),g=i([]),b=i([]),r=i(!1),l=i({total:0,pageSize:10,pageSizes:[10,20,50,100],currentPage:1,background:!0}),h=()=>c(this,null,function*(){m.value=!0;const{data:t,code:e}=yield E({});e&&(g.value=t.lists,d.value=g.value.length?g.value[0]:{},y()),m.value=!1}),O=t=>c(this,null,function*(){const{code:e}=yield G({id:t.id});e&&(o("删除成功",{type:"success"}),h())}),A=(t="新增",e)=>c(this,null,function*(){var P,S,_;F({title:`${t}问题分类`,props:{formInline:{type_name:(P=e==null?void 0:e.type_name)!=null?P:"",sort:(S=e==null?void 0:e.sort)!=null?S:"",status:(_=e==null?void 0:e.status)!=null?_:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>M(X,{ref:s,formInline:null}),beforeSure:(C,{options:z})=>{const I=s.value.getRef(),R=z.props.formInline,L=p=>c(this,null,function*(){const{code:f,msg:T}=yield Q(p);f?(o("新增成功",{type:"success"}),h(),C()):o(T,{type:"error"})}),u=p=>c(this,null,function*(){const{code:f,msg:T}=yield U(k(H({},p),{id:e.id}));f?(o("修改成功",{type:"success"}),h(),C()):o(T,{type:"error"})});I.validate(p=>{p&&(t==="新增"?L(R):u(R))})}})}),y=()=>c(this,null,function*(){const{data:t,code:e}=yield J({type:d.value.id,page:l.value.currentPage,page_limit:l.value.pageSize});e&&(v.value=t.lists,l.value.total=t.count,l.value.currentPage=t.page),m.value=!1});return{onSearch:h,isShow:r,tableList:g,loading:m,activeData:d,formLabel:b,formData:n,openTypeDialog:A,changeData:t=>{d.value.id!==t.id&&(d.value=t,y())},tableLabel:a,pagination:l,handleDelete:O,handleSizeChange:t=>{l.value.pageSize=t,y()},handleCurrentChange:t=>{l.value.currentPage=t,y()},problemList:v,openDialog:(t="新增",e)=>c(this,null,function*(){var P,S;F({title:`${t}问题`,props:{formInline:{title:(P=e==null?void 0:e.title)!=null?P:"",content:(S=e==null?void 0:e.content)!=null?S:"",type:d.value.id}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>M(Y,{ref:s,formInline:null}),beforeSure:(_,{options:C})=>{const z=s.value.getRef(),I=C.props.formInline,R=u=>c(this,null,function*(){const{code:p,msg:f}=yield V(u);p?(o("新增成功",{type:"success"}),y(),_()):o(f,{type:"error"})}),L=u=>c(this,null,function*(){const{code:p,msg:f}=yield W(k(H({},u),{id:e.id}));p?(o("修改成功",{type:"success"}),y(),_()):o(f,{type:"error"})});z.validate(u=>{u&&(t==="新增"?R(I):L(I))})}})}),DeleteProblem:t=>c(this,null,function*(){const{code:e}=yield N({id:t.id});e&&(o("删除成功",{type:"success"}),h())})}}export{oe as useData};