king
2024-06-01 c62724a2cdbafa3c660538955acbedafa5a01871
src/tabviews/zshare/mutilform/index.jsx
@@ -154,6 +154,17 @@
      let key = item.field.toLowerCase()
      // positecgroup 表单隐藏
      if (item.tooltip && /@[a-z0-9_]+@/.test(item.tooltip)) {
        let field = item.tooltip.replace(/@|\s/ig, '').toLowerCase()
        if (data[field] === 'N') {
          item.hidden = true
        }
        item.tooltip = ''
      }
      if (item.type === 'funcvar') {
        readin = false
        item.readin = false
@@ -393,11 +404,13 @@
          message: item.label + '不可为空!'
        }]
        if (typeof(item.min) === 'number' || typeof(item.max) === 'number') {
        if (typeof(item.min) === 'number' || typeof(item.max) === 'number' || item.notZero === 'true') {
          item.rules.push({
            validator: (rule, value, callback) => {
              if (isNaN(value)) {
                callback()
              } else if (item.notZero === 'true' && value === 0) {
                callback(item.label + '不可为0')
              } else if (typeof(item.min) === 'number' && value < item.min) {
                if (item.min < 1e-6) {
                  if (item.min === 1e-6) {
@@ -474,6 +487,12 @@
            message: '请选择' + item.label + '!'
          })
        }
        if (['cascader', 'checkbox', 'checkcard', 'fileupload', 'multiselect'].includes(item.type) && item.fieldlength) {
          item.rules.push({
            max: item.fieldlength,
            message: formRule.input.formMessage.replace('@max', item.fieldlength)
          })
        }
      }
      if (item.rules.length === 0) {
@@ -545,7 +564,7 @@
          item.subFields = []
          item.linkSubField.forEach(m => {
            let n = fieldMap.get(m)
            if (n && ['text', 'number', 'textarea'].includes(n.type)) {
            if (n && ['text', 'number', 'textarea', 'select'].includes(n.type)) {
              item.subFields.push({
                uuid: n.uuid,
                field: m
@@ -568,7 +587,7 @@
          item.subFields = []
          item.linkSubField.forEach(m => {
            let n = fieldMap.get(m)
            if (n && ['text', 'number', 'textarea'].includes(n.type)) {
            if (n && ['text', 'number', 'textarea', 'select'].includes(n.type)) {
              item.subFields.push({
                uuid: n.uuid,
                field: m
@@ -588,7 +607,7 @@
          item.subFields = []
          item.linkSubField.forEach(m => {
            let n = fieldMap.get(m)
            if (n && ['text', 'number', 'textarea'].includes(n.type)) {
            if (n && ['text', 'number', 'textarea', 'select'].includes(n.type)) {
              item.subFields.push({
                uuid: n.uuid,
                field: m
@@ -600,7 +619,7 @@
          item.subFields = []
          item.linkSubField.forEach(m => {
            let n = fieldMap.get(m)
            if (n && ['text', 'number', 'textarea'].includes(n.type)) {
            if (n && ['text', 'number', 'textarea', 'select'].includes(n.type)) {
              item.subFields.push({
                uuid: n.uuid,
                field: m
@@ -617,7 +636,11 @@
        item.supInitVal = ''
        if (fieldMap.has(item.linkField)) {
          item.supInitVal = fieldMap.get(item.linkField).initval || ''
          let supitem = fieldMap.get(item.linkField)
          item.supInitVal = supitem.initval || ''
          if (supitem.$first) {
            item.$resetSup = true
          }
        } else if (data.hasOwnProperty(item.linkField.toLowerCase())) {
          item.supInitVal = data[item.linkField.toLowerCase()]
        }
@@ -1087,7 +1110,11 @@
        // if (item.type === 'link') {
        if (item.linkField) {
          item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.value === '')
          let supInitVal = item.supInitVal
          if (item.$resetSup) {
            supInitVal = this.record[item.linkField]
          }
          item.options = item.oriOptions.filter(option => option.ParentID === supInitVal || option.value === '')
        // } else if (['select', 'radio', 'checkbox', 'checkcard', 'multiselect'].includes(item.type)) {
        } else {
          item.options = item.oriOptions