Commit 69de021bcd6f780cf4c1da384c1f62b7ec7e76ee

Authored by 陈鑫涛
1 parent 559b4992

新增手机端

Showing 52 changed files with 220 additions and 195 deletions
package.json
... ... @@ -30,6 +30,7 @@
30 30 "lodash-decorators": "^6.0.1",
31 31 "moment": "^2.30.1",
32 32 "numeral": "^2.0.6",
  33 + "rc-form": "2.4.11",
33 34 "react-dnd": "^14.0.5",
34 35 "react-dnd-html5-backend": "^14.1.0",
35 36 "react-draggable": "4.4.5",
... ... @@ -41,7 +42,8 @@
41 42 "react-resizable": "^3.0.5",
42 43 "react-sortable-hoc": "^2.0.0",
43 44 "react-to-print": "^3.0.5",
44   - "umi": "^4.4.11"
  45 + "umi": "^4.4.11",
  46 + "weixin-js-sdk": "1.6.0"
45 47 },
46 48 "devDependencies": {
47 49 "@types/react": "^18.0.33",
... ...
src/components/Common/BoxShowImgMaterial/indexNew.js
... ... @@ -170,7 +170,7 @@ const BoxShowImgMaterial = props => {
170 170 ).toFixed(2);
171 171 useEffect(
172 172 () => {
173   - setBoxKey(new Date().getTime());
  173 + // setBoxKey(new Date().getTime());
174 174 setTimeout(() => {
175 175 // if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current)
176 176 if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) {
... ...
src/components/Common/PrintPdf/PreviewPdf.js
1 1 /* eslint-disable prefer-destructuring */
2 2 /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */
3 3 import React from 'react';
4   -import { InputItem, Icon } from 'antd-mobile';
  4 +import { InputItem, Icon } from 'antd-mobile-v2';
5 5 import { Document, Page, pdfjs } from 'react-pdf';
6 6 import 'antd-mobile-v2/dist/antd-mobile.css';
7 7 import pdfstyles from './printpdf.less';
... ...
src/components/Common/Typesetting/typesetting.js
... ... @@ -417,7 +417,7 @@ const Typesetting = props => {
417 417 useEffect(
418 418 () => {
419 419 // 计算缩放比例
420   - setBoxKey(new Date().getTime());
  420 + // setBoxKey(new Date().getTime());
421 421 setTimeout(() => {
422 422 const scaleX = (clientWidth - 50) / (outerWidth + 110);
423 423 const scaleY = (clientHeight - 5) / (outerHeight + 90);
... ... @@ -482,10 +482,11 @@ const Typesetting = props => {
482 482 if (propsData && L) {
483 483 const sMaterialsName = slaveData.find(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel).sMaterialsName;
484 484 const propsDataLeft = Number(propsData.props.style.left.slice(0, -2));
  485 + // 长需要找出最大的
485 486 const propsDataWidth = Number(propsData.props.style.width.slice(0, -2));
486 487 const propsDataHeight = Number(propsData.props.style.height.slice(0, -2));
487 488 const propsDataTop = Number(propsData.props.style.top.slice(0, -2));
488   - const newMaterialLength = propsDataLeft + propsDataWidth; // 原纸长
  489 + const newMaterialLength = propsDataLeft + innerWidthCombined; // 原纸长
489 490 const newMaterialWidth = propsDataTop + propsDataHeight - dSBLB;
490 491 // 计算开数
491 492 const dSinglePQty = variables
... ... @@ -557,12 +558,11 @@ const Typesetting = props => {
557 558 }, 0); // 使用 0 延迟,将任务放入事件队列
558 559 }
559 560 const isMax = slaveDataDetail?.dMaxLength && Number(slaveDataDetail?.dMaxLength) >= Number(slaveRowData?.dMachineLength);
560   - console.log("🚀 ~ isMax:", isMax,slaveDataDetail?.dMaxLength,slaveRowData?.dMachineLength)
561 561 const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length;
562 562  
563 563 const onClick = () => {
564 564 setIsModalOpen(true);
565   - setBoxKeys(new Date().getTime());
  565 + // setBoxKeys(new Date().getTime());
566 566 setTimeout(() => {
567 567 const scaleX = 1200 / outerWidth;
568 568 const scaleY = 500 / outerHeight;
... ...
src/components/Common/commonBusiness.js
... ... @@ -3,7 +3,7 @@
3 3 */
4 4 /* eslint-disable */
5 5 import { Modal } from 'antd-v4';
6   -import { Modal as mobileModal } from 'antd-mobile';
  6 +import { Modal as mobileModal } from 'antd-mobile-v2';
7 7  
8 8 import { message } from '@/utils/common/message';
9 9 import moment from 'moment';
... ...
src/components/Common/commonBusiness1.js
... ... @@ -3,7 +3,7 @@
3 3 */
4 4 /* eslint-disable */
5 5 import { Modal } from 'antd';
6   -import { Modal as mobileModal } from 'antd-mobile';
  6 +import { Modal as mobileModal } from 'antd-mobile-v2';
7 7  
8 8 import { message } from '@/utils/common/message';
9 9 import moment from 'moment';
... ...
src/components/PrintPdf/PreviewPdf.js
1 1 /* eslint-disable prefer-destructuring */
2 2 /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */
3 3 import React from 'react';
4   -import { InputItem, Icon } from 'antd-mobile';
  4 +import { InputItem, Icon } from 'antd-mobile-v2';
5 5 import { Document, Page, pdfjs } from 'react-pdf';
6 6 import 'antd-mobile-v2/dist/antd-mobile.css';
7 7 import * as commonUtils from '@/utils/utils';
... ...
src/mobile/common/CommobileBase.js
... ... @@ -5,7 +5,7 @@
5 5  
6 6 import React, { Component } from 'react';
7 7 import moment from 'moment';
8   -import { Modal, Toast } from 'antd-mobile';
  8 +import { Modal, Toast } from 'antd-mobile-v2';
9 9 import { addResult } from '@/utils/common/calcuate';
10 10 import commonConfig from '../../utils/config';
11 11 import * as commonUtils from '../../utils/utils';
... ...
src/mobile/common/CommobileBill.js
1 1 /* eslint-disable */
2 2 import React from 'react';
3 3 import weixin from 'weixin-js-sdk';
4   -import { Flex, Button, ListView, Toast } from 'antd-mobile';
  4 +import { Flex, Button, ListView, Toast } from 'antd-mobile-v2';
5 5 import { createForm } from 'rc-form';
6 6 import 'antd-mobile-v2/dist/antd-mobile.css';
7 7 import CommobileBase from './CommobileBase';
... ...
src/mobile/common/CommobileBillEvent.js
... ... @@ -4,7 +4,7 @@
4 4 * Created by mar105 on 2019-01-08.
5 5 */
6 6 import React, { Component } from 'react';
7   -import { Toast } from 'antd-mobile';
  7 +import { Toast } from 'antd-mobile-v2';
8 8 import * as commonUtils from '../../utils/utils';
9 9 import * as commonFunc from '../../components/Common/commonFunc';
10 10 import * as commonBusiness from '../../components/Common/commonBusiness';
... ...
src/mobile/common/CommobileClassifyEvent.js
1 1 /* eslint-disable array-callback-return,no-undef,prefer-destructuring */
2 2 import React, { Component } from 'react';
3   -import { Modal } from 'antd-mobile';
  3 +import { Modal } from 'antd-mobile-v2';
4 4 import * as commonUtils from '../../utils/utils'; /* 通用方法 */
5 5 import commonConfig from '../../utils/config';
6 6 import * as commonServices from '../../services/services';
... ...
src/mobile/common/CommobileComponent.js
1 1 /* eslint-disable */
2   -import { List, InputItem, Picker, TextareaItem, DatePicker, Checkbox, Toast } from 'antd-mobile';
  2 +import { List, InputItem, Picker, TextareaItem, DatePicker, Checkbox, Toast } from 'antd-mobile-v2';
3 3 import moment from 'moment';
4 4 import React, { Component } from 'react';
5 5 import { debounce } from 'lodash';
... ...
src/mobile/common/CommobileList.js
... ... @@ -2,7 +2,7 @@
2 2 /* eslint-disable prefer-destructuring */
3 3 /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */
4 4 import React from 'react';
5   -import { ListView, Checkbox, Modal, Toast, Flex } from 'antd-mobile';
  5 +import { ListView, Checkbox, Modal, Toast, Flex } from 'antd-mobile-v2';
6 6 import { createForm } from 'rc-form';
7 7 import 'antd-mobile-v2/dist/antd-mobile.css';
8 8 import commonConfig from '../../utils/config';
... ...
src/mobile/common/CommobileListEvent.js
... ... @@ -3,7 +3,7 @@
3 3 * Created by mar105 on 2019-03-27.
4 4 */
5 5 import React, { Component } from 'react';
6   -import { Toast, Modal, TextareaItem, List } from 'antd-mobile';
  6 +import { Toast, Modal, TextareaItem, List } from 'antd-mobile-v2';
7 7 import { history } from 'umi';
8 8 import * as commonUtils from '../../utils/utils'; /* 通用方法 */
9 9 import commonConfig from '../../utils/config';
... ...
src/mobile/common/CommobileModalList.jsx
... ... @@ -3,7 +3,7 @@ import React, { PureComponent } from 'react';
3 3 import { createForm } from 'rc-form';
4 4 import CommobileBase from '../../mobile/common/CommobileBase';
5 5 import CommobileListEvent from './CommobileListEvent';
6   -import { Checkbox, ListView, TextareaItem } from 'antd-mobile';
  6 +import { Checkbox, ListView, TextareaItem } from 'antd-mobile-v2';
7 7 import * as commonUtils from '../../utils/utils';
8 8  
9 9  
... ...
src/mobile/common/CommobilePrintPdf.js
1 1 /* eslint-disable prefer-destructuring */
2 2 /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */
3 3 import React from 'react';
4   -import { InputItem, Icon } from 'antd-mobile';
  4 +import { InputItem, Icon } from 'antd-mobile-v2';
5 5 import { Document, Page, pdfjs } from 'react-pdf';
6 6 import 'antd-mobile-v2/dist/antd-mobile.css';
7 7 import * as commonUtils from '../../utils/utils';
... ...
src/mobile/common/CommobileSearchComponent.js
... ... @@ -2,7 +2,7 @@
2 2 /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */
3 3 import React from 'react';
4 4 import weixin from 'weixin-js-sdk';
5   -import { Tabs, Badge, SearchBar, Modal, Button, Menu, ActivityIndicator, Flex, WhiteSpace, Toast, List } from 'antd-mobile';
  5 +import { Tabs, Badge, SearchBar, Modal, Button, Menu, ActivityIndicator, Flex, WhiteSpace, Toast, List } from 'antd-mobile-v2';
6 6 import 'antd-mobile-v2/dist/antd-mobile.css';
7 7 import styles from '.././mobile.less';
8 8 import commonConfig from '../../utils/config';
... ...
src/mobile/common/CommobileStep.js
1 1 /* eslint-disable prefer-destructuring */
2 2 /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */
3 3 import React from 'react';
4   -import { Steps } from 'antd-mobile';
  4 +import { Steps } from 'antd-mobile-v2';
5 5 import 'antd-mobile-v2/dist/antd-mobile.css';
6 6 import CommobileBase from '../../mobile/common/CommobileBase';
7 7 import CommobileListEvent from './CommobileListEvent';
... ...
src/mobile/common/CommobileSubBill.js
1 1 /* eslint-disable */
2 2 import React from 'react';
3 3 import weixin from 'weixin-js-sdk';
4   -import { Flex, Button, ListView, Toast, Tabs, Badge, Modal} from 'antd-mobile';
  4 +import { Flex, Button, ListView, Toast, Tabs, Badge, Modal} from 'antd-mobile-v2';
5 5 import { createForm } from 'rc-form';
6 6 import 'antd-mobile-v2/dist/antd-mobile.css';
7 7 import CommobileBase from './CommobileBase';
... ...
src/mobile/common/CommobileSubBillEvent.js
... ... @@ -4,7 +4,7 @@
4 4 * Created by mar105 on 2019-01-08.
5 5 */
6 6 import React, { Component } from 'react';
7   -import { Toast,Modal } from 'antd-mobile';
  7 +import { Toast,Modal } from 'antd-mobile-v2';
8 8 import * as commonUtils from '../../utils/utils';
9 9 import * as commonFunc from '../../components/Common/commonFunc';
10 10 import * as commonBusiness from '../../components/Common/commonBusiness';
... ...
src/mobile/common/CommobileTabBill.js
1 1 /* eslint-disable */
2 2 import React from 'react';
3 3 import weixin from 'weixin-js-sdk';
4   -import { Flex, Button, ListView, Toast, Tabs, Badge,} from 'antd-mobile';
  4 +import { Flex, Button, ListView, Toast, Tabs, Badge,} from 'antd-mobile-v2';
5 5 import { createForm } from 'rc-form';
6 6 import 'antd-mobile-v2/dist/antd-mobile.css';
7 7 import CommobileBase from './CommobileBase';
... ...
src/mobile/common/CommobileToolBar.js
1 1 /* eslint-disable */
2 2 import React, { Component } from 'react';
3   -import { Button, Toast } from 'antd-mobile';
  3 +import { Button, Toast } from 'antd-mobile-v2';
4 4 import * as commonUtils from '../../utils/utils';
5 5 import commonConfig from '../../utils/config';
6 6 import * as commonServices from '../../services/services';
... ...
src/mobile/common/CommobileView.js
... ... @@ -3,7 +3,7 @@
3 3 */
4 4 /* eslint-disable object-curly-newline,prefer-destructuring */
5 5 import React, { Component } from 'react';
6   -import { List } from 'antd-mobile';
  6 +import { List } from 'antd-mobile-v2';
7 7 import ShowType from './CommobileComponent';
8 8 import * as commonUtils from '../../utils/utils'; /* 通用方法 */
9 9  
... ...
src/mobile/common/CommobileViewMaster.js
... ... @@ -3,7 +3,7 @@
3 3 */
4 4 /* eslint-disable object-curly-newline,prefer-destructuring */
5 5 import React, { Component } from 'react';
6   -import { List, Flex } from 'antd-mobile';
  6 +import { List, Flex } from 'antd-mobile-v2';
7 7 import ShowType from './CommobileComponent';
8 8 import * as commonUtils from '../../utils/utils';
9 9 import styles from '../mobile.less'; /* 通用方法 */
... ...
src/mobile/common/CommobileViewSlave.js
... ... @@ -3,7 +3,7 @@
3 3 */
4 4 /* eslint-disable object-curly-newline,prefer-destructuring */
5 5 import React, { Component } from 'react';
6   -import { List } from 'antd-mobile';
  6 +import { List } from 'antd-mobile-v2';
7 7 import ShowType from './CommobileComponent';
8 8 import * as commonUtils from '../../utils/utils';
9 9 import styles from '../mobile.less'; /* 通用方法 */
... ...
src/mobile/common/ContactsInfoMobile.js
1 1 import React from 'react';
2   -import { Grid, Result } from 'antd-mobile';
  2 +import { Grid, Result } from 'antd-mobile-v2';
3 3 import { createForm } from 'rc-form';
4 4 import 'antd-mobile-v2/dist/antd-mobile.css';
5 5 import styles from '../mobile.less';
... ...
src/mobile/common/ContactsMobile.js
1 1 import React from 'react';
2   -import { ListView } from 'antd-mobile';
  2 +import { ListView } from 'antd-mobile-v2';
3 3 import styles from '../mobile.less';
4 4 // eslint-disable-next-line import/first
5 5 import 'antd-mobile-v2/dist/antd-mobile.css';
... ...
src/mobile/common/DeviceMobile.js
1 1 /* eslint-disable prefer-destructuring */
2 2 /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */
3 3 import React from 'react';
4   -import { Tabs, Badge, SearchBar, ListView, Modal, List, Button } from 'antd-mobile';
  4 +import { Tabs, Badge, SearchBar, ListView, Modal, List, Button } from 'antd-mobile-v2';
5 5 import 'antd-mobile-v2/dist/antd-mobile.css';
6 6 import styles from '.././mobile.less';
7 7 import commonConfig from '../../utils/config';
... ...
src/mobile/common/ExamineMobile.js
1 1 /* eslint-disable */
2 2 import React from 'react';
3   -import { Flex, Button, ListView, Toast, TextareaItem, Steps, WhiteSpace, WingBlank } from 'antd-mobile';
  3 +import { Flex, Button, ListView, Toast, TextareaItem, Steps, WhiteSpace, WingBlank } from 'antd-mobile-v2';
4 4 import { DownlandOutline, ArrowDownCircleOutline, CheckCircleFill, ClockCircleFill, HandPayCircleOutline, InformationCircleOutline, } from 'antd-mobile-icons'
5 5 import { Space, Dropdown, Menu } from 'antd';
6 6 import { createForm } from 'rc-form';
... ...
src/mobile/common/ExamineMobile1.js
1 1 import React from 'react';
2   -import { Button, Card, TextareaItem, WhiteSpace, WingBlank, ListView } from 'antd-mobile';
  2 +import { Button, Card, TextareaItem, WhiteSpace, WingBlank, ListView } from 'antd-mobile-v2';
3 3 // import { createForm } from 'rc-form';
4 4 import 'antd-mobile-v2/dist/antd-mobile.css';
5 5 import CommobileBase from './CommobileBase';
... ...
src/mobile/common/MessageMobile.js
1 1 import React from 'react';
2 2 // eslint-disable-next-line no-unused-vars
3   -import { Tabs, Badge, ListView, SearchBar } from 'antd-mobile';
4   -import 'antd-mobile-v2/dist/antd-mobile.css';
  3 +import { Tabs, Badge, ListView, SearchBar } from 'antd-mobile-v2';
  4 +import 'antd-mobile/dist/antd-mobile.css';
5 5 // import ExamineMobile from './ExamineMobile';
6 6 import commonConfig from '../../utils/config';
7 7 import * as commonUtils from '../../utils/utils';
... ...
src/mobile/common/MyselfMobile.js
1 1 import React from 'react';
2   -import { Button, List } from 'antd-mobile';
  2 +import { Button, List } from 'antd-mobile-v2';
3 3 import 'antd-mobile-v2/dist/antd-mobile.css';
4 4 // import ExamineMobile from './ExamineMobile';
5 5 import commonConfig from '../../utils/config';
... ...
src/mobile/common/ProcessReportMobile.js
1 1 import React from 'react';
2   -import { Flex, Button, ListView, Toast } from 'antd-mobile';
  2 +import { Flex, Button, ListView, Toast } from 'antd-mobile-v2';
3 3 import { createForm } from 'rc-form';
4 4 import 'antd-mobile-v2/dist/antd-mobile.css';
5 5 import CommobileBase from './CommobileBase';
... ...
src/mobile/common/RevisePasswordMobile.js
1 1 import React from 'react';
2   -import { List, InputItem, NavBar, Toast } from 'antd-mobile';
  2 +import { List, InputItem, NavBar, Toast } from 'antd-mobile-v2';
3 3 import { createForm } from 'rc-form';
4 4 import 'antd-mobile-v2/dist/antd-mobile.css';
5 5 // import ExamineMobile from './ExamineMobile';
... ...
src/mobile/common/SceneCssMobile.js
1 1 import React from 'react';
2   -import { Grid, Toast } from 'antd-mobile';
  2 +import { Grid, Toast } from 'antd-mobile-v2';
3 3 import 'antd-mobile-v2/dist/antd-mobile.css';
4 4 import styles from './SceneMobile.less';
5 5 // eslint-disable-next-line import/first
... ...
src/mobile/common/SceneMobile.js
1 1 import React from 'react';
2   -import { Button, Grid, Toast } from 'antd-mobile';
  2 +import { Button, Grid, Toast } from 'antd-mobile-v2';
3 3 import 'antd-mobile-v2/dist/antd-mobile.css';
4 4 import styles from './SceneMobile.less';
5 5 // eslint-disable-next-line import/first
... ...
src/mobile/common/SceneSrmMobile.js
1 1 import React from 'react';
2   -import { Grid, Toast } from 'antd-mobile';
  2 +import { Grid, Toast } from 'antd-mobile-v2';
3 3 import 'antd-mobile-v2/dist/antd-mobile.css';
4 4 import styles from './SceneMobile.less';
5 5 // eslint-disable-next-line import/first
... ...
src/mobile/common/WorkBenchMobile.js
1 1 import React from 'react';
2   -import { Grid, Toast } from 'antd-mobile';
  2 +import { Grid, Toast } from 'antd-mobile-v2';
3 3 import 'antd-mobile-v2/dist/antd-mobile.css';
4 4 import styles from './SceneMobile.less';
5 5 import commonConfig from '../../utils/config';
... ...
src/mobile/components/FileManageMobile.js
1 1 /* eslint-disable prefer-destructuring */
2 2 /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */
3 3 import React from 'react';
4   -import { Button, Modal } from 'antd-mobile';
  4 +import { Button, Modal } from 'antd-mobile-v2';
5 5 import 'antd-mobile-v2/dist/antd-mobile.css';
6 6 import * as commonUtils from '../../utils/utils';
7 7 import CommobileClassifyEvent from '../common/CommobileClassifyEvent';
... ...
src/mobile/components/FileManageMobileWx.js
... ... @@ -2,7 +2,7 @@
2 2 /* eslint-disable prefer-destructuring */
3 3 /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */
4 4 import React from 'react';
5   -import { Button, Toast } from 'antd-mobile';
  5 +import { Button, Toast } from 'antd-mobile-v2';
6 6 import 'antd-mobile-v2/dist/antd-mobile.css';
7 7 import weixin from 'weixin-js-sdk';
8 8 import logo from '@/assets/footer_logo.png';
... ...
src/mobile/components/FileShowMobile.js
... ... @@ -2,7 +2,7 @@
2 2 /* eslint-disable prefer-destructuring */
3 3 /* eslint no-dupe-keys: 0, no-mixed-operators: 0 */
4 4 import React from 'react';
5   -import { Button, Modal } from 'antd-mobile';
  5 +import { Button, Modal } from 'antd-mobile-v2';
6 6 import 'antd-mobile-v2/dist/antd-mobile.css';
7 7 import * as commonUtils from '../../utils/utils';
8 8 import CommobileClassifyEvent from '../common/CommobileClassifyEvent';
... ...
src/mobile/components/modal.jsx
1 1 /*eslint-disable*/
2 2 import React, { PureComponent } from 'react';
3   -import { Modal } from 'antd-mobile';
  3 +import { Modal } from 'antd-mobile-v2';
4 4  
5 5 export default class ModalBase extends PureComponent {
6 6 state = {
... ...
src/mobile/components/preView.js
1 1 import React from 'react';
2   -import { Carousel, Modal } from 'antd-mobile';
  2 +import { Carousel, Modal } from 'antd-mobile-v2';
3 3 import styles from './preView.less';
4 4  
5 5 /**
... ...
src/mobile/login/LoginMobile.js
... ... @@ -146,6 +146,8 @@ class LoginMobile extends React.Component {
146 146 type: 'loginMobile/login',
147 147 payload: { ...param, dispatch },
148 148 });
  149 + console.log('登录成功',param,dispatch);
  150 +
149 151 } else {
150 152 Toast.fail(dataReturn.msg);
151 153 }
... ...
src/mobile/logincss/LoginCss.js
1 1 import React from 'react';
2 2 import { createForm } from 'rc-form';
3   -import { InputItem, Button, WhiteSpace, Toast, Modal, Picker, List } from 'antd-mobile';
  3 +import { InputItem, Button, WhiteSpace, Toast, Modal, Picker, List } from 'antd-mobile-v2';
4 4 import 'antd-mobile-v2/dist/antd-mobile.css';
5 5 import styles from './LoginCss.less';
6 6 import LoginIcon from '../../assets/mobile/logoCss.png';
... ...
src/mobile/loginsrm/LoginSrm.js
1 1 import React from 'react';
2 2 import { createForm } from 'rc-form';
3   -import { InputItem, Button, WhiteSpace, Toast, Modal, Picker, List } from 'antd-mobile';
  3 +import { InputItem, Button, WhiteSpace, Toast, Modal, Picker, List } from 'antd-mobile-v2';
4 4 import 'antd-mobile-v2/dist/antd-mobile.css';
5 5 import styles from './LoginSrm.less';
6 6 import LoginIcon from '../../assets/mobile/logoSrm.png';
... ...
src/models/app.js
... ... @@ -3,7 +3,7 @@ import config from '../utils/config';
3 3 import * as utils from '../utils/utils';
4 4 import * as services from '../services/services';
5 5 import { message, notification, Modal } from 'antd-v4';
6   -// import { Toast } from 'antd-mobile';
  6 +// import { Toast } from 'antd-mobile-v2';
7 7 import * as commonFunc from '../components/Common/commonFunc';/* 通用单据方法 */
8 8  
9 9 const { confirm } = Modal;
... ...
src/routes/mobile/IndexCssMobile.js
1 1 /* eslint-disable */
2 2 import React from 'react';
3 3 import 'antd-mobile-v2/dist/antd-mobile.css';
4   -import { Icon, NavBar, TabBar, Modal } from 'antd-mobile';
5   -import { connect,history } from 'umi';
  4 +import { Icon, NavBar, TabBar, Modal } from 'antd-mobile-v2';
  5 +// import { history } from 'dva/router';
  6 +import { connect,history } from 'umi';
6 7  
7 8 import styles from './IndexMobile.less';
8 9 import SceneCssMobile from './common/SceneCssMobile';
... ...
src/routes/mobile/IndexMobile.js
1   -import React from 'react';
2   -import 'antd-mobile-v2/dist/antd-mobile.css';
3   -import { Icon, NavBar, TabBar, Modal } from 'antd-mobile-v2';
4   -import { connect,history } from 'umi';
  1 +import React from "react";
  2 +import "antd-mobile-v2/dist/antd-mobile.css";
  3 +import { Icon, NavBar, TabBar, Modal } from "antd-mobile-v2";
  4 +// import { history } from 'dva/router';
  5 +import { connect, history } from "umi";
5 6  
6   -import * as commonUtils from '@/utils/utils';
7   -import styles from './IndexMobile.less';
8   -import SceneMobile from './common/SceneMobile';
9   -import MessageMobile from './common/MessageMobile';
10   -import ContactsMobile from './common/ContactsMobile';
11   -import WorkBenchMobile from './common/WorkBenchMobile';
12   -import CommobileList from './commobileList/commobileList';
13   -import ProcessReportMobile from './common/ProcessReportMobile';
14   -import MyselfMobile from './common/MyselfMobile';
15   -import ContactsInfoMobile from './common/ContactsInfoMobile';
16   -import RevisePasswordMobile from './common/RevisePasswordMobile';
17   -import CommobileBill from './common/commobileBill';
18   -import CommobilePrintPdf from './common/commobilePrintPdf';
19   -import ExamineMobile from './common/ExamineMobile';
20   -import Icon1 from '../../assets/mobile/1.png';
21   -import Icon11 from '../../assets/mobile/11.png';
22   -import Icon2 from '../../assets/mobile/2.png';
23   -import Icon21 from '../../assets/mobile/21.png';
24   -import Icon3 from '../../assets/mobile/3.png';
25   -import Icon31 from '../../assets/mobile/31.png';
  7 +import * as commonUtils from "@/utils/utils";
  8 +import styles from "./IndexMobile.less";
  9 +import SceneMobile from "./common/SceneMobile";
  10 +import MessageMobile from "./common/MessageMobile";
  11 +import ContactsMobile from "./common/ContactsMobile";
  12 +import WorkBenchMobile from "./common/WorkBenchMobile";
  13 +import CommobileList from "./commobileList/commobileList";
  14 +import ProcessReportMobile from "./common/ProcessReportMobile";
  15 +import MyselfMobile from "./common/MyselfMobile";
  16 +import ContactsInfoMobile from "./common/ContactsInfoMobile";
  17 +import RevisePasswordMobile from "./common/RevisePasswordMobile";
  18 +import CommobileBill from "./common/commobileBill";
  19 +import CommobilePrintPdf from "./common/commobilePrintPdf";
  20 +import ExamineMobile from "./common/ExamineMobile";
  21 +import Icon1 from "../../assets/mobile/1.png";
  22 +import Icon11 from "../../assets/mobile/11.png";
  23 +import Icon2 from "../../assets/mobile/2.png";
  24 +import Icon21 from "../../assets/mobile/21.png";
  25 +import Icon3 from "../../assets/mobile/3.png";
  26 +import Icon31 from "../../assets/mobile/31.png";
26 27 // import Icon4 from '../../assets/mobile/4.png';
27 28 // import Icon41 from '../../assets/mobile/41.png';
28   -import Icon5 from '../../assets/mobile/5.png';
29   -import Icon51 from '../../assets/mobile/51.png';
  29 +import Icon5 from "../../assets/mobile/5.png";
  30 +import Icon51 from "../../assets/mobile/51.png";
30 31 // import AppUtil from '../../utils/AppUtil';
31   -import * as commonBusiness from '../../components/Common/commonBusiness';
  32 +import * as commonBusiness from "../../components/Common/commonBusiness";
32 33  
33 34 // eslint-disable-next-line prefer-destructuring
34 35 const alert = Modal.alert;
... ... @@ -36,8 +37,8 @@ class IndexMobile extends React.Component {
36 37 constructor(props) {
37 38 super(props);
38 39 this.state = {
39   - selectedTab: 'scene',
40   - title: '现场',
  40 + selectedTab: "scene",
  41 + title: "现场",
41 42 hidden: false,
42 43 fullScreen: true,
43 44 touchStartPageX: 0, // 滑动开始的Y坐标
... ... @@ -45,13 +46,13 @@ class IndexMobile extends React.Component {
45 46 };
46 47 }
47 48 componentWillMount() {
48   - this.props.dispatch(history.push('/indexMobile')); // 刷新时更新路由,避免底部按钮和返回按钮错乱显示
  49 + this.props.dispatch(history.push("/indexMobile")); // 刷新时更新路由,避免底部按钮和返回按钮错乱显示
49 50 if (this.props.routing && this.props.routing) {
50 51 const { state } = this.props.routing;
51 52 if (state) {
52 53 const { sId } = state;
53   - if (sId === 'myself') {
54   - this.setState({ selectedTab: 'myself' });
  54 + if (sId === "myself") {
  55 + this.setState({ selectedTab: "myself" });
55 56 // this.renderContent('contacts');
56 57 }
57 58 }
... ... @@ -63,50 +64,51 @@ class IndexMobile extends React.Component {
63 64 componentDidUpdate(prevProps) {
64 65 /* eslint-disable */
65 66 if (prevProps?.location.state !== this.props.location.state) {
66   - const originTitle = ({
67   - message: '消息',
68   - scene: '现场',
69   - workbench: '工作台',
70   - device: '设备',
71   - myself: '我的',
72   - })[this.state.selectedTab];
73   -
  67 + const originTitle = {
  68 + message: "消息",
  69 + scene: "现场",
  70 + workbench: "工作台",
  71 + device: "设备",
  72 + myself: "我的",
  73 + }[this.state.selectedTab];
  74 +
74 75 try {
75   - const path = JSON.parse(this.props.location.state || '{}');
  76 + const path = JSON.parse(this.props.location.state || "{}");
76 77 this.setState({ title: path.title || originTitle });
77   - } catch (error) {
  78 + } catch (error) {
78 79 this.setState({ title: originTitle });
79 80 }
80 81 }
81 82 }
82 83  
83   - handleTouchStart = (e) => {
  84 + handleTouchStart = e => {
84 85 this.setState({
85 86 touchStartPageX: e.changedTouches[0].pageX,
86 87 touchStartPageY: e.changedTouches[0].pageY,
87 88 });
88   - }
  89 + };
89 90  
90   - handleTouchEnd = (e) => {
  91 + handleTouchEnd = e => {
91 92 const touchEndtPageX = e.changedTouches[0].pageX;
92 93 const touchEndtPageY = e.changedTouches[0].pageY;
93 94 const touchDireactionX = touchEndtPageX - this.state.touchStartPageX; // 滑动横向坐标
94 95 const touchDireactionY = touchEndtPageY - this.state.touchStartPageY; // 滑动横向坐标
95   - if (touchDireactionX > 100 && touchDireactionY > -80) { // 滑动一定距离
  96 + if (touchDireactionX > 100 && touchDireactionY > -80) {
  97 + // 滑动一定距离
96 98 const { plus } = window;
97   - if (location.pathname === '/indexMobile') {
98   - alert('确定退出吗?', '', [
99   - { text: '取消', onPress: () => {} },
100   - { text: '是', onPress: () => plus.runtime.quit() }, // 关闭app
  99 + if (location.pathname === "/indexMobile") {
  100 + alert("确定退出吗?", "", [
  101 + { text: "取消", onPress: () => {} },
  102 + { text: "是", onPress: () => plus.runtime.quit() }, // 关闭app
101 103 ]);
102 104 } else {
103 105 window.history.back(-1);
104 106 }
105 107 }
106   - }
  108 + };
107 109 renderContent(pageText) {
108   - if (pageText === 'message') {
109   - if (location.pathname === '/indexMobile/examine') {
  110 + if (pageText === "message") {
  111 + if (location.pathname === "/indexMobile/examine") {
110 112 return (
111 113 <div className={styles.demoContainer}>
112 114 <ExamineMobile {...this.props} />
... ... @@ -119,26 +121,26 @@ class IndexMobile extends React.Component {
119 121 </div>
120 122 );
121 123 }
122   - } else if (pageText === 'scene') {
123   - if (location.pathname === '/indexMobile/commobileList') {
  124 + } else if (pageText === "scene") {
  125 + if (location.pathname === "/indexMobile/commobileList") {
124 126 return (
125 127 <div className={styles.demoContainer}>
126 128 <CommobileList {...this.props} />
127 129 </div>
128 130 );
129   - } else if (location.pathname === '/indexMobile/printPdf') {
  131 + } else if (location.pathname === "/indexMobile/printPdf") {
130 132 return (
131 133 <div className={styles.demoContainer}>
132 134 <CommobilePrintPdf {...this.props} />
133 135 </div>
134 136 );
135   - } else if (location.pathname === '/indexMobile/processReport') {
  137 + } else if (location.pathname === "/indexMobile/processReport") {
136 138 return (
137 139 <div className={styles.demoContainer}>
138 140 <ProcessReportMobile {...this.props} />
139 141 </div>
140 142 );
141   - } else if (location.pathname === '/indexMobile/commobileBill') {
  143 + } else if (location.pathname === "/indexMobile/commobileBill") {
142 144 return (
143 145 <div className={styles.demoContainer}>
144 146 <CommobileBill {...this.props} />
... ... @@ -152,14 +154,14 @@ class IndexMobile extends React.Component {
152 154 </div>
153 155 );
154 156 }
155   - } else if (pageText === 'workbench') {
156   - if (location.pathname === '/indexMobile/commobileList') {
  157 + } else if (pageText === "workbench") {
  158 + if (location.pathname === "/indexMobile/commobileList") {
157 159 return (
158 160 <div className={styles.demoContainer}>
159 161 <CommobileList {...this.props} />
160 162 </div>
161 163 );
162   - } else if (location.pathname === '/indexMobile/commobileBill') {
  164 + } else if (location.pathname === "/indexMobile/commobileBill") {
163 165 return (
164 166 <div className={styles.demoContainer}>
165 167 <CommobileBill {...this.props} />
... ... @@ -172,24 +174,22 @@ class IndexMobile extends React.Component {
172 174 </div>
173 175 );
174 176 }
175   - } else if (pageText === 'device') {
176   - return (
177   - <CommobileList {...this.props} sModelsId="101251240115015888433389260" />
178   - );
179   - } else if (pageText === 'myself') {
180   - if (location.pathname === '/indexMobile/contacts') {
  177 + } else if (pageText === "device") {
  178 + return <CommobileList {...this.props} sModelsId="101251240115015888433389260" />;
  179 + } else if (pageText === "myself") {
  180 + if (location.pathname === "/indexMobile/contacts") {
181 181 return (
182 182 <div className={styles.demoContainer}>
183 183 <ContactsMobile {...this.props} sModelType={pageText} sModelsId="101251240115015888435981690" />
184 184 </div>
185 185 );
186   - } else if (location.pathname === '/indexMobile/revisePassword') {
  186 + } else if (location.pathname === "/indexMobile/revisePassword") {
187 187 return (
188 188 <div className={styles.demoContainer}>
189 189 <RevisePasswordMobile {...this.props} sModelsId="101251240115015888435981690" />
190 190 </div>
191 191 );
192   - } else if (location.pathname === '/indexMobile/contactsInfo') {
  192 + } else if (location.pathname === "/indexMobile/contactsInfo") {
193 193 return (
194 194 <div className={styles.demoContainer}>
195 195 <ContactsInfoMobile {...this.props} sModelsId="101251240115015892479567200" />
... ... @@ -207,8 +207,8 @@ class IndexMobile extends React.Component {
207 207  
208 208 render() {
209 209 const { hidden } = this.state;
210   - const TabBarHidden = location.pathname === '/indexMobile' ? hidden : true;
211   - const navbarIconShow = !['/indexMobile/commobileBill'].includes(location.pathname);
  210 + const TabBarHidden = location.pathname === "/indexMobile" ? hidden : true;
  211 + const navbarIconShow = !["/indexMobile/commobileBill"].includes(location.pathname);
212 212 const msg = this.props.app.unRead;
213 213 const msgObj = commonUtils.isJSON(msg) ? JSON.parse(msg) : {};
214 214 return (
... ... @@ -216,14 +216,13 @@ class IndexMobile extends React.Component {
216 216 <div className="demoName">
217 217 <NavBar
218 218 // mode="light"
219   - style={{ background: '#f0f0f0', color: '#888' }}
  219 + style={{ background: "#f0f0f0", color: "#888" }}
220 220 icon={TabBarHidden && navbarIconShow ? <Icon type="left" /> : null}
221 221 onLeftClick={() => {
222 222 if (TabBarHidden && navbarIconShow) {
223 223 window.history.back(-1);
224 224 }
225   - }
226   - }
  225 + }}
227 226 className={styles.iconColor}
228 227 >
229 228 {this.state.title}
... ... @@ -231,9 +230,17 @@ class IndexMobile extends React.Component {
231 230 </div>
232 231 <div
233 232 className="demo-preview-item"
234   - style={this.state.fullScreen ? {
235   - position: 'fixed', width: '100%', top: '40px', bottom: 0, background: '#f0f0f0',
236   - } : { height: 400 }}
  233 + style={
  234 + this.state.fullScreen
  235 + ? {
  236 + position: "fixed",
  237 + width: "100%",
  238 + top: "40px",
  239 + bottom: 0,
  240 + background: "#f0f0f0",
  241 + }
  242 + : { height: 400 }
  243 + }
237 244 onTouchStart={this.handleTouchStart.bind(this)}
238 245 onTouchEnd={this.handleTouchEnd.bind(this)}
239 246 >
... ... @@ -243,139 +250,153 @@ class IndexMobile extends React.Component {
243 250 tintColor="#33A3F4"
244 251 barTintColor="white"
245 252 hidden={TabBarHidden}
246   - style={{ display: location.pathname === '/indexMobile' ? 'block' : 'none' }}
  253 + style={{ display: location.pathname === "/indexMobile" ? "block" : "none" }}
247 254 >
248 255 <TabBar.Item
249 256 title="消息"
250 257 key="message"
251   - icon={<div style={{
252   - width: '22px',
253   - height: '22px',
254   - background: `url(${Icon11}) center center / 21px 21px no-repeat`,
255   - }}
256   - />
  258 + icon={
  259 + <div
  260 + style={{
  261 + width: "22px",
  262 + height: "22px",
  263 + background: `url(${Icon11}) center center / 21px 21px no-repeat`,
  264 + }}
  265 + />
257 266 }
258   - selectedIcon={<div style={{
259   - width: '22px',
260   - height: '22px',
261   - background: `url(${Icon1}) center center / 21px 21px no-repeat`,
262   - }}
263   - />
  267 + selectedIcon={
  268 + <div
  269 + style={{
  270 + width: "22px",
  271 + height: "22px",
  272 + background: `url(${Icon1}) center center / 21px 21px no-repeat`,
  273 + }}
  274 + />
264 275 }
265   - selected={this.state.selectedTab === 'message'}
  276 + selected={this.state.selectedTab === "message"}
266 277 badge={msgObj.iCount || 0}
267 278 onPress={() => {
268 279 const { app } = this.props;
269 280 const { token } = app;
270 281 commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 });
271 282 this.setState({
272   - selectedTab: 'message', title: '消息',
  283 + selectedTab: "message",
  284 + title: "消息",
273 285 });
274   - this.props.dispatch(history.push('/indexMobile'));
  286 + this.props.dispatch(history.push("/indexMobile"));
275 287 }}
276 288 data-seed="logId"
277 289 >
278   - {this.state.selectedTab === 'message' ? this.renderContent(this.state.selectedTab) : ''}
  290 + {this.state.selectedTab === "message" ? this.renderContent(this.state.selectedTab) : ""}
279 291 </TabBar.Item>
280 292 <TabBar.Item
281 293 icon={
282   - <div style={{
283   - width: '22px',
284   - height: '22px',
285   - background: `url(${Icon21}) center center / 21px 21px no-repeat`,
286   - }}
  294 + <div
  295 + style={{
  296 + width: "22px",
  297 + height: "22px",
  298 + background: `url(${Icon21}) center center / 21px 21px no-repeat`,
  299 + }}
287 300 />
288 301 }
289 302 selectedIcon={
290   - <div style={{
291   - width: '22px',
292   - height: '22px',
293   - background: `url(${Icon2}) center center / 21px 21px no-repeat`,
294   - }}
  303 + <div
  304 + style={{
  305 + width: "22px",
  306 + height: "22px",
  307 + background: `url(${Icon2}) center center / 21px 21px no-repeat`,
  308 + }}
295 309 />
296 310 }
297 311 title="现场"
298 312 key="scene"
299 313 // badge="new"
300   - selected={this.state.selectedTab === 'scene'}
  314 + selected={this.state.selectedTab === "scene"}
301 315 onPress={() => {
302 316 const { app } = this.props;
303 317 const { token } = app;
304 318 commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 });
305 319 this.setState({
306   - selectedTab: 'scene', title: '现场',
  320 + selectedTab: "scene",
  321 + title: "现场",
307 322 });
308   - this.props.dispatch(history.push('/indexMobile'));
  323 + this.props.dispatch(history.push("/indexMobile"));
309 324 }}
310 325 data-seed="logId1"
311 326 >
312   - {this.state.selectedTab === 'scene' ? this.renderContent(this.state.selectedTab) : ''}
  327 + {this.state.selectedTab === "scene" ? this.renderContent(this.state.selectedTab) : ""}
313 328 </TabBar.Item>
314 329 <TabBar.Item
315 330 icon={
316   - <div style={{
317   - width: '22px',
318   - height: '22px',
319   - background: `url(${Icon31}) center center / 21px 21px no-repeat`,
320   - }}
  331 + <div
  332 + style={{
  333 + width: "22px",
  334 + height: "22px",
  335 + background: `url(${Icon31}) center center / 21px 21px no-repeat`,
  336 + }}
321 337 />
322 338 }
323 339 selectedIcon={
324   - <div style={{
325   - width: '22px',
326   - height: '22px',
327   - background: `url(${Icon3}) center center / 21px 21px no-repeat`,
328   - }}
  340 + <div
  341 + style={{
  342 + width: "22px",
  343 + height: "22px",
  344 + background: `url(${Icon3}) center center / 21px 21px no-repeat`,
  345 + }}
329 346 />
330 347 }
331 348 title="工作台"
332 349 key="workbench"
333 350 // badge="2"
334   - selected={this.state.selectedTab === 'workbench'}
  351 + selected={this.state.selectedTab === "workbench"}
335 352 onPress={() => {
336 353 const { app } = this.props;
337 354 const { token } = app;
338 355 commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 });
339 356 this.setState({
340   - selectedTab: 'workbench', title: '工作台',
  357 + selectedTab: "workbench",
  358 + title: "工作台",
341 359 });
342   - this.props.dispatch(history.push('/indexMobile'));
  360 + this.props.dispatch(history.push("/indexMobile"));
343 361 }}
344 362 >
345   - {this.state.selectedTab === 'workbench' ? this.renderContent(this.state.selectedTab) : ''}
  363 + {this.state.selectedTab === "workbench" ? this.renderContent(this.state.selectedTab) : ""}
346 364 </TabBar.Item>
347 365 <TabBar.Item
348 366 icon={
349   - <div style={{
350   - width: '22px',
351   - height: '22px',
352   - background: `url(${Icon51}) center center / 21px 21px no-repeat`,
353   - }}
  367 + <div
  368 + style={{
  369 + width: "22px",
  370 + height: "22px",
  371 + background: `url(${Icon51}) center center / 21px 21px no-repeat`,
  372 + }}
354 373 />
355 374 }
356 375 selectedIcon={
357   - <div style={{
358   - width: '22px',
359   - height: '22px',
360   - background: `url(${Icon5}) center center / 21px 21px no-repeat`,
361   - }}
  376 + <div
  377 + style={{
  378 + width: "22px",
  379 + height: "22px",
  380 + background: `url(${Icon5}) center center / 21px 21px no-repeat`,
  381 + }}
362 382 />
363 383 }
364 384 title="我的"
365 385 key="contacts"
366 386 // badge="4"
367   - selected={this.state.selectedTab === 'myself'}
  387 + selected={this.state.selectedTab === "myself"}
368 388 onPress={() => {
369 389 const { app } = this.props;
370 390 const { token } = app;
371 391 commonBusiness.clearSocketData({ token, value: {}, sModelsId: 100 });
372 392 this.setState({
373   - selectedTab: 'myself', title: '我的',
  393 + selectedTab: "myself",
  394 + title: "我的",
374 395 });
375   - this.props.dispatch(history.push('/indexMobile'));
  396 + this.props.dispatch(history.push("/indexMobile"));
376 397 }}
377 398 >
378   - {this.state.selectedTab === 'myself' ? this.renderContent(this.state.selectedTab) : ''}
  399 + {this.state.selectedTab === "myself" ? this.renderContent(this.state.selectedTab) : ""}
379 400 </TabBar.Item>
380 401 </TabBar>
381 402 </div>
... ... @@ -383,6 +404,4 @@ class IndexMobile extends React.Component {
383 404 );
384 405 }
385 406 }
386   -export default connect(({ app, routing }) =>
387   - ({ app, routing }))(IndexMobile);
388   -
  407 +export default connect(({ app, routing }) => ({ app, routing }))(IndexMobile);
... ...
src/routes/mobile/IndexSrmMobile.js
1 1 /* eslint-disable */
2 2 import React from 'react';
3 3 import 'antd-mobile-v2/dist/antd-mobile.css';
4   -import { Icon, NavBar, TabBar, Modal } from 'antd-mobile';
5   -import { connect,history } from 'dva';
  4 +import { Icon, NavBar, TabBar, Modal } from 'antd-mobile-v2';
  5 +// import { history } from 'dva/router';
  6 +import { connect,history } from 'umi';
6 7  
7 8 import styles from './IndexMobile.less';
8 9 import SceneSrmMobile from './common/SceneSrmMobile';
... ...
src/routes/mobile/commobileList/commobileList.js
... ... @@ -4,7 +4,7 @@
4 4 */
5 5  
6 6 import React from 'react';
7   -import { connect } from 'dva';
  7 +import { connect } from 'umi';
8 8 import CommobileListComponent from '../../../mobile/common/CommobileList';
9 9 import * as commonUtils from '../../../utils/utils';
10 10  
... ...
src/utils/common/message.js
1 1 /* eslint-disable */
2 2 import { Modal, message as antdMessage } from 'antd-v4';
3   -import { Modal as mobileModal } from 'antd-mobile';
  3 +import { Modal as mobileModal } from 'antd-mobile-v2';
4 4  
5 5 const { warning } = Modal;
6 6 const antdMobileAlert = mobileModal.alert;
... ...