index.a23a2b50.js 5.6 KB

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