Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-21 03:19:19 +08:00
v3-admin-vite/assets/index-DC0JxONI.js

2 lines
6.8 KiB
JavaScript
Raw Permalink Normal View History

import"./index-DVW30Bkn.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-l0sNRNKZ.js";/* empty css *//* empty css *//* empty css */import{c as H,u as K,d as Q,g as Y}from"./el-message-box-C4s56iX2.js";import{V as N,t as Z,r as _,w as ee,v as ae,L as a,E as I,u as t,C as g,D as l,h as te,I as s,A as C,J as le,G as ne,x as m}from"./vue-YISEtOLz.js";import{A as V,a3 as oe,a4 as re,C as se,o as ie,X as ue,D as pe,r as de,a5 as me,O as ce,W as fe,a6 as ge,a7 as _e,a8 as ve,t as be,a9 as ye,aa as Ce,n as he,ab as we,ac as ke,E as z,ad as De}from"./element-BtlHndxu.js";import{_ as Ve}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./vxe-aCtyydk-.js";const ze={total:0,currentPage:1,pageSizes:[10,20,50],pageSize:10,layout:"total, sizes, prev, pager, next, jumper"};function Ee(E={}){const i=N({...ze,...E});return{paginationData:i,handleCurrentChange:v=>{i.currentPage=v},handleSizeChange:v=>{i.pageSize=v}}}const Te={class:"app-container"},xe={class:"toolbar-wrapper"},Ae={class:"table-wrapper"},Se={class:"pager-wrapper"},Pe=Z({name:"ElementPlus",__name:"index",setup(E){const i=_(!1),{paginationData:r,handleCurrentChange:T,handleSizeChange:v}=Ee(),x={id:void 0,username:"",password:""},c=_(!1),k=_(null),u=_(V(x)),$={username:[{required:!0,trigger:"blur",message:"请输入用户名"}],password:[{required:!0,trigger:"blur",message:"请输入密码"}]};function L(){var o;(o=k.value)==null||o.validate(e=>{if(!e){z.error("表单校验不通过");return}i.value=!0,(u.value.id===void 0?H:K)(u.value).then(()=>{z.success("操作成功"),c.value=!1,b()}).finally(()=>{i.value=!1})})}function M(){var o;(o=k.value)==null||o.clearValidate(),u.value=V(x)}function O(o){De.confirm(`正在删除用户:${o.username},确认删除?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{Q(o.id).then(()=>{z.success("删除成功"),b()})})}function q(o){c.value=!0,u.value=V(o)}const D=_([]),A=_(null),f=N({username:"",phone:""});function b(){i.value=!0,Y({currentPage:r.currentPage,size:r.pageSize,username:f.username,phone:f.phone}).then(({data:o})=>{r.total=o.total,D.value=o.list}).catch(()=>{D.value=[]}).finally(()=>{i.value=!1})}function S(){r.currentPage===1?b():r.currentPage=1}function G(){var o;(o=A.value)==null||o.resetFields(),S()}return ee([()=>r.currentPage,()=>r.pageSize],b,{immediate:!0}),(o,e)=>{const P=oe,h=pe,y=ue,p=de,U=fe,F=ie,B=be,d=Ce,w=he,j=we,J=ke,W=se,R=re;return m(),ae("div",Te,[a(P,{title:"数据来源",type:"success",description:"由 Apifox 提供在线 Mock数据不具备真实性仅供简单的 CRUD 操作演示。","show-icon":""}),I((m(),g(F,{shadow:"never",class:"search-wrapper"},{default:l(()=>[a(U,{ref_key:"searchFormRef",ref:A,inline:!0,model:t(f)},{default:l(()=>[a(y,{prop:"username",label:"用户名"},{default:l(()=>[a(h,{modelValue:t(f).username,"onUpdate:modelValue":e[0]||(e[0]=n=>t(f).username=n),placeholder:"请输入"},null,8,["modelValue"])]),_:1}),a(y,{prop:"phone",label:"手机号"},{default:l(()=>[a(h,{modelValue:t(f).phone,"onUpdate:modelValue":e[1]||(e[1]=n=>t(f).phone=n),placeholder:"请输入"},null,8,["modelValue"])]),_:1}),a(y,null,{default:l(()=>[a(p,{type:"primary",icon:t(me),onClick:S},{default:l(()=>e[7]||(e[7]=[s(" 查询 ")])),_:1},8,["icon"]),a(p,{icon:t(ce),onClick:G},{default:l(()=>e[8]||(e[8]=[s(" 重置 ")])),_:1},8,["icon"])]),_:1})]),_:1},8,["model"])]),_:1})),[[R,t(i)]]),I((m(),g(F,{shadow:"never"},{default:l(()=>[C("div",xe,[C("div",null,[a(p,{type:"primary",icon:t(ge),onClick:e[2]||(e[2]=n=>c.value=!0)},{default:l(()=>e[9]||(e[9]=[s(" 新增用户 ")])),_:1},8,["icon"]),a(p,{type:"danger",icon:t(_e)},{default:l(()=>e[10]||(e[10]=[s(" 批量删除 ")])),_:1},8,["icon"])]),C("div",null,[a(B,{content:"下载"},{default:l(()=>[a(p,{type:"primary",icon:t(ve),circle:""},null,8,["icon"])]),_:1}),a(B,{c