From 70c47c170ae1cc154e68c1af407e4f6ebf04669e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 03 十二月 2019 19:25:01 +0800 Subject: [PATCH] 2019-12-03 --- src/components/tabview/index.jsx | 3 + src/index.js | 2 + src/assets/img/loginbg-origin.jpg | 0 public/index.html | 2 src/views/login/loginform.jsx | 3 + src/components/header/index.jsx | 6 +++ src/templates/comtableconfig/source.jsx | 6 +++ src/assets/img/loginbg.jpg | 0 src/api/index.js | 12 +++++- src/views/login/index.scss | 5 +- src/locales/zh-CN/comtable.js | 1 src/tabviews/commontable/index.jsx | 18 --------- public/options.js | 10 ++++ src/locales/en-US/comtable.js | 1 src/utils/utils.js | 6 ++- src/assets/css/main.scss | 13 ++++++ src/views/login/index.jsx | 29 +++++++------- 17 files changed, 75 insertions(+), 42 deletions(-) diff --git a/public/index.html b/public/index.html index 94431c0..c81ee7a 100644 --- a/public/index.html +++ b/public/index.html @@ -9,7 +9,7 @@ <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo.png" /> <script src="%PUBLIC_URL%/options.js"></script> - <title>MinkeSoft</title> + <title></title> </head> <body> <noscript>You need to enable JavaScript to run this app.</noscript> diff --git a/public/options.js b/public/options.js index e6d155b..ec1cb62 100644 --- a/public/options.js +++ b/public/options.js @@ -1,5 +1,13 @@ window.GLOB = { service: 'mkwms', appkey: '20191106103859640976D6E924E464D029CF0', - mainSystemApi: '' + mainSystemApi: '', + title: '', + logo: '', + bgImage: '', + platName: '', + copyright: '', + ICP: '', + bgColor: '', + lineColor: '' } \ No newline at end of file diff --git a/src/api/index.js b/src/api/index.js index 268be70..64f6778 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,5 +1,6 @@ import axios from 'axios' import qs from 'qs' +import {notification } from 'antd' // axios.defaults.baseURL = 'http://qingqiumarket.cn' axios.defaults.crossDomain = true @@ -35,14 +36,21 @@ return Promise.resolve(response.data) } }, (error) => { - // console.log(error.response.status) + notification.error({ + className: 'notification-custom-error', + bottom: 0, + message: '鐘舵�佺爜-' + error.response.status + '锛岃鑱旂郴绠$悊鍛�', + placement: 'bottomRight', + duration: 15 + }) return Promise.reject(error) }) class Api { constructor() { + let service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : '' if (process.env.NODE_ENV === 'production') { - axios.defaults.baseURL = document.location.origin + (window.GLOB.service ? '/' + window.GLOB.service : '') + axios.defaults.baseURL = document.location.origin + '/' + service } else { // axios.defaults.baseURL = 'http://127.0.0.1:8888' } diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss index 9e5898e..386900a 100644 --- a/src/assets/css/main.scss +++ b/src/assets/css/main.scss @@ -143,4 +143,17 @@ .ant-popover { z-index: 1090!important; +} + +.ant-notification-notice.notification-custom-error { + background: #f5222d; + .anticon.ant-notification-notice-icon-error { + color: #ffffff; + } + .ant-notification-notice-message { + color: #ffffff; + } + .ant-notification-close-icon { + color: #ffffff; + } } \ No newline at end of file diff --git a/src/assets/img/loginbg-origin.jpg b/src/assets/img/loginbg-origin.jpg new file mode 100644 index 0000000..72130b7 --- /dev/null +++ b/src/assets/img/loginbg-origin.jpg Binary files differ diff --git a/src/assets/img/loginbg.jpg b/src/assets/img/loginbg.jpg index 72130b7..7899f9b 100644 --- a/src/assets/img/loginbg.jpg +++ b/src/assets/img/loginbg.jpg Binary files differ diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index 7b9749c..d1ccdb7 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -177,6 +177,12 @@ return item }) }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 15 + }) } } diff --git a/src/components/tabview/index.jsx b/src/components/tabview/index.jsx index 2a387f5..79e2404 100644 --- a/src/components/tabview/index.jsx +++ b/src/components/tabview/index.jsx @@ -16,6 +16,7 @@ let Comps = {} +let service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : '' class Header extends Component { static propTpyes = { @@ -71,7 +72,7 @@ } else if (view.type === 'TabForm') { return (<Comps.TabForm MenuNo={view.MenuNo} MenuID={view.MenuID} key={view.MenuID} param={view.param}/>) } else if (view.type === 'iframe') { - return (<Comps.Iframe key={view.MenuID} title={view.MenuName} url={'http://qingqiumarket.cn/MKWMS/zh-CN/' + view.LinkUrl}/>) + return (<Comps.Iframe key={view.MenuID} title={view.MenuName} url={'http://qingqiumarket.cn/' + service + 'zh-CN/' + view.LinkUrl}/>) } else { return (<NotFount key={view.MenuID} />) } diff --git a/src/index.js b/src/index.js index ec4170e..46ab291 100644 --- a/src/index.js +++ b/src/index.js @@ -21,6 +21,8 @@ ) } +document.title = window.GLOB.title || 'MinkeSoft' + render(Route) serviceWorker.unregister() diff --git a/src/locales/en-US/comtable.js b/src/locales/en-US/comtable.js index 041f45d..f0557ea 100644 --- a/src/locales/en-US/comtable.js +++ b/src/locales/en-US/comtable.js @@ -50,6 +50,7 @@ 'header.form.type': 'Type', 'header.form.text': 'Text', 'header.form.picture': '鍥剧墖', + 'header.form.number': '鏁板瓧', 'header.form.colspan': '鍚堝苟鍒�', 'header.form.select': 'Select', 'header.form.link': '鍏宠仈鑿滃崟', diff --git a/src/locales/zh-CN/comtable.js b/src/locales/zh-CN/comtable.js index 2a5e95c..97c1995 100644 --- a/src/locales/zh-CN/comtable.js +++ b/src/locales/zh-CN/comtable.js @@ -50,6 +50,7 @@ 'header.form.type': '绫诲瀷', 'header.form.text': '鏂囨湰', 'header.form.picture': '鍥剧墖', + 'header.form.number': '鏁板瓧', 'header.form.colspan': '鍚堝苟鍒�', 'header.form.select': '閫夋嫨', 'header.form.link': '鍏宠仈鑿滃崟', diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index d092828..b3a7690 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -318,24 +318,6 @@ UNSAFE_componentWillMount () { // 缁勪欢鍔犺浇鏃讹紝鑾峰彇鑿滃崟鏁版嵁 this.loadconfig() - // this.loadmaindata() - - // this.setState({ - // data: [1,2,3,4,5,6,7,8,9,10].map((item, index) => { - // return { - // key: index, - // ID: item + 'mainkey', - // ExRateName: '$', - // SupplierName: '澶╃尗' + item + '搴�', - // SupShortName: '澶╃尗', - // SupplierCode: '201922' + item, - // OrgName: '闃块噷宸村反', - // OrgCode: '302999', - // PlanDate: '2019-11-' + (item < 10 ? '0' + item : item) - // } - // }), - // total: 329 - // }) } shouldComponentUpdate (nextProps, nextState) { diff --git a/src/templates/comtableconfig/source.jsx b/src/templates/comtableconfig/source.jsx index edd1705..a408d7a 100644 --- a/src/templates/comtableconfig/source.jsx +++ b/src/templates/comtableconfig/source.jsx @@ -328,6 +328,12 @@ }, { type: 'columns', + label: CommonDict['header.form.number'], + subType: 'number', + url: '' + }, + { + type: 'columns', label: CommonDict['header.form.colspan'], subType: 'colspan', url: '' diff --git a/src/utils/utils.js b/src/utils/utils.js index 358319a..53cb3b8 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -1,5 +1,7 @@ import moment from 'moment' +const service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : '' + export default class Utils { /** * @description 鐢熸垚32浣島uid string + 鏃堕棿 @@ -262,9 +264,9 @@ if (!url) return '' let baseurl = '' if (process.env.NODE_ENV === 'production') { - baseurl = document.location.origin + '/' + baseurl = document.location.origin + '/' + service } else { - baseurl = 'http://qingqiumarket.cn/MKWMS/' + baseurl = 'http://qingqiumarket.cn/' + service } let realurl = url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url return realurl diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index b1cbfa0..297814e 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -20,7 +20,14 @@ selectedlang: iszhCN ? 'zh-CN' : 'en-US', dict: iszhCN ? zhCN : enUS, isDisabled: false, - auth: false + auth: false, + logo: window.GLOB.logo || logourl, + bgImage: window.GLOB.bgImage || loginbg, + platName: window.GLOB.platName || '鏄庣鍟嗕笟鏅鸿兘寮�鏀惧钩鍙�', + copyright: window.GLOB.copyright || 'Copyright漏2017 鎵�鏈夌浉鍏崇増鏉冨綊 鍖椾含鏄庣鏅崕淇℃伅鎶�鏈湁闄愬叕鍙�', + ICP: window.GLOB.ICP || 'ICP澶囨锛� 浜琁CP澶�12007830鍙�', + bgColor: window.GLOB.bgColor || '#000000', + lineColor: window.GLOB.lineColor || '#06b4f7' } changelang (item) { @@ -119,12 +126,13 @@ render () { return ( - <div className="login-container"> - <div className="logo"> - <img src={logourl} alt=""/> + <div className="login-container" style={{backgroundImage: 'url(' + this.state.bgImage + ')', backgroundColor: this.state.bgColor}}> + <div className="logo" style={{borderColor: this.state.lineColor}}> + <img src={this.state.logo} alt=""/> </div> - <div className="login-middle" style={{background: 'url(' + loginbg + ')'}}> + <div className="login-middle" style={{borderColor: this.state.lineColor}}> <LoginForm + platName={this.state.platName} dict={this.state.dict} auth={this.state.auth} lang={this.state.selectedlang} @@ -135,15 +143,8 @@ /> </div> <div className="login-bottom"> - <p> - <span className="split">Copyright漏2017</span> - <span className="split">{this.state.dict['login.copyright']}</span> - <span>鍖椾含鏄庣鏅崕淇℃伅鎶�鏈湁闄愬叕鍙�</span> - </p> - <p> - <span>ICP澶囨锛�</span> - <span>浜琁CP澶�12007830鍙�</span> - </p> + <p dangerouslySetInnerHTML={{ __html: this.state.copyright.replace(/\s/ig, ' ') }}></p> + <p dangerouslySetInnerHTML={{ __html: this.state.ICP.replace(/\s/ig, ' ') }}></p> </div> </div> ) diff --git a/src/views/login/index.scss b/src/views/login/index.scss index 70a4965..003ca7b 100644 --- a/src/views/login/index.scss +++ b/src/views/login/index.scss @@ -1,7 +1,9 @@ .login-container { height: 100vh; min-height: 600px; - background: #000000; + background-size: cover; + background-repeat: no-repeat; + background-position: center center; .logo { height: 100px; padding-top: 30px; @@ -13,7 +15,6 @@ .login-middle { height: calc(100vh - 194px); min-height: 420px; - // background: url('../../assets/img/loginbg.jpg'); background-size: cover; background-position: center center; border-bottom: 2px solid #06b4f7; diff --git a/src/views/login/loginform.jsx b/src/views/login/loginform.jsx index 8dea33d..968b863 100644 --- a/src/views/login/loginform.jsx +++ b/src/views/login/loginform.jsx @@ -13,6 +13,7 @@ dict: PropTypes.object, auth: PropTypes.bool, lang: PropTypes.string, + platName: PropTypes.string } state = {} @@ -62,7 +63,7 @@ return ( <Form onSubmit={this.handleSubmit} className="login-form" id="login-form"> - <h4>鏄庣鍟嗕笟鏅鸿兘寮�鏀惧钩鍙�</h4> + <h4>{this.props.platName}</h4> <Form.Item> {getFieldDecorator('username', { rules: [{ required: true, message: this.props.dict['login.username.empty'] }], -- Gitblit v1.8.0