index.1562fba4.js 5.5 KB

1
  1. import{_ as le,d as oe,D as se,E as d,a7 as x,F as ue,ag as ie,x as i,o as g,c as T,O as U,P as H,b as ce,y as e,K as a,L as re,M as me,u as r,R as h,N as k,a as S,bE as de,W as E,ba as O}from"./index.1417328f.js";import{useColumns as pe}from"./columns.01173562.js";import{a as fe,b as _e}from"./index.4a42eaee.js";import{g as ve}from"./status.727086c1.js";import ge from"./resetPassword.9262d23d.js";import he from"./addEdit.e8ac3a1a.js";const ke={class:"main"},ye=E(" \u641C\u7D22 "),Ce=E(" \u91CD\u7F6E "),be=E(" \u65B0\u589E\u8D26\u53F7 "),Fe={name:"Account"},we=oe({...Fe,setup(Se){const{logout:R}=se(),p=d([]),o=x({nickname:"",username:"",status:"",page:1,size:15}),z=d([]),y=d(!0),{columns:j}=pe(),C=d(!1),A=d(""),I=d("add"),b=x({id:"",nickname:"",mobile:""}),L=d(""),D=d(!1),N=d(),F=x({total:0,pageSize:15,currentPage:1,background:!0}),K=async n=>{const{id:t}=n;L.value=t,D.value=!0},W=async n=>{const{id:t,status:_}=n,{code:m,message:u}=await fe({id:t,status:_+""=="1"?"0":"1"});O({code:m,message:u,logout:R,handler:()=>f()})};async function q(n){o.page=n,await f()}async function G(n){o.size=n,o.page=1,await f()}function J(n){}async function f(){y.value=!0;const{code:n,data:t,message:_}=await _e({...o,noRela:!0,islevel:"1"});O({code:n,message:_,logout:R,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,_){A.value=n,I.value=t;const{nickname:m,mobile:u}=_;b.nickname=m,b.mobile=u,b.id=n,C.value=!0}const X=()=>{C.value=!1,f()},Y=()=>{C.value=!1},P=()=>{D.value=!1},Z=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"),M=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(ce("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(re,null,me(r(ve),(l,B)=>(g(),k(_,{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(M,{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(M,{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:r(h)("search"),loading:y.value,onClick:Q},{default:a(()=>[ye]),_:1},8,["icon","loading"]),e(v,{icon:r(h)("refresh"),onClick:t[3]||(t[3]=l=>Z(N.value))},{default:a(()=>[Ce]),_:1},8,["icon"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),e(r(de),{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:r(h)("add"),onClick:t[4]||(t[4]=l=>V("","add",{}))},{default:a(()=>[be]),_:1},8,["icon"])]),default:a(({size:l,checkList:B})=>[e(te,{border:"",align:"left",showOverflowTooltip:"","table-layout":"auto",size:"small",data:z.value,columns:r(j),checkList:B,pagination:F,paginationSmall:l==="small","header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:J,onSizeChange:G,onCurrentChange:q},{operation:a(({row:c})=>[e($,{title:"\u786E\u8BA4\u91CD\u7F6E\u5BC6\u7801\uFF1F",onConfirm:s=>K(c)},{reference:a(()=>[p.value.some(s=>s=="012")?(g(),k(v,{key:0,class:"reset-margin",link:"",type:"primary",size:"small",icon:r(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(c.id,"view",c),icon:r(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(c.id,"edit",c),icon:r(h)("edits")},null,8,["onClick","icon"])):S("v-if",!0),p.value.some(s=>s=="004")&&c.status+""=="1"||p.value.some(s=>s=="003")&&c.status+""=="0"?(g(),k($,{key:2,title:String(c.status)==="1"?"\u6539\u4E3A\u7981\u7528\uFF1F":"\u6539\u4E3A\u542F\u7528\uFF1F",onConfirm:s=>W(c)},{reference:a(()=>[e(v,{class:"reset-margin",link:"",type:"primary",size:"small",icon:r(h)(String(c.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:A.value,isDetails:I.value,"show-model":C.value,onRefresh:X,onCancel:Y,sitem:b},null,8,["itemId","isDetails","show-model","sitem"]),e(ge,{itemId:L.value,"show-model":D.value,onRefresh:P,onCancel:P},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 Re=le(we,[["__scopeId","data-v-39e91daa"],["__file","/Users/apple/Desktop/Company Projects/accout-vue3-ui/src/views/system/account/index.vue"]]);export{Re as default};