| | |
| | | let btn = cards.action[index] |
| | | btn.eleType = 'button' |
| | | |
| | | if (!btn.width) { |
| | | btn.width = 12 |
| | | } |
| | | if (btn.color) { |
| | | btn.style = btn.style || {} |
| | | btn.style.color = '#ffffff' |
| | | if (btn.color === 'primary') { |
| | | btn.style.backgroundColor = '#1677ff' |
| | | } else if (btn.color === 'danger') { |
| | | btn.style.backgroundColor = '#ff3141' |
| | | } else if (btn.color === 'warning') { |
| | | btn.style.backgroundColor = '#ff8f1f' |
| | | } else if (btn.color === 'success') { |
| | | btn.style.backgroundColor = '#00b578' |
| | | } else if (btn.color === 'light') { |
| | | btn.style.backgroundColor = '#cccccc' |
| | | } |
| | | } |
| | | |
| | | let _elements = [...this.state.elements, btn] |
| | | |
| | | this.setState({ |
| | |
| | | const { TextArea } = Input |
| | | const MkIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | const actionTypeOptions = { |
| | | pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'], |
| | | prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'], |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'], |
| | | pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'], |
| | | prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'], |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width'], |
| | | excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'resetPageIndex', 'pagination', 'search', 'width'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement', 'syncComponent', 'clickouter'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'color', 'width', 'open'], |
| | | funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'color', 'width'] |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'open'], |
| | | funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width'] |
| | | } |
| | | |
| | | class ActionForm extends Component { |
| | |
| | | if (_control) { |
| | | _options.push('controlField', 'controlVal') |
| | | } |
| | | } |
| | | if (_Ot === 'requiredSgl' && ['pop', 'prompt', 'exec'].includes(_opentype)) { |
| | | _options.push('swipe') |
| | | } |
| | | |
| | | return _options |
| | |
| | | |
| | | return ( |
| | | <div className="single-search-edit-list" onClick={this.clickComponent} id={card.uuid} style={_style}> |
| | | <div className="search-wrap" style={{borderRadius: card.wrap.borderRadius || 0}}> |
| | | <Input placeholder={card.wrap.label} value={card.initval} /> |
| | | {card.wrap.scan === 'show' ? <Icon type="scan" /> : null} |
| | | <div className="search-wrap" style={{borderRadius: card.wrap.borderRadius || 0, height: card.wrap.height || 32}}> |
| | | <Input placeholder={card.wrap.label} value={card.wrap.initval || ''} /> |
| | | {card.wrap.scan === 'show' ? <Icon type="scan" style={{lineHeight: `${card.wrap.height || 32}px`}} /> : null} |
| | | {card.wrap.show === 'text' ? <Button type="primary">搜索</Button> : <Button icon="search" type="primary"></Button>} |
| | | </div> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | |
| | | .ant-input { |
| | | flex: 1; |
| | | border-radius: 0; |
| | | height: 100%; |
| | | } |
| | | .anticon-scan { |
| | | font-size: 18px; |
| | | padding: 5px; |
| | | padding: 0px 10px; |
| | | color: #959595; |
| | | } |
| | | .ant-btn { |
| | |
| | | position: relative; |
| | | right: -1px; |
| | | min-width: 45px; |
| | | height: 100%; |
| | | } |
| | | } |
| | | } |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'initval', |
| | | label: '初始值', |
| | | initval: wrap.initval || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'required', |
| | | label: '必填', |
| | | initval: wrap.required || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'match', |
| | | label: '匹配方式', |
| | | initval: wrap.match || 'like', |
| | | required: true, |
| | | options: [ |
| | | {value: 'like', label: 'like'}, |
| | | {value: 'not like', label: 'not like'}, |
| | | {value: '=', label: '='}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'show', |
| | | label: '搜索样式', |
| | |
| | | precision: 0, |
| | | initval: wrap.borderRadius || 0, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'height', |
| | | label: '高度', |
| | | min: 28, |
| | | max: 150, |
| | | precision: 0, |
| | | initval: wrap.height || 32, |
| | | required: false |
| | | } |
| | | ] |
| | | |
| | |
| | | import SandBox from '@/assets/mobimg/sandbox.png' |
| | | import Pie1 from '@/assets/mobimg/ring.png' |
| | | import Pie2 from '@/assets/mobimg/nightingale.png' |
| | | import Mainsearch from '@/assets/mobimg/mainsearch.png' |
| | | import singlesearch from '@/assets/mobimg/singlesearch.png' |
| | | import Navbar from '@/assets/mobimg/navbar-mob.png' |
| | | import Carousel from '@/assets/mobimg/carousel.png' |
| | | import Carousel1 from '@/assets/mobimg/carousel1.png' |
| | |
| | | { type: 'menu', url: Navbar, component: 'navbar', subtype: 'tabbar', title: '菜单栏' }, |
| | | { type: 'menu', url: MenuBar, component: 'menubar', subtype: 'menubar', title: '菜单' }, |
| | | { type: 'menu', url: tabs, component: 'tabs', subtype: 'tabs', title: '标签页', width: 24 }, |
| | | { type: 'menu', url: Mainsearch, component: 'search', subtype: 'mainsearch', title: '搜索条件', width: 24 }, |
| | | { type: 'menu', url: singlesearch, component: 'search', subtype: 'mainsearch', title: '搜索条件', width: 24 }, |
| | | { type: 'menu', url: card1, component: 'card', subtype: 'datacard', title: '数据卡', width: 24 }, |
| | | { type: 'menu', url: card2, component: 'card', subtype: 'propcard', title: '属性卡', width: 24 }, |
| | | { type: 'menu', url: card2, component: 'balcony', subtype: 'balcony', title: '浮动卡', width: 24 }, |
| | |
| | | verifyConfig = (show) => { |
| | | const { config } = this.state |
| | | let error = '' |
| | | let searchSum = 0 |
| | | let swipes = [] |
| | | |
| | | let check = (components) => { |
| | | components.forEach(item => { |
| | |
| | | return |
| | | } else if (item.type === 'navbar' && !item.wrap.MenuNo) { |
| | | error = `导航栏《${item.name}》未设置菜单参数!` |
| | | } else if (item.type === 'topbar') { |
| | | if (item.wrap.type === 'search' || item.wrap.type === 'searchIcon' || (item.wrap.type === 'navbar' && item.wrap.search === 'true')) { |
| | | searchSum += 1 |
| | | } |
| | | } else if (item.type === 'search') { |
| | | searchSum += 1 |
| | | if (!item.wrap.field) { |
| | | error = `搜索条件《${item.name}》未设置搜索字段!` |
| | | } |
| | | } |
| | | if (item.wrap && item.wrap.pagestyle === 'slide') { |
| | | swipes.push(item.name) |
| | | } |
| | | |
| | | if (['propcard', 'brafteditor', 'sandbox', 'tabbar', 'stepform', 'tabform'].includes(item.subtype) && item.wrap.datatype === 'static') return |
| | |
| | | |
| | | check(config.components) |
| | | |
| | | if (!error && searchSum > 1) { |
| | | error = '搜索组件与导航栏的搜索功能不可同时使用。' |
| | | } else if (!error && swipes.length > 1) { |
| | | error = `页面中不可同时使用多个滑动加载组件。(${swipes.join('、')})` |
| | | } |
| | | |
| | | if (show && error) { |
| | | notification.warning({ |
| | | top: 92, |