king
2023-03-02 5a542f58fba7fa063d66f5ac8dd8f31dd8209017
2023-03-02
6个文件已修改
482 ■■■■■ 已修改文件
src/tabviews/commontable/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/calendarconfig/index.jsx 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 151 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/treepageconfig/index.jsx 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx
@@ -177,7 +177,8 @@
            }
            tab.ContainerId = this.state.ContainerId
            return window.GLOB.mkActions[tab.linkTab]
            // return window.GLOB.mkActions[tab.linkTab]
            return tab
          })
        })
      } else {
src/templates/calendarconfig/index.jsx
@@ -422,19 +422,19 @@
        return
      }
      let tabParam = { // 添加菜单tab页
        func: 'sPC_sMenusTab_AddUpt',
        MenuID: menu.MenuID
      }
      // let tabParam = { // 添加菜单tab页
      //   func: 'sPC_sMenusTab_AddUpt',
      //   MenuID: menu.MenuID
      // }
      if (_config.tab) {
        tabParam.LText = Utils.formatOptions(`select '${menu.MenuID}' as MenuID ,'${_config.tab.linkTab}' as Tabid,'${_config.tab.label}' as TabName ,'0' as Sort`)
      } else {
        tabParam.LText = Utils.formatOptions(`select '${menu.MenuID}' as MenuID ,'' as Tabid,'' as TabName ,'0' as Sort`)
      }
      // if (_config.tab) {
      //   tabParam.LText = Utils.formatOptions(`select '${menu.MenuID}' as MenuID ,'${_config.tab.linkTab}' as Tabid,'${_config.tab.label}' as TabName ,'0' as Sort`)
      // } else {
      //   tabParam.LText = Utils.formatOptions(`select '${menu.MenuID}' as MenuID ,'' as Tabid,'' as TabName ,'0' as Sort`)
      // }
      tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
      // tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      // tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
      let _vals = this.getFuncNames(_config.funcs, [], [])
      let _tables = Array.from(new Set(_vals.table))
@@ -478,41 +478,14 @@
          this.setState({
            config: _config,
            openEdition: response.open_edition || '',
            originMenu: fromJS(_config).toJS()
            originMenu: fromJS(_config).toJS(),
            menuloading: false,
            menucloseloading: false
          }, () => {
            reload && MKEmitter.emit('revert')
          })
          this.props.reloadmenu()
          // 标签信息保存
          Api.getSystemConfig(tabParam).then(result => {
            if (result.status) {
              notification.success({
                top: 92,
                message: '保存成功',
                duration: 2
              })
              if (this.state.closeVisible) {
                this.handleViewBack()
              } else {
                this.setState({
                  menuloading: false,
                  menucloseloading: false
                })
              }
            } else {
              notification.warning({
                top: 92,
                message: result.message,
                duration: 5
              })
              this.setState({
                menuloading: false,
                menucloseloading: false
              })
            }
          })
          localParam.func = 'sPC_TrdMenu_AddUpt_For_Local'
          delete localParam.LongParam
@@ -523,6 +496,16 @@
          delete localParam.open_edition
          Api.genericInterface(localParam)
          notification.success({
            top: 92,
            message: '保存成功',
            duration: 2
          })
          if (this.state.closeVisible) {
            this.handleViewBack()
          }
        } else {
          this.setState({
            menuloading: false,
src/templates/comtableconfig/index.jsx
@@ -380,7 +380,7 @@
    }
    let _sort = 0
    let btntabs = []
    // let btntabs = []
    let btnParam = {             // 添加菜单按钮
      func: 'sPC_Button_AddUpt',
@@ -396,14 +396,14 @@
    _config.action.forEach(item => {
      if (item.hidden === 'true') return
      _sort++
      if (item.OpenType === 'popview') {
        btntabs.push({
          uuid: item.uuid,
          linkTab: item.linkTab,
          label: item.label,
          sort: _sort
        })
      }
      // if (item.OpenType === 'popview') {
      //   btntabs.push({
      //     uuid: item.uuid,
      //     linkTab: item.linkTab,
      //     label: item.label,
      //     sort: _sort
      //   })
      // }
      
      btnParam.LText.push(`select '${item.uuid}' as menuid, '${item.label}' as menuname, '${_sort * 10}' as Sort`)
    })
@@ -413,33 +413,33 @@
    btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp)
    
    let tabParam = { // 添加菜单tab页
      func: 'sPC_sMenusTab_AddUpt',
      MenuID: menu.MenuID
    }
    // let tabParam = { // 添加菜单tab页
    //   func: 'sPC_sMenusTab_AddUpt',
    //   MenuID: menu.MenuID
    // }
    let _LText = []
    // let _LText = []
    btntabs.forEach(item => {
      _LText.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${item.sort * 10}' as Sort`)
    })
    _config.tabgroups.forEach(group => {
      group.sublist.forEach(item => {
        _sort++
        _LText.push(`select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
      })
    })
    // btntabs.forEach(item => {
    //   _LText.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${item.sort * 10}' as Sort`)
    // })
    // _config.tabgroups.forEach(group => {
    //   group.sublist.forEach(item => {
    //     _sort++
    //     _LText.push(`select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
    //   })
    // })
    _LText = _LText.join(' union all ')
    // _LText = _LText.join(' union all ')
    // 清空菜单下关联的标签
    if (!_LText) {
      _LText = `select '${menu.MenuID}' as MenuID ,'' as Tabid,'' as TabName ,'0' as Sort`
    }
    // if (!_LText) {
    //   _LText = `select '${menu.MenuID}' as MenuID ,'' as Tabid,'' as TabName ,'0' as Sort`
    // }
    tabParam.LText = Utils.formatOptions(_LText)
    tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
    // tabParam.LText = Utils.formatOptions(_LText)
    // tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    // tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
    let _vals = this.getFuncNames(_config)
@@ -596,7 +596,7 @@
            delete localParam.EasyCode
            delete localParam.open_edition
            this.submitAction(btnParam, tabParam, localParam)
            this.submitAction(btnParam, localParam)
          } else {
            this.setState({
              menuloading: false,
@@ -616,52 +616,29 @@
  /**
   * @description 保存或修改菜单按钮集
   */
  submitAction = (btnParam, tabParam, localParam) => {
  submitAction = (btnParam, localParam) => {
    const { config } = this.state
    new Promise(resolve => {
      let deffers = []
      let defer = new Promise(resolve => {
        Api.getSystemConfig(tabParam).then(result => {
          resolve(result)
        })
      })
      deffers.push(defer)
      if (btnParam.LText) {
        let defer = new Promise(resolve => {
          Api.getSystemConfig(btnParam).then(result => {
            if (result.status) {
              this.setState({ // 保存成功后清空复制列表
                copyActions: []
              })
            }
            resolve(result)
          })
        })
        deffers.push(defer)
      }
      Promise.all(deffers).then(result => {
        let error = false
        result.forEach(res => {
          if (!res.status) {
            error = res
          }
        })
        if (error) {
          } else {
          notification.warning({
            top: 92,
            message: error.message,
              message: result.message,
            duration: 5
          })
          resolve(false)
          }
        })
        } else {
          resolve(true)
        }
      })
    }).then(response => {
      if (response === false) return response
src/templates/formtabconfig/index.jsx
@@ -951,26 +951,26 @@
        btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp)
        
        let tabParam = { // 添加菜单tab页
          func: 'sPC_sMenusTab_AddUpt',
          MenuID: btnTab.uuid
        }
        // let tabParam = { // 添加菜单tab页
        //   func: 'sPC_sMenusTab_AddUpt',
        //   MenuID: btnTab.uuid
        // }
        
        let _LText = []
        // let _LText = []
        config.tabgroups.forEach(group => {
          group.sublist.forEach(item => {
            _sort++
            _LText.push(`select '${btnTab.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
          })
        })
        // config.tabgroups.forEach(group => {
        //   group.sublist.forEach(item => {
        //     _sort++
        //     _LText.push(`select '${btnTab.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
        //   })
        // })
        _LText = _LText.join(' union all ')
        // _LText = _LText.join(' union all ')
        tabParam.LText = Utils.formatOptions(_LText)
        // tabParam.LText = Utils.formatOptions(_LText)
        tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
        // tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        // tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
  
        let param = {
          func: 'sPC_ButtonParam_AddUpt',
@@ -1042,7 +1042,7 @@
                originMenu: _config
              })
    
              this.submitAction(btnParam, tabParam)
              this.submitAction(btnParam)
            } else {
              this.setState({
                menuloading: false,
@@ -1069,43 +1069,14 @@
  /**
   * @description 保存或修改菜单按钮
   */
  submitAction = (btnParam, tabParam) => {
  submitAction = (btnParam) => {
    new Promise(resolve => {
      let deffers = []
      if (tabParam.LText) {
        let defer = new Promise(resolve => {
          Api.getSystemConfig(tabParam).then(result => {
            resolve(result)
          })
        })
        deffers.push(defer)
      }
      if (btnParam.LText) {
        let defer = new Promise(resolve => {
          Api.getSystemConfig(btnParam).then(result => {
            resolve(result)
          })
        })
        deffers.push(defer)
      }
      if (deffers.length === 0) {
        resolve(true)
      } else {
        Promise.all(deffers).then(result => {
          let error = false
          result.forEach(res => {
            if (!res.status) {
              error = res
            }
          })
          if (error) {
          if (!result.status) {
            notification.warning({
              top: 92,
              message: error.message,
              message: result.message,
              duration: 5
            })
            resolve(false)
@@ -1113,8 +1084,15 @@
            resolve(true)
          }
        })
      } else {
        resolve(true)
      }
    }).then(response => {
      this.setState({
        menuloading: false,
        menucloseloading: false
      })
      if (response) {
        notification.success({
          top: 92,
@@ -1123,17 +1101,7 @@
        })
        if (this.state.closeVisible) {
          this.handleViewBack()
        } else {
          this.setState({
            menuloading: false,
            menucloseloading: false
          })
        }
      } else {
        this.setState({
          menuloading: false,
          menucloseloading: false
        })
      }
    })
  }
src/templates/subtableconfig/index.jsx
@@ -5,7 +5,7 @@
import HTML5Backend from 'react-dnd-html5-backend'
import { Button, Card, Modal, Collapse, notification, Spin, Switch, Tooltip, Col } from 'antd'
import { QuestionCircleOutlined, RedoOutlined } from '@ant-design/icons'
import moment from 'moment'
// import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
@@ -365,41 +365,41 @@
      return
    }
    let btnParam = {
      func: 'sPC_Button_AddUpt',
      Type: 40,
      ParentID: _config.uuid,
      MenuNo: _config.tabNo,
      Template: 'SubTable',
      PageParam: '',
      LongParam: '',
      LText: []
    }
    // let btnParam = {
    //   func: 'sPC_Button_AddUpt',
    //   Type: 40,
    //   ParentID: _config.uuid,
    //   MenuNo: _config.tabNo,
    //   Template: 'SubTable',
    //   PageParam: '',
    //   LongParam: '',
    //   LText: []
    // }
    let btntabs = []
    // let btntabs = []
    _config.action.forEach((item, index) => {
      if (item.hidden === 'true') return
      if (item.OpenType === 'popview') {
        btntabs.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${(index + 1) * 10}' as Sort`)
      }
      btnParam.LText.push(`select '${item.uuid}' as menuid, '${item.label}' as menuname, '${(index + 1) * 10}' as Sort`)
    })
    // _config.action.forEach((item, index) => {
    //   if (item.hidden === 'true') return
    //   if (item.OpenType === 'popview') {
    //     btntabs.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${(index + 1) * 10}' as Sort`)
    //   }
    //   btnParam.LText.push(`select '${item.uuid}' as menuid, '${item.label}' as menuname, '${(index + 1) * 10}' as Sort`)
    // })
    btnParam.LText = btnParam.LText.join(' union all ')
    btnParam.LText = Utils.formatOptions(btnParam.LText)
    btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp)
    // btnParam.LText = btnParam.LText.join(' union all ')
    // btnParam.LText = Utils.formatOptions(btnParam.LText)
    // btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    // btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp)
    let tabParam = { // 添加标签按钮tab页
      func: 'sPC_sMenusTab_AddUpt',
      MenuID: _config.uuid,
      LText: btntabs.join(' union all ')
    }
    // let tabParam = { // 添加标签按钮tab页
    //   func: 'sPC_sMenusTab_AddUpt',
    //   MenuID: _config.uuid,
    //   LText: btntabs.join(' union all ')
    // }
    tabParam.LText = Utils.formatOptions(tabParam.LText)
    tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
    // tabParam.LText = Utils.formatOptions(tabParam.LText)
    // tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    // tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
    let param = {
      func: 'sPC_Tab_AddUpt',
@@ -530,8 +530,16 @@
              menuloading: false,
              menucloseloading: false
            })
            this.submitAction(btnParam, tabParam)
            notification.success({
              top: 92,
              message: '保存成功',
              duration: 2
          })
            if (this.state.closeVisible) {
              this.handleViewBack()
            }
          })
          this.submitAction()
        } else {
          this.setState({
            menuloading: false,
@@ -550,60 +558,8 @@
  /**
   * @description 保存或修改菜单按钮
   */
  submitAction = (btnParam, tabParam) => {
  submitAction = () => {
    const { config } = this.state
    new Promise(resolve => {
      let deffers = []
      if (tabParam.LText) {
        let defer = new Promise(resolve => {
          Api.getSystemConfig(tabParam).then(result => {
            resolve(result)
          })
        })
        deffers.push(defer)
      }
      if (btnParam.LText) {
        let defer = new Promise(resolve => {
          Api.getSystemConfig(btnParam).then(result => {
            if (result.status) {
              this.setState({ // 保存成功后清空复制列表
                copyActions: []
              })
            }
            resolve(result)
          })
        })
        deffers.push(defer)
      }
      if (deffers.length === 0) {
        resolve(true)
      } else {
        Promise.all(deffers).then(result => {
          let error = false
          result.forEach(res => {
            if (!res.status) {
              error = res
            }
          })
          if (error) {
            notification.warning({
              top: 92,
              message: error.message,
              duration: 5
            })
            resolve(false)
          } else {
            resolve(true)
          }
        })
      }
    }).then(response => {
      if (response === false) return response
      let oriActions = []
      this.state.originActions.forEach(item => {
@@ -618,7 +574,7 @@
        })
      })
      if (oriActions.length === 0) return 'true'
    if (oriActions.length === 0) return
      oriActions.forEach(action => {
        Api.getSystemConfig({
@@ -652,29 +608,6 @@
            }
          }
        })
      })
      return 'true'
    }).then(response => {
      if (response === 'true') {
        notification.success({
          top: 92,
          message: '保存成功',
          duration: 2
        })
        if (this.state.closeVisible) {
          this.handleViewBack()
        } else {
          this.setState({
            menuloading: false,
            menucloseloading: false
          })
        }
      } else {
        this.setState({
          menuloading: false,
          menucloseloading: false
        })
      }
    })
  }
src/templates/treepageconfig/index.jsx
@@ -283,31 +283,31 @@
      return
    }
    let _sort = 0
    let btntabs = []
    // let _sort = 0
    // let btntabs = []
    
    let tabParam = { // 添加菜单tab页
      func: 'sPC_sMenusTab_AddUpt',
      MenuID: menu.MenuID
    }
    // let tabParam = { // 添加菜单tab页
    //   func: 'sPC_sMenusTab_AddUpt',
    //   MenuID: menu.MenuID
    // }
    let _LText = []
    // let _LText = []
    btntabs.forEach(item => {
      _LText.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${item.sort * 10}' as Sort`)
    })
    _config.tabgroups.forEach(group => {
      group.sublist.forEach(item => {
        _sort++
        _LText.push(`select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
      })
    })
    // btntabs.forEach(item => {
    //   _LText.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${item.sort * 10}' as Sort`)
    // })
    // _config.tabgroups.forEach(group => {
    //   group.sublist.forEach(item => {
    //     _sort++
    //     _LText.push(`select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
    //   })
    // })
    _LText = _LText.join(' union all ')
    // _LText = _LText.join(' union all ')
    tabParam.LText = Utils.formatOptions(_LText)
    tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
    // tabParam.LText = Utils.formatOptions(_LText)
    // tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    // tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
    let _funcs = []
    let _tables = []
@@ -414,13 +414,11 @@
          this.setState({
            config: _config,
            openEdition: response.open_edition || '',
            originMenu: fromJS(_config).toJS()
            originMenu: fromJS(_config).toJS(),
            menuloading: false,
            menucloseloading: false
          })
          // 存在标签页时
          if (tabParam.LText) {
            Api.getSystemConfig(tabParam).then(result => {
              if (result.status) {
                notification.success({
                  top: 92,
                  message: '保存成功',
@@ -432,42 +430,6 @@
                if (this.state.closeVisible) {
                  this.props.handleView()
                } else {
                  this.setState({
                    menuloading: false,
                    menucloseloading: false
                  })
                }
              } else {
                notification.warning({
                  top: 92,
                  message: result.message,
                  duration: 5
                })
                this.setState({
                  menuloading: false,
                  menucloseloading: false
                })
              }
            })
          } else {
            notification.success({
              top: 92,
              message: '保存成功',
              duration: 2
            })
            this.props.reloadmenu()
            Api.genericInterface(localParam)
            if (this.state.closeVisible) {
              this.props.handleView()
            } else {
              this.setState({
                menuloading: false,
                menucloseloading: false
              })
            }
          }
        } else {
          this.setState({