@ibiz-template/vue3-components 0.5.7-alpha.3 → 0.5.7-alpha.4
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/ibiz-markdown-editor-anJxfRF1.js +1 -0
- package/dist/index-knHzHtox.js +2 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/wang-editor-R2mUYWuB.js +1 -0
- package/dist/{xlsx-util-15YjErDj.js → xlsx-util-kzUgnbtt.js} +1 -1
- package/es/common/data-import2/data-import2.mjs +7 -1
- package/es/common/doing-notice/doing-notice.css +1 -0
- package/es/common/doing-notice/doing-notice.d.ts +19 -0
- package/es/common/doing-notice/doing-notice.mjs +38 -0
- package/es/common/index.d.ts +1 -0
- package/es/common/index.mjs +3 -1
- package/es/editor/html/html-editor.controller.d.ts +0 -26
- package/es/editor/html/html-editor.controller.mjs +1 -64
- package/es/editor/html/wang-editor/wang-editor.mjs +1 -1
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +5 -17
- package/es/editor/markdown/markdown-editor.controller.d.ts +0 -26
- package/es/editor/markdown/markdown-editor.controller.mjs +2 -64
- package/es/editor/upload/upload-editor.controller.d.ts +0 -26
- package/es/editor/upload/upload-editor.controller.mjs +2 -64
- package/es/editor/upload/use/use-ibiz-upload.mjs +6 -1
- package/es/editor/upload/use/use-iview-upload.mjs +7 -2
- package/es/index.mjs +2 -0
- package/es/panel-component/user-message/async-action/async-action/async-action.d.ts +18 -4
- package/es/panel-component/user-message/async-action/async-action/async-action.mjs +34 -15
- package/es/panel-component/user-message/async-action/async-action/async-action.provider.d.ts +35 -2
- package/es/panel-component/user-message/async-action/async-action/async-action.provider.mjs +9 -2
- package/es/panel-component/user-message/async-action/async-action-tab/async-action-tab.d.ts +11 -51
- package/es/panel-component/user-message/async-action/async-action-tab/async-action-tab.mjs +22 -44
- package/es/panel-component/user-message/index.d.ts +1 -0
- package/es/panel-component/user-message/index.mjs +7 -0
- package/es/panel-component/user-message/internal-message/index.d.ts +2 -0
- package/es/panel-component/user-message/internal-message/index.mjs +2 -0
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.css +1 -1
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.mjs +6 -5
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.provider.d.ts +19 -3
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.provider.mjs +9 -3
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.css +1 -0
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.d.ts +35 -0
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.mjs +80 -0
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.provider.d.ts +40 -0
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.provider.mjs +55 -0
- package/es/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.css +1 -1
- package/es/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.d.ts +10 -1
- package/es/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.mjs +18 -34
- package/es/panel-component/user-message/user-message.d.ts +1 -0
- package/es/panel-component/user-message/user-message.mjs +4 -0
- package/es/util/app-popover/app-popover-component.d.ts +4 -2
- package/es/util/app-popover/app-popover-component.mjs +6 -2
- package/es/util/index.d.ts +1 -0
- package/es/util/index.mjs +1 -0
- package/es/util/notice-util/notice-util.d.ts +13 -0
- package/es/util/notice-util/notice-util.mjs +62 -0
- package/es/util/open-view-util/open-view-util.d.ts +10 -9
- package/es/util/open-view-util/open-view-util.mjs +6 -6
- package/es/util/overlay-controller/overlay-controller.d.ts +3 -2
- package/lib/common/data-import2/data-import2.cjs +7 -1
- package/lib/common/doing-notice/doing-notice.cjs +40 -0
- package/lib/common/doing-notice/doing-notice.css +1 -0
- package/lib/common/index.cjs +3 -0
- package/lib/editor/html/html-editor.controller.cjs +0 -63
- package/lib/editor/html/wang-editor/wang-editor.cjs +1 -1
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +5 -17
- package/lib/editor/markdown/markdown-editor.controller.cjs +0 -62
- package/lib/editor/upload/upload-editor.controller.cjs +0 -62
- package/lib/editor/upload/use/use-ibiz-upload.cjs +6 -1
- package/lib/editor/upload/use/use-iview-upload.cjs +7 -2
- package/lib/index.cjs +4 -0
- package/lib/panel-component/user-message/async-action/async-action/async-action.cjs +34 -15
- package/lib/panel-component/user-message/async-action/async-action/async-action.provider.cjs +9 -2
- package/lib/panel-component/user-message/async-action/async-action-tab/async-action-tab.cjs +20 -42
- package/lib/panel-component/user-message/index.cjs +7 -0
- package/lib/panel-component/user-message/internal-message/index.cjs +4 -0
- package/lib/panel-component/user-message/internal-message/internal-message-default/internal-message-default.cjs +6 -5
- package/lib/panel-component/user-message/internal-message/internal-message-default/internal-message-default.css +1 -1
- package/lib/panel-component/user-message/internal-message/internal-message-default/internal-message-default.provider.cjs +9 -3
- package/lib/panel-component/user-message/internal-message/internal-message-json/internal-message-json.cjs +82 -0
- package/lib/panel-component/user-message/internal-message/internal-message-json/internal-message-json.css +1 -0
- package/lib/panel-component/user-message/internal-message/internal-message-json/internal-message-json.provider.cjs +57 -0
- package/lib/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.cjs +17 -33
- package/lib/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.css +1 -1
- package/lib/panel-component/user-message/user-message.cjs +4 -0
- package/lib/util/app-popover/app-popover-component.cjs +6 -2
- package/lib/util/index.cjs +2 -0
- package/lib/util/notice-util/notice-util.cjs +64 -0
- package/lib/util/open-view-util/open-view-util.cjs +6 -6
- package/package.json +5 -5
- package/dist/ibiz-markdown-editor-RaswfMqH.js +0 -1
- package/dist/index-5ErnlgZ5.js +0 -2
- package/dist/wang-editor-8iEE3iXJ.js +0 -1
|
@@ -280,7 +280,13 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
280
280
|
Authorization: "Bearer ".concat(getCookie(CoreConst.TOKEN))
|
|
281
281
|
});
|
|
282
282
|
const UploadUrl = computed(() => {
|
|
283
|
-
let
|
|
283
|
+
let uploadFileUrl;
|
|
284
|
+
if (ibiz.env.uploadFileUrl.indexOf("{cat}") !== -1) {
|
|
285
|
+
uploadFileUrl = ibiz.env.uploadFileUrl.replace("/{cat}", "/temp");
|
|
286
|
+
} else {
|
|
287
|
+
uploadFileUrl = "".concat(ibiz.env.uploadFileUrl, "/temp");
|
|
288
|
+
}
|
|
289
|
+
let uploadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(uploadFileUrl);
|
|
284
290
|
uploadUrl += qs.stringify({
|
|
285
291
|
preview: true
|
|
286
292
|
}, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-async-action-notice.el-notification{width:auto}.ibiz-async-action-notice.el-notification .el-notification__group{margin:0}.ibiz-async-action-notice.el-notification .el-notification__closeBtn{top:5px;right:5px}.ibiz-doing-notice__text{margin-right:8px}.ibiz-doing-notice__num{margin:0 8px;font-size:18px;font-weight:700;color:var(--ibiz-color-danger)}.ibiz-doing-notice__loading-icon{width:18px;height:18px;margin-right:6px;vertical-align:middle;animation:loading-rotate 2s linear infinite}.ibiz-doing-notice__loading-icon .path{stroke:var(--ibiz-color-primary);stroke-dasharray:90,150;stroke-dashoffset:0;stroke-linecap:round;stroke-width:2;animation:loading-dash 1.5s ease-in-out infinite}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import './doing-notice.scss';
|
|
3
|
+
export declare const DoingNotice: import("vue").DefineComponent<{
|
|
4
|
+
info: {
|
|
5
|
+
type: PropType<{
|
|
6
|
+
num: number;
|
|
7
|
+
}>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}, {
|
|
11
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
12
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
info: {
|
|
14
|
+
type: PropType<{
|
|
15
|
+
num: number;
|
|
16
|
+
}>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
}>>, {}, {}>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createTextVNode, createVNode, defineComponent } from 'vue';
|
|
2
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
+
import './doing-notice.css';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
const DoingNotice = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "DoingNotice",
|
|
8
|
+
props: {
|
|
9
|
+
info: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: true
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup() {
|
|
15
|
+
const ns = useNamespace("doing-notice");
|
|
16
|
+
return {
|
|
17
|
+
ns
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
render() {
|
|
21
|
+
return createVNode("div", {
|
|
22
|
+
"class": [this.ns.b()]
|
|
23
|
+
}, [createVNode("span", {
|
|
24
|
+
"class": this.ns.e("text")
|
|
25
|
+
}, [createTextVNode("\u6709"), createVNode("span", {
|
|
26
|
+
"class": this.ns.e("num")
|
|
27
|
+
}, [this.info.num]), createTextVNode("\u4E2A\u5F02\u6B65\u64CD\u4F5C\u6B63\u5728\u6267\u884C\uFF0C\u8BF7\u7A0D\u540E")]), createVNode("svg", {
|
|
28
|
+
"class": this.ns.e("loading-icon"),
|
|
29
|
+
"viewBox": "-10, -10, 50, 50"
|
|
30
|
+
}, [createVNode("path", {
|
|
31
|
+
"class": "path",
|
|
32
|
+
"d": "M 30 15 L 28 17 M 25.61 25.61 A 15 15, 0, 0, 1, 15 30 A 15 15, 0, 1, 1, 27.99 7.5 L 15 15",
|
|
33
|
+
"style": "stroke-width: 4px; fill: rgba(0, 0, 0, 0)"
|
|
34
|
+
}, null)])]);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export { DoingNotice };
|
package/es/common/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './split/split';
|
|
|
7
7
|
export * from './split-trigger/split-trigger';
|
|
8
8
|
export * from './sort-bar/sort-bar';
|
|
9
9
|
export type { MapOptions } from './map-chart/map-chart.util';
|
|
10
|
+
export { DoingNotice } from './doing-notice/doing-notice';
|
|
10
11
|
export declare const IBizCommonComponents: {
|
|
11
12
|
install: (v: App) => void;
|
|
12
13
|
};
|
package/es/common/index.mjs
CHANGED
|
@@ -16,12 +16,14 @@ import { DataImport2 } from './data-import2/data-import2.mjs';
|
|
|
16
16
|
import { DataImport2Table } from './data-import2-table/data-import2-table.mjs';
|
|
17
17
|
import { DataImport2Select } from './data-import2-select/data-import2-select.mjs';
|
|
18
18
|
import { IBizGridSetting } from './grid-setting/grid-setting.mjs';
|
|
19
|
+
import { DoingNotice } from './doing-notice/doing-notice.mjs';
|
|
19
20
|
|
|
20
21
|
"use strict";
|
|
21
22
|
const IBizCommonComponents = {
|
|
22
23
|
install: (v) => {
|
|
23
24
|
v.component(IBizControlBase.name, IBizControlBase);
|
|
24
25
|
v.component(IBizIcon.name, IBizIcon);
|
|
26
|
+
v.component(DoingNotice.name, DoingNotice);
|
|
25
27
|
v.component(IBizRow.name, IBizRow);
|
|
26
28
|
v.component(IBizCol.name, IBizCol);
|
|
27
29
|
v.component(IBizRouterView.name, IBizRouterView);
|
|
@@ -52,4 +54,4 @@ const IBizCommonComponents = {
|
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
56
|
|
|
55
|
-
export { IBizActionToolbar, IBizCol, IBizCommonComponents, IBizRawItem, IBizRow, IBizSortBar, IBizSplit, IBizSplitTrigger, IBizCommonComponents as default };
|
|
57
|
+
export { DoingNotice, IBizActionToolbar, IBizCol, IBizCommonComponents, IBizRawItem, IBizRow, IBizSortBar, IBizSplit, IBizSplitTrigger, IBizCommonComponents as default };
|
|
@@ -17,30 +17,4 @@ export declare class HtmlEditorController extends EditorController<IHtml> {
|
|
|
17
17
|
*/
|
|
18
18
|
exportParams?: IParams;
|
|
19
19
|
protected onInit(): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* 计算文件的上传路径和下载路径
|
|
22
|
-
* 下载路径文件id用%fileId%占位,替换即可
|
|
23
|
-
* 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
|
|
24
|
-
*
|
|
25
|
-
* @author lxm
|
|
26
|
-
* @date 2022-11-17 13:11:43
|
|
27
|
-
* @param {IData} data
|
|
28
|
-
* @returns {*} {{ uploadUrl: string; downloadUrl: string }}
|
|
29
|
-
*/
|
|
30
|
-
calcBaseUrl(data: IData): {
|
|
31
|
-
uploadUrl: string;
|
|
32
|
-
downloadUrl: string;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* 请求url获取文件流,并用JS触发文件下载
|
|
36
|
-
*
|
|
37
|
-
* @author lxm
|
|
38
|
-
* @date 2022-11-17 14:11:09
|
|
39
|
-
* @param {string} url
|
|
40
|
-
* @param {IData} file
|
|
41
|
-
*/
|
|
42
|
-
fileDownload(file: {
|
|
43
|
-
url: string;
|
|
44
|
-
name: string;
|
|
45
|
-
}): void;
|
|
46
20
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EditorController, convertNavData } from '@ibiz-template/runtime';
|
|
3
|
-
import qs from 'qs';
|
|
1
|
+
import { EditorController } from '@ibiz-template/runtime';
|
|
4
2
|
|
|
5
3
|
"use strict";
|
|
6
4
|
var __defProp = Object.defineProperty;
|
|
@@ -49,67 +47,6 @@ class HtmlEditorController extends EditorController {
|
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
|
-
/**
|
|
53
|
-
* 计算文件的上传路径和下载路径
|
|
54
|
-
* 下载路径文件id用%fileId%占位,替换即可
|
|
55
|
-
* 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
|
|
56
|
-
*
|
|
57
|
-
* @author lxm
|
|
58
|
-
* @date 2022-11-17 13:11:43
|
|
59
|
-
* @param {IData} data
|
|
60
|
-
* @returns {*} {{ uploadUrl: string; downloadUrl: string }}
|
|
61
|
-
*/
|
|
62
|
-
calcBaseUrl(data) {
|
|
63
|
-
let uploadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.uploadFileUrl);
|
|
64
|
-
let downloadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl, "/%fileId%");
|
|
65
|
-
let uploadParams = {};
|
|
66
|
-
let exportParams = {};
|
|
67
|
-
if (this.uploadParams) {
|
|
68
|
-
uploadParams = convertNavData(
|
|
69
|
-
this.uploadParams,
|
|
70
|
-
data,
|
|
71
|
-
this.params,
|
|
72
|
-
this.context
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
if (this.exportParams) {
|
|
76
|
-
exportParams = convertNavData(
|
|
77
|
-
this.exportParams,
|
|
78
|
-
data,
|
|
79
|
-
this.params,
|
|
80
|
-
this.context
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
uploadUrl += qs.stringify(uploadParams, { addQueryPrefix: true });
|
|
84
|
-
downloadUrl += qs.stringify(exportParams, { addQueryPrefix: true });
|
|
85
|
-
return { uploadUrl, downloadUrl };
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* 请求url获取文件流,并用JS触发文件下载
|
|
89
|
-
*
|
|
90
|
-
* @author lxm
|
|
91
|
-
* @date 2022-11-17 14:11:09
|
|
92
|
-
* @param {string} url
|
|
93
|
-
* @param {IData} file
|
|
94
|
-
*/
|
|
95
|
-
fileDownload(file) {
|
|
96
|
-
ibiz.net.request(file.url, {
|
|
97
|
-
method: "get",
|
|
98
|
-
responseType: "blob",
|
|
99
|
-
baseURL: ""
|
|
100
|
-
// 已经有baseURL了,这里无需再写
|
|
101
|
-
}).then((response) => {
|
|
102
|
-
if (response.status !== 200) {
|
|
103
|
-
throw new RuntimeError("\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25");
|
|
104
|
-
}
|
|
105
|
-
if (!response.data) {
|
|
106
|
-
throw new RuntimeError("\u6587\u4EF6\u6D41\u6570\u636E\u4E0D\u5B58\u5728");
|
|
107
|
-
} else {
|
|
108
|
-
const fileName = file.name;
|
|
109
|
-
downloadFileFromBlob(response.data, fileName);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
50
|
}
|
|
114
51
|
|
|
115
52
|
export { HtmlEditorController };
|
|
@@ -47,7 +47,7 @@ const IBizHtml = /* @__PURE__ */ defineComponent({
|
|
|
47
47
|
}
|
|
48
48
|
watch(() => props.data, (newVal) => {
|
|
49
49
|
if (newVal) {
|
|
50
|
-
const urls = c.
|
|
50
|
+
const urls = ibiz.util.file.calcFileUpDownUrl(c.context, c.params, newVal, c.editorParams);
|
|
51
51
|
uploadUrl.value = urls.uploadUrl;
|
|
52
52
|
downloadUrl.value = urls.downloadUrl;
|
|
53
53
|
}
|
|
@@ -33,7 +33,7 @@ const IBizMarkDown = /* @__PURE__ */ defineComponent({
|
|
|
33
33
|
const cssVars = ref({});
|
|
34
34
|
watch(() => props.data, (newVal) => {
|
|
35
35
|
if (newVal && c) {
|
|
36
|
-
const urls = c.
|
|
36
|
+
const urls = ibiz.util.file.calcFileUpDownUrl(c.context, c.params, newVal, c.editorParams);
|
|
37
37
|
uploadUrl.value = urls.uploadUrl;
|
|
38
38
|
downloadUrl.value = urls.downloadUrl;
|
|
39
39
|
}
|
|
@@ -42,22 +42,10 @@ const IBizMarkDown = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
deep: true
|
|
43
43
|
});
|
|
44
44
|
const markDownBox = ref();
|
|
45
|
-
const fileUpload = (file, callback) => {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
url: uploadUrl.value,
|
|
50
|
-
method: "post",
|
|
51
|
-
headers: headers.value,
|
|
52
|
-
data: formData
|
|
53
|
-
}).then((res) => {
|
|
54
|
-
if (res.status === 200 && res.data.fileid) {
|
|
55
|
-
const url = downloadUrl.value.replace("%fileId%", res.data.fileid);
|
|
56
|
-
callback(url);
|
|
57
|
-
}
|
|
58
|
-
}).catch((error) => {
|
|
59
|
-
ibiz.log.error("\u4E0A\u4F20\u51FA\u9519", error);
|
|
60
|
-
});
|
|
45
|
+
const fileUpload = async (file, callback) => {
|
|
46
|
+
const data = await ibiz.util.file.fileUpload(uploadUrl.value, file, headers.value);
|
|
47
|
+
const url = downloadUrl.value.replace("%fileId%", data.fileid);
|
|
48
|
+
callback(url);
|
|
61
49
|
};
|
|
62
50
|
const getCherryHtml = () => {
|
|
63
51
|
var _a;
|
|
@@ -73,30 +73,4 @@ export declare class MarkDownEditorController extends EditorController<IMarkdown
|
|
|
73
73
|
*/
|
|
74
74
|
chatCompletion: boolean;
|
|
75
75
|
protected onInit(): Promise<void>;
|
|
76
|
-
/**
|
|
77
|
-
* 计算文件的上传路径和下载路径
|
|
78
|
-
* 下载路径文件id用%fileId%占位,替换即可
|
|
79
|
-
* 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
|
|
80
|
-
*
|
|
81
|
-
* @author lxm
|
|
82
|
-
* @date 2022-11-17 13:11:43
|
|
83
|
-
* @param {IData} data
|
|
84
|
-
* @returns {*} {{ uploadUrl: string; downloadUrl: string }}
|
|
85
|
-
*/
|
|
86
|
-
calcBaseUrl(data: IData): {
|
|
87
|
-
uploadUrl: string;
|
|
88
|
-
downloadUrl: string;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* 请求url获取文件流,并用JS触发文件下载
|
|
92
|
-
*
|
|
93
|
-
* @author lxm
|
|
94
|
-
* @date 2022-11-17 14:11:09
|
|
95
|
-
* @param {string} url
|
|
96
|
-
* @param {IData} file
|
|
97
|
-
*/
|
|
98
|
-
fileDownload(file: {
|
|
99
|
-
url: string;
|
|
100
|
-
name: string;
|
|
101
|
-
}): void;
|
|
102
76
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { RuntimeModelError
|
|
2
|
-
import { EditorController, getDeACMode
|
|
3
|
-
import qs from 'qs';
|
|
1
|
+
import { RuntimeModelError } from '@ibiz-template/core';
|
|
2
|
+
import { EditorController, getDeACMode } from '@ibiz-template/runtime';
|
|
4
3
|
|
|
5
4
|
"use strict";
|
|
6
5
|
var __defProp = Object.defineProperty;
|
|
@@ -142,67 +141,6 @@ class MarkDownEditorController extends EditorController {
|
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
}
|
|
145
|
-
/**
|
|
146
|
-
* 计算文件的上传路径和下载路径
|
|
147
|
-
* 下载路径文件id用%fileId%占位,替换即可
|
|
148
|
-
* 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
|
|
149
|
-
*
|
|
150
|
-
* @author lxm
|
|
151
|
-
* @date 2022-11-17 13:11:43
|
|
152
|
-
* @param {IData} data
|
|
153
|
-
* @returns {*} {{ uploadUrl: string; downloadUrl: string }}
|
|
154
|
-
*/
|
|
155
|
-
calcBaseUrl(data) {
|
|
156
|
-
let uploadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.uploadFileUrl);
|
|
157
|
-
let downloadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl, "/%fileId%");
|
|
158
|
-
let uploadParams = {};
|
|
159
|
-
let exportParams = {};
|
|
160
|
-
if (this.uploadParams) {
|
|
161
|
-
uploadParams = convertNavData(
|
|
162
|
-
this.uploadParams,
|
|
163
|
-
data,
|
|
164
|
-
this.params,
|
|
165
|
-
this.context
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
if (this.exportParams) {
|
|
169
|
-
exportParams = convertNavData(
|
|
170
|
-
this.exportParams,
|
|
171
|
-
data,
|
|
172
|
-
this.params,
|
|
173
|
-
this.context
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
uploadUrl += qs.stringify(uploadParams, { addQueryPrefix: true });
|
|
177
|
-
downloadUrl += qs.stringify(exportParams, { addQueryPrefix: true });
|
|
178
|
-
return { uploadUrl, downloadUrl };
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* 请求url获取文件流,并用JS触发文件下载
|
|
182
|
-
*
|
|
183
|
-
* @author lxm
|
|
184
|
-
* @date 2022-11-17 14:11:09
|
|
185
|
-
* @param {string} url
|
|
186
|
-
* @param {IData} file
|
|
187
|
-
*/
|
|
188
|
-
fileDownload(file) {
|
|
189
|
-
ibiz.net.request(file.url, {
|
|
190
|
-
method: "get",
|
|
191
|
-
responseType: "blob",
|
|
192
|
-
baseURL: ""
|
|
193
|
-
// 已经有baseURL了,这里无需再写
|
|
194
|
-
}).then((response) => {
|
|
195
|
-
if (response.status !== 200) {
|
|
196
|
-
throw new RuntimeError("\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25");
|
|
197
|
-
}
|
|
198
|
-
if (!response.data) {
|
|
199
|
-
throw new RuntimeError("\u6587\u4EF6\u6D41\u6570\u636E\u4E0D\u5B58\u5728");
|
|
200
|
-
} else {
|
|
201
|
-
const fileName = file.name;
|
|
202
|
-
downloadFileFromBlob(response.data, fileName);
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
144
|
}
|
|
207
145
|
|
|
208
146
|
export { MarkDownEditorController };
|
|
@@ -28,30 +28,4 @@ export declare class UploadEditorController extends EditorController<IFileUpload
|
|
|
28
28
|
*/
|
|
29
29
|
exportParams?: IParams;
|
|
30
30
|
protected onInit(): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* 计算文件的上传路径和下载路径
|
|
33
|
-
* 下载路径文件id用%fileId%占位,替换即可
|
|
34
|
-
* 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
|
|
35
|
-
*
|
|
36
|
-
* @author lxm
|
|
37
|
-
* @date 2022-11-17 13:11:43
|
|
38
|
-
* @param {IData} data
|
|
39
|
-
* @returns {*} {{ uploadUrl: string; downloadUrl: string }}
|
|
40
|
-
*/
|
|
41
|
-
calcBaseUrl(data: IData): {
|
|
42
|
-
uploadUrl: string;
|
|
43
|
-
downloadUrl: string;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* 请求url获取文件流,并用JS触发文件下载
|
|
47
|
-
*
|
|
48
|
-
* @author lxm
|
|
49
|
-
* @date 2022-11-17 14:11:09
|
|
50
|
-
* @param {string} url
|
|
51
|
-
* @param {IData} file
|
|
52
|
-
*/
|
|
53
|
-
fileDownload(file: {
|
|
54
|
-
url: string;
|
|
55
|
-
name: string;
|
|
56
|
-
}): void;
|
|
57
31
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { RuntimeModelError
|
|
2
|
-
import { EditorController
|
|
3
|
-
import qs from 'qs';
|
|
1
|
+
import { RuntimeModelError } from '@ibiz-template/core';
|
|
2
|
+
import { EditorController } from '@ibiz-template/runtime';
|
|
4
3
|
|
|
5
4
|
"use strict";
|
|
6
5
|
var __defProp = Object.defineProperty;
|
|
@@ -77,67 +76,6 @@ class UploadEditorController extends EditorController {
|
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
|
-
/**
|
|
81
|
-
* 计算文件的上传路径和下载路径
|
|
82
|
-
* 下载路径文件id用%fileId%占位,替换即可
|
|
83
|
-
* 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
|
|
84
|
-
*
|
|
85
|
-
* @author lxm
|
|
86
|
-
* @date 2022-11-17 13:11:43
|
|
87
|
-
* @param {IData} data
|
|
88
|
-
* @returns {*} {{ uploadUrl: string; downloadUrl: string }}
|
|
89
|
-
*/
|
|
90
|
-
calcBaseUrl(data) {
|
|
91
|
-
let uploadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.uploadFileUrl);
|
|
92
|
-
let downloadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl, "/%fileId%");
|
|
93
|
-
let uploadParams = {};
|
|
94
|
-
let exportParams = {};
|
|
95
|
-
if (this.uploadParams) {
|
|
96
|
-
uploadParams = convertNavData(
|
|
97
|
-
this.uploadParams,
|
|
98
|
-
data,
|
|
99
|
-
this.params,
|
|
100
|
-
this.context
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
if (this.exportParams) {
|
|
104
|
-
exportParams = convertNavData(
|
|
105
|
-
this.exportParams,
|
|
106
|
-
data,
|
|
107
|
-
this.params,
|
|
108
|
-
this.context
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
uploadUrl += qs.stringify(uploadParams, { addQueryPrefix: true });
|
|
112
|
-
downloadUrl += qs.stringify(exportParams, { addQueryPrefix: true });
|
|
113
|
-
return { uploadUrl, downloadUrl };
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* 请求url获取文件流,并用JS触发文件下载
|
|
117
|
-
*
|
|
118
|
-
* @author lxm
|
|
119
|
-
* @date 2022-11-17 14:11:09
|
|
120
|
-
* @param {string} url
|
|
121
|
-
* @param {IData} file
|
|
122
|
-
*/
|
|
123
|
-
fileDownload(file) {
|
|
124
|
-
ibiz.net.request(file.url, {
|
|
125
|
-
method: "get",
|
|
126
|
-
responseType: "blob",
|
|
127
|
-
baseURL: ""
|
|
128
|
-
// 已经有baseURL了,这里无需再写
|
|
129
|
-
}).then((response) => {
|
|
130
|
-
if (response.status !== 200) {
|
|
131
|
-
throw new RuntimeError("\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25");
|
|
132
|
-
}
|
|
133
|
-
if (!response.data) {
|
|
134
|
-
throw new RuntimeError("\u6587\u4EF6\u6D41\u6570\u636E\u4E0D\u5B58\u5728");
|
|
135
|
-
} else {
|
|
136
|
-
const fileName = file.name;
|
|
137
|
-
downloadFileFromBlob(response.data, fileName);
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
79
|
}
|
|
142
80
|
|
|
143
81
|
export { UploadEditorController };
|
|
@@ -23,7 +23,12 @@ function useIBizUploadInit(props) {
|
|
|
23
23
|
props.data,
|
|
24
24
|
(newVal) => {
|
|
25
25
|
if (newVal) {
|
|
26
|
-
const urls =
|
|
26
|
+
const urls = ibiz.util.file.calcFileUpDownUrl(
|
|
27
|
+
props.controller.value.context,
|
|
28
|
+
props.controller.value.params,
|
|
29
|
+
newVal,
|
|
30
|
+
props.controller.value.editorParams
|
|
31
|
+
);
|
|
27
32
|
uploadUrl.value = urls.uploadUrl;
|
|
28
33
|
downloadUrl.value = urls.downloadUrl;
|
|
29
34
|
}
|
|
@@ -26,7 +26,12 @@ function useIViewUpload(props, valueChange, c) {
|
|
|
26
26
|
() => props.data,
|
|
27
27
|
(newVal) => {
|
|
28
28
|
if (newVal) {
|
|
29
|
-
const urls =
|
|
29
|
+
const urls = ibiz.util.file.calcFileUpDownUrl(
|
|
30
|
+
c.context,
|
|
31
|
+
c.params,
|
|
32
|
+
newVal,
|
|
33
|
+
c.editorParams
|
|
34
|
+
);
|
|
30
35
|
uploadUrl.value = urls.uploadUrl;
|
|
31
36
|
downloadUrl.value = urls.downloadUrl;
|
|
32
37
|
}
|
|
@@ -96,7 +101,7 @@ function useIViewUpload(props, valueChange, c) {
|
|
|
96
101
|
};
|
|
97
102
|
const onDownload = (file) => {
|
|
98
103
|
const url = file.url || downloadUrl.value.replace("%fileId%", file.id);
|
|
99
|
-
|
|
104
|
+
ibiz.util.file.fileDownload(url, file.name);
|
|
100
105
|
};
|
|
101
106
|
const limit = computed(() => {
|
|
102
107
|
return c.multiple ? 9999 : 1;
|
package/es/index.mjs
CHANGED
|
@@ -45,6 +45,7 @@ import { IBizMapControl } from './control/map/index.mjs';
|
|
|
45
45
|
import { IBizReportPanelControl } from './control/report-panel/index.mjs';
|
|
46
46
|
import { IBizGanttControl } from './control/gantt/index.mjs';
|
|
47
47
|
import { IBizContextMenuControl } from './control/context-menu/index.mjs';
|
|
48
|
+
export { DoingNotice } from './common/doing-notice/doing-notice.mjs';
|
|
48
49
|
export { IBizCol } from './common/col/col.mjs';
|
|
49
50
|
export { IBizRow } from './common/row/row.mjs';
|
|
50
51
|
export { IBizActionToolbar } from './common/action-toolbar/action-toolbar.mjs';
|
|
@@ -117,6 +118,7 @@ export { NotificationUtil } from './util/notification-util/notification-util.mjs
|
|
|
117
118
|
export { OpenViewUtil } from './util/open-view-util/open-view-util.mjs';
|
|
118
119
|
export { OverlayController } from './util/overlay-controller/overlay-controller.mjs';
|
|
119
120
|
export { usePagination } from './util/pagination/use-pagination.mjs';
|
|
121
|
+
export { NoticeUtil } from './util/notice-util/notice-util.mjs';
|
|
120
122
|
|
|
121
123
|
"use strict";
|
|
122
124
|
var index = {
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
import { IPortalAsyncAction } from '@ibiz-template/core';
|
|
3
3
|
import './async-action.scss';
|
|
4
|
+
import { IAsyncActionProvider } from '@ibiz-template/runtime';
|
|
4
5
|
export declare const AsyncAction: import("vue").DefineComponent<{
|
|
5
|
-
|
|
6
|
+
action: {
|
|
6
7
|
type: PropType<IPortalAsyncAction>;
|
|
7
8
|
required: true;
|
|
8
9
|
};
|
|
10
|
+
provider: {
|
|
11
|
+
type: PropType<IAsyncActionProvider>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
9
14
|
}, {
|
|
10
15
|
ns: import("@ibiz-template/core").Namespace;
|
|
11
16
|
showErrorInfo: import("vue").ComputedRef<boolean | "">;
|
|
12
17
|
clickable: import("vue").ComputedRef<boolean>;
|
|
13
18
|
actionstate: import("vue").ComputedRef<10 | 20 | 30 | 40>;
|
|
14
19
|
progressText: import("vue").ComputedRef<string>;
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
onClick: (event: MouseEvent) => Promise<void>;
|
|
21
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
close: () => true;
|
|
23
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
action: {
|
|
17
25
|
type: PropType<IPortalAsyncAction>;
|
|
18
26
|
required: true;
|
|
19
27
|
};
|
|
20
|
-
|
|
28
|
+
provider: {
|
|
29
|
+
type: PropType<IAsyncActionProvider>;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
}>> & {
|
|
33
|
+
onClose?: (() => any) | undefined;
|
|
34
|
+
}, {}, {}>;
|