Merge branch 'master' into positec
| | |
| | | |
| | | state = { |
| | | editorState: '', |
| | | encryption: 'false', |
| | | encryption: 'false' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | encryption |
| | | }) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { editorState } = this.state |
| | | |
| | | let style = null |
| | | if (config && config.contHeidht) { |
| | | style = {'--editor-height': config.contHeidht < 100 ? config.contHeidht + 'vh' : config.contHeidht + 'px'} |
| | | } |
| | | |
| | | return ( |
| | | <div className="normal-braft-editor"> |
| | | <div className="normal-braft-editor" style={style}> |
| | | <BraftEditor |
| | | value={editorState} |
| | | onChange={this.handleEditorChange} |
| | |
| | | .normal-braft-editor { |
| | | overflow: hidden; |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 4px; |
| | | |
| | | .bf-content { |
| | | overflow-x: hidden; |
| | | overflow-y: auto; |
| | | height: auto; |
| | | min-height: 500px; |
| | | height: var(--editor-height, auto); |
| | | min-height: var(--editor-height, 500px); |
| | | padding-bottom: 0px; |
| | | .public-DraftEditor-content { |
| | | padding-bottom: 0; |
| | |
| | | } |
| | | .model-menu-edit-content-form { |
| | | .normal-braft-editor { |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 4px; |
| | | overflow-x: hidden; |
| | | .bf-container .DraftEditor-root, .bf-container .public-DraftEditor-content { |
| | | min-height: 500px; |
| | | } |
| | |
| | | card: PropTypes.object |
| | | } |
| | | |
| | | transConfig = (config, type) => { |
| | | if (type === 'menucell') { |
| | | config.setting.type = 'linkmenu' |
| | | config.setting.linkMenuId = '' |
| | | config.setting.copyMenuId = '' |
| | | } else if (type === 'mobnavbar') { |
| | | delete config.open_edition |
| | | delete config.dataName |
| | | |
| | | config.menus.forEach(item => { |
| | | item.property = 'menu' |
| | | item.open = 'self' |
| | | |
| | | delete item.copyMenuId |
| | | delete item.clearMenu |
| | | delete item.linkMenuId |
| | | }) |
| | | } else if (config.type === 'menubar' && config.subtype === 'menubar') { |
| | | let cell = config.subMenus[0] |
| | | config.subMenus = [] |
| | | |
| | | if (cell) { |
| | | cell.setting.type = 'menu' |
| | | cell.setting.linkMenuId = '' |
| | | cell.setting.copyMenuId = '' |
| | | |
| | | config.subMenus.push(cell) |
| | | } |
| | | } else if (['normaltable', 'editable', 'basetable'].includes(type)) { |
| | | config.action = config.action.filter(item => !item.origin) |
| | | config.cols = config.cols.filter(item => !item.origin) |
| | | config.search = config.search.filter(item => !item.origin) |
| | | delete config.isNew |
| | | } |
| | | } |
| | | |
| | | trigger = () => { |
| | | const { card, type } = this.props |
| | | let _val = fromJS(card).toJS() |
| | | _val.copyType = type |
| | | |
| | | this.transConfig(_val, type) |
| | | |
| | | try { |
| | | delete _val.$srcId |
| | |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | | |
| | | if (type === 'menucell') { |
| | | _val.setting.type = 'linkmenu' |
| | | _val.setting.linkMenuId = '' |
| | | _val.setting.copyMenuId = '' |
| | | } else if (_val.type === 'menubar' && _val.subtype === 'menubar') { |
| | | let cell = _val.subMenus[0] |
| | | _val.subMenus = [] |
| | | |
| | | if (cell) { |
| | | cell.setting.type = 'menu' |
| | | cell.setting.linkMenuId = '' |
| | | cell.setting.copyMenuId = '' |
| | | |
| | | _val.subMenus.push(cell) |
| | | } |
| | | } else if (['normaltable', 'editable', 'basetable'].includes(type)) { |
| | | _val.action = _val.action.filter(item => !item.origin) |
| | | _val.cols = _val.cols.filter(item => !item.origin) |
| | | _val.search = _val.search.filter(item => !item.origin) |
| | | delete _val.isNew |
| | | } |
| | | |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) |
| | |
| | | .ant-input-number { |
| | | margin-top: 4px; |
| | | } |
| | | .normal-braft-editor { |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 4px; |
| | | } |
| | | } |
| | | .ant-form-item-control-wrapper::after { |
| | | content: ''; |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | // import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | |
| | | const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform')) |
| | | |
| | | class PasteController extends Component { |
| | |
| | | options = ['tabs', 'timeline', 'datacard', 'doublecard', 'propcard', 'cardatacard', 'carpropcard', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'editor', 'pie', 'scatter', 'iframe', 'sandbox'] |
| | | |
| | | if (appType === 'mob') { |
| | | options.push('menubar', 'singleSearch') |
| | | options.push('menubar', 'singleSearch', 'mobnavbar') |
| | | if (sessionStorage.getItem('editMenuType') !== 'popview') { |
| | | options.push('topbar') |
| | | } |
| | |
| | | }) |
| | | return |
| | | } |
| | | } else if (res.type === 'navbar') { |
| | | if (menu.components.findIndex(m => m.type === 'navbar') > -1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单栏不可重复添加!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | } else if (res.type === 'search') { |
| | | if (tab) { |
| | |
| | | |
| | | this.resetlink(res, commonId) |
| | | |
| | | this.props.insert(res) |
| | | |
| | | this.setState({visible: false}) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | let skip = true |
| | | if (appType === 'mob' && res.type === 'navbar') { |
| | | let appMenus = sessionStorage.getItem('appViewList') |
| | | if (appMenus) { |
| | | try { |
| | | appMenus = JSON.parse(appMenus) |
| | | appMenus = appMenus.filter(item => item.keys_type === 'navbar') |
| | | } catch (e) { |
| | | appMenus = [] |
| | | } |
| | | } else { |
| | | appMenus = [] |
| | | } |
| | | |
| | | if (appMenus.length) { |
| | | const that = this |
| | | skip = false |
| | | |
| | | confirm({ |
| | | title: '如需使用当前应用中已有的菜单栏,请点击右侧关联菜单栏,如需添加请点确定。', |
| | | onOk() { |
| | | that.props.insert(res) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (skip) { |
| | | this.props.insert(res) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | delete _config.autoMatic |
| | | |
| | | let useMSearch = false |
| | | |
| | | if (clear) { |
| | | _config.components = [] |
| | | } else { |
| | |
| | | tab.components[0].width = 24 |
| | | tab.components[0].wrap.width = 24 |
| | | tab.components[0].wrap.name = tab.components[0].name |
| | | if (tab.components[0].setting.useMSearch === 'true') { |
| | | useMSearch = true |
| | | } |
| | | |
| | | tab.components[0].action.forEach(btn => { |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | |
| | | }) |
| | | } |
| | | |
| | | if (useMSearch) { |
| | | if (_config.components[0].search && _config.components[0].search.length > 0) { |
| | | let cell = { |
| | | uuid: Utils.getuuid(), |
| | | type: 'search', |
| | | width: 24, |
| | | subtype: 'mainsearch', |
| | | name: '搜索', |
| | | search: _config.components[0].search || [], |
| | | search: _config.components[0].search, |
| | | style: {borderBottomColor: '#f0f0f0', borderBottomWidth: '1px'}, |
| | | wrap: {float: 'left', blacklist: [], name: '搜索', width: 24} |
| | | } |
| | |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const MenuComponent = asyncIconComponent(() => import('./menus')) |
| | | const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | |
| | | class NormalNavbar extends Component { |
| | | static propTpyes = { |
| | |
| | | <NormalForm title="菜单栏设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="mobnavbar" card={card}/> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle} /> |
| | | <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null} |
| | |
| | | .ant-input-number { |
| | | margin-top: 4px; |
| | | } |
| | | .normal-braft-editor { |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 4px; |
| | | } |
| | | } |
| | | .ant-form-item-control-wrapper::after { |
| | | content: ''; |
| | |
| | | .ant-input-number { |
| | | margin-top: 4px; |
| | | } |
| | | .normal-braft-editor { |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 4px; |
| | | } |
| | | } |
| | | .ant-form-item-control-wrapper::after { |
| | | content: ''; |
| | |
| | | min-width: 100px; |
| | | } |
| | | } |
| | | .normal-braft-editor { |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 4px; |
| | | overflow-x: hidden; |
| | | } |
| | | p { |
| | | color: #1890ff; |
| | | font-size: 15px; |
| | |
| | | } else if (card.type === 'textarea') { |
| | | formItem = (<TextArea value={card.initval} placeholder={card.placeholder || ''} autoSize={{ minRows: 2, maxRows: 6 }} />) |
| | | } else if (card.type === 'brafteditor') { |
| | | formItem = (<Editor />) |
| | | formItem = (<Editor config={{contHeidht: card.contHeidht}}/>) |
| | | } else if (card.type === 'fileupload') { |
| | | formItem = (<Button style={{marginTop: '3px'}}><UploadOutlined /> 点击上传 </Button>) |
| | | } else if (card.type === 'funcvar') { |
| | |
| | | min-width: 100px; |
| | | } |
| | | } |
| | | .normal-braft-editor { |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 4px; |
| | | } |
| | | } |
| | | .ant-form-item-control-wrapper::after { |
| | | content: ''; |
| | |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'contHeidht', |
| | | label: '高度', |
| | | min: 1, |
| | | max: 2000, |
| | | precision: 1, |
| | | initVal: card.contHeidht, |
| | | tooltip: '富文本编辑区的高度,小于100时为窗口的百分比。', |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'labelwidth', |
| | | min: 1, |
| | | max: 100, |
| | |
| | | hint: ['label', 'field', 'type', 'blacklist', 'supField', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |
| | | split: ['label', 'type', 'marginTop', 'marginBottom', 'splitline', 'splitctrl', 'supField', 'opacity'], |
| | | formula: ['label', 'type', 'marginTop', 'marginBottom', 'splitline', 'supField', 'span', 'labelwidth', 'formula', 'eval', 'postfix'], |
| | | brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption', 'marginTop', 'marginBottom'], |
| | | brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption', 'marginTop', 'marginBottom', 'contHeidht'], |
| | | funcvar: ['span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |
| | | linkMain: ['readonly', 'required', 'hidden','declare', 'span', 'labelwidth', 'tooltip', 'interception', 'extra', 'place', 'marginTop', 'marginBottom'], |
| | | popSelect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'enter', 'dataSource', 'columns', 'primaryKey', 'order', 'controlField', 'laypage', 'onload', 'searchKey', 'showField', 'popWidth'], |
| | |
| | | * @return {String} item 组件信息 |
| | | */ |
| | | static resetComponentConfig = (item, appType, commonId) => { |
| | | if (item.type === 'navbar') { |
| | | return item |
| | | } |
| | | |
| | | if (item.subtype === 'tablecard') { // 兼容 |
| | | item.type = 'card' |
| | | } |
| | |
| | | item.name = item.setting.name |
| | | } |
| | | |
| | | if (item.type === 'menubar') { |
| | | if (item.columns) { |
| | | item.columns = item.columns.map(cell => { |
| | | cell.uuid = this.getuuid() |
| | | return cell |
| | | }) |
| | | } |
| | | |
| | | if (item.type === 'navbar') { |
| | | if (appType === 'mob') { |
| | | item.menus.forEach(menu => { |
| | | menu.MenuID = this.getuuid() |
| | | }) |
| | | item.wrap.MenuNo = item.wrap.MenuNo + sign |
| | | } |
| | | return item |
| | | } else if (item.type === 'menubar') { |
| | | item.subMenus = item.subMenus.map(cell => { |
| | | cell.uuid = this.getuuid() |
| | | return cell |
| | |
| | | } |
| | | } else if (item.search) { |
| | | item.search = item.search.map(cell => { |
| | | cell.uuid = this.getuuid() |
| | | return cell |
| | | }) |
| | | } |
| | | if (item.columns) { |
| | | item.columns = item.columns.map(cell => { |
| | | cell.uuid = this.getuuid() |
| | | return cell |
| | | }) |