Skip to content

Commit

Permalink
更新页面
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoubichuan committed Dec 24, 2023
1 parent 10b84b1 commit 2aeed0b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/pages/list/list/TablePart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ const TablePart: React.FC<TablePartProps> = (props) => {
cancelText: '取消',
onOk: async () => {
const res: any = await exportList(selectedRowsState);
debugger;
const blob = new Blob([res.data], {
type: 'application/vnd.ms-excel;charset=utf-8',
});
Expand Down
6 changes: 3 additions & 3 deletions src/pages/list/list/UpdatePart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type UpdatePartProps = {
template: any;
};
const UpdatePart: React.FC<UpdatePartProps> = (props) => {
const { data, template = [], onVisibleChange, onFinish } = props;
const { data, template, onVisibleChange, onFinish } = props;
const [createModalVisible, handleModalVisible] = useState<boolean>(true);
const handleEdit = async (fields: TableListItem) => {
const hide = message.loading('正在配置');
Expand Down Expand Up @@ -63,10 +63,10 @@ const UpdatePart: React.FC<UpdatePartProps> = (props) => {
initialValues={data}
>
{template
.filter((item: any) => item.edit)
.filter((o: any) => o.edit && JSON.stringify(o.edit) !== '{}')
.map((item: any) => {
let form = <ProFormText {...item.edit} label={item.title} name={item.dataIndex} />;
switch (item.edit ? item.edit.type || '' : '') {
switch (item.edit.type) {
case 'input':
form = <ProFormText {...item.edit} label={item.title} name={item.dataIndex} />;
break;
Expand Down
16 changes: 16 additions & 0 deletions src/pages/list/template/1.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
[
{
"title": "编号",
"dataIndex": "id",
"search": {},
"table": {},
"create": {},
"edit": {
"disabled": true,
"colProps": {
"span": 24
}
},
"view": {
"type": "text"
}
},
{
"title": "类型名称",
"dataIndex": "typeName",
Expand Down

0 comments on commit 2aeed0b

Please sign in to comment.