Files
beautifier-web/dist/assets/index.9e09f495.js
T
2026-04-27 17:08:13 +08:00

2 lines
5.1 KiB
JavaScript

import{d as H,p as K,r as z,W as L,B as J,Q as i,D as X,H as Y,a as c,$ as Z,N as ee,j as o,b as d,g as j,v as p,f as l,e as r,G as te,F as ae,h as ue,c as f,x as b,t as y,k as oe,C as D,E as le,V as E}from"./index.507bae88.js";import{p as ie,s as re,l as se}from"./index.fe8ce043.js";/* empty css */import{S as ne}from"./index.a482b18a.js";import{S as de}from"./index.53fadc17.js";import ce from"./editDialog.ac75bd51.js";import{g as v}from"./filter.0d40c637.js";import{p as pe}from"./plus.c97dcbd2.js";import{e as fe}from"./edit.0a544f0d.js";import"./plugin-vue_export-helper.41ffa612.js";import"./index.5631df1d.js";const me={class:"app-container"},he={name:"role"},Te=H({...he,setup(_e){const{my:m}=K(),x=z(L),u=J({loading:!0,dialog:{id:0,visible:!1,project_id:"",title:""},dataList:[],authAdd:!1,authEdit:!1,authStatus:!1,authDetail:!1,authTitles:!1,authList:!1,publicProjectTitles:!1,selectProjectId:0,sortListData:[],num:i}),{loading:A,dialog:F,dataList:I,authEdit:k,authStatus:P,authList:V,selectProjectId:g,sortListData:N}=X(u);function $(e,a){return a==i.authTypeUrl&&(e=e.slice(1)),e}function R(){if(!u.publicProjectTitles){m.reminder("\u6CA1\u6709\u9879\u76EE\u4E0B\u62C9\u7684\u6743\u9650");return}ie().then(e=>{if(e.code===D.ok.code)u.sortListData=e.data,u.selectProjectId=u.sortListData[0].id,C();else return m.reminder(e.message)})}function U(e,a,s){a==i.statusForbidden?le.prompt("\u786E\u8BA4\u7981\u7528\u8BE5\u6570\u636E\u9879?","\u8B66\u544A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(h=>{B(s,e,a,h.value)}).catch(()=>{s.row.status=a==i.one?i.two:i.one}):B(s,e,a,"")}function B(e,a,s,h){re(a,s,h).then(_=>_.code===D.ok.code?(e.row.status=s,u.row=s,m.ok("\u4FEE\u6539\u6210\u529F")):(e.row.status=s==i.one?i.two:i.one,m.reminder(_.message)))}function C(){u.loading=!0,se({project_id:u.selectProjectId,project:0,auth:""}).then(e=>{if(u.loading=!1,e.code===D.ok.code)u.dataList=e.data;else return m.reminder(e.message)})}function T(e){u.dialog={id:e,project_id:u.selectProjectId,title:e>0?"\u7F16\u8F91":"\u6DFB\u52A0",visible:!0}}function G(e){let a="";switch(e){case i.authTypeDir:a="\u76EE\u5F55";break;case i.authTypeWeb:a="\u9875\u9762";break;case i.authTypeButton:a="\u6309\u94AE";break;case i.authTypeUrl:a="\u5916\u94FE";break}return a}const M=e=>{u.dialog.visible=e};return Y(()=>{u.authEdit=v(E.authorityEditId)!="",u.authStatus=v(E.authorityStatusId)!="",u.publicProjectTitles=v(E.publicProjectTitlesId)!="",u.authList=v(E.authorityListId)!="",R()}),(e,a)=>{const s=c("el-option"),h=c("el-select"),_=c("el-form-item"),S=c("el-button"),n=c("el-table-column"),O=c("el-tag"),q=c("el-switch"),Q=c("el-table"),W=Z("loading");return ee((d(),j("div",me,[p(" \u641C\u7D22\u8868\u5355 "),l(o(L),{ref_key:"queryFormRef",ref:x,inline:!0},{default:r(()=>[l(_,{label:"\u9879\u76EE",prop:"parent_id"},{default:r(()=>[l(h,{modelValue:o(g),"onUpdate:modelValue":a[0]||(a[0]=t=>te(g)?g.value=t:null),placeholder:"Select",onChange:C},{default:r(()=>[(d(!0),j(ae,null,ue(o(N),t=>(d(),f(s,{key:t.id,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(_,null,{default:r(()=>[o(k)&&o(g)!=0?(d(),f(S,{key:0,type:"success",icon:o(pe),onClick:a[1]||(a[1]=t=>T(0))},{default:r(()=>[b(y(e.$t("navbar.add")),1)]),_:1},8,["icon"])):p("v-if",!0)]),_:1})]),_:1},512),p(" \u6570\u636E\u8868\u683C "),o(V)?(d(),f(Q,{key:0,ref:"dataTableRef",data:o(I),"row-key":"id","tree-props":{children:"children"},"highlight-current-row":"",border:""},{default:r(()=>[l(n,{fixed:"",label:"\u6743\u9650\u540D",prop:"name","min-width":"200"},{default:r(t=>[b(y(t.row.name)+" ",1),l(de,{"icon-class":t.row.icon},null,8,["icon-class"])]),_:1}),l(n,{label:"\u52A0\u8F7D\u9875\u9762",prop:"view_path","min-width":"200"}),l(n,{label:"\u8DEF\u7531\u8DEF\u5F84",prop:"path","min-width":"180"},{default:r(t=>[b(y($(t.row.path,t.row.type)),1)]),_:1}),l(n,{label:"\u63A5\u53E3\u5730\u5740",prop:"api","min-width":"185"}),l(n,{label:"\u6743\u9650\u6807\u8BC6",prop:"identification","min-width":"150"}),l(n,{label:"\u662F\u5426\u53EF\u89C1",prop:"is_show",align:"center",width:"100"},{default:r(t=>[l(ne,{status:t.row.is_show},null,8,["status"])]),_:1}),l(n,{label:"\u7C7B\u578B",prop:"type",align:"center",width:"80"},{default:r(t=>[l(O,null,{default:r(()=>[b(y(G(t.row.type)),1)]),_:2},1024)]),_:1}),o(P)?(d(),f(n,{key:0,fixed:"right",label:"\u72B6\u6001",prop:"status",align:"center",width:"70"},{default:r(t=>[l(q,{onChange:w=>U(t.row.id,w,t),modelValue:t.row.status,"onUpdate:modelValue":w=>t.row.status=w,"inline-prompt":"","active-value":1,"inactive-value":2,"active-text":"\u5F00","inactive-text":"\u5173"},null,8,["onChange","modelValue","onUpdate:modelValue"])]),_:1})):p("v-if",!0),o(k)?(d(),f(n,{key:1,fixed:"right",label:"\u64CD\u4F5C",align:"center",width:"120"},{default:r(t=>[o(k)?(d(),f(S,{key:0,type:"primary",icon:o(fe),circle:"",plain:"",onClick:oe(w=>T(t.row.id),["stop"])},null,8,["icon","onClick"])):p("v-if",!0)]),_:1})):p("v-if",!0)]),_:1},8,["data"])):p("v-if",!0),o(F).visible?(d(),f(ce,{key:1,dialog:o(F),onCloseDialog:a[2]||(a[2]=t=>M(t)),onGetDataList:a[3]||(a[3]=t=>C())},null,8,["dialog"])):p("v-if",!0)])),[[W,o(A)]])}}});export{Te as default};