index.fe7eb075.js 3.2 KB

1
  1. import{ck as a,X as v,Z as D,cr as F,S as k,_ as y,d as b,m as c,n as w,cp as x,o as R,c as q,h as r,x as T,b as I,u as t,cZ as M,d9 as S,da as W}from"./index.56449854.js";import U from"./menu-tree.25a3870b.js";import{u as Y}from"./use-page-modal.682b86d9.js";import"./index.77a8b055.js";const{VITE_PROXY_DOMAIN_REAL:ae,VITE_PROXY_USER_REAL:$}=v(),o=$+"/admin/",N=e=>a.request("post",`${o}menu/queryAction`,{data:e}),L=e=>a.request("post",`${o}action/query`,{data:e}),V=e=>a.request("post",`${o}menu/addAction`,{data:e}),O=e=>a.request("post",`${o}menuactionsave`,{data:e}),X=e=>a.request("post",`${o}menu/statusAction`,{data:e}),j=e=>a.request("post",`${o}menu/delAction`,{data:e}),z=[{type:"selection",width:40,align:"center",hide:({checkList:e})=>!e.includes("\u52FE\u9009\u5217")},{label:"\u5E8F\u53F7",type:"index",minWidth:60,align:"left",hide:({checkList:e})=>!e.includes("\u5E8F\u53F7\u5217")},{label:"\u6309\u94AE\u540D\u79F0",prop:"action_name",minWidth:180,align:"left"},{label:"\u72B6\u6001",prop:"status",minWidth:80,cellRenderer:({row:e,props:i})=>D(F,{size:i.size,type:String(e.status)==="1"?"success":"danger"},{default:()=>e.status+""=="0"?"\u7981\u7528":"\u542F\u7528"})},{label:"\u521B\u5EFA\u65F6\u95F4",minWidth:180,prop:"createTime",formatter:({createTime:e})=>k(e).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",minWidth:140,slot:"operation"}],H={columns:z,title:"\u6309\u94AE\u8BBE\u7F6E",notNeedCompanyFilter:!0,noRequiredInit:!0,statusProp:"menu_action_id",deleteProp:"menu_action_id",apis:{httpAdd:V,httpList:N,httpUpdate:O,httpDelete:j,httpStatus:X}},Z={title:"\u6309\u94AE",colLayout:{span:24},itemStyle:{},formItems:[{field:"action_id",type:"select",label:"\u6309\u94AE\u540D\u79F0",labelWidth:"120px",placeholder:"\u6309\u94AE\u540D\u79F0",options:[],rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u6309\u94AE\u6807\u8BC6"}]}]},G={class:"main role"},J={"w-full":"",flex:""},K=b({__name:"index",setup(e){const i=c(""),l=c(null),d=c(Z),{pageModalRef:m,handleCreateData:f,handleUpdateData:h,handlePreviewData:_,handleConfrim:g,defaultInfo:C}=Y({pageContentRef:l,confirmCallback:({action_id:n})=>({menu_id:t(i),action_id:n})});function E(n){const{is_menu:u,id:s}=n;!(String(u)==="0")||!s||(i.value=s,l.value.getPageData({menu_id:s}))}w(async()=>{const{code:n,data:u}=await L({status:"1"});if(n!==1)return;const s=u.map(({action_name:p,id:P})=>({label:p,value:P}));d.value.formItems[0].options=s});const{hasPermissionWithCode:B,permissions:A}=x("setBtn");return(n,u)=>(R(),q("div",G,[r(W,{"is-show":t(B)("3")},{default:T(()=>[I("div",J,[r(U,{onTreeSelectChange:E,onInitTableData:n.initTableData},null,8,["onInitTableData"]),r(t(M),{ref_key:"pageContentRef",ref:l,powers:t(A),"content-config":t(H),onCreateBtnClick:t(f),onPreviewBtnClick:t(_),onUpdateBtnClick:t(h)},null,8,["powers","content-config","onCreateBtnClick","onPreviewBtnClick","onUpdateBtnClick"])]),r(t(S),{ref_key:"pageModalRef",ref:m,"modal-config":d.value,"default-info":t(C),onConfirmBtnClick:t(g)},null,8,["modal-config","default-info","onConfirmBtnClick"])]),_:1},8,["is-show"])]))}});var oe=y(K,[["__file","C:/Users/89793/Desktop/projects/report-v3/src/views/system/setBtn/index.vue"]]);export{oe as default};