| | |
| | | margin-top: 7px; |
| | | overflow: hidden; |
| | | .color-sketch-block-box { |
| | | min-width: 100px; |
| | | min-width: 50px; |
| | | .color-sketch-block-inner { |
| | | box-shadow: 0 0 0 1px rgba(0, 0, 0, .1) inset; |
| | | } |
| | |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import DragElement from './dragsearch' |
| | | import getWrapForm from './options' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | |
| | | const WrapComponent = asyncIconComponent(() => import('./wrapsetting')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const FieldsComponent = asyncIconComponent(() => import('@/templates/sharecomponent/fieldscomponent')) |
| | | const SearchForm = asyncIconComponent(() => import('@/templates/sharecomponent/searchcomponent/searchform')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | |
| | | }) |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | const { wrap, action } = this.state.card |
| | | |
| | | return getWrapForm(wrap, action) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加" onClick={this.addSearch} type="plus" /> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent}/> |
| | | <NormalForm title="搜索设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="mainsearch" card={card}/> |
| | | <PasteComponent config={card} options={['search', 'form']} updateConfig={this.checkComponent} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
New file |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, action = []) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch (e) { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | const wrapForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'name', |
| | | label: '组件名称', |
| | | initval: wrap.name || '', |
| | | tooltip: '用于组件间的区分。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initval: wrap.width || 24, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'advanceWidth', |
| | | label: '高级搜索', |
| | | initval: wrap.advanceWidth || 1000, |
| | | tooltip: '高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。', |
| | | min: 10, |
| | | max: 3000, |
| | | precision: 0, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'float', |
| | | label: '对齐', |
| | | initval: wrap.float || 'left', |
| | | tooltip: '右对齐时,隐藏搜索按钮。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'left', label: '左对齐'}, |
| | | {value: 'right', label: '右对齐'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'show', |
| | | label: '搜索按钮', |
| | | initval: wrap.show || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | | {value: 'false', label: '隐藏'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | ] |
| | | |
| | | return wrapForm |
| | | } |
| | |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import getWrapForm from './options' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | |
| | | import './index.scss' |
| | | |
| | | const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const SearchComponent = asyncComponent(() => import('@/templates/sharecomponent/searchcomponent')) |
| | | const ActionComponent = asyncComponent(() => import('@/menu/components/share/actioncomponent')) |
| | | const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) |
| | |
| | | const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) |
| | | const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent')) |
| | | const ColumnComponent = asyncComponent(() => import('./columns')) |
| | | const WrapComponent = asyncIconComponent(() => import('./wrapsetting')) |
| | | |
| | | class TableCardEditComponent extends Component { |
| | | static propTpyes = { |
| | |
| | | } |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | const { wrap, action } = this.state.card |
| | | |
| | | return getWrapForm(wrap, action) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | <Icon className="plus" title="添加列" onClick={this.addColumns} type="plus" /> |
| | | {appType !== 'mob' ? <Icon className="plus" title="添加搜索" onClick={this.addSearch} type="plus-circle" /> : null} |
| | | <Icon className="plus" title="添加按钮" onClick={this.addButton} type="plus-square" /> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent} /> |
| | | <NormalForm title="表格设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="normaltable" card={card}/> |
| | | <PasteComponent config={card} options={['action', 'search', 'form', 'cols']} updateConfig={this.updateComponent} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
New file |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, action = []) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch (e) { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | const wrapForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'title', |
| | | label: '标题', |
| | | initval: wrap.title || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'name', |
| | | label: '组件名称', |
| | | initval: wrap.name || '', |
| | | tooltip: '用于组件间的区分。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'tableType', |
| | | label: '表格属性', |
| | | initval: wrap.tableType, |
| | | required: false, |
| | | options: [ |
| | | {value: '', label: '不可选'}, |
| | | {value: 'radio', label: '单选'}, |
| | | {value: 'checkbox', label: '多选'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'bordered', |
| | | label: '边框', |
| | | initval: wrap.bordered || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '有'}, |
| | | {value: 'false', label: '无'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'tableHeader', |
| | | label: '表头', |
| | | initval: wrap.tableHeader || 'show', |
| | | required: false, |
| | | options: [ |
| | | {value: 'show', label: '显示'}, |
| | | {value: 'hidden', label: '隐藏'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'collapse', |
| | | label: '可收起', |
| | | initval: wrap.collapse || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'size', |
| | | label: '表格大小', |
| | | initval: wrap.size || 'middle', |
| | | required: false, |
| | | options: [ |
| | | {value: 'default', label: '大'}, |
| | | {value: 'middle', label: '中'}, |
| | | {value: 'small', label: '小'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'mode', |
| | | label: '模式', |
| | | initval: wrap.mode || 'default', |
| | | required: false, |
| | | options: [ |
| | | {value: 'default', label: '常规'}, |
| | | {value: 'ghost', label: '透明'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'color', |
| | | field: 'borderColor', |
| | | label: '边框颜色', |
| | | initval: wrap.borderColor || '#e8e8e8', |
| | | tooltip: '默认值 #e8e8e8。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'color', |
| | | field: 'color', |
| | | label: '字体颜色', |
| | | initval: wrap.color || 'rgba(0, 0, 0, 0.65)', |
| | | tooltip: '默认值 rgba(0, 0, 0, 0.65)。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'fontSize', |
| | | label: '字体大小', |
| | | initval: wrap.fontSize || 24, |
| | | min: 12, |
| | | max: 30, |
| | | precision: 0, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initval: wrap.width || 24, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'advanceWidth', |
| | | label: '高级搜索', |
| | | initval: wrap.advanceWidth || 1000, |
| | | tooltip: '高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。', |
| | | min: 10, |
| | | max: 3000, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'doubleClick', |
| | | label: '双击事件', |
| | | initval: wrap.doubleClick || '', |
| | | tooltip: '双击表格中行,触发的按钮。', |
| | | required: false, |
| | | allowClear: true, |
| | | options: action.map(item => ({value: item.uuid, label: item.label})), |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | ] |
| | | |
| | | return wrapForm |
| | | } |
| | |
| | | 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 { getTabForm, getTabsSetForm } 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')) |
| | |
| | | this.props.updateConfig(tabs) |
| | | } |
| | | |
| | | getTabsForms = () => { |
| | | const { tabs } = this.state |
| | | |
| | | return getTabsSetForm(tabs.setting) |
| | | } |
| | | |
| | | updateTabs = (res) => { |
| | | this.updateComponent({...this.state.tabs, setting: res}) |
| | | } |
| | | |
| | | onChange = (key) => { |
| | | const { tabs } = this.state |
| | | window.GLOB.TabsMap.set(tabs.uuid, key) |
| | |
| | | <NormalForm title="添加标签" width={600} update={this.updateTab} getForms={() => this.getTabForms()}> |
| | | <Icon type="plus" className="plus" title="添加标签"/> |
| | | </NormalForm> |
| | | <SettingComponent config={tabs} updateConfig={this.updateComponent} /> |
| | | <NormalForm title="标签页设置" width={700} update={this.updateTabs} getForms={this.getTabsForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="tabs" card={tabs}/> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(tabs.uuid)} /> |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | * @description tab表单配置信息 |
| | | */ |
| | | export default function (tab, setting) { |
| | | export function getTabForm(tab, setting) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | |
| | |
| | | ] |
| | | |
| | | return tabForm |
| | | } |
| | | |
| | | /** |
| | | * @description tabs表单配置信息 |
| | | */ |
| | | export function getTabsSetForm(setting) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch (e) { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | const tabForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'name', |
| | | label: '组件名称', |
| | | initval: setting.name || '', |
| | | tooltip: '用于组件间的区分。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initval: setting.width || 24, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'position', |
| | | label: '标签位置', |
| | | initval: setting.position || 'top', |
| | | required: true, |
| | | options: [ |
| | | {value: 'top', label: 'top'}, |
| | | {value: 'bottom', label: 'bottom'}, |
| | | {value: 'left', label: 'left'}, |
| | | {value: 'right', label: 'right'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'display', values: ['top', 'bottom']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'tabStyle', |
| | | label: '页签样式', |
| | | initval: setting.tabStyle || 'line', |
| | | tooltip: '标签位置为top时有效,默认值为line。', |
| | | required: true, |
| | | options: [ |
| | | {value: 'line', label: 'line'}, |
| | | {value: 'card', label: 'card'}, |
| | | ], |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'display', |
| | | label: '标签显示', |
| | | initval: setting.display || 'flex', |
| | | required: false, |
| | | options: [ |
| | | {value: 'flex', label: '弹性布局'}, |
| | | {value: 'inline-block', label: '定宽'}, |
| | | ], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initval: setting.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | ] |
| | | |
| | | return tabForm |
| | | } |
| | |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import getWrapForm 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/datasource')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) |
| | | const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent')) |
| | | const WrapComponent = asyncIconComponent(() => import('./wrapsetting')) |
| | | |
| | | const { TreeNode } = Tree |
| | | |
| | |
| | | this.props.updateConfig(config) |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | const { wrap, columns } = this.state.card |
| | | |
| | | return getWrapForm(wrap, columns) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | <NormalHeader config={card} updateComponent={this.updateComponent}/> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent} /> |
| | | <NormalForm title="基本设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="normaltable" card={card}/> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <ClockComponent config={card} updateConfig={this.updateComponent}/> |
New file |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, columns = []) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch (e) { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | const wrapForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'title', |
| | | label: '标题', |
| | | initval: wrap.title || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'name', |
| | | label: '组件名称', |
| | | initval: wrap.name || '', |
| | | tooltip: '用于组件间的区分。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'valueField', |
| | | label: 'Value', |
| | | initval: wrap.valueField || '', |
| | | tooltip: '数据值字段。', |
| | | required: true, |
| | | options: columns |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'labelField', |
| | | label: 'Label', |
| | | initval: wrap.labelField || '', |
| | | tooltip: '显示文字字段。', |
| | | required: true, |
| | | options: columns |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'parentField', |
| | | label: 'Parent', |
| | | initval: wrap.parentField || '', |
| | | tooltip: '父级字段。', |
| | | required: true, |
| | | options: columns |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'mark', |
| | | label: '顶级标识', |
| | | initval: wrap.mark || '', |
| | | tooltip: '父级字段值与顶级标识相同时,视为顶级节点。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initval: wrap.width || 24, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'showIcon', |
| | | label: '图标', |
| | | initval: wrap.showIcon || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | | {value: 'false', label: '隐藏'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'showLine', |
| | | label: '分割线', |
| | | initval: wrap.showLine || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | | {value: 'false', label: '隐藏'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'searchable', |
| | | label: '过滤条件', |
| | | initval: wrap.searchable || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | | {value: 'false', label: '隐藏'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | ] |
| | | |
| | | return wrapForm |
| | | } |
| | |
| | | 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 { getTabForm, getTabsSetForm } 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')) |
| | |
| | | this.props.updateConfig(tabs) |
| | | } |
| | | |
| | | getTabsForms = () => { |
| | | const { tabs } = this.state |
| | | |
| | | return getTabsSetForm(tabs.setting) |
| | | } |
| | | |
| | | updateTabs = (res) => { |
| | | this.updateComponent({...this.state.tabs, setting: res}) |
| | | } |
| | | |
| | | onChange = (key) => { |
| | | const { tabs } = this.state |
| | | window.GLOB.TabsMap.set(tabs.uuid, key) |
| | |
| | | <NormalForm title="添加标签" width={600} update={this.updateTab} getForms={() => this.getTabForms()}> |
| | | <Icon type="plus" className="plus" title="添加标签"/> |
| | | </NormalForm> |
| | | <SettingComponent config={tabs} updateConfig={this.updateComponent} /> |
| | | <NormalForm title="标签页设置" width={700} update={this.updateTabs} getForms={this.getTabsForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="tabs" card={tabs}/> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(tabs.uuid)} /> |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (tab, setting) { |
| | | export function getTabForm(tab, setting) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | |
| | |
| | | ] |
| | | |
| | | return tabForm |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description tabs表单配置信息 |
| | | */ |
| | | export function getTabsSetForm(setting) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch (e) { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | const tabForm = [ |
| | | { |
| | | type: 'text', |
| | | field: 'name', |
| | | label: '组件名称', |
| | | initval: setting.name || '', |
| | | tooltip: '用于组件间的区分。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initval: setting.width || 24, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'position', |
| | | label: '标签位置', |
| | | initval: setting.position || 'top', |
| | | required: true, |
| | | options: [ |
| | | {value: 'top', label: 'top'}, |
| | | {value: 'bottom', label: 'bottom'}, |
| | | {value: 'left', label: 'left'}, |
| | | {value: 'right', label: 'right'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'display', values: ['top', 'bottom']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'tabStyle', |
| | | label: '页签样式', |
| | | initval: setting.tabStyle || 'line', |
| | | tooltip: '标签位置为top时有效,默认值为line。', |
| | | required: true, |
| | | options: [ |
| | | {value: 'line', label: 'line'}, |
| | | {value: 'card', label: 'card'}, |
| | | ], |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'display', |
| | | label: '标签显示', |
| | | initval: setting.display || 'flex', |
| | | required: false, |
| | | options: [ |
| | | {value: 'flex', label: '弹性布局'}, |
| | | {value: 'inline-block', label: '定宽'}, |
| | | ], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initval: setting.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | }, |
| | | ] |
| | | |
| | | return tabForm |
| | | } |
| | |
| | | try { |
| | | let pageParam = JSON.parse(window.decodeURIComponent(window.atob(item.menus_rolelist))) |
| | | item.nodes = pageParam |
| | | if (pageParam.type === 'navbar') { |
| | | if (pageParam.login) { |
| | | item.nodes = '' |
| | | } else if (pageParam.type === 'navbar') { |
| | | item.type = 'navbar' |
| | | } |
| | | } catch (e) { |