ls-pro-common 3.1.18 → 3.1.20
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/common.js +1 -1
- package/dist/common.min.js +1 -1
- package/es/components/InputTable.d.ts +2 -2
- package/es/components/InputTable.js +20 -14
- package/es/hooks/useDtl/index.js +3 -3
- package/es/hooks/useSingle/index.js +3 -3
- package/es/utils/index.d.ts +6 -0
- package/es/utils/index.js +11 -4
- package/lib/components/InputTable.d.ts +2 -2
- package/lib/components/InputTable.js +20 -14
- package/lib/hooks/useDtl/index.js +3 -3
- package/lib/hooks/useSingle/index.js +3 -3
- package/lib/utils/index.d.ts +6 -0
- package/lib/utils/index.js +11 -4
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ export declare type InputTableProps = ProFormItemProps<InputProps> & {
|
|
|
48
48
|
/** @name 选择行事件 */
|
|
49
49
|
onSelectChange?: (item: any, formRef?: any) => void;
|
|
50
50
|
/** @name 加载之前事件,param为查询条件对象,可以通过此方法调整 */
|
|
51
|
-
beforeLoad?: (param: any) => any;
|
|
51
|
+
beforeLoad?: (param: any) => Promise<any> | any;
|
|
52
52
|
/** @name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
|
|
53
53
|
afterLoad?: (rows: any[]) => void;
|
|
54
54
|
getPopupContainer?: (triggerNode: any) => HTMLElement;
|
|
@@ -108,7 +108,7 @@ declare const InputTable: React.ForwardRefExoticComponent<{
|
|
|
108
108
|
/** @name 选择行事件 */
|
|
109
109
|
onSelectChange?: ((item: any, formRef?: any) => void) | undefined;
|
|
110
110
|
/** @name 加载之前事件,param为查询条件对象,可以通过此方法调整 */
|
|
111
|
-
beforeLoad?: ((param: any) => any) | undefined;
|
|
111
|
+
beforeLoad?: ((param: any) => Promise<any> | any) | undefined;
|
|
112
112
|
/** @name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
|
|
113
113
|
afterLoad?: ((rows: any[]) => void) | undefined;
|
|
114
114
|
getPopupContainer?: ((triggerNode: any) => HTMLElement) | undefined;
|
|
@@ -184,28 +184,34 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
184
184
|
selectRowRef.current = [];
|
|
185
185
|
(_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$cl = _tableRef$current2.clearSelected) === null || _tableRef$current2$cl === void 0 ? void 0 : _tableRef$current2$cl.call(_tableRef$current2);
|
|
186
186
|
}
|
|
187
|
-
if (beforeLoad) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
if (!beforeLoad) {
|
|
188
|
+
_context.next = 18;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
_context.next = 16;
|
|
192
|
+
return beforeLoad(data);
|
|
193
|
+
case 16:
|
|
194
|
+
_param = _context.sent;
|
|
195
|
+
if (typeof _param !== 'boolean' && _param !== undefined) {
|
|
196
|
+
data = _param;
|
|
192
197
|
}
|
|
198
|
+
case 18:
|
|
193
199
|
if (!(method !== 'GET')) {
|
|
194
|
-
_context.next =
|
|
200
|
+
_context.next = 24;
|
|
195
201
|
break;
|
|
196
202
|
}
|
|
197
|
-
_context.next =
|
|
203
|
+
_context.next = 21;
|
|
198
204
|
return httpPost(url, data);
|
|
199
|
-
case
|
|
205
|
+
case 21:
|
|
200
206
|
result = _context.sent;
|
|
201
|
-
_context.next =
|
|
207
|
+
_context.next = 27;
|
|
202
208
|
break;
|
|
203
|
-
case
|
|
204
|
-
_context.next =
|
|
209
|
+
case 24:
|
|
210
|
+
_context.next = 26;
|
|
205
211
|
return httpGet(url, data);
|
|
206
|
-
case
|
|
212
|
+
case 26:
|
|
207
213
|
result = _context.sent;
|
|
208
|
-
case
|
|
214
|
+
case 27:
|
|
209
215
|
rows = (result.rows || []).filter(function (o) {
|
|
210
216
|
return o;
|
|
211
217
|
});
|
|
@@ -238,7 +244,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
238
244
|
total: Number(result.total || 0),
|
|
239
245
|
success: true
|
|
240
246
|
});
|
|
241
|
-
case
|
|
247
|
+
case 31:
|
|
242
248
|
case "end":
|
|
243
249
|
return _context.stop();
|
|
244
250
|
}
|
package/es/hooks/useDtl/index.js
CHANGED
|
@@ -87,13 +87,13 @@ function useDtl(dtlParam) {
|
|
|
87
87
|
return beforeFn(arg, isDtl);
|
|
88
88
|
case 4:
|
|
89
89
|
data = _context.sent;
|
|
90
|
-
if (!(data ===
|
|
90
|
+
if (!(data === false)) {
|
|
91
91
|
_context.next = 7;
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
|
-
return _context.abrupt("return",
|
|
94
|
+
return _context.abrupt("return", false);
|
|
95
95
|
case 7:
|
|
96
|
-
return _context.abrupt("return",
|
|
96
|
+
return _context.abrupt("return", arg);
|
|
97
97
|
case 8:
|
|
98
98
|
case "end":
|
|
99
99
|
return _context.stop();
|
|
@@ -104,13 +104,13 @@ function useSingle(inParam) {
|
|
|
104
104
|
return beforeFn(arg);
|
|
105
105
|
case 4:
|
|
106
106
|
data = _context.sent;
|
|
107
|
-
if (!(data ===
|
|
107
|
+
if (!(data === false)) {
|
|
108
108
|
_context.next = 7;
|
|
109
109
|
break;
|
|
110
110
|
}
|
|
111
|
-
return _context.abrupt("return",
|
|
111
|
+
return _context.abrupt("return", false);
|
|
112
112
|
case 7:
|
|
113
|
-
return _context.abrupt("return",
|
|
113
|
+
return _context.abrupt("return", arg);
|
|
114
114
|
case 8:
|
|
115
115
|
case "end":
|
|
116
116
|
return _context.stop();
|
package/es/utils/index.d.ts
CHANGED
|
@@ -176,6 +176,12 @@ export declare const getUserName: () => string | undefined;
|
|
|
176
176
|
export declare const getLoginName: () => string | undefined;
|
|
177
177
|
/** @name 公司Id */
|
|
178
178
|
export declare const getCompanyId: () => string | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* 判断是否是微前端子应用
|
|
181
|
+
*
|
|
182
|
+
* @returns String | undefined
|
|
183
|
+
*/
|
|
184
|
+
export declare const isQiankunSubApp: () => any;
|
|
179
185
|
/** @name 微前端原生路径 */
|
|
180
186
|
export declare const appPath: (path?: string) => any;
|
|
181
187
|
/**
|
package/es/utils/index.js
CHANGED
|
@@ -392,13 +392,20 @@ export var getCompanyId = function getCompanyId() {
|
|
|
392
392
|
var _getUserInfo3;
|
|
393
393
|
return (_getUserInfo3 = getUserInfo()) === null || _getUserInfo3 === void 0 ? void 0 : _getUserInfo3.companyId;
|
|
394
394
|
};
|
|
395
|
+
/**
|
|
396
|
+
* 判断是否是微前端子应用
|
|
397
|
+
*
|
|
398
|
+
* @returns String | undefined
|
|
399
|
+
*/
|
|
400
|
+
export var isQiankunSubApp = function isQiankunSubApp() {
|
|
401
|
+
// @ts-ignore
|
|
402
|
+
return window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
|
|
403
|
+
};
|
|
395
404
|
/** @name 微前端原生路径 */
|
|
396
405
|
export var appPath = function appPath() {
|
|
397
406
|
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
// @ts-ignore
|
|
401
|
-
return window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
|
|
407
|
+
if (isQiankunSubApp()) {
|
|
408
|
+
return isQiankunSubApp();
|
|
402
409
|
}
|
|
403
410
|
if (path) return path;
|
|
404
411
|
//本地开发环境,判断是否hash路由,如果是hash路由,则返回./
|
|
@@ -48,7 +48,7 @@ export declare type InputTableProps = ProFormItemProps<InputProps> & {
|
|
|
48
48
|
/** @name 选择行事件 */
|
|
49
49
|
onSelectChange?: (item: any, formRef?: any) => void;
|
|
50
50
|
/** @name 加载之前事件,param为查询条件对象,可以通过此方法调整 */
|
|
51
|
-
beforeLoad?: (param: any) => any;
|
|
51
|
+
beforeLoad?: (param: any) => Promise<any> | any;
|
|
52
52
|
/** @name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
|
|
53
53
|
afterLoad?: (rows: any[]) => void;
|
|
54
54
|
getPopupContainer?: (triggerNode: any) => HTMLElement;
|
|
@@ -108,7 +108,7 @@ declare const InputTable: React.ForwardRefExoticComponent<{
|
|
|
108
108
|
/** @name 选择行事件 */
|
|
109
109
|
onSelectChange?: ((item: any, formRef?: any) => void) | undefined;
|
|
110
110
|
/** @name 加载之前事件,param为查询条件对象,可以通过此方法调整 */
|
|
111
|
-
beforeLoad?: ((param: any) => any) | undefined;
|
|
111
|
+
beforeLoad?: ((param: any) => Promise<any> | any) | undefined;
|
|
112
112
|
/** @name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
|
|
113
113
|
afterLoad?: ((rows: any[]) => void) | undefined;
|
|
114
114
|
getPopupContainer?: ((triggerNode: any) => HTMLElement) | undefined;
|
|
@@ -184,28 +184,34 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
184
184
|
selectRowRef.current = [];
|
|
185
185
|
(_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$cl = _tableRef$current2.clearSelected) === null || _tableRef$current2$cl === void 0 ? void 0 : _tableRef$current2$cl.call(_tableRef$current2);
|
|
186
186
|
}
|
|
187
|
-
if (beforeLoad) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
if (!beforeLoad) {
|
|
188
|
+
_context.next = 18;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
_context.next = 16;
|
|
192
|
+
return beforeLoad(data);
|
|
193
|
+
case 16:
|
|
194
|
+
_param = _context.sent;
|
|
195
|
+
if (typeof _param !== 'boolean' && _param !== undefined) {
|
|
196
|
+
data = _param;
|
|
192
197
|
}
|
|
198
|
+
case 18:
|
|
193
199
|
if (!(method !== 'GET')) {
|
|
194
|
-
_context.next =
|
|
200
|
+
_context.next = 24;
|
|
195
201
|
break;
|
|
196
202
|
}
|
|
197
|
-
_context.next =
|
|
203
|
+
_context.next = 21;
|
|
198
204
|
return httpPost(url, data);
|
|
199
|
-
case
|
|
205
|
+
case 21:
|
|
200
206
|
result = _context.sent;
|
|
201
|
-
_context.next =
|
|
207
|
+
_context.next = 27;
|
|
202
208
|
break;
|
|
203
|
-
case
|
|
204
|
-
_context.next =
|
|
209
|
+
case 24:
|
|
210
|
+
_context.next = 26;
|
|
205
211
|
return httpGet(url, data);
|
|
206
|
-
case
|
|
212
|
+
case 26:
|
|
207
213
|
result = _context.sent;
|
|
208
|
-
case
|
|
214
|
+
case 27:
|
|
209
215
|
rows = (result.rows || []).filter(function (o) {
|
|
210
216
|
return o;
|
|
211
217
|
});
|
|
@@ -238,7 +244,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
238
244
|
total: Number(result.total || 0),
|
|
239
245
|
success: true
|
|
240
246
|
});
|
|
241
|
-
case
|
|
247
|
+
case 31:
|
|
242
248
|
case "end":
|
|
243
249
|
return _context.stop();
|
|
244
250
|
}
|
|
@@ -87,13 +87,13 @@ function useDtl(dtlParam) {
|
|
|
87
87
|
return beforeFn(arg, isDtl);
|
|
88
88
|
case 4:
|
|
89
89
|
data = _context.sent;
|
|
90
|
-
if (!(data ===
|
|
90
|
+
if (!(data === false)) {
|
|
91
91
|
_context.next = 7;
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
|
-
return _context.abrupt("return",
|
|
94
|
+
return _context.abrupt("return", false);
|
|
95
95
|
case 7:
|
|
96
|
-
return _context.abrupt("return",
|
|
96
|
+
return _context.abrupt("return", arg);
|
|
97
97
|
case 8:
|
|
98
98
|
case "end":
|
|
99
99
|
return _context.stop();
|
|
@@ -104,13 +104,13 @@ function useSingle(inParam) {
|
|
|
104
104
|
return beforeFn(arg);
|
|
105
105
|
case 4:
|
|
106
106
|
data = _context.sent;
|
|
107
|
-
if (!(data ===
|
|
107
|
+
if (!(data === false)) {
|
|
108
108
|
_context.next = 7;
|
|
109
109
|
break;
|
|
110
110
|
}
|
|
111
|
-
return _context.abrupt("return",
|
|
111
|
+
return _context.abrupt("return", false);
|
|
112
112
|
case 7:
|
|
113
|
-
return _context.abrupt("return",
|
|
113
|
+
return _context.abrupt("return", arg);
|
|
114
114
|
case 8:
|
|
115
115
|
case "end":
|
|
116
116
|
return _context.stop();
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -176,6 +176,12 @@ export declare const getUserName: () => string | undefined;
|
|
|
176
176
|
export declare const getLoginName: () => string | undefined;
|
|
177
177
|
/** @name 公司Id */
|
|
178
178
|
export declare const getCompanyId: () => string | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* 判断是否是微前端子应用
|
|
181
|
+
*
|
|
182
|
+
* @returns String | undefined
|
|
183
|
+
*/
|
|
184
|
+
export declare const isQiankunSubApp: () => any;
|
|
179
185
|
/** @name 微前端原生路径 */
|
|
180
186
|
export declare const appPath: (path?: string) => any;
|
|
181
187
|
/**
|
package/lib/utils/index.js
CHANGED
|
@@ -392,13 +392,20 @@ export var getCompanyId = function getCompanyId() {
|
|
|
392
392
|
var _getUserInfo3;
|
|
393
393
|
return (_getUserInfo3 = getUserInfo()) === null || _getUserInfo3 === void 0 ? void 0 : _getUserInfo3.companyId;
|
|
394
394
|
};
|
|
395
|
+
/**
|
|
396
|
+
* 判断是否是微前端子应用
|
|
397
|
+
*
|
|
398
|
+
* @returns String | undefined
|
|
399
|
+
*/
|
|
400
|
+
export var isQiankunSubApp = function isQiankunSubApp() {
|
|
401
|
+
// @ts-ignore
|
|
402
|
+
return window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
|
|
403
|
+
};
|
|
395
404
|
/** @name 微前端原生路径 */
|
|
396
405
|
export var appPath = function appPath() {
|
|
397
406
|
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
// @ts-ignore
|
|
401
|
-
return window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
|
|
407
|
+
if (isQiankunSubApp()) {
|
|
408
|
+
return isQiankunSubApp();
|
|
402
409
|
}
|
|
403
410
|
if (path) return path;
|
|
404
411
|
//本地开发环境,判断是否hash路由,如果是hash路由,则返回./
|