king
2023-03-10 cec96a86ed6b3fba6a10d6d46818e9755ac3b5ca
2023-03-10
15个文件已修改
152 ■■■■ 已修改文件
src/menu/components/form/simple-form/index.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/step-form/index.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/tab-form/index.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/modalconfig/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/modalconfig/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardItem/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-G6/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-bar-line/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/form/simple-form/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/form/step-form/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/form/tab-form/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/simple-form/index.jsx
@@ -125,6 +125,7 @@
    card.width = card.wrap.width
    card.name = card.wrap.name
    card.errors = []
    let idCtrl = false
    if (card.wrap.datatype !== 'static') {
      let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : ''
@@ -151,6 +152,9 @@
      card.subcards.forEach(item => {
        item.fields.forEach(m => {
          if (m.dataSource && /@ID@/ig.test(m.dataSource)) {
            idCtrl = true
          }
          if (m.type === 'linkMain' && !supModule) {
            card.errors.push({ level: 1, detail: `请检查关联主表“${m.label}”是否有效`})
          }
@@ -163,12 +167,17 @@
      card.subcards.forEach(item => {
        item.fields.forEach(m => {
          if (m.dataSource && /@ID@/ig.test(m.dataSource)) {
            idCtrl = true
          }
          if (m.type === 'linkMain' && !supModule) {
            card.errors.push({ level: 1, detail: `请检查关联主表“${m.label}”是否有效`})
          }
        })
      })
    }
    card.idCtrl = idCtrl
    this.setState({
      card: card
@@ -334,7 +343,6 @@
    let _tabfields = []
    let _linkableFields = []
    let _linksupFields = []
    let _allFields = []
    let standardform = null
    let uniq = new Map()
@@ -344,13 +352,6 @@
    card.subcards[0].fields.forEach((item, i) => {
      if (_form.uuid === item.uuid) {
        index = i
      }
      if (item.field) {
        _allFields.push({
          field: item.field,
          label: item.label
        })
      }
      if (['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) {
@@ -422,7 +423,7 @@
      standardform,
      visible: true,
      editform: _form,
      formlist: getModalForm(_form, _inputfields, _tabfields, _linkableFields, _linksupFields, _allFields, card.columns)
      formlist: getModalForm(_form, _inputfields, _tabfields, _linkableFields, _linksupFields, card.columns)
    })
  }
src/menu/components/form/step-form/index.jsx
@@ -132,6 +132,7 @@
    card.width = card.wrap.width
    card.name = card.wrap.name
    card.errors = []
    let idCtrl = false
    if (card.wrap.datatype !== 'static') {
      let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : ''
@@ -158,6 +159,9 @@
      card.subcards.forEach(item => {
        item.fields.forEach(m => {
          if (m.dataSource && /@ID@/ig.test(m.dataSource)) {
            idCtrl = true
          }
          if (m.type === 'linkMain' && !supModule) {
            card.errors.push({ level: 1, detail: `请检查分组“${item.setting.title}”中关联主表“${m.label}”是否有效`})
          }
@@ -170,12 +174,17 @@
      card.subcards.forEach(item => {
        item.fields.forEach(m => {
          if (m.dataSource && /@ID@/ig.test(m.dataSource)) {
            idCtrl = true
          }
          if (m.type === 'linkMain' && !supModule) {
            card.errors.push({ level: 1, detail: `请检查分组“${item.setting.title}”中关联主表“${m.label}”是否有效`})
          }
        })
      })
    }
    card.idCtrl = idCtrl
    this.setState({
      card: card
@@ -435,7 +444,6 @@
    let _tabfields = []
    let _linkableFields = []
    let _linksupFields = []
    let _allFields = []
    let standardform = null
    let uniq = new Map()
@@ -445,13 +453,6 @@
    group.fields.forEach((item, i) => {
      if (_form.uuid === item.uuid) {
        index = i
      }
      if (item.field) {
        _allFields.push({
          field: item.field,
          label: item.label
        })
      }
      if (['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) {
@@ -524,7 +525,7 @@
      standardform,
      visible: true,
      editform: _form,
      formlist: getModalForm(_form, _inputfields, _tabfields, _linkableFields, _linksupFields, _allFields, card.columns)
      formlist: getModalForm(_form, _inputfields, _tabfields, _linkableFields, _linksupFields, card.columns)
    })
  }
src/menu/components/form/tab-form/index.jsx
@@ -144,6 +144,7 @@
    card.width = card.wrap.width
    card.name = card.wrap.name
    card.errors = []
    let idCtrl = false
    if (card.wrap.datatype !== 'static') {
      let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : ''
@@ -170,6 +171,9 @@
      card.subcards.forEach(item => {
        item.fields.forEach(m => {
          if (m.dataSource && /@ID@/ig.test(m.dataSource)) {
            idCtrl = true
          }
          if (m.type === 'linkMain' && !supModule) {
            card.errors.push({ level: 1, detail: `请检查分组“${item.setting.title}”中关联主表“${m.label}”是否有效`})
          }
@@ -182,12 +186,17 @@
      card.subcards.forEach(item => {
        item.fields.forEach(m => {
          if (m.dataSource && /@ID@/ig.test(m.dataSource)) {
            idCtrl = true
          }
          if (m.type === 'linkMain' && !supModule) {
            card.errors.push({ level: 1, detail: `请检查分组“${item.setting.title}”中关联主表“${m.label}”是否有效`})
          }
        })
      })
    }
    card.idCtrl = idCtrl
    this.setState({
      card: card
@@ -441,7 +450,6 @@
    let _tabfields = []
    let _linkableFields = []
    let _linksupFields = []
    let _allFields = []
    let standardform = null
    let uniq = new Map()
@@ -451,13 +459,6 @@
    group.fields.forEach((item, i) => {
      if (_form.uuid === item.uuid) {
        index = i
      }
      if (item.field) {
        _allFields.push({
          field: item.field,
          label: item.label
        })
      }
      if (['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) {
@@ -529,7 +530,7 @@
      standardform,
      visible: true,
      editform: _form,
      formlist: getModalForm(_form, _inputfields, _tabfields, _linkableFields, _linksupFields, _allFields, card.columns)
      formlist: getModalForm(_form, _inputfields, _tabfields, _linkableFields, _linksupFields, card.columns)
    })
  }
src/menu/modalconfig/index.jsx
@@ -113,7 +113,6 @@
    let _tabfields = []
    let _linkableFields = []
    let _linksupFields = []
    let _allFields = []
    let standardform = null
    let uniq = new Map()
@@ -123,13 +122,6 @@
    config.fields.forEach((item, i) => {
      if (card.uuid === item.uuid) {
        index = i
      }
      if (item.field) {
        _allFields.push({
          field: item.field,
          label: item.label
        })
      }
      if (['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) {
@@ -208,7 +200,7 @@
      standardform,
      visible: true,
      card: card,
      formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, _allFields, columns)
      formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, columns)
    })
  }
src/mob/modalconfig/index.jsx
@@ -134,7 +134,6 @@
    let _tabfields = []
    let _linkableFields = []
    let _linksupFields = []
    let _allFields = []
    let standardform = null
    let uniq = new Map()
@@ -144,13 +143,6 @@
    config.fields.forEach((item, i) => {
      if (card.uuid === item.uuid) {
        index = i
      }
      if (item.field) {
        _allFields.push({
          field: item.field,
          label: item.label
        })
      }
      if (['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) {
@@ -222,7 +214,7 @@
      standardform,
      visible: true,
      card: card,
      formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, _allFields, columns)
      formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, columns)
    })
  }
src/tabviews/custom/components/card/cardItem/index.jsx
@@ -51,7 +51,7 @@
      let menu = null
      
      if (card.menus && card.menus.length > 0) {
        let s = data[card.setting.menuType] || ''
        let s = data[card.setting.menuType] + ''
        card.menus.forEach(m => {
          if (s !== m.sign) return
          menu = m
src/tabviews/custom/components/chart/antv-G6/index.jsx
@@ -1494,7 +1494,7 @@
      let menu = null
      
      if (plot.menus && plot.menus.length > 0) {
        let s = data[plot.menuType] || ''
        let s = data[plot.menuType] + ''
        plot.menus.forEach(m => {
          if (s !== m.sign) return
          menu = m
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -1780,7 +1780,7 @@
        let menu = null
        
        if (plot.menus && plot.menus.length > 0) {
          let s = data[plot.menuType] || ''
          let s = data[plot.menuType] + ''
          plot.menus.forEach(m => {
            if (s !== m.sign) return
            menu = m
src/tabviews/custom/components/form/simple-form/index.jsx
@@ -63,6 +63,7 @@
          _data = _data[0] || {$$empty: true}
        }
        _sync = false
        _data.$$uuid = _data[config.setting.primaryKey] || ''
      }
    } else {
      _data = {$$empty: true}
@@ -127,6 +128,8 @@
          _data = _data[0] || {$$empty: true}
        }
      }
      _data.$$uuid = _data[config.setting.primaryKey] || ''
      this.setState({sync: false, data: _data})
    } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
@@ -244,6 +247,8 @@
    if (result.status) {
      let _data = result.data && result.data[0] ? result.data[0] : {$$empty: true}
      _data.$$uuid = _data[config.setting.primaryKey] || ''
      this.setState({
        data: null,
        loading: false
@@ -289,6 +294,7 @@
    const { config, loading, BID, BData, data, group, dict } = this.state
    if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null
    if (config.idCtrl && (!data || data.$$empty)) return null
    
    return (
      <div className="custom-simple-form-box" id={'anchor' + config.uuid} style={{...config.style}}>
src/tabviews/custom/components/form/step-form/index.jsx
@@ -62,6 +62,7 @@
          _data = _data[0] || {$$empty: true}
        }
        _sync = false
        _data.$$uuid = _data[config.setting.primaryKey] || ''
      }
    } else {
      _data = {$$empty: true}
@@ -168,6 +169,8 @@
          _data = _data[0] || {$$empty: true}
        }
      }
      _data.$$uuid = _data[config.setting.primaryKey] || ''
      if (config.wrap.statusControl && _data[config.wrap.statusControl]) {
        let _status = _data[config.wrap.statusControl]
@@ -304,6 +307,8 @@
      let _data = result.data && result.data[0] ? result.data[0] : {$$empty: true}
      let _group = this.state.group
      _data.$$uuid = _data[config.setting.primaryKey] || ''
      if (type === 'refresh') {
        _group = config.subcards[0]
      }
@@ -391,6 +396,7 @@
    const { config, loading, BID, BData, data, group, dict, step } = this.state
    if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null
    if (config.idCtrl && (!data || data.$$empty)) return null
    
    return (
      <div className="custom-normal-form-box" id={'anchor' + config.uuid} style={{...config.style}}>
src/tabviews/custom/components/form/tab-form/index.jsx
@@ -61,6 +61,7 @@
          _data = _data[0] || {$$empty: true}
        }
        _sync = false
        _data.$$uuid = _data[config.setting.primaryKey] || ''
      }
    } else {
      _data = {$$empty: true}
@@ -142,6 +143,8 @@
          _data = _data[0] || {$$empty: true}
        }
      }
      _data.$$uuid = _data[config.setting.primaryKey] || ''
      this.setState({sync: false, data: _data, group: null}, () => {
        this.setState({group: _group})
@@ -260,6 +263,8 @@
    if (result.status) {
      let _data = result.data && result.data[0] ? result.data[0] : {$$empty: true}
      _data.$$uuid = _data[config.setting.primaryKey] || ''
      this.setState({
        data: null,
        loading: false
@@ -307,6 +312,7 @@
    const { config, loading, BID, BData, data, group, dict } = this.state
    if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null
    if (config.idCtrl && (!data || data.$$empty)) return null
    
    return (
      <div className="custom-tab-form-box" id={'anchor' + config.uuid} style={{...config.style}}>
src/tabviews/zshare/mutilform/index.jsx
@@ -104,6 +104,12 @@
        delete item.style.marginRight
      }
      if (item.type === 'split' && item.splitctrl) {
        if (data.hasOwnProperty(item.splitctrl.toLowerCase()) && data[item.splitctrl.toLowerCase()] === '') {
          return false
        }
      }
      if (item.type === 'split' || item.type === 'formula') return true
      if (item.type === 'hint') {
        if (item.field && data[item.field.toLowerCase()]) {
@@ -165,6 +171,10 @@
          })
        }
        item.oriOptions = fromJS(item.options).toJS()
        if (item.empty === 'hidden' && item.oriOptions.length === 0) {
          item.hidden = true
        }
      }
      let newval = '$empty'
@@ -810,6 +820,10 @@
            })
          }
        }
        if (item.empty === 'hidden' && item.oriOptions.length > 0) {
          item.hidden = false
        }
      }
      
      return item
@@ -901,17 +915,8 @@
    formlist.forEach((item, index) => {
      if (item.hidden) return
      if (item.empty === 'hidden' && item.oriOptions.length === 0) return
      if (item.type === 'split') {
        if (item.splitctrl) {
          let cell = formlist.filter(m => m.field === item.splitctrl)[0]
          if (cell && (cell.hidden || (cell.empty === 'hidden' && !cell.oriOptions.length))) {
            return null
          }
        }
        fields.push(
          <Col span={24} key={index}>
            <p className="mk-form-split-line" style={item.style}>{item.label}</p>
src/templates/modalconfig/index.jsx
@@ -243,7 +243,6 @@
    let _tabfields = []
    let _linkableFields = []
    let _linksupFields = []
    let _allFields = []
    let standardform = null
    let uniq = new Map()
@@ -253,13 +252,6 @@
    config.fields.forEach((item, i) => {
      if (card.uuid === item.uuid) {
        index = i
      }
      if (item.field) {
        _allFields.push({
          field: item.field,
          label: item.label
        })
      }
      if (['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) {
@@ -358,7 +350,7 @@
      standardform,
      visible: true,
      card: card,
      formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, _allFields)
      formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields)
    })
  }
src/templates/zshare/formconfig.jsx
@@ -2388,7 +2388,7 @@
 * @param {*} linkableFields  // 可关联表单
 * @param {*} linksupFields   // 上级表单
 */
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, allFields = [], columns = []) {
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, columns = []) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
@@ -2442,10 +2442,6 @@
  })
  linksupFields = linksupFields.map((item, index) => {
    item.label = `${index + 1}、${item.field || ''}(${item.label})`
    return item
  })
  allFields = allFields.map((item, index) => {
    item.label = `${index + 1}、${item.field || ''}(${item.label})`
    return item
  })
@@ -3485,13 +3481,13 @@
      }]
    },
    {
      type: 'select',
      type: 'text',
      key: 'splitctrl',
      label: '显示控制',
      label: '控制字段',
      initVal: card.splitctrl || '',
      tooltip: '分割线与该表单同步显示或隐藏。',
      allowClear: true,
      options: allFields
      tooltip: '选行且行中对应字段值为空时隐藏。',
      required: false,
      options: columns
    },
    {
      type: 'radio',
src/templates/zshare/modalform/index.jsx
@@ -26,7 +26,7 @@
  radio: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'setAll', 'emptyText', 'splitline', 'arrange', 'marginTop', 'marginBottom', 'empty'],
  checkcard: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'span', 'labelwidth', 'display', 'tooltip', 'extra', 'width', 'multiple', 'splitline', 'marginTop', 'marginBottom', 'empty'],
  multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'dropdown', 'empty'],
  link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkField', 'linkSubField', 'span', 'place', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom'],
  link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkField', 'linkSubField', 'span', 'place', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'empty', 'marginTop', 'marginBottom'],
  fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'miniSet', 'splitline', 'marginTop', 'marginBottom', 'maxSize'],
  switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'],
  date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'place', 'marginTop', 'marginBottom', 'minDate', 'maxDate', 'precision'],