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

2 lines
3.6 KiB
JavaScript

var K=Object.defineProperty,$=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var M=(s,t,l)=>t in s?K(s,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[t]=l,g=(s,t)=>{for(var l in t||(t={}))B.call(t,l)&&M(s,l,t[l]);if(P)for(var l of P(t))E.call(t,l)&&M(s,l,t[l]);return s},S=(s,t)=>$(s,j(t));var p=(s,t,l)=>new Promise((y,i)=>{var c=a=>{try{f(l.next(a))}catch(o){i(o)}},m=a=>{try{f(l.throw(a))}catch(o){i(o)}},f=a=>a.done?y(a.value):Promise.resolve(a.value).then(c,m);f((l=l.apply(s,t)).next())});import{_ as G}from"./form.vue_vue_type_script_setup_true_lang-De_iThI9.js";import{aw as h,n as r,b as _,r as C,aK as H,ag as J,aA as d}from"./index-CRmU-Qpi.js";import"./index.vue_vue_type_script_setup_true_lang-8Iz1Oohf.js";const Q=s=>h.request("get","/adminapi/Version/version_list",{params:s}),T=s=>h.request("post","/adminapi/Version/version_add",{data:s}),U=s=>h.request("post","/adminapi/Version/version_edit",{data:s}),W=s=>h.request("post","/adminapi/Version/version_del",{data:s});function te(){const s=r(),t=r(!0),l=r([]),y=r(!1),i=r({total:0,pageSize:10,pageSizes:[10,20,50,100],currentPage:1,background:!0}),c=r({version:""});r([]);const m=r([{label:"版本号",prop:"version",type:"input"}]),a=r([{type:"index",index:n=>n+1},{label:"版本号(新)",prop:"newversion"},{label:"code码",prop:"version_code"},{label:"类型",prop:"type",cellRenderer:({row:n})=>_(C("el-tag"),{type:n.type===1?"success":""},{default:()=>[n.type===1?"安卓":"IOS"]})},{label:"下载链接",prop:"downloadurl"},{label:"更新内容",prop:"content"},{label:"强制更新",prop:"enforce",cellRenderer:({row:n})=>_(C("el-tag"),{type:n.enforce===1?"success":"info"},{default:()=>[n.enforce===1?"是":"否"]})},{label:"启用状态",prop:"status",cellRenderer:({row:n,props:e})=>_(C("el-tag"),{type:n.status===0?"info":n.status===1?"success":"danger"},{default:()=>[n.status===0?"待发布":n.status===1?"已发布":"禁用"]})},{label:"操作",fixed:"right",width:210,slot:"operation"}]),o=n=>p(this,null,function*(){t.value=!0,c.value=g({},n);const{data:e,code:v}=yield Q(S(g({},n),{pageNum:i.value.currentPage,pageSize:i.value.pageSize}));v&&(l.value=e.lists,i.value.total=e.totalRow,i.value.currentPage=e.pageNumber),t.value=!1});return{searchForm:c,searchLabel:m,onSearch:o,isShow:y,tableList:l,tableLabel:a,pagination:i,handleSizeChange:n=>{i.value.pageSize=n,o(c.value)},handleCurrentChange:n=>{i.value.currentPage=n,o(c.value)},loading:t,openDialog:(n="新增",e)=>{var v,R,V,z,x,q,N;H({title:`${n}版本`,props:{formInline:{version:(v=e==null?void 0:e.newversion)!=null?v:"",type:(R=e==null?void 0:e.type)!=null?R:"",downloadurl:(V=e==null?void 0:e.downloadurl)!=null?V:"",content:(z=e==null?void 0:e.content)!=null?z:"",enforce:(x=e==null?void 0:e.enforce)!=null?x:"",version_code:(q=e==null?void 0:e.version_code)!=null?q:"",status:(N=e==null?void 0:e.status)!=null?N:1}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>J(G,{ref:s,formInline:null}),beforeSure:(I,{options:k})=>{const F=s.value.getRef(),L=k.props.formInline,O=u=>p(this,null,function*(){const{code:b}=yield T(u);b?(d("新增成功",{type:"success"}),o(c.value),I()):d("新增失败",{type:"error"})}),A=u=>p(this,null,function*(){const{code:b}=yield U(S(g({},u),{id:e.id}));b?(d("修改成功",{type:"success"}),o(c.value),I()):d("修改失败",{type:"error"})});F.validate(u=>{u&&(n==="新增"?O(L):A(L))})}})},handleDelete:n=>p(this,null,function*(){const{code:e}=yield W({id:n.id});e&&(d("删除成功",{type:"success"}),o(c.value))})}}export{te as useData};