| | |
| | | |
| | | return ( |
| | | <div className="menu-table-card-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> |
| | | <NormalHeader config={card} updateComponent={this.updateComponent}/> |
| | | <NormalHeader defaultshow="hidden" config={card} updateComponent={this.updateComponent}/> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加卡片" onClick={() => this.addCard()} type="plus" /> |
| | |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | min-height: 100px; |
| | | min-height: 50px; |
| | | |
| | | .table-header { |
| | | position: relative; |
| | |
| | | <Radio.Button value="upload" size="small" onClick={() => this.handleChange('upload')}>上传</Radio.Button> |
| | | <Radio.Button value="system" size="small" onClick={() => this.handleChange('system')}>系统</Radio.Button> |
| | | </Radio.Group> : null} |
| | | {url ? <div className="mk-source-item-info"> |
| | | <Icon type="paper-clip" /> |
| | | {url ? <div className={'mk-source-item-info' + (type !== 'video' ? ' picture' : '')}> |
| | | {type === 'video' ? <Icon type="paper-clip" /> : <img src={url} alt="" />} |
| | | <a target="_blank" rel="noopener noreferrer" href={url}>{name}</a> |
| | | <Icon title="删除文件" type="delete" onClick={this.deleteUrl}/> |
| | | </div> : null} |
| | |
| | | text-overflow: ellipsis; |
| | | } |
| | | } |
| | | .mk-source-item-info.picture { |
| | | display: flex; |
| | | img { |
| | | width: 32px; |
| | | height: 32px; |
| | | } |
| | | img + a { |
| | | height: 32px; |
| | | line-height: 32px; |
| | | } |
| | | .anticon-delete { |
| | | top: 8px; |
| | | } |
| | | } |
| | | .mk-source-item-info:hover { |
| | | background-color: #e6f7ff; |
| | | .anticon-delete { |
| | |
| | | } |
| | | |
| | | pasteSubmit = () => { |
| | | let options = ['tabs', 'menubar', 'datacard', 'propcard', 'mainsearch', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter'] |
| | | let options = ['tabs', 'menubar', 'topbar', 'datacard', 'propcard', 'mainsearch', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter'] |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (res.copyType === 'menubar' && sessionStorage.getItem('appType') !== 'mob') { |
| | | if ((res.copyType === 'menubar' || res.copyType === 'topbar') && sessionStorage.getItem('appType') !== 'mob') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '当前系统不支持菜单组件!', |
| | |
| | | } |
| | | |
| | | this.setState({visible: false}) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | this.setState({config}) |
| | | window.GLOB.customMenu = config |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | |
| | | refreshConfig = () => { |
| | |
| | | pageable: false, // 组件属性 - 是否可分页 |
| | | switchable: false, // 组件属性 - 数据是否可切换 |
| | | dataName: card.dataName || '', |
| | | width: card.width || 24, |
| | | name: card.name, |
| | | subtype: card.subtype, |
| | | setting: { interType: 'system' }, |
| | |
| | | card: component |
| | | }) |
| | | |
| | | component.width = component.wrap.width |
| | | component.name = component.wrap.name |
| | | |
| | | this.props.updateConfig(component) |
| | |
| | | import './index.scss' |
| | | |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | |
| | | class NormalNavbar extends Component { |
| | | static propTpyes = { |
| | |
| | | <NormalForm title="导航栏设置" width={750} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="topbar" card={card}/> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | </div> |
| | |
| | | type: card.type, |
| | | floor: card.floor, |
| | | dataName: card.dataName || '', |
| | | width: card.width || 24, |
| | | name: card.name, |
| | | subtype: card.subtype, |
| | | wrap: { name: card.name, width: card.width || 1200 }, |
| | |
| | | card: component |
| | | }) |
| | | |
| | | component.width = component.wrap.width |
| | | component.name = component.wrap.name |
| | | |
| | | this.props.updateConfig(component) |
| | |
| | | // 权限过滤 |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | let balMap = new Map() |
| | | config.components = this.filterComponent(config.components, roleId, permAction, permMenus, balMap) |
| | | let skip = config.permission === 'false' || this.props.menuType === 'HS' |
| | | config.components = this.filterComponent(config.components, roleId, permAction, permMenus, balMap, skip) |
| | | |
| | | // 获取主搜索条件 |
| | | let mainSearch = [] |
| | |
| | | }) |
| | | } |
| | | |
| | | filterComponent = (components, roleId, permAction, permMenus, balMap) => { |
| | | filterComponent = (components, roleId, permAction, permMenus, balMap, skip) => { |
| | | return components.filter(item => { |
| | | |
| | | if (item.style && item.style.boxShadow) { |
| | |
| | | }) |
| | | |
| | | item.subtabs = item.subtabs.map(tab => { |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus, balMap) |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus, balMap, skip) |
| | | return tab |
| | | }) |
| | | |
| | |
| | | return false |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap) |
| | | item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap, skip) |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter'].includes(item.type)) { |
| | | if ( |
| | | item.plot.blacklist && item.plot.blacklist.length > 0 && |
| | |
| | | } |
| | | |
| | | // 权限过滤 |
| | | let isHS = this.props.menuType === 'HS' |
| | | let tabId = this.props.Tab ? this.props.Tab.uuid : '' // 弹窗标签按钮Id |
| | | if (item.action && item.action.length > 0) { |
| | | item.action = item.action.filter(cell => { |
| | |
| | | cell.style = {...cell.style, ...cell.btnstyle} |
| | | } |
| | | |
| | | return isHS || permAction[cell.uuid] |
| | | return skip || permAction[cell.uuid] |
| | | }) |
| | | } |
| | | |
| | |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || isHS || permAction[cell.uuid] |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | | card.backElements = card.backElements.filter(cell => { |
| | | if (cell.eleType === 'button') { |
| | |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | return cell.eleType !== 'button' || isHS || permAction[cell.uuid] |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || isHS || permAction[cell.uuid] |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | | } else if ((item.type === 'table' && item.subtype === 'tablecard') || item.type === 'carousel') { |
| | | item.subcards && item.subcards.forEach(card => { |
| | |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | return cell.eleType !== 'button' || isHS || permAction[cell.uuid] |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | | }) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | |
| | | cell.style = {...cell.style, ...cell.btnstyle} |
| | | } |
| | | |
| | | return isHS || permAction[cell.uuid] |
| | | return skip || permAction[cell.uuid] |
| | | }) |
| | | return col.elements.length !== 0 |
| | | }) |
| | |
| | | }) |
| | | } |
| | | if (item.type === 'topbar') { |
| | | item.wrap.name = '' |
| | | item.name = '' |
| | | if (item.search && item.search.fields) { |
| | | item.search.fields = item.search.fields.map(cell => { |
| | | cell.uuid = this.getuuid() |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Select, Radio, Input, Tooltip, Icon, notification, InputNumber } from 'antd' |
| | | import { Form, Row, Col, Select, Radio, Input, Tooltip, Icon, notification, InputNumber, Checkbox } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | onChange = (vals) => { |
| | | this.setState({user_binding: vals}) |
| | | } |
| | | |
| | | /** |
| | |
| | | <Col span={12}> |
| | | <Form.Item label="权限管理"> |
| | | {getFieldDecorator('role_type', { |
| | | initialValue: card ? card.role_type || 'true' : 'true' |
| | | initialValue: card ? card.role_type || 'false' : 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">启用</Radio> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {typename !== 'pc' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="使用微信授权登录时,是否需要绑定用户。"> |
| | | <Icon type="question-circle" /> |
| | | 用户绑定 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('user_binding', { |
| | | initialValue: user_binding |
| | | })( |
| | | <Select mode="multiple"> |
| | | <Select.Option value="uname_pwd">用户名</Select.Option> |
| | | <Select.Option value="sms_vcode">手机号</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {typename !== 'pc' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="短信模板可在管理系统 HS-奇云短信模板 处添加。"> |
| | | <Icon type="question-circle" /> |
| | | 短信模板 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sms_id', { |
| | | initialValue: card ? card.sms_id || '' : '' |
| | | })( |
| | | <Select allowClear> |
| | | {msgs.map(option => |
| | | <Select.Option key={option.ID} value={option.ID}>{option.SignName + ' - ' + option.TemplateCode}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={12}> |
| | | <Form.Item label="皮肤"> |
| | | {getFieldDecorator('css', { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {typename !== 'pc' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="使用公众号授权登录时,是否需要绑定用户。"> |
| | | <Icon type="question-circle" /> |
| | | 用户绑定 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('user_binding', { |
| | | initialValue: user_binding |
| | | })( |
| | | <Checkbox.Group onChange={this.onChange}> |
| | | <Checkbox value="uname_pwd">账号</Checkbox> |
| | | <Checkbox value="sms_vcode">手机短信</Checkbox> |
| | | </Checkbox.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {typename !== 'pc' && user_binding.includes('sms_vcode') ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="短信模板可在管理系统 HS-奇云短信模板 处添加。"> |
| | | <Icon type="question-circle" /> |
| | | 短信模板 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sms_id', { |
| | | initialValue: card ? card.sms_id || '' : '', |
| | | rules: [{ |
| | | required: true, |
| | | message: '使用手机短信时请选择短信模板!' |
| | | }] |
| | | })( |
| | | <Select allowClear> |
| | | {msgs.map(option => |
| | | <Select.Option key={option.ID} value={option.ID}>{option.SignName + ' - ' + option.TemplateCode}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={12}> |
| | | <Form.Item label="标题"> |
| | | {getFieldDecorator('title', { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | {typename !== 'pc' && user_binding.length > 0 ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="使用微信授权登录时,绑定用户页面的版权声明,注:可添加html标签。"> |
| | | <Icon type="question-circle" /> |
| | |
| | | initialValue: card ? card.copyright || '' : '' |
| | | })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="LOGO"> |
| | | </Col> : null} |
| | | {typename !== 'pc' && user_binding.length > 0 ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="使用微信授权登录时,绑定用户页面的LOGO。"> |
| | | <Icon type="question-circle" /> |
| | | LOGO |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('logo', { |
| | | initialValue: card ? card.logo : '' |
| | | })( |
| | | <SourceComponent type="picture" placement="right"/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | {typename !== 'pc' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="在使用明科云APP时,页面的切换模式"> |
| | |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="在使用明科云APP时,且在app模式中无效"> |
| | | <Icon type="question-circle" /> |
| | | 延迟加载 |
| | | 延迟加载(ms) |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('delay', { |
| | |
| | | .ant-input-number { |
| | | width: 100%; |
| | | } |
| | | .ant-form-item-control { |
| | | height: 40px; |
| | | } |
| | | .ant-form-item-with-help { |
| | | margin-bottom: 24px; |
| | | } |
| | | } |
| | |
| | | |
| | | this.setState({config}) |
| | | window.GLOB.customMenu = config |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="跳过权限验证时,页面中组件及按钮不在进行权限控制。"> |
| | | <Icon type="question-circle" /> |
| | | 权限验证 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('permission', { |
| | | initialValue: config.permission || 'true' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('permission', e.target.value)}}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {config.cacheUseful === 'true' ? <Col span={24}> |
| | | <Form.Item label="单位"> |
| | | {getFieldDecorator('timeUnit', { |
| | |
| | | Typename: sessionStorage.getItem('typename'), |
| | | MenuName: item.name || '', |
| | | PageParam: JSON.stringify({Template: item.type}), |
| | | open_edition: item.open_edition || '', |
| | | open_edition: _item.open_edition || '', |
| | | menus_rolelist: window.btoa(window.encodeURIComponent(JSON.stringify(roles))), |
| | | LText: '', |
| | | LTexttb: '' |
| | |
| | | insert = (item) => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | if (item.type === 'topbar' && config.components.findIndex(m => m.type === 'topbar') > -1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '导航栏不可重复添加!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | config.components.push(item) |
| | | |
| | | this.setState({config}) |
| | | window.GLOB.customMenu = config |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | |
| | | refreshView = () => { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="跳过权限验证时,页面中组件及按钮不在进行权限控制。"> |
| | | <Icon type="question-circle" /> |
| | | 权限验证 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('permission', { |
| | | initialValue: config.permission || 'true' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('permission', e.target.value)}}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {config.cacheUseful === 'true' ? <Col span={24}> |
| | | <Form.Item label="单位"> |
| | | {getFieldDecorator('timeUnit', { |
| | |
| | | |
| | | this.setState({config}) |
| | | window.GLOB.customMenu = config |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | |
| | | refreshView = () => { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="跳过权限验证时,页面中组件及按钮不在进行权限控制。"> |
| | | <Icon type="question-circle" /> |
| | | 权限验证 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('permission', { |
| | | initialValue: config.permission || 'true' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('permission', e.target.value)}}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {config.cacheUseful === 'true' ? <Col span={24}> |
| | | <Form.Item label="单位"> |
| | | {getFieldDecorator('timeUnit', { |
| | |
| | | </div> |
| | | <div className="right-view"> |
| | | <div className="app-action"> |
| | | <Button className="mk-primary" onClick={this.initTree}>初始化</Button> |
| | | <Button className="mk-purple" onClick={this.syncTree}>同步</Button> |
| | | <Button className="mk-primary" onClick={this.initTree}>同步</Button> |
| | | {/* <Button className="mk-purple" onClick={this.syncTree}>同步</Button> */} |
| | | <Button className="mk-green save" onClick={this.saveTree}>保存</Button> |
| | | </div> |
| | | {trees && trees.length ? <Tree |