|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
* @Author: donghao donghao@supervision.ltd
|
|
|
|
|
* @Date: 2024-04-07 14:02:00
|
|
|
|
|
* @LastEditors: donghao donghao@supervision.ltd
|
|
|
|
|
* @LastEditTime: 2024-04-24 14:47:04
|
|
|
|
|
* @LastEditTime: 2024-05-13 16:13:22
|
|
|
|
|
* @FilePath: \general-ai-manage\src\pages\BusinessProject\BusinessProject.tsx
|
|
|
|
|
* @Description: 企业项目首页
|
|
|
|
|
* @交互说明
|
|
|
|
@ -13,7 +13,7 @@
|
|
|
|
|
* # 企业logo添加需要上传base64编码(小图标适用)
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
import { CommButton } from '@/components/Button';
|
|
|
|
|
import { CommButton, TextButton } from '@/components/Button';
|
|
|
|
|
import { isSuccessApi } from '@/utils/forApi';
|
|
|
|
|
import { ReactComponent as BusinessBannerLogo } from '/public/home/business_banner_logo.svg';
|
|
|
|
|
import { ReactComponent as BusinessHeader1 } from '/public/home/business_header_1.svg';
|
|
|
|
@ -26,11 +26,10 @@ import { ReactComponent as SearchIcon } from '/public/home/search_icon.svg';
|
|
|
|
|
// device_count_icon model_count_icon
|
|
|
|
|
import IsDelete from '@/components/TableActionCard/isDelete';
|
|
|
|
|
import { getBusinessProject } from '@/services/testApi/businessProject';
|
|
|
|
|
import { EditOutlined, SearchOutlined } from '@ant-design/icons';
|
|
|
|
|
import { SearchOutlined } from '@ant-design/icons';
|
|
|
|
|
import { ProCard, ProForm, ProFormText, ProList } from '@ant-design/pro-components';
|
|
|
|
|
import { FormattedMessage } from '@umijs/max';
|
|
|
|
|
import { FormattedMessage, useIntl } from '@umijs/max';
|
|
|
|
|
import React, { useEffect, useState } from 'react';
|
|
|
|
|
import { proIconForTableActionStyle } from '../../../../config/defaultIcon';
|
|
|
|
|
import BusinessCard from './components/businessCard';
|
|
|
|
|
import CreateForm from './components/createForm';
|
|
|
|
|
import './index.less';
|
|
|
|
@ -61,6 +60,8 @@ const headerItems: headerItemsProps[] = [
|
|
|
|
|
|
|
|
|
|
const BusinessProject: React.FC = () => {
|
|
|
|
|
/**state */
|
|
|
|
|
const intl = useIntl();
|
|
|
|
|
|
|
|
|
|
const [businessProjectList, setBusinessProjectList] = useState<Record<string, any>[]>([]); // 列表数据
|
|
|
|
|
const [querysData, setQuerysData] = useState<Record<string, any>>({}); // 列表查询参数
|
|
|
|
|
const [createModalOpen, setCreateModalOpen] = useState<boolean>(false); // 创建新增窗口是否打开
|
|
|
|
@ -101,7 +102,6 @@ const BusinessProject: React.FC = () => {
|
|
|
|
|
<BusinessCard
|
|
|
|
|
info={item}
|
|
|
|
|
renderActions={[
|
|
|
|
|
// TODO 统一调整样式 按 UI效果
|
|
|
|
|
{
|
|
|
|
|
key: 'update',
|
|
|
|
|
renderDom: (
|
|
|
|
@ -113,14 +113,17 @@ const BusinessProject: React.FC = () => {
|
|
|
|
|
setCurrentRow(record);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<EditOutlined
|
|
|
|
|
key="update"
|
|
|
|
|
style={{
|
|
|
|
|
color: 'rgba(21, 77, 221, 1)',
|
|
|
|
|
...proIconForTableActionStyle,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<span>资料编辑</span>
|
|
|
|
|
<TextButton
|
|
|
|
|
fontSize={12}
|
|
|
|
|
buttonLabel={
|
|
|
|
|
<span className="text-white">
|
|
|
|
|
<FormattedMessage
|
|
|
|
|
id="business.list.table.action.edit"
|
|
|
|
|
defaultMessage="编辑"
|
|
|
|
|
/>
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
></TextButton>
|
|
|
|
|
</div>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
@ -129,8 +132,22 @@ const BusinessProject: React.FC = () => {
|
|
|
|
|
renderDom: (
|
|
|
|
|
<div className="action_item_box">
|
|
|
|
|
<IsDelete
|
|
|
|
|
buttonType="deleteIcon"
|
|
|
|
|
deleteNextText="删除项目"
|
|
|
|
|
deleteNextText={
|
|
|
|
|
<FormattedMessage id="pages.searchTable.destroy" defaultMessage="删除" />
|
|
|
|
|
}
|
|
|
|
|
buttonRender={
|
|
|
|
|
<TextButton
|
|
|
|
|
fontSize={12}
|
|
|
|
|
buttonLabel={
|
|
|
|
|
<span className="text-white">
|
|
|
|
|
<FormattedMessage
|
|
|
|
|
id="business.list.table.action.destroy"
|
|
|
|
|
defaultMessage="删除"
|
|
|
|
|
/>
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
></TextButton>
|
|
|
|
|
}
|
|
|
|
|
deleteApi={() => {
|
|
|
|
|
// TODO 调用删除接口
|
|
|
|
|
// handleDestroy(record).then(() => {});
|
|
|
|
@ -172,7 +189,7 @@ const BusinessProject: React.FC = () => {
|
|
|
|
|
<li className="flex items-center" key={index}>
|
|
|
|
|
<span className="info_icon">{item.icon}</span>
|
|
|
|
|
<div className="info_body">
|
|
|
|
|
<p>{item.title}</p>
|
|
|
|
|
<p className="text_color_2">{item.title}</p>
|
|
|
|
|
<span>{item.count}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
@ -189,6 +206,7 @@ const BusinessProject: React.FC = () => {
|
|
|
|
|
>
|
|
|
|
|
<div className="gn_table_query_filter">
|
|
|
|
|
<ProForm
|
|
|
|
|
className="gn_search_from"
|
|
|
|
|
form={form}
|
|
|
|
|
layout="horizontal"
|
|
|
|
|
submitter={{
|
|
|
|
@ -198,13 +216,17 @@ const BusinessProject: React.FC = () => {
|
|
|
|
|
type="primary"
|
|
|
|
|
htmlType="submit"
|
|
|
|
|
prevIcon={<SearchIcon />}
|
|
|
|
|
buttonLabel="查询"
|
|
|
|
|
buttonLabel={
|
|
|
|
|
<FormattedMessage id="pages.searchTable.search" defaultMessage="查询" />
|
|
|
|
|
}
|
|
|
|
|
></CommButton>
|
|
|
|
|
<CommButton
|
|
|
|
|
style={{ marginLeft: 12 }}
|
|
|
|
|
htmlType="button"
|
|
|
|
|
prevIcon={<ResetIcon />}
|
|
|
|
|
buttonLabel="重置"
|
|
|
|
|
buttonLabel={
|
|
|
|
|
<FormattedMessage id="pages.searchTable.reset" defaultMessage="重置" />
|
|
|
|
|
}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
form.resetFields(); // 点击重置按钮时重置表单数据
|
|
|
|
|
setQuerysData(() => {}); // 清空筛选项
|
|
|
|
@ -221,7 +243,9 @@ const BusinessProject: React.FC = () => {
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<ProFormText
|
|
|
|
|
label="企业名称"
|
|
|
|
|
label={
|
|
|
|
|
<FormattedMessage id="business.list.table.searchForm.name" defaultMessage="名称" />
|
|
|
|
|
}
|
|
|
|
|
labelClassName="label_set_1"
|
|
|
|
|
fieldProps={{
|
|
|
|
|
style: {
|
|
|
|
@ -230,12 +254,18 @@ const BusinessProject: React.FC = () => {
|
|
|
|
|
prefix: <SearchOutlined style={{ color: 'rgba(0,0,0,.25)' }} />,
|
|
|
|
|
}}
|
|
|
|
|
name="name"
|
|
|
|
|
placeholder="请输入企业名称"
|
|
|
|
|
placeholder={`${intl.formatMessage({
|
|
|
|
|
id: 'common.please_input',
|
|
|
|
|
defaultMessage: '$$$',
|
|
|
|
|
})}${intl.formatMessage({
|
|
|
|
|
id: 'business.list.table.searchForm.name',
|
|
|
|
|
defaultMessage: '$$$',
|
|
|
|
|
})}`}
|
|
|
|
|
/>
|
|
|
|
|
</ProForm>
|
|
|
|
|
</div>
|
|
|
|
|
<ProList<any>
|
|
|
|
|
className="gn"
|
|
|
|
|
className="gn_pro_list"
|
|
|
|
|
ghost={true}
|
|
|
|
|
itemCardProps={{
|
|
|
|
|
ghost: true,
|
|
|
|
|