wtsk-comps 1.1.18 → 1.2.0
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 +1 -2
- package/dist/wtsk-comps.cjs.js +1 -1
- package/dist/wtsk-comps.es.js +30 -665
- package/dist/wtsk-comps.umd.js +1 -1
- package/package.json +11 -7
package/README.md
CHANGED
package/dist/wtsk-comps.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
"use strict";const t=require("vue"),u=t.defineComponent({name:"WtskBtn",inheritAttrs:!1,__name:"WtskBtn",setup(r){const o=t.useAttrs(),n=t.ref(!1);function a(e,l){const s={};for(const c in e)c!==l&&(s[c]=e[c]);return s}async function i(){n.value=!0;try{typeof o.onClick=="function"&&await o.onClick?.()}finally{n.value=!1}}return(e,l)=>{const s=t.resolveComponent("el-button");return t.openBlock(),t.createBlock(s,t.mergeProps(a(e.$attrs,"onClick"),{loading:n.value,onClick:i}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["loading"])}}}),f=[{name:"WtskBtn",component:u}],p={install(r){f.forEach(({name:o,component:n})=>{r.component(o,n)})}};module.exports=p;
|
package/dist/wtsk-comps.es.js
CHANGED
|
@@ -1,684 +1,49 @@
|
|
|
1
|
-
import { useAttrs as
|
|
2
|
-
|
|
3
|
-
const ae = {
|
|
4
|
-
name: "WtskBtn"
|
|
5
|
-
}, oe = /* @__PURE__ */ Object.assign(ae, {
|
|
1
|
+
import { defineComponent as i, useAttrs as f, ref as u, resolveComponent as m, openBlock as p, createBlock as k, mergeProps as _, withCtx as d, renderSlot as C } from "vue";
|
|
2
|
+
const B = /* @__PURE__ */ i({
|
|
6
3
|
name: "WtskBtn",
|
|
7
|
-
inheritAttrs: !1
|
|
8
|
-
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
for (const
|
|
14
|
-
|
|
15
|
-
return
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "WtskBtn",
|
|
6
|
+
setup(l) {
|
|
7
|
+
const e = f(), t = u(!1);
|
|
8
|
+
function a(n, r) {
|
|
9
|
+
const o = {};
|
|
10
|
+
for (const s in n)
|
|
11
|
+
s !== r && (o[s] = n[s]);
|
|
12
|
+
return o;
|
|
16
13
|
}
|
|
17
14
|
async function c() {
|
|
18
|
-
|
|
19
|
-
b.value = !0;
|
|
15
|
+
t.value = !0;
|
|
20
16
|
try {
|
|
21
|
-
|
|
17
|
+
typeof e.onClick == "function" && await e.onClick?.();
|
|
22
18
|
} finally {
|
|
23
|
-
|
|
19
|
+
t.value = !1;
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
|
-
return (
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
loading:
|
|
22
|
+
return (n, r) => {
|
|
23
|
+
const o = m("el-button");
|
|
24
|
+
return p(), k(o, _(a(n.$attrs, "onClick"), {
|
|
25
|
+
loading: t.value,
|
|
30
26
|
onClick: c
|
|
31
27
|
}), {
|
|
32
|
-
default:
|
|
33
|
-
|
|
28
|
+
default: d(() => [
|
|
29
|
+
C(n.$slots, "default")
|
|
34
30
|
]),
|
|
35
31
|
_: 3
|
|
36
32
|
}, 16, ["loading"]);
|
|
37
33
|
};
|
|
38
34
|
}
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
name:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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);
|
|
35
|
+
}), v = [
|
|
36
|
+
{ name: "WtskBtn", component: B }
|
|
37
|
+
// { name: 'WtskTree', component: WtskTree },
|
|
38
|
+
// { name: 'WtskForm', component: WtskForm },
|
|
39
|
+
// { name: 'WtskTable', component: WtskTable }
|
|
40
|
+
], g = {
|
|
41
|
+
install(l) {
|
|
42
|
+
v.forEach(({ name: e, component: t }) => {
|
|
43
|
+
l.component(e, t);
|
|
679
44
|
});
|
|
680
45
|
}
|
|
681
46
|
};
|
|
682
47
|
export {
|
|
683
|
-
|
|
48
|
+
g as default
|
|
684
49
|
};
|
package/dist/wtsk-comps.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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)})}}});
|
|
1
|
+
(function(t,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(t=typeof globalThis<"u"?globalThis:t||self,t.WtskComps=o(t.Vue))})(this,(function(t){"use strict";const l=[{name:"WtskBtn",component:t.defineComponent({name:"WtskBtn",inheritAttrs:!1,__name:"WtskBtn",setup(r){const s=t.useAttrs(),n=t.ref(!1);function a(e,f){const i={};for(const c in e)c!==f&&(i[c]=e[c]);return i}async function u(){n.value=!0;try{typeof s.onClick=="function"&&await s.onClick?.()}finally{n.value=!1}}return(e,f)=>{const i=t.resolveComponent("el-button");return t.openBlock(),t.createBlock(i,t.mergeProps(a(e.$attrs,"onClick"),{loading:n.value,onClick:u}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["loading"])}}})}];return{install(r){l.forEach(({name:s,component:n})=>{r.component(s,n)})}}}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wtsk-comps",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Vue3+Element Plus基础组件库(wtsk-btn/form/table/tree)",
|
|
5
5
|
"author": "lujh",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"element-plus": "^2.11.
|
|
29
|
-
"vue": "^3.
|
|
28
|
+
"element-plus": "^2.11.3",
|
|
29
|
+
"vue": "^3.5.24"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": ">=20.0.0",
|
|
@@ -34,16 +34,20 @@
|
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"dev": "vite",
|
|
37
|
-
"build": "vite build",
|
|
37
|
+
"build": "vue-tsc -b && vite build",
|
|
38
38
|
"prepublishOnly": "npm run build"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"element-plus": "
|
|
42
|
-
"vue": "^3.
|
|
41
|
+
"element-plus": "2.11.3",
|
|
42
|
+
"vue": "^3.5.24"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
+
"@types/node": "^24.10.1",
|
|
45
46
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
47
|
+
"@vue/tsconfig": "^0.8.1",
|
|
46
48
|
"sass": "^1.97.3",
|
|
47
|
-
"
|
|
49
|
+
"typescript": "~5.9.3",
|
|
50
|
+
"vite": "^7.2.4",
|
|
51
|
+
"vue-tsc": "^3.1.4"
|
|
48
52
|
}
|
|
49
53
|
}
|