ScopeSentry/static/assets/TreeTable-CErrWNU3.js

2 lines
2.6 KiB
JavaScript

import{_ as e}from"./ContentWrap.vue_vue_type_script_setup_true_lang-BgCcO80c.js";import{d as t,a,l,s as o,e as i,H as r,o as s,i as p,w as n,N as m,O as d,_ as c}from"./index-B4Nyjh3H.js";import{_ as u}from"./Table.vue_vue_type_script_lang-DkXax4KK.js";import{b}from"./index-B2RH5IwT.js";import{E as g}from"./el-tag-DS_6W9-f.js";import{u as f}from"./useTable-CG-SPGP0.js";import"./el-card-wk8kGoMw.js";import"./el-tooltip-l0sNRNKZ.js";import"./el-popper-DBt0ZFPB.js";import"./el-table-column-D5fUDOpn.js";import"./index-ThnV7dxG.js";import"./isEqual-DFD3TClT.js";import"./debounce-4WtFbZlf.js";import"./el-checkbox-DAPJr8Xi.js";import"./isArrayLikeObject-CWayLN3s.js";import"./raf-jjs8tbGM.js";import"./el-select-ErNzBCXo.js";import"./useInput-Drsa8fv-.js";import"./el-image-viewer-CLYRUyY9.js";import"./tsxHelper-TQdELaO0.js";import"./el-dropdown-item-BheZ-il5.js";import"./castArray-BrlE0VBR.js";import"./refs-CGmkSrb7.js";import"./index-xQ3iUQKd.js";import"./index-CdbOSPly.js";const j=c(t({__name:"TreeTable",setup(t){const{tableRegister:c,tableState:j}=f({fetchDataApi:async()=>{const{currentPage:e,pageSize:t}=j,l=await b({pageIndex:a(e),pageSize:a(t)});return{list:l.data.list,total:l.data.total}}}),{loading:_,dataList:y,total:x,currentPage:D,pageSize:v}=j,{t:w}=l(),S=o([{field:"selection",type:"selection"},{field:"index",label:w("tableDemo.index"),type:"index"},{field:"content",label:w("tableDemo.header"),children:[{field:"title",label:w("tableDemo.title")},{field:"author",label:w("tableDemo.author")},{field:"display_time",label:w("tableDemo.displayTime")},{field:"importance",label:w("tableDemo.importance"),formatter:(e,t,a)=>i(g,{type:1===a?"success":2===a?"warning":"danger"},{default:()=>[w(1===a?"tableDemo.important":2===a?"tableDemo.good":"tableDemo.commonly")]})},{field:"pageviews",label:w("tableDemo.pageviews")}]},{field:"action",label:w("tableDemo.action"),slots:{default:e=>{let t;return i(r,{type:"primary",onClick:()=>z(e)},"function"==typeof(a=t=w("tableDemo.action"))||"[object Object]"===Object.prototype.toString.call(a)&&!d(a)?t:{default:()=>[t]});var a}}}]),z=e=>{};return(t,l)=>(s(),p(a(e),{title:`${a(w)("router.treeTable")} ${a(w)("tableDemo.example")}`},{default:n((()=>[i(a(u),{pageSize:a(v),"onUpdate:pageSize":l[0]||(l[0]=e=>m(v)?v.value=e:null),currentPage:a(D),"onUpdate:currentPage":l[1]||(l[1]=e=>m(D)?D.value=e:null),columns:S,data:a(y),"row-key":"id",loading:a(_),sortable:"",pagination:{total:a(x)},onRegister:a(c)},null,8,["pageSize","currentPage","columns","data","loading","pagination","onRegister"])])),_:1},8,["title"]))}}),[["__scopeId","data-v-ef67ff34"]]);export{j as default};