wtsk-comps 1.2.4 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/wtsk-comps.cjs.js +1 -1
- package/dist/wtsk-comps.css +1 -0
- package/dist/wtsk-comps.es.js +669 -45
- package/dist/wtsk-comps.umd.js +1 -1
- package/package.json +5 -14
- package/dist/types/index.d.ts +0 -1
package/README.md
CHANGED
package/dist/wtsk-comps.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=e.defineComponent({name:"WtskBtn",inheritAttrs:!1,__name:"WtskBtn",props:{onClick:{type:Function},size:{},disabled:{type:Boolean},type:{},icon:{},nativeType:{},loading:{type:Boolean},loadingIcon:{},plain:{type:Boolean},text:{type:Boolean},link:{type:Boolean},bg:{type:Boolean},autofocus:{type:Boolean},round:{type:Boolean},circle:{type:Boolean},color:{},dark:{type:Boolean},autoInsertSpace:{type:Boolean},tag:{}},setup(t){const o=t,s=e.useAttrs(),n=e.ref(!1),i=e.computed(()=>({...Object.fromEntries(Object.entries(o).filter(([a])=>a!=="onClick")),...s}));async function c(){n.value=!0;try{typeof o.onClick=="function"&&await o.onClick?.()}finally{n.value=!1}}return(l,a)=>{const p=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(p,e.mergeProps(i.value,{loading:n.value,onClick:c}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["loading"])}}}),u={install(t){t.component("WtskBtn",r)}};exports.WtskBtn=r;exports.default=u;
|
|
1
|
+
"use strict";const e=require("vue"),V=require("element-plus"),x={name:"WtskBtn"},N=Object.assign(x,{name:"WtskBtn",inheritAttrs:!1},{setup(r){const m=e.useAttrs(),f=e.ref(!1);function h(p,k){const a={};for(const g in p)g!==k&&(a[g]=p[g]);return a}async function i(){var p;f.value=!0;try{await((p=m.onClick)==null?void 0:p.call(m))}finally{f.value=!1}}return(p,k)=>{const a=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(a,e.mergeProps(h(p.$attrs,"onClick"),{loading:f.value,onClick:i}),{default:e.withCtx(()=>[e.renderSlot(p.$slots,"default")]),_:3},16,["loading"])}}});/*! Element Plus Icons Vue v2.3.2 */var E=e.defineComponent({name:"Delete",__name:"delete",setup(r){return(m,f)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),S=E,P=e.defineComponent({name:"Edit",__name:"edit",setup(r){return(m,f)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),e.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),b=P,T=e.defineComponent({name:"Plus",__name:"plus",setup(r){return(m,f)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),_=T;const F={class:"wtsk-tree-box"},z={key:0,class:"wtsk-tree-box-title"},$={key:1,class:"wtsk-tree-box-filter wtsk-form"},H={style:{display:"flex","align-items":"center"},class:"wtsk-form"},M={class:"wtsk-tree-box-tree-custom"},O={style:{display:"flex","align-items":"center"},class:"wtsk-form"},U={style:{display:"flex","align-items":"center"},class:"wtsk-form"},A={name:"WtskTree"},R=Object.assign(A,{name:"WtskTree",inheritAttrs:!1},{props:{treeTitle:{type:String,default:""},treeHasFilter:{type:Boolean,default:!1},treeFilterType:{type:String,default:"default"},treeHasOperate:{type:Boolean,default:!1},treeCustomizeOperate:{type:Boolean,default:!1},treeAddParentText:{type:String,default:"新增一级"}},emits:["treeOperate"],setup(r,{expose:m,emit:f}){const h=e.useAttrs(),i=r,p=e.ref();let k=e.ref(""),a=e.ref("");const g=f;e.watch(k,o=>{var l;(l=p.value)==null||l.filter(o)});function s(o,l,u){var y;if(!o)return!0;const n=l.label?l.label:(y=h.props)==null?void 0:y.label;if(i.treeFilterType==="default")return l[n].includes(o);{let w=[];v(u,w,o,n);let B=!1;return w.forEach(t=>{B=B||t}),B}}function v(o,l,u,n){let y=o.data&&o.data[n]&&o.data[n].includes(u);y&&l.push(y),!y&&o.level!==1&&o.parent&&v(o.parent,l,u,n)}function d(o,l,u){i.treeCustomizeOperate||o==="delete"?g("treeOperate",o,l,u):a.value.trim()!==""?(document.documentElement.click(),g("treeOperate",o,l,u,a.value)):V.ElMessage.error("名称不能为空!")}return m({wtskTreeRef:p}),(o,l)=>{const u=e.resolveComponent("el-input"),n=e.resolveComponent("el-button"),y=e.resolveComponent("el-popover"),w=e.resolveComponent("el-popconfirm"),B=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",F,[r.treeTitle!==""?(e.openBlock(),e.createElementBlock("div",z,e.toDisplayString(r.treeTitle),1)):e.createCommentVNode("",!0),r.treeHasFilter||r.treeHasOperate?(e.openBlock(),e.createElementBlock("div",$,[r.treeHasFilter?(e.openBlock(),e.createBlock(u,{key:0,modelValue:e.unref(k),"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(k)?k.value=t:k=t),placeholder:"输入名称进行筛选……",clearable:""},null,8,["modelValue"])):e.createCommentVNode("",!0),r.treeCustomizeOperate?(e.openBlock(),e.createBlock(n,{key:2,type:"primary",onClick:l[4]||(l[4]=t=>d("addParent"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.treeAddParentText),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[r.treeHasOperate?(e.openBlock(),e.createBlock(y,{key:0,placement:"bottom",width:280,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(n,{type:"primary",onClick:l[1]||(l[1]=t=>e.isRef(a)?a.value="":a="")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.treeAddParentText),1)]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(u,{modelValue:e.unref(a),"onUpdate:modelValue":l[2]||(l[2]=t=>e.isRef(a)?a.value=t:a=t),placeholder:"请输入名称",clearable:""},null,8,["modelValue"]),e.createVNode(n,{type:"primary",style:{"margin-left":"10px"},onClick:l[3]||(l[3]=e.withModifiers(t=>d("addParent"),["stop"]))},{default:e.withCtx(()=>[...l[9]||(l[9]=[e.createTextVNode("新增",-1)])]),_:1})])]),_:1})):e.createCommentVNode("",!0)],64))])):e.createCommentVNode("",!0),e.createVNode(B,e.mergeProps({ref_key:"wtskTreeRef",ref:p,class:"wtsk-tree wtsk-tree-box-tree"},{"node-key":"id","highlight-current":!0,"default-expand-all":!0,"expand-on-click-node":!1,"check-on-click-leaf":!1,...o.$attrs},{"filter-node-method":s}),e.createSlots({_:2},[r.treeHasOperate?{name:"default",fn:e.withCtx(({node:t,data:c})=>[e.createElementVNode("div",M,[e.createElementVNode("div",null,e.toDisplayString(t.label),1),e.createElementVNode("div",null,[r.treeCustomizeOperate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(n,{type:"success",link:"",icon:e.unref(_),onClick:e.withModifiers(C=>d("add",c,t),["stop"])},null,8,["icon","onClick"]),e.createVNode(n,{type:"primary",link:"",icon:e.unref(b),onClick:e.withModifiers(C=>d("edit",c,t),["stop"])},null,8,["icon","onClick"])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(y,{placement:"bottom",width:280,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(n,{type:"success",link:"",icon:e.unref(_),onClick:l[5]||(l[5]=e.withModifiers(C=>e.isRef(a)?a.value="":a="",["stop"]))},null,8,["icon"])]),default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(u,{modelValue:e.unref(a),"onUpdate:modelValue":l[6]||(l[6]=C=>e.isRef(a)?a.value=C:a=C),placeholder:"请输入名称",clearable:""},null,8,["modelValue"]),e.createVNode(n,{type:"primary",style:{"margin-left":"10px"},onClick:e.withModifiers(C=>d("add",c,t),["stop"])},{default:e.withCtx(()=>[...l[10]||(l[10]=[e.createTextVNode("新增",-1)])]),_:1},8,["onClick"])])]),_:2},1024),e.createVNode(y,{placement:"bottom",width:280,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(n,{type:"primary",link:"",icon:e.unref(b),onClick:e.withModifiers(C=>e.isRef(a)?a.value=t.label:a=t.label,["stop"])},null,8,["icon","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",U,[e.createVNode(u,{modelValue:e.unref(a),"onUpdate:modelValue":l[7]||(l[7]=C=>e.isRef(a)?a.value=C:a=C),placeholder:"请输入名称",clearable:""},null,8,["modelValue"]),e.createVNode(n,{type:"primary",style:{"margin-left":"10px"},onClick:e.withModifiers(C=>d("edit",c,t),["stop"])},{default:e.withCtx(()=>[...l[11]||(l[11]=[e.createTextVNode("修改",-1)])]),_:1},8,["onClick"])])]),_:2},1024)],64)),e.createVNode(w,{title:"确定删除这条数据吗?","hide-icon":"",width:"170",onConfirm:C=>d("delete",c,t)},{reference:e.withCtx(()=>[e.createVNode(n,{type:"danger",link:"",icon:e.unref(S),onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},null,8,["icon"])]),_:1},8,["onConfirm"])])])]),key:"0"}:void 0]),1040)])}}}),W={name:"WtskForm"},D=Object.assign(W,{name:"WtskForm",inheritAttrs:!1},{props:e.mergeModels({formIsSearch:{type:Boolean,default:!1},formItems:{type:Array,default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(r,{expose:m}){const f=r,h=e.computed(()=>f.formItems.filter(s=>!s.hidden)),i=e.useModel(r,"modelValue"),p={input:V.ElInput,number:V.ElInputNumber,select:V.ElSelect,date:V.ElDatePicker,switch:V.ElSwitch,treeSelect:V.ElTreeSelect};function k(s,v){if(!s||typeof s!="object"||!v)return;const d=v.split(".");let o=s;for(const l of d){if(o===null||!(l in o))return;o=o[l]}return o}function a(s,v,d){if(!s||typeof s!="object"||!v)return;const o=v.split(".");let l=s;for(let u=0;u<o.length-1;u++){const n=o[u];if((l[n]===null||typeof l[n]!="object"&&l[n]!==void 0)&&(l[n]={}),!(n in l))return;l=l[n]}l[o[o.length-1]]=d}const g=e.ref();return m({wtskFormRef:g}),(s,v)=>{const d=e.resolveComponent("el-radio"),o=e.resolveComponent("el-radio-group"),l=e.resolveComponent("el-checkbox"),u=e.resolveComponent("el-checkbox-group"),n=e.resolveComponent("el-form-item"),y=e.resolveComponent("el-col"),w=e.resolveComponent("el-row"),B=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(B,e.mergeProps({ref_key:"wtskFormRef",ref:g,class:["wtsk-form",r.formIsSearch?"wtsk-form-search":""]},{"label-width":r.formIsSearch?"auto":"100px",...s.$attrs},{model:i.value}),{default:e.withCtx(()=>[r.formIsSearch?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,t=>(e.openBlock(),e.createBlock(n,{key:t.prop,label:t.label,prop:t.prop},{default:e.withCtx(()=>[e.renderSlot(s.$slots,t.prop,{},()=>[t.type==="radio"||t.type==="checkbox"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="radio"?(e.openBlock(),e.createBlock(o,{key:0,modelValue:i.value[t.prop],"onUpdate:modelValue":c=>i.value[t.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,c=>(e.openBlock(),e.createBlock(d,{value:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.type==="checkbox"?(e.openBlock(),e.createBlock(u,{key:1,modelValue:i.value[t.prop],"onUpdate:modelValue":c=>i.value[t.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,c=>(e.openBlock(),e.createBlock(l,{label:c.label,value:c.value},null,8,["label","value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p[t.type]),e.mergeProps({key:1,ref_for:!0},t.props,{"model-value":k(i.value,t.prop),"onUpdate:modelValue":c=>a(i.value,t.prop,c)}),null,16,["model-value","onUpdate:modelValue"]))])]),_:2},1032,["label","prop"]))),128)),e.createVNode(n,null,{default:e.withCtx(()=>[e.renderSlot(s.$slots,"formSearchBtn")]),_:3})],64)):(e.openBlock(),e.createBlock(w,{key:1,gutter:16},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,t=>(e.openBlock(),e.createBlock(y,{key:t.prop,span:t.span||24},{default:e.withCtx(()=>[e.createVNode(n,{label:t.label,prop:t.prop},{default:e.withCtx(()=>[e.renderSlot(s.$slots,t.prop,{},()=>[t.type==="radio"||t.type==="checkbox"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="radio"?(e.openBlock(),e.createBlock(o,{key:0,modelValue:i.value[t.prop],"onUpdate:modelValue":c=>i.value[t.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,c=>(e.openBlock(),e.createBlock(d,{value:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.type==="checkbox"?(e.openBlock(),e.createBlock(u,{key:1,modelValue:i.value[t.prop],"onUpdate:modelValue":c=>i.value[t.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,c=>(e.openBlock(),e.createBlock(l,{label:c.label,value:c.value},null,8,["label","value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p[t.type]),e.mergeProps({key:1,ref_for:!0},t.props,{modelValue:i.value[t.prop],"onUpdate:modelValue":c=>i.value[t.prop]=c}),null,16,["modelValue","onUpdate:modelValue"]))])]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128))]),_:3}))]),_:3},16,["class","model"])}}}),L={key:0},I={name:"WtskTable"},j=Object.assign(I,{name:"WtskTable",inheritAttrs:!1},{props:{tableData:{type:Array,default:()=>[]},tableHeight:{type:String,default:"550px"},tableColumns:{type:Array,default:()=>[]},tableHasPage:{type:Boolean,default:!0},tableTotal:{type:Number,default:0},tablePageNum:{type:Number,default:1},tablePageSize:{type:Number,default:10},tablePageProp:{type:Object,default:()=>{}}},emits:["tablePageChange"],setup(r,{expose:m,emit:f}){const h=r,i=e.ref(),p=e.ref({pageNum:h.tablePageNum,pageSize:h.tablePageSize});e.watch([()=>h.tablePageNum,()=>h.tablePageSize],([s,v])=>{p.value.pageNum=s,p.value.pageSize=v},{immediate:!0});const k=f;function a(s){p.value.pageNum=s,k("tablePageChange",{...p.value})}function g(s){p.value.pageSize=s,k("tablePageChange",{...p.value})}return m({wtskTableRef:i}),(s,v)=>{const d=e.resolveComponent("el-table-column"),o=e.resolveComponent("el-table"),l=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(o,e.mergeProps({ref_key:"wtskTableRef",ref:i,class:"wtsk-table"},{"row-key":"id","default-expand-all":!0,...s.$attrs},{data:r.tableData,height:r.tableHasPage?r.tableHeight:"auto",stripe:""}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.tableColumns,u=>(e.openBlock(),e.createBlock(d,e.mergeProps({key:u.prop},{ref_for:!0},{align:"center","reserve-selection":!0,"show-overflow-tooltip":!0,...u}),e.createSlots({_:2},[u.slot?{name:"default",fn:e.withCtx(n=>[e.renderSlot(s.$slots,u.slot,e.mergeProps({ref_for:!0},n))]),key:"0"}:void 0,u.type==="operate"?{name:"default",fn:e.withCtx(n=>[e.renderSlot(s.$slots,"tableBtn",e.mergeProps({ref_for:!0},n))]),key:"1"}:void 0]),1040))),128))]),_:3},16,["data","height"]),r.tableHasPage?(e.openBlock(),e.createElementBlock("div",L,[e.createVNode(l,e.mergeProps({class:"wtsk-pagination"},{layout:"total, prev, pager, next, sizes","page-sizes":[5,10,20,50,100],background:!0,...r.tablePageProp},{total:r.tableTotal,"current-page":p.value.pageNum,"page-size":p.value.pageSize,onSizeChange:g,onCurrentChange:a}),null,16,["total","current-page","page-size"])])):e.createCommentVNode("",!0)],64)}}}),q=[{name:"WtskBtn",component:N},{name:"WtskTree",component:R},{name:"WtskForm",component:D},{name:"WtskTable",component:j}],G={install(r){q.forEach(({name:m,component:f})=>{r.component(m,f)})}};module.exports=G;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.wtsk-form .el-input,.wtsk-form .el-select,.wtsk-form .el-date-editor,.wtsk-form .el-input-number{width:100%}.wtsk-form .el-form-item__label-wrap,.wtsk-form .el-form-item__label{font-weight:700}.wtsk-form .el-input__wrapper,.wtsk-form .el-select__wrapper,.wtsk-form .el-textarea__inner{background:#ffffff80;border:1px solid rgba(64,158,255,.3);box-shadow:none!important}.wtsk-form .el-input-group__append{box-shadow:none;border:1px solid rgba(64,158,255,.3);border-left:0}.wtsk-form .el-input-group__append .el-button{border:0}.wtsk-form .el-input-group__append .el-button .el-icon{color:#409eff}.wtsk-form.wtsk-form-search{display:flex;gap:20px}.wtsk-form.wtsk-form-search .el-input,.wtsk-form.wtsk-form-search .el-select,.wtsk-form.wtsk-form-search .el-date-editor,.wtsk-form.wtsk-form-search .el-input-number{width:200px}.wtsk-form.wtsk-form-search .el-input.el-date-editor--datetimerange,.wtsk-form.wtsk-form-search .el-select.el-date-editor--datetimerange,.wtsk-form.wtsk-form-search .el-date-editor.el-date-editor--datetimerange,.wtsk-form.wtsk-form-search .el-input-number.el-date-editor--datetimerange{width:initial}.wtsk-form.wtsk-form-search .el-form-item{margin:0}.el-table.wtsk-table{background:transparent}.el-table.wtsk-table .el-table__inner-wrapper:before{background-color:transparent!important}.el-table.wtsk-table tr{background:transparent!important}.el-table.wtsk-table tr.el-table__row--striped td{background:#ffffff70!important;border-top:1px solid #fff!important;border-bottom:1px solid #fff!important}.el-table.wtsk-table tr.current-row td{background:#409eff0f!important}.el-table.wtsk-table th{padding:0;height:50px;background-color:#409eff26!important;border:0!important;font-size:14px;color:#333}.el-table.wtsk-table th:nth-of-type(1){border-radius:4px 0 0 4px}.el-table.wtsk-table th:nth-last-of-type(1){border-radius:0 4px 4px 0}.el-table.wtsk-table td{padding:0;height:50px;background:transparent!important;border:0!important}.el-table.wtsk-table td .el-button.is-link{position:relative;padding:4px 5px;margin-left:0;color:#409eff;outline:0}.el-table.wtsk-table td .el-button.is-link:hover{text-decoration:underline}.el-table.wtsk-table.wtsk-table-small th,.el-table.wtsk-table.wtsk-table-small td{height:40px!important}.el-pagination.wtsk-pagination{justify-content:flex-end;margin-top:10px}.el-pagination.wtsk-pagination .btn-prev,.el-pagination.wtsk-pagination .btn-next,.el-pagination.wtsk-pagination .el-select__wrapper,.el-pagination.wtsk-pagination .el-pager li{background:#ffffff80!important;border:1px solid rgba(64,158,255,.5)!important;box-shadow:none!important}.el-pagination.wtsk-pagination .btn-prev.is-active,.el-pagination.wtsk-pagination .btn-next.is-active,.el-pagination.wtsk-pagination .el-select__wrapper.is-active,.el-pagination.wtsk-pagination .el-pager li.is-active{background-color:#409eff!important}.el-tree.wtsk-tree,.el-tree.wtsk-tree .el-tree-node .el-tree-node__content{background:transparent}.el-tree.wtsk-tree .el-tree-node.is-current>.el-tree-node__content{background:#409eff26!important;border-radius:4px}*{box-sizing:border-box;outline:none!important}*::selection{background-color:transparent;color:#409eff}html,body,#app{position:relative;margin:0;padding:0;width:100%;height:100%;overflow:hidden}a{color:initial;text-decoration:none}a:hover{color:#409eff}::-webkit-scrollbar{width:6px;height:8px;border:0!important}::-webkit-scrollbar-corner{background:transparent;border-radius:0}::-webkit-scrollbar-thumb{background-color:#409eff1a;border-radius:8px}.el-scrollbar__thumb{background-color:#409eff4d}.wtsk-tree-box{position:relative;width:100%;height:100%;display:flex;flex-direction:column}.wtsk-tree-box .wtsk-tree-box-title{line-height:40px;border-bottom:1px solid #eee;text-align:center;font-size:17px;color:#333}.wtsk-tree-box .wtsk-tree-box-filter{padding:5px;display:flex;align-items:center;justify-content:center;gap:10px}.wtsk-tree-box .wtsk-tree-box-tree{flex:1;overflow-x:hidden;overflow-y:auto}.wtsk-tree-box .wtsk-tree-box-tree .wtsk-tree-box-tree-custom{width:calc(100% - 24px);display:flex;align-items:center;justify-content:space-between}.wtsk-tree-box .wtsk-tree-box-tree .wtsk-tree-box-tree-custom>div:nth-of-type(1){width:calc(100% - 60px);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wtsk-tree-box .wtsk-tree-box-tree .wtsk-tree-box-tree-custom>div:nth-of-type(2){width:60px}.wtsk-tree-box .wtsk-tree-box-tree .wtsk-tree-box-tree-custom>div:nth-of-type(2) button{margin:0}
|
package/dist/wtsk-comps.es.js
CHANGED
|
@@ -1,60 +1,684 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { useAttrs as L, ref as E, resolveComponent as y, openBlock as l, createBlock as k, mergeProps as z, withCtx as s, renderSlot as A, defineComponent as M, createElementBlock as f, createElementVNode as S, watch as j, toDisplayString as W, createCommentVNode as T, isRef as O, unref as N, Fragment as _, createVNode as m, withModifiers as $, createTextVNode as U, createSlots as q, computed as G, useModel as J, renderList as B, resolveDynamicComponent as I, mergeModels as Q } from "vue";
|
|
2
|
+
import { ElMessage as X, ElTreeSelect as Y, ElSwitch as Z, ElDatePicker as K, ElSelect as ee, ElInputNumber as te, ElInput as le } from "element-plus";
|
|
3
|
+
const ae = {
|
|
4
|
+
name: "WtskBtn"
|
|
5
|
+
}, oe = /* @__PURE__ */ Object.assign(ae, {
|
|
3
6
|
name: "WtskBtn",
|
|
4
|
-
inheritAttrs: !1
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
link: { type: Boolean },
|
|
18
|
-
bg: { type: Boolean },
|
|
19
|
-
autofocus: { type: Boolean },
|
|
20
|
-
round: { type: Boolean },
|
|
21
|
-
circle: { type: Boolean },
|
|
22
|
-
color: {},
|
|
23
|
-
dark: { type: Boolean },
|
|
24
|
-
autoInsertSpace: { type: Boolean },
|
|
25
|
-
tag: {}
|
|
26
|
-
},
|
|
27
|
-
setup(e) {
|
|
28
|
-
const t = e, a = p(), o = u(!1), s = f(() => ({ ...Object.fromEntries(
|
|
29
|
-
Object.entries(t).filter(([l]) => l !== "onClick")
|
|
30
|
-
), ...a }));
|
|
31
|
-
async function r() {
|
|
32
|
-
o.value = !0;
|
|
7
|
+
inheritAttrs: !1
|
|
8
|
+
}, {
|
|
9
|
+
setup(o) {
|
|
10
|
+
const v = L(), b = E(!1);
|
|
11
|
+
function P(d, h) {
|
|
12
|
+
const n = {};
|
|
13
|
+
for (const w in d)
|
|
14
|
+
w !== h && (n[w] = d[w]);
|
|
15
|
+
return n;
|
|
16
|
+
}
|
|
17
|
+
async function c() {
|
|
18
|
+
var d;
|
|
19
|
+
b.value = !0;
|
|
33
20
|
try {
|
|
34
|
-
|
|
21
|
+
await ((d = v.onClick) == null ? void 0 : d.call(v));
|
|
35
22
|
} finally {
|
|
36
|
-
|
|
23
|
+
b.value = !1;
|
|
37
24
|
}
|
|
38
25
|
}
|
|
39
|
-
return (
|
|
40
|
-
const
|
|
41
|
-
return
|
|
42
|
-
loading:
|
|
43
|
-
onClick:
|
|
26
|
+
return (d, h) => {
|
|
27
|
+
const n = y("el-button");
|
|
28
|
+
return l(), k(n, z(P(d.$attrs, "onClick"), {
|
|
29
|
+
loading: b.value,
|
|
30
|
+
onClick: c
|
|
44
31
|
}), {
|
|
45
|
-
default:
|
|
46
|
-
|
|
32
|
+
default: s(() => [
|
|
33
|
+
A(d.$slots, "default")
|
|
47
34
|
]),
|
|
48
35
|
_: 3
|
|
49
36
|
}, 16, ["loading"]);
|
|
50
37
|
};
|
|
51
38
|
}
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
|
|
39
|
+
});
|
|
40
|
+
/*! Element Plus Icons Vue v2.3.2 */
|
|
41
|
+
var ne = /* @__PURE__ */ M({
|
|
42
|
+
name: "Delete",
|
|
43
|
+
__name: "delete",
|
|
44
|
+
setup(o) {
|
|
45
|
+
return (v, b) => (l(), f("svg", {
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
viewBox: "0 0 1024 1024"
|
|
48
|
+
}, [
|
|
49
|
+
S("path", {
|
|
50
|
+
fill: "currentColor",
|
|
51
|
+
d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
|
|
52
|
+
})
|
|
53
|
+
]));
|
|
54
|
+
}
|
|
55
|
+
}), re = ne, ue = /* @__PURE__ */ M({
|
|
56
|
+
name: "Edit",
|
|
57
|
+
__name: "edit",
|
|
58
|
+
setup(o) {
|
|
59
|
+
return (v, b) => (l(), f("svg", {
|
|
60
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
61
|
+
viewBox: "0 0 1024 1024"
|
|
62
|
+
}, [
|
|
63
|
+
S("path", {
|
|
64
|
+
fill: "currentColor",
|
|
65
|
+
d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"
|
|
66
|
+
}),
|
|
67
|
+
S("path", {
|
|
68
|
+
fill: "currentColor",
|
|
69
|
+
d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
|
|
70
|
+
})
|
|
71
|
+
]));
|
|
72
|
+
}
|
|
73
|
+
}), R = ue, se = /* @__PURE__ */ M({
|
|
74
|
+
name: "Plus",
|
|
75
|
+
__name: "plus",
|
|
76
|
+
setup(o) {
|
|
77
|
+
return (v, b) => (l(), f("svg", {
|
|
78
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
79
|
+
viewBox: "0 0 1024 1024"
|
|
80
|
+
}, [
|
|
81
|
+
S("path", {
|
|
82
|
+
fill: "currentColor",
|
|
83
|
+
d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
|
|
84
|
+
})
|
|
85
|
+
]));
|
|
86
|
+
}
|
|
87
|
+
}), D = se;
|
|
88
|
+
const pe = { class: "wtsk-tree-box" }, ie = {
|
|
89
|
+
key: 0,
|
|
90
|
+
class: "wtsk-tree-box-title"
|
|
91
|
+
}, de = {
|
|
92
|
+
key: 1,
|
|
93
|
+
class: "wtsk-tree-box-filter wtsk-form"
|
|
94
|
+
}, ce = {
|
|
95
|
+
style: { display: "flex", "align-items": "center" },
|
|
96
|
+
class: "wtsk-form"
|
|
97
|
+
}, fe = { class: "wtsk-tree-box-tree-custom" }, me = {
|
|
98
|
+
style: { display: "flex", "align-items": "center" },
|
|
99
|
+
class: "wtsk-form"
|
|
100
|
+
}, ke = {
|
|
101
|
+
style: { display: "flex", "align-items": "center" },
|
|
102
|
+
class: "wtsk-form"
|
|
103
|
+
}, ye = {
|
|
104
|
+
name: "WtskTree"
|
|
105
|
+
}, ge = /* @__PURE__ */ Object.assign(ye, {
|
|
106
|
+
name: "WtskTree",
|
|
107
|
+
inheritAttrs: !1
|
|
108
|
+
}, {
|
|
109
|
+
props: {
|
|
110
|
+
// 树标题
|
|
111
|
+
treeTitle: {
|
|
112
|
+
type: String,
|
|
113
|
+
default: ""
|
|
114
|
+
},
|
|
115
|
+
// 是否有筛选框
|
|
116
|
+
treeHasFilter: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: !1
|
|
119
|
+
},
|
|
120
|
+
// 筛选类型(default:默认,只展示筛选节点,detail:详细,展示筛选节点及子节点)
|
|
121
|
+
treeFilterType: {
|
|
122
|
+
type: String,
|
|
123
|
+
default: "default"
|
|
124
|
+
},
|
|
125
|
+
// 是否有操作按钮
|
|
126
|
+
treeHasOperate: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: !1
|
|
129
|
+
},
|
|
130
|
+
// 操作是否自定义
|
|
131
|
+
treeCustomizeOperate: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: !1
|
|
134
|
+
},
|
|
135
|
+
// 树顶部按钮文本
|
|
136
|
+
treeAddParentText: {
|
|
137
|
+
type: String,
|
|
138
|
+
default: "新增一级"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
emits: ["treeOperate"],
|
|
142
|
+
setup(o, { expose: v, emit: b }) {
|
|
143
|
+
const P = L(), c = o, d = E();
|
|
144
|
+
let h = E(""), n = E("");
|
|
145
|
+
const w = b;
|
|
146
|
+
j(h, (a) => {
|
|
147
|
+
var t;
|
|
148
|
+
(t = d.value) == null || t.filter(a);
|
|
149
|
+
});
|
|
150
|
+
function p(a, t, i) {
|
|
151
|
+
var C;
|
|
152
|
+
if (!a) return !0;
|
|
153
|
+
const r = t.label ? t.label : (C = P.props) == null ? void 0 : C.label;
|
|
154
|
+
if (c.treeFilterType === "default") return t[r].includes(a);
|
|
155
|
+
{
|
|
156
|
+
let F = [];
|
|
157
|
+
V(i, F, a, r);
|
|
158
|
+
let H = !1;
|
|
159
|
+
return F.forEach((e) => {
|
|
160
|
+
H = H || e;
|
|
161
|
+
}), H;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function V(a, t, i, r) {
|
|
165
|
+
let C = a.data && a.data[r] && a.data[r].includes(i);
|
|
166
|
+
C && t.push(C), !C && a.level !== 1 && a.parent && V(a.parent, t, i, r);
|
|
167
|
+
}
|
|
168
|
+
function g(a, t, i) {
|
|
169
|
+
c.treeCustomizeOperate || a === "delete" ? w("treeOperate", a, t, i) : n.value.trim() !== "" ? (document.documentElement.click(), w("treeOperate", a, t, i, n.value)) : X.error("名称不能为空!");
|
|
170
|
+
}
|
|
171
|
+
return v({ wtskTreeRef: d }), (a, t) => {
|
|
172
|
+
const i = y("el-input"), r = y("el-button"), C = y("el-popover"), F = y("el-popconfirm"), H = y("el-tree");
|
|
173
|
+
return l(), f("div", pe, [
|
|
174
|
+
o.treeTitle !== "" ? (l(), f("div", ie, W(o.treeTitle), 1)) : T("", !0),
|
|
175
|
+
o.treeHasFilter || o.treeHasOperate ? (l(), f("div", de, [
|
|
176
|
+
o.treeHasFilter ? (l(), k(i, {
|
|
177
|
+
key: 0,
|
|
178
|
+
modelValue: N(h),
|
|
179
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => O(h) ? h.value = e : h = e),
|
|
180
|
+
placeholder: "输入名称进行筛选……",
|
|
181
|
+
clearable: ""
|
|
182
|
+
}, null, 8, ["modelValue"])) : T("", !0),
|
|
183
|
+
o.treeCustomizeOperate ? (l(), k(r, {
|
|
184
|
+
key: 2,
|
|
185
|
+
type: "primary",
|
|
186
|
+
onClick: t[4] || (t[4] = (e) => g("addParent"))
|
|
187
|
+
}, {
|
|
188
|
+
default: s(() => [
|
|
189
|
+
U(W(o.treeAddParentText), 1)
|
|
190
|
+
]),
|
|
191
|
+
_: 1
|
|
192
|
+
})) : (l(), f(_, { key: 1 }, [
|
|
193
|
+
o.treeHasOperate ? (l(), k(C, {
|
|
194
|
+
key: 0,
|
|
195
|
+
placement: "bottom",
|
|
196
|
+
width: 280,
|
|
197
|
+
trigger: "click"
|
|
198
|
+
}, {
|
|
199
|
+
reference: s(() => [
|
|
200
|
+
m(r, {
|
|
201
|
+
type: "primary",
|
|
202
|
+
onClick: t[1] || (t[1] = (e) => O(n) ? n.value = "" : n = "")
|
|
203
|
+
}, {
|
|
204
|
+
default: s(() => [
|
|
205
|
+
U(W(o.treeAddParentText), 1)
|
|
206
|
+
]),
|
|
207
|
+
_: 1
|
|
208
|
+
})
|
|
209
|
+
]),
|
|
210
|
+
default: s(() => [
|
|
211
|
+
S("div", ce, [
|
|
212
|
+
m(i, {
|
|
213
|
+
modelValue: N(n),
|
|
214
|
+
"onUpdate:modelValue": t[2] || (t[2] = (e) => O(n) ? n.value = e : n = e),
|
|
215
|
+
placeholder: "请输入名称",
|
|
216
|
+
clearable: ""
|
|
217
|
+
}, null, 8, ["modelValue"]),
|
|
218
|
+
m(r, {
|
|
219
|
+
type: "primary",
|
|
220
|
+
style: { "margin-left": "10px" },
|
|
221
|
+
onClick: t[3] || (t[3] = $((e) => g("addParent"), ["stop"]))
|
|
222
|
+
}, {
|
|
223
|
+
default: s(() => [...t[9] || (t[9] = [
|
|
224
|
+
U("新增", -1)
|
|
225
|
+
])]),
|
|
226
|
+
_: 1
|
|
227
|
+
})
|
|
228
|
+
])
|
|
229
|
+
]),
|
|
230
|
+
_: 1
|
|
231
|
+
})) : T("", !0)
|
|
232
|
+
], 64))
|
|
233
|
+
])) : T("", !0),
|
|
234
|
+
m(H, z({
|
|
235
|
+
ref_key: "wtskTreeRef",
|
|
236
|
+
ref: d,
|
|
237
|
+
class: "wtsk-tree wtsk-tree-box-tree"
|
|
238
|
+
}, {
|
|
239
|
+
"node-key": "id",
|
|
240
|
+
"highlight-current": !0,
|
|
241
|
+
"default-expand-all": !0,
|
|
242
|
+
"expand-on-click-node": !1,
|
|
243
|
+
"check-on-click-leaf": !1,
|
|
244
|
+
...a.$attrs
|
|
245
|
+
}, { "filter-node-method": p }), q({ _: 2 }, [
|
|
246
|
+
o.treeHasOperate ? {
|
|
247
|
+
name: "default",
|
|
248
|
+
fn: s(({ node: e, data: u }) => [
|
|
249
|
+
S("div", fe, [
|
|
250
|
+
S("div", null, W(e.label), 1),
|
|
251
|
+
S("div", null, [
|
|
252
|
+
o.treeCustomizeOperate ? (l(), f(_, { key: 0 }, [
|
|
253
|
+
m(r, {
|
|
254
|
+
type: "success",
|
|
255
|
+
link: "",
|
|
256
|
+
icon: N(D),
|
|
257
|
+
onClick: $((x) => g("add", u, e), ["stop"])
|
|
258
|
+
}, null, 8, ["icon", "onClick"]),
|
|
259
|
+
m(r, {
|
|
260
|
+
type: "primary",
|
|
261
|
+
link: "",
|
|
262
|
+
icon: N(R),
|
|
263
|
+
onClick: $((x) => g("edit", u, e), ["stop"])
|
|
264
|
+
}, null, 8, ["icon", "onClick"])
|
|
265
|
+
], 64)) : (l(), f(_, { key: 1 }, [
|
|
266
|
+
m(C, {
|
|
267
|
+
placement: "bottom",
|
|
268
|
+
width: 280,
|
|
269
|
+
trigger: "click"
|
|
270
|
+
}, {
|
|
271
|
+
reference: s(() => [
|
|
272
|
+
m(r, {
|
|
273
|
+
type: "success",
|
|
274
|
+
link: "",
|
|
275
|
+
icon: N(D),
|
|
276
|
+
onClick: t[5] || (t[5] = $((x) => O(n) ? n.value = "" : n = "", ["stop"]))
|
|
277
|
+
}, null, 8, ["icon"])
|
|
278
|
+
]),
|
|
279
|
+
default: s(() => [
|
|
280
|
+
S("div", me, [
|
|
281
|
+
m(i, {
|
|
282
|
+
modelValue: N(n),
|
|
283
|
+
"onUpdate:modelValue": t[6] || (t[6] = (x) => O(n) ? n.value = x : n = x),
|
|
284
|
+
placeholder: "请输入名称",
|
|
285
|
+
clearable: ""
|
|
286
|
+
}, null, 8, ["modelValue"]),
|
|
287
|
+
m(r, {
|
|
288
|
+
type: "primary",
|
|
289
|
+
style: { "margin-left": "10px" },
|
|
290
|
+
onClick: $((x) => g("add", u, e), ["stop"])
|
|
291
|
+
}, {
|
|
292
|
+
default: s(() => [...t[10] || (t[10] = [
|
|
293
|
+
U("新增", -1)
|
|
294
|
+
])]),
|
|
295
|
+
_: 1
|
|
296
|
+
}, 8, ["onClick"])
|
|
297
|
+
])
|
|
298
|
+
]),
|
|
299
|
+
_: 2
|
|
300
|
+
}, 1024),
|
|
301
|
+
m(C, {
|
|
302
|
+
placement: "bottom",
|
|
303
|
+
width: 280,
|
|
304
|
+
trigger: "click"
|
|
305
|
+
}, {
|
|
306
|
+
reference: s(() => [
|
|
307
|
+
m(r, {
|
|
308
|
+
type: "primary",
|
|
309
|
+
link: "",
|
|
310
|
+
icon: N(R),
|
|
311
|
+
onClick: $((x) => O(n) ? n.value = e.label : n = e.label, ["stop"])
|
|
312
|
+
}, null, 8, ["icon", "onClick"])
|
|
313
|
+
]),
|
|
314
|
+
default: s(() => [
|
|
315
|
+
S("div", ke, [
|
|
316
|
+
m(i, {
|
|
317
|
+
modelValue: N(n),
|
|
318
|
+
"onUpdate:modelValue": t[7] || (t[7] = (x) => O(n) ? n.value = x : n = x),
|
|
319
|
+
placeholder: "请输入名称",
|
|
320
|
+
clearable: ""
|
|
321
|
+
}, null, 8, ["modelValue"]),
|
|
322
|
+
m(r, {
|
|
323
|
+
type: "primary",
|
|
324
|
+
style: { "margin-left": "10px" },
|
|
325
|
+
onClick: $((x) => g("edit", u, e), ["stop"])
|
|
326
|
+
}, {
|
|
327
|
+
default: s(() => [...t[11] || (t[11] = [
|
|
328
|
+
U("修改", -1)
|
|
329
|
+
])]),
|
|
330
|
+
_: 1
|
|
331
|
+
}, 8, ["onClick"])
|
|
332
|
+
])
|
|
333
|
+
]),
|
|
334
|
+
_: 2
|
|
335
|
+
}, 1024)
|
|
336
|
+
], 64)),
|
|
337
|
+
m(F, {
|
|
338
|
+
title: "确定删除这条数据吗?",
|
|
339
|
+
"hide-icon": "",
|
|
340
|
+
width: "170",
|
|
341
|
+
onConfirm: (x) => g("delete", u, e)
|
|
342
|
+
}, {
|
|
343
|
+
reference: s(() => [
|
|
344
|
+
m(r, {
|
|
345
|
+
type: "danger",
|
|
346
|
+
link: "",
|
|
347
|
+
icon: N(re),
|
|
348
|
+
onClick: t[8] || (t[8] = $(() => {
|
|
349
|
+
}, ["stop"]))
|
|
350
|
+
}, null, 8, ["icon"])
|
|
351
|
+
]),
|
|
352
|
+
_: 1
|
|
353
|
+
}, 8, ["onConfirm"])
|
|
354
|
+
])
|
|
355
|
+
])
|
|
356
|
+
]),
|
|
357
|
+
key: "0"
|
|
358
|
+
} : void 0
|
|
359
|
+
]), 1040)
|
|
360
|
+
]);
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
}), ve = {
|
|
364
|
+
name: "WtskForm"
|
|
365
|
+
}, be = /* @__PURE__ */ Object.assign(ve, {
|
|
366
|
+
name: "WtskForm",
|
|
367
|
+
inheritAttrs: !1
|
|
368
|
+
}, {
|
|
369
|
+
props: /* @__PURE__ */ Q({
|
|
370
|
+
// 表单是否是搜索类型
|
|
371
|
+
formIsSearch: {
|
|
372
|
+
type: Boolean,
|
|
373
|
+
default: !1
|
|
374
|
+
},
|
|
375
|
+
// 表单配置项
|
|
376
|
+
formItems: {
|
|
377
|
+
type: Array,
|
|
378
|
+
default: () => []
|
|
379
|
+
}
|
|
380
|
+
}, {
|
|
381
|
+
modelValue: {},
|
|
382
|
+
modelModifiers: {}
|
|
383
|
+
}),
|
|
384
|
+
emits: ["update:modelValue"],
|
|
385
|
+
setup(o, { expose: v }) {
|
|
386
|
+
const b = o, P = G(() => b.formItems.filter((p) => !p.hidden)), c = J(o, "modelValue"), d = {
|
|
387
|
+
input: le,
|
|
388
|
+
number: te,
|
|
389
|
+
select: ee,
|
|
390
|
+
date: K,
|
|
391
|
+
switch: Z,
|
|
392
|
+
treeSelect: Y
|
|
393
|
+
};
|
|
394
|
+
function h(p, V) {
|
|
395
|
+
if (!p || typeof p != "object" || !V) return;
|
|
396
|
+
const g = V.split(".");
|
|
397
|
+
let a = p;
|
|
398
|
+
for (const t of g) {
|
|
399
|
+
if (a === null || !(t in a)) return;
|
|
400
|
+
a = a[t];
|
|
401
|
+
}
|
|
402
|
+
return a;
|
|
403
|
+
}
|
|
404
|
+
function n(p, V, g) {
|
|
405
|
+
if (!p || typeof p != "object" || !V) return;
|
|
406
|
+
const a = V.split(".");
|
|
407
|
+
let t = p;
|
|
408
|
+
for (let i = 0; i < a.length - 1; i++) {
|
|
409
|
+
const r = a[i];
|
|
410
|
+
if ((t[r] === null || typeof t[r] != "object" && t[r] !== void 0) && (t[r] = {}), !(r in t)) return;
|
|
411
|
+
t = t[r];
|
|
412
|
+
}
|
|
413
|
+
t[a[a.length - 1]] = g;
|
|
414
|
+
}
|
|
415
|
+
const w = E();
|
|
416
|
+
return v({ wtskFormRef: w }), (p, V) => {
|
|
417
|
+
const g = y("el-radio"), a = y("el-radio-group"), t = y("el-checkbox"), i = y("el-checkbox-group"), r = y("el-form-item"), C = y("el-col"), F = y("el-row"), H = y("el-form");
|
|
418
|
+
return l(), k(H, z({
|
|
419
|
+
ref_key: "wtskFormRef",
|
|
420
|
+
ref: w,
|
|
421
|
+
class: ["wtsk-form", o.formIsSearch ? "wtsk-form-search" : ""]
|
|
422
|
+
}, { "label-width": o.formIsSearch ? "auto" : "100px", ...p.$attrs }, { model: c.value }), {
|
|
423
|
+
default: s(() => [
|
|
424
|
+
o.formIsSearch ? (l(), f(_, { key: 0 }, [
|
|
425
|
+
(l(!0), f(_, null, B(P.value, (e) => (l(), k(r, {
|
|
426
|
+
key: e.prop,
|
|
427
|
+
label: e.label,
|
|
428
|
+
prop: e.prop
|
|
429
|
+
}, {
|
|
430
|
+
default: s(() => [
|
|
431
|
+
A(p.$slots, e.prop, {}, () => [
|
|
432
|
+
e.type === "radio" || e.type === "checkbox" ? (l(), f(_, { key: 0 }, [
|
|
433
|
+
e.type === "radio" ? (l(), k(a, {
|
|
434
|
+
key: 0,
|
|
435
|
+
modelValue: c.value[e.prop],
|
|
436
|
+
"onUpdate:modelValue": (u) => c.value[e.prop] = u
|
|
437
|
+
}, {
|
|
438
|
+
default: s(() => [
|
|
439
|
+
(l(!0), f(_, null, B(e.data, (u) => (l(), k(g, {
|
|
440
|
+
value: u.value
|
|
441
|
+
}, {
|
|
442
|
+
default: s(() => [
|
|
443
|
+
U(W(u.label), 1)
|
|
444
|
+
]),
|
|
445
|
+
_: 2
|
|
446
|
+
}, 1032, ["value"]))), 256))
|
|
447
|
+
]),
|
|
448
|
+
_: 2
|
|
449
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : T("", !0),
|
|
450
|
+
e.type === "checkbox" ? (l(), k(i, {
|
|
451
|
+
key: 1,
|
|
452
|
+
modelValue: c.value[e.prop],
|
|
453
|
+
"onUpdate:modelValue": (u) => c.value[e.prop] = u
|
|
454
|
+
}, {
|
|
455
|
+
default: s(() => [
|
|
456
|
+
(l(!0), f(_, null, B(e.data, (u) => (l(), k(t, {
|
|
457
|
+
label: u.label,
|
|
458
|
+
value: u.value
|
|
459
|
+
}, null, 8, ["label", "value"]))), 256))
|
|
460
|
+
]),
|
|
461
|
+
_: 2
|
|
462
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : T("", !0)
|
|
463
|
+
], 64)) : (l(), k(I(d[e.type]), z({
|
|
464
|
+
key: 1,
|
|
465
|
+
ref_for: !0
|
|
466
|
+
}, e.props, {
|
|
467
|
+
"model-value": h(c.value, e.prop),
|
|
468
|
+
"onUpdate:modelValue": (u) => n(c.value, e.prop, u)
|
|
469
|
+
}), null, 16, ["model-value", "onUpdate:modelValue"]))
|
|
470
|
+
])
|
|
471
|
+
]),
|
|
472
|
+
_: 2
|
|
473
|
+
}, 1032, ["label", "prop"]))), 128)),
|
|
474
|
+
m(r, null, {
|
|
475
|
+
default: s(() => [
|
|
476
|
+
A(p.$slots, "formSearchBtn")
|
|
477
|
+
]),
|
|
478
|
+
_: 3
|
|
479
|
+
})
|
|
480
|
+
], 64)) : (l(), k(F, {
|
|
481
|
+
key: 1,
|
|
482
|
+
gutter: 16
|
|
483
|
+
}, {
|
|
484
|
+
default: s(() => [
|
|
485
|
+
(l(!0), f(_, null, B(P.value, (e) => (l(), k(C, {
|
|
486
|
+
key: e.prop,
|
|
487
|
+
span: e.span || 24
|
|
488
|
+
}, {
|
|
489
|
+
default: s(() => [
|
|
490
|
+
m(r, {
|
|
491
|
+
label: e.label,
|
|
492
|
+
prop: e.prop
|
|
493
|
+
}, {
|
|
494
|
+
default: s(() => [
|
|
495
|
+
A(p.$slots, e.prop, {}, () => [
|
|
496
|
+
e.type === "radio" || e.type === "checkbox" ? (l(), f(_, { key: 0 }, [
|
|
497
|
+
e.type === "radio" ? (l(), k(a, {
|
|
498
|
+
key: 0,
|
|
499
|
+
modelValue: c.value[e.prop],
|
|
500
|
+
"onUpdate:modelValue": (u) => c.value[e.prop] = u
|
|
501
|
+
}, {
|
|
502
|
+
default: s(() => [
|
|
503
|
+
(l(!0), f(_, null, B(e.data, (u) => (l(), k(g, {
|
|
504
|
+
value: u.value
|
|
505
|
+
}, {
|
|
506
|
+
default: s(() => [
|
|
507
|
+
U(W(u.label), 1)
|
|
508
|
+
]),
|
|
509
|
+
_: 2
|
|
510
|
+
}, 1032, ["value"]))), 256))
|
|
511
|
+
]),
|
|
512
|
+
_: 2
|
|
513
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : T("", !0),
|
|
514
|
+
e.type === "checkbox" ? (l(), k(i, {
|
|
515
|
+
key: 1,
|
|
516
|
+
modelValue: c.value[e.prop],
|
|
517
|
+
"onUpdate:modelValue": (u) => c.value[e.prop] = u
|
|
518
|
+
}, {
|
|
519
|
+
default: s(() => [
|
|
520
|
+
(l(!0), f(_, null, B(e.data, (u) => (l(), k(t, {
|
|
521
|
+
label: u.label,
|
|
522
|
+
value: u.value
|
|
523
|
+
}, null, 8, ["label", "value"]))), 256))
|
|
524
|
+
]),
|
|
525
|
+
_: 2
|
|
526
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : T("", !0)
|
|
527
|
+
], 64)) : (l(), k(I(d[e.type]), z({
|
|
528
|
+
key: 1,
|
|
529
|
+
ref_for: !0
|
|
530
|
+
}, e.props, {
|
|
531
|
+
modelValue: c.value[e.prop],
|
|
532
|
+
"onUpdate:modelValue": (u) => c.value[e.prop] = u
|
|
533
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue"]))
|
|
534
|
+
])
|
|
535
|
+
]),
|
|
536
|
+
_: 2
|
|
537
|
+
}, 1032, ["label", "prop"])
|
|
538
|
+
]),
|
|
539
|
+
_: 2
|
|
540
|
+
}, 1032, ["span"]))), 128))
|
|
541
|
+
]),
|
|
542
|
+
_: 3
|
|
543
|
+
}))
|
|
544
|
+
]),
|
|
545
|
+
_: 3
|
|
546
|
+
}, 16, ["class", "model"]);
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
}), _e = { key: 0 }, he = {
|
|
550
|
+
name: "WtskTable"
|
|
551
|
+
}, we = /* @__PURE__ */ Object.assign(he, {
|
|
552
|
+
name: "WtskTable",
|
|
553
|
+
inheritAttrs: !1
|
|
554
|
+
}, {
|
|
555
|
+
props: {
|
|
556
|
+
// 表格数据
|
|
557
|
+
tableData: {
|
|
558
|
+
type: Array,
|
|
559
|
+
default: () => []
|
|
560
|
+
},
|
|
561
|
+
// 表格高度
|
|
562
|
+
tableHeight: {
|
|
563
|
+
type: String,
|
|
564
|
+
default: "550px"
|
|
565
|
+
},
|
|
566
|
+
// 表格表头配置
|
|
567
|
+
tableColumns: {
|
|
568
|
+
type: Array,
|
|
569
|
+
default: () => []
|
|
570
|
+
},
|
|
571
|
+
// 表格是否有分页
|
|
572
|
+
tableHasPage: {
|
|
573
|
+
type: Boolean,
|
|
574
|
+
default: !0
|
|
575
|
+
},
|
|
576
|
+
// 表格总数
|
|
577
|
+
tableTotal: {
|
|
578
|
+
type: Number,
|
|
579
|
+
default: 0
|
|
580
|
+
},
|
|
581
|
+
// 表格当前页码
|
|
582
|
+
tablePageNum: {
|
|
583
|
+
type: Number,
|
|
584
|
+
default: 1
|
|
585
|
+
},
|
|
586
|
+
// 表格每页页数
|
|
587
|
+
tablePageSize: {
|
|
588
|
+
type: Number,
|
|
589
|
+
default: 10
|
|
590
|
+
},
|
|
591
|
+
// 表格分页额外信息
|
|
592
|
+
tablePageProp: {
|
|
593
|
+
type: Object,
|
|
594
|
+
default: () => {
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
emits: ["tablePageChange"],
|
|
599
|
+
setup(o, { expose: v, emit: b }) {
|
|
600
|
+
const P = o, c = E(), d = E({
|
|
601
|
+
pageNum: P.tablePageNum,
|
|
602
|
+
pageSize: P.tablePageSize
|
|
603
|
+
});
|
|
604
|
+
j([() => P.tablePageNum, () => P.tablePageSize], ([p, V]) => {
|
|
605
|
+
d.value.pageNum = p, d.value.pageSize = V;
|
|
606
|
+
}, { immediate: !0 });
|
|
607
|
+
const h = b;
|
|
608
|
+
function n(p) {
|
|
609
|
+
d.value.pageNum = p, h("tablePageChange", { ...d.value });
|
|
610
|
+
}
|
|
611
|
+
function w(p) {
|
|
612
|
+
d.value.pageSize = p, h("tablePageChange", { ...d.value });
|
|
613
|
+
}
|
|
614
|
+
return v({ wtskTableRef: c }), (p, V) => {
|
|
615
|
+
const g = y("el-table-column"), a = y("el-table"), t = y("el-pagination");
|
|
616
|
+
return l(), f(_, null, [
|
|
617
|
+
m(a, z({
|
|
618
|
+
ref_key: "wtskTableRef",
|
|
619
|
+
ref: c,
|
|
620
|
+
class: "wtsk-table"
|
|
621
|
+
}, { "row-key": "id", "default-expand-all": !0, ...p.$attrs }, {
|
|
622
|
+
data: o.tableData,
|
|
623
|
+
height: o.tableHasPage ? o.tableHeight : "auto",
|
|
624
|
+
stripe: ""
|
|
625
|
+
}), {
|
|
626
|
+
default: s(() => [
|
|
627
|
+
(l(!0), f(_, null, B(o.tableColumns, (i) => (l(), k(g, z({
|
|
628
|
+
key: i.prop
|
|
629
|
+
}, { ref_for: !0 }, {
|
|
630
|
+
align: "center",
|
|
631
|
+
"reserve-selection": !0,
|
|
632
|
+
"show-overflow-tooltip": !0,
|
|
633
|
+
...i
|
|
634
|
+
}), q({ _: 2 }, [
|
|
635
|
+
i.slot ? {
|
|
636
|
+
name: "default",
|
|
637
|
+
fn: s((r) => [
|
|
638
|
+
A(p.$slots, i.slot, z({ ref_for: !0 }, r))
|
|
639
|
+
]),
|
|
640
|
+
key: "0"
|
|
641
|
+
} : void 0,
|
|
642
|
+
i.type === "operate" ? {
|
|
643
|
+
name: "default",
|
|
644
|
+
fn: s((r) => [
|
|
645
|
+
A(p.$slots, "tableBtn", z({ ref_for: !0 }, r))
|
|
646
|
+
]),
|
|
647
|
+
key: "1"
|
|
648
|
+
} : void 0
|
|
649
|
+
]), 1040))), 128))
|
|
650
|
+
]),
|
|
651
|
+
_: 3
|
|
652
|
+
}, 16, ["data", "height"]),
|
|
653
|
+
o.tableHasPage ? (l(), f("div", _e, [
|
|
654
|
+
m(t, z({ class: "wtsk-pagination" }, {
|
|
655
|
+
layout: "total, prev, pager, next, sizes",
|
|
656
|
+
"page-sizes": [5, 10, 20, 50, 100],
|
|
657
|
+
background: !0,
|
|
658
|
+
...o.tablePageProp
|
|
659
|
+
}, {
|
|
660
|
+
total: o.tableTotal,
|
|
661
|
+
"current-page": d.value.pageNum,
|
|
662
|
+
"page-size": d.value.pageSize,
|
|
663
|
+
onSizeChange: w,
|
|
664
|
+
onCurrentChange: n
|
|
665
|
+
}), null, 16, ["total", "current-page", "page-size"])
|
|
666
|
+
])) : T("", !0)
|
|
667
|
+
], 64);
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
}), Ve = [
|
|
671
|
+
{ name: "WtskBtn", component: oe },
|
|
672
|
+
{ name: "WtskTree", component: ge },
|
|
673
|
+
{ name: "WtskForm", component: be },
|
|
674
|
+
{ name: "WtskTable", component: we }
|
|
675
|
+
], Pe = {
|
|
676
|
+
install(o) {
|
|
677
|
+
Ve.forEach(({ name: v, component: b }) => {
|
|
678
|
+
o.component(v, b);
|
|
679
|
+
});
|
|
55
680
|
}
|
|
56
681
|
};
|
|
57
682
|
export {
|
|
58
|
-
|
|
59
|
-
b as default
|
|
683
|
+
Pe as default
|
|
60
684
|
};
|
package/dist/wtsk-comps.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WtskComps={},t.Vue))})(this,(function(t,e){"use strict";const i=e.defineComponent({name:"WtskBtn",inheritAttrs:!1,__name:"WtskBtn",props:{onClick:{type:Function},size:{},disabled:{type:Boolean},type:{},icon:{},nativeType:{},loading:{type:Boolean},loadingIcon:{},plain:{type:Boolean},text:{type:Boolean},link:{type:Boolean},bg:{type:Boolean},autofocus:{type:Boolean},round:{type:Boolean},circle:{type:Boolean},color:{},dark:{type:Boolean},autoInsertSpace:{type:Boolean},tag:{}},setup(n){const o=n,c=e.useAttrs(),l=e.ref(!1),p=e.computed(()=>({...Object.fromEntries(Object.entries(o).filter(([a])=>a!=="onClick")),...c}));async function d(){l.value=!0;try{typeof o.onClick=="function"&&await o.onClick?.()}finally{l.value=!1}}return(s,a)=>{const f=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(f,e.mergeProps(p.value,{loading:l.value,onClick:d}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16,["loading"])}}}),r={install(n){n.component("WtskBtn",i)}};t.WtskBtn=i,t.default=r,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(e,B){typeof exports=="object"&&typeof module<"u"?module.exports=B(require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["vue","element-plus"],B):(e=typeof globalThis<"u"?globalThis:e||self,e.WtskComps=B(e.Vue,e.ElementPlus))})(this,function(e,B){"use strict";const N=Object.assign({name:"WtskBtn"},{name:"WtskBtn",inheritAttrs:!1},{setup(a){const f=e.useAttrs(),k=e.ref(!1);function V(i,g){const r={};for(const y in i)y!==g&&(r[y]=i[y]);return r}async function d(){var i;k.value=!0;try{await((i=f.onClick)==null?void 0:i.call(f))}finally{k.value=!1}}return(i,g)=>{const r=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(r,e.mergeProps(V(i.$attrs,"onClick"),{loading:k.value,onClick:d}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["loading"])}}});/*! Element Plus Icons Vue v2.3.2 */var E=e.defineComponent({name:"Delete",__name:"delete",setup(a){return(f,k)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),S=E,T=e.defineComponent({name:"Edit",__name:"edit",setup(a){return(f,k)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),e.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),u=T,P=e.defineComponent({name:"Plus",__name:"plus",setup(a){return(f,k)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),x=P;const F={class:"wtsk-tree-box"},$={key:0,class:"wtsk-tree-box-title"},z={key:1,class:"wtsk-tree-box-filter wtsk-form"},H={style:{display:"flex","align-items":"center"},class:"wtsk-form"},M={class:"wtsk-tree-box-tree-custom"},O={style:{display:"flex","align-items":"center"},class:"wtsk-form"},U={style:{display:"flex","align-items":"center"},class:"wtsk-form"},W=Object.assign({name:"WtskTree"},{name:"WtskTree",inheritAttrs:!1},{props:{treeTitle:{type:String,default:""},treeHasFilter:{type:Boolean,default:!1},treeFilterType:{type:String,default:"default"},treeHasOperate:{type:Boolean,default:!1},treeCustomizeOperate:{type:Boolean,default:!1},treeAddParentText:{type:String,default:"新增一级"}},emits:["treeOperate"],setup(a,{expose:f,emit:k}){const V=e.useAttrs(),d=a,i=e.ref();let g=e.ref(""),r=e.ref("");const y=k;e.watch(g,o=>{var l;(l=i.value)==null||l.filter(o)});function s(o,l,p){var h;if(!o)return!0;const n=l.label?l.label:(h=V.props)==null?void 0:h.label;if(d.treeFilterType==="default")return l[n].includes(o);{let b=[];_(p,b,o,n);let w=!1;return b.forEach(t=>{w=w||t}),w}}function _(o,l,p,n){let h=o.data&&o.data[n]&&o.data[n].includes(p);h&&l.push(h),!h&&o.level!==1&&o.parent&&_(o.parent,l,p,n)}function m(o,l,p){d.treeCustomizeOperate||o==="delete"?y("treeOperate",o,l,p):r.value.trim()!==""?(document.documentElement.click(),y("treeOperate",o,l,p,r.value)):B.ElMessage.error("名称不能为空!")}return f({wtskTreeRef:i}),(o,l)=>{const p=e.resolveComponent("el-input"),n=e.resolveComponent("el-button"),h=e.resolveComponent("el-popover"),b=e.resolveComponent("el-popconfirm"),w=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",F,[a.treeTitle!==""?(e.openBlock(),e.createElementBlock("div",$,e.toDisplayString(a.treeTitle),1)):e.createCommentVNode("",!0),a.treeHasFilter||a.treeHasOperate?(e.openBlock(),e.createElementBlock("div",z,[a.treeHasFilter?(e.openBlock(),e.createBlock(p,{key:0,modelValue:e.unref(g),"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(g)?g.value=t:g=t),placeholder:"输入名称进行筛选……",clearable:""},null,8,["modelValue"])):e.createCommentVNode("",!0),a.treeCustomizeOperate?(e.openBlock(),e.createBlock(n,{key:2,type:"primary",onClick:l[4]||(l[4]=t=>m("addParent"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.treeAddParentText),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.treeHasOperate?(e.openBlock(),e.createBlock(h,{key:0,placement:"bottom",width:280,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(n,{type:"primary",onClick:l[1]||(l[1]=t=>e.isRef(r)?r.value="":r="")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.treeAddParentText),1)]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(p,{modelValue:e.unref(r),"onUpdate:modelValue":l[2]||(l[2]=t=>e.isRef(r)?r.value=t:r=t),placeholder:"请输入名称",clearable:""},null,8,["modelValue"]),e.createVNode(n,{type:"primary",style:{"margin-left":"10px"},onClick:l[3]||(l[3]=e.withModifiers(t=>m("addParent"),["stop"]))},{default:e.withCtx(()=>[...l[9]||(l[9]=[e.createTextVNode("新增",-1)])]),_:1})])]),_:1})):e.createCommentVNode("",!0)],64))])):e.createCommentVNode("",!0),e.createVNode(w,e.mergeProps({ref_key:"wtskTreeRef",ref:i,class:"wtsk-tree wtsk-tree-box-tree"},{"node-key":"id","highlight-current":!0,"default-expand-all":!0,"expand-on-click-node":!1,"check-on-click-leaf":!1,...o.$attrs},{"filter-node-method":s}),e.createSlots({_:2},[a.treeHasOperate?{name:"default",fn:e.withCtx(({node:t,data:c})=>[e.createElementVNode("div",M,[e.createElementVNode("div",null,e.toDisplayString(t.label),1),e.createElementVNode("div",null,[a.treeCustomizeOperate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(n,{type:"success",link:"",icon:e.unref(x),onClick:e.withModifiers(C=>m("add",c,t),["stop"])},null,8,["icon","onClick"]),e.createVNode(n,{type:"primary",link:"",icon:e.unref(u),onClick:e.withModifiers(C=>m("edit",c,t),["stop"])},null,8,["icon","onClick"])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(h,{placement:"bottom",width:280,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(n,{type:"success",link:"",icon:e.unref(x),onClick:l[5]||(l[5]=e.withModifiers(C=>e.isRef(r)?r.value="":r="",["stop"]))},null,8,["icon"])]),default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(p,{modelValue:e.unref(r),"onUpdate:modelValue":l[6]||(l[6]=C=>e.isRef(r)?r.value=C:r=C),placeholder:"请输入名称",clearable:""},null,8,["modelValue"]),e.createVNode(n,{type:"primary",style:{"margin-left":"10px"},onClick:e.withModifiers(C=>m("add",c,t),["stop"])},{default:e.withCtx(()=>[...l[10]||(l[10]=[e.createTextVNode("新增",-1)])]),_:1},8,["onClick"])])]),_:2},1024),e.createVNode(h,{placement:"bottom",width:280,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(n,{type:"primary",link:"",icon:e.unref(u),onClick:e.withModifiers(C=>e.isRef(r)?r.value=t.label:r=t.label,["stop"])},null,8,["icon","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",U,[e.createVNode(p,{modelValue:e.unref(r),"onUpdate:modelValue":l[7]||(l[7]=C=>e.isRef(r)?r.value=C:r=C),placeholder:"请输入名称",clearable:""},null,8,["modelValue"]),e.createVNode(n,{type:"primary",style:{"margin-left":"10px"},onClick:e.withModifiers(C=>m("edit",c,t),["stop"])},{default:e.withCtx(()=>[...l[11]||(l[11]=[e.createTextVNode("修改",-1)])]),_:1},8,["onClick"])])]),_:2},1024)],64)),e.createVNode(b,{title:"确定删除这条数据吗?","hide-icon":"",width:"170",onConfirm:C=>m("delete",c,t)},{reference:e.withCtx(()=>[e.createVNode(n,{type:"danger",link:"",icon:e.unref(S),onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},null,8,["icon"])]),_:1},8,["onConfirm"])])])]),key:"0"}:void 0]),1040)])}}}),A=Object.assign({name:"WtskForm"},{name:"WtskForm",inheritAttrs:!1},{props:e.mergeModels({formIsSearch:{type:Boolean,default:!1},formItems:{type:Array,default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(a,{expose:f}){const k=a,V=e.computed(()=>k.formItems.filter(s=>!s.hidden)),d=e.useModel(a,"modelValue"),i={input:B.ElInput,number:B.ElInputNumber,select:B.ElSelect,date:B.ElDatePicker,switch:B.ElSwitch,treeSelect:B.ElTreeSelect};function g(s,_){if(!s||typeof s!="object"||!_)return;const m=_.split(".");let o=s;for(const l of m){if(o===null||!(l in o))return;o=o[l]}return o}function r(s,_,m){if(!s||typeof s!="object"||!_)return;const o=_.split(".");let l=s;for(let p=0;p<o.length-1;p++){const n=o[p];if((l[n]===null||typeof l[n]!="object"&&l[n]!==void 0)&&(l[n]={}),!(n in l))return;l=l[n]}l[o[o.length-1]]=m}const y=e.ref();return f({wtskFormRef:y}),(s,_)=>{const m=e.resolveComponent("el-radio"),o=e.resolveComponent("el-radio-group"),l=e.resolveComponent("el-checkbox"),p=e.resolveComponent("el-checkbox-group"),n=e.resolveComponent("el-form-item"),h=e.resolveComponent("el-col"),b=e.resolveComponent("el-row"),w=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(w,e.mergeProps({ref_key:"wtskFormRef",ref:y,class:["wtsk-form",a.formIsSearch?"wtsk-form-search":""]},{"label-width":a.formIsSearch?"auto":"100px",...s.$attrs},{model:d.value}),{default:e.withCtx(()=>[a.formIsSearch?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,t=>(e.openBlock(),e.createBlock(n,{key:t.prop,label:t.label,prop:t.prop},{default:e.withCtx(()=>[e.renderSlot(s.$slots,t.prop,{},()=>[t.type==="radio"||t.type==="checkbox"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="radio"?(e.openBlock(),e.createBlock(o,{key:0,modelValue:d.value[t.prop],"onUpdate:modelValue":c=>d.value[t.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,c=>(e.openBlock(),e.createBlock(m,{value:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.type==="checkbox"?(e.openBlock(),e.createBlock(p,{key:1,modelValue:d.value[t.prop],"onUpdate:modelValue":c=>d.value[t.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,c=>(e.openBlock(),e.createBlock(l,{label:c.label,value:c.value},null,8,["label","value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i[t.type]),e.mergeProps({key:1,ref_for:!0},t.props,{"model-value":g(d.value,t.prop),"onUpdate:modelValue":c=>r(d.value,t.prop,c)}),null,16,["model-value","onUpdate:modelValue"]))])]),_:2},1032,["label","prop"]))),128)),e.createVNode(n,null,{default:e.withCtx(()=>[e.renderSlot(s.$slots,"formSearchBtn")]),_:3})],64)):(e.openBlock(),e.createBlock(b,{key:1,gutter:16},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,t=>(e.openBlock(),e.createBlock(h,{key:t.prop,span:t.span||24},{default:e.withCtx(()=>[e.createVNode(n,{label:t.label,prop:t.prop},{default:e.withCtx(()=>[e.renderSlot(s.$slots,t.prop,{},()=>[t.type==="radio"||t.type==="checkbox"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="radio"?(e.openBlock(),e.createBlock(o,{key:0,modelValue:d.value[t.prop],"onUpdate:modelValue":c=>d.value[t.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,c=>(e.openBlock(),e.createBlock(m,{value:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.type==="checkbox"?(e.openBlock(),e.createBlock(p,{key:1,modelValue:d.value[t.prop],"onUpdate:modelValue":c=>d.value[t.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,c=>(e.openBlock(),e.createBlock(l,{label:c.label,value:c.value},null,8,["label","value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i[t.type]),e.mergeProps({key:1,ref_for:!0},t.props,{modelValue:d.value[t.prop],"onUpdate:modelValue":c=>d.value[t.prop]=c}),null,16,["modelValue","onUpdate:modelValue"]))])]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128))]),_:3}))]),_:3},16,["class","model"])}}}),R={key:0},D=[{name:"WtskBtn",component:N},{name:"WtskTree",component:W},{name:"WtskForm",component:A},{name:"WtskTable",component:Object.assign({name:"WtskTable"},{name:"WtskTable",inheritAttrs:!1},{props:{tableData:{type:Array,default:()=>[]},tableHeight:{type:String,default:"550px"},tableColumns:{type:Array,default:()=>[]},tableHasPage:{type:Boolean,default:!0},tableTotal:{type:Number,default:0},tablePageNum:{type:Number,default:1},tablePageSize:{type:Number,default:10},tablePageProp:{type:Object,default:()=>{}}},emits:["tablePageChange"],setup(a,{expose:f,emit:k}){const V=a,d=e.ref(),i=e.ref({pageNum:V.tablePageNum,pageSize:V.tablePageSize});e.watch([()=>V.tablePageNum,()=>V.tablePageSize],([s,_])=>{i.value.pageNum=s,i.value.pageSize=_},{immediate:!0});const g=k;function r(s){i.value.pageNum=s,g("tablePageChange",{...i.value})}function y(s){i.value.pageSize=s,g("tablePageChange",{...i.value})}return f({wtskTableRef:d}),(s,_)=>{const m=e.resolveComponent("el-table-column"),o=e.resolveComponent("el-table"),l=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(o,e.mergeProps({ref_key:"wtskTableRef",ref:d,class:"wtsk-table"},{"row-key":"id","default-expand-all":!0,...s.$attrs},{data:a.tableData,height:a.tableHasPage?a.tableHeight:"auto",stripe:""}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableColumns,p=>(e.openBlock(),e.createBlock(m,e.mergeProps({key:p.prop},{ref_for:!0},{align:"center","reserve-selection":!0,"show-overflow-tooltip":!0,...p}),e.createSlots({_:2},[p.slot?{name:"default",fn:e.withCtx(n=>[e.renderSlot(s.$slots,p.slot,e.mergeProps({ref_for:!0},n))]),key:"0"}:void 0,p.type==="operate"?{name:"default",fn:e.withCtx(n=>[e.renderSlot(s.$slots,"tableBtn",e.mergeProps({ref_for:!0},n))]),key:"1"}:void 0]),1040))),128))]),_:3},16,["data","height"]),a.tableHasPage?(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(l,e.mergeProps({class:"wtsk-pagination"},{layout:"total, prev, pager, next, sizes","page-sizes":[5,10,20,50,100],background:!0,...a.tablePageProp},{total:a.tableTotal,"current-page":i.value.pageNum,"page-size":i.value.pageSize,onSizeChange:y,onCurrentChange:r}),null,16,["total","current-page","page-size"])])):e.createCommentVNode("",!0)],64)}}})}];return{install(a){D.forEach(({name:f,component:k})=>{a.component(f,k)})}}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wtsk-comps",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Vue3+Element Plus基础组件库(wtsk-btn/form/table/tree)",
|
|
5
5
|
"author": "lujh",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,10 +14,8 @@
|
|
|
14
14
|
"module": "dist/wtsk-comps.es.js",
|
|
15
15
|
"unpkg": "dist/wtsk-comps.umd.js",
|
|
16
16
|
"style": "dist/wtsk-comps.css",
|
|
17
|
-
"types": "dist/types/index.d.ts",
|
|
18
17
|
"exports": {
|
|
19
18
|
".": {
|
|
20
|
-
"types": "./dist/types/index.d.ts",
|
|
21
19
|
"import": "./dist/wtsk-comps.es.js",
|
|
22
20
|
"require": "./dist/wtsk-comps.cjs.js"
|
|
23
21
|
},
|
|
@@ -28,7 +26,7 @@
|
|
|
28
26
|
],
|
|
29
27
|
"peerDependencies": {
|
|
30
28
|
"element-plus": "^2.11.3",
|
|
31
|
-
"vue": "^3.
|
|
29
|
+
"vue": "^3.2.0"
|
|
32
30
|
},
|
|
33
31
|
"engines": {
|
|
34
32
|
"node": ">=20.0.0",
|
|
@@ -36,23 +34,16 @@
|
|
|
36
34
|
},
|
|
37
35
|
"scripts": {
|
|
38
36
|
"dev": "vite",
|
|
39
|
-
"build
|
|
40
|
-
"build:js": "vite build",
|
|
41
|
-
"build": "npm run build:types && npm run build:js",
|
|
37
|
+
"build": "vite build",
|
|
42
38
|
"prepublishOnly": "npm run build"
|
|
43
39
|
},
|
|
44
40
|
"dependencies": {
|
|
45
41
|
"element-plus": "^2.11.3",
|
|
46
|
-
"vue": "^3.
|
|
42
|
+
"vue": "^3.2.0"
|
|
47
43
|
},
|
|
48
44
|
"devDependencies": {
|
|
49
|
-
"@types/node": "^24.10.1",
|
|
50
45
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
51
|
-
"@vue/tsconfig": "^0.8.1",
|
|
52
46
|
"sass": "^1.97.3",
|
|
53
|
-
"
|
|
54
|
-
"vite": "^7.2.4",
|
|
55
|
-
"vite-plugin-dts": "^4.5.4",
|
|
56
|
-
"vue-tsc": "^3.1.4"
|
|
47
|
+
"vite": "^5.4.21"
|
|
57
48
|
}
|
|
58
49
|
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|