@ibiz-template/vue3-components 0.5.7-alpha.3 → 0.5.7-alpha.5
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--KqYDzjn.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-74o5wGKy.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/control/dashboard/custom-dashboard-container/custom-dashboard-container.d.ts +236 -0
- package/es/control/dashboard/dashboard-design/dashboard-design.d.ts +2 -0
- package/es/control/form/form-detail/form-button/form-button.mjs +2 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +2124 -0
- package/es/control/grid/grid/grid-control.util.mjs +4 -0
- package/es/control/search-bar/filter-tree/filter-tree.d.ts +45 -14
- package/es/control/search-bar/filter-tree/filter-tree.mjs +42 -21
- package/es/control/search-bar/search-bar.mjs +8 -2
- 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/index.mjs +8 -0
- 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/span/span/span.d.ts +2 -0
- package/es/editor/text-box/ibiz-input-number/ibiz-input-number.mjs +2 -2
- 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/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.controller.d.ts +46 -0
- package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.controller.mjs +93 -0
- package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.css +1 -0
- package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.d.ts +81 -0
- package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.mjs +187 -0
- package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.provider.d.ts +17 -0
- package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.provider.mjs +22 -0
- package/es/editor/user/ibiz-searchcond-edit/index.d.ts +3 -0
- package/es/editor/user/ibiz-searchcond-edit/index.mjs +5 -0
- package/es/editor/user/index.d.ts +1 -0
- package/es/editor/user/index.mjs +6 -0
- 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/control/form/form-detail/form-button/form-button.cjs +2 -1
- package/lib/control/grid/grid/grid-control.util.cjs +4 -0
- package/lib/control/search-bar/filter-tree/filter-tree.cjs +41 -20
- package/lib/control/search-bar/search-bar.cjs +8 -2
- package/lib/editor/html/html-editor.controller.cjs +0 -63
- package/lib/editor/html/wang-editor/wang-editor.cjs +1 -1
- package/lib/editor/index.cjs +8 -0
- 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/text-box/ibiz-input-number/ibiz-input-number.cjs +2 -2
- 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/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.cjs +189 -0
- package/lib/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.controller.cjs +95 -0
- package/lib/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.css +1 -0
- package/lib/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.provider.cjs +24 -0
- package/lib/editor/user/ibiz-searchcond-edit/index.cjs +11 -0
- package/lib/editor/user/index.cjs +12 -0
- 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 +6 -6
- package/dist/ibiz-markdown-editor-RaswfMqH.js +0 -1
- package/dist/index-5ErnlgZ5.js +0 -2
- package/dist/wang-editor-8iEE3iXJ.js +0 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var core = require('@ibiz-template/core');
|
|
4
3
|
var runtime = require('@ibiz-template/runtime');
|
|
5
|
-
var qs = require('qs');
|
|
6
4
|
|
|
7
5
|
"use strict";
|
|
8
6
|
var __defProp = Object.defineProperty;
|
|
@@ -51,67 +49,6 @@ class HtmlEditorController extends runtime.EditorController {
|
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
|
-
/**
|
|
55
|
-
* 计算文件的上传路径和下载路径
|
|
56
|
-
* 下载路径文件id用%fileId%占位,替换即可
|
|
57
|
-
* 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
|
|
58
|
-
*
|
|
59
|
-
* @author lxm
|
|
60
|
-
* @date 2022-11-17 13:11:43
|
|
61
|
-
* @param {IData} data
|
|
62
|
-
* @returns {*} {{ uploadUrl: string; downloadUrl: string }}
|
|
63
|
-
*/
|
|
64
|
-
calcBaseUrl(data) {
|
|
65
|
-
let uploadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.uploadFileUrl);
|
|
66
|
-
let downloadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl, "/%fileId%");
|
|
67
|
-
let uploadParams = {};
|
|
68
|
-
let exportParams = {};
|
|
69
|
-
if (this.uploadParams) {
|
|
70
|
-
uploadParams = runtime.convertNavData(
|
|
71
|
-
this.uploadParams,
|
|
72
|
-
data,
|
|
73
|
-
this.params,
|
|
74
|
-
this.context
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
if (this.exportParams) {
|
|
78
|
-
exportParams = runtime.convertNavData(
|
|
79
|
-
this.exportParams,
|
|
80
|
-
data,
|
|
81
|
-
this.params,
|
|
82
|
-
this.context
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
uploadUrl += qs.stringify(uploadParams, { addQueryPrefix: true });
|
|
86
|
-
downloadUrl += qs.stringify(exportParams, { addQueryPrefix: true });
|
|
87
|
-
return { uploadUrl, downloadUrl };
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* 请求url获取文件流,并用JS触发文件下载
|
|
91
|
-
*
|
|
92
|
-
* @author lxm
|
|
93
|
-
* @date 2022-11-17 14:11:09
|
|
94
|
-
* @param {string} url
|
|
95
|
-
* @param {IData} file
|
|
96
|
-
*/
|
|
97
|
-
fileDownload(file) {
|
|
98
|
-
ibiz.net.request(file.url, {
|
|
99
|
-
method: "get",
|
|
100
|
-
responseType: "blob",
|
|
101
|
-
baseURL: ""
|
|
102
|
-
// 已经有baseURL了,这里无需再写
|
|
103
|
-
}).then((response) => {
|
|
104
|
-
if (response.status !== 200) {
|
|
105
|
-
throw new core.RuntimeError("\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25");
|
|
106
|
-
}
|
|
107
|
-
if (!response.data) {
|
|
108
|
-
throw new core.RuntimeError("\u6587\u4EF6\u6D41\u6570\u636E\u4E0D\u5B58\u5728");
|
|
109
|
-
} else {
|
|
110
|
-
const fileName = file.name;
|
|
111
|
-
core.downloadFileFromBlob(response.data, fileName);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
52
|
}
|
|
116
53
|
|
|
117
54
|
exports.HtmlEditorController = HtmlEditorController;
|
|
@@ -51,7 +51,7 @@ const IBizHtml = /* @__PURE__ */ vue.defineComponent({
|
|
|
51
51
|
}
|
|
52
52
|
vue.watch(() => props.data, (newVal) => {
|
|
53
53
|
if (newVal) {
|
|
54
|
-
const urls = c.
|
|
54
|
+
const urls = ibiz.util.file.calcFileUpDownUrl(c.context, c.params, newVal, c.editorParams);
|
|
55
55
|
uploadUrl.value = urls.uploadUrl;
|
|
56
56
|
downloadUrl.value = urls.downloadUrl;
|
|
57
57
|
}
|
package/lib/editor/index.cjs
CHANGED
|
@@ -30,6 +30,7 @@ require('./array/index.cjs');
|
|
|
30
30
|
require('./cascader/index.cjs');
|
|
31
31
|
require('./color-picker/index.cjs');
|
|
32
32
|
require('./preset/index.cjs');
|
|
33
|
+
require('./user/ibiz-searchcond-edit/index.cjs');
|
|
33
34
|
var span = require('./span/span/span.cjs');
|
|
34
35
|
var spanLink = require('./span/span-link/span-link.cjs');
|
|
35
36
|
var input = require('./text-box/input/input.cjs');
|
|
@@ -63,6 +64,7 @@ var ibizArray = require('./array/ibiz-array/ibiz-array.cjs');
|
|
|
63
64
|
var ibizCascader = require('./cascader/ibiz-cascader/ibiz-cascader.cjs');
|
|
64
65
|
var ibizColorPicker = require('./color-picker/ibiz-color-picker/ibiz-color-picker.cjs');
|
|
65
66
|
var ibizPresetRawitem = require('./preset/preset-rawitem/ibiz-preset-rawitem/ibiz-preset-rawitem.cjs');
|
|
67
|
+
var ibizSearchcondEdit = require('./user/ibiz-searchcond-edit/ibiz-searchcond-edit.cjs');
|
|
66
68
|
var spanEditor_provider = require('./span/span-editor.provider.cjs');
|
|
67
69
|
var textBoxEditor_provider = require('./text-box/text-box-editor.provider.cjs');
|
|
68
70
|
var dropdownListEditor_provider = require('./dropdown-list/dropdown-list-editor.provider.cjs');
|
|
@@ -87,6 +89,7 @@ var markdownEditor_provider = require('./markdown/markdown-editor.provider.cjs')
|
|
|
87
89
|
var arrayEditor_provider = require('./array/array-editor.provider.cjs');
|
|
88
90
|
var cascaderEditor_provider = require('./cascader/cascader-editor.provider.cjs');
|
|
89
91
|
var colorPickerEditor_provider = require('./color-picker/color-picker-editor.provider.cjs');
|
|
92
|
+
var ibizSearchcondEdit_provider = require('./user/ibiz-searchcond-edit/ibiz-searchcond-edit.provider.cjs');
|
|
90
93
|
|
|
91
94
|
"use strict";
|
|
92
95
|
const IBizEditor = {
|
|
@@ -125,6 +128,7 @@ const IBizEditor = {
|
|
|
125
128
|
v.component(ibizCascader.IBizCascader.name, ibizCascader.IBizCascader);
|
|
126
129
|
v.component(ibizColorPicker.IBizColorPicker.name, ibizColorPicker.IBizColorPicker);
|
|
127
130
|
v.component(ibizPresetRawitem.IBizPresetRawitem.name, ibizPresetRawitem.IBizPresetRawitem);
|
|
131
|
+
v.component(ibizSearchcondEdit.IBizSearchCondEdit.name, ibizSearchcondEdit.IBizSearchCondEdit);
|
|
128
132
|
v.component(
|
|
129
133
|
"IBizHtml",
|
|
130
134
|
vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('./html/wang-editor/wang-editor.cjs'); }))
|
|
@@ -289,6 +293,10 @@ const IBizEditor = {
|
|
|
289
293
|
"COLORPICKER",
|
|
290
294
|
() => new colorPickerEditor_provider.ColorPickerEditorProvider()
|
|
291
295
|
);
|
|
296
|
+
runtime.registerEditorProvider(
|
|
297
|
+
"PICKER_searchCondEdit",
|
|
298
|
+
() => new ibizSearchcondEdit_provider.SearchCondEditEditorProvider()
|
|
299
|
+
);
|
|
292
300
|
runtime.registerEditorProvider(
|
|
293
301
|
"FIELD_IMAGE_PICTURE_ONE",
|
|
294
302
|
() => new uploadEditor_provider.FileUploaderEditorProvider("PICTURE_ONE")
|
|
@@ -37,7 +37,7 @@ const IBizMarkDown = /* @__PURE__ */ vue.defineComponent({
|
|
|
37
37
|
const cssVars = vue.ref({});
|
|
38
38
|
vue.watch(() => props.data, (newVal) => {
|
|
39
39
|
if (newVal && c) {
|
|
40
|
-
const urls = c.
|
|
40
|
+
const urls = ibiz.util.file.calcFileUpDownUrl(c.context, c.params, newVal, c.editorParams);
|
|
41
41
|
uploadUrl.value = urls.uploadUrl;
|
|
42
42
|
downloadUrl.value = urls.downloadUrl;
|
|
43
43
|
}
|
|
@@ -46,22 +46,10 @@ const IBizMarkDown = /* @__PURE__ */ vue.defineComponent({
|
|
|
46
46
|
deep: true
|
|
47
47
|
});
|
|
48
48
|
const markDownBox = vue.ref();
|
|
49
|
-
const fileUpload = (file, callback) => {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
url: uploadUrl.value,
|
|
54
|
-
method: "post",
|
|
55
|
-
headers: headers.value,
|
|
56
|
-
data: formData
|
|
57
|
-
}).then((res) => {
|
|
58
|
-
if (res.status === 200 && res.data.fileid) {
|
|
59
|
-
const url = downloadUrl.value.replace("%fileId%", res.data.fileid);
|
|
60
|
-
callback(url);
|
|
61
|
-
}
|
|
62
|
-
}).catch((error) => {
|
|
63
|
-
ibiz.log.error("\u4E0A\u4F20\u51FA\u9519", error);
|
|
64
|
-
});
|
|
49
|
+
const fileUpload = async (file, callback) => {
|
|
50
|
+
const data = await ibiz.util.file.fileUpload(uploadUrl.value, file, headers.value);
|
|
51
|
+
const url = downloadUrl.value.replace("%fileId%", data.fileid);
|
|
52
|
+
callback(url);
|
|
65
53
|
};
|
|
66
54
|
const getCherryHtml = () => {
|
|
67
55
|
var _a;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@ibiz-template/core');
|
|
4
4
|
var runtime = require('@ibiz-template/runtime');
|
|
5
|
-
var qs = require('qs');
|
|
6
5
|
|
|
7
6
|
"use strict";
|
|
8
7
|
var __defProp = Object.defineProperty;
|
|
@@ -144,67 +143,6 @@ class MarkDownEditorController extends runtime.EditorController {
|
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
|
-
/**
|
|
148
|
-
* 计算文件的上传路径和下载路径
|
|
149
|
-
* 下载路径文件id用%fileId%占位,替换即可
|
|
150
|
-
* 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
|
|
151
|
-
*
|
|
152
|
-
* @author lxm
|
|
153
|
-
* @date 2022-11-17 13:11:43
|
|
154
|
-
* @param {IData} data
|
|
155
|
-
* @returns {*} {{ uploadUrl: string; downloadUrl: string }}
|
|
156
|
-
*/
|
|
157
|
-
calcBaseUrl(data) {
|
|
158
|
-
let uploadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.uploadFileUrl);
|
|
159
|
-
let downloadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl, "/%fileId%");
|
|
160
|
-
let uploadParams = {};
|
|
161
|
-
let exportParams = {};
|
|
162
|
-
if (this.uploadParams) {
|
|
163
|
-
uploadParams = runtime.convertNavData(
|
|
164
|
-
this.uploadParams,
|
|
165
|
-
data,
|
|
166
|
-
this.params,
|
|
167
|
-
this.context
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
if (this.exportParams) {
|
|
171
|
-
exportParams = runtime.convertNavData(
|
|
172
|
-
this.exportParams,
|
|
173
|
-
data,
|
|
174
|
-
this.params,
|
|
175
|
-
this.context
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
uploadUrl += qs.stringify(uploadParams, { addQueryPrefix: true });
|
|
179
|
-
downloadUrl += qs.stringify(exportParams, { addQueryPrefix: true });
|
|
180
|
-
return { uploadUrl, downloadUrl };
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* 请求url获取文件流,并用JS触发文件下载
|
|
184
|
-
*
|
|
185
|
-
* @author lxm
|
|
186
|
-
* @date 2022-11-17 14:11:09
|
|
187
|
-
* @param {string} url
|
|
188
|
-
* @param {IData} file
|
|
189
|
-
*/
|
|
190
|
-
fileDownload(file) {
|
|
191
|
-
ibiz.net.request(file.url, {
|
|
192
|
-
method: "get",
|
|
193
|
-
responseType: "blob",
|
|
194
|
-
baseURL: ""
|
|
195
|
-
// 已经有baseURL了,这里无需再写
|
|
196
|
-
}).then((response) => {
|
|
197
|
-
if (response.status !== 200) {
|
|
198
|
-
throw new core.RuntimeError("\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25");
|
|
199
|
-
}
|
|
200
|
-
if (!response.data) {
|
|
201
|
-
throw new core.RuntimeError("\u6587\u4EF6\u6D41\u6570\u636E\u4E0D\u5B58\u5728");
|
|
202
|
-
} else {
|
|
203
|
-
const fileName = file.name;
|
|
204
|
-
core.downloadFileFromBlob(response.data, fileName);
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
146
|
}
|
|
209
147
|
|
|
210
148
|
exports.MarkDownEditorController = MarkDownEditorController;
|
|
@@ -38,8 +38,8 @@ const IBizInputNumber = /* @__PURE__ */ vue.defineComponent({
|
|
|
38
38
|
});
|
|
39
39
|
vue.watch(() => props.value, (newVal, oldVal) => {
|
|
40
40
|
if (newVal !== oldVal) {
|
|
41
|
-
const number = newVal != null && !Object.is(newVal, "") ? Number(newVal) :
|
|
42
|
-
currentVal.value = Number.isNaN(number) ?
|
|
41
|
+
const number = newVal != null && !Object.is(newVal, "") ? Number(newVal) : null;
|
|
42
|
+
currentVal.value = Number.isNaN(number) ? null : number;
|
|
43
43
|
}
|
|
44
44
|
}, {
|
|
45
45
|
immediate: true
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@ibiz-template/core');
|
|
4
4
|
var runtime = require('@ibiz-template/runtime');
|
|
5
|
-
var qs = require('qs');
|
|
6
5
|
|
|
7
6
|
"use strict";
|
|
8
7
|
var __defProp = Object.defineProperty;
|
|
@@ -79,67 +78,6 @@ class UploadEditorController extends runtime.EditorController {
|
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
|
-
/**
|
|
83
|
-
* 计算文件的上传路径和下载路径
|
|
84
|
-
* 下载路径文件id用%fileId%占位,替换即可
|
|
85
|
-
* 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
|
|
86
|
-
*
|
|
87
|
-
* @author lxm
|
|
88
|
-
* @date 2022-11-17 13:11:43
|
|
89
|
-
* @param {IData} data
|
|
90
|
-
* @returns {*} {{ uploadUrl: string; downloadUrl: string }}
|
|
91
|
-
*/
|
|
92
|
-
calcBaseUrl(data) {
|
|
93
|
-
let uploadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.uploadFileUrl);
|
|
94
|
-
let downloadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl, "/%fileId%");
|
|
95
|
-
let uploadParams = {};
|
|
96
|
-
let exportParams = {};
|
|
97
|
-
if (this.uploadParams) {
|
|
98
|
-
uploadParams = runtime.convertNavData(
|
|
99
|
-
this.uploadParams,
|
|
100
|
-
data,
|
|
101
|
-
this.params,
|
|
102
|
-
this.context
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
if (this.exportParams) {
|
|
106
|
-
exportParams = runtime.convertNavData(
|
|
107
|
-
this.exportParams,
|
|
108
|
-
data,
|
|
109
|
-
this.params,
|
|
110
|
-
this.context
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
uploadUrl += qs.stringify(uploadParams, { addQueryPrefix: true });
|
|
114
|
-
downloadUrl += qs.stringify(exportParams, { addQueryPrefix: true });
|
|
115
|
-
return { uploadUrl, downloadUrl };
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* 请求url获取文件流,并用JS触发文件下载
|
|
119
|
-
*
|
|
120
|
-
* @author lxm
|
|
121
|
-
* @date 2022-11-17 14:11:09
|
|
122
|
-
* @param {string} url
|
|
123
|
-
* @param {IData} file
|
|
124
|
-
*/
|
|
125
|
-
fileDownload(file) {
|
|
126
|
-
ibiz.net.request(file.url, {
|
|
127
|
-
method: "get",
|
|
128
|
-
responseType: "blob",
|
|
129
|
-
baseURL: ""
|
|
130
|
-
// 已经有baseURL了,这里无需再写
|
|
131
|
-
}).then((response) => {
|
|
132
|
-
if (response.status !== 200) {
|
|
133
|
-
throw new core.RuntimeError("\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25");
|
|
134
|
-
}
|
|
135
|
-
if (!response.data) {
|
|
136
|
-
throw new core.RuntimeError("\u6587\u4EF6\u6D41\u6570\u636E\u4E0D\u5B58\u5728");
|
|
137
|
-
} else {
|
|
138
|
-
const fileName = file.name;
|
|
139
|
-
core.downloadFileFromBlob(response.data, fileName);
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
81
|
}
|
|
144
82
|
|
|
145
83
|
exports.UploadEditorController = UploadEditorController;
|
|
@@ -25,7 +25,12 @@ function useIBizUploadInit(props) {
|
|
|
25
25
|
props.data,
|
|
26
26
|
(newVal) => {
|
|
27
27
|
if (newVal) {
|
|
28
|
-
const urls =
|
|
28
|
+
const urls = ibiz.util.file.calcFileUpDownUrl(
|
|
29
|
+
props.controller.value.context,
|
|
30
|
+
props.controller.value.params,
|
|
31
|
+
newVal,
|
|
32
|
+
props.controller.value.editorParams
|
|
33
|
+
);
|
|
29
34
|
uploadUrl.value = urls.uploadUrl;
|
|
30
35
|
downloadUrl.value = urls.downloadUrl;
|
|
31
36
|
}
|
|
@@ -28,7 +28,12 @@ function useIViewUpload(props, valueChange, c) {
|
|
|
28
28
|
() => props.data,
|
|
29
29
|
(newVal) => {
|
|
30
30
|
if (newVal) {
|
|
31
|
-
const urls =
|
|
31
|
+
const urls = ibiz.util.file.calcFileUpDownUrl(
|
|
32
|
+
c.context,
|
|
33
|
+
c.params,
|
|
34
|
+
newVal,
|
|
35
|
+
c.editorParams
|
|
36
|
+
);
|
|
32
37
|
uploadUrl.value = urls.uploadUrl;
|
|
33
38
|
downloadUrl.value = urls.downloadUrl;
|
|
34
39
|
}
|
|
@@ -98,7 +103,7 @@ function useIViewUpload(props, valueChange, c) {
|
|
|
98
103
|
};
|
|
99
104
|
const onDownload = (file) => {
|
|
100
105
|
const url = file.url || downloadUrl.value.replace("%fileId%", file.id);
|
|
101
|
-
|
|
106
|
+
ibiz.util.file.fileDownload(url, file.name);
|
|
102
107
|
};
|
|
103
108
|
const limit = vue.computed(() => {
|
|
104
109
|
return c.multiple ? 9999 : 1;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var vue3Util = require('@ibiz-template/vue3-util');
|
|
5
|
+
require('./ibiz-searchcond-edit.css');
|
|
6
|
+
var qxUtil = require('qx-util');
|
|
7
|
+
var runtime = require('@ibiz-template/runtime');
|
|
8
|
+
|
|
9
|
+
"use strict";
|
|
10
|
+
const IBizSearchCondEdit = /* @__PURE__ */ vue.defineComponent({
|
|
11
|
+
name: "IBizSearchCondEdit",
|
|
12
|
+
props: vue3Util.getInputProps(),
|
|
13
|
+
emits: vue3Util.getEditorEmits(),
|
|
14
|
+
setup(props, {
|
|
15
|
+
emit
|
|
16
|
+
}) {
|
|
17
|
+
const ns = vue3Util.useNamespace("searchcond-edit");
|
|
18
|
+
const c = props.controller;
|
|
19
|
+
const currentVal = vue.ref(null);
|
|
20
|
+
const isEditable = vue.ref(false);
|
|
21
|
+
const editorRef = vue.ref();
|
|
22
|
+
const filterNodes = vue.ref([]);
|
|
23
|
+
const filterButtonRef = vue.ref();
|
|
24
|
+
let popover;
|
|
25
|
+
const showFormDefaultContent = vue.computed(() => {
|
|
26
|
+
if (props.controlParams && props.controlParams.editmode === "hover") {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
});
|
|
31
|
+
vue.watch(() => props.value, (newVal, oldVal) => {
|
|
32
|
+
if (newVal !== oldVal) {
|
|
33
|
+
if (newVal == null) {
|
|
34
|
+
currentVal.value = "";
|
|
35
|
+
filterNodes.value = runtime.getOriginFilterNodes();
|
|
36
|
+
} else if (typeof newVal === "string") {
|
|
37
|
+
currentVal.value = newVal;
|
|
38
|
+
if (newVal) {
|
|
39
|
+
try {
|
|
40
|
+
const searchconds = JSON.parse(newVal);
|
|
41
|
+
filterNodes.value = searchconds.map((item) => runtime.parseFilters(item));
|
|
42
|
+
} catch (error) {
|
|
43
|
+
ibiz.log.error("".concat(newVal, "\u503C\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u4E3Ajson\u5B57\u7B26\u4E32"));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
immediate: true
|
|
50
|
+
});
|
|
51
|
+
const resetFilter = () => {
|
|
52
|
+
filterNodes.value = runtime.getOriginFilterNodes();
|
|
53
|
+
};
|
|
54
|
+
resetFilter();
|
|
55
|
+
const setEditable = (flag) => {
|
|
56
|
+
if (flag) {
|
|
57
|
+
isEditable.value = flag;
|
|
58
|
+
} else {
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
isEditable.value = flag;
|
|
61
|
+
}, 100);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const handleChange = (e) => {
|
|
65
|
+
emit("change", e);
|
|
66
|
+
};
|
|
67
|
+
if (props.autoFocus) {
|
|
68
|
+
vue.watch(editorRef, (newVal) => {
|
|
69
|
+
if (newVal) {
|
|
70
|
+
const input = newVal.$el.getElementsByTagName("input")[0];
|
|
71
|
+
input.focus();
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const onFocus = (e) => {
|
|
76
|
+
emit("focus", e);
|
|
77
|
+
setEditable(true);
|
|
78
|
+
};
|
|
79
|
+
const onBlur = (e) => {
|
|
80
|
+
emit("blur", e);
|
|
81
|
+
setEditable(false);
|
|
82
|
+
};
|
|
83
|
+
const handleKeyUp = (e) => {
|
|
84
|
+
if (e && e.code === "Enter") {
|
|
85
|
+
emit("enter", e);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const getCurrentValByFilterNodes = () => {
|
|
89
|
+
const searchconds = runtime.calcSearchConds(filterNodes.value);
|
|
90
|
+
if (searchconds) {
|
|
91
|
+
currentVal.value = JSON.stringify(searchconds, null, 2);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const onConfirm = () => {
|
|
95
|
+
getCurrentValByFilterNodes();
|
|
96
|
+
if (popover) {
|
|
97
|
+
popover.dismiss();
|
|
98
|
+
}
|
|
99
|
+
emit("change", currentVal.value);
|
|
100
|
+
};
|
|
101
|
+
const onCancel = () => {
|
|
102
|
+
resetFilter();
|
|
103
|
+
getCurrentValByFilterNodes();
|
|
104
|
+
emit("change", "");
|
|
105
|
+
};
|
|
106
|
+
const showFilter = async () => {
|
|
107
|
+
popover = ibiz.overlay.createPopover(() => {
|
|
108
|
+
return vue.createVNode(vue.resolveComponent("iBizFilterTreeControl"), {
|
|
109
|
+
"filterControllers": c.filterControllers,
|
|
110
|
+
"filterNodes": filterNodes.value,
|
|
111
|
+
"parent": "searchcond-edit",
|
|
112
|
+
"onConfirm": () => {
|
|
113
|
+
onConfirm();
|
|
114
|
+
},
|
|
115
|
+
"onCancel": () => {
|
|
116
|
+
onCancel();
|
|
117
|
+
}
|
|
118
|
+
}, null);
|
|
119
|
+
}, void 0, {
|
|
120
|
+
placement: "bottom-end",
|
|
121
|
+
autoClose: true
|
|
122
|
+
});
|
|
123
|
+
popover.present(filterButtonRef.value.$el);
|
|
124
|
+
await popover.onWillDismiss();
|
|
125
|
+
popover = void 0;
|
|
126
|
+
};
|
|
127
|
+
const triggerFilter = () => {
|
|
128
|
+
if (popover) {
|
|
129
|
+
popover.dismiss();
|
|
130
|
+
} else {
|
|
131
|
+
showFilter();
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
return {
|
|
135
|
+
ns,
|
|
136
|
+
c,
|
|
137
|
+
currentVal,
|
|
138
|
+
handleChange,
|
|
139
|
+
onFocus,
|
|
140
|
+
onBlur,
|
|
141
|
+
editorRef,
|
|
142
|
+
handleKeyUp,
|
|
143
|
+
isEditable,
|
|
144
|
+
setEditable,
|
|
145
|
+
showFormDefaultContent,
|
|
146
|
+
filterNodes,
|
|
147
|
+
triggerFilter,
|
|
148
|
+
filterButtonRef,
|
|
149
|
+
resetFilter
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
render() {
|
|
153
|
+
let content = null;
|
|
154
|
+
if (this.readonly) {
|
|
155
|
+
content = qxUtil.isNilOrEmpty(this.currentVal) ? "" : "".concat(this.currentVal);
|
|
156
|
+
} else {
|
|
157
|
+
content = [vue.createVNode(vue.resolveComponent("el-input"), {
|
|
158
|
+
"ref": "editorRef",
|
|
159
|
+
"class": [this.ns.b("input")],
|
|
160
|
+
"model-value": this.currentVal,
|
|
161
|
+
"type": "textarea",
|
|
162
|
+
"rows": 10,
|
|
163
|
+
"placeholder": this.c.placeHolder,
|
|
164
|
+
"disabled": this.disabled,
|
|
165
|
+
"controls": false,
|
|
166
|
+
"onFocus": this.onFocus,
|
|
167
|
+
"onBlur": this.onBlur,
|
|
168
|
+
"onKeyup": this.handleKeyUp
|
|
169
|
+
}, null), vue.createVNode(vue.resolveComponent("el-button"), {
|
|
170
|
+
"ref": "filterButtonRef",
|
|
171
|
+
"type": "primary",
|
|
172
|
+
"title": "\u7F16\u8F91",
|
|
173
|
+
"class": this.ns.b("filter"),
|
|
174
|
+
"onClick": () => this.triggerFilter()
|
|
175
|
+
}, {
|
|
176
|
+
default: () => [vue.createVNode(vue.resolveComponent("iBizIcon"), {
|
|
177
|
+
"icon": {
|
|
178
|
+
cssClass: "fa fa-edit"
|
|
179
|
+
}
|
|
180
|
+
}, null)]
|
|
181
|
+
})];
|
|
182
|
+
}
|
|
183
|
+
return vue.createVNode("div", {
|
|
184
|
+
"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)]
|
|
185
|
+
}, [content]);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
exports.IBizSearchCondEdit = IBizSearchCondEdit;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var runtime = require('@ibiz-template/runtime');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __publicField = (obj, key, value) => {
|
|
9
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
10
|
+
return value;
|
|
11
|
+
};
|
|
12
|
+
class SearchCondEditEditorController extends runtime.EditorController {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
/**
|
|
16
|
+
* 过滤项集合
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
__publicField(this, "searchBarFilters", []);
|
|
20
|
+
/**
|
|
21
|
+
* 过滤项控制器集合
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
__publicField(this, "filterControllers", []);
|
|
25
|
+
/**
|
|
26
|
+
* 实体模型
|
|
27
|
+
* @author lxm
|
|
28
|
+
* @date 2023-10-13 02:49:59
|
|
29
|
+
* @type {IAppDataEntity}
|
|
30
|
+
*/
|
|
31
|
+
__publicField(this, "appDataEntity", null);
|
|
32
|
+
}
|
|
33
|
+
async onInit() {
|
|
34
|
+
await super.onInit();
|
|
35
|
+
await this.initByEntitySchema();
|
|
36
|
+
await this.initSearchBarFilters();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 根据实体jsonschema初始化
|
|
40
|
+
* @author lxm
|
|
41
|
+
* @date 2023-12-29 04:21:31
|
|
42
|
+
* @return {*} {Promise<void>}
|
|
43
|
+
*/
|
|
44
|
+
async initByEntitySchema() {
|
|
45
|
+
if (!this.model.appDataEntityId) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
49
|
+
this.model.appDataEntityId,
|
|
50
|
+
this.context.srfappid
|
|
51
|
+
);
|
|
52
|
+
if (appDataEntity) {
|
|
53
|
+
this.appDataEntity = appDataEntity;
|
|
54
|
+
}
|
|
55
|
+
const json = await runtime.getEntitySchema(
|
|
56
|
+
this.model.appDataEntityId,
|
|
57
|
+
this.context
|
|
58
|
+
);
|
|
59
|
+
if (!json) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const addSearchBarFilters = await runtime.calcFilterModelBySchema(
|
|
63
|
+
json,
|
|
64
|
+
this.model.appDataEntityId,
|
|
65
|
+
this.model.appId
|
|
66
|
+
);
|
|
67
|
+
this.searchBarFilters = addSearchBarFilters;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 初始化过滤项控制器
|
|
71
|
+
* @author lxm
|
|
72
|
+
* @date 2023-10-13 03:33:17
|
|
73
|
+
* @protected
|
|
74
|
+
* @return {*} {Promise<void>}
|
|
75
|
+
*/
|
|
76
|
+
async initSearchBarFilters() {
|
|
77
|
+
var _a;
|
|
78
|
+
if (((_a = this.searchBarFilters) == null ? void 0 : _a.length) && this.appDataEntity) {
|
|
79
|
+
this.searchBarFilters.forEach((item) => {
|
|
80
|
+
const filterController = new runtime.SearchBarFilterController(
|
|
81
|
+
item,
|
|
82
|
+
this.appDataEntity,
|
|
83
|
+
this.context,
|
|
84
|
+
this.params
|
|
85
|
+
);
|
|
86
|
+
this.filterControllers.push(filterController);
|
|
87
|
+
});
|
|
88
|
+
await Promise.all(
|
|
89
|
+
this.filterControllers.map((controller) => controller.init())
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
exports.SearchCondEditEditorController = SearchCondEditEditorController;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-searchcond-edit{position:relative;width:100%;height:100%;font-size:var(--ibiz-form-item-font-size);font-weight:var(--ibiz-form-item-regular)}.ibiz-searchcond-edit .ibiz-searchcond-edit-filter{position:absolute;top:var(--ibiz-spacing-tight);right:var(--ibiz-spacing-tight)}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ibizSearchcondEdit_controller = require('./ibiz-searchcond-edit.controller.cjs');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __publicField = (obj, key, value) => {
|
|
9
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
10
|
+
return value;
|
|
11
|
+
};
|
|
12
|
+
class SearchCondEditEditorProvider {
|
|
13
|
+
constructor() {
|
|
14
|
+
__publicField(this, "formEditor", "IBizSearchCondEdit");
|
|
15
|
+
__publicField(this, "gridEditor", "IBizSearchCondEdit");
|
|
16
|
+
}
|
|
17
|
+
async createController(editorModel, parentController) {
|
|
18
|
+
const c = new ibizSearchcondEdit_controller.SearchCondEditEditorController(editorModel, parentController);
|
|
19
|
+
await c.init();
|
|
20
|
+
return c;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.SearchCondEditEditorProvider = SearchCondEditEditorProvider;
|