@ibiz-template/vue3-components 0.7.6 → 0.7.7-dev.0
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-FAFZUJRc.js +4 -0
- package/dist/index-Rqr5SnvQ.js +1 -0
- package/dist/index-x-jLCilD.js +1 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-QjtIWX97.js → xlsx-util-2bS-pf2I.js} +1 -1
- package/es/common/action-toolbar/action-toolbar.d.ts +1 -0
- package/es/common/action-toolbar/action-toolbar.mjs +9 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +4 -0
- package/es/control/toolbar/toolbar.mjs +13 -7
- package/es/editor/code/monaco-editor/monaco-editor.css +1 -1
- package/es/editor/code/monaco-editor/monaco-editor.d.ts +7 -0
- package/es/editor/code/monaco-editor/monaco-editor.mjs +179 -16
- package/es/editor/text-box/ibiz-input-number/ibiz-input-number.d.ts +1 -0
- package/es/editor/text-box/ibiz-input-number/ibiz-input-number.mjs +10 -3
- package/es/editor/text-box/input/input.d.ts +1 -0
- package/es/editor/text-box/input/input.mjs +9 -2
- package/es/ibiz-vue3.mjs +2 -0
- package/es/index.mjs +1 -0
- package/es/locale/en/index.d.ts +9 -1
- package/es/locale/en/index.mjs +10 -2
- package/es/locale/zh-CN/index.d.ts +9 -1
- package/es/locale/zh-CN/index.mjs +10 -2
- package/es/util/open-view-util/open-view-util.mjs +2 -3
- package/es/view/403-view/403-view.css +1 -0
- package/es/view/403-view/403-view.d.ts +6 -0
- package/es/view/403-view/403-view.mjs +45 -0
- package/es/view/404-view/404-view.mjs +2 -2
- package/es/view/index.d.ts +1 -0
- package/es/view/index.mjs +1 -0
- package/es/web-app/components/modal-router-shell/modal-router-shell.mjs +5 -2
- package/es/web-app/util/unauthorized-handler/unauthorized-handler.d.ts +1 -1
- package/es/web-app/util/unauthorized-handler/unauthorized-handler.mjs +3 -12
- package/lib/common/action-toolbar/action-toolbar.cjs +9 -1
- package/lib/control/toolbar/toolbar.cjs +13 -7
- package/lib/editor/code/monaco-editor/monaco-editor.cjs +178 -15
- package/lib/editor/code/monaco-editor/monaco-editor.css +1 -1
- package/lib/editor/text-box/ibiz-input-number/ibiz-input-number.cjs +10 -3
- package/lib/editor/text-box/input/input.cjs +9 -2
- package/lib/ibiz-vue3.cjs +2 -0
- package/lib/index.cjs +2 -0
- package/lib/locale/en/index.cjs +10 -2
- package/lib/locale/zh-CN/index.cjs +10 -2
- package/lib/util/open-view-util/open-view-util.cjs +2 -3
- package/lib/view/403-view/403-view.cjs +47 -0
- package/lib/view/403-view/403-view.css +1 -0
- package/lib/view/404-view/404-view.cjs +2 -2
- package/lib/view/index.cjs +2 -0
- package/lib/web-app/components/modal-router-shell/modal-router-shell.cjs +4 -1
- package/lib/web-app/util/unauthorized-handler/unauthorized-handler.cjs +3 -12
- package/package.json +7 -7
- package/dist/index-13Oh42A8.js +0 -1
- package/dist/index-ZIuDbCjc.js +0 -1
- package/dist/index-rHXmoO9Y.js +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-403-view{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px}.ibiz-403-view .ibiz-403-view-text{margin-top:40px;display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.ibiz-403-view-text__text1{margin-bottom:20px}.ibiz-403-view-text__text2 a{color:#557da5;cursor:pointer}.ibiz-403-view.is-top{width:100vw;height:100vh}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './403-view.scss';
|
|
2
|
+
export declare const View403: import("vue").DefineComponent<{}, {
|
|
3
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
4
|
+
isTop: import("vue").ComputedRef<boolean>;
|
|
5
|
+
gotoIndexView: () => Promise<void>;
|
|
6
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { onMounted, computed, createVNode, createTextVNode, defineComponent } from 'vue';
|
|
2
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
+
import { useRouter, useRoute } from 'vue-router';
|
|
4
|
+
import './403-view.css';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const View403 = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "IBizView403",
|
|
9
|
+
setup() {
|
|
10
|
+
const ns = useNamespace("403-view");
|
|
11
|
+
const router = useRouter();
|
|
12
|
+
const route = useRoute();
|
|
13
|
+
const gotoIndexView = async () => {
|
|
14
|
+
await router.push("/");
|
|
15
|
+
window.location.reload();
|
|
16
|
+
};
|
|
17
|
+
onMounted(() => ibiz.util.hiddenAppLoading());
|
|
18
|
+
const isTop = computed(() => {
|
|
19
|
+
return route && !route.params.view1;
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
ns,
|
|
23
|
+
isTop,
|
|
24
|
+
gotoIndexView
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
render() {
|
|
28
|
+
return createVNode("div", {
|
|
29
|
+
"class": [this.ns.b(), this.ns.is("top", this.isTop)]
|
|
30
|
+
}, [createVNode("img", {
|
|
31
|
+
"class": this.ns.b("img"),
|
|
32
|
+
"src": "./assets/images/404.png"
|
|
33
|
+
}, null), createVNode("div", {
|
|
34
|
+
"class": this.ns.b("text")
|
|
35
|
+
}, [createVNode("div", {
|
|
36
|
+
"class": this.ns.be("text", "text1")
|
|
37
|
+
}, [createTextVNode("\u62B1\u6B49\uFF0C\u60A8\u6CA1\u6709\u8BBF\u95EE\u8BE5\u9875\u9762\u7684\u6743\u9650")]), this.isTop ? createVNode("div", {
|
|
38
|
+
"class": this.ns.be("text", "text2")
|
|
39
|
+
}, [createTextVNode("\u60A8\u6CA1\u6709\u8BBF\u95EE\u8BE5\u9875\u9762\u7684\u6743\u9650\uFF0C\u8BF7"), createVNode("a", {
|
|
40
|
+
"onClick": this.gotoIndexView
|
|
41
|
+
}, [createTextVNode("\u8FD4\u56DE\u9996\u9875")]), createTextVNode("\u7EE7\u7EED\u6D4F\u89C8")]) : null])]);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export { View403 };
|
|
@@ -34,9 +34,9 @@ const View404 = /* @__PURE__ */ defineComponent({
|
|
|
34
34
|
"class": this.ns.b("text")
|
|
35
35
|
}, [createVNode("div", {
|
|
36
36
|
"class": this.ns.be("text", "text1")
|
|
37
|
-
}, [createTextVNode("\u62B1\u6B49\uFF0C\u60A8\u8BBF\u95EE\u7684\
|
|
37
|
+
}, [createTextVNode("\u62B1\u6B49\uFF0C\u60A8\u8BBF\u95EE\u7684\u8D44\u6E90\u4E0D\u5B58\u5728")]), this.isTop ? createVNode("div", {
|
|
38
38
|
"class": this.ns.be("text", "text2")
|
|
39
|
-
}, [createTextVNode("\u60A8\u8981\u627E\u7684\
|
|
39
|
+
}, [createTextVNode("\u60A8\u8981\u627E\u7684\u8D44\u6E90\u4E0D\u5B58\u5728\uFF0C\u8BF7"), createVNode("a", {
|
|
40
40
|
"onClick": this.gotoIndexView
|
|
41
41
|
}, [createTextVNode("\u8FD4\u56DE\u9996\u9875")]), createTextVNode("\u7EE7\u7EED\u6D4F\u89C8")]) : null])]);
|
|
42
42
|
}
|
package/es/view/index.d.ts
CHANGED
package/es/view/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { View404 } from './404-view/404-view.mjs';
|
|
2
|
+
export { View403 } from './403-view/403-view.mjs';
|
|
2
3
|
export { LoginView } from './login-view/login-view.mjs';
|
|
3
4
|
export { IBizWFStepTraceView } from './wf-step-trace-view/index.mjs';
|
|
4
5
|
export { IBizSubAppRefView } from './sub-app-ref-view/index.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref, toRaw, onUnmounted, createVNode, defineComponent } from 'vue';
|
|
2
|
-
import { parseRouteViewData, createOverlayView } from '@ibiz-template/vue3-util';
|
|
2
|
+
import { parseRouteViewData, createOverlayView, routerCallback } from '@ibiz-template/vue3-util';
|
|
3
3
|
import { useRoute, useRouter } from 'vue-router';
|
|
4
4
|
import { IBizContext } from '@ibiz-template/core';
|
|
5
5
|
import { RouteConst } from '@ibiz-template/runtime';
|
|
@@ -97,7 +97,7 @@ const ModalRouterShell = /* @__PURE__ */ defineComponent({
|
|
|
97
97
|
};
|
|
98
98
|
overlay = ibiz.overlay.createModal(component, void 0, opts);
|
|
99
99
|
overlay.present();
|
|
100
|
-
await overlay.onWillDismiss();
|
|
100
|
+
const result = await overlay.onWillDismiss();
|
|
101
101
|
overlay = null;
|
|
102
102
|
if (isDestroyed.value === false) {
|
|
103
103
|
if ((_a = window.history.state) == null ? void 0 : _a.back) {
|
|
@@ -107,6 +107,9 @@ const ModalRouterShell = /* @__PURE__ */ defineComponent({
|
|
|
107
107
|
const index = path.indexOf("/".concat(RouteConst.ROUTE_MODAL_TAG, "/"));
|
|
108
108
|
router.replace(path.substring(0, index));
|
|
109
109
|
}
|
|
110
|
+
routerCallback.close(router.currentRoute.value.fullPath, result || {
|
|
111
|
+
ok: false
|
|
112
|
+
});
|
|
110
113
|
}
|
|
111
114
|
};
|
|
112
115
|
openView();
|
|
@@ -60,17 +60,8 @@ class UnauthorizedHandler {
|
|
|
60
60
|
* @protected
|
|
61
61
|
* @return {*} {Promise<void>}
|
|
62
62
|
*/
|
|
63
|
-
async handle403() {
|
|
64
|
-
|
|
65
|
-
title: "\u5F53\u524D\u8D26\u6237\u88AB\u7981\u6B62\u8BBF\u95EE",
|
|
66
|
-
desc: "\u662F\u5426\u8981\u9000\u51FA\u5F53\u524D\u8D26\u6237\uFF1F"
|
|
67
|
-
});
|
|
68
|
-
if (result) {
|
|
69
|
-
const bol = await ibiz.hub.controller.logout();
|
|
70
|
-
if (bol) {
|
|
71
|
-
window.location.reload();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
63
|
+
async handle403(error) {
|
|
64
|
+
ibiz.mc.error.send(error);
|
|
74
65
|
}
|
|
75
66
|
/**
|
|
76
67
|
* 没有权限处理
|
|
@@ -97,7 +88,7 @@ class UnauthorizedHandler {
|
|
|
97
88
|
return true;
|
|
98
89
|
}
|
|
99
90
|
if (error.status === 403) {
|
|
100
|
-
this.handle403();
|
|
91
|
+
this.handle403(error);
|
|
101
92
|
return true;
|
|
102
93
|
}
|
|
103
94
|
}
|
|
@@ -39,6 +39,8 @@ const IBizActionToolbar = /* @__PURE__ */ vue.defineComponent({
|
|
|
39
39
|
emit
|
|
40
40
|
}) {
|
|
41
41
|
const ns = vue3Util.useNamespace("action-toolbar");
|
|
42
|
+
const dropdownRef = vue.ref();
|
|
43
|
+
const popoverVisible = vue.ref(false);
|
|
42
44
|
props.actionDetails.forEach((detail) => {
|
|
43
45
|
if (detail.capLanguageRes && detail.capLanguageRes.lanResTag) {
|
|
44
46
|
detail.caption = ibiz.i18n.t(detail.capLanguageRes.lanResTag, detail.caption);
|
|
@@ -49,6 +51,11 @@ const IBizActionToolbar = /* @__PURE__ */ vue.defineComponent({
|
|
|
49
51
|
});
|
|
50
52
|
const handleClick = async (detail, e) => {
|
|
51
53
|
e.stopPropagation();
|
|
54
|
+
if (props.mode === "buttons") {
|
|
55
|
+
popoverVisible.value = false;
|
|
56
|
+
} else if (dropdownRef.value) {
|
|
57
|
+
dropdownRef.value.handleClose();
|
|
58
|
+
}
|
|
52
59
|
emit("action-click", detail, e);
|
|
53
60
|
};
|
|
54
61
|
const expandDetails = vue.ref([]);
|
|
@@ -63,7 +70,6 @@ const IBizActionToolbar = /* @__PURE__ */ vue.defineComponent({
|
|
|
63
70
|
});
|
|
64
71
|
}
|
|
65
72
|
const groupButtonRef = vue.ref();
|
|
66
|
-
const popoverVisible = vue.ref(false);
|
|
67
73
|
const calcActionItemClass = (item) => {
|
|
68
74
|
const {
|
|
69
75
|
actionLevel
|
|
@@ -73,6 +79,7 @@ const IBizActionToolbar = /* @__PURE__ */ vue.defineComponent({
|
|
|
73
79
|
const popoverIndex = props.zIndex;
|
|
74
80
|
return {
|
|
75
81
|
ns,
|
|
82
|
+
dropdownRef,
|
|
76
83
|
popoverIndex,
|
|
77
84
|
expandDetails,
|
|
78
85
|
groupDetails,
|
|
@@ -144,6 +151,7 @@ const IBizActionToolbar = /* @__PURE__ */ vue.defineComponent({
|
|
|
144
151
|
})]]);
|
|
145
152
|
}
|
|
146
153
|
return vue.createVNode(vue.resolveComponent("el-dropdown"), {
|
|
154
|
+
"ref": "dropdownRef",
|
|
147
155
|
"onCommand": (command) => this.handleClick(command, new MouseEvent("click")),
|
|
148
156
|
"class": [this.ns.b(), this.ns.m("dropdown")]
|
|
149
157
|
}, {
|
|
@@ -60,6 +60,10 @@ const ToolbarControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
60
60
|
const handleClick = async (item, event, params) => {
|
|
61
61
|
await c.onItemClick(item, event, params);
|
|
62
62
|
};
|
|
63
|
+
const calcCssName = (item) => {
|
|
64
|
+
var _a2;
|
|
65
|
+
return (_a2 = item == null ? void 0 : item.sysCss) == null ? void 0 : _a2.cssName;
|
|
66
|
+
};
|
|
63
67
|
const renderExtraButtons = (extraButtons) => {
|
|
64
68
|
return extraButtons.map((button) => {
|
|
65
69
|
let _slot;
|
|
@@ -82,11 +86,11 @@ const ToolbarControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
82
86
|
"class": ns.b("submenu"),
|
|
83
87
|
"index": item.id,
|
|
84
88
|
"title": item.tooltip,
|
|
85
|
-
"popper-class": [ns.b("submenu-popper"), ns.bm("submenu-popper", toolbarStyle)]
|
|
89
|
+
"popper-class": [ns.b("submenu-popper"), ns.bm("submenu-popper", toolbarStyle), ns.bm("submenu-popper", calcCssName(item))]
|
|
86
90
|
}, {
|
|
87
91
|
default: () => {
|
|
88
92
|
return detoolbarItems.map((item2) => {
|
|
89
|
-
var _a2;
|
|
93
|
+
var _a2, _b;
|
|
90
94
|
const actionId = item2.uiactionId;
|
|
91
95
|
const visible = (_a2 = c.state.buttonsState[item2.id]) == null ? void 0 : _a2.visible;
|
|
92
96
|
if (!visible) {
|
|
@@ -108,9 +112,10 @@ const ToolbarControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
108
112
|
}
|
|
109
113
|
if (item2.itemType === "DEUIACTION") {
|
|
110
114
|
let _slot2;
|
|
115
|
+
const buttonType = (_b = item2.buttonStyle) == null ? void 0 : _b.toLowerCase();
|
|
111
116
|
if (actionId === "exportexcel") {
|
|
112
117
|
return vue.createVNode(exportExcel.IBizExportExcel, {
|
|
113
|
-
"class": [ns.e("menu-exportexcel")],
|
|
118
|
+
"class": [ns.e("menu-exportexcel"), ns.em("item", buttonType), calcCssName(item2)],
|
|
114
119
|
"mode": "menu",
|
|
115
120
|
"item": item2,
|
|
116
121
|
"btnContent": btnContent,
|
|
@@ -122,7 +127,7 @@ const ToolbarControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
122
127
|
}, null);
|
|
123
128
|
}
|
|
124
129
|
return vue.createVNode(vue.resolveComponent("el-menu-item"), {
|
|
125
|
-
"class": [ns.is("loading", c.state.buttonsState[item2.id].loading)],
|
|
130
|
+
"class": [ns.is("loading", c.state.buttonsState[item2.id].loading), ns.em("item", buttonType), calcCssName(item2)],
|
|
126
131
|
"index": "menuitem".concat(item2.id),
|
|
127
132
|
"disabled": c.state.buttonsState[item2.id].disabled,
|
|
128
133
|
"title": item2.tooltip,
|
|
@@ -144,6 +149,7 @@ const ToolbarControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
144
149
|
title: () => {
|
|
145
150
|
let _slot3;
|
|
146
151
|
return vue.createVNode(vue.resolveComponent("el-button"), {
|
|
152
|
+
"class": calcCssName(item),
|
|
147
153
|
"loading": loading
|
|
148
154
|
}, _isSlot(_slot3 = btnContent(item)) ? _slot3 : {
|
|
149
155
|
default: () => [_slot3]
|
|
@@ -175,9 +181,10 @@ const ToolbarControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
175
181
|
if (item.itemType === "DEUIACTION") {
|
|
176
182
|
let _slot4;
|
|
177
183
|
const actionId = item.uiactionId;
|
|
184
|
+
const buttonType = (_b = item.buttonStyle) == null ? void 0 : _b.toLowerCase();
|
|
178
185
|
if (actionId === "exportexcel") {
|
|
179
186
|
return vue.createVNode(exportExcel.IBizExportExcel, {
|
|
180
|
-
"class": [ns.e("item"), ns.e("item-deuiaction")],
|
|
187
|
+
"class": [ns.e("item"), ns.e("item-deuiaction"), ns.em("item", buttonType), calcCssName(item)],
|
|
181
188
|
"item": item,
|
|
182
189
|
"btnContent": btnContent,
|
|
183
190
|
"size": btnSize.value,
|
|
@@ -187,10 +194,9 @@ const ToolbarControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
187
194
|
}
|
|
188
195
|
}, null);
|
|
189
196
|
}
|
|
190
|
-
const buttonType = (_b = item.buttonStyle) == null ? void 0 : _b.toLowerCase();
|
|
191
197
|
return vue.createVNode("div", {
|
|
192
198
|
"key": itemId,
|
|
193
|
-
"class": [ns.e("item"), ns.e("item-deuiaction"), ns.em("item", buttonType), ns.is("loading", c.state.buttonsState[itemId].loading)]
|
|
199
|
+
"class": [ns.e("item"), ns.e("item-deuiaction"), ns.em("item", buttonType), calcCssName(item), ns.is("loading", c.state.buttonsState[itemId].loading)]
|
|
194
200
|
}, [vue.createVNode(vue.resolveComponent("el-button"), {
|
|
195
201
|
"title": item.tooltip,
|
|
196
202
|
"size": btnSize.value,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
require('./monaco-editor.css');
|
|
5
5
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
6
|
+
var ElementPlus = require('element-plus');
|
|
6
7
|
require('../../../node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.45.0/node_modules/@monaco-editor/loader/lib/es/index.cjs');
|
|
7
8
|
var index = require('../../../node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.45.0/node_modules/@monaco-editor/loader/lib/es/loader/index.cjs');
|
|
8
9
|
|
|
@@ -15,7 +16,24 @@ const IBizCode = /* @__PURE__ */ vue.defineComponent({
|
|
|
15
16
|
emit
|
|
16
17
|
}) {
|
|
17
18
|
const ns = vue3Util.useNamespace("code");
|
|
19
|
+
const c = props.controller;
|
|
18
20
|
const currentVal = vue.ref("");
|
|
21
|
+
const enableEdit = vue.ref(true);
|
|
22
|
+
const hasEnableEdit = vue.ref(false);
|
|
23
|
+
const readonlyState = vue.ref(false);
|
|
24
|
+
const enableFullScreen = vue.ref(false);
|
|
25
|
+
const isFullScreen = vue.ref(false);
|
|
26
|
+
const editorModel = c.model;
|
|
27
|
+
if (editorModel.editorParams) {
|
|
28
|
+
if (editorModel.editorParams.enableEdit) {
|
|
29
|
+
hasEnableEdit.value = true;
|
|
30
|
+
readonlyState.value = true;
|
|
31
|
+
enableEdit.value = c.toBoolean(editorModel.editorParams.enableEdit) && !props.readonly && !props.disabled;
|
|
32
|
+
}
|
|
33
|
+
if (editorModel.editorParams.enableFullScreen) {
|
|
34
|
+
enableFullScreen.value = c.toBoolean(editorModel.editorParams.enableFullScreen);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
19
37
|
let editor;
|
|
20
38
|
let monacoEditor;
|
|
21
39
|
const {
|
|
@@ -35,13 +53,22 @@ const IBizCode = /* @__PURE__ */ vue.defineComponent({
|
|
|
35
53
|
}, {
|
|
36
54
|
immediate: true
|
|
37
55
|
});
|
|
38
|
-
|
|
39
|
-
if (editor) {
|
|
40
|
-
|
|
41
|
-
readOnly: newVal
|
|
42
|
-
});
|
|
56
|
+
const updateEditorOptions = () => {
|
|
57
|
+
if (!editor) {
|
|
58
|
+
return;
|
|
43
59
|
}
|
|
44
|
-
|
|
60
|
+
if (props.readonly || props.disabled) {
|
|
61
|
+
hasEnableEdit.value = false;
|
|
62
|
+
readonlyState.value = true;
|
|
63
|
+
}
|
|
64
|
+
editor.updateOptions({
|
|
65
|
+
readOnly: hasEnableEdit.value ? readonlyState.value : props.readonly || props.disabled
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
vue.watch(() => props.readonly, updateEditorOptions, {
|
|
69
|
+
immediate: true
|
|
70
|
+
});
|
|
71
|
+
vue.watch(() => props.disabled, updateEditorOptions, {
|
|
45
72
|
immediate: true
|
|
46
73
|
});
|
|
47
74
|
const codeEditBox = vue.ref();
|
|
@@ -67,10 +94,10 @@ const IBizCode = /* @__PURE__ */ vue.defineComponent({
|
|
|
67
94
|
minimap: {
|
|
68
95
|
enabled: true
|
|
69
96
|
},
|
|
70
|
-
readOnly: props.readonly,
|
|
97
|
+
readOnly: hasEnableEdit.value ? readonlyState.value : props.readonly || props.disabled,
|
|
71
98
|
// 只读
|
|
72
99
|
readOnlyMessage: {
|
|
73
|
-
value: "
|
|
100
|
+
value: ibiz.i18n.t("editor.code.readOnlyPrompt")
|
|
74
101
|
},
|
|
75
102
|
fontSize: 16,
|
|
76
103
|
// 字体大小
|
|
@@ -85,8 +112,10 @@ const IBizCode = /* @__PURE__ */ vue.defineComponent({
|
|
|
85
112
|
editor.setValue(currentVal.value);
|
|
86
113
|
});
|
|
87
114
|
editor.onDidChangeModelContent(() => {
|
|
88
|
-
|
|
89
|
-
|
|
115
|
+
if (!hasEnableEdit.value) {
|
|
116
|
+
currentVal.value = editor.getValue();
|
|
117
|
+
emit("change", currentVal.value);
|
|
118
|
+
}
|
|
90
119
|
});
|
|
91
120
|
window.addEventListener("resize", () => {
|
|
92
121
|
editor.layout();
|
|
@@ -94,6 +123,115 @@ const IBizCode = /* @__PURE__ */ vue.defineComponent({
|
|
|
94
123
|
});
|
|
95
124
|
});
|
|
96
125
|
};
|
|
126
|
+
const changeEditState = () => {
|
|
127
|
+
readonlyState.value = !readonlyState.value;
|
|
128
|
+
if (!editor)
|
|
129
|
+
return;
|
|
130
|
+
if (!readonlyState.value) {
|
|
131
|
+
editor.updateOptions({
|
|
132
|
+
readOnly: false
|
|
133
|
+
});
|
|
134
|
+
} else {
|
|
135
|
+
editor.updateOptions({
|
|
136
|
+
readOnly: true
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const changeFullScreenState = async () => {
|
|
141
|
+
currentVal.value = String(editor == null ? void 0 : editor.getValue());
|
|
142
|
+
editor == null ? void 0 : editor.dispose();
|
|
143
|
+
editor = null;
|
|
144
|
+
isFullScreen.value = !isFullScreen.value;
|
|
145
|
+
editorInit();
|
|
146
|
+
};
|
|
147
|
+
const isAllowRenderFullScreen = () => {
|
|
148
|
+
if (enableFullScreen.value) {
|
|
149
|
+
if (isFullScreen.value) {
|
|
150
|
+
return vue.createVNode("i", {
|
|
151
|
+
"class": "fa fa-compress",
|
|
152
|
+
"aria-hidden": "true",
|
|
153
|
+
"onClick": () => changeFullScreenState()
|
|
154
|
+
}, null);
|
|
155
|
+
}
|
|
156
|
+
return vue.createVNode("i", {
|
|
157
|
+
"class": "fa fa-expand",
|
|
158
|
+
"aria-hidden": "true",
|
|
159
|
+
"onClick": () => changeFullScreenState()
|
|
160
|
+
}, null);
|
|
161
|
+
}
|
|
162
|
+
return null;
|
|
163
|
+
};
|
|
164
|
+
const renderCancelMessage = () => {
|
|
165
|
+
return vue.createVNode("div", {
|
|
166
|
+
"class": ns.be("message", "message-content")
|
|
167
|
+
}, [vue.createVNode("p", null, [ibiz.i18n.t("editor.code.confirmCancelPrompt")]), vue.createVNode("p", {
|
|
168
|
+
"class": ns.bem("message", "message-content", "message-tip")
|
|
169
|
+
}, [ibiz.i18n.t("editor.code.cancelEditPrompt")])]);
|
|
170
|
+
};
|
|
171
|
+
const cancelEdit = () => {
|
|
172
|
+
if (props.value !== (editor == null ? void 0 : editor.getValue())) {
|
|
173
|
+
ElementPlus.ElMessageBox({
|
|
174
|
+
title: ibiz.i18n.t("editor.code.confirmCancel"),
|
|
175
|
+
type: "warning",
|
|
176
|
+
customClass: ns.b("message"),
|
|
177
|
+
message: renderCancelMessage(),
|
|
178
|
+
showCancelButton: true,
|
|
179
|
+
cancelButtonClass: ns.be("message", "message-cancel"),
|
|
180
|
+
confirmButtonClass: ns.be("message", "message-comfire")
|
|
181
|
+
}).then(() => {
|
|
182
|
+
editor == null ? void 0 : editor.setValue(String(props.value || ""));
|
|
183
|
+
changeEditState();
|
|
184
|
+
}).catch(() => {
|
|
185
|
+
editor == null ? void 0 : editor.focus();
|
|
186
|
+
});
|
|
187
|
+
} else {
|
|
188
|
+
changeEditState();
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const save = () => {
|
|
192
|
+
changeEditState();
|
|
193
|
+
if (editor) {
|
|
194
|
+
currentVal.value = editor.getValue();
|
|
195
|
+
emit("change", currentVal.value);
|
|
196
|
+
}
|
|
197
|
+
if (isFullScreen.value) {
|
|
198
|
+
changeFullScreenState();
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
const renderFooter = () => {
|
|
202
|
+
if (hasEnableEdit.value) {
|
|
203
|
+
return vue.createVNode("div", {
|
|
204
|
+
"class": [ns.b("footer"), {
|
|
205
|
+
[ns.b("footer-dialog")]: isFullScreen.value
|
|
206
|
+
}]
|
|
207
|
+
}, [vue.createVNode("div", {
|
|
208
|
+
"class": ns.be("footer", "cancel"),
|
|
209
|
+
"onClick": () => cancelEdit()
|
|
210
|
+
}, [ibiz.i18n.t("app.cancel")]), vue.createVNode("div", {
|
|
211
|
+
"class": ns.be("footer", "save"),
|
|
212
|
+
"onClick": () => save()
|
|
213
|
+
}, [ibiz.i18n.t("app.save")])]);
|
|
214
|
+
}
|
|
215
|
+
return null;
|
|
216
|
+
};
|
|
217
|
+
const renderHeaderToolbar = () => {
|
|
218
|
+
if (hasEnableEdit.value || enableFullScreen.value) {
|
|
219
|
+
return vue.createVNode("div", {
|
|
220
|
+
"class": ns.b("toolbar")
|
|
221
|
+
}, [hasEnableEdit.value && enableEdit.value && readonlyState.value ? vue.createVNode("i", {
|
|
222
|
+
"class": "fa fa-edit",
|
|
223
|
+
"aria-hidden": "true",
|
|
224
|
+
"onClick": () => changeEditState()
|
|
225
|
+
}, null) : null, isAllowRenderFullScreen()]);
|
|
226
|
+
}
|
|
227
|
+
return null;
|
|
228
|
+
};
|
|
229
|
+
const renderCodeContent = () => {
|
|
230
|
+
return vue.createVNode("div", {
|
|
231
|
+
"ref": codeEditBox,
|
|
232
|
+
"class": ns.e("box")
|
|
233
|
+
}, null);
|
|
234
|
+
};
|
|
97
235
|
vue.onMounted(() => {
|
|
98
236
|
editorInit();
|
|
99
237
|
});
|
|
@@ -103,14 +241,39 @@ const IBizCode = /* @__PURE__ */ vue.defineComponent({
|
|
|
103
241
|
return {
|
|
104
242
|
ns,
|
|
105
243
|
currentVal,
|
|
106
|
-
codeEditBox
|
|
244
|
+
codeEditBox,
|
|
245
|
+
isFullScreen,
|
|
246
|
+
hasEnableEdit,
|
|
247
|
+
readonlyState,
|
|
248
|
+
renderFooter,
|
|
249
|
+
renderHeaderToolbar,
|
|
250
|
+
renderCodeContent,
|
|
251
|
+
changeFullScreenState
|
|
107
252
|
};
|
|
108
253
|
},
|
|
109
254
|
render() {
|
|
110
|
-
return vue.createVNode("div", {
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
255
|
+
return !this.isFullScreen ? vue.createVNode("div", {
|
|
256
|
+
"class": [this.ns.b(), {
|
|
257
|
+
[this.ns.b("editor-readonly")]: this.readonlyState
|
|
258
|
+
}, {
|
|
259
|
+
[this.ns.b("editor-enable")]: !this.readonlyState
|
|
260
|
+
}]
|
|
261
|
+
}, [this.renderHeaderToolbar(), this.renderCodeContent(), this.hasEnableEdit && !this.readonlyState ? this.renderFooter() : null]) : vue.createVNode(vue.resolveComponent("el-dialog"), {
|
|
262
|
+
"modelValue": this.isFullScreen,
|
|
263
|
+
"onUpdate:modelValue": ($event) => this.isFullScreen = $event,
|
|
264
|
+
"width": "80%",
|
|
265
|
+
"top": "10vh",
|
|
266
|
+
"class": this.ns.b("dialog-full-screen"),
|
|
267
|
+
"onClose": () => this.changeFullScreenState()
|
|
268
|
+
}, {
|
|
269
|
+
default: () => [vue.createVNode("div", {
|
|
270
|
+
"class": [this.ns.b(), {
|
|
271
|
+
[this.ns.b("editor-readonly")]: this.readonlyState
|
|
272
|
+
}, {
|
|
273
|
+
[this.ns.b("editor-enable")]: !this.readonlyState
|
|
274
|
+
}]
|
|
275
|
+
}, [this.renderHeaderToolbar(), this.renderCodeContent(), this.hasEnableEdit && !this.readonlyState ? this.renderFooter() : null])]
|
|
276
|
+
});
|
|
114
277
|
}
|
|
115
278
|
});
|
|
116
279
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-code{display:
|
|
1
|
+
.ibiz-code{display:flex;flex-direction:column;width:100%;height:100%}.ibiz-code__box{width:100%;height:100%;min-height:200px;overflow:hidden}.ibiz-code-toolbar{display:flex;align-items:center;justify-content:end;width:100%;min-height:32px;padding-right:var(--ibiz-spacing-base);font-size:var(--ibiz-font-size-header-6)}.ibiz-code-toolbar>*+*{margin-left:var(--ibiz-spacing-base-loose)}.ibiz-code-toolbar i{cursor:pointer}.ibiz-code-toolbar i:hover{color:var(--ibiz-color-primary)}.ibiz-code-footer{display:flex;align-items:center;justify-content:end;width:100%;min-height:36px;margin-top:var(--ibiz-spacing-base-tight);margin-right:var(--ibiz-spacing-tight)}.ibiz-code-footer>*+*{margin-left:var(--ibiz-spacing-base)}.ibiz-code-footer__cancel{height:36px;line-height:36px;color:var(--ibiz-color-text-1);cursor:pointer;opacity:.7}.ibiz-code-footer__cancel:hover{color:var(--ibiz-color-primary);opacity:1}.ibiz-code-footer__save{width:96px;height:36px;line-height:36px;color:var(--ibiz-color-primary-active-text);text-align:center;cursor:pointer;background-color:var(--ibiz-color-primary);border-radius:5px}.ibiz-code-footer__save:hover{box-shadow:0 2px 5px 1px var(--ibiz-color-primary)}.ibiz-code-message{width:500px;max-width:unset}.ibiz-code-message__message-content--message-tip{color:var(--ibiz-color-text-3)}.ibiz-code-message__message-cancel{color:var(--ibiz-color-text-1);background-color:transparent}.ibiz-code-message__message-cancel:hover{color:var(--ibiz-color-primary);background-color:transparent}.ibiz-code-message__message-comfire{background-color:var(--ibiz-color-danger)!important}.ibiz-code-message__message-comfire:hover{box-shadow:0 2px 5px 1px var(--ibiz-color-danger)}.ibiz-code-editor-enable .ibiz-code__box{height:calc(100% - 68px)}.ibiz-code-dialog-full-screen{height:80%!important}.ibiz-code-dialog-full-screen .ibiz-code{gap:0;padding:0 var(--ibiz-spacing-extra-loose);--w-e-toolbar-bg-color:var(--ibiz-color-bg-0)}.ibiz-code-dialog-full-screen .ibiz-code .ibiz-code__box{height:calc(100% - 124px)}.ibiz-code-dialog-full-screen .ibiz-code .ibiz-code-toolbar{min-height:56px}.ibiz-code-footer-dialog{min-height:68px;margin-top:0}
|
|
@@ -44,6 +44,12 @@ const IBizInputNumber = /* @__PURE__ */ vue.defineComponent({
|
|
|
44
44
|
}, {
|
|
45
45
|
immediate: true
|
|
46
46
|
});
|
|
47
|
+
const currentFormatVal = vue.computed(() => {
|
|
48
|
+
if (currentVal.value || currentVal.value === 0) {
|
|
49
|
+
return props.controller.formatValue(currentVal.value);
|
|
50
|
+
}
|
|
51
|
+
return "";
|
|
52
|
+
});
|
|
47
53
|
const setEditable = (flag) => {
|
|
48
54
|
if (flag) {
|
|
49
55
|
isEditable.value = flag;
|
|
@@ -88,7 +94,8 @@ const IBizInputNumber = /* @__PURE__ */ vue.defineComponent({
|
|
|
88
94
|
setEditable,
|
|
89
95
|
showFormDefaultContent,
|
|
90
96
|
max,
|
|
91
|
-
min
|
|
97
|
+
min,
|
|
98
|
+
currentFormatVal
|
|
92
99
|
};
|
|
93
100
|
},
|
|
94
101
|
render() {
|
|
@@ -97,7 +104,7 @@ const IBizInputNumber = /* @__PURE__ */ vue.defineComponent({
|
|
|
97
104
|
} = this.c.parent;
|
|
98
105
|
let content = null;
|
|
99
106
|
if (this.readonly) {
|
|
100
|
-
content = qxUtil.isNilOrEmpty(this.currentVal) ? "" : "".concat(this.
|
|
107
|
+
content = qxUtil.isNilOrEmpty(this.currentVal) ? "" : "".concat(this.currentFormatVal);
|
|
101
108
|
if (content && unitName) {
|
|
102
109
|
content += unitName;
|
|
103
110
|
}
|
|
@@ -122,7 +129,7 @@ const IBizInputNumber = /* @__PURE__ */ vue.defineComponent({
|
|
|
122
129
|
}
|
|
123
130
|
const formDefaultContent = vue.createVNode("div", {
|
|
124
131
|
"class": this.ns.b("form-default-content")
|
|
125
|
-
}, [this.currentVal || this.currentVal === 0 ? this.
|
|
132
|
+
}, [this.currentVal || this.currentVal === 0 ? this.currentFormatVal : "-"]);
|
|
126
133
|
return vue.createVNode("div", {
|
|
127
134
|
"class": [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : "", this.ns.is("editable", this.isEditable), this.ns.is("show-default", this.showFormDefaultContent)]
|
|
128
135
|
}, [this.showFormDefaultContent && formDefaultContent, content]);
|
|
@@ -66,6 +66,12 @@ const IBizInput = /* @__PURE__ */ vue.defineComponent({
|
|
|
66
66
|
}, {
|
|
67
67
|
immediate: true
|
|
68
68
|
});
|
|
69
|
+
const currentFormatVal = vue.computed(() => {
|
|
70
|
+
if (currentVal.value) {
|
|
71
|
+
return props.controller.formatValue(currentVal.value);
|
|
72
|
+
}
|
|
73
|
+
return "";
|
|
74
|
+
});
|
|
69
75
|
const setEditable = (flag) => {
|
|
70
76
|
if (flag) {
|
|
71
77
|
isEditable.value = flag;
|
|
@@ -218,7 +224,8 @@ const IBizInput = /* @__PURE__ */ vue.defineComponent({
|
|
|
218
224
|
setEditable,
|
|
219
225
|
showLimit,
|
|
220
226
|
isAuto,
|
|
221
|
-
showFormDefaultContent
|
|
227
|
+
showFormDefaultContent,
|
|
228
|
+
currentFormatVal
|
|
222
229
|
};
|
|
223
230
|
},
|
|
224
231
|
render() {
|
|
@@ -278,7 +285,7 @@ const IBizInput = /* @__PURE__ */ vue.defineComponent({
|
|
|
278
285
|
}
|
|
279
286
|
const formDefaultContent = vue.createVNode("div", {
|
|
280
287
|
"class": this.ns.b("form-default-content")
|
|
281
|
-
}, [this.currentVal ? this.type === "password" ? this.currentVal.split("").map((_item) => "\u2022") : this.
|
|
288
|
+
}, [this.currentVal ? this.type === "password" ? this.currentVal.split("").map((_item) => "\u2022") : this.currentFormatVal : "-"]);
|
|
282
289
|
return vue.createVNode("div", {
|
|
283
290
|
"class": [this.ns.b(), this.ns.is("textarea", Object.is(this.type, "textarea")), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : "", this.ns.is("editable", this.isEditable), this.ns.is("show-default", this.showFormDefaultContent)],
|
|
284
291
|
"style": {
|
package/lib/ibiz-vue3.cjs
CHANGED
|
@@ -12,6 +12,7 @@ require('./view/index.cjs');
|
|
|
12
12
|
var index = require('./locale/index.cjs');
|
|
13
13
|
var index$3 = require('./view-engine/index.cjs');
|
|
14
14
|
var _404View = require('./view/404-view/404-view.cjs');
|
|
15
|
+
var _403View = require('./view/403-view/403-view.cjs');
|
|
15
16
|
var index$4 = require('./view/wf-step-trace-view/index.cjs');
|
|
16
17
|
var index$5 = require('./view/sub-app-ref-view/index.cjs');
|
|
17
18
|
var index$6 = require('./control/data-view/index.cjs');
|
|
@@ -55,6 +56,7 @@ var IBizVue3 = {
|
|
|
55
56
|
ibiz.i18n = index.iBizI18n;
|
|
56
57
|
ibiz.util.getExcelUtil = () => Promise.resolve().then(function () { return require('./util/xlsx-util/xlsx-util.cjs'); });
|
|
57
58
|
runtime.registerErrorViewProvider("404", () => ({ component: _404View.View404 }));
|
|
59
|
+
runtime.registerErrorViewProvider("403", () => ({ component: _403View.View403 }));
|
|
58
60
|
v.use(index$1.IBizCommonComponents);
|
|
59
61
|
v.use(index$2.IBizPanelComponents);
|
|
60
62
|
v.use(index$3.IBizViewEngine);
|
package/lib/index.cjs
CHANGED
|
@@ -102,6 +102,7 @@ var index$10 = require('./panel-component/panel-index-view-search/index.cjs');
|
|
|
102
102
|
var index$11 = require('./panel-component/index-actions/index.cjs');
|
|
103
103
|
var index$12 = require('./panel-component/user-action/index.cjs');
|
|
104
104
|
var _404View = require('./view/404-view/404-view.cjs');
|
|
105
|
+
var _403View = require('./view/403-view/403-view.cjs');
|
|
105
106
|
var loginView = require('./view/login-view/login-view.cjs');
|
|
106
107
|
var index$14 = require('./view/wf-step-trace-view/index.cjs');
|
|
107
108
|
var index$15 = require('./view/sub-app-ref-view/index.cjs');
|
|
@@ -229,6 +230,7 @@ exports.IBizPanelIndexViewSearch = index$10.IBizPanelIndexViewSearch;
|
|
|
229
230
|
exports.IBizIndexActions = index$11.IBizIndexActions;
|
|
230
231
|
exports.IBizUserAction = index$12.IBizUserAction;
|
|
231
232
|
exports.View404 = _404View.View404;
|
|
233
|
+
exports.View403 = _403View.View403;
|
|
232
234
|
exports.LoginView = loginView.LoginView;
|
|
233
235
|
exports.IBizWFStepTraceView = index$14.IBizWFStepTraceView;
|
|
234
236
|
exports.IBizSubAppRefView = index$15.IBizSubAppRefView;
|
package/lib/locale/en/index.cjs
CHANGED
|
@@ -16,7 +16,8 @@ var index = {
|
|
|
16
16
|
refresh: "Refresh",
|
|
17
17
|
noSupport: "Not supported currently",
|
|
18
18
|
add: "Add",
|
|
19
|
-
delete: "Delete"
|
|
19
|
+
delete: "Delete",
|
|
20
|
+
save: "Save"
|
|
20
21
|
},
|
|
21
22
|
// 视图
|
|
22
23
|
view: {},
|
|
@@ -113,7 +114,14 @@ var index = {
|
|
|
113
114
|
}
|
|
114
115
|
},
|
|
115
116
|
// 编辑器
|
|
116
|
-
editor: {
|
|
117
|
+
editor: {
|
|
118
|
+
code: {
|
|
119
|
+
readOnlyPrompt: "Currently in read-only mode, not editable",
|
|
120
|
+
confirmCancelPrompt: "Are you sure you want to cancel editing?",
|
|
121
|
+
cancelEditPrompt: "Canceling editing will prevent the modified content from being saved and cannot be retrieved.",
|
|
122
|
+
confirmCancel: "Confirm cancel"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
117
125
|
};
|
|
118
126
|
|
|
119
127
|
exports.default = index;
|