| | |
| | | } |
| | | |
| | | setSize = (width, height) => { |
| | | if (!this.ImageWrapDom) return |
| | | const { clientWidth, clientHeight } = this.ImageWrapDom |
| | | |
| | | if (!clientWidth || !clientHeight || !width || !height) return |
| | |
| | | 'model.form.excelOut': 'Export excel', |
| | | 'model.form.newpage': 'The new page', |
| | | 'model.form.newpage.type': 'Page type', |
| | | 'model.form.newpage.url': 'Page address', |
| | | 'model.pageUrl': 'Page address', |
| | | 'model.form.prompt': 'Prompt', |
| | | 'model.form.exec': 'Direct execution', |
| | | 'model.form.paramJoint': 'Joint param', |
| | |
| | | 'model.form.excelOut': '导出Excel', |
| | | 'model.form.newpage': '新页面', |
| | | 'model.form.newpage.type': '页面类型', |
| | | 'model.form.newpage.url': '页面地址', |
| | | 'model.pageUrl': '页面地址', |
| | | 'model.form.prompt': '提示框', |
| | | 'model.form.exec': '直接执行', |
| | | 'model.form.paramJoint': '拼接参数', |
| | |
| | | const Video = asyncComponent(() => import('@/components/video')) |
| | | const MarkColumn = asyncIconComponent(() => import('@/menu/components/share/markcomponent')) |
| | | |
| | | const Card = ({ id, parent, fields, card, moveCard, findCard, editCard, delCard, copyCard, changeStyle, updateMarks }) => { |
| | | const Card = ({ id, parent, fields, card, moveCard, findCard, editCard, delCard, copyCard, changeStyle, updateMarks, doubleClickCard }) => { |
| | | const originalIndex = findCard(id).index |
| | | const [{ isDragging }, drag] = useDrag({ |
| | | item: { type: 'action', id, originalIndex }, |
| | |
| | | } else if (card.eleType === 'text' || card.eleType === 'number') { |
| | | let val = `${card.prefix || ''}${card.datatype === 'static' ? (card.value || '') : (card.field || '')}${card.postfix || ''}` |
| | | return ( |
| | | <div className={'ant-mk-text line' + card.height} style={{height: card.innerHeight || 21}}>{val}</div> |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | ) |
| | | } else if (card.eleType === 'icon') { |
| | | return (<Icon type={card.icon}/>) |
| | |
| | | </div> |
| | | } trigger="hover"> |
| | | <div ref={node => drag(drop(node))} className={'ant-col card-cell ant-col-' + card.width}> |
| | | <div style={_style} onClick={clickComponent} id={card.uuid}> |
| | | <div style={_style} onClick={clickComponent} onDoubleClick={() => doubleClickCard(id)} id={card.uuid}> |
| | | {getContent()} |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | const doubleClickCard = id => { |
| | | const { card } = findCard(id) |
| | | |
| | | if (card.eleType !== 'button' && card.eleType !== 'text' && card.eleType !== 'picture') { |
| | | return |
| | | } |
| | | |
| | | handleSubConfig(card) |
| | | } |
| | | |
| | |
| | | editCard={editCard} |
| | | updateMarks={updateMarks} |
| | | changeStyle={changeStyle} |
| | | doubleClickCard={doubleClickCard} |
| | | delCard={delCard} |
| | | findCard={findCard} |
| | | /> |
| | |
| | | font-weight: inherit; |
| | | text-decoration: inherit; |
| | | } |
| | | .ant-mk-text:not(.line1) { |
| | | .ant-mk-text:not(.line1):not(.line) { |
| | | word-break: break-word; |
| | | display: -webkit-box; |
| | | -webkit-box-orient: vertical; |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) |
| | | const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) |
| | | |
| | |
| | | item.required = card.eleType !== 'qrcode' |
| | | } |
| | | if (item.key === 'linkurl') { |
| | | item.type = card.link === 'dynamic' ? 'select' : 'text' |
| | | item.type = card.link === 'dynamic' ? 'select' : 'textarea' |
| | | } |
| | | |
| | | return item |
| | |
| | | } |
| | | |
| | | if (['text', 'picture'].includes(eleType) && link) { |
| | | _options.push('linkurl', 'joint') |
| | | if (link === 'dynamic' || link === 'static' || link === 'custom') { |
| | | _options.push('linkurl', 'joint') |
| | | } else if (link === 'page') { |
| | | _options.push('copyMenuId', 'joint') |
| | | } else if (link === 'linkpage') { |
| | | _options.push('linkmenu', 'joint') |
| | | } |
| | | } |
| | | } else if (eleType === 'icon') { |
| | | if (datatype === 'dynamic') { |
| | |
| | | */ |
| | | selectChange = (key, value, option) => { |
| | | const { config } = this.props |
| | | const { datatype } = this.state |
| | | const { datatype, eleType } = this.state |
| | | |
| | | if (key === 'eleType') { |
| | | let _options = this.getOptions(value, datatype, '') |
| | |
| | | if (this.props.form.getFieldValue('value') !== undefined) { |
| | | this.props.form.setFieldsValue({value: option.props.title}) |
| | | } |
| | | } else if (key === 'link') { |
| | | let _options = this.getOptions(eleType, this.state.datatype, value) |
| | | this.setState({ |
| | | link: value, |
| | | formlist: this.state.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | | if (item.key === 'linkurl') { |
| | | item.type = value === 'dynamic' ? 'select' : 'textarea' |
| | | } |
| | | return item |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | formlist: this.state.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | | if (item.key === 'linkurl') { |
| | | item.type = value === 'dynamic' ? 'select' : 'text' |
| | | item.type = value === 'dynamic' ? 'select' : 'textarea' |
| | | } |
| | | return item |
| | | }) |
| | |
| | | const fields = [] |
| | | |
| | | this.state.formlist.forEach((item, index) => { |
| | | if (item.hidden) return |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | if (item.type === 'text') { // 文本搜索 |
| | | let rules = [] |
| | | |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | |
| | | { |
| | | max: formRule.input.max, |
| | | message: formRule.input.message |
| | | }, |
| | | ...rules |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'number') { |
| | | } else if (item.type === 'textarea') { // 文本搜索 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Col span={24} className="textarea" key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: item.readonly ? false : !!item.required, |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={item.min || 0} max={item.max || 10000} precision={item.precision || 0} onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'select') { // 下拉搜索 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: this.props.dict['form.required.select'] + item.label + '!' |
| | | required: item.readonly ? false : !!item.required, |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | }, |
| | | { |
| | | max: formRule.input.max, |
| | | message: formRule.input.message |
| | | } |
| | | ] |
| | | })(<TextArea rows={2} disabled={item.readonly} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'number') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [{ |
| | | required: item.readonly ? false : !!item.required, |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | }] |
| | | })(<InputNumber min={item.min || 0} max={item.max || 10000} precision={item.precision || 0} onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'select') { // 下拉搜索 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [{ |
| | | required: !!item.required, |
| | | message: this.props.dict['form.required.select'] + item.label + '!' |
| | | }] |
| | | })( |
| | | <Select |
| | | showSearch |
| | |
| | | } else if (item.type === 'radio') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: this.props.dict['form.required.select'] + item.label + '!' |
| | | } |
| | | ] |
| | | rules: [{ |
| | | required: !!item.required, |
| | | message: this.props.dict['form.required.select'] + item.label + '!' |
| | | }] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onChange(e, item.key)}} disabled={item.readonly}> |
| | | { |
| | | item.options.map(option => { |
| | | return ( |
| | | <Radio key={option.value} value={option.value}>{option.text}</Radio> |
| | | ) |
| | | }) |
| | | } |
| | | {item.options.map(option => { |
| | | return ( |
| | | <Radio key={option.value} value={option.value}>{option.text}</Radio> |
| | | ) |
| | | })} |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | |
| | | if (!err) { |
| | | values.uuid = this.props.card.uuid |
| | | values.marks = this.props.card.marks || null |
| | | |
| | | // if (values.eleType === 'picture' && values.datatype === 'static' && !values.url) { |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: '尚未添加图片或图片上传失败,请重新添加!', |
| | | // duration: 5 |
| | | // }) |
| | | // return |
| | | // } |
| | | |
| | | resolve(values) |
| | | } else { |
| | |
| | | margin-right: 5px; |
| | | } |
| | | } |
| | | .ant-col { |
| | | height: 65px; |
| | | >.ant-row { |
| | | >.ant-col { |
| | | height: 65px; |
| | | } |
| | | .ant-col.textarea { |
| | | height: 80px; |
| | | .ant-form-item-label { |
| | | width: 14.2%; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | width: 85.8%; |
| | | } |
| | | } |
| | | } |
| | | .color-form { |
| | | .ant-form-item-control { |
| | |
| | | if (type === 'table') { |
| | | _options.push({value: 'sequence', text: '序号'}) |
| | | } |
| | | let appMenus = [] |
| | | const isApp = sessionStorage.getItem('appType') === 'pc' |
| | | |
| | | if (isApp) { |
| | | appMenus = sessionStorage.getItem('appMenus') |
| | | if (appMenus) { |
| | | try { |
| | | appMenus = JSON.parse(appMenus) |
| | | appMenus = appMenus.map(item => ({value: item.MenuID, text: item.MenuName})) |
| | | } catch { |
| | | appMenus = [] |
| | | } |
| | | } else { |
| | | appMenus = [] |
| | | } |
| | | } |
| | | |
| | | let forms = [ |
| | | { |
| | |
| | | key: 'link', |
| | | label: '链接', |
| | | initVal: card.link || '', |
| | | tooltip: '动态地址为绑定字段值。', |
| | | required: false, |
| | | forbid: isApp, |
| | | options: [ |
| | | { value: '', text: '无' }, |
| | | { value: 'dynamic', text: '动态' }, |
| | |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'link', |
| | | label: '链接', |
| | | initVal: card.link || '', |
| | | required: false, |
| | | forbid: !isApp, |
| | | options: [ |
| | | { value: '', text: '无' }, |
| | | { value: 'page', text: '菜单' }, |
| | | { value: 'linkpage', text: '关联菜单' }, |
| | | { value: 'custom', text: '链接' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'linkmenu', |
| | | label: '关联菜单', |
| | | initVal: card.linkmenu || '', |
| | | required: true, |
| | | forbid: !isApp, |
| | | options: appMenus |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'copyMenuId', |
| | | label: '复制菜单', |
| | | initVal: card.copyMenuId || '', |
| | | required: false, |
| | | forbid: !isApp, |
| | | options: appMenus |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'linkurl', |
| | | label: '链接地址', |
| | | initVal: card.linkurl || '', |
| | |
| | | |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | let line = _card.height || 1 |
| | | let line = _card.height || null |
| | | |
| | | if (_card.style.fontSize) { |
| | | fontSize = parseInt(_card.style.fontSize) |
| | |
| | | lineHeight = parseFloat(_card.style.lineHeight) |
| | | } |
| | | |
| | | _card.innerHeight = fontSize * lineHeight * line |
| | | if (line) { |
| | | _card.innerHeight = fontSize * lineHeight * line |
| | | } |
| | | } else if (_card.eleType === 'barcode') { |
| | | _card.style = style |
| | | |
| | |
| | | } else if (res.eleType === 'text' || res.eleType === 'number') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | let line = res.height || 1 |
| | | let line = res.height || null |
| | | |
| | | if (res.style && res.style.fontSize) { |
| | | fontSize = parseInt(res.style.fontSize) |
| | |
| | | if (res.style && res.style.lineHeight) { |
| | | lineHeight = parseFloat(res.style.lineHeight) |
| | | } |
| | | res.innerHeight = fontSize * lineHeight * line |
| | | |
| | | if (line) { |
| | | res.innerHeight = fontSize * lineHeight * line |
| | | } |
| | | |
| | | if (res.eleType === 'text' && res.link && !res.style.color) { |
| | | res.style.color = '#2440B3' |
| | |
| | | const { cards } = this.props |
| | | let btn = fromJS(item).toJS() |
| | | |
| | | if (btn.eleType !== 'button' || (sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') !== 'false')) return |
| | | if ((sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') !== 'false')) return |
| | | |
| | | if (btn.OpenType === 'pop') { |
| | | if (!btn.modal) { |
| | | btn.modal = { |
| | | setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | | tables: [], |
| | | groups: [], |
| | | fields: [] |
| | | if (btn.eleType === 'button') { |
| | | if (btn.OpenType === 'pop') { |
| | | if (!btn.modal) { |
| | | btn.modal = { |
| | | setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | | tables: [], |
| | | groups: [], |
| | | fields: [] |
| | | } |
| | | } |
| | | |
| | | MKEmitter.emit('changeModal', cards, btn) |
| | | } else if (btn.OpenType === 'popview') { |
| | | MKEmitter.emit('changePopview', cards, btn) |
| | | } else if (btn.OpenType === 'innerpage' && btn.pageTemplate === 'page') { |
| | | MKEmitter.emit('changeEditMenu', {MenuID: btn.uuid, copyMenuId: btn.copyMenuId}) |
| | | } else if (btn.OpenType === 'innerpage' && btn.pageTemplate === 'linkpage') { |
| | | MKEmitter.emit('changeEditMenu', {MenuID: btn.linkmenu}) |
| | | } |
| | | |
| | | MKEmitter.emit('changeModal', cards, btn) |
| | | } else if (btn.OpenType === 'popview') { |
| | | MKEmitter.emit('changePopview', cards, btn) |
| | | } else { |
| | | if (btn.link === 'page') { |
| | | MKEmitter.emit('changeEditMenu', {MenuID: btn.uuid, copyMenuId: btn.copyMenuId}) |
| | | } else if (btn.link === 'linkpage') { |
| | | MKEmitter.emit('changeEditMenu', {MenuID: btn.linkmenu}) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'resetPageIndex', 'pagination', 'search', 'width'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open'], |
| | | funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width'] |
| | | } |
| | | |
| | |
| | | |
| | | let _opentype = card.OpenType // 打开方式 |
| | | let _intertype = card.intertype || 'system' // 接口类型 |
| | | let _funcType = card.funcType || 'print' // 功能按钮默认类型 |
| | | let _procMode = card.procMode || 'system' // 参数请求方式 |
| | | let _funcType = card.funcType || '' // 功能按钮默认类型 |
| | | let _procMode = card.procMode || 'system' // 参数请求方式 |
| | | |
| | | let _options = this.getOptions(_opentype, _intertype, _funcType, card.pageTemplate, _procMode) |
| | | |
| | |
| | | if (_opentype === 'innerpage') { // 新页面,可选模板(自定义时,可填入外部链接) |
| | | if (_pageTemplate === 'custom') { |
| | | _options.push('url', 'joint') |
| | | } else if (_pageTemplate === 'page') { |
| | | _options.push('copyMenuId', 'joint') |
| | | } else if (_pageTemplate === 'linkpage') { |
| | | _options.push('linkmenu', 'joint') |
| | | } |
| | | } else if (_opentype === 'excelOut') { // 导入导出 |
| | | if (_intertype === 'outer') { |
| | |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | export function getActionForm (card, functip, setting, usefulFields, type, menulist = [], modules = []) { |
| | | let appMenus = [] |
| | | let opentypes = [ |
| | | { |
| | | value: 'pop', |
| | |
| | | } |
| | | ] |
| | | |
| | | let pageTemps = [ |
| | | { value: 'billprint', text: '单据打印' }, |
| | | { value: 'pay', text: Formdict['model.pay'] }, |
| | | { value: 'custom', text: Formdict['header.form.custom'] } |
| | | ] |
| | | const isApp = sessionStorage.getItem('appType') === 'pc' |
| | | |
| | | let funTypes = [ |
| | | { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, |
| | | { value: 'print', text: '标签打印' } |
| | | ] |
| | | |
| | | if (isApp) { |
| | | opentypes = opentypes.filter(item => item.value !== 'tab') |
| | | pageTemps = [ |
| | | { value: 'page', text: '菜单' }, |
| | | { value: 'linkpage', text: '关联菜单' }, |
| | | { value: 'billprint', text: '单据打印' }, |
| | | { value: 'pay', text: Formdict['model.pay'] }, |
| | | { value: 'custom', text: '链接' } |
| | | ] |
| | | funTypes = [ |
| | | { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, |
| | | ] |
| | | appMenus = sessionStorage.getItem('appMenus') |
| | | if (appMenus) { |
| | | try { |
| | | appMenus = JSON.parse(appMenus) |
| | | appMenus = appMenus.map(item => ({value: item.MenuID, text: item.MenuName})) |
| | | } catch { |
| | | appMenus = [] |
| | | } |
| | | } else { |
| | | appMenus = [] |
| | | } |
| | | } |
| | | |
| | | if (type === 'chart') { |
| | | opentypes = opentypes.filter(item => item.value === 'excelIn' || item.value === 'excelOut') |
| | | } |
| | |
| | | type: 'radio', |
| | | key: 'funcType', |
| | | label: Formdict['header.form.funcType'], |
| | | initVal: card.funcType || 'print', |
| | | initVal: card.funcType || (isApp ? 'changeuser' : ''), |
| | | required: true, |
| | | options: [{ |
| | | value: 'changeuser', |
| | | text: Formdict['header.form.func.changeuser'] |
| | | }, { |
| | | value: 'print', |
| | | text: '标签打印' |
| | | }] |
| | | options: funTypes |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | label: Formdict['model.form.newpage.type'], |
| | | initVal: card.pageTemplate || '', |
| | | required: true, |
| | | options: pageTemps |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'open', |
| | | label: '链接方式', |
| | | initVal: card.open || 'blank', |
| | | required: true, |
| | | forbid: !isApp, |
| | | options: [{ |
| | | value: 'billprint', |
| | | text: '单据打印' |
| | | value: 'blank', |
| | | text: '新窗口' |
| | | }, { |
| | | value: 'pay', |
| | | text: Formdict['model.pay'] |
| | | }, { |
| | | value: 'custom', |
| | | text: Formdict['header.form.custom'] |
| | | value: 'self', |
| | | text: '当前窗口' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | type: 'select', |
| | | key: 'linkmenu', |
| | | label: '关联菜单', |
| | | initVal: card.linkmenu || '', |
| | | required: true, |
| | | options: appMenus |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'copyMenuId', |
| | | label: '复制菜单', |
| | | initVal: card.copyMenuId || '', |
| | | required: false, |
| | | options: appMenus |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'url', |
| | | label: Formdict['model.form.newpage.url'], |
| | | label: Formdict['model.pageUrl'], |
| | | initVal: card.url || '', |
| | | required: true |
| | | }, |
| | |
| | | label: Formdict['model.form.linkmenu'], |
| | | initVal: card.linkmenu || [], |
| | | required: true, |
| | | forbid: isApp, |
| | | options: menulist |
| | | }, |
| | | { |
| | |
| | | |
| | | if (element.OpenType === 'pop' || element.OpenType === 'popview' || element.execMode === 'pop') { |
| | | this.props.setSubConfig(element) |
| | | } else if (element.OpenType === 'innerpage' && element.pageTemplate === 'page') { |
| | | MKEmitter.emit('changeEditMenu', {MenuID: element.uuid, copyMenuId: element.copyMenuId}) |
| | | } else if (element.OpenType === 'innerpage' && element.pageTemplate === 'linkpage') { |
| | | MKEmitter.emit('changeEditMenu', {MenuID: element.linkmenu}) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (values.urls && values.urls[0]) { |
| | | } else if (values.urls && values.urls[0] && values.urls[0].status !== 'done') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '文件上传中,请稍后!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (values.urls && values.urls[0] && values.urls[0].response) { |
| | | values.linkurl = values.urls[0].response |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到文件路径!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | resolve(values) |
| | | } else { |
| | |
| | | <Col span={24}> |
| | | <Form.Item label="备注"> |
| | | {getFieldDecorator('remark', { |
| | | initialValue: card.remark, |
| | | initialValue: card.remark || '', |
| | | rules: [ |
| | | { |
| | | max: 50, |
| | |
| | | </Col> |
| | | </Row> |
| | | <Row gutter={16} style={{height: '340px'}}> |
| | | {piclist.length && piclist.map(item => ( |
| | | {piclist.length > 0 && piclist.map(item => ( |
| | | <Col span={4} key={item.id}> |
| | | <div className="image-video-box"> |
| | | <div className="image-video-box-body"> |
| | |
| | | </Col> |
| | | </Row> |
| | | <Row gutter={16} style={{height: '340px'}}> |
| | | {vidlist.length && vidlist.map(item => ( |
| | | {vidlist.length > 0 && vidlist.map(item => ( |
| | | <Col span={4} key={item.id}> |
| | | <div className="image-video-box"> |
| | | <div className="image-video-box-body"> |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Popover, Menu } from 'antd' |
| | | import { Icon, Popover, Menu, Button } from 'antd' |
| | | |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | // 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 WrapComponent = asyncIconComponent(() => import('./wrapsetting')) |
| | | const MenuComponent = asyncIconComponent(() => import('./menusetting')) |
| | | // const CardComponent = asyncComponent(() => import('../cardcomponent')) |
| | | const LinkComponent = asyncIconComponent(() => import('./linksetting')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) |
| | | |
| | | // const { confirm } = Modal |
| | | const { SubMenu } = Menu |
| | | |
| | | class NormalNavbar extends Component { |
| | |
| | | } |
| | | |
| | | changeMenu = (menu) => { |
| | | MKEmitter.emit('changeEditMenu', menu) |
| | | MKEmitter.emit('changeEditMenu', { |
| | | MenuID: menu.property === 'linkmenu' ? menu.linkMenuId : menu.MenuID, |
| | | copyMenuId: menu.property === 'menu' ? menu.copyMenuId : '', |
| | | }) |
| | | } |
| | | |
| | | changeLogoMenu = () => { |
| | |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <MenuComponent config={card} updateConfig={this.updateComponent} /> |
| | | <LinkComponent config={card} updateConfig={this.updateComponent} /> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent} /> |
| | | <CopyComponent type="normalnarbar" card={card}/> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | |
| | | })} |
| | | </Menu> |
| | | </div> |
| | | <div className="link">asdfds</div> |
| | | <div className="link"> |
| | | {card.links.map(link => { |
| | | return <Button type="link" key={link.MenuID} onDoubleClick={() => this.changeMenu(link)}>{link.name}</Button> |
| | | })} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | ) |
| | |
| | | flex: 1; |
| | | display: inline-block; |
| | | text-align: right; |
| | | color: inherit; |
| | | button { |
| | | color: inherit; |
| | | } |
| | | } |
| | | } |
| | | .card-control { |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Modal } from 'antd' |
| | | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import LinkTable from './linktable' |
| | | import './index.scss' |
| | | |
| | | class DataSource extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.any, |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | visible: false |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | verifySubmit = () => { |
| | | const { config } = this.props |
| | | |
| | | this.props.updateConfig({...config, links: this.mTable.state.data || []}) |
| | | this.setState({visible: false}) |
| | | } |
| | | |
| | | render () { |
| | | const { config } = this.props |
| | | const { visible, dict } = this.state |
| | | |
| | | return ( |
| | | <div className="model-link-setting-wrap"> |
| | | <Icon type="link" title="链接" onClick={() => this.setState({ visible: true })}/> |
| | | <Modal |
| | | wrapClassName="popview-modal" |
| | | title="链接编辑" |
| | | visible={visible} |
| | | width={950} |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | | destroyOnClose |
| | | > |
| | | <LinkTable |
| | | links={config.links || []} |
| | | ref={(ref) => { this.mTable = ref }} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default DataSource |
New file |
| | |
| | | .model-link-setting-wrap { |
| | | display: inline-block; |
| | | |
| | | >.anticon-link { |
| | | color: rgb(38, 194, 129); |
| | | } |
| | | |
| | | >.anticon-edit { |
| | | color: #1890ff; |
| | | } |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Radio, Tooltip, Icon, Select } from 'antd' |
| | | |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | menu: PropTypes.object, // 卡片行信息 |
| | | inputSubmit: PropTypes.func // 回车事件 |
| | | } |
| | | |
| | | state = { |
| | | property: this.props.menu.property || 'link', |
| | | linkIntId: this.props.menu.linkIntId || '', |
| | | appMenus: [], |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let appMenus = sessionStorage.getItem('appMenus') |
| | | if (appMenus) { |
| | | try { |
| | | appMenus = JSON.parse(appMenus) |
| | | } catch { |
| | | appMenus = [] |
| | | } |
| | | } else { |
| | | appMenus = [] |
| | | } |
| | | |
| | | this.setState({appMenus}) |
| | | } |
| | | |
| | | componentDidMount() { |
| | | const { menu } = this.props |
| | | |
| | | if (!menu.MenuID) { |
| | | let _form = document.getElementById('name') |
| | | _form && _form.select() |
| | | } |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | if (values.linkmenuid) { |
| | | values.linkIntId = this.state.linkIntId || '' |
| | | } |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | handleSubmit = (e) => { |
| | | e.preventDefault() |
| | | |
| | | if (this.props.inputSubmit) { |
| | | this.props.inputSubmit() |
| | | } |
| | | } |
| | | |
| | | changeProperty = (e) => { |
| | | let val = e.target.value |
| | | |
| | | this.setState({property: val}) |
| | | } |
| | | |
| | | changeLinkMenu = (val, { props }) => { |
| | | this.setState({linkIntId: props.intid}) |
| | | } |
| | | |
| | | render() { |
| | | const { menu } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { property, appMenus } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col span={22}> |
| | | <Form.Item label="链接名称"> |
| | | {getFieldDecorator('name', { |
| | | initialValue: menu.name, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入链接名称!' |
| | | } |
| | | ] |
| | | })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={22}> |
| | | <Form.Item label="链接属性"> |
| | | {getFieldDecorator('property', { |
| | | initialValue: menu.property || 'link' |
| | | })( |
| | | <Radio.Group onChange={this.changeProperty}> |
| | | <Radio value="link">链接</Radio> |
| | | <Radio value="linkmenu">关联菜单</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {property === 'link' ? <Col span={22}> |
| | | <Form.Item label="链接地址"> |
| | | {getFieldDecorator('link', { |
| | | initialValue: menu.link || '', |
| | | rules: [{ |
| | | required: true, |
| | | message: '请输入链接地址!' |
| | | }] |
| | | })(<TextArea rows={2} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={22}> |
| | | <Form.Item label="打开方式"> |
| | | {getFieldDecorator('open', { |
| | | initialValue: menu.open || 'blank' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="blank">新窗口</Radio> |
| | | <Radio value="self">当前窗口</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {property === 'linkmenu' ? <Col span={22}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="关联当前app中已有的菜单。"> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '3px'}}/> |
| | | 关联菜单 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('linkMenuId', { |
| | | initialValue: menu.linkMenuId || '', |
| | | rules: [{ |
| | | required: true, |
| | | message: '请选择关联菜单!' |
| | | }] |
| | | })( |
| | | <Select onChange={this.changeLinkMenu}> |
| | | {appMenus.map(item => (<Select.Option key={item.MenuID} intid={item.menuid_int} value={item.MenuID}>{item.MenuName}</Select.Option>))} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(SettingForm) |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Table, Button, Modal, Icon } from 'antd' |
| | | |
| | | import LinkForm from '../linkform' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | |
| | | class LinkTable extends Component { |
| | | static propTpyes = { |
| | | links: PropTypes.object, // 卡片行信息 |
| | | } |
| | | |
| | | state = { |
| | | data: [], |
| | | editMenu: null, |
| | | columns: [ |
| | | { title: '链接名称', dataIndex: 'name', key: 'name' }, |
| | | { title: '链接属性', dataIndex: 'property', key: 'property', render: text => { |
| | | const trans = {link: '链接', linkmenu: '关联菜单'} |
| | | |
| | | return trans[text] |
| | | }}, |
| | | { title: '链接地址', dataIndex: 'link', key: 'link'}, |
| | | { title: '打开方式', dataIndex: 'open', key: 'open', render: (text, record) => { |
| | | const trans = {blank: '新窗口', self: '当前窗口'} |
| | | |
| | | return trans[text] |
| | | }}, |
| | | { title: '操作', key: 'operation', align: 'center', width: '190px', render: (text, record) => |
| | | (<div> |
| | | <Button type="link" style={{padding: '0 5px', marginRight: '5px'}} onClick={() => this.editMenu(record)}>编辑</Button> |
| | | <Button type="link" style={{color: '#ff4d4f', padding: '0 5px', marginRight: '5px'}} onClick={() => this.delMenu(record)}>删除</Button> |
| | | <Icon type="arrow-up" style={{color: '#26C281', cursor: 'pointer', padding: '0 5px', marginRight: '5px'}} onClick={() => this.moveUp(record)}/> |
| | | <Icon type="arrow-down" style={{color: '#ff4d4f', cursor: 'pointer', padding: '0 5px'}} onClick={() => this.moveDown(record)}/> |
| | | </div>) |
| | | } |
| | | ] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { links } = this.props |
| | | |
| | | this.setState({data: fromJS(links).toJS()}) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | moveUp = (record) => { |
| | | let data = fromJS(this.state.data).toJS() |
| | | |
| | | let dragIndex = data.findIndex(c => c.MenuID === record.MenuID) |
| | | let hoverIndex = dragIndex - 1 |
| | | |
| | | if (hoverIndex === -1) return |
| | | |
| | | data.splice(hoverIndex, 0, ...data.splice(dragIndex, 1)) |
| | | this.setState({data}) |
| | | } |
| | | |
| | | moveDown = (record) => { |
| | | let data = fromJS(this.state.data).toJS() |
| | | |
| | | let dragIndex = data.findIndex(c => c.MenuID === record.MenuID) |
| | | let hoverIndex = dragIndex + 1 |
| | | |
| | | if (hoverIndex === data.length) return |
| | | |
| | | data.splice(hoverIndex, 0, ...data.splice(dragIndex, 1)) |
| | | this.setState({data}) |
| | | } |
| | | |
| | | delMenu = (record) => { |
| | | const { data } = this.state |
| | | const _this = this |
| | | |
| | | confirm({ |
| | | title: '确定删除吗?', |
| | | content: '', |
| | | onOk() { |
| | | _this.setState({data: data.filter(item => item.MenuID !== record.MenuID)}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | editMenu = (record) => { |
| | | this.setState({editMenu: record, visible: true}) |
| | | } |
| | | |
| | | plusMenu = () => { |
| | | let _menu = { |
| | | name: '链接' |
| | | } |
| | | |
| | | this.setState({editMenu: _menu, visible: true}) |
| | | } |
| | | |
| | | menuSubmit = () => { |
| | | const { editMenu, data } = this.state |
| | | |
| | | this.menuRef.handleConfirm().then(res => { |
| | | let _menu = {...editMenu, ...res} |
| | | if (!_menu.MenuID) { |
| | | _menu.MenuID = Utils.getuuid() |
| | | this.setState({data: [...data, _menu], editMenu: null, visible: false}) |
| | | } else { |
| | | this.setState({ |
| | | editMenu: null, |
| | | visible: false, |
| | | data: data.map(item => { |
| | | if (item.MenuID === _menu.MenuID) { |
| | | return _menu |
| | | } else { |
| | | return item |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { columns, data, visible, editMenu } = this.state |
| | | |
| | | return ( |
| | | <div className="link-control-wrap"> |
| | | <Button className="link-plus mk-green" onClick={this.plusMenu}>添加</Button> |
| | | <Table |
| | | rowKey="MenuID" |
| | | columns={columns} |
| | | dataSource={data} |
| | | pagination={false} |
| | | /> |
| | | <Modal |
| | | title="编辑" |
| | | visible={visible} |
| | | width={600} |
| | | maskClosable={false} |
| | | onOk={this.menuSubmit} |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | | destroyOnClose |
| | | > |
| | | <LinkForm |
| | | menu={editMenu} |
| | | inputSubmit={this.menuSubmit} |
| | | wrappedComponentRef={(inst) => this.menuRef = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default LinkTable |
New file |
| | |
| | | .link-control-wrap { |
| | | position: relative; |
| | | |
| | | .link-plus { |
| | | float: right; |
| | | position: relative; |
| | | z-index: 1; |
| | | margin-bottom: 5px; |
| | | } |
| | | .ant-empty { |
| | | margin: 5px 0; |
| | | } |
| | | thead tr { |
| | | background: #fbfbfb; |
| | | } |
| | | |
| | | .ant-table-body { |
| | | margin: 0!important; |
| | | } |
| | | } |
| | |
| | | .model-menu-setting-wrap { |
| | | display: inline-block; |
| | | |
| | | >.anticon-menu { |
| | | color: purple; |
| | | } |
| | | |
| | | >.anticon-edit { |
| | | color: #1890ff; |
| | | } |
| | |
| | | <Radio.Group onChange={this.changeProperty}> |
| | | <Radio value="menu">菜单</Radio> |
| | | <Radio value="link">链接</Radio> |
| | | {menu.level === 1 || menu.level === 2 ? <Radio value="classify">分类</Radio> : null} |
| | | <Radio value="linkmenu">关联菜单</Radio> |
| | | {menu.level === 1 || menu.level === 2 ? <Radio value="classify">分类</Radio> : null} |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={22}> |
| | | <Form.Item label="隐藏"> |
| | | {getFieldDecorator('hidden', { |
| | | initialValue: menu.hidden || 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="false">否</Radio> |
| | | <Radio value="true">是</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Tooltip, Icon, InputNumber, Select } from 'antd' |
| | | import { Form, Row, Col, Input, Tooltip, Icon, InputNumber, Select, Radio } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="存在登录且取到登录信息时,显示用户头像、用户名及退出。"> |
| | | <Icon type="question-circle" /> |
| | | 用户信息 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('user', { |
| | | initialValue: wrap.user || 'hidden' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="hidden">隐藏</Radio> |
| | | <Radio value="show">显示</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | </div> |
| | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> |
| | | <div className={'ant-mk-text line' + card.height} style={{height: card.innerHeight || 21}}>{val}</div> |
| | | <div className={'ant-mk-text line' + card.height} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={_style}> |
| | | <div className={'ant-mk-text line' + card.height} style={{height: card.innerHeight || 21}}>{val}</div> |
| | | <div className={'ant-mk-text line' + card.height} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | } |
| | | |
| | | onDelete = (msg) => { |
| | | let filelist = this.state.filelist.filter(v => !v.url && !v.response) |
| | | |
| | | let filelist = this.state.filelist.map(item => { |
| | | if (!item.url && !item.response && !item.status) { |
| | | item.status = 'error' |
| | | } |
| | | return item |
| | | }) |
| | | this.setState({filelist, showprogress: false}) |
| | | this.props.onChange(filelist) |
| | | |
| | |
| | | } |
| | | .fileupload-form-container.limit-fileupload { |
| | | > .ant-upload { |
| | | display: none; |
| | | display: inline; |
| | | >.ant-upload { |
| | | >input { |
| | | display: none; |
| | | } |
| | | >button { |
| | | display: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import { Form, Row, Col, Input, Select } from 'antd' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | |
| | | message: '地址最长为1024个字符!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | | })(<TextArea rows={2} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'url', |
| | | label: Formdict['model.form.newpage.url'], |
| | | label: Formdict['model.pageUrl'], |
| | | initVal: card.url || '', |
| | | required: true |
| | | }, |
| | |
| | | import React, { Component } from 'react' |
| | | import { connect } from 'react-redux' |
| | | import { DndProvider } from 'react-dnd' |
| | | import { withRouter } from 'react-router' |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | |
| | | localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS, |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | }) |
| | | this.getAppMessage() |
| | | } else if (param.type === 'view') { |
| | | this.setState({ |
| | | MenuId: param.MenuID |
| | | }, () => { |
| | | this.getMenuParam() |
| | | }) |
| | | } |
| | | this.getAppMessage() |
| | | } catch { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单信息解析错误!', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (this.props.match.params.param !== nextProps.match.params.param) { |
| | | window.location.reload() |
| | | } |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | this.props.history.replace('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: menu.MenuID, type: 'view'})))) |
| | | window.location.reload() |
| | | this.props.history.push('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: menu.MenuID, copyMenuId: menu.copyMenuId || '', type: 'view'})))) |
| | | } |
| | | |
| | | getAppMessage = () => { |
| | |
| | | } |
| | | |
| | | let homeId = '' |
| | | if (this.state.MenuId) { |
| | | let appViewList = res.data && res.data.length > 0 ? res.data : [] |
| | | |
| | | homeId = this.state.MenuId |
| | | |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | } else { |
| | | let appViewList = [] |
| | | if (res.data && res.data.length > 0) { |
| | | appViewList = res.data |
| | | appViewList.forEach(item => { |
| | | if (item.keys_type === 'index') { |
| | | homeId = item.keys_id |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (!homeId) { |
| | | homeId = Utils.getuuid() |
| | | |
| | | let param = { |
| | | func: 's_kei_link_keyids_addupt', |
| | | BID: sessionStorage.getItem('appId'), |
| | | exec_type: 'y', |
| | | LText: '' |
| | | let appViewList = [] |
| | | if (res.data && res.data.length > 0) { |
| | | appViewList = res.data |
| | | appViewList.forEach(item => { |
| | | if (item.keys_type === 'index') { |
| | | homeId = item.keys_id |
| | | } |
| | | }) |
| | | } |
| | | |
| | | appViewList.unshift({ |
| | | appkey: window.GLOB.appkey || '', |
| | | bid: sessionStorage.getItem('appId') || '', |
| | | kei_no: sessionStorage.getItem('kei_no') || '', |
| | | keys_id: homeId, |
| | | keys_type: 'index', |
| | | remark: '首页' |
| | | }) |
| | | if (!homeId) { |
| | | homeId = Utils.getuuid() |
| | | |
| | | param.LText = appViewList.map(item => `select '${item.keys_id}','${item.keys_type}','${item.kei_no}','${item.appkey}','${item.bid}','${sessionStorage.getItem('CloudUserID')}','${item.remark}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | let param = { |
| | | func: 's_kei_link_keyids_addupt', |
| | | BID: sessionStorage.getItem('appId'), |
| | | exec_type: 'y', |
| | | LText: '' |
| | | } |
| | | |
| | | appViewList.unshift({ |
| | | appkey: window.GLOB.appkey || '', |
| | | bid: sessionStorage.getItem('appId') || '', |
| | | kei_no: sessionStorage.getItem('kei_no') || '', |
| | | keys_id: homeId, |
| | | keys_type: 'index', |
| | | remark: '首页' |
| | | }) |
| | | |
| | | param.LText = appViewList.map(item => `select '${item.keys_id}','${item.keys_type}','${item.kei_no}','${item.appkey}','${item.bid}','${sessionStorage.getItem('CloudUserID')}','${item.remark}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | this.props.history.replace('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: homeId, type: 'view'})))) |
| | | } |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | this.props.history.replace('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: homeId, type: 'view'})))) |
| | | } |
| | | this.props.history.replace('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: homeId, type: 'view'})))) |
| | | |
| | | this.setState({MenuId: homeId}, () => { |
| | | this.getMenuParam() |
| | | }) |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(MenuDesign) |
| | | export default withRouter(connect(mapStateToProps, mapDispatchToProps)(MenuDesign)) |