|
@@ -19,53 +19,53 @@ function HomePage(props) {
|
|
|
Icon: require('@/assets/UnityMenu/project.png'),
|
|
|
},
|
|
|
{
|
|
|
- id: 2,
|
|
|
- name: '合同管理',
|
|
|
+ id: 5,
|
|
|
+ name: '工时管理',
|
|
|
active: true,
|
|
|
click: () => {
|
|
|
- navigate('/contract-manager');
|
|
|
+ window.open(
|
|
|
+ `http://120.55.44.4:8899/#/purchase/home/work-hours?JWT-TOKEN=${getToken()}`,
|
|
|
+ );
|
|
|
},
|
|
|
- Icon: require('@/assets/UnityMenu/agreement.png'),
|
|
|
+ Icon: require('@/assets/UnityMenu/time.png'),
|
|
|
},
|
|
|
{
|
|
|
- id: 3,
|
|
|
- name: 'OA审批',
|
|
|
+ id: 6,
|
|
|
+ name: '供应商管理',
|
|
|
active: true,
|
|
|
click: () => {
|
|
|
- navigate('/oa');
|
|
|
+ navigate('/manufacturer');
|
|
|
},
|
|
|
- Icon: require('@/assets/UnityMenu/OA.png'),
|
|
|
+ Icon: require('@/assets/UnityMenu/Manufacturer.png'),
|
|
|
},
|
|
|
{
|
|
|
- id: 4,
|
|
|
- name: 'BOM清单',
|
|
|
+ id: 2,
|
|
|
+ name: '合同管理',
|
|
|
active: true,
|
|
|
click: () => {
|
|
|
- window.open(
|
|
|
- `http://120.55.44.4:8896/#/bom/home?JWT-TOKEN=${getToken()}`,
|
|
|
- );
|
|
|
+ navigate('/contract-manager');
|
|
|
},
|
|
|
- Icon: require('@/assets/UnityMenu/Bom.png'),
|
|
|
+ Icon: require('@/assets/UnityMenu/agreement.png'),
|
|
|
},
|
|
|
{
|
|
|
- id: 5,
|
|
|
- name: '工时管理',
|
|
|
+ id: 4,
|
|
|
+ name: 'BOM清单',
|
|
|
active: true,
|
|
|
click: () => {
|
|
|
window.open(
|
|
|
- `http://120.55.44.4:8899/#/purchase/home/work-hours?JWT-TOKEN=${getToken()}`,
|
|
|
+ `http://120.55.44.4:8896/#/bom/home?JWT-TOKEN=${getToken()}`,
|
|
|
);
|
|
|
},
|
|
|
- Icon: require('@/assets/UnityMenu/time.png'),
|
|
|
+ Icon: require('@/assets/UnityMenu/Bom.png'),
|
|
|
},
|
|
|
{
|
|
|
- id: 6,
|
|
|
- name: '供应商管理',
|
|
|
+ id: 3,
|
|
|
+ name: 'OA审批',
|
|
|
active: true,
|
|
|
click: () => {
|
|
|
- navigate('/manufacturer');
|
|
|
+ navigate('/oa');
|
|
|
},
|
|
|
- Icon: require('@/assets/UnityMenu/Manufacturer.png'),
|
|
|
+ Icon: require('@/assets/UnityMenu/OA.png'),
|
|
|
},
|
|
|
{
|
|
|
id: 7,
|
|
@@ -76,51 +76,76 @@ function HomePage(props) {
|
|
|
},
|
|
|
Icon: require('@/assets/UnityMenu/transfer.png'),
|
|
|
},
|
|
|
+ // {
|
|
|
+ // id: 8,
|
|
|
+ // name: '系统管理',
|
|
|
+ // active: true,
|
|
|
+ // click: () => {},
|
|
|
+ // Icon: require('@/assets/UnityMenu/system.png'),
|
|
|
+ // },
|
|
|
{
|
|
|
- id: 8,
|
|
|
- name: '系统管理',
|
|
|
+ id: 9,
|
|
|
+ name: '个人中心',
|
|
|
active: true,
|
|
|
- click: () => {},
|
|
|
- Icon: require('@/assets/UnityMenu/system.png'),
|
|
|
+ click: () => {
|
|
|
+ navigate('/profile/apply');
|
|
|
+ },
|
|
|
+ Icon: require('@/assets/UnityMenu/userCenter.png'),
|
|
|
},
|
|
|
];
|
|
|
return (
|
|
|
<div className={menuStyle.background}>
|
|
|
<div className={menuStyle.menuContent}>
|
|
|
- <div className={menuStyle.wrap}>
|
|
|
- {curMenu.map((item) => (
|
|
|
- <div key={item.id} className={menuStyle.item}>
|
|
|
- <div
|
|
|
- onClick={() => item.click?.(item)}
|
|
|
- className={menuStyle.menu}
|
|
|
- style={item.active ? {} : { cursor: 'not-allowed' }}
|
|
|
- >
|
|
|
- <img
|
|
|
- className={menuStyle.pic}
|
|
|
- src={
|
|
|
- item.active
|
|
|
- ? item.Icon
|
|
|
- : require('@/assets/UnityMenu/newModel.png')
|
|
|
- }
|
|
|
- style={item.active ? {} : { cursor: 'not-allowed' }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div style={{ marginTop: 22, width: 152, textAlign: 'center' }}>
|
|
|
- <span
|
|
|
- onClick={() => item.click?.(item)}
|
|
|
- className={menuStyle.menuFriName}
|
|
|
- style={
|
|
|
- item.active
|
|
|
- ? {}
|
|
|
- : { color: '#6081B2', cursor: 'not-allowed' }
|
|
|
- }
|
|
|
- >
|
|
|
- {item.name}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- ))}
|
|
|
- </div>
|
|
|
+ <MenuContent list={curMenu}></MenuContent>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+function MenuContent({ list }) {
|
|
|
+ const row = useMemo(() => {
|
|
|
+ const result = [];
|
|
|
+ for (let i = 0; i < list.length; i += 4) {
|
|
|
+ result.push(list.slice(i, i + 4));
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }, [list]);
|
|
|
+ return row.map((rowList) => (
|
|
|
+ <div className={menuStyle.wrap}>
|
|
|
+ {rowList.map((item) => (
|
|
|
+ <MenuItem key={item.id} item={item} />
|
|
|
+ ))}
|
|
|
+ <div className={menuStyle.empty}></div>
|
|
|
+ <div className={menuStyle.empty}></div>
|
|
|
+ <div className={menuStyle.empty}></div>
|
|
|
+ </div>
|
|
|
+ ));
|
|
|
+}
|
|
|
+
|
|
|
+function MenuItem({ item }) {
|
|
|
+ return (
|
|
|
+ <div className={menuStyle.item}>
|
|
|
+ <div
|
|
|
+ onClick={() => item.click?.(item)}
|
|
|
+ className={menuStyle.menu}
|
|
|
+ style={item.active ? {} : { cursor: 'not-allowed' }}
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ className={menuStyle.pic}
|
|
|
+ src={
|
|
|
+ item.active ? item.Icon : require('@/assets/UnityMenu/newModel.png')
|
|
|
+ }
|
|
|
+ style={item.active ? {} : { cursor: 'not-allowed' }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div style={{ marginTop: 22, width: 152, textAlign: 'center' }}>
|
|
|
+ <span
|
|
|
+ onClick={() => item.click?.(item)}
|
|
|
+ className={menuStyle.menuFriName}
|
|
|
+ style={item.active ? {} : { color: '#6081B2', cursor: 'not-allowed' }}
|
|
|
+ >
|
|
|
+ {item.name}
|
|
|
+ </span>
|
|
|
</div>
|
|
|
</div>
|
|
|
);
|