@glodon-aiot/react-biz-components 3.0.5-beta.0
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/README.git.md +73 -0
- package/README.lib.md +135 -0
- package/dist/aiot-react-biz-components.js +79742 -0
- package/dist/aiot-react-biz-components.umd.cjs +1005 -0
- package/dist/favicon.ico +0 -0
- package/dist/favicon2.ico +0 -0
- package/dist/font/gos-font.js +64 -0
- package/dist/images/empty.svg +40 -0
- package/dist/images/loading.gif +0 -0
- package/dist/images/logo.png +0 -0
- package/dist/images/map-example.png +0 -0
- package/dist/images/sketch.png +0 -0
- package/dist/index.html +43 -0
- package/dist/logo192.png +0 -0
- package/dist/logo512.png +0 -0
- package/dist/manifest.json +25 -0
- package/dist/robots.txt +3 -0
- package/dist/src/PanoramaMap/index.d.ts +8 -0
- package/dist/src/auth/AuthContext.d.ts +18 -0
- package/dist/src/auth/AuthProvider.d.ts +17 -0
- package/dist/src/auth/Errors.d.ts +3 -0
- package/dist/src/auth/RequireAuth.d.ts +3 -0
- package/dist/src/auth/api/apis.d.ts +10 -0
- package/dist/src/auth/api/errors.d.ts +19 -0
- package/dist/src/auth/api/projectErrorHandler.d.ts +1 -0
- package/dist/src/auth/components/LoadingAuth/index.d.ts +6 -0
- package/dist/src/auth/components/NoPermission/index.d.ts +10 -0
- package/dist/src/auth/components/UserInformation/index.d.ts +4 -0
- package/dist/src/auth/index.d.ts +9 -0
- package/dist/src/auth/tool.d.ts +11 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/style.css +1 -0
- package/package.json +118 -0
package/dist/index.html
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<meta name="theme-color" content="#000000" />
|
|
8
|
+
<meta
|
|
9
|
+
name="description"
|
|
10
|
+
content="Web site created using create-react-app"
|
|
11
|
+
/>
|
|
12
|
+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
|
13
|
+
<!--
|
|
14
|
+
manifest.json provides metadata used when your web app is installed on a
|
|
15
|
+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
16
|
+
-->
|
|
17
|
+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
18
|
+
<!--
|
|
19
|
+
Notice the use of %PUBLIC_URL% in the tags above.
|
|
20
|
+
It will be replaced with the URL of the `public` folder during the build.
|
|
21
|
+
Only files inside the `public` folder can be referenced from the HTML.
|
|
22
|
+
|
|
23
|
+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
|
24
|
+
work correctly both with client-side routing and a non-root public URL.
|
|
25
|
+
Learn how to configure a non-root public URL by running `npm run build`.
|
|
26
|
+
-->
|
|
27
|
+
<title>智能进度</title>
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
31
|
+
<div id="root"></div>
|
|
32
|
+
<!--
|
|
33
|
+
This HTML file is a template.
|
|
34
|
+
If you open it directly in the browser, you will see an empty page.
|
|
35
|
+
|
|
36
|
+
You can add webfonts, meta tags, or analytics to this file.
|
|
37
|
+
The build step will place the bundled scripts into the <body> tag.
|
|
38
|
+
|
|
39
|
+
To begin the development, run `npm start` or `yarn start`.
|
|
40
|
+
To create a production bundle, use `npm run build` or `yarn build`.
|
|
41
|
+
-->
|
|
42
|
+
</body>
|
|
43
|
+
</html>
|
package/dist/logo192.png
ADDED
|
Binary file
|
package/dist/logo512.png
ADDED
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"short_name": "gOS App",
|
|
3
|
+
"name": "gOS App Sample",
|
|
4
|
+
"icons": [
|
|
5
|
+
{
|
|
6
|
+
"src": "favicon.ico",
|
|
7
|
+
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
+
"type": "image/x-icon"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"src": "logo192.png",
|
|
12
|
+
"type": "image/png",
|
|
13
|
+
"sizes": "192x192"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"src": "logo512.png",
|
|
17
|
+
"type": "image/png",
|
|
18
|
+
"sizes": "512x512"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"start_url": ".",
|
|
22
|
+
"display": "standalone",
|
|
23
|
+
"theme_color": "#ffffff",
|
|
24
|
+
"background_color": "#000000"
|
|
25
|
+
}
|
package/dist/robots.txt
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IUserInfo, LoginInfo, User } from '@glodon-aiot/apis';
|
|
3
|
+
import { ApiError } from './api/apis';
|
|
4
|
+
interface AuthContextType {
|
|
5
|
+
loading: boolean;
|
|
6
|
+
loginInfo: LoginInfo | null;
|
|
7
|
+
userInfo: IUserInfo | null;
|
|
8
|
+
signin: () => void;
|
|
9
|
+
signout: () => void;
|
|
10
|
+
setLoginAdrress: (loginInfo: LoginInfo) => void;
|
|
11
|
+
user: User | null;
|
|
12
|
+
error?: ApiError | null;
|
|
13
|
+
setUser: (user: User | null) => void;
|
|
14
|
+
refresh: (newTenant: string, orgId?: string) => Promise<string>;
|
|
15
|
+
}
|
|
16
|
+
export declare const AuthContext: React.Context<AuthContextType>;
|
|
17
|
+
export declare function useAuth(): AuthContextType;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { IUserInfo, LoginInfo, User } from '@glodon-aiot/apis';
|
|
3
|
+
export declare const authProvider: {
|
|
4
|
+
isAuthenticated: boolean;
|
|
5
|
+
loginInfo: LoginInfo | null;
|
|
6
|
+
setLoginAdrress: (loginInfo: LoginInfo) => void;
|
|
7
|
+
signin(): void;
|
|
8
|
+
signout(): void;
|
|
9
|
+
user: User | null;
|
|
10
|
+
setLoginUser: (user: User) => void;
|
|
11
|
+
userInfo: IUserInfo | null;
|
|
12
|
+
setUserInfo: (userInfo: IUserInfo) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const refreshToken: (newTenant: string, orgId?: string, productCode?: string) => Promise<string>;
|
|
15
|
+
export declare function AuthProvider({ children }: {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AuthApi, DataApi } from '@glodon-aiot/apis';
|
|
2
|
+
export declare const isDev: boolean;
|
|
3
|
+
export declare const deviceHost: string;
|
|
4
|
+
export interface ApiError {
|
|
5
|
+
status: number;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
declare const authApi: AuthApi;
|
|
9
|
+
declare const dataApi: DataApi;
|
|
10
|
+
export { authApi, dataApi };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum AuthApiErrors {
|
|
2
|
+
Success = 200,// 成功
|
|
3
|
+
UserNotExist = 10001,// 用户不存在
|
|
4
|
+
DatabaseError = 10003,// 数据库查询错误
|
|
5
|
+
ReadConfigFailed = 10012,// 读取配置错误
|
|
6
|
+
GenerateTokenFailed = 10104,// 生成access token失败
|
|
7
|
+
UserNotInTenant = 10107,// 用户不在指定租户内
|
|
8
|
+
InvalidApiKey = 10100,// 无效的 api key
|
|
9
|
+
IlegalUserName = 10113,// 不合法用户名
|
|
10
|
+
ProductNoDefaltRole = 10124,// 未配置产品默认角色
|
|
11
|
+
ProductAuthorizationFailed = 10126,// 为用户开通产品失败
|
|
12
|
+
UpdateUserInfoFailed = 10127,// 更新用户信息失败
|
|
13
|
+
AutoAuthorizationNotAllowed = 10128
|
|
14
|
+
}
|
|
15
|
+
export declare enum DataApiErrors {
|
|
16
|
+
DatabaseError = 10003,// 数据库查询错误
|
|
17
|
+
GroupNotExist = 10210,//不存在分组
|
|
18
|
+
ProductNoPermission = 10211
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const adminCountIsExpired: (message: any) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style.less';
|
|
3
|
+
interface NoPermissionProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
textContent?: string;
|
|
6
|
+
imageUrl?: string;
|
|
7
|
+
branding?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const WithoutPermission: React.FC<NoPermissionProps>;
|
|
10
|
+
export default WithoutPermission;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AuthProvider, authProvider, refreshToken } from './AuthProvider';
|
|
2
|
+
import RequireAuth from './RequireAuth';
|
|
3
|
+
import { authApi, dataApi } from './api/apis';
|
|
4
|
+
import WithoutPermission from './components/NoPermission';
|
|
5
|
+
export * from './AuthContext';
|
|
6
|
+
export * from './AuthProvider';
|
|
7
|
+
export * from './components/NoPermission';
|
|
8
|
+
export * from './tool';
|
|
9
|
+
export { RequireAuth, AuthProvider, authProvider, WithoutPermission, authApi, dataApi, refreshToken, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const tokenTool: {
|
|
2
|
+
setToken: (token: string) => void;
|
|
3
|
+
getToken: (payload?: string) => any;
|
|
4
|
+
delToken: (payload?: string) => void;
|
|
5
|
+
setIdTokenHint: (token: string) => void;
|
|
6
|
+
getIdTokenHint: (payload?: string) => any;
|
|
7
|
+
delIdTokenHint: (payload?: string) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const JWT: (token: string) => any;
|
|
10
|
+
export declare const isExpired: (token: string) => boolean;
|
|
11
|
+
export declare const productCode: string;
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.auto-without-permission{width:100%;height:100vh;background:white}.auto-without-permission .no-permission-layout{width:100%;height:100vh}.auto-without-permission .no-permission-layout .no-permission-header{min-width:992px;background-color:#fff;padding:0 24px;display:flex;justify-content:space-between;align-items:center;z-index:1000;filter:drop-shadow(0px 4px 12px rgba(7,12,20,.12));color:#070c14}.auto-without-permission .no-permission-layout .no-permission-header .header-left{display:flex;align-items:center;gap:24px}.auto-without-permission .no-permission-layout .no-permission-content{width:100%;height:100%;display:flex;flex-wrap:wrap;justify-content:center;align-content:center}.auto-without-permission .no-permission-layout .no-permission-content .content{height:366px;display:flex;gap:24px}.auto-without-permission .no-permission-layout .no-permission-content .content .permission-img{width:440px;height:100%}.auto-without-permission .no-permission-layout .no-permission-content .content .permission-desc{display:flex;flex-direction:column;height:auto;align-items:flex-end;justify-content:flex-end;margin-bottom:70px;flex-grow:1}.auto-without-permission .no-permission-layout .no-permission-content .content .permission-desc .title{height:64px;font-size:36px;font-weight:500;color:#000;line-height:64px}.auto-without-permission .no-permission-layout .no-permission-content .content .permission-desc .text{width:192px;height:24px;font-size:16px;font-weight:400;color:#00000073;line-height:24px}.user-information .user-information-pannel{color:#070c14;cursor:pointer}.user-information .user-information-pannel:hover{color:#9c24f2}
|
package/package.json
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@glodon-aiot/react-biz-components",
|
|
3
|
+
"version": "3.0.5-beta.0",
|
|
4
|
+
"module": "./dist/aiot-react-biz-components.js",
|
|
5
|
+
"main": "./dist/aiot-react-biz-components.umd.cjs",
|
|
6
|
+
"types": "./dist/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/aiot-react-biz-components.js",
|
|
10
|
+
"require": "./dist/aiot-react-biz-components.umd.cjs",
|
|
11
|
+
"types": "./dist/src/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./style.css": "./dist/style.css"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"type": "module",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "vite",
|
|
21
|
+
"start": "vite",
|
|
22
|
+
"build": "tsc && vite build --mode prod",
|
|
23
|
+
"build:pre": "tsc && vite build --mode prod",
|
|
24
|
+
"preview": "vite preview",
|
|
25
|
+
"check": "yarn prettier --check .",
|
|
26
|
+
"write": "yarn prettier --write .",
|
|
27
|
+
"lint": "eslint --ext .tsx,.ts --fix ./example -c .eslintrc.js",
|
|
28
|
+
"storybook": "start-storybook -p 6006 -s public",
|
|
29
|
+
"build-storybook": "build-storybook -s public",
|
|
30
|
+
"docs": "start-storybook -p 6006",
|
|
31
|
+
"commit": "cz"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"webpack": "*"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@glodon-aiot/apis": "^3.0.5-beta.0",
|
|
38
|
+
"@glodon-aiot/react-components": "^3.0.5-beta.0",
|
|
39
|
+
"framer-motion": "4.1.17",
|
|
40
|
+
"js-base64": "^3.7.7",
|
|
41
|
+
"react": "^17.0.2",
|
|
42
|
+
"react-dom": "^17.0.2",
|
|
43
|
+
"style-loader": "2.0.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@babel/core": "^7.20.12",
|
|
47
|
+
"@commitlint/cli": "^17.0.3",
|
|
48
|
+
"@commitlint/config-conventional": "^17.0.3",
|
|
49
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
50
|
+
"@storybook/addon-actions": "6.3.6",
|
|
51
|
+
"@storybook/addon-essentials": "6.4.9",
|
|
52
|
+
"@storybook/addon-interactions": "^6.5.16",
|
|
53
|
+
"@storybook/addon-links": "6.3.5",
|
|
54
|
+
"@storybook/addon-postcss": "2.0.0",
|
|
55
|
+
"@storybook/builder-vite": "^0.4.0",
|
|
56
|
+
"@storybook/node-logger": "6.4.9",
|
|
57
|
+
"@storybook/react": "6.4.9",
|
|
58
|
+
"@storybook/testing-library": "^0.0.13",
|
|
59
|
+
"@types/react": "^17.0.44",
|
|
60
|
+
"@types/react-dom": "^17.0.17",
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^5.35.1",
|
|
62
|
+
"@typescript-eslint/parser": "^5.35.1",
|
|
63
|
+
"@vitejs/plugin-react": "^3.1.0",
|
|
64
|
+
"babel-loader": "^8.3.0",
|
|
65
|
+
"commitizen": "^4.3.0",
|
|
66
|
+
"css-loader": "^6.7.3",
|
|
67
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
68
|
+
"cz-customizable": "^7.0.0",
|
|
69
|
+
"eslint": "^8.0.1",
|
|
70
|
+
"eslint-config-prettier": "^8.5.0",
|
|
71
|
+
"eslint-config-standard-with-typescript": "^22.0.0",
|
|
72
|
+
"eslint-plugin-import": "^2.25.2",
|
|
73
|
+
"eslint-plugin-n": "^15.0.0",
|
|
74
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
75
|
+
"eslint-plugin-react": "^7.31.0",
|
|
76
|
+
"eslint-plugin-storybook": "^0.6.10",
|
|
77
|
+
"husky": ">=6",
|
|
78
|
+
"less": "^4.1.2",
|
|
79
|
+
"less-loader": "^11.1.0",
|
|
80
|
+
"lint-staged": ">=10",
|
|
81
|
+
"postcss-loader": "^7.2.4",
|
|
82
|
+
"prettier": "2.7.1",
|
|
83
|
+
"require-from-string": "^2.0.2",
|
|
84
|
+
"storybook-less-loader": "^0.1.0",
|
|
85
|
+
"typescript": "*",
|
|
86
|
+
"vite": "^4.1.1"
|
|
87
|
+
},
|
|
88
|
+
"lint-staged": {
|
|
89
|
+
"*.{js,css,md,jsx,less,ts,tsx,json}": "prettier --write"
|
|
90
|
+
},
|
|
91
|
+
"production": [
|
|
92
|
+
">0.2%",
|
|
93
|
+
"not dead",
|
|
94
|
+
"not op_mini all"
|
|
95
|
+
],
|
|
96
|
+
"development": [
|
|
97
|
+
"last 1 chrome version",
|
|
98
|
+
"last 1 firefox version",
|
|
99
|
+
"last 1 safari version"
|
|
100
|
+
],
|
|
101
|
+
"config": {
|
|
102
|
+
"commitizen": {
|
|
103
|
+
"path": "node_modules/cz-customizable"
|
|
104
|
+
},
|
|
105
|
+
"cz-customizable": {
|
|
106
|
+
"config": ".cz-config.cjs"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"publishConfig": {
|
|
110
|
+
"access": "public",
|
|
111
|
+
"registry": "https://registry.npmjs.org/"
|
|
112
|
+
},
|
|
113
|
+
"husky": {
|
|
114
|
+
"hooks": {
|
|
115
|
+
"commit-msg": "validate-commit-msg"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|