1 |
- import{_ as le,d as oe,v as se,w as d,Z as x,x as ue,ad as ie,r as i,o as g,c as T,H as U,K as H,b as re,l as e,C as a,F as ce,D as me,u as c,G as C,J as h,M as A,a as S,bp as de,bn as j}from"./index.42bf163d.js";import{useColumns as pe}from"./columns.40f5861d.js";import{a as fe,b as _e}from"./index.12889ab8.js";import{a as ve}from"./status.d6b2a53d.js";import ge from"./resetPassword.be73bef0.js";import he from"./addEdit.ec2301ad.js";const Ce={class:"main"},ke={name:"Account"},ye=oe({...ke,setup(be){const{logout:I}=se(),p=d([]),o=x({nickname:"",username:"",status:"",page:1,size:15}),z=d([]),k=d(!0),{columns:G}=pe(),y=d(!1),R=d(""),E=d("add"),b=x({id:"",nickname:"",mobile:""}),L=d(""),D=d(!1),N=d(),F=x({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 fe({id:t,status:_+""=="1"?"0":"1"});j({code:m,message:u,logout:I,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(){k.value=!0;const{code:n,data:t,message:_}=await _e({...o,noRela:!0});j({code:n,message:_,logout:I,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}}),k.value=!1}async function Q(){o.page=1,await f()}function V(n,t,_){R.value=n,E.value=t;const{nickname:m,mobile:u}=_;b.nickname=m,b.mobile=u,b.id=n,y.value=!0}const W=()=>{y.value=!1,f()},X=()=>{y.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",Ce,[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(ve),(l,B)=>(g(),C(_,{key:"status"+l.value+B,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:k.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(de),{title:"\u8FD0\u8425\u8D26\u53F7\u7BA1\u7406",loading:k.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:B})=>[e(te,{border:"",align:"left",showOverflowTooltip:"","table-layout":"auto",size:"small",data:z.value,columns:c(G),checkList:B,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(),C(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(),C(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(),C(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(),C($,{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:R.value,isDetails:E.value,"show-model":y.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 Be=le(ye,[["__scopeId","data-v-39e91daa"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/system/account/index.vue"]]);export{Be as default};
|