king
2023-12-14 0eb129a9beddbb86ae74d7106a8e60823206b8d5
src/templates/sharecomponent/searchcomponent/searchform/index.jsx
@@ -252,6 +252,7 @@
      reTypes.initval = 'text'
    }
    reTooltip.match = ''
    if (type === 'text') {
      reOptions.match = matchReg.class1
    } else if (type === 'multiselect') {
@@ -263,7 +264,8 @@
    } else if (type === 'date') {
      reOptions.match = matchReg.class4
    } else if (type === 'datemonth') {
      reOptions.match = matchReg.class5
      reTooltip.match = '匹配模式为 between 时,搜索条件为大于月初小于月末,匹配模式为 = 时,搜索条件为等于当前月(YYYY-MM)。'
      reOptions.match = matchReg.class6
    } else if (type === 'dateweek' || type === 'daterange' || type === 'range') {
      reOptions.match = matchReg.class5
    } else if (type === 'checkcard') {
@@ -284,6 +286,25 @@
    } else if (type === 'group') {
      reTooltip.field = '查询数据时(自定义脚本或统计数据源),类型字段将用作替换脚本中的 @字段@ ,类型字段对应值为:日 -> day;周 -> week;月 -> month;季 -> quarter;年 -> year;自定义 -> customized'
      reLabel.field = '类型字段'
    }
    reTooltip.initval = ''
    if (type === 'select') {
      if (this.record.resourceType === '0') {
        reTooltip.initval = '初始值应为数据的Value值,可使用@username@、@fullName@'
      } else if (this.record.resourceType === '1') {
        reTooltip.initval = '初始值应为《值·字段》的值,可使用@username@、@fullName@、$first。注:使用$first时,搜索条件应为必填。'
      }
    } else if (type === 'link') {
      if (this.record.resourceType === '0') {
        reTooltip.initval = '初始值应为数据的Value值。'
      } else if (this.record.resourceType === '1') {
        reTooltip.initval = '初始值应为《值·字段》的值,可使用$first。注:使用$first时,搜索条件应为必填。'
      }
    } else if (type === 'text') {
      reTooltip.initval = '可使用@username@、@fullName@。'
    } else if (type === 'range') {
      reTooltip.initval = '使用逗号拼接,例如 3,10'
    }
    return {
@@ -688,6 +709,23 @@
            values.field = values.field.join(',')
          }
          if (['select', 'link'].includes(values.type)) {
            if (values.resourceType === '1') {
              if (/\$first/.test(values.initval) && values.initval.replace(/\s/g, '') === '$first') {
                values.initval = '$first'
              }
              if (values.initval === '$first' && values.required !== 'true') {
                notification.warning({
                  top: 92,
                  message: '使用$first时,搜索条件应为必填!',
                  duration: 5
                })
                return
              }
            }
          }
          // 下拉菜单或联动菜单
          if (['multiselect', 'select', 'link', 'radio'].includes(values.type)) {
            if (values.resourceType === '0') {