File: /var/www/html/public/static/js/hook-5c204a62.js
import{be as C}from"./message-2472a54a.js";import{getUserList as X}from"./system-8b6a6190.js";import{V as Y,W as Z}from"./index-d44f8e28.js";import{r as t,A as u,c as $,o as j}from"./runtime-core.esm-bundler-6128546f.js";import"./utils-2ab4f76a.js";import"./preload-helper-78dc9057.js";import"./vue-i18n.runtime.esm-bundler-6949bcab.js";import"./index-b7f916e1.js";import"./_commonjsHelpers-87174ba5.js";import"./vue-router-a383d220.js";function ue(){const S=t(!1),V=u({role_list:[],row:{}}),g=u({uid:"",username:"",phone:"",status:""}),x=t([]),m=t(!0);t({});const i=u({uid:"",code:"",name:"",phone:"",email:""}),h=t(!1),z=u({uid:"",code:"",name:"",phone:"",email:""}),W=t(!1),F=["用户ID","用户编号","用户名称","身份","手机号码","邮箱"],L=$(()=>["!h-[20px]","reset-margin","!text-gray-500","dark:!text-white","dark:hover:!text-primary"]);function P(e){i.uid=e.uid,i.code=e.code,i.name=e.username,i.phone=e.phone,i.email=e.email,h.value=!0}function U(){i.uid="",i.code="",i.name="",i.phone="",i.email="",h.value=!0}function O(e){Y(e.uid).then(a=>{C("删除人员成功",{type:"success"}),r()}).catch(a=>{C("删除人员失败",{type:"error"})})}function A(e){r(1,e)}function I(e){r(e)}async function r(e=1,a=5){m.value=!0;const{data:o,meta:s}=await X(Object.assign(g,{page:e,resault:p.pageSize}));x.value=o,p.total=s.total,setTimeout(()=>{m.value=!1},500)}const M=e=>{e&&(e.resetFields(),r())},N=u({password:"",repassword:""}),R=t(!1),_=t(!1),T=t(!1),v=t(!0),q=t(!1),w=t([]);function B(e){w.value=e.map(a=>({id:a.id,label:a.name}))}const b=t(!1),y=t("");function E(e,a){if(!e||Object.keys(e).length===0)return!0;const o=[];for(let s of a){const l=s.field,c=s.oper,f=s.value;let d="";e.hasOwnProperty(l)&&(d=e[l]);let n;switch(c){case">":n=d>f;break;case"<":n=d<f;break;case">=":n=d>=f;break;case"<=":n=d<=f;break;case"=":n=d===f;break;default:n=!1}o.push(n)}return o.every(s=>s===!0)}const G=t("用户列表");t("");const H=t(""),k=t(15),p=u({total:0,pageSize:k.value,pageSizes:[10,15,20,50,100],currentPage:1,background:!0}),D=t([]),J=t([]),K=t([]);async function Q(){b.value=!0;const{data:e}=await Z();y.value=e.row_key;let a=[],o=!1;_.value&&(a.push({type:"selection",width:55,align:"left",selectable:(s,l)=>e.exclude?!E(s,e.exclude):!0,fixed:!0,reserveSelection:!0}),o=!0),e.sec_fields.length>0?(o?a.push({type:"expand",slot:"expand"}):a.push({type:"expand",slot:"expand",fixed:!0,width:40}),a.push({label:"序号",type:"index",minWidth:60})):o?a.push({label:"序号",type:"index",minWidth:40,width:60}):a.push({label:"序号",type:"index",minWidth:40,width:60,fixed:!0}),v.value&&a.push({label:"操作",fixed:"right",width:280,slot:"operation"});for(let s in e.fields){let l=e.fields[s];a.push(l)}if(D.value=a,e.sec_fields.length>0){let s=[];s=[{label:"序号",type:"index",minWidth:40}];for(let l in e.sec_fields){let c=e.sec_fields[l];s.push(c)}J.value=s}if(e.third_fields.length>0){let s=[{label:"序号",type:"index",width:70}];for(let l in e.third_fields){let c=e.sec_fields[l];s.push(c)}K.value=s}e.model&&(G.value=e.model.tname,H.value=e.model.cmt),k.value=e.page_num,p.pageSize=e.page_num,r()}return j(()=>{Q()}),{config_loading:b,row_key:y,select_items:w,show_border:q,show_select:_,show_select_btn:T,show_operate:v,passwordformData:z,passwordFormDialogVisible:W,rePasswordformDialogVisible:R,rePasswordformData:N,editFormDialogVisible:h,editformData:i,handleNew:U,handleUpdate:P,handleDelete:O,selectList:F,formData:V,formDialogVisible:S,form:g,loading:m,columns:D,dataList:x,pagination:p,buttonClass:L,onSearch:r,resetForm:M,handleSizeChange:A,handleCurrentChange:I,handleSelectionChange:B}}export{ue as useUser};