| | |
| | | card: null, // 卡片信息,包括正反面 |
| | | formlist: null, // 设置表单信息 |
| | | elements: null, // 编辑组 |
| | | side: 'front' |
| | | side: 'front', |
| | | appType: sessionStorage.getItem('appType') |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | getSettingForms = () => { |
| | | const { cards } = this.props |
| | | const { setting } = this.state.card |
| | | const { card, appType } = this.state |
| | | |
| | | return getSettingForm(setting, cards.subtype === 'propcard') |
| | | let buttons = [] |
| | | card.elements && card.elements.forEach(item => { |
| | | if (item.eleType === 'button') { |
| | | buttons.push({ |
| | | value: item.uuid, |
| | | label: item.label |
| | | }) |
| | | } |
| | | }) |
| | | if (appType !== 'mob' && card.backElements) { |
| | | card.backElements.forEach(item => { |
| | | if (item.eleType === 'button') { |
| | | buttons.push({ |
| | | value: item.uuid, |
| | | label: item.label |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return getSettingForm(card.setting, cards.subtype === 'propcard', buttons) |
| | | } |
| | | |
| | | updateSetting = (res) => { |
| | | const { card, side } = this.state |
| | | const { card, side, 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 |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | card: {...card, setting: res} |