king
2023-08-21 2bfe0c30989141535de2da8d3656c83957a7c223
2023-08-21
3个文件已修改
50 ■■■■■ 已修改文件
src/menu/datasource/index.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/customscript/index.jsx 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/index.jsx
@@ -212,6 +212,14 @@
        delete res.setting.debugId
      }
      if (res.setting.interType === 'system' && res.setting.sync === 'true') {
        res.scripts && res.scripts.forEach(script => {
          if (script.status === 'false' || script.position !== 'back') return
          res.setting.sync = 'false'
        })
      }
      this.setState({loading: false, visible: false})
      this.props.updateConfig({...config, ...res})
    }, () => {
src/menu/datasource/verifycard/customscript/index.jsx
@@ -1,7 +1,8 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Form, Row, Col, Button, notification, Select, Tooltip, Modal, Switch } from 'antd'
import { Form, Row, Col, Button, notification, Select, Tooltip, Modal, Switch, Radio } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import Toast from 'antd-mobile/es/components/toast'
import Dialog from 'antd-mobile/es/components/dialog'
@@ -87,7 +88,8 @@
    })
    this.props.form.setFieldsValue({
      sql: record.sql
      sql: record.sql,
      position: record.position || 'front'
    })
  }
@@ -115,6 +117,7 @@
        }
        values.uuid = this.state.editItem ? this.state.editItem.uuid : ''
        values.position = values.position || 'front'
        let _quot = values.sql.match(/'{1}/g)
        let _lparen = values.sql.match(/\({1}/g)
@@ -313,7 +316,24 @@
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'url变量,请按照@xxx@格式使用。'}>{urlFields ? ', ' : ''}<span style={{color: '#13c2c2'}}>{urlFields}</span></Tooltip>
            </Form.Item>
          </Col>
          <Col span={10} style={{width: '43%'}}>
          <Col span={8} style={{whiteSpace: 'nowrap'}}>
            <Form.Item style={{marginBottom: 0}} label={
              <Tooltip placement="bottomLeft" title={'自定义脚本与数据源位置关系。'}>
                <QuestionCircleOutlined className="mk-form-tip" />
                执行位置
              </Tooltip>
            }>
              {getFieldDecorator('position', {
                initialValue: 'front'
              })(
                <Radio.Group>
                  <Radio value="front">前置</Radio>
                  <Radio value="back">后置</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          <Col span={8}>
            <Form.Item label="快捷添加" labelCol={{xs: { span: 24 }, sm: { span: 6 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 18 }} } style={{marginBottom: 0}}>
              <Select
                showSearch
src/menu/datasource/verifycard/index.jsx
@@ -117,7 +117,7 @@
      {
        title: 'SQL',
        dataIndex: 'sql',
        width: '72%',
        width: '65%',
        render: (text) => {
          let title = text.match(/^\s*\/\*.+\*\//)
          title = title && title[0] ? title[0] : ''
@@ -132,9 +132,21 @@
        }
      },
      {
        title: '执行位置',
        dataIndex: 'position',
        width: '10%',
        render: (text, record) => {
          if (record.position === 'back') {
            return <span style={{color: 'orange'}}>后置</span>
          } else {
            return <span style={{color: '#26C281'}}>前置</span>
          }
        }
      },
      {
        title: '状态',
        dataIndex: 'status',
        width: '13%',
        width: '10%',
        render: (text, record) => record.status === 'false' ?
          (
            <div style={{color: '#ff4d4f'}}>