| | |
| | | } |
| | | |
| | | callback = null |
| | | timer = null |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | |
| | | } |
| | | |
| | | this.callback = callback |
| | | this.timer = null |
| | | |
| | | let card = fromJS(style).toJS() |
| | | let borposition = 'outer' |
| | | |
| | |
| | | this.callback = null |
| | | } |
| | | |
| | | updateStyle = (style) => { |
| | | updateStyle = (style, delay) => { |
| | | const { card } = this.state |
| | | |
| | | let _style = { |
| | |
| | | card: _style, |
| | | }) |
| | | |
| | | this.timer && clearTimeout(this.timer) |
| | | |
| | | if (delay) { |
| | | this.timer = setTimeout(() => { |
| | | this.callback && this.callback(_style) |
| | | }, 300) |
| | | } else { |
| | | this.callback && this.callback(_style) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | value = 300 |
| | | } |
| | | |
| | | this.updateStyle({fontSize: `${value}px`}) |
| | | this.updateStyle({fontSize: `${value}px`}, true) |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | if (isNaN(value) || value < 1 || value > 10) return |
| | | |
| | | this.updateStyle({lineHeight: value}) |
| | | this.updateStyle({lineHeight: value}, true) |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | if (isNaN(value) || value < 0 || value > 100) return |
| | | |
| | | this.updateStyle({letterSpacing: `${value}px`}) |
| | | this.updateStyle({letterSpacing: `${value}px`}, true) |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | if (isNaN(value) || value < 0 || value > 100) return |
| | | |
| | | this.updateStyle({textIndent: `${value}px`}) |
| | | this.updateStyle({textIndent: `${value}px`}, true) |
| | | } |
| | | |
| | | changeBackground = (val) => { |
| | |
| | | thdMenuList = JSON.parse(thdMenuList) |
| | | |
| | | let thdMenu = null |
| | | let firstId = '' |
| | | |
| | | thdMenuList.forEach(trd => { |
| | | if (MenuId === trd.MenuID) { |
| | |
| | | smenulist = item.children |
| | | } |
| | | }) |
| | | |
| | | firstId = thdMenu.FstId || '' |
| | | } |
| | | |
| | | this.props.updateConfig({...config, fstMenuId: thdMenu ? thdMenu.FstId : ''}) |
| | | if (firstId !== config.fstMenuId) { |
| | | this.props.updateConfig({...config, fstMenuId: firstId}) |
| | | } |
| | | |
| | | this.setState({ |
| | | fstMenuId: thdMenu ? thdMenu.FstId : '', |
| | | fstMenuId: firstId, |
| | | menulist, |
| | | smenulist |
| | | }, () => { |
| | | this.props.form.setFieldsValue({ |
| | | fstMenuId: thdMenu ? thdMenu.FstId : '', |
| | | fstMenuId: firstId, |
| | | parentId: thdMenu ? thdMenu.ParentId : '' |
| | | }) |
| | | }) |
| | |
| | | }) |
| | | |
| | | let smenulist = [] |
| | | let firstId = '' |
| | | if (thdMenu) { |
| | | menulist.forEach(item => { |
| | | if (item.MenuID === thdMenu.FstId) { |
| | | smenulist = item.children |
| | | } |
| | | }) |
| | | firstId = thdMenu.FstId || '' |
| | | } |
| | | sessionStorage.setItem('fstMenuList', JSON.stringify(menulist)) |
| | | sessionStorage.setItem('thdMenuList', JSON.stringify(thdMenuList)) |
| | | this.props.updateConfig({...config, fstMenuId: thdMenu ? thdMenu.FstId : ''}) |
| | | |
| | | if (firstId !== config.fstMenuId) { |
| | | this.props.updateConfig({...config, fstMenuId: firstId}) |
| | | } |
| | | |
| | | this.setState({ |
| | | fstMenuId: thdMenu ? thdMenu.FstId : '', |
| | | fstMenuId: firstId, |
| | | menulist, |
| | | smenulist |
| | | }, () => { |
| | | this.props.form.setFieldsValue({ |
| | | fstMenuId: thdMenu ? thdMenu.FstId : '', |
| | | fstMenuId: firstId, |
| | | parentId: thdMenu ? thdMenu.ParentId : '' |
| | | }) |
| | | }) |