king
2021-09-01 31ec63f0419895876cbaba99637a884a32d33d0d
src/templates/formtabconfig/index.jsx
@@ -10,30 +10,31 @@
import Api from '@/api'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import Utils from '@/utils/utils.js'
import DevUtils from '@/utils/devutils.js'
import Utils, { FuncUtils } from '@/utils/utils.js'
import { getModalForm, getActionForm } from '@/templates/zshare/formconfig'
import { queryTableSql } from '@/utils/option.js'
import TabsComponent from '@/templates/sharecomponent/tabscomponent'
import ModalForm from '@/templates/zshare/modalform'
import PasteForm from '@/templates/zshare/pasteform'
import ActionForm from './actionform'
import SettingForm from './settingform'
import DragElement from './dragelement'
import GroupForm from './groupform'
import EditCard from '@/templates/zshare/editcard'
import VerifyCard from '@/templates/zshare/verifycard'
import MenuForm from '@/templates/zshare/menuform'
import SourceElement from '@/templates/zshare/dragsource'
import CreateFunc from '@/templates/zshare/createfunc'
import asyncComponent from '@/utils/asyncComponent'
import Source from './source'
import './index.scss'
const { Panel } = Collapse
const { Option } = Select
const { confirm } = Modal
const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform'))
const CreateFunc = asyncComponent(() => import('@/templates/zshare/createfunc'))
const VerifyCard = asyncComponent(() => import('@/templates/zshare/verifycard'))
class ComTableConfig extends Component {
  static propTpyes = {
@@ -44,7 +45,7 @@
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,        // 字典
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,        // 字典
    config: null,            // 页面配置
    modaltype: '',           // 模态框类型,控制模态框显示
    tableVisible: false,     // 数据表字段模态框
@@ -439,7 +440,7 @@
      _formfields = [..._formfields, ...group.sublist]
    })
    _inputfields = _formfields.filter(item => item.type === 'text' || item.type === 'number')
    _inputfields = _formfields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color')
    _tabfields = _formfields.filter(item => card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type))
    _tabfields.unshift({field: '', text: '原表单'})
    
@@ -497,7 +498,7 @@
    if (usefulFields) {
      try {
        usefulFields = JSON.parse(usefulFields)
      } catch {
      } catch (e) {
        usefulFields = []
      }
    } else {
@@ -507,7 +508,6 @@
    let ableField = usefulFields.join(', ')
    let functip = <div>
      <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p>
      <p>{this.state.dict['model.tooltip.func.outface']}</p>
    </div>
    this.setState({
@@ -613,6 +613,7 @@
  
          let param = {
            func: 's_debug_sql',
            exec_type: 'y',
            LText: res.dataSource
          }
@@ -620,7 +621,7 @@
          param.LText = Utils.formatOptions(param.LText)
          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
          param.secretkey = Utils.encrypt(param.LText, param.timestamp)
          param.secretkey = Utils.encrypt('', param.timestamp)
  
          if (window.GLOB.mainSystemApi && res.database === 'sso') {
            param.rduri = window.GLOB.mainSystemApi
@@ -731,8 +732,8 @@
        menuNo: menu.MenuNo
      }
      newLText = Utils.formatOptions(DevUtils.getfunc(_param, btn, menu, _config))
      DelText = Utils.formatOptions(DevUtils.dropfunc(_param.funcName))
      newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config))
      DelText = Utils.formatOptions(FuncUtils.dropfunc(_param.funcName))
      this.refs.btnCreatFunc.exec(btn.innerFunc, newLText, DelText)
    })
@@ -771,8 +772,8 @@
      }
      let _config = {...config, setting: setting}
      let newLText = Utils.formatOptions(DevUtils.getTableFunc(setting, menu, _config)) // 创建存储过程sql
      let DelText = Utils.formatOptions(DevUtils.dropfunc(setting.innerFunc))          // 删除存储过程sql
      let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting, menu, _config)) // 创建存储过程sql
      let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc))          // 删除存储过程sql
      this.refs.tableCreatFunc.exec(setting.innerFunc, newLText, DelText).then(result => {
        if (result === 'success') {
@@ -906,7 +907,7 @@
        if (_ismutil && group.sublist.length === 0) {
          _config.enabled = false
        }
        let arr = group.sublist.filter(item => item.field.toLowerCase() === _primary)
        let arr = group.sublist.filter(item => item.field && item.field.toLowerCase() === _primary)
        if (arr.length > 0) {
          _config.enabled = false
@@ -1469,6 +1470,7 @@
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: res.dataresource
        }
@@ -1476,7 +1478,7 @@
        param.LText = Utils.formatOptions(param.LText)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.secretkey = Utils.encrypt(param.LText, param.timestamp)
        param.secretkey = Utils.encrypt('', param.timestamp)
        
        Api.getLocalConfig(param).then(result => {
          if (result.status) {
@@ -1619,7 +1621,7 @@
    let primaryrepeat = false
    config.groups.forEach(group => {
      let arr = group.sublist.filter(item => item.field.toLowerCase() === _primary)
      let arr = group.sublist.filter(item => item.field && item.field.toLowerCase() === _primary)
      if (arr.length > 0) {
        primaryrepeat = true
@@ -2013,7 +2015,6 @@
          visible={this.state.tableVisible}
          width={'65vw'}
          maskClosable={false}
          style={{minWidth: '900px', maxWidth: '1200px'}}
          cancelText={this.state.dict['model.close']}
          onOk={this.addFieldSubmit}
          onCancel={() => { // 取消添加
@@ -2037,7 +2038,6 @@
          visible={this.state.profileVisible}
          width={'75vw'}
          maskClosable={false}
          style={{minWidth: '900px', maxWidth: '1200px'}}
          okText={this.state.dict['model.submit']}
          onOk={this.verifySubmit}
          onCancel={() => { this.setState({ profileVisible: false }) }}