king
2022-04-26 5046d0d13dc6a8563b8e54e31913bc44cfa1072f
src/templates/zshare/formconfig.jsx
@@ -302,6 +302,14 @@
  let typeOptions = []
  if (appType === 'mob') {
    // let adapters = sessionStorage.getItem('adapter')
    // if (adapters) {
    //   adapters = adapters.split(',')
    // } else {
    //   adapters = []
    // }
    // (adapters.includes('wxmini') ? '(小程序暂不支持)' : '')
    typeOptions = [{
      value: 'range',
      text: '数值(区间)'
@@ -318,6 +326,7 @@
    //   value: 'daterange',
    //   text: Formdict['model.form.daterange']
    }]
  } else {
    typeOptions = [{
      value: 'text',
@@ -506,7 +515,7 @@
      required: true
    },
    {
      type: 'textarea',
      type: 'codemirror',
      key: 'dataSource',
      label: Formdict['header.form.datasource'],
      initVal: card.dataSource || '',
@@ -650,6 +659,37 @@
      required: false
    },
    {
      type: 'number',
      key: 'labelwidth',
      min: 1,
      max: 100,
      precision: 1,
      label: '名称宽度',
      initVal: card.labelwidth || 33.3,
      tooltip: '名称占据搜索条件宽度的百分比。注:存在多列搜索时,当前搜索如果想要占据整行可参照以下比例,两列(16.5)、三列(10.8)、四列(8)',
      required: true,
      forbid: appType === 'mob'
    },
    {
      type: 'radio',
      key: 'precision',
      label: '精确度',
      initVal: card.precision || 'day',
      options: [{
        value: 'day',
        text: '天'
      }, {
        value: 'hour',
        text: '小时'
      }, {
        value: 'minute',
        text: '分钟'
      }, {
        value: 'second',
        text: '秒'
      }]
    },
    {
      type: 'radio',
      key: 'required',
      label: Formdict['model.required'],
@@ -746,6 +786,7 @@
      key: 'advanced',
      label: '高级搜索',
      initVal: card.advanced || 'false',
      tooltip: '在隐藏搜索按钮时,高级搜索无效。',
      forbid: appType === 'mob',
      options: [{
        value: 'true',
@@ -1177,18 +1218,18 @@
      type: refresh.length === 0 ? 'radio' : 'select',
      key: 'execSuccess',
      label: Formdict['model.form.afterSuccess'],
      initVal: card.execSuccess || 'never',
      initVal: card.execSuccess || 'grid',
      tooltip: '选择刷新行时,如果选择多条数据会刷新表格。',
      required: true,
      options: [{
        value: 'never',
        text: '不刷新'
      }, {
        value: 'grid',
        text: '刷新表格'
      }, {
        value: 'line',
        text: '刷新行'
      }, {
        value: 'grid',
        text: '刷新表格'
      },
      ...refresh]
    },
@@ -1203,11 +1244,11 @@
        value: 'never',
        text: '不刷新'
      }, {
        value: 'grid',
        text: '刷新表格'
      }, {
        value: 'line',
        text: '刷新行'
      }, {
        value: 'grid',
        text: '刷新表格'
      },
      ...refresh]
    },
@@ -1268,8 +1309,16 @@
      type: 'text',
      key: 'output',
      label: '返回值',
      tooltip: '执行成功后的返回值。',
      tooltip: '执行成功后的返回值。例如:@id',
      initVal: card.output || '',
      required: false
    },
    {
      type: 'text',
      key: 'tipTitle',
      label: '确认提示',
      initVal: card.tipTitle || '',
      tooltip: '注:弹窗(表单)在显示为是否框时有效。',
      required: false
    },
    {
@@ -1422,6 +1471,13 @@
      label: '控制值',
      tooltip: '当选择控制字段,且字段值与控制值相等时,按钮会隐藏或禁用,多个值用逗号分隔。',
      initVal: card.controlVal || '',
      required: false
    },
    {
      type: 'text',
      key: 'reason',
      label: '禁用原因',
      initVal: card.reason || '',
      required: false
    },
  ]
@@ -2260,9 +2316,9 @@
  }, {
    value: 'datemonth',
    text: Formdict['model.form.datemonth']
  }, {
    value: 'datetime',
    text: Formdict['model.form.datetime']
  // }, {
  //   value: 'datetime',
  //   text: '日期(分/秒)'
  }, {
    value: 'textarea',
    text: Formdict['model.form.textarea']
@@ -2325,9 +2381,9 @@
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    }, {
      value: 'datetime',
      text: Formdict['model.form.datetime']
    // }, {
    //   value: 'datetime',
    //   text: '日期(分/秒)'
    }, {
      value: 'textarea',
      text: Formdict['model.form.textarea']
@@ -2343,6 +2399,9 @@
    }, {
      value: 'split',
      text: '分隔线'
    }, {
      value: 'linkMain',
      text: '关联主表'
    }]
  }
@@ -2350,6 +2409,9 @@
    _fieldlength = 512
  } else if (['textarea', 'brafteditor'].includes(card.type)) {
    _fieldlength = 8000
  } else if (card.type === 'datetime') {
    card.type = 'date'
    card.precision = 'second'
  }
  let options = card.options || []
@@ -2367,6 +2429,10 @@
    initval = card.initval === true
  } else if (card.type === 'number') {
    initval = card.initval || 0
  }
  if (appType === 'mob' && ![24, 12, 8, 6].includes(card.span)) {
    card.span = 24
  }
  return [
@@ -2744,6 +2810,25 @@
      }]
    },
    {
      type: 'radio',
      key: 'precision',
      label: '精确度',
      initVal: card.precision || 'day',
      options: [{
        value: 'day',
        text: '天'
      }, {
        value: 'hour',
        text: '小时'
      }, {
        value: 'minute',
        text: '分钟'
      }, {
        value: 'second',
        text: '秒'
      }]
    },
    {
      type: 'number',
      key: 'fieldlength',
      min: 1,
@@ -2752,7 +2837,7 @@
      label: Formdict['model.form.field'] + Formdict['model.length'],
      // tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512',
      initVal: card.fieldlength || _fieldlength,
      required: false
      required: true
    },
    {
      type: 'number',
@@ -3063,7 +3148,7 @@
      type: 'radio',
      key: 'interception',
      label: '截取空格',
      initVal: card.interception || 'false',
      initVal: card.interception || 'true',
      tooltip: '提交时,是否截取首尾的空白字符。',
      options: [{
        value: 'true',
@@ -3155,6 +3240,46 @@
      forbid: appType === 'mob'
    },
    {
      type: 'radio',
      key: 'span',
      label: '表单宽度',
      initVal: card.span || 24,
      tooltip: '栅格布局整行24等分。',
      required: true,
      forbid: appType !== 'mob',
      options: [{
        value: 24,
        text: 24
      }, {
        value: 12,
        text: 12
      }, {
        value: 8,
        text: 8
      }, {
        value: 6,
        text: 6
      }]
    },
    {
      type: 'radio',
      key: 'lenControl',
      label: '长度控制',
      initVal: card.lenControl || 'limit',
      tooltip: '在设置字段长度后,对长度的控制方式。',
      required: false,
      options: [{
        value: 'limit',
        text: '限制输入'
      }, {
        value: 'left',
        text: '左截'
      }, {
        value: 'right',
        text: '右截'
      }]
    },
    {
      type: 'number',
      key: 'labelwidth',
      min: 1,
@@ -3210,6 +3335,7 @@
    {
      type: 'text',
      key: 'supvalue',
      max: 512,
      label: '显示值',
      tooltip: '请填写显示值,只有上级表单值与显示值相同时,该表单才会显示,注:1、多个值用逗号分隔;2、上级表单初始值为$first时暂未处理。',
      initVal: card.supvalue || '',
@@ -3233,6 +3359,22 @@
      initVal: card.extra || '',
      required: false,
      forbid: appType === 'mob'
    },
    {
      type: 'radio',
      key: 'enterReplace',
      label: '回车符替换',
      tooltip: '回车符会替换为英文逗号。',
      initVal: card.enterReplace || 'false',
      required: false,
      forbid: appType !== 'mob',
      options: [{
        value: 'false',
        text: '否'
      }, {
        value: 'true',
        text: '是'
      }]
    },
    {
      type: 'text',
@@ -3288,7 +3430,7 @@
      key: 'marginTop',
      label: '上边距(px)',
      initVal: card.marginTop || 0,
      min: 0,
      min: -100,
      max: 1000,
      precision: 0,
      required: false,
@@ -3299,7 +3441,7 @@
      key: 'marginBottom',
      label: '下边距(px)',
      initVal: card.marginBottom || 0,
      min: 0,
      min: -100,
      max: 1000,
      precision: 0,
      required: false,