From aa41be24e83653077d85860cb70882551912af24 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 28 十月 2022 12:53:25 +0800 Subject: [PATCH] 2022-10-28 --- src/tabviews/treepage/index.jsx | 18 src/templates/comtableconfig/updatetable/index.scss | 30 ++ src/tabviews/custom/components/chart/antv-scatter/index.jsx | 19 src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 19 src/tabviews/custom/components/table/base-table/index.jsx | 19 src/tabviews/custom/components/chart/antv-dashboard/index.jsx | 19 src/mob/components/tabs/antv-tabs/options.jsx | 2 src/tabviews/custom/components/tree/antd-tree/index.jsx | 19 src/utils/utils-custom.js | 11 src/templates/comtableconfig/index.jsx | 2 src/templates/comtableconfig/updatetable/index.jsx | 56 ++++ src/menu/components/card/balcony/options.jsx | 5 src/tabviews/calendar/index.jsx | 16 src/menu/components/form/simple-form/options.jsx | 5 src/tabviews/custom/components/carousel/data-card/index.jsx | 19 src/tabviews/custom/components/table/edit-table/index.jsx | 19 src/views/tabledesign/menuform/index.jsx | 22 - src/templates/modalconfig/index.jsx | 3 src/menu/components/form/step-form/options.jsx | 5 src/tabviews/custom/components/form/simple-form/index.jsx | 19 src/tabviews/subtable/index.jsx | 18 src/templates/sharecomponent/settingcomponent/settingform/index.jsx | 70 +++-- src/tabviews/subtabtable/index.jsx | 18 src/tabviews/commontable/index.jsx | 19 src/templates/zshare/codemirror/index.jsx | 3 src/menu/datasource/verifycard/index.jsx | 70 +++-- src/tabviews/custom/components/card/data-card/index.jsx | 18 src/tabviews/custom/components/form/tab-form/index.jsx | 19 src/tabviews/custom/components/card/table-card/index.jsx | 19 src/menu/components/module/voucher/options.jsx | 5 src/tabviews/custom/components/card/prop-card/index.jsx | 18 src/menu/components/card/data-card/options.jsx | 5 src/menu/datasource/verifycard/settingform/index.jsx | 2 src/tabviews/custom/components/table/normal-table/index.jsx | 19 src/templates/zshare/verifycard/index.jsx | 72 +++-- src/tabviews/custom/components/interfaces/interItem/index.jsx | 23 + src/menu/components/tabs/antv-tabs/options.jsx | 2 src/tabviews/custom/components/chart/antv-pie/index.jsx | 19 src/tabviews/custom/components/timeline/normal-timeline/index.jsx | 19 src/menu/versions/index.jsx | 1 src/tabviews/custom/components/carousel/prop-card/index.jsx | 19 src/tabviews/custom/components/form/step-form/index.jsx | 19 src/menu/modalconfig/index.jsx | 3 src/tabviews/custom/components/card/balcony/index.jsx | 18 44 files changed, 555 insertions(+), 270 deletions(-) diff --git a/src/menu/components/card/balcony/options.jsx b/src/menu/components/card/balcony/options.jsx index 1946423..46f7bec 100644 --- a/src/menu/components/card/balcony/options.jsx +++ b/src/menu/components/card/balcony/options.jsx @@ -1,15 +1,14 @@ import React from 'react' -import { fromJS } from 'immutable' import MenuUtils from '@/utils/utils-custom.js' /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ export default function (wrap) { - let menu = fromJS(window.GLOB.customMenu).toJS() + let menu = window.GLOB.customMenu let modules = MenuUtils.getLinkModules(menu.components) || [] - let supmodules = MenuUtils.getSupModules(menu.components, '') + let supmodules = MenuUtils.getSupModules(menu.components, '', menu.interfaces) let roleList = sessionStorage.getItem('sysRoles') let appType = sessionStorage.getItem('appType') diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 733b74d..09778c0 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -1,4 +1,3 @@ -import { fromJS } from 'immutable' import MenuUtils from '@/utils/utils-custom.js' /** @@ -7,7 +6,7 @@ export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting) { let appType = sessionStorage.getItem('appType') let MenuType = '' - let menu = fromJS(window.GLOB.customMenu).toJS() + let menu = window.GLOB.customMenu let laypage = setting && setting.laypage !== 'false' let interfaces = [] if (subtype === 'propcard' && menu.interfaces) { @@ -26,7 +25,7 @@ } let modules = [] if (subtype === 'propcard' || subtype === 'datacard') { - modules = MenuUtils.getSupModules(menu.components, id) + modules = MenuUtils.getSupModules(menu.components, id, menu.interfaces) } let roleList = sessionStorage.getItem('sysRoles') diff --git a/src/menu/components/form/simple-form/options.jsx b/src/menu/components/form/simple-form/options.jsx index 4d87e6f..b2c3953 100644 --- a/src/menu/components/form/simple-form/options.jsx +++ b/src/menu/components/form/simple-form/options.jsx @@ -1,4 +1,3 @@ -import { fromJS } from 'immutable' import MenuUtils from '@/utils/utils-custom.js' /** @@ -36,8 +35,8 @@ } let modules = [] - let menu = fromJS(window.GLOB.customMenu).toJS() - modules = MenuUtils.getSupModules(menu.components, config.uuid) + let menu = window.GLOB.customMenu + modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces) const wrapForm = [ { diff --git a/src/menu/components/form/step-form/options.jsx b/src/menu/components/form/step-form/options.jsx index d52824e..d162d66 100644 --- a/src/menu/components/form/step-form/options.jsx +++ b/src/menu/components/form/step-form/options.jsx @@ -1,4 +1,3 @@ -import { fromJS } from 'immutable' import MenuUtils from '@/utils/utils-custom.js' /** @@ -20,8 +19,8 @@ } let modules = [] - let menu = fromJS(window.GLOB.customMenu).toJS() - modules = MenuUtils.getSupModules(menu.components, config.uuid) + let menu = window.GLOB.customMenu + modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces) const wrapForm = [ { diff --git a/src/menu/components/module/voucher/options.jsx b/src/menu/components/module/voucher/options.jsx index d8466ad..a837e93 100644 --- a/src/menu/components/module/voucher/options.jsx +++ b/src/menu/components/module/voucher/options.jsx @@ -1,4 +1,3 @@ -import { fromJS } from 'immutable' import MenuUtils from '@/utils/utils-custom.js' /** @@ -8,8 +7,8 @@ let roleList = sessionStorage.getItem('sysRoles') let appType = sessionStorage.getItem('appType') - let menu = fromJS(window.GLOB.customMenu).toJS() - let modules = MenuUtils.getSupModules(menu.components, id) + let menu = window.GLOB.customMenu + let modules = MenuUtils.getSupModules(menu.components, id, menu.interfaces) if (roleList) { try { diff --git a/src/menu/components/tabs/antv-tabs/options.jsx b/src/menu/components/tabs/antv-tabs/options.jsx index d8ef388..be2cd65 100644 --- a/src/menu/components/tabs/antv-tabs/options.jsx +++ b/src/menu/components/tabs/antv-tabs/options.jsx @@ -89,7 +89,7 @@ let appType = sessionStorage.getItem('appType') let roleList = sessionStorage.getItem('sysRoles') - let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, uuid) + let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, uuid, window.GLOB.customMenu.interfaces) modules.push({ value: 'preview', label: '涓婁竴椤碉紙url鍙傛暟锛�' diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx index c903ac2..59ae132 100644 --- a/src/menu/datasource/verifycard/index.jsx +++ b/src/menu/datasource/verifycard/index.jsx @@ -912,36 +912,50 @@ title = title && title[0] ? title[0] : '' let _text = title ? item.sql.replace(title, '') : item.sql - return ( - <div className={'script-item ' + (script && script.uuid === item.uuid ? 'active' : '') } key={item.uuid}> - <div style={{cursor: 'pointer'}} onClick={() => { - this.setState({script: item, scriptValue: item.sql}) - }}> - {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} - <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> - <div>{item.status === 'false' ? - <span style={{color: '#ff4d4f', marginLeft: '20px'}}> - 绂佺敤 - <StopOutlined style={{marginLeft: '5px'}} /> - </span> : - <span style={{color: '#26C281', marginLeft: '20px'}}> - 鍚敤 - <CheckCircleOutlined style={{marginLeft: '5px'}}/> - </span>} + if (item.status === 'false') { + return ( + <div className="script-item" key={item.uuid}> + <div style={{cursor: 'not-allowed'}}> + {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} + <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> + <div> + <span style={{color: '#ff4d4f', marginLeft: '20px'}}> + 绂佺敤 + <StopOutlined style={{marginLeft: '5px'}} /> + </span> + </div> + </div> + <div style={{height: '24px'}}></div> + </div> + ) + } else { + return ( + <div className={'script-item ' + (script && script.uuid === item.uuid ? 'active' : '') } key={item.uuid}> + <div style={{cursor: 'pointer'}} onClick={() => { + this.setState({script: item, scriptValue: item.sql}) + }}> + {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} + <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> + <div> + <span style={{color: '#26C281', marginLeft: '20px'}}> + 鍚敤 + <CheckCircleOutlined style={{marginLeft: '5px'}}/> + </span> + </div> + </div> + <div style={{textAlign: 'right'}}> + <span className="operation-btn" onClick={() => this.handleStatus(item)} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <Popconfirm + overlayClassName="popover-confirm" + title="纭畾鍒犻櫎鍚�?" + onConfirm={() => this.deleteScript(item) + }> + <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> + </Popconfirm> </div> </div> - <div style={{textAlign: 'right'}}> - <span className="operation-btn" onClick={() => this.handleStatus(item)} style={{color: '#8E44AD'}}><SwapOutlined /></span> - <Popconfirm - overlayClassName="popover-confirm" - title="纭畾鍒犻櫎鍚�?" - onConfirm={() => this.deleteScript(item) - }> - <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> - </Popconfirm> - </div> - </div> - ) + ) + } })} </div> <div className="script-button"> diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx index 3929542..4a6dc36 100644 --- a/src/menu/datasource/verifycard/settingform/index.jsx +++ b/src/menu/datasource/verifycard/settingform/index.jsx @@ -32,7 +32,7 @@ UNSAFE_componentWillMount () { const { config, setting } = this.props - let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, config.uuid) + let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, config.uuid, window.GLOB.customMenu.interfaces) let ismain = false if (window.GLOB.customMenu.Template === 'BaseTable') { diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx index a2916fd..654a303 100644 --- a/src/menu/modalconfig/index.jsx +++ b/src/menu/modalconfig/index.jsx @@ -200,6 +200,9 @@ if (!card.span && standardform && standardform.span) { card.span = standardform.span card.labelwidth = standardform.labelwidth + } else if (!card.span) { + card.span = 12 + card.labelwidth = 33.3 } this.setState({ diff --git a/src/menu/versions/index.jsx b/src/menu/versions/index.jsx index 1eb76b9..01fb94d 100644 --- a/src/menu/versions/index.jsx +++ b/src/menu/versions/index.jsx @@ -6,7 +6,6 @@ import moment from 'moment' import Api from '@/api' -// import options from '@/store/options.js' import Utils from '@/utils/utils.js' import './index.scss' diff --git a/src/mob/components/tabs/antv-tabs/options.jsx b/src/mob/components/tabs/antv-tabs/options.jsx index 886aa13..664d749 100644 --- a/src/mob/components/tabs/antv-tabs/options.jsx +++ b/src/mob/components/tabs/antv-tabs/options.jsx @@ -86,7 +86,7 @@ * @description tabs琛ㄥ崟閰嶇疆淇℃伅 */ export function getTabsSetForm(setting, uuid) { - let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, uuid) + let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, uuid, window.GLOB.customMenu.interfaces) modules.push({ value: 'preview', label: '涓婁竴椤碉紙url鍙傛暟锛�' diff --git a/src/tabviews/calendar/index.jsx b/src/tabviews/calendar/index.jsx index aba9cc3..6eda2ef 100644 --- a/src/tabviews/calendar/index.jsx +++ b/src/tabviews/calendar/index.jsx @@ -269,11 +269,17 @@ this.setState({ loading: false }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 91bc0e0..2a4f260 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { notification, Spin, Tabs, Switch, Row, Col } from 'antd' +import { notification, Spin, Tabs, Switch, Row, Col, Modal } from 'antd' import Api from '@/api' import zhCN from '@/locales/zh-CN/main.js' @@ -791,11 +791,18 @@ if (autoMatic) { MKEmitter.emit('autoMaticError', this.props.MenuID) } - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/card/balcony/index.jsx b/src/tabviews/custom/components/card/balcony/index.jsx index c027da2..dde04a1 100644 --- a/src/tabviews/custom/components/card/balcony/index.jsx +++ b/src/tabviews/custom/components/card/balcony/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, notification, Checkbox } from 'antd' +import { Spin, notification, Checkbox, Modal } from 'antd' import Api from '@/api' import UtilsDM from '@/utils/utils-datamanage.js' @@ -347,11 +347,17 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 557efcd..d26086d 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, Empty, notification, message, Row, Col, Pagination } from 'antd' +import { Spin, Empty, notification, message, Row, Col, Pagination, Modal } from 'antd' import { DownOutlined } from '@ant-design/icons' import Api from '@/api' @@ -604,11 +604,17 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index 69708a2..0150f59 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, notification, Col, Row } from 'antd' +import { Spin, notification, Col, Row, Modal } from 'antd' import Api from '@/api' import UtilsDM from '@/utils/utils-datamanage.js' @@ -397,11 +397,17 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index f2616d8..9a9abaa 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, notification, Row, Col, Empty, Pagination } from 'antd' +import { Spin, notification, Row, Col, Empty, Pagination, Modal } from 'antd' import { DownOutlined } from '@ant-design/icons' import Api from '@/api' @@ -330,11 +330,18 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx index 788da3d..735bfe6 100644 --- a/src/tabviews/custom/components/carousel/data-card/index.jsx +++ b/src/tabviews/custom/components/carousel/data-card/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, Empty, notification, Carousel } from 'antd' +import { Spin, Empty, notification, Carousel, Modal } from 'antd' import Api from '@/api' import UtilsDM from '@/utils/utils-datamanage.js' @@ -259,11 +259,18 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/carousel/prop-card/index.jsx b/src/tabviews/custom/components/carousel/prop-card/index.jsx index c5b37fe..9be4cc9 100644 --- a/src/tabviews/custom/components/carousel/prop-card/index.jsx +++ b/src/tabviews/custom/components/carousel/prop-card/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, notification, Carousel } from 'antd' +import { Spin, notification, Carousel, Modal } from 'antd' import asyncComponent from '@/utils/asyncComponent' import Api from '@/api' @@ -277,11 +277,18 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx index 2e6524a..e4359ee 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -3,7 +3,7 @@ import { is, fromJS } from 'immutable' import { Chart } from '@antv/g2' import DataSet from '@antv/data-set' -import { Spin, Empty, notification } from 'antd' +import { Spin, Empty, notification, Modal } from 'antd' import { DownloadOutlined } from '@ant-design/icons' import moment from 'moment' @@ -534,11 +534,18 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx index bbda7f1..b791452 100644 --- a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx +++ b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Chart, registerShape } from '@antv/g2' -import { Spin, notification } from 'antd' +import { Spin, notification, Modal } from 'antd' import { DownloadOutlined } from '@ant-design/icons' import moment from 'moment' @@ -278,11 +278,18 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index 8916b90..99f9070 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -3,7 +3,7 @@ import { is, fromJS } from 'immutable' import { Chart } from '@antv/g2' import DataSet, { DataView } from '@antv/data-set' -import { Spin, Empty, notification } from 'antd' +import { Spin, Empty, notification, Modal } from 'antd' import { DownloadOutlined } from '@ant-design/icons' import moment from 'moment' @@ -239,11 +239,18 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/chart/antv-scatter/index.jsx b/src/tabviews/custom/components/chart/antv-scatter/index.jsx index bffcc3b..062105a 100644 --- a/src/tabviews/custom/components/chart/antv-scatter/index.jsx +++ b/src/tabviews/custom/components/chart/antv-scatter/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Chart } from '@antv/g2' -import { Spin, Empty, notification } from 'antd' +import { Spin, Empty, notification, Modal } from 'antd' import { DownloadOutlined } from '@ant-design/icons' import moment from 'moment' @@ -273,11 +273,18 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/form/simple-form/index.jsx b/src/tabviews/custom/components/form/simple-form/index.jsx index 5711995..82016a0 100644 --- a/src/tabviews/custom/components/form/simple-form/index.jsx +++ b/src/tabviews/custom/components/form/simple-form/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, notification } from 'antd' +import { Spin, notification, Modal } from 'antd' import Api from '@/api' import UtilsDM from '@/utils/utils-datamanage.js' @@ -258,11 +258,18 @@ this.setState({ loading: false, }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/form/step-form/index.jsx b/src/tabviews/custom/components/form/step-form/index.jsx index d942371..03fe999 100644 --- a/src/tabviews/custom/components/form/step-form/index.jsx +++ b/src/tabviews/custom/components/form/step-form/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, notification, Button } from 'antd' +import { Spin, notification, Button, Modal } from 'antd' import Api from '@/api' import UtilsDM from '@/utils/utils-datamanage.js' @@ -326,11 +326,18 @@ this.setState({ loading: false, }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/form/tab-form/index.jsx b/src/tabviews/custom/components/form/tab-form/index.jsx index 870b4ad..a9c4818 100644 --- a/src/tabviews/custom/components/form/tab-form/index.jsx +++ b/src/tabviews/custom/components/form/tab-form/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, notification } from 'antd' +import { Spin, notification, Modal } from 'antd' import Api from '@/api' import UtilsDM from '@/utils/utils-datamanage.js' @@ -268,11 +268,18 @@ this.setState({ loading: false, }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/interfaces/interItem/index.jsx b/src/tabviews/custom/components/interfaces/interItem/index.jsx index 9253bd9..cffd75b 100644 --- a/src/tabviews/custom/components/interfaces/interItem/index.jsx +++ b/src/tabviews/custom/components/interfaces/interItem/index.jsx @@ -1,6 +1,6 @@ import {Component} from 'react' import PropTypes from 'prop-types' -import { notification } from 'antd' +import { notification, Modal } from 'antd' import Api from '@/api' import UtilsDM from '@/utils/utils-datamanage.js' @@ -64,10 +64,11 @@ let result = await Api.genericInterface(param) if (result.status) { this.loading = false - let _data = { $$empty: true } + let _data = { $$empty: true, $$uuid: '' } if (result.data && result.data[0]) { _data = result.data[0] + _data.$$uuid = _data[config.setting.primaryKey] || '' } _data.$$loaded = true @@ -75,14 +76,22 @@ window.GLOB.CacheData.set(config.uuid, _data) MKEmitter.emit('mkPublicData', config.uuid, _data) + MKEmitter.emit('resetSelectLine', config.uuid, _data.$$uuid, _data) } else { this.loading = false this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx index 58a66c5..1937a67 100644 --- a/src/tabviews/custom/components/table/base-table/index.jsx +++ b/src/tabviews/custom/components/table/base-table/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { notification } from 'antd' +import { notification, Modal } from 'antd' import Api from '@/api' import Utils from '@/utils/utils.js' @@ -210,11 +210,18 @@ this.setState({ loading: false }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index 51a6a06..a988a29 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { notification } from 'antd' +import { notification, Modal } from 'antd' import Api from '@/api' import Utils from '@/utils/utils.js' @@ -252,11 +252,18 @@ this.setState({ loading: false }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index bf7d655..cc22445 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { notification, Collapse } from 'antd' +import { notification, Collapse, Modal } from 'antd' import Api from '@/api' import Utils from '@/utils/utils.js' @@ -289,11 +289,18 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx index 99f4cda..8e6e58e 100644 --- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx +++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, notification, Timeline, Empty } from 'antd' +import { Spin, notification, Timeline, Empty, Modal } from 'antd' import Api from '@/api' import MkIcon from '@/components/mk-icon' @@ -296,11 +296,18 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/tree/antd-tree/index.jsx b/src/tabviews/custom/components/tree/antd-tree/index.jsx index 41794b6..4ddd9ee 100644 --- a/src/tabviews/custom/components/tree/antd-tree/index.jsx +++ b/src/tabviews/custom/components/tree/antd-tree/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, Empty, notification, Input, Tree } from 'antd' +import { Spin, Empty, notification, Input, Tree, Modal } from 'antd' import { FolderOpenOutlined, FolderOutlined, FileOutlined } from '@ant-design/icons' import Api from '@/api' @@ -197,11 +197,18 @@ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 1f2429f..51ebb7b 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { notification, Spin, Switch, Row, Col, Tabs} from 'antd' +import { notification, Spin, Switch, Row, Col, Tabs, Modal } from 'antd' import Api from '@/api' import zhCN from '@/locales/zh-CN/main.js' @@ -668,11 +668,17 @@ loading: false }) - notification.error({ - top: 92, - message: prex + result.message, - duration: 10 - }) + if (result.ErrCode === 'N') { + Modal.error({ + title: prex + result.message, + }) + } else { + notification.error({ + top: 92, + message: prex + result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 6a11de2..9ef2fed 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { notification, Spin} from 'antd' +import { notification, Spin, Modal } from 'antd' import Api from '@/api' import zhCN from '@/locales/zh-CN/main.js' @@ -600,11 +600,17 @@ this.setState({ loading: false }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/treepage/index.jsx b/src/tabviews/treepage/index.jsx index b0e8403..11e2f0b 100644 --- a/src/tabviews/treepage/index.jsx +++ b/src/tabviews/treepage/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { notification, Spin, Tabs, Tree, Row, Col, Card, Input, Empty } from 'antd' +import { notification, Spin, Tabs, Tree, Row, Col, Card, Input, Empty, Modal } from 'antd' import { FolderOpenOutlined, FolderOutlined, FileOutlined } from '@ant-design/icons' import Api from '@/api' @@ -323,11 +323,17 @@ treeNodes: [], treedata: [] }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 74e2368..7b6778d 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -28,6 +28,7 @@ const Versions = asyncComponent(() => import('@/menu/versions')) const UrlFieldComponent = asyncComponent(() => import('@/menu/urlfieldcomponent')) const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) +// const UpdateTable = asyncComponent(() => import('./updatetable')) const Unattended = asyncComponent(() => import('@/templates/zshare/unattended')) const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcomponent')) @@ -1267,6 +1268,7 @@ <Versions MenuId={menu.MenuID} open_edition={openEdition} updateConfig={this.refreshConfig}/> <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> + {/* <UpdateTable config={config}/> */} <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button> <Button onClick={this.cancelConfig}>鍏抽棴</Button> diff --git a/src/templates/comtableconfig/updatetable/index.jsx b/src/templates/comtableconfig/updatetable/index.jsx new file mode 100644 index 0000000..c093914 --- /dev/null +++ b/src/templates/comtableconfig/updatetable/index.jsx @@ -0,0 +1,56 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { is, fromJS } from 'immutable' +// import { Modal, Button, notification } from 'antd' +import { Modal, Button } from 'antd' +import { ArrowUpOutlined } from '@ant-design/icons' +// import moment from 'moment' + +// import Api from '@/api' +// import Utils from '@/utils/utils.js' +import './index.scss' + +const { confirm } = Modal + +class UpdateTable extends Component { + static propTpyes = { + config: PropTypes.object + } + + state = {} + + shouldComponentUpdate (nextProps, nextState) { + return !is(fromJS(this.state), fromJS(nextState)) + } + + trigger = () => { + const _this = this + confirm({ + title: '纭畾鍗囩骇褰撳墠鑿滃崟鍚楋紵', + content: '', + onOk() { + return new Promise(resolve => { + _this.execUpdate(resolve) + }) + }, + onCancel() {} + }) + } + + execUpdate = (_resolve) => { + // const { config } = this.props + setTimeout(() => { + _resolve() + }, 5000) + } + + render() { + return ( + <div style={{display: 'inline-block'}}> + <Button className="mk-border-purple" onClick={this.trigger}><ArrowUpOutlined /> 鍗囩骇</Button> + </div> + ) + } +} + +export default UpdateTable \ No newline at end of file diff --git a/src/templates/comtableconfig/updatetable/index.scss b/src/templates/comtableconfig/updatetable/index.scss new file mode 100644 index 0000000..e4f4b2f --- /dev/null +++ b/src/templates/comtableconfig/updatetable/index.scss @@ -0,0 +1,30 @@ +.version-modal { + .ant-modal-body { + padding: 32px 32px 24px; + } + .ant-modal-footer { + display: none; + } + .header { + color: rgba(0, 0, 0, 0.85); + font-weight: 500; + font-size: 16px; + .anticon { + color: #faad14; + margin-right: 16px; + font-size: 22px; + } + } + .detail { + margin-top: 8px; + margin-bottom: 24px; + color: rgba(0, 0, 0, 0.5); + font-size: 14px; + } + .footer { + text-align: right; + .ant-btn + .ant-btn { + margin-left: 15px; + } + } +} \ No newline at end of file diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index 97c1bdd..04c9ca6 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -357,6 +357,9 @@ if (!card.span && standardform && standardform.span) { card.span = standardform.span card.labelwidth = standardform.labelwidth + } else if (!card.span) { + card.span = 12 + card.labelwidth = 33.3 } this.setState({ diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx index 86caaea..3ed654e 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx @@ -557,36 +557,50 @@ title = title && title[0] ? title[0] : '' let _text = title ? item.sql.replace(title, '') : item.sql - return ( - <div className={'script-item ' + (script && script.uuid === item.uuid ? 'active' : '') } key={item.uuid}> - <div style={{cursor: 'pointer'}} onClick={() => { - this.setState({script: item, scriptValue: item.sql}) - }}> - {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} - <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> - <div>{item.status === 'false' ? - <span style={{color: '#ff4d4f', marginLeft: '20px'}}> - 绂佺敤 - <StopOutlined style={{marginLeft: '5px'}} /> - </span> : - <span style={{color: '#26C281', marginLeft: '20px'}}> - 鍚敤 - <CheckCircleOutlined style={{marginLeft: '5px'}}/> - </span>} + if (item.status === 'false') { + return ( + <div className="script-item" key={item.uuid}> + <div style={{cursor: 'not-allowed'}}> + {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} + <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> + <div> + <span style={{color: '#ff4d4f', marginLeft: '20px'}}> + 绂佺敤 + <StopOutlined style={{marginLeft: '5px'}} /> + </span> + </div> + </div> + <div style={{height: '24px'}}></div> + </div> + ) + } else { + return ( + <div className={'script-item ' + (script && script.uuid === item.uuid ? 'active' : '') } key={item.uuid}> + <div style={{cursor: 'pointer'}} onClick={() => { + this.setState({script: item, scriptValue: item.sql}) + }}> + {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} + <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> + <div> + <span style={{color: '#26C281', marginLeft: '20px'}}> + 鍚敤 + <CheckCircleOutlined style={{marginLeft: '5px'}}/> + </span> + </div> + </div> + <div style={{textAlign: 'right'}}> + <span className="operation-btn" onClick={() => this.handleStatus(item)} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <Popconfirm + overlayClassName="popover-confirm" + title="纭畾鍒犻櫎鍚�?" + onConfirm={() => this.handleDelete(item) + }> + <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> + </Popconfirm> </div> </div> - <div style={{textAlign: 'right'}}> - <span className="operation-btn" onClick={() => this.handleStatus(item)} style={{color: '#8E44AD'}}><SwapOutlined /></span> - <Popconfirm - overlayClassName="popover-confirm" - title="纭畾鍒犻櫎鍚�?" - onConfirm={() => this.handleDelete(item) - }> - <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> - </Popconfirm> - </div> - </div> - ) + ) + } })} </div> <div className="script-button"> diff --git a/src/templates/zshare/codemirror/index.jsx b/src/templates/zshare/codemirror/index.jsx index 149a15d..a7ee8d3 100644 --- a/src/templates/zshare/codemirror/index.jsx +++ b/src/templates/zshare/codemirror/index.jsx @@ -111,6 +111,9 @@ if (!_sql) return _sql = sqlFormatter.format(_sql.replace(/\s{2,}/g, ' ')) + // _sql = _sql.replace(/case\n\s+when\s/ig, (word) => { + // return word.replace(/case/, '').replace(/when/, 'case when') + // }) this.setState({display: false, editor: null, defaultVal: _sql}, () => { this.setState({display: true}) diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 7bd7bcb..c198cbb 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -1763,37 +1763,51 @@ position = <span style={{color: '#1890ff'}}>sql鍚�</span> } - return ( - <div className={'script-item ' + (this.state.scriptId === item.uuid ? 'active' : '') } key={item.uuid}> - <div style={{cursor: 'pointer'}} onClick={() => { - this.scriptsFullForm.edit(item) - this.setState({scriptId: item.uuid}) - }}> - {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} - <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> - <div>{position}{item.status === 'false' ? - <span style={{color: '#ff4d4f', marginLeft: '20px'}}> - 绂佺敤 - <StopOutlined style={{marginLeft: '5px'}} /> - </span> : - <span style={{color: '#26C281', marginLeft: '20px'}}> - 鍚敤 - <CheckCircleOutlined style={{marginLeft: '5px'}}/> - </span>} + if (item.status === 'false') { + return ( + <div className="script-item" key={item.uuid}> + <div style={{cursor: 'not-allowed'}}> + {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} + <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> + <div>{position} + <span style={{color: '#ff4d4f', marginLeft: '20px'}}> + 绂佺敤 + <StopOutlined style={{marginLeft: '5px'}} /> + </span> + </div> + </div> + <div style={{height: '24px'}}></div> + </div> + ) + } else { + return ( + <div className={'script-item ' + (this.state.scriptId === item.uuid ? 'active' : '') } key={item.uuid}> + <div style={{cursor: 'pointer'}} onClick={() => { + this.scriptsFullForm.edit(item) + this.setState({scriptId: item.uuid}) + }}> + {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} + <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> + <div>{position} + <span style={{color: '#26C281', marginLeft: '20px'}}> + 鍚敤 + <CheckCircleOutlined style={{marginLeft: '5px'}}/> + </span> + </div> + </div> + <div style={{textAlign: 'right'}}> + <span className="operation-btn" onClick={() => this.handleStatus(item, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <Popconfirm + overlayClassName="popover-confirm" + title="纭畾鍒犻櫎鍚�?" + onConfirm={() => this.handleDelete(item, 'scripts') + }> + <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> + </Popconfirm> </div> </div> - <div style={{textAlign: 'right'}}> - <span className="operation-btn" onClick={() => this.handleStatus(item, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> - <Popconfirm - overlayClassName="popover-confirm" - title="纭畾鍒犻櫎鍚�?" - onConfirm={() => this.handleDelete(item, 'scripts') - }> - <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> - </Popconfirm> - </div> - </div> - ) + ) + } })} </div> <CustomScript diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index 64fb0a1..2ea10f9 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -171,7 +171,7 @@ * @description 鑾峰彇涓婄骇妯″潡 * @return {String} selfId 褰撳墠缁勪欢id */ - static getSupModules (components, selfId) { + static getSupModules (components, selfId, interfaces) { let modules = [] components.forEach(item => { if (item.uuid === selfId) { @@ -264,6 +264,15 @@ } }) + if (interfaces && interfaces.length > 0) { + interfaces.forEach(item => { + modules.push({ + value: item.uuid, + label: item.name + }) + }) + } + return modules } diff --git a/src/views/tabledesign/menuform/index.jsx b/src/views/tabledesign/menuform/index.jsx index 5d5f785..5e16759 100644 --- a/src/views/tabledesign/menuform/index.jsx +++ b/src/views/tabledesign/menuform/index.jsx @@ -1,7 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, notification, Radio, Tooltip, Switch } from 'antd' -import { QuestionCircleOutlined } from '@ant-design/icons' +import { Form, Row, Col, Input, Select, notification, Radio, Switch } from 'antd' import Api from '@/api' import options from '@/store/options.js' @@ -201,8 +200,6 @@ this.props.updateConfig({...config, OpenType: value}) } else if (key === 'hidden') { this.props.updateConfig({...config, hidden: value}) - } else if (key === 'permission') { - this.props.updateConfig({...config, permission: value}) } } @@ -332,23 +329,6 @@ <Radio.Group onChange={(e) => {this.selectChange('OpenType', e.target.value)}}> <Radio value="newtab">鏍囩椤�</Radio> <Radio value="newpage">鏂伴〉闈�</Radio> - </Radio.Group> - )} - </Form.Item> - </Col> - <Col span={24}> - <Form.Item label={ - <Tooltip placement="topLeft" title="璺宠繃鏉冮檺楠岃瘉鏃讹紝椤甸潰涓粍浠跺強鎸夐挳涓嶅湪杩涜鏉冮檺鎺у埗銆�"> - <QuestionCircleOutlined className="mk-form-tip" /> - 鏉冮檺楠岃瘉 - </Tooltip> - }> - {getFieldDecorator('permission', { - initialValue: config.permission || 'true' - })( - <Radio.Group onChange={(e) => {this.selectChange('permission', e.target.value)}}> - <Radio value="true">浣跨敤</Radio> - <Radio value="false">涓嶄娇鐢�</Radio> </Radio.Group> )} </Form.Item> -- Gitblit v1.8.0