2 lines
2.6 KiB
Java
2 lines
2.6 KiB
Java
var f=(e,n,t)=>new Promise((p,u)=>{var l=a=>{try{s(t.next(a))}catch(r){u(r)}},o=a=>{try{s(t.throw(a))}catch(r){u(r)}},s=a=>a.done?p(a.value):Promise.resolve(a.value).then(l,o);s((t=t.apply(e,n)).next())});import{s as T,au as A,bL as N}from"./index-X7Y8jykP.js";import{m as S,o as B,p as M}from"./auth.api-DyuagR5L.js";import{e as P,h as z,c as R,r as d,C as k,z as y,y as g,F as V,Q as $,f as h,A as I,K as F,E as _}from"./vue-vendor-DNhG1Cve.js";import{_ as L}from"./index-C7ckZv9Z.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";import"./DirectoryTree-nk_YTTIy.js";import"./FolderOpenOutlined-SzIPA7z0.js";import"./index-Cl-8Hzo4.js";import"./useMaxLevel-DE205ncc.js";import"./eagerComputed-BTlOruLW.js";import"./index-BuONesFs.js";const q=P({name:"AuthDataTree",props:{cgformId:{type:String,required:!0}},setup(e){const{createMessage:n}=T(),t=d(""),p=d(3),u=d(!0),l=d([]),o=d([]),s=d([]),a=d(""),r=R(()=>!t.value);z(()=>e.cgformId,m,{immediate:!0});function m(){return f(this,null,function*(){if(!e.cgformId)return;let c=yield M(e.cgformId);s.value=c.map(i=>({key:i.id,title:i.ruleName}))})}function v(c,i){return f(this,null,function*(){t.value=c,a.value=i,o.value=[],yield m();let x=yield S({roleId:c,cgformId:e.cgformId,type:p.value,authMode:i});o.value=x.map(w=>w.authId)})}function C(){t.value="",m()}function K(){m(),v(t.value,a.value)}function E(){return f(this,null,function*(){yield B(t.value,e.cgformId,{authId:JSON.stringify(o.value),authMode:a.value}),n.success("保存成功")})}function D(c){l.value=c,u.value=!1}function b(){t.value="",o.value=[]}return{loadChecked:v,clear:b,expandedKeys:l,autoExpandParent:u,checkedKeys:o,treeData:s,disabled:r,onSave:E,onExpand:D,onRefresh:K,clearChecked:C}}}),J={class:"onl-auth-tree-btns"};function O(e,n,t,p,u,l){const o=N,s=F("a-button"),a=L;return y(),k("div",null,[e.disabled?(y(),g(o,{key:0,description:"请先选中左侧角色/部门/用户"})):e.treeData.length===0?(y(),g(o,{key:1,description:"无权限信息"})):(y(),k(V,{key:2},[$("div",J,[h(s,{onClick:e.onRefresh,size:"small",type:"primary",preIcon:"ant-design:redo",ghost:""},{default:I(()=>[...n[1]||(n[1]=[_("刷新",-1)])]),_:1},8,["onClick"]),h(s,{onClick:e.onSave,size:"small",type:"primary",preIcon:"ant-design:save",ghost:""},{default:I(()=>[...n[2]||(n[2]=[_("保存",-1)])]),_:1},8,["onClick"])]),h(a,{checkable:"",checkedKeys:e.checkedKeys,"onUpdate:checkedKeys":n[0]||(n[0]=r=>e.checkedKeys=r),expandedKeys:e.expandedKeys,autoExpandParent:e.autoExpandParent,treeData:e.treeData,onExpand:e.onExpand},null,8,["checkedKeys","expandedKeys","autoExpandParent","treeData","onExpand"])],64))])}const ne=A(q,[["render",O],["__scopeId","data-v-6af08014"]]);export{ne as default};
|