king
2024-02-19 1e4a7720c748bc0206b02b30f4a2e0b3dafb54f3
src/templates/zshare/createinterface/index.jsx
@@ -6,14 +6,12 @@
import MutilForm from './mutilform'
import Utils from '@/utils/utils.js'
import options from '@/store/options.js'
import { updateForm } from '@/utils/utils-update.js'
import Api from '@/api'
import './index.scss'
class CreateFunc extends Component {
class CreateInterface extends Component {
  static propTypes = {
    dict: PropTypes.object,  // 字典项
    trigger: PropTypes.func
  }
@@ -57,7 +55,7 @@
        _val = ''
      }
      if (item.type === 'datemonth' || item.type === 'dateweek' || item.type === 'daterange') {
      if (['datemonth', 'dateweek', 'daterange', 'range'].includes(item.type)) {
        fields = [item.field, item.field]
      }
@@ -105,9 +103,12 @@
        _fieldMap.set(item.field, true)
        searchText.push(item.field + ' ' + item.match + ' @' + _field + '@')
      } else if (item.type === 'datemonth' || item.type === 'dateweek' || item.type === 'daterange') {
      } else if (['datemonth', 'dateweek', 'daterange'].includes(item.type)) {
        searchText.push('(' + item.field + ' >= @' + item.field + '@ AND ' + item.field + ' < @' + item.field + '1@)')
      } else if (item.type === 'range') {
        searchText.push('(' + item.field + ' >= @' + item.field + '@ AND ' + item.field + ' <= @' + item.field + '1@)')
      } else {
        searchText.push(item.field + ' ' + item.match + ' @' + item.field + '@')
      }
@@ -171,10 +172,10 @@
        required: true,
        options: [{
          value: 'Y',
          text: this.props.dict['model.true']
          text: '是'
        }, {
          value: 'N',
          text: this.props.dict['model.false']
          text: '否'
        }]
      }, {
        type: 'radio',
@@ -184,10 +185,10 @@
        required: true,
        options: [{
          value: 'Y',
          text: this.props.dict['model.true']
          text: '是'
        }, {
          value: 'N',
          text: this.props.dict['model.false']
          text: '否'
        }]
      }]
    })
@@ -262,7 +263,7 @@
    new Promise(resolve => {
      // 获取云端存储过程信息
      Api.getLocalConfig(param).then(result => {
      Api.genericInterface(param).then(result => {
        if (!result.status) {
          notification.warning({
            top: 92,
@@ -336,7 +337,7 @@
      Ltexttableparam: '',
      Ltext: '',
      menuType: menu.type,
      systemType: options.sysType
      systemType: window.GLOB.sysType
    }
    this.setState({
@@ -407,7 +408,7 @@
    new Promise(resolve => {
      if (btn.OpenType === 'pop') {
        Api.getSystemConfig({
        Api.getCloudConfig({
          func: 'sPC_Get_LongParam',
          MenuID: btn.uuid
        }).then(result => {
@@ -457,6 +458,8 @@
                  _fieldtype = 'datetime'
                } else if (_field.type === 'number') {
                  _fieldtype = `decimal(18,${_fieldlen})`
                } else if (_field.type === 'rate') {
                  _fieldtype = `decimal(18,2)`
                }
                _field.fieldtype = _fieldtype
@@ -556,7 +559,7 @@
      _mainParam = fromJS(param).toJS()
      return Api.getLocalConfig(param)
      return Api.genericInterface(param)
    }).then(res => {
      if (res === false) return res
@@ -663,6 +666,8 @@
          _type = 'datetime'
        } else if (form.type === 'number') {
          _type = `decimal(18,${form.fieldlen})`
        } else if (form.type === 'rate') {
          _type = `decimal(18,2)`
        }
        _declarefields.push(`@${_key} ${_type}`)
@@ -1061,7 +1066,7 @@
    } else if (_actionType === 'LogicDelete') { // 逻辑删除
      _sql += `
        /* 默认sql */
        update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifyuserid=@userid@ where ${primaryKey}=@${primaryKey}@;`
        update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifystaff=@fullname,modifyuserid=@userid@ where ${primaryKey}=@${primaryKey}@;`
      
    } else if (_actionType === 'delete') {      // 物理删除
      let _msg = ''
@@ -1108,11 +1113,11 @@
          onClick={this.props.trigger}
          loading={this.state.loading}
        >
          {this.props.dict['header.menu.interface.create']}
          创建接口
        </Button>
        {/* 接口选项 */}
        <Modal
          title={this.props.dict['header.menu.interface.create']}
          title="创建接口"
          visible={this.state.visible}
          width={500}
          maskClosable={false}
@@ -1121,7 +1126,6 @@
          destroyOnClose
        >
          <MutilForm
            dict={this.props.dict}
            formlist={this.state.formlist}
            wrappedComponentRef={(inst) => this.FormRef = inst}
          />
@@ -1131,4 +1135,4 @@
  }
}
export default CreateFunc
export default CreateInterface