ls-pro-common 3.1.28 → 3.1.30

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/lib/index.d.ts CHANGED
@@ -1,46 +1,24 @@
1
- import DtlLayout from './components/DtlLayout';
2
- import InputTable from './components/InputTable';
3
- import Page404 from './components/404';
4
- import Loading from './components/Loading';
5
- import IconSelector from './components/IconSelector';
6
- import ImageSelector from './components/ImageSelector';
7
- import InputMultiLine from './components/InputMultiLine';
8
- import AreaCascader from './components/AreaCascader';
9
- import AreaCascaderPanel from './components/AreaCascaderPanel';
10
- import DescritionCard from './components/DescritionCard';
11
- import Permission from './components/Permission';
12
- import GroupTip from './components/GroupTip';
13
- import IconBack from './components/IconBack';
14
- import IconText from './components/IconText';
15
- import IconQuestion from './components/IconQuestion';
16
- import IconBell from './components/IconBell';
17
- import IconSearch from './components/IconSearch';
18
- import TagCheck from './components/TagCheck';
19
- import ViewOffice from './components/ViewOffice';
20
- import ProButton from './components/ProButton';
21
- import RecordLog from './components/RecordLog';
22
- import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions, httpBatchGet, httpBatchPost, getResourceRight } from './http';
23
- import BaseService from './service/BaseService';
1
+ /** 组件 */
2
+ export * from './components';
3
+ /** Hooks */
4
+ export * from './hooks';
5
+ /** Http请求 */
6
+ export { default as request } from './http';
7
+ export * from './http';
8
+ /** 基础服务 */
9
+ export { default as BaseService } from './service/BaseService';
10
+ /** 导出进度及完成后自动下载 */
11
+ export { default as exportProcess } from './utils/exportProcess';
12
+ /** Utils 方法,放在第一层级,方便调用 */
13
+ export * from './utils';
14
+ /** 主数据请求 */
24
15
  import * as mdmRequest from './http/mdmRequest';
16
+ /** Utils 对象 */
25
17
  import * as utils from './utils';
26
- import exportProcess from './utils/exportProcess';
27
- /** Hooks */
28
- import useSingle from './hooks/useSingle';
29
- import useDtl from './hooks/useDtl';
30
- import usePermission from './hooks/usePermission';
31
- import useGetState from './hooks/useGetState';
32
- import useFilterLocal from './hooks/useFilterBack';
33
- import useBaseDict from './hooks/useBaseDict';
34
- import useSelectOptions from './hooks/useSelectOptions';
35
- import showConfirmFun from './hooks/useShowConfirm';
36
- import useQueue from './hooks/useQueue';
37
- import { useDict } from './hooks/useDict';
38
- import useMdm from './hooks/useMdm';
18
+ export { utils, mdmRequest };
39
19
  /** Type */
40
- import type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typing';
41
- import type { DtlLyaoutProps } from './components/DtlLayout';
42
- import type { DescritionCardProps } from './components/DescritionCard';
43
- import type { PermissionProps } from './components/Permission';
44
- import type { TDict } from './hooks/useDict';
45
- export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps, DescritionCardProps, PermissionProps, TDict, };
46
- export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, ViewOffice, IconBack, IconText, IconBell, IconQuestion, IconSearch, TagCheck, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, httpBatchGet, httpBatchPost, getResourceRight, utils, useSingle, useDtl, usePermission, useGetState, useFilterLocal, useQueue, useBaseDict, useSelectOptions, useDict, useMdm, showConfirmFun, exportProcess, mdmRequest, ProButton, RecordLog, };
20
+ export type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typing';
21
+ export type { DtlLyaoutProps } from './components/DtlLayout';
22
+ export type { DescritionCardProps } from './components/DescritionCard';
23
+ export type { PermissionProps } from './components/Permission';
24
+ export type { TDict } from './hooks/useDict';
package/lib/index.js CHANGED
@@ -1,39 +1,18 @@
1
- import DtlLayout from './components/DtlLayout';
2
- import InputTable from './components/InputTable';
3
- import Page404 from './components/404';
4
- import Loading from './components/Loading';
5
- import IconSelector from './components/IconSelector';
6
- import ImageSelector from './components/ImageSelector';
7
- import InputMultiLine from './components/InputMultiLine';
8
- import AreaCascader from './components/AreaCascader';
9
- import AreaCascaderPanel from './components/AreaCascaderPanel';
10
- import DescritionCard from './components/DescritionCard';
11
- import Permission from './components/Permission';
12
- import GroupTip from './components/GroupTip';
13
- import IconBack from './components/IconBack';
14
- import IconText from './components/IconText';
15
- import IconQuestion from './components/IconQuestion';
16
- import IconBell from './components/IconBell';
17
- import IconSearch from './components/IconSearch';
18
- import TagCheck from './components/TagCheck';
19
- import ViewOffice from './components/ViewOffice';
20
- import ProButton from './components/ProButton';
21
- import RecordLog from './components/RecordLog';
22
- import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions, httpBatchGet, httpBatchPost, getResourceRight } from './http';
23
- import BaseService from './service/BaseService';
1
+ /** 组件 */
2
+ export * from './components';
3
+ /** Hooks */
4
+ export * from './hooks';
5
+ /** Http请求 */
6
+ export { default as request } from './http';
7
+ export * from './http';
8
+ /** 基础服务 */
9
+ export { default as BaseService } from './service/BaseService';
10
+ /** 导出进度及完成后自动下载 */
11
+ export { default as exportProcess } from './utils/exportProcess';
12
+ /** Utils 方法,放在第一层级,方便调用 */
13
+ export * from './utils';
14
+ /** 主数据请求 */
24
15
  import * as mdmRequest from './http/mdmRequest';
16
+ /** Utils 对象 */
25
17
  import * as utils from './utils';
26
- import exportProcess from './utils/exportProcess';
27
- /** Hooks */
28
- import useSingle from './hooks/useSingle';
29
- import useDtl from './hooks/useDtl';
30
- import usePermission from './hooks/usePermission';
31
- import useGetState from './hooks/useGetState';
32
- import useFilterLocal from './hooks/useFilterBack';
33
- import useBaseDict from './hooks/useBaseDict';
34
- import useSelectOptions from './hooks/useSelectOptions';
35
- import showConfirmFun from './hooks/useShowConfirm';
36
- import useQueue from './hooks/useQueue';
37
- import { useDict } from './hooks/useDict';
38
- import useMdm from './hooks/useMdm';
39
- export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, ViewOffice, IconBack, IconText, IconBell, IconQuestion, IconSearch, TagCheck, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, httpBatchGet, httpBatchPost, getResourceRight, utils, useSingle, useDtl, usePermission, useGetState, useFilterLocal, useQueue, useBaseDict, useSelectOptions, useDict, useMdm, showConfirmFun, exportProcess, mdmRequest, ProButton, RecordLog };
18
+ export { utils, mdmRequest };
@@ -75,14 +75,14 @@ export declare const setCache: (key: string, data: any, session?: boolean) => vo
75
75
  * @param {boolean} session 从 sessionStorage 取数还是从 localStorage 中取数 默认从 localStorage
76
76
  * @returns 关键字对应的值
77
77
  */
78
- export declare const getCache: (key: string, session?: boolean) => string | null;
78
+ export declare const getCache: any;
79
79
  /**
80
80
  * 读取本地缓存,优先从sessionStorage 取,取不到时再从 localStorage取
81
81
  *
82
82
  * @param key
83
83
  * @returns
84
84
  */
85
- export declare const getCacheSessionFirst: (key: string) => string | null;
85
+ export declare const getCacheSessionFirst: (key: string) => any;
86
86
  /**
87
87
  * @param key 关键字,不传清除所有
88
88
  * @param session 是否session storage , 默认 localStorage
@@ -226,5 +226,6 @@ export declare const urlDownloadDomain: (url: string) => string;
226
226
  *
227
227
  * @param url 文件地址
228
228
  * @param fileName 文件名
229
+ * @param isBlank 是否新开窗口下载,默认新开窗口,不影响原页面展示
229
230
  */
230
- export declare const downloadFile: (url: string, fileName?: string | undefined) => void;
231
+ export declare const downloadFile: (url: string, fileName?: string | undefined, isBlank?: boolean) => void;
@@ -493,12 +493,17 @@ export var urlDownloadDomain = function urlDownloadDomain(url) {
493
493
  *
494
494
  * @param url 文件地址
495
495
  * @param fileName 文件名
496
+ * @param isBlank 是否新开窗口下载,默认新开窗口,不影响原页面展示
496
497
  */
497
498
  export var downloadFile = function downloadFile(url, fileName) {
499
+ var isBlank = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
498
500
  var a = document.createElement('a');
499
501
  url = urlDownloadDomain(url);
500
502
  a.href = url;
501
- // a.target = '_blank'; // 新开屏有闪烁
503
+ if (isBlank) {
504
+ a.target = '_blank'; // 新开屏有闪烁,但不会导致下载文件不存在或无法访问时原始页面出错。
505
+ }
506
+
502
507
  if (fileName) {
503
508
  a.setAttribute('download', fileName);
504
509
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "3.1.28",
3
+ "version": "3.1.30",
4
4
  "description": "ls-pro-common",
5
5
  "license": "MIT",
6
6
  "sideEffects": [