feat: 新增左树右表的layout组件,按UI要求调整各模块的细节交互

develop
zhoux 2 years ago
parent 4627ed7a11
commit 8f0fa7794b

2
.gitignore vendored

@ -9,6 +9,8 @@ _roadhog-api-doc
# production # production
/dist /dist
/taskDoc /taskDoc
/src/pages/Demo
# misc # misc
.DS_Store .DS_Store
npm-debug.log* npm-debug.log*

@ -1,36 +1,17 @@
<!--
* @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-01 13:56:33
* @LastEditors: zhoux zhouxia@supervision.ltd
* @LastEditTime: 2023-11-13 13:12:38
* @FilePath: \general-ai-platform-web\README.md
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
# General-AI-Platform-Web # General-AI-Platform-Web
通用算法平台前端仓库 develop 通用算法平台前端仓库 develop
### 生成代码调整
* ProFormSelect 选择控件 对应文案使用 common.please_select 默认可以使用 common.please_input
### remark ### remark
* 列表筛选表单配置统一使用renderFormItem配置方便个性化处理 * 列表筛选表单配置统一使用renderFormItem配置方便个性化处理
* 删除按钮颜色配色 统一将a标签换成Button 设置属性{ type="text" danger} * 删除按钮颜色配色 统一将a标签换成Button 设置属性{ type="text" danger}
* 列表多选的操作高亮处理,目前不明显
* 列表action栏位操作多个排在一起显得拥挤
* 展示抽屉内容时需要有关闭按钮,排版需和谐 * 展示抽屉内容时需要有关闭按钮,排版需和谐
* 使用stepForm的时候最后的提交写在最后一步的onfinish里面而不是总的stepForm里 * 使用stepForm的时候最后的提交写在最后一步的onfinish里面而不是总的stepForm里
* table操作栏按钮统一使用button合理间距 * table操作栏按钮统一使用button合理间距
### 具体实现 ### 具体实现
1. 筛选表单区: 列表在columns配置初始数据时需要筛选的表单项统一使用renderFormItem属性基于renderFormItem去配置表单项field, 【searchFormItemProps】属性统一配置自定义业务 1. 筛选表单区: 列表在columns配置初始数据时需要筛选的表单项统一使用renderFormItem属性基于renderFormItem去配置表单项field, 【searchFormItemProps】属性统一配置自定义业务
{ {
@ -51,17 +32,13 @@
5. 列表可选时,首列需要固定 5. 列表可选时,首列需要固定
新增首列index栏位设置{fixed: 'left'}可实现固定 新增首列index栏位设置{fixed: 'left'}可实现固定
6. 列表固定表头 scroll={{ y: 500 }}
## ProTable 固定列表
1. 固定表头 scroll={{ y: 500 }}
批量选择确认按钮固定,列表头内容固定 批量选择确认按钮固定,列表头内容固定
2. 批量选择 tableAlertOptionRender 7. 列表批量选择 tableAlertOptionRender
配置多选操作选项区 配置多选操作选项区
## ProForm 表单
### git提交修饰 ### git提交修饰
feat: 新功能 feat: 新功能
fix: bug修复 fix: bug修复
@ -72,8 +49,5 @@ perf: 改进性能的代码更改
test: 添加缺少的测试或更正现有测试 test: 添加缺少的测试或更正现有测试
chore: 对构建过程或辅助工具和库(如文档)的更改(无法确认内容可使用) chore: 对构建过程或辅助工具和库(如文档)的更改(无法确认内容可使用)
### bug汇总 ### bug汇总
* 新增路由页面,默认该角色拥有查看权限,实际配置并没有(重新配置权限,又能正常访问该新增页面) * 新增路由页面,默认该角色拥有查看权限,实际配置并没有(重新配置权限,又能正常访问该新增页面)

@ -2,11 +2,12 @@
* @Author: zhoux zhouxia@supervision.ltd * @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-13 14:19:57 * @Date: 2023-11-13 14:19:57
* @LastEditors: zhoux zhouxia@supervision.ltd * @LastEditors: zhoux zhouxia@supervision.ltd
* @LastEditTime: 2023-11-17 15:27:51 * @LastEditTime: 2023-11-22 13:15:04
* @FilePath: \general-ai-platform-web\config\defaultForm.ts * @FilePath: \general-ai-platform-web\config\defaultForm.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE2 * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE2
*/ */
import { StepsFormProps } from "@ant-design/pro-components";
import { ReactNode } from "react"; import { ReactNode } from "react";
@ -49,3 +50,11 @@ export const proFormListCreatorButtonProps : {
position: 'bottom', position: 'bottom',
creatorButtonText: '添加参数字段', // 设置新增一项数据的文案 creatorButtonText: '添加参数字段', // 设置新增一项数据的文案
} }
// 分步表单统一配置
export const proFormStepsFormProps: StepsFormProps = {
stepsProps: {
labelPlacement: 'vertical',
}
}

@ -2,7 +2,7 @@
* @Author: zhoux zhouxia@supervision.ltd * @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-13 11:32:26 * @Date: 2023-11-13 11:32:26
* @LastEditors: zhoux zhouxia@supervision.ltd * @LastEditors: zhoux zhouxia@supervision.ltd
* @LastEditTime: 2023-11-16 13:30:09 * @LastEditTime: 2023-11-21 13:36:39
* @FilePath: \general-ai-platform-web\config\defaultTable.ts * @FilePath: \general-ai-platform-web\config\defaultTable.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -32,6 +32,9 @@ export const proTablePaginationOptions: PaginationProps = {
showTotal: (total) => `${total}`, showTotal: (total) => `${total}`,
} }
// 默认索引列配置 // 默认索引列配置
// export const proTableIndexColumnOptions : ProColumns = { // export const proTableIndexColumnOptions : ProColumns = {
// title: '序号', // title: '序号',

@ -25,7 +25,6 @@ export default [
{ {
path: '/welcome', path: '/welcome',
name: 'welcome', name: 'welcome',
component: 'Welcome/Welcome', component: 'Welcome/Welcome',
}, },
{ {

@ -55,6 +55,7 @@
"classnames": "^2.3.2", "classnames": "^2.3.2",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"echarts-for-react": "^3.0.2", "echarts-for-react": "^3.0.2",
"fabric": "^5.3.0",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"moment": "^2.29.4", "moment": "^2.29.4",
@ -75,6 +76,7 @@
"@testing-library/react": "^13.4.0", "@testing-library/react": "^13.4.0",
"@types/classnames": "^2.3.1", "@types/classnames": "^2.3.1",
"@types/express": "^4.17.17", "@types/express": "^4.17.17",
"@types/fabric": "^5.3.6",
"@types/history": "^4.7.11", "@types/history": "^4.7.11",
"@types/jest": "^29.5.1", "@types/jest": "^29.5.1",
"@types/js-yaml": "^4.0.8", "@types/js-yaml": "^4.0.8",

@ -2,7 +2,7 @@
* @Author: zhoux zhouxia@supervision.ltd * @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-15 15:01:34 * @Date: 2023-11-15 15:01:34
* @LastEditors: zhoux zhouxia@supervision.ltd * @LastEditors: zhoux zhouxia@supervision.ltd
* @LastEditTime: 2023-11-16 17:22:16 * @LastEditTime: 2023-11-22 13:24:58
* @FilePath: \general-ai-platform-web\src\components\DictionaryBox\isEnable.tsx * @FilePath: \general-ai-platform-web\src\components\DictionaryBox\isEnable.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -22,7 +22,7 @@ const IsEnableBox: React.FC<IsEnableBoxProps> = (props) => {
return ( return (
<div style={{ display: 'flex', alignItems: 'center'}}> <div style={{ display: 'flex', alignItems: 'center'}}>
<Badge status={isEnable ? 'success' : 'default'}></Badge> <Badge status={isEnable ? 'success' : 'default'}></Badge>
<span style={{color: currentItem.color, padding: 4 }}> <span style={{color: currentItem.color, paddingLeft: 4 }}>
<FormattedMessage id={isEnable ? 'common.enable' : 'common.disable'} defaultMessage="$$$" /> <FormattedMessage id={isEnable ? 'common.enable' : 'common.disable'} defaultMessage="$$$" />
</span> </span>
</div> </div>

@ -109,7 +109,9 @@ ol {
} }
/* 颜色 */ /* 颜色 */
.theme_color, .theme_color,
.ant-table-cell > a { .ant-table-cell > a,
.ant-descriptions-item-content > a,
a.ant-dropdown-trigger {
color: #155BD4; color: #155BD4;
} }
.theme_bg_color { .theme_bg_color {
@ -124,10 +126,14 @@ ol {
} }
.ant-menu-light .ant-menu-item-selected, .ant-menu-light .ant-menu-item-selected,
.ant-menu-light > .ant-menu .ant-menu-item-selected { .ant-menu-light > .ant-menu .ant-menu-item-selected {
background-color: rgba(21, 91, 212, 0.1); background-color: #e8effb;
} }
.ant-select-dropdown .ant-select-item-option-active:not(.ant-select-item-option-disabled) { .ant-select-dropdown .ant-select-item-option-active:not(.ant-select-item-option-disabled) {
background-color: rgba(21, 91, 212, 0.1); background-color: #e8effb;
}
.ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected,
:where(.css-dev-only-do-not-override-7ql2tf).ant-tree .ant-tree-checkbox + span.ant-tree-node-selected {
background-color: #e8effb;
} }
/* 表单 */ /* 表单 */
.ant-form-item { .ant-form-item {
@ -143,10 +149,21 @@ ol {
.ant-modal .ant-modal-title { .ant-modal .ant-modal-title {
font-size: 18px; font-size: 18px;
} }
/* 列表table */ .ant-modal-body .ant-pro-steps-form-steps-container {
.ant-pro-table-list-toolbar-left { max-width: 1900px !important;
}
/* 列表table && proTable */
.ant-pro-table .ant-pro-table-list-toolbar-left {
flex: 0.3; flex: 0.3;
} }
.ant-pro-table .ant-pro-table-search .ant-form .ant-pro-query-filter-row-split {
padding-right: 0 !important;
}
/* ant-descriptions */
.ant-descriptions .ant-descriptions-row > th,
.ant-descriptions .ant-descriptions-row > td {
padding-right: 12px;
}
/* UI // TODO 11-17 /* UI // TODO 11-17
*/ */
.gn.h2 { .gn.h2 {

@ -131,7 +131,9 @@ ol {
/* 颜色 */ /* 颜色 */
.theme_color, .ant-table-cell>a{ .theme_color, .ant-table-cell>a,
.ant-descriptions-item-content>a,
a.ant-dropdown-trigger{
color: #155BD4; color: #155BD4;
} }
@ -147,11 +149,14 @@ ol {
} }
.ant-menu-light .ant-menu-item-selected, .ant-menu-light>.ant-menu .ant-menu-item-selected { .ant-menu-light .ant-menu-item-selected, .ant-menu-light>.ant-menu .ant-menu-item-selected {
background-color: rgba(#155BD4, 0.1); background-color: #e8effb;
} }
.ant-select-dropdown .ant-select-item-option-active:not(.ant-select-item-option-disabled) { .ant-select-dropdown .ant-select-item-option-active:not(.ant-select-item-option-disabled) {
background-color: rgba(#155BD4, 0.1); background-color: #e8effb;
}
.ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected, :where(.css-dev-only-do-not-override-7ql2tf).ant-tree .ant-tree-checkbox+span.ant-tree-node-selected {
background-color: #e8effb;
} }
@ -172,13 +177,32 @@ ol {
font-size: 18px; font-size: 18px;
} }
/* 列表table */ .ant-modal-body .ant-pro-steps-form-steps-container{
// 控制proTable 标题栏左侧文字最大弹性占比 max-width: 1900px !important;
.ant-pro-table-list-toolbar-left{ }
flex: 0.3 /* 列表table && proTable */
// proTable
.ant-pro-table{
// 标题栏左侧文字最大弹性占比
.ant-pro-table-list-toolbar-left{
flex: 0.3
}
// 筛选表单
.ant-pro-table-search{
.ant-form{
.ant-pro-query-filter-row-split{
padding-right: 0 !important;
}
}
}
}
/* ant-descriptions */
.ant-descriptions{
.ant-descriptions-row >th,
.ant-descriptions-row >td {
padding-right: 12px;
}
} }
/* UI 规范表 // TODO 11-17启动 /* UI 规范表 // TODO 11-17启动
*/ */

@ -0,0 +1,61 @@
import { ProCard } from '@ant-design/pro-components';
import { CardProps } from 'antd';
// 此模块使用的 ProCardType
export interface ProCardTypeProps extends CardProps {
colSpan?: string;
headerBordered?: boolean;
}
// 当前组件类型
type TreeAndTableListProps = {
leftCard?: ProCardTypeProps;
rightCard?: ProCardTypeProps;
leftDom: any;
rightDom: any;
};
const TreeAndTableList: React.FC<TreeAndTableListProps> = (props) => {
// 业务层接收
const { leftCard, rightCard, leftDom, rightDom } = props;
// 统一配置
let finalLeftCard: ProCardTypeProps = {
// 左侧卡片
headStyle: { paddingTop: 24, paddingLeft: 20, paddingRight: 20 },
bodyStyle: {paddingLeft: 20, paddingRight: 20},
colSpan: '22%',
};
let finalRightCard: ProCardTypeProps = {
headStyle: { padding: 0, margin: 0, background: 'transparent' },
bodyStyle: { padding: 0, margin: 0 },
headerBordered: true,
// 右侧卡片
colSpan: '76.5%',
};
if (leftCard) {
Object.assign(finalLeftCard, leftCard);
}
if (rightCard) {
Object.assign(finalRightCard, rightCard);
}
return (
<>
<ProCard
style={{ display: 'flex', width: '100%', background: 'transparent' }}
bodyStyle={{
padding: 0,
margin: 0,
display: 'flex',
justifyContent: 'space-between',
}}
>
{/* 后续依据业务需要动态调整 */}
<ProCard {...finalLeftCard}>{leftDom}</ProCard>
<ProCard {...finalRightCard}>{rightDom}</ProCard>
</ProCard>
</>
);
};
export default TreeAndTableList;

@ -2,7 +2,7 @@
* @Author: zhoux zhouxia@supervision.ltd * @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-01 13:56:33 * @Date: 2023-11-01 13:56:33
* @LastEditors: zhoux zhouxia@supervision.ltd * @LastEditors: zhoux zhouxia@supervision.ltd
* @LastEditTime: 2023-11-17 10:07:03 * @LastEditTime: 2023-11-21 14:23:38
* @FilePath: \general-ai-platform-web\src\locales\zh-CN\device.ts * @FilePath: \general-ai-platform-web\src\locales\zh-CN\device.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -58,6 +58,7 @@ export const device_group: { [key: string]: string } = {
'device.device_group.table.rule.required.parentFkId': '父节点为必填项', 'device.device_group.table.rule.required.parentFkId': '父节点为必填项',
'device.device_group.table.list.add': '新建设备分组', 'device.device_group.table.list.add': '新建设备分组',
'device.device_group.table.list.update': '更新设备分组', 'device.device_group.table.list.update': '更新设备分组',
'device.device_group.table.list.treeAdd': '添加根节点',
}; };
export const device_relation: { [key: string]: string } = { export const device_relation: { [key: string]: string } = {
'device.device_relation.table.list.id': 'ID', 'device.device_relation.table.list.id': 'ID',

@ -1,339 +1,384 @@
import {postActionDetectionGetActionDetectionList} from '@/services/analysis/ActionDetection'; import TableActionCard from '@/components/TableActionCard';
import VideoModal from '@/pages/Analysis/ActionDetectionList/components/VideoModal';
import { postActionDetectionGetActionDetectionList } from '@/services/analysis/ActionDetection';
import type { ActionType, ProColumns } from '@ant-design/pro-components'; import type { ActionType, ProColumns } from '@ant-design/pro-components';
import { import { FooterToolbar, PageContainer, ProTable } from '@ant-design/pro-components';
FooterToolbar, import { FormattedMessage, useAccess, useIntl } from '@umijs/max';
PageContainer, import { Button, Image, Tag } from 'antd';
ProTable,
} from '@ant-design/pro-components';
import { FormattedMessage, useIntl, useAccess, Access, history } from '@umijs/max';
import {Tag, Image} from 'antd';
import React, { useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
import VideoModal from "@/pages/Analysis/ActionDetectionList/components/VideoModal"; import { proTableCommonOptions } from '../../../../config/defaultTable';
// import UpdateForm from './components/UpdateForm'; // import UpdateForm from './components/UpdateForm';
// import CreateForm from "./components/CreateForm"; // import CreateForm from "./components/CreateForm";
// import {ColumnDrawer} from "./components/ColumnDrawer"; // import {ColumnDrawer} from "./components/ColumnDrawer";
const ActionDetectionList: React.FC = () => { const ActionDetectionList: React.FC = () => {
/** /**
* @en-US Pop-up window of new window * @en-US Pop-up window of new window
* @zh-CN * @zh-CN
* */ * */
const [videoModalOpen, setVideoModalOpen] = useState<boolean>(false); const [videoModalOpen, setVideoModalOpen] = useState<boolean>(false);
const [createModalOpen, setCreateModalOpen] = useState<boolean>(false); const [createModalOpen, setCreateModalOpen] = useState<boolean>(false);
/** /**
* @en-US The pop-up window of the distribution update window * @en-US The pop-up window of the distribution update window
* @zh-CN * @zh-CN
* */ * */
const [updateModalOpen, setUpdateModalOpen] = useState<boolean>(false); const [updateModalOpen, setUpdateModalOpen] = useState<boolean>(false);
const [showDetail, setShowDetail] = useState<boolean>(false); const [showDetail, setShowDetail] = useState<boolean>(false);
/** /**
* @en-US International configuration * @en-US International configuration
* @zh-CN * @zh-CN
* */ * */
const access = useAccess(); const access = useAccess();
const intl = useIntl(); const intl = useIntl();
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
const [currentRow, setCurrentRow] = useState<API.ActionDetection>(); const [currentRow, setCurrentRow] = useState<API.ActionDetection>();
const [selectedRowsState, setSelectedRows] = useState<API.ActionDetection[]>([]); const [selectedRowsState, setSelectedRows] = useState<API.ActionDetection[]>([]);
const handleUpdateModal = ()=>{ const handleUpdateModal = () => {
if (updateModalOpen) { if (updateModalOpen) {
setUpdateModalOpen(false) setUpdateModalOpen(false);
setCurrentRow(undefined) setCurrentRow(undefined);
} else { } else {
setUpdateModalOpen(true) setUpdateModalOpen(true);
} }
} };
const handleVideoModal = ()=>{ const handleVideoModal = () => {
if (videoModalOpen) { if (videoModalOpen) {
setVideoModalOpen(false) setVideoModalOpen(false);
setCurrentRow(undefined) setCurrentRow(undefined);
} else { } else {
setVideoModalOpen(true) setVideoModalOpen(true);
} }
} };
const handleCreateModal = ()=>{ const handleCreateModal = () => {
if (createModalOpen) { if (createModalOpen) {
setCreateModalOpen(false) setCreateModalOpen(false);
setCurrentRow(undefined) setCurrentRow(undefined);
} else { } else {
setCreateModalOpen(true) setCreateModalOpen(true);
} }
} };
const handleColumnDrawer = ()=>{ const handleColumnDrawer = () => {
if (showDetail) { if (showDetail) {
setShowDetail(false) setShowDetail(false);
setCurrentRow(undefined) setCurrentRow(undefined);
} else { } else {
setShowDetail(true) setShowDetail(true);
} }
} };
const handleDestroy = async (selectedRow: API.ActionDetection) => { const handleDestroy = async (selectedRow: API.ActionDetection) => {
// deleteActionDetectionDeleteActionDetection({id: selectedRow.id}).then(()=>{ // deleteActionDetectionDeleteActionDetection({id: selectedRow.id}).then(()=>{
// message.success(intl.formatMessage({id: 'common.success', defaultMessage: '$$$'})) // message.success(intl.formatMessage({id: 'common.success', defaultMessage: '$$$'}))
// actionRef.current?.reload() // actionRef.current?.reload()
// }).catch(()=>{ // }).catch(()=>{
// message.error(intl.formatMessage({id: 'common.failure', defaultMessage: '$$$'})) // message.error(intl.formatMessage({id: 'common.failure', defaultMessage: '$$$'}))
// }) // })
}; };
const columns: ProColumns<API.ActionDetection>[] = [
{ const columns: ProColumns<API.ActionDetection>[] = [
title: (<FormattedMessage {
id="analysis.action_detection.table.list.id" title: <FormattedMessage id="analysis.action_detection.table.list.id" defaultMessage="$$$" />,
defaultMessage="$$$"/>), dataIndex: 'id',
dataIndex: "id", hideInSearch: true,
hideInSearch: true, key: 'fixedName',
}, fixed: 'left',
},
{ {
title: (<FormattedMessage title: (
id="analysis.action_detection.table.list.source" <FormattedMessage id="analysis.action_detection.table.list.source" defaultMessage="$$$" />
defaultMessage="$$$"/>), ),
dataIndex: "source", dataIndex: 'source',
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: (<FormattedMessage title: (
id="analysis.action_detection.table.list.position" <FormattedMessage id="analysis.action_detection.table.list.position" defaultMessage="$$$" />
defaultMessage="$$$"/>), ),
dataIndex: "source", dataIndex: 'source',
hideInSearch: true, hideInSearch: true,
renderText: (text)=>{ renderText: (text) => {
return '工位一' return '工位一';
} },
}, },
{ {
title: (<FormattedMessage title: (
id="analysis.action_detection.table.list.configFile" <FormattedMessage
defaultMessage="$$$"/>), id="analysis.action_detection.table.list.configFile"
dataIndex: "configFile", defaultMessage="$$$"
hideInSearch: true, />
hideInTable: true, ),
dataIndex: 'configFile',
hideInSearch: true,
hideInTable: true,
}, },
{ {
title: (<FormattedMessage title: (
id="analysis.action_detection.table.list.imagesPath" <FormattedMessage
defaultMessage="$$$"/>), id="analysis.action_detection.table.list.imagesPath"
dataIndex: "imagesPath", defaultMessage="$$$"
hideInSearch: true, />
valueType: 'image', ),
dataIndex: 'imagesPath',
renderText: (text)=>{ hideInSearch: true,
let text_temp = text.replace(/^\.\//, "/"); valueType: 'image',
return `${FILE_SERVER_HOST}${text_temp}`
},
render: (_, record)=>{
if (record.imagesPath){
// return <img src={`${FILE_SERVER_HOST}${record.imagesPath.replace(/^\.\//, "/")}`} alt=""/>
return <Image src={`${FILE_SERVER_HOST}${record.imagesPath.replace(/^\.\//, "/")}`} width={200}/>
}
renderText: (text) => {
let text_temp = text.replace(/^\.\//, '/');
return `${FILE_SERVER_HOST}${text_temp}`;
},
render: (_, record) => {
if (record.imagesPath) {
// return <img src={`${FILE_SERVER_HOST}${record.imagesPath.replace(/^\.\//, "/")}`} alt=""/>
return (
<Image
src={`${FILE_SERVER_HOST}${record.imagesPath.replace(/^\.\//, '/')}`}
width={200}
/>
);
} }
},
}, },
{ {
title: (<FormattedMessage title: (
id="analysis.action_detection.table.list.type" <FormattedMessage id="analysis.action_detection.table.list.type" defaultMessage="$$$" />
defaultMessage="$$$"/>), ),
dataIndex: "type", dataIndex: 'type',
hideInSearch: false, hideInSearch: false,
render: (_, record) => ( render: (_, record) => (
<Tag color={'red'}>{intl.formatMessage({id: `error_type.${record.type}`, defaultMessage: '异常'})}</Tag> <Tag color={'red'}>
), {intl.formatMessage({ id: `error_type.${record.type}`, defaultMessage: '异常' })}
valueEnum: { </Tag>
playing_phone: { ),
text: '玩手机', valueEnum: {
status: 'Error', playing_phone: {
}, text: '玩手机',
sleep: { status: 'Error',
text:'睡觉', },
status: 'Success', sleep: {
}, text: '睡觉',
person: { status: 'Success',
text: '离岗',
status: 'Processing',
},
}, },
person: {
text: '离岗',
status: 'Processing',
},
},
}, },
{ {
title: (<FormattedMessage title: (
id="analysis.action_detection.table.list.remark" <FormattedMessage id="analysis.action_detection.table.list.remark" defaultMessage="$$$" />
defaultMessage="$$$"/>), ),
dataIndex: "remark", dataIndex: 'remark',
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: (<FormattedMessage title: (
id="analysis.action_detection.table.list.createTime" <FormattedMessage
defaultMessage="$$$"/>), id="analysis.action_detection.table.list.createTime"
dataIndex: "timestamp", defaultMessage="$$$"
sorter: true, />
hideInSearch: true, ),
valueType: 'dateTime', dataIndex: 'timestamp',
sorter: true,
hideInSearch: true,
valueType: 'dateTime',
}, },
{ {
title: (<FormattedMessage title: (
id="analysis.action_detection.table.list.updateTime" <FormattedMessage
defaultMessage="$$$"/>), id="analysis.action_detection.table.list.updateTime"
dataIndex: "updateTime", defaultMessage="$$$"
sorter: true, />
hideInSearch: true, ),
valueType: 'dateTime', dataIndex: 'updateTime',
sorter: true,
hideInSearch: true,
valueType: 'dateTime',
}, },
{
{ title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />, dataIndex: 'option',
dataIndex: 'option', valueType: 'option',
valueType: 'option', fixed: 'right',
fixed:'right', render: (_, record) => [
render: (_, record) => [ <TableActionCard
<Access accessible={access.canUpdate(history.location.pathname)} key={`${history.location.pathname}-add`}> key="TableActionCardRef"
<a renderActions={[
key="video" // {
onClick={() => { // key: 'detail',
setVideoModalOpen(true); // renderDom: (
setCurrentRow(record); // <Button
}} // key="detail"
> // type="link"
<FormattedMessage id="common.open_video" defaultMessage="$$$" /> // size="small"
</a> // onClick={() => {
</Access> // setCurrentRow(record);
], // doToDetail(record);
},]; // // setShowDetail(true);
return ( // }}
<PageContainer> // >
<ProTable<API.ActionDetection> // <FormattedMessage id="pages.searchTable.detail" defaultMessage="Update" />
headerTitle={intl.formatMessage({ // </Button>
id: 'pages.searchTable.title', // ),
defaultMessage: '$$$', // },
})} {
options={{ fullScreen: true, setting: true, density: true, reload: true }} key: 'video',
actionRef={actionRef} renderDom: (
rowKey="key" <Button
search={{ key="update"
labelWidth: 120, type="link"
}} size="small"
onDataSourceChange={(data)=>{ onClick={() => {
setVideoModalOpen(true);
}} setCurrentRow(record);
pagination={{ }}
// showSizeChanger: true, >
pageSize: 10, <FormattedMessage id="common.open_video" defaultMessage="Update" />
}} </Button>
columnsState={{ ),
persistenceKey: 'action_detection_list', },
persistenceType: 'localStorage' // {
}} // key: 'destroy',
toolBarRender={() => [ // renderDom: (
// <Access accessible={access.canUpdate(history.location.pathname)} key={`${history.location.pathname}-add`}> // <IsDelete
// // deleteApi={() => {
// <Button // handleDestroy(record).then(() => {});
// type="primary" // }}
// key="primary" // ></IsDelete>
// onClick={() => { // ),
// setCreateModalOpen(true); // },
// }} ]}
// > ></TableActionCard>,
// <PlusOutlined /> <FormattedMessage id="pages.searchTable.new" defaultMessage="New" /> ],
// </Button> },
// </Access> ];
]} return (
request={async (params = {}, sort) => { <PageContainer>
const {current, ...rest} = params <ProTable<API.ActionDetection>
headerTitle={intl.formatMessage({
id: 'pages.searchTable.title',
defaultMessage: '$$$',
})}
scroll={{ y: proTableCommonOptions.commscrollY, x: proTableCommonOptions.commscrollX }}
options={{ fullScreen: true, setting: true, density: true, reload: true }}
actionRef={actionRef}
rowKey="key"
search={{
labelWidth: proTableCommonOptions.searchLabelWidth,
}}
onDataSourceChange={(data) => {}}
pagination={{
// showSizeChanger: true,
pageSize: 10,
}}
columnsState={{
persistenceKey: 'action_detection_list',
persistenceType: 'localStorage',
}}
tableAlertOptionRender={() => {
return (
<>
{selectedRowsState?.length > 0 && (
// <IsBatchDelete
// deleteApi={() => {
// deleteAlgorithmModelDeleteAlgorithmModelByIds({
// ids: selectedRowsState.map((v: API.AlgorithmModel) => {
// return v.id as number;
// }),
// }).then(() => {
// actionRef.current?.reloadAndRest?.();
// });
// }}
// />
<>
<FormattedMessage id="pages.searchTable.chosen" defaultMessage="Chosen" />
<a style={{ fontWeight: 600 }}>{selectedRowsState.length}</a>
<FormattedMessage id="pages.searchTable.item" defaultMessage="$$$" />
</>
)}
</>
);
}}
toolBarRender={() => [
// <Access accessible={access.canUpdate(history.location.pathname)} key={`${history.location.pathname}-add`}>
//
// <Button
// type="primary"
// key="primary"
// onClick={() => {
// setCreateModalOpen(true);
// }}
// >
// <PlusOutlined /> <FormattedMessage id="pages.searchTable.new" defaultMessage="New" />
// </Button>
// </Access>
]}
request={async (params = {}, sort) => {
const { current, ...rest } = params;
const reqParams = { const reqParams = {
page: current, page: current,
desc: false, desc: false,
orderKey: "", orderKey: '',
...rest, ...rest,
} };
if (sort && Object.keys(sort).length) { if (sort && Object.keys(sort).length) {
reqParams.orderKey = Object.keys(sort)[0] reqParams.orderKey = Object.keys(sort)[0];
let sort_select = sort[reqParams.orderKey] let sort_select = sort[reqParams.orderKey];
reqParams.desc = sort_select === 'descend'; reqParams.desc = sort_select === 'descend';
} }
let resp = await postActionDetectionGetActionDetectionList({...reqParams}) let resp = await postActionDetectionGetActionDetectionList({ ...reqParams });
return { return {
data: resp.data.list.map((v: API.ActionDetection)=>{ data: resp.data.list.map((v: API.ActionDetection) => {
return {...v, key: v.id} return { ...v, key: v.id };
}), }),
success: resp.success, success: resp.success,
total: resp.data.total, total: resp.data.total,
current: resp.data.page, current: resp.data.page,
pageSize: resp.data.pageSize pageSize: resp.data.pageSize,
}; };
}}
columns={columns}
// rowSelection={{
// onChange: (_, selectedRows) => {
// setSelectedRows(selectedRows);
// },
// }}
/>
{/*<CreateForm*/}
{/* createModalOpen={createModalOpen}*/}
{/* values={currentRow || {}}*/}
{/* handleModal={handleCreateModal}*/}
{/* reload={actionRef.current?.reload}*/}
{/*/>*/}
{/*<UpdateForm*/}
{/* updateModalOpen={updateModalOpen}*/}
{/* values={currentRow || {}}*/}
{/* handleModal={handleUpdateModal}*/}
{/* reload={actionRef.current?.reload}*/}
{/*/>*/}
<VideoModal
modalOpen={videoModalOpen}
handleModal={handleVideoModal}
values={currentRow || {}}
reload={actionRef.current?.reload}
/>
}} {/*<ColumnDrawer*/}
columns={columns} {/* handleDrawer={handleColumnDrawer}*/}
// rowSelection={{ {/* isShowDetail={showDetail}*/}
// onChange: (_, selectedRows) => { {/* columns={columns}*/}
// setSelectedRows(selectedRows); {/* currentRow={currentRow}*/}
// }, {/*/>*/}
// }} </PageContainer>
/> );
{selectedRowsState?.length > 0 && (
<FooterToolbar
extra={
<div>
<FormattedMessage id="pages.searchTable.chosen" defaultMessage="Chosen" />{' '}
<a style={{ fontWeight: 600 }}>{selectedRowsState.length}</a>{' '}
<FormattedMessage id="pages.searchTable.item" defaultMessage="$$$" />
</div>
}
>
{/* <Button*/}
{/* onClick={async () => {*/}
{/* deleteActionDetectionDeleteActionDetectionByIds({ids: selectedRowsState.map((v: API.ActionDetection)=>{return v.id as number})}).then(()=>{*/}
{/* actionRef.current?.reloadAndRest?.();*/}
{/* })*/}
{/* }}*/}
{/*>*/}
{/* <FormattedMessage*/}
{/* id="pages.searchTable.batchDeletion"*/}
{/* defaultMessage="Batch deletion"*/}
{/* />*/}
{/*</Button>*/}
</FooterToolbar>
)}
{/*<CreateForm*/}
{/* createModalOpen={createModalOpen}*/}
{/* values={currentRow || {}}*/}
{/* handleModal={handleCreateModal}*/}
{/* reload={actionRef.current?.reload}*/}
{/*/>*/}
{/*<UpdateForm*/}
{/* updateModalOpen={updateModalOpen}*/}
{/* values={currentRow || {}}*/}
{/* handleModal={handleUpdateModal}*/}
{/* reload={actionRef.current?.reload}*/}
{/*/>*/}
<VideoModal modalOpen={videoModalOpen}
handleModal={handleVideoModal}
values={currentRow || {}}
reload={actionRef.current?.reload}
/>
{/*<ColumnDrawer*/}
{/* handleDrawer={handleColumnDrawer}*/}
{/* isShowDetail={showDetail}*/}
{/* columns={columns}*/}
{/* currentRow={currentRow}*/}
{/*/>*/}
</PageContainer>
);
}; };
export default ActionDetectionList; export default ActionDetectionList;

@ -79,7 +79,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
<FormattedMessage id="device.device_group.table.list.parentFkId" defaultMessage="$$$" /> <FormattedMessage id="device.device_group.table.list.parentFkId" defaultMessage="$$$" />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'device.device_group.table.list.parentFkId', id: 'device.device_group.table.list.parentFkId',
@ -241,14 +241,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
})}`} })}`}
required={false} required={false}
/> />
<ProFormSwitch
width={proFormItemStyleProps.column2Width}
name="isEnable"
label={
<FormattedMessage id="device.device_group.table.list.isEnable" defaultMessage="$$$" />
}
initialValue={true}
/>
<ProFormText <ProFormText
width={proFormItemStyleProps.column2Width} width={proFormItemStyleProps.column2Width}
@ -264,6 +257,14 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
defaultMessage: '$$$', defaultMessage: '$$$',
})}`} })}`}
required={false} required={false}
/>
<ProFormSwitch
width={proFormItemStyleProps.column2Width}
name="isEnable"
label={
<FormattedMessage id="device.device_group.table.list.isEnable" defaultMessage="$$$" />
}
initialValue={true}
/> />
</ProForm.Group> </ProForm.Group>
</ModalForm> </ModalForm>

@ -355,7 +355,7 @@ const DeviceGroupList: React.FC = () => {
}} }}
> >
<PlusOutlined />{' '} <PlusOutlined />{' '}
<FormattedMessage id="pages.searchTable.create_root_menu" defaultMessage="New" /> <FormattedMessage id="device.device_group.table.list.treeAdd" defaultMessage="New" />
</Button> </Button>
</Access>, </Access>,
]} ]}

@ -86,7 +86,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
name="groupFkId" name="groupFkId"
label={<FormattedMessage id="device.device.table.list.groupFkId" defaultMessage="$$$" />} label={<FormattedMessage id="device.device.table.list.groupFkId" defaultMessage="$$$" />}
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'device.device.table.list.groupFkId', id: 'device.device.table.list.groupFkId',
@ -185,7 +185,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
<FormattedMessage id="device.device.table.list.categoryFkId" defaultMessage="$$$" /> <FormattedMessage id="device.device.table.list.categoryFkId" defaultMessage="$$$" />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'device.device.table.list.categoryFkId', id: 'device.device.table.list.categoryFkId',

@ -163,7 +163,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
<FormattedMessage id="device.device.table.list.categoryFkId" defaultMessage="$$$" /> <FormattedMessage id="device.device.table.list.categoryFkId" defaultMessage="$$$" />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'device.device.table.list.categoryFkId', id: 'device.device.table.list.categoryFkId',
@ -190,7 +190,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
name="groupFkId" name="groupFkId"
label={<FormattedMessage id="device.device.table.list.groupFkId" defaultMessage="$$$" />} label={<FormattedMessage id="device.device.table.list.groupFkId" defaultMessage="$$$" />}
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'device.device.table.list.groupFkId', id: 'device.device.table.list.groupFkId',

@ -1,6 +1,7 @@
import IsBatchDelete from '@/components/BatchOperation/isBatchDelete'; import IsBatchDelete from '@/components/BatchOperation/isBatchDelete';
import TableActionCard from '@/components/TableActionCard'; import TableActionCard from '@/components/TableActionCard';
import IsDelete from '@/components/TableActionCard/isDelete'; import IsDelete from '@/components/TableActionCard/isDelete';
import TreeAndTableList, { ProCardTypeProps } from '@/layouts/treeAndTableList';
import { ColumnDrawer as DeviceCategoryColumnDrawer } from '@/pages/Device/DeviceCategoryList/components/ColumnDrawer'; import { ColumnDrawer as DeviceCategoryColumnDrawer } from '@/pages/Device/DeviceCategoryList/components/ColumnDrawer';
import { DeviceCategoryColumns } from '@/pages/Device/DeviceCategoryList/components/Columns'; import { DeviceCategoryColumns } from '@/pages/Device/DeviceCategoryList/components/Columns';
import { ColumnDrawer as DeviceGroupColumnDrawer } from '@/pages/Device/DeviceGroupList/components/ColumnDrawer'; import { ColumnDrawer as DeviceGroupColumnDrawer } from '@/pages/Device/DeviceGroupList/components/ColumnDrawer';
@ -25,13 +26,7 @@ import {
} from '@/services/device/DeviceGroup'; } from '@/services/device/DeviceGroup';
import { PlusOutlined, RedoOutlined } from '@ant-design/icons'; import { PlusOutlined, RedoOutlined } from '@ant-design/icons';
import type { ActionType, ProColumns } from '@ant-design/pro-components'; import type { ActionType, ProColumns } from '@ant-design/pro-components';
import { import { PageContainer, ProFormSelect, ProTable } from '@ant-design/pro-components';
PageContainer,
ProCard,
ProFormSelect,
ProFormText,
ProTable,
} from '@ant-design/pro-components';
import { Access, FormattedMessage, history, useAccess, useIntl } from '@umijs/max'; import { Access, FormattedMessage, history, useAccess, useIntl } from '@umijs/max';
import { Button, Tree, message } from 'antd'; import { Button, Tree, message } from 'antd';
import { DataNode } from 'antd/es/tree'; import { DataNode } from 'antd/es/tree';
@ -215,23 +210,23 @@ const DeviceList: React.FC = () => {
</a> </a>
); );
}, },
renderFormItem: () => { // renderFormItem: () => {
return ( // return (
<> // <>
<ProFormText // <ProFormText
width="md" // width="md"
labelCol={{ span: 4 }} // labelCol={{ span: 4 }}
wrapperCol={{ span: 22 }} // wrapperCol={{ span: 22 }}
name="name" // name="name"
placeholder={`${intl.formatMessage({ // placeholder={`${intl.formatMessage({
id: 'common.please_input', // id: 'common.please_input',
defaultMessage: '$$$', // defaultMessage: '$$$',
})}`} // })}`}
required={false} // required={false}
/> // />
</> // </>
); // );
}, // },
key: 'fixedName', key: 'fixedName',
fixed: 'left', fixed: 'left',
}, },
@ -297,9 +292,6 @@ const DeviceList: React.FC = () => {
return ( return (
// value 和 onchange 会通过 form 自动注入。 // value 和 onchange 会通过 form 自动注入。
<ProFormSelect <ProFormSelect
width="md"
labelCol={{ span: 4 }}
wrapperCol={{ span: 22 }}
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_select', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
@ -354,9 +346,6 @@ const DeviceList: React.FC = () => {
return ( return (
// value 和 onchange 会通过 form 自动注入。 // value 和 onchange 会通过 form 自动注入。
<ProFormSelect <ProFormSelect
width="md"
labelCol={{ span: 4 }}
wrapperCol={{ span: 22 }}
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_select', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
@ -416,7 +405,6 @@ const DeviceList: React.FC = () => {
dataIndex: 'option', dataIndex: 'option',
valueType: 'option', valueType: 'option',
fixed: 'right', fixed: 'right',
width: 160,
render: (_, record) => [ render: (_, record) => [
<TableActionCard <TableActionCard
key="TableActionCardRef" key="TableActionCardRef"
@ -493,33 +481,27 @@ const DeviceList: React.FC = () => {
]; ];
return ( return (
<PageContainer> <PageContainer>
<ProCard <TreeAndTableList
style={{ display: 'flex', width: '100%', background: 'transparent' }} leftCard={
bodyStyle={{ {
padding:0, title: '网点选择',
margin:0, extra: (
display: 'flex', <>
justifyContent: 'space-between', <Button
}} icon={<RedoOutlined />}
> onClick={() => {
{/* bodyStyle={{padding: 0, margin: 0}} */} setSelectNodes([]);
<ProCard actionRef.current?.reload();
headStyle={{ paddingTop: 24, paddingLeft: 20, paddingRight: 20 }} }}
title="网点选择" >
colSpan="22%"
extra={ </Button>
<Button </>
icon={<RedoOutlined />} ),
onClick={() => { } as ProCardTypeProps
setSelectNodes([]); }
actionRef.current?.reload(); leftDom={
}} hasInit && (
>
</Button>
}
>
{hasInit && (
<Tree <Tree
checkable={false} checkable={false}
defaultExpandAll={true} defaultExpandAll={true}
@ -531,14 +513,9 @@ const DeviceList: React.FC = () => {
}} }}
checkStrictly={false} checkStrictly={false}
/> />
)} )
</ProCard> }
<ProCard rightDom={
colSpan="76.5%"
style={{ padding: 0, margin: 0, background: 'transparent' }}
bodyStyle={{ padding: 0, margin: 0 }}
headerBordered
>
<ProTable<API.Device> <ProTable<API.Device>
headerTitle={intl.formatMessage({ headerTitle={intl.formatMessage({
id: 'pages.searchTable.title', id: 'pages.searchTable.title',
@ -682,8 +659,8 @@ const DeviceList: React.FC = () => {
}, },
}} }}
/> />
</ProCard> }
</ProCard> ></TreeAndTableList>
<CreateForm <CreateForm
createModalOpen={createModalOpen} createModalOpen={createModalOpen}
values={currentRow || {}} values={currentRow || {}}

@ -1,75 +1,115 @@
import {ModalForm,ProForm} from '@ant-design/pro-components';import {ProFormSelect} from '@ant-design/pro-components'; import { postDeviceGetDeviceFkSelect } from '@/services/device/Device';
import {FormattedMessage, useIntl} from '@umijs/max'; import { postDeviceRelationCreateDeviceRelation } from '@/services/device/DeviceRelation';
import {postDeviceGetDeviceFkSelect} from "@/services/device/Device"; import { ModalForm, ProForm, ProFormSelect } from '@ant-design/pro-components';
import {postDeviceRelationCreateDeviceRelation} from "@/services/device/DeviceRelation"; import { FormattedMessage, useIntl } from '@umijs/max';
import React, {useState} from 'react'; import { Form, message } from 'antd';
import {Button, Form, message} from 'antd'; import React from 'react';
export type FormValueType = { export type FormValueType = {
target?: string; target?: string;
template?: string; template?: string;
type?: string; type?: string;
time?: string; time?: string;
frequency?: string; frequency?: string;
} & Partial<API.DeviceRelation>; } & Partial<API.DeviceRelation>;
export type CreateFormProps = { export type CreateFormProps = {
createModalOpen: boolean; createModalOpen: boolean;
handleModal: ()=>void; handleModal: () => void;
values: Partial<API.DeviceRelation>; values: Partial<API.DeviceRelation>;
reload: any; reload: any;
}; };
const CreateForm: React.FC<CreateFormProps> = (props) => { const CreateForm: React.FC<CreateFormProps> = (props) => {
const intl = useIntl();
const [form] = Form.useForm<API.DeviceRelation>();
const intl = useIntl(); return (
const [form] = Form.useForm<API.DeviceRelation>(); <ModalForm<API.DeviceRelation>
title={intl.formatMessage({
return ( id: 'common.modal.table.create.title',
<ModalForm<API.DeviceRelation> defaultMessage: '$$$',
title={intl.formatMessage({ })}
id: 'common.modal.table.create.title', open={props.createModalOpen}
defaultMessage: '$$$', form={form}
})} autoFocusFirstInput
open={props.createModalOpen} modalProps={{
form={form} destroyOnClose: true,
autoFocusFirstInput onCancel: () => props.handleModal(),
modalProps={{ }}
destroyOnClose: true, submitTimeout={2000}
onCancel: () => props.handleModal(), onFinish={async (values) => {
}} postDeviceRelationCreateDeviceRelation(values)
submitTimeout={2000} .then(() => {
onFinish={async (values) => { message.success(intl.formatMessage({ id: 'common.success', defaultMessage: '$$$' }));
postDeviceRelationCreateDeviceRelation(values).then(()=>{ props.reload();
message.success(intl.formatMessage({id: 'common.success', defaultMessage: '$$$'})) })
props.reload() .catch(() => {
}).catch(()=>{ message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '$$$' }));
message.error(intl.formatMessage({id: 'common.failure', defaultMessage: '$$$'})) });
})
props.handleModal(); props.handleModal();
return true; return true;
}} }}
> >
<ProForm.Group>
<ProForm.Group> <ProFormSelect
<ProFormSelect width="md" name="deviceParentFkId" label={<FormattedMessage id="device.device_relation.table.list.deviceParentFkId" defaultMessage="$$$"/>} placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'device.device_relation.table.list.deviceParentFkId', defaultMessage: '$$$'})}`} required={true} showSearch debounceTime={1000} request={async (keyWord)=>{ width="md"
const resp = await postDeviceGetDeviceFkSelect({keyword: keyWord?.keyWords || ''}) name="deviceParentFkId"
return resp.data.list.map((v: any)=>{ label={
return { <FormattedMessage
label: v.name, id="device.device_relation.table.list.deviceParentFkId"
value: v.id defaultMessage="$$$"
} />
}) }
} placeholder={`${intl.formatMessage({
}/> id: 'common.please_select',
<ProFormSelect width="md" name="deviceSonFkId" label={<FormattedMessage id="device.device_relation.table.list.deviceSonFkId" defaultMessage="$$$"/>} placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'device.device_relation.table.list.deviceSonFkId', defaultMessage: '$$$'})}`} required={true} showSearch debounceTime={1000} request={async (keyWord)=>{ defaultMessage: '$$$',
const resp = await postDeviceGetDeviceFkSelect({keyword: keyWord?.keyWords || ''}) })}${intl.formatMessage({
return resp.data.list.map((v: any)=>{ id: 'device.device_relation.table.list.deviceParentFkId',
return { defaultMessage: '$$$',
label: v.name, })}`}
value: v.id required={true}
} showSearch
}) debounceTime={1000}
} request={async (keyWord) => {
}/> const resp = await postDeviceGetDeviceFkSelect({ keyword: keyWord?.keyWords || '' });
</ProForm.Group> return resp.data.list.map((v: any) => {
</ModalForm>)} return {
label: v.name,
value: v.id,
};
});
}}
/>
<ProFormSelect
width="md"
name="deviceSonFkId"
label={
<FormattedMessage
id="device.device_relation.table.list.deviceSonFkId"
defaultMessage="$$$"
/>
}
placeholder={`${intl.formatMessage({
id: 'common.please_select',
defaultMessage: '$$$',
})}${intl.formatMessage({
id: 'device.device_relation.table.list.deviceSonFkId',
defaultMessage: '$$$',
})}`}
required={true}
showSearch
debounceTime={1000}
request={async (keyWord) => {
const resp = await postDeviceGetDeviceFkSelect({ keyword: keyWord?.keyWords || '' });
return resp.data.list.map((v: any) => {
return {
label: v.name,
value: v.id,
};
});
}}
/>
</ProForm.Group>
</ModalForm>
);
};
export default CreateForm; export default CreateForm;

@ -1,25 +1,29 @@
import {ModalForm,ProForm} from '@ant-design/pro-components';import {ProFormSelect} from '@ant-design/pro-components';import {ProFormDateTimePicker} from '@ant-design/pro-components'; import { postDeviceGetDeviceFkSelect } from '@/services/device/Device';
import {FormattedMessage, useIntl} from '@umijs/max'; import { putDeviceRelationUpdateDeviceRelation } from '@/services/device/DeviceRelation';
import {postDeviceGetDeviceFkSelect} from "@/services/device/Device"; import {
import {putDeviceRelationUpdateDeviceRelation} from "@/services/device/DeviceRelation"; ModalForm,
import React, {useState} from 'react'; ProForm,
import {Button, Form, message} from 'antd'; ProFormDateTimePicker,
ProFormSelect,
} from '@ant-design/pro-components';
import { FormattedMessage, useIntl } from '@umijs/max';
import { Form, message } from 'antd';
import React from 'react';
export type FormValueType = { export type FormValueType = {
target?: string; target?: string;
template?: string; template?: string;
type?: string; type?: string;
time?: string; time?: string;
frequency?: string; frequency?: string;
} & Partial<API.DeviceRelation>; } & Partial<API.DeviceRelation>;
export type UpdateFormProps = { export type UpdateFormProps = {
updateModalOpen: boolean; updateModalOpen: boolean;
handleModal: () => void; handleModal: () => void;
values: Partial<API.DeviceRelation>; values: Partial<API.DeviceRelation>;
reload: any; reload: any;
}; };
const UpdateForm: React.FC<UpdateFormProps> = (props) => { const UpdateForm: React.FC<UpdateFormProps> = (props) => {
const intl = useIntl(); const intl = useIntl();
const [form] = Form.useForm<API.DeviceRelation>(); const [form] = Form.useForm<API.DeviceRelation>();
@ -38,42 +42,129 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
}} }}
submitTimeout={2000} submitTimeout={2000}
onFinish={async (values) => { onFinish={async (values) => {
putDeviceRelationUpdateDeviceRelation(values).then(()=>{ putDeviceRelationUpdateDeviceRelation(values)
message.success(intl.formatMessage({id: 'common.success', defaultMessage: '$$$'})) .then(() => {
props.reload() message.success(intl.formatMessage({ id: 'common.success', defaultMessage: '$$$' }));
}).catch(()=>{ props.reload();
message.error(intl.formatMessage({id: 'common.failure', defaultMessage: '$$$'})) })
}) .catch(() => {
message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '$$$' }));
});
props.handleModal(); props.handleModal();
return true; return true;
}} }}
> >
<ProForm.Group>
<ProForm.Group> <ProFormText
<ProFormText width="md" name="id" label="id" disabled={true} initialValue={props.values.id}/> width="md"
<ProFormSelect width="md" name="deviceParentFkId" label={<FormattedMessage id="device.device_relation.table.list.deviceParentFkId" defaultMessage="$$$"/>} placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'device.device_relation.table.list.deviceParentFkId', defaultMessage: '$$$'})}`} required={true} initialValue={props.values.deviceParentFkId} showSearch debounceTime={1000} request={async (keyWord)=>{ name="id"
const resp = await postDeviceGetDeviceFkSelect({keyword: keyWord?.keyWords || ''}) label="id"
return resp.data.list.map((v: any)=>{ disabled={true}
return { initialValue={props.values.id}
label: v.name, />
value: v.id <ProFormSelect
} width="md"
}) name="deviceParentFkId"
} label={
}/> <FormattedMessage
<ProFormSelect width="md" name="deviceSonFkId" label={<FormattedMessage id="device.device_relation.table.list.deviceSonFkId" defaultMessage="$$$"/>} placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'device.device_relation.table.list.deviceSonFkId', defaultMessage: '$$$'})}`} required={true} initialValue={props.values.deviceSonFkId} showSearch debounceTime={1000} request={async (keyWord)=>{ id="device.device_relation.table.list.deviceParentFkId"
const resp = await postDeviceGetDeviceFkSelect({keyword: keyWord?.keyWords || ''}) defaultMessage="$$$"
return resp.data.list.map((v: any)=>{ />
return { }
label: v.name, placeholder={`${intl.formatMessage({
value: v.id id: 'common.please_select',
} defaultMessage: '$$$',
}) })}${intl.formatMessage({
} id: 'device.device_relation.table.list.deviceParentFkId',
}/> defaultMessage: '$$$',
<ProFormDateTimePicker width="md" name="createTime" label={<FormattedMessage id="device.device_relation.table.list.createTime" defaultMessage="$$$"/>} placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'device.device_relation.table.list.createTime', defaultMessage: '$$$'})}`} required={false} initialValue={props.values.createTime} disabled={true}/> })}`}
<ProFormDateTimePicker width="md" name="updateTime" label={<FormattedMessage id="device.device_relation.table.list.updateTime" defaultMessage="$$$"/>} placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'device.device_relation.table.list.updateTime', defaultMessage: '$$$'})}`} required={false} initialValue={props.values.updateTime} disabled={true}/> required={true}
</ProForm.Group> initialValue={props.values.deviceParentFkId}
</ModalForm>)} showSearch
debounceTime={1000}
request={async (keyWord) => {
const resp = await postDeviceGetDeviceFkSelect({ keyword: keyWord?.keyWords || '' });
return resp.data.list.map((v: any) => {
return {
label: v.name,
value: v.id,
};
});
}}
/>
<ProFormSelect
width="md"
name="deviceSonFkId"
label={
<FormattedMessage
id="device.device_relation.table.list.deviceSonFkId"
defaultMessage="$$$"
/>
}
placeholder={`${intl.formatMessage({
id: 'common.please_select',
defaultMessage: '$$$',
})}${intl.formatMessage({
id: 'device.device_relation.table.list.deviceSonFkId',
defaultMessage: '$$$',
})}`}
required={true}
initialValue={props.values.deviceSonFkId}
showSearch
debounceTime={1000}
request={async (keyWord) => {
const resp = await postDeviceGetDeviceFkSelect({ keyword: keyWord?.keyWords || '' });
return resp.data.list.map((v: any) => {
return {
label: v.name,
value: v.id,
};
});
}}
/>
<ProFormDateTimePicker
width="md"
name="createTime"
label={
<FormattedMessage
id="device.device_relation.table.list.createTime"
defaultMessage="$$$"
/>
}
placeholder={`${intl.formatMessage({
id: 'common.please_input',
defaultMessage: '$$$',
})}${intl.formatMessage({
id: 'device.device_relation.table.list.createTime',
defaultMessage: '$$$',
})}`}
required={false}
initialValue={props.values.createTime}
disabled={true}
/>
<ProFormDateTimePicker
width="md"
name="updateTime"
label={
<FormattedMessage
id="device.device_relation.table.list.updateTime"
defaultMessage="$$$"
/>
}
placeholder={`${intl.formatMessage({
id: 'common.please_input',
defaultMessage: '$$$',
})}${intl.formatMessage({
id: 'device.device_relation.table.list.updateTime',
defaultMessage: '$$$',
})}`}
required={false}
initialValue={props.values.updateTime}
disabled={true}
/>
</ProForm.Group>
</ModalForm>
);
};
export default UpdateForm; export default UpdateForm;

@ -23,7 +23,7 @@ import { FormListActionType } from '@ant-design/pro-form/lib';
import yaml from 'js-yaml'; import yaml from 'js-yaml';
// @ts-ignore // @ts-ignore
import cookie from 'react-cookies'; import cookie from 'react-cookies';
import { proFormItemStyleProps, proFormListCreatorButtonProps, proFormModelWidth, proFormSmallModelWidth } from '../../../../../config/defaultForm'; import { proFormItemStyleProps, proFormListCreatorButtonProps, proFormModelWidth, proFormSmallModelWidth, proFormStepsFormProps } from '../../../../../config/defaultForm';
interface RecordType { interface RecordType {
key: string; key: string;
@ -148,9 +148,7 @@ const MyCreateForm: React.FC<CreateFormProps> = (props) => {
<StepsForm<{ <StepsForm<{
name: string; name: string;
}> }>
stepsProps={{ stepsProps={proFormStepsFormProps.stepsProps}
labelPlacement: 'vertical',
}}
current={current} current={current}
onCurrentChange={setCurrent} onCurrentChange={setCurrent}
onFinish={async () => { onFinish={async () => {

@ -2,7 +2,7 @@
* @Author: zhoux zhouxia@supervision.ltd * @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-01 13:56:33 * @Date: 2023-11-01 13:56:33
* @LastEditors: zhoux zhouxia@supervision.ltd * @LastEditors: zhoux zhouxia@supervision.ltd
* @LastEditTime: 2023-11-15 16:35:04 * @LastEditTime: 2023-11-22 13:21:41
* @FilePath: \general-ai-platform-web\src\pages\Resource\AlgorithmModelList\components\CreateForm.tsx * @FilePath: \general-ai-platform-web\src\pages\Resource\AlgorithmModelList\components\CreateForm.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -96,7 +96,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
/> />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'resource.algorithm_model.table.list.categoryFkId', id: 'resource.algorithm_model.table.list.categoryFkId',

@ -105,7 +105,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
/> />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'resource.algorithm_model.table.list.categoryFkId', id: 'resource.algorithm_model.table.list.categoryFkId',

@ -117,7 +117,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
/> />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'resource.business_image.table.list.projectFkId', id: 'resource.business_image.table.list.projectFkId',

@ -2,7 +2,7 @@
* @Author: zhoux zhouxia@supervision.ltd * @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-01 13:56:33 * @Date: 2023-11-01 13:56:33
* @LastEditors: zhoux zhouxia@supervision.ltd * @LastEditors: zhoux zhouxia@supervision.ltd
* @LastEditTime: 2023-11-14 14:50:08 * @LastEditTime: 2023-11-22 13:27:07
* @FilePath: \general-ai-platform-web\src\pages\Resource\BusinessImageList\components\UpdateForm.tsx * @FilePath: \general-ai-platform-web\src\pages\Resource\BusinessImageList\components\UpdateForm.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -143,7 +143,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
/> />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'resource.business_image.table.list.projectFkId', id: 'resource.business_image.table.list.projectFkId',

@ -31,7 +31,15 @@ const ColumnDrawer: React.FC<ColumnDrawProps> = (props) => {
params={{ params={{
id: props.currentRow?.id, id: props.currentRow?.id,
}} }}
columns={props.columns as ProDescriptionsItemProps<API.ModelImage>[]} columns={props.columns.filter((item)=>{
// update 对原内容项重写
if(item.dataIndex === 'name'){
item.render = (dom) => {
return (<a>{dom}</a>)
}
}
return item
}) as ProDescriptionsItemProps<API.ModelImage>[]}
/> />
)} )}
</Drawer> </Drawer>

@ -88,7 +88,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
/> />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'resource.model_image.table.list.modelVersionFkId', id: 'resource.model_image.table.list.modelVersionFkId',

@ -104,7 +104,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
/> />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'resource.model_image.table.list.modelVersionFkId', id: 'resource.model_image.table.list.modelVersionFkId',

@ -122,11 +122,6 @@ const ModelImageList: React.FC = () => {
hideInSearch: true, hideInSearch: true,
key: 'fixedName', key: 'fixedName',
fixed: 'left', fixed: 'left',
},
{
title: <FormattedMessage id="resource.model_image.table.list.id" defaultMessage="id" />,
dataIndex: 'id',
sorter: true,
render: (dom, entity) => { render: (dom, entity) => {
return ( return (
<a <a
@ -138,8 +133,15 @@ const ModelImageList: React.FC = () => {
{dom} {dom}
</a> </a>
); );
}, }
}, },
// {
// title: <FormattedMessage id="resource.model_image.table.list.id" defaultMessage="id" />,
// dataIndex: 'id',
// sorter: true,
// },
// },
{ {
title: ( title: (

@ -2,7 +2,7 @@
* @Author: zhoux zhouxia@supervision.ltd * @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-01 13:56:33 * @Date: 2023-11-01 13:56:33
* @LastEditors: zhoux zhouxia@supervision.ltd * @LastEditors: zhoux zhouxia@supervision.ltd
* @LastEditTime: 2023-11-15 17:23:44 * @LastEditTime: 2023-11-22 13:50:07
* @FilePath: \general-ai-platform-web\src\pages\Resource\ModelVersionList\components\CreateForm.tsx * @FilePath: \general-ai-platform-web\src\pages\Resource\ModelVersionList\components\CreateForm.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -76,7 +76,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
/> />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'resource.model_version.table.list.modelFkId', id: 'resource.model_version.table.list.modelFkId',

@ -2,7 +2,7 @@
* @Author: zhoux zhouxia@supervision.ltd * @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-01 13:56:33 * @Date: 2023-11-01 13:56:33
* @LastEditors: zhoux zhouxia@supervision.ltd * @LastEditors: zhoux zhouxia@supervision.ltd
* @LastEditTime: 2023-11-17 13:16:24 * @LastEditTime: 2023-11-22 13:50:12
* @FilePath: \general-ai-platform-web\src\pages\Resource\ModelVersionList\components\MyCreateForm.tsx * @FilePath: \general-ai-platform-web\src\pages\Resource\ModelVersionList\components\MyCreateForm.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -23,7 +23,11 @@ import { FormattedMessage, useIntl } from '@umijs/max';
import { Form, Modal, UploadFile, message } from 'antd'; import { Form, Modal, UploadFile, message } from 'antd';
import yaml from 'js-yaml'; import yaml from 'js-yaml';
import React, { useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
import { proFormMaxItemStyleProps, proFormMaxModelWidth } from '../../../../../config/defaultForm'; import {
proFormMaxItemStyleProps,
proFormMaxModelWidth,
proFormStepsFormProps,
} from '../../../../../config/defaultForm';
export type FormValueType = { export type FormValueType = {
target?: string; target?: string;
@ -85,7 +89,7 @@ const MyCreateForm: React.FC<MyCreateFormProps> = (props) => {
<StepsForm<{ <StepsForm<{
name: string; name: string;
}> }>
stepsProps={{}} stepsProps={proFormStepsFormProps.stepsProps}
current={current} current={current}
onCurrentChange={setCurrent} onCurrentChange={setCurrent}
formProps={{ formProps={{
@ -120,9 +124,9 @@ const MyCreateForm: React.FC<MyCreateFormProps> = (props) => {
}> }>
name="base" name="base"
formRef={formRef} formRef={formRef}
title="创建模型版本数据" title="创建数据"
stepProps={{ stepProps={{
description: '填入模型版本基本信息', description: '填入基本信息',
}} }}
onFinish={async () => { onFinish={async () => {
// setFormData(formRef.current?.getFieldsValue()); // setFormData(formRef.current?.getFieldsValue());
@ -141,7 +145,7 @@ const MyCreateForm: React.FC<MyCreateFormProps> = (props) => {
/> />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'resource.model_version.table.list.modelFkId', id: 'resource.model_version.table.list.modelFkId',
@ -289,7 +293,7 @@ const MyCreateForm: React.FC<MyCreateFormProps> = (props) => {
<ProFormUploadDragger <ProFormUploadDragger
width={proFormMaxItemStyleProps.width} width={proFormMaxItemStyleProps.width}
max={1} max={1}
label={<span className='h3 gn'></span>} label={<span className="h3 gn"></span>}
value={fileList} value={fileList}
name="dragger" name="dragger"
fieldProps={{ fieldProps={{
@ -341,10 +345,10 @@ const MyCreateForm: React.FC<MyCreateFormProps> = (props) => {
{/* // TODO label字重与上面统一, 操作按钮需要与输入框对齐 */} {/* // TODO label字重与上面统一, 操作按钮需要与输入框对齐 */}
<ProFormList <ProFormList
name="params" name="params"
label= {<span className='h3 gn'></span>} label={<span className="h3 gn"></span>}
actionRef={actionFormListRef} actionRef={actionFormListRef}
itemContainerRender={(doms) => { itemContainerRender={(doms) => {
return <ProForm.Group >{doms}</ProForm.Group>; return <ProForm.Group>{doms}</ProForm.Group>;
}} }}
alwaysShowItemLabel alwaysShowItemLabel
> >

@ -77,7 +77,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
/> />
} }
placeholder={`${intl.formatMessage({ placeholder={`${intl.formatMessage({
id: 'common.please_input', id: 'common.please_select',
defaultMessage: '$$$', defaultMessage: '$$$',
})}${intl.formatMessage({ })}${intl.formatMessage({
id: 'resource.model_version.table.list.modelFkId', id: 'resource.model_version.table.list.modelFkId',

@ -3,10 +3,10 @@ import {
postDeviceGroupGetDeviceGroupTree, postDeviceGroupGetDeviceGroupTree,
} from '@/services/device/DeviceGroup'; } from '@/services/device/DeviceGroup';
import TreeAndTableList, { ProCardTypeProps } from '@/layouts/treeAndTableList';
import { postProjectGetProjectByGroupId } from '@/services/project/Project'; import { postProjectGetProjectByGroupId } from '@/services/project/Project';
import { postModelVersionGetModelVersionListByIds } from '@/services/resource/ModelVersion'; import { postModelVersionGetModelVersionListByIds } from '@/services/resource/ModelVersion';
import { FormattedMessage } from '@@/exports'; import { FormattedMessage } from '@@/exports';
import { RedoOutlined } from '@ant-design/icons';
import type { ActionType } from '@ant-design/pro-components'; import type { ActionType } from '@ant-design/pro-components';
import { import {
PageContainer, PageContainer,
@ -63,7 +63,7 @@ const AlgorithmSetting: React.FC = () => {
const [tab, setTab] = useState<string>(''); const [tab, setTab] = useState<string>('');
const columns1: ProColumns<API.DeviceGroup>[] = [ const columns1: ProColumns<API.DeviceGroup>[] = [
{ {
title: <FormattedMessage id="device.device_group.table.list.name" defaultMessage="$$$" />, title: '全选',
dataIndex: 'name', dataIndex: 'name',
hideInSearch: true, hideInSearch: true,
}, },
@ -307,30 +307,26 @@ const AlgorithmSetting: React.FC = () => {
return ( return (
<PageContainer> <PageContainer>
<ProCard split="vertical"> <TreeAndTableList
<ProCard leftCard={
title="网点选择" {
colSpan="24%" title: '网点选择',
bodyStyle={{ padding: 0, margin: 0 }} } as ProCardTypeProps
extra={ }
<Button leftDom={
icon={<RedoOutlined />}
onClick={() => {
setSelectNodes([]);
actionRef.current?.reload();
}}
>
</Button>
}
>
<ProTable<API.DeviceGroup> <ProTable<API.DeviceGroup>
// headerTitle={intl.formatMessage({ // headerTitle={intl.formatMessage({
// id: 'pages.searchTable.title', // id: 'pages.searchTable.title',
// defaultMessage: '$$$', // defaultMessage: '$$$',
// })} // })}
cardProps={{
bodyStyle: {
padding: 0,
margin: 0,
},
}}
options={{ options={{
search: true, // TODO 1113 搜索需要对接比对UI调整交互 search: false, // TODO 1113 搜索需要对接比对UI调整交互
fullScreen: false, fullScreen: false,
setting: false, setting: false,
density: false, density: false,
@ -385,35 +381,43 @@ const AlgorithmSetting: React.FC = () => {
}; };
}} }}
columns={columns1} columns={columns1}
rowSelection={{ rowSelection={
// onChange: (_, selectedRows) => { {
// // setSelectedRows(selectedRows); // onChange: (_, selectedRows) => {
// }, // // setSelectedRows(selectedRows);
}} // },
}
}
/> />
</ProCard> }
<ProCard title="" headerBordered split={'horizontal'}> rightDom={
<ProCard colSpan="80%"> <>
<ProDescriptions <ProCard bodyStyle={{ paddingTop: 24 }} colSpan="80%">
column={4} <ProDescriptions
dataSource={currentRow} column={3}
title="网点详细信息" dataSource={currentRow}
tooltip="包含了从服务器请求columns等功能" title="网点详细信息"
columns={columns} tooltip="包含了从服务器请求columns等功能"
></ProDescriptions> columns={columns}
</ProCard> ></ProDescriptions>
<ProCard </ProCard>
wrap <ProCard
tabs={{ wrap
activeKey: tab, tabs={{
items: tabs, activeKey: tab,
onChange: (key) => { items: tabs,
changeProjectTab(key); onChange: (key) => {
}, changeProjectTab(key);
}} },
></ProCard> }}
</ProCard> ></ProCard>
</ProCard> </>
}
></TreeAndTableList>
{/* <ProCard split="vertical">
<ProCard title="网点选择" colSpan="24%" bodyStyle={{ padding: 0, margin: 0 }}></ProCard>
<ProCard title="" headerBordered split={'horizontal'}></ProCard>
</ProCard> */}
<UpdateForm <UpdateForm
updateModalOpen={updateModalOpen} updateModalOpen={updateModalOpen}
handleModal={handleUpdateModal} handleModal={handleUpdateModal}

@ -14,7 +14,7 @@ const ColumnDrawer: React.FC<ColumnDrawProps> = (props) => {
return ( return (
<Drawer <Drawer
width={600} width={500}
open={props.isShowDetail} open={props.isShowDetail}
onClose={() => { onClose={() => {
props.handleDrawer(); props.handleDrawer();

@ -64,7 +64,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
/> />
<ProFormSelect width={proFormItemStyleProps.column2Width} name="method" <ProFormSelect width={proFormItemStyleProps.column2Width} name="method"
label={<FormattedMessage id="system.api.table.list.method" defaultMessage="$$$"/>} label={<FormattedMessage id="system.api.table.list.method" defaultMessage="$$$"/>}
placeholder="请输入请求方式" required={false} initialValue="GET" valueEnum={{ placeholder="请选择请求方式" required={false} initialValue="GET" valueEnum={{
'GET': intl.formatMessage({id: 'system.api.enum.GET', defaultMessage: '$$$',}), 'GET': intl.formatMessage({id: 'system.api.enum.GET', defaultMessage: '$$$',}),
'POST': intl.formatMessage({id: 'system.api.enum.POST', defaultMessage: '$$$',}), 'POST': intl.formatMessage({id: 'system.api.enum.POST', defaultMessage: '$$$',}),
'DELETE': intl.formatMessage({id: 'system.api.enum.DELETE', defaultMessage: '$$$',}), 'DELETE': intl.formatMessage({id: 'system.api.enum.DELETE', defaultMessage: '$$$',}),

@ -1,3 +1,11 @@
/*
* @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-01 13:56:33
* @LastEditors: zhoux zhouxia@supervision.ltd
* @LastEditTime: 2023-11-22 13:51:06
* @FilePath: \general-ai-platform-web\src\pages\System\ApiList\components\UpdateForm.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import {ModalForm, ProForm} from '@ant-design/pro-components'; import {ModalForm, ProForm} from '@ant-design/pro-components';
import {ProFormText} from '@ant-design/pro-components'; import {ProFormText} from '@ant-design/pro-components';
import {ProFormSelect} from '@ant-design/pro-components'; import {ProFormSelect} from '@ant-design/pro-components';
@ -66,7 +74,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
/> />
<ProFormSelect width={proFormItemStyleProps.column2Width} name="method" <ProFormSelect width={proFormItemStyleProps.column2Width} name="method"
label={<FormattedMessage id="system.api.table.list.method" defaultMessage="$$$"/>} label={<FormattedMessage id="system.api.table.list.method" defaultMessage="$$$"/>}
placeholder="请输入请求方式" required={false} initialValue={props.values.method} valueEnum={{ placeholder="请选择请求方式" required={false} initialValue={props.values.method} valueEnum={{
'GET': intl.formatMessage({id: 'system.api.enum.GET', defaultMessage: '$$$',}), 'GET': intl.formatMessage({id: 'system.api.enum.GET', defaultMessage: '$$$',}),
'POST': intl.formatMessage({id: 'system.api.enum.POST', defaultMessage: '$$$',}), 'POST': intl.formatMessage({id: 'system.api.enum.POST', defaultMessage: '$$$',}),
'DELETE': intl.formatMessage({id: 'system.api.enum.DELETE', defaultMessage: '$$$',}), 'DELETE': intl.formatMessage({id: 'system.api.enum.DELETE', defaultMessage: '$$$',}),

@ -14,7 +14,7 @@ const ColumnDrawer: React.FC<ColumnDrawProps> = (props) => {
return ( return (
<Drawer <Drawer
width={600} width={500}
open={props.isShowDetail} open={props.isShowDetail}
onClose={() => { onClose={() => {
props.handleDrawer(); props.handleDrawer();

@ -77,7 +77,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
options={parentSelectOptions} options={parentSelectOptions}
request={async () => parentSelectOptions} request={async () => parentSelectOptions}
label={<FormattedMessage id="system.department.table.list.parentId" defaultMessage="$$$"/>} label={<FormattedMessage id="system.department.table.list.parentId" defaultMessage="$$$"/>}
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.department.table.list.parentId', defaultMessage: '$$$'})}`} placeholder={`${intl.formatMessage({id: 'common.please_select', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.department.table.list.parentId', defaultMessage: '$$$'})}`}
/> />
<ProFormDigit width={proFormItemStyleProps.column2Width} fieldProps={{precision: 0}} name="sort" <ProFormDigit width={proFormItemStyleProps.column2Width} fieldProps={{precision: 0}} name="sort"
label={<FormattedMessage id="system.department.table.list.sort" defaultMessage="$$$"/>} label={<FormattedMessage id="system.department.table.list.sort" defaultMessage="$$$"/>}

@ -65,7 +65,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
initialValue={parentId} initialValue={parentId}
request={async () => parentSelectOptions} request={async () => parentSelectOptions}
label={<FormattedMessage id="system.department.table.list.parentId" defaultMessage="$$$"/>} label={<FormattedMessage id="system.department.table.list.parentId" defaultMessage="$$$"/>}
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.department.table.list.parentId', defaultMessage: '$$$'})}`} placeholder={`${intl.formatMessage({id: 'common.please_select', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.department.table.list.parentId', defaultMessage: '$$$'})}`}
/> />
</ProForm.Group> </ProForm.Group>

@ -14,7 +14,7 @@ const ColumnDrawer: React.FC<ColumnDrawProps> = (props) => {
return ( return (
<Drawer <Drawer
width={600} width={500}
open={props.isShowDetail} open={props.isShowDetail}
onClose={() => { onClose={() => {
props.handleDrawer(); props.handleDrawer();

@ -15,7 +15,7 @@ const ColumnDrawer: React.FC<ColumnDrawProps> = (props) => {
return ( return (
<Drawer <Drawer
width={600} width={500}
open={props.isShowDetail} open={props.isShowDetail}
onClose={() => { onClose={() => {
props.setCurrentRow(undefined); props.setCurrentRow(undefined);

@ -1,14 +1,20 @@
import {ModalForm, ProForm, ProFormDependency} from '@ant-design/pro-components'; import { postMenuCreateMenu } from '@/services/system/Menu';
import {ProFormText} from '@ant-design/pro-components'; import {
import {ProFormSwitch} from '@ant-design/pro-components'; ModalForm,
import {ProFormSelect, ProFormDigit, ProFormRadio} from '@ant-design/pro-components'; ProForm,
import {FormattedMessage, useIntl} from '@umijs/max'; ProFormDependency,
import {postMenuCreateMenu} from "@/services/system/Menu"; ProFormDigit,
ProFormRadio,
ProFormSelect,
ProFormSwitch,
ProFormText,
} from '@ant-design/pro-components';
import { FormattedMessage, useIntl } from '@umijs/max';
// import {systemMenuGetMenuPkIdSelectList} from "@/services/system/system"; // import {systemMenuGetMenuPkIdSelectList} from "@/services/system/system";
import React, {useEffect, useState} from 'react'; import IconSelector from '@/components/IconSelector';
import {App, Button, Form, Modal, message} from 'antd'; import { createIcon } from '@/utils/IconUtil';
import IconSelector from "@/components/IconSelector"; import { Form, message } from 'antd';
import {createIcon} from '@/utils/IconUtil'; import React, { useEffect, useState } from 'react';
// 表单宽度 804 两列 // 表单宽度 804 两列
import { proFormItemStyleProps, proFormModelWidth } from '../../../../../config/defaultForm'; import { proFormItemStyleProps, proFormModelWidth } from '../../../../../config/defaultForm';
@ -27,30 +33,33 @@ export type CreateFormProps = {
reload: any; reload: any;
}; };
const CreateForm: React.FC<CreateFormProps> = (props) => { const CreateForm: React.FC<CreateFormProps> = (props) => {
const intl = useIntl(); const intl = useIntl();
const [form] = Form.useForm<API.Menu>(); const [form] = Form.useForm<API.Menu>();
// const {message} = App.useApp() // const {message} = App.useApp()
const [menuIconName, setMenuIconName] = useState<any>(); const [menuIconName, setMenuIconName] = useState<any>();
const [iconSelectorOpen, setIconSelectorOpen] = useState<boolean>(false); const [iconSelectorOpen, setIconSelectorOpen] = useState<boolean>(false);
const [parentId, setParentId] = useState<number>(0); const [parentId, setParentId] = useState<number>(0);
const [parentSelectOptions, setParentSelectOptions] = useState<any[]>([{label: '根节点', value: 0}]); const [parentSelectOptions, setParentSelectOptions] = useState<any[]>([
{ label: '根节点', value: 0 },
]);
useEffect(()=>{ useEffect(() => {
if (props.values.id !== undefined && props.values.id !== 0) { if (props.values.id !== undefined && props.values.id !== 0) {
setParentId(props.values.id as number) setParentId(props.values.id as number);
setParentSelectOptions([{label: props.values.title, value: props.values.id}]) setParentSelectOptions([{ label: props.values.title, value: props.values.id }]);
} else{ } else {
setParentId(0) setParentId(0);
} }
}, [props.createModalOpen]) }, [props.createModalOpen]);
console.log(props); console.log(props);
return ( return (
<ModalForm<API.Menu> <ModalForm<API.Menu>
width={proFormModelWidth} width={proFormModelWidth}
title={intl.formatMessage({ title={intl.formatMessage({
id: props.values.id ? 'system.menu.table.list.create_son_menu': 'system.menu.table.list.add', id: props.values.id
? 'system.menu.table.list.create_son_menu'
: 'system.menu.table.list.add',
defaultMessage: '$$$', defaultMessage: '$$$',
})} })}
open={props.createModalOpen} open={props.createModalOpen}
@ -62,181 +71,274 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
}} }}
submitTimeout={2000} submitTimeout={2000}
onFinish={async (values) => { onFinish={async (values) => {
console.log(values) console.log(values);
postMenuCreateMenu(values).then(() => { postMenuCreateMenu(values)
message.success(intl.formatMessage({id: 'common.success', defaultMessage: '$$$'})) .then(() => {
props.reload() message.success(intl.formatMessage({ id: 'common.success', defaultMessage: '$$$' }));
}).catch(() => { props.reload();
message.error(intl.formatMessage({id: 'common.error', defaultMessage: '$$$'})) })
}) .catch(() => {
message.error(intl.formatMessage({ id: 'common.error', defaultMessage: '$$$' }));
});
props.handleModal(); props.handleModal();
return true; return true;
}} }}
> >
<ProForm.Group> <ProForm.Group>
<ProFormSelect width={proFormItemStyleProps.column2Width} name="parentId" <ProFormSelect
disabled={true} width={proFormItemStyleProps.column2Width}
initialValue={parentId} name="parentId"
request={async () => parentSelectOptions} disabled={true}
label={<FormattedMessage id="system.menu.table.list.parentId" defaultMessage="$$$"/>} initialValue={parentId}
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.parentId', defaultMessage: '$$$'})}`} request={async () => parentSelectOptions}
label={<FormattedMessage id="system.menu.table.list.parentId" defaultMessage="$$$" />}
placeholder={`${intl.formatMessage({
id: 'common.please_select',
defaultMessage: '$$$',
})}${intl.formatMessage({
id: 'system.menu.table.list.parentId',
defaultMessage: '$$$',
})}`}
/> />
</ProForm.Group> </ProForm.Group>
<ProForm.Group> <ProForm.Group>
<ProFormRadio.Group width={proFormItemStyleProps.column2Width} name="type" <ProFormRadio.Group
required={true} width={proFormItemStyleProps.column2Width}
label={<FormattedMessage id="system.menu.table.list.type" defaultMessage="$$$"/>} name="type"
initialValue={'M'} required={true}
options={[ label={<FormattedMessage id="system.menu.table.list.type" defaultMessage="$$$" />}
{ initialValue={'M'}
label: intl.formatMessage({id: 'system.menu.table.list.type_M', defaultMessage: '$$$'}), options={[
value: 'M', {
}, label: intl.formatMessage({
{ id: 'system.menu.table.list.type_M',
label: intl.formatMessage({id: 'system.menu.table.list.type_C', defaultMessage: '$$$'}), defaultMessage: '$$$',
value: 'C', }),
}, value: 'M',
{ },
label: intl.formatMessage({id: 'system.menu.table.list.type_F', defaultMessage: '$$$'}), {
value: 'F', label: intl.formatMessage({
}, id: 'system.menu.table.list.type_C',
{ defaultMessage: '$$$',
label: intl.formatMessage({id: 'system.menu.table.list.type_E', defaultMessage: '$$$'}), }),
value: 'E', value: 'C',
}, },
]}> {
label: intl.formatMessage({
</ProFormRadio.Group> id: 'system.menu.table.list.type_F',
defaultMessage: '$$$',
}),
value: 'F',
},
{
label: intl.formatMessage({
id: 'system.menu.table.list.type_E',
defaultMessage: '$$$',
}),
value: 'E',
},
]}
></ProFormRadio.Group>
</ProForm.Group> </ProForm.Group>
<ProForm.Group> <ProForm.Group>
<ProFormText width={proFormItemStyleProps.column2Width} name="title" <ProFormText
label={<FormattedMessage id="system.menu.table.list.title" defaultMessage="$$$"/>} width={proFormItemStyleProps.column2Width}
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.title', defaultMessage: '$$$'})}`} name="title"
required={true} label={<FormattedMessage id="system.menu.table.list.title" defaultMessage="$$$" />}
rules={[ placeholder={`${intl.formatMessage({
{ id: 'common.please_input',
required: true, defaultMessage: '$$$',
message: ( })}${intl.formatMessage({ id: 'system.menu.table.list.title', defaultMessage: '$$$' })}`}
<FormattedMessage required={true}
id="system.menu.table.rule.required.name" rules={[
defaultMessage="name is required" {
/> required: true,
), message: (
}, <FormattedMessage
]} id="system.menu.table.rule.required.name"
defaultMessage="name is required"
/>
),
},
]}
/> />
<ProFormDigit width={proFormItemStyleProps.column2Width} fieldProps={{precision: 0}} name="sort" <ProFormDigit
label={<FormattedMessage id="system.menu.table.list.sort" defaultMessage="$$$"/>} width={proFormItemStyleProps.column2Width}
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.sort', defaultMessage: '$$$'})}`} fieldProps={{ precision: 0 }}
initialValue={1} name="sort"
label={<FormattedMessage id="system.menu.table.list.sort" defaultMessage="$$$" />}
placeholder={`${intl.formatMessage({
id: 'common.please_input',
defaultMessage: '$$$',
})}${intl.formatMessage({ id: 'system.menu.table.list.sort', defaultMessage: '$$$' })}`}
initialValue={1}
/> />
</ProForm.Group> </ProForm.Group>
<ProFormDependency name={['type']}> <ProFormDependency name={['type']}>
{ {(record) => {
(record) => { let isShow = record.type !== 'F' && record.type !== 'E';
let isShow = (record.type !== 'F' && record.type !== 'E') if (isShow) {
if (isShow) { return (
return ( <ProForm.Group>
<ProForm.Group> <ProFormText
<ProFormText width={proFormItemStyleProps.column2Width} name="name" width={proFormItemStyleProps.column2Width}
label={<FormattedMessage id="system.menu.table.list.name" defaultMessage="$$$"/>} name="name"
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.name', defaultMessage: '$$$'})}`} label={<FormattedMessage id="system.menu.table.list.name" defaultMessage="$$$" />}
required={true} placeholder={`${intl.formatMessage({
rules={[ id: 'common.please_input',
{ defaultMessage: '$$$',
required: true, })}${intl.formatMessage({
message: ( id: 'system.menu.table.list.name',
<FormattedMessage defaultMessage: '$$$',
id="system.menu.table.rule.required.name" })}`}
defaultMessage="name is required" required={true}
/> rules={[
), {
}, required: true,
]} message: (
/> <FormattedMessage
<ProFormText width={proFormItemStyleProps.column2Width} name="path" id="system.menu.table.rule.required.name"
label={<FormattedMessage id="system.menu.table.list.path" defaultMessage="$$$"/>} defaultMessage="name is required"
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.path', defaultMessage: '$$$'})}`} />
required={true} ),
rules={[ },
{ ]}
required: true, />
message: ( <ProFormText
<FormattedMessage width={proFormItemStyleProps.column2Width}
id="system.menu.table.rule.required.name" name="path"
defaultMessage="name is required" label={<FormattedMessage id="system.menu.table.list.path" defaultMessage="$$$" />}
/> placeholder={`${intl.formatMessage({
), id: 'common.please_input',
}, defaultMessage: '$$$',
]} })}${intl.formatMessage({
/> id: 'system.menu.table.list.path',
<ProFormText width={proFormItemStyleProps.column2Width} name="component" defaultMessage: '$$$',
label={<FormattedMessage id="system.menu.table.list.component" defaultMessage="$$$"/>} })}`}
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.component', defaultMessage: '$$$'})}`} required={true}
required={true} rules={[
hidden={record.type === 'M'} {
// disabled={record.type === 'M'} required: true,
/> message: (
<FormattedMessage
id="system.menu.table.rule.required.name"
defaultMessage="name is required"
/>
),
},
]}
/>
<ProFormText
width={proFormItemStyleProps.column2Width}
name="component"
label={
<FormattedMessage id="system.menu.table.list.component" defaultMessage="$$$" />
}
placeholder={`${intl.formatMessage({
id: 'common.please_input',
defaultMessage: '$$$',
})}${intl.formatMessage({
id: 'system.menu.table.list.component',
defaultMessage: '$$$',
})}`}
required={true}
hidden={record.type === 'M'}
// disabled={record.type === 'M'}
/>
<ProFormSelect
width={proFormItemStyleProps.column2Width}
name="icon"
label={intl.formatMessage({
id: 'system.menu.table.list.icon',
defaultMessage: '$$$',
})}
valueEnum={{}}
hidden={parentId !== 0}
addonBefore={createIcon(menuIconName)}
fieldProps={{
onClick: () => {
setIconSelectorOpen(true);
},
}}
placeholder={`${intl.formatMessage({
id: 'common.please_select',
defaultMessage: '$$$',
})}${intl.formatMessage({
id: 'system.menu.table.list.icon',
defaultMessage: '$$$',
})}`}
rules={[
{
required: false,
message: (
<FormattedMessage id="请输入菜单图标!" defaultMessage="请输入菜单图标!" />
),
},
]}
/>
<ProFormSelect {iconSelectorOpen ? (
width={proFormItemStyleProps.column2Width} <>
name="icon" <IconSelector
label={intl.formatMessage({ onSelect={(name: string) => {
id: 'system.menu.table.list.icon', form.setFieldsValue({ icon: name });
defaultMessage: '$$$', setMenuIconName(name);
})} setIconSelectorOpen(false);
valueEnum={{}}
hidden={parentId !==0}
addonBefore={createIcon(menuIconName)}
fieldProps={{
onClick: () => {
setIconSelectorOpen(true);
},
}} }}
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.icon', defaultMessage: '$$$'})}`}
rules={[
{
required: false,
message: <FormattedMessage id="请输入菜单图标!" defaultMessage="请输入菜单图标!"/>,
},
]}
/> />
</ProForm.Group> </>
) ) : (
} ''
} )}
</ProForm.Group>
);
} }
}}
</ProFormDependency> </ProFormDependency>
<ProForm.Group> <ProForm.Group>
<ProFormDependency name={['type']}> <ProFormDependency name={['type']}>
{ {(record) => {
(record) => { return (
return ( <ProFormText
<ProFormText width={proFormItemStyleProps.column2Width} name="permission" width={proFormItemStyleProps.column2Width}
label={<FormattedMessage id="system.menu.table.list.permission" defaultMessage="$$$"/>} name="permission"
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.permission', defaultMessage: '$$$'})}`} label={
disabled={record.type === 'M'} <FormattedMessage id="system.menu.table.list.permission" defaultMessage="$$$" />
/> }
) placeholder={`${intl.formatMessage({
} id: 'common.please_input',
} defaultMessage: '$$$',
})}${intl.formatMessage({
id: 'system.menu.table.list.permission',
defaultMessage: '$$$',
})}`}
disabled={record.type === 'M'}
/>
);
}}
</ProFormDependency> </ProFormDependency>
</ProForm.Group> </ProForm.Group>
<ProForm.Group> <ProForm.Group>
<ProFormText width={proFormItemStyleProps.column2Width} name="remark" <ProFormText
label={<FormattedMessage id="system.menu.table.list.remark" defaultMessage="$$$"/>} width={proFormItemStyleProps.column2Width}
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.remark', defaultMessage: '$$$'})}`} name="remark"
required={false}/> label={<FormattedMessage id="system.menu.table.list.remark" defaultMessage="$$$" />}
<ProFormSwitch width={proFormItemStyleProps.column2Width} name="hidden" initialValue={false} placeholder={`${intl.formatMessage({
label={<FormattedMessage id="system.menu.table.list.hidden" defaultMessage="$$$"/>} id: 'common.please_input',
required={false}> defaultMessage: '$$$',
})}${intl.formatMessage({ id: 'system.menu.table.list.remark', defaultMessage: '$$$' })}`}
</ProFormSwitch> required={false}
</ProForm.Group> />
<Modal <ProFormSwitch
width={proFormItemStyleProps.column2Width}
name="hidden"
initialValue={false}
label={<FormattedMessage id="system.menu.table.list.hidden" defaultMessage="$$$" />}
required={false}
></ProFormSwitch>
</ProForm.Group>
{/* <Modal
width={800} width={800}
open={iconSelectorOpen} open={iconSelectorOpen}
onCancel={() => { onCancel={() => {
@ -246,14 +348,13 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
> >
<IconSelector <IconSelector
onSelect={(name: string) => { onSelect={(name: string) => {
form.setFieldsValue({icon: name}); form.setFieldsValue({ icon: name });
setMenuIconName(name); setMenuIconName(name);
setIconSelectorOpen(false); setIconSelectorOpen(false);
}} }}
/> />
</Modal> </Modal> */}
</ModalForm> </ModalForm>
);
) };
}
export default CreateForm; export default CreateForm;

@ -72,7 +72,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
initialValue={parentId} initialValue={parentId}
request={async () => parentSelectOptions} request={async () => parentSelectOptions}
label={<FormattedMessage id="system.menu.table.list.parentId" defaultMessage="$$$"/>} label={<FormattedMessage id="system.menu.table.list.parentId" defaultMessage="$$$"/>}
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.parentId', defaultMessage: '$$$'})}`} placeholder={`${intl.formatMessage({id: 'common.please_select', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.parentId', defaultMessage: '$$$'})}`}
/> />
</ProForm.Group> </ProForm.Group>
<ProForm.Group> <ProForm.Group>
@ -192,11 +192,11 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
}, },
}} }}
initialValue={props.values.icon} initialValue={props.values.icon}
placeholder={`${intl.formatMessage({id: 'common.please_input', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.icon', defaultMessage: '$$$'})}`} placeholder={`${intl.formatMessage({id: 'common.please_select', defaultMessage: '$$$'})}${intl.formatMessage({id: 'system.menu.table.list.icon', defaultMessage: '$$$'})}`}
rules={[ rules={[
{ {
required: false, required: false,
message: <FormattedMessage id="请输入菜单图标!" defaultMessage="请输入菜单图标!"/>, message: <FormattedMessage id="请选择菜单图标!" defaultMessage="请选择菜单图标!"/>,
}, },
]} ]}
/> />

@ -14,7 +14,7 @@ const ColumnDrawer: React.FC<ColumnDrawProps> = (props) => {
return ( return (
<Drawer <Drawer
width={600} width={500}
open={props.isShowDetail} open={props.isShowDetail}
onClose={() => { onClose={() => {
props.handleDrawer(); props.handleDrawer();

@ -14,7 +14,7 @@ const ColumnDrawer: React.FC<ColumnDrawProps> = (props) => {
return ( return (
<Drawer <Drawer
width={600} width={500}
open={props.isShowDetail} open={props.isShowDetail}
onClose={() => { onClose={() => {
props.handleDrawer(); props.handleDrawer();

@ -1,3 +1,11 @@
/*
* @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-01 13:56:33
* @LastEditors: zhoux zhouxia@supervision.ltd
* @LastEditTime: 2023-11-22 14:54:56
* @FilePath: \general-ai-platform-web\src\pages\System\RoleList\components\ColumnDrawer.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import React from "react"; import React from "react";
import {Drawer} from "antd"; import {Drawer} from "antd";
import {ProColumns, ProDescriptions, ProDescriptionsItemProps} from "@ant-design/pro-components"; import {ProColumns, ProDescriptions, ProDescriptionsItemProps} from "@ant-design/pro-components";
@ -14,7 +22,7 @@ const ColumnDrawer: React.FC<ColumnDrawProps> = (props) => {
return ( return (
<Drawer <Drawer
width={600} width={500}
open={props.isShowDetail} open={props.isShowDetail}
onClose={() => { onClose={() => {
props.handleDrawer(); props.handleDrawer();

@ -70,6 +70,7 @@ const SetPermissionForm: React.FC<SetPermissionFormProps> = (props) => {
}, [props.updateModalOpen]) }, [props.updateModalOpen])
return ( return (
// TODO 权限数据过长 1440px 1920px尺寸下700溢出滚动更大的屏幕可以自适应
<ModalForm<API.UpdateRolePermissionParams> <ModalForm<API.UpdateRolePermissionParams>
title={intl.formatMessage({ title={intl.formatMessage({
id: 'system.role.table.list.set_permission', id: 'system.role.table.list.set_permission',
@ -115,7 +116,7 @@ const SetPermissionForm: React.FC<SetPermissionFormProps> = (props) => {
key: 'menu', key: 'menu',
label: intl.formatMessage({id: 'system.role.table.list.menu_permission', defaultMessage: '$$$'}), label: intl.formatMessage({id: 'system.role.table.list.menu_permission', defaultMessage: '$$$'}),
children: children:
<ProForm.Item label="菜单权限" shouldUpdate> <ProForm.Item label="" shouldUpdate>
{(form) => { {(form) => {
return ( return (
<ProForm.Item name="menuIds"> <ProForm.Item name="menuIds">
@ -142,7 +143,7 @@ const SetPermissionForm: React.FC<SetPermissionFormProps> = (props) => {
{ {
key: 'api', key: 'api',
label: intl.formatMessage({id: 'system.role.table.list.api_permission', defaultMessage: '$$$'}), label: intl.formatMessage({id: 'system.role.table.list.api_permission', defaultMessage: '$$$'}),
children: <ProForm.Item label="api权限" shouldUpdate> children: <ProForm.Item label="" shouldUpdate>
{(form) => { {(form) => {
return ( return (
<ProForm.Item name="apiIds"> <ProForm.Item name="apiIds">

@ -14,7 +14,7 @@ const ColumnDrawer: React.FC<ColumnDrawProps> = (props) => {
return ( return (
<Drawer <Drawer
width={600} width={500}
open={props.isShowDetail} open={props.isShowDetail}
onClose={() => { onClose={() => {
props.handleDrawer(); props.handleDrawer();

@ -1,28 +1,24 @@
import {PlusOutlined} from '@ant-design/icons'; import { deleteUserDeleteUser, postUserGetUserList } from '@/services/system/User';
import type {ActionType, ProColumns} from '@ant-design/pro-components'; import { PlusOutlined } from '@ant-design/icons';
import { import type { ActionType, ProColumns } from '@ant-design/pro-components';
FooterToolbar, import { PageContainer, ProTable } from '@ant-design/pro-components';
PageContainer, import { Access, FormattedMessage, history, useAccess, useIntl } from '@umijs/max';
ProTable, import { Button, message } from 'antd';
ProCard, import React, { useEffect, useRef, useState } from 'react';
} from '@ant-design/pro-components'; import { ColumnDrawer } from './components/ColumnDrawer';
import {FormattedMessage, useIntl, useAccess, Access, history} from '@umijs/max'; import CreateForm from './components/CreateForm';
import {Button, Popconfirm, message} from 'antd';
import React, {useEffect, useRef, useState} from 'react';
import UpdateForm from './components/UpdateForm'; import UpdateForm from './components/UpdateForm';
import CreateForm from "./components/CreateForm";
import {ColumnDrawer} from "./components/ColumnDrawer";
import {postUserGetUserList, deleteUserDeleteUser} from "@/services/system/User";
import { postDepartmentGetDepartmentTree } from '@/services/system/Department';
import { RedoOutlined } from '@ant-design/icons';
import { Tree } from 'antd'; import { Tree } from 'antd';
import type { DataNode } from 'antd/es/tree'; import type { DataNode } from 'antd/es/tree';
import {postDepartmentGetDepartmentTree} from "@/services/system/Department";
import {RedoOutlined} from "@ant-design/icons";
// 列表操作栏组件 // 列表操作栏组件
import TableActionCard from '@/components/TableActionCard'; import TableActionCard from '@/components/TableActionCard';
import IsDelete from '@/components/TableActionCard/isDelete'; import IsDelete from '@/components/TableActionCard/isDelete';
// 批量删除 // 批量删除
import IsBatchDelete from '@/components/BatchOperation/isBatchDelete'; import IsBatchDelete from '@/components/BatchOperation/isBatchDelete';
import TreeAndTableList, { ProCardTypeProps } from '@/layouts/treeAndTableList';
const UserList: React.FC = () => { const UserList: React.FC = () => {
/** /**
@ -47,63 +43,65 @@ const UserList: React.FC = () => {
const [selectedRowsState, setSelectedRows] = useState<API.User[]>([]); const [selectedRowsState, setSelectedRows] = useState<API.User[]>([]);
const [deptTreeData, setDeptTreeData] = React.useState<DataNode[]>([]); const [deptTreeData, setDeptTreeData] = React.useState<DataNode[]>([]);
const [selectDepts, setSelectDepts] = React.useState<any[]>([]); const [selectDepts, setSelectDepts] = React.useState<any[]>([]);
const [hasInit, setHasInit] = useState<boolean>(false) const [hasInit, setHasInit] = useState<boolean>(false);
useEffect(()=>{ useEffect(() => {
postDepartmentGetDepartmentTree().then((resp)=>{ postDepartmentGetDepartmentTree()
setDeptTreeData(resp.data.tree) .then((resp) => {
setHasInit(true) setDeptTreeData(resp.data.tree);
}).catch(()=>{ setHasInit(true);
message.error(intl.formatMessage({id: 'common.failure', defaultMessage: '$$$'})) })
}) .catch(() => {
}, []) message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '$$$' }));
});
}, []);
const handleUpdateModal = () => { const handleUpdateModal = () => {
if (updateModalOpen) { if (updateModalOpen) {
setUpdateModalOpen(false) setUpdateModalOpen(false);
setCurrentRow(undefined) setCurrentRow(undefined);
} else { } else {
setUpdateModalOpen(true) setUpdateModalOpen(true);
} }
} };
const handleCreateModal = () => { const handleCreateModal = () => {
if (createModalOpen) { if (createModalOpen) {
setCreateModalOpen(false) setCreateModalOpen(false);
setCurrentRow(undefined) setCurrentRow(undefined);
} else { } else {
setCreateModalOpen(true) setCreateModalOpen(true);
} }
} };
const handleColumnDrawer = () => { const handleColumnDrawer = () => {
if (showDetail) { if (showDetail) {
setShowDetail(false) setShowDetail(false);
setCurrentRow(undefined) setCurrentRow(undefined);
} else { } else {
setShowDetail(true) setShowDetail(true);
} }
} };
const handleDestroy = async (selectedRow: API.User) => { const handleDestroy = async (selectedRow: API.User) => {
deleteUserDeleteUser(selectedRow).then(() => { deleteUserDeleteUser(selectedRow)
message.success(intl.formatMessage({id: 'common.success', defaultMessage: '$$$'})) .then(() => {
actionRef.current?.reload() message.success(intl.formatMessage({ id: 'common.success', defaultMessage: '$$$' }));
}).catch(() => { actionRef.current?.reload();
message.error(intl.formatMessage({id: 'common.failure', defaultMessage: '$$$'})) })
}) .catch(() => {
message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '$$$' }));
});
}; };
const columns: ProColumns<API.User>[] = [ const columns: ProColumns<API.User>[] = [
{ {
title: (<FormattedMessage title: <FormattedMessage id="system.user.table.list.id" defaultMessage="id" />,
id="system.user.table.list.id" dataIndex: 'id',
defaultMessage="id"/>),
dataIndex: "id",
sorter: true, sorter: true,
// valueType: "digit", // valueType: "digit",
filters: true, onFilter: true, filters: true,
onFilter: true,
render: (dom, entity) => { render: (dom, entity) => {
return ( return (
<a <a
style={{color: '#155BD4'}} style={{ color: '#155BD4' }}
onClick={() => { onClick={() => {
setCurrentRow(entity); setCurrentRow(entity);
setShowDetail(true); setShowDetail(true);
@ -117,62 +115,49 @@ const UserList: React.FC = () => {
{ {
sorter: true, sorter: true,
title: (<FormattedMessage title: <FormattedMessage id="system.user.table.list.userName" defaultMessage="$$$" />,
id="system.user.table.list.userName" dataIndex: 'userName',
defaultMessage="$$$"/>),
dataIndex: "userName",
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: (<FormattedMessage title: <FormattedMessage id="system.user.table.list.nickName" defaultMessage="$$$" />,
id="system.user.table.list.nickName" dataIndex: 'nickName',
defaultMessage="$$$"/>),
dataIndex: "nickName",
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: (<FormattedMessage title: <FormattedMessage id="system.user.table.list.avatarId" defaultMessage="$$$" />,
id="system.user.table.list.avatarId" dataIndex: 'avatarUrl',
defaultMessage="$$$"/>),
dataIndex: "avatarUrl",
hideInSearch: true, hideInSearch: true,
renderText: (v) => { renderText: (v) => {
if (v) { if (v) {
return SERVER_HOST + v.replace(/\\/g, '/') return SERVER_HOST + v.replace(/\\/g, '/');
} else { } else {
return '' return '';
} }
}, },
// hideInTable: true, // hideInTable: true,
valueType: 'image', valueType: 'image',
}, },
{ {
title: (<FormattedMessage title: <FormattedMessage id="system.user.table.list.enable" defaultMessage="$$$" />,
id="system.user.table.list.enable" dataIndex: 'enable',
defaultMessage="$$$"/>),
dataIndex: "enable",
valueEnum: { valueEnum: {
true: { true: {
text: (<FormattedMessage text: <FormattedMessage id="common.open" defaultMessage="$$" />,
id="common.open" status: 'Success',
defaultMessage="$$"/>),
status: 'Success'
}, },
false: { false: {
text: (<FormattedMessage text: <FormattedMessage id="common.close" defaultMessage="$$" />,
id="common.close" status: 'Error',
defaultMessage="$$"/>), },
status: 'Error'
}
}, },
filters: true, onFilter: true, filters: true,
onFilter: true,
}, },
{ {
title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating"/>, title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
dataIndex: 'option', dataIndex: 'option',
valueType: 'option', valueType: 'option',
fixed: 'right', fixed: 'right',
@ -207,7 +192,7 @@ const UserList: React.FC = () => {
), ),
}, },
]} ]}
></TableActionCard> ></TableActionCard>,
// <Access accessible={access.canUpdate(history.location.pathname)} key={`${history.location.pathname}-add`}> // <Access accessible={access.canUpdate(history.location.pathname)} key={`${history.location.pathname}-add`}>
// <a // <a
// key="update" // key="update"
@ -237,45 +222,50 @@ const UserList: React.FC = () => {
// </Popconfirm> // </Popconfirm>
// </Access> // </Access>
], ],
},]; },
];
return ( return (
<PageContainer> <PageContainer>
<ProCard <TreeAndTableList
style={{ display: 'flex', width: '100%', background: 'transparent' }} leftCard={
bodyStyle={{
padding:0,
margin:0,
display: 'flex',
justifyContent: 'space-between',
}}>
<ProCard headStyle={{ paddingTop: 24, paddingLeft: 20, paddingRight: 20 }} title="部门选择" colSpan="20%" extra={<Button icon={<RedoOutlined />} onClick={()=>{setSelectDepts([]); actionRef.current?.reload()}}></Button>}>
{ {
hasInit && ( title: '部门选择',
<Tree extra: (
checkable={false} <>
defaultExpandAll={true} <Button
selectedKeys={selectDepts} icon={<RedoOutlined />}
treeData={deptTreeData} onClick={() => {
onSelect={(selectKeys)=>{ setSelectDepts([]);
setSelectDepts(selectKeys) actionRef.current?.reload();
actionRef.current?.reload() }}
}} >
/>
) </Button>
} </>
</ProCard> ),
<ProCard } as ProCardTypeProps
colSpan="78%" }
style={{ padding: 0, margin: 0, background: 'transparent' }} leftDom={
bodyStyle={{ padding: 0, margin: 0 }} hasInit && (
headerBordered <Tree
> checkable={false}
defaultExpandAll={true}
selectedKeys={selectDepts}
treeData={deptTreeData}
onSelect={(selectKeys) => {
setSelectDepts(selectKeys);
actionRef.current?.reload();
}}
/>
)
}
rightDom={
<ProTable<API.User> <ProTable<API.User>
headerTitle={intl.formatMessage({ headerTitle={intl.formatMessage({
id: 'pages.searchTable.title', id: 'pages.searchTable.title',
defaultMessage: '$$$', defaultMessage: '$$$',
})} })}
options={{fullScreen: true, setting: true, density: true, reload: true}} options={{ fullScreen: true, setting: true, density: true, reload: true }}
actionRef={actionRef} actionRef={actionRef}
rowKey="id" rowKey="id"
search={{ search={{
@ -287,10 +277,13 @@ const UserList: React.FC = () => {
}} }}
columnsState={{ columnsState={{
persistenceKey: 'api_list', persistenceKey: 'api_list',
persistenceType: 'localStorage' persistenceType: 'localStorage',
}} }}
toolBarRender={() => [ toolBarRender={() => [
<Access accessible={access.canUpdate(history.location.pathname)} key={`${history.location.pathname}-add`}> <Access
accessible={access.canUpdate(history.location.pathname)}
key={`${history.location.pathname}-add`}
>
<Button <Button
type="primary" type="primary"
key="primary" key="primary"
@ -298,34 +291,35 @@ const UserList: React.FC = () => {
setCreateModalOpen(true); setCreateModalOpen(true);
}} }}
> >
<PlusOutlined/> <FormattedMessage id="pages.searchTable.new" defaultMessage="New"/> <PlusOutlined />{' '}
<FormattedMessage id="pages.searchTable.new" defaultMessage="New" />
</Button> </Button>
</Access> </Access>,
]} ]}
request={async (params = {}, sort) => { request={async (params = {}, sort) => {
const {current, ...rest} = params const { current, ...rest } = params;
const reqParams:any = { const reqParams: any = {
page: current, page: current,
desc: false, desc: false,
orderKey: "", orderKey: '',
...rest, ...rest,
} };
if (selectDepts.length) { if (selectDepts.length) {
reqParams.deptId = selectDepts[0] reqParams.deptId = selectDepts[0];
} }
if (sort && Object.keys(sort).length) { if (sort && Object.keys(sort).length) {
reqParams.orderKey = Object.keys(sort)[0] reqParams.orderKey = Object.keys(sort)[0];
let sort_select = sort[reqParams.orderKey] let sort_select = sort[reqParams.orderKey];
reqParams.desc = sort_select === 'descend'; reqParams.desc = sort_select === 'descend';
} }
let resp = await postUserGetUserList({...reqParams}) let resp = await postUserGetUserList({ ...reqParams });
console.log(resp) console.log(resp);
return { return {
data: resp.data.list, data: resp.data.list,
success: resp.success, success: resp.success,
total: resp.data.total, total: resp.data.total,
current: resp.data.page, current: resp.data.page,
pageSize: resp.data.pageSize pageSize: resp.data.pageSize,
}; };
}} }}
columns={columns} columns={columns}
@ -341,8 +335,8 @@ const UserList: React.FC = () => {
<IsBatchDelete <IsBatchDelete
deleteApi={() => { deleteApi={() => {
const ids = selectedRowsState.map((v: API.User) => { const ids = selectedRowsState.map((v: API.User) => {
return v.id return v.id;
}) });
// deleteUserDeleteUsersByIds({ids: ids as number[]}).then(() => { // deleteUserDeleteUsersByIds({ids: ids as number[]}).then(() => {
// actionRef.current?.reloadAndRest?.(); // actionRef.current?.reloadAndRest?.();
// }) // })
@ -353,39 +347,12 @@ const UserList: React.FC = () => {
); );
}} }}
/> />
{/* {selectedRowsState?.length > 0 && ( }
<FooterToolbar ></TreeAndTableList>
extra={
<div>
<FormattedMessage id="pages.searchTable.chosen" defaultMessage="Chosen"/>{' '}
<a style={{fontWeight: 600}}>{selectedRowsState.length}</a>{' '}
<FormattedMessage id="pages.searchTable.item" defaultMessage="$$$"/>
</div>
}
>
<Button
onClick={async () => {
const ids = selectedRowsState.map((v: API.User) => {
return v.id
})
// deleteUserDeleteUsersByIds({ids: ids as number[]}).then(() => {
// actionRef.current?.reloadAndRest?.();
// })
}}
>
<FormattedMessage
id="pages.searchTable.batchDeletion"
defaultMessage="Batch deletion"
/>
</Button>
</FooterToolbar>
)} */}
</ProCard>
</ProCard>
<CreateForm <CreateForm
createModalOpen={createModalOpen} createModalOpen={createModalOpen}
values={currentRow as API.Register || {}} values={(currentRow as API.Register) || {}}
handleModal={handleCreateModal} handleModal={handleCreateModal}
reload={actionRef.current?.reload} reload={actionRef.current?.reload}
/> />
@ -402,7 +369,6 @@ const UserList: React.FC = () => {
columns={columns} columns={columns}
currentRow={currentRow} currentRow={currentRow}
/> />
</PageContainer> </PageContainer>
); );
}; };

Loading…
Cancel
Save