king
2022-09-06 b8e1395f02c929eaa96b949cf6027ee2a43856a6
src/templates/zshare/formconfig.jsx
@@ -13,6 +13,17 @@
export function getTreeSettingForm (setting, usefulFields = [], MenuID) {
  let str = '^(' + usefulFields.join('|') + ')'
  let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
  let rules = [{
    max: formRule.func.max,
    message: formRule.func.maxMessage
  }]
  if (usefulFields.length > 0) {
    rules.push({
      pattern: _patten,
      message: formRule.func.innerMessage
    })
  }
  return [
    {
@@ -103,19 +114,11 @@
      key: 'innerFunc',
      label: Formdict['header.form.innerFunc'],
      initVal: setting.innerFunc || '',
      tooltip: '开头可用字符:' + usefulFields.join(', '),
      tooltip: usefulFields.length ? '开头可用字符:' + usefulFields.join(', ') : '',
      placement: 'bottomLeft',
      required: false,
      readonly: false,
      rules: [
        {
          pattern: _patten,
          message: formRule.func.innerMessage
        }, {
          max: formRule.func.max,
          message: formRule.func.maxMessage
        }
      ]
      rules: rules
    },
    {
      type: 'datasource',
@@ -286,7 +289,7 @@
 * @param {object} card           // 搜索条件对象
 * @param {Array}  linkableFields // 可关联字段
 */
export function getSearchForm (card, linkableFields) {
export function getSearchForm (card, linkableFields, columns, position) {
  let roleList = sessionStorage.getItem('sysRoles')
  let appType = sessionStorage.getItem('appType')
  if (roleList) {
@@ -302,6 +305,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: '数值(区间)'
@@ -310,7 +321,7 @@
      text: '选项卡'
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
      text: '日期(天)'
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
@@ -318,6 +329,7 @@
    //   value: 'daterange',
    //   text: Formdict['model.form.daterange']
    }]
  } else {
    typeOptions = [{
      value: 'text',
@@ -336,10 +348,10 @@
      text: '选项卡'
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
      text: '日期(天)'
    }, {
      value: 'dateweek',
      text: Formdict['model.form.dateweek']
      text: '日期(周)'
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
@@ -387,7 +399,8 @@
      key: 'field',
      label: Formdict['model.form.field'],
      initVal: card.field || '',
      required: true
      required: true,
      options: columns
    },
    {
      type: 'select',
@@ -451,6 +464,9 @@
      }, {
        value: 'picture',
        text: '图片'
      }, {
        value: 'color',
        text: '色块'
      }]
    },
    {
@@ -506,7 +522,7 @@
      required: true
    },
    {
      type: 'textarea',
      type: 'codemirror',
      key: 'dataSource',
      label: Formdict['header.form.datasource'],
      initVal: card.dataSource || '',
@@ -650,6 +666,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,7 +793,8 @@
      key: 'advanced',
      label: '高级搜索',
      initVal: card.advanced || 'false',
      forbid: appType === 'mob',
      tooltip: '在高级搜索以模态框或抽屉展开时,搜索条件在开发界面占比为6,实际效果请在运行时查看。',
      forbid: appType === 'mob' || position === 'header',
      options: [{
        value: 'true',
        text: Formdict['model.true']
@@ -785,19 +833,29 @@
      }]
    },
    {
      type: 'radio',
      key: 'selectStyle',
      label: '选中效果',
      tooltip: '背景及文字变化时会使用系统色。',
      initVal: card.selectStyle || (card.backgroundColor ? 'custom' : 'background'),
      options: [{
        value: 'background',
        text: '背景变化'
      }, {
        value: 'font',
        text: '文字变化'
      }, {
        value: 'custom',
        text: '自定义'
      }]
    },
    {
      type: 'color',
      key: 'backgroundColor',
      label: '背景色',
      initVal: card.backgroundColor || '',
      tooltip: '设置背景色后,选中效果由背景颜色控制。',
      required: false
    },
    {
      type: 'color',
      key: 'borderColor',
      label: '边框颜色',
      initVal: card.borderColor || '',
      required: false
      required: true
    },
    {
      type: 'multiselect',
@@ -805,7 +863,8 @@
      label: Formdict['header.form.blacklist'],
      initVal: card.blacklist || [],
      required: false,
      options: roleList || []
      options: roleList || [],
      forbid: appType === 'mob'
    }
  ]
}
@@ -879,6 +938,8 @@
      value: 'equaltab',
      text: '刷新同级标签'
    })
  } else if (card.execSuccess === 'maingrid') {
    card.execSuccess = 'grid'
  }
  if (card.OpenType === 'blank') {
@@ -886,6 +947,10 @@
  }
  if (!card.control && card.controlField) {
    card.control = 'disabled'
  }
  if (card.intertype === 'outer' && !card.procMode && !card.innerFunc) { // 兼容外部函数直传类型
    card.procMode = 'none'
  }
  return [
@@ -898,21 +963,48 @@
      options: opentypes
    },
    {
      type: 'text',
      key: 'label',
      label: '按钮名称',
      initVal: card.label,
      required: true,
      readonly: false
    },
    {
      type: 'select',
      key: 'funcType',
      label: '功能类型',
      initVal: card.funcType || '',
      required: true,
      options: [{
        value: 'changeuser',
        text: '切换用户'
      }, {
        value: 'print',
        text: '标签打印'
      }, {
        value: 'refund',
        text: '退款'
      }, {
        value: 'changeuser',
        text: '切换用户'
      }, {
        value: 'closetab',
        text: '标签关闭'
      }, {
        value: 'megvii',
        text: '旷视面板机'
      }, {
        value: 'filezip',
        text: '文件压缩包'
      }]
    },
    { // 旷视面板机接口 待扩展
      type: 'radio',
      key: 'subFunc',
      label: '接口名称',
      initVal: card.subFunc || 'addUser',
      required: true,
      options: [
        { value: 'addUser', text: '添加用户' },
      ]
    },
    {
      type: 'select',
@@ -943,7 +1035,8 @@
      type: 'radio',
      key: 'procMode',
      label: '参数处理',
      initVal: card.procMode || 'system',
      initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'),
      tooltip: '当返回值存在 mk_ex_invoke 且值为 false 时,不会调用外部接口。',
      required: true,
      options: [{
        value: 'system',
@@ -951,6 +1044,9 @@
      }, {
        value: 'inner',
        text: '内部函数'
      }, {
        value: 'none',
        text: '无'
      }]
    },
    {
@@ -960,14 +1056,6 @@
      initVal: card.sqlType || '',
      required: true,
      options: []
    },
    {
      type: 'text',
      key: 'label',
      label: '按钮名称',
      initVal: card.label,
      required: true,
      readonly: false
    },
    {
      type: 'text',
@@ -981,9 +1069,18 @@
      key: 'innerFunc',
      label: Formdict['header.form.innerFunc'],
      initVal: card.innerFunc || '',
      tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始。`,
      tooltip: usefulFields.length ? `函数名称需以${usefulFields.join(', ')}等字符开始。` : '',
      fields: usefulFields,
      required: card.intertype === 'inner',
      readonly: false
    },
    {
      type: 'text',
      key: 'urlkey',
      label: '地址字段',
      initVal: card.urlkey || '',
      tooltip: '图片(文件)链接的字段名。',
      required: false,
      readonly: false
    },
    {
@@ -1109,7 +1206,7 @@
      type: 'radio',
      key: 'callbackType',
      label: '回调方式',
      initVal: card.callbackType || 'script',
      initVal: card.callbackType || (card.callbackFunc ? 'func' : 'none'),
      tooltip: '使用后台脚本执行时,需要配合计划任务。',
      required: true,
      options: [{
@@ -1118,6 +1215,12 @@
      }, {
        value: 'default',
        text: '后台脚本'
      }, {
        value: 'func',
        text: '回调函数'
      }, {
        value: 'none',
        text: '无'
      }]
    },
    {
@@ -1132,7 +1235,7 @@
      key: 'callbackFunc',
      label: Formdict['header.form.callbackFunc'],
      initVal: card.callbackFunc || '',
      required: false,
      required: true,
      readonly: false
    },
    {
@@ -1184,11 +1287,11 @@
        value: 'never',
        text: '不刷新'
      }, {
        value: 'grid',
        text: '刷新表格'
      }, {
        value: 'line',
        text: '刷新行'
      }, {
        value: 'grid',
        text: '刷新表格'
      },
      ...refresh]
    },
@@ -1203,11 +1306,11 @@
        value: 'never',
        text: '不刷新'
      }, {
        value: 'grid',
        text: '刷新表格'
      }, {
        value: 'line',
        text: '刷新行'
      }, {
        value: 'grid',
        text: '刷新表格'
      },
      ...refresh]
    },
@@ -1268,7 +1371,7 @@
      type: 'text',
      key: 'output',
      label: '返回值',
      tooltip: '执行成功后的返回值。',
      tooltip: '执行成功后的返回值。系统函数可指定返回的变量(以@符开头,如@id);自定义函数可指定返回字段(如id)。',
      initVal: card.output || '',
      required: false
    },
@@ -1351,7 +1454,7 @@
      precision: 0,
      label: '比例',
      initVal: card.ratio || 85,
      tooltip: '小于100为宽度(或高度)百分比,大于100为像素值。',
      tooltip: '模态框或抽屉的宽度,小于100为窗口宽度(或高度)百分比,大于100为像素值。',
      required: true
    },
    {
@@ -1393,7 +1496,7 @@
      key: 'preFunc',
      label: '前置函数',
      initVal: card.preFunc || '',
      tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行;当前置函数返回中ErrCode等于-1时,将不再执行内部函数。`,
      tooltip: usefulFields.length ? `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行;当前置函数返回中ErrCode等于-1时,将不再执行内部函数。` : '',
      fields: usefulFields,
      required: false,
      readonly: false
@@ -1432,6 +1535,42 @@
      initVal: card.controlVal || '',
      required: false
    },
    {
      type: 'text',
      key: 'reason',
      label: '禁用原因',
      initVal: card.reason || '',
      required: false
    },
    {
      type: 'radio',
      key: 'hidden',
      label: '隐藏',
      initVal: card.hidden || 'false',
      tooltip: '隐藏后按钮在页面中不显示,且不参与权限分配。',
      required: false,
      options: [{
        value: 'false',
        text: '否'
      }, {
        value: 'true',
        text: '是'
      }]
    },
    {
      type: 'radio',
      key: 'progress',
      label: '进度提示',
      initVal: card.progress || 'number',
      required: false,
      options: [{
        value: 'number',
        text: '剩余数'
      }, {
        value: 'progressbar',
        text: '进度条'
      }]
    }
  ]
}
@@ -1487,6 +1626,9 @@
      }, {
        value: 'picture',
        text: Formdict['model.form.picture']
      }, {
        value: 'video',
        text: '视频'
      }, {
        value: 'link',
        text: Formdict['model.form.href']
@@ -1576,6 +1718,26 @@
      }]
    },
    {
      type: 'number',
      key: 'startTime',
      precision: 0,
      label: '开始时间',
      initVal: card.startTime || 0,
      tooltip: '视频开始播放的时间,用于调整视频初始化展示的界面。',
      required: false
    },
    {
      type: 'select',
      key: 'aspectRatio',
      label: '长宽比',
      initVal: card.aspectRatio || '16:9',
      required: true,
      options: [
        { value: '4:3', text: '4:3' },
        { value: '16:9', text: '16:9' }
      ]
    },
    {
      type: 'radio',
      key: 'rowspan',
      label: '行合并',
@@ -1626,10 +1788,10 @@
      type: 'select',
      key: 'format',
      label: Formdict['header.form.format'],
      initVal: card.format || '',
      initVal: card.format || 'none',
      options: [{
        value: '',
        text: Formdict['model.empty']
        value: 'none',
        text: '无'
      }, {
        value: 'thdSeparator',
        text: '千分位'
@@ -1646,10 +1808,13 @@
      type: 'select',
      key: 'textFormat',
      label: Formdict['header.form.format'],
      initVal: card.textFormat || '',
      initVal: card.textFormat || 'none',
      options: [{
        value: '',
        text: Formdict['model.empty']
        value: 'none',
        text: '无'
      }, {
        value: 'encryption',
        text: '加密'
      }, {
        value: 'YYYY-MM-DD',
        text: 'YYYY-MM-DD'
@@ -1678,15 +1843,39 @@
    },
    {
      type: 'number',
      key: 'maxHeight',
      key: 'span',
      min: 1,
      max: 1000,
      decimal: 0,
      label: '最大高度',
      tooltip: '图片在表格中显示的最大高度',
      tooltipClass: 'middle',
      initVal: card.maxHeight || 128,
      max: 24,
      precision: 0,
      label: '图片宽度',
      initVal: card.span || 24,
      tooltip: '栅格布局,等分为24份。',
      required: true
    },
    {
      type: 'select',
      key: 'lenWidRadio',
      label: '长宽比',
      initVal: card.lenWidRadio || '1:1',
      required: true,
      options: [
        { value: '1:1', text: '1:1' },
        { value: '4:3', text: '4:3' },
        { value: '3:2', text: '3:2' },
        { value: '16:9', text: '16:9' },
        { value: '2:1', text: '2:1' },
        { value: '3:1', text: '3:1' },
        { value: '4:1', text: '4:1' },
        { value: '5:1', text: '5:1' },
        { value: '6:1', text: '6:1' },
        { value: '7:1', text: '7:1' },
        { value: '8:1', text: '8:1' },
        { value: '9:1', text: '9:1' },
        { value: '10:1', text: '10:1' },
        { value: '3:4', text: '3:4' },
        { value: '2:3', text: '2:3' },
        { value: '9:16', text: '9:16' },
      ]
    },
    {
      type: 'radio',
@@ -2242,6 +2431,9 @@
    value: 'select',
    text: Formdict['model.form.select']
  }, {
    value: 'textarea',
    text: '多行文本'
  }, {
    value: 'multiselect',
    text: Formdict['model.form.multiselect']
  }, {
@@ -2261,19 +2453,19 @@
    text: '选项卡'
  }, {
    value: 'fileupload',
    text: Formdict['header.form.fileupload']
    text: '文件上传'
  }, {
    value: 'date',
    text: Formdict['model.form.dateday']
    text: '日期(天)'
  }, {
    value: 'datemonth',
    text: Formdict['model.form.datemonth']
  // }, {
  //   value: 'datetime',
  //   text: '日期(分/秒)'
  }, {
    value: 'datetime',
    text: Formdict['model.form.datetime']
  }, {
    value: 'textarea',
    text: Formdict['model.form.textarea']
    value: 'cascader',
    text: '级联菜单'
  }, {
    value: 'rate',
    text: '评分'
@@ -2295,6 +2487,9 @@
  }, {
    value: 'linkMain',
    text: '关联主表'
  }, {
    value: 'formula',
    text: '公式'
  }]
  let _fieldlength = 50
@@ -2326,19 +2521,22 @@
      text: '选项卡'
    }, {
      value: 'fileupload',
      text: Formdict['header.form.fileupload']
      text: '文件上传'
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
      text: '日期(天)'
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    }, {
      value: 'datetime',
      text: Formdict['model.form.datetime']
    // }, {
    //   value: 'datetime',
    //   text: '日期(分/秒)'
    }, {
      value: 'textarea',
      text: Formdict['model.form.textarea']
    }, {
      value: 'cascader',
      text: '级联菜单'
    }, {
      value: 'rate',
      text: '评分'
@@ -2354,6 +2552,9 @@
    }, {
      value: 'linkMain',
      text: '关联主表'
    }, {
      value: 'formula',
      text: '公式'
    }]
  }
@@ -2361,6 +2562,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 || []
@@ -2460,10 +2664,10 @@
      required: true,
      options: [{
        value: '0',
        text: Formdict['header.form.custom']
        text: '自定义'
      }, {
        value: '1',
        text: Formdict['header.form.datasource']
        text: '数据源'
      }]
    },
    {
@@ -2478,6 +2682,9 @@
      }, {
        value: 'picture',
        text: '图片'
      }, {
        value: 'color',
        text: '色块'
      }]
    },
    {
@@ -2509,9 +2716,9 @@
    },
    {
      type: 'radio',
      key: 'ratio',
      key: 'picratio',
      label: '图片比例',
      initVal: card.ratio || '1:1',
      initVal: card.picratio || card.ratio || '1:1',
      required: true,
      options: [{
        value: '1:1',
@@ -2590,6 +2797,14 @@
    },
    {
      type: 'text',
      key: 'topmark',
      label: '顶级标识',
      initVal: card.topmark || '',
      tooltip: '关联字段值与顶级标识相同时,视为顶级节点。',
      required: false
    },
    {
      type: 'text',
      key: 'valueField',
      label: '值·字段',
      initVal: card.valueField || '',
@@ -2633,16 +2848,6 @@
      tooltip: '设置禁用字段,且字段值为true时,选项不可选。',
      required: false,
      readonly: false
    },
    {
      type: 'number',
      key: 'decimal',
      min: 0,
      max: 18,
      precision: 0,
      label: Formdict['header.form.decimal'],
      initVal: card.decimal || 0,
      required: true
    },
    {
      type: 'number',
@@ -2759,6 +2964,72 @@
      }]
    },
    {
      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: 'declareType',
      label: '数据类型',
      tooltip: '声明变量时的类型,时间格式datetime或文本格式nvarchar(50)。',
      initVal: card.declareType || 'datetime',
      options: [{
        value: 'datetime',
        text: 'datetime'
      }, {
        value: 'nvarchar(50)',
        text: 'nvarchar(50)'
      }]
    },
    {
      type: 'text',
      key: 'separator',
      label: '连接符',
      initVal: card.separator === undefined ? '/' : card.separator,
      tooltip: '表单提交时信息之间的连接符。注:连接符为空时,初始化时填充其他表单无效。',
      required: false,
      readonly: false
    },
    {
      type: 'radio',
      key: 'declare',
      label: '数据类型',
      initVal: card.declare || 'nvarchar',
      tooltip: '声明变量时的类型。使用 decimal 时,请确认Value为数值,且不可为空。',
      options: [{
        value: 'nvarchar',
        text: 'nvarchar'
      }, {
        value: 'decimal',
        text: 'decimal'
      }]
    },
    {
      type: 'number',
      key: 'decimal',
      min: 0,
      max: 18,
      precision: 0,
      label: Formdict['header.form.decimal'],
      initVal: card.decimal || 0,
      required: true
    },
    {
      type: 'number',
      key: 'fieldlength',
      min: 1,
@@ -2767,7 +3038,7 @@
      label: Formdict['model.form.field'] + Formdict['model.length'],
      // tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512',
      initVal: card.fieldlength || _fieldlength,
      required: false
      required: true
    },
    {
      type: 'number',
@@ -2787,19 +3058,25 @@
      initVal: card.regular || '',
      options: [{
        value: '',
        text: Formdict['model.empty']
        text: '空'
      }, {
        value: 'number',
        text: Formdict['model.form.number']
        text: '数字'
      }, {
        value: 'letter',
        text: Formdict['header.form.letter']
        text: '字母'
      }, {
        value: 'letter_number',
        text: '数字或字母'
      }, {
        value: 'letter&number',
        text: '字母+数字'
        text: '数字、字母以及@_.'
      }, {
        value: 'phone',
        text: '手机号'
      }, {
        value: 'email',
        text: '邮箱'
      }]
    },
    {
@@ -2834,15 +3111,15 @@
    },
    {
      type: 'radio',
      key: 'allowHalf',
      label: '半选',
      initVal: card.allowHalf || 'false',
      key: 'hidden',
      label: "隐藏",
      initVal: card.hidden || 'false',
      options: [{
        value: 'true',
        text: '支持'
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: '不支持'
        text: Formdict['model.false']
      }]
    },
    {
@@ -2861,21 +3138,8 @@
    {
      type: 'radio',
      key: 'required',
      label: Formdict['model.required'],
      label: "必填",
      initVal: card.required || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'hidden',
      label: Formdict['model.hidden'],
      initVal: card.hidden || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
@@ -2932,14 +3196,14 @@
      type: 'radio',
      key: 'readin',
      label: '自动填充',
      tooltip: '是否将表格选中的数据自动填充到表单(字段相同)',
      tooltip: '将表格选中的数据自动填充到表单中。注:在批量操作时,如想要所选行(当前字段)全部修改请设为否或首行。',
      initVal: card.readin || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }, {
        value: 'top',
        text: '首行'
@@ -2958,6 +3222,26 @@
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'allowHalf',
      label: '半选',
      initVal: card.allowHalf || 'false',
      options: [{
        value: 'true',
        text: '支持'
      }, {
        value: 'false',
        text: '不支持'
      }]
    },
    {
      type: 'color',
      key: 'color',
      label: '颜色',
      initVal: card.color || '#fadb14',
      required: true
    },
    {
      type: 'number',
@@ -3019,33 +3303,29 @@
      }]
    },
    {
      type: 'radio',
      key: 'selectStyle',
      label: '选中效果',
      tooltip: '背景及文字变化时会使用系统色。',
      initVal: card.selectStyle || (card.backgroundColor ? 'custom' : 'background'),
      options: [{
        value: 'background',
        text: '背景变化'
      }, {
        value: 'font',
        text: '文字变化'
      }, {
        value: 'custom',
        text: '自定义'
      }]
    },
    {
      type: 'color',
      key: 'backgroundColor',
      label: '背景色',
      initVal: card.backgroundColor || '',
      tooltip: '设置背景色后,选中效果由背景颜色控制。',
      required: false
    },
    {
      type: 'color',
      key: 'borderColor',
      label: '边框颜色',
      initVal: card.borderColor || '',
      required: false
    },
    {
      type: 'radio',
      key: 'declareType',
      label: '数据类型',
      tooltip: '声明变量时的类型,时间格式datetime或文本格式nvarchar(50)。',
      initVal: card.declareType || 'datetime',
      options: [{
        value: 'datetime',
        text: 'datetime'
      }, {
        value: 'nvarchar(50)',
        text: 'nvarchar(50)'
      }]
      required: true
    },
    // {
    //   type: 'radio',
@@ -3066,12 +3346,16 @@
      key: 'encryption',
      label: '加密传输',
      initVal: card.type === 'brafteditor' ? (card.encryption || 'true') : (card.encryption || 'false'),
      tooltip: '使用md5加密时,加密前内容会转为小写,加密后的md5值为32位大写。',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '无'
      }, {
        value: 'true',
        text: 'base64加密'
      }, {
        value: 'md5',
        text: 'md5加密'
      }]
    },
    {
@@ -3087,6 +3371,37 @@
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'textarea',
      key: 'formula',
      label: '公式',
      initVal: card.formula || '',
      tooltip: '动态替换相应的字段,展示获得的结果。可使用JS的一些语法,如:三元表达式 @field1@ > @field2@ ? 0 : 1;Math对象,取绝对值 Math.abs(@field@)、四舍五入 Math.round(@field@)等',
      rows: 2,
      required: true
    },
    {
      type: 'radio',
      key: 'eval',
      label: '解析',
      initVal: card.eval || 'true',
      tooltip: '当公式内容涉及计算时请选择“是”,当公式内容为字段拼接时请选择“否”。',
      required: false,
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'text',
      key: 'postfix',
      label: '后缀',
      initVal: card.postfix || '',
      required: false
    },
    {
      type: 'radio',
@@ -3135,15 +3450,21 @@
    {
      type: 'radio',
      key: 'compress',
      label: '压缩',
      label: '文件处理',
      initVal: card.compress || 'false',
      tooltip: '文件压缩必须为图片,图片格式为jpg、png、gif 或 jpeg',
      tooltip: '文件压缩或base64必须为图片,图片格式为jpg、png、gif 或 jpeg。注:base64只可上传一张图片。',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '默认'
      }, {
        value: 'true',
        text: '压缩'
      }, {
        value: 'base64',
        text: 'base64'
      }, {
        value: 'oss',
        text: 'oss上传'
      }]
    },
    {
@@ -3156,6 +3477,90 @@
      initVal: card.limit || 2,
      tooltip: '压缩起点,小于起点值的文件不进行压缩。',
      required: true
    },
    {
      type: 'radio',
      key: 'miniSet',
      label: '小程序设置',
      initVal: card.miniSet || 'default',
      options: [{
        value: 'default',
        text: '默认'
      }, {
        value: 'custom',
        text: '自定义'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'checkbox',
      key: 'mediaType',
      label: '文件类型',
      initVal: card.mediaType || ['image', 'video'],
      options: [{
        value: 'image',
        text: '图片'
      }, {
        value: 'video',
        text: '视频'
      }],
      required: true,
      forbid: appType !== 'mob'
    },
    {
      type: 'checkbox',
      key: 'sourceType',
      label: '文件来源',
      initVal: card.sourceType || ['album', 'camera'],
      options: [{
        value: 'album',
        text: '相册选择'
      }, {
        value: 'camera',
        text: '相机拍摄'
      }],
      required: true,
      forbid: appType !== 'mob'
    },
    {
      type: 'radio',
      key: 'sizeType',
      label: '图片压缩',
      initVal: card.sizeType || 'compressed',
      options: [{
        value: 'compressed',
        text: '是'
      }, {
        value: 'original',
        text: '否'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'number',
      key: 'maxDuration',
      label: '拍摄时长',
      initVal: card.maxDuration || 10,
      tooltip: '拍摄视频最长拍摄时间,单位秒。时间范围为 3s 至 60s 之间。不限制相册。',
      min: 3,
      max: 60,
      precision: 0,
      required: true,
      forbid: appType !== 'mob'
    },
    {
      type: 'radio',
      key: 'camera',
      label: '摄像头',
      initVal: card.camera || 'back',
      options: [{
        value: 'back',
        text: '后置'
      }, {
        value: 'front',
        text: '前置'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'number',
@@ -3189,6 +3594,24 @@
      }, {
        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: '右截'
      }]
    },
    {
@@ -3247,6 +3670,7 @@
    {
      type: 'text',
      key: 'supvalue',
      max: 512,
      label: '显示值',
      tooltip: '请填写显示值,只有上级表单值与显示值相同时,该表单才会显示,注:1、多个值用逗号分隔;2、上级表单初始值为$first时暂未处理。',
      initVal: card.supvalue || '',
@@ -3270,6 +3694,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',
@@ -3320,35 +3760,36 @@
      initVal: card.linkSubField || [],
      options: inputfields
    },
    {
      type: 'number',
      key: 'marginTop',
      label: '上边距(px)',
      initVal: card.marginTop || 0,
      min: 0,
      max: 1000,
      precision: 0,
      required: false,
      forbid: appType !== 'mob'
    },
    {
      type: 'number',
      key: 'marginBottom',
      label: '下边距(px)',
      initVal: card.marginBottom || 0,
      min: 0,
      max: 1000,
      precision: 0,
      required: false,
      forbid: appType !== 'mob'
    },
    // {
    //   type: 'number',
    //   key: 'marginTop',
    //   label: '上边距(px)',
    //   initVal: card.marginTop || 0,
    //   min: -100,
    //   max: 1000,
    //   precision: 0,
    //   required: false,
    //   forbid: appType !== 'mob'
    // },
    // {
    //   type: 'number',
    //   key: 'marginBottom',
    //   label: '下边距(px)',
    //   initVal: card.marginBottom || 0,
    //   min: -100,
    //   max: 1000,
    //   precision: 0,
    //   required: false,
    //   forbid: appType !== 'mob'
    // },
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],
      initVal: card.blacklist || [],
      required: false,
      options: roleList
      options: roleList,
      forbid: appType === 'mob'
    }
  ]
}