/*
* @Author: lusx
* @Date: 2020-03-02 14:51:29
* @Last Modified by: lusx
* @Last Modified time: 2020-05-20 11:14:53
*/
import React from 'react';
import { Popover } from 'antd';
import {WeaTools} from 'ecCom';
import classnames from 'classnames';
import Content from "./content";
import { toJS } from "mobx";
import _ from "lodash";
import "./prjSelect.less";
import { WeaLocaleProvider } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
const { ls } = WeaTools;
export default class PrjSelect extends React.Component {
static defaultProps = {
prefixCls: 'prj-select'
};
constructor() {
super();
this.state = { open: false, copyOPtions: {}, options: {} };
this.total = 0;
}
componentDidMount() {
const { value } = this.props;
const prjdatas = toJS(ls.getJSONObj("prj_portal_datas"));
const total = toJS(ls.getJSONObj("prj_portal_count"));
this.total = total;
const options = { menus: prjdatas, total: this.total };
this.setState({ options });
}
render() {
const { prefixCls, onChange, value, title } = this.props;
let selected = title;
const prjdatas = toJS(ls.getJSONObj("prj_portal_datas"));
prjdatas.forEach(data=>{
data.datas.length > 0 && data.datas.forEach(d=>{
if(d.id == value) {
selected = d.name;
return false;
}
})
})
const { open, options } = this.state;
const iconClass = classnames({
'icon-jiantou-xia': !open,
'icon-jiantou-shang': open
});
return (