| | |
| | | const cssModuleRegex = /\.module\.css$/; |
| | | const sassRegex = /\.(scss|sass)$/; |
| | | const sassModuleRegex = /\.module\.(scss|sass)$/; |
| | | const sign = (() => { |
| | | let uuid = [] |
| | | let options = '0123456789abcdefghigklmnopqrstuv' |
| | | for (let i = 0; i < 8; i++) { |
| | | uuid.push(options.substr(Math.floor(Math.random() * 0x20), 1)) |
| | | } |
| | | return uuid.join('') |
| | | })() |
| | | |
| | | // src => @ |
| | | function resolves(dir) { |
| | |
| | | // In development, it does not produce real files. |
| | | // contenthash => hash |
| | | filename: isEnvProduction |
| | | ? 'static/js/[name].[hash:8].js' |
| | | ? `static/js/[name].${sign}.js` |
| | | : isEnvDevelopment && 'static/js/bundle.js', |
| | | // TODO: remove this when upgrading to webpack 5 |
| | | futureEmitAssets: true, |
| | | // There are also additional JS chunk files if you use code splitting. |
| | | // contenthash => hash |
| | | chunkFilename: isEnvProduction |
| | | ? 'static/js/[name].[hash:8].chunk.js' |
| | | ? `static/js/[name].${sign}.chunk.js` |
| | | : isEnvDevelopment && 'static/js/[name].chunk.js', |
| | | // We inferred the "public path" (such as / or /my-project) from homepage. |
| | | // We use "/" in development. |
| | |
| | | loader: require.resolve('url-loader'), |
| | | options: { |
| | | limit: imageInlineSizeLimit, |
| | | name: 'static/media/[name].[hash:8].[ext]', |
| | | name: `static/media/[name].${sign}.[ext]`, |
| | | }, |
| | | }, |
| | | // Process application JS with Babel. |
| | |
| | | // by webpacks internal loaders. |
| | | exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/], |
| | | options: { |
| | | name: 'static/media/[name].[hash:8].[ext]', |
| | | name: `static/media/[name].${sign}.[ext]`, |
| | | }, |
| | | }, |
| | | // ** STOP ** Are you adding a new loader? |
| | |
| | | // Options similar to the same options in webpackOptions.output |
| | | // both options are optional |
| | | // contenthash => hash |
| | | filename: 'static/css/[name].[hash:8].css', |
| | | chunkFilename: 'static/css/[name].[hash:8].chunk.css', |
| | | filename: `static/css/[name].${sign}.css`, |
| | | chunkFilename: `static/css/[name].${sign}.chunk.css`, |
| | | }), |
| | | // Generate a manifest file which contains a mapping of all asset filenames |
| | | // to their corresponding output file so that tools can pick it up without |
| | |
| | | <head> |
| | | <meta charset="utf-8" /> |
| | | <meta name="renderer" content="webkit"> |
| | | <!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" /> --> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| | | <meta name="theme-color" content="#000000" /> |
| | | <link rel="shortcut icon" href="#"> |
| | | <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> |
| | | <title></title> |
| | | <script> |
| | | let _href = window.location.href.split('#')[0] |
| | | let l_version = localStorage.getItem(_href + 'version') |
| | | let _ctime = parseInt(new Date().getTime() / 1000) |
| | | let _time = '' |
| | | |
| | | if (l_version) { |
| | | let vers = l_version.split('-') |
| | | l_version = vers[0] |
| | | _time = +vers[1] |
| | | } |
| | | |
| | | if (_time && _ctime - _time < 180) { |
| | | let meta1 = document.createElement('meta') |
| | | let meta2 = document.createElement('meta') |
| | | let meta3 = document.createElement('meta') |
| | | let meta4 = document.createElement('meta') |
| | | meta1.content = '0' |
| | | meta1.httpEquiv = 'Expires' |
| | | meta2.content = 'no-cache' |
| | | meta2.httpEquiv = 'Pragma' |
| | | meta3.content = 'no-cache' |
| | | meta3.httpEquiv = 'Cache-Control' |
| | | meta4.content = 'no-cache' |
| | | meta4.httpEquiv = 'Cache' |
| | | document.getElementsByTagName('head')[0].appendChild(meta1) |
| | | document.getElementsByTagName('head')[0].appendChild(meta2) |
| | | document.getElementsByTagName('head')[0].appendChild(meta3) |
| | | document.getElementsByTagName('head')[0].appendChild(meta4) |
| | | } else { |
| | | fetch('./manifest.json', { cache: 'no-cache'}) |
| | | .then(response => response.json()) |
| | | .then(res => { |
| | | if (res && res.mk_version) { |
| | | let version = res.mk_version |
| | | let nocache = false |
| | | |
| | | if (l_version && version !== l_version) { |
| | | nocache = true |
| | | localStorage.setItem(_href + 'version', version + '-' + _ctime) |
| | | } else if (!l_version) { |
| | | localStorage.setItem(_href + 'version', version + '-' + (_ctime - 360)) |
| | | } |
| | | |
| | | if (nocache) { |
| | | window.location.reload() |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | </script> |
| | | </head> |
| | | <body> |
| | | <noscript>You need to enable JavaScript to run this app.</noscript> |
| | |
| | | "start_url": ".", |
| | | "display": "standalone", |
| | | "theme_color": "#000000", |
| | | "background_color": "#ffffff" |
| | | "background_color": "#ffffff", |
| | | "mk_version": "20230712" |
| | | } |
| | |
| | | const TreePage = asyncComponent(() => import('@/tabviews/treepage')) |
| | | const Iframe = asyncComponent(() => import('@/tabviews/iframe')) |
| | | const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) |
| | | const FormTab = asyncComponent(() => import('@/tabviews/formtab')) |
| | | |
| | | moment.locale('zh-cn') |
| | | |
| | |
| | | return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>) |
| | | } else if (view.type === 'TreePage') { |
| | | return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>) |
| | | } else if (view.type === 'FormTab') { |
| | | return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>) |
| | | } else if (view.type === 'iframe') { |
| | | return (<Iframe MenuID={view.MenuID} title={view.MenuName} url={view.src}/>) |
| | | } else { |
| | |
| | | import 'moment/locale/zh-cn' |
| | | |
| | | import asyncComponent from '@/utils/asyncLoadComponent' |
| | | // import NotFount from '@/components/404' |
| | | import NotFount from '@/components/404' |
| | | import options from '@/store/options.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Api from '@/api' |
| | |
| | | const TreePage = asyncComponent(() => import('@/tabviews/treepage')) |
| | | const Iframe = asyncComponent(() => import('@/tabviews/iframe')) |
| | | const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) |
| | | const FormTab = asyncComponent(() => import('@/tabviews/formtab')) |
| | | const Calendar = asyncComponent(() => import('@/tabviews/calendar')) |
| | | |
| | | moment.locale('zh-cn') |
| | | |
| | |
| | | return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>) |
| | | } else if (view.type === 'RolePermission') { |
| | | return (<RoleManage MenuID={view.MenuID}/>) |
| | | } else if (view.type === 'FormTab') { |
| | | return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>) |
| | | } else if (view.type === 'iframe') { |
| | | return (<Iframe MenuID={view.MenuID} title={view.MenuName} url={view.src}/>) |
| | | } else { |
| | | return (<Calendar MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>) |
| | | // return (<NotFount />) |
| | | return (<NotFount />) |
| | | } |
| | | } |
| | | |
| | |
| | | import options, { styles } from '@/store/options.js' |
| | | import '@/assets/css/main.scss' |
| | | import '@/assets/css/action.scss' |
| | | // import '@/assets/css/minkeicon.css' |
| | | import '@/assets/css/viewstyle.scss' |
| | | |
| | | if (window.location.href.indexOf('#/design') > -1) { // 编辑页面刷新时,跳转至主页 |
| | |
| | | } |
| | | |
| | | sessionStorage.removeItem('isEditState') |
| | | |
| | | // 新系统文件置于admin中 ../options.json , { cache: 'no-cache'} |
| | | |
| | | fetch('../options.json') |
| | | .then(response => response.json()) |
| | |
| | | } |
| | | |
| | | let _href = window.location.href.split('#')[0] |
| | | |
| | | let _systemMsg = localStorage.getItem(_href + 'system') |
| | | |
| | | GLOB.navBar = 'shutter' // 默认为百叶窗 |
| | |
| | | res.resetContrl = card.wrap.resetContrl || 'init' |
| | | |
| | | if (res.colorField && res.signs) { |
| | | res.signs = res.signs.map(item => { |
| | | res.signs = res.signs.map((item, i) => { |
| | | try { |
| | | let colors = item.color.match(/\d+/g) |
| | | let colors = item.background.match(/\d+/g) |
| | | if ((colors[0] * 0.299 + colors[1] * 0.578 + colors[2] * 0.114) * colors[3] < 192) { |
| | | item.fontColor = '#ffffff' |
| | | } else { |
| | |
| | | item.fontColor = '' |
| | | } |
| | | |
| | | item.style = {background: item.background} |
| | | if (item.fontColor) { |
| | | item.style.color = item.fontColor |
| | | } |
| | | |
| | | item.$index = i + 1 |
| | | |
| | | return item |
| | | }) |
| | | } |
| | |
| | | |
| | | if (card.style && card.style.clear === 'left') { |
| | | _style_ = {clear: 'left'} |
| | | } else if (card.style && card.style.clear === 'right') { |
| | | _style_ = {float: 'right'} |
| | | } |
| | | |
| | | let className = card.width || '' |
| | |
| | | |
| | | if (card.style && card.style.clear === 'left') { |
| | | _style_ = {clear: 'left'} |
| | | } else if (card.style && card.style.clear === 'right') { |
| | | _style_ = {float: 'right'} |
| | | } |
| | | |
| | | let tableHCell = false |
| | |
| | | const { card, side } = this.state |
| | | |
| | | let _style = null |
| | | let options = ['height', 'background', 'border', 'padding', 'margin', 'shadow'] |
| | | let options = ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear'] |
| | | if (side === 'front') { |
| | | _style = card.style ? fromJS(card.style).toJS() : {} |
| | | } else if (side === 'back') { |
| | |
| | | tablerole = ' mk-table-header' |
| | | } |
| | | |
| | | let _style_ = null |
| | | |
| | | if (card.style.clear === 'left') { |
| | | _style_ = {clear: 'left'} |
| | | } else if (card.style.clear === 'right') { |
| | | _style_ = {float: 'right'} |
| | | } |
| | | |
| | | return ( |
| | | <Col span={card.setting.width || 6}> |
| | | <Col span={card.setting.width || 6} style={_style_}> |
| | | <div className={'card-item ' + (card.setting.btnControl || '') + checkAll + tablerole} style={_style} onDoubleClick={(e) => {e.stopPropagation(); this.doubleClickCard()}} id={card.uuid}> |
| | | <span className="circle-select"></span> |
| | | <CardCellComponent cards={cards} cardCell={card} side={side} elements={elements} updateElement={this.updateCard}/> |
| | |
| | | } |
| | | } |
| | | MKEmitter.emit('changeModal', card, btn) |
| | | } else if (btn.OpenType === 'popview' && appType !== 'mob') { |
| | | MKEmitter.emit('changePopview', card, btn) |
| | | } else if (btn.OpenType === 'popview') { |
| | | if (appType === 'mob') { |
| | | message.warning('滑动按钮不支持弹窗页面!') |
| | | } else { |
| | | MKEmitter.emit('changePopview', card, btn) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | if (type === 'sub') { |
| | | _style = fromJS(card.backStyle).toJS() |
| | | } else { |
| | | options.push('clear') |
| | | _style = fromJS(card.style).toJS() |
| | | } |
| | | |
| | |
| | | mainBox = 'flex-card ' |
| | | } |
| | | |
| | | let _style_ = null |
| | | |
| | | if (card.style.clear === 'left') { |
| | | _style_ = {clear: 'left'} |
| | | } else if (card.style.clear === 'right') { |
| | | _style_ = {float: 'right'} |
| | | } |
| | | |
| | | return ( |
| | | <Col span={card.setting.width || 24}> |
| | | <Col span={card.setting.width || 24} style={_style_}> |
| | | <div className="card-item-wrap" style={_wrapStyle}> |
| | | <div className={`card-item ${card.setting.btnControl || ''} ${checkAll} mk-${card.setting.display} ${mainBox}`} style={_style} onDoubleClick={(e) => {e.stopPropagation(); this.doubleClickCard()}} id={card.uuid}> |
| | | <span className="circle-select"></span> |
| | |
| | | let reReadonly = {} |
| | | |
| | | if (this.record.type === 'prev') { |
| | | shows = ['type', 'label', 'enable', 'actionType'] |
| | | shows = ['typeName', 'label', 'actionType'] |
| | | } else if (this.record.type === 'next') { |
| | | shows = ['type', 'label', 'enable', 'actionType'] |
| | | shows = ['typeName', 'label', 'actionType'] |
| | | } else if (this.record.type === 'close') { |
| | | shows = ['type', 'label', 'enable'] |
| | | shows = ['typeName', 'label'] |
| | | } else { |
| | | shows = ['type', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'enable', 'output', 'reload'] // 选项列表 |
| | | shows = ['typeName', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'output', 'reload'] // 选项列表 |
| | | |
| | | if (this.record.intertype === 'custom') { |
| | | shows.pop() |
| | |
| | | |
| | | export function getActionForm (card, functip, tableName, usefulFields, modules, anchors) { |
| | | const appType = sessionStorage.getItem('appType') |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let _type = '提交' |
| | | if (card.type === 'prev') { |
| | | _type = '上一步' |
| | |
| | | } |
| | | } |
| | | |
| | | let refresh = [] |
| | | if (viewType === 'popview') { // 弹窗标签 |
| | | refresh.push({ |
| | | value: 'closepoptab', // 关闭弹窗标签 |
| | | text: '关闭弹窗' |
| | | }) |
| | | refresh.push({ |
| | | value: 'popclose', // 执行弹窗关闭时的刷新 |
| | | text: '刷新源组件' |
| | | }) |
| | | } |
| | | |
| | | return [ |
| | | { |
| | | type: 'tip', |
| | | key: 'type', |
| | | label: '按钮类型', |
| | | initVal: card.type, |
| | | forbid: true |
| | | }, |
| | | { |
| | | type: 'tip', |
| | | key: 'typeName', |
| | | label: '按钮类型', |
| | | initVal: _type |
| | | }, |
| | |
| | | }, { |
| | | value: 'mainline', |
| | | text: '刷新上级组件 - 行' |
| | | }] |
| | | }, ...refresh] |
| | | }, |
| | | { |
| | | type: (appType === 'pc' || appType === 'mob') ? 'select' : 'cascader', |
| | |
| | | .submit { |
| | | border: none; |
| | | height: auto; |
| | | border-style: solid; |
| | | } |
| | | .skip { |
| | | color: rgba(0, 0, 0, 0.85); |
| | |
| | | scripts: [], |
| | | subcards: [{ |
| | | uuid: Utils.getuuid(), |
| | | setting: {title: '空', align: 'left_right', enable: 'true'}, |
| | | setting: {title: '', align: 'left_right', enable: 'true'}, |
| | | style: {}, |
| | | fields: [], |
| | | subButton: {label: '提交', type: 'submit', intertype: 'system', reload: 'false', sqlType: 'update', sql: '', Ot: 'notRequired', execSuccess: 'never', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | |
| | | |
| | | if (card.style && card.style.clear === 'left') { |
| | | style.clear = 'left' |
| | | } else if (card.style && card.style.clear === 'right') { |
| | | style.float = 'right' |
| | | } |
| | | |
| | | const getCardComponent = () => { |
| | |
| | | shows.push('placement') |
| | | } else if (this.record.display === 'drawer') { |
| | | shows.push('placement') |
| | | } else if (this.record.display === 'modal') { |
| | | shows.push('popshow') |
| | | } |
| | | if (this.record.popClose === 'grid') { |
| | | shows.push('resetPageIndex') |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'popshow', |
| | | label: '弹窗展示', |
| | | initVal: card.popshow || 'default', |
| | | tooltip: '小窗口展示将隐藏标题及底部按钮。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'default', |
| | | text: '默认' |
| | | }, { |
| | | value: 'miniview', |
| | | text: '小窗口' |
| | | }], |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'maskStyle', |
| | | label: '蒙层样式', |
| | | initVal: card.maskStyle || 'default', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'popshow', |
| | | label: '弹窗展示', |
| | | initVal: card.popshow || 'default', |
| | | tooltip: '小窗口展示将隐藏标题及底部按钮。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'default', |
| | | text: '默认' |
| | | }, { |
| | | value: 'miniview', |
| | | text: '小窗口' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'preFunc', |
| | | label: '前置函数', |
| | |
| | | col.label = '序号' |
| | | } |
| | | |
| | | _columns.splice(hoverIndex, 0, col) |
| | | let hIndex = +hoverIndex |
| | | |
| | | if (_columns.length > 0 && hIndex + 1 === _columns.length) { |
| | | _columns.push(col) |
| | | } else { |
| | | _columns.splice(hIndex, 0, col) |
| | | } |
| | | |
| | | this.setState({ |
| | | columns: _columns |
| | |
| | | |
| | | if (card.style && card.style.clear === 'left') { |
| | | style.clear = 'left' |
| | | } else if (card.style && card.style.clear === 'right') { |
| | | style.float = 'right' |
| | | } |
| | | |
| | | const getCardComponent = () => { |
| | |
| | | |
| | | if (card.style && card.style.clear === 'left') { |
| | | style.clear = 'left' |
| | | } else if (card.style && card.style.clear === 'right') { |
| | | style.float = 'right' |
| | | } |
| | | |
| | | const getCardComponent = () => { |
| | |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.clear || 'none'} onChange={(e) => this.changeNormalStyle(e.target.value, 'clear')}> |
| | | <Radio value="none">左浮动</Radio> |
| | | <Radio value="left">不浮动</Radio> |
| | | <Radio value="right">右浮动</Radio> |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | padding-left: 0px; |
| | | padding-right: 0px; |
| | | } |
| | | >.ant-col:not(.ant-col-24) { |
| | | >.ant-col { |
| | | padding-right: 10px; |
| | | } |
| | | >.ant-col:not(.ant-col-24) { |
| | | .am-list-line .am-input-label { |
| | | width: auto; |
| | | padding-right: 10px; |
| | |
| | | |
| | | if (card.style && card.style.clear === 'left') { |
| | | style.clear = 'left' |
| | | } else if (card.style && card.style.clear === 'right') { |
| | | style.float = 'right' |
| | | } |
| | | |
| | | const getCardComponent = () => { |
| | |
| | | |
| | | if (card.style && card.style.clear === 'left') { |
| | | style.clear = 'left' |
| | | } else if (card.style && card.style.clear === 'right') { |
| | | style.float = 'right' |
| | | } |
| | | |
| | | let col = 'ant-col-' + (card.width || 24) |
| | |
| | | |
| | | if (card.style && card.style.clear === 'left') { |
| | | style.clear = 'left' |
| | | } else if (card.style && card.style.clear === 'right') { |
| | | style.float = 'right' |
| | | } |
| | | |
| | | let col = ' ant-col ant-col-' + (card.width || 24) |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Select, Radio, Row, Col } from 'antd' |
| | | import { Select, Radio, Row, Col, Popover, Badge } from 'antd' |
| | | import moment from 'moment' |
| | | import 'moment/locale/zh-cn' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const { Option } = Select |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (!is(fromJS(this.props.config.wrap), fromJS(nextProps.config.wrap))) { |
| | | const { datelist } = this.state |
| | | if (!is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | this.setState({ |
| | | levels: nextProps.config.wrap.levels, |
| | | level: nextProps.config.wrap.levels[0] |
| | | datelist: this.mountdata(datelist, nextProps.data) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | mountdata = (datelist, data) => { |
| | | return fromJS(datelist).toJS().map(month => { |
| | | month.subData = [] |
| | | data.forEach(item => { |
| | | if (item.$startM <= month.time && item.$endM >= month.time) { |
| | | month.subData.push(item) |
| | | } |
| | | }) |
| | | |
| | | month.children = month.children.map(week => { |
| | | week.children = week.children.map(day => { |
| | | if (day.$disable) return day |
| | | |
| | | day.subData = [] |
| | | day.style = null |
| | | day.$level = 100 |
| | | data.forEach(item => { |
| | | if (item.$start <= day.time && item.$end >= day.time) { |
| | | day.subData.push(item) |
| | | |
| | | if (!day.style) { |
| | | day.style = item.$style |
| | | day.$level = item.$level |
| | | } else if (item.$level < day.$level) { |
| | | day.style = item.$style |
| | | day.$level = item.$level |
| | | } |
| | | } |
| | | }) |
| | | return day |
| | | }) |
| | | return week |
| | | }) |
| | | return month |
| | | }) |
| | | } |
| | | |
| | | getNongLi = (nyear, nmonth, nday, week) => { |
| | |
| | | |
| | | let item = { |
| | | day: _day, |
| | | time: times[0] + times[1] + _day, |
| | | time: +(times[0] + times[1] + _day), |
| | | label: _day, |
| | | subData: [], |
| | | $disable: true, |
| | |
| | | |
| | | let item = { |
| | | day: _day, |
| | | time: selectYear + month + _day, |
| | | time: +(selectYear + month + _day), |
| | | label: i, |
| | | subData: [], |
| | | ...nl |
| | |
| | | |
| | | let item = { |
| | | day: _day, |
| | | time: times[0] + times[1] + _day, |
| | | time: +(times[0] + times[1] + _day), |
| | | label: i, |
| | | subData: [], |
| | | $disable: true, |
| | |
| | | |
| | | datelist.push({ |
| | | month: month, |
| | | time: selectYear + month, |
| | | time: +(selectYear + month), |
| | | label: monthName[month], |
| | | children: _weeklist, |
| | | subData: [] |
| | |
| | | } |
| | | |
| | | yearChange = (value) => { |
| | | const { data } = this.props |
| | | const { selectMonth } = this.state |
| | | let datelist = this.getDateList(value) |
| | | |
| | | if (data.length > 0) { |
| | | datelist = this.mountdata(datelist, data) |
| | | } |
| | | |
| | | let monthlist = datelist.filter(item => item.month === selectMonth)[0].children.filter(cell => !cell.children[0].$disable || !cell.children[6].$disable) |
| | | |
| | | this.setState({ selectYear: value, datelist, monthlist }) |
| | | |
| | | this.props.yearChange(value) |
| | | } |
| | | |
| | | monthChange = (value) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | triggerDay = (d) => { |
| | | const { config } = this.props |
| | | |
| | | if (!config.setting.linkbtn) return |
| | | |
| | | let id = d.time + '' |
| | | id = id.substr(0, 4) + '-' + id.substr(4, 2) + '-' + id.substr(6) |
| | | |
| | | MKEmitter.emit('triggerBtnId', config.setting.linkbtn, [{$$uuid: id}]) |
| | | } |
| | | |
| | | openView = (data, e) => { |
| | | const { config } = this.props |
| | | |
| | | if (!config.wrap.click) return |
| | | |
| | | e && e.stopPropagation() |
| | | |
| | | if (config.wrap.click === 'menus') { |
| | | let menu = null |
| | | |
| | | if (config.wrap.menus && config.wrap.menus.length > 0) { |
| | | let s = data[config.wrap.menuType] + '' |
| | | config.wrap.menus.forEach(m => { |
| | | if (s !== m.sign) return |
| | | menu = m |
| | | }) |
| | | } |
| | | if (!menu) return |
| | | |
| | | let newtab = { |
| | | MenuID: menu.MenuID, |
| | | MenuName: menu.MenuName, |
| | | MenuNo: menu.MenuNo || '', |
| | | type: menu.tabType, |
| | | param: {$BID: data.$$uuid || ''} |
| | | } |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | newtab.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | } else if (config.wrap.click === 'menu') { |
| | | let menuId = config.wrap.MenuID || config.wrap.menu.slice(-1)[0] |
| | | let menu = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0] |
| | | |
| | | if (!menu && config.wrap.MenuName && config.wrap.tabType) { |
| | | menu = { |
| | | MenuID: menuId, |
| | | MenuName: config.wrap.MenuName, |
| | | MenuNo: config.wrap.MenuNo || '', |
| | | type: config.wrap.tabType |
| | | } |
| | | } |
| | | |
| | | if (!menu) return |
| | | |
| | | let newtab = { |
| | | ...menu, |
| | | param: {$BID: data.$$uuid || ''} |
| | | } |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | newtab.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { level, selectYear, selectMonth, yearlist, levels, datelist, monthlist } = this.state |
| | | const _levelName = {day: '日', month: '月', year: '年'} |
| | | |
| | | return ( |
| | | <div className="mk-calendar"> |
| | | <div className={'mk-calendar' + (config.setting.linkbtn ? ' open-pop' : '') + (config.wrap.click ? ' open-menu' : '')}> |
| | | <div className="mk-calendar-control"> |
| | | <Select value={selectYear} onChange={this.yearChange}> |
| | | {yearlist.map(item => (<Option key={item} value={item}>{item}年</Option>))} |
| | |
| | | <tr key={m}> |
| | | {cell.children.map((d, i) => ( |
| | | <td key={i}> |
| | | <div className={'day-wrap' + (d.$disable ? ' disabled' : '')}> |
| | | {d.label} |
| | | <div style={d.style} className={'day-wrap' + (d.$disable ? ' disabled' : '')} onClick={() => !d.$disable && this.triggerDay(d)}> |
| | | {d.subData.length > 0 ? <Popover mouseEnterDelay={0.3} overlayClassName={'calendar-day-pop' + (config.wrap.click ? ' open-menu' : '')} content={ |
| | | <div onClick={(e) => e.stopPropagation()}> |
| | | {d.subData.map((data, index) => ( |
| | | <div key={index} className="message" onClick={() => this.openView(data)}> |
| | | <Badge color={data.$color} text={ |
| | | <span> |
| | | {data.$message} |
| | | <span style={{color: 'rgba(0,0,0,.45)'}}>({data.$startTime + ' ~ ' + data.$endTime})</span> |
| | | </span>} |
| | | /> |
| | | </div> |
| | | ))} |
| | | </div> |
| | | } trigger="hover"> |
| | | {d.label} |
| | | </Popover> : d.label} |
| | | </div> |
| | | </td> |
| | | ))} |
| | |
| | | <tr key={m}> |
| | | {cell.children.map((d, i) => ( |
| | | <td key={i}> |
| | | <div className={'month-wrap' + (d.$disable ? ' disabled' : '')}> |
| | | <div className={'month-wrap' + (d.$disable ? ' disabled' : '')} onClick={() => !d.$disable && this.triggerDay(d)}> |
| | | <div className="header"> |
| | | <div className="message"> |
| | | {d.label} |
| | |
| | | <span className="right">{d.jr}</span> |
| | | </div> |
| | | </div> |
| | | <ul className="content"></ul> |
| | | <ul className="content"> |
| | | {d.subData.map((data, index) => ( |
| | | <li key={index} className="message" onClick={(e) => this.openView(data, e)}> |
| | | <Badge color={data.$color} text={data.$message} /> |
| | | </li> |
| | | ))} |
| | | </ul> |
| | | </div> |
| | | </td> |
| | | ))} |
| | |
| | | <div className="header"> |
| | | {item.label} |
| | | </div> |
| | | <ul className="content"></ul> |
| | | <ul className="content"> |
| | | {item.subData.map((data, index) => ( |
| | | <li key={index} className="message" onClick={() => this.openView(data)}> |
| | | <Badge color={data.$color} text={`${data.$message} (${data.$startTime} ~ ${data.$endTime})`}/> |
| | | </li> |
| | | ))} |
| | | </ul> |
| | | </div> |
| | | </Col> |
| | | ))} |
| | |
| | | } |
| | | .content { |
| | | padding: 0 10px 10px; |
| | | height: 70px; |
| | | height: 55px; |
| | | overflow-y: auto; |
| | | position: absolute; |
| | | left: 0; |
| | | right: 0; |
| | | .message { |
| | | width: 100%; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | .ant-badge { |
| | | width: 100%; |
| | | } |
| | | .ant-badge-status-text { |
| | | color: inherit; |
| | | font-size: 13px; |
| | | width: calc(100% - 15px); |
| | | overflow: hidden; |
| | | word-break: break-word; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | height: 21px; |
| | | display: inline-block; |
| | | vertical-align: top; |
| | | } |
| | | } |
| | | } |
| | |
| | | .year-wrap { |
| | | width: calc(100% - 2px); |
| | | box-shadow: 0px 0px 3px var(--mk-sys-color2); |
| | | cursor: pointer; |
| | | transition: background 0.1s; |
| | | .header { |
| | | text-align: center; |
| | |
| | | width: 100%; |
| | | overflow: hidden; |
| | | margin-bottom: 5px; |
| | | text-overflow: ellipsis; |
| | | .ant-badge { |
| | | width: 100%; |
| | | } |
| | | .ant-badge-status-text { |
| | | font-size: 13px; |
| | | width: calc(100% - 15px); |
| | | overflow: hidden; |
| | | word-break: break-word; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | height: 21px; |
| | | display: inline-block; |
| | | vertical-align: top; |
| | | } |
| | | } |
| | | } |
| | | .content::-webkit-scrollbar { |
| | |
| | | } |
| | | } |
| | | } |
| | | .mk-calendar:not(.open-pop) { |
| | | .day-wrap { |
| | | cursor: default!important; |
| | | } |
| | | .month-wrap { |
| | | cursor: default!important; |
| | | } |
| | | } |
| | | .mk-calendar.open-menu { |
| | | .month-wrap, .year-wrap { |
| | | .content { |
| | | .message { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .calendar-day-pop.open-menu { |
| | | .message { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | .calendar-day-pop { |
| | | .message { |
| | | .ant-badge-status-text { |
| | |
| | | vertical-align: middle; |
| | | } |
| | | } |
| | | .ant-popover-inner { |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); |
| | | } |
| | | .ant-popover-inner-content { |
| | | min-height: 100px; |
| | | padding: 0px; |
| | | min-height: 45px; |
| | | max-height: 200px; |
| | | overflow-y: auto; |
| | | >div { |
| | | padding: 12px 16px; |
| | | } |
| | | } |
| | | .ant-popover-inner-content::-webkit-scrollbar { |
| | | width: 5px; |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import CalendarBoard from './board' |
| | | import './index.scss' |
| | | |
| | | const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) |
| | | const MainSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch')) |
| | | const PopupButton = asyncComponent(() => import('@/tabviews/zshare/actionList/popupbutton')) |
| | | const CalendarBoard = asyncComponent(() => import('./board')) |
| | | |
| | | class NormalCalendar extends Component { |
| | | static propTpyes = { |
| | |
| | | BID: '', // 上级ID |
| | | config: null, // 图表配置信息 |
| | | loading: false, // 数据加载状态 |
| | | data: null, // 数据 |
| | | data: [], // 数据 |
| | | search: '', |
| | | year: new Date().getFullYear(), |
| | | BData: '' |
| | |
| | | _config.setting.$re_year = true |
| | | } |
| | | |
| | | if (_config.wrap.colorField && (!_config.wrap.signs || _config.wrap.signs.length === 0)) { |
| | | _config.wrap.colorField = '' |
| | | } |
| | | |
| | | if (_config.action[0] && _config.action[0].config && _config.action[0].config.enabled) { |
| | | _config.setting.linkbtn = _config.action[0].uuid |
| | | } else { |
| | | _config.action = [] |
| | | } |
| | | |
| | | this.setState({ |
| | | BID: BData ? (BData.$BID || '') : '', |
| | | BData: BData, |
| | |
| | | Api.getLCacheConfig(config.uuid).then(res => { |
| | | if (!res || this.loaded) return |
| | | |
| | | this.setState({data: res.map((item, index) => { |
| | | let data = [] |
| | | res.forEach((item, index) => { |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$Index = index + 1 + '' |
| | | |
| | | return item |
| | | })}) |
| | | |
| | | let pass = this.resetLine(item) |
| | | |
| | | if (pass) { |
| | | data.push(item) |
| | | } |
| | | }) |
| | | |
| | | this.setState({data: data}) |
| | | }) |
| | | } |
| | | } |
| | |
| | | Api.writeCacheConfig(config.uuid, result.data || '') |
| | | } |
| | | |
| | | let data = result.data.map((item, index) => { |
| | | let data = [] |
| | | result.data.forEach((item, index) => { |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | |
| | | return item |
| | | let pass = this.resetLine(item) |
| | | |
| | | if (pass) { |
| | | data.push(item) |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | data: data, |
| | | loading: false |
| | | }) |
| | | |
| | | |
| | | if (result.message) { |
| | | if (result.ErrCode === 'Y') { |
| | | Modal.success({ |
| | |
| | | } |
| | | } |
| | | |
| | | resetLine = (item) => { |
| | | const { config: { wrap } } = this.state |
| | | |
| | | let startTime = item[wrap.timeField] || '' |
| | | let endTime = item[wrap.endField || wrap.timeField] || '' |
| | | |
| | | item.$message = item[wrap.remarkField] |
| | | |
| | | if (!/^(1|2)\d{3}(-|\/)\d{2}(-|\/)\d{2}/.test(startTime)) return false |
| | | if (!/^(1|2)\d{3}(-|\/)\d{2}(-|\/)\d{2}/.test(endTime)) return false |
| | | if (!item.$message) return false |
| | | |
| | | if (wrap.colorField) { |
| | | let sign = item[wrap.colorField] || '' |
| | | |
| | | wrap.signs.forEach(cell => { |
| | | if (cell.sign !== sign) return |
| | | |
| | | item.$style = cell.style |
| | | item.$color = cell.background |
| | | item.$level = cell.$index |
| | | }) |
| | | } |
| | | |
| | | let equal = endTime.substr(0, 4) === startTime.substr(0, 4) |
| | | |
| | | item.$startM = +(startTime.substr(0, 4) + startTime.substr(5, 2)) |
| | | item.$endM = +(endTime.substr(0, 4) + endTime.substr(5, 2)) |
| | | item.$start = +(startTime.substr(0, 4) + startTime.substr(5, 2) + startTime.substr(8, 2)) |
| | | item.$end = +(endTime.substr(0, 4) + endTime.substr(5, 2) + endTime.substr(8, 2)) |
| | | item.$startTime = equal ? `${startTime.substr(5, 2)}-${startTime.substr(8, 2)}` : `${startTime.substr(0, 4)}-${startTime.substr(5, 2)}-${startTime.substr(8, 2)}` |
| | | item.$endTime = equal ? `${endTime.substr(5, 2)}-${endTime.substr(8, 2)}` : `${endTime.substr(0, 4)}-${endTime.substr(5, 2)}-${endTime.substr(8, 2)}` |
| | | |
| | | return true |
| | | } |
| | | |
| | | refreshbysearch = (searches) => { |
| | | this.setState({ |
| | | search: searches |
| | | }, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | |
| | | yearChange = (value) => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.$re_year) return |
| | | |
| | | this.setState({ |
| | | year: value |
| | | }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | <div className="normal-calendar-box" id={'anchor' + config.uuid} style={{...config.style}}> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | {data ? <div className="ant-spin-blur"></div> : null} |
| | | <div className="ant-spin-blur"></div> |
| | | <Spin /> |
| | | </div> : null |
| | | } |
| | |
| | | {config.action[0] ? |
| | | <PopupButton disabled={false} BID={BID} btn={config.action[0]} BData={BData} setting={config.setting} selectedData={[]}/> : null |
| | | } |
| | | <CalendarBoard config={config} /> |
| | | <CalendarBoard config={config} data={data} yearChange={this.yearChange}/> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 标签关闭刷新 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (card.style && card.style.clear === 'left') { |
| | | _style_ = {clear: 'left'} |
| | | } else if (card.style && card.style.clear === 'right') { |
| | | _style_ = {float: 'right'} |
| | | } |
| | | |
| | | if (card.eleType === 'sequence') { |
| | |
| | | } |
| | | } |
| | | |
| | | if (item.style.clear === 'left') { |
| | | item.wStyle = {clear: 'left'} |
| | | } else if (item.style.clear === 'right') { |
| | | item.wStyle = {float: 'right'} |
| | | } |
| | | |
| | | delete item.style.clear |
| | | |
| | | if (item.$cardType !== 'extendCard') { |
| | | _card = item |
| | | } else if (!_card) { |
| | |
| | | } else { |
| | | this.loadData(id) |
| | | } |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | |
| | | {switchable ? <div className={'prev-page ' + (pageIndex === 1 ? 'disabled' : '')} onClick={this.prevPage}><div><div><img src={preImg} alt=""/></div></div></div> : null} |
| | | <Row className={'card-row-list ' + config.wrap.layout}> |
| | | {precards.map((item, index) => ( |
| | | <Col key={'pre' + index} className="extend-card" span={item.setting.width || 6}> |
| | | <Col key={'pre' + index} className="extend-card" style={item.wStyle} span={item.setting.width || 6}> |
| | | {item.setting.cardRole === 'header' ? <TableHeader card={item} data={extendData} refresh={this.refreshByHeader}> |
| | | {item.setting.checkAll === 'show' ? <span onClick={this.checkAll} className={'circle-select' + checkAll}></span> : null} |
| | | </TableHeader> : <CardItem card={item} cards={config} data={extendData}> |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Col className={className} key={index} span={card.setting.width}> |
| | | <Col className={className} key={index} style={card.wStyle} span={card.setting.width}> |
| | | <CardItem card={card} cards={config} data={item} onClick={() => {this.changeCard(index, item)}}> |
| | | <span className="circle-select"></span> |
| | | </CardItem> |
| | |
| | | ) |
| | | })} |
| | | {nextcards.map((item, index) => ( |
| | | <Col key={'next' + index} className="extend-card" span={item.setting.width || 6}> |
| | | <Col key={'next' + index} className="extend-card" style={item.wStyle} span={item.setting.width || 6}> |
| | | {item.setting.cardRole === 'header' ? <TableHeader card={item} data={extendData} refresh={this.refreshByHeader}> |
| | | {item.setting.checkAll === 'show' ? <span onClick={this.checkAll} className={'circle-select' + checkAll}></span> : null} |
| | | </TableHeader> : <CardItem card={item} cards={config} data={extendData}> |
| | |
| | | } |
| | | } |
| | | |
| | | if (item.style.clear === 'left') { |
| | | item.wStyle = {clear: 'left'} |
| | | } else if (item.style.clear === 'right') { |
| | | item.wStyle = {float: 'right'} |
| | | } |
| | | |
| | | delete item.style.clear |
| | | |
| | | if (item.$cardType !== 'extendCard') { |
| | | _card = item |
| | | } else if (!_card) { |
| | |
| | | }) |
| | | } else { |
| | | this.loadData(id) |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | |
| | | <div className={`data-zoom ${config.wrap.wrapClass}`} style={config.wrap.minWidth ? {minWidth: config.wrap.minWidth} : null}> |
| | | <Row className={'card-row-list '}> |
| | | {precards.map((item, index) => ( |
| | | <Col key={'pre' + index} className="extend-card" span={item.setting.width || 6}> |
| | | <Col key={'pre' + index} className="extend-card" style={item.wStyle} span={item.setting.width || 6}> |
| | | {item.setting.cardRole === 'header' ? <TableHeader card={item} data={extendData} refresh={this.refreshByHeader}> |
| | | {item.setting.checkAll === 'show' ? <span onClick={this.checkAll} className={'circle-select' + checkAll}></span> : null} |
| | | </TableHeader> : <CardItem card={item} cards={config} data={extendData}> |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Col key={index} span={card.setting.width}> |
| | | <Col key={index} span={card.setting.width} style={card.wStyle}> |
| | | <div className={className} style={wrapStyle}> |
| | | <CardItem card={card} cards={config} data={item} onDoubleClick={() => this.onDoubleClick(index, subClass)} onClick={() => {this.changeCard(index, item, subClass)}}> |
| | | <span className="circle-select"></span> |
| | |
| | | ) |
| | | })} |
| | | {nextcards.map((item, index) => ( |
| | | <Col key={'next' + index} className="extend-card" span={item.setting.width || 6}> |
| | | <Col key={'next' + index} className="extend-card" style={item.wStyle} span={item.setting.width || 6}> |
| | | {item.setting.cardRole === 'header' ? <TableHeader card={item} data={extendData} refresh={this.refreshByHeader}> |
| | | {item.setting.checkAll === 'show' ? <span onClick={this.checkAll} className={'circle-select' + checkAll}></span> : null} |
| | | </TableHeader> : <CardItem card={item} cards={config} data={extendData}> |
| | |
| | | card.setting.click = '' |
| | | } |
| | | } |
| | | |
| | | if (card.style.clear === 'left') { |
| | | card.wStyle = {clear: 'left'} |
| | | } else if (card.style.clear === 'right') { |
| | | card.wStyle = {float: 'right'} |
| | | } |
| | | |
| | | delete card.style.clear |
| | | }) |
| | | |
| | | let selected = _config.wrap.selected || 'false' |
| | |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | refreshLineData = (menuId, btn, uuid, count) => { |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Col className={className} key={index} span={item.setting.width || 6} offset={item.offset || 0}> |
| | | <Col className={className} key={index} style={item.wStyle} span={item.setting.width || 6} offset={item.offset || 0}> |
| | | <CardItem card={item} cards={config} data={data} onClick={() => {this.changeCard(index, item)}}/> |
| | | </Col> |
| | | ) |
| | |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | refreshLineData = (menuId, btn, uuid, count) => { |
| | |
| | | |
| | | if (item.style && item.style.clear === 'left') { |
| | | _style_ = {clear: 'left'} |
| | | } else if (item.style && item.style.clear === 'right') { |
| | | _style_ = {float: 'right'} |
| | | } |
| | | |
| | | let val = '' |
| | |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id, data) => { |
| | |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id, data) => { |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Spin, Tooltip, message, Modal, notification } from 'antd' |
| | | import { UndoOutlined, RedoOutlined, VerticalAlignTopOutlined, VerticalAlignBottomOutlined, SaveOutlined, ZoomInOutlined, ZoomOutOutlined, OneToOneOutlined, QuestionCircleOutlined } from '@ant-design/icons' |
| | | import { UndoOutlined, RedoOutlined, VerticalAlignTopOutlined, VerticalAlignBottomOutlined, SaveOutlined, ZoomInOutlined, ZoomOutOutlined, OneToOneOutlined, QuestionCircleOutlined, ClearOutlined } from '@ant-design/icons' |
| | | import { Graph, Shape } from '@antv/x6' |
| | | import { Stencil } from '@antv/x6-plugin-stencil' |
| | | import { Transform } from '@antv/x6-plugin-transform' |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import NormalHeader from '@/tabviews/custom/components/share/normalheader' |
| | | import lanes from '@/menu/components/chart/antv-X6/lane.json' |
| | | import xflows from '@/menu/components/chart/antv-X6/xflow.json' |
| | | // import lanes from '@/menu/components/chart/antv-X6/lane.json' |
| | | // import xflows from '@/menu/components/chart/antv-X6/xflow.json' |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | const NodeUpdate = asyncComponent(() => import('./nodeupdate')) |
| | | |
| | | const groups = { |
| | |
| | | } |
| | | |
| | | async loadData () { |
| | | const { config, BID } = this.state |
| | | const { BID } = this.state |
| | | |
| | | if (config.setting.supModule && !BID) { // BID 不存在时,不做查询 |
| | | if (!BID) { |
| | | if (!is(fromJS(this.data), fromJS([]))) { |
| | | this.cells = [] |
| | | this.handleData() |
| | | } |
| | | this.setState({empty: true}) |
| | | return |
| | | } |
| | | |
| | |
| | | loading: true |
| | | }) |
| | | |
| | | if (config) { |
| | | if (config.plot.subtype === 'xflow') { |
| | | this.cells = xflows |
| | | } else { |
| | | this.cells = lanes |
| | | } |
| | | this.handleData() |
| | | |
| | | setTimeout(() => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }, 2000) |
| | | return |
| | | } |
| | | |
| | | let param = { |
| | | func: '', |
| | | BID: BID |
| | | func: 's_get_works_flow_local_param_v6', |
| | | ID: BID |
| | | } |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | | let item = result.data && result.data[0] ? result.data[0] : null |
| | | let cells = [] |
| | | |
| | | if (item && item.long_param) { |
| | | let long_param = JSON.parse(window.decodeURIComponent(window.atob(item.long_param))) |
| | | cells = long_param.cells || [] |
| | | } |
| | | |
| | | this.cells = cells |
| | | this.handleData() |
| | | |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | |
| | | this.cells = result.data || [] |
| | | this.handleData() |
| | | |
| | | if (result.message) { |
| | | if (result.ErrCode === 'Y') { |
| | |
| | | } |
| | | |
| | | save = () => { |
| | | // let nodes = this.mkGraph.toJSON() |
| | | // this.mkGraph.toPNG((dataUri) => { |
| | | // Api.fileuploadbase64({ |
| | | // Base64Img: dataUri |
| | | // }).then(res => { |
| | | // }) |
| | | // }, {padding: 20}) |
| | | const { BID } = this.state |
| | | |
| | | if (!BID) { |
| | | Modal.error({ |
| | | title: '未获取到流程ID,不可保存!', |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | |
| | | let nodes = this.mkGraph.toJSON() |
| | | this.mkGraph.toPNG((dataUri) => { |
| | | let param = { |
| | | func: 's_works_flow_param_upt_v6', |
| | | long_param: window.btoa(window.encodeURIComponent(JSON.stringify(nodes))), |
| | | flow_image: dataUri, |
| | | ID: BID, |
| | | BID: '' |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '保存成功!', |
| | | duration: 2 |
| | | }) |
| | | } else { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | }, {padding: 20}) |
| | | } |
| | | |
| | | clearNode = () => { |
| | | let cells = this.mkGraph.getCells() |
| | | const that = this |
| | | |
| | | if (cells.length === 0) return |
| | | |
| | | confirm({ |
| | | title: '确定清空元素吗?', |
| | | content: '清空后不可恢复。', |
| | | okText: '确定', |
| | | cancelText: '取消', |
| | | onOk() { |
| | | that.mkGraph.removeCells(cells) |
| | | that.mkGraph.cleanHistory() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | deleteLane = (cell, graph) => { |
| | |
| | | |
| | | if (config.plot.function === 'show') { |
| | | if (config.plot.empty === 'hidden' && this.cells.length === 0) { |
| | | style.display = 'none' |
| | | style.position = 'absolute' |
| | | style.width = '100%' |
| | | style.zIndex = -1 |
| | | } |
| | | |
| | | return ( |
| | | <div className="custom-x6-plot-box" id={'anchor' + config.uuid} style={config.style}> |
| | | <div className="custom-x6-plot-box" id={'anchor' + config.uuid} style={style}> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <div className="ant-spin-blur"></div> |
| | |
| | | <Tooltip title="前进"> |
| | | <RedoOutlined onClick={this.setprev}/> |
| | | </Tooltip> |
| | | <Tooltip title="清空"> |
| | | <ClearOutlined onClick={this.clearNode}/> |
| | | </Tooltip> |
| | | <Tooltip overlayStyle={{maxWidth: 260}} title="快捷键:复制(ctrl+c)、剪切(ctrl+x)、粘贴(ctrl+v)、后退(ctrl+z)、前进(ctrl+shift+z)、删除(backspace 或 delete)"> |
| | | <QuestionCircleOutlined /> |
| | | </Tooltip> |
| | |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | reloadData = (menuId) => { |
| | |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | reloadData = (menuId) => { |
| | |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | reloadData = (menuId) => { |
| | |
| | | |
| | | if (group.uuid !== menuId) return |
| | | |
| | | if (position === 'mainline' && config.setting.supModule && BID) { |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | |
| | | }, () => { |
| | | this.setState({data: {$$empty: true}}) |
| | | }) |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | return |
| | | } |
| | | |
| | |
| | | this.setState({data: _data}) |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, _data.$$uuid, _data) |
| | | |
| | | if (result.message) { |
| | | if (result.ErrCode === 'Y') { |
| | | Modal.success({ |
| | |
| | | .submit { |
| | | min-width: 70px; |
| | | border: none; |
| | | border-style: solid; |
| | | } |
| | | } |
| | | .mk-form-action.no-button { |
| | |
| | | |
| | | if (group.uuid !== menuId) return |
| | | |
| | | if (position === 'mainline' && config.setting.supModule && BID) { |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | |
| | | }, () => { |
| | | this.setState({data: {$$empty: true}}) |
| | | }) |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | return |
| | | } |
| | | |
| | |
| | | this.setState({group: _group}) |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, _data.$$uuid, _data) |
| | | |
| | | if (result.message) { |
| | | if (result.ErrCode === 'Y') { |
| | | Modal.success({ |
| | |
| | | .submit { |
| | | min-width: 70px; |
| | | border: none; |
| | | border-style: solid; |
| | | } |
| | | .skip { |
| | | color: rgba(0, 0, 0, 0.85); |
| | |
| | | |
| | | if (group.uuid !== menuId) return |
| | | |
| | | if (position === 'mainline' && config.setting.supModule && BID) { |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | |
| | | }, () => { |
| | | this.setState({data: {$$empty: true}}) |
| | | }) |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | return |
| | | } |
| | | |
| | |
| | | this.setState({data: _data}) |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, _data.$$uuid, _data) |
| | | |
| | | if (result.message) { |
| | | if (result.ErrCode === 'Y') { |
| | | Modal.success({ |
| | |
| | | .submit { |
| | | min-width: 70px; |
| | | border: none; |
| | | border-style: solid; |
| | | } |
| | | } |
| | | .mk-form-action.no-button { |
| | |
| | | |
| | | if (item.style && item.style.clear === 'left') { |
| | | style = {clear: 'left'} |
| | | } else if (item.style && item.style.clear === 'right') { |
| | | style = {float: 'right'} |
| | | } |
| | | |
| | | if (item.type === 'card' && item.subtype === 'datacard') { |
| | |
| | | |
| | | if (item.style && item.style.clear === 'left') { |
| | | style = {clear: 'left'} |
| | | } else if (item.style && item.style.clear === 'right') { |
| | | style = {float: 'right'} |
| | | } |
| | | |
| | | if (item.type === 'card' && item.subtype === 'datacard') { |
| | |
| | | } else { |
| | | this.reloadtable(btn, id) |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | |
| | | } else { |
| | | this.reloadtable(btn) |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | refreshLineData = (menuId, btn, uuid, count) => { |
| | |
| | | } else { |
| | | this.reloadtable(btn, id) |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | refreshLineData = (menuId, btn, uuid, count) => { |
| | |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | refreshLineData = (menuId, btn, uuid, count) => { |
| | |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | if (item.style && item.style.clear === 'left') { |
| | | style = {clear: 'left'} |
| | | } else if (item.style && item.style.clear === 'right') { |
| | | style = {float: 'right'} |
| | | } |
| | | |
| | | if (item.type === 'card' && item.subtype === 'datacard') { |
| | |
| | | group.subButton.OpenType = 'formSubmit' |
| | | group.subButton.execError = 'never' |
| | | group.subButton.logLabel = item.$menuname + '-' + group.subButton.label |
| | | group.subButton.$tabId = Tab.uuid |
| | | |
| | | if (!group.subButton.Ot) { |
| | | group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' |
| | |
| | | |
| | | if (item.style && item.style.clear === 'left') { |
| | | style = {clear: 'left'} |
| | | } else if (item.style && item.style.clear === 'right') { |
| | | style = {float: 'right'} |
| | | } |
| | | |
| | | if (item.type === 'card' && item.subtype === 'datacard') { |
| | |
| | | let node = document.getElementById('tab' + id) |
| | | node && node.click() |
| | | } |
| | | |
| | | if (btn.execSuccess === 'popclose' && btn.$tabId) { // 标签关闭刷新 |
| | | MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | } else if (btn.execError !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn, '', this.state.selines) |
| | | } |
| | | |
| | | if (btn.execError === 'popclose' && btn.$tabId) { // 标签关闭刷新 |
| | | MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | return col |
| | | }) |
| | | |
| | | if (data && data[0]) { |
| | | let errors = [] |
| | | columns.forEach(col => { |
| | | if (col.Column && data[0][col.Column] === undefined) { |
| | | errors.push(col.Text) |
| | | } |
| | | }) |
| | | |
| | | if (errors.length) { |
| | | notification.error({ |
| | | top: 92, |
| | | message: '数据中缺少字段:' + errors.join('、'), |
| | | duration: 5 |
| | | }) |
| | | |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | |
| | | return |
| | | } |
| | | } |
| | | |
| | | try { |
| | | if (imgCol) { |
| | |
| | | let node = document.getElementById('tab' + id) |
| | | node && node.click() |
| | | } |
| | | |
| | | if (btn.execSuccess === 'popclose' && btn.$tabId) { // 标签关闭刷新 |
| | | MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | } else if (btn.execError !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn, '', []) |
| | | } |
| | | |
| | | if (btn.execError === 'popclose' && btn.$tabId) { // 标签关闭刷新 |
| | | MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | |
| | | if (btn.execSuccess !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn) |
| | | } |
| | | |
| | | if (btn.execSuccess === 'popclose' && btn.$tabId) { // 标签关闭刷新 |
| | | MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | if (btn.execError !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn) |
| | | } |
| | | |
| | | if (btn.execError === 'popclose' && btn.$tabId) { // 标签关闭刷新 |
| | | MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | |
| | | |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | } |
| | | |
| | | if (btn.execSuccess === 'popclose' && btn.$tabId) { // 标签关闭刷新 |
| | | MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | triggerNote = (res) => { |
| | |
| | | if (window.GLOB.breakpoint) { |
| | | MKEmitter.emit('refreshDebugTable') |
| | | } |
| | | |
| | | if (btn.execError === 'popclose' && btn.$tabId) { // 标签关闭刷新 |
| | | MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | handleModelConfig = (config) => { |
| | |
| | | |
| | | if (btn.Ot === 'requiredSgl' && setting.primaryKey) { |
| | | _data = data[0] |
| | | primaryId = _data[setting.primaryKey] || '' |
| | | primaryId = _data.$$uuid || _data[setting.primaryKey] || '' |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | ratio = ratio + 'vw' |
| | | } |
| | | return <Modal |
| | | wrapClassName={'popview-modal ' + (!btn.$view ? '' : 'custom-popview')} |
| | | wrapClassName={'popview-modal ' + (!btn.$view ? '' : 'custom-popview ') + (btn.popshow || '')} |
| | | title={btn.label} |
| | | width={ratio} |
| | | maskClosable={btn.clickouter === 'close'} |
| | |
| | | .custom-popview.popview-modal { |
| | | >.ant-modal-content >.ant-modal-body { |
| | | .ant-modal-content .ant-modal-body { |
| | | padding: 0; |
| | | .custom-page-wrap { |
| | | min-height: 200px; |
| | |
| | | } |
| | | } |
| | | } |
| | | .custom-popview.popview-modal.miniview { |
| | | .ant-modal-header { |
| | | display: none; |
| | | } |
| | | .ant-modal-footer { |
| | | display: none; |
| | | } |
| | | .ant-modal-body { |
| | | padding: 0px; |
| | | border-radius: 4px; |
| | | max-height: calc(100vh - 110px); |
| | | } |
| | | } |
| | | .table-drawer-popview { |
| | | .close-drawer { |
| | | position: absolute; |
| | |
| | | if (btn.execSuccess !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, '', this.state.selines) |
| | | } |
| | | |
| | | if (btn.execSuccess === 'popclose' && btn.$tabId) { // 标签关闭刷新 |
| | | MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | interface: config.setting.interface || '', |
| | | dataresource: config.setting.dataresource || '', |
| | | tableName: config.setting.tableName || '', |
| | | sysInterface: config.setting.sysInterface || 'false', |
| | | order: config.setting.order || '', |
| | | execute: config.setting.default || 'true', |
| | | primaryKey: config.setting.valueField || '', |
| | |
| | | type: 'admin', |
| | | OpenType: config.OpenType, |
| | | PageParam: {Template: 'CustomPage', OpenType: 'newtab', hidden: config.hidden}, |
| | | MenuType: 'CustomPage' |
| | | MenuType: 'custom' |
| | | } |
| | | let url = window.btoa(window.encodeURIComponent(JSON.stringify(urlparam))) |
| | | config.tbkey = key |
| | |
| | | |
| | | if (res.status) { |
| | | delete urlparam.type |
| | | delete urlparam.MenuType |
| | | |
| | | let _param = window.btoa(window.encodeURIComponent(JSON.stringify(urlparam))) |
| | | |
| | |
| | | onOk: () => { |
| | | if (save) { |
| | | delete urlparam.type |
| | | delete urlparam.MenuType |
| | | |
| | | let _param = window.btoa(window.encodeURIComponent(JSON.stringify(urlparam))) |
| | | |
| | |
| | | import nortable from '@/assets/img/normaltable.jpg' |
| | | // import mainsubtable from '@/assets/img/mainsubtable.jpg' |
| | | import treepage from '@/assets/img/treepage.jpg' |
| | | // import treepage from '@/assets/img/treepage.jpg' |
| | | import customImg from '@/assets/img/custom.jpg' |
| | | import newpage from '@/assets/img/newpage.jpg' |
| | | import rolemanage from '@/assets/img/rolemanage.jpg' |
| | |
| | | baseconfig: '', |
| | | isSystem: true |
| | | }, |
| | | { |
| | | title: '树形页面', |
| | | type: 'TreePage', |
| | | url: treepage, |
| | | baseconfig: '', |
| | | isSystem: true |
| | | }, |
| | | // { |
| | | // title: '树形页面', |
| | | // type: 'TreePage', |
| | | // url: treepage, |
| | | // baseconfig: '', |
| | | // isSystem: true |
| | | // }, |
| | | { |
| | | title: '外部页面', |
| | | type: 'NewPage', |
| | |
| | | const Header = asyncComponent(() => import('@/menu/header')) |
| | | const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig')) |
| | | const TreePageConfig = asyncLoadComponent(() => import('@/templates/treepageconfig')) |
| | | const FormTabConfig = asyncLoadComponent(() => import('@/templates/formtabconfig')) |
| | | const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig')) |
| | | const SubTable = asyncLoadComponent(() => import('@/templates/subtableconfig')) |
| | | |
| | |
| | | tabConfig={this.state.tabConfig} |
| | | btnTab={this.state.btnTab} |
| | | btnTabConfig={this.state.btnTabConfig} |
| | | config={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'FormTab' ? |
| | | <FormTabConfig |
| | | menu={this.state.editMenu} |
| | | btnTab={this.state.btnTab} |
| | | config={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | |
| | | |
| | | if (item.style && item.style.clear === 'left') { |
| | | style = {clear: 'left'} |
| | | } else if (item.style && item.style.clear === 'right') { |
| | | style = {float: 'right'} |
| | | } |
| | | |
| | | if (item.type === 'bar' || item.type === 'line') { |
| | |
| | | document.getElementsByTagName('head')[0].removeChild(JSONP) |
| | | },500) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | componentDidMount () { |
| | | // md5("/ws/location/v1/ip?callback=callbackFunction&key=key&output=jsonp secret key") |