xydata-tools 1.0.32 → 1.0.34

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.
Files changed (52) hide show
  1. package/README.md +1 -1
  2. package/dist/components/both/security-layout/index.js +27 -9
  3. package/dist/types/components/aaa/auth/index.d.ts +2 -0
  4. package/dist/types/components/aaa/index.d.ts +2 -0
  5. package/dist/types/components/aaa/security-layout/index.d.ts +2 -0
  6. package/dist/types/components/aaa/setting/index.d.ts +7 -0
  7. package/dist/types/components/aaa/setting/permission/components/UpdateForm.d.ts +2 -0
  8. package/dist/types/components/aaa/setting/permission/index.d.ts +2 -0
  9. package/dist/types/components/aaa/setting/permission/service.d.ts +8 -0
  10. package/dist/types/components/aaa/setting/requesturl/components/UpdateForm.d.ts +2 -0
  11. package/dist/types/components/aaa/setting/requesturl/index.d.ts +2 -0
  12. package/dist/types/components/aaa/setting/requesturl/service.d.ts +4 -0
  13. package/dist/types/components/aaa/setting/role/components/UpdateForm.d.ts +2 -0
  14. package/dist/types/components/aaa/setting/role/index.d.ts +2 -0
  15. package/dist/types/components/aaa/setting/role/service.d.ts +7 -0
  16. package/dist/types/components/aaa/setting/user/components/UpdateForm.d.ts +2 -0
  17. package/dist/types/components/aaa/setting/user/index.d.ts +2 -0
  18. package/dist/types/components/aaa/setting/user/service.d.ts +13 -0
  19. package/dist/types/components/both/index.d.ts +2 -0
  20. package/dist/types/components/both/security-layout/index.d.ts +2 -0
  21. package/dist/types/components/dictionary/components/UpdateForm.d.ts +2 -0
  22. package/dist/types/components/dictionary/index.d.ts +2 -0
  23. package/dist/types/components/dictionary/service.d.ts +4 -0
  24. package/dist/types/components/downloadFile/index.d.ts +38 -0
  25. package/dist/types/components/index.d.ts +9 -0
  26. package/dist/types/components/materialCard/index.d.ts +58 -0
  27. package/dist/types/components/organization/components/CreatePeopleForm.d.ts +2 -0
  28. package/dist/types/components/organization/components/CreateSubStoreForm.d.ts +2 -0
  29. package/dist/types/components/organization/components/OrgTree.d.ts +2 -0
  30. package/dist/types/components/organization/index.d.ts +2 -0
  31. package/dist/types/components/organization/service.d.ts +133 -0
  32. package/dist/types/components/sso/index.d.ts +2 -0
  33. package/dist/types/components/sso/security-layout/index.d.ts +2 -0
  34. package/dist/types/components/sso/setting/index.d.ts +7 -0
  35. package/dist/types/components/sso/setting/permRole/index.d.ts +2 -0
  36. package/dist/types/components/sso/setting/permission/components/UpdateForm.d.ts +2 -0
  37. package/dist/types/components/sso/setting/permission/index.d.ts +2 -0
  38. package/dist/types/components/sso/setting/role/components/UpdateForm.d.ts +2 -0
  39. package/dist/types/components/sso/setting/role/index.d.ts +2 -0
  40. package/dist/types/components/sso/setting/service.d.ts +13 -0
  41. package/dist/types/components/sso/setting/user/components/RoleUpdateForm.d.ts +2 -0
  42. package/dist/types/components/sso/setting/user/index.d.ts +2 -0
  43. package/dist/types/components/tools/version.d.ts +12 -0
  44. package/dist/types/components/uploadFile/index.d.ts +57 -0
  45. package/dist/types/index.d.ts +3 -0
  46. package/dist/types/utils/downloadFile.d.ts +23 -0
  47. package/dist/types/utils/request.d.ts +1 -0
  48. package/dist/types/utils/serviceSet.d.ts +5 -0
  49. package/dist/types/utils/token.d.ts +4 -0
  50. package/dist/types/utils/utils.d.ts +37 -0
  51. package/dist/utils/downloadFile.js +10 -2
  52. package/package.json +5 -2
package/README.md CHANGED
@@ -294,7 +294,7 @@ export default PermPage;
294
294
  6. 打包发布:
295
295
 
296
296
  ```bash
297
- npm run build
297
+ npm run prepublishOnly
298
298
  npm config set registry https://registry.npmjs.org
299
299
  npm config set proxy false
300
300
  npm publish -d
@@ -5,11 +5,12 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
5
5
  import React, { useEffect } from "react";
6
6
  import { getSessionStorage, setSessionStorage } from "../../../utils/token.js";
7
7
  import { message, Spin } from "antd";
8
- import { queryAaaCurrent } from "../../../services/service.js";
8
+ import { queryAaaCurrent, queryCurrent } from "../../../services/service.js";
9
9
  var BothSecurityLayout = function BothSecurityLayout(props) {
10
10
  var children = props.children,
11
11
  propsEnvData = props.envData,
12
- propsService = props.service;
12
+ propsService = props.service,
13
+ getUserOk = props.getUserOk;
13
14
  var envData = propsEnvData || (getSessionStorage("env_data") ? JSON.parse(getSessionStorage("env_data")) : {});
14
15
  var service = propsService || getSessionStorage("service");
15
16
  var token = getSessionStorage("Token");
@@ -23,7 +24,11 @@ var BothSecurityLayout = function BothSecurityLayout(props) {
23
24
  console.log("ENV_DATA:", envData);
24
25
  console.log("service:", service);
25
26
  if (!token) {
26
- envData.sso_type === "new" ? ssoTypeByNew() : ssoTypeByOld();
27
+ if (!AAALOGIN) {
28
+ envData.sso_type === "new" ? ssoTypeByNew() : ssoTypeByOld();
29
+ } else {
30
+ window.location.href = LOGIN_URI;
31
+ }
27
32
  } else {
28
33
  getUserinfo();
29
34
  }
@@ -34,14 +39,27 @@ var BothSecurityLayout = function BothSecurityLayout(props) {
34
39
  return _regeneratorRuntime().wrap(function _callee$(_context) {
35
40
  while (1) switch (_context.prev = _context.next) {
36
41
  case 0:
37
- _context.next = 2;
38
- return queryAaaCurrent();
39
- case 2:
40
- response = _context.sent;
42
+ if (!AAALOGIN) {
43
+ _context.next = 6;
44
+ break;
45
+ }
46
+ _context.next = 3;
47
+ return queryAaaCurrent({});
48
+ case 3:
49
+ _context.t0 = _context.sent;
50
+ _context.next = 9;
51
+ break;
52
+ case 6:
53
+ _context.next = 8;
54
+ return queryCurrent({});
55
+ case 8:
56
+ _context.t0 = _context.sent;
57
+ case 9:
58
+ response = _context.t0;
41
59
  if (response.rspCode === "000000") {
42
- props.getUserOk(response.data);
60
+ getUserOk && getUserOk(response.data);
43
61
  }
44
- case 4:
62
+ case 11:
45
63
  case "end":
46
64
  return _context.stop();
47
65
  }
@@ -0,0 +1,2 @@
1
+ export default Auth;
2
+ declare function Auth(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default Aaa;
2
+ import Aaa from "./setting/index";
@@ -0,0 +1,2 @@
1
+ export default AaaSecurityLayout;
2
+ declare function AaaSecurityLayout(props: any): any;
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export { Permission };
3
+ export { Url };
4
+ export { Role };
5
+ export { User };
6
+ }
7
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export default UpdateForm;
2
+ declare function UpdateForm(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default PermList;
2
+ declare function PermList(): any;
@@ -0,0 +1,8 @@
1
+ export function queryPerm(params: any): Promise<any>;
2
+ export function removePerm(params: any): Promise<any>;
3
+ export function addPerm(params: any): Promise<any>;
4
+ export function updatePerm(params: any): Promise<any>;
5
+ export function assignUri(params: any): Promise<any>;
6
+ export function getPermUris(params: any): Promise<any>;
7
+ export function getUriList(params: any): Promise<any>;
8
+ export function loadPermData(params: any): Promise<any>;
@@ -0,0 +1,2 @@
1
+ export default UpdateForm;
2
+ declare function UpdateForm(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default RequestUriList;
2
+ declare function RequestUriList(): any;
@@ -0,0 +1,4 @@
1
+ export function queryUri(params: any): Promise<any>;
2
+ export function removeUri(params: any): Promise<any>;
3
+ export function addUri(params: any): Promise<any>;
4
+ export function updateUri(params: any): Promise<any>;
@@ -0,0 +1,2 @@
1
+ export default UpdateForm;
2
+ declare function UpdateForm(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default RoleList;
2
+ declare function RoleList(): any;
@@ -0,0 +1,7 @@
1
+ export function queryRole(params: any): Promise<any>;
2
+ export function removeRole(params: any): Promise<any>;
3
+ export function addRole(params: any): Promise<any>;
4
+ export function updateRole(params: any): Promise<any>;
5
+ export function assignPerm(params: any): Promise<any>;
6
+ export function getRolePerms(params: any): Promise<any>;
7
+ export function getPermList(params: any): Promise<any>;
@@ -0,0 +1,2 @@
1
+ export default UpdateForm;
2
+ declare function UpdateForm(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default UserList;
2
+ declare function UserList(props: any): any;
@@ -0,0 +1,13 @@
1
+ export function queryUser(params: any): Promise<any>;
2
+ export function removeUser(params: any): Promise<any>;
3
+ export function resetPassword(params: any): Promise<any>;
4
+ export function addUser(params: any): Promise<any>;
5
+ export function updateUser(params: any): Promise<any>;
6
+ export function assignRole(params: any): Promise<any>;
7
+ export function lock(params: any): Promise<any>;
8
+ export function unlock(params: any): Promise<any>;
9
+ export function enable(params: any): Promise<any>;
10
+ export function disable(params: any): Promise<any>;
11
+ export function getRoleList(params: any): Promise<any>;
12
+ export function getUserRoles(params: any): Promise<any>;
13
+ export function createGitAccount(params: any): Promise<any>;
@@ -0,0 +1,2 @@
1
+ export default SecurityLayout;
2
+ import SecurityLayout from "./security-layout/index";
@@ -0,0 +1,2 @@
1
+ export default BothSecurityLayout;
2
+ declare function BothSecurityLayout(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default UpdateForm;
2
+ declare function UpdateForm(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default DictionaryList;
2
+ declare function DictionaryList(): any;
@@ -0,0 +1,4 @@
1
+ export function queryApi(params: any): Promise<any>;
2
+ export function removeApi(params: any): Promise<any>;
3
+ export function addApi(params: any): Promise<any>;
4
+ export function updateApi(params: any): Promise<any>;
@@ -0,0 +1,38 @@
1
+ export default DownloadFile;
2
+ /**
3
+ * 附件下载组件
4
+ * @preserve
5
+ * @param {Object} props 组件的属性
6
+ * @param {string|React.ReactNode} [props.text] 按钮内容,可传入 string 或 ReactNode
7
+ * @param {Object} [props.queryOption] 下载参数对象
8
+ * @param {string} [props.queryOption.url] 下载地址
9
+ * @param {string} [props.queryOption.methods] 请求方法 (GET/POST)
10
+ * @param {string} [props.queryOption.fileName] 文件名
11
+ * @param {Object} [props.queryOption.params] 请求参数
12
+ * @param {Object} [props.queryOption.customField] 自定义字段
13
+ * @param {string} [props.queryOption.customField.url] 自定义文件地址字段(表示取值res.data.[传入的参数])
14
+ * @param {string} [props.queryOption.customField.fileName] 自定义文件名字段(表示取值res.data.[传入的参数])
15
+ * @param {(error: Error) => void} [props.onError] 接口异常回调函数
16
+ * @param {React.ReactNode} [props.icon] 按钮的图标
17
+ * @param {boolean} [props.disabled] 是否禁用按钮
18
+ * @param {boolean} [props.danger] 是否为危险按钮
19
+ * @param {"default"|"primary"|"ghost"|"dashed"|"link"|"text"} [props.type] 按钮类型
20
+ */
21
+ declare function DownloadFile(props: {
22
+ text?: string | React.ReactNode;
23
+ queryOption?: {
24
+ url?: string;
25
+ methods?: string;
26
+ fileName?: string;
27
+ params?: any;
28
+ customField?: {
29
+ url?: string;
30
+ fileName?: string;
31
+ };
32
+ };
33
+ onError?: (error: Error) => void;
34
+ icon?: React.ReactNode;
35
+ disabled?: boolean;
36
+ danger?: boolean;
37
+ type?: "default" | "primary" | "ghost" | "dashed" | "link" | "text";
38
+ }): any;
@@ -0,0 +1,9 @@
1
+ export { default as DictionaryFront } from "./dictionary";
2
+ export { default as OrganizationFront } from "./organization";
3
+ export { default as Sso } from "./sso";
4
+ export { default as Aaa } from "./aaa";
5
+ export { default as BothSecurityLayout } from "./both";
6
+ export { default as UploadFile } from "./uploadFile";
7
+ export { default as DownloadFile } from "./downloadFile";
8
+ export { default as Version } from "./tools/version";
9
+ export { default as MaterialCard } from "./materialCard";
@@ -0,0 +1,58 @@
1
+ export default MaterialCard;
2
+ /**
3
+ * 业务卡片组件
4
+ * @preserve
5
+ * @param {Object} props - 组件的属性
6
+ * @param {string} [props.className] - 自定义类名
7
+ * @param {'left'|'right'|'top'|'bottom'} [props.borderPosition] - 边框位置,默认 'left'
8
+ * @param {string} [props.borderColor] - 边框颜色,默认 '#1890ff'
9
+ * @param {number} [props.borderWidth] - 边框宽度,默认 3
10
+ * @param {number} [props.borderRadius] - 边框圆角,默认 8
11
+ * @param {React.ReactNode|string} [props.title] - 卡片标题
12
+ * @param {React.ReactNode} [props.extra] - 标题栏右侧额外内容
13
+ * @param {React.ReactNode|string} [props.footer] - 底部内容
14
+ * @param {React.ReactNode} [props.footerExtra] - 底部右侧额外内容
15
+ * @param {React.CSSProperties} [props.style] - 卡片容器样式
16
+ * @param {React.CSSProperties} [props.headerStyle] - 标题栏样式
17
+ * @param {React.CSSProperties} [props.bodyStyle] - 内容区域样式
18
+ * @param {React.CSSProperties} [props.footerStyle] - 底部样式
19
+ * @param {React.CSSProperties} [props.titleStyle] - 标题文字样式
20
+ * @param {boolean} [props.showTitleBar] - 是否显示标题前的竖条,默认 true
21
+ * @param {string} [props.titleBarColor] - 标题竖条颜色
22
+ * @param {Object} [props.displayMode] - 展示模式配置
23
+ * @param {Array<{label: string, value: any}>} [props.displayMode.items] - 展示项数组
24
+ * @param {'horizontal'|'vertical'} [props.displayMode.layout] - label 和 value 的布局方式:horizontal 水平并排,vertical 上下排列,默认 'horizontal'
25
+ * @param {number} [props.displayMode.column] - 一行显示的数据项数量,默认 2
26
+ * @param {'solid'|'dashed'|'dotted'} [props.dividerType] - 分割线类型,默认 'dashed'
27
+ * @param {React.CSSProperties} [props.dividerStyle] - 分割线样式
28
+ * @param {React.ReactNode} [props.children] - 卡片内容
29
+ */
30
+ declare function MaterialCard(props: {
31
+ className?: string;
32
+ borderPosition?: 'left' | 'right' | 'top' | 'bottom';
33
+ borderColor?: string;
34
+ borderWidth?: number;
35
+ borderRadius?: number;
36
+ title?: React.ReactNode | string;
37
+ extra?: React.ReactNode;
38
+ footer?: React.ReactNode | string;
39
+ footerExtra?: React.ReactNode;
40
+ style?: React.CSSProperties;
41
+ headerStyle?: React.CSSProperties;
42
+ bodyStyle?: React.CSSProperties;
43
+ footerStyle?: React.CSSProperties;
44
+ titleStyle?: React.CSSProperties;
45
+ showTitleBar?: boolean;
46
+ titleBarColor?: string;
47
+ displayMode?: {
48
+ items?: Array<{
49
+ label: string;
50
+ value: any;
51
+ }>;
52
+ layout?: 'horizontal' | 'vertical';
53
+ column?: number;
54
+ };
55
+ dividerType?: 'solid' | 'dashed' | 'dotted';
56
+ dividerStyle?: React.CSSProperties;
57
+ children?: React.ReactNode;
58
+ }): any;
@@ -0,0 +1,2 @@
1
+ export default CreatePeopleForm;
2
+ declare function CreatePeopleForm(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default CreateSubStoreForm;
2
+ declare function CreateSubStoreForm(props: any): any;
@@ -0,0 +1,2 @@
1
+ declare function _default(props: any): any;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export default Organization;
2
+ declare function Organization(props: any): any;
@@ -0,0 +1,133 @@
1
+ /**
2
+ * @api 新增组织机构
3
+ * @param { String } orgCode 机构编号(必填:是)
4
+ * @param { String } orgName 机构名称(必填:是)
5
+ * @param { String } parentId 上级,传orgCode(必填:是)
6
+ * @param { String } address 单位地址(必填:否)
7
+ * @param { String } orgType 单位类型(必填:否)
8
+ * @param { String } telephone 联系方式(必填:否)
9
+ * @param { String } liablePerson 责任人(必填:否)
10
+ * @param { String } longitude 经度(必填:否)
11
+ * @param { String } latitude 纬度(必填:否)
12
+ * @param { String } streetCode 所属街道编码(必填:否)
13
+ * @param { String } streetName 所属街道名称(必填:否)
14
+ * @param { String } adultSchool 关联的成人学校(必填:否)
15
+ * @param { Number } orderNo 序号(必填:否)
16
+ * @param { String } orgInstitutionLicense 医疗机构执业许可证(必填:否)
17
+ * @param { String } minuteAddress 单位具体地址(必填:否)
18
+ * @param { String } grade 单位级别(必填:否)
19
+ * @param { String } workTypeCode 单位工作类型(必填:否)
20
+ * @param { String } liablePersonTelePhone 责任人联系方式(必填:否)
21
+ * @param { String } postCode 邮政编码(必填:否)
22
+ * @param { String } report 是否需要上报常规报表(必填:否)
23
+ * @param { String } inputdate 录入日期(必填:否)
24
+ * @param { String } reportdate 上报日期间(必填:否)
25
+ * @param { String } hospitalCode 关联卫生院编码(必填:否)
26
+ * @param { String } orgRank 备注(必填:否)
27
+ */
28
+ export function createOrganization(params: any): Promise<any>;
29
+ /**
30
+ * @api 查询单个组织机构信息
31
+ * @param { String } id 组织机构ID(必填:是)
32
+ */
33
+ export function queryOrganizationInfo(params: any): Promise<any>;
34
+ /**
35
+ * @api 查询人员详情
36
+ * @param { String } id 人员ID(必填:是)
37
+ */
38
+ export function queryOrgPeopleInfo(params: any): Promise<any>;
39
+ /**
40
+ * @api 创建/编辑人员信息
41
+ * @param { String } id 人员ID(编辑试必填)(必填:否)
42
+ * @param { String } username 用户名(必填:是)
43
+ * @param { String } realname 姓名(必填:是)
44
+ * @param { String } mobilePhone 手机号(必填:是)
45
+ * @param { String } gender 性别(必填:null)
46
+ * @param { String } birthday 生日(必填:null)
47
+ * @param { String } peopleAttrs 人员角色id,逗号隔开(必填:是)
48
+ * @param { String } expiredTime 过期时间(必填:null)
49
+ * @param { String } orgCode 组织机构编码(必填:是)
50
+ * @param { String } orgName 组织机构名称(必填:是)
51
+ */
52
+ export function createOrUpdatePerson(params: any): Promise<any>;
53
+ /**
54
+ * @api 查询子组织
55
+ * @param { String } orgType 组织类型,2-市区,5-街道,8-社区,13-小区,30-医疗机构(必填:否)
56
+ * @param { String } parentId 父组织orgCode(必填:否)
57
+ */
58
+ export function queryChildrenOrg(params: any): Promise<any>;
59
+ /**
60
+ * @api 删除人员信息
61
+ * @param { String } id 人员ID(必填:是)
62
+ */
63
+ export function deletePerson(params: any): Promise<any>;
64
+ /**
65
+ * @api 初始化密码
66
+ * @param { String } id 人员ID(必填:是)
67
+ */
68
+ export function initPassword(params: any): Promise<any>;
69
+ /**
70
+ * @api 是否显示组织机构
71
+ * @param { String } id 人员ID(必填:是)
72
+ * @param { String } showBi 是否显示 (必填:是)
73
+ */
74
+ export function updateShowBi(params: any): Promise<any>;
75
+ /**
76
+ * @api 更新组织机构
77
+ * @param { String } id 主键ID(必填:是)
78
+ * @param { String } orgCode 机构编号(必填:否)
79
+ * @param { String } orgName 机构名称(必填:否)
80
+ * @param { String } parentId 上级(必填:否)
81
+ * @param { String } address 单位地址(必填:否)
82
+ * @param { String } orgType 单位类型(必填:否)
83
+ * @param { String } telephone 联系方式(必填:否)
84
+ * @param { String } liablePerson 责任人(必填:否)
85
+ * @param { String } longitude 经度(必填:否)
86
+ * @param { String } latitude 纬度(必填:否)
87
+ * @param { String } streetCode 所属街道编码(必填:否)
88
+ * @param { String } streetName 所属街道名称(必填:否)
89
+ * @param { String } adultSchool 关联的成人学校(必填:否)
90
+ * @param { Number } orderNo 序号(必填:否)
91
+ * @param { String } orgInstitutionLicense 医疗机构执业许可证(必填:否)
92
+ * @param { String } minuteAddress 单位具体地址(必填:否)
93
+ * @param { String } grade 单位级别(必填:否)
94
+ * @param { String } workTypeCode 单位工作类型(必填:否)
95
+ * @param { String } liablePersonTelePhone 责任人联系方式(必填:否)
96
+ * @param { String } postCode 邮政编码(必填:否)
97
+ * @param { String } report 是否需要上报常规报表(必填:否)
98
+ * @param { String } inputdate 录入日期(必填:否)
99
+ * @param { String } reportdate 上报日期间(必填:否)
100
+ * @param { String } hospitalCode 关联卫生院编码(必填:否)
101
+ * @param { String } orgRank 备注(必填:否)
102
+ */
103
+ export function updateOrganization(params: any): Promise<any>;
104
+ /**
105
+ * @api 删除组织机构
106
+ * @param { String } id 主键ID(必填:是)
107
+ */
108
+ export function deleteOrganization(params: any): Promise<any>;
109
+ /**
110
+ * @api 查询组织机构树
111
+ * @params 无参数
112
+ */
113
+ export function queryAuthOrgTree(params: any): Promise<any>;
114
+ /**
115
+ * @api 查询全部组织机构
116
+ * @params 无参数
117
+ */
118
+ export function queryAllTree(params: any): Promise<any>;
119
+ /**
120
+ * @api 分页查询组织人员
121
+ * @param { Number } current 当前页码(必填:否)
122
+ * @param { Number } pageSize 每页条数(必填:否)
123
+ * @param { Object } searchObject 查询条件(必填:否)
124
+ * @param { String } orgCode 组织编码(必填:是)
125
+ * @param { String } key 查询条件(姓名,手机号)(必填:否)
126
+ */
127
+ export function queryOrgPeoplePage(params: any): Promise<any>;
128
+ /**
129
+ * @api 查询数字字典
130
+ * @params dictCode字典编码
131
+ */
132
+ export function queryBaseDictList(params: any): Promise<any>;
133
+ export function queryRole(params: any): Promise<any>;
@@ -0,0 +1,2 @@
1
+ export default Sso;
2
+ import Sso from "./setting/index";
@@ -0,0 +1,2 @@
1
+ export default SsoSecurityLayout;
2
+ declare function SsoSecurityLayout(props: any): any;
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export { Permission };
3
+ export { Role };
4
+ export { User };
5
+ export { PermRole };
6
+ }
7
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export default PermRoleBoard;
2
+ declare function PermRoleBoard(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default UpdateForm;
2
+ declare function UpdateForm(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default PermList;
2
+ declare function PermList(): any;
@@ -0,0 +1,2 @@
1
+ export default UpdateForm;
2
+ declare function UpdateForm(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default RoleList;
2
+ declare function RoleList(props: any): any;
@@ -0,0 +1,13 @@
1
+ export function queryRole(params: any): Promise<any>;
2
+ export function fetchUsers(params: any): Promise<any>;
3
+ export function changeAdmin(params: any): Promise<any>;
4
+ export function assignRole(params: any): Promise<any>;
5
+ export function addRole(params: any): Promise<any>;
6
+ export function updateRole(params: any): Promise<any>;
7
+ export function removeRole(params: any): Promise<any>;
8
+ export function queryPerm(params: any): Promise<any>;
9
+ export function addPerm(params: any): Promise<any>;
10
+ export function updatePerm(params: any): Promise<any>;
11
+ export function removePerm(params: any): Promise<any>;
12
+ export function fetchPerms(params: any): Promise<any>;
13
+ export function saveRolePerms(params: any): Promise<any>;
@@ -0,0 +1,2 @@
1
+ export default RoleUpdateForm;
2
+ declare function RoleUpdateForm(props: any): any;
@@ -0,0 +1,2 @@
1
+ export default UserList;
2
+ declare function UserList(props: any): any;
@@ -0,0 +1,12 @@
1
+ export default Version;
2
+ /**
3
+ * 导出Excel
4
+ * @preserve
5
+ * @param {Object} props 组件的属性
6
+ * @param {Object} [props.envData] 环境变量数据,默认为从 sessionStorage 中获取的 env_data
7
+ * @param {string} [props.position] 按钮位置,可选值:bottom、sider,默认为 bottom
8
+ */
9
+ declare function Version(props: {
10
+ envData?: any;
11
+ position?: string;
12
+ }): any;
@@ -0,0 +1,57 @@
1
+ export default UploadFile;
2
+ /**
3
+ * 附件上传组件
4
+ * @preserve
5
+ * @param {Object} props 组件的属性
6
+ * @param {FormProps} props.form 表单实例
7
+ * @param {string} props.label 表单标签
8
+ * @param {string} props.name 表单字段
9
+ * @param {Array<Object>} props.rules 表单校验规则
10
+ * @param {string} props.accept 接受上传的文件类型
11
+ * @param {string} props.action 上传的地址, 默认为:"/api/file/upload?type=openFile"
12
+ * @param {number} props.max 最大上传数量, 超过最大数量就会隐藏上传按钮
13
+ * @param {boolean} props.multiple 是否支持多选文件,开启后按住 ctrl 可选择多个文件
14
+ * @param {React.ReactNode} props.icon Button 或 Dragger 的图标
15
+ * @param {React.ReactNode} props.title Button 或 Dragger 的标题
16
+ * @param {React.ReactNode} props.description 当 listType 为 dragger 时的描述
17
+ * @param {string} props.listType 上传列表的内建样式, 可选值: text, picture, picture-card, dragger
18
+ * @param {Object|boolean} props.showUploadList 是否展示文件列表, 可设为一个对象,用于单独设定 showPreviewIcon, showRemoveIcon 等
19
+ * @param {boolean} props.readonly 是否只读
20
+ * @param {boolean} props.disabled 是否禁用
21
+ * @param {Object} props.checkFile 文件校验配置
22
+ * @param {Array<string>} [props.checkFile.suffixs] 限制的文件格式, 示例:["png", "jpg"]
23
+ * @param {number} [props.checkFile.maxSize] 限制的文件大小 (单位: KB), 示例:1024 表示限制 1MB
24
+ * @param {Function} props.onChange 上传文件改变时的回调
25
+ * @param {FormItemProps} props.formItemOptions 表单项配置
26
+ * @param {UploadProps} props.uploadOptions 上传配置
27
+ * @param {ButtonProps} props.buttonOptions 上传按钮的配置
28
+ */
29
+ declare function UploadFile(props: {
30
+ form: FormProps;
31
+ label: string;
32
+ name: string;
33
+ rules: Array<any>;
34
+ accept: string;
35
+ action: string;
36
+ max: number;
37
+ multiple: boolean;
38
+ icon: React.ReactNode;
39
+ title: React.ReactNode;
40
+ description: React.ReactNode;
41
+ listType: string;
42
+ showUploadList: any | boolean;
43
+ readonly: boolean;
44
+ disabled: boolean;
45
+ checkFile: {
46
+ suffixs?: Array<string>;
47
+ maxSize?: number;
48
+ };
49
+ onChange: Function;
50
+ formItemOptions: FormItemProps;
51
+ uploadOptions: UploadProps;
52
+ buttonOptions: ButtonProps;
53
+ }): any;
54
+ import { FormProps } from "antd";
55
+ import { FormItemProps } from "antd";
56
+ import { UploadProps } from "antd";
57
+ import { ButtonProps } from "antd";
@@ -0,0 +1,3 @@
1
+ export * from "./components";
2
+ export { registerService, unRegisterService, saveEnvData, removeEnvData, ssoLogout } from "./utils/serviceSet.js";
3
+ export { setUploadFileData, getUploadFileData } from "./utils/utils.js";
@@ -0,0 +1,23 @@
1
+ export default DownloadFile;
2
+ /**
3
+ * 下载文件,支持直接下载外链文件和通过接口下载文件两种方式
4
+ * @param {Object} payload - 配置参数对象
5
+ * @param {string} payload.url - 请求的接口地址或文件外链
6
+ * @param {Object} [payload.headers={}] - 请求头信息
7
+ * @param {string} [payload.method="POST"] - 请求方法,支持 GET 和 POST
8
+ * @param {string} [payload.fileName=""] - 下载的文件名
9
+ * @param {Object} [payload.params={}] - 请求参数
10
+ * @param {Object} [payload.customField={url: "url", fileName: "fileName"}] - 自定义字段配置
11
+ * @param {Function} [payload.onError] - 错误回调函数
12
+ * @param {string} [payload.downloadType] - 下载类型,值为 'pure' 时表示下载外链文件
13
+ */
14
+ declare function DownloadFile(payload: {
15
+ url: string;
16
+ headers?: any;
17
+ method?: string;
18
+ fileName?: string;
19
+ params?: any;
20
+ customField?: any;
21
+ onError?: Function;
22
+ downloadType?: string;
23
+ }): Promise<void>;
@@ -0,0 +1 @@
1
+ export default function doRequest(url: any, method: any, data: any, params: any): Promise<any>;
@@ -0,0 +1,5 @@
1
+ export function registerService(service: any): void;
2
+ export function unRegisterService(): void;
3
+ export function saveEnvData(data: any): void;
4
+ export function removeEnvData(): void;
5
+ export function ssoLogout(): void;
@@ -0,0 +1,4 @@
1
+ export function getSessionStorage(key?: string): string;
2
+ export function setSessionStorage(key: string, value: any): void;
3
+ export function removeSessionStorage(key?: string): void;
4
+ export function clearSessionStorage(): void;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * 获取 URL 查询参数的值
3
+ * @param {string} variable - 查询参数的名称
4
+ * @returns {string|boolean} - 返回查询参数的值,如果不存在则返回 false
5
+ */
6
+ export function getQueryVariable(variable: string): string | boolean;
7
+ /**
8
+ * 处理表格响应数据
9
+ * @param {Object} config - 配置对象
10
+ * @param {React.MutableRefObject} config.actionRef - ProTable 实例的引用
11
+ * @param {Object} config.res - 请求响应的数据
12
+ * @param {string} [config.type='proTable'] - 表格类型,支持 'table' 或 'proTable'
13
+ * @returns {Object} - 返回处理后的表格数据
14
+ */
15
+ export function handleTableResponse(config: {
16
+ actionRef: React.MutableRefObject;
17
+ res: any;
18
+ type?: string;
19
+ }): any;
20
+ /**
21
+ * 生成 GUID
22
+ * @returns {string} - 返回生成的 GUID
23
+ */
24
+ export function createGuid(): string;
25
+ /**
26
+ * 将数组格式转换为树状结构
27
+ * @param {Array} array - 原始数组
28
+ * @param {string} [id='id'] - 唯一标识字段
29
+ * @param {string} [pid='pid'] - 父级标识字段
30
+ * @param {string} [children='children'] - 子节点字段
31
+ * @returns {Array} - 转换后的树状结构
32
+ */
33
+ export function arrayToTree(array?: any[], id?: string, pid?: string, children?: string): any[];
34
+ export function asyncCallback(res: any, isTip: boolean): boolean;
35
+ export function formatFormItem(params: any): any;
36
+ export function getUploadFileData(fileList: any[]): Promise<any[]>;
37
+ export function setUploadFileData(fileList: any[]): any[];
@@ -12,8 +12,16 @@ import { message } from "antd";
12
12
  import qs from "querystring";
13
13
 
14
14
  /**
15
- * 下载文件
16
- * @param {Object} payload 对象,可传入url{ string },method{ string }(GET/POST),fileName{ string },params{ Object }···
15
+ * 下载文件,支持直接下载外链文件和通过接口下载文件两种方式
16
+ * @param {Object} payload - 配置参数对象
17
+ * @param {string} payload.url - 请求的接口地址或文件外链
18
+ * @param {Object} [payload.headers={}] - 请求头信息
19
+ * @param {string} [payload.method="POST"] - 请求方法,支持 GET 和 POST
20
+ * @param {string} [payload.fileName=""] - 下载的文件名
21
+ * @param {Object} [payload.params={}] - 请求参数
22
+ * @param {Object} [payload.customField={url: "url", fileName: "fileName"}] - 自定义字段配置
23
+ * @param {Function} [payload.onError] - 错误回调函数
24
+ * @param {string} [payload.downloadType] - 下载类型,值为 'pure' 时表示下载外链文件
17
25
  */
18
26
  var DownloadFile = /*#__PURE__*/function () {
19
27
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(payload) {
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "xydata-tools",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "xydata tools",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "scripts": {
8
8
  "dev": "yarn link && father dev",
9
- "build": "father build"
9
+ "build": "father build",
10
+ "generate-types": "tsc --project tsconfig.json",
11
+ "prepublishOnly": "npm run build && npm run generate-types"
10
12
  },
13
+ "types": "dist/types/index.d.ts",
11
14
  "keywords": [],
12
15
  "authors": [],
13
16
  "license": "MIT",