提交 201dd41e authored 作者: 钟是志's avatar 钟是志

应用树形列表增加搜索条件

上级 de389925
......@@ -4,13 +4,13 @@
* 一个年份加上校区-学院-专业的树
* */
import { Tree } from 'antd';
import { Input, Tree } from 'antd';
import React, { Component, Fragment } from 'react';
import Shell from '@/baseComponent/Shell';
import { getAppTypeList, getListByTreeList } from '@/webPublic/Services';
import { getPermInfo } from '@/highOrderComponent/Service';
import { connect } from 'dva';
import { deepCopy } from '@/webPublic/zyd_public/utils/utils';
import BlockTitle from '@/baseComponent/BlockTitle';
const { TreeNode } = Tree;
......@@ -18,11 +18,11 @@ const { TreeNode } = Tree;
sysCode: global.system.sysCode,
}))
export default class AppTypeTree extends Component {
constructor() {
super();
constructor() {
super();
this.state = {
treeListData: [],
initYear: 0,
name: '',
};
}
......@@ -67,7 +67,7 @@ export default class AppTypeTree extends Component {
});
};
getList = () => {
getList = (name = null) => {
const { groupId } = this.props;
const { parentId } = this.state;
if (!groupId) {
......@@ -77,6 +77,7 @@ export default class AppTypeTree extends Component {
{
parentId,
groupId,
name,
cacheKey: Math.random(),
},
).then((treeListData) => {
......@@ -136,39 +137,55 @@ export default class AppTypeTree extends Component {
treeNodeList = (data) => {
let dom = data.map((item) => {
return (
<TreeNode title={item.title}
return (
<TreeNode title={item.title}
isLeaf={item.isLeaf}
key={item.id}>
{item.children && this.treeNodeList(item.children)}
</TreeNode>
);
});
return dom;
};
</TreeNode>
);
});
return dom;
};
render() {
const { treeListData, loading, heightSet } = this.state;
const { selectKey } = this.props;
return (
<Fragment>
<Shell
styleShell={{
borderRight: '1px solid rgba(210,210,210,1)',
minHeight: heightSet || document.body.clientHeight - 150,
backgroundColor: '#fff',
overflowX: 'auto',
marginTop: 0,
}}>
<Tree
onSelect={this.onSelect}
selectedKeys={[selectKey]}
style={{ minHeight: '400px,' }}
disabled={loading}>
{this.treeNodeList(treeListData)}
</Tree>
</Shell>
</Fragment>
);
}
inputList = () => {
const { name } = this.state;
return (
<Input.Search
placeHolder={'应用名称搜索'}
onSearch={(value) => {
this.getList(value);
}}
style={{ marginLeft: '10px', width: '150px' }}/>
);
};
render() {
const { treeListData, loading, heightSet } = this.state;
const { selectKey } = this.props;
return (
<Fragment>
<Shell
styleShell={{
borderRight: '1px solid rgba(210,210,210,1)',
minHeight: heightSet || document.body.clientHeight - 150,
backgroundColor: '#fff',
overflowX: 'auto',
marginTop: 0,
}}>
<BlockTitle title={'应用'}
isSmall={true}
dom={this.inputList()}
/>
<Tree
onSelect={this.onSelect}
selectedKeys={[selectKey]}
style={{ minHeight: '400px,' }}
disabled={loading}>
{this.treeNodeList(treeListData)}
</Tree>
</Shell>
</Fragment>
);
}
}
......@@ -57,6 +57,13 @@ const handlePageSearch = (props) => {
return deleteChildren(response);
},
condition: [
{
key: 'groupId',
name: '类别',
type: 'select',
options: props.typeList,
required: true,
},
{
key: 'sysCode',
type: 'select',
......@@ -92,13 +99,7 @@ const handlePageSearch = (props) => {
},
],
},
{
key: 'groupId',
name: '类别',
type: 'select',
options: props.typeList,
required: true,
},
],
nameSpan: { big: 6, small: 7 },
fileSpan: { big: 4, small: 4 },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论