|
|
@@ -9,6 +9,157 @@ import SubAlreadyItem
|
|
|
from '../../../components/private/subscribe/SubAlreadyItem'
|
|
|
import { SUBSCRIBE_ITEM_NOT } from '../../../configs/constans.config'
|
|
|
import SubLeftMenu from '../../../components/private/subscribe/SubLeftMenu'
|
|
|
+import { saveListState } from '../../../redux/actions/listState'
|
|
|
+import { isObjEmpty } from '../../../utils/common.util'
|
|
|
+
|
|
|
+const subMenuList = [
|
|
|
+ {
|
|
|
+ className: '财务管理',
|
|
|
+ subList: [
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 3126,
|
|
|
+ 'title': '我的事业部应收款统计(华商龙)',
|
|
|
+ 'status': 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'public',
|
|
|
+ 'id': 3140,
|
|
|
+ 'title': '风控周报',
|
|
|
+ 'status': 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 3107,
|
|
|
+ 'title': '上月利润统计(华商龙)',
|
|
|
+ 'status': 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 3127,
|
|
|
+ 'title': '我的事业部逾期应收统计(华商龙)',
|
|
|
+ 'status': 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 3102,
|
|
|
+ 'title': '应收款统计(华商龙)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': '',
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 8806,
|
|
|
+ 'title': '逾期应收统计(英唐集团)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': '',
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 8809,
|
|
|
+ 'title': '应付款统计(英唐集团)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ className: '数据统计',
|
|
|
+ subList: [
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'public',
|
|
|
+ 'id': 17143,
|
|
|
+ 'title': '优软云流量统计',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ className: '销售管理',
|
|
|
+ subList: [
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 3080,
|
|
|
+ 'title': '当月毛利润统计(华商龙)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 3122,
|
|
|
+ 'title': '我的事业部当月销售额统计(华商龙)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': '',
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 8811,
|
|
|
+ 'title': '当月毛利润统计(英唐集团)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': '',
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 8812,
|
|
|
+ 'title': '当月销售额统计(英唐集团)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 3100,
|
|
|
+ 'title': '当月销售额统计(华商龙)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ className: '库存管理',
|
|
|
+ subList: [
|
|
|
+ {
|
|
|
+ 'img': '',
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 8810,
|
|
|
+ 'title': '总库存统计(英唐集团)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 3124,
|
|
|
+ 'title': '我的事业部呆滞库存统计(华商龙)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 3123,
|
|
|
+ 'title': '我的事业部总库存统计(华商龙)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 3120,
|
|
|
+ 'title': '呆滞库存统计(华商龙)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'img': null,
|
|
|
+ 'kind': 'private',
|
|
|
+ 'id': 3125,
|
|
|
+ 'title': '我的事业部死库存统计(华商龙)',
|
|
|
+ 'status': 3,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+]
|
|
|
|
|
|
class SubscribeNot extends Component {
|
|
|
|
|
|
@@ -19,7 +170,11 @@ class SubscribeNot extends Component {
|
|
|
}
|
|
|
|
|
|
componentDidMount () {
|
|
|
-
|
|
|
+ saveListState({
|
|
|
+ listData: subMenuList,
|
|
|
+ leftSelect: 0,
|
|
|
+ scrollTop: 0,
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
componentWillUnmount () {
|
|
|
@@ -27,37 +182,56 @@ class SubscribeNot extends Component {
|
|
|
}
|
|
|
|
|
|
render () {
|
|
|
+ const { listState: { listData, leftSelect } } = this.props
|
|
|
+ const leftItems = [], rightItems = []
|
|
|
+ if (!isObjEmpty(listData)) {
|
|
|
+ listData.forEach((item, index) => {
|
|
|
+ leftItems.push(
|
|
|
+ <SubLeftMenu
|
|
|
+ subClass={{
|
|
|
+ className: item.className,
|
|
|
+ classIndex: index,
|
|
|
+ select: leftSelect === index,
|
|
|
+ }}
|
|
|
+ onLeftClick={this.onLeftClick.bind(this)}
|
|
|
+ />,
|
|
|
+ )
|
|
|
+ })
|
|
|
+
|
|
|
+ const sublist = listData[leftSelect] && listData[leftSelect].subList
|
|
|
+ if (!isObjEmpty(sublist)) {
|
|
|
+ sublist.forEach((item, index) => {
|
|
|
+ rightItems.push(
|
|
|
+ <SubAlreadyItem subObj={{
|
|
|
+ ...item,
|
|
|
+ type: SUBSCRIBE_ITEM_NOT,
|
|
|
+ }}/>,
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
return (
|
|
|
<div className='subscribe-not-root'>
|
|
|
<div className='subscribe-not-left-menu'>
|
|
|
- <SubLeftMenu subClass={{ name: '项目数据' }}/>
|
|
|
- <SubLeftMenu subClass={{ name: '项目数据', select: true }}/>
|
|
|
- <SubLeftMenu subClass={{ name: '项目数据' }}/>
|
|
|
- <SubLeftMenu subClass={{ name: '项目数据' }}/>
|
|
|
+ {leftItems}
|
|
|
</div>
|
|
|
<div className='subscribe-not-right-list'>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
- <SubAlreadyItem subObj={{ name: '超期任务', type: SUBSCRIBE_ITEM_NOT }}/>
|
|
|
+ {rightItems}
|
|
|
</div>
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
+
|
|
|
+ onLeftClick = (subClass) => {
|
|
|
+ saveListState({
|
|
|
+ leftSelect: subClass.classIndex,
|
|
|
+ scrollTop: 0,
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-let mapStateToProps = (state) => ({})
|
|
|
+let mapStateToProps = (state) => ({
|
|
|
+ listState: state.listState,
|
|
|
+})
|
|
|
|
|
|
export default connect(mapStateToProps)(SubscribeNot)
|