Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoubichuan committed Nov 5, 2023
1 parent 6d146c1 commit 38fe8eb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
8 changes: 6 additions & 2 deletions src/pages/list/list/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
flex-direction: column;
height: 100%;
.ant-pro-card {
flex: 1;
height: 100%;
&:first-child {
flex-basis: 100px;
}
&:last-child {
flex-grow: 1;
}
.ant-pro-card-body {
.ant-table-wrapper {
height: calc(100% - 64px);
Expand Down
13 changes: 4 additions & 9 deletions src/pages/list/search/projects/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ const Projects: FC = () => {
const [templateData, setTemplateData] = useState<any>([]);
const [lists, setLists] = useState<any>([]);
const getTemplateData = async () => {
let template: any = [];
const result = await list(
const { data } = await list(
'field/1',
{
current: 1,
pageSize: 20,
},
{ type: path.split('/')[path.split('/').length - 1] },
);
template = result.data;
setTemplateData(template);
setLists(template);
setTemplateData(data);
setLists(data);
};
useEffect(() => {
getTemplateData();
Expand All @@ -51,9 +49,6 @@ const Projects: FC = () => {
data = result.data;
setLists(data);
};
useEffect(() => {
getData({});
}, []);
const formItemLayout = {
wrapperCol: {
xs: { span: 24 },
Expand All @@ -66,7 +61,7 @@ const Projects: FC = () => {
<Card bordered={false}>
<Form
layout="inline"
onValuesChange={(_, { category }) => {
onValuesChange={(_) => {
getData(_);
}}
>
Expand Down
29 changes: 29 additions & 0 deletions src/pages/list/template/1.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,35 @@
},
"view": true
},
{
"title": "搜索属性",
"dataIndex": "search",
"hideInSearch": true,
"hideInTable": false,
"table": {
"type": "text",
"width": 160
},
"create": {
"rules": [
{
"required": true,
"message": "内容必填"
}
],
"colProps": { "span": 24 }
},
"edit": {
"rules": [
{
"required": true,
"message": "内容必填"
}
],
"colProps": { "span": 24 }
},
"view": true
},
{
"title": "表格显示",
"dataIndex": "hideInTable",
Expand Down

0 comments on commit 38fe8eb

Please sign in to comment.