cfel-base-components 0.0.21 → 0.0.23

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.md CHANGED
@@ -1,2 +1,2 @@
1
1
  <!-- npm run dev
2
- npm pubilsh -->
2
+ npm publish -->
@@ -24,9 +24,9 @@ const App = () => {
24
24
  // </Layout >
25
25
  <>
26
26
 
27
- {/* <Account></Account> */}
27
+ <Account></Account>
28
28
 
29
- <AccountInfo />
29
+ {/* <AccountInfo /> */}
30
30
  {/* <Role ></Role> */}
31
31
 
32
32
  {/* <RoleInfo/> */}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cfel-base-components",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "cfel-base-components",
5
5
  "main": "/src/index.tsx",
6
6
  "types": "src/index.d.ts",
@@ -2,8 +2,8 @@ import axios, { AxiosRequestHeaders } from 'axios';
2
2
  import { notification } from 'antd';
3
3
 
4
4
 
5
- let UMI_APP_BASEURL = window.location.origin || process.env
6
- const instance = axios.create({ baseURL: 'https://lios-iot-daily.chengfengerlai.com' });
5
+ let UMI_APP_BASEURL:any = window.location.origin || process.env
6
+ const instance = axios.create({ baseURL: UMI_APP_BASEURL });
7
7
 
8
8
  instance.interceptors.request.use(
9
9
  (config: any) => {
@@ -12,9 +12,13 @@ import { accountPage } from "./api"
12
12
 
13
13
  import "./index.scss"
14
14
 
15
+ export interface AccountProps {
16
+ historyAction: any;
17
+ }
15
18
 
16
-
17
- export default function Account() {
19
+ export default function Account({
20
+ historyAction
21
+ }:AccountProps) {
18
22
  const searchFormRef: any = useRef()
19
23
 
20
24
  useEffect(() => {
@@ -85,12 +89,14 @@ export default function Account() {
85
89
  fixed: 'right',
86
90
  width: 80,
87
91
  render: (rowdata: any) => (
88
- <Space>
92
+
93
+ <Space>
89
94
  <a
90
95
  onClick={() => {
91
- let origin = window.location?.origin
92
- let baseUrl = window.location?.pathname.slice(1).split('/')[0]
93
- window.location.href = `${origin}/${baseUrl}/account-info?id=${rowdata.id}`
96
+ historyAction?.push({
97
+ pathname: `/account-info`,
98
+ search: `?id=${rowdata.id}`,
99
+ });
94
100
  }}
95
101
  >
96
102
  配置
@@ -13,9 +13,13 @@ import { ProFormText, } from '@ant-design/pro-components';
13
13
  import { timeFormatter } from '../../utils';
14
14
 
15
15
  import "./index.scss"
16
+ export interface RoleProps {
17
+ historyAction: any;
18
+ }
16
19
 
17
-
18
- export default function Role() {
20
+ export default function Role({
21
+ historyAction
22
+ }:RoleProps) {
19
23
  const searchFormRef: any = useRef()
20
24
 
21
25
  useEffect(() => {
@@ -63,10 +67,11 @@ export default function Role() {
63
67
  width: 80,
64
68
  fixed: "right",
65
69
  render: (rowdata: any,) => <Space>
66
- <a onClick={() => {
67
- let origin = window.location?.origin
68
- let baseUrl = window.location?.pathname.slice(1).split('/')[0]
69
- window.location.href = `${origin}/${baseUrl}/role-info?roleCode=${rowdata.roleCode}`
70
+ <a onClick={() => {
71
+ historyAction?.push({
72
+ pathname: `/role-info`,
73
+ search: `?roleCode=${rowdata.roleCode}`,
74
+ });
70
75
  }}>赋予账号</a>
71
76
  </Space>
72
77
  },