| | |
| | | CacheUtils.updateWebSqlversion('1.00', curTime) |
| | | resolve() |
| | | return |
| | | } else if (!msg.createDate || reload) { |
| | | } else if (!msg.createDate || reload === true) { |
| | | param.modifydate = curTime |
| | | param.menuids = window.btoa(msg.menuids) |
| | | } else if (msg.menuids) { |
| | |
| | | list.push(...res.menu_del) |
| | | } |
| | | |
| | | list = list.map(mid => mid.menuid) |
| | | |
| | | if (typeof(reload) === 'string' && !list.includes(reload)) { |
| | | list.push(reload) |
| | | } |
| | | |
| | | if (list.length > 0) { |
| | | let clear = false |
| | | list.forEach(mid => { |
| | | if (systemMenuKeys.indexOf(mid.menuid) > -1) { |
| | | if (systemMenuKeys.indexOf(mid) > -1) { |
| | | clear = true |
| | | } |
| | | }) |
| | | let keys = list.map(mid => `'${mid.menuid}'`).join(',') |
| | | if (clear) { |
| | | keys = '' |
| | | list = '' |
| | | } else { |
| | | list = list.map(mid => `'${mid}'`).join(',') |
| | | } |
| | | CacheUtils.delWebSqlConfig(keys) |
| | | CacheUtils.delWebSqlConfig(list) |
| | | } |
| | | |
| | | CacheUtils.updateWebSqlversion(res.app_version || '1.00', curTime) |
| | |
| | | CacheUtils.updateIndexDBversion({version: '1.00', createDate: curTime}) |
| | | resolve() |
| | | return |
| | | } else if (!msg.createDate || reload) { |
| | | } else if (!msg.createDate || reload === true) { |
| | | param.modifydate = curTime |
| | | param.menuids = window.btoa(msg.menuids) |
| | | } else if (msg.menuids) { |
| | |
| | | list.push(...res.menu_del) |
| | | } |
| | | |
| | | list = list.map(mid => mid.menuid) |
| | | |
| | | if (typeof(reload) === 'string' && !list.includes(reload)) { |
| | | list.push(reload) |
| | | } |
| | | |
| | | if (list.length > 0) { |
| | | let clear = false |
| | | list.forEach(mid => { |
| | | if (systemMenuKeys.indexOf(mid.menuid) > -1) { |
| | | if (systemMenuKeys.indexOf(mid) > -1) { |
| | | clear = true |
| | | } |
| | | }) |
| | | let keys = list.map(mid => mid.menuid) |
| | | if (clear) { |
| | | keys = '' |
| | | list = '' |
| | | } |
| | | CacheUtils.delIndexDBConfig(keys) |
| | | CacheUtils.delIndexDBConfig(list) |
| | | } |
| | | |
| | | CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime}) |
| | |
| | | return ( |
| | | <> |
| | | {eye ? value : this.getValue()} |
| | | {eye ? <EyeOutlined className="mk-open-eye" onClick={() => this.setState({eye: false})}/> : <EyeInvisibleOutlined className="mk-close-eye" onClick={() => this.setState({eye: true})}/>} |
| | | {eye ? <EyeOutlined className="mk-open-eye" onClick={(e) => {e.stopPropagation();this.setState({eye: false})}}/> : <EyeInvisibleOutlined className="mk-close-eye" onClick={(e) => {e.stopPropagation();this.setState({eye: true})}}/>} |
| | | </> |
| | | ) |
| | | } |
| | |
| | | window.addEventListener('storage', (e) => { |
| | | if (e.key === 'getSessionStorage' && e.newValue === window.GLOB.appkey) { |
| | | localStorage.setItem('sessionStorage', JSON.stringify(sessionStorage)) |
| | | } else if (e.key === 'menuUpdate') { |
| | | let menuId = e.newValue.split(',')[1] |
| | | if (menuId) { |
| | | Api.getAppVersion(menuId).then(() => { |
| | | MKEmitter.emit('reloadMenuView', menuId) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | const Iframe = asyncComponent(() => import('@/tabviews/iframe')) |
| | | const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) |
| | | const FormTab = asyncComponent(() => import('@/tabviews/formtab')) |
| | | const TabManage = asyncComponent(() => import('@/tabviews/tabmanage')) |
| | | |
| | | class TabViews extends Component { |
| | | static propTpyes = { |
| | |
| | | |
| | | // 获取主菜单参数 |
| | | let menudefer = new Promise(resolve => { |
| | | Api.getAppVersion().then(() => { |
| | | Api.getAppVersion(menu.MenuID).then(() => { |
| | | resolve() |
| | | }, () => { |
| | | resolve() |
| | |
| | | return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | } else if (view.type === 'FormTab') { |
| | | return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | } else if (view.type === 'TabManage') { |
| | | return (<TabManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | } else if (view.type === 'iframe') { |
| | | return (<Iframe key={view.MenuID} MenuID={view.MenuID} MenuNo={view.MenuNo} title={view.MenuName} MenuName={view.MenuName} url={window.GLOB.baseurl + 'zh-CN/' + view.LinkUrl}/>) |
| | | } else { |
| | |
| | | newcard.eleType = item.value |
| | | newcard.datatype = 'dynamic' |
| | | newcard.height = 1 |
| | | |
| | | if (item.value === 'splitline') { |
| | | newcard.width = 24 |
| | | newcard.color = '#EBE9E9' |
| | | } else if (item.value === 'slider') { |
| | | newcard.width = 24 |
| | | newcard.color = '#1890ff' |
| | | } |
| | | } else { |
| | | newcard.eleType = 'button' |
| | | newcard.label = 'button' |
| | |
| | | item.initVal = posterType |
| | | } else if (item.key === 'fixStyle') { |
| | | item.initVal = fixStyle |
| | | } else if (item.key === 'color') { |
| | | if (value === 'splitline') { |
| | | item.initVal = '#EBE9E9' |
| | | } |
| | | } |
| | | |
| | | return item |
| | |
| | | showType: card.showType || 'line', |
| | | formlist: _formlist |
| | | }, () => { |
| | | if (value === 'slider') { |
| | | if (value === 'splitline') { |
| | | this.props.form.setFieldsValue({width: 24, color: '#EBE9E9'}) |
| | | } else if (value === 'slider') { |
| | | this.props.form.setFieldsValue({width: 24, color: '#1890ff'}) |
| | | } else if (value === 'qrcode') { |
| | | this.props.form.setFieldsValue({color: '#000000'}) |
| | |
| | | |
| | | .card-button-cell { |
| | | float: left; |
| | | button { |
| | | box-shadow: none; |
| | | } |
| | | button:not(.ant-switch) { |
| | | width: 100%; |
| | | background-size: cover; |
| | |
| | | field: 'prevEnable', |
| | | label: '上一步', |
| | | initval: group.prevButton ? group.prevButton.enable || 'false' : 'false', |
| | | tooltip: '第一组不显示。', |
| | | tooltip: '第一组不显示。注:除关闭功能外。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | |
| | | field: 'nextEnable', |
| | | label: '跳过', |
| | | initval: group.nextButton ? group.nextButton.enable || 'false' : 'false', |
| | | tooltip: '最后一组不显示。', |
| | | tooltip: '最后一组不显示。注:除关闭功能外。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | |
| | | const { card } = this.props |
| | | |
| | | if (card.type === 'prev') { |
| | | return ['type', 'label', 'enable'] |
| | | return ['type', 'label', 'enable', 'actionType'] |
| | | } else if (card.type === 'next') { |
| | | return ['type', 'label', 'enable', 'actionType'] |
| | | } else if (card.type === 'close') { |
| | | return ['type', 'label', 'enable'] |
| | | } |
| | | |
| | | let _options = ['type', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'enable', 'output', 'reload'] // 选项列表 |
| | | |
| | | if (_intertype === 'custom') { |
| | |
| | | _type = '上一步' |
| | | } else if (card.type === 'next') { |
| | | _type = '下一步' |
| | | } else if (card.type === 'close') { |
| | | _type = '关闭' |
| | | } |
| | | |
| | | let menulist = [] |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'actionType', |
| | | label: '执行操作', |
| | | initVal: card.actionType || 'default', |
| | | tooltip: '关闭功能:管理系统中会关闭当前标签,子应用中为返回上一页。', |
| | | required: true, |
| | | options: [{ |
| | | value: 'default', |
| | | text: '默认' |
| | | }, { |
| | | value: 'close', |
| | | text: '关闭' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'intertype', |
| | | label: '接口类型', |
| | | initVal: card.intertype || 'system', |
| | |
| | | let group = fromJS(this.props.group).toJS() |
| | | |
| | | if (res.type === 'prev') { |
| | | res.enable = group.prevButton.enable || 'true' |
| | | group.prevButton = res |
| | | } else if (res.type === 'submit') { |
| | | group.subButton = res |
| | | } else if (res.type === 'next') { |
| | | res.enable = group.nextButton.enable || 'true' |
| | | group.nextButton = res |
| | | } else if (res.type === 'close') { |
| | | res.enable = group.closeButton.enable || 'true' |
| | | group.closeButton = res |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | |
| | | return ( |
| | | <div className="mk-form-action"> |
| | | {group.prevButton && group.prevButton.enable !== 'false' && group.sort !== 1 ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | {group.prevButton && group.prevButton.enable === 'true' ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.handleAction(group.prevButton)} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={() => this.handleStyle(group.prevButton)}/> |
| | |
| | | } trigger="hover"> |
| | | <Button type="link" className="submit mk-primary" onDoubleClick={this.changeMenu} style={resetStyle(group.subButton.style)}>{group.subButton.label}</Button> |
| | | </Popover> |
| | | {group.nextButton && group.nextButton.enable !== 'false' && group.sort !== config.subcards.length ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | {group.closeButton && group.closeButton.enable === 'true' ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.handleAction(group.closeButton)} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={() => this.handleStyle(group.closeButton)}/> |
| | | </div> |
| | | } trigger="hover"> |
| | | <Button type="link" style={resetStyle(group.closeButton.style)}>{group.closeButton.label}</Button> |
| | | </Popover> : null} |
| | | {group.nextButton && group.nextButton.enable === 'true' ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.handleAction(group.nextButton)} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={() => this.handleStyle(group.nextButton)}/> |
| | |
| | | } |
| | | .skip { |
| | | color: rgba(0, 0, 0, 0.85); |
| | | float: right; |
| | | position: absolute; |
| | | height: auto; |
| | | right: 0px; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | let _card = {...this.state.card, wrap: res} |
| | | let _card = fromJS(this.state.card).toJS() |
| | | _card.wrap = res |
| | | |
| | | if (res.datatype === 'static') { |
| | | if (res.supModule && res.supModule.length > 0) { |
| | |
| | | _card.subcards[0].setting.enable = _card.wrap.enable |
| | | _card.subcards[0].setting.verticalSpace = _card.wrap.verticalSpace |
| | | |
| | | if (_card.wrap.closeEnable === 'true' && !_card.subcards[0].closeButton) { |
| | | _card.subcards[0].closeButton = {label: '关闭', enable: 'true', type: 'close', style: {backgroundColor: '#ffffff', color: 'rgba(0,0,0,0.65)', borderColor: '#d9d9d9', borderWidth: '1px', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px', marginLeft: '10px'}} |
| | | } else if (_card.subcards[0].closeButton) { |
| | | _card.subcards[0].closeButton.enable = _card.wrap.closeEnable |
| | | } |
| | | |
| | | this.updateComponent(_card) |
| | | } |
| | | |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'subEnable', |
| | | field: 'enable', |
| | | label: '提交', |
| | | initval: wrap.enable || 'true', |
| | | required: false, |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'closeEnable', |
| | | label: '关闭', |
| | | initval: wrap.closeEnable || 'false', |
| | | tooltip: '管理系统中会关闭当前标签,子应用中为返回上一页。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | | {value: 'false', label: '隐藏'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'goback', |
| | | label: '空值返回', |
| | | initval: wrap.goback || 'false', |
| | |
| | | const { connectDragSource, connectDropTarget, moveCol, addElement, dropCol, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | |
| | | if (index !== undefined) { |
| | | let style = {cursor: 'move', textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | |
| | | return connectDragSource( |
| | | connectDropTarget(<th {...restProps} index={index} style={{ cursor: 'move', textAlign: align }} onDoubleClick={() => column && this.props.editColumn(column)}> |
| | | connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => column && this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column && ['custom', 'colspan', 'action'].includes(column.type) ? |
| | |
| | | </th>), |
| | | ) |
| | | } else if (column) { |
| | | let style = {textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | return ( |
| | | <th {...restProps} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <th {...restProps} style={style} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column && ['custom', 'colspan'].includes(column.type) ? |
| | |
| | | |
| | | if (column && column.type === 'custom') { |
| | | return ( |
| | | <td style={{padding: 0, minWidth: (column.Width || 100) / 2, ...(column.style || {})}} className={className}> |
| | | <td style={{padding: 0, ...(column.style || {})}} className={className}> |
| | | <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/> |
| | | </td> |
| | | ) |
| | | } else if (column && column.type === 'action') { |
| | | return ( |
| | | <td style={{padding: '0 5px', textAlign: column.Align, minWidth: (column.Width || 100) / 2}} className={'action-column ' + className}> |
| | | <td style={{padding: '0 5px', textAlign: column.Align}} className={'action-column ' + className}> |
| | | <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/> |
| | | </td> |
| | | ) |
| | |
| | | } |
| | | } |
| | | return ( |
| | | <td style={{...style, minWidth: (column.Width || 100) / 2}} className={className}> |
| | | <td style={{...style}} className={className}> |
| | | {val} |
| | | {column.Hide === 'true' ? <CloseCircleOutlined style={{marginLeft: '5px', color: 'orange', fontSize: '12px'}}/> : null} |
| | | {column.marks && column.marks.length ? <AntDesignOutlined className="profile"/> : null} |
| | |
| | | font-size: inherit; |
| | | font-weight: inherit; |
| | | } |
| | | .ant-table-selection-column { |
| | | width: 60px; |
| | | min-width: 60px; |
| | | max-width: 60px; |
| | | } |
| | | .ant-table-body { |
| | | overflow-x: auto; |
| | | tr { |
| | |
| | | </th> |
| | | ) |
| | | |
| | | let style = {cursor: 'move', textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | |
| | | return connectDragSource( |
| | | connectDropTarget(<th {...restProps} index={index} style={{ cursor: 'move', textAlign: align }} onDoubleClick={() => this.props.editColumn(column)}> |
| | | connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {['custom', 'action'].includes(column.type) ? |
| | |
| | | |
| | | if (column && column.type === 'custom') { |
| | | return ( |
| | | <td style={{padding: 0, minWidth: column.Width || 100, ...(column.style || {})}} className={className}> |
| | | <td style={{padding: 0, ...(column.style || {})}} className={className}> |
| | | <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/> |
| | | </td> |
| | | ) |
| | | } else if (column && column.type === 'action') { |
| | | return ( |
| | | <td style={{padding: '0 5px', textAlign: column.Align, minWidth: column.Width || 100}} className={'action-column ' + className}> |
| | | <td style={{padding: '0 5px', textAlign: column.Align}} className={'action-column ' + className}> |
| | | <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/> |
| | | </td> |
| | | ) |
| | |
| | | } |
| | | } |
| | | return ( |
| | | <td style={{...style, minWidth: column.Width || 100}} className={className}> |
| | | <td style={style} className={className}> |
| | | {column.field ? <Paragraph className="col-copy" copyable={{ text: column.field }}>{val}</Paragraph> : val} |
| | | {column.marks && column.marks.length ? <AntDesignOutlined className="profile"/> : null} |
| | | {column.Hide === 'true' ? <CloseCircleOutlined className="close-col"/> : null} |
| | |
| | | color: inherit; |
| | | font-size: inherit; |
| | | } |
| | | .ant-table-selection-column { |
| | | width: 60px; |
| | | min-width: 60px; |
| | | max-width: 60px; |
| | | } |
| | | .submit-btn { |
| | | min-height: 24px; |
| | | height: auto; |
| | |
| | | const { connectDragSource, connectDropTarget, moveCol, dropCol, addElement, updateCol, editColumn, pasteCell, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props |
| | | |
| | | if (index !== undefined) { |
| | | let style = {cursor: 'move', textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | |
| | | return connectDragSource( |
| | | connectDropTarget(<th {...restProps} index={index} style={{ cursor: 'move', textAlign: align }} onDoubleClick={() => column && this.props.editColumn(column)}> |
| | | connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => column && this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column && ['custom', 'colspan', 'action'].includes(column.type) ? |
| | |
| | | </th>), |
| | | ) |
| | | } else if (column) { |
| | | let style = {textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | |
| | | return ( |
| | | <th {...restProps} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <th {...restProps} style={style} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column && ['custom', 'colspan'].includes(column.type) ? |
| | |
| | | |
| | | if (column && column.type === 'custom') { |
| | | return ( |
| | | <td style={{padding: 0, minWidth: column.Width || 100, ...(column.style || {})}} className={className}> |
| | | <td style={{padding: 0, ...(column.style || {})}} className={className}> |
| | | <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/> |
| | | </td> |
| | | ) |
| | | } else if (column && column.type === 'action') { |
| | | return ( |
| | | <td style={{padding: '0 5px', textAlign: column.Align, minWidth: column.Width || 100}} className={'action-column ' + className}> |
| | | <td style={{padding: '0 5px', textAlign: column.Align}} className={'action-column ' + className}> |
| | | <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/> |
| | | </td> |
| | | ) |
| | |
| | | } |
| | | } |
| | | return ( |
| | | <td style={{...style, minWidth: column.Width || 100}} className={className}> |
| | | <td style={{...style}} className={className}> |
| | | {column.field ? <Paragraph className="col-copy" copyable={{ text: column.field }}>{val}</Paragraph> : val} |
| | | {column.marks && column.marks.length ? <AntDesignOutlined className="profile"/> : null} |
| | | {column.Hide === 'true' ? <CloseCircleOutlined className="close-col"/> : null} |
| | |
| | | font-size: inherit; |
| | | font-weight: inherit; |
| | | } |
| | | .ant-table-selection-column { |
| | | width: 60px; |
| | | min-width: 60px; |
| | | max-width: 60px; |
| | | } |
| | | .ant-table-body { |
| | | overflow-x: auto; |
| | | tr { |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { btn } = this.props |
| | | const { config, saving } = this.state |
| | | |
| | | return ( |
| | |
| | | <SettingOutlined onClick={this.changeSetting} /> |
| | | <div className="ant-modal-content" style={{width: config.setting.width > 100 ? config.setting.width : config.setting.width + '%'}}> |
| | | <div className="ant-modal-header"> |
| | | <div className="ant-modal-title">{config.setting.title}</div> |
| | | <div className="ant-modal-title">{btn.label}</div> |
| | | <Button className="mk-cols-change" onClick={() => this.changecols(1)}>1列</Button> |
| | | <Button className="mk-cols-change" onClick={() => this.changecols(2)}>2列</Button> |
| | | <Button className="mk-cols-change" onClick={() => this.changecols(3)}>3列</Button> |
| | |
| | | Api.getSystemConfig(param).then(res => { |
| | | _resolve() |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | Modal.warning({ |
| | | title: res.message, |
| | | okText: '知道了' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | localStorage.setItem('menuUpdate', new Date().getTime()) |
| | | localStorage.setItem('menuUpdate', new Date().getTime() + ',' + _config.uuid) |
| | | notification.success({ |
| | | top: 92, |
| | | message: '切换成功。', |
| | |
| | | } |
| | | |
| | | reloadview = () => { |
| | | window.GLOB.CacheData.delete(this.props.MenuID) |
| | | if (this.state.config) { |
| | | this.deleteCache(this.state.config.components) |
| | | } |
| | | |
| | | this.setState({ |
| | | BID: '', // 页面跳转时携带ID |
| | | loadingview: true, // 页面加载中 |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Spin, notification, Modal } from 'antd' |
| | | import { Spin, notification, Modal, Button } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | |
| | | if (config.wrap.datatype !== 'static') { |
| | | _sync = config.setting.sync === 'true' |
| | | |
| | | if (_sync && data && data[config.dataName]) { |
| | | _data = data[config.dataName] |
| | | if (_sync && data) { |
| | | _data = data[config.dataName] || {$$empty: true} |
| | | if (Array.isArray(_data)) { |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | |
| | | |
| | | let _group = config.subcards[0] |
| | | |
| | | if (_group.subButton.enable === 'false') { |
| | | if (_group.subButton.enable === 'false' && (!_group.closeButton || _group.closeButton.enable !== 'true')) { |
| | | _group.subButton.style.display = 'none' |
| | | _group.$button = 'no-button' |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | closeTab = () => { |
| | | const { group } = this.state |
| | | |
| | | MKEmitter.emit('closeTabView', group.subButton.$MenuID) |
| | | } |
| | | |
| | | render() { |
| | | const { config, loading, BID, BData, data, group, dict } = this.state |
| | | |
| | |
| | | columns={config.columns} |
| | | selectedData={data.$$empty ? [] : [data]} |
| | | /> |
| | | {group.closeButton && group.closeButton.enable === 'true' ? <Button type="link" onClick={this.closeTab} style={group.closeButton.style}>{group.closeButton.label}</Button> : null} |
| | | </div> : null} |
| | | </div> |
| | | ) |
| | |
| | | if (config.wrap.datatype !== 'static') { |
| | | _sync = config.setting.sync === 'true' |
| | | |
| | | if (_sync && data && data[config.dataName]) { |
| | | _data = data[config.dataName] |
| | | if (_sync && data) { |
| | | _data = data[config.dataName] || {$$empty: true} |
| | | if (Array.isArray(_data)) { |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | |
| | | |
| | | config.subcards = config.subcards.map((group, i) => { |
| | | group.sort = i + 1 |
| | | if (i === 0) { |
| | | if (i === 0 && group.prevButton.actionType !== 'close') { |
| | | group.prevButton.enable = 'false' |
| | | } |
| | | if (i + 1 === config.subcards.length) { |
| | | if (i + 1 === config.subcards.length && group.nextButton.actionType !== 'close') { |
| | | group.nextButton.enable = 'false' |
| | | } |
| | | |
| | |
| | | prevStep = () => { |
| | | const { config, group } = this.state |
| | | |
| | | if (group.prevButton.actionType === 'close') { |
| | | MKEmitter.emit('closeTabView', group.subButton.$MenuID) |
| | | return |
| | | } |
| | | |
| | | let _group = config.subcards.filter(item => item.sort === (group.sort - 1))[0] |
| | | |
| | | this.setState({group: null, step: group.sort - 2}, () => { |
| | |
| | | nextStep = () => { |
| | | const { config, group } = this.state |
| | | |
| | | if (group.nextButton.actionType === 'close') { |
| | | MKEmitter.emit('closeTabView', group.subButton.$MenuID) |
| | | return |
| | | } |
| | | |
| | | let _group = config.subcards.filter(item => item.sort === (group.sort + 1))[0] |
| | | |
| | | this.setState({group: null, step: group.sort}, () => { |
| | |
| | | border: none; |
| | | } |
| | | .skip { |
| | | float: right; |
| | | color: rgba(0, 0, 0, 0.85); |
| | | position: absolute; |
| | | height: auto; |
| | | right: 0px; |
| | | } |
| | | } |
| | | .mk-form-action.no-button { |
| | |
| | | if (config.wrap.datatype !== 'static') { |
| | | _sync = config.setting.sync === 'true' |
| | | |
| | | if (_sync && data && data[config.dataName]) { |
| | | _data = data[config.dataName] |
| | | if (_sync && data) { |
| | | _data = data[config.dataName] || {$$empty: true} |
| | | if (Array.isArray(_data)) { |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | |
| | | const { setting } = this.state |
| | | |
| | | if (!setting.supModule || setting.supModule !== MenuID) return |
| | | |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ |
| | | pageIndex: 1, |
| | |
| | | item.subcards = item.subcards.map(group => { |
| | | group.subButton.uuid = group.uuid |
| | | group.subButton.$menuId = group.uuid |
| | | group.subButton.$MenuID = this.props.MenuID |
| | | // group.subButton.$forbid = true // 不声明数据源变量 |
| | | group.subButton.OpenType = 'formSubmit' |
| | | group.subButton.execError = 'never' |
| | |
| | | } |
| | | |
| | | reloadview = () => { |
| | | window.GLOB.CacheData.delete(this.props.MenuID) |
| | | |
| | | if (this.state.config) { |
| | | this.deleteCache(this.state.config.components) |
| | | this.state.config.interfaces.forEach(m => { |
| | | window.GLOB.CacheData.delete(m.uuid) |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | BID: '', // 页面跳转时携带ID |
| | | loadingview: true, // 页面加载中 |
| | |
| | | item.subcards = item.subcards.map(group => { |
| | | group.subButton.uuid = group.uuid |
| | | group.subButton.$menuId = group.uuid |
| | | group.subButton.$MenuID = Tab.$MenuID |
| | | group.subButton.OpenType = 'formSubmit' |
| | | group.subButton.execError = 'never' |
| | | group.subButton.logLabel = item.$menuname + '-' + group.subButton.label |
| | |
| | | MenuID: btn.MenuID, |
| | | MenuName: btn.MenuName, |
| | | MenuNo: btn.MenuNo, |
| | | type: btn.tabType, |
| | | param: { |
| | | $BID: id |
| | | } |
| | | type: btn.tabType |
| | | } |
| | | } else if (!newtab) { |
| | | return |
| | | } |
| | | |
| | | newtab = {...newtab, param: { $BID: id }} |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | MKEmitter.emit('modifyTabs', newtab, 'replace') |
| | | } else { |
| | |
| | | style: { backgroundColor: '#ffffff', paddingTop: '16px', paddingBottom: '80px', paddingLeft: '16px', paddingRight: '16px'}, |
| | | } |
| | | |
| | | let uuids = {} |
| | | let formActions = [] |
| | | let popActions = [] |
| | | let errors = [] |
| | | let mainTb = {name: '主表', uuid: Utils.getuuid(), useMSearch: 'false'} |
| | | let mainTb = {name: '主表', uuid: Utils.getuuid(), useMSearch: 'false', isMain: true} |
| | | |
| | | let oldtabs = { |
| | | mainTable: mainTb.uuid |
| | | } |
| | | |
| | | let tbl = this.getTable(config, mainTb, uuids, errors, formActions, popActions, oldtabs) |
| | | let tbl = this.getTable(config, mainTb, errors, formActions, popActions, oldtabs) |
| | | |
| | | if (config.autoMatic && config.autoMatic.enable === 'true' && uuids[config.autoMatic.action]) { |
| | | _config.autoMatic = {...config.autoMatic} |
| | | _config.autoMatic.action = uuids[config.autoMatic.action] |
| | | |
| | | if (tbl.action.filter(item => item.uuid === _config.autoMatic.action && (['pop', 'prompt', 'exec'].includes(item.OpenType) || (item.OpenType === 'funcbutton' && item.funcType === 'print'))).length === 0) { |
| | | if (config.autoMatic && config.autoMatic.enable === 'true') { |
| | | if (tbl.action.filter(item => item.uuid === config.autoMatic.action && (['pop', 'prompt', 'exec'].includes(item.OpenType) || (item.OpenType === 'funcbutton' && item.funcType === 'print'))).length === 0) { |
| | | _config.autoMatic = {enable: 'false'} |
| | | } else { |
| | | _config.autoMatic = {...config.autoMatic} |
| | | } |
| | | } else { |
| | | _config.autoMatic = {enable: 'false'} |
| | |
| | | _config.components = _config.components.map(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs = item.subtabs.map(tab => { |
| | | tab.components[0] = this.getTable(menus[tab.components[0].linkTab], tab.components[0], uuids, errors, formActions, popActions, oldtabs) |
| | | tab.components[0] = this.getTable(menus[tab.components[0].linkTab], tab.components[0], errors, formActions, popActions, oldtabs) |
| | | |
| | | return tab |
| | | }) |
| | |
| | | MenuName: btn.label, |
| | | tables: _config.tables || [], |
| | | Template: 'BaseTable', |
| | | components: [this.getTable(menus[btn.uuid], mainTb, {}, errors, formActions)], |
| | | components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions)], |
| | | viewType: 'popview', |
| | | style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } |
| | | } |
| | |
| | | MenuName: btn.label, |
| | | tables: _config.tables || [], |
| | | Template: 'BaseTable', |
| | | components: [this.getTable(menus[btn.uuid], mainTb, {}, errors, formActions)], |
| | | components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions)], |
| | | viewType: 'popview', |
| | | style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } |
| | | } |
| | |
| | | MenuName: btn.label, |
| | | tables: _config.tables || [], |
| | | Template: 'BaseTable', |
| | | components: [this.getTable(menus[btn.uuid], mainTb, {}, errors, formActions)], |
| | | components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions)], |
| | | viewType: 'popview', |
| | | style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } |
| | | } |
| | |
| | | MenuName: btn.label, |
| | | tables: _config.tables || [], |
| | | Template: 'BaseTable', |
| | | components: [this.getTable(menus[btn.uuid], mainTb, {}, errors, formActions)], |
| | | components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions)], |
| | | viewType: 'popview', |
| | | style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } |
| | | } |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | let save = false |
| | | |
| | | new Promise(resolve => { |
| | | Api.getSystemConfig(param).then(res => { |
| | | resolve(res) |
| | |
| | | }).then(res => { // 删除原菜单 |
| | | if (!res || !res.status) return res |
| | | |
| | | save = true |
| | | localStorage.setItem('menuUpdate', new Date().getTime() + ',' + config.uuid) |
| | | |
| | | if (this.delButtons.length === 0) return res |
| | | |
| | | return Api.getSystemConfig({ |
| | | func: 'sPC_MainMenu_Del', |
| | | up_type: 'Y', |
| | | MenuID: this.delButtons.join(',') |
| | | }) |
| | | }).then(res => { |
| | |
| | | _resolve() |
| | | |
| | | if (res.status) { |
| | | localStorage.setItem('menuUpdate', new Date().getTime()) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '升级成功', |
| | |
| | | window.location.reload() |
| | | }, 2000) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | Modal.warning({ |
| | | title: res.message, |
| | | okText: '知道了', |
| | | onOk: () => { |
| | | if (save) { |
| | | delete urlparam.type |
| | | delete urlparam.MenuType |
| | | |
| | | let _param = window.btoa(window.encodeURIComponent(JSON.stringify(urlparam))) |
| | | |
| | | window.history.replaceState(null, null, window.location.href.split('#')[0] + `#/tabledesign/${_param}`) |
| | | window.location.reload() |
| | | } else { |
| | | window.location.reload() |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | getTable = (config, newCon, uuids, errors, formActions, popActions, oldtabs) => { |
| | | getTable = (config, newCon, errors, formActions, popActions, oldtabs) => { |
| | | let _card = { |
| | | uuid: newCon.uuid, |
| | | type: 'table', |
| | |
| | | let colbtns = [] |
| | | let colors = { primary: '#1890ff', yellow: '#c49f47', orange: 'orange', danger: '#ff4d4f', green: '#26C281', dgreen: '#32c5d2', purple: '#8E44AD', cyan: '#13c2c2', gray: '#666666', default: 'rgba(0, 0, 0, 0.65)' } |
| | | |
| | | let uuids = {} |
| | | config.action.forEach(btn => { |
| | | let _c = btn.class ? btn.class.replace('border-', '') : '' |
| | | let color = colors[_c] || '#1890ff' |
| | | let _btn = fromJS(btn).toJS() |
| | | _btn.uuid = Utils.getuuid() |
| | | // _btn.uuid = Utils.getuuid() |
| | | delete _btn.position |
| | | delete _btn.linkTab |
| | | |
| | |
| | | _btn.popClose = 'mainline' |
| | | } |
| | | |
| | | uuids[btn.uuid] = _btn.uuid |
| | | |
| | | if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.funcType === 'print' && btn.execMode === 'pop')) { |
| | | |
| | | formActions.push({origin: btn.uuid, uuid: _btn.uuid, name: newCon.name, label: btn.label}) |
| | |
| | | return |
| | | } |
| | | } |
| | | |
| | | uuids[btn.uuid] = true |
| | | |
| | | if (_btn.tabType === 'CommonTable' || _btn.tabType === 'SubTable') { |
| | | _btn.tabType = 'BaseTable' |
| | |
| | | } |
| | | }) |
| | | |
| | | if (config.setting.doubleClick && uuids[config.setting.doubleClick]) { |
| | | _card.wrap.doubleClick = uuids[config.setting.doubleClick] |
| | | } else { |
| | | if (config.setting.doubleClick && !uuids[config.setting.doubleClick]) { |
| | | _card.wrap.doubleClick = '' |
| | | } |
| | | |
| | |
| | | btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp) |
| | | |
| | | |
| | | new Promise(resolve => { |
| | | if (MenuType === 'billPrint') { // 打印生成页面效果图 |
| | | html2canvas(document.getElementById('menu-shell-inner')).then(canvas => { |
| | |
| | | if (!res || !res.status) return res |
| | | |
| | | if (MenuType !== 'billPrint') { // 基本信息改变时,通知菜单列表更新 |
| | | let ori = this.state.oriConfig |
| | | if (config.MenuName !== ori.MenuName || config.MenuNo !== ori.MenuNo || config.parentId !== ori.parentId) { |
| | | localStorage.setItem('menuUpdate', new Date().getTime()) |
| | | } |
| | | localStorage.setItem('menuUpdate', new Date().getTime() + ',' + config.uuid) |
| | | } |
| | | config.open_edition = res.open_edition || '' |
| | | this.setState({ |
| | |
| | | needUpdate: false |
| | | }) |
| | | |
| | | localStorage.setItem('mobUpdate', new Date().getTime() + ',' + config.uuid) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '保存成功', |
| | |
| | | needUpdate: false |
| | | }) |
| | | |
| | | localStorage.setItem('pcUpdate', new Date().getTime() + ',' + config.uuid) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '保存成功', |
| | |
| | | MenuID: '1583979633842550imkchl4qt4qppsiv', |
| | | MenuNo: 'sVersionMUpgrade', |
| | | MenuName: '版本升级', |
| | | // }, { |
| | | // src: '', |
| | | // PageParam: {OpenType: 'newtab', Template: 'TabManage'}, |
| | | // type: 'TabManage', |
| | | // MenuID: 'TabManageView', |
| | | // MenuNo: 'TabManage', |
| | | // MenuName: '标签页管理', |
| | | }, { |
| | | src: '', |
| | | PageParam: {OpenType: 'newtab', Template: 'TabManage'}, |
| | | type: 'TabManage', |
| | | MenuID: 'TabManageView', |
| | | MenuNo: 'TabManage', |
| | | MenuName: '标签页管理', |
| | | }, { |
| | | src: '', |
| | | PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, |
| | |
| | | }).then(res => { |
| | | if (!res || !res.status) return res |
| | | |
| | | let ori = this.state.oriConfig |
| | | if (config.MenuName !== ori.MenuName || config.MenuNo !== ori.MenuNo || config.parentId !== ori.parentId) { |
| | | localStorage.setItem('menuUpdate', new Date().getTime()) |
| | | } |
| | | localStorage.setItem('menuUpdate', new Date().getTime() + ',' + config.uuid) |
| | | config.open_edition = res.open_edition || '' |
| | | |
| | | this.setState({ |