cfel-base-components 0.0.22 → 0.0.24

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 -->
@@ -14,7 +14,7 @@
14
14
  <div id="root"></div>
15
15
  <script>
16
16
  window.g_config = {
17
- token: "7718735d-6131-4d96-8e3e-b40e494cd98c",
17
+ token: "111f1bf4-600b-4e47-815b-b739d5398c91",
18
18
  tenant: {
19
19
  id: 1674706582226763778,
20
20
  corpId: "dingc9dbc42450ccf06e4ac5d6980864d335",
@@ -26,10 +26,10 @@ const App = () => {
26
26
 
27
27
  {/* <Account></Account> */}
28
28
 
29
- <AccountInfo />
29
+ {/* <AccountInfo /> */}
30
30
  {/* <Role ></Role> */}
31
31
 
32
- {/* <RoleInfo/> */}
32
+ <RoleInfo/>
33
33
  </>
34
34
  );
35
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cfel-base-components",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "description": "cfel-base-components",
5
5
  "main": "/src/index.tsx",
6
6
  "types": "src/index.d.ts",
@@ -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
  },
@@ -20,6 +20,7 @@ export default function index({
20
20
 
21
21
  useEffect(() => {
22
22
  form.resetFields()
23
+ if(open)queryByKeywordSearch('')
23
24
  }, [open])
24
25
 
25
26
  const editModelOpen = (type: boolean) => {
package/src/index.tsx CHANGED
@@ -9,7 +9,7 @@ import Role from './components/role'
9
9
  import RoleInfo from './components/roleInfo'
10
10
  import request from './apiRequest/config'
11
11
  import iotRequest from './apiRequest/iotConfig'
12
-
12
+ import { getUrlParams, downloadFile, timeFormatter } from './utils/index'
13
13
  export {
14
14
  LiosLayout,
15
15
  LiosLayoutlProps,
@@ -22,5 +22,8 @@ export {
22
22
  Role,
23
23
  RoleInfo,
24
24
  request,
25
- iotRequest
25
+ iotRequest,
26
+ getUrlParams,
27
+ downloadFile,
28
+ timeFormatter
26
29
  }