| | |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | return !is(fromJS(this.state), fromJS(nextState)) || !is(fromJS(this.props.children), fromJS(nextProps.children)) |
| | | } |
| | | |
| | | trigger = () => { |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { title, width, children } = this.props |
| | | const { title, width, children, double } = this.props |
| | | const { visible, dict, formlist } = this.state |
| | | |
| | | return ( |
| | | <div className="normal-form-wrap"> |
| | | <span onClick={this.trigger}>{children}</span> |
| | | <> |
| | | {!double ? <span onClick={this.trigger}>{children}</span> : <span onDoubleClick={this.trigger}>{children}</span>} |
| | | <Modal |
| | | wrapClassName="popview-modal" |
| | | title={title} |
| | |
| | | wrappedComponentRef={(inst) => this.Ref = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | </> |
| | | ) |
| | | } |
| | | } |
| | |
| | | .normal-form-wrap { |
| | | display: inline-block; |
| | | } |
| | |
| | | } else if (item.type === 'textarea') { |
| | | content = (<TextArea rows={item.rows || 2} placeholder=""/>) |
| | | } else if (item.type === 'mkicon') { |
| | | content = (<MkIcon />) |
| | | content = (<MkIcon allowClear={item.allowClear}/>) |
| | | } else if (item.type === 'source') { |
| | | content = (<SourceComponent type="" placement="right"/>) |
| | | } |
| | |
| | | const { confirm } = Modal |
| | | |
| | | const WrapComponent = asyncIconComponent(() => import('./wrapsetting')) |
| | | const FieldsComponent = asyncIconComponent(() => import('@/templates/sharecomponent/fieldscomponent')) |
| | | const SearchForm = asyncIconComponent(() => import('@/templates/sharecomponent/searchcomponent/searchform')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) |
| | |
| | | }) |
| | | } |
| | | |
| | | updatefields = (config) => { |
| | | this.setState({card: config}, ()=> { |
| | | this.props.updateConfig(config) |
| | | }) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | |
| | | return ( |
| | | <div className={`main-search-edit-list ${card.wrap.float} ${card.wrap.show || ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}> |
| | | <FieldsComponent config={card} type="search" updatefield={this.updatefields} /> |
| | | <Switch checkedChildren={dict['model.switch.open']} size="small" unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} /> |
| | | <DragElement |
| | | list={card.search} |
| | |
| | | margin-left: 5px; |
| | | } |
| | | } |
| | | .quickly-add { |
| | | position: absolute; |
| | | z-index: 3; |
| | | right: 55px; |
| | | bottom: 3px; |
| | | .ant-btn-block { |
| | | background-color: transparent; |
| | | color: #1890ff; |
| | | border: none; |
| | | box-shadow: none!important; |
| | | height: 18px; |
| | | padding: 0 10px; |
| | | } |
| | | } |
| | | } |
| | | .main-search-edit-list:not(.right) { |
| | | .pre-action { |
| | |
| | | funTypes = [ |
| | | { value: 'mkBinding', text: '开通扫码登录' }, |
| | | { value: 'mkUnBinding', text: '用户解绑' }, |
| | | { value: 'scan', text: '扫一扫' }, |
| | | { value: 'reAuth', text: '重新授权' }, |
| | | ] |
| | | } else { |
| | | opentypes = opentypes.filter(item => item.value !== 'tab') |
| | |
| | | return ( |
| | | <div className={`normal-table-columns ${config.setting.laypage} ${config.wrap.tableType} ${config.wrap.mode || ''}`} id={tableId}> |
| | | <div className="col-control"> |
| | | <Icon title="复制" type="copy" onClick={this.copycolumn} /> |
| | | <Icon title="复制显示列" type="copy" onClick={this.copycolumn} /> |
| | | <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} /> |
| | | <Icon title="同步" type="file-sync" onClick={this.syncfield} /> |
| | | <Icon title="同步字段集" type="file-sync" onClick={this.syncfield} /> |
| | | </div> |
| | | <DndProvider> |
| | | <Table |
| | |
| | | |
| | | render() { |
| | | const { order } = this.state |
| | | const { children } = this.props |
| | | const { children, ...resProps } = this.props |
| | | const tabs = [] |
| | | React.Children.forEach(children, c => { |
| | | tabs.push(c) |
| | |
| | | |
| | | return ( |
| | | <DndProvider> |
| | | <Tabs renderTabBar={this.renderTabBar} {...this.props}> |
| | | <Tabs renderTabBar={this.renderTabBar} {...resProps}> |
| | | {orderTabs} |
| | | </Tabs> |
| | | </DndProvider> |
| | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getTabForm from './options' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import './index.scss' |
| | | |
| | | const SettingComponent = asyncIconComponent(() => import('../tabsetting')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const PasteController = asyncIconComponent(() => import('@/menu/pastecontroller')) |
| | | const TabLabelComponent = asyncComponent(() => import('../tablabelform')) |
| | | const TabComponents = asyncComponent(() => import('../tabcomponents')) |
| | | |
| | | const { TabPane } = Tabs |
| | |
| | | appType: sessionStorage.getItem('appType'), |
| | | tabs: null, |
| | | editab: null, |
| | | labelvisible: false |
| | | defaultActiveKey: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | ] |
| | | } |
| | | this.setState({ |
| | | defaultActiveKey: _tabs.subtabs[0].uuid, |
| | | tabs: _tabs |
| | | }) |
| | | this.props.updateConfig(_tabs) |
| | | } else { |
| | | this.setState({ |
| | | defaultActiveKey: window.GLOB.TabsMap.get(tabs.uuid) || '', |
| | | tabs: fromJS(tabs).toJS() |
| | | }) |
| | | } |
| | |
| | | this.props.updateConfig(tabs) |
| | | } |
| | | |
| | | tabAdd = (e) => { |
| | | const { tabs } = this.state |
| | | |
| | | e.stopPropagation() |
| | | |
| | | this.setState({ |
| | | editab: { |
| | | uuid: '', |
| | | parentId: tabs.uuid, |
| | | floor: tabs.floor, |
| | | label: '', |
| | | icon: '', |
| | | components: [] |
| | | }, |
| | | labelvisible: true |
| | | }) |
| | | } |
| | | |
| | | editTab = (tab) => { |
| | | this.setState({ |
| | | editab: tab, |
| | | labelvisible: true |
| | | }) |
| | | } |
| | | |
| | | tabLabelSubmit = () => { |
| | | let tabs = fromJS(this.state.tabs).toJS() |
| | | let editab = fromJS(this.state.editab).toJS() |
| | | |
| | | this.tabLabelRef.handleConfirm().then(res => { |
| | | editab.label = res.label |
| | | editab.icon = res.icon |
| | | editab.hasSearch = res.hasSearch || '' |
| | | editab.blacklist = res.blacklist |
| | | |
| | | if (editab.uuid) { |
| | | tabs.subtabs = tabs.subtabs.map(t => { |
| | | if (t.uuid === editab.uuid) { |
| | | return editab |
| | | } else { |
| | | return t |
| | | } |
| | | }) |
| | | } else { |
| | | editab.uuid = Utils.getuuid() |
| | | tabs.subtabs.push(editab) |
| | | } |
| | | |
| | | this.setState({ |
| | | editab: null, |
| | | labelvisible: false, |
| | | tabs |
| | | }) |
| | | this.props.updateConfig(tabs) |
| | | }) |
| | | } |
| | | |
| | | delTab = (tab) => { |
| | | let tabs = fromJS(this.state.tabs).toJS() |
| | | const _this = this |
| | |
| | | } |
| | | } |
| | | |
| | | getTabForms = (tab) => { |
| | | const { tabs } = this.state |
| | | |
| | | if (!tab) { |
| | | tab = { |
| | | uuid: '', |
| | | parentId: tabs.uuid, |
| | | floor: tabs.floor, |
| | | label: '', |
| | | icon: '', |
| | | components: [] |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | editab: tab |
| | | }) |
| | | |
| | | return getTabForm(tab, tabs.setting) |
| | | } |
| | | |
| | | updateTab = (res) => { |
| | | let tabs = fromJS(this.state.tabs).toJS() |
| | | let editab = fromJS(this.state.editab).toJS() |
| | | |
| | | editab.label = res.label |
| | | editab.icon = res.icon |
| | | editab.hasSearch = res.hasSearch || '' |
| | | editab.blacklist = res.blacklist |
| | | |
| | | if (editab.uuid) { |
| | | tabs.subtabs = tabs.subtabs.map(t => { |
| | | if (t.uuid === editab.uuid) { |
| | | return editab |
| | | } else { |
| | | return t |
| | | } |
| | | }) |
| | | } else { |
| | | editab.uuid = Utils.getuuid() |
| | | tabs.subtabs.push(editab) |
| | | } |
| | | |
| | | this.setState({ |
| | | editab: null, |
| | | tabs |
| | | }) |
| | | |
| | | this.props.updateConfig(tabs) |
| | | } |
| | | |
| | | onChange = (key) => { |
| | | const { tabs } = this.state |
| | | window.GLOB.TabsMap.set(tabs.uuid, key) |
| | | } |
| | | |
| | | render() { |
| | | const { tabs, dict, labelvisible, editab, appType } = this.state |
| | | const { tabs, appType, defaultActiveKey } = this.state |
| | | let _style = resetStyle(tabs.style) |
| | | |
| | | return ( |
| | | <div className={'menu-tabs-edit-box ' + tabs.setting.display} style={_style} onClick={this.clickComponent} id={tabs.uuid}> |
| | | <DraggableTabs tabPosition={tabs.setting.position} type={tabs.setting.tabStyle} tabsMove={this.moveSwitch}> |
| | | <DraggableTabs defaultActiveKey={defaultActiveKey} tabPosition={tabs.setting.position} type={tabs.setting.tabStyle} tabsMove={this.moveSwitch} onChange={this.onChange}> |
| | | {tabs.subtabs.map(tab => ( |
| | | <TabPane tab={ |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="edit" title="edit" type="edit" onClick={() => this.editTab(tab)} /> |
| | | <NormalForm title="标签编辑" width={600} update={this.updateTab} getForms={() => this.getTabForms(tab)}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <PasteController type="tab" Tab={tab} insert={this.insert} /> |
| | | <Icon className="close" title="delete" type="close" onClick={() => this.delTab(tab)} /> |
| | | </div> |
| | |
| | | </DraggableTabs> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加标签" type="plus" onClick={this.tabAdd} /> |
| | | <NormalForm title="添加标签" width={600} update={this.updateTab} getForms={() => this.getTabForms()}> |
| | | <Icon type="plus" className="plus" title="添加标签"/> |
| | | </NormalForm> |
| | | <SettingComponent config={tabs} updateConfig={this.updateComponent} /> |
| | | <CopyComponent type="tabs" card={tabs}/> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | |
| | | } trigger="hover"> |
| | | <Icon type="tool" /> |
| | | </Popover> |
| | | <Modal |
| | | wrapClassName="popview-modal" |
| | | title={'标签编辑'} |
| | | visible={labelvisible} |
| | | width={600} |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | onOk={this.tabLabelSubmit} |
| | | onCancel={() => { this.setState({ labelvisible: false }) }} |
| | | destroyOnClose |
| | | > |
| | | <TabLabelComponent |
| | | dict={dict} |
| | | tab={editab} |
| | | setting={tabs.setting} |
| | | inputSubmit={this.tabLabelSubmit} |
| | | wrappedComponentRef={(inst) => this.tabLabelRef = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
New file |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (tab, setting) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | const tabForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'label', |
| | | label: '名称', |
| | | initval: tab.label || '', |
| | | required: true, |
| | | focus: true, |
| | | span: 22 |
| | | }, |
| | | { |
| | | type: 'mkicon', |
| | | field: 'icon', |
| | | label: '图标', |
| | | initval: tab.icon || '', |
| | | required: false, |
| | | allowClear: true, |
| | | span: 22 |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'hasSearch', |
| | | label: '搜索', |
| | | initval: tab.hasSearch || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'icon', label: '有'}, |
| | | ], |
| | | forbid: appType !== 'mob' || setting.position !== 'top' || setting.display !== 'inline-block', |
| | | span: 22 |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initval: tab.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType, |
| | | span: 22 |
| | | }, |
| | | ] |
| | | |
| | | return tabForm |
| | | } |
| | |
| | | type="fields" |
| | | updatefield={this.updatefields} |
| | | /> |
| | | <Icon type="copy" onClick={this.copyColumns} style={{position: 'absolute', cursor: 'pointer', zIndex: 1, top: '-35px', right: '0px', color: '#1890ff'}} /> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="datasourcefield" data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> |
| | | <Icon type="copy" title="复制字段" onClick={this.copyColumns} style={{position: 'absolute', cursor: 'pointer', zIndex: 1, top: '-35px', right: '0px', color: '#1890ff'}} /> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} type="datasourcefield" data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> |
| | | </TabPane> |
| | | <TabPane tab={ |
| | | <span> |
| | |
| | | |
| | | render() { |
| | | const { order } = this.state |
| | | const { children } = this.props |
| | | const { children, ...resProps } = this.props |
| | | const tabs = [] |
| | | React.Children.forEach(children, c => { |
| | | tabs.push(c) |
| | |
| | | |
| | | return ( |
| | | <DndProvider> |
| | | <Tabs renderTabBar={this.renderTabBar} {...this.props}> |
| | | <Tabs renderTabBar={this.renderTabBar} {...resProps}> |
| | | {orderTabs} |
| | | </Tabs> |
| | | </DndProvider> |
| | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getTabForm from './options' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import './index.scss' |
| | | |
| | | const SettingComponent = asyncIconComponent(() => import('@/menu/components/tabs/tabsetting')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const PasteController = asyncIconComponent(() => import('@/menu/pastecontroller')) |
| | | const TabLabelComponent = asyncComponent(() => import('@/menu/components/tabs/tablabelform')) |
| | | // const TabLabelComponent = asyncComponent(() => import('@/menu/components/tabs/tablabelform')) |
| | | const TabComponents = asyncComponent(() => import('../tabcomponents')) |
| | | |
| | | const { TabPane } = Tabs |
| | |
| | | appType: sessionStorage.getItem('appType'), |
| | | tabs: null, |
| | | editab: null, |
| | | labelvisible: false |
| | | defaultActiveKey: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | } |
| | | |
| | | this.setState({ |
| | | defaultActiveKey: _tabs.subtabs[0].uuid, |
| | | tabs: _tabs |
| | | }) |
| | | this.props.updateConfig(_tabs) |
| | | } else { |
| | | this.setState({ |
| | | defaultActiveKey: window.GLOB.TabsMap.get(tabs.uuid) || '', |
| | | tabs: fromJS(tabs).toJS() |
| | | }) |
| | | } |
| | |
| | | this.props.updateConfig(tabs) |
| | | } |
| | | |
| | | tabAdd = (e) => { |
| | | const { tabs } = this.state |
| | | |
| | | e.stopPropagation() |
| | | |
| | | this.setState({ |
| | | editab: { |
| | | uuid: '', |
| | | parentId: tabs.uuid, |
| | | floor: tabs.floor, |
| | | label: '', |
| | | icon: '', |
| | | components: [] |
| | | }, |
| | | labelvisible: true |
| | | }) |
| | | } |
| | | |
| | | editTab = (tab) => { |
| | | this.setState({ |
| | | editab: tab, |
| | | labelvisible: true |
| | | }) |
| | | } |
| | | |
| | | tabLabelSubmit = () => { |
| | | let tabs = fromJS(this.state.tabs).toJS() |
| | | let editab = fromJS(this.state.editab).toJS() |
| | | |
| | | this.tabLabelRef.handleConfirm().then(res => { |
| | | editab.label = res.label |
| | | editab.icon = res.icon |
| | | editab.hasSearch = res.hasSearch || '' |
| | | editab.blacklist = res.blacklist |
| | | |
| | | if (editab.uuid) { |
| | | tabs.subtabs = tabs.subtabs.map(t => { |
| | | if (t.uuid === editab.uuid) { |
| | | return editab |
| | | } else { |
| | | return t |
| | | } |
| | | }) |
| | | } else { |
| | | editab.uuid = Utils.getuuid() |
| | | tabs.subtabs.push(editab) |
| | | } |
| | | |
| | | this.setState({ |
| | | editab: null, |
| | | labelvisible: false, |
| | | tabs |
| | | }) |
| | | this.props.updateConfig(tabs) |
| | | }) |
| | | } |
| | | |
| | | delTab = (tab) => { |
| | | let tabs = fromJS(this.state.tabs).toJS() |
| | | const _this = this |
| | |
| | | MKEmitter.emit('changeSearch', card) |
| | | } |
| | | |
| | | getTabForms = (tab) => { |
| | | const { tabs } = this.state |
| | | |
| | | if (!tab) { |
| | | tab = { |
| | | uuid: '', |
| | | parentId: tabs.uuid, |
| | | floor: tabs.floor, |
| | | label: '', |
| | | icon: '', |
| | | components: [] |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | editab: tab |
| | | }) |
| | | |
| | | return getTabForm(tab, tabs.setting) |
| | | } |
| | | |
| | | updateTab = (res) => { |
| | | let tabs = fromJS(this.state.tabs).toJS() |
| | | let editab = fromJS(this.state.editab).toJS() |
| | | |
| | | editab.label = res.label |
| | | editab.icon = res.icon |
| | | editab.hasSearch = res.hasSearch || '' |
| | | editab.blacklist = res.blacklist |
| | | |
| | | if (editab.uuid) { |
| | | tabs.subtabs = tabs.subtabs.map(t => { |
| | | if (t.uuid === editab.uuid) { |
| | | return editab |
| | | } else { |
| | | return t |
| | | } |
| | | }) |
| | | } else { |
| | | editab.uuid = Utils.getuuid() |
| | | tabs.subtabs.push(editab) |
| | | } |
| | | |
| | | this.setState({ |
| | | editab: null, |
| | | tabs |
| | | }) |
| | | |
| | | this.props.updateConfig(tabs) |
| | | } |
| | | |
| | | onChange = (key) => { |
| | | const { tabs } = this.state |
| | | window.GLOB.TabsMap.set(tabs.uuid, key) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { tabs, dict, labelvisible, editab, appType } = this.state |
| | | const { tabs, appType, defaultActiveKey } = this.state |
| | | let _style = resetStyle(tabs.style) |
| | | let _tabStyle = resetStyle(tabs.tabStyle) |
| | | |
| | | return ( |
| | | <div className={'mob-tabs-edit-box ' + tabs.setting.display} style={_style} onClick={this.clickComponent} id={tabs.uuid}> |
| | | <DraggableTabs tabPosition={tabs.setting.position} type={tabs.setting.tabStyle} tabsMove={this.moveSwitch}> |
| | | <DraggableTabs defaultActiveKey={defaultActiveKey} tabPosition={tabs.setting.position} type={tabs.setting.tabStyle} tabsMove={this.moveSwitch} onChange={this.onChange}> |
| | | {tabs.subtabs.map(tab => ( |
| | | <TabPane tab={ |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="edit" title="edit" type="edit" onClick={() => this.editTab(tab)} /> |
| | | <NormalForm title="标签编辑" width={600} update={this.updateTab} getForms={() => this.getTabForms(tab)}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <PasteController type="tab" Tab={tab} insert={this.insert} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeTabStyle} type="font-colors" /> |
| | | <Icon className="close" title="delete" type="close" onClick={() => this.delTab(tab)} /> |
| | |
| | | </DraggableTabs> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加标签" type="plus" onClick={this.tabAdd} /> |
| | | <NormalForm title="添加标签" width={600} update={this.updateTab} getForms={() => this.getTabForms()}> |
| | | <Icon type="plus" className="plus" title="添加标签"/> |
| | | </NormalForm> |
| | | <SettingComponent config={tabs} updateConfig={this.updateComponent} /> |
| | | <CopyComponent type="tabs" card={tabs}/> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | |
| | | } trigger="hover"> |
| | | <Icon type="tool" /> |
| | | </Popover> |
| | | <Modal |
| | | wrapClassName="popview-modal" |
| | | title={'标签编辑'} |
| | | visible={labelvisible} |
| | | width={600} |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | onOk={this.tabLabelSubmit} |
| | | onCancel={() => { this.setState({ labelvisible: false }) }} |
| | | destroyOnClose |
| | | > |
| | | <TabLabelComponent |
| | | dict={dict} |
| | | tab={editab} |
| | | setting={tabs.setting} |
| | | inputSubmit={this.tabLabelSubmit} |
| | | wrappedComponentRef={(inst) => this.tabLabelRef = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
New file |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (tab, setting) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | const tabForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'label', |
| | | label: '名称', |
| | | initval: tab.label || '', |
| | | required: true, |
| | | focus: true, |
| | | span: 22 |
| | | }, |
| | | { |
| | | type: 'mkicon', |
| | | field: 'icon', |
| | | label: '图标', |
| | | initval: tab.icon || '', |
| | | required: false, |
| | | allowClear: true, |
| | | span: 22 |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'hasSearch', |
| | | label: '搜索', |
| | | initval: tab.hasSearch || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'icon', label: '有'}, |
| | | ], |
| | | forbid: appType !== 'mob' || setting.position !== 'top' || setting.display !== 'inline-block', |
| | | span: 22 |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initval: tab.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType, |
| | | span: 22 |
| | | }, |
| | | ] |
| | | |
| | | return tabForm |
| | | } |
| | |
| | | |
| | | let eTDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | const EditableContext = React.createContext() |
| | | const { confirm } = Modal |
| | | let dragingIndex = -1 |
| | | const { Paragraph } = Typography |
| | | |
| | |
| | | operation = { |
| | | title: (<div> |
| | | {eTDict['model.operation']} |
| | | {actions.includes('copy') ? ( |
| | | <span className="copy-control"> |
| | | <Icon type="copy" onClick={() => this.copy()} /> |
| | | <Icon type="snippets" onClick={this.paste} /> |
| | | </span> |
| | | ) : null} |
| | | <span className="copy-control"> |
| | | {actions.includes('copy') ? <Icon type="copy" title="复制" onClick={() => this.copy()} /> : null} |
| | | {actions.includes('copy') ? <Icon type="snippets" title="粘贴" onClick={this.paste} /> : null} |
| | | {actions.includes('clear') ? <Icon type="delete" title="清空" onClick={this.clear} /> : null} |
| | | </span> |
| | | </div>), |
| | | dataIndex: 'operation', |
| | | width: '140px', |
| | |
| | | this.setState({ editingKey: '' }) |
| | | } |
| | | |
| | | clear = () => { |
| | | const _this = this |
| | | |
| | | confirm({ |
| | | title: '确定清空列表吗?', |
| | | content: '', |
| | | onOk() { |
| | | _this.setState({ data: [], editingKey: '' }, () => { |
| | | _this.props.onChange([]) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | copy = (item) => { |
| | | const { type } = this.props |
| | | const { data } = this.state |
| | |
| | | .anticon-snippets { |
| | | color: purple; |
| | | } |
| | | .anticon-delete { |
| | | margin-left: 7px; |
| | | color: #ff4d4f; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | let _modularDetail = [] |
| | | let _billFields = [{ |
| | | field: 'BID', |
| | | label: 'BID', |
| | | type: 'text', |
| | | uuid: 'BID' |
| | | }] |
| | | let _billFields = [] |
| | | |
| | | if (this.props.modular.length > 0) { |
| | | _modularDetail = this.props.modularDetail.filter(item => item.BID === this.props.modular[0].ID) |
| | |
| | | |
| | | if (!hasBid) { // 唯一性验证添加BID |
| | | uniqueFields.unshift({ uuid: 'BID', field: 'BID', label: 'BID', type: 'text' }) |
| | | } |
| | | |
| | | if (!hasBid && (card.sqlType === 'insert' || card.sqlType === 'insertOrUpdate')) { // 表单中增加BID |
| | | _fields.unshift({ uuid: 'BID', field: 'BID', label: 'BID', type: 'text' }) |
| | | fieldArr.push('bid') |
| | | _declare.push(`@bid nvarchar(50)`) |
| | |
| | | sessionStorage.setItem('appType', '') // 应用类型 |
| | | document.body.className = '' |
| | | window.GLOB.UserComponentMap = new Map() // 缓存用户自定义组件 |
| | | window.GLOB.TabsMap = new Map() // 缓存用户操作的标签页 |
| | | window.GLOB.urlFields = [] // url变量 |
| | | window.GLOB.customMenu = null // 保存菜单信息 |
| | | |
| | |
| | | sessionStorage.setItem('appType', 'mob') // 应用类型 |
| | | document.body.className = '' |
| | | window.GLOB.UserComponentMap = new Map() // 缓存用户自定义组件 |
| | | window.GLOB.TabsMap = new Map() // 缓存用户操作的标签页 |
| | | window.GLOB.CacheIndependent = new Map() |
| | | window.GLOB.urlFields = [] // url变量 |
| | | window.GLOB.customMenu = null // 保存菜单信息 |
| | |
| | | sessionStorage.setItem('typename', 'pc') |
| | | document.body.className = '' |
| | | window.GLOB.UserComponentMap = new Map() // 缓存用户自定义组件 |
| | | window.GLOB.TabsMap = new Map() // 缓存用户操作的标签页 |
| | | window.GLOB.CacheIndependent = new Map() |
| | | window.GLOB.urlFields = [] // url变量 |
| | | window.GLOB.customMenu = null // 保存菜单信息 |