king
2024-05-21 66bdbc1df92e8ec4a5108a4e0323e25a7b9ff8f8
src/tabviews/custom/popview/index.jsx
@@ -2,6 +2,7 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { notification, Spin, Row, Col, Modal } from 'antd'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
@@ -61,7 +62,7 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { Tab } = this.props
    const { Tab, param } = this.props
    let config = Tab.config || ''
@@ -105,9 +106,18 @@
    // 权限过滤
    let roleId = sessionStorage.getItem('role_id') || '' // 角色ID
    let balMap = new Map()
    let param = this.props.param || {} // url参数
    let urlparam = {} // url参数
    if (param) {
      Object.keys(param).forEach(key => {
        if (/^\$/.test(key)) {
          urlparam[key] = param[key]
        } else {
          urlparam[key.toLowerCase()] = param[key]
        }
      })
    }
    window.GLOB.CacheData.set(Tab.uuid, param)
    window.GLOB.CacheData.set(Tab.uuid, urlparam)
    let userName = sessionStorage.getItem('User_Name') || ''
    let fullName = sessionStorage.getItem('Full_Name') || ''
@@ -129,7 +139,7 @@
      regs.push({ reg: /@works_flow_code@/ig, value: `'${flow.flow_code || ''}'` })
    }
    config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, Tab.uuid, Tab.uuid)
    config.components = this.filterComponent(config.components, roleId, balMap, urlparam, Tab, Tab.uuid, Tab.uuid)
    
    // 获取主搜索条件
    config.components.forEach(component => {
@@ -143,7 +153,7 @@
    })
    let params = []
    let BID = param.$BID || ''
    let BID = urlparam.$BID || ''
    config.components = this.formatSetting(config.components, params, regs, balMap)
@@ -226,12 +236,7 @@
          if (item.setting.supModule === 'preview') {
            item.setting.supModule = ''
            let val = ''
            Object.keys(urlparam).forEach(key => {
              if (key.toLowerCase() === item.setting.controlField) {
                val = urlparam[key]
              }
            })
            let val = urlparam[item.setting.controlField] || ''
            item.subtabs = item.subtabs.filter(tab => {
              if (tab.$pass) return true
@@ -244,12 +249,7 @@
        if (item.setting.selectField) {
          item.setting.selectField = item.setting.selectField.toLowerCase()
          let val = ''
          Object.keys(urlparam).forEach(key => {
            if (key.toLowerCase() === item.setting.selectField) {
              val = urlparam[key]
            }
          })
          let val = urlparam[item.setting.selectField] || ''
          let activeKey = ''
@@ -361,7 +361,10 @@
              col.type = 'custom'
            }
            
            if (col.type === 'number') {
            if (col.type === 'index') {
              col.field = '$Index'
              col.type = 'text'
            } else if (col.type === 'number') {
              if (typeof(col.decimal) === 'number') {
                col.round = Math.pow(10, col.decimal)
                if (col.format === 'percent') {
@@ -412,6 +415,13 @@
        
        item.cols = getCols(item.cols)
        if (item.hasExtend) {
          item.setting.hasExtend = true
          item.setting.tableMode = 'compatible'
          item.setting.extendTime = moment().format('YYYY-MM-DD HH:mm:ss')
          item.colsCtrls = null
        }
        if (item.subtype === 'editable') {
          item.submit.logLabel = item.$menuname + '-提交'
          item.submit.$menuId = item.uuid