vue-ui-kit-pro 0.0.10 → 0.0.11
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/dist/index.d.ts +2 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/vue-ui-kit-pro.js +49 -50
- package/dist/vue-ui-kit-pro.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/src/index.d.ts
CHANGED
package/dist/vue-ui-kit-pro.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as V, ref as
|
|
2
|
-
import { ElTable as
|
|
1
|
+
import { defineComponent as V, ref as c, watch as $, resolveComponent as m, createElementBlock as x, openBlock as F, createVNode as l, createElementVNode as g, withCtx as i, createTextVNode as p, toDisplayString as N, unref as L, mergeProps as U, renderSlot as C } from "vue";
|
|
2
|
+
import { ElTable as A, ElMessage as b } from "element-plus";
|
|
3
3
|
const M = { class: "page-container" }, R = { class: "table-container" }, W = { class: "table-btn-container" }, O = { class: "pagination-container" }, j = /* @__PURE__ */ V({
|
|
4
4
|
__name: "ListPage",
|
|
5
5
|
props: {
|
|
@@ -12,8 +12,8 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
12
12
|
actionWidth: {},
|
|
13
13
|
treeProps: {}
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const a =
|
|
15
|
+
setup(r, { expose: y }) {
|
|
16
|
+
const a = r, v = c(), n = c(!1), d = c(1), u = c(10), f = c(), E = async () => {
|
|
17
17
|
await a.onBeforeEdit(), n.value = !0;
|
|
18
18
|
}, h = async (t) => {
|
|
19
19
|
try {
|
|
@@ -30,19 +30,19 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
30
30
|
b.error("操作失败:" + t);
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
$(() => [
|
|
34
|
-
e && t && (
|
|
33
|
+
$(() => [u.value, d.value], async ([t, e]) => {
|
|
34
|
+
e && t && (f.value = await a.fetechData(e, t));
|
|
35
35
|
}, {
|
|
36
36
|
immediate: !0
|
|
37
37
|
});
|
|
38
38
|
const w = (t) => {
|
|
39
|
-
c.value = t;
|
|
40
|
-
}, D = (t) => {
|
|
41
39
|
u.value = t;
|
|
40
|
+
}, D = (t) => {
|
|
41
|
+
d.value = t;
|
|
42
42
|
}, _ = async () => {
|
|
43
|
-
|
|
43
|
+
f.value = await a.fetechData(d.value, u.value);
|
|
44
44
|
};
|
|
45
|
-
return
|
|
45
|
+
return y({
|
|
46
46
|
openEdit: async () => {
|
|
47
47
|
n.value = !0;
|
|
48
48
|
},
|
|
@@ -54,53 +54,53 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
54
54
|
if (!a.treeProps?.lazy) return;
|
|
55
55
|
const e = v.value?.store;
|
|
56
56
|
if (!e) return;
|
|
57
|
-
const
|
|
58
|
-
e.states.lazyTreeNodeMap.value[t] =
|
|
57
|
+
const s = await a.treeProps.load(t);
|
|
58
|
+
e.states.lazyTreeNodeMap.value[t] = s;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}), (t, e) => {
|
|
62
|
-
const
|
|
62
|
+
const s = m("el-button"), P = m("el-table-column"), T = m("el-pagination"), S = m("el-drawer");
|
|
63
63
|
return F(), x("div", M, [
|
|
64
|
-
l(
|
|
64
|
+
l(s, {
|
|
65
65
|
type: "primary",
|
|
66
66
|
onClick: E
|
|
67
67
|
}, {
|
|
68
|
-
default:
|
|
69
|
-
|
|
68
|
+
default: i(() => [
|
|
69
|
+
p(N(a.addBtnTitle), 1)
|
|
70
70
|
]),
|
|
71
71
|
_: 1
|
|
72
72
|
}),
|
|
73
73
|
g("div", R, [
|
|
74
|
-
l(
|
|
74
|
+
l(L(A), U({
|
|
75
75
|
ref_key: "tableRef",
|
|
76
76
|
ref: v,
|
|
77
|
-
data:
|
|
77
|
+
data: f.value?.value
|
|
78
78
|
}, a.treeProps), {
|
|
79
|
-
default:
|
|
79
|
+
default: i(() => [
|
|
80
80
|
C(t.$slots, "table", {}, void 0, !0),
|
|
81
|
-
l(
|
|
81
|
+
l(P, {
|
|
82
82
|
label: "操作",
|
|
83
|
-
width:
|
|
83
|
+
width: r.actionWidth ?? 170
|
|
84
84
|
}, {
|
|
85
|
-
default:
|
|
85
|
+
default: i(({ row: o }) => [
|
|
86
86
|
g("div", W, [
|
|
87
|
-
l(
|
|
87
|
+
l(s, {
|
|
88
88
|
size: "small",
|
|
89
89
|
onClick: (B) => h(o)
|
|
90
90
|
}, {
|
|
91
|
-
default:
|
|
92
|
-
|
|
91
|
+
default: i(() => [...e[4] || (e[4] = [
|
|
92
|
+
p("编辑", -1)
|
|
93
93
|
])]),
|
|
94
94
|
_: 1
|
|
95
95
|
}, 8, ["onClick"]),
|
|
96
96
|
C(t.$slots, "tableActions", { row: o }, void 0, !0),
|
|
97
|
-
l(
|
|
97
|
+
l(s, {
|
|
98
98
|
size: "small",
|
|
99
99
|
type: "danger",
|
|
100
100
|
onClick: (B) => k(o)
|
|
101
101
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
|
|
102
|
+
default: i(() => [...e[5] || (e[5] = [
|
|
103
|
+
p("删除", -1)
|
|
104
104
|
])]),
|
|
105
105
|
_: 1
|
|
106
106
|
}, 8, ["onClick"])
|
|
@@ -113,12 +113,12 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
113
113
|
}, 16, ["data"])
|
|
114
114
|
]),
|
|
115
115
|
g("div", O, [
|
|
116
|
-
l(
|
|
117
|
-
"current-page":
|
|
118
|
-
"onUpdate:currentPage": e[0] || (e[0] = (o) =>
|
|
119
|
-
"page-size":
|
|
120
|
-
"onUpdate:pageSize": e[1] || (e[1] = (o) =>
|
|
121
|
-
total:
|
|
116
|
+
l(T, {
|
|
117
|
+
"current-page": d.value,
|
|
118
|
+
"onUpdate:currentPage": e[0] || (e[0] = (o) => d.value = o),
|
|
119
|
+
"page-size": u.value,
|
|
120
|
+
"onUpdate:pageSize": e[1] || (e[1] = (o) => u.value = o),
|
|
121
|
+
total: f.value?.totalCount,
|
|
122
122
|
layout: "total, prev, pager, next, sizes",
|
|
123
123
|
"page-sizes": [5, 10, 20],
|
|
124
124
|
onSizeChange: w,
|
|
@@ -132,26 +132,26 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
132
132
|
direction: "rtl",
|
|
133
133
|
size: "400px"
|
|
134
134
|
}, {
|
|
135
|
-
footer:
|
|
136
|
-
l(
|
|
135
|
+
footer: i(() => [
|
|
136
|
+
l(s, {
|
|
137
137
|
onClick: e[2] || (e[2] = (o) => n.value = !1)
|
|
138
138
|
}, {
|
|
139
|
-
default:
|
|
140
|
-
|
|
139
|
+
default: i(() => [...e[6] || (e[6] = [
|
|
140
|
+
p("取消", -1)
|
|
141
141
|
])]),
|
|
142
142
|
_: 1
|
|
143
143
|
}),
|
|
144
|
-
l(
|
|
144
|
+
l(s, {
|
|
145
145
|
type: "primary",
|
|
146
146
|
onClick: z
|
|
147
147
|
}, {
|
|
148
|
-
default:
|
|
149
|
-
|
|
148
|
+
default: i(() => [...e[7] || (e[7] = [
|
|
149
|
+
p("确定", -1)
|
|
150
150
|
])]),
|
|
151
151
|
_: 1
|
|
152
152
|
})
|
|
153
153
|
]),
|
|
154
|
-
default:
|
|
154
|
+
default: i(() => [
|
|
155
155
|
C(t.$slots, "form", {}, void 0, !0)
|
|
156
156
|
]),
|
|
157
157
|
_: 3
|
|
@@ -159,16 +159,15 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
159
159
|
]);
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
}), q = (
|
|
163
|
-
const a =
|
|
164
|
-
for (const [v, n] of
|
|
162
|
+
}), q = (r, y) => {
|
|
163
|
+
const a = r.__vccOpts || r;
|
|
164
|
+
for (const [v, n] of y)
|
|
165
165
|
a[v] = n;
|
|
166
166
|
return a;
|
|
167
|
-
}, G = /* @__PURE__ */ q(j, [["__scopeId", "data-v-27efd3c7"]]),
|
|
168
|
-
|
|
169
|
-
s.component(d.name, d);
|
|
170
|
-
});
|
|
167
|
+
}, G = /* @__PURE__ */ q(j, [["__scopeId", "data-v-27efd3c7"]]), Y = (r) => {
|
|
168
|
+
r.component("ListPage", G);
|
|
171
169
|
};
|
|
172
170
|
export {
|
|
173
|
-
|
|
171
|
+
G as ListPage,
|
|
172
|
+
Y as default
|
|
174
173
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e
|
|
1
|
+
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r["vue-ui-kit-pro"]={},r.Vue,r.ElementPlus))})(this,(function(r,e,u){"use strict";const g={class:"page-container"},_={class:"table-container"},h={class:"table-btn-container"},V={class:"pagination-container"},C=((i,m)=>{const n=i.__vccOpts||i;for(const[p,a]of m)n[p]=a;return n})(e.defineComponent({__name:"ListPage",props:{addBtnTitle:{},editDrawTitle:{},fetechData:{type:Function},onEditSubmit:{type:Function},onDeleted:{type:Function},onBeforeEdit:{type:Function},actionWidth:{},treeProps:{}},setup(i,{expose:m}){const n=i,p=e.ref(),a=e.ref(!1),d=e.ref(1),c=e.ref(10),f=e.ref(),x=async()=>{await n.onBeforeEdit(),a.value=!0},E=async o=>{try{await n.onBeforeEdit(o),a.value=!0}catch(t){u.ElMessage.error("操作失败,"+t)}},N=async o=>{await n.onDeleted(o),y()},w=async()=>{try{await n.onEditSubmit(),a.value=!1,y()}catch(o){u.ElMessage.error("操作失败:"+o)}};e.watch(()=>[c.value,d.value],async([o,t])=>{t&&o&&(f.value=await n.fetechData(t,o))},{immediate:!0});const T=o=>{c.value=o},k=o=>{d.value=o},y=async()=>{f.value=await n.fetechData(d.value,c.value)};return m({openEdit:async()=>{a.value=!0},closeEdit:async()=>{a.value=!1},reloadTreeChildren:async o=>{if(o){if(!n.treeProps?.lazy)return;const t=p.value?.store;if(!t)return;const s=await n.treeProps.load(o);t.states.lazyTreeNodeMap.value[o]=s}}}),(o,t)=>{const s=e.resolveComponent("el-button"),z=e.resolveComponent("el-table-column"),S=e.resolveComponent("el-pagination"),P=e.resolveComponent("el-drawer");return e.openBlock(),e.createElementBlock("div",g,[e.createVNode(s,{type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.addBtnTitle),1)]),_:1}),e.createElementVNode("div",_,[e.createVNode(e.unref(u.ElTable),e.mergeProps({ref_key:"tableRef",ref:p,data:f.value?.value},n.treeProps),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"table",{},void 0,!0),e.createVNode(z,{label:"操作",width:i.actionWidth??170},{default:e.withCtx(({row:l})=>[e.createElementVNode("div",h,[e.createVNode(s,{size:"small",onClick:D=>E(l)},{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode("编辑",-1)])]),_:1},8,["onClick"]),e.renderSlot(o.$slots,"tableActions",{row:l},void 0,!0),e.createVNode(s,{size:"small",type:"danger",onClick:D=>N(l)},{default:e.withCtx(()=>[...t[5]||(t[5]=[e.createTextVNode("删除",-1)])]),_:1},8,["onClick"])])]),_:3},8,["width"])]),_:3},16,["data"])]),e.createElementVNode("div",V,[e.createVNode(S,{"current-page":d.value,"onUpdate:currentPage":t[0]||(t[0]=l=>d.value=l),"page-size":c.value,"onUpdate:pageSize":t[1]||(t[1]=l=>c.value=l),total:f.value?.totalCount,layout:"total, prev, pager, next, sizes","page-sizes":[5,10,20],onSizeChange:T,onCurrentChange:k},null,8,["current-page","page-size","total"])]),e.createVNode(P,{modelValue:a.value,"onUpdate:modelValue":t[3]||(t[3]=l=>a.value=l),title:n.editDrawTitle,direction:"rtl",size:"400px"},{footer:e.withCtx(()=>[e.createVNode(s,{onClick:t[2]||(t[2]=l=>a.value=!1)},{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(s,{type:"primary",onClick:w},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("确定",-1)])]),_:1})]),default:e.withCtx(()=>[e.renderSlot(o.$slots,"form",{},void 0,!0)]),_:3},8,["modelValue","title"])])}}}),[["__scopeId","data-v-27efd3c7"]]),b=i=>{i.component("ListPage",C)};r.ListPage=C,r.default=b,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|