| | |
| | | |
| | | import asyncComponent from '@/utils/asyncLoadComponent' |
| | | import NotFount from '@/components/404' |
| | | import options from '@/store/options.js' |
| | | import mzhCN from '@/locales/zh-CN/main.js' |
| | | import menUS from '@/locales/en-US/main.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | | const Home = asyncComponent(() => import('@/tabviews/home')) |
| | |
| | | const { tabview } = this.state |
| | | window.GLOB.CacheMap = new Map() |
| | | |
| | | MKEmitter.emit('reloadMenuView', tabview.MenuID) |
| | | if (options.sysType === 'local' && window.GLOB.systemType !== 'production') { |
| | | Api.getAppVersion().then(() => { |
| | | MKEmitter.emit('reloadMenuView', tabview.MenuID) |
| | | }, () => { |
| | | MKEmitter.emit('reloadMenuView', tabview.MenuID) |
| | | }) |
| | | } else { |
| | | MKEmitter.emit('reloadMenuView', tabview.MenuID) |
| | | } |
| | | } |
| | | |
| | | selectcomponent = (view) => { |
| | |
| | | oriVersion: '', |
| | | newVersion: '', |
| | | debug: sessionStorage.getItem('debug') === 'true', |
| | | navBar: ['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar) ? 'topmenu' : '', |
| | | navBar: ['linkage_navigation', 'linkage', 'menu_board', 'menu_board_navigation'].includes(window.GLOB.navBar) ? 'topmenu' : '', |
| | | menuType: window.GLOB.navBar |
| | | } |
| | | |
| | |
| | | } else if (menu.OpenType === 'blank') { |
| | | menu.selected = true |
| | | this.props.modifyTabview([menu]) |
| | | } else if (this.state.navBar === 'topmenu') { |
| | | } else if (this.state.navBar === 'topmenu' && this.state.menuType !== 'menu_board_navigation') { |
| | | menu.selected = true |
| | | this.props.modifyTabview([menu]) |
| | | } else { |
| | |
| | | })} |
| | | </ul> : null |
| | | } |
| | | {navBar === 'topmenu' && menuType !== 'menu_board' && menulist ? |
| | | {navBar === 'topmenu' && menuType !== 'menu_board' && menuType !== 'menu_board_navigation' && menulist ? |
| | | <ul className="header-menu vertical-menu">{ |
| | | menulist.map(item => { |
| | | if (item.children && item.children.length > 0) { |
| | |
| | | })} |
| | | </ul> : null |
| | | } |
| | | {navBar === 'topmenu' && menuType === 'menu_board' && menulist ? |
| | | {navBar === 'topmenu' && (menuType === 'menu_board' || menuType === 'menu_board_navigation') && menulist ? |
| | | <ul className="header-menu vertical-menu">{ |
| | | menulist.map(item => { |
| | | if (item.children && item.children.length > 0) { |
| | |
| | | ) |
| | | })} |
| | | </div> |
| | | // <Menu mode="horizontal"> |
| | | // {item.children.map(cell => { |
| | | // return ( |
| | | // <Menu.Item key={cell.MenuID}> |
| | | // <div>{cell.MenuName}</div> |
| | | // <div> |
| | | // {cell.children && cell.children.map(m => ( |
| | | // <Menu.Item key={m.MenuID} onClick={() => {this.changeVerMenu(m)}}> |
| | | // {m.MenuName} |
| | | // </Menu.Item> |
| | | // ))} |
| | | // </div> |
| | | // </Menu.Item> |
| | | // ) |
| | | // })} |
| | | // </Menu> |
| | | }> |
| | | <li> |
| | | <span>{item.MenuName}</span> |
| | |
| | | import { modifyTabview, toggleIsiframe } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncLoadComponent' |
| | | import NotFount from '@/components/404' |
| | | // import options from '@/store/options.js' |
| | | import options from '@/store/options.js' |
| | | import mzhCN from '@/locales/zh-CN/main.js' |
| | | import menUS from '@/locales/en-US/main.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | | const Home = asyncComponent(() => import('@/tabviews/home')) |
| | |
| | | e.stopPropagation() |
| | | window.GLOB.CacheMap = new Map() |
| | | |
| | | MKEmitter.emit('reloadMenuView', menu.MenuID) |
| | | if (options.sysType === 'local' && window.GLOB.systemType !== 'production') { |
| | | Api.getAppVersion().then(() => { |
| | | MKEmitter.emit('reloadMenuView', menu.MenuID) |
| | | }, () => { |
| | | MKEmitter.emit('reloadMenuView', menu.MenuID) |
| | | }) |
| | | } else { |
| | | MKEmitter.emit('reloadMenuView', menu.MenuID) |
| | | } |
| | | } |
| | | |
| | | changeTab = (e, menu) => { |
| | |
| | | font-style: italic; |
| | | } |
| | | } |
| | | .header-container + .mk-tabview-wrap { |
| | | max-width: 100%; |
| | | } |
| | | .mk-tabview-wrap.collapsed { |
| | | max-width: calc(100% - 80px); |
| | | } |
| | |
| | | if (item.key === 'field' || item.key === 'linkurl') { |
| | | item.options = [] |
| | | config.columns.forEach(col => { |
| | | if (!/^Nvarchar/ig.test(col.datatype) && (card.eleType === 'number' || card.eleType === 'slider')) { |
| | | if (/^(Int|Decimal)/ig.test(col.datatype) && (card.eleType === 'number' || card.eleType === 'slider')) { |
| | | item.options.push({ |
| | | value: col.field, |
| | | text: col.label |
| | | }) |
| | | } else if (/^Nvarchar/ig.test(col.datatype) && card.eleType !== 'number' && card.eleType !== 'slider') { |
| | | } else if (/^(Nvarchar|date)/ig.test(col.datatype) && card.eleType !== 'number' && card.eleType !== 'slider') { |
| | | item.options.push({ |
| | | value: col.field, |
| | | text: col.label |
| | |
| | | if (item.key === 'field') { |
| | | item.options = [] |
| | | config.columns.forEach(col => { |
| | | if (!/^Nvarchar/ig.test(col.datatype) && (value === 'number' || value === 'slider')) { |
| | | if (/^(Int|Decimal)/ig.test(col.datatype) && (value === 'number' || value === 'slider')) { |
| | | item.options.push({ |
| | | value: col.field, |
| | | text: col.label |
| | | }) |
| | | } else if (/^Nvarchar/ig.test(col.datatype) && value !== 'number' && value !== 'slider') { |
| | | } else if (/^(Nvarchar|date)/ig.test(col.datatype) && value !== 'number' && value !== 'slider') { |
| | | item.options.push({ |
| | | value: col.field, |
| | | text: col.label |
| | |
| | | field: 'primaryId', |
| | | label: '主键值', |
| | | initval: setting.primaryId || '', |
| | | tooltip: '卡片点击时,向其他组件传递的ID值。', |
| | | tooltip: '设置一个属性卡静态ID,向其他组件传递的指定静态ID值', |
| | | required: false, |
| | | forbid: !hasPrimaryKey |
| | | }, |
| | |
| | | field: 'primaryId', |
| | | label: '主键值', |
| | | initval: setting.primaryId || '', |
| | | tooltip: '卡片点击时,向其他组件传递的ID值。', |
| | | tooltip: '设置一个属性卡静态ID,向其他组件传递的指定静态ID值', |
| | | required: false, |
| | | forbid: !hasPrimaryKey |
| | | }, |
| | |
| | | |
| | | getWrapForms = () => { |
| | | const { card } = this.state |
| | | |
| | | return getWrapForm(card.wrap, card.subtype) |
| | | return getWrapForm(card.wrap, card.subtype, card.columns) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | ] |
| | | })( |
| | | <Select> |
| | | <Select.Option value="Nvarchar(10)"> Nvarchar(10) </Select.Option> |
| | | <Select.Option value="Nvarchar(20)"> Nvarchar(20) </Select.Option> |
| | | <Select.Option value="Nvarchar(50)"> Nvarchar(50) </Select.Option> |
| | | <Select.Option value="Nvarchar(100)"> Nvarchar(100) </Select.Option> |
| | | <Select.Option value="Nvarchar(512)"> Nvarchar(512) </Select.Option> |
| | |
| | | <Select.Option value="Decimal(18,16)"> Decimal(18,16) </Select.Option> |
| | | <Select.Option value="Decimal(18,17)"> Decimal(18,17) </Select.Option> |
| | | <Select.Option value="Decimal(18,18)"> Decimal(18,18) </Select.Option> |
| | | {/* <Select.Option value="date"> date </Select.Option> */} |
| | | <Select.Option value="date"> date </Select.Option> |
| | | <Select.Option value="datetime"> datetime </Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | |
| | | dataIndex: 'datatype', |
| | | inputType: 'select', |
| | | options: [ |
| | | { value: 'Nvarchar(10)', text: 'Nvarchar(10)' }, |
| | | { value: 'Nvarchar(20)', text: 'Nvarchar(20)' }, |
| | | { value: 'Nvarchar(50)', text: 'Nvarchar(50)' }, |
| | | { value: 'Nvarchar(100)', text: 'Nvarchar(100)' }, |
| | | { value: 'Nvarchar(512)', text: 'Nvarchar(512)' }, |
| | |
| | | { value: 'Decimal(18,16)', text: 'Decimal(18,16)' }, |
| | | { value: 'Decimal(18,17)', text: 'Decimal(18,17)' }, |
| | | { value: 'Decimal(18,18)', text: 'Decimal(18,18)' }, |
| | | { value: 'date', text: 'date' }, |
| | | { value: 'datetime', text: 'datetime' }, |
| | | ], |
| | | editable: true, |
| | | width: '25%', |
| | |
| | | const presetColors = [ |
| | | '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#1890ff', '#2f54eb', '#722ed1', |
| | | '#eb2f96', '#595959', '#ffa39e', '#ffbb96', '#ffd591', '#ffe58f', '#fffb8f', '#eaff8f', '#b7eb8f', '#87e8de', '#91d5ff', |
| | | '#adc6ff', '#d3adf7', '#ffadd2', '#d9d9d9', '#434343', '#000000', '#ffffff', 'transparent' |
| | | '#adc6ff', '#d3adf7', '#EBE9E9', '#d9d9d9', '#434343', '#000000', '#ffffff', 'transparent' |
| | | ] |
| | | |
| | | class ColorSketch extends Component { |
| | |
| | | setting: { type: 'menu', width: 6, sign: 'icon', icon: 'user', name: '客户', url: '', color: '#ffffff', iconFont: 20, padding: 12, background: '#1890ff', imgWidth: '' }, |
| | | style: { |
| | | paddingTop: '15px', paddingBottom: '15px' |
| | | }, |
| | | isnew: true |
| | | } |
| | | } |
| | | |
| | | if (card.subMenus.length > 0) { |
| | | newcard = fromJS(card.subMenus.slice(-1)[0]).toJS() |
| | | newcard.uuid = Utils.getuuid() |
| | | newcard.isnew = true |
| | | } |
| | | |
| | | card.subMenus.push(newcard) |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Modal, Popover, Icon, Col } from 'antd' |
| | | import { Popover, Icon, Col } from 'antd' |
| | | |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | |
| | |
| | | MKEmitter.emit('changeStyle', [cards.uuid, card.uuid], options, _style) |
| | | } |
| | | |
| | | cancel = () => { |
| | | const { card } = this.state |
| | | |
| | | if (card.isnew) { |
| | | let _card = fromJS(card).toJS() |
| | | delete _card.isnew |
| | | |
| | | this.setState({ card: _card }) |
| | | this.props.updateElement(_card) |
| | | } |
| | | } |
| | | |
| | | getSettingForms = () => { |
| | | const { card } = this.state |
| | | |
| | | return getSettingForm(card.setting) |
| | | } |
| | | |
| | | updateSetting = (res, resolve) => { |
| | | updateSetting = (res) => { |
| | | const { card } = this.state |
| | | let _card = {...card, setting: res} |
| | | |
| | | if (!card.isnew && card.setting.type === 'menu' && _card.setting.type !== 'menu') { |
| | | const _this = this |
| | | confirm({ |
| | | content: '菜单将被重置,确定修改吗?', |
| | | onOk() { |
| | | _card.oriuuid = _card.uuid |
| | | _card.uuid = Utils.getuuid() |
| | | _this.setState({ card: _card }) |
| | | _this.props.updateElement(_card) |
| | | resolve() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else { |
| | | delete _card.isnew |
| | | this.setState({ card: _card }) |
| | | this.props.updateElement(_card) |
| | | resolve() |
| | | if (card.setting.type === 'menu' && _card.setting.type !== 'menu') { |
| | | _card.oriuuid = _card.uuid |
| | | _card.uuid = Utils.getuuid() |
| | | } |
| | | |
| | | this.setState({ card: _card }) |
| | | this.props.updateElement(_card) |
| | | } |
| | | |
| | | changeMenu = () => { |
| | |
| | | <Col span={card.setting.width || 6} offset={offset || 0}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <NormalForm title="菜单编辑" width={900} check update={this.updateSetting} getForms={this.getSettingForms} cancel={this.cancel}> |
| | | <NormalForm title="菜单编辑" width={900} update={this.updateSetting} getForms={this.getSettingForms}> |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="menucell" card={card}/> |
| | |
| | | field: 'linkurl', |
| | | label: '链接', |
| | | initval: setting.linkurl || '', |
| | | required: true |
| | | required: true, |
| | | span: 24 |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | min-height: 100px; |
| | | min-height: 180px; |
| | | |
| | | .tree-header { |
| | | position: relative; |
| | |
| | | card.elements = card.elements.filter(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | cell.Ot = 'requiredSgl' |
| | | cell.Ot = cell.Ot || 'requiredSgl' |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | |
| | | card.backElements = card.backElements.filter(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | cell.Ot = 'requiredSgl' |
| | | cell.Ot = cell.Ot || 'requiredSgl' |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | |
| | | card.elements = card.elements.filter(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | cell.Ot = 'requiredSgl' |
| | | cell.Ot = cell.Ot || 'requiredSgl' |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | |
| | | if (col.type !== 'action') return true |
| | | col.elements = col.elements.filter(cell => { |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | cell.Ot = 'requiredSgl' |
| | | cell.Ot = cell.Ot || 'requiredSgl' |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | |
| | | if (!_initvars.includes(_key)) { |
| | | let _val = datavars.hasOwnProperty(_key) ? datavars[_key] : '' |
| | | |
| | | if (col.datatype && /^date/ig.test(col.datatype) && !_val) { |
| | | _val = '1900-01-01' |
| | | } |
| | | |
| | | _initvars.push(_key) |
| | | _initColfields.push(`@${_key}='${_val}'`) |
| | | } |
| | |
| | | <div className="mk-main-view"> |
| | | <ConfigProvider locale={_locale}> |
| | | <Header key="header"/> |
| | | {isSideMenu ? <Sidemenu key="sidemenu"/> : null} |
| | | {isSideMenu && navBar !== 'menu_board_navigation' ? <Sidemenu key="sidemenu"/> : null} |
| | | {isSideMenu ? <Tabview key="tabview"/> : null} |
| | | {!isSideMenu ? <Breadview key="breadview"/> : null} |
| | | <QueryLog /> |
| | |
| | | background: #ffffff; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | padding-bottom: 50px; |
| | | |
| | | > .ant-collapse { |
| | | background-color: #ffffff; |
| | |
| | | position: fixed; |
| | | right: 0; |
| | | top: 48px; |
| | | height: 100vh; |
| | | height: calc(100vh - 48px); |
| | | padding: 20px 10px; |
| | | background: #ffffff; |
| | | z-index: 10; |
| | | transition: right 0.3s; |
| | | overflow-y: auto; |
| | | |
| | | .draw { |
| | | position: absolute; |
| | |
| | | height: 22px; |
| | | } |
| | | } |
| | | .menu-control::-webkit-scrollbar { |
| | | width: 2px; |
| | | } |
| | | .menu-control::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.08); |
| | | background: rgba(0, 0, 0, 0.08); |
| | | } |
| | | .menu-control::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | .menu-control.hidden { |
| | | right: -130px; |
| | | } |
| | |
| | | box-shadow: 0px 2px 5px #bcbcbc; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | padding-bottom: 50px; |
| | | |
| | | > .ant-collapse { |
| | | background-color: #ffffff; |
| | |
| | | z-index: 10; |
| | | transition: right 0.3s; |
| | | box-shadow: 0px 0px 5px #bcbcbc; |
| | | overflow-y: auto; |
| | | |
| | | .draw { |
| | | position: absolute; |
| | |
| | | height: 22px; |
| | | } |
| | | } |
| | | .menu-control::-webkit-scrollbar { |
| | | width: 2px; |
| | | } |
| | | .menu-control::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.08); |
| | | background: rgba(0, 0, 0, 0.08); |
| | | } |
| | | .menu-control::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | .menu-control.hidden { |
| | | right: -130px; |
| | | } |