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