@ibiz-template/runtime 0.7.15 → 0.7.16
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.esm.js +6095 -5922
- package/dist/index.system.min.js +1 -1
- package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts.map +1 -1
- package/out/controller/control/wizard-panel/wizard-panel.controller.js +21 -3
- package/out/controller/utils/data-file-util/data-file-util.d.ts.map +1 -1
- package/out/controller/utils/data-file-util/data-file-util.js +1 -4
- package/out/engine/view-base.engine.d.ts.map +1 -1
- package/out/engine/view-base.engine.js +4 -0
- package/out/interface/controller/state/control/i-drbar.state.d.ts +32 -0
- package/out/interface/controller/state/control/i-drbar.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-drtab.state.d.ts +40 -0
- package/out/interface/controller/state/control/i-drtab.state.d.ts.map +1 -1
- package/out/interface/provider/i-ac-item.provider.d.ts +19 -0
- package/out/interface/provider/i-ac-item.provider.d.ts.map +1 -0
- package/out/interface/provider/i-ac-item.provider.js +1 -0
- package/out/interface/provider/index.d.ts +1 -0
- package/out/interface/provider/index.d.ts.map +1 -1
- package/out/register/helper/ac-item-register.d.ts +25 -0
- package/out/register/helper/ac-item-register.d.ts.map +1 -0
- package/out/register/helper/ac-item-register.js +55 -0
- package/out/register/helper/index.d.ts +1 -0
- package/out/register/helper/index.d.ts.map +1 -1
- package/out/register/helper/index.js +1 -0
- package/out/service/dto/method.dto.d.ts +10 -14
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +26 -29
- package/out/service/service/entity/method/de-action.d.ts +10 -0
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +25 -2
- package/out/service/service/entity/method/method-input.d.ts +10 -0
- package/out/service/service/entity/method/method-input.d.ts.map +1 -1
- package/out/service/service/entity/method/method-input.js +15 -0
- package/out/service/utils/util/util.d.ts +14 -0
- package/out/service/utils/util/util.d.ts.map +1 -1
- package/out/service/utils/util/util.js +29 -0
- package/out/types.d.ts +0 -9
- package/out/types.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.js +3 -7
- package/out/utils/dr-ctrl-util/index.d.ts +29 -0
- package/out/utils/dr-ctrl-util/index.d.ts.map +1 -0
- package/out/utils/dr-ctrl-util/index.js +72 -0
- package/out/utils/file-util/file-util.d.ts +9 -0
- package/out/utils/file-util/file-util.d.ts.map +1 -1
- package/out/utils/file-util/file-util.js +27 -12
- package/out/utils/index.d.ts +1 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -0
- package/package.json +2 -2
|
@@ -19,4 +19,18 @@ export declare function fieldValueToBoolean(value: unknown): boolean;
|
|
|
19
19
|
export declare function convertToObject(input: string | undefined): {
|
|
20
20
|
[key: string]: number;
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* 转换数组成ListMap
|
|
24
|
+
*
|
|
25
|
+
* @param {IData[]} arr
|
|
26
|
+
* @return {*} listMap
|
|
27
|
+
*/
|
|
28
|
+
export declare function convertArrayToListMap(arr: IData[]): IData;
|
|
29
|
+
/**
|
|
30
|
+
* 转换ListMap成数组
|
|
31
|
+
*
|
|
32
|
+
* @param {listMap} obj
|
|
33
|
+
* @return {*} IData[]
|
|
34
|
+
*/
|
|
35
|
+
export declare function convertListMapToArray(obj: IData): IData[];
|
|
22
36
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/service/utils/util/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAsB3D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG;IAC1D,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAaA"}
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/service/utils/util/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAsB3D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG;IAC1D,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAaA;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,CAOzD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,KAAK,GAAG,KAAK,EAAE,CAQzD"}
|
|
@@ -53,3 +53,32 @@ export function convertToObject(input) {
|
|
|
53
53
|
}
|
|
54
54
|
return result;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* 转换数组成ListMap
|
|
58
|
+
*
|
|
59
|
+
* @param {IData[]} arr
|
|
60
|
+
* @return {*} listMap
|
|
61
|
+
*/
|
|
62
|
+
export function convertArrayToListMap(arr) {
|
|
63
|
+
const result = {};
|
|
64
|
+
arr.forEach(obj => {
|
|
65
|
+
result[obj.srflistmapfield] = obj;
|
|
66
|
+
delete obj.srflistmapfield;
|
|
67
|
+
});
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 转换ListMap成数组
|
|
72
|
+
*
|
|
73
|
+
* @param {listMap} obj
|
|
74
|
+
* @return {*} IData[]
|
|
75
|
+
*/
|
|
76
|
+
export function convertListMapToArray(obj) {
|
|
77
|
+
const result = [];
|
|
78
|
+
Object.keys(obj).forEach(key => {
|
|
79
|
+
const temp = obj[key];
|
|
80
|
+
temp.srflistmapfield = key;
|
|
81
|
+
result.push(temp);
|
|
82
|
+
});
|
|
83
|
+
return result;
|
|
84
|
+
}
|
package/out/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { I18n } from '@ibiz-template/core';
|
|
2
1
|
import { EngineFactory } from './engine';
|
|
3
2
|
import { GlobalUtil } from './global';
|
|
4
3
|
import { IMessageUtil, INotificationUtil, IOpenViewUtil, IModalUtil, IConfirmUtil, ILoadingUtil, IPluginFactory, IOverlayController, IGlobalConfig, IAppHubService, IAuthService, IPlatformProvider, INoticeUtil, IMarkOpenDataService, IRenderUtil, IAppUtil } from './interface';
|
|
@@ -147,14 +146,6 @@ declare module '@ibiz-template/core' {
|
|
|
147
146
|
* @type {GlobalUtil}
|
|
148
147
|
*/
|
|
149
148
|
util: GlobalUtil;
|
|
150
|
-
/**
|
|
151
|
-
* 多语言
|
|
152
|
-
*
|
|
153
|
-
* @author chitanda
|
|
154
|
-
* @date 2023-08-11 16:08:15
|
|
155
|
-
* @type {I18n}
|
|
156
|
-
*/
|
|
157
|
-
i18n: I18n;
|
|
158
149
|
/**
|
|
159
150
|
* 逻辑调度中心
|
|
160
151
|
* @author lxm
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,QAAQ,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oB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;QACpB;;;;;;;WAOG;QACH,YAAY,CAAC,EAAE,aAAa,CAAC;KAC9B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"front-ui-action-provider.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/front-ui-action-provider.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAa,MAAM,kBAAkB,CAAC;AAG7D,OAAO,EACL,cAAc,EACd,eAAe,EAIhB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,oBAAoB;IACvD,UAAU,CACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IAyE3B;;;;;;;;OAQG;cACa,OAAO,CACrB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IAoB3B;;;;;;OAMG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"front-ui-action-provider.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/front-ui-action-provider.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAa,MAAM,kBAAkB,CAAC;AAG7D,OAAO,EACL,cAAc,EACd,eAAe,EAIhB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,oBAAoB;IACvD,UAAU,CACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IAyE3B;;;;;;;;OAQG;cACa,OAAO,CACrB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IAoB3B;;;;;;OAMG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC;IA4DhB;;;;;;OAMG;cACa,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IA+B3B;;;;;;OAMG;cACa,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC;IAwDhB;;;;;;;;OAQG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;CAsD5B"}
|
|
@@ -98,7 +98,7 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
98
98
|
* @return {*}
|
|
99
99
|
*/
|
|
100
100
|
async executePrint(action, args) {
|
|
101
|
-
var _a
|
|
101
|
+
var _a;
|
|
102
102
|
// 处理参数
|
|
103
103
|
const { resultContext, resultParams } = await this.handleParams(action, args.context, args.data, args.params);
|
|
104
104
|
const appDataEntity = await ibiz.hub.getAppDataEntity(action.appDataEntityId, action.appId);
|
|
@@ -123,15 +123,11 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
123
123
|
if (res.ok) {
|
|
124
124
|
// 存在srfcontenttype参数需响应文件
|
|
125
125
|
if (resultParams && resultParams.srfcontenttype) {
|
|
126
|
-
|
|
127
|
-
const disposition = res.headers['content-disposition'];
|
|
128
|
-
const filename = (_b = disposition
|
|
129
|
-
.split(';')
|
|
130
|
-
.find((str) => str.indexOf('filename=') !== -1)) === null || _b === void 0 ? void 0 : _b.slice(9);
|
|
126
|
+
const fileName = ibiz.util.file.getFileName(res);
|
|
131
127
|
const href = URL.createObjectURL(res.data);
|
|
132
128
|
const a = document.createElement('a');
|
|
133
129
|
a.href = href;
|
|
134
|
-
a.download =
|
|
130
|
+
a.download = fileName;
|
|
135
131
|
document.body.appendChild(a);
|
|
136
132
|
a.click();
|
|
137
133
|
document.body.removeChild(a);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IDRBarItemsState, IDRTabPagesState } from '../../interface';
|
|
2
|
+
import { AppCounter } from '../../service';
|
|
3
|
+
/**
|
|
4
|
+
* 根据计数器数据,计算项显示状态
|
|
5
|
+
*
|
|
6
|
+
* @author zhanghengfeng
|
|
7
|
+
* @date 2024-05-16 19:05:55
|
|
8
|
+
* @export
|
|
9
|
+
* @param {(IDRBarItemsState | IDRTabPagesState)} item
|
|
10
|
+
* @param {AppCounter} [counter]
|
|
11
|
+
* @return {*} {(boolean | undefined)}
|
|
12
|
+
*/
|
|
13
|
+
export declare function calcItemVisibleByCounter(item: IDRBarItemsState | IDRTabPagesState, counter?: AppCounter): boolean | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* 根据启用模式,计算项显示状态
|
|
16
|
+
*
|
|
17
|
+
* @author zhanghengfeng
|
|
18
|
+
* @date 2024-05-16 19:05:46
|
|
19
|
+
* @export
|
|
20
|
+
* @param {(IDRBarItemsState | IDRTabPagesState)} item
|
|
21
|
+
* @param {IContext} context
|
|
22
|
+
* @param {IParams} params
|
|
23
|
+
* @param {string} appDeId
|
|
24
|
+
* @param {string} appId
|
|
25
|
+
* @param {IData} [data]
|
|
26
|
+
* @return {*} {(Promise<boolean | undefined>)}
|
|
27
|
+
*/
|
|
28
|
+
export declare function calcItemVisible(item: IDRBarItemsState | IDRTabPagesState, context: IContext, params: IParams, appDeId: string, appId: string, data?: IData): Promise<boolean | undefined>;
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/dr-ctrl-util/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,gBAAgB,GAAG,gBAAgB,EACzC,OAAO,CAAC,EAAE,UAAU,GACnB,OAAO,GAAG,SAAS,CAiBrB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,gBAAgB,GAAG,gBAAgB,EACzC,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,KAAK,GACX,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAoC9B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { execDELogicAction } from '../../de-logic';
|
|
2
|
+
import { findDELogic } from '../../model';
|
|
3
|
+
import { ScriptFactory } from '../script';
|
|
4
|
+
/**
|
|
5
|
+
* 根据计数器数据,计算项显示状态
|
|
6
|
+
*
|
|
7
|
+
* @author zhanghengfeng
|
|
8
|
+
* @date 2024-05-16 19:05:55
|
|
9
|
+
* @export
|
|
10
|
+
* @param {(IDRBarItemsState | IDRTabPagesState)} item
|
|
11
|
+
* @param {AppCounter} [counter]
|
|
12
|
+
* @return {*} {(boolean | undefined)}
|
|
13
|
+
*/
|
|
14
|
+
export function calcItemVisibleByCounter(item, counter) {
|
|
15
|
+
const { enableMode, counterId } = item;
|
|
16
|
+
if (!counter || !counterId) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (enableMode === 'COUNT_GTE_ZERO') {
|
|
20
|
+
if (counter.getCounter(counterId) >= 0) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if (enableMode === 'COUNT_GT_ZERO') {
|
|
26
|
+
if (counter.getCounter(counterId) > 0) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 根据启用模式,计算项显示状态
|
|
34
|
+
*
|
|
35
|
+
* @author zhanghengfeng
|
|
36
|
+
* @date 2024-05-16 19:05:46
|
|
37
|
+
* @export
|
|
38
|
+
* @param {(IDRBarItemsState | IDRTabPagesState)} item
|
|
39
|
+
* @param {IContext} context
|
|
40
|
+
* @param {IParams} params
|
|
41
|
+
* @param {string} appDeId
|
|
42
|
+
* @param {string} appId
|
|
43
|
+
* @param {IData} [data]
|
|
44
|
+
* @return {*} {(Promise<boolean | undefined>)}
|
|
45
|
+
*/
|
|
46
|
+
export async function calcItemVisible(item, context, params, appDeId, appId, data) {
|
|
47
|
+
const { enableMode, dataAccessAction, testAppDELogicId, testScriptCode } = item;
|
|
48
|
+
if (enableMode === 'DEOPPRIV' && dataAccessAction) {
|
|
49
|
+
const app = ibiz.hub.getApp(context.srfappid);
|
|
50
|
+
const result = await app.authority.calcByDataAccessAction(dataAccessAction, context, data, appDeId);
|
|
51
|
+
return !!result;
|
|
52
|
+
}
|
|
53
|
+
if (enableMode === 'DELOGIC' && testAppDELogicId && appDeId && appId) {
|
|
54
|
+
const entityModel = await ibiz.hub.getAppDataEntity(appDeId, appId);
|
|
55
|
+
const deLogic = findDELogic(testAppDELogicId, entityModel);
|
|
56
|
+
if (deLogic) {
|
|
57
|
+
const result = await execDELogicAction(deLogic, context, data, params);
|
|
58
|
+
return !!result.data;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (enableMode === 'SCRIPT' && testScriptCode) {
|
|
62
|
+
const result = ScriptFactory.execScriptFn({
|
|
63
|
+
data,
|
|
64
|
+
context,
|
|
65
|
+
params,
|
|
66
|
+
}, testScriptCode, {
|
|
67
|
+
isAsync: false,
|
|
68
|
+
singleRowReturn: true,
|
|
69
|
+
});
|
|
70
|
+
return !!result;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IHttpResponse } from '@ibiz-template/core';
|
|
1
2
|
export declare class FileUtil {
|
|
2
3
|
/**
|
|
3
4
|
* 计算OSSCat参数
|
|
@@ -53,5 +54,13 @@ export declare class FileUtil {
|
|
|
53
54
|
* @memberof FileUtil
|
|
54
55
|
*/
|
|
55
56
|
fileUpload(uploadUrl: string, file: Blob, headers: IData): Promise<IData>;
|
|
57
|
+
/**
|
|
58
|
+
* 获取文件名
|
|
59
|
+
*
|
|
60
|
+
* @param {IHttpResponse<IData>} response
|
|
61
|
+
* @return {*} {string}
|
|
62
|
+
* @memberof FileUtil
|
|
63
|
+
*/
|
|
64
|
+
getFileName(response: IHttpResponse<IData>): string;
|
|
56
65
|
}
|
|
57
66
|
//# sourceMappingURL=file-util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-util.d.ts","sourceRoot":"","sources":["../../../src/utils/file-util/file-util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-util.d.ts","sourceRoot":"","sources":["../../../src/utils/file-util/file-util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGd,MAAM,qBAAqB,CAAC;AAI7B,qBAAa,QAAQ;IACnB;;;;;;;;;OASG;IACH,SAAS,CAAC,aAAa,CACrB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,QAAQ,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM;IAWT;;;;;;;;;;;;;;;;;OAiBG;IACH,iBAAiB,CACf,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,OAAO,EACf,IAAI,GAAE,KAAU,EAChB,WAAW,GAAE,KAAU,GACtB;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;KACrB;IA0BD;;;;;;;OAOG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB7D;;;;;;;;;;OAUG;IACG,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,KAAK,GACb,OAAO,CAAC,KAAK,CAAC;IAiBjB;;;;;;OAMG;IACH,WAAW,CAAC,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM;CAkBpD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RuntimeError, downloadFileFromBlob } from '@ibiz-template/core';
|
|
1
|
+
import { RuntimeError, downloadFileFromBlob, } from '@ibiz-template/core';
|
|
2
2
|
import qs from 'qs';
|
|
3
3
|
import { convertNavData } from '../nav-params/nav-params';
|
|
4
4
|
export class FileUtil {
|
|
@@ -66,7 +66,6 @@ export class FileUtil {
|
|
|
66
66
|
* @memberof FileUtil
|
|
67
67
|
*/
|
|
68
68
|
async fileDownload(url, name) {
|
|
69
|
-
var _a;
|
|
70
69
|
// 发送get请求
|
|
71
70
|
const response = await ibiz.net.request(url, {
|
|
72
71
|
method: 'get',
|
|
@@ -82,16 +81,7 @@ export class FileUtil {
|
|
|
82
81
|
}
|
|
83
82
|
else {
|
|
84
83
|
// 获取文件名
|
|
85
|
-
let fileName =
|
|
86
|
-
const disposition = (_a = qs.parse(response.headers['content-disposition'], {
|
|
87
|
-
delimiter: ';',
|
|
88
|
-
})) === null || _a === void 0 ? void 0 : _a.filename;
|
|
89
|
-
if (disposition) {
|
|
90
|
-
// 特殊处理返回的文件名带有双引号
|
|
91
|
-
if (disposition.startsWith('"') && disposition.endsWith('"')) {
|
|
92
|
-
fileName = disposition.substring(1, disposition.length - 1);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
84
|
+
let fileName = ibiz.util.file.getFileName(response);
|
|
95
85
|
// 外部传名称以外部为准,需要带文件后缀名
|
|
96
86
|
if (name)
|
|
97
87
|
fileName = name;
|
|
@@ -123,4 +113,29 @@ export class FileUtil {
|
|
|
123
113
|
}
|
|
124
114
|
return res.data;
|
|
125
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* 获取文件名
|
|
118
|
+
*
|
|
119
|
+
* @param {IHttpResponse<IData>} response
|
|
120
|
+
* @return {*} {string}
|
|
121
|
+
* @memberof FileUtil
|
|
122
|
+
*/
|
|
123
|
+
getFileName(response) {
|
|
124
|
+
let fileName = '';
|
|
125
|
+
const contentDisposition = response.headers['content-disposition'];
|
|
126
|
+
if (!contentDisposition) {
|
|
127
|
+
return fileName;
|
|
128
|
+
}
|
|
129
|
+
const disposition = qs.parse(contentDisposition, {
|
|
130
|
+
delimiter: ';',
|
|
131
|
+
});
|
|
132
|
+
if (disposition && disposition.filename) {
|
|
133
|
+
fileName = disposition.filename;
|
|
134
|
+
}
|
|
135
|
+
// 特殊处理返回的文件名带有双引号
|
|
136
|
+
if (fileName.startsWith('"') && fileName.endsWith('"')) {
|
|
137
|
+
fileName = fileName.substring(1, fileName.length - 1);
|
|
138
|
+
}
|
|
139
|
+
return fileName;
|
|
140
|
+
}
|
|
126
141
|
}
|
package/out/utils/index.d.ts
CHANGED
|
@@ -19,4 +19,5 @@ export { handleAllSettled } from './promise/promise';
|
|
|
19
19
|
export { AnimeUtil } from './anime';
|
|
20
20
|
export { FileUtil } from './file-util';
|
|
21
21
|
export { ShortCutUtil } from './short-cut/short-cut-util';
|
|
22
|
+
export * from './dr-ctrl-util';
|
|
22
23
|
//# sourceMappingURL=index.d.ts.map
|
package/out/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,yCAAyC,CAAC;AACjD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BAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,cAAc,gBAAgB,CAAC"}
|
package/out/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.16",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"animejs": "^3.2.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@ibiz-template/core": "^0.7.
|
|
38
|
+
"@ibiz-template/core": "^0.7.16",
|
|
39
39
|
"@ibiz/model-core": "^0.1.27",
|
|
40
40
|
"@types/animejs": "^3.1.12",
|
|
41
41
|
"@types/path-browserify": "^1.0.2",
|