king
2022-07-29 02546bc3c0ed7a4e471df15b80792008563d1d10
2022-07-29
9个文件已修改
281 ■■■■ 已修改文件
public/options.json 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/components/login/normal-login/index.jsx 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/components/login/normal-login/index.scss 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/components/login/normal-login/loginform.jsx 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/components/login/normal-login/options.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/components/login/normal-login/signform.jsx 118 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/options.json
@@ -1,12 +1,12 @@
{
  "appId": "201912040924165801464FF1788654BC5AC73",
  "appkey": "20191106103859640976D6E924E464D029CF0",
  "appId": "202108312122504607B107A83F55B40C98CCF",
  "appkey": "20210831212235413F287EC3BF489424496C8",
  "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars",
  "systemType": "",
  "externalDatabase": "false",
  "lineColor": "",
  "filter": "false",
  "defaultApp": "mk",
  "defaultApp": "mkindustry",
  "defaultLang": "zh-CN",
  "WXAppID": "",
  "WXminiAppID": "",
@@ -15,6 +15,6 @@
  "probation": "",
  "keepPassword": "true",
  "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"],
  "host": "http://qingqiumarket.cn",
  "service": "MKWMS/"
  "host": "http://demo.mk9h.cn",
  "service": "erp_new/"
}
src/pc/components/login/normal-login/index.jsx
@@ -25,7 +25,7 @@
  state = {
    card: null,
    back: false
    active: 'login'
  }
  UNSAFE_componentWillMount () {
@@ -68,7 +68,14 @@
      if (_card.wrap.link && _card.wrap.link === 'menu') {
        _card.wrap.linkmenu = _card.uuid
      }
      _card.wrap.classify = _card.wrap.classify || 'login'
      let active = 'login'
      if (_card.wrap.classify === 'signin') {
        active = 'signin'
      }
      this.setState({
        active,
        card: _card
      })
    }
@@ -146,17 +153,26 @@
    card.wrap = res
    let active = 'login'
    if (res.classify === 'signin') {
      active = 'signin'
    }
    this.setState({
      active
    })
    this.updateComponent(card)
  }
  render() {
    const { card } = this.state
    const { card, active } = this.state
    let style = resetStyle(card.style)
    if (card.wrap.maxWidth) {
      style.maxWidth = card.wrap.maxWidth
    if (card.style.width) {
      let left = style.marginLeft && style.marginLeft !== '0px' ? style.marginLeft : 'auto'
      let right = style.marginRight && style.marginRight !== '0px' ? style.marginRight : 'auto'
      style.margin = (style.marginTop || 0) + ' ' + right + ' ' + (style.marginBottom || 0) + ' ' + left
      style.maxWidth = `calc(100% - ${style.marginLeft || '0px'} - ${style.marginRight || '0px'})`
      delete style.marginLeft
      delete style.marginRight
      delete style.marginTop
@@ -176,8 +192,8 @@
        } trigger="hover">
          <ToolOutlined />
        </Popover>
        {card.wrap.loginWays ? <LoginForm wrap={card.wrap} /> : null}
        {card.wrap.signWays ? <SignForm wrap={card.wrap} /> : null}
        {card.wrap.loginWays && active === 'login' ? <LoginForm wrap={card.wrap} changeway={() => this.setState({active: 'signin'})}/> : null}
        {card.wrap.signWays && active === 'signin' ? <SignForm wrap={card.wrap} changeway={() => this.setState({active: 'login'})}/> : null}
        <div className="component-name">
          <div className="center">
            <div className="title">{card.name}</div>
src/pc/components/login/normal-login/index.scss
@@ -7,6 +7,7 @@
  background-repeat: no-repeat;
  background-size: cover;
  min-height: 100px;
  max-width: 100%;
  
  .card-control {
    position: absolute;
@@ -62,6 +63,12 @@
    .ant-form-item:last-child {
      margin-bottom: 0;
    }
    .mk-jump-way {
      cursor: pointer;
      float: right;
      color: #1890ff;
      margin-bottom: 15px;
    }
  }
  .login-way-title {
    font-size: 18px;
@@ -107,7 +114,10 @@
  .protocol-wrap {
    padding: 0 20px 15px;
    span {
      font-size: 13px;
      font-size: 12px;
    }
    .ant-checkbox + span {
      padding-right: 0px;
    }
    .protocol {
      color: #1890ff;
@@ -125,6 +135,53 @@
  }
  .login-ways.center {
    text-align: center;
  }
  .sign-ways {
    clear: both;
    text-align: center;
    margin-top: 25px;
    .title {
      color: #959595;
      display: flex;
      padding: 0 15%;
    }
    .title::before, .title::after {
      display: inline-block;
      content: ' ';
      height: 0.5px;
      flex: 1;
      background-color: rgba(0, 0, 0, 0.15);
      position: relative;
      top: 12px;
    }
    .title::before {
      margin: 0 25px 0 0;
    }
    .title::after {
      margin: 0 0 0 25px;
    }
    .content {
      display: flex;
      .item {
        flex: 1;
        cursor: pointer;
        padding-top: 10px;
        .anticon {
          font-size: 20px;
          width: 40px;
          height: 40px;
          line-height: 45px;
          border-radius: 40px;
          background: #e6f7ff;
          color: #1890ff;
        }
        .name {
          color: #000000;
          display: block;
          margin-top: 10px;
        }
      }
    }
  }
  .form-scan-wrap {
@@ -171,9 +228,6 @@
.mk-mob-view .login-edit-box {
  display: block;
  // .login-way-wrap.simple {
  //   display: none;
  // }
  .login-way-wrap {
    padding: 0 15px;
    border-radius: 0;
@@ -200,4 +254,9 @@
    border: 0;
    border-radius: 0;
  }
  .protocol-wrap {
    span {
      font-size: 13px;
    }
  }
}
src/pc/components/login/normal-login/loginform.jsx
@@ -12,7 +12,8 @@
class LoginTabForm extends Component {
  static propTpyes = {
    wrap: PropTypes.object
    wrap: PropTypes.object,
    changeway: PropTypes.func
  }
  state = {
@@ -32,22 +33,27 @@
        loginWays.push({
          type: 'sms_vcode',
          label: '短信登录',
          tempId: wrap.tempId
          tempId: wrap.tempId,
          sort: 2
        })
      } else if (way === 'uname_pwd') {
        loginWays.push({
          type: 'uname_pwd',
          label: '账号登录',
          shortcut: wrap.shortcut
          shortcut: wrap.shortcut,
          sort: 1
        })
      } else if (way === 'app_scan') {
        scanWay = {
          type: 'app_scan',
          label: '扫码登录'
          label: '扫码登录',
          sort: 3
        }
        loginWays.push(scanWay)
      }
    })
    loginWays.sort((a, b) => a.sort - b.sort)
    this.setState({
      loginWays: loginWays,
@@ -67,22 +73,26 @@
          loginWays.push({
            type: 'sms_vcode',
            label: '短信登录',
            tempId: wrap.tempId
            tempId: wrap.tempId,
            sort: 2
          })
        } else if (way === 'uname_pwd') {
          loginWays.push({
            type: 'uname_pwd',
            label: '账号登录',
            shortcut: wrap.shortcut
            shortcut: wrap.shortcut,
            sort: 1
          })
        } else if (way === 'app_scan') {
          scanWay = {
            type: 'app_scan',
            label: '扫码登录'
            label: '扫码登录',
            sort: 3
          }
          loginWays.push(scanWay)
        }
      })
      loginWays.sort((a, b) => a.sort - b.sort)
      this.setState({
        loginWays: loginWays,
@@ -126,6 +136,7 @@
  }
  render() {
    const { wrap } = this.props
    const { activeWay, loginWays, scanWay } = this.state
    return (
@@ -185,9 +196,7 @@
          </div>
          请使用客户端扫一扫登录
        </div> : null}
        {/* {wrap.protocol === 'true' ? <div className={'protocol-wrap '}>
          <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span className="protocol" key={i}>《{item.label}》</span>))}
        </div> : null} */}
        {wrap.classify !== 'login' ? <span className="mk-jump-way" onClick={() => this.props.changeway()}>没有账号,去注册?</span> : null}
        <div className={'login-ways ' + (activeWay.type === 'app_scan' ? 'center' : '')}>
          {loginWays.map(item => {
            if (item.type === 'app_scan' || activeWay.type === item.type) return null
src/pc/components/login/normal-login/options.jsx
@@ -59,17 +59,17 @@
      precision: 0,
      required: true
    },
    {
      type: 'number',
      field: 'maxWidth',
      label: '最大宽度',
      initval: wrap.maxWidth || '',
      tooltip: '登录框的最大宽度值。',
      min: 100,
      max: 2000,
      precision: 0,
      required: false
    },
    // {
    //   type: 'number',
    //   field: 'maxWidth',
    //   label: '最大宽度',
    //   initval: wrap.maxWidth || '',
    //   tooltip: '登录框的最大宽度值。',
    //   min: 100,
    //   max: 2000,
    //   precision: 0,
    //   required: false
    // },
    {
      type: 'styleInput',
      field: 'height',
@@ -152,6 +152,7 @@
      field: 'signWays',
      label: '注册方式',
      initval: wrap.signWays || [],
      tooltip: '微信授权只在小程序中有效。',
      required: true,
      options: [
        { label: '账号', value: 'uname_pwd' },
src/pc/components/login/normal-login/signform.jsx
@@ -2,27 +2,58 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Form, Input, Button, notification, Checkbox } from 'antd'
import { UserOutlined, LockOutlined } from '@ant-design/icons'
import { UserOutlined, LockOutlined, MobileOutlined, WechatOutlined } from '@ant-design/icons'
import MKEmitter from '@/utils/events.js'
import './index.scss'
class LoginTabForm extends Component {
  static propTpyes = {
    wrap: PropTypes.object
    wrap: PropTypes.object,
    changeway: PropTypes.func
  }
  state = {
    activeWay: null,
    appType: sessionStorage.getItem('appType'),
    signWays: []
  }
  UNSAFE_componentWillMount () {
    const { wrap } = this.props
    let signWays = []
    wrap.signWays.forEach(way => {
      if (way === 'sms_vcode') {
        signWays.push({
          type: 'sms_vcode',
          label: '手机号注册',
          icon: <MobileOutlined />,
          tempId: wrap.signTempId,
          sort: 2
        })
      } else if (way === 'uname_pwd') {
        signWays.push({
          type: 'uname_pwd',
          label: '账号注册',
          icon: <LockOutlined />,
          sort: 1
        })
      } else if (way === 'weixin') {
        signWays.push({
          type: 'weixin',
          label: '微信登录',
          icon: <WechatOutlined />,
          sort: 3
        })
      }
    })
    signWays.sort((a, b) => a.sort - b.sort)
    this.setState({
      signWays: wrap.signWays,
      activeWay: wrap.signWays[0]
      signWays: signWays,
      activeWay: signWays[0]
    })
  }
@@ -30,14 +61,42 @@
    const { wrap } = this.props
    if (!is(fromJS(wrap), fromJS(nextProps.wrap))) {
      let signWays = []
      nextProps.wrap.signWays.forEach(way => {
        if (way === 'sms_vcode') {
          signWays.push({
            type: 'sms_vcode',
            label: '手机号注册',
            tempId: nextProps.wrap.signTempId,
            sort: 2
          })
        } else if (way === 'uname_pwd') {
          signWays.push({
            type: 'uname_pwd',
            label: '账号注册',
            sort: 1
          })
        } else if (way === 'weixin') {
          signWays.push({
            type: 'weixin',
            label: '微信登录',
            sort: 3
          })
        }
      })
      signWays.sort((a, b) => a.sort - b.sort)
      this.setState({
        signWays: nextProps.wrap.signWays,
        activeWay: nextProps.wrap.signWays[0]
        signWays: signWays,
        activeWay: signWays[0]
      })
    }
  }
  onChangeTab = (activeWay) => {
    if (activeWay.type === 'weixin') return
    this.setState({activeWay})
  }
@@ -72,11 +131,12 @@
  render() {
    const { wrap } = this.props
    const { activeWay, signWays } = this.state
    const { activeWay, signWays, appType } = this.state
    return (
      <Form className="login-edit-form">
        {activeWay === 'uname_pwd' ? <div className="form-item-wrap">
        {appType === 'pc' ? <div className="login-way-title">{activeWay.label}</div> : null}
        {activeWay.type === 'uname_pwd' ? <div className="form-item-wrap">
          <Form.Item>
            <Input
              prefix={<UserOutlined style={{ color: 'rgba(0,0,0,.25)' }} />}
@@ -87,8 +147,8 @@
          <Form.Item>
            <Input.Password placeholder="密码" prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />
          </Form.Item>
          {wrap.groups ? <div className={'protocol-wrap '}>
            <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span className="protocol" key={i}>《{item.label}》</span>))}
          {wrap.groups ? <div className="protocol-wrap">
            <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span><span className="protocol" key={i}>《{item.label}》</span>{wrap.groups.length > i + 1 ? (wrap.groups.length > i + 2 ? '、' : '和') : null}</span>))}
          </div> : null}
          <Form.Item className="btn-login">
            <Button type="primary" onDoubleClick={() => this.changeMenu()} className="sign-form-button">
@@ -96,14 +156,14 @@
            </Button>
          </Form.Item>
        </div> : null}
        {activeWay === 'sms_vcode' ? <div className="form-item-wrap">
        {activeWay.type === 'sms_vcode' ? <div className="form-item-wrap">
          <Form.Item>
            <Input
              placeholder="手机号"
              autoComplete="off"
            />
          </Form.Item>
          <Form.Item style={{marginBottom: '35px'}}>
          <Form.Item style={{marginBottom: wrap.groups ? '15px' : '35px'}}>
            <Input
              addonAfter={
                <Button type="link" className="vercode" size="small">
@@ -114,8 +174,8 @@
              autoComplete="off"
            />
          </Form.Item>
          {wrap.groups ? <div className={'protocol-wrap '}>
            <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span className="protocol" key={i}>《{item.label}》</span>))}
          {wrap.groups ? <div className="protocol-wrap">
            <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span><span className="protocol" key={i}>《{item.label}》</span>{wrap.groups.length > i + 1 ? (wrap.groups.length > i + 2 ? '、' : '和') : null}</span>))}
          </div> : null}
          <Form.Item className="btn-login">
            <Button type="primary" onDoubleClick={() => this.changeMenu()} className="sign-form-button">
@@ -123,12 +183,32 @@
            </Button>
          </Form.Item>
        </div> : null}
        <div className={'login-ways '}>
          <div>其他登录方式</div>
          {signWays.map((item, i) => {
            return (<span key={i} onClick={() => this.onChangeTab(item)}>{item}</span>)
        {activeWay.type === 'weixin' ? <div className="form-item-wrap">
          <Form.Item className="btn-login" style={{marginBottom: wrap.groups ? '0px' : '15px'}}>
            <Button type="primary" onDoubleClick={() => this.changeMenu()} className="sign-form-button">
              微信一键登录
            </Button>
          </Form.Item>
          {wrap.groups ? <div className="protocol-wrap">
            <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span><span className="protocol" key={i}>《{item.label}》</span>{wrap.groups.length > i + 1 ? (wrap.groups.length > i + 2 ? '、' : '和') : null}</span>))}
          </div> : null}
        </div> : null}
        {wrap.classify !== 'signin' ? <span className="mk-jump-way" onClick={() => this.props.changeway()}>已有账号,去登陆?</span> : null}
        {appType === 'mob' && signWays.length > 1 ? <div className="sign-ways">
          <div className="title">其他登录方式</div>
          <div className="content">
            {signWays.map((item, i) => {
              if (activeWay.type === item.type) return null
              return (<div key={i} className="item" onClick={() => this.onChangeTab(item)}>{item.icon}<span className="name">{item.label}</span></div>)
            })}
          </div>
        </div> : null}
        {appType === 'pc' && signWays.length > 1 ? <div className="login-ways">
          {signWays.map(item => {
            if (activeWay.type === item.type) return null
            return (<span key={item.type} onClick={() => this.onChangeTab(item)}>{item.label}</span>)
          })}
        </div>
        </div> : null}
      </Form>
    )
  }
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2290,7 +2290,7 @@
        className={className}
        onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
      >{label}</Button>
      {this.getModels()}
      <span onClick={(e) => {e.stopPropagation()}}>{this.getModels()}</span>
      {loadingTotal ? <Progress className="mk-button-progress" percent={(loadingTotal - loadingNumber) / loadingTotal * 100} size="small" showInfo={false} /> : null}
    </>
  }
src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -358,7 +358,7 @@
          className={className}
          onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
        >{label}</Button>
        {this.getPop()}
        <span onClick={(e) => {e.stopPropagation()}}>{this.getPop()}</span>
      </>
    )
  }
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -1691,7 +1691,7 @@
        className={className}
        onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
      >{label}</Button>
      {this.getModels()}
      <span onClick={(e) => {e.stopPropagation()}}>{this.getModels()}</span>
    </>
  }
}