| 1 |
- import{p as F,a as ie}from"./index-519a55fb.js";import{d as P,i as v,y as D,l as Q,q as re,r as p,o as S,b as J,w as i,C as ue,c as o,B as K,L as G,e as f,s as U,f as q,F as ce,D as de,S as fe,t as M,H as pe,p as me,j as _e,_ as ve}from"./index-3b8b93f4.js";import"./CusNavigation.vue_vue_type_style_index_0_scoped_5e63f475_lang-c9f54a72.js";import{C as he}from"./CusNavigation-0a2cb184.js";import{R as ge}from"./ReloadOutlined-79e30c0a.js";var X={exports:{}},a=X.exports={},x,y;function W(){throw new Error("setTimeout has not been defined")}function j(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?x=setTimeout:x=W}catch(t){x=W}try{typeof clearTimeout=="function"?y=clearTimeout:y=j}catch(t){y=j}})();function Y(t){if(x===setTimeout)return setTimeout(t,0);if((x===W||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch(r){try{return x.call(null,t,0)}catch(u){return x.call(this,t,0)}}}function xe(t){if(y===clearTimeout)return clearTimeout(t);if((y===j||!y)&&clearTimeout)return y=clearTimeout,clearTimeout(t);try{return y(t)}catch(r){try{return y.call(null,t)}catch(u){return y.call(this,t)}}}var w=[],I=!1,z,A=-1;function ye(){!I||!z||(I=!1,z.length?w=z.concat(w):A=-1,w.length&&Z())}function Z(){if(!I){var t=Y(ye);I=!0;for(var r=w.length;r;){for(z=w,w=[];++A<r;)z&&z[A].run();A=-1,r=w.length}z=null,I=!1,xe(t)}}a.nextTick=function(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var u=1;u<arguments.length;u++)r[u-1]=arguments[u];w.push(new ee(t,r)),w.length===1&&!I&&Y(Z)};function ee(t,r){this.fun=t,this.array=r}ee.prototype.run=function(){this.fun.apply(null,this.array)};a.title="browser";a.browser=!0;a.env={};a.argv=[];a.version="";a.versions={};function k(){}a.on=k;a.addListener=k;a.once=k;a.off=k;a.removeListener=k;a.removeAllListeners=k;a.emit=k;a.prependListener=k;a.prependOnceListener=k;a.listeners=function(t){return[]};a.binding=function(t){throw new Error("process.binding is not supported")};a.cwd=function(){return"/"};a.chdir=function(t){throw new Error("process.chdir is not supported")};a.umask=function(){return 0};var te=X.exports;const be=P({__name:"Add",emits:["onSuccess"],setup(t,{expose:r,emit:u}){const m=v(null),b=v(!1),h=v(!0),_=v([{value:"123",label:"网络泵"},{value:"456",label:"化疗泵"},{value:"789",label:"其他"}]),l=D({id:void 0,username:"",password:"",mobile:"",email:"",code:""}),L=function(){let c="";h.value?c="/user/add":c="/user/edit",F({url:c,data:l},s=>{console.log(s),K.info(s.msg),$(),u("onSuccess",s)})},T=c=>{var s;console.log("handleOK",c),(s=m.value)==null||s.validate().then(()=>{console.log("11"),L()},()=>{console.log("22")})},E=()=>{b.value=!0,te.nextTick(()=>{G("addUser")})},$=()=>{b.value=!1},B=()=>{var c;h.value=!0,ue(l),(c=m.value)==null||c.clearValidate(),E()},N=c=>{var s;h.value=!1,Object.assign(l,c),(s=m.value)==null||s.clearValidate(),E()},V=c=>{_.value=c};return Q(()=>{console.log("onMounted")}),re(()=>{console.log("onUnmounted")}),r({add:B,update:N,updateOptions:V}),(c,s)=>{const R=p("a-input"),e=p("a-form-item"),n=p("a-form"),O=p("a-modal");return S(),J(O,{class:"addUser",title:"添加用户",visible:b.value,"onUpdate:visible":s[3]||(s[3]=g=>b.value=g),maskClosable:!1,width:480,cancelText:"取消",okText:"确定",onOk:T},{default:i(()=>[o(n,{ref_key:"formRef",ref:m,model:l,name:"basic","label-align":"left","label-col":{span:4},"wrapper-col":{span:20},autocomplete:"off",layout:"vertical"},{default:i(()=>[o(e,{"wrapper-col":{offset:0,span:24},label:"用户名",name:"username",rules:[{required:!0,message:"请输入用户名!"}]},{default:i(()=>[o(R,{size:"large",value:l.username,"onUpdate:value":s[0]||(s[0]=g=>l.username=g)},null,8,["value"])]),_:1}),o(e,{"wrapper-col":{offset:0,span:24},label:"用户编号",name:"code",rules:[{required:!0,message:"请输入用户编号!"}]},{default:i(()=>[o(R,{size:"large",value:l.code,"onUpdate:value":s[1]||(s[1]=g=>l.code=g)},null,8,["value"])]),_:1}),o(e,{"wrapper-col":{offset:0,span:24},label:"手机号",name:"mobile",rules:[{required:!0,message:"请输入手机号!"}]},{default:i(()=>[o(R,{size:"large",value:l.mobile,"onUpdate:value":s[2]||(s[2]=g=>l.mobile=g)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["visible"])}}}),we=f("div",null," 详情 ",-1),ke=P({__name:"Detail",setup(t,{expose:r}){const u=v(!1),m=_=>{console.log(_),u.value=!1},b=()=>{u.value=!0,te.nextTick(()=>{G("userDetail")})},h=()=>{u.value=!1};return Q(()=>{}),r({show:b,hidden:h}),(_,l)=>{const L=p("a-modal");return S(),J(L,{class:"userDetail",title:"产品功能",visible:u.value,"onUpdate:visible":l[0]||(l[0]=T=>u.value=T),maskClosable:!1,width:480,cancelText:"取消",okText:"确定",onOk:m},{default:i(()=>[we]),_:1},8,["visible"])}}}),Te=t=>(me("data-v-46b60fa6"),t=t(),_e(),t),Ce={class:"cus-animation",style:{height:"100%",width:"100%",padding:"16px 20px",display:"flex","flex-direction":"column"}},Se={style:{display:"flex","justify-content":"space-between","align-items":"flex-end"}},ze={style:{display:"flex"}},Oe=Te(()=>f("span",null,"添加",-1)),Ue={style:{"font-weight":"bold"}},Ie={key:0},Le={key:1,style:{color:"red"}},Re={style:{"font-weight":"bold"}},Ee={key:0,style:{color:"green"}},$e={key:1,style:{color:"red"}},qe=["onClick"],De=["onClick"],Ae={key:0,style:{"margin-left":"26px"}},Be=P({__name:"Index",setup(t){const r=v(null),u=D({x:1600}),m=D({pageSize:20,current:1,size:"default",showSizeChanger:!0,showQuickJumper:!0,showTotal:function(e){return`共 ${e} 条数据`},onChange:function(e,n){console.log("111",e,n),this.current=e,this.pageSize=n,l()}}),b=v([]),h=v(!1),_=D({size:20,page:1,sort:"createtime",order:"desc",keyWord:""}),l=()=>{h.value=!0,_.size=m.pageSize,_.page=m.current,ie({url:"/user/search",data:_}).then(e=>{console.log(e),m.total=e.total,b.value=e.data,h.value=!1})},L=function(){m.current=1,l()},T=v(null),E=e=>{var n;console.log(e),(n=T.value)==null||n.add()},$=v(null),B=e=>{var n;console.log(e),(n=$.value)==null||n.show(e)},N=e=>{console.log(e);const n={id:e.id};F({url:"/user/delete",data:n},O=>{console.log(O),K.info(O.msg),l()})},V=e=>{var n;console.log(e),(n=T.value)==null||n.update(e)},c=v(),s=()=>{F({url:"/role/search",data:{size:100,page:1,sort:"createtime",order:"desc",keyWord:""}},e=>{var n;console.log(e),c.value=e.data,(n=T.value)==null||n.updateOptions(c.value)})},R=e=>{console.log(e),l()};return Q(()=>{var e;u.y=((e=r.value)==null?void 0:e.clientHeight)-113,l(),s()}),(e,n)=>{const O=p("a-button"),g=p("a-tooltip"),oe=p("a-input"),ne=p("a-form-item"),ae=p("a-form"),C=p("a-table-column"),le=p("a-popconfirm"),se=p("a-table");return S(),U(ce,null,[f("div",Ce,[o(q(he),{title:"用户管理"}),f("div",Se,[f("div",ze,[o(O,{type:"primary",style:{"margin-right":"10px",background:"#0058FF"},onClick:E},{icon:i(()=>[o(q(de))]),default:i(()=>[Oe]),_:1}),o(ae,{layout:"inline",model:_},{default:i(()=>[o(ne,null,{default:i(()=>[o(oe,{allowClear:"",value:_.keyWord,"onUpdate:value":n[0]||(n[0]=d=>_.keyWord=d),placeholder:"请输入要查询的内容",style:{width:"280px"}},{suffix:i(()=>[o(g,{title:"点击搜索",onClick:L},{default:i(()=>[o(q(fe),{style:{color:"rgba(0, 0, 0, 0.45)"}})]),_:1})]),_:1},8,["value"])]),_:1})]),_:1},8,["model"])]),f("div",null,[o(g,{onClick:l},{default:i(()=>[o(q(ge),{style:{"font-size":"16px"},spin:h.value},null,8,["spin"])]),_:1})])]),f("div",{ref_key:"table_container",ref:r,style:{"margin-top":"9px","border-top":"1px solid #eee",display:"flex","flex-direction":"column",overflow:"hidden",height:"0px","flex-grow":"1"}},[o(se,{"data-source":b.value,pagination:m,scroll:u,bordered:!0,loading:h.value,size:"middle"},{default:i(()=>[o(C,{title:"序号",width:60,fixed:"left",align:"center"},{default:i(({index:d})=>[f("div",null,M(d+1),1)]),_:1}),o(C,{title:"用户名","data-index":"username",width:200,fixed:"left",align:"center"}),o(C,{title:"用户编号",width:180,fixed:"left",align:"left"},{default:i(({record:d})=>[f("div",Ue,[d.code?(S(),U("span",Ie,M(d.code),1)):(S(),U("span",Le,"未知"))])]),_:1}),o(C,{title:"手机号","data-index":"mobile",width:200}),o(C,{title:"状态",width:150,align:"center"},{default:i(({record:d})=>[f("div",Re,[d.enabled?(S(),U("span",Ee,"正常")):(S(),U("span",$e,"异常"))])]),_:1}),o(C,{title:"上次登录时间","data-index":"lasttime",width:200}),o(C,{title:"创建时间","data-index":"createtime",width:200}),o(C,{title:"操作",width:200,fixed:"right"},{default:i(({record:d})=>[f("div",null,[f("a",{style:{"margin-left":"0px"},onClick:H=>B(d)},"查看",8,qe),f("a",{style:{"margin-left":"26px"},onClick:H=>V(d)},"编辑",8,De),o(le,{title:"确定删除?",okText:"确定",cancelText:"取消",onConfirm:H=>N(d)},{default:i(()=>[d.id!=1?(S(),U("a",Ae,"删除")):pe("",!0)]),_:2},1032,["onConfirm"])])]),_:1})]),_:1},8,["data-source","pagination","scroll","loading"])],512)]),o(be,{ref_key:"addRef",ref:T,onOnSuccess:R},null,512),o(ke,{ref_key:"detailRef",ref:$},null,512)],64)}}});const Pe=ve(Be,[["__scopeId","data-v-46b60fa6"]]);export{Pe as default};
|