king
2021-07-30 f6a1ab6a58215cf7546976a86eb6face1a7be32f
src/templates/zshare/formconfig.jsx
@@ -288,6 +288,7 @@
 */
export function getSearchForm (card, linkableFields) {
  let roleList = sessionStorage.getItem('sysRoles')
  let appType = sessionStorage.getItem('appType')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
@@ -300,10 +301,10 @@
  let typeOptions = []
  if (sessionStorage.getItem('appType') === 'mob') {
  if (appType === 'mob') {
    typeOptions = [{
      value: 'text',
      text: Formdict['model.form.text']
      value: 'range',
      text: '数值(区间)'
    }, {
      value: 'checkcard',
      text: '选项卡'
@@ -313,10 +314,10 @@
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    }, {
      value: 'daterange',
      text: Formdict['model.form.daterange']
    }]
    if (!['text', 'checkcard', 'date', 'datemonth'].includes(card.type)) {
      card.type = 'text'
    }
  } else {
    typeOptions = [{
      value: 'text',
@@ -349,6 +350,18 @@
      value: 'group',
      text: Formdict['model.form.dategroup']
    }]
  }
  if (card.focus) {
    if (['text', 'multiselect'].includes(card.type)) {
      card.match = 'like'
    } else if (['select', 'link', 'checkcard'].includes(card.type)) {
      card.match = '='
    } else if (card.type === 'date') {
      card.match = '>='
    } else if (['datemonth', 'dateweek', 'daterange', 'range'].includes(card.type)) {
      card.match = 'between'
    }
  }
  return [
@@ -389,7 +402,7 @@
      type: 'text',
      key: 'initval',
      label: Formdict['header.form.initval'],
      tooltip: '类型为下拉菜单时,初始值应为数据的Value值(使用数据源时,应为《值·字段》的值)',
      tooltip: '类型为下拉菜单时,初始值应为数据的Value值(使用数据源时,应为《值·字段》的值);类型为数值(区间)时,初始值使用逗号拼接,例如 3,10',
      initVal: card.initval,
      required: false
    },
@@ -440,7 +453,7 @@
      min: 1,
      max: 24,
      precision: 0,
      label: '卡片宽度',
      label: '元素宽度',
      initVal: card.width || 4,
      tooltip: '栅格布局,每行等分为24列。',
      required: true
@@ -621,7 +634,8 @@
      max: 24,
      label: Formdict['header.form.ratio'],
      tooltip: '栅格布局,每行等分为24列。',
      initVal: card.ratio,
      initVal: card.ratio || 6,
      forbid: appType === 'mob',
      required: false
    },
    {
@@ -679,6 +693,31 @@
    //   }]
    // },
    {
      type: 'number',
      key: 'maxValue',
      label: '最大值',
      initVal: card.maxValue,
      forbid: appType !== 'mob',
      required: true
    },
    {
      type: 'number',
      key: 'minValue',
      label: '最小值',
      initVal: card.minValue,
      forbid: appType !== 'mob',
      required: true
    },
    {
      type: 'number',
      key: 'step',
      label: '步长',
      initVal: card.step,
      tooltip: '步长取值必须大于 0,并且可被 (max - min) 整除',
      forbid: appType !== 'mob',
      required: true
    },
    {
      type: 'radio',
      key: 'labelShow',
      label: '显示名称',
@@ -696,6 +735,7 @@
      key: 'advanced',
      label: '高级搜索',
      initVal: card.advanced || 'false',
      forbid: appType === 'mob',
      options: [{
        value: 'true',
        text: Formdict['model.true']
@@ -710,7 +750,7 @@
      label: '输入样式',
      initVal: card.inputType || 'input',
      required: false,
      forbid: sessionStorage.getItem('appType') === null,
      forbid: appType === null,
      options: [{
        value: 'input',
        text: '输入框'
@@ -724,6 +764,7 @@
      key: 'backgroundColor',
      label: '背景色',
      initVal: card.backgroundColor || '',
      tooltip: '设置背景色后,选中效果由背景颜色控制。',
      required: false
    },
    {
@@ -2313,7 +2354,7 @@
      min: 1,
      max: 24,
      precision: 0,
      label: '卡片宽度',
      label: '元素宽度',
      initVal: card.width || 4,
      tooltip: '栅格布局,每行等分为24列。',
      required: true
@@ -2514,6 +2555,9 @@
      }, {
        value: 'letter&number',
        text: Formdict['header.form.letter&number']
      }, {
        value: 'phone',
        text: '手机号'
      }]
    },
    {
@@ -2542,19 +2586,6 @@
      initVal: card.maxfile || '',
      tooltip: '等于0时不做限制。',
      required: false
    },
    {
      type: 'radio',
      key: 'hidelabel',
      label: '隐藏名称',
      initVal: card.hidelabel || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
@@ -2628,11 +2659,14 @@
      label: '扫码',
      initVal: card.scan || 'false',
      options: [{
        value: 'true',
        text: '启用'
      }, {
        value: 'false',
        text: '不启用'
        text: '禁用'
      }, {
        value: 'simple',
        text: '单次'
      }, {
        value: 'multi',
        text: '连续'
      }],
      forbid: appType !== 'mob'
    },
@@ -2665,10 +2699,38 @@
      }]
    },
    {
      type: 'radio',
      key: 'hidelabel',
      label: '隐藏名称',
      initVal: card.hidelabel || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'arrange',
      label: '元素排列',
      initVal: card.arrange || 'adaptive',
      forbid: appType !== 'mob',
      options: [{
        value: 'line',
        text: '整行'
      }, {
        value: 'adaptive',
        text: '自适应'
      }]
    },
    {
      type: 'color',
      key: 'backgroundColor',
      label: '背景色',
      initVal: card.backgroundColor || '',
      tooltip: '设置背景色后,选中效果由背景颜色控制。',
      required: false
    },
    {
@@ -2813,6 +2875,20 @@
    },
    {
      type: 'radio',
      key: 'splitline',
      label: '分割线',
      initVal: card.splitline || 'true',
      forbid: appType !== 'mob',
      options: [{
        value: 'true',
        text: '显示'
      }, {
        value: 'false',
        text: '隐藏'
      }]
    },
    {
      type: 'radio',
      key: 'count',
      label: '计数功能',
      initVal: card.count || 'false',
@@ -2840,7 +2916,7 @@
      type: 'text',
      key: 'supvalue',
      label: '显示值',
      tooltip: '请填写显示值,只有上级表单值与显示值相同时,该表单才会显示,注:多个值用逗号分隔。',
      tooltip: '请填写显示值,只有上级表单值与显示值相同时,该表单才会显示,注:1、多个值用逗号分隔;2、上级表单初始值为$first时暂未处理。',
      initVal: card.supvalue || '',
      required: true,
      readonly: false
@@ -2865,6 +2941,14 @@
    },
    {
      type: 'text',
      key: 'placeholder',
      label: '提示信息',
      tooltip: '字段预期值的提示信息。',
      initVal: card.placeholder || '',
      required: false
    },
    {
      type: 'text',
      key: 'emptyText',
      label: '空值文本',
      tooltip: '空值的提示文本,选择设置空值时有效,默认值为《空》。',