vue-ui-kit-pro 0.0.13 → 0.0.15
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.
|
@@ -20,9 +20,10 @@ export interface ListPageProps {
|
|
|
20
20
|
onEditSubmit: () => Promise<void>;
|
|
21
21
|
onDeleted: (row: any) => Promise<void>;
|
|
22
22
|
onBeforeEdit: (row?: any) => Promise<void>;
|
|
23
|
-
onEditOpend
|
|
23
|
+
onEditOpend?: () => Promise<void>;
|
|
24
24
|
actionWidth?: number;
|
|
25
25
|
treeProps?: treeProps;
|
|
26
|
+
drawWidth: string;
|
|
26
27
|
}
|
|
27
28
|
export interface ListPageInstance {
|
|
28
29
|
openEdit: () => Promise<void>;
|
package/dist/vue-ui-kit-pro.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.page-container[data-v-
|
|
1
|
+
.page-container[data-v-81380a1d]{height:100%;padding:20px;box-sizing:border-box}.table-btn-container[data-v-81380a1d]{display:flex;justify-content:space-around}.table-container[data-v-81380a1d]{min-height:45%;flex:1;overflow:hidden;margin-bottom:16px}.pagination-container[data-v-81380a1d]{text-align:right;position:relative}.el-pagination[data-v-81380a1d]{position:absolute;right:0}
|
package/dist/vue-ui-kit-pro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as V, ref as c, watch as $, resolveComponent as m, createElementBlock as
|
|
2
|
-
import { ElTable as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as V, ref as c, watch as $, resolveComponent as m, createElementBlock as F, openBlock as O, createVNode as l, createElementVNode as g, withCtx as i, createTextVNode as p, toDisplayString as x, unref as N, mergeProps as W, renderSlot as C } from "vue";
|
|
2
|
+
import { ElTable as L, ElMessage as b } from "element-plus";
|
|
3
|
+
const U = { class: "page-container" }, A = { class: "table-container" }, M = { class: "table-btn-container" }, R = { class: "pagination-container" }, j = /* @__PURE__ */ V({
|
|
4
4
|
__name: "ListPage",
|
|
5
5
|
props: {
|
|
6
6
|
addBtnTitle: {},
|
|
@@ -11,72 +11,73 @@ const A = { class: "page-container" }, M = { class: "table-container" }, R = { c
|
|
|
11
11
|
onBeforeEdit: { type: Function },
|
|
12
12
|
onEditOpend: { type: Function },
|
|
13
13
|
actionWidth: {},
|
|
14
|
-
treeProps: {}
|
|
14
|
+
treeProps: {},
|
|
15
|
+
drawWidth: {}
|
|
15
16
|
},
|
|
16
17
|
setup(r, { expose: y }) {
|
|
17
|
-
const
|
|
18
|
-
await
|
|
18
|
+
const a = r, v = c(), n = c(!1), d = c(1), u = c(10), f = c(), E = async () => {
|
|
19
|
+
await a.onBeforeEdit(), n.value = !0;
|
|
19
20
|
}, h = async (t) => {
|
|
20
21
|
try {
|
|
21
|
-
await
|
|
22
|
+
await a.onBeforeEdit(t), n.value = !0;
|
|
22
23
|
} catch (e) {
|
|
23
24
|
b.error("操作失败," + e);
|
|
24
25
|
}
|
|
25
26
|
}, k = async (t) => {
|
|
26
|
-
await
|
|
27
|
-
},
|
|
27
|
+
await a.onDeleted(t), _();
|
|
28
|
+
}, w = async () => {
|
|
28
29
|
try {
|
|
29
|
-
await
|
|
30
|
+
await a.onEditSubmit(), n.value = !1, _();
|
|
30
31
|
} catch (t) {
|
|
31
32
|
b.error("操作失败:" + t);
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
35
|
$(() => [u.value, d.value], async ([t, e]) => {
|
|
35
|
-
e && t && (f.value = await
|
|
36
|
+
e && t && (f.value = await a.fetechData(e, t));
|
|
36
37
|
}, {
|
|
37
38
|
immediate: !0
|
|
38
39
|
});
|
|
39
|
-
const
|
|
40
|
+
const z = (t) => {
|
|
40
41
|
u.value = t;
|
|
41
42
|
}, D = (t) => {
|
|
42
43
|
d.value = t;
|
|
43
44
|
}, _ = async () => {
|
|
44
|
-
f.value = await
|
|
45
|
+
f.value = await a.fetechData(d.value, u.value);
|
|
45
46
|
};
|
|
46
47
|
return y({
|
|
47
48
|
openEdit: async () => {
|
|
48
|
-
|
|
49
|
+
n.value = !0;
|
|
49
50
|
},
|
|
50
51
|
closeEdit: async () => {
|
|
51
|
-
|
|
52
|
+
n.value = !1;
|
|
52
53
|
},
|
|
53
54
|
reloadTreeChildren: async (t) => {
|
|
54
55
|
if (t) {
|
|
55
|
-
if (!
|
|
56
|
+
if (!a.treeProps?.lazy) return;
|
|
56
57
|
const e = v.value?.store;
|
|
57
58
|
if (!e) return;
|
|
58
|
-
const s = await
|
|
59
|
+
const s = await a.treeProps.load(t);
|
|
59
60
|
e.states.lazyTreeNodeMap.value[t] = s;
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
}), (t, e) => {
|
|
63
64
|
const s = m("el-button"), P = m("el-table-column"), T = m("el-pagination"), S = m("el-drawer");
|
|
64
|
-
return
|
|
65
|
+
return O(), F("div", U, [
|
|
65
66
|
l(s, {
|
|
66
67
|
type: "primary",
|
|
67
68
|
onClick: E
|
|
68
69
|
}, {
|
|
69
70
|
default: i(() => [
|
|
70
|
-
p(
|
|
71
|
+
p(x(a.addBtnTitle), 1)
|
|
71
72
|
]),
|
|
72
73
|
_: 1
|
|
73
74
|
}),
|
|
74
|
-
g("div",
|
|
75
|
-
l(N(
|
|
75
|
+
g("div", A, [
|
|
76
|
+
l(N(L), W({
|
|
76
77
|
ref_key: "tableRef",
|
|
77
78
|
ref: v,
|
|
78
79
|
data: f.value?.value
|
|
79
|
-
},
|
|
80
|
+
}, a.treeProps), {
|
|
80
81
|
default: i(() => [
|
|
81
82
|
C(t.$slots, "table", {}, void 0, !0),
|
|
82
83
|
l(P, {
|
|
@@ -84,7 +85,7 @@ const A = { class: "page-container" }, M = { class: "table-container" }, R = { c
|
|
|
84
85
|
width: r.actionWidth ?? 170
|
|
85
86
|
}, {
|
|
86
87
|
default: i(({ row: o }) => [
|
|
87
|
-
g("div",
|
|
88
|
+
g("div", M, [
|
|
88
89
|
l(s, {
|
|
89
90
|
size: "small",
|
|
90
91
|
onClick: (B) => h(o)
|
|
@@ -113,7 +114,7 @@ const A = { class: "page-container" }, M = { class: "table-container" }, R = { c
|
|
|
113
114
|
_: 3
|
|
114
115
|
}, 16, ["data"])
|
|
115
116
|
]),
|
|
116
|
-
g("div",
|
|
117
|
+
g("div", R, [
|
|
117
118
|
l(T, {
|
|
118
119
|
"current-page": d.value,
|
|
119
120
|
"onUpdate:currentPage": e[0] || (e[0] = (o) => d.value = o),
|
|
@@ -122,21 +123,22 @@ const A = { class: "page-container" }, M = { class: "table-container" }, R = { c
|
|
|
122
123
|
total: f.value?.totalCount,
|
|
123
124
|
layout: "total, prev, pager, next, sizes",
|
|
124
125
|
"page-sizes": [5, 10, 20],
|
|
125
|
-
onSizeChange:
|
|
126
|
+
onSizeChange: z,
|
|
126
127
|
onCurrentChange: D
|
|
127
128
|
}, null, 8, ["current-page", "page-size", "total"])
|
|
128
129
|
]),
|
|
129
130
|
l(S, {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
class: "drawer-wrapper",
|
|
132
|
+
modelValue: n.value,
|
|
133
|
+
"onUpdate:modelValue": e[3] || (e[3] = (o) => n.value = o),
|
|
134
|
+
title: a.editDrawTitle,
|
|
133
135
|
direction: "rtl",
|
|
134
|
-
size:
|
|
135
|
-
onOpened:
|
|
136
|
+
size: r.drawWidth,
|
|
137
|
+
onOpened: a.onEditOpend
|
|
136
138
|
}, {
|
|
137
139
|
footer: i(() => [
|
|
138
140
|
l(s, {
|
|
139
|
-
onClick: e[2] || (e[2] = (o) =>
|
|
141
|
+
onClick: e[2] || (e[2] = (o) => n.value = !1)
|
|
140
142
|
}, {
|
|
141
143
|
default: i(() => [...e[6] || (e[6] = [
|
|
142
144
|
p("取消", -1)
|
|
@@ -145,7 +147,7 @@ const A = { class: "page-container" }, M = { class: "table-container" }, R = { c
|
|
|
145
147
|
}),
|
|
146
148
|
l(s, {
|
|
147
149
|
type: "primary",
|
|
148
|
-
onClick:
|
|
150
|
+
onClick: w
|
|
149
151
|
}, {
|
|
150
152
|
default: i(() => [...e[7] || (e[7] = [
|
|
151
153
|
p("确定", -1)
|
|
@@ -157,16 +159,16 @@ const A = { class: "page-container" }, M = { class: "table-container" }, R = { c
|
|
|
157
159
|
C(t.$slots, "form", {}, void 0, !0)
|
|
158
160
|
]),
|
|
159
161
|
_: 3
|
|
160
|
-
}, 8, ["modelValue", "title", "onOpened"])
|
|
162
|
+
}, 8, ["modelValue", "title", "size", "onOpened"])
|
|
161
163
|
]);
|
|
162
164
|
};
|
|
163
165
|
}
|
|
164
166
|
}), q = (r, y) => {
|
|
165
|
-
const
|
|
166
|
-
for (const [v,
|
|
167
|
-
|
|
168
|
-
return
|
|
169
|
-
}, G = /* @__PURE__ */ q(j, [["__scopeId", "data-v-
|
|
167
|
+
const a = r.__vccOpts || r;
|
|
168
|
+
for (const [v, n] of y)
|
|
169
|
+
a[v] = n;
|
|
170
|
+
return a;
|
|
171
|
+
}, G = /* @__PURE__ */ q(j, [["__scopeId", "data-v-81380a1d"]]), Y = (r) => {
|
|
170
172
|
r.component("ListPage", G);
|
|
171
173
|
};
|
|
172
174
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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"},h={class:"table-container"},_={class:"table-btn-container"},V={class:"pagination-container"},C=((i,m)=>{const o=i.__vccOpts||i;for(const[p,a]of m)o[p]=a;return o})(e.defineComponent({__name:"ListPage",props:{addBtnTitle:{},editDrawTitle:{},fetechData:{type:Function},onEditSubmit:{type:Function},onDeleted:{type:Function},onBeforeEdit:{type:Function},onEditOpend:{type:Function},actionWidth:{},treeProps:{},drawWidth:{}},setup(i,{expose:m}){const o=i,p=e.ref(),a=e.ref(!1),d=e.ref(1),c=e.ref(10),f=e.ref(),E=async()=>{await o.onBeforeEdit(),a.value=!0},b=async n=>{try{await o.onBeforeEdit(n),a.value=!0}catch(t){u.ElMessage.error("操作失败,"+t)}},N=async n=>{await o.onDeleted(n),y()},x=async()=>{try{await o.onEditSubmit(),a.value=!1,y()}catch(n){u.ElMessage.error("操作失败:"+n)}};e.watch(()=>[c.value,d.value],async([n,t])=>{t&&n&&(f.value=await o.fetechData(t,n))},{immediate:!0});const T=n=>{c.value=n},k=n=>{d.value=n},y=async()=>{f.value=await o.fetechData(d.value,c.value)};return m({openEdit:async()=>{a.value=!0},closeEdit:async()=>{a.value=!1},reloadTreeChildren:async n=>{if(n){if(!o.treeProps?.lazy)return;const t=p.value?.store;if(!t)return;const s=await o.treeProps.load(n);t.states.lazyTreeNodeMap.value[n]=s}}}),(n,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:E},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.addBtnTitle),1)]),_:1}),e.createElementVNode("div",h,[e.createVNode(e.unref(u.ElTable),e.mergeProps({ref_key:"tableRef",ref:p,data:f.value?.value},o.treeProps),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"table",{},void 0,!0),e.createVNode(z,{label:"操作",width:i.actionWidth??170},{default:e.withCtx(({row:l})=>[e.createElementVNode("div",_,[e.createVNode(s,{size:"small",onClick:D=>b(l)},{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode("编辑",-1)])]),_:1},8,["onClick"]),e.renderSlot(n.$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,{class:"drawer-wrapper",modelValue:a.value,"onUpdate:modelValue":t[3]||(t[3]=l=>a.value=l),title:o.editDrawTitle,direction:"rtl",size:i.drawWidth,onOpened:o.onEditOpend},{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:x},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("确定",-1)])]),_:1})]),default:e.withCtx(()=>[e.renderSlot(n.$slots,"form",{},void 0,!0)]),_:3},8,["modelValue","title","size","onOpened"])])}}}),[["__scopeId","data-v-81380a1d"]]),w=i=>{i.component("ListPage",C)};r.ListPage=C,r.default=w,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|