kouxiangtang 0.0.9 → 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/README.md +19 -4
- package/dist/ImageUploader-CIMFMJHg.js +98 -0
- package/dist/{RichTextEditor-DN5lXRly.js → RichTextEditor-BMsUo6Ib.js} +1 -1
- package/dist/index-z9s-vTIc.js +6311 -0
- package/dist/kouxiangtang.js +8 -8
- package/dist/kouxiangtang.umd.cjs +9 -76
- package/dist/style.css +1 -1
- package/package.json +6 -6
- package/dist/ImageUploader-CPznrVNu.js +0 -98
- package/dist/index-CUGZtXHB.js +0 -32813
package/README.md
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# KouXiangTang - 口香糖
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
通用的管理后台前端框架,此框架带有明确的后台数据管理目的
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- 定义一个领域模型(`domain`)
|
|
6
|
+
- 每个领域模型都有列表页
|
|
7
|
+
- 每个领域模型都有详情页
|
|
8
|
+
- 每个领域模型根据 `API` 接口情况提供标准的增删改查的操作
|
|
9
|
+
- 列表页提供可配置的数据过滤方式
|
|
10
|
+
- 提供针对列表页数据集的批量操作(`PageAction`)
|
|
11
|
+
- 提供针对单条数据的操作(`RowAction`)
|
|
12
|
+
- 提供针对数据关联的显示
|
|
13
|
+
- 从属于:`beongs-to`
|
|
14
|
+
- 一对多:`has-many`
|
|
6
15
|
|
|
7
|
-
|
|
16
|
+
## DefineDomain
|
|
17
|
+
|
|
18
|
+
参考 [define-domain](./doc/define-domain.md)
|
|
19
|
+
|
|
20
|
+
## Rest Route
|
|
21
|
+
|
|
22
|
+
参考 [route](./doc/route.md)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { resolveComponent as m, openBlock as t, createBlock as l, unref as c, withCtx as a, renderSlot as y, createElementVNode as x, createVNode as n, withModifiers as B, createCommentVNode as C } from "vue";
|
|
2
|
+
import { _ as I, b as M, l as b, p as S, d as E, a as L } from "./index-z9s-vTIc.js";
|
|
3
|
+
import { ElMessage as p, ElLoading as u } from "element-plus";
|
|
4
|
+
const N = { class: "image-slot" }, V = {
|
|
5
|
+
__name: "ImageUploader",
|
|
6
|
+
props: {
|
|
7
|
+
imageUrl: { type: String }
|
|
8
|
+
},
|
|
9
|
+
emits: ["on-success"],
|
|
10
|
+
setup(_, { emit: h }) {
|
|
11
|
+
const g = h, r = _, f = M().imageUploadUrl;
|
|
12
|
+
`${localStorage.getItem("token")}`;
|
|
13
|
+
const U = (e) => {
|
|
14
|
+
if (!(e.size / 1024 / 1024 < 5))
|
|
15
|
+
return p({
|
|
16
|
+
message: "上传大小不能超过 5MB!",
|
|
17
|
+
type: "warning"
|
|
18
|
+
}), !1;
|
|
19
|
+
}, k = (e) => {
|
|
20
|
+
g("on-success", e.data.imageUrl);
|
|
21
|
+
};
|
|
22
|
+
function w() {
|
|
23
|
+
console.log("删除"), g("on-success", "");
|
|
24
|
+
}
|
|
25
|
+
function v(e) {
|
|
26
|
+
return u.service({ text: "上传中,请稍后", background: "rgba(0,0,0,0.3)" }), new Promise((i, o) => {
|
|
27
|
+
const s = new FormData();
|
|
28
|
+
s.append("image", e.file), L.post(f, s, {}).then((d) => {
|
|
29
|
+
u.service().close(), p({
|
|
30
|
+
message: "上传成功",
|
|
31
|
+
type: "success"
|
|
32
|
+
}), i(d.data);
|
|
33
|
+
}).catch(() => {
|
|
34
|
+
u.service().close(), p({
|
|
35
|
+
message: "上传失败",
|
|
36
|
+
type: "warning"
|
|
37
|
+
}), o("Upload failed");
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return (e, i) => {
|
|
42
|
+
const o = m("el-icon"), s = m("el-image"), d = m("el-upload");
|
|
43
|
+
return t(), l(d, {
|
|
44
|
+
class: "image-uploader",
|
|
45
|
+
action: c(f),
|
|
46
|
+
name: "image",
|
|
47
|
+
"show-file-list": !1,
|
|
48
|
+
"on-success": k,
|
|
49
|
+
"before-upload": U,
|
|
50
|
+
"http-request": v
|
|
51
|
+
}, {
|
|
52
|
+
default: a(() => [
|
|
53
|
+
y(e.$slots, "default", {}, void 0, !0),
|
|
54
|
+
r.imageUrl ? (t(), l(s, {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: "image",
|
|
57
|
+
src: r.imageUrl,
|
|
58
|
+
fit: "scale-down"
|
|
59
|
+
}, {
|
|
60
|
+
placeholder: a(() => [
|
|
61
|
+
x("div", N, [
|
|
62
|
+
n(o, { class: "placeholder-icon" }, {
|
|
63
|
+
default: a(() => [
|
|
64
|
+
n(c(b))
|
|
65
|
+
]),
|
|
66
|
+
_: 1
|
|
67
|
+
})
|
|
68
|
+
])
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
}, 8, ["src"])) : (t(), l(o, {
|
|
72
|
+
key: 1,
|
|
73
|
+
class: "uploader-icon"
|
|
74
|
+
}, {
|
|
75
|
+
default: a(() => [
|
|
76
|
+
n(c(S))
|
|
77
|
+
]),
|
|
78
|
+
_: 1
|
|
79
|
+
})),
|
|
80
|
+
r.imageUrl ? (t(), l(o, {
|
|
81
|
+
key: 2,
|
|
82
|
+
class: "delete-icon",
|
|
83
|
+
onClick: B(w, ["stop", "prevent"])
|
|
84
|
+
}, {
|
|
85
|
+
default: a(() => [
|
|
86
|
+
n(c(E))
|
|
87
|
+
]),
|
|
88
|
+
_: 1
|
|
89
|
+
})) : C("", !0)
|
|
90
|
+
]),
|
|
91
|
+
_: 3
|
|
92
|
+
}, 8, ["action"]);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}, $ = /* @__PURE__ */ I(V, [["__scopeId", "data-v-19c702c5"]]);
|
|
96
|
+
export {
|
|
97
|
+
$ as default
|
|
98
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as tn, onMounted as rn, onBeforeUnmount as nn, ref as $r, watch as Ir, nextTick as Gr, h as an, openBlock as on, createBlock as sn, unref as un } from "vue";
|
|
2
2
|
import * as Dr from "quill";
|
|
3
3
|
import Pr from "quill";
|
|
4
|
-
import { c as W, g as ln, a as fn, b as cn } from "./index-
|
|
4
|
+
import { c as W, g as ln, a as fn, b as cn } from "./index-z9s-vTIc.js";
|
|
5
5
|
import hn from "quill-image-uploader";
|
|
6
6
|
var ue = -1, ne = 1, Z = 0;
|
|
7
7
|
function it(r, a, n, u) {
|