ray-template/js/index-CEq6_GG6.js

2 lines
7.8 KiB
JavaScript

import{a3 as $,Y as z,T as G,U as L,z as P,a4 as j}from"./hooks-DAFrMGjY.js";import{m as Y}from"./utils-Bic_iDtY.js";import"./currency.js@2.0.4-9OAR_aOO.js";import"./crypto-js@4.2.0-CXjOS6lk.js";import"./dayjs@1.11.13-BWvakrn1.js";import"./print-js@1.6.0-BptnCCm-.js";import"./jsbarcode@3.11.6-CfPZaUx-.js";import"./@logicflow_core@2.0.10-ofLqxMRW.js";import"./mobx-preact@3.0.0_mobx@5.15.7_preact@10.25.4-CFsMsPXj.js";import"./preact@10.25.4--QYavupV.js";import{N as D,e as n,ag as _,P as u,w as K,b as r,H as q,M as F,am as H,J as X,p as Q}from"./naive-ui@2.41.0_vue@3.5.13_typescript@5.6.3_-DW0tiym6.js";import{m as W,b as e,J as o,F as I,q as Z}from"./@vue_runtime-core@3.5.13-pPpmd6wL.js";import{k as x,e as ee,x as te}from"./@vue_reactivity@3.5.13-CVvlldVq.js";import"./lodash-es@4.17.21-BbYRMHep.js";import"./@vueuse_core@12.4.0_typescript@5.6.3-DzjsbTKf.js";import"./@vueuse_shared@12.4.0_typescript@5.6.3-BcXCAzGo.js";import"./vue-hooks-plus@2.2.3_vue@3.5.13_typescript@5.6.3_-F-c4u1GS.js";import"./lodash@4.17.21-Bv2ueefR.js";import"./call-bind-apply-helpers@1.0.1-BosuxZz1.js";import"./js-cookie@3.0.5-Z_8Sd105.js";import"./screenfull@5.2.0-CClqR5rE.js";import"./pinia-plugin-persistedstate@4.2.0_pinia@2.3.0_typescript@5.6.3_vue@3.5.13_typescript@5.6.3___rollup@4.31.0-7e9nenNP.js";import"./destr@2.0.3-Cx7WjB9q.js";import"./deep-pick-omit@1.2.1-B1UrSIxj.js";import"./pinia@2.3.0_typescript@5.6.3_vue@3.5.13_typescript@5.6.3_-D39uhmss.js";import"./html-to-image@1.11.11-D6_yziCT.js";import"./vue-router@4.4.0_vue@3.5.13_typescript@5.6.3_-Ddx7y29b.js";import"./@vue_runtime-dom@3.5.13-DJqlZTHq.js";import"./@vue_shared@3.5.13-CQ6Z-5d1.js";import"./interactjs@1.10.27-0Tgk5CYh.js";import"./vue-i18n@9.13.1_vue@3.5.13_typescript@5.6.3_-DQlA9smo.js";import"./@intlify_shared@9.13.1-BxU0OzX2.js";import"./@intlify_core-base@9.13.1-CVxc1Bsn.js";import"./@intlify_message-compiler@9.13.1-GrLDMuy_.js";import"./echarts@5.6.0-Dq866SEH.js";import"./zrender@5.6.1-B_T0sHVE.js";import"./tslib@2.3.0-BDyQ-Jie.js";import"./mobx@5.15.7-BvNiR7Ki.js";import"./uuid@9.0.1-CtRu48qb.js";import"./classnames@2.5.1-iH4Bdr9I.js";import"./mousetrap@1.6.5-C2A6yrpM.js";import"./mobx-utils@5.6.2_mobx@5.15.7-D4RSJWSh.js";import"./date-fns@3.6.0-CG906D2E.js";import"./seemly@0.3.9-BnJ6M8Cl.js";import"./vueuc@0.4.64_vue@3.5.13_typescript@5.6.3_-DZgPmxv3.js";import"./evtd@0.2.4-CI_DDEu_.js";import"./@css-render_vue3-ssr@0.15.14_vue@3.5.13_typescript@5.6.3_-DvmkD8RF.js";import"./vooks@0.2.12_vue@3.5.13_typescript@5.6.3_-rG9g4GjQ.js";import"./vdirs@0.1.8_vue@3.5.13_typescript@5.6.3_-C0KV5pCE.js";import"./@juggle_resize-observer@3.4.0-DY95s5UV.js";import"./css-render@0.15.14-BwokE0u2.js";import"./@emotion_hash@0.8.0-WldOFDRm.js";import"./treemate@0.3.11-CWtmm0QO.js";import"./date-fns-tz@3.2.0_date-fns@3.6.0-CULxTaQG.js";import"./async-validator@4.2.5-P8scd9xB.js";import"./@css-render_plugin-bem@0.15.14_css-render@0.15.14-BrMTnGYY.js";function N(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!Z(i)}const at=W({name:"TableView",setup(){const[i,{getTableInstance:c,clearFilters:p,clearSorter:m,scrollTo:f,filters:C,sort:k,downloadCsv:y,print:h}]=$(),b=[{type:"selection"},{title:"Name",key:"name",filterOptions:[{label:"John Brown",value:"John Brown"},{label:"Jim Green",value:"Jim Green"}],filter:(t,a)=>a.name.includes(t.toString())},{title:"Age",key:"age",sorter:(t,a)=>t.age-a.age},{title:"Address",key:"address"},{title:"Tags",key:"tags",render:t=>t.tags.map(d=>e(K,{type:"info",bordered:!1,style:"margin-right: 6px"},N(d)?d:{default:()=>[d]}))},{title:"Remark",key:"remark"},{title:"Action",key:"actions",render:t=>e(n,{align:"center"},{default:()=>[e(u,{size:"tiny"},{default:()=>[o("查看")]}),e(j,{options:[{label:"编辑",key:"edit"},{label:"新增",key:"add"}],onSelect:a=>{window.$message.info(`当前选择: ${a}`)}},null)]})}],w=x([...b].map((t,a)=>({...t}))),s=x([]),g=[{label:"编辑",key:"edit"},{label:()=>e("span",{style:"color: red;"},[o("删除")]),key:"delete"}],E=ee({gridItemCount:4,gridCollapsedRows:1,tableLoading:!1}),[T,{checkedRowKeysBind:B,getKeys:R,getRows:l,clearKey:v,clearAll:A,selectKey:S}]=z(s,w,{rowKey:"key",onChange:(t,a,d)=>{}}),J=()=>{for(let t=0;t<10;t++)s.value.push({key:Y(),name:t%2===0?"John Brown":"Jim Green",age:t+20,address:"New York No. 1 Lake Park",tags:["nice","developer"],remark:"我是一条很长很长的备注"})},M=t=>{window.$message.info(`${t}`)},O=()=>{const{key:t}=s.value[1];v(t)},U=()=>{s.value.map(a=>a.key).forEach(a=>S(a))},V=()=>{const{key:t}=s.value[1];S(t)};return J(),{...te(E),tableData:s,actionColumns:w,baseColumns:b,tableMenuOptions:g,menuSelect:M,register:i,getKeys:R,getRows:l,clearKey:v,clearAll:A,checkedRowKeysBind:B,checkedRowKeys:T,clearSecondIndexRow:O,selectAll:U,selectSecondIndexRow:V,clearFilters:p,clearSorter:m,scrollTo:f,filters:C,sort:k,downloadCsv:y,getTableInstance:c,print:h}},render(){let i;const{register:c,clearAll:p,checkedRowKeysBind:m,clearSecondIndexRow:f,selectAll:C,selectSecondIndexRow:k,clearFilters:y,clearSorter:h,scrollTo:b,filters:w,sort:s,downloadCsv:g,getTableInstance:E,getRows:T,getKeys:B,print:R}=this;return e(n,{vertical:!0},{default:()=>[e(D,{title:"RTable"},{default:()=>[o("基于 NDataTable 封装,继承该组件所有 props 属性。查看 RTable props 文件即可查看该组件拓展项")]}),e(D,{title:"useTable"},{default:()=>[e(n,{vertical:!0,style:"width: 100%"},{default:()=>[e(_,{title:"DataTable Methods",type:"info"},{default:()=>[o("其余的方法查看")," ",e("a",{style:"color: transparent",href:"https://www.naiveui.com/zh-CN/dark/components/data-table#DataTable-Methods"},[o("Naive UI")]),o("官网,保持一致。")]}),e(n,null,{default:()=>[e(u,{onClick:h.bind(this)},{default:()=>[o("清除所有排序")]}),e(u,{onClick:y.bind(this)},{default:()=>[o("清除所有过滤")]}),e(u,{onClick:()=>{g()}},{default:()=>[o("下载 CSV")]}),e(u,{onClick:()=>E()},{default:()=>[o("getTableInstance")]}),e(u,{onClick:()=>R()},{default:()=>[o("打印")]})]})]})]}),e(D,{title:"useCheckedRowKeys"},{default:()=>[e(n,{vertical:!0},{default:()=>[e(n,null,{default:()=>[e(u,{onClick:C.bind(this)},{default:()=>[o("选中所有行")]}),e(u,{onClick:p.bind(this)},{default:()=>[o("取消所有已选中行")]}),e(u,{onClick:k.bind(this)},{default:()=>[o("选中第二行")]}),e(u,{onClick:f.bind(this)},{default:()=>[o("取消第二行选中")]})]}),e(n,null,N(i=this.checkedRowKeys.map(l=>e(K,{type:"success",key:l},N(l)?l:{default:()=>[l]})))?i:{default:()=>[i]})]})]}),e(G,{collapsedRows:this.gridCollapsedRows,cols:this.gridItemCount,onUpdateOpen:l=>window.$message.info(`我是 RCollapse 组件${l?"收起":"展开"}的回调函数`)},{action:()=>e(I,null,[e(u,{type:"primary"},{default:()=>[o("搜索")]}),e(u,null,{default:()=>[o("重置")]})]),default:()=>e(I,null,[e(r,null,{default:()=>[e(q,null,null)]}),e(r,null,{default:()=>[e(F,null,null)]}),e(r,null,{default:()=>[e(H,{type:"datetimerange",clearable:!0},null)]}),e(r,null,{default:()=>[e(F,null,null)]}),e(r,null,{default:()=>[e(F,null,null)]})])}),e(L,{checkedRowKeys:this.checkedRowKeys,"onUpdate:checkedRowKeys":l=>this.checkedRowKeys=l,onUpdateCheckedRowKeys:m.bind(this),onRegister:c.bind(this),scrollX:1e3,title:e(n,{align:"center"},{default:()=>[e("span",null,[o("标题插槽:")]),e(X,{onUpdateValue:l=>this.tableLoading=l},null)]}),data:this.tableData,columns:this.actionColumns,"onUpdate:columns":l=>this.actionColumns=l,pagination:{pageSize:10},contextMenuOptions:this.tableMenuOptions,loading:this.tableLoading,onContextMenuClick:this.menuSelect.bind(this),toolOptions:[e(Q,null,{trigger:()=>e(P,{name:"search",size:"18",cursor:"pointer",onClick:()=>{window.$message.info("点击了搜索按钮")}},null),default:()=>"我是自定义工具栏示例"})],rowKey:l=>l.key,striped:!0},{tableFooter:()=>"表格的底部内容区域插槽,有时候你可能会用上",tableAction:()=>"表格的操作区域内容插槽,有时候可能会用上"})]})}});export{at as default};