| | |
| | | state = { |
| | | card: null, // 卡片信息 |
| | | formlist: null, // 设置表单信息 |
| | | appType: sessionStorage.getItem('appType') |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | getSettingForms = () => { |
| | | const { cards } = this.props |
| | | const { setting } = this.state.card |
| | | const { card } = this.state |
| | | |
| | | if (cards.type !== 'carousel') { |
| | | return getTableSetting(setting, cards.columns) |
| | | let buttons = [] |
| | | card.elements && card.elements.forEach(item => { |
| | | if (item.eleType === 'button') { |
| | | buttons.push({ |
| | | value: item.uuid, |
| | | label: item.label |
| | | }) |
| | | } |
| | | }) |
| | | return getTableSetting(card.setting, cards.columns, buttons) |
| | | } else { |
| | | return getCarouselSetting(setting, cards.subtype === 'propcard') |
| | | return getCarouselSetting(card.setting, cards.subtype === 'propcard') |
| | | } |
| | | } |
| | | |
| | | updateSetting = (res) => { |
| | | const { card } = this.state |
| | | const { card, appType } = this.state |
| | | |
| | | if (appType === '' && res.menu) { |
| | | let list = null |
| | | try { |
| | | list = JSON.parse(sessionStorage.getItem('thdMenuList')) || [] |
| | | } catch (e) { |
| | | list = [] |
| | | } |
| | | |
| | | let id = res.menu[res.menu.length - 1] |
| | | |
| | | list.forEach(item => { |
| | | if (item.MenuID === id) { |
| | | res.MenuID = id |
| | | res.MenuName = item.MenuName |
| | | res.MenuNo = item.MenuNo |
| | | res.tabType = item.type |
| | | } |
| | | }) |
| | | } |
| | | |
| | | let _card = {...card, setting: res} |
| | | |
| | |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加元素" onClick={this.addElement} type="plus" /> |
| | | <Icon className="plus" title="添加按钮" onClick={this.addButton} type="plus-square" /> |
| | | <NormalForm title="卡片设置" width={700} update={this.updateSetting} getForms={this.getSettingForms}> |
| | | <NormalForm title="卡片设置" width={800} update={this.updateSetting} getForms={this.getSettingForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="cardcell" card={card}/> |