king
2022-02-17 3c3c5b4e5f239b712eb837af7f732ce5ab3e859f
2022-02-17
19个文件已修改
1个文件已添加
282 ■■■■■ 已修改文件
src/assets/img/minview.png 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/tableIn/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/tableIn/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/sysinterface/settingform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/treesettingcomponent/settingform/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/editTable/index.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/editTable/index.scss 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/callbackcustomscript/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/callbackcustomscript/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customform/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customscript/index.jsx 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customscript/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.jsx 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.scss 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/minview.png
src/menu/components/table/edit-table/columns/tableIn/index.jsx
@@ -527,7 +527,7 @@
    return (
      <div id="verify-excel-box-tab">
        <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.tabchange}>
        <Tabs activeKey={activeKey} className="tablein-verify-card-box" onChange={this.tabchange}>
          <TabPane tab="基础验证" key="basemsg">
            <Form {...formItemLayout}>
              <Row gutter={24}>
src/menu/components/table/edit-table/columns/tableIn/index.scss
@@ -1,4 +1,4 @@
.verify-card-box {
.tablein-verify-card-box {
  .ant-tabs-nav-scroll {
    text-align: center;
  }
src/menu/sysinterface/settingform/index.jsx
@@ -131,7 +131,7 @@
    return (
      <div className="model-interface-form-box" id="model-interface-form-body">
        <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.changeTab}>
        <Tabs activeKey={activeKey} onChange={this.changeTab}>
          <TabPane tab="接口设置" key="setting">
            <BaseForm
              dict={dict}
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -737,7 +737,7 @@
    return (
      <div id="verify-excel-box-tab">
        <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.tabchange}>
        <Tabs activeKey={activeKey} className="excelin-verify-card-box" onChange={this.tabchange}>
          <TabPane tab="基础验证" key="basemsg">
            <Form {...formItemLayout}>
              <Row gutter={24}>
@@ -800,7 +800,7 @@
            </span>
          } key="unique">
            <UniqueForm fields={verify.columns} dict={this.props.dict} uniqueChange={this.uniqueChange}/>
            <EditTable actions={['edit', 'move', 'del']} data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/>
            <EditTable actions={['edit', 'move', 'del', 'status']} data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/>
          </TabPane> : null}
          {card.intertype === 'system' ? <TabPane tab={
            <span>
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss
@@ -1,4 +1,4 @@
.verify-card-box {
.excelin-verify-card-box {
  .ant-tabs-nav-scroll {
    text-align: center;
  }
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
@@ -487,7 +487,7 @@
    return (
      <div id="verify-excelout-box-tab">
        <Tabs defaultActiveKey="1" className="verify-card-box" onChange={this.tabchange}>
        <Tabs defaultActiveKey="1" className="excelout-verify-card-box" onChange={this.tabchange}>
          <TabPane tab={
            <span>
              Excel导出列
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.scss
@@ -1,4 +1,4 @@
.verify-card-box {
.excelout-verify-card-box {
  .ant-tabs-nav-scroll {
    text-align: center;
  }
src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -477,7 +477,7 @@
    return (
      <div className="model-table-setting-form-box" id="model-setting-form-body">
        {loading && <Spin size="large" />}
        <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.changeTab}>
        <Tabs activeKey={activeKey} onChange={this.changeTab}>
          <TabPane tab="数据源" key="setting">
            <DataSource
              menu={menu}
src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx
@@ -250,7 +250,7 @@
    return (
      <div className="model-tree-setting-form-box" id="model-setting-form-body">
        {loading && <Spin size="large" />}
        <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.changeTab}>
        <Tabs activeKey={activeKey} onChange={this.changeTab}>
          <TabPane tab="数据源" key="setting">
            <DataSource
              menu={menu}
src/templates/sharecomponent/treesettingcomponent/settingform/index.scss
@@ -47,7 +47,7 @@
    box-shadow: unset;
  }
  .verify-card-box .ant-tabs-nav-scroll {
  .ant-tabs-nav-scroll {
    text-align: center;
  }
}
src/templates/zshare/editTable/index.jsx
@@ -3,7 +3,7 @@
import { is, fromJS } from 'immutable'
import { DndProvider, DragSource, DropTarget } from 'react-dnd'
import { Table, Input, InputNumber, Popconfirm, Form, Select, Radio, Cascader, notification, message, Modal, Typography } from 'antd'
import { CopyOutlined, EditOutlined, DeleteOutlined, SnippetsOutlined } from '@ant-design/icons'
import { CopyOutlined, EditOutlined, DeleteOutlined, SnippetsOutlined, SwapOutlined } from '@ant-design/icons'
import Utils from '@/utils/utils.js'
import ColorSketch from '@/mob/colorsketch'
@@ -221,6 +221,7 @@
            <div className={'edit-operation-btn' + (editingKey !== '' ? ' disabled' : '')} style={{minWidth: '110px', whiteSpace: 'nowrap'}}>
              {actions.includes('edit') ? <span className="primary" onClick={() => {editingKey === '' && this.edit(record.uuid)}}><EditOutlined /></span> : null}
              {actions.includes('copy') ? <span className="copy" onClick={() => {editingKey === '' && this.copy(record)}}><CopyOutlined /></span> : null}
              {actions.includes('status') ? <span className="status" onClick={() => {editingKey === '' && this.handleStatus(record)}}><SwapOutlined /></span> : null}
              {actions.includes('del') && editingKey === '' ? <Popconfirm
                overlayClassName="popover-confirm"
                title={eTDict['model.query.delete']}
@@ -412,6 +413,22 @@
    })
  }
  handleStatus = (record) => {
    const { data } = this.state
    record.status = record.status === 'false' ? 'true' : 'false'
    let newData = data.map(item => {
      if (record.uuid === item.uuid) return record
      return item
    })
    this.setState({ data: newData }, () => {
      this.props.onChange(newData)
    })
  }
  onSave = (record) => {
    const { columns } = this.state
    const newData = [...this.state.data]
src/templates/zshare/editTable/index.scss
@@ -39,7 +39,7 @@
  .edit-operation-btn {
    display: block;
    text-align: center;
    span {
    > span {
      margin-right: 10px;
      cursor: pointer;
      font-size: 16px;
@@ -50,6 +50,9 @@
    }
    .copy {
      color: #26C281;
    }
    .status {
      color: #8E44AD;
    }
    .danger {
      color: #ff4d4f;
@@ -69,6 +72,9 @@
    .danger {
      color: rgba(0, 0, 0, .25);
    }
    .status {
      color: rgba(0, 0, 0, .25);
    }
    .copy {
      color: rgba(0, 0, 0, .25);
    }
src/templates/zshare/verifycard/callbackcustomscript/index.jsx
@@ -221,7 +221,7 @@
    }
    return (
      <Form {...formItemLayout} className="verify-form" id="verify-custom-callback-scripts">
      <Form {...formItemLayout} className="verify-form verify-custom-callback-scripts" id="verify-custom-callback-scripts">
        <Row gutter={24}>
          <Col span={8}>
            <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}>
src/templates/zshare/verifycard/callbackcustomscript/index.scss
@@ -1,4 +1,4 @@
#verify-custom-scripts {
.verify-custom-callback-scripts {
  .ant-select-dropdown-menu-item {
    white-space: normal;
  }
src/templates/zshare/verifycard/customform/index.jsx
@@ -183,6 +183,7 @@
            <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green">
              保存
            </Button>
            <div></div>
            <Button onClick={this.handleCancel}>
              取消
            </Button>
src/templates/zshare/verifycard/customscript/index.jsx
@@ -11,6 +11,7 @@
class CustomForm extends Component {
  static propTpyes = {
    type: PropTypes.any,
    dict: PropTypes.object,         // 字典项
    btn: PropTypes.object,          // 按钮信息
    usefulfields: PropTypes.string, // 可用字段
@@ -219,7 +220,7 @@
  }
  render() {
    const { usefulfields, systemScripts, btn } = this.props
    const { usefulfields, systemScripts, btn, type } = this.props
    const { getFieldDecorator } = this.props.form
    const formItemLayout = {
      labelCol: {
@@ -232,20 +233,22 @@
      }
    }
    let _type = type || ''
    return (
      <Form {...formItemLayout} className="verify-form" id="verify-custom-scripts">
      <Form {...formItemLayout} className="verify-form verify-custom-scripts" id={'verify-custom-scripts' + _type}>
        <Row gutter={24}>
          {btn.sql ? <Col span={8}>
          {!_type && btn.sql ? <Col span={8}>
            <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}>
              {btn.sql}
            </Form.Item>
          </Col> : null}
          <Col span={10}>
          {!_type ? <Col span={10}>
            <Form.Item label={'报错字段'} style={{margin: 0, whiteSpace: 'nowrap'}}>
              ErrorCode(增加后缀NT表示数据不回滚,如ENT、NNT、FNT、NMNT), retmsg
            </Form.Item>
          </Col>
          {usefulfields ? <Col span={24} className="sqlfield">
          </Col> : null}
          {!_type && usefulfields ? <Col span={24} className="sqlfield">
            <Form.Item label={'可用字段'}>
              {usefulfields}
            </Form.Item>
@@ -274,7 +277,7 @@
                showSearch
                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                onSelect={this.selectScript}
                getPopupContainer={() => document.getElementById('verify-custom-scripts')}
                getPopupContainer={() => document.getElementById('verify-custom-scripts' + _type)}
              >
                <Select.Option key="default" value={this.props.defaultsql}>默认sql</Select.Option>
                <Select.Option key="debugger" value={`z_debug: select @ErrorCode='E',@retmsg='测试断点' goto aaa`}>
src/templates/zshare/verifycard/customscript/index.scss
@@ -1,4 +1,4 @@
#verify-custom-scripts {
.verify-custom-scripts {
  .ant-select-dropdown-menu-item {
    white-space: normal;
  }
src/templates/zshare/verifycard/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
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 } from '@ant-design/icons'
import { QuestionCircleOutlined, CheckCircleOutlined, StopOutlined, EditOutlined, SwapOutlined, DeleteOutlined, ExclamationOutlined, BorderOutlined } from '@ant-design/icons'
import moment from 'moment'
import Api from '@/api'
@@ -18,6 +18,7 @@
import asyncComponent from '@/utils/asyncComponent'
import { updateForm } from '@/utils/utils-update.js'
import MKEmitter from '@/utils/events.js'
import MinView from '@/assets/img/minview.png'
import './index.scss'
const { TabPane } = Tabs
@@ -38,6 +39,8 @@
    initsql: '',            // sql验证时变量声明及赋值
    notes: [],              // 短信模板
    setting: null,
    visible: false,
    scriptId: '',
    verify: {},
    fields: [],
    usefulfields: '',
@@ -1451,7 +1454,7 @@
  render() {
    const { card } = this.props
    const { verify, fields, 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 } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -1585,7 +1588,7 @@
            </span>
          } key="2x">
            <ContrastForm dict={this.props.dict} contrastChange={this.contrastChange}/>
            <EditTable actions={['edit', 'move', 'copy', 'del']} type="contrastverify" data={verify.contrasts} columns={contrastColumns} onChange={(contrasts) => this.setState({verify: {...verify, contrasts}})}/>
            <EditTable actions={['edit', 'move', 'copy', 'del', 'status']} type="contrastverify" data={verify.contrasts} columns={contrastColumns} onChange={(contrasts) => this.setState({verify: {...verify, contrasts}})}/>
          </TabPane> : null}
          {card.intertype === 'system' || (card.intertype === 'custom' && card.procMode === 'system') ? <TabPane tab={
            <span>
@@ -1634,7 +1637,7 @@
              dict={this.props.dict}
              uniqueChange={this.uniqueChange}
            />
            <EditTable actions={['edit', 'move', 'del']} data={verify.uniques} columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} onChange={this.changeUniques}/>
            <EditTable actions={['edit', 'move', 'del', 'status']} data={verify.uniques} columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} onChange={this.changeUniques}/>
          </TabPane> : null}
          {card.intertype === 'system' || (card.intertype === 'custom' && card.procMode === 'system') ? <TabPane tab={
            <span>
@@ -1658,6 +1661,18 @@
              {verify.scripts.length ? <span className="count-tip">{verify.scripts.length}</span> : null}
            </span>
          } key="6">
            <BorderOutlined className="full-scripts" onClick={() => {
              if (this.scriptsForm && (this.scriptsForm.state.editItem || (this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))))) {
                notification.warning({
                  top: 92,
                  message: '请保存自定义脚本!',
                  duration: 5
                })
                return
              }
              this.setState({visible: true, scriptId: ''})
            }}/>
            <CustomScript
              btn={this.props.card}
              dict={this.props.dict}
@@ -1777,6 +1792,76 @@
            </Form>
          </TabPane>
        </Tabs>
        <Modal
          wrapClassName="model-custom-scripts-modal"
          title="自定义脚本"
          visible={visible}
          width={'95vw'}
          maskClosable={false}
          destroyOnClose
        >
          <img className="unfull-scripts" src={MinView} onClick={() => this.setState({visible: false, scriptId: ''})} alt=""/>
          <div className="script-table-wrap">
            {verify.scripts.map(item => {
              let title = item.sql.match(/^\s*\/\*.+\*\//)
              title = title && title[0] ? title[0] : ''
              let _text = title ? item.sql.replace(title, '') : item.sql
              let position = null
              if (item.position === 'init') {
                position = <span style={{color: 'orange'}}>初始化</span>
              } else if (item.position === 'front') {
                position = <span style={{color: '#26C281'}}>sql前</span>
              } else {
                position = <span style={{color: '#1890ff'}}>sql后</span>
              }
              return (
                <div className={'script-item ' + (this.state.scriptId === item.uuid ? 'active' : '') } key={item.uuid}>
                  <div style={{cursor: 'pointer'}} onClick={() => {
                    this.scriptsFullForm.edit(item)
                    this.setState({scriptId: item.uuid})
                  }}>
                    {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null}
                    <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph>
                    <div>{position}{item.status === 'false' ?
                      <span style={{color: '#ff4d4f', marginLeft: '20px'}}>
                        禁用
                        <StopOutlined style={{marginLeft: '5px'}} />
                      </span> :
                      <span style={{color: '#26C281', marginLeft: '20px'}}>
                        启用
                        <CheckCircleOutlined style={{marginLeft: '5px'}}/>
                      </span>}
                    </div>
                  </div>
                  <div style={{textAlign: 'right'}}>
                    <span className="operation-btn" onClick={() => this.handleStatus(item, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span>
                    <Popconfirm
                      overlayClassName="popover-confirm"
                      title={this.props.dict['model.query.delete']}
                      onConfirm={() => this.handleDelete(item, 'scripts')
                    }>
                      <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span>
                    </Popconfirm>
                  </div>
                </div>
              )
            })}
          </div>
          <CustomScript
            type="fullscreen"
            btn={this.props.card}
            dict={this.props.dict}
            initsql={this.state.initsql}
            customScripts={verify.scripts}
            defaultsql={this.state.defaultsql}
            usefulfields={this.state.usefulfields}
            systemScripts={this.state.systemScripts}
            scriptsChange={this.scriptsChange}
            wrappedComponentRef={(inst) => this.scriptsFullForm = inst}
          />
        </Modal>
      </div>
    )
  }
src/templates/zshare/verifycard/index.scss
@@ -72,4 +72,120 @@
  .operation-btn:not(:first-child) {
    margin-left: 5px;
  }
  .full-scripts {
    position: absolute;
    right: 0px;
    top: 18px;
    font-size: 18px;
    color: #1890ff;
  }
}
.model-custom-scripts-modal {
  .ant-modal {
    top: 30px;
    .ant-modal-footer {
      display: none;
    }
    .ant-modal-close {
      display: none;
    }
    .ant-modal-body {
      height: calc(100vh - 110px);
      overflow-y: auto;
      display: flex;
      .script-table-wrap {
        width: 220px;
        .operation-btn {
          display: inline-block;
          font-size: 16px;
          padding: 0 5px;
          cursor: pointer;
          margin-left: 5px;
        }
        .script-item {
          border: 1px solid #eeeeee;
          padding: 5px;
          margin-bottom: 10px;
        }
        .script-item.active {
          border-color: #1890ff;
        }
        .ant-typography {
          margin-bottom: 5px;
        }
      }
      .unfull-scripts {
        position: absolute;
        right: 20px;
        z-index: 2;
        top: 18px;
        color: #1890ff;
        width: 26px;
        cursor: pointer;
        padding: 5px;
      }
      .verify-form {
        flex: 1;
        .sql {
          .ant-col-sm-8 {
            width: 10.5%;
          }
          .ant-col-sm-16 {
            width: 89.5%;
            padding-top: 4px;
          }
          .CodeMirror {
            height: auto;
            min-height: calc(100vh - 230px);
          }
          .CodeMirror-scroll {
            min-height: calc(100vh - 230px);
          }
        }
        .sqlfield {
          .ant-form-item {
            margin-bottom: 5px;
          }
          .ant-form-item-control {
            line-height: 24px;
          }
          .ant-form-item-label {
            line-height: 25px;
          }
          .ant-form-item-children {
            line-height: 22px;
          }
          .ant-col-sm-8 {
            width: 10.5%;
          }
          .ant-col-sm-16 {
            width: 89.5%;
          }
        }
        .add {
          padding-top: 4px;
        }
      }
    }
    .ant-modal-body::-webkit-scrollbar {
      width: 7px;
    }
    .ant-modal-body::-webkit-scrollbar-thumb {
      border-radius: 5px;
      box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13);
      background: rgba(0, 0, 0, 0.13);
    }
    .ant-modal-body::-webkit-scrollbar-track {
      box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
      border-radius: 3px;
      border: 1px solid rgba(0, 0, 0, 0.07);
      background: rgba(0, 0, 0, 0);
    }
  }
}