king
2022-08-08 176c6e1da22e96a1110fa91f8fc8eb8ad2881e08
2022-08-08
15个文件已修改
258 ■■■■ 已修改文件
src/components/normalform/modalform/index.jsx 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/formaction/actionform/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/formaction/actionform/index.scss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/tabs/antv-tabs/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/tabs/antv-tabs/options.jsx 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/tabs/antv-tabs/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/tabs/antv-tabs/options.jsx 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/tabs/antv-tabs/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/actionform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobdesign/index.jsx 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/normalform/modalform/index.jsx
@@ -275,16 +275,29 @@
      if (!content) return
      fields.push(
        <Col span={item.span || 12} key={index}>
          <Form.Item label={label}>
            {getFieldDecorator(item.field, {
              initialValue: item.initval,
              rules: item.rules
            })(content)}
          </Form.Item>
        </Col>
      )
      if (item.help) {
        fields.push(
          <Col span={item.span || 12} key={index}>
            <Form.Item label={label} help={<span style={{fontSize: '12px'}}>{item.help}</span>}>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: item.rules
              })(content)}
            </Form.Item>
          </Col>
        )
      } else {
        fields.push(
          <Col span={item.span || 12} key={index}>
            <Form.Item label={label}>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: item.rules
              })(content)}
            </Form.Item>
          </Col>
        )
      }
    })
    
    return fields
src/menu/components/form/formaction/actionform/index.jsx
@@ -192,7 +192,7 @@
  getFields() {
    const { getFieldDecorator } = this.props.form
    const { interType } = this.state
    const { interType, callbackType } = this.state
    const fields = []
    this.state.formlist.forEach((item, index) => {
@@ -219,7 +219,7 @@
            message: formRule.func.maxMessage
          }]
        } else if (item.key === 'output') {
          if (interType === 'system') {
          if (interType === 'system' || ((interType === 'outer' || interType === 'custom') && callbackType === 'script')) {
            _rules = [{
              pattern: /^@[0-9a-zA-Z_]+@?$/,
              message: '变量以@符开头,可使用字母、数字以及_'
src/menu/components/form/formaction/actionform/index.scss
@@ -4,6 +4,11 @@
    color: #1890ff;
    cursor: pointer;
  }
  >.ant-row >.ant-col {
    float: none;
    display: inline-block;
    vertical-align: top;
  }
  .textarea {
    .ant-col-sm-7 {
      width: 14%;
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -722,7 +722,7 @@
            { max: formRule.func.max, message: formRule.func.maxMessage }
          )
        } else if (item.key === 'output') {
          if (this.record.intertype === 'system') {
          if (this.record.intertype === 'system' || ((this.record.intertype === 'outer' || this.record.intertype === 'custom') && this.record.callbackType === 'script')) {
            rules = [{
              pattern: /^@[0-9a-zA-Z_]+@?$/,
              message: '变量以@符开头,可使用字母、数字以及_'
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -52,15 +52,28 @@
  ]
  let getTabs = (list) => {
    return list.filter(item => {
      if (item.type !== 'tabs') return false
    let _list = []
    list.forEach(item => {
      if (item.type !== 'tabs') return
      item.children = item.children.map(cell => {
        cell.children = getTabs(cell.children)
        return cell
      _list.push({
        value: item.uuid,
        label: item.name,
        children: item.subtabs.map(cell => {
          let children = getTabs(cell.components)
          if (children.length === 0) {
            children = null
          }
          return {
            value: cell.uuid,
            label: cell.label,
            children: children
          }
        })
      })
      return item
    })
    return _list
  }
  // if (type === 'editable') {
@@ -74,8 +87,7 @@
  //     }
  //   ]
  // }
  let tabs = getTabs(JSON.parse(JSON.stringify(modules)))
  let tabs = getTabs(JSON.parse(JSON.stringify(window.GLOB.customMenu.components)))
  let pageTemps = [
    { value: 'billprint', text: '单据打印' },
src/menu/components/tabs/antv-tabs/index.jsx
@@ -318,6 +318,7 @@
    editab.hide = res.hide || 'false'
    editab.backgroundColor = res.backgroundColor
    editab.controlVal = res.controlVal || ''
    editab.selectVal = res.selectVal || ''
    editab.blacklist = res.blacklist
    if (editab.uuid) {
src/menu/components/tabs/antv-tabs/options.jsx
@@ -52,9 +52,16 @@
      field: 'controlVal',
      label: '隐藏标记',
      initval: tab.controlVal || '',
      tooltip: '当禁用字段值与隐藏标记相等时,标签页会隐藏。',
      tooltip: '当禁用字段值与隐藏标记相等时,标签页会隐藏。注:多个值请用逗号分隔。',
      required: false,
      // forbid: appType === 'mob',
    },
    {
      type: 'text',
      field: 'selectVal',
      label: '选中标记',
      initval: tab.selectVal || '',
      tooltip: '当选中字段值与选中标记相等时,标签页默认选中。',
      required: false
    },
    {
      type: 'color',
@@ -96,6 +103,10 @@
  let roleList = sessionStorage.getItem('sysRoles')
  let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, uuid) || []
  modules.push({
    value: 'preview',
    label: '上一页(url参数)'
  })
  if (roleList) {
    try {
@@ -198,13 +209,13 @@
      label: '上级组件',
      initval: setting.supModule || [],
      tooltip: '标签组可以选择上级组件,填入禁用字段,用于控制标签隐藏。',
      help: '用于控制标签页隐藏。',
      required: false,
      allowClear: true,
      options: modules,
      controlFields: [
        {field: 'controlField', notNull: true},
      ],
      // forbid: appType === 'mob',
    },
    {
      type: 'text',
@@ -213,7 +224,14 @@
      initval: setting.controlField || '',
      tooltip: '用于控制标签隐藏的字段,在标签中填入隐藏标记。',
      required: true,
      // forbid: appType === 'mob',
    },
    {
      type: 'text',
      field: 'selectField',
      label: '选中字段',
      initval: setting.selectField || '',
      tooltip: '用于控制标签页初始化选中,在标签中填入选中标记,注:数据源于url参数。',
      required: false
    },
    {
      type: 'color',
src/mob/components/tabs/antv-tabs/index.jsx
@@ -341,6 +341,7 @@
    editab.hide = res.hide || 'false'
    editab.backgroundColor = res.backgroundColor
    editab.controlVal = res.controlVal || ''
    editab.selectVal = res.selectVal || ''
    editab.blacklist = res.blacklist
    if (editab.uuid) {
src/mob/components/tabs/antv-tabs/options.jsx
@@ -52,7 +52,15 @@
      field: 'controlVal',
      label: '隐藏标记',
      initval: tab.controlVal || '',
      tooltip: '当禁用字段值与隐藏标记相等时,标签页会隐藏。',
      tooltip: '当禁用字段值与隐藏标记相等时,标签页会隐藏。注:多个值请用逗号分隔。',
      required: false
    },
    {
      type: 'text',
      field: 'selectVal',
      label: '选中标记',
      initval: tab.selectVal || '',
      tooltip: '当选中字段值与选中标记相等时,标签页默认选中。',
      required: false
    },
    {
@@ -92,6 +100,10 @@
 */
export function getTabsSetForm(setting, uuid) {
  let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, uuid) || []
  modules.push({
    value: 'preview',
    label: '上一页(url参数)'
  })
  const tabForm = [
    {
@@ -146,6 +158,7 @@
      label: '上级组件',
      initval: setting.supModule || [],
      tooltip: '标签组可以选择上级组件,填入禁用字段,用于控制标签隐藏。',
      help: '用于控制标签页隐藏。',
      required: false,
      allowClear: true,
      options: modules,
@@ -162,6 +175,14 @@
      required: true
    },
    {
      type: 'text',
      field: 'selectField',
      label: '选中字段',
      initval: setting.selectField || '',
      tooltip: '用于控制标签页初始化选中,在标签中填入选中标记,注:数据源于url参数。',
      required: false
    },
    {
      type: 'color',
      field: 'backgroundColor',
      label: '背景(标题栏)',
src/tabviews/custom/components/tabs/antv-tabs/index.jsx
@@ -52,8 +52,13 @@
    if (config.setting.autoSwitch === 'true' && config.subtabs.length > 1 && config.setting.interval) {
      this.autoSwitch(config.setting.interval)
    }
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    if (config.activeKey) {
      let node = document.getElementById('tab' + config.activeKey)
      node && node.click()
    }
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
  }
  /**
@@ -81,13 +86,18 @@
          tabs: {...tabs, subtabs: []}
        })
      } else {
        let val = data[tabs.setting.controlField] === undefined ? '' : data[tabs.setting.controlField] + ''
        let val = ''
        Object.keys(data).forEach(key => {
          if (key.toLowerCase() === tabs.setting.controlField) {
            val = data[key]
          }
        })
        this.setState({
          tabs: {...tabs, subtabs: this.props.config.subtabs.filter(tab => {
            if (tab.controlVal === val) {
              return false
            } else if (/,/ig.test(tab.controlVal)) {
              return tab.controlVal.split(',').includes(val)
              return !tab.controlVal.split(',').includes(val)
            }
            return true
          })}
src/tabviews/custom/index.jsx
@@ -73,7 +73,7 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { permAction, param } = this.props
    const { permAction } = this.props
    let _param = {
      func: 'sPC_Get_LongParam',
@@ -138,7 +138,9 @@
      let roleId = sessionStorage.getItem('role_id') || '' // 角色ID
      let balMap = new Map()
      let skip = config.permission === 'false' || window.GLOB.mkHS
      config.components = this.filterComponent(config.components, roleId, permAction, balMap, skip)
      let param = this.props.param || {} // url参数
      config.components = this.filterComponent(config.components, roleId, permAction, balMap, skip, param)
      
      // 获取主搜索条件
      let mainSearch = []
@@ -147,7 +149,7 @@
        component.search = component.search.map(item => {
          item.oriInitval = item.initval
          if (['text', 'select', 'link'].includes(item.type) && param && param.$searchkey === item.field) {
          if (['text', 'select', 'link'].includes(item.type) && param.$searchkey === item.field) {
            item.initval = param.$searchval
          }
@@ -158,7 +160,7 @@
      })
      let params = []
      let BID = param && param.$BID ? param.$BID : ''
      let BID = param.$BID || ''
      let inherit = {}
      if (config.cacheUseful === 'true') { // 缓存继承
@@ -188,7 +190,7 @@
      }
      if (config.urlFields) {
        config.urlFields.forEach(field => {
          let val = `'${param ? (param[field] || '') : ''}'`
          let val = `'${param[field] || ''}'`
          regs.push({
            reg: new RegExp('@' + field + '@', 'ig'),
            value: val
@@ -441,7 +443,7 @@
    })
  }
  filterComponent = (components, roleId, permAction, balMap, skip) => {
  filterComponent = (components, roleId, permAction, balMap, skip, urlparam) => {
    return components.filter(item => {
      
      if (item.style && item.style.boxShadow) {
@@ -473,8 +475,58 @@
          return true
        })
        if (item.setting.supModule) {
          let pid = item.setting.supModule.pop()
          item.setting.supModule = pid || ''
          if (item.setting.supModule) {
            item.setting.controlField = item.setting.controlField.toLowerCase()
            if (item.setting.supModule === 'preview') {
              item.setting.supModule = ''
              let val = ''
              Object.keys(urlparam).forEach(key => {
                if (key.toLowerCase() === item.setting.controlField) {
                  val = urlparam[key]
                }
              })
              item.subtabs = item.subtabs.filter(tab => {
                if (tab.controlVal === val) {
                  return false
                } else if (/,/ig.test(tab.controlVal)) {
                  return !tab.controlVal.split(',').includes(val)
                }
                return true
              })
            }
          }
        }
        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 activeKey = ''
          item.subtabs.forEach(tab => {
            if (!activeKey && tab.selectVal === val) {
              activeKey = tab.uuid
            }
          })
          item.activeKey = activeKey
        }
        item.subtabs = item.subtabs.map(tab => {
          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip)
          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam)
          return tab
        })
@@ -489,6 +541,8 @@
          })
        })
        item.parentIds = supIds
        return true
      } else if (item.type === 'group') {
        if (
          item.setting.blacklist && item.setting.blacklist.length > 0 &&
@@ -497,7 +551,9 @@
          return false
        }
        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip)
        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam)
        return true
      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) {
        if (
          item.plot.blacklist && item.plot.blacklist.length > 0 &&
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -1394,8 +1394,13 @@
        }
      })
      _backCustomScript += `
        aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
      if (btn.output) {
        _backCustomScript += `
          aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg,${btn.output} as mk_b_id`
      } else {
        _backCustomScript += `
          aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
      }
      let sql = [...lineMap.values()].map(item => (`
        ${item.insert}
src/templates/sharecomponent/actioncomponent/actionform/index.jsx
@@ -549,7 +549,7 @@
            { max: formRule.func.max, message: formRule.func.maxMessage }
          )
        } else if (item.key === 'output') {
          if (this.record.intertype === 'system') {
          if (this.record.intertype === 'system' || ((this.record.intertype === 'outer' || this.record.intertype === 'custom') && this.record.callbackType === 'script')) {
            rules = [{
              pattern: /^@[0-9a-zA-Z_]+@?$/,
              message: '变量以@符开头,可使用字母、数字以及_'
src/templates/zshare/formconfig.jsx
@@ -2945,7 +2945,7 @@
      type: 'text',
      key: 'separator',
      label: '连接符',
      initVal: card.separator || card.separator === undefined ? '/' : '',
      initVal: card.separator === undefined ? '/' : card.separator,
      tooltip: '表单提交时信息之间的连接符。注:连接符为空时,初始化时填充其他表单无效。',
      required: false,
      readonly: false
src/views/mobdesign/index.jsx
@@ -1625,16 +1625,16 @@
    let searchSum = 0
    let swipes = []
    let check = (components) => {
    let check = (components, level, sign) => {
      components.forEach(item => {
        if (error) return
        if (item.type === 'tabs') {
          item.subtabs.forEach(tab => {
            check(tab.components)
            check(tab.components, level + 1, tab.uuid)
          })
          return
        } else if (item.type === 'group') {
          check(item.components)
          check(item.components, level, sign)
          return
        } else if (item.type === 'navbar' && !item.wrap.MenuNo) {
          error = `导航栏《${item.name}》未设置菜单参数!`
@@ -1649,7 +1649,8 @@
          }
        }
        if (item.wrap && item.wrap.pagestyle === 'slide' && item.pageable && item.setting.laypage !== 'false') {
          swipes.push(item.name)
          // swipes.push(item.name)
          swipes.push({level, name: item.name, sign})
        }
        item.errors && item.errors.forEach(err => {
@@ -1659,7 +1660,7 @@
      })
    }
    check(config.components)
    check(config.components, 1, 'view')
    // if (!error && viewType === 'userbind' && config.components.filter(item => item.type === 'login').length === 0) {
    //   error = '用户绑定页面必须添加登录。'
@@ -1667,8 +1668,27 @@
    if (!error && searchSum > 1) {
      error = '搜索组件与导航栏的搜索功能不可同时使用。'
    } else if (!error && swipes.length > 1) {
      error = `页面中不可同时使用多个滑动加载组件。(${swipes.join('、')})`
    } else if (!error && swipes.length > 0) {
      swipes.forEach(cell => {
        if (!error && cell.level > 2) {
          error = `不可在多层标签页中使用滑动加载组件。(${cell.name})`
        }
      })
      if (!error) {
        let levels = swipes.map(s => s.level)
        levels = Array.from(new Set(levels))
        if (levels.length > 1) {
          error = `不可在页面与标签页中同时使用滑动加载组件。(${swipes.map(s => s.name).join('、')})`
        }
      }
      if (!error) {
        let signs = swipes.map(s => s.sign)
        signs = Array.from(new Set(signs))
        if (signs.length !== swipes.length) {
          error = `页面中(或同一标签页中)不可同时使用多个滑动加载组件。(${swipes.map(s => s.name).join('、')})`
        }
      }
    }
    if (show && error) {