From 590a8198e9fcb503aaeb04f6d550c65bf30c0566 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 11 三月 2020 18:01:06 +0800 Subject: [PATCH] 2020-03-11 --- src/tabviews/rolemanage/index.scss | 39 ++++++ src/tabviews/commontable/index.scss | 4 src/tabviews/formtab/index.jsx | 5 src/tabviews/subtable/index.scss | 2 src/tabviews/rolemanage/index.jsx | 91 ++++++++++++++- src/tabviews/subtable/index.jsx | 47 ++++--- src/tabviews/subtabtable/index.jsx | 36 +++-- src/tabviews/commontable/index.jsx | 46 ++++--- src/tabviews/managetable/index.jsx | 8 src/tabviews/tableshare/actionList/index.jsx | 14 ++ src/views/login/index.jsx | 9 + 11 files changed, 222 insertions(+), 79 deletions(-) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index f214488..d7eb0af 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -9,19 +9,21 @@ import zhCN from '@/locales/zh-CN/main.js' import enUS from '@/locales/en-US/main.js' import Utils from '@/utils/utils.js' -import asyncComponent from '@/utils/asyncLoadComponent' +import asyncComponent from '@/utils/asyncComponent' +import asyncLoadComponent from '@/utils/asyncLoadComponent' import {refreshTabView, modifyTabview} from '@/store/action' import MainTable from './mainTable' import VerifyCard from '@/tabviews/tableshare/verifycard' -import MainAction from '@/tabviews/tableshare/actionList' import MainSearch from '@/tabviews/tableshare/topSearch' -import SubTable from '@/tabviews/subtable' import NotFount from '@/components/404' import './index.scss' -const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable')) -const FormTab = asyncComponent(() => import('@/tabviews/formtab')) +const MainAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) +const SubTable = asyncLoadComponent(() => import('@/tabviews/subtable')) +const SubTabTable = asyncLoadComponent(() => import('@/tabviews/subtabtable')) +const FormTab = asyncLoadComponent(() => import('@/tabviews/formtab')) + const { TabPane } = Tabs const { TreeNode } = Tree const { Paragraph } = Typography @@ -941,22 +943,24 @@ /> : null } {actions && setting.onload !== 'false' ? - <MainAction - ref="mainButton" - BID="" - type="main" - menuType="main" - setting={setting} - actions={actions} - dict={this.state.dict} - MenuID={this.props.MenuID} - logcolumns={this.state.logcolumns} - ContainerId={this.state.ContainerId} - refreshdata={this.refreshbyaction} - triggerPopview={this.triggerPopview} - getexceloutparam={this.getexceloutparam} - gettableselected={this.gettableselected} - /> : null + <div style={{minHeight: '45px'}}> + <MainAction + ref="mainButton" + BID="" + type="main" + menuType="main" + setting={setting} + actions={actions} + dict={this.state.dict} + MenuID={this.props.MenuID} + logcolumns={this.state.logcolumns} + ContainerId={this.state.ContainerId} + refreshdata={this.refreshbyaction} + triggerPopview={this.triggerPopview} + getexceloutparam={this.getexceloutparam} + gettableselected={this.gettableselected} + /> + </div> : null } {columns && setting.onload !== 'false' ? <div className="main-table-box"> diff --git a/src/tabviews/commontable/index.scss b/src/tabviews/commontable/index.scss index 20b0579..21369a9 100644 --- a/src/tabviews/commontable/index.scss +++ b/src/tabviews/commontable/index.scss @@ -53,14 +53,14 @@ .main-pickup { position: absolute; right: 20px; - top: -25px; + top: -22px; z-index: 1; } .custom-control { position: absolute; z-index: 1; right: 20px; - top: -55px; + top: -50px; font-size: 16px; padding: 3px; cursor: pointer; diff --git a/src/tabviews/formtab/index.jsx b/src/tabviews/formtab/index.jsx index 0ef451a..2175cb1 100644 --- a/src/tabviews/formtab/index.jsx +++ b/src/tabviews/formtab/index.jsx @@ -10,20 +10,19 @@ import enUS from '@/locales/en-US/main.js' import Utils from '@/utils/utils.js' import options from '@/store/options.js' +import asyncComponent from '@/utils/asyncLoadComponent' import FormGroup from './formgroup' import FormAction from './actionList' -import SubTable from '@/tabviews/subtable' import NotFount from '@/components/404' import {refreshTabView, modifyTabview} from '@/store/action' import './index.scss' const { TabPane } = Tabs +const SubTable = asyncComponent(() => import('@/tabviews/subtable')) class NormalTable extends Component { static propTpyes = { - // MenuNo: PropTypes.string, // 鑿滃崟鍙傛暟 - // MenuName: PropTypes.string, // 鑿滃崟鍙傛暟 MenuID: PropTypes.string, // 鑿滃崟Id param: PropTypes.any, // 涓昏〃浼犻�掑弬鏁� refresh: PropTypes.any // 鍒锋柊涓昏〃椤甸潰 diff --git a/src/tabviews/managetable/index.jsx b/src/tabviews/managetable/index.jsx index a45b20e..35d258b 100644 --- a/src/tabviews/managetable/index.jsx +++ b/src/tabviews/managetable/index.jsx @@ -10,18 +10,20 @@ import enUS from '@/locales/en-US/main.js' import Utils from '@/utils/utils.js' import options from '@/store/options.js' -import asyncComponent from '@/utils/asyncLoadComponent' +import asyncComponent from '@/utils/asyncComponent' +import asyncLoadComponent from '@/utils/asyncLoadComponent' import {refreshTabView, modifyTabview} from '@/store/action' import MainTable from '@/tabviews/commontable/mainTable' -import MainAction from '@/tabviews/tableshare/actionList' import MainSearch from '@/tabviews/tableshare/topSearch' -import SubTable from '@/tabviews/subtable' import NotFount from '@/components/404' import './index.scss' +const MainAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) +const SubTable = asyncLoadComponent(() => import('@/tabviews/subtable')) const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable')) const FormTab = asyncComponent(() => import('@/tabviews/formtab')) + const { TabPane } = Tabs const { TreeNode } = Tree const { Paragraph } = Typography diff --git a/src/tabviews/rolemanage/index.jsx b/src/tabviews/rolemanage/index.jsx index 6f1619b..91b720c 100644 --- a/src/tabviews/rolemanage/index.jsx +++ b/src/tabviews/rolemanage/index.jsx @@ -1,11 +1,14 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Card, Col, Row, Icon } from 'antd' -// import Api from '@/api' +import { Card, Col, Row, Icon, Menu, notification, Spin, Input } from 'antd' + +import Api from '@/api' import zhCN from '@/locales/zh-CN/role.js' import enUS from '@/locales/en-US/role.js' import './index.scss' + +const { Search } = Input export default class RoleManage extends Component { static propTpyes = { @@ -14,11 +17,61 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS + dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + loadingview: true, + roleList: null, + primarykey: '' + } + + getRoleList = async () => { + let param = { + func: 's_rolemenu_get_list' + } + let result = await Api.getSystemConfig(param) + + if (result.status) { + this.setState({ + roleList: result.data + }) + } else { + this.setState({ + loadingview: false + }) + notification.warning({ + top: 92, + message: result.message, + duration: 10 + }) + } + } + + getMenuList = async () => { + let param = { + func: 's_rolemenu_get_FstMenu' + } + let result = await Api.getSystemConfig(param) + + if (result.status) { + + } else { + this.setState({ + loadingview: false + }) + notification.warning({ + top: 92, + message: result.message, + duration: 10 + }) + } + } + + changeRole = () => { + } UNSAFE_componentWillMount () { - + this.getRoleList() + this.getMenuList() } shouldComponentUpdate (nextProps, nextState) { @@ -26,14 +79,38 @@ } render() { + const { roleList, loadingview, primarykey } = this.state + + let _roleList = [] + + if (roleList && roleList.length > 0) { + _roleList = roleList.filter(role => role.RoleName.toLowerCase().indexOf(primarykey.toLowerCase()) >= 0) + } + return ( <div className="rolemanage"> + {loadingview && <Spin size="large" />} <Row gutter={16}> <Col span={6}> <Card - title={<span className="role-title"><Icon type="bank" /> {this.state.dict['role.title']}</span>} - bordered={false}> - Card content + className="role-list" + title={ + <span className="role-title"> + <Icon type="bank" /> + <span className="title">{this.state.dict['role.title']}</span> + <Search placeholder="" onSearch={value => this.setState({primarykey: value})} /> + </span> + } + bordered={false} + > + <Menu + onClick={this.handleClick} + mode="inline" + > + {_roleList.map((role, index) => + <Menu.Item key={index} onClick={() => this.changeRole(role)}>{role.RoleName}</Menu.Item> + )} + </Menu> </Card> </Col> <Col span={18}> diff --git a/src/tabviews/rolemanage/index.scss b/src/tabviews/rolemanage/index.scss index 30e6bcd..cdd317e 100644 --- a/src/tabviews/rolemanage/index.scss +++ b/src/tabviews/rolemanage/index.scss @@ -4,7 +4,42 @@ position: relative; background: #fafafa; padding: 15px; - .role-title { - color: #36c6d3; + + .role-list { + min-height: calc(100vh - 125px); + .ant-card-head { + padding: 0 10px; + .role-title { + display: inline-block; + width: 100%; + color: #36c6d3; + .anticon-bank { + margin-right: 5px; + } + .ant-input-affix-wrapper { + width: calc(100% - 140px); + max-width: 130px; + margin-top: -2px; + float: right; + input { + border-radius: 20px; + height: 30px; + } + } + } + } + .ant-card-body { + padding: 0px; + .ant-menu-inline { + border-right: 0; + margin-top: 2px; + } + } + } + > .ant-spin { + position: fixed; + left: calc(50vw - 22px); + top: calc(50vh - 70px); + z-index: 1; } } \ No newline at end of file diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 310af7f..5a14bc9 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -6,9 +6,9 @@ import moment from 'moment' import Api from '@/api' import SubTable from './subTable' -import SubAction from '@/tabviews/tableshare/actionList' import SubSearch from '@/tabviews/tableshare/topSearch' -import asyncComponent from '@/utils/asyncLoadComponent' +import asyncLoadComponent from '@/utils/asyncLoadComponent' +import asyncComponent from '@/utils/asyncComponent' import NotFount from '@/components/404' import zhCN from '@/locales/zh-CN/main.js' import enUS from '@/locales/en-US/main.js' @@ -16,7 +16,8 @@ import options from '@/store/options.js' import './index.scss' -const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable')) +const SubTabTable = asyncLoadComponent(() => import('@/tabviews/subtabtable')) +const SubAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) class SubTabViewTable extends Component { static propTpyes = { @@ -662,25 +663,27 @@ dict={this.state.dict} /> : null } - {actions && - <SubAction - ref="subButton" - type="sub" - menuType={this.props.menuType} - setting={setting} - actions={actions} - Tab={this.props.Tab} - BID={this.props.BID} - BData={this.props.BData} - dict={this.state.dict} - MenuID={this.props.SupMenuID} - logcolumns={this.state.logcolumns} - ContainerId={this.props.ContainerId} - refreshdata={this.refreshbyaction} - triggerPopview={this.triggerPopview} - getexceloutparam={this.getexceloutparam} - gettableselected={this.gettableselected} - /> + {actions ? + <div style={{minHeight: '45px'}}> + <SubAction + ref="subButton" + type="sub" + menuType={this.props.menuType} + setting={setting} + actions={actions} + Tab={this.props.Tab} + BID={this.props.BID} + BData={this.props.BData} + dict={this.state.dict} + MenuID={this.props.SupMenuID} + logcolumns={this.state.logcolumns} + ContainerId={this.props.ContainerId} + refreshdata={this.refreshbyaction} + triggerPopview={this.triggerPopview} + getexceloutparam={this.getexceloutparam} + gettableselected={this.gettableselected} + /> + </div> : null } {columns ? <div className="subtable-box"> diff --git a/src/tabviews/subtable/index.scss b/src/tabviews/subtable/index.scss index ff14f6f..dd32050 100644 --- a/src/tabviews/subtable/index.scss +++ b/src/tabviews/subtable/index.scss @@ -34,7 +34,7 @@ .subtable-pickup { position: absolute; right: 5px; - top: -25px; + top: -22px; z-index: 10; } } diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index cafcb9f..23910cf 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -5,8 +5,8 @@ import { notification, Spin} from 'antd' import moment from 'moment' import Api from '@/api' +import asyncComponent from '@/utils/asyncComponent' import SubTable from '@/tabviews/subtable/subTable' -import SubAction from '@/tabviews/tableshare/actionList' import SubSearch from '@/tabviews/tableshare/topSearch' import NotFount from '@/components/404' import zhCN from '@/locales/zh-CN/main.js' @@ -14,6 +14,8 @@ import Utils from '@/utils/utils.js' import options from '@/store/options.js' import './index.scss' + +const SubAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) class SubTabModalTable extends Component { static propTpyes = { @@ -612,21 +614,23 @@ dict={this.state.dict} /> : null } - {actions && - <SubAction - ref="subtabButton" - type="subtab" - menuType={this.props.menuType} - setting={setting} - actions={actions} - BID={this.props.BID} - BData={this.props.BData} - dict={this.state.dict} - MenuID={this.props.SupMenuID} - ContainerId={this.props.ContainerId} - refreshdata={this.refreshbyaction} - gettableselected={this.gettableselected} - /> + {actions ? + <div style={{minHeight: '45px'}}> + <SubAction + ref="subtabButton" + type="subtab" + menuType={this.props.menuType} + setting={setting} + actions={actions} + BID={this.props.BID} + BData={this.props.BData} + dict={this.state.dict} + MenuID={this.props.SupMenuID} + ContainerId={this.props.ContainerId} + refreshdata={this.refreshbyaction} + gettableselected={this.gettableselected} + /> + </div> : null } {columns && <SubTable diff --git a/src/tabviews/tableshare/actionList/index.jsx b/src/tabviews/tableshare/actionList/index.jsx index 92f83e0..ad7dd32 100644 --- a/src/tabviews/tableshare/actionList/index.jsx +++ b/src/tabviews/tableshare/actionList/index.jsx @@ -429,6 +429,11 @@ delete res.status // 浣跨敤澶勭悊鍚庣殑鏁版嵁璋冪敤澶栭儴鎺ュ彛 + let keys = Object.keys(res) // 鎻愪氦澶栭儴鎺ュ彛鍓嶏紝娣诲姞BID + if (keys.filter(key => key.toLowerCase() === 'bid').length === 0) { + res.BID = this.props.BID + } + resolve(res) } else { this.execError(res, btn) @@ -1098,6 +1103,11 @@ delete res.status // 浣跨敤澶勭悊鍚庣殑鏁版嵁璋冪敤澶栭儴鎺ュ彛 + let keys = Object.keys(res) // 鎻愪氦澶栭儴鎺ュ彛鍓嶏紝娣诲姞BID + if (keys.filter(key => key.toLowerCase() === 'bid').length === 0) { + res.BID = this.props.BID + } + resolve(res) } else { this.execError(res, btn) @@ -1542,6 +1552,10 @@ delete res.status // 浣跨敤澶勭悊鍚庣殑鏁版嵁璋冪敤澶栭儴鎺ュ彛 + let keys = Object.keys(res) // 鎻愪氦澶栭儴鎺ュ彛鍓嶏紝娣诲姞BID + if (keys.filter(key => key.toLowerCase() === 'bid').length === 0) { + res.BID = this.props.BID + } resolve(res) } else { this.execError(res, btn) diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index e1b9292..83a2061 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -13,6 +13,7 @@ import './index.scss' const LoginForm = asyncComponent(() => import('./loginform')) +const Action = asyncComponent(() => import('@/tabviews/tableshare/actionList')) const iszhCN = !localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN' class Login extends Component { @@ -28,7 +29,8 @@ ICP: window.GLOB.icp || 'ICP澶囨锛� 浜琁CP澶�12007830鍙�', bgColor: window.GLOB.bgColor || '#000000', lineColor: window.GLOB.lineColor || '#1890ff', - website: window.GLOB.website || (!window.GLOB.copyRight && 'http://minkesoft.com') + website: window.GLOB.website || (!window.GLOB.copyRight && 'http://minkesoft.com'), + loaded: false } changelang (item) { @@ -116,7 +118,8 @@ localStorage.setItem('AuthCode', box) this.setState({ - auth: true + auth: true, + loaded: true }) } else { localStorage.removeItem('AuthCode') @@ -136,6 +139,7 @@ } render () { + return ( <div className="login-container" style={{backgroundImage: 'url(' + this.state.bgImage + ')', backgroundColor: this.state.bgColor}}> <div className="logo" style={{borderColor: this.state.lineColor}}> @@ -160,6 +164,7 @@ } <p dangerouslySetInnerHTML={{ __html: this.state.ICP.replace(/\s/ig, ' ') }}></p> </div> + {this.state.loaded ? <div style={{position: 'fixed', bottom: '-1000px'}}><Action setting={{}} actions={[]} /></div> : null } </div> ) } -- Gitblit v1.8.0