index.da2cc534.js 3.6 KB

123
  1. import{e as b,r as D,G as T,aj as I,a0 as s,ae as N,g as h,h as _,A as o,q as f,t as V,j as l,z as p,x as L,y as B,aE as E,aF as j}from"./vue.e266cb73.js";import{ad as z}from"./index.dcc65bf7.js";import{_ as M}from"./_plugin-vue_export-helper.c27b6911.js";import"./index.f84209b0.js";const u=n=>(E("data-v-5653ef7f"),n=n(),j(),n),P={class:"tree-container layout-pd"},R={class:"tree-head"},U={class:"tree-head-check"},q=u(()=>l("div",{class:"tree-head-one"},"商品 ID",-1)),F=u(()=>l("div",{style:{flex:"1",display:"flex"}},[l("div",{class:"tree-head-two"},"商品名称"),l("div",{class:"tree-head-three"},"描述")],-1)),G={class:"tree-custom-node"},K={style:{flex:"1"}},H={key:0,style:{flex:"1",display:"flex"}},J={style:{flex:"1"}},O={style:{flex:"1"}},Q=b({name:"pagesTree"}),W=b({...Q,setup(n){const t=D(),e=T({treeCheckAll:!1,treeLoading:!1,treeTableData:[],treeDefaultProps:{children:"children",label:"label"},treeSelArr:[],treeLength:0}),g=r=>{let a=0;r.map(c=>{c.children&&(a+=c.children.length)}),e.treeLength=a+r.length},v=()=>{e.treeCheckAll?t.value.setCheckedNodes(e.treeTableData):t.value.setCheckedKeys([])},m=()=>{e.treeSelArr=[],e.treeSelArr=t.value.getCheckedNodes(),e.treeSelArr.length==e.treeLength?e.treeCheckAll=!0:e.treeCheckAll=!1},k=()=>{if(t.value.getCheckedNodes().length<=0){z.warning("请选择元素");return}},x=()=>{e.treeTableData=[{id:1,label:"12987121",label1:"好滋好味鸡蛋仔",label2:"荷兰优质淡奶,奶香浓而不腻",isShow:!0,children:[{id:11,label:"一级 1-1",label1:"好滋好味鸡蛋仔",label2:"荷兰优质淡奶,奶香浓而不腻",isShow:!1},{id:12,label:"一级 1-2",label1:"好滋好味鸡蛋仔",label2:"荷兰优质淡奶,奶香浓而不腻",isShow:!1}]},{id:2,label:"12987122",label1:"好滋好味鸡蛋仔",label2:"荷兰优质淡奶,奶香浓而不腻",isShow:!0,children:[{id:21,label:"二级 2-1",label1:"好滋好味鸡蛋仔",label2:"荷兰优质淡奶,奶香浓而不腻",isShow:!1},{id:22,label:"二级 2-2",label1:"好滋好味鸡蛋仔",label2:"荷兰优质淡奶,奶香浓而不腻",isShow:!1}]},{id:3,label:"12987123",label1:"好滋好味鸡蛋仔",label2:"荷兰优质淡奶,奶香浓而不腻",isShow:!0,children:[{id:31,label:"二级 3-1",label1:"好滋好味鸡蛋仔",label2:"荷兰优质淡奶,奶香浓而不腻",isShow:!1},{id:32,label:"二级 3-2",label1:"好滋好味鸡蛋仔",label2:"荷兰优质淡奶,奶香浓而不腻",isShow:!1},{id:33,label:"二级 3-3",label1:"好滋好味鸡蛋仔",label2:"荷兰优质淡奶,奶香浓而不腻",isShow:!1}]}],g(e.treeTableData)};return I(()=>{x()}),(r,a)=>{const c=s("el-checkbox"),S=s("el-tree"),C=s("SvgIcon"),w=s("el-button"),y=s("el-card"),A=N("loading");return h(),_("div",P,[o(y,{shadow:"hover",header:"element plus Tree 树形控件改成表格"},{default:f(()=>[V((h(),_("div",null,[l("div",R,[l("div",U,[o(c,{modelValue:e.treeCheckAll,"onUpdate:modelValue":a[0]||(a[0]=i=>e.treeCheckAll=i),onChange:v},null,8,["modelValue"])]),q,F]),o(S,{data:e.treeTableData,"show-checkbox":"","node-key":"id",ref_key:"treeTableRef",ref:t,props:e.treeDefaultProps,onCheck:m},{default:f(({node:i,data:d})=>[l("span",G,[l("span",K,p(i.label),1),d.isShow?(h(),_("span",H,[l("span",J,p(d.label1),1),l("span",O,p(d.label2),1)])):L("v-if",!0)])]),_:1},8,["data","props"])])),[[A,e.treeLoading]]),o(w,{onClick:k,class:"mt15",size:"default",type:"primary"},{default:f(()=>[o(C,{name:"iconfont icon-shuxingtu"}),B(" 选择元素 ")]),_:1})]),_:1})])}}});const ee=M(W,[["__scopeId","data-v-5653ef7f"],["__file","C:/Users/89282/Desktop/lechang_storage/lechang_storage/vue-next-admin/src/views/pages/tree/index.vue"]]);export{ee as default};
  2. //# sourceMappingURL=index.da2cc534.js.map