@opentiny/tiny-engine-toolbar-setting 1.0.2-beta.0 → 1.0.3
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.js +47 -33
- package/package.json +19 -6
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Popover as
|
|
2
|
-
import { useCanvas as S, useBlock as k, usePage as
|
|
3
|
-
import { constants as
|
|
4
|
-
import { resolveComponent as u, openBlock as
|
|
1
|
+
import { Popover as y } from "@opentiny/vue";
|
|
2
|
+
import { useCanvas as S, useBlock as k, usePage as B, useLayout as h, useModal as C, useNotify as x } from "@opentiny/tiny-engine-controller";
|
|
3
|
+
import { constants as A } from "@opentiny/tiny-engine-utils";
|
|
4
|
+
import { resolveComponent as u, openBlock as E, createElementBlock as N, createVNode as d, withCtx as M, createElementVNode as b } from "vue";
|
|
5
5
|
const {
|
|
6
|
-
PAGE_STATUS:
|
|
7
|
-
} =
|
|
6
|
+
PAGE_STATUS: w
|
|
7
|
+
} = A, I = {
|
|
8
8
|
components: {
|
|
9
|
-
TinyPopover:
|
|
9
|
+
TinyPopover: y
|
|
10
10
|
},
|
|
11
11
|
props: {
|
|
12
12
|
icon: {
|
|
@@ -17,20 +17,21 @@ const {
|
|
|
17
17
|
setup() {
|
|
18
18
|
const {
|
|
19
19
|
pageState: a,
|
|
20
|
-
isBlock:
|
|
20
|
+
isBlock: e
|
|
21
21
|
} = S(), {
|
|
22
22
|
getCurrentBlock: o
|
|
23
23
|
} = k(), {
|
|
24
|
-
initCurrentPageData:
|
|
24
|
+
initCurrentPageData: t,
|
|
25
25
|
isChangePageData: c
|
|
26
|
-
} =
|
|
26
|
+
} = B(), {
|
|
27
27
|
PLUGIN_NAME: p,
|
|
28
28
|
activePlugin: r,
|
|
29
|
-
layoutState: g
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
layoutState: g,
|
|
30
|
+
isEmptyPage: l
|
|
31
|
+
} = h(), {
|
|
32
|
+
confirm: f,
|
|
32
33
|
message: _
|
|
33
|
-
} =
|
|
34
|
+
} = C(), P = () => {
|
|
34
35
|
r(p.BlockManage).then((n) => {
|
|
35
36
|
n.openSettingPanel({
|
|
36
37
|
item: o()
|
|
@@ -42,13 +43,13 @@ const {
|
|
|
42
43
|
} = a;
|
|
43
44
|
n.openPageSettingPanel();
|
|
44
45
|
const s = await n.getPageById(i.id);
|
|
45
|
-
|
|
46
|
-
},
|
|
46
|
+
t(s);
|
|
47
|
+
}, v = () => {
|
|
47
48
|
var i;
|
|
48
49
|
const {
|
|
49
50
|
pageStatus: n
|
|
50
51
|
} = g;
|
|
51
|
-
if (n.state ===
|
|
52
|
+
if (n.state === w.Lock) {
|
|
52
53
|
const s = ((i = n.data) == null ? void 0 : i.username) || "";
|
|
53
54
|
_({
|
|
54
55
|
message: `您点击的页面被${s}锁定,暂时无法编辑,请联系解锁`,
|
|
@@ -58,7 +59,7 @@ const {
|
|
|
58
59
|
}
|
|
59
60
|
r(p.AppManage).then((s) => {
|
|
60
61
|
if (c()) {
|
|
61
|
-
|
|
62
|
+
f({
|
|
62
63
|
title: "提示",
|
|
63
64
|
message: "当前页面尚未保存,是否要继续切换?",
|
|
64
65
|
exec: () => {
|
|
@@ -71,30 +72,43 @@ const {
|
|
|
71
72
|
});
|
|
72
73
|
};
|
|
73
74
|
return {
|
|
74
|
-
openSetting: () =>
|
|
75
|
-
|
|
75
|
+
openSetting: () => {
|
|
76
|
+
if (l()) {
|
|
77
|
+
x({
|
|
78
|
+
type: "warning",
|
|
79
|
+
message: "请先创建页面"
|
|
80
|
+
});
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (e()) {
|
|
84
|
+
P();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
v();
|
|
88
|
+
},
|
|
89
|
+
isBlock: e
|
|
76
90
|
};
|
|
77
91
|
}
|
|
78
|
-
},
|
|
92
|
+
}, L = (a, e) => {
|
|
79
93
|
const o = a.__vccOpts || a;
|
|
80
|
-
for (const [
|
|
81
|
-
o[
|
|
94
|
+
for (const [t, c] of e)
|
|
95
|
+
o[t] = c;
|
|
82
96
|
return o;
|
|
83
|
-
},
|
|
84
|
-
function
|
|
97
|
+
}, T = { class: "toolbar-itm-clean" };
|
|
98
|
+
function D(a, e, o, t, c, p) {
|
|
85
99
|
const r = u("svg-icon"), g = u("tiny-popover");
|
|
86
|
-
return
|
|
100
|
+
return E(), N("div", T, [
|
|
87
101
|
d(g, {
|
|
88
102
|
trigger: "hover",
|
|
89
103
|
"open-delay": 1e3,
|
|
90
104
|
"popper-class": "toolbar-right-popover",
|
|
91
105
|
"append-to-body": "",
|
|
92
|
-
content:
|
|
106
|
+
content: t.isBlock() ? "区块设置" : "页面设置"
|
|
93
107
|
}, {
|
|
94
|
-
reference:
|
|
95
|
-
|
|
108
|
+
reference: M(() => [
|
|
109
|
+
b("span", {
|
|
96
110
|
class: "icon",
|
|
97
|
-
onClick:
|
|
111
|
+
onClick: e[0] || (e[0] = (...l) => t.openSetting && t.openSetting(...l))
|
|
98
112
|
}, [
|
|
99
113
|
d(r, { name: o.icon }, null, 8, ["name"])
|
|
100
114
|
])
|
|
@@ -103,13 +117,13 @@ function T(a, t, o, e, c, p) {
|
|
|
103
117
|
}, 8, ["content"])
|
|
104
118
|
]);
|
|
105
119
|
}
|
|
106
|
-
const
|
|
120
|
+
const G = /* @__PURE__ */ L(I, [["render", D]]), q = {
|
|
107
121
|
id: "setting",
|
|
108
122
|
title: "setting",
|
|
109
123
|
icon: "",
|
|
110
124
|
align: "right",
|
|
111
|
-
component:
|
|
125
|
+
component: G
|
|
112
126
|
};
|
|
113
127
|
export {
|
|
114
|
-
|
|
128
|
+
q as default
|
|
115
129
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-setting",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -12,16 +12,29 @@
|
|
|
12
12
|
"files": [
|
|
13
13
|
"dist"
|
|
14
14
|
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/opentiny/tiny-engine",
|
|
18
|
+
"directory": "packages/toolbars/setting"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/opentiny/tiny-engine/issues"
|
|
22
|
+
},
|
|
23
|
+
"author": "OpenTiny Team",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"homepage": "https://opentiny.design/tiny-engine",
|
|
15
26
|
"dependencies": {
|
|
16
|
-
"@opentiny/tiny-engine-controller": "
|
|
17
|
-
"@opentiny/tiny-engine-utils": "
|
|
18
|
-
"@opentiny/vue": "~3.10.0"
|
|
19
|
-
"vue": "3.2.45"
|
|
27
|
+
"@opentiny/tiny-engine-controller": "1.0.3",
|
|
28
|
+
"@opentiny/tiny-engine-utils": "1.0.4",
|
|
29
|
+
"@opentiny/vue": "~3.10.0"
|
|
20
30
|
},
|
|
21
31
|
"devDependencies": {
|
|
22
32
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
23
33
|
"@vitejs/plugin-vue-jsx": "^1.3.10",
|
|
24
34
|
"vite": "^4.3.7"
|
|
25
35
|
},
|
|
26
|
-
"
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"vue": "^3.4.15"
|
|
38
|
+
},
|
|
39
|
+
"gitHead": "9a6cce3988accb39c97a9a21169c022c65a8e27f"
|
|
27
40
|
}
|