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

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

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