import{d as E,a1 as M,U as d,a2 as v,a3 as O,k as n,af as a,u as p,G as L,ad as K,V as Q,ag as q}from"./vue-vendor-CxLCUzY4.js";import"./index-KOQNKxnC.js";import{useListPage as F}from"./useListPage-CevWQ3ci.js";import{s as j,c as G,l as X,g as z,d as H,b as J,C as W}from"./CgreportModal-5a23d089-B1M6sQNo.js";import"./index-XZKTTfG1.js";import{C as N}from"./clipboard-CwX7nYZZ.js";import{a9 as Y,X as Z}from"./index-CLZzJyTP.js";import"./index-ByX9XNkE.js";import"./useJvxeMethods-DmJn8BNm.js";import"./user.api-DAu0nuTv.js";import{Q as tt}from"./componentMap-DpsJvoqz.js";import et from"./BasicTable-DUJWN3yz.js";import"./antd-vue-vendor-CahNzUUa.js";import"./useForm-Dx3lJ3DG.js";import"./index-DvqyyN77.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-CrdW4fN1.js";import"./useTimeout-KpZCXEcl.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useWindowSizeFn-D9PllI8g.js";import"./useFormItem-IOFWTdED.js";import"./download-DopMSmFN.js";import"./base64Conver-24EVOS6V.js";import"./index-CDa2_aYE.js";import"./index-D0jTtUNS.js";import"./useCountdown-BpP55PQ2.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-CfAGgHjD.js";import"./props-BtZrRNiI.js";import"./JSelectBiz-CLnJTMe2.js";import"./JAddInput-B36c3B5x.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-C7yPiS0L.js";import"./index-44tRnyoF.js";import"./bem-DT3DdmOs.js";import"./props-CG-jAkbI.js";import"./useContextMenu-BGU2vdqV.js";import"./depart.api-DHG2p2Yd.js";import"./JImageUpload-BFwNYdm5.js";import"./JDictSelectTag-CfF54ALX.js";import"./JSelectDept-CaEHrQp6.js";import"./JPopup-BvqhHpPl.js";import"./JEllipsis-C_gT_vEQ.js";import"./JUpload-DgDEmizw.js";import"./index-Bn2zmO2L.js";import"./index-CEznvAVZ.js";import"./index-CfAukas3.js";import"./JAreaLinkage-M9TGy8nY.js";import"./JCodeEditor-CR57XeIe.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CWOTSpxK.js";import"./injectionKey-DPVn4AgL.js";import"./vxeUtils-D_h6Rytj.js";var P=(C,h,l)=>new Promise((y,m)=>{var k=i=>{try{r(l.next(i))}catch(c){m(c)}},g=i=>{try{r(l.throw(i))}catch(c){m(c)}},r=i=>i.done?y(i.value):Promise.resolve(i.value).then(k,g);r((l=l.apply(C,h)).next())});const le=E({__name:"index",setup(C,{expose:h}){let l=M();const[y,{openModal:m}]=Y(),{prefixCls:k,tableContext:g,createMessage:r,createConfirm:i}=F({designScope:"online-cgreport-list",pagination:!0,tableProps:{title:"Online报表",api:X,rowKey:"id",columns:G,formConfig:{autoSubmitOnEnter:!0,showAdvancedButton:!0,schemas:j}}}),[c,{reload:_},{rowSelection:S,selectedRowKeys:w}]=g;function x(){m(!0,{isUpdate:!1,showFooter:!0})}function R(e){m(!0,{record:e,isUpdate:!0,showFooter:!0})}function T(e){return P(this,null,function*(){yield H({id:e.id},_)})}function $(){return P(this,null,function*(){yield J({ids:w.value},()=>{_(),w.value=[]})})}function B(){_()}function A(e){return[{label:"编辑",onClick:R.bind(null,e)}]}function I(e){return[{label:"功能测试",class:["low-app-hide"],onClick:()=>V(e.id)},{label:"配置地址",class:["low-app-hide"],onClick:()=>D(e)},{label:"删除",popConfirm:{title:"是否确认删除",confirm:T.bind(null,e)}}]}function V(e){l.push({path:"/online/cgreport/"+e})}function D(e){let b=e.id,s=`/online/cgreport/${b}`,u=`INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) 
                         VALUES ('${Z()}', NULL, '${e.name}', '${s}', '1', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 0, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', null, NULL, NULL, 0)`;z(b).then(o=>{let t="";if(o&&o.length>0)for(let f of o)t+=f.paramName+"=${"+f.paramName+"}&";t.length>0&&(t=t.substring(0,t.length-1),s+="?"+t)}).catch(()=>{r.warning("获取参数失败!")}).finally(()=>{i({iconType:"info",width:500,title:`菜单链接【${e.name}】`,content:s,closable:!0,maskClosable:!0,cancelText:"复制SQL",okText:"复制URL",cancelButtonProps:{class:"copy-this-sql","data-clipboard-text":u},okButtonProps:{class:"copy-this-text","data-clipboard-text":s},onOk(){return new Promise(o=>{const t=new N(".copy-this-text");t.on("success",()=>{t.destroy(),r.success("复制URL成功"),o()}),t.on("error",()=>{r.error("该浏览器不支持自动复制"),t.destroy(),o()})})},onCancel(){return new Promise(o=>{const t=new N(".copy-this-sql");t.on("success",()=>{t.destroy(),r.success("复制插入菜单SQL成功"),o()}),t.on("error",()=>{r.error("该浏览器不支持自动复制"),t.destroy(),o()})})}})})}return h({handleAdd:x}),(e,b)=>{const s=d("a-button"),u=d("Icon"),o=d("a-menu-item"),t=d("a-menu"),f=d("a-dropdown");return v(),O("div",null,[n(p(et),q({onRegister:p(c),rowSelection:p(S)},e.$attrs),{tableTitle:a(()=>[n(s,{preIcon:"ant-design:plus-outlined",type:"primary",onClick:x,style:{"margin-right":"5px"}},{default:a(()=>[L("录入")]),_:1}),p(w).length>0?(v(),K(f,{key:0},{overlay:a(()=>[n(t,null,{default:a(()=>[n(o,{key:"1",onClick:$},{default:a(()=>[n(u,{icon:"ant-design:delete-outlined"}),L(" 删除 ")]),_:1})]),_:1})]),default:a(()=>[n(s,null,{default:a(()=>[L("批量操作 "),n(u,{icon:"mdi:chevron-down"})]),_:1})]),_:1})):Q("",!0)]),action:a(({record:U})=>[n(p(tt),{actions:A(U),dropDownActions:I(U)},null,8,["actions","dropDownActions"])]),_:1},16,["onRegister","rowSelection"]),n(W,{onRegister:p(y),onSuccess:B},null,8,["onRegister"])])}}});export{le as default};
