| | |
| | | trdItem.type = 'iframe' |
| | | trdItem.OpenType = 'newtab' |
| | | } |
| | | } else if (trdItem.OpenType === 'view') { |
| | | trdItem.OpenType = 'newpage' |
| | | trdItem.src = '#/view/' + trd.MenuID |
| | | } else { |
| | | trdItem.src = '#/tab/' + trd.MenuID |
| | | } |
| | |
| | | window.addEventListener('storage', (e) => { |
| | | if (e.key === 'getSessionStorage' && e.newValue === window.GLOB.appkey) { |
| | | localStorage.setItem('sessionStorage', JSON.stringify(sessionStorage)) |
| | | } else if (e.key === 'getSysPermission' && e.newValue === window.GLOB.appkey) { |
| | | localStorage.setItem('sysPermissions', JSON.stringify({mkThdMenus: window.GLOB.mkThdMenus, mkActions: window.GLOB.mkActions})) |
| | | } else if (e.key === 'menuUpdate') { |
| | | let menuId = e.newValue.split(',')[1] |
| | | if (menuId) { |
| | |
| | | |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | |
| | | /** |
| | | * @description 获取图表视图配置表单 |
| | | * @param {object} card // 图表对象 |
| | |
| | | * @param {object} card // 图表对象 |
| | | * @param {Array} columns // 显示列 |
| | | */ |
| | | export function getOptionForm (card, columns) { |
| | | export function getOptionForm (card, uuid) { |
| | | let menu = window.GLOB.customMenu |
| | | let modules = MenuUtils.getSupModules(menu.components, uuid, menu.interfaces) |
| | | |
| | | return [ |
| | | { |
| | | type: 'select', |
| | | field: 'subtype', |
| | | label: '类型', |
| | | label: '图表类型', |
| | | initval: card.subtype || 'xflow', |
| | | required: true, |
| | | options: [{ |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'export', |
| | | label: '下载', |
| | | initval: card.export || 'png', |
| | | required: false, |
| | | field: 'function', |
| | | label: '功能', |
| | | initval: card.function || 'show', |
| | | required: true, |
| | | options: [ |
| | | {value: 'none', label: '禁用'}, |
| | | {value: 'png', label: 'PNG图'}, |
| | | {value: 'edit', label: '流程编辑'}, |
| | | {value: 'show', label: '流程展示'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'empty', values: ['show']} |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'empty', |
| | | label: '空值隐藏', |
| | | initval: card.empty || 'show', |
| | | tooltip: '当查询数据为空时,隐藏该组件。', |
| | | type: 'cascader', |
| | | field: 'supModule', |
| | | label: '上级组件', |
| | | initval: card.supModule || [], |
| | | required: false, |
| | | options: [ |
| | | {value: 'show', label: '否'}, |
| | | {value: 'hidden', label: '是'}, |
| | | ], |
| | | options: modules, |
| | | allowClear: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | initval: card.backgroundColor || '', |
| | | required: false, |
| | | allowClear: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'empty', |
| | | label: '空值隐藏', |
| | | initval: card.empty || 'show', |
| | | tooltip: '当查询数据为空时,隐藏该组件。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'show', label: '否'}, |
| | | {value: 'hidden', label: '是'}, |
| | | ], |
| | | } |
| | | ] |
| | | } |
| | |
| | | view: 'normal', |
| | | plot: fromJS(config.plot).toJS(), |
| | | baseFormlist: getBaseForm(config.plot, config.columns), |
| | | formlist: getOptionForm(config.plot, config.columns) |
| | | formlist: getOptionForm(config.plot, config.uuid) |
| | | }) |
| | | } |
| | | |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle, getTables, checkComponent } from '@/utils/utils-custom.js' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import lanes from './lane.json' |
| | | import xflows from './xflow.json' |
| | | import './index.scss' |
| | | |
| | | const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) |
| | | const ChartCompileForm = asyncIconComponent(() => import('./chartcompile')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) |
| | |
| | | } |
| | | }, |
| | | gridType: 'dot', |
| | | export: 'png' |
| | | function: 'show', |
| | | supModule: [] |
| | | } |
| | | |
| | | let _card = { |
| | |
| | | width: _plot.width, |
| | | name: _plot.name, |
| | | subtype: card.subtype, |
| | | setting: { interType: 'system' }, |
| | | setting: { interType: '' }, |
| | | style: { |
| | | borderWidth: '1px', borderColor: 'rgb(217, 217, 217)', |
| | | marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' |
| | |
| | | card.width = card.plot.width |
| | | card.name = card.plot.name |
| | | card.subtype = card.plot.subtype |
| | | |
| | | card.$c_ds = true |
| | | card.errors = checkComponent(card) |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | card.errors = [] |
| | | card.$tables = [] |
| | | |
| | | this.setState({ |
| | | card: card |
| | |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <ChartCompileForm config={card} plotchange={this.plotchange}/> |
| | | <CopyComponent type="antvG6" card={card}/> |
| | | <CopyComponent type="antvX6" card={card}/> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/> |
| | | <DeleteOutlined className="close" title="delete" onClick={() => this.props.deletecomponent(card.uuid)}/> |
| | | <SettingComponent config={card} updateConfig={this.updateComponent}/> |
| | | </div> |
| | | } trigger="hover"> |
| | | <ToolOutlined/> |
| | |
| | | <div className="component-name"> |
| | | <div className="center"> |
| | | <div className="title">{card.name}</div> |
| | | <div className="content"> |
| | | {card.errors && card.errors.map((err, index) => { |
| | | if (err.level === 0) { |
| | | return <span key={index} className="error">{err.detail}</span> |
| | | } else { |
| | | return <span key={index} className="waring">{err.detail};</span> |
| | | } |
| | | })} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | key: 'procMode', |
| | | label: '参数处理', |
| | | initVal: card.procMode || 'system', |
| | | tooltip: '当返回值存在 mk_ex_invoke 且值为 false 时,不会调用外部接口。', |
| | | tooltip: '当返回值存在 mk_ex_invoke 且值为 false 时,不会调用外部接口。注:当选“无”时,按钮选行时会传递主键,存在表单时会传递表单字段,存在BID时会传BID字段。', |
| | | required: true, |
| | | options: [{ |
| | | value: 'system', |
| | |
| | | const CustomChart = asyncComponent(() => import('@/menu/components/chart/chart-custom')) |
| | | const Timeline = asyncComponent(() => import('@/menu/components/timeline/normal-timeline')) |
| | | const AntvG6 = asyncComponent(() => import('@/menu/components/chart/antv-G6')) |
| | | const AntvX6 = asyncComponent(() => import('@/menu/components/chart/antv-X6')) |
| | | const DoubleDataCard = asyncComponent(() => import('@/menu/components/card/double-data-card')) |
| | | |
| | | const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => { |
| | |
| | | return (<CustomChart card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'antvG6') { |
| | | return (<AntvG6 card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'antvX6') { |
| | | return (<AntvX6 card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } |
| | | } |
| | | |
| | |
| | | balcony: '浮动卡', |
| | | timeline: '时间轴', |
| | | antvG6: '树图', |
| | | antvX6: '流程图', |
| | | card: '卡片' |
| | | } |
| | | let i = 1 |
| | |
| | | } |
| | | |
| | | if (appType !== 'mob') { |
| | | options.push('editable', 'antvG6', 'tree', 'dashboard', 'chart') |
| | | options.push('editable', 'antvG6', 'antvX6', 'tree', 'dashboard', 'chart') |
| | | } |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'width', 'hidden'], |
| | | excelOut: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'maskStyle', 'closeButton', 'hidden'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden', 'openTab'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], |
| | | funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], |
| | | form: ['label', 'OpenType', 'formType', 'intertype', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'width', 'refreshTab', 'title', 'hidden'] |
| | |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | |
| | | if (this.record.pageTemplate === 'custom') { |
| | | shows.push('url', 'joint', 'open') |
| | | shows.push('url', 'proUrl', 'joint', 'open') |
| | | } else if (this.record.pageTemplate === 'linkpage') { |
| | | shows.push('linkmenu', 'open') |
| | | |
| | |
| | | { required: item.readonly ? false : item.required, message: '请输入' + item.label + '!' } |
| | | ] |
| | | |
| | | if (item.key === 'url' || item.key === 'proUrl') { |
| | | rules.push({ |
| | | pattern: /^[^\s]*$/, |
| | | message: '地址中不可使用空格!' |
| | | }) |
| | | } |
| | | |
| | | content = <TextArea rows={2} readOnly={item.readonly}/> |
| | | } else if (item.type === 'keyinterface') { |
| | | span = 24 |
| | |
| | | { |
| | | type: 'select', |
| | | key: 'OpenType', |
| | | label: '打开方式', |
| | | label: '按钮类型', |
| | | initVal: card.OpenType, |
| | | required: true, |
| | | options: opentypes |
| | |
| | | key: 'procMode', |
| | | label: '参数处理', |
| | | initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'), |
| | | tooltip: '当返回值存在 mk_ex_invoke 且值为 false 时,不会调用外部接口。', |
| | | tooltip: '当返回值存在 mk_ex_invoke 且值为 false 时,不会调用外部接口。注:当选“无”时,按钮选行时会传递主键,存在表单时会传递表单字段,存在BID时会传BID字段。', |
| | | required: true, |
| | | options: [{ |
| | | value: 'system', |
| | |
| | | initVal: card.url || '', |
| | | tooltip: appType === '' ? '地址格式为:http://******/admin/index.html#/iframe/menuId/loginuid/BID 会打开标签页。注:使用@loginuid@时自动替换为当前系统的loginuid;选择单行且拼接参数时会拼接BID。' : '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'proUrl', |
| | | label: '正式地址', |
| | | initVal: card.proUrl || '', |
| | | tooltip: appType === '' ? '地址格式为:http://******/admin/index.html#/iframe/menuId/loginuid/BID 会打开标签页。注:使用@loginuid@时自动替换为当前系统的loginuid;选择单行且拼接参数时会拼接BID。' : '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'openTab', |
| | | label: '打开方式', |
| | | initVal: card.openTab || 'newtab', |
| | | tooltip: '菜单打开方式。', |
| | | forbid: appType !== '', |
| | | options: [ |
| | | {value: 'newtab', text: '标签页'}, |
| | | // {value: 'newpage', text: '新页面(标签页)'}, |
| | | {value: 'view', text: '新页面(全屏)'} |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'display', |
| | | label: '显示方式', |
| | | initVal: card.display || 'modal', |
| | |
| | | { |
| | | type: 'select', |
| | | key: 'OpenType', |
| | | label: '打开方式', |
| | | label: '按钮类型', |
| | | initVal: card.OpenType, |
| | | required: true, |
| | | options: opentypes |
| | |
| | | key: 'procMode', |
| | | label: '参数处理', |
| | | initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'), |
| | | tooltip: '当返回值存在 mk_ex_invoke 且值为 false 时,不会调用外部接口。', |
| | | tooltip: '当返回值存在 mk_ex_invoke 且值为 false 时,不会调用外部接口。注:当选“无”时,按钮选行时会传递主键,存在表单时会传递表单字段,存在BID时会传BID字段。', |
| | | required: true, |
| | | options: [{ |
| | | value: 'system', |
| | |
| | | initVal: card.url || '', |
| | | tooltip: '地址格式为:http://******/admin/index.html#/iframe/menuId/loginuid/BID 会打开标签页。注:使用@loginuid@时自动替换为当前系统的loginuid;选择单行且拼接参数时会拼接BID。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'proUrl', |
| | | label: '正式地址', |
| | | initVal: card.proUrl || '', |
| | | tooltip: '地址格式为:http://******/admin/index.html#/iframe/menuId/loginuid/BID 会打开标签页。注:使用@loginuid@时自动替换为当前系统的loginuid;选择单行且拼接参数时会拼接BID。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'openTab', |
| | | label: '打开方式', |
| | | initVal: card.openTab || 'newtab', |
| | | tooltip: '菜单打开方式。', |
| | | options: [ |
| | | {value: 'newtab', text: '标签页'}, |
| | | // {value: 'newpage', text: '新页面(标签页)'}, |
| | | {value: 'view', text: '新页面(全屏)'} |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'display', |
| | | label: '显示方式', |
| | | initVal: card.display || 'modal', |
| | |
| | | if (appType === 'mob') { |
| | | options.push('menubar') |
| | | } else { |
| | | options.push('editable', 'antvG6', 'tree', 'dashboard', 'chart') |
| | | options.push('editable', 'antvG6', 'antvX6', 'tree', 'dashboard', 'chart') |
| | | } |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | |
| | | const CustomChart = asyncComponent(() => import('@/menu/components/chart/chart-custom')) |
| | | const Timeline = asyncComponent(() => import('@/menu/components/timeline/normal-timeline')) |
| | | const AntvG6 = asyncComponent(() => import('@/menu/components/chart/antv-G6')) |
| | | const AntvX6 = asyncComponent(() => import('@/menu/components/chart/antv-X6')) |
| | | const DoubleDataCard = asyncComponent(() => import('@/menu/components/card/double-data-card')) |
| | | |
| | | const Card = ({ id, card, moveCard, findCard, delCard, unGroup, updateConfig }) => { |
| | |
| | | return (<CustomChart card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'antvG6') { |
| | | return (<AntvG6 card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'antvX6') { |
| | | return (<AntvX6 card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } |
| | | } |
| | | |
| | |
| | | balcony: '浮动卡', |
| | | timeline: '时间轴', |
| | | antvG6: '树图', |
| | | antvX6: '流程图', |
| | | card: '卡片' |
| | | } |
| | | let i = 1 |
| | |
| | | import mindmap from '@/assets/mobimg/mindmap.png' |
| | | import indent from '@/assets/mobimg/indent.jfif' |
| | | import kapmap from '@/assets/mobimg/kapmap.jfif' |
| | | // import xflow from '@/assets/mobimg/xflow.png' |
| | | import xflow from '@/assets/mobimg/xflow.png' |
| | | import Voucher from '@/assets/mobimg/voucher.png' |
| | | import Account from '@/assets/mobimg/account.png' |
| | | |
| | |
| | | { type: 'menu', url: mindmap, component: 'antvG6', subtype: 'mindmap', title: '思维导图', width: 24 }, |
| | | { type: 'menu', url: indent, component: 'antvG6', subtype: 'indentTree', title: '缩进文件树', width: 24 }, |
| | | { type: 'menu', url: kapmap, component: 'antvG6', subtype: 'kapmap', title: '知识图谱树', width: 24 }, |
| | | // { type: 'menu', url: xflow, component: 'antvX6', subtype: 'xflow', title: '流程图', width: 24 }, |
| | | { type: 'menu', url: xflow, component: 'antvX6', subtype: 'xflow', title: '流程图', width: 24 }, |
| | | { type: 'menu', url: chart, component: 'chart', subtype: 'custom', title: '自定义图表', width: 24, forbid: ['billPrint'] }, |
| | | { type: 'menu', url: Editor, component: 'editor', subtype: 'brafteditor', title: '富文本', width: 24 }, |
| | | { type: 'menu', url: SandBox, component: 'code', subtype: 'sandbox', title: '自定义', width: 24 }, |
| | |
| | | options.push('menubar', 'singleSearch') |
| | | } |
| | | } else { |
| | | options.push('editable', 'mainsearch', 'antvG6', 'tree', 'dashboard', 'chart') |
| | | options.push('editable', 'mainsearch', 'antvG6', 'antvX6', 'tree', 'dashboard', 'chart') |
| | | } |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | |
| | | {path: '/proc', name: 'proc', component: SystemProc}, |
| | | {path: '/iframe/:menuId/:loginUid', name: 'iframe', component: MkIframe}, |
| | | {path: '/iframe/:menuId/:loginUid/:bid', name: 'iframe', component: MkIframe}, |
| | | {path: '/view/:menuId', name: 'iframe', component: MkIframe}, |
| | | {path: '/view/:menuId/:bid', name: 'iframe', component: MkIframe}, |
| | | {path: '/interface', name: 'interface', component: Interface} |
| | | ] |
| | | |
| | |
| | | // } |
| | | |
| | | let Id = '' |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(url)) { |
| | | con = '&' |
| | | } |
| | | |
| | | if (cards.subtype === 'propcard' && cardCell) { |
| | | Id = cardCell.setting.primaryId || '' |
| | |
| | | } |
| | | |
| | | if (card.joint === 'true') { |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(url)) { |
| | | con = '&' |
| | | } |
| | | |
| | | url = url + `${con}id=${Id}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } |
| | | |
| | |
| | | <div className={'ant-col mk-cell-btn ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}> |
| | | <NewPageButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | selectedData={_data} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Spin, Tooltip, Empty, message, Modal, notification } from 'antd' |
| | | import { VerticalAlignTopOutlined, VerticalAlignBottomOutlined, SaveOutlined, ZoomInOutlined, ZoomOutOutlined, OneToOneOutlined, DownloadOutlined } from '@ant-design/icons' |
| | | import { Spin, Tooltip, message, Modal, notification } from 'antd' |
| | | import { UndoOutlined, RedoOutlined, VerticalAlignTopOutlined, VerticalAlignBottomOutlined, SaveOutlined, ZoomInOutlined, ZoomOutOutlined, OneToOneOutlined } 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 { Export } from '@antv/x6-plugin-export' |
| | | |
| | | import Api from '@/api' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | 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 './index.scss' |
| | | |
| | | const NodeUpdate = asyncComponent(() => import('./nodeupdate')) |
| | |
| | | |
| | | class antvX6Chart extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, |
| | | mainSearch: PropTypes.any |
| | | config: PropTypes.object |
| | | } |
| | | |
| | | state = { |
| | | config: null, |
| | | editing: false, |
| | | node: null, |
| | | arr_field: 'id,cells', |
| | | loading: false |
| | | } |
| | | |
| | | selectNode = null |
| | | mkGraph = null |
| | | cells = [] |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config } = this.props |
| | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(config.setting.supModule) |
| | | _config.setting.supModule = '' |
| | | |
| | | if (_config.plot.supModule && _config.plot.supModule.length > 0) { |
| | | _config.setting.supModule = _config.plot.supModule.pop() |
| | | } |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(config.$pageId) |
| | | } |
| | |
| | | BData: BData || '', |
| | | plot: _config.plot |
| | | }, () => { |
| | | if (config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } |
| | | this.loadData() |
| | | }) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('reloadData', this.reloadData) |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | |
| | | MKEmitter.removeListener('reloadData', this.reloadData) |
| | | MKEmitter.removeListener('resetSelectLine', this.resetParentParam) |
| | | } |
| | | |
| | | reloadData = (menuId) => { |
| | | const { config } = this.state |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | this.loadData() |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id) => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id }, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | | async loadData () { |
| | | const { mainSearch } = this.props |
| | | const { config, arr_field, BID } = this.state |
| | | const { config, BID } = this.state |
| | | |
| | | if (config.setting.supModule && !BID) { // BID 不存在时,不做查询 |
| | | if (!is(fromJS(this.data), fromJS([]))) { |
| | | this.data = [] |
| | | this.cells = [] |
| | | this.handleData() |
| | | } |
| | | return |
| | | } |
| | | |
| | | let searches = config.setting.useMSearch && mainSearch ? mainSearch : [] |
| | | |
| | | let requireFields = searches.filter(item => item.required && item.value === '') |
| | | if (requireFields.length > 0) { |
| | | return |
| | | } |
| | | |
| | |
| | | loading: true |
| | | }) |
| | | |
| | | let _orderBy = config.setting.order || '' |
| | | let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, '', '', BID) |
| | | 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 |
| | | } |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | | if (config.$cache && config.setting.onload !== 'false') { |
| | | Api.writeCacheConfig(config.uuid, result.data || '') |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | |
| | | if (!is(fromJS(this.data), fromJS(result.data || []))) { |
| | | this.data = result.data || [] |
| | | this.handleData() |
| | | } |
| | | this.cells = result.data || [] |
| | | this.handleData() |
| | | |
| | | if (result.message) { |
| | | if (result.ErrCode === 'Y') { |
| | |
| | | viewrender = () => { |
| | | const { plot } = this.state |
| | | |
| | | if (plot.subtype === 'xflow') { |
| | | this.xflowrender() |
| | | } else if (plot.subtype === 'lane') { |
| | | this.lanerender() |
| | | if (plot.function === 'show') { |
| | | if (plot.subtype === 'xflow') { |
| | | this.xflowSrender() |
| | | } else if (plot.subtype === 'lane') { |
| | | this.laneSrender() |
| | | } |
| | | } else { |
| | | if (plot.subtype === 'xflow') { |
| | | this.xflowrender() |
| | | } else if (plot.subtype === 'lane') { |
| | | this.lanerender() |
| | | } |
| | | } |
| | | } |
| | | |
| | | xflowSrender = () => { |
| | | const { config } = this.state |
| | | |
| | | const graph = new Graph({ |
| | | container: document.getElementById(config.uuid + 'container'), |
| | | grid: config.plot.grid, |
| | | scaling: { |
| | | min: 0.5, |
| | | max: 2 |
| | | }, |
| | | autoResize: true, |
| | | panning: true, |
| | | background: { |
| | | color: config.plot.backgroundColor || 'transparent' |
| | | }, |
| | | mousewheel: { |
| | | enabled: true, |
| | | zoomAtMousePosition: true, |
| | | modifiers: 'ctrl' |
| | | }, |
| | | connecting: { |
| | | router: 'manhattan', |
| | | connector: { |
| | | name: 'rounded', |
| | | args: { |
| | | radius: 8 |
| | | } |
| | | }, |
| | | anchor: 'center', |
| | | connectionPoint: 'anchor', |
| | | allowBlank: false, |
| | | snap: { |
| | | radius: 20 |
| | | }, |
| | | createEdge() { |
| | | return new Shape.Edge({ |
| | | attrs: { |
| | | line: { |
| | | stroke: '#000000', |
| | | strokeWidth: 1, |
| | | targetMarker: { |
| | | name: 'block', |
| | | width: 12, |
| | | height: 8 |
| | | } |
| | | } |
| | | }, |
| | | zIndex: 0 |
| | | }) |
| | | }, |
| | | validateConnection({ targetMagnet }) { |
| | | return !!targetMagnet |
| | | } |
| | | }, |
| | | highlighting: { |
| | | magnetAdsorbed: { |
| | | name: 'stroke', |
| | | args: { |
| | | attrs: { |
| | | fill: '#5F95FF', |
| | | stroke: '#5F95FF' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | if (this.cells.length > 0) { |
| | | let cells = [] |
| | | this.cells.forEach((item) => { |
| | | if (item.shape === 'edge') { |
| | | cells.push(graph.createEdge(item)) |
| | | } else { |
| | | cells.push(graph.createNode(item)) |
| | | } |
| | | }) |
| | | graph.resetCells(cells) |
| | | graph.positionContent('center') |
| | | } |
| | | } |
| | | |
| | | laneSrender = () => { |
| | | const { config } = this.state |
| | | |
| | | const graph = new Graph({ |
| | | container: document.getElementById(config.uuid + 'container'), |
| | | scaling: { |
| | | min: 0.5, |
| | | max: 2 |
| | | }, |
| | | autoResize: true, |
| | | panning: true, |
| | | background: { color: '#ffffff' }, |
| | | mousewheel: { |
| | | enabled: true, |
| | | zoomAtMousePosition: true, |
| | | modifiers: 'ctrl' |
| | | }, |
| | | connecting: { |
| | | router: 'manhattan', |
| | | connector: { |
| | | name: 'rounded', |
| | | args: { |
| | | radius: 8 |
| | | } |
| | | }, |
| | | anchor: 'center', |
| | | connectionPoint: 'anchor', |
| | | allowBlank: false, |
| | | snap: { |
| | | radius: 20 |
| | | }, |
| | | createEdge() { |
| | | return new Shape.Edge({ |
| | | attrs: { |
| | | line: { |
| | | stroke: '#000000', |
| | | strokeWidth: 1, |
| | | targetMarker: { |
| | | name: 'block', |
| | | width: 12, |
| | | height: 8 |
| | | } |
| | | } |
| | | }, |
| | | zIndex: 2 |
| | | }) |
| | | }, |
| | | validateConnection({ targetMagnet }) { |
| | | return !!targetMagnet |
| | | } |
| | | }, |
| | | highlighting: { |
| | | magnetAdsorbed: { |
| | | name: 'stroke', |
| | | args: { |
| | | attrs: { |
| | | fill: '#5F95FF', |
| | | stroke: '#5F95FF' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | translating: { |
| | | restrict(cellView) { |
| | | const cell = cellView.cell |
| | | const parentId = cell.prop('parent') |
| | | |
| | | if (parentId) { |
| | | const parentNode = graph.getCellById(parentId) |
| | | if (parentNode) { |
| | | return parentNode.getBBox().moveAndExpand({ |
| | | x: 0, |
| | | y: 36, |
| | | width: 0, |
| | | height: -36, |
| | | }) |
| | | } |
| | | } |
| | | return cell.getBBox() |
| | | } |
| | | } |
| | | }) |
| | | |
| | | if (this.cells.length > 0) { |
| | | let cells = [] |
| | | this.cells.forEach((item) => { |
| | | if (item.shape === 'edge') { |
| | | cells.push(graph.createEdge(item)) |
| | | } else { |
| | | cells.push(graph.createNode(item)) |
| | | } |
| | | }) |
| | | graph.resetCells(cells) |
| | | graph.positionContent('top') |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | |
| | | stencil.load([p1, p2, p3], 'group2') |
| | | |
| | | if (this.cells.length > 0) { |
| | | let cells = [] |
| | | this.cells.forEach((item) => { |
| | | if (item.shape === 'edge') { |
| | | cells.push(graph.createEdge(item)) |
| | | } else { |
| | | cells.push(graph.createNode(item)) |
| | | } |
| | | }) |
| | | graph.resetCells(cells) |
| | | graph.positionContent('center') |
| | | } |
| | | |
| | | this.mkGraph = graph |
| | | } |
| | |
| | | |
| | | stencil.load([g1], 'group3') |
| | | |
| | | // let data = [{"id":"1","shape":"lane","width":260,"height":500,"position":{"x":0,"y":0},"label":"阶段1", preId: '', nextId: '2'},{"id":"2","shape":"lane","width":200,"height":500,"position":{"x":260,"y":0},"label":"<Function>", preId: '1', nextId: '3'},{"id":"3","shape":"lane","width":200,"height":500,"position":{"x":460,"y":0},"label":"<Function>", preId: '2', nextId: '4'},{"id":"4","shape":"lane","width":200,"height":500,"position":{"x":660,"y":0},"label":"<Function>", preId: '3', nextId: ''}] |
| | | // let cells = [] |
| | | // data.forEach((item) => { |
| | | // if (item.shape === 'edge') { |
| | | // cells.push(graph.createEdge(item)) |
| | | // } else { |
| | | // cells.push(graph.createNode(item)) |
| | | // } |
| | | // }) |
| | | // graph.resetCells(cells) |
| | | // graph.zoomToFit({ padding: 10, maxScale: 1 }) |
| | | if (this.cells.length > 0) { |
| | | let cells = [] |
| | | this.cells.forEach((item) => { |
| | | if (item.shape === 'edge') { |
| | | cells.push(graph.createEdge(item)) |
| | | } else { |
| | | cells.push(graph.createNode(item)) |
| | | } |
| | | }) |
| | | graph.resetCells(cells) |
| | | graph.positionContent('top') |
| | | } |
| | | |
| | | this.mkGraph = graph |
| | | } |
| | |
| | | } |
| | | |
| | | // zoom() 可获取或者设置缩放比例 |
| | | setback = () => { |
| | | if (this.mkGraph.canUndo()) { |
| | | this.mkGraph.undo() |
| | | } |
| | | } |
| | | |
| | | setprev = () => { |
| | | if (this.mkGraph.canRedo()) { |
| | | this.mkGraph.redo() |
| | | } |
| | | } |
| | | |
| | | setZoomIn = () => { |
| | | this.mkGraph.zoom(0.1) |
| | | } |
| | |
| | | |
| | | save = () => { |
| | | // let nodes = this.mkGraph.toJSON() |
| | | } |
| | | |
| | | savePicture = () => { |
| | | const { config } = this.state |
| | | this.mkGraph.exportPNG(config.name, {padding: 20}) |
| | | // this.mkGraph.toPNG((dataUri) => { |
| | | // Api.fileuploadbase64({ |
| | | // Base64Img: dataUri |
| | | // }).then(res => { |
| | | // }) |
| | | // }, {padding: 20}) |
| | | } |
| | | |
| | | addLane = (cell, graph) => { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { loading, config, empty, node } = this.state |
| | | const { loading, config, node } = this.state |
| | | |
| | | let style = {...config.style} |
| | | |
| | | if (config.plot.function === 'show') { |
| | | if (config.plot.empty === 'hidden' && this.cells.length === 0) { |
| | | style.display = 'none' |
| | | } |
| | | |
| | | return ( |
| | | <div className="custom-x6-plot-box" id={'anchor' + config.uuid} style={config.style}> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <div className="ant-spin-blur"></div> |
| | | <Spin /> |
| | | </div> : null |
| | | } |
| | | <NormalHeader config={config} /> |
| | | <div className="canvas" style={{width: '100%', minHeight: config.plot.height, height: config.plot.height}} id={config.uuid + 'canvas'}> |
| | | <div id={config.uuid + 'container'} className="mk-container"></div> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | |
| | | return ( |
| | | <div className="custom-x6-plot-box" id={'anchor' + config.uuid} style={config.style}> |
| | |
| | | </div> : null |
| | | } |
| | | <NormalHeader config={config} /> |
| | | {empty ? <Empty description={false}/> : null} |
| | | <div className="mk-toolbar"> |
| | | <div className="left-tool"> |
| | | {config.plot.subtype === 'xflow' ? <Tooltip title="置前"> |
| | |
| | | {config.plot.subtype === 'xflow' ? <Tooltip title="置后"> |
| | | <VerticalAlignBottomOutlined onClick={this.setBottom}/> |
| | | </Tooltip> : null} |
| | | <Tooltip title="保存"> |
| | | <SaveOutlined onClick={this.save}/> |
| | | </Tooltip> |
| | | {config.plot.export === 'png' ? <Tooltip title="导出图片"> |
| | | <DownloadOutlined onClick={this.savePicture}/> |
| | | </Tooltip> : null} |
| | | </div> |
| | | <div className="right-tool"> |
| | | <Tooltip title="放大"> |
| | | <ZoomInOutlined onClick={this.setZoomIn}/> |
| | | </Tooltip> |
| | |
| | | <Tooltip title="1:1"> |
| | | <OneToOneOutlined onClick={this.setZoomInt}/> |
| | | </Tooltip> |
| | | <Tooltip title="后退"> |
| | | <UndoOutlined onClick={this.setback}/> |
| | | </Tooltip> |
| | | <Tooltip title="前进"> |
| | | <RedoOutlined onClick={this.setprev}/> |
| | | </Tooltip> |
| | | </div> |
| | | <div className="right-tool"> |
| | | <Tooltip title="保存"> |
| | | <SaveOutlined onClick={this.save}/> |
| | | </Tooltip> |
| | | </div> |
| | | </div> |
| | | <div className="canvas" style={{width: '100%', minHeight: config.plot.height, height: config.plot.height}} id={config.uuid + 'canvas'}> |
| | |
| | | .mk-toolbar { |
| | | width: 100%; |
| | | height: 40px; |
| | | border: 1px solid #1890ff; |
| | | border-bottom: 1px solid #dfe3e8; |
| | | |
| | | .left-tool { |
| | | float: left; |
| | |
| | | z-index: 1; |
| | | } |
| | | } |
| | | .loading-mask { |
| | | position: absolute; |
| | | left: 0px; |
| | | top: 0; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | text-align: justify; |
| | | z-index: 3; |
| | | |
| | | .ant-spin-blur { |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 100%; |
| | | opacity: 0.5; |
| | | background: #ffffff; |
| | | } |
| | | } |
| | | } |
| | |
| | | import NormalHeader from '@/tabviews/custom/components/share/normalheader' |
| | | import './index.scss' |
| | | |
| | | // const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) |
| | | const ExcelOutButton = asyncComponent(() => import('@/tabviews/zshare/actionList/exceloutbutton')) |
| | | const ExcelInButton = asyncComponent(() => import('@/tabviews/zshare/actionList/excelInbutton')) |
| | | |
| | |
| | | const TimeLine = asyncComponent(() => import('@/tabviews/custom/components/timeline/normal-timeline')) |
| | | const CustomChart = asyncComponent(() => import('@/tabviews/custom/components/chart/custom-chart')) |
| | | const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6')) |
| | | const AntvX6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-X6')) |
| | | |
| | | class TabTransfer extends Component { |
| | | static propTpyes = { |
| | |
| | | <AntvG6 config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'antvX6') { |
| | | return ( |
| | | <Col span={item.width} style={style} key={item.uuid}> |
| | | <AntvX6 config={item}/> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return null |
| | | } |
| | |
| | | const CustomChart = asyncComponent(() => import('@/tabviews/custom/components/chart/custom-chart')) |
| | | const MkBaseTable = asyncComponent(() => import('@/tabviews/custom/components/table/base-table')) |
| | | const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6')) |
| | | const AntvX6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-X6')) |
| | | |
| | | class TabTransfer extends Component { |
| | | static propTpyes = { |
| | |
| | | <AntvG6 config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'antvX6') { |
| | | return ( |
| | | <Col span={item.width} style={style} key={item.uuid}> |
| | | <AntvX6 config={item}/> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return null |
| | | } |
| | |
| | | item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName) |
| | | |
| | | return true |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) { |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart', 'antvG6', 'antvX6'].includes(item.type)) { |
| | | if ( |
| | | item.plot.blacklist && item.plot.blacklist.length > 0 && |
| | | item.plot.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0 |
| | |
| | | } else if (item.type === 'antvX6') { |
| | | return ( |
| | | <Col span={item.width} style={style} key={item.uuid}> |
| | | <AntvX6 config={item} mainSearch={mainSearch}/> |
| | | <AntvX6 config={item}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'module' && item.subtype === 'voucher') { |
| | |
| | | const Voucher = asyncComponent(() => import('../components/module/voucher')) |
| | | const Iframe = asyncComponent(() => import('../components/iframe')) |
| | | const AntvG6 = asyncComponent(() => import('../components/chart/antv-G6')) |
| | | const AntvX6 = asyncComponent(() => import('../components/chart/antv-X6')) |
| | | |
| | | class CustomPage extends Component { |
| | | static propTpyes = { |
| | |
| | | <AntvG6 config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'antvX6') { |
| | | return ( |
| | | <Col span={item.width} style={style} key={item.uuid}> |
| | | <AntvX6 config={item}/> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return null |
| | | } |
| | |
| | | key={item.uuid} |
| | | show={item.show || 'actionList'} |
| | | disabled={false} |
| | | BID={BID} |
| | | btn={item} |
| | | BData={BData} |
| | | selectedData={selectedData} |
| | |
| | | |
| | | class NewPageButton extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // BID |
| | | BData: PropTypes.any, // 主表数据 |
| | | btn: PropTypes.object, // 按钮 |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type) => { |
| | | const { btn, selectedData } = this.props |
| | | const { btn, selectedData, BID } = this.props |
| | | const { disabled } = this.state |
| | | |
| | | if (disabled) return |
| | |
| | | }) |
| | | window.open(url) |
| | | } else if (btn.pageTemplate === 'custom') { |
| | | if (/#\/iframe\//.test(btn.url)) { |
| | | let url = btn.url.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID')) |
| | | let url = btn.url |
| | | if (window.GLOB.systemType === 'production' && btn.proUrl) { |
| | | url = btn.proUrl |
| | | } |
| | | |
| | | if (btn.Ot === 'requiredSgl' && btn.joint !== 'false') { |
| | | if (btn.Ot === 'notRequired' && BID) { |
| | | Id = BID |
| | | } |
| | | |
| | | if (/#\/iframe\//.test(url)) { |
| | | url = url.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID')) |
| | | |
| | | if (btn.joint === 'true' && Id) { |
| | | url = url + '/' + Id |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | let url = btn.url |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(url)) { |
| | | con = '&' |
| | | } |
| | | |
| | | if (btn.Ot === 'requiredSgl' && btn.joint !== 'false') { |
| | | |
| | | if (btn.joint === 'true') { |
| | | url = url + `${con}id=${Id}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } else if (btn.Ot === 'requiredSgl' && btn.joint === 'false') { |
| | | } else if (Id) { |
| | | url = url + `${con}id=${Id}` |
| | | } else if (btn.joint !== 'false') { |
| | | url = url + `${con}appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } |
| | | |
| | | window.open(url) |
| | |
| | | } |
| | | } |
| | | |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | if (btn.openTab === 'view') { |
| | | window.open('#/view/' + newtab.MenuID + '/' + primaryId) |
| | | } else { |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | |
| | | MKEmitter.emit('openNewTab') |
| | | } |
| | | |
| | | MKEmitter.emit('openNewTab') |
| | | if (window.GLOB.systemType === 'production') { |
| | | MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '标签页'}) |
| | | } |
| | |
| | | } |
| | | |
| | | if (item.joint === 'true' && _href) { |
| | | let _quary = `id=${record[this.props.setting.primaryKey]}&userid=${sessionStorage.getItem('UserID')}&appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}` |
| | | let _quary = `id=${record[this.props.setting.primaryKey]}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID')}` |
| | | let _param = '' |
| | | |
| | | try { |
| | |
| | | <NewPageButton |
| | | key={btn.uuid} |
| | | btn={btn} |
| | | BID={record.$$BID} |
| | | disabled={record.$disabled} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | |
| | | } |
| | | |
| | | if (col.joint === 'true' && _href) { |
| | | let _quary = `id=${record[this.props.setting.primaryKey]}&userid=${sessionStorage.getItem('UserID')}&appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}` |
| | | let _quary = `id=${record[this.props.setting.primaryKey]}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID')}` |
| | | let _param = '' |
| | | |
| | | try { |
| | |
| | | const BraftEditor = asyncComponent(() => import('@/tabviews/custom/components/editor/braft-editor')) |
| | | const Balcony = asyncComponent(() => import('@/tabviews/custom/components/card/balcony')) |
| | | const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6')) |
| | | const AntvX6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-X6')) |
| | | const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) |
| | | |
| | | class BillPrint extends Component { |
| | |
| | | <AntvG6 config={item} initdata={item.data} mainSearch={[]}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'antvX6') { |
| | | return ( |
| | | <Col span={item.width} style={style} key={item.uuid}> |
| | | <AntvX6 config={item}/> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return null |
| | | } |
| | |
| | | <Form.Item label="打开方式"> |
| | | {getFieldDecorator('OpenType', { |
| | | initialValue: config.OpenType || 'newtab', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择打开方式!' |
| | | } |
| | | ] |
| | | rules: [{ required: true, message: '请选择打开方式!' }] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('OpenType', e.target.value)}}> |
| | | <Radio value="newtab">标签页</Radio> |
| | | <Radio value="newpage">新页面</Radio> |
| | | </Radio.Group> |
| | | <Select onChange={(value) => {this.selectChange('OpenType', value)}}> |
| | | <Select.Option value="newtab">标签页</Select.Option> |
| | | <Select.Option value="newpage">新页面(标签页)</Select.Option> |
| | | <Select.Option value="view">新页面(全屏)</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | |
| | | import Api from '@/api' |
| | | import asyncComponent from '@/utils/asyncLoadComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const CustomPage = asyncComponent(() => import('@/tabviews/custom')) |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { menuId, loginUid, bid } = this.props.match.params |
| | | const { params, path } = this.props.match |
| | | const { menuId, loginUid, bid } = params |
| | | |
| | | if (sessionStorage.getItem('UserID')) { |
| | | if (/^\/view\//.test(path)) { |
| | | localStorage.setItem('getSysPermission', window.GLOB.appkey) |
| | | |
| | | window.addEventListener('storage', function(event) { |
| | | if (event.key === 'sysPermissions' && event.newValue) { |
| | | let values = event.newValue |
| | | values = JSON.parse(values) |
| | | |
| | | window.GLOB.mkThdMenus = values.mkThdMenus |
| | | window.GLOB.mkActions = values.mkActions |
| | | } |
| | | }) |
| | | |
| | | setTimeout(() => { |
| | | localStorage.removeItem('getSysPermission') |
| | | localStorage.removeItem('sysPermissions') |
| | | |
| | | if (window.GLOB.mkActions) { |
| | | this.setState({loading: false}) |
| | | } else { |
| | | this.getPermRole() |
| | | } |
| | | }, 20) |
| | | } else if (sessionStorage.getItem('UserID')) { |
| | | this.getPermRole() |
| | | } else { |
| | | sessionStorage.setItem('LoginUID', loginUid) |
| | |
| | | this.setState({BID: bid || '', MenuId: menuId}) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.addListener('closeTabView', this.closeTabView) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.removeListener('closeTabView', this.closeTabView) |
| | | } |
| | | |
| | | modifyTabs = (tab) => { |
| | | const { MenuId, BID } = this.state |
| | | |
| | | let _menuId = tab.MenuID |
| | | let _BID = tab.param && tab.param.$BID ? tab.param.$BID : '' |
| | | |
| | | let historys = sessionStorage.getItem('page_historys') |
| | | historys = historys ? JSON.parse(historys) : [] |
| | | |
| | | historys.push({MenuId: MenuId, BID: BID}) |
| | | |
| | | sessionStorage.setItem('page_historys', JSON.stringify(historys)) |
| | | |
| | | this.setState({ |
| | | MenuId: _menuId, |
| | | BID: _BID, |
| | | loading: true |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | closeTabView = () => { |
| | | let historys = sessionStorage.getItem('page_historys') |
| | | historys = historys ? JSON.parse(historys) : [] |
| | | |
| | | if (historys.length === 0) return |
| | | |
| | | let tab = historys.shift() |
| | | |
| | | sessionStorage.setItem('page_historys', JSON.stringify(historys)) |
| | | |
| | | this.setState({ |
| | | MenuId: tab.MenuId, |
| | | BID: tab.BID, |
| | | loading: true |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | getPermRole = () => { |
| | | Api.getSystemConfig({ |
| | | func: 's_Get_TrdMenu_Role', |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Select, notification, Radio, Switch } from 'antd' |
| | | import { Form, Row, Col, Input, Select, notification, Switch } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import options from '@/store/options.js' |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('OpenType', e.target.value)}}> |
| | | <Radio value="newtab">标签页</Radio> |
| | | <Radio value="newpage">新页面</Radio> |
| | | </Radio.Group> |
| | | <Select onChange={(value) => {this.selectChange('OpenType', value)}}> |
| | | <Select.Option value="newtab">标签页</Select.Option> |
| | | <Select.Option value="newpage">新页面(标签页)</Select.Option> |
| | | <Select.Option value="view">新页面(全屏)</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |