index.43e8c3.js 5.4 KB

1
  1. import{_ as le,d as oe,w as se,x as d,Z as B,y as ue,ad as ie,r as i,o as g,c as T,H as U,K as H,h as re,l as e,D as a,F as ce,E as me,m as c,by as de,G as k,J as h,M as A,a as S,bA as pe,bx as j}from"./index.js";import{useColumns as fe}from"./columns.70d8b7.js";import{a as _e,b as ve}from"./index.38d51ba4.js";import ge from"./resetPassword.4646c1.js";import he from"./addEdit.981bec.js";const ke={class:"main"},ye={name:"Account"},Ce=oe({...ye,setup(be){const{logout:E}=se(),p=d([]),o=B({nickname:"",username:"",status:"",page:1,size:15}),z=d([]),y=d(!0),{columns:G}=fe(),C=d(!1),I=d(""),R=d("add"),b=B({id:"",nickname:"",mobile:""}),L=d(""),D=d(!1),N=d(),F=B({total:0,pageSize:15,currentPage:1,background:!0}),J=async n=>{const{id:t}=n;L.value=t,D.value=!0},K=async n=>{const{id:t,status:_}=n,{code:m,message:u}=await _e({id:t,status:_+""=="1"?"0":"1"});j({code:m,message:u,logout:E,handler:()=>f()})};async function O(n){o.page=n,await f()}async function Z(n){o.size=n,o.page=1,await f()}function q(n){}async function f(){y.value=!0;const{code:n,data:t,message:_}=await ve({...o,noRela:!0});j({code:n,message:_,logout:E,handler:()=>{const{list:m,count:u}=t;z.value=m!=null?m:[],F.total=u!=null?u:0,F.pageSize=o.size,F.currentPage=o.page}}),y.value=!1}async function Q(){o.page=1,await f()}function V(n,t,_){I.value=n,R.value=t;const{nickname:m,mobile:u}=_;b.nickname=m,b.mobile=u,b.id=n,C.value=!0}const W=()=>{C.value=!1,f()},X=()=>{C.value=!1},M=()=>{D.value=!1},Y=n=>{!n||(n.resetFields(),o.page=1,f())};return ue(()=>{p.value=ie().getMenuActions("account"),f()}),(n,t)=>{const _=i("el-option"),m=i("el-select"),u=i("el-form-item"),w=i("el-col"),P=i("el-input"),v=i("el-button"),ee=i("el-row"),ae=i("el-form"),$=i("el-popconfirm"),te=i("PureTable"),ne=i("NoAuth");return g(),T("div",ke,[U(re("div",null,[e(ae,{ref_key:"formRef",ref:N,model:o,size:"small","label-width":0,class:"bg-white pl-8 pt-4"},{default:a(()=>[e(ee,{gutter:12},{default:a(()=>[e(w,{span:6},{default:a(()=>[e(u,{prop:"status"},{default:a(()=>[e(m,{modelValue:o.status,"onUpdate:modelValue":t[0]||(t[0]=l=>o.status=l),style:{width:"100%"},placeholder:"\u8D26\u53F7\u72B6\u6001",clearable:""},{default:a(()=>[(g(!0),T(ce,null,me(c(de),(l,x)=>(g(),k(_,{key:"status"+l.value+x,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(w,{span:6},{default:a(()=>[e(u,{prop:"nickname"},{default:a(()=>[e(P,{modelValue:o.nickname,"onUpdate:modelValue":t[1]||(t[1]=l=>o.nickname=l),placeholder:"\u771F\u5B9E\u59D3\u540D",clearable:""},null,8,["modelValue"])]),_:1})]),_:1}),e(w,{span:6},{default:a(()=>[e(u,{prop:"username"},{default:a(()=>[e(P,{modelValue:o.username,"onUpdate:modelValue":t[2]||(t[2]=l=>o.username=l),placeholder:"\u624B\u673A\u53F7",clearable:""},null,8,["modelValue"])]),_:1})]),_:1}),e(w,{span:6},{default:a(()=>[e(u,null,{default:a(()=>[e(v,{type:"primary",icon:c(h)("search"),loading:y.value,onClick:Q},{default:a(()=>[A(" \u641C\u7D22 ")]),_:1},8,["icon","loading"]),e(v,{icon:c(h)("refresh"),onClick:t[3]||(t[3]=l=>Y(N.value))},{default:a(()=>[A(" \u91CD\u7F6E ")]),_:1},8,["icon"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),e(c(pe),{title:"\u8FD0\u8425\u8D26\u53F7\u7BA1\u7406",loading:y.value,size:"small",dataList:z.value,onRefresh:f},{buttons:a(()=>[e(v,{type:"primary",size:"small",icon:c(h)("add"),onClick:t[4]||(t[4]=l=>V("","add",{}))},{default:a(()=>[A(" \u65B0\u589E ")]),_:1},8,["icon"])]),default:a(({size:l,checkList:x})=>[e(te,{border:"",align:"left",showOverflowTooltip:"","table-layout":"auto",size:"small",data:z.value,columns:c(G),checkList:x,pagination:F,paginationSmall:l==="small","header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:q,onSizeChange:Z,onCurrentChange:O},{operation:a(({row:r})=>[e($,{title:"\u786E\u8BA4\u91CD\u7F6E\u5BC6\u7801\uFF1F",onConfirm:s=>J(r)},{reference:a(()=>[p.value.some(s=>s=="012")?(g(),k(v,{key:0,class:"reset-margin",link:"",type:"primary",size:"small",icon:c(h)("refresh-right")},null,8,["icon"])):S("v-if",!0)]),_:2},1032,["onConfirm"]),p.value.some(s=>s=="007")?(g(),k(v,{key:0,class:"reset-margin",link:"",type:"primary",size:"small",onClick:s=>V(r.id,"view",r),icon:c(h)("eye-view")},null,8,["onClick","icon"])):S("v-if",!0),p.value.some(s=>s=="005")?(g(),k(v,{key:1,class:"reset-margin",link:"",type:"primary",size:"small",onClick:s=>V(r.id,"edit",r),icon:c(h)("edits")},null,8,["onClick","icon"])):S("v-if",!0),p.value.some(s=>s=="004")&&r.status+""=="1"||p.value.some(s=>s=="003")&&r.status+""=="0"?(g(),k($,{key:2,title:String(r.status)==="1"?"\u6539\u4E3A\u7981\u7528\uFF1F":"\u6539\u4E3A\u542F\u7528\uFF1F",onConfirm:s=>K(r)},{reference:a(()=>[e(v,{class:"reset-margin",link:"",type:"primary",size:"small",icon:c(h)(String(r.status)==="1"?"close-circle-line":"checkbox-circle-line")},null,8,["icon"])]),_:2},1032,["title","onConfirm"])):S("v-if",!0)]),_:2},1032,["data","columns","checkList","pagination","paginationSmall"])]),_:1},8,["loading","dataList"]),e(he,{itemId:I.value,isDetails:R.value,"show-model":C.value,onRefresh:W,onCancel:X,sitem:b},null,8,["itemId","isDetails","show-model","sitem"]),e(ge,{itemId:L.value,"show-model":D.value,onRefresh:M,onCancel:M},null,8,["itemId","show-model"])],512),[[H,p.value.some(l=>l=="001")]]),U(e(ne,null,null,512),[[H,!p.value.some(l=>l=="001")]])])}}});var Ve=le(Ce,[["__scopeId","data-v-39e91daa"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/system/account/index.vue"]]);export{Ve as default};