king
2022-06-10 9fa028fdac3517c2c2b167e52782f83185daa131
src/templates/zshare/verifycard/index.jsx
@@ -3,6 +3,8 @@
import { is, fromJS } from 'immutable'
import { Form, Tabs, Row, Col, Radio, Button, Select, Popconfirm, notification, Modal, message, InputNumber, Tooltip, Typography } from 'antd'
import { QuestionCircleOutlined, CheckCircleOutlined, StopOutlined, EditOutlined, SwapOutlined, DeleteOutlined, ExclamationOutlined, BorderOutlined } from '@ant-design/icons'
import Toast from 'antd-mobile/es/components/toast'
import Dialog from 'antd-mobile/es/components/dialog'
import moment from 'moment'
import Api from '@/api'
@@ -37,6 +39,7 @@
  state = {
    initsql: '',            // sql验证时变量声明及赋值
    appType: sessionStorage.getItem('appType'),
    notes: [],              // 短信模板
    setting: null,
    visible: false,
@@ -1273,35 +1276,66 @@
  }
  showError = (errorType) => {
    const { verify, appType } = this.state
    if (errorType === 'S') {
      notification.success({
        top: 92,
        message: '执行成功!',
        duration: 2
      })
      let time = verify.stime || 2
      if (appType === 'mob') {
        Toast.show({ icon: 'success', content: '执行成功!', duration: time * 1000 })
      } else {
        notification.success({
          top: 92,
          message: '执行成功!',
          duration: time
        })
      }
    } else if (errorType === 'Y') {
      Modal.success({
        title: '执行成功!'
      })
      if (appType === 'mob') {
        Dialog.alert({content: '执行成功!', confirmText: '知道了'})
      } else {
        Modal.success({
          title: '执行成功!'
        })
      }
    } else if (errorType === 'F') {
      notification.error({
        className: 'notification-custom-error',
        top: 92,
        message: '执行失败!',
        duration: 10
      })
      if (appType === 'mob') {
        let time = verify.ftime || 3
        Toast.show({ icon: 'fail', content: '执行失败!', duration: time * 1000 })
      } else {
        notification.error({
          className: 'notification-custom-error',
          top: 92,
          message: '执行失败!',
          duration: verify.ftime || 10
        })
      }
    } else if (errorType === 'N') {
      notification.error({
        top: 92,
        message: '执行失败!',
        duration: 10
      })
      if (appType === 'mob') {
        let time = verify.ntime || 3
        Toast.show({ content: '执行失败!', duration: time * 1000 })
      } else {
        notification.error({
          top: 92,
          message: '执行失败!',
          duration: verify.ntime || 10
        })
      }
    } else if (errorType === 'E') {
      Modal.error({
        title: '执行失败!'
      })
      if (appType === 'mob') {
        Dialog.alert({content: '执行失败!', confirmText: '知道了'})
      } else {
        Modal.error({
          title: '执行失败!'
        })
      }
    } else if (errorType === 'NM') {
      message.error('执行失败!')
      if (appType === 'mob') {
        let time = verify.ntime || 3
        Toast.show({ content: '执行失败!', duration: time * 1000 })
      } else {
        message.error('执行失败!')
      }
    }
  }
@@ -1454,7 +1488,7 @@
  render() {
    const { card } = this.props
    const { verify, fields, visible, uniqueFields, uniqueColumns, unionFields, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, cbScriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes } = this.state
    const { verify, fields, visible, uniqueFields, uniqueColumns, unionFields, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, cbScriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes, appType } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -1742,7 +1776,7 @@
                </Col>
                <Col span={8}>
                  <Form.Item label={'停留时间'}>
                    <InputNumber defaultValue={verify.ntime || 10} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} />
                    <InputNumber defaultValue={verify.ntime || (appType === 'mob' ? 3 : 10)} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} />
                  </Form.Item>
                </Col>
              </Row>
@@ -1757,7 +1791,7 @@
                </Col>
                <Col span={8}>
                  <Form.Item label={'停留时间'}>
                    <InputNumber defaultValue={verify.ftime || 10} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} />
                    <InputNumber defaultValue={verify.ftime || (appType === 'mob' ? 3 : 10)} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} />
                  </Form.Item>
                </Col>
              </Row>