From 836dc03f4dd7f3e5e1770723f5b406c4bb1c1a18 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 31 五月 2023 13:32:56 +0800 Subject: [PATCH] 2023-05-31 --- src/tabviews/custom/components/table/edit-table/normalTable/index.scss | 8 -- src/tabviews/custom/components/table/edit-table/index.jsx | 58 +++++++------------ src/tabviews/custom/components/table/base-table/index.jsx | 27 ++------ src/views/login/loginform.jsx | 7 ++ src/tabviews/custom/components/share/normalTable/index.jsx | 2 src/tabviews/custom/components/table/normal-table/index.jsx | 27 ++------ src/components/header/loginform.jsx | 4 + src/views/login/logincloudform.jsx | 2 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 14 +--- 9 files changed, 53 insertions(+), 96 deletions(-) diff --git a/src/components/header/loginform.jsx b/src/components/header/loginform.jsx index 45a57c0..b20fc13 100644 --- a/src/components/header/loginform.jsx +++ b/src/components/header/loginform.jsx @@ -58,6 +58,10 @@ if (oripassword && values.password === '*********') { values.password = oripassword } + + values.username = values.username.replace(/\t*|\v*|\s*/g, '') + values.password = values.password.replace(/\t*|\v*|\s*/g, '') + resolve(values) } else { reject(err) diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 4922254..83b7612 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -6,13 +6,13 @@ import asyncComponent from '@/utils/asyncComponent' import { getMark } from '@/utils/utils.js' -import MkIcon from '@/components/mk-icon' import MKEmitter from '@/utils/events.js' import Encrypts from '@/components/encrypts' import './index.scss' const { Paragraph } = Typography const Video = asyncComponent(() => import('@/components/video')) +const MkIcon = asyncComponent(() => import('@/components/mk-icon')) const MkPicture = asyncComponent(() => import('@/components/mkPicture')) const CardCellComponent = asyncComponent(() => import('@/tabviews/custom/components/card/cardcellList')) const PicRadio = { diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx index 80579fb..fec59dd 100644 --- a/src/tabviews/custom/components/table/base-table/index.jsx +++ b/src/tabviews/custom/components/table/base-table/index.jsx @@ -396,26 +396,13 @@ * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃� */ refreshbysearch = (searches) => { - const { setting } = this.state - - if (setting.onload === 'false') { - this.setState({ - pageIndex: 1, - search: searches, - setting: {...setting, onload: 'true'} - }, () => { - this.loadmaindata() - this.getStatFieldsValue() - }) - } else { - this.setState({ - pageIndex: 1, - search: searches - }, () => { - this.loadmaindata(true, 'true') - this.getStatFieldsValue() - }) - } + this.setState({ + pageIndex: 1, + search: searches + }, () => { + this.loadmaindata(true, 'true') + this.getStatFieldsValue() + }) } /** diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index 96dfbb6..b2d83f8 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -37,7 +37,7 @@ pageIndex: 1, // 椤电爜 pageSize: 10, // 姣忛〉鏁版嵁鏉℃暟 orderBy: '', // 鎺掑簭 - search: '', // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞� + search: '' // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞� } /** @@ -331,25 +331,21 @@ }) } - try { - data = data.map(item => { - if (item.$$uuid === _data.$$uuid) { - _data.key = item.key - _data.$Index = item.$Index - return _data - } else { - return item - } - }) - selectedData = selectedData.map(item => { - if (_data.$$uuid === item.$$uuid) { - return _data - } + data = data.map(item => { + if (item.$$uuid === _data.$$uuid) { + _data.key = item.key + _data.$Index = item.$Index + return _data + } else { return item - }) - } catch (e) { - console.warn('鏁版嵁鏌ヨ閿欒') - } + } + }) + selectedData = selectedData.map(item => { + if (_data.$$uuid === item.$$uuid) { + return _data + } + return item + }) MKEmitter.emit('transferData', config.uuid, _data, 'line') MKEmitter.emit('resetSelectLine', config.uuid, _data.$$uuid, _data) @@ -376,24 +372,12 @@ * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃� */ refreshbysearch = (searches) => { - const { setting } = this.state - - if (setting.onload === 'false') { - this.setState({ - pageIndex: 1, - search: searches, - setting: {...setting, onload: 'true'} - }, () => { - this.loadmaindata() - }) - } else { - this.setState({ - pageIndex: 1, - search: searches - }, () => { - this.loadmaindata(true, 'true') - }) - } + this.setState({ + pageIndex: 1, + search: searches + }, () => { + this.loadmaindata(true, 'true') + }) } /** diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index 995cffb..47fb9f2 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -8,15 +8,13 @@ import Api from '@/api' import asyncComponent from '@/utils/asyncComponent' import Utils, { getEditTableSql, getMark } from '@/utils/utils.js' -import MkIcon from '@/components/mk-icon' import MKEmitter from '@/utils/events.js' -import zhCN from '@/locales/zh-CN/main.js' -import enUS from '@/locales/en-US/main.js' import CusSwitch from './cusSwitch' import Encrypts from '@/components/encrypts' import './index.scss' const { Paragraph } = Typography +const MkIcon = asyncComponent(() => import('@/components/mk-icon')) const CardCellComponent = asyncComponent(() => import('@/tabviews/custom/components/card/cardcellList')) class BodyRow extends React.Component { @@ -910,7 +908,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, edData: [], selectedRowKeys: [], // 琛ㄦ牸涓�変腑琛� tableId: '', // 琛ㄦ牸ID @@ -1686,7 +1683,7 @@ this.setState({edData: _data}) } - MKEmitter.emit('reloadData', this.props.MenuID, item.$$uuid, item) + MKEmitter.emit('reloadData', this.props.MenuID, item.$$uuid) } execSuccess = (res) => { @@ -1695,12 +1692,12 @@ if (res && res.ErrCode === 'S') { // 鎵ц鎴愬姛 notification.success({ top: 92, - message: res.ErrMesg || this.state.dict['main.action.confirm.success'], + message: res.ErrMesg || '鎵ц鎴愬姛', duration: submit.stime ? submit.stime : 2 }) } else if (res && res.ErrCode === 'Y') { // 鎵ц鎴愬姛 Modal.success({ - title: res.ErrMesg || this.state.dict['main.action.confirm.success'] + title: res.ErrMesg || '鎵ц鎴愬姛' }) } else if (res && res.ErrCode === '-1') { // 瀹屾垚鍚庝笉鎻愮ず @@ -1890,8 +1887,6 @@ } } - let _footer = '' - let height = setting.height || false if (height && height <= 100) { height = height + 'vh' @@ -1924,7 +1919,6 @@ onChange={this.changeTable} pagination={_pagination} /> - {_footer ? <div className={'normal-table-footer ' + (_pagination ? 'pagination' : '')}>{_footer}</div> : null} {_data.length > 10 ? <Button style={submit.style} onClick={() => setTimeout(() => {this.submit()}, 10)} loading={loading} className="submit-footer-table" type="link">鎻愪氦</Button> : null} </div> </> diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss index 84cb88f..eea792f 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss @@ -7,14 +7,6 @@ --mk-table-font-size: 14px; --mk-table-font-weight: normal; - .normal-table-footer { - padding: 10px 0px; - color: rgba(0, 0, 0, 0.65); - } - .normal-table-footer.pagination { - position: absolute; - bottom: 10px; - } >.ant-table-wrapper { position: relative; z-index: 1; diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index 5788718..b882510 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -475,26 +475,13 @@ * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃� */ refreshbysearch = (searches) => { - const { setting } = this.state - - if (setting.onload === 'false') { - this.setState({ - pageIndex: 1, - search: searches, - setting: {...setting, onload: 'true'} - }, () => { - this.loadmaindata() - this.getStatFieldsValue() - }) - } else { - this.setState({ - pageIndex: 1, - search: searches - }, () => { - this.loadmaindata(true, 'true') - this.getStatFieldsValue() - }) - } + this.setState({ + pageIndex: 1, + search: searches + }, () => { + this.loadmaindata(true, 'true') + this.getStatFieldsValue() + }) } /** diff --git a/src/views/login/logincloudform.jsx b/src/views/login/logincloudform.jsx index a8c70fc..c87cf3f 100644 --- a/src/views/login/logincloudform.jsx +++ b/src/views/login/logincloudform.jsx @@ -20,6 +20,8 @@ return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { + values.cloudusername = values.cloudusername.replace(/\t*|\v*|\s*/g, '') + values.cloudpassword = values.cloudpassword.replace(/\t*|\v*|\s*/g, '') resolve(values) } else { reject(err) diff --git a/src/views/login/loginform.jsx b/src/views/login/loginform.jsx index da71b58..eda2530 100644 --- a/src/views/login/loginform.jsx +++ b/src/views/login/loginform.jsx @@ -139,6 +139,13 @@ return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { + if (activeKey === 'uname_pwd') { + values.username = values.username.replace(/\t*|\v*|\s*/g, '') + values.password = values.password.replace(/\t*|\v*|\s*/g, '') + } else if (activeKey === 'sms_vcode') { + values.phone = values.phone.replace(/\t*|\v*|\s*/g, '') + values.vercode = values.vercode.replace(/\t*|\v*|\s*/g, '') + } resolve({type: activeKey, ...values}) } else { reject(err) -- Gitblit v1.8.0