king
2022-08-06 cbeffcc0902631909c0373f274752a97ddaf2d4e
src/templates/zshare/formconfig.jsx
@@ -1,6 +1,6 @@
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import { formRule } from '@/utils/option.js'
import { formRule, btnClasses } from '@/utils/option.js'
const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
@@ -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']
@@ -364,23 +376,31 @@
    }
  }
  let options = card.options || []
  if (['select', 'link'].includes(card.type) && card.setAll === 'true') { // 兼容
    options.unshift({
      key: 'empty',
      Value: '',
      Text: '全部',
      ParentID: ''
    })
  }
  return [
    {
      type: 'text',
      key: 'label',
      label: Formdict['model.name'],
      initVal: card.label || '',
      required: true,
      readonly: false
      required: true
    },
    {
      type: 'text',
      key: 'field',
      label: Formdict['model.form.field'],
      initVal: card.field || '',
      tooltipClass: 'middle',
      required: true,
      readonly: false
      options: columns
    },
    {
      type: 'select',
@@ -395,8 +415,7 @@
      key: 'datefield',
      label: '时间字段',
      initVal: card.datefield || '',
      required: true,
      readonly: false
      required: true
    },
    {
      type: 'text',
@@ -420,19 +439,19 @@
        text: Formdict['header.form.datasource']
      }]
    },
    {
      type: 'radio',
      key: 'setAll',
      label: '设置全部',
      initVal: card.setAll || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    // {
    //   type: 'radio',
    //   key: 'setAll',
    //   label: '设置全部',
    //   initVal: card.setAll || 'true',
    //   options: [{
    //     value: 'true',
    //     text: Formdict['model.true']
    //   }, {
    //     value: 'false',
    //     text: Formdict['model.false']
    //   }]
    // },
    {
      type: 'radio',
      key: 'display',
@@ -445,6 +464,9 @@
      }, {
        value: 'picture',
        text: '图片'
      }, {
        value: 'color',
        text: '色块'
      }]
    },
    {
@@ -463,16 +485,14 @@
      key: 'cardValField',
      label: '值·字段',
      initVal: card.cardValField || 'Value',
      required: true,
      readonly: false
      required: true
    },
    {
      type: 'text',
      key: 'urlField',
      label: '地址字段',
      initVal: card.urlField || '',
      required: true,
      readonly: false
      required: true
    },
    {
      type: 'radio',
@@ -499,24 +519,21 @@
      key: 'fields',
      label: '字段集',
      initVal: card.fields || [],
      required: true,
      readonly: false
      required: true
    },
    {
      type: 'textarea',
      type: 'codemirror',
      key: 'dataSource',
      label: Formdict['header.form.datasource'],
      initVal: card.dataSource || '',
      required: true,
      readonly: false
      required: true
    },
    {
      type: 'options',
      key: 'options',
      label: '选项',
      initVal: card.options || [],
      required: true,
      readonly: false
      initVal: options,
      required: true
    },
    {
      type: 'checkbox',
@@ -524,7 +541,6 @@
      label: '选项',
      initVal: card.items || ['day', 'week', 'month', 'quarter', 'year', 'customized'],
      required: true,
      readonly: false,
      options: [{
        value: 'day',
        label: '日'
@@ -546,12 +562,26 @@
      }]
    },
    {
      type: 'radio',
      key: 'multiple',
      label: '选择形式',
      initVal: card.multiple || 'false',
      required: true,
      options: [{
        value: 'false',
        text: '单选'
      }, {
        value: 'true',
        text: '多选'
      }]
    },
    {
      type: 'select',
      key: 'linkField',
      label: '关联字段',
      initVal: card.linkField || '',
      required: true,
      readonly: false,
      allowClear: true,
      options: linkableFields
    },
    {
@@ -559,24 +589,21 @@
      key: 'valueField',
      label: '值·字段',
      initVal: card.valueField || '',
      required: true,
      readonly: false
      required: true
    },
    {
      type: 'text',
      key: 'valueText',
      label: '文本·字段',
      initVal: card.valueText || '',
      required: true,
      readonly: false
      required: true
    },
    {
      type: 'text',
      key: 'orderBy',
      label: '排序·字段',
      initVal: card.orderBy || '',
      required: false,
      readonly: false
      required: false
    },
    {
      type: 'select',
@@ -639,17 +666,34 @@
      required: false
    },
    {
      type: 'radio',
      key: 'multiple',
      label: '可多选',
      initVal: card.multiple || '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: 'true',
        text: '是'
        value: 'day',
        text: '天'
      }, {
        value: 'false',
        text: '否'
        value: 'hour',
        text: '小时'
      }, {
        value: 'minute',
        text: '分钟'
      }, {
        value: 'second',
        text: '秒'
      }]
    },
    {
@@ -749,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']
@@ -788,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',
@@ -808,7 +863,8 @@
      label: Formdict['header.form.blacklist'],
      initVal: card.blacklist || [],
      required: false,
      options: roleList || []
      options: roleList || [],
      forbid: appType === 'mob'
    }
  ]
}
@@ -820,7 +876,7 @@
 * @param {*} usefulFields   存储过程可用的开始字段
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, config, usefulFields, type, menulist = [], printTemps = []) {
export function getActionForm (card, config, usefulFields, type, menulist = [], printTemps = [], tabs = []) {
  let columns = (config.columns || []).filter(col => col.field)
  let opentypes = [
@@ -864,6 +920,11 @@
    card.popClose = 'grid'
  }
  if (card.OpenType === 'outerpage') {
    card.pageTemplate = 'custom'
    card.OpenType = 'innerpage'
  }
  let refresh = []
  if (type === 'subtable') { // 子表页面,可设置刷新主表及同级标签
@@ -886,6 +947,10 @@
    card.control = 'disabled'
  }
  if (card.intertype === 'outer' && !card.procMode && !card.innerFunc) { // 兼容外部函数直传类型
    card.procMode = 'none'
  }
  return [
    {
      type: 'select',
@@ -894,6 +959,14 @@
      initVal: card.OpenType,
      required: true,
      options: opentypes
    },
    {
      type: 'text',
      key: 'label',
      label: '按钮名称',
      initVal: card.label,
      required: true,
      readonly: false
    },
    {
      type: 'select',
@@ -910,7 +983,23 @@
      }, {
        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',
@@ -941,7 +1030,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',
@@ -949,6 +1039,9 @@
      }, {
        value: 'inner',
        text: '内部函数'
      }, {
        value: 'none',
        text: '无'
      }]
    },
    {
@@ -958,14 +1051,6 @@
      initVal: card.sqlType || '',
      required: true,
      options: []
    },
    {
      type: 'text',
      key: 'label',
      label: '按钮名称',
      initVal: card.label,
      required: true,
      readonly: false
    },
    {
      type: 'text',
@@ -979,10 +1064,18 @@
      key: 'innerFunc',
      label: Formdict['header.form.innerFunc'],
      initVal: card.innerFunc || '',
      tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始。`,
      tooltip: usefulFields.length ? `函数名称需以${usefulFields.join(', ')}等字符开始。` : '',
      fields: usefulFields,
      tooltipClass: 'middle',
      required: card.intertype === 'inner',
      readonly: false
    },
    {
      type: 'text',
      key: 'urlkey',
      label: '地址字段',
      initVal: card.urlkey || '',
      tooltip: '图片(文件)链接的字段名。',
      required: false,
      readonly: false
    },
    {
@@ -991,7 +1084,13 @@
      label: '关联标签',
      initVal: card.linkTab || '',
      required: false,
      options: []
      options: [
        {
          value: '',
          text: '新建'
        },
        ...tabs
      ]
    },
    {
      type: 'select',
@@ -1102,7 +1201,7 @@
      type: 'radio',
      key: 'callbackType',
      label: '回调方式',
      initVal: card.callbackType || 'script',
      initVal: card.callbackType || (card.callbackFunc ? 'func' : 'script'),
      tooltip: '使用后台脚本执行时,需要配合计划任务。',
      required: true,
      options: [{
@@ -1111,6 +1210,12 @@
      }, {
        value: 'default',
        text: '后台脚本'
      }, {
        value: 'func',
        text: '回调函数'
      }, {
        value: 'none',
        text: '无'
      }]
    },
    {
@@ -1125,7 +1230,7 @@
      key: 'callbackFunc',
      label: Formdict['header.form.callbackFunc'],
      initVal: card.callbackFunc || '',
      required: false,
      required: true,
      readonly: false
    },
    {
@@ -1170,18 +1275,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]
    },
@@ -1196,11 +1301,11 @@
        value: 'never',
        text: '不刷新'
      }, {
        value: 'grid',
        text: '刷新表格'
      }, {
        value: 'line',
        text: '刷新行'
      }, {
        value: 'grid',
        text: '刷新表格'
      },
      ...refresh]
    },
@@ -1246,7 +1351,7 @@
      label: Formdict['model.form.color'],
      initVal: card.class,
      required: false,
      options: []
      options: btnClasses
    },
    {
      type: 'cascader',
@@ -1261,8 +1366,16 @@
      type: 'text',
      key: 'output',
      label: '返回值',
      tooltip: '执行成功后的返回值。',
      tooltip: '执行成功后的返回值。系统函数可指定返回的变量(以@符开头,如@id);自定义函数可指定返回字段(如id)。',
      initVal: card.output || '',
      required: false
    },
    {
      type: 'text',
      key: 'tipTitle',
      label: '确认提示',
      initVal: card.tipTitle || '',
      tooltip: '注:弹窗(表单)在显示为是否框时有效。',
      required: false
    },
    {
@@ -1332,11 +1445,11 @@
      type: 'number',
      key: 'ratio',
      min: 1,
      max: 24,
      max: 3000,
      precision: 0,
      label: '比例',
      initVal: card.ratio || 85,
      tooltip: '小于100为宽度(或高度)百分比,大于100为像素值。',
      tooltip: '模态框或抽屉的宽度,小于100为窗口宽度(或高度)百分比,大于100为像素值。',
      required: true
    },
    {
@@ -1378,9 +1491,8 @@
      key: 'preFunc',
      label: '前置函数',
      initVal: card.preFunc || '',
      tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行;当前置函数返回中ErrCode等于-1时,将不再执行内部函数。`,
      tooltip: usefulFields.length ? `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行;当前置函数返回中ErrCode等于-1时,将不再执行内部函数。` : '',
      fields: usefulFields,
      tooltipClass: 'middle',
      required: false,
      readonly: false
    },
@@ -1418,6 +1530,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: '进度条'
      }]
    }
  ]
}
@@ -1618,7 +1766,7 @@
        text: Formdict['model.empty']
      }, {
        value: 'thdSeparator',
        text: Formdict['header.form.thdSeparator']
        text: '千分位'
      }, {
        value: 'percent',
        text: '百分比'
@@ -2247,19 +2395,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: '评分'
@@ -2281,6 +2432,9 @@
  }, {
    value: 'linkMain',
    text: '关联主表'
  }, {
    value: 'formula',
    text: '公式'
  }]
  let _fieldlength = 50
@@ -2312,19 +2466,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: '评分'
@@ -2337,6 +2494,12 @@
    }, {
      value: 'split',
      text: '分隔线'
    }, {
      value: 'linkMain',
      text: '关联主表'
    }, {
      value: 'formula',
      text: '公式'
    }]
  }
@@ -2344,6 +2507,30 @@
    _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 || []
  if (['select', 'radio', 'link'].includes(card.type) && card.setAll === 'true') { // 兼容
    options.unshift({
      key: 'empty',
      Value: '',
      Text: card.emptyText || '空',
      ParentID: ''
    })
  }
  let initval = card.initval || ''
  if (card.type === 'switch') {
    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 [
@@ -2375,8 +2562,7 @@
      type: 'text',
      key: 'initval',
      label: Formdict['header.form.initval'],
      tooltip: '下拉多选与多选框,添加多个初始值请使用“,”号分隔。注:下拉选择、联动菜单或单选框中$first表示选择第一项',
      initVal: card.initval || '',
      initVal: initval,
      required: false
    },
    {
@@ -2406,16 +2592,14 @@
      key: 'openText',
      label: '开启提示',
      initVal: card.openText || '',
      required: false,
      forbid: appType === 'mob'
      required: false
    },
    {
      type: 'text',
      key: 'closeText',
      label: '关闭提示',
      initVal: card.closeText || '',
      required: false,
      forbid: appType === 'mob'
      required: false
    },
    {
      type: 'radio',
@@ -2425,10 +2609,10 @@
      required: true,
      options: [{
        value: '0',
        text: Formdict['header.form.custom']
        text: '自定义'
      }, {
        value: '1',
        text: Formdict['header.form.datasource']
        text: '数据源'
      }]
    },
    {
@@ -2443,6 +2627,9 @@
      }, {
        value: 'picture',
        text: '图片'
      }, {
        value: 'color',
        text: '色块'
      }]
    },
    {
@@ -2474,9 +2661,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',
@@ -2492,19 +2679,19 @@
        text: '16:9'
      }]
    },
    {
      type: 'radio',
      key: 'setAll',
      label: '设置空值',
      initVal: card.setAll || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    // {
    //   type: 'radio',
    //   key: 'setAll',
    //   label: '设置空值',
    //   initVal: card.setAll || 'false',
    //   options: [{
    //     value: 'true',
    //     text: Formdict['model.true']
    //   }, {
    //     value: 'false',
    //     text: Formdict['model.false']
    //   }]
    // },
    {
      type: 'fields',
      key: 'fields',
@@ -2517,7 +2704,7 @@
      type: 'options',
      key: 'options',
      label: '选项',
      initVal: card.options || [],
      initVal: options,
      required: true,
      readonly: false
    },
@@ -2530,13 +2717,36 @@
      readonly: false
    },
    {
      type: 'radio',
      key: 'multiple',
      label: '选择形式',
      initVal: card.multiple || 'false',
      required: true,
      options: [{
        value: 'false',
        text: '单选'
      }, {
        value: 'true',
        text: '多选'
      }]
    },
    {
      type: 'select',
      key: 'linkField',
      label: '关联字段',
      initVal: card.linkField || '',
      required: true,
      readonly: false,
      allowClear: true,
      options: linkableFields
    },
    {
      type: 'text',
      key: 'topmark',
      label: '顶级标识',
      initVal: card.topmark || '',
      tooltip: '关联字段值与顶级标识相同时,视为顶级节点。',
      required: false
    },
    {
      type: 'text',
@@ -2583,30 +2793,6 @@
      tooltip: '设置禁用字段,且字段值为true时,选项不可选。',
      required: false,
      readonly: false
    },
    {
      type: 'radio',
      key: 'multiple',
      label: '可多选',
      initVal: card.multiple || 'false',
      required: true,
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'number',
      key: 'decimal',
      min: 0,
      max: 18,
      precision: 0,
      label: Formdict['header.form.decimal'],
      initVal: card.decimal || 0,
      required: true
    },
    {
      type: 'number',
@@ -2723,15 +2909,81 @@
      }]
    },
    {
      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 || card.separator === undefined ? '/' : '',
      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,
      max: 1000000,
      max: 100000,
      precision: 0,
      label: Formdict['model.form.field'] + Formdict['model.length'],
      tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512',
      // tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512',
      initVal: card.fieldlength || _fieldlength,
      required: false
      required: true
    },
    {
      type: 'number',
@@ -2751,19 +3003,22 @@
      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: '字母+数字'
        text: '数字、字母以及_@_.'
      }, {
        value: 'phone',
        text: '手机号'
      }, {
        value: 'email',
        text: '邮箱'
      }]
    },
    {
@@ -2983,33 +3238,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',
@@ -3030,6 +3281,24 @@
      key: 'encryption',
      label: '加密传输',
      initVal: card.type === 'brafteditor' ? (card.encryption || 'true') : (card.encryption || 'false'),
      tooltip: '使用md5加密时,加密前内容会转为小写,加密后的md5值为32位大写。',
      options: [{
        value: 'false',
        text: '无'
      }, {
        value: 'true',
        text: 'base64加密'
      }, {
        value: 'md5',
        text: 'md5加密'
      }]
    },
    {
      type: 'radio',
      key: 'interception',
      label: '截取空格',
      initVal: card.interception || 'true',
      tooltip: '提交时,是否截取首尾的空白字符。',
      options: [{
        value: 'true',
        text: Formdict['model.true']
@@ -3039,18 +3308,35 @@
      }]
    },
    {
      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: 'interception',
      label: '截取空格',
      initVal: card.interception || 'false',
      tooltip: '提交时,是否截取首尾的空白字符。',
      key: 'eval',
      label: '解析',
      initVal: card.eval || 'true',
      tooltip: '当公式内容涉及计算时请选择“是”,当公式内容为字段拼接时请选择“否”。',
      required: false,
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
      type: 'text',
      key: 'postfix',
      label: '后缀',
      initVal: card.postfix || '',
      required: false
    },
    {
      type: 'radio',
@@ -3099,15 +3385,18 @@
    {
      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'
      }]
    },
    {
@@ -3132,6 +3421,46 @@
      tooltip: '栅格布局整行24等分。',
      required: true,
      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',
@@ -3179,19 +3508,21 @@
      type: 'select',
      key: 'supField',
      label: '上级表单',
      tooltip: '上级表单为下拉选择、联动菜单、单选框及多选框,添加后该表单显示及隐藏将受上级表单控制,注:受控关系在该表单隐藏时失效。',
      tooltip: '该表单显示或隐藏受上级表单控制。',
      initVal: card.supField || '',
      required: false,
      readonly: false,
      allowClear: true,
      options: linksupFields
    },
    {
      type: 'text',
      key: 'supvalue',
      max: 512,
      label: '显示值',
      tooltip: '请填写显示值,只有上级表单值与显示值相同时,该表单才会显示,注:1、多个值用逗号分隔;2、上级表单初始值为$first时暂未处理。',
      initVal: card.supvalue || '',
      required: true,
      required: false,
      readonly: false
    },
    {
@@ -3213,6 +3544,22 @@
      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',
      key: 'placeholder',
      label: '提示信息',
@@ -3220,14 +3567,14 @@
      initVal: card.placeholder || '',
      required: false
    },
    {
      type: 'text',
      key: 'emptyText',
      label: '空值文本',
      tooltip: '空值的提示文本,选择设置空值时有效,默认值为《空》。',
      initVal: card.emptyText || '',
      required: false
    },
    // {
    //   type: 'text',
    //   key: 'emptyText',
    //   label: '空值文本',
    //   tooltip: '空值的提示文本,选择设置空值时有效,默认值为《空》。',
    //   initVal: card.emptyText || '',
    //   required: false
    // },
    {
      type: 'radio',
      key: 'enter',
@@ -3256,40 +3603,41 @@
    {
      type: 'multiselect',
      key: 'linkSubField',
      label: Formdict['model.form.linkform'],
      tooltip: '在切换选项时会把信息自动填入关联的表单(文本或数字表单)中。注:使用选项卡且设为可多选时无效。',
      label: '填充表单',
      tooltip: '在切换选项时会把信息自动填入关联的表单(文本或数字表单)中。',
      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'
    }
  ]
}