From 75623dd039b742dbb44fb4c6b4af563404ed9c7f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 03 二月 2020 16:06:04 +0800 Subject: [PATCH] 2020-02-03 --- src/templates/modalconfig/index.jsx | 243 +++--------------------------------------------- 1 files changed, 15 insertions(+), 228 deletions(-) diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index 6e4ef74..3db06af 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -3,19 +3,22 @@ import { is, fromJS } from 'immutable' import { DndProvider } from 'react-dnd' import HTML5Backend from 'react-dnd-html5-backend' -import { Button, Card, Modal, Collapse, notification, Select, List, Icon, Empty } from 'antd' import moment from 'moment' +import { Button, Card, Modal, Collapse, notification, Select, List, Icon, Empty } from 'antd' + +import Api from '@/api' +import zhCN from '@/locales/zh-CN/comtable.js' +import enUS from '@/locales/en-US/comtable.js' +import Utils from '@/utils/utils.js' +import { getModalForm } from '@/templates/tableshare/formconfig' + +import ModalForm from '@/templates/ushare/modalform' import DragElement from './dragelement' import SourceElement from './dragelement/source' -import Api from '@/api' -import ModalForm from './modalform' import SettingForm from './settingform' import GroupForm from './groupform' import EditCard from './editcard' import MenuForm from './menuform' -import zhCN from '@/locales/zh-CN/comtable.js' -import enUS from '@/locales/en-US/comtable.js' -import Utils from '@/utils/utils.js' import Source from './source' import './index.scss' @@ -31,6 +34,8 @@ editSubTab: PropTypes.any, tabConfig: PropTypes.any, subTabConfig: PropTypes.any, + btnTab: PropTypes.any, + btnTabConfig: PropTypes.any, editAction: PropTypes.object, subConfig: PropTypes.any, handleView: PropTypes.func @@ -220,7 +225,7 @@ // 椤甸潰杩斿洖 handleViewBack = () => { - const {menu, editTab, editSubTab, tabConfig, subTabConfig} = this.props + const {menu, editTab, editSubTab, tabConfig, subTabConfig, btnTab, btnTabConfig} = this.props let _view = (subTabConfig && subTabConfig.Template) || (tabConfig && tabConfig.Template) || menu.LongParam.Template @@ -230,6 +235,8 @@ tabConfig: tabConfig, editSubTab: editSubTab, subTabConfig: subTabConfig, + btnTab: btnTab, + btnTabConfig: btnTabConfig, editAction: null, subConfig: subTabConfig || tabConfig || null, tabview: _view @@ -359,227 +366,7 @@ this.setState({ visible: true, card: card, - formlist: [ - { - type: 'text', - key: 'label', - label: this.state.dict['header.form.name'], - initVal: card.label, - required: true, - readonly: false - }, - { - type: 'text', - key: 'field', - label: this.state.dict['header.form.field'], - initVal: card.field, - required: true, - readonly: false - }, - { - type: 'select', - key: 'type', - label: this.state.dict['header.form.type'], - initVal: card.type, - required: true, - options: [{ - value: 'text', - text: this.state.dict['header.form.text'] - }, { - value: 'number', - text: this.state.dict['header.form.number'] - }, { - value: 'select', - text: this.state.dict['header.form.select'] - }, { - value: 'multiselect', - text: this.state.dict['header.form.multiselect'] - }, { - value: 'link', - text: this.state.dict['header.form.link'] - }, { - value: 'fileupload', - text: this.state.dict['header.form.fileupload'] - }, { - value: 'date', - text: this.state.dict['header.form.dateday'] - }, { - value: 'datemonth', - text: this.state.dict['header.form.datemonth'] - }, { - value: 'datetime', - text: this.state.dict['header.form.datetime'] - }, { - value: 'textarea', - text: this.state.dict['header.form.textarea'] - }, { - value: 'funcvar', - text: this.state.dict['header.form.funcvar'] - }] - }, - { - type: 'text', - key: 'initval', - label: this.state.dict['header.form.initval'], - initVal: card.initval, - required: false - }, - { - type: 'radio', - key: 'resourceType', - label: this.state.dict['header.form.resourceType'], - initVal: card.resourceType || '0', - required: true, - options: [{ - value: '0', - text: this.state.dict['header.form.custom'] - }, { - value: '1', - text: this.state.dict['header.form.datasource'] - }] - }, - { - type: 'radio', - key: 'setAll', - label: this.state.dict['header.form.setAll'], - initVal: card.setAll || 'false', - options: [{ - value: 'true', - text: this.state.dict['header.form.true'] - }, { - value: 'false', - text: this.state.dict['header.form.false'] - }] - }, - { - type: 'textarea', - key: 'dataSource', - label: this.state.dict['header.form.datasource'], - initVal: card.dataSource || '', - required: true, - readonly: false - }, - { - type: 'options', - key: 'options', - label: '', - initVal: card.options || [], - required: true, - readonly: false - }, - { - type: 'text', - key: 'linkField', - label: this.state.dict['header.form.linkField'], - initVal: card.linkField || '', - required: true, - readonly: false - }, - { - type: 'text', - key: 'valueField', - label: this.state.dict['header.form.valueField'], - initVal: card.valueField || '', - required: true, - readonly: false - }, - { - type: 'text', - key: 'valueText', - label: this.state.dict['header.form.valueText'], - initVal: card.valueText || '', - required: true, - readonly: false - }, - { - type: 'text', - key: 'orderBy', - label: this.state.dict['header.form.orderBy'], - initVal: card.orderBy || '', - required: false, - readonly: false - }, - { - type: 'select', - key: 'orderType', - label: this.state.dict['header.form.orderType'], - initVal: card.orderType || 'asc', - options: [{ - value: 'asc', - text: this.state.dict['header.form.asc'] - }, { - value: 'desc', - text: this.state.dict['header.form.desc'] - }] - }, - { - type: 'number', - key: 'decimal', - label: this.state.dict['header.form.decimal'], - initVal: card.decimal || 0, - required: false - }, - { - type: 'number', - key: 'min', - label: '鏈�灏忓��', - initVal: card.min || '', - required: false - }, - { - type: 'number', - key: 'max', - label: '鏈�澶у��', - initVal: card.max || '', - required: false - }, - { - type: 'radio', - key: 'readonly', - label: this.state.dict['header.form.readonly'], - initVal: card.readonly || 'false', - options: [{ - value: 'true', - text: this.state.dict['header.form.true'] - }, { - value: 'false', - text: this.state.dict['header.form.false'] - }] - }, - { - type: 'radio', - key: 'required', - label: this.state.dict['header.form.field.required'], - initVal: card.required || 'false', - options: [{ - value: 'true', - text: this.state.dict['header.form.true'] - }, { - value: 'false', - text: this.state.dict['header.form.false'] - }] - }, - { - type: 'radio', - key: 'hidden', - label: this.state.dict['header.form.field.ishidden'], - initVal: card.hidden || 'false', - options: [{ - value: 'true', - text: this.state.dict['header.form.true'] - }, { - value: 'false', - text: this.state.dict['header.form.false'] - }] - }, - { - type: 'multiselect', - key: 'linkSubField', - label: this.state.dict['header.form.linkForm'], - initVal: card.linkSubField || [], - options: _inputfields - } - ] + formlist: getModalForm(card, _inputfields, !!this.props.editTab) }) } -- Gitblit v1.8.0