2 lines
6.2 KiB
JavaScript
2 lines
6.2 KiB
JavaScript
import{C as W,D as q,Q as G,R as H,w as J,F as X,I as Y,L as Z,o as ee,t as te,M as oe,N as ae}from"./element-plus.0a93cab1.js";import{_ as le}from"./index.vue_vue_type_script_setup_true_lang.3863431c.js";import{f as ne,b as ie}from"./index.8ccde2ce.js";import{_ as ue}from"./index.vue_vue_type_script_setup_true_lang.3dc69f7e.js";import{d as A,s as se,a0 as me,r as re,i as pe,am as de,o as u,c as k,W as e,O as a,u as o,a8 as V,V as ce,a7 as _e,M as m,T as d,P as v,a as D,S as C,j as fe,n as B}from"./@vue.c3e77981.js";import{a as x,_ as ve,b as be,c as he}from"./edit1.vue_vue_type_script_setup_true_lang.f98f3de4.js";import{r as we}from"./role.f684e086.js";import{u as Fe}from"./useDictOptions.3149944b.js";import{u as ge}from"./usePaging.d25ebf19.js";import"./@vueuse.a48d0173.js";import"./@element-plus.12c58ce2.js";import"./lodash-es.2b5acb28.js";import"./dayjs.16ed1fda.js";import"./axios.a8078129.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.b082b0c1.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.a2abcd4b.js";import"./vue-router.43c06794.js";import"./pinia.b5130627.js";import"./css-color-function.975e80a5.js";import"./color.d986aa86.js";import"./clone.704d8332.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.ded7f805.js";import"./vue-clipboard3.987889a8.js";import"./clipboard.af74a91f.js";import"./echarts.8535e5a6.js";import"./zrender.3eba8991.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b8b719e9.js";import"./index.39ecea31.js";import"./picker.11937b67.js";import"./index.69b150c0.js";import"./index.198329df.js";import"./index.4539689e.js";import"./index.vue_vue_type_script_setup_true_lang.3a6265a0.js";import"./vue3-video-play.4813c60b.js";import"./vuedraggable.5825c4b1.js";import"./vue.74758107.js";import"./sortablejs.275d9d20.js";import"./post.fbf454cd.js";import"./department.698720c8.js";const Ce={class:"admin"},Ee={class:"mt-4"},ye={class:"flex mt-4 justify-end"},ke=A({name:"admin"}),Et=A({...ke,setup(Ve){const b=se(),s=me({account:"",name:"",role_id:""}),h=re(!1),{pager:r,getLists:c,resetParams:$,resetPage:g}=ge({fetchFun:x,params:s}),P=l=>{be({id:l.id,avatar:l.avatar,account:l.account,name:l.name,role_id:l.role_id,job_id:l.job_id,dept_id:l.dept_id,disable:l.disable,multipoint_login:l.multipoint_login}).finally(()=>{c()})},S=async()=>{var l;h.value=!0,await B(),(l=b.value)==null||l.open("add")},U=async l=>{var n,_;h.value=!0,await B(),(n=b.value)==null||n.open("edit"),(_=b.value)==null||_.setFormData(l)},z=async l=>{await ne.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await he({id:l}),c()},{optionsData:I}=Fe({role:{api:we}});return pe(()=>{c()}),(l,n)=>{const _=W,w=q,E=G,K=H,f=J,L=ue,N=X,y=Y,R=ie,i=Z,T=ee,j=te,M=oe,O=le,F=de("perms"),Q=ae;return u(),k("div",Ce,[e(y,{class:"!border-none",shadow:"never"},{default:a(()=>[e(N,{class:"mb-[-16px]",model:o(s),inline:""},{default:a(()=>[e(w,{label:"\u7BA1\u7406\u5458\u8D26\u53F7"},{default:a(()=>[e(_,{modelValue:o(s).account,"onUpdate:modelValue":n[0]||(n[0]=t=>o(s).account=t),class:"w-[280px]",clearable:"",onKeyup:V(o(g),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(w,{label:"\u7BA1\u7406\u5458\u540D\u79F0"},{default:a(()=>[e(_,{modelValue:o(s).name,"onUpdate:modelValue":n[1]||(n[1]=t=>o(s).name=t),class:"w-[280px]",clearable:"",onKeyup:V(o(g),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(w,{label:"\u7BA1\u7406\u5458\u89D2\u8272"},{default:a(()=>[e(K,{class:"w-[280px]",modelValue:o(s).role_id,"onUpdate:modelValue":n[2]||(n[2]=t=>o(s).role_id=t)},{default:a(()=>[e(E,{label:"\u5168\u90E8",value:""}),(u(!0),k(ce,null,_e(o(I).role,(t,p)=>(u(),m(E,{key:p,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(w,null,{default:a(()=>[e(f,{type:"primary",onClick:o(g)},{default:a(()=>[d("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(f,{onClick:o($)},{default:a(()=>[d("\u91CD\u7F6E")]),_:1},8,["onClick"]),e(L,{class:"ml-2.5","fetch-fun":o(x),params:o(s),"page-size":o(r).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),v((u(),m(y,{class:"mt-4 !border-none",shadow:"never"},{default:a(()=>[v((u(),m(f,{type:"primary",onClick:S},{icon:a(()=>[e(R,{name:"el-icon-Plus"})]),default:a(()=>[d(" \u65B0\u589E ")]),_:1})),[[F,["auth.admin/add"]]]),D("div",Ee,[e(M,{data:o(r).lists,size:"large"},{default:a(()=>[e(i,{label:"ID",prop:"id","min-width":"60"}),d("> "),e(i,{label:"\u5934\u50CF","min-width":"100"},{default:a(({row:t})=>[e(T,{size:50,src:t.avatar},null,8,["src"])]),_:1}),e(i,{label:"\u8D26\u53F7",prop:"account","min-width":"100"}),e(i,{label:"\u540D\u79F0",prop:"name","min-width":"100"}),e(i,{label:"\u89D2\u8272",prop:"role_name","min-width":"100","show-tooltip-when-overflow":""}),e(i,{label:"\u90E8\u95E8",prop:"dept_name","min-width":"100","show-tooltip-when-overflow":""}),e(i,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"create_time","min-width":"180"}),e(i,{label:"\u6700\u8FD1\u767B\u5F55\u65F6\u95F4",prop:"login_time","min-width":"180"}),e(i,{label:"\u6700\u8FD1\u767B\u5F55IP",prop:"login_ip","min-width":"120"}),v((u(),m(i,{label:"\u72B6\u6001","min-width":"100"},{default:a(({row:t})=>[t.root!=1?(u(),m(j,{key:0,modelValue:t.disable,"onUpdate:modelValue":p=>t.disable=p,"active-value":0,"inactive-value":1,onChange:p=>P(t)},null,8,["modelValue","onUpdate:modelValue","onChange"])):C("",!0)]),_:1})),[[F,["auth.admin/edit"]]]),e(i,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:a(({row:t})=>[v((u(),m(f,{type:"primary",link:"",onClick:p=>U(t)},{default:a(()=>[d(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[F,["auth.admin/edit"]]]),t.root!=1?v((u(),m(f,{key:0,type:"danger",link:"",onClick:p=>z(t.id)},{default:a(()=>[d(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[F,["auth.admin/delete"]]]):C("",!0)]),_:1})]),_:1},8,["data"])]),D("div",ye,[e(O,{modelValue:o(r),"onUpdate:modelValue":n[3]||(n[3]=t=>fe(r)?r.value=t:null),onChange:o(c)},null,8,["modelValue","onChange"])])]),_:1})),[[Q,o(r).loading]]),o(h)?(u(),m(ve,{key:0,ref_key:"editRef",ref:b,onSuccess:o(c),onClose:n[4]||(n[4]=t=>h.value=!1)},null,8,["onSuccess"])):C("",!0)])}}});export{Et as default};
|