vue-ui-kit-pro 0.0.7 → 0.0.9
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/src/index.d.ts +3 -6
- package/dist/vue-ui-kit-pro.js +35 -37
- package/dist/vue-ui-kit-pro.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
install: (app: any) => void;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
1
|
+
import { default as ListPage } from './components/ListPage.vue';
|
|
2
|
+
export { ListPage };
|
|
3
|
+
export default ListPage;
|
package/dist/vue-ui-kit-pro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElTable as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as $, ref as c, watch as x, resolveComponent as m, createElementBlock as F, openBlock as N, createVNode as l, createElementVNode as g, withCtx as i, createTextVNode as p, toDisplayString as U, unref as A, mergeProps as L, renderSlot as C } from "vue";
|
|
2
|
+
import { ElTable as M, ElMessage as E } from "element-plus";
|
|
3
|
+
const R = { class: "page-container" }, W = { class: "table-container" }, O = { class: "table-btn-container" }, j = { class: "pagination-container" }, q = /* @__PURE__ */ $({
|
|
4
4
|
__name: "ListPage",
|
|
5
5
|
props: {
|
|
6
6
|
addBtnTitle: {},
|
|
@@ -13,21 +13,21 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
13
13
|
treeProps: {}
|
|
14
14
|
},
|
|
15
15
|
setup(r, { expose: y }) {
|
|
16
|
-
const a = r, v = c(), n = c(!1), d = c(1), u = c(10), f = c(),
|
|
16
|
+
const a = r, v = c(), n = c(!1), d = c(1), u = c(10), f = c(), h = async () => {
|
|
17
17
|
await a.onBeforeEdit(), n.value = !0;
|
|
18
|
-
},
|
|
18
|
+
}, k = async (t) => {
|
|
19
19
|
try {
|
|
20
20
|
await a.onBeforeEdit(t), n.value = !0;
|
|
21
21
|
} catch (e) {
|
|
22
|
-
|
|
22
|
+
E.error("操作失败," + e);
|
|
23
23
|
}
|
|
24
|
-
},
|
|
25
|
-
await a.onDeleted(t),
|
|
26
|
-
},
|
|
24
|
+
}, z = async (t) => {
|
|
25
|
+
await a.onDeleted(t), b();
|
|
26
|
+
}, w = async () => {
|
|
27
27
|
try {
|
|
28
|
-
await a.onEditSubmit(), n.value = !1,
|
|
28
|
+
await a.onEditSubmit(), n.value = !1, b();
|
|
29
29
|
} catch (t) {
|
|
30
|
-
|
|
30
|
+
E.error("操作失败:" + t);
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
x(() => [u.value, d.value], async ([t, e]) => {
|
|
@@ -35,11 +35,11 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
35
35
|
}, {
|
|
36
36
|
immediate: !0
|
|
37
37
|
});
|
|
38
|
-
const
|
|
38
|
+
const D = (t) => {
|
|
39
39
|
u.value = t;
|
|
40
|
-
},
|
|
40
|
+
}, T = (t) => {
|
|
41
41
|
d.value = t;
|
|
42
|
-
},
|
|
42
|
+
}, b = async () => {
|
|
43
43
|
f.value = await a.fetechData(d.value, u.value);
|
|
44
44
|
};
|
|
45
45
|
return y({
|
|
@@ -59,19 +59,19 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}), (t, e) => {
|
|
62
|
-
const s = m("el-button"), P = m("el-table-column"),
|
|
63
|
-
return
|
|
62
|
+
const s = m("el-button"), P = m("el-table-column"), S = m("el-pagination"), B = m("el-drawer");
|
|
63
|
+
return N(), F("div", R, [
|
|
64
64
|
l(s, {
|
|
65
65
|
type: "primary",
|
|
66
|
-
onClick:
|
|
66
|
+
onClick: h
|
|
67
67
|
}, {
|
|
68
68
|
default: i(() => [
|
|
69
|
-
p(
|
|
69
|
+
p(U(a.addBtnTitle), 1)
|
|
70
70
|
]),
|
|
71
71
|
_: 1
|
|
72
72
|
}),
|
|
73
|
-
g("div",
|
|
74
|
-
l(
|
|
73
|
+
g("div", W, [
|
|
74
|
+
l(A(M), L({
|
|
75
75
|
ref_key: "tableRef",
|
|
76
76
|
ref: v,
|
|
77
77
|
data: f.value?.value
|
|
@@ -83,10 +83,10 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
83
83
|
width: r.actionWidth ?? 170
|
|
84
84
|
}, {
|
|
85
85
|
default: i(({ row: o }) => [
|
|
86
|
-
g("div",
|
|
86
|
+
g("div", O, [
|
|
87
87
|
l(s, {
|
|
88
88
|
size: "small",
|
|
89
|
-
onClick: (
|
|
89
|
+
onClick: (V) => k(o)
|
|
90
90
|
}, {
|
|
91
91
|
default: i(() => [...e[4] || (e[4] = [
|
|
92
92
|
p("编辑", -1)
|
|
@@ -97,7 +97,7 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
97
97
|
l(s, {
|
|
98
98
|
size: "small",
|
|
99
99
|
type: "danger",
|
|
100
|
-
onClick: (
|
|
100
|
+
onClick: (V) => z(o)
|
|
101
101
|
}, {
|
|
102
102
|
default: i(() => [...e[5] || (e[5] = [
|
|
103
103
|
p("删除", -1)
|
|
@@ -112,8 +112,8 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
112
112
|
_: 3
|
|
113
113
|
}, 16, ["data"])
|
|
114
114
|
]),
|
|
115
|
-
g("div",
|
|
116
|
-
l(
|
|
115
|
+
g("div", j, [
|
|
116
|
+
l(S, {
|
|
117
117
|
"current-page": d.value,
|
|
118
118
|
"onUpdate:currentPage": e[0] || (e[0] = (o) => d.value = o),
|
|
119
119
|
"page-size": u.value,
|
|
@@ -121,11 +121,11 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
121
121
|
total: f.value?.totalCount,
|
|
122
122
|
layout: "total, prev, pager, next, sizes",
|
|
123
123
|
"page-sizes": [5, 10, 20],
|
|
124
|
-
onSizeChange:
|
|
125
|
-
onCurrentChange:
|
|
124
|
+
onSizeChange: D,
|
|
125
|
+
onCurrentChange: T
|
|
126
126
|
}, null, 8, ["current-page", "page-size", "total"])
|
|
127
127
|
]),
|
|
128
|
-
l(
|
|
128
|
+
l(B, {
|
|
129
129
|
modelValue: n.value,
|
|
130
130
|
"onUpdate:modelValue": e[3] || (e[3] = (o) => n.value = o),
|
|
131
131
|
title: a.editDrawTitle,
|
|
@@ -143,7 +143,7 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
143
143
|
}),
|
|
144
144
|
l(s, {
|
|
145
145
|
type: "primary",
|
|
146
|
-
onClick:
|
|
146
|
+
onClick: w
|
|
147
147
|
}, {
|
|
148
148
|
default: i(() => [...e[7] || (e[7] = [
|
|
149
149
|
p("确定", -1)
|
|
@@ -159,18 +159,16 @@ const M = { class: "page-container" }, R = { class: "table-container" }, W = { c
|
|
|
159
159
|
]);
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
}),
|
|
162
|
+
}), G = (r, y) => {
|
|
163
163
|
const a = r.__vccOpts || r;
|
|
164
164
|
for (const [v, n] of y)
|
|
165
165
|
a[v] = n;
|
|
166
166
|
return a;
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
r.component("ListPage", G);
|
|
171
|
-
}
|
|
167
|
+
}, _ = /* @__PURE__ */ G(q, [["__scopeId", "data-v-27efd3c7"]]);
|
|
168
|
+
_.install = (r) => {
|
|
169
|
+
r.component(_.name, _);
|
|
172
170
|
};
|
|
173
171
|
export {
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
_ as ListPage,
|
|
173
|
+
_ as default
|
|
176
174
|
};
|
|
@@ -1 +1 @@
|
|
|
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.VueUiKitPro={},r.Vue,r.ElementPlus))})(this,(function(r,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.VueUiKitPro={},r.Vue,r.ElementPlus))})(this,(function(r,e,m){"use strict";const _={class:"page-container"},g={class:"table-container"},h={class:"table-btn-container"},V={class:"pagination-container"},d=((i,C)=>{const n=i.__vccOpts||i;for(const[f,a]of C)n[f]=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:C}){const n=i,f=e.ref(),a=e.ref(!1),c=e.ref(1),p=e.ref(10),u=e.ref(),b=async()=>{await n.onBeforeEdit(),a.value=!0},x=async o=>{try{await n.onBeforeEdit(o),a.value=!0}catch(t){m.ElMessage.error("操作失败,"+t)}},E=async o=>{await n.onDeleted(o),y()},N=async()=>{try{await n.onEditSubmit(),a.value=!1,y()}catch(o){m.ElMessage.error("操作失败:"+o)}};e.watch(()=>[p.value,c.value],async([o,t])=>{t&&o&&(u.value=await n.fetechData(t,o))},{immediate:!0});const w=o=>{p.value=o},T=o=>{c.value=o},y=async()=>{u.value=await n.fetechData(c.value,p.value)};return C({openEdit:async()=>{a.value=!0},closeEdit:async()=>{a.value=!1},reloadTreeChildren:async o=>{if(o){if(!n.treeProps?.lazy)return;const t=f.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"),k=e.resolveComponent("el-table-column"),z=e.resolveComponent("el-pagination"),S=e.resolveComponent("el-drawer");return e.openBlock(),e.createElementBlock("div",_,[e.createVNode(s,{type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.addBtnTitle),1)]),_:1}),e.createElementVNode("div",g,[e.createVNode(e.unref(m.ElTable),e.mergeProps({ref_key:"tableRef",ref:f,data:u.value?.value},n.treeProps),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"table",{},void 0,!0),e.createVNode(k,{label:"操作",width:i.actionWidth??170},{default:e.withCtx(({row:l})=>[e.createElementVNode("div",h,[e.createVNode(s,{size:"small",onClick:P=>x(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:P=>E(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(z,{"current-page":c.value,"onUpdate:currentPage":t[0]||(t[0]=l=>c.value=l),"page-size":p.value,"onUpdate:pageSize":t[1]||(t[1]=l=>p.value=l),total:u.value?.totalCount,layout:"total, prev, pager, next, sizes","page-sizes":[5,10,20],onSizeChange:w,onCurrentChange:T},null,8,["current-page","page-size","total"])]),e.createVNode(S,{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:N},{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"]]);d.install=i=>{i.component(d.name,d)},r.ListPage=d,r.default=d,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|