-
-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
多租户资产信息优化 更改默认图标 编辑/添加资产后刷新界面 修改添加按钮样式 资产数量更新 成员管理资产查看
- Loading branch information
Showing
5 changed files
with
83 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,60 @@ | ||
import React from "react"; | ||
import { List, Input } from "antd"; | ||
import React, { useEffect, useState } from "react"; | ||
import { List, Input, Select } from "antd"; | ||
import encodeQueryParam from "@/utils/encodeParam"; | ||
import styles from './index.less'; | ||
import Product from "./product"; | ||
import Device from "./device"; | ||
import IconFont from "@/components/IconFont"; | ||
|
||
const Assets = () => ( | ||
<div> | ||
{/* <div style={{ marginBottom: 50, marginTop: 20 }}> | ||
<Input.Search /> | ||
</div> */} | ||
|
||
<div className={styles.cardList}> | ||
|
||
<List<Partial<any>> | ||
rowKey="id" | ||
loading={false} | ||
grid={{ gutter: 24, lg: 4, md: 2, sm: 1, xs: 1 }} | ||
> | ||
|
||
<Product /> | ||
<Device /> | ||
</List> | ||
</div> | ||
</div > | ||
) | ||
import Service from "../../service"; | ||
|
||
interface Props { | ||
data: any; | ||
user?: any; | ||
} | ||
const Assets = (props: Props) => { | ||
const service = new Service('tenant'); | ||
|
||
const { data: { id }, user } = props; | ||
|
||
const [userList, setUserList] = useState([]); | ||
const [current, setCurrent] = useState(); | ||
useEffect(() => { | ||
service.member.query(id, encodeQueryParam({})).subscribe(resp => { | ||
const temp = resp.data.map((item: any) => ({ | ||
id: item.userId, | ||
name: item.name | ||
})); | ||
setUserList(temp); | ||
}); | ||
if (user) { | ||
setCurrent(user.userId); | ||
} | ||
}, [user?.userId]); | ||
return ( | ||
|
||
|
||
<div> | ||
<div style={{ marginBottom: 20, marginTop: 20 }}> | ||
<Select | ||
style={{ width: '100%' }} | ||
value={current} | ||
onChange={(e: any) => setCurrent(e)}> | ||
{userList.map((item: any) => <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>)} | ||
</Select> | ||
</div> | ||
|
||
<div className={styles.cardList}> | ||
|
||
<List<Partial<any>> | ||
rowKey="id" | ||
loading={false} | ||
grid={{ gutter: 24, lg: 4, md: 2, sm: 1, xs: 1 }} | ||
> | ||
|
||
<Product user={current} /> | ||
<Device user={current} /> | ||
</List> | ||
</div> | ||
</div > | ||
) | ||
} | ||
export default Assets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters