king
2022-06-18 fe21d23b147ed5cec22b4f76a88840b05495d4ad
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
@@ -286,7 +286,7 @@
 * @param {object} card           // 搜索条件对象
 * @param {Array}  linkableFields // 可关联字段
 */
export function getSearchForm (card, linkableFields) {
export function getSearchForm (card, linkableFields, columns) {
  let roleList = sessionStorage.getItem('sysRoles')
  let appType = sessionStorage.getItem('appType')
  if (roleList) {
@@ -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: '数值(区间)'
@@ -314,10 +322,11 @@
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    }, {
      value: 'daterange',
      text: Formdict['model.form.daterange']
    // }, {
    //   value: 'daterange',
    //   text: Formdict['model.form.daterange']
    }]
  } else {
    typeOptions = [{
      value: 'text',
@@ -364,23 +373,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 +412,7 @@
      key: 'datefield',
      label: '时间字段',
      initVal: card.datefield || '',
      required: true,
      readonly: false
      required: true
    },
    {
      type: 'text',
@@ -409,7 +425,7 @@
    {
      type: 'radio',
      key: 'resourceType',
      label: Formdict['header.form.resourceType'],
      label: '选项来源',
      initVal: card.resourceType || '0',
      required: true,
      options: [{
@@ -420,19 +436,19 @@
        text: Formdict['header.form.datasource']
      }]
    },
    {
      type: 'radio',
      key: 'setAll',
      label: Formdict['header.form.setAll'],
      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',
@@ -461,18 +477,16 @@
    {
      type: 'text',
      key: 'cardValField',
      label: Formdict['header.form.valueField'],
      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 +513,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 +535,6 @@
      label: '选项',
      initVal: card.items || ['day', 'week', 'month', 'quarter', 'year', 'customized'],
      required: true,
      readonly: false,
      options: [{
        value: 'day',
        label: '日'
@@ -546,42 +556,53 @@
      }]
    },
    {
      type: 'radio',
      key: 'multiple',
      label: '选择形式',
      initVal: card.multiple || 'false',
      required: true,
      options: [{
        value: 'false',
        text: '单选'
      }, {
        value: 'true',
        text: '多选'
      }]
    },
    {
      type: 'select',
      key: 'linkField',
      label: Formdict['header.form.linkField'],
      label: '关联字段',
      initVal: card.linkField || '',
      required: true,
      readonly: false,
      allowClear: true,
      options: linkableFields
    },
    {
      type: 'text',
      key: 'valueField',
      label: Formdict['header.form.valueField'],
      label: '值·字段',
      initVal: card.valueField || '',
      required: true,
      readonly: false
      required: true
    },
    {
      type: 'text',
      key: 'valueText',
      label: Formdict['header.form.valueText'],
      label: '文本·字段',
      initVal: card.valueText || '',
      required: true,
      readonly: false
      required: true
    },
    {
      type: 'text',
      key: 'orderBy',
      label: Formdict['header.form.orderBy'],
      label: '排序·字段',
      initVal: card.orderBy || '',
      required: false,
      readonly: false
      required: false
    },
    {
      type: 'select',
      key: 'orderType',
      label: Formdict['header.form.orderType'],
      label: '排序方式',
      initVal: card.orderType || 'asc',
      options: [{
        value: 'asc',
@@ -617,14 +638,14 @@
    {
      type: 'radio',
      key: 'database',
      label: Formdict['header.form.database'],
      label: '数据库',
      initVal: card.database || 'local',
      options: [{
        value: 'local',
        text: Formdict['header.form.database.local']
        text: '本地'
      }, {
        value: 'sso',
        text: Formdict['header.form.database.sso']
        text: '系统'
      }]
    },
    {
@@ -639,17 +660,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: '秒'
      }]
    },
    {
@@ -676,6 +714,20 @@
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'query',
      label: '参与查询',
      initVal: card.query || 'true',
      tooltip: '是否作为 where 条件,参与数据查询。',
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    // {
@@ -720,14 +772,14 @@
    {
      type: 'radio',
      key: 'labelShow',
      label: '显示名称',
      label: '名称',
      initVal: card.labelShow || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '显示'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '隐藏'
      }]
    },
    {
@@ -735,6 +787,7 @@
      key: 'advanced',
      label: '高级搜索',
      initVal: card.advanced || 'false',
      tooltip: '在隐藏搜索按钮时,高级搜索无效。',
      forbid: appType === 'mob',
      options: [{
        value: 'true',
@@ -794,7 +847,8 @@
      label: Formdict['header.form.blacklist'],
      initVal: card.blacklist || [],
      required: false,
      options: roleList || []
      options: roleList || [],
      forbid: appType === 'mob'
    }
  ]
}
@@ -806,7 +860,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 = [
@@ -840,23 +894,19 @@
    }
  ]
  // 标签类型,主表才会存在表单标签页
  let tabTems = [{
    value: 'FormTab',
    text: '表单标签页'
  }]
  if (type === 'subtable') {
    tabTems = []
  }
  if (card.execSuccess === 'view' || card.execSuccess === 'refresh') { // refresh为表单标签页
    card.execSuccess = 'grid'
  }
  if (card.execError === 'view' || card.execSuccess === 'refresh') {
  if (card.execError === 'view' || card.execError === 'refresh') {
    card.execError = 'grid'
  }
  if (card.popClose === 'view') {
    card.popClose = 'grid'
  }
  if (card.OpenType === 'outerpage') {
    card.pageTemplate = 'custom'
    card.OpenType = 'innerpage'
  }
  let refresh = []
@@ -867,11 +917,18 @@
    }
    refresh.push({
      value: 'maingrid',
      text: Formdict['header.form.refresh.maingrid']
      text: '刷新主表(行)'
    }, {
      value: 'equaltab',
      text: Formdict['header.form.refresh.equaltab']
      text: '刷新同级标签'
    })
  }
  if (card.OpenType === 'blank') {
    card.OpenType = 'tab'
  }
  if (!card.control && card.controlField) {
    card.control = 'disabled'
  }
  return [
@@ -886,19 +943,32 @@
    {
      type: 'select',
      key: 'funcType',
      label: Formdict['header.form.funcType'],
      label: '功能类型',
      initVal: card.funcType || '',
      required: true,
      options: [{
        value: 'changeuser',
        text: Formdict['header.form.func.changeuser']
        text: '切换用户'
      }, {
        value: 'print',
        text: '标签打印'
      }, {
        value: 'closetab',
        text: '标签关闭'
      }, {
        value: 'megvii',
        text: '旷视面板机'
      }]
    },
    { // 旷视面板机接口 待扩展
      type: 'radio',
      key: 'subFunc',
      label: '接口名称',
      initVal: card.subFunc || 'addUser',
      required: true,
      options: [
        { value: 'addUser', text: '添加用户' },
      ]
    },
    {
      type: 'select',
@@ -969,7 +1039,6 @@
      initVal: card.innerFunc || '',
      tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始。`,
      fields: usefulFields,
      tooltipClass: 'middle',
      required: card.intertype === 'inner',
      readonly: false
    },
@@ -979,7 +1048,13 @@
      label: '关联标签',
      initVal: card.linkTab || '',
      required: false,
      options: []
      options: [
        {
          value: '',
          text: '新建'
        },
        ...tabs
      ]
    },
    {
      type: 'select',
@@ -1119,7 +1194,7 @@
    {
      type: 'radio',
      key: 'position',
      label: Formdict['header.form.position'],
      label: '显示位置',
      initVal: card.position || 'toolbar',
      required: true,
      options: [{
@@ -1139,20 +1214,6 @@
      options: []
    },
    {
      type: 'select',
      key: 'tabTemplate',
      label: '标签类型',
      initVal: card.tabTemplate || '',
      required: true,
      options: [
        {
          value: 'ThdMenu',
          text: Formdict['model.menu.level3']
        },
        ...tabTems
      ]
    },
    {
      type: 'cascader',
      key: 'linkmenu',
      label: Formdict['model.form.linkmenu'],
@@ -1169,45 +1230,21 @@
      options: menulist
    },
    {
      type: 'radio',
      key: 'afterExecSuccess',
      label: Formdict['header.form.afterExecSuccess'],
      initVal: card.afterExecSuccess || 'close',
      required: true,
      options: [{
        value: 'close',
        text: Formdict['model.close']
      }, {
        value: 'notclose',
        text: Formdict['model.notclose']
      }]
    },
    {
      type: 'radio',
      key: 'afterExecError',
      label: Formdict['header.form.afterExecError'],
      initVal: card.afterExecError || 'notclose',
      required: true,
      options: [{
        value: 'close',
        text: Formdict['model.close']
      }, {
        value: 'notclose',
        text: Formdict['model.notclose']
      }]
    },
    {
      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: Formdict['header.form.refresh.never']
        text: '不刷新'
      }, {
        value: 'line',
        text: '刷新行'
      }, {
        value: 'grid',
        text: Formdict['header.form.refresh.grid']
        text: '刷新表格'
      },
      ...refresh]
    },
@@ -1216,13 +1253,17 @@
      key: 'execError',
      label: Formdict['model.form.afterError'],
      initVal: card.execError || 'never',
      tooltip: '选择刷新行时,如果选择多条数据会刷新表格。',
      required: true,
      options: [{
        value: 'never',
        text: Formdict['header.form.refresh.never']
        text: '不刷新'
      }, {
        value: 'line',
        text: '刷新行'
      }, {
        value: 'grid',
        text: Formdict['header.form.refresh.grid']
        text: '刷新表格'
      },
      ...refresh]
    },
@@ -1234,10 +1275,10 @@
      required: true,
      options: [{
        value: 'never',
        text: Formdict['header.form.refresh.never']
        text: '不刷新'
      }, {
        value: 'grid',
        text: Formdict['header.form.refresh.grid']
        text: '刷新表格'
      },
      ...refresh]
    },
@@ -1256,12 +1297,11 @@
      }]
    },
    {
      type: 'select',
      type: 'icon',
      key: 'icon',
      label: Formdict['model.icon'],
      initVal: card.icon,
      required: false,
      options: []
      required: false
    },
    {
      type: 'select',
@@ -1269,7 +1309,7 @@
      label: Formdict['model.form.color'],
      initVal: card.class,
      required: false,
      options: []
      options: btnClasses
    },
    {
      type: 'cascader',
@@ -1284,8 +1324,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
    },
    {
@@ -1312,7 +1360,7 @@
    {
      type: 'radio',
      key: 'pagination',
      label: Formdict['header.form.pagination'],
      label: '分页',
      initVal: card.pagination || 'false',
      required: false,
      options: [{
@@ -1338,23 +1386,6 @@
      }]
    },
    {
      type: 'select',
      key: 'controlField',
      label: '控制字段',
      tooltip: '禁用控制字段,可根据数据控制按钮是否禁用。',
      initVal: card.controlField || '',
      required: false,
      options: [{label: '无', field: ''}, ...columns]
    },
    {
      type: 'text',
      key: 'controlVal',
      label: '控制值',
      tooltip: '当选择控制字段,且字段值与控制值相等时,按钮会禁用,多个值用逗号分隔。',
      initVal: card.controlVal || '',
      required: false
    },
    {
      type: 'radio',
      key: 'display',
      label: '显示方式',
@@ -1372,11 +1403,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
    },
    {
@@ -1384,7 +1415,6 @@
      key: 'placement',
      label: '抽屉方向',
      initVal: card.placement || 'right',
      tooltip: '使用抽屉时有效。',
      required: false,
      options: [{
        value: 'right',
@@ -1401,16 +1431,99 @@
      }]
    },
    {
      type: 'radio',
      key: 'clickouter',
      label: '点击蒙层',
      initVal: card.clickouter || 'unclose',
      required: false,
      options: [{
        value: 'unclose',
        text: '不关闭'
      }, {
        value: 'close',
        text: '关闭'
      }]
    },
    {
      type: 'text',
      key: 'preFunc',
      label: '前置函数',
      initVal: card.preFunc || '',
      tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行。`,
      tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行;当前置函数返回中ErrCode等于-1时,将不再执行内部函数。`,
      fields: usefulFields,
      tooltipClass: 'middle',
      required: false,
      readonly: false
    },
    {
      type: 'radio',
      key: 'control',
      label: '按钮控制',
      initVal: card.control || '',
      required: false,
      options: [{
        value: '',
        text: '无'
      }, {
        value: 'disabled',
        text: '禁用'
      }, {
        value: 'hidden',
        text: '隐藏'
      }]
    },
    {
      type: 'select',
      key: 'controlField',
      label: '控制字段',
      tooltip: '控制字段,可根据数据控制按钮的隐藏或禁用。',
      initVal: card.controlField || '',
      required: true,
      options: columns
    },
    {
      type: 'text',
      key: 'controlVal',
      label: '控制值',
      tooltip: '当选择控制字段,且字段值与控制值相等时,按钮会隐藏或禁用,多个值用逗号分隔。',
      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: '进度条'
      }]
    }
  ]
}
@@ -1611,7 +1724,7 @@
        text: Formdict['model.empty']
      }, {
        value: 'thdSeparator',
        text: Formdict['header.form.thdSeparator']
        text: '千分位'
      }, {
        value: 'percent',
        text: '百分比'
@@ -1670,8 +1783,8 @@
    {
      type: 'radio',
      key: 'scale',
      label: Formdict['header.form.clickscale'],
      initVal: card.scale || 'false',
      label: '点击缩放',
      initVal: card.scale || 'true',
      required: false,
      options: [{
        value: 'true',
@@ -1951,8 +2064,8 @@
      readonly: !(setting.laypage === 'false'),
      forbid: !['line', 'bar'].includes(card.chartType),
      options: [
        { value: 'query', text: Formdict['header.form.query'] },
        { value: 'statistics', text: Formdict['header.form.statistics'] }
        { value: 'query', text: '查询' },
        { value: 'statistics', text: '统计' }
      ]
    },
    {
@@ -2190,9 +2303,8 @@
 * @param {*} tabfields       // 可切换表单
 * @param {*} linkableFields  // 可关联表单
 * @param {*} linksupFields   // 上级表单
 * @param {*} subtable        // 是否为子表表单
 */
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, subtable = false) {
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
@@ -2248,12 +2360,15 @@
  }, {
    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: 'rate',
    text: '评分'
  }, {
    value: 'color',
    text: Formdict['model.form.color']
@@ -2271,7 +2386,7 @@
    text: '分隔线'
  }, {
    value: 'linkMain',
    text: Formdict['header.form.linkMain']
    text: '关联主表'
  }]
  let _fieldlength = 50
@@ -2310,12 +2425,15 @@
    }, {
      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: 'rate',
      text: '评分'
    }, {
      value: 'funcvar',
      text: Formdict['header.form.funcvar']
@@ -2325,6 +2443,9 @@
    }, {
      value: 'split',
      text: '分隔线'
    }, {
      value: 'linkMain',
      text: '关联主表'
    }]
  }
@@ -2332,6 +2453,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 [
@@ -2363,8 +2508,7 @@
      type: 'text',
      key: 'initval',
      label: Formdict['header.form.initval'],
      tooltip: '下拉多选与多选框,添加多个初始值请使用“,”号分隔。注:下拉选择、联动菜单或单选框中$first表示选择第一项',
      initVal: card.initval || '',
      initVal: initval,
      required: false
    },
    {
@@ -2394,21 +2538,19 @@
      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',
      key: 'resourceType',
      label: Formdict['header.form.resourceType'],
      label: '选项来源',
      initVal: card.resourceType || '0',
      required: true,
      options: [{
@@ -2447,7 +2589,7 @@
    {
      type: 'text',
      key: 'cardValField',
      label: Formdict['header.form.valueField'],
      label: '值·字段',
      initVal: card.cardValField || 'Value',
      required: true,
      readonly: false
@@ -2480,19 +2622,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',
@@ -2505,7 +2647,7 @@
      type: 'options',
      key: 'options',
      label: '选项',
      initVal: card.options || [],
      initVal: options,
      required: true,
      readonly: false
    },
@@ -2518,18 +2660,33 @@
      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: Formdict['header.form.linkField'],
      label: '关联字段',
      initVal: card.linkField || '',
      required: true,
      readonly: false,
      allowClear: true,
      options: linkableFields
    },
    {
      type: 'text',
      key: 'valueField',
      label: Formdict['header.form.valueField'],
      label: '值·字段',
      initVal: card.valueField || '',
      required: true,
      readonly: false
@@ -2537,7 +2694,7 @@
    {
      type: 'text',
      key: 'valueText',
      label: Formdict['header.form.valueText'],
      label: '文本·字段',
      initVal: card.valueText || '',
      required: true,
      readonly: false
@@ -2545,7 +2702,7 @@
    {
      type: 'text',
      key: 'orderBy',
      label: Formdict['header.form.orderBy'],
      label: '排序·字段',
      initVal: card.orderBy || '',
      required: false,
      readonly: false
@@ -2553,7 +2710,7 @@
    {
      type: 'select',
      key: 'orderType',
      label: Formdict['header.form.orderType'],
      label: '排序方式',
      initVal: card.orderType || 'asc',
      options: [{
        value: 'asc',
@@ -2571,20 +2728,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',
@@ -2611,15 +2754,134 @@
      required: false
    },
    {
      type: 'select',
      key: 'minDate',
      label: '最小值',
      initVal: card.minDate || '',
      required: false,
      options: [{
        value: '',
        text: '无'
      }, {
        value: '0',
        text: '当天'
      }, {
        value: '1',
        text: '后一天'
      }, {
        value: '2',
        text: '后两天'
      }, {
        value: '3',
        text: '后三天'
      }, {
        value: '7',
        text: '后七天'
      }, {
        value: '30',
        text: '后30天'
      }, {
        value: '90',
        text: '后90天'
      }, {
        value: '-1',
        text: '前一天'
      }, {
        value: '-2',
        text: '前两天'
      }, {
        value: '-3',
        text: '前三天'
      }, {
        value: '-7',
        text: '前七天'
      }, {
        value: '-30',
        text: '前30天'
      }, {
        value: '-90',
        text: '前90天'
      }]
    },
    {
      type: 'select',
      key: 'maxDate',
      label: '最大值',
      initVal: card.maxDate || '',
      required: false,
      options: [{
        value: '',
        text: '无'
      }, {
        value: '0',
        text: '当天'
      }, {
        value: '1',
        text: '后一天'
      }, {
        value: '2',
        text: '后两天'
      }, {
        value: '3',
        text: '后三天'
      }, {
        value: '7',
        text: '后七天'
      }, {
        value: '30',
        text: '后30天'
      }, {
        value: '90',
        text: '后90天'
      }, {
        value: '-1',
        text: '前一天'
      }, {
        value: '-2',
        text: '前两天'
      }, {
        value: '-3',
        text: '前三天'
      }, {
        value: '-7',
        text: '前七天'
      }, {
        value: '-30',
        text: '前30天'
      }, {
        value: '-90',
        text: '前90天'
      }]
    },
    {
      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,
      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',
@@ -2627,7 +2889,7 @@
      min: 1,
      max: 100,
      precision: 0,
      label: appType === 'mob' ? '行数' : Formdict['header.form.maxRows'],
      label: appType === 'mob' ? '行数' : '最大行数',
      tooltip: appType === 'mob' ? '行数为空时,高度自适应' : '',
      initVal: card.maxRows || (appType === 'mob' ? '' : 6),
      required: false
@@ -2635,40 +2897,46 @@
    {
      type: 'select',
      key: 'regular',
      label: Formdict['header.form.regular'],
      label: '正则校验',
      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: Formdict['header.form.letter&number']
        text: '数字、字母以及_'
      }, {
        value: 'phone',
        text: '手机号'
      }, {
        value: 'email',
        text: '邮箱'
      }]
    },
    {
      type: 'select',
      key: 'fileType',
      label: '显示方式',
      initVal: card.fileType || (appType === 'mob' ? 'picture-card' : 'text'),
      initVal: card.fileType || 'text',
      options: [{
        value: 'text',
        text: '文件'
      }, {
      },
      {
        value: 'picture',
        text: '图文信息'
      }, {
      },
      {
        value: 'picture-card',
        text: '图片卡'
      }]
      }],
      forbid: appType === 'mob'
    },
    {
      type: 'number',
@@ -2683,8 +2951,21 @@
    },
    {
      type: 'radio',
      key: 'allowHalf',
      label: '半选',
      initVal: card.allowHalf || 'false',
      options: [{
        value: 'true',
        text: '支持'
      }, {
        value: 'false',
        text: '不支持'
      }]
    },
    {
      type: 'radio',
      key: 'readonly',
      label: Formdict['header.form.readonly'],
      label: '只读',
      initVal: card.readonly || 'false',
      options: [{
        value: 'true',
@@ -2723,14 +3004,14 @@
    {
      type: 'radio',
      key: 'database',
      label: Formdict['header.form.database'],
      label: '数据库',
      initVal: card.database || 'local',
      options: [{
        value: 'local',
        text: Formdict['header.form.database.local']
        text: '本地'
      }, {
        value: 'sso',
        text: Formdict['header.form.database.sso']
        text: '系统'
      }]
    },
    {
@@ -2739,11 +3020,11 @@
      label: '光标',
      initVal: card.cursor || 'left',
      options: [{
        value: 'right',
        text: '右对齐'
      }, {
        value: 'left',
        text: '左对齐'
      }, {
        value: 'right',
        text: '右对齐'
      }],
      forbid: appType !== 'mob'
    },
@@ -2767,7 +3048,7 @@
    {
      type: 'radio',
      key: 'readin',
      label: Formdict['header.form.readin'],
      label: '自动填充',
      tooltip: '是否将表格选中的数据自动填充到表单(字段相同)',
      initVal: card.readin || 'true',
      options: [{
@@ -2794,6 +3075,24 @@
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'number',
      min: 1,
      max: 100,
      precision: 0,
      key: 'rateCount',
      label: '总数',
      initVal: card.rateCount || 5,
      tooltip: '默认值为5。',
      required: false
    },
    {
      type: 'icon',
      key: 'character',
      label: '自定义图标',
      initVal: card.character || '',
      required: false
    },
    {
      type: 'radio',
@@ -2865,19 +3164,118 @@
        text: 'nvarchar(50)'
      }]
    },
    // {
    //   type: 'radio',
    //   key: 'mode',
    //   label: '模式',
    //   initVal: card.mode || 'picker',
    //   options: [{
    //     value: 'picker',
    //     text: '选择器'
    //   }, {
    //     value: 'calendar',
    //     text: '日历'
    //   }],
    //   forbid: appType !== 'mob'
    // },
    {
      type: 'radio',
      key: 'mode',
      label: '模式',
      initVal: card.mode || 'picker',
      key: 'encryption',
      label: '加密传输',
      initVal: card.type === 'brafteditor' ? (card.encryption || 'true') : (card.encryption || 'false'),
      options: [{
        value: 'picker',
        text: '选择器'
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'calendar',
        text: '日历'
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'interception',
      label: '截取空格',
      initVal: card.interception || 'true',
      tooltip: '提交时,是否截取首尾的空白字符。',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'splitline',
      label: '分割线',
      initVal: card.splitline || 'true',
      forbid: appType !== 'mob',
      options: [{
        value: 'true',
        text: '显示'
      }, {
        value: 'false',
        text: '隐藏'
      }]
    },
    {
      type: 'radio',
      key: 'place',
      label: '排列',
      initVal: card.place || 'left_right',
      tooltip: '提示文字与输入框的位置关系。',
      forbid: appType !== 'mob',
      options: [{
        value: 'left_right',
        text: '左右'
      }, {
        value: 'up_down',
        text: '上下'
      }]
    },
    {
      type: 'radio',
      key: 'count',
      label: '计数功能',
      initVal: card.count || 'false',
      tooltip: '显示输入的字符数,设置行数时生效,注:加密传输时最大值与字段长度不等。',
      options: [{
        value: 'true',
        text: '开启'
      }, {
        value: 'false',
        text: '关闭'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'radio',
      key: 'compress',
      label: '文件处理',
      initVal: card.compress || 'false',
      tooltip: '文件压缩或base64必须为图片,图片格式为jpg、png、gif 或 jpeg。注:base64只可上传一张图片。',
      options: [{
        value: 'false',
        text: '无'
      }, {
        value: 'true',
        text: '压缩'
      }, {
        value: 'base64',
        text: 'base64'
      }]
    },
    {
      type: 'number',
      key: 'limit',
      min: 0.01,
      max: 1000,
      precision: 2,
      label: '起点(M)',
      initVal: card.limit || 2,
      tooltip: '压缩起点,小于起点值的文件不进行压缩。',
      required: true
    },
    {
      type: 'number',
@@ -2892,6 +3290,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,
@@ -2902,31 +3340,6 @@
      tooltip: '名称占据表单宽度的百分比。注:存在多列表单时,当前表单如果想要占据整行可参照以下比例,两列(16.2)、三列(10.5)、四列(7.7)',
      required: true,
      forbid: appType === 'mob'
    },
    {
      type: 'radio',
      key: 'compress',
      label: '压缩',
      initVal: card.compress || 'false',
      tooltip: '文件压缩必须为图片,图片格式为jpg、png、gif 或 jpeg',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'number',
      key: 'limit',
      min: 0.01,
      max: 1000,
      precision: 2,
      label: '起点(M)',
      initVal: card.limit || 2,
      tooltip: '压缩起点,小于起点值的文件不进行压缩。',
      required: true
    },
    {
      type: 'textarea',
@@ -2957,79 +3370,26 @@
      required: false,
      readonly: false
    },
    {
      type: 'radio',
      key: 'encryption',
      label: '加密传输',
      initVal: card.type === 'brafteditor' ? (card.encryption || 'true') : (card.encryption || 'false'),
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'interception',
      label: '截取空格',
      initVal: card.interception || 'false',
      tooltip: '提交时,是否截取首尾的空白字符。',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      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',
      tooltip: '显示输入的字符数,设置行数时生效,注:加密传输时最大值与字段长度不等。',
      options: [{
        value: 'true',
        text: '开启'
      }, {
        value: 'false',
        text: '关闭'
      }],
      forbid: appType !== 'mob'
    },
    {
      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
    },
    {
@@ -3051,6 +3411,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: '提示信息',
@@ -3058,14 +3434,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',
@@ -3094,18 +3470,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: -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'
    }
  ]
}
@@ -3137,27 +3536,11 @@
      options: []
    },
    {
      type: 'select',
      type: 'icon',
      key: 'icon',
      label: Formdict['model.icon'],
      initVal: card.icon || '',
      required: false,
      options: [{
        value: '',
        text: Formdict['model.empty']
      }, {
        value: 'table',
        text: 'table'
      }, {
        value: 'bar-chart',
        text: 'bar-chart'
      }, {
        value: 'pie-chart',
        text: 'pie-chart'
      }, {
        value: 'line-chart',
        text: 'line-chart'
      }],
      forbid: type === 'CalendarPage'
    },
    {