@wetspace/pro-components
Version:
::: tip 基本介绍
2 lines (1 loc) • 8.06 kB
JavaScript
;Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("element-plus"),w=require("../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.12_typescript@5.4.2_/node_modules/@element-plus/icons-vue/dist/index.js"),h={class:"check-all__inner"},V={class:"cols__inner"},g=e.defineComponent({__name:"tool-icon",props:{size:String,columns:{type:Array,default(){return[]}},initColumns:{type:Array,default(){return[]}}},emits:["refresh","update:size","tools","update:columns"],setup(f,{emit:m}){const r=a.useNamespace("tabel-tools"),d=e.shallowRef(!0),p=e.computed(()=>!(n.columns.length!==0&&n.columns.length===n.initColumns.length||n.columns.length===0)),u=()=>{const o=n.initColumns.map(t=>Array.isArray(t.dataIndex)?t.dataIndex.join(""):t.dataIndex);s("update:columns",o)},v=o=>{o?u():s("update:columns",[]),d.value=o},s=m,n=f,i=o=>{s("update:size",o)},x=()=>s("refresh"),C=o=>{s("update:columns",o)};return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(r).b()])},[e.createVNode(e.unref(a.ElIcon),{class:"table-tool-icon",onClick:x},{default:e.withCtx(()=>[e.createVNode(e.unref(w.RefreshRight))]),_:1}),e.createVNode(e.unref(a.ElDropdown),{trigger:"click",class:"table-tool-icon"},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(a.ElDropdownMenu),null,{default:e.withCtx(()=>[e.createVNode(e.unref(a.ElDropdownItem),{class:e.normalizeClass([e.unref(r).e("toolsizeitem"),e.unref(r).is("actived",n.size==="default")]),onClick:t[0]||(t[0]=l=>i("default"))},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode(" 默认 ")])),_:1},8,["class"]),e.createVNode(e.unref(a.ElDropdownItem),{class:e.normalizeClass([e.unref(r).e("toolsizeitem"),e.unref(r).is("actived",n.size==="large")]),onClick:t[1]||(t[1]=l=>i("large"))},{default:e.withCtx(()=>t[6]||(t[6]=[e.createTextVNode(" 宽松 ")])),_:1},8,["class"]),e.createVNode(e.unref(a.ElDropdownItem),{class:e.normalizeClass([e.unref(r).e("toolsizeitem"),e.unref(r).is("actived",n.size==="small")]),onClick:t[2]||(t[2]=l=>i("small"))},{default:e.withCtx(()=>t[7]||(t[7]=[e.createTextVNode(" 紧凑 ")])),_:1},8,["class"])]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(a.ElIcon),{size:14},{default:e.withCtx(()=>t[4]||(t[4]=[e.createElementVNode("svg",{t:"1716079659980",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1502",width:"200",height:"200"},[e.createElementVNode("path",{d:"M815 72.7H214.9c-22.3 0-40.3 18.1-40.3 40.3v4.9c0 22.3 18.1 40.3 40.3 40.3H815c22.3 0 40.3-18.1 40.3-40.3V113c0-22.2-18-40.3-40.3-40.3zM815 893.4H214.9c-22.3 0-40.3 18.1-40.3 40.3v4.9c0 22.3 18.1 40.3 40.3 40.3H815c22.3 0 40.3-18.1 40.3-40.3v-4.9c0-22.2-18-40.3-40.3-40.3zM408.8 708.8l53.1 76.2 53 76.1L568 785l53-76.2h-63.2v-370H621l-53-70.9-53.1-71-53 71-53.1 70.9h63.4v370z","p-id":"1503"})],-1)])),_:1})]),_:1}),e.createVNode(e.unref(a.ElPopover),{trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(e.unref(a.ElIcon),{class:"table-tool-icon"},{default:e.withCtx(()=>t[8]||(t[8]=[e.createElementVNode("svg",{t:"1716079862322",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6939",width:"200",height:"200"},[e.createElementVNode("path",{d:"M577.173333 138.666667v38.986666A92.8 92.8 0 0 0 629.333333 260.693333a276.106667 276.106667 0 0 1 37.92 22.293334 91.733333 91.733333 0 0 0 99.04 4.266666l32.693334-19.04 65.706666 114.773334-33.493333 19.52a92.693333 92.693333 0 0 0-45.386667 87.413333c0.693333 7.84 1.013333 15.093333 1.013334 22.08s-0.32 14.24-1.013334 22.08a92.693333 92.693333 0 0 0 45.386667 87.413333l33.493333 19.52-65.706666 114.773334-32.693334-19.04a91.733333 91.733333 0 0 0-99.04 4.266666 276.106667 276.106667 0 0 1-37.92 22.293334 92.8 92.8 0 0 0-52.266666 83.04V885.333333H446.826667v-38.986666A92.8 92.8 0 0 0 394.666667 763.306667a276.106667 276.106667 0 0 1-37.92-22.293334 91.733333 91.733333 0 0 0-99.04-4.266666l-32.693334 19.04-65.813333-114.773334 33.493333-19.52a92.693333 92.693333 0 0 0 45.386667-87.413333c-0.693333-7.84-1.013333-15.093333-1.013333-22.08s0.32-14.24 1.013333-22.08a92.693333 92.693333 0 0 0-45.386667-87.413333l-33.493333-19.52 65.706667-114.773334 32.693333 19.04a91.733333 91.733333 0 0 0 99.04-4.266666A276.106667 276.106667 0 0 1 394.666667 260.693333a92.8 92.8 0 0 0 52.266666-83.04V138.666667h130.346667M512 692.48a182.08 182.08 0 0 0 40.426667-4.533333 178.826667 178.826667 0 0 0 134.666666-135.573334 181.333333 181.333333 0 0 0-35.36-153.653333A178.453333 178.453333 0 0 0 512 331.52a182.08 182.08 0 0 0-40.426667 4.533333 178.826667 178.826667 0 0 0-134.666666 135.573334 181.333333 181.333333 0 0 0 35.36 153.653333 178.453333 178.453333 0 0 0 139.733333 67.2M634.666667 64H389.6a17.546667 17.546667 0 0 0-17.44 17.6v96a17.546667 17.546667 0 0 1-10.026667 16 352.746667 352.746667 0 0 0-48.32 28.373333 17.6 17.6 0 0 1-9.813333 3.093334 17.013333 17.013333 0 0 1-8.533333-2.346667l-82.666667-48a17.12 17.12 0 0 0-8.693333-2.4A17.386667 17.386667 0 0 0 188.746667 181.333333l-122.666667 213.866667a17.706667 17.706667 0 0 0 6.4 24.053333l82.346667 48a17.493333 17.493333 0 0 1 8.533333 16.746667c-0.746667 9.333333-1.226667 18.72-1.226667 28.266667s0.48 18.933333 1.226667 28.266666a17.6 17.6 0 0 1-8.533333 16.746667l-82.346667 48a17.706667 17.706667 0 0 0-6.4 24.053333l122.666667 213.866667a17.333333 17.333333 0 0 0 15.093333 8.8 17.066667 17.066667 0 0 0 8.693333-2.346667l82.666667-48a16.48 16.48 0 0 1 8.533333-2.346666 17.6 17.6 0 0 1 10.08 3.253333 352.746667 352.746667 0 0 0 48.32 28.373333 17.546667 17.546667 0 0 1 10.026667 16v96a17.546667 17.546667 0 0 0 17.44 17.6H634.666667a17.546667 17.546667 0 0 0 17.44-17.6v-96a17.546667 17.546667 0 0 1 10.026666-16 352.746667 352.746667 0 0 0 48.32-28.373333 17.6 17.6 0 0 1 10.08-3.253333 16.48 16.48 0 0 1 8.533334 2.346666l82.666666 48a17.066667 17.066667 0 0 0 8.693334 2.346667 17.333333 17.333333 0 0 0 15.093333-8.8l122.133333-213.866667a17.706667 17.706667 0 0 0-6.4-24.053333l-82.346666-48a17.6 17.6 0 0 1-8.533334-16.746667c0.746667-9.333333 1.226667-18.72 1.226667-28.266666s-0.48-18.933333-1.226667-28.266667a17.493333 17.493333 0 0 1 8.533334-16.746667l82.346666-48a17.706667 17.706667 0 0 0 6.4-24.053333L835.253333 181.333333a17.386667 17.386667 0 0 0-15.093333-8.853333 17.12 17.12 0 0 0-8.693333 2.4l-82.666667 48a17.013333 17.013333 0 0 1-8.533333 2.346667 17.6 17.6 0 0 1-10.08-3.253334 352.746667 352.746667 0 0 0-48.32-28.373333 17.546667 17.546667 0 0 1-10.026667-16v-96A17.546667 17.546667 0 0 0 634.666667 64zM512 617.813333a105.973333 105.973333 0 0 1-24-208.96 109.973333 109.973333 0 0 1 24-2.666666 105.973333 105.973333 0 0 1 24 208.96 109.973333 109.973333 0 0 1-24 2.666666z","p-id":"6940"})],-1)])),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(r).e("cols-display")])},[e.createElementVNode("div",h,[e.createVNode(e.unref(a.ElCheckbox),{modelValue:d.value,"onUpdate:modelValue":t[3]||(t[3]=l=>d.value=l),indeterminate:p.value,onChange:v},{default:e.withCtx(()=>t[9]||(t[9]=[e.createTextVNode(" 列展示 ")])),_:1},8,["modelValue","indeterminate"]),e.createVNode(e.unref(a.ElButton),{link:"",type:"primary",onClick:u},{default:e.withCtx(()=>t[10]||(t[10]=[e.createTextVNode(" 重置 ")])),_:1})]),e.createElementVNode("div",V,[e.createVNode(e.unref(a.ElCheckboxGroup),{"model-value":n.columns,onChange:C},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.initColumns,(l,c)=>(e.openBlock(),e.createBlock(e.unref(a.ElCheckbox),{key:Array.isArray(l.dataIndex)?l.dataIndex.join(""):l.dataIndex,disabled:c===0||c===n.initColumns.length-1,label:Array.isArray(l.dataIndex)?l.dataIndex.join(""):l.dataIndex,value:Array.isArray(l.dataIndex)?l.dataIndex.join(""):l.dataIndex},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.label||l.title),1)]),_:2},1032,["disabled","label","value"]))),128))]),_:1},8,["model-value"])])],2)]),_:1})],2))}});exports.default=g;