mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-06 03:57:49 +08:00
2 lines
4.0 KiB
JavaScript
2 lines
4.0 KiB
JavaScript
import{y as p,z as d}from"./hooks-BhHffBS8.js";import"./dayjs@1.11.10-BYZwCyGy.js";import"./print-js@1.6.0-C3lAJnMa.js";import"./currency.js@2.0.4-9OAR_aOO.js";import"./awesome-qr@2.1.5-rc.0-Ds7AaOTE.js";import{a as c}from"./vue-hooks-plus@1.8.8_vue@3.4.21-CBeGMwb0.js";import{s}from"./instance-BsZCPX3D.js";import"./lodash@4.17.21-CM7ROh5r.js";import"./lodash-es@4.17.21-C8H4BJij.js";import"./@vueuse_core@10.9.0_vue@3.4.21-CShlBTir.js";import"./@vueuse_shared@10.9.0_vue@3.4.21-JDL3uqC1.js";import"./utils-Dx3WEey5.js";import"./js-cookie@3.0.5-Z_8Sd105.js";import"./screenfull@5.2.0-DuGDi0R7.js";import"./qs@6.11.2-5yoVYNs7.js";import"./side-channel@1.0.4-DiPXwnX9.js";import"./get-intrinsic@1.2.1-5uWIhZOj.js";import"./has-symbols@1.0.3-eVqrYdw7.js";import"./has-proto@1.0.1-CgulNy6r.js";import"./function-bind@1.1.2-B8G-TZ45.js";import"./has@1.0.3-B6xjtObm.js";import"./call-bind@1.0.2-BD5aDJOM.js";import"./interactjs@1.10.26-DmsZVOf4.js";import"./pinia-plugin-persistedstate@3.2.0_pinia@2.1.7-C45aYbGY.js";import"./dom-to-image@2.6.0-CaeIWam-.js";import"./echarts@5.5.0-BEyY33Zi.js";import"./zrender@5.5.0-JN1hODMT.js";import"./tslib@2.3.0-BDyQ-Jie.js";import"./@vue_runtime-core@3.4.21-DW3iHaBZ.js";import"./@vue_reactivity@3.4.21-8_tu8c_o.js";import"./@vue_shared@3.4.21-DCcVmNGw.js";import"./canvas@2.11.2-CVRTzJty.js";import"./js-binary-schema-parser@2.0.3-D0akQrQ7.js";const V=o=>s({url:"/api/list",method:"get",params:o}),Q=Vue.defineComponent({name:"MockDemo",setup(){const o=[{title:"id",key:"id"},{title:"邮箱",key:"email"},{title:"地址",key:"address"},{title:"姓名",key:"name"},{title:"年龄",key:"age"},{title:"创建时间",key:"createDate"},{title:"操作",key:"action",render:u=>Vue.createVNode(naive.NFlex,{align:"center"},{default:()=>[Vue.createVNode(naive.NButton,{type:"primary",text:!0,onClick:()=>{window.$message.info("查看")}},{default:()=>[Vue.createTextVNode("查看")]}),Vue.createVNode(naive.NButton,{type:"primary",text:!0,onClick:()=>{window.$message.warning("编辑")}},{default:()=>[Vue.createTextVNode("编辑")]}),Vue.createVNode(naive.NButton,{type:"error",text:!0,onClick:()=>{window.$message.error("删除")}},{default:()=>[Vue.createTextVNode("删除")]})]})}],t=Vue.reactive({email:null}),e=Vue.reactive({page:1,pageSize:10,itemCount:0,pageSizes:[10,20,30,40,50],showSizePicker:!0,onUpdatePage:u=>{e.page=u,a()},onUpdatePageSize:u=>{e.pageSize=u,e.page=1,a()}}),{data:i,loading:n,run:l}=c(V,{defaultParams:[{page:e.page,pageSize:e.pageSize,email:t.email}],onSuccess:u=>{const{total:r}=u;e.itemCount=r}}),a=()=>{const{pageSize:u,page:r}=e,{email:m}=t;l({page:r,pageSize:u,email:m})};return{personData:i,personLoading:n,paginationRef:e,columns:o,...Vue.toRefs(t),getPerson:a}},render(){return Vue.createVNode(naive.NFlex,{vertical:!0},{default:()=>{var o;return[Vue.createVNode(naive.NCard,{title:"Mock 数据"},{default:()=>[Vue.createVNode("h2",null,[Vue.createTextVNode("mock 数据使用。但是,并没有启用生产环境的部署,所以生产环境结果为空。")])]}),Vue.createVNode(naive.NCard,{title:"提示"},{default:()=>[Vue.createVNode("h2",null,[Vue.createTextVNode("RTable 组件有一个比较值得注意的地方就是,该组件会自动的按照数据量计算分页条数。所以你在异步获取数据的时候,一定要手动设置 remote 属性为 true,并且设置 itemCount 或者 pageCount。")])]}),Vue.createVNode(naive.NForm,{labelPlacement:"left"},{default:()=>[Vue.createVNode(p,{bordered:!1,cols:3},{default:()=>Vue.createVNode(Vue.Fragment,null,[Vue.createVNode(naive.NFormItemGi,{label:"邮箱"},{default:()=>[Vue.createVNode(naive.NInput,{value:this.email,"onUpdate:value":t=>this.email=t,clearable:!0},null)]})]),action:()=>Vue.createVNode(naive.NButton,{type:"primary",onClick:this.getPerson.bind(this)},{default:()=>[Vue.createTextVNode("搜索")]})})]}),Vue.createVNode(d,{title:"Mock数据表格",data:(o=this.personData)==null?void 0:o.data,loading:this.personLoading,columns:this.columns,"onUpdate:columns":t=>this.columns=t,pagination:this.paginationRef,remote:!0},null)]}})}});export{Q as default};
|