2024-03-11 19:13:42 +08:00
|
|
|
import './head.css'
|
2024-03-11 23:33:03 +08:00
|
|
|
import BalanceHead from '../../components/balance/BalanceHead.tsx';
|
|
|
|
import RechargeHead from '../../components/recharge/RechargeHead.tsx';
|
2024-04-29 17:22:26 +08:00
|
|
|
import { Dropdown, MenuProps, message, Modal, Space, Spin } from "antd";
|
2024-07-05 13:38:59 +08:00
|
|
|
import { DownOutlined, UserOutlined, KeyOutlined, LogoutOutlined, AccountBookOutlined, MenuFoldOutlined, UsergroupAddOutlined } from "@ant-design/icons";
|
2024-04-29 17:22:26 +08:00
|
|
|
import { useContext, useEffect, useState } from "react";
|
|
|
|
import { put } from "../../util/AjaxUtils.ts";
|
|
|
|
import { GlobalContext, GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts";
|
2024-04-02 18:45:46 +08:00
|
|
|
import UserEdit from "../../components/user/UserEdit.tsx";
|
|
|
|
import PasswordChange from "../../components/password/PasswordChange.tsx";
|
2024-04-29 17:22:26 +08:00
|
|
|
// import headRightBg from '../../assets/head-right-bg.png';
|
2024-04-02 18:45:46 +08:00
|
|
|
import InvoiceList from "../../components/invoice/InvoiceList.tsx";
|
2024-04-29 17:22:26 +08:00
|
|
|
import logoImg from '../../static/head/logo.png'
|
2024-05-23 14:57:22 +08:00
|
|
|
import userImg from '../../static/homeimg/userimg.png'
|
2024-05-28 18:00:42 +08:00
|
|
|
import { reMenuActive } from '../../util/cache';
|
2024-06-19 11:08:39 +08:00
|
|
|
// import BelongPeople from '../../components/BelongPeople/BelongPeople.tsx'
|
|
|
|
import BelongPeople from '../../components/BelongPeople/BelongPeople.tsx'
|
2024-06-21 16:18:01 +08:00
|
|
|
import ContactPeople from '../../components/ContactPeople/ContactPeople.tsx'
|
2024-03-11 19:13:42 +08:00
|
|
|
export default function Head() {
|
2024-03-26 21:09:41 +08:00
|
|
|
const globalContext = useContext(GlobalContext);
|
|
|
|
const globalDispatchContext = useContext(GlobalDispatchContext);
|
|
|
|
const [messageApi, contextHolder] = message.useMessage();
|
|
|
|
const [modal, modalHolder] = Modal.useModal();
|
|
|
|
const [loading, setLoading] = useState<boolean>(false);
|
|
|
|
const [isSelfModalOpen, setIsSelfModalOpen] = useState(false);
|
2024-03-27 11:04:38 +08:00
|
|
|
const [isPasswordModalOpen, setIsPasswordModalOpen] = useState(false);
|
2024-04-07 17:37:09 +08:00
|
|
|
const [isInvoiceModalOpen, setIsInvoiceModalOpen] = useState(false);
|
2024-06-19 11:08:39 +08:00
|
|
|
// 所属者弹窗
|
2024-07-05 13:38:59 +08:00
|
|
|
const [belongModal, setBelongModal] = useState(false)
|
2024-06-19 11:08:39 +08:00
|
|
|
const [belongPeopleInfo, setBelongPeopleInfo] = useState({
|
|
|
|
authorName: '',
|
|
|
|
authorType: '',
|
|
|
|
authorIdCardType: '',
|
|
|
|
authorIdCard: '',
|
2024-07-05 13:38:59 +08:00
|
|
|
authorCrcAccount: '',
|
|
|
|
authorId: '',
|
|
|
|
authorProvinceCity: ''
|
2024-06-19 11:08:39 +08:00
|
|
|
})
|
|
|
|
const setValue = () => {
|
|
|
|
// console.log(value);
|
|
|
|
}
|
2024-06-21 16:18:01 +08:00
|
|
|
// 联系人弹窗
|
2024-07-05 13:38:59 +08:00
|
|
|
const [contactModal, setContactModal] = useState(false)
|
2024-03-26 21:09:41 +08:00
|
|
|
|
|
|
|
useEffect(() => {
|
2024-04-02 18:45:46 +08:00
|
|
|
reloadUser(messageApi, globalDispatchContext).then((data) => {
|
|
|
|
if (!data.hasUserInfo) {
|
|
|
|
setIsSelfModalOpen(true);
|
2024-03-26 21:09:41 +08:00
|
|
|
}
|
2024-04-02 18:45:46 +08:00
|
|
|
});
|
2024-03-26 21:09:41 +08:00
|
|
|
}, [globalContext.user]);
|
2024-03-16 23:12:49 +08:00
|
|
|
|
|
|
|
const items: MenuProps['items'] = [
|
|
|
|
{
|
|
|
|
key: 'userinfo',
|
|
|
|
label: (
|
|
|
|
<div className="dropdown-item">
|
2024-04-29 17:22:26 +08:00
|
|
|
<UserOutlined />
|
2024-03-16 23:12:49 +08:00
|
|
|
<span className="title">个人信息</span>
|
|
|
|
</div>
|
|
|
|
),
|
2024-03-26 21:09:41 +08:00
|
|
|
onClick: () => {
|
|
|
|
setIsSelfModalOpen(true);
|
|
|
|
}
|
2024-03-16 23:12:49 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'changePass',
|
|
|
|
label: (
|
|
|
|
<div className="dropdown-item">
|
2024-04-29 17:22:26 +08:00
|
|
|
<KeyOutlined />
|
2024-03-16 23:12:49 +08:00
|
|
|
<span className="title">修改密码</span>
|
|
|
|
</div>
|
|
|
|
),
|
2024-03-27 11:04:38 +08:00
|
|
|
onClick: () => {
|
|
|
|
setIsPasswordModalOpen(true);
|
|
|
|
}
|
2024-03-16 23:12:49 +08:00
|
|
|
},
|
2024-04-02 18:45:46 +08:00
|
|
|
{
|
|
|
|
key: 'invoice',
|
|
|
|
label: (
|
|
|
|
<div className="dropdown-item">
|
|
|
|
<AccountBookOutlined />
|
|
|
|
<span className="title">发票管理</span>
|
|
|
|
</div>
|
|
|
|
),
|
|
|
|
onClick: () => {
|
2024-04-07 17:37:09 +08:00
|
|
|
setIsInvoiceModalOpen(true);
|
2024-04-02 18:45:46 +08:00
|
|
|
}
|
|
|
|
},
|
2024-03-16 23:12:49 +08:00
|
|
|
{
|
2024-06-20 09:14:36 +08:00
|
|
|
key: 'belong',
|
2024-03-16 23:12:49 +08:00
|
|
|
label: (
|
|
|
|
<div className="dropdown-item">
|
2024-07-05 13:38:59 +08:00
|
|
|
<MenuFoldOutlined />
|
2024-06-20 09:14:36 +08:00
|
|
|
<span className="title">产权所属者</span>
|
2024-03-16 23:12:49 +08:00
|
|
|
</div>
|
|
|
|
),
|
2024-04-12 14:12:38 +08:00
|
|
|
onClick: () => {
|
2024-06-20 09:14:36 +08:00
|
|
|
setBelongModal(true)
|
2024-04-12 14:12:38 +08:00
|
|
|
}
|
2024-03-16 23:12:49 +08:00
|
|
|
},
|
2024-06-21 16:18:01 +08:00
|
|
|
{
|
|
|
|
key: 'contact',
|
|
|
|
label: (
|
|
|
|
<div className="dropdown-item">
|
2024-07-05 13:38:59 +08:00
|
|
|
<UsergroupAddOutlined />
|
2024-06-21 16:18:01 +08:00
|
|
|
<span className="title">产权联系人</span>
|
|
|
|
</div>
|
|
|
|
),
|
|
|
|
onClick: () => {
|
|
|
|
setContactModal(true)
|
|
|
|
}
|
|
|
|
},
|
2024-06-19 11:08:39 +08:00
|
|
|
{
|
2024-06-20 09:14:36 +08:00
|
|
|
key: 'logout',
|
2024-06-19 11:08:39 +08:00
|
|
|
label: (
|
|
|
|
<div className="dropdown-item">
|
2024-06-20 09:14:36 +08:00
|
|
|
<LogoutOutlined />
|
|
|
|
<span className="title">退出系统</span>
|
2024-06-19 11:08:39 +08:00
|
|
|
</div>
|
|
|
|
),
|
|
|
|
onClick: () => {
|
2024-06-20 09:14:36 +08:00
|
|
|
reMenuActive()
|
|
|
|
|
|
|
|
window.location.href = '/copyright/logout'
|
2024-06-19 11:08:39 +08:00
|
|
|
}
|
|
|
|
},
|
2024-07-05 13:38:59 +08:00
|
|
|
|
2024-03-16 23:12:49 +08:00
|
|
|
]
|
|
|
|
|
2024-03-11 19:13:42 +08:00
|
|
|
return (
|
2024-03-26 21:09:41 +08:00
|
|
|
<>
|
|
|
|
<div className="head">
|
|
|
|
<div className="center">
|
|
|
|
<div className="left">
|
2024-04-29 17:22:26 +08:00
|
|
|
{/* <span className="sys-title">AI引擎软著</span>
|
2024-03-26 21:09:41 +08:00
|
|
|
<Divider type="vertical"/>
|
2024-04-29 17:22:26 +08:00
|
|
|
<span className="sys-title-sub">软件著作权一站式服务平台</span> */}
|
|
|
|
<img src={logoImg} alt="" />
|
2024-03-26 21:09:41 +08:00
|
|
|
</div>
|
2024-04-29 17:22:26 +08:00
|
|
|
{/* <div className="right" style={{backgroundImage: `url(${headRightBg})`}}> */}
|
2024-07-05 13:38:59 +08:00
|
|
|
|
2024-04-29 17:22:26 +08:00
|
|
|
<div className="right">
|
2024-07-05 13:38:59 +08:00
|
|
|
<div className='head-nav' onClick={()=>{
|
|
|
|
window.open('https://www.aimzhu.com/operator/route/agreementportal/view?agreementId=c0c5683a-bef3-40c3-8395-900a362ea234')
|
|
|
|
}}>
|
|
|
|
系统操作流程
|
|
|
|
</div>
|
2024-04-29 17:22:26 +08:00
|
|
|
<BalanceHead />
|
|
|
|
<RechargeHead />
|
2024-03-26 21:09:41 +08:00
|
|
|
{/*<MessageHead/>*/}
|
2024-04-29 17:22:26 +08:00
|
|
|
<div style={{ display: 'flex', alignContent: 'center', padding: '0 10px', cursor: 'pointer' }}>
|
2024-07-05 13:38:59 +08:00
|
|
|
<div style={{ width: '50px', height: '50px', borderRadius: '25px', marginLeft: '20px', marginRight: '10px' }} >
|
|
|
|
<img src={userImg} alt="" width={50} height={50} />
|
2024-05-23 14:57:22 +08:00
|
|
|
</div>
|
2024-03-26 21:09:41 +08:00
|
|
|
<Dropdown menu={{
|
|
|
|
items: items
|
|
|
|
}}>
|
|
|
|
<Space>
|
2024-04-29 17:22:26 +08:00
|
|
|
{/* 您好:{globalContext.user.nickname} */}
|
|
|
|
个人中心
|
|
|
|
<DownOutlined />
|
2024-03-26 21:09:41 +08:00
|
|
|
</Space>
|
|
|
|
</Dropdown>
|
|
|
|
</div>
|
2024-03-16 23:12:49 +08:00
|
|
|
</div>
|
2024-03-11 19:13:42 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-03-26 21:09:41 +08:00
|
|
|
<Modal open={isSelfModalOpen}
|
2024-04-29 17:22:26 +08:00
|
|
|
title="个人信息"
|
|
|
|
footer={false}
|
|
|
|
onCancel={() => {
|
|
|
|
if (!globalContext.user.hasUserInfo) {
|
|
|
|
messageApi.info('请完善个人信息');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
setIsSelfModalOpen(false)
|
|
|
|
}}>
|
2024-03-26 21:09:41 +08:00
|
|
|
<UserEdit handleConfirm={(data) => {
|
|
|
|
modal.confirm({
|
2024-03-27 11:04:38 +08:00
|
|
|
title: '提示',
|
2024-03-26 21:09:41 +08:00
|
|
|
content: '确定保存吗?',
|
|
|
|
okText: '确认',
|
|
|
|
cancelText: '取消',
|
|
|
|
okButtonProps: {
|
|
|
|
style: {
|
|
|
|
backgroundColor: 'var(--color-primary)'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onOk: () => {
|
|
|
|
setIsSelfModalOpen(false);
|
|
|
|
put({
|
|
|
|
messageApi,
|
|
|
|
url: '/api/user-info/update-self',
|
|
|
|
body: data,
|
|
|
|
onBefore() {
|
|
|
|
setLoading(true);
|
|
|
|
},
|
|
|
|
onSuccess() {
|
|
|
|
messageApi.success('修改成功');
|
|
|
|
},
|
|
|
|
onFinally() {
|
|
|
|
setLoading(false);
|
|
|
|
}
|
|
|
|
})
|
2024-03-27 11:04:38 +08:00
|
|
|
}
|
|
|
|
});
|
2024-04-29 17:22:26 +08:00
|
|
|
}} />
|
2024-03-27 11:04:38 +08:00
|
|
|
</Modal>
|
|
|
|
<Modal open={isPasswordModalOpen}
|
2024-04-29 17:22:26 +08:00
|
|
|
title="修改密码"
|
|
|
|
footer={false}
|
|
|
|
onCancel={() => {
|
|
|
|
setIsPasswordModalOpen(false)
|
|
|
|
}}>
|
2024-03-27 11:04:38 +08:00
|
|
|
<PasswordChange handleConfirm={(data) => {
|
|
|
|
modal.confirm({
|
|
|
|
title: '提示',
|
|
|
|
content: '确定修改吗?',
|
|
|
|
okText: '确认',
|
|
|
|
cancelText: '取消',
|
|
|
|
okButtonProps: {
|
|
|
|
style: {
|
|
|
|
backgroundColor: 'var(--color-primary)'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onOk: () => {
|
|
|
|
put({
|
|
|
|
messageApi,
|
|
|
|
url: '/api/user/update-password',
|
|
|
|
body: data,
|
|
|
|
onBefore() {
|
|
|
|
setLoading(true);
|
|
|
|
},
|
|
|
|
onSuccess() {
|
|
|
|
setIsPasswordModalOpen(false);
|
|
|
|
messageApi.success('修改成功,重新登录生效');
|
|
|
|
},
|
|
|
|
onFinally() {
|
|
|
|
setLoading(false);
|
|
|
|
}
|
|
|
|
})
|
2024-03-26 21:09:41 +08:00
|
|
|
}
|
|
|
|
});
|
2024-04-29 17:22:26 +08:00
|
|
|
}} />
|
2024-03-26 21:09:41 +08:00
|
|
|
</Modal>
|
2024-04-07 17:37:09 +08:00
|
|
|
<Modal open={isInvoiceModalOpen}
|
2024-04-29 17:22:26 +08:00
|
|
|
title="发票管理"
|
|
|
|
width={1100}
|
|
|
|
footer={false}
|
|
|
|
onCancel={() => setIsInvoiceModalOpen(false)}
|
2024-04-01 20:39:22 +08:00
|
|
|
>
|
2024-04-29 17:22:26 +08:00
|
|
|
<InvoiceList />
|
2024-04-01 20:39:22 +08:00
|
|
|
</Modal>
|
2024-06-20 09:14:36 +08:00
|
|
|
<Modal title="知识产权所属者"
|
2024-06-19 11:08:39 +08:00
|
|
|
destroyOnClose
|
|
|
|
|
|
|
|
open={belongModal}
|
|
|
|
width={1200}
|
|
|
|
|
|
|
|
footer={null}
|
|
|
|
onCancel={() => {
|
|
|
|
setBelongModal(false)
|
|
|
|
|
|
|
|
}}>
|
|
|
|
|
2024-07-05 13:38:59 +08:00
|
|
|
<BelongPeople closeModal={() => { setBelongModal(false) }} setBelongPeopleInfo={setBelongPeopleInfo} belongPeopleInfo={belongPeopleInfo} setValue={setValue} isShow={false} ></BelongPeople>
|
2024-06-21 16:18:01 +08:00
|
|
|
</Modal>
|
|
|
|
<Modal title="知识产权联系人"
|
|
|
|
destroyOnClose
|
|
|
|
|
|
|
|
open={contactModal}
|
|
|
|
width={1200}
|
|
|
|
|
|
|
|
footer={null}
|
|
|
|
onCancel={() => {
|
|
|
|
setContactModal(false)
|
|
|
|
|
|
|
|
}}>
|
|
|
|
|
|
|
|
<ContactPeople ></ContactPeople>
|
2024-06-19 11:08:39 +08:00
|
|
|
</Modal>
|
2024-04-29 17:22:26 +08:00
|
|
|
<Spin tip="正在提交..." spinning={loading} fullscreen />
|
2024-03-26 21:09:41 +08:00
|
|
|
{contextHolder}
|
|
|
|
{modalHolder}
|
|
|
|
</>
|
2024-03-11 19:13:42 +08:00
|
|
|
)
|
|
|
|
}
|