| | |
| | | }) |
| | | }) |
| | | }) |
| | | } else if (col.inputType === 'cascader') { |
| | | let keys = record[col.dataIndex] |
| | | let _options = [] |
| | | let rematch = (options, level) => { |
| | | options.some(m => { |
| | | if (!m.value || m.value !== keys[level]) return false |
| | | |
| | | _options.push(m) |
| | | |
| | | if (m.children && keys[level + 1]) { |
| | | rematch(m.children, level + 1) |
| | | } |
| | | return true |
| | | }) |
| | | } |
| | | |
| | | rematch(col.options, 0) |
| | | |
| | | if (_options.length) { |
| | | col.extends.forEach(n => { |
| | | record[n.value] = _options.map(o => o[n.key]).join(' / ') |
| | | }) |
| | | } |
| | | } else { |
| | | let key = record[col.dataIndex] |
| | | let option = col.options.filter(m => m.value === key)[0] |
| | |
| | | _card.menus = res.menus |
| | | |
| | | delete res.menus |
| | | } else { |
| | | delete _card.menus |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const CardComponent = asyncComponent(() => import('../cardcomponent')) |
| | | const Nodes = asyncComponent(() => import('./node-wrap')) |
| | | const MobPagination = asyncIconComponent(() => import('@/menu/components/share/mobPagination')) |
| | | const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | |
| | | getWrapForms = () => { |
| | | const { card } = this.state |
| | | |
| | | return getWrapForm(card.wrap, card.subtype, card.columns) |
| | | return getWrapForm(card.wrap, card.subtype, card.columns, card.uuid, card.supNodes) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | let _card = {...this.state.card, wrap: res} |
| | | |
| | | if (res.supNodes) { |
| | | _card.supNodes = res.supNodes |
| | | _card.supNodes = _card.supNodes.map(item => { |
| | | item.componentId = item.nodes[item.nodes.length - 1] |
| | | return item |
| | | }) |
| | | |
| | | delete res.supNodes |
| | | } else { |
| | | delete _card.supNodes |
| | | } |
| | | |
| | | this.updateComponent(_card) |
| | | } |
| | | |
| | | pasteComponent = (res, resolve) => { |
| | |
| | | } |
| | | } |
| | | |
| | | updateSupNodes = (res) => { |
| | | const { card } = this.state |
| | | |
| | | this.setState({ |
| | | card: {...card, supNodes: res} |
| | | }) |
| | | |
| | | this.updateComponent({...card, supNodes: res}) |
| | | } |
| | | |
| | | render() { |
| | | const { card, appType } = this.state |
| | | |
| | |
| | | <NormalForm title="数据卡设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | {card.wrap.supType === 'multi' && appType !== 'mob' ? <Nodes card={card} updateMenus={this.updateSupNodes}/> : null} |
| | | <CopyComponent type="datacard" card={card}/> |
| | | <PasteComponent options={['action', 'search', 'form', 'cardcell']} updateConfig={this.pasteComponent} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/> |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, subtype, columns = [], id = '') { |
| | | export default function (wrap, subtype, columns = [], id = '', supNodes = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let MenuType = '' |
| | | let menu = fromJS(window.GLOB.customMenu).toJS() |
| | |
| | | MenuType = 'billPrint' |
| | | } |
| | | let modules = [] |
| | | if (subtype === 'propcard') { |
| | | if (subtype === 'propcard' || subtype === 'datacard') { |
| | | modules = MenuUtils.getSupModules(menu.components, id) || [] |
| | | } |
| | | |
| | |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'supType', |
| | | label: '上级类型', |
| | | initval: wrap.supType || 'single', |
| | | tooltip: '上级组件为单一组件或多个组件。', |
| | | required: false, |
| | | forbid: subtype !== 'datacard' || appType === 'mob', |
| | | options: [ |
| | | {value: 'single', label: '单组件'}, |
| | | {value: 'multi', label: '多组件'}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | forbid: subtype !== 'datacard' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'supType', |
| | | label: '上级类型', |
| | | initval: wrap.supType || 'single', |
| | | tooltip: '上级组件为单一组件或多个组件。', |
| | | required: false, |
| | | forbid: subtype !== 'datacard' || appType === 'mob', |
| | | options: [ |
| | | {value: 'single', label: '单组件'}, |
| | | {value: 'multi', label: '多组件'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'supNodes', values: ['multi']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | { |
| | | type: 'table', |
| | | field: 'supNodes', |
| | | label: '上级组件', |
| | | initval: supNodes, |
| | | required: true, |
| | | forbid: subtype !== 'datacard' || appType === 'mob', |
| | | span: 24, |
| | | columns: [ |
| | | { |
| | | title: '序号', |
| | | dataIndex: '$index', |
| | | editable: false, |
| | | required: false, |
| | | width: '20%' |
| | | }, |
| | | { |
| | | title: '菜单', |
| | | dataIndex: 'nodes', |
| | | inputType: 'cascader', |
| | | editable: true, |
| | | required: true, |
| | | extends: [{key: 'label', value: 'label'}], |
| | | width: '50%', |
| | | render: (text, record) => record.label, |
| | | options: modules |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | |
| | | return cardWrapForm.map(item => { |
| | |
| | | {value: 'autologon', label: '自动登录'}, |
| | | ] |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // field: 'shortcut', |
| | | // label: '快捷方式', |
| | | // initval: wrap.shortcut || 'remember', |
| | | // tooltip: '账号密码登录时的快捷方式。', |
| | | // required: false, |
| | | // options: [ |
| | | // {value: 'none', label: '无'}, |
| | | // {value: 'remember', label: '记住密码'}, |
| | | // {value: 'autologon', label: '自动登录'}, |
| | | // ] |
| | | // }, |
| | | ] |
| | | |
| | | return wrapForm |