king
2021-09-10 d074bedd5c2834113fe0c4ed5a3c78ec905681c3
src/components/normalform/modalform/index.jsx
@@ -12,6 +12,7 @@
const { TextArea } = Input
const MKRadio = asyncComponent(() => import('./mkRadio'))
const MKCheckbox = asyncComponent(() => import('./mkCheckbox'))
const StyleInput = asyncComponent(() => import('./styleInput'))
const MKFileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload'))
const MKColor = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkColor'))
@@ -158,7 +159,19 @@
        current.controlFields.forEach(cell => {
          let m = map.get(cell.field)
          m.hidden = current.hidden || !cell.values.includes(val)
          if (current.hidden) {
            m.hidden = true
          } else if (current.type === 'checkbox') {
            let vals = [...val, ...cell.values]
            if (vals.length !== new Set(vals).size) {
              m.hidden = false
            } else {
              m.hidden = true
            }
          } else {
            m.hidden = !cell.values.includes(val)
          }
          if (m.hidden) {
            m.initval = this.record[m.field]
@@ -209,6 +222,8 @@
        content = (<StyleInput config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>)
      } else if (item.type === 'radio') {
        content = (<MKRadio config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>)
      } else if (item.type === 'checkbox') {
        content = (<MKCheckbox config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>)
      } else if (item.type === 'fileupload') {
        content = (<MKFileUpload config={item} onChange={(val) => this.recordChange({[item.field]: val})} />)
      } else if (item.type === 'cascader') {