| | |
| | | let time = +sessionStorage.getItem(rduri) |
| | | let c_time = Math.round(new Date().getTime() / 1000) |
| | | |
| | | if (time && c_time - time <= 60) { |
| | | if (time && c_time - time <= 1800) { |
| | | sessionStorage.setItem(rduri, c_time) |
| | | return axios({ |
| | | url: `${url}${param.func ? '/' + param.func : ''}`, |
| | |
| | | >.ant-tabs-content { |
| | | height: 100%; |
| | | .ant-tabs-tabpane:first-child { |
| | | .page-setting-wrap, .page-message-wrap { |
| | | .user-tools { |
| | | display: none; |
| | | } |
| | | } |
| | |
| | | // 通用组件 |
| | | const AntvTabs = asyncComponent(() => import('@/tabviews/custom/components/tabs/antv-tabs')) |
| | | const MkBaseTable = asyncComponent(() => import('@/tabviews/custom/components/table/base-table')) |
| | | const FlowFloat = asyncComponent(() => import('@/tabviews/zshare/flowFloat')) |
| | | const SettingComponent = asyncComponent(() => import('@/tabviews/zshare/settingcomponent')) |
| | | const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes')) |
| | | const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic')) |
| | |
| | | lostmsg: '', // 页面丢失时的提示信息 |
| | | config: null, // 页面配置信息,包括组件等 |
| | | userConfig: null, // 用户自定义设置 |
| | | loading: false, // 列表数据加载中 |
| | | visible: false, // 标签页控制 |
| | | shortcuts: null, // 快捷键 |
| | | autoMatic: null |
| | |
| | | return |
| | | } |
| | | |
| | | if (config.process === 'true') { |
| | | let unset = true |
| | | if (result.works_flow_code && result.works_long_param) { |
| | | try { // 流程信息解析 |
| | | let flowConfig = JSON.parse(window.decodeURIComponent(window.atob(result.works_long_param))) |
| | | flowConfig.flow_code = result.works_flow_code |
| | | flowConfig.flow_name = result.works_flow_name |
| | | config.flow_code = result.works_flow_code |
| | | config.flow_name = result.works_flow_name |
| | | unset = false |
| | | |
| | | window.GLOB.UserCacheMap.set('flow' + MenuID, flowConfig) |
| | | } catch (e) { |
| | | unset = true |
| | | console.warn('Parse Failure') |
| | | } |
| | | } |
| | | |
| | | if (unset) { |
| | | this.setState({ |
| | | config: config, |
| | | viewlost: true, |
| | | loadingview: false, |
| | | lostmsg: '抱歉,您访问的页面未设置工作流,请联系管理员。' |
| | | }) |
| | | return |
| | | } |
| | | } else if (result.works_flow_code) { |
| | | Api.getSystemConfig({ |
| | | func: 's_works_flow_param_sso_menu_upt_v6', |
| | | upt_type: 'del', |
| | | works_flow_code: '', |
| | | works_flow_name: '', |
| | | long_param: '', |
| | | flow_id: '', |
| | | menuid: config.MenuID, |
| | | menuname: config.MenuName, |
| | | username: sessionStorage.getItem('User_Name') || '', |
| | | fullName: sessionStorage.getItem('Full_Name') || '' |
| | | }) |
| | | } |
| | | |
| | | // HS不使用自定义设置 |
| | | if (result.LongParamUser && !window.GLOB.mkHS) { |
| | | try { // 配置信息解析 |
| | |
| | | }) |
| | | } |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID, config.MenuName) |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID, config.MenuName, config.process === 'true') |
| | | |
| | | let autoMatic = null |
| | | if (config.autoMatic && config.autoMatic.enable === 'true') { |
| | |
| | | } |
| | | } |
| | | |
| | | filterComponent = (components, roleId, permAction, skip, urlparam, pageId, MenuName) => { |
| | | filterComponent = (components, roleId, permAction, skip, urlparam, pageId, MenuName, process) => { |
| | | return components.filter(item => { |
| | | item.$pageId = pageId |
| | | item.$searchId = pageId |
| | | |
| | | if (process) { |
| | | item.$process = process |
| | | item.$flowId = 'flow' + this.props.MenuID |
| | | } |
| | | |
| | | item.$menuname = (MenuName || '') + '-' + (item.name || '主表') |
| | | |
| | |
| | | if (tab.permission !== 'true') { // 权限未开启不做权限控制 |
| | | skip = true |
| | | } |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, skip, urlparam, pageId, MenuName) |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, skip, urlparam, pageId, MenuName, process) |
| | | return tab |
| | | }) |
| | | |
| | |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$view = 'popview' |
| | | |
| | | if (item.$process) { |
| | | cell.$process = true |
| | | cell.$flowId = 'flow' + this.props.MenuID |
| | | } |
| | | |
| | | if (cell.controlField) { |
| | | if (/,/ig.test(cell.controlVal)) { |
| | |
| | | loadingview: true, // 页面加载中 |
| | | viewlost: false, // 页面丢失:1、未获取到配置-页面丢失;2、页面未启用 |
| | | config: null, // 页面配置信息,包括组件等 |
| | | loading: false, // 列表数据加载中 |
| | | shortcuts: null, |
| | | }, () => { |
| | | this.loadconfig() |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { loadingview, viewlost, config, loading, shortcuts, autoMatic } = this.state |
| | | const { loadingview, viewlost, config, shortcuts, autoMatic } = this.state |
| | | |
| | | if (!config || viewlost) { |
| | | return ( |
| | | <div className="custom-table-wrap"> |
| | | {loadingview ? <Spin className="view-spin" size="large" /> : null} |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | <div className="user-tools"> |
| | | {config && config.process === 'true' ? <FlowFloat init={true} config={config}/> : null} |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | |
| | | return ( |
| | | <div className={'custom-table-wrap ' + (loadingview || loading ? 'loading' : '')} id={this.state.ContainerId} style={config ? config.style : null}> |
| | | {(loadingview || loading) ? <Spin className="view-spin" size="large" /> : null} |
| | | <div className="custom-table-wrap" id={this.state.ContainerId} style={config.style}> |
| | | <Row className="component-wrap">{this.getComponents()}</Row> |
| | | {config && window.GLOB.breakpoint ? <DebugTable /> : null} |
| | | {!window.GLOB.mkHS && config && autoMatic ? <AutoMatic autoMatic={autoMatic} tabId={config.MenuID} config={config.components[0]} /> : null} |
| | | {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <TableNodes config={config} /> : null} |
| | | {!window.GLOB.mkHS && config ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null} |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | {window.GLOB.breakpoint ? <DebugTable /> : null} |
| | | <div className="user-tools"> |
| | | {autoMatic ? <AutoMatic autoMatic={autoMatic} tabId={config.MenuID} config={config.components[0]} /> : null} |
| | | {config.process === 'true' ? <FlowFloat config={config}/> : null} |
| | | <SettingComponent config={config} shortcuts={shortcuts || []}/> |
| | | <TableNodes config={config} /> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | .ant-btn-link:hover { |
| | | opacity: 0.8; |
| | | } |
| | | } |
| | | .custom-table-wrap.loading { |
| | | .ant-spin-spinning:not(.view-spin) { |
| | | display: none; |
| | | |
| | | .user-tools { |
| | | position: fixed; |
| | | z-index: 2; |
| | | bottom: 55px; |
| | | right: 20px; |
| | | .tool-wrap { |
| | | margin-top: 5px; |
| | | .ant-btn { |
| | | width: 40px; |
| | | height: 40px; |
| | | } |
| | | .anticon-forward { |
| | | font-size: 20px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | </Tabs>)) |
| | | } |
| | | {setting && window.GLOB.breakpoint ? <DebugTable /> : null} |
| | | {!window.GLOB.mkHS && setting ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null} |
| | | {setting ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null} |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | </div> |
| | | ) |
| | |
| | | clear: both; |
| | | } |
| | | } |
| | | |
| | | .tool-wrap { |
| | | position: fixed; |
| | | z-index: 2; |
| | | bottom: 55px; |
| | | right: 20px; |
| | | .ant-btn { |
| | | width: 40px; |
| | | height: 40px; |
| | | } |
| | | } |
| | | } |
| | |
| | | loading: false, |
| | | status: 0, |
| | | flowname: '', |
| | | flowcode: '', |
| | | orgs: [] |
| | | } |
| | | |
| | |
| | | |
| | | this.setState({ |
| | | status: item.status || 0, |
| | | flowname: item.works_flow_name, |
| | | flowname: item.works_flow_name || '', |
| | | flowcode: item.works_flow_code || '', |
| | | loading: false |
| | | }) |
| | | |
| | |
| | | } |
| | | |
| | | save = () => { |
| | | const { BID, plot, status } = this.state |
| | | const { BID, plot, status, flowname, flowcode } = this.state |
| | | |
| | | if (!BID) { |
| | | Modal.error({ |
| | |
| | | ID: BID, |
| | | BID: '' |
| | | } |
| | | |
| | | let ssoParam = { |
| | | func: 's_works_flow_param_sso_upt_v6', |
| | | status: status, |
| | | ID: BID, |
| | | works_flow_code: flowcode, |
| | | works_flow_name: flowname, |
| | | long_param: window.btoa(window.encodeURIComponent(JSON.stringify(nodes))) |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '保存成功!', |
| | | duration: 2 |
| | | }) |
| | | this.setState({ |
| | | loading: false, |
| | | status: _status |
| | | }) |
| | | if (plot.subtype === 'xflow') { |
| | | Api.getSystemConfig(ssoParam).then(result => { |
| | | if (result.status) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '保存成功!', |
| | | duration: 2 |
| | | }) |
| | | this.setState({ |
| | | loading: false, |
| | | status: _status |
| | | }) |
| | | } else { |
| | | notification.error({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '保存成功!', |
| | | duration: 2 |
| | | }) |
| | | this.setState({ |
| | | loading: false, |
| | | status: _status |
| | | }) |
| | | } |
| | | } else { |
| | | notification.error({ |
| | | top: 92, |
| | |
| | | } |
| | | }) |
| | | |
| | | let _total = debit |
| | | if (debit === 0) { |
| | | debit = '' |
| | | } |
| | | |
| | | if (_total === '' && credit !== '') { |
| | | _total = 0 |
| | | } |
| | | |
| | | if (credit === 0) { |
| | | credit = '' |
| | | } |
| | | |
| | | totalLine.debit = debit |
| | | totalLine.credit = credit |
| | | |
| | | totalLine.subject_voucher_text = this.changeMoneyToChinese(debit) |
| | | totalLine.subject_voucher_text = this.changeMoneyToChinese(_total) |
| | | |
| | | return totalLine |
| | | } |
| | |
| | | const Iframe = asyncComponent(() => import('./components/iframe')) |
| | | const Calendar = asyncComponent(() => import('./components/calendar')) |
| | | const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) |
| | | const FlowFloat = asyncComponent(() => import('@/tabviews/zshare/flowFloat')) |
| | | const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes')) |
| | | const MkInterfaces = asyncComponent(() => import('@/tabviews/custom/components/interfaces')) |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | if (config.process === 'true') { |
| | | let unset = true |
| | | if (result.works_flow_code && result.works_long_param) { |
| | | try { // 流程信息解析 |
| | | let flowConfig = JSON.parse(window.decodeURIComponent(window.atob(result.works_long_param))) |
| | | flowConfig.flow_code = result.works_flow_code |
| | | flowConfig.flow_name = result.works_flow_name |
| | | config.flow_code = result.works_flow_code |
| | | config.flow_name = result.works_flow_name |
| | | unset = false |
| | | |
| | | window.GLOB.UserCacheMap.set('flow' + MenuID, flowConfig) |
| | | } catch (e) { |
| | | unset = true |
| | | console.warn('Parse Failure') |
| | | } |
| | | } |
| | | |
| | | if (unset) { |
| | | config.interfaces = [] |
| | | this.setState({ |
| | | config: config, |
| | | viewlost: true, |
| | | loadingview: false, |
| | | lostmsg: '抱歉,您访问的页面未设置工作流,请联系管理员。' |
| | | }) |
| | | return |
| | | } |
| | | } else if (result.works_flow_code) { |
| | | Api.getSystemConfig({ |
| | | func: 's_works_flow_param_sso_menu_upt_v6', |
| | | upt_type: 'del', |
| | | works_flow_code: '', |
| | | works_flow_name: '', |
| | | long_param: '', |
| | | flow_id: '', |
| | | menuid: config.MenuID, |
| | | menuname: config.MenuName, |
| | | username: sessionStorage.getItem('User_Name') || '', |
| | | fullName: sessionStorage.getItem('Full_Name') || '' |
| | | }) |
| | | } |
| | | |
| | | // HS不使用自定义设置 |
| | | if (result.LongParamUser && !window.GLOB.mkHS) { |
| | | try { // 配置信息解析 |
| | |
| | | let initInters = [] |
| | | |
| | | config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters) |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, config.$cache, config.$time, config.MenuName, MenuID, MenuID) |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, config.$cache, config.$time, config.MenuName, MenuID, MenuID, config.process === 'true') |
| | | |
| | | let params = [] |
| | | let BID = param.$BID || '' |
| | |
| | | } |
| | | } |
| | | |
| | | filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId) => { |
| | | filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId, process) => { |
| | | return components.filter(item => { |
| | | item.$pageId = pageId |
| | | item.$searchId = searchId |
| | | item.$syncId = syncId |
| | | |
| | | if (process) { |
| | | item.$process = process |
| | | item.$flowId = 'flow' + this.props.MenuID |
| | | } |
| | | |
| | | if (cache) { |
| | | item.$cache = cache |
| | | item.$time = time |
| | |
| | | _searchId = tab.uuid |
| | | } |
| | | |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, _searchId, tab.uuid) |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, _searchId, tab.uuid, process) |
| | | |
| | | if (_searchId === tab.uuid) { |
| | | tab.components.forEach(cell => { |
| | |
| | | return false |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId) |
| | | item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId, process) |
| | | |
| | | return true |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart', 'antvG6', 'antvX6'].includes(item.type)) { |
| | |
| | | group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' |
| | | } |
| | | |
| | | if (item.$process) { |
| | | group.subButton.$process = true |
| | | group.subButton.$flowId = 'flow' + this.props.MenuID |
| | | } |
| | | |
| | | if (item.$cache && item.$time) { |
| | | group.$cache = item.$cache |
| | | group.$time = item.$time |
| | |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$view = 'popview' |
| | | |
| | | if (item.$process) { |
| | | cell.$process = true |
| | | cell.$flowId = 'flow' + this.props.MenuID |
| | | } |
| | | |
| | | if (cell.btnstyle) { // 兼容 |
| | | cell.style = cell.style || {} |
| | |
| | | render() { |
| | | const { loadingview, viewlost, config, loading, shortcuts, BID } = this.state |
| | | |
| | | if (!config || viewlost) { |
| | | return ( |
| | | <div className="custom-page-wrap"> |
| | | {loadingview ? <Spin className="view-spin" size="large" /> : null} |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | <div className="user-tools"> |
| | | {config && config.process === 'true' ? <FlowFloat init={true} config={config}/> : null} |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | |
| | | return ( |
| | | <div className={`custom-page-wrap ${config && config.minWidth ? 'mk-scroll' : ''} ${loadingview || loading ? 'loading' : ''} ${config && config.mask === 'false' ? 'mk-no-mask' : ''}`} id={this.state.ContainerId} style={config ? config.style : null}> |
| | | {(loadingview || (loading && !config.$cache)) ? <Spin className="view-spin" size="large" /> : null} |
| | | <Row id={config ? 'menu' + config.uuid : ''} style={config && config.minWidth ? {minWidth: config.minWidth} : null} className="component-wrap">{this.getComponents()}</Row> |
| | | {config && config.interfaces.length > 0 ? <MkInterfaces BID={BID} interfaces={config.interfaces}/> : null} |
| | | {config && window.GLOB.breakpoint ? <DebugTable /> : null} |
| | | {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <TableNodes config={config} /> : null} |
| | | {!window.GLOB.mkHS && config ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null} |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | <div className={`custom-page-wrap ${config.minWidth ? 'mk-scroll' : ''} ${loading ? 'loading' : ''} ${config.mask === 'false' ? 'mk-no-mask' : ''}`} id={this.state.ContainerId} style={config.style}> |
| | | {loading && !config.$cache ? <Spin className="view-spin" size="large" /> : null} |
| | | <Row id={'menu' + config.uuid} style={{minWidth: config.minWidth || 'unset'}} className="component-wrap">{this.getComponents()}</Row> |
| | | {config.interfaces.length > 0 ? <MkInterfaces BID={BID} interfaces={config.interfaces}/> : null} |
| | | {window.GLOB.breakpoint ? <DebugTable /> : null} |
| | | <div className="user-tools"> |
| | | {config.process === 'true' ? <FlowFloat config={config}/> : null} |
| | | <SettingComponent config={config} shortcuts={shortcuts || []}/> |
| | | <TableNodes config={config} /> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | .ant-btn-link:hover { |
| | | opacity: 0.8; |
| | | } |
| | | |
| | | .user-tools { |
| | | position: fixed; |
| | | z-index: 2; |
| | | bottom: 55px; |
| | | right: 20px; |
| | | .tool-wrap { |
| | | margin-top: 5px; |
| | | .ant-btn { |
| | | width: 40px; |
| | | height: 40px; |
| | | } |
| | | .anticon-forward { |
| | | font-size: 20px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .custom-page-wrap.loading { |
| | | .ant-spin-spinning:not(.view-spin) { |
| | |
| | | item.$pageId = Tab.uuid |
| | | item.$searchId = searchId |
| | | item.$syncId = syncId |
| | | |
| | | if (Tab.$process) { |
| | | item.$process = true |
| | | item.$flowId = Tab.$flowId |
| | | } |
| | | |
| | | if (item.style && item.style.boxShadow) { |
| | | delete item.style.hShadow |
| | |
| | | cell.$MenuID = Tab.$MenuID |
| | | cell.$tabId = Tab.uuid |
| | | |
| | | if (Tab.$process) { |
| | | cell.$process = true |
| | | cell.$flowId = Tab.$flowId |
| | | } |
| | | |
| | | if (cell.btnstyle) { // 兼容 |
| | | cell.style = cell.style || {} |
| | | cell.style = {...cell.style, ...cell.btnstyle} |
| | |
| | | import { Button, message } from 'antd' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | class AutoMatic extends Component { |
| | | static propTpyes = { |
| | |
| | | const { running } = this.state |
| | | |
| | | return ( |
| | | <Button |
| | | icon={running ? 'pause' : 'forward'} |
| | | shape="circle" |
| | | className={'auto-matic ' + (window.GLOB.systemType === 'production' ? 'low' : '')} |
| | | onClick={this.trigger} |
| | | /> |
| | | <div className="tool-wrap"> |
| | | <Button icon={running ? 'pause' : 'forward'} shape="circle" onClick={this.trigger}/> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | |
| | | .auto-matic { |
| | | position: fixed; |
| | | z-index: 2; |
| | | bottom: 145px; |
| | | right: 20px; |
| | | width: 40px; |
| | | height: 40px; |
| | | .anticon-forward { |
| | | font-size: 20px; |
| | | } |
| | | } |
| | | .auto-matic.low { |
| | | bottom: 100px; |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Button, Modal, notification, Spin, Empty } from 'antd' |
| | | import { BranchesOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | class CustomSetting extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, |
| | | init: PropTypes.any |
| | | } |
| | | |
| | | state = { |
| | | debug: sessionStorage.getItem('debug') === 'true', |
| | | visible: false, |
| | | flows: null, |
| | | loading: false, |
| | | activeCode: '', |
| | | initCode: '' |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | componentDidMount() { |
| | | const { init } = this.props |
| | | |
| | | if (init) { |
| | | this.trigger() |
| | | } |
| | | } |
| | | |
| | | trigger = () => { |
| | | const { config } = this.props |
| | | const { debug } = this.state |
| | | |
| | | if (!debug) return null |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | loading: false, |
| | | initCode: config.flow_code || '', |
| | | activeCode: '' |
| | | }) |
| | | |
| | | let param = { |
| | | func: 's_get_works_flow_local_param_v6' |
| | | } |
| | | |
| | | Api.genericInterface(param).then(result => { |
| | | if (result.status) { |
| | | let flows = result.data || [] |
| | | let active = config.flow_code ? flows.filter(item => item.works_flow_code === config.flow_code)[0] : null |
| | | this.setState({ |
| | | flows: flows, |
| | | activeCode: active |
| | | }) |
| | | |
| | | if (config.flow_code && !active) { |
| | | Modal.error({ |
| | | title: '当前菜单工作流已失效,请重新选择。' |
| | | }) |
| | | } |
| | | } else { |
| | | if (!result.message) return |
| | | if (result.ErrCode === 'N') { |
| | | Modal.error({ |
| | | title: result.message, |
| | | }) |
| | | } else if (result.ErrCode !== '-2') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | settingSubmit = () => { |
| | | const { config } = this.props |
| | | const { activeCode } = this.state |
| | | |
| | | let param = { |
| | | func: 's_works_flow_param_sso_menu_upt_v6', |
| | | upt_type: '', |
| | | works_flow_code: activeCode.works_flow_code, |
| | | works_flow_name: activeCode.works_flow_name, |
| | | long_param: activeCode.long_param, |
| | | flow_id: activeCode.id, |
| | | menuid: config.MenuID, |
| | | menuname: config.MenuName, |
| | | username: sessionStorage.getItem('User_Name') || '', |
| | | fullName: sessionStorage.getItem('Full_Name') || '' |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | if (!result.status) { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | Api.deleteMenuStorage(config.MenuID) |
| | | |
| | | setTimeout(() => { |
| | | this.setState({ |
| | | visible: false, |
| | | loading: false |
| | | }, () => { |
| | | window.GLOB.CacheMap = new Map() |
| | | MKEmitter.emit('reloadMenuView', config.MenuID) |
| | | }) |
| | | }, 100) |
| | | }) |
| | | } |
| | | |
| | | deleteFlow = () => { |
| | | const { config } = this.props |
| | | |
| | | let param = { |
| | | func: 's_works_flow_param_sso_menu_upt_v6', |
| | | upt_type: 'del', |
| | | works_flow_code: '', |
| | | works_flow_name: '', |
| | | long_param: '', |
| | | flow_id: '', |
| | | menuid: config.MenuID, |
| | | menuname: config.MenuName, |
| | | username: sessionStorage.getItem('User_Name') || '', |
| | | fullName: sessionStorage.getItem('Full_Name') || '' |
| | | } |
| | | |
| | | this.setState({ |
| | | deling: true |
| | | }) |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | if (!result.status) { |
| | | this.setState({ |
| | | deling: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | Api.deleteMenuStorage(config.MenuID) |
| | | |
| | | setTimeout(() => { |
| | | this.setState({ |
| | | visible: false, |
| | | deling: false |
| | | }, () => { |
| | | window.GLOB.CacheMap = new Map() |
| | | MKEmitter.emit('reloadMenuView', config.MenuID) |
| | | }) |
| | | }, 100) |
| | | }) |
| | | } |
| | | |
| | | changeFlow = (item) => { |
| | | this.setState({ |
| | | activeCode: item |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { flows, visible, initCode, loading, deling, activeCode, debug } = this.state |
| | | |
| | | if (!debug) return null |
| | | |
| | | return ( |
| | | <div className="tool-wrap"> |
| | | <Button shape="circle" onClick={this.trigger}><BranchesOutlined /></Button> |
| | | <Modal |
| | | wrapClassName="flow-setting-modal" |
| | | title="工作流" |
| | | maskClosable={false} |
| | | width={1000} |
| | | visible={visible} |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | | footer={[ |
| | | initCode ? <Button key="revert" type="danger" disabled={loading} loading={deling} onClick={this.deleteFlow}>删除</Button> : null, |
| | | <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>取消</Button>, |
| | | <Button key="confirm" type="primary" disabled={deling || !activeCode} loading={loading} onClick={this.settingSubmit}>提交</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | {!flows ? <Spin size="large" /> : <> |
| | | {flows.length === 0 ? <Empty /> : <div> |
| | | {flows.map(item => (<div className={'flow-item' + (activeCode && activeCode.works_flow_code === item.works_flow_code ? ' active' : '')} key={item.works_flow_code} onClick={() => this.changeFlow(item)}> |
| | | <div className="header">{item.works_flow_name}({item.works_flow_code})</div> |
| | | <div className="img" style={{backgroundImage: `url(${item.flow_image})`}}></div> |
| | | </div>))} |
| | | </div>} |
| | | </>} |
| | | {flows && flows.length === 0 ? <Empty /> : null} |
| | | {!flows ? <Spin size="large" /> : null} |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default CustomSetting |
New file |
| | |
| | | .flow-setting-modal { |
| | | .ant-modal { |
| | | top: 50px; |
| | | padding-bottom: 5px; |
| | | .ant-modal-footer { |
| | | .ant-btn-danger:hover { |
| | | color: #ffffff!important; |
| | | } |
| | | } |
| | | .ant-modal-body { |
| | | max-height: calc(100vh - 190px); |
| | | min-height: 250px; |
| | | overflow-y: auto; |
| | | padding-top: 0px; |
| | | position: relative; |
| | | |
| | | .flow-item { |
| | | display: inline-block; |
| | | width: calc(25% - 20px); |
| | | margin: 10px; |
| | | border: 1px solid #d8d8d8; |
| | | vertical-align: top; |
| | | cursor: pointer; |
| | | |
| | | .header { |
| | | height: 50px; |
| | | padding: 5px; |
| | | word-break: break-word; |
| | | display: -webkit-box; |
| | | -webkit-box-orient: vertical; |
| | | overflow: hidden; |
| | | -webkit-line-clamp: 2; |
| | | text-align: center; |
| | | } |
| | | .img { |
| | | height: 150px; |
| | | background-size: contain; |
| | | background-position: center; |
| | | background-repeat: no-repeat; |
| | | } |
| | | } |
| | | |
| | | .flow-item.active { |
| | | border: 1px solid var(--mk-sys-color); |
| | | box-shadow: 0 0 2px var(--mk-sys-color); |
| | | } |
| | | |
| | | .ant-spin { |
| | | position: absolute; |
| | | left: calc(50% - 22px); |
| | | top: 100px; |
| | | } |
| | | .ant-empty { |
| | | margin-top: 30px; |
| | | } |
| | | |
| | | .component-title { |
| | | font-size: 16px; |
| | | display: inline-block; |
| | | margin: 20px 0px 10px 0px; |
| | | padding: 0 10px; |
| | | border-bottom: 2px solid #1890ff; |
| | | } |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | Api.deleteMenuStorage(config.MenuID).then(() => { |
| | | Api.deleteMenuStorage(config.MenuID) |
| | | |
| | | setTimeout(() => { |
| | | this.setState({ |
| | | visible: false, |
| | | revertLoading: false |
| | |
| | | window.GLOB.CacheMap = new Map() |
| | | MKEmitter.emit('reloadMenuView', config.MenuID) |
| | | }) |
| | | }) |
| | | }, 100) |
| | | }) |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | Api.deleteMenuStorage(config.MenuID).then(() => { |
| | | Api.deleteMenuStorage(config.MenuID) |
| | | |
| | | setTimeout(() => { |
| | | this.setState({ |
| | | visible: false, |
| | | confirmLoading: false |
| | |
| | | window.GLOB.CacheMap = new Map() |
| | | MKEmitter.emit('reloadMenuView', config.MenuID) |
| | | }) |
| | | }) |
| | | }, 100) |
| | | }) |
| | | } |
| | | |
| | |
| | | render() { |
| | | const { components, visible } = this.state |
| | | |
| | | if (window.GLOB.mkHS || window.GLOB.sysType !== 'local') return null |
| | | |
| | | return ( |
| | | <div className="page-setting-wrap"> |
| | | {window.GLOB.sysType === 'local' ? <Button |
| | | icon="setting" |
| | | shape="circle" |
| | | className="page-setting" |
| | | onClick={this.trigger} |
| | | /> : null} |
| | | <div className="tool-wrap"> |
| | | <Button icon="setting" shape="circle" onClick={this.trigger}/> |
| | | <Modal |
| | | wrapClassName="custom-setting-modal" |
| | | title={'自定义设置'} |
| | |
| | | .page-setting-wrap { |
| | | .page-setting { |
| | | position: fixed; |
| | | z-index: 2; |
| | | bottom: 55px; |
| | | right: 20px; |
| | | width: 40px; |
| | | height: 40px; |
| | | } |
| | | } |
| | | .custom-popview { |
| | | .page-setting-wrap { |
| | | display: none; |
| | | } |
| | | } |
| | | .page-message-wrap.exist + .page-setting-wrap { |
| | | .page-setting { |
| | | bottom: 100px; |
| | | } |
| | | } |
| | | .custom-setting-modal { |
| | | .ant-modal { |
| | | top: 50px; |
| | | padding-bottom: 5px; |
| | | .ant-modal-footer { |
| | | .ant-btn-danger:hover { |
| | | color: #ffffff!important; |
| | | } |
| | | } |
| | | .ant-modal-body { |
| | | max-height: calc(100vh - 190px); |
| | | min-height: 250px; |
| | |
| | | const { config } = this.props |
| | | const { visible, loading, empty, debug } = this.state |
| | | |
| | | if (window.GLOB.mkHS || window.GLOB.systemType === 'production' || !debug || window.GLOB.sysType === 'cloud') return null |
| | | |
| | | return ( |
| | | <div className={'page-message-wrap ' + (debug && window.GLOB.sysType !== 'cloud' ? 'exist' : '')}> |
| | | {debug && window.GLOB.sysType !== 'cloud' ? <Button |
| | | icon="fork" |
| | | shape="circle" |
| | | className="page-message" |
| | | onClick={this.trigger} |
| | | /> : null} |
| | | <div className="tool-wrap"> |
| | | <Button icon="fork" shape="circle" onClick={this.trigger}/> |
| | | <Modal |
| | | title="" |
| | | wrapClassName="view-table-modal" |
| | |
| | | .page-message-wrap { |
| | | .page-message { |
| | | position: fixed; |
| | | z-index: 2; |
| | | bottom: 55px; |
| | | right: 20px; |
| | | width: 40px; |
| | | height: 40px; |
| | | } |
| | | } |
| | | |
| | | .view-table-modal { |
| | | .ant-modal { |
| | | top: 30px; |