king
2021-06-24 95afd40fc2741ac0ce59c2091f6cfce1f98877d4
src/templates/zshare/formconfig.jsx
@@ -2,7 +2,7 @@
import enUS from '@/locales/en-US/model.js'
import { formRule } from '@/utils/option.js'
const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
/**
 * @description 获取树形页面设置表单配置信息
@@ -210,7 +210,7 @@
      key: 'mark',
      label: '顶级标识',
      initVal: setting.mark || '',
      tooltip: '父级字段值与顶级标识(默认值为空)相同时,视为顶级节点。',
      tooltip: '父级字段值与顶级标识相同时,视为顶级节点。',
      required: false,
      readonly: false,
      rules: [
@@ -284,10 +284,73 @@
/**
 * @description 获取搜索条件表单配置信息
 * @param {object} card           // 搜索条件对象
 * @param {Array}  roleList       // 角色列表
 * @param {Array}  linkableFields // 可关联字段
 */
export function getSearchForm (card, roleList, linkableFields) {
export function getSearchForm (card, linkableFields) {
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch {
      roleList = []
    }
  } else {
    roleList = []
  }
  let typeOptions = []
  if (sessionStorage.getItem('appType') === 'mob') {
    typeOptions = [{
      value: 'text',
      text: Formdict['model.form.text']
    }, {
      value: 'checkcard',
      text: '选项卡'
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    }]
    if (!['text', 'checkcard', 'date', 'datemonth'].includes(card.type)) {
      card.type = 'text'
    }
  } else {
    typeOptions = [{
      value: 'text',
      text: Formdict['model.form.text']
    }, {
      value: 'select',
      text: Formdict['model.form.select']
    }, {
      value: 'multiselect',
      text: Formdict['model.form.multiselect']
    }, {
      value: 'link',
      text: Formdict['model.form.link']
    }, {
      value: 'checkcard',
      text: '选项卡'
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
    }, {
      value: 'dateweek',
      text: Formdict['model.form.dateweek']
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    }, {
      value: 'daterange',
      text: Formdict['model.form.daterange']
    }, {
      value: 'group',
      text: Formdict['model.form.dategroup']
    }]
  }
  return [
    {
      type: 'text',
@@ -312,34 +375,7 @@
      label: Formdict['model.form.type'],
      initVal: card.type,
      required: true,
      options: [{
        value: 'text',
        text: Formdict['model.form.text']
      }, {
        value: 'select',
        text: Formdict['model.form.select']
      }, {
        value: 'multiselect',
        text: Formdict['model.form.multiselect']
      }, {
        value: 'link',
        text: Formdict['model.form.link']
      }, {
        value: 'date',
        text: Formdict['model.form.dateday']
      }, {
        value: 'dateweek',
        text: Formdict['model.form.dateweek']
      }, {
        value: 'datemonth',
        text: Formdict['model.form.datemonth']
      }, {
        value: 'daterange',
        text: Formdict['model.form.daterange']
      }, {
        value: 'group',
        text: Formdict['model.form.dategroup']
      }]
      options: typeOptions
    },
    {
      type: 'text',
@@ -375,7 +411,7 @@
      type: 'radio',
      key: 'setAll',
      label: Formdict['header.form.setAll'],
      initVal: card.setAll || 'false',
      initVal: card.setAll || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
@@ -383,6 +419,75 @@
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'display',
      label: '显示',
      initVal: card.display || 'text',
      required: true,
      options: [{
        value: 'text',
        text: '文本'
      }, {
        value: 'picture',
        text: '图片'
      }]
    },
    {
      type: 'number',
      key: 'width',
      min: 1,
      max: 24,
      precision: 0,
      label: '卡片宽度',
      initVal: card.width || 4,
      tooltip: '栅格布局,每行等分为24列。',
      required: true
    },
    {
      type: 'text',
      key: 'cardValField',
      label: Formdict['header.form.valueField'],
      initVal: card.cardValField || 'Value',
      required: true,
      readonly: false
    },
    {
      type: 'text',
      key: 'urlField',
      label: '地址字段',
      initVal: card.urlField || '',
      required: true,
      readonly: false
    },
    {
      type: 'radio',
      key: 'picratio',
      label: '图片比例',
      initVal: card.picratio || '1:1',
      required: true,
      options: [{
        value: '1:1',
        text: '1:1'
      }, {
        value: '3:2',
        text: '3:2'
      }, {
        value: '4:3',
        text: '4:3'
      }, {
        value: '16:9',
        text: '16:9'
      }]
    },
    {
      type: 'fields',
      key: 'fields',
      label: '字段集',
      initVal: card.fields || [],
      required: true,
      readonly: false
    },
    {
      type: 'textarea',
@@ -395,7 +500,7 @@
    {
      type: 'options',
      key: 'options',
      label: '',
      label: '选项',
      initVal: card.options || [],
      required: true,
      readonly: false
@@ -497,20 +602,6 @@
      }]
    },
    {
      type: 'select',
      key: 'display',
      label: Formdict['header.form.display'],
      initVal: card.display || 'dropdown',
      required: true,
      options: [{
        value: 'dropdown',
        text: Formdict['header.form.dropdown']
      // }, {
      //   value: 'button',
      //   text: Formdict['header.form.button']
      }]
    },
    {
      type: 'radio',
      key: 'database',
      label: Formdict['header.form.database'],
@@ -532,6 +623,20 @@
      tooltip: '栅格布局,每行等分为24列。',
      initVal: card.ratio,
      required: false
    },
    {
      type: 'radio',
      key: 'multiple',
      label: '可多选',
      initVal: card.multiple || 'false',
      required: true,
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'radio',
@@ -574,6 +679,46 @@
      }]
    },
    {
      type: 'radio',
      key: 'labelShow',
      label: '显示名称',
      initVal: card.labelShow || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'advanced',
      label: '高级搜索',
      initVal: card.advanced || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'color',
      key: 'backgroundColor',
      label: '背景色',
      initVal: card.backgroundColor || '',
      required: false
    },
    {
      type: 'color',
      key: 'borderColor',
      label: '边框颜色',
      initVal: card.borderColor || '',
      required: false
    },
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],
@@ -589,10 +734,12 @@
 * @param {*} card           编辑按钮
 * @param {*} functip        生成存储过程提示
 * @param {*} config         页面配置
 * @param {*} permFuncField  存储过程可用的开始字段
 * @param {*} usefulFields   存储过程可用的开始字段
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, functip, config, permFuncField, type, menulist = []) {
export function getActionForm (card, functip, config, usefulFields, type, menulist = [], printTemps = []) {
  let columns = (config.columns || []).filter(col => col.field)
  let opentypes = [
    {
      value: 'pop',
@@ -633,17 +780,28 @@
    tabTems = []
  }
  if (card.execSuccess === 'view' || card.execSuccess === 'refresh') { // refresh为表单标签页
    card.execSuccess = 'grid'
  }
  if (card.execError === 'view' || card.execSuccess === 'refresh') {
    card.execError = 'grid'
  }
  if (card.popClose === 'view') {
    card.popClose = 'grid'
  }
  let refresh = []
  if (type === 'subtable') { // 子表页面,可设置刷新主表及同级标签
    if (card.focus) {
      card.popClose = 'maingrid'
    }
    refresh.push({
      value: 'maingrid',
      text: Formdict['header.form.refresh.maingrid']
    }, {
      value: 'equaltab',
      text: Formdict['header.form.refresh.equaltab']
    // }, {
    //   value: 'mainline',
    //   text: Formdict['header.form.refresh.mainline']
    })
  }
@@ -657,7 +815,7 @@
      options: opentypes
    },
    {
      type: 'select',
      type: 'radio',
      key: 'funcType',
      label: Formdict['header.form.funcType'],
      initVal: card.funcType || '',
@@ -667,7 +825,7 @@
        text: Formdict['header.form.func.changeuser']
      }, {
        value: 'print',
        text: Formdict['header.form.func.print']
        text: '标签打印'
      }]
    },
    {
@@ -693,31 +851,29 @@
      label: Formdict['header.form.intertype'],
      initVal: card.intertype || 'system',
      required: true,
      options: []
    },
    {
      type: 'radio',
      key: 'procMode',
      label: '参数处理',
      initVal: card.procMode || 'system',
      required: true,
      options: [{
        value: 'system',
        text: Formdict['model.interface.system']
        text: '系统函数'
      }, {
        value: 'inner',
        text: Formdict['model.interface.inner']
      }, {
        value: 'outer',
        text: Formdict['model.interface.outer']
        text: '内部函数'
      }]
    },
    {
      type: 'select',
      type: 'radio',
      key: 'sqlType',
      label: Formdict['header.form.action.type'],
      initVal: card.sqlType || '',
      required: true,
      options: []
    },
    {
      type: 'text',
      key: 'sql',
      label: Formdict['model.form.tablename'],
      initVal: card.sql || config.setting.tableName || '',
      required: true
    },
    {
      type: 'text',
@@ -729,26 +885,33 @@
    },
    {
      type: 'text',
      key: 'sql',
      label: Formdict['model.form.tablename'],
      initVal: card.sql || config.setting.tableName || '',
      required: true
    },
    {
      type: 'text',
      key: 'innerFunc',
      label: Formdict['header.form.innerFunc'],
      initVal: card.innerFunc || '',
      tooltip: functip,
      fields: permFuncField,
      fields: usefulFields,
      tooltipClass: 'middle',
      required: card.intertype === 'inner',
      readonly: false
    },
    {
      type: 'select',
      key: 'tabType',
      label: Formdict['model.form.tabType'],
      initVal: card.tabType || 'SubTable',
      required: true,
      options: [{
        value: 'SubTable',
        text: Formdict['model.menu.tab.subtable']
      }]
    },
    // {
    //   type: 'select',
    //   key: 'tabType',
    //   label: Formdict['model.form.tabType'],
    //   initVal: card.tabType || 'SubTable',
    //   required: true,
    //   options: [{
    //     value: 'SubTable',
    //     text: Formdict['model.menu.tab.subtable']
    //   }]
    // },
    {
      type: 'select',
      key: 'linkTab',
@@ -764,8 +927,14 @@
      initVal: card.pageTemplate || '',
      required: true,
      options: [{
        value: 'print',
        text: Formdict['header.menu.printTemplate']
      //   value: 'print',
      //   text: '标签打印模板'
      // }, {
      //   value: 'billprintTemp',
      //   text: '单据打印模板'
      // }, {
        value: 'billprint',
        text: '单据打印'
      }, {
        value: 'pay',
        text: Formdict['model.pay']
@@ -775,9 +944,17 @@
      }]
    },
    {
      type: 'select',
      key: 'printTemp',
      label: '打印模板',
      initVal: card.printTemp || '',
      required: true,
      options: printTemps
    },
    {
      type: 'text',
      key: 'url',
      label: Formdict['model.form.newpage.url'],
      label: Formdict['model.pageUrl'],
      initVal: card.url || '',
      required: true
    },
@@ -804,12 +981,71 @@
      readonly: false
    },
    {
      type: 'text',
      type: 'textarea',
      key: 'interface',
      label: Formdict['header.form.interface'],
      label: '测试地址',
      initVal: card.sysInterface === 'true' ? (window.GLOB.mainSystemApi || '') : (card.interface || ''),
      required: true,
      readonly: card.sysInterface === 'true'
    },
    {
      type: 'textarea',
      key: 'proInterface',
      label: '正式地址',
      initVal: card.proInterface || '',
      tooltip: '正式系统所使用的接口地址。',
      required: false
    },
    {
      type: 'radio',
      key: 'method',
      label: '请求方式',
      initVal: card.method || 'post',
      required: true,
      options: [{
        value: 'get',
        text: 'GET'
      }, {
        value: 'post',
        text: 'POST'
      }]
    },
    {
      type: 'radio',
      key: 'cross',
      label: '跨域请求',
      initVal: card.cross || 'true',
      tooltip: '如果自定义接口不支持跨域请求,会通过当前系统转发。',
      required: false,
      options: [{
        value: 'true',
        text: '支持'
      }, {
        value: 'false',
        text: '不支持'
      }]
    },
    {
      type: 'radio',
      key: 'callbackType',
      label: '回调方式',
      initVal: card.callbackType || 'script',
      tooltip: '使用后台脚本执行时,需要配合计划任务。',
      required: true,
      options: [{
        value: 'script',
        text: '自定义脚本'
      }, {
        value: 'default',
        text: '后台脚本'
      }]
    },
    {
      type: 'text',
      key: 'cbTable',
      label: '回调表名',
      initVal: card.cbTable || '',
      required: true
    },
    {
      type: 'text',
@@ -820,7 +1056,7 @@
      readonly: false
    },
    {
      type: 'select',
      type: 'radio',
      key: 'position',
      label: Formdict['header.form.position'],
      initVal: card.position || 'toolbar',
@@ -864,7 +1100,7 @@
      options: menulist
    },
    {
      type: 'select',
      type: 'radio',
      key: 'afterExecSuccess',
      label: Formdict['header.form.afterExecSuccess'],
      initVal: card.afterExecSuccess || 'close',
@@ -878,7 +1114,7 @@
      }]
    },
    {
      type: 'select',
      type: 'radio',
      key: 'afterExecError',
      label: Formdict['header.form.afterExecError'],
      initVal: card.afterExecError || 'notclose',
@@ -892,7 +1128,7 @@
      }]
    },
    {
      type: 'select',
      type: refresh.length === 0 ? 'radio' : 'select',
      key: 'execSuccess',
      label: Formdict['model.form.afterSuccess'],
      initVal: card.execSuccess || 'never',
@@ -903,14 +1139,11 @@
      }, {
        value: 'grid',
        text: Formdict['header.form.refresh.grid']
      }, {
        value: 'view',
        text: Formdict['header.form.refresh.view']
      },
      ...refresh]
    },
    {
      type: 'select',
      type: refresh.length === 0 ? 'radio' : 'select',
      key: 'execError',
      label: Formdict['model.form.afterError'],
      initVal: card.execError || 'never',
@@ -921,13 +1154,11 @@
      }, {
        value: 'grid',
        text: Formdict['header.form.refresh.grid']
      }, {
        value: 'view',
        text: Formdict['header.form.refresh.view']
      }]
      },
      ...refresh]
    },
    {
      type: 'select',
      type: refresh.length === 0 ? 'radio' : 'select',
      key: 'popClose',
      label: Formdict['header.form.popClose'],
      initVal: card.popClose || 'never',
@@ -938,11 +1169,22 @@
      }, {
        value: 'grid',
        text: Formdict['header.form.refresh.grid']
      }, {
        value: 'view',
        text: Formdict['header.form.refresh.view']
      },
      ...refresh]
    },
    {
      type: 'radio',
      key: 'resetPageIndex',
      label: '刷新时',
      initVal: card.resetPageIndex || 'true',
      required: false,
      options: [{
        value: 'true',
        text: '重置页码'
      }, {
        value: 'false',
        text: '不重置'
      }]
    },
    {
      type: 'select',
@@ -1008,6 +1250,23 @@
        value: 'false',
        text: '非必填'
      }]
    },
    {
      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
    }
  ]
}
@@ -1015,10 +1274,24 @@
/**
 * @description 获取显示列表单配置信息
 * @param {object} card       // 搜索条件对象
 * @param {Array}  roleList   // 角色列表-黑名单
 * @param {Array}  menulist   // 菜单列表-用于字段透视
 */
export function getColumnForm (card, roleList = [], menulist = []) {
export function getColumnForm (card, menulist = [], fields = []) {
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch {
      roleList = []
    }
  } else {
    roleList = []
  }
  if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) {
    card.perspective = ''
  }
  return [
    {
      type: 'text',
@@ -1056,6 +1329,9 @@
      }, {
        value: 'textarea',
        text: Formdict['model.form.textarea']
      }, {
        value: 'index',
        text: '序号'
      }]
    },
    {
@@ -1140,7 +1416,7 @@
      key: 'rowspan',
      label: '行合并',
      initVal: card.rowspan || 'false',
      tooltip: '相邻行信息相同时,单元格合并。注:为防止表格信息错乱,行合并只能添加一个字段。',
      tooltip: '相邻行信息相同时,单元格合并。',
      required: false,
      options: [{
        value: 'true',
@@ -1196,6 +1472,9 @@
      }, {
        value: 'percent',
        text: '百分比'
      }, {
        value: 'abs',
        text: '绝对值'
      }],
      required: false
    },
@@ -1260,12 +1539,43 @@
      }]
    },
    {
      type: 'radio',
      key: 'perspective',
      label: '字段透视',
      initVal: card.perspective || '',
      options: [{
        value: '',
        text: '无'
      }, {
        value: 'linkmenu',
        text: '菜单'
      }, {
        value: 'linkurl',
        text: '链接'
      }]
    },
    {
      type: 'cascader',
      key: 'linkmenu',
      label: Formdict['model.form.linkmenu'],
      label: Formdict['model.menu'],
      initVal: card.linkmenu || [],
      required: false,
      required: true,
      options: menulist
    },
    {
      type: 'textarea',
      key: 'linkurl',
      label: '链接地址',
      initVal: card.linkurl || '',
      required: true
    },
    {
      type: 'multiselect',
      key: 'linkfields',
      label: '关联字段',
      initVal: card.linkfields || [],
      required: false,
      options: fields
    },
    {
      type: 'multiselect',
@@ -1281,12 +1591,22 @@
/**
 * @description 获取图表视图外部配置表单
 * @param {object} card         // 搜索条件对象
 * @param {Array}  roleList     // 角色列表-黑名单
 * @param {Array}  columns      // 显示列
 * @param {Array}  actions      // 按钮组excel
 * @param {Array}  extraActions // 常规按钮
 */
export function getChartViewForm (card, roleList = [], _columns, actions, extraActions) {
export function getChartViewForm (card, _columns, actions, extraActions) {
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch {
      roleList = []
    }
  } else {
    roleList = []
  }
  let _charts = [{
    value: 'line',
    text: '折线图'
@@ -1707,13 +2027,13 @@
      required: true
    }, {
      type: 'number',
      key: 'correction',
      label: '数据修正',
      tooltip: '当数据项少于设置值时,系统会自动修正(避免柱形图过宽),在自定义中,设置为折线图时失效。',
      key: 'barSize',
      label: '柱形宽度',
      tooltip: '空值时,宽度自适应。',
      min: 5,
      max: 30,
      max: 100,
      decimal: 0,
      initVal: card.correction,
      initVal: card.barSize,
      forbid: !['bar'].includes(card.chartType),
      required: false
    }
@@ -1724,24 +2044,153 @@
 * @description 获取表单配置信息
 * @param {*} card            // 表单对象
 * @param {*} inputfields     // 可关联表单
 * @param {*} tabfields       // 可切换表单
 * @param {*} linkableFields  // 可关联表单
 * @param {*} linksupFields   // 上级表单
 * @param {*} subtable        // 是否为子表表单
 * @param {*} roleList        // 角色列表-黑名单
 */
export function getModalForm (card, inputfields, linkableFields, linksupFields, subtable = false, roleList = []) {
  let _openType = []
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, subtable = false) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
      roleList = roleList.map(role => {
        return {
          uuid: role.uuid,
          field: role.value,
          label: role.text
        }
      })
    } catch {
      roleList = []
    }
  } else {
    roleList = []
  }
  let _openType = [{
    value: 'text',
    text: Formdict['model.form.text']
  }, {
    value: 'number',
    text: Formdict['model.form.number']
  }, {
    value: 'select',
    text: Formdict['model.form.select']
  }, {
    value: 'multiselect',
    text: Formdict['model.form.multiselect']
  }, {
    value: 'link',
    text: Formdict['model.form.link']
  }, {
    value: 'switch',
    text: '开关'
  }, {
    value: 'checkbox',
    text: '多选框'
  }, {
    value: 'radio',
    text: '单选框'
  }, {
    value: 'checkcard',
    text: '选项卡'
  }, {
    value: 'fileupload',
    text: Formdict['header.form.fileupload']
  }, {
    value: 'date',
    text: Formdict['model.form.dateday']
  }, {
    value: 'datemonth',
    text: Formdict['model.form.datemonth']
  }, {
    value: 'datetime',
    text: Formdict['model.form.datetime']
  }, {
    value: 'textarea',
    text: Formdict['model.form.textarea']
  }, {
    value: 'color',
    text: Formdict['model.form.color']
  }, {
    value: 'brafteditor',
    text: '富文本'
  }, {
    value: 'funcvar',
    text: Formdict['header.form.funcvar']
  }, {
    value: 'hint',
    text: '提示'
  }, {
    value: 'split',
    text: '分隔线'
  }]
  let _fieldlength = 50
  if (subtable) {
  if (appType === 'mob') {
    _openType = [{
      value: 'text',
      text: Formdict['model.form.text']
    }, {
      value: 'number',
      text: Formdict['model.form.number']
    }, {
      value: 'select',
      text: '选择器'
    }, {
      value: 'link',
      text: Formdict['model.form.link']
    }, {
      value: 'switch',
      text: '开关'
    }, {
      value: 'checkbox',
      text: '多选框'
    }, {
      value: 'radio',
      text: '单选框'
    }, {
      value: 'checkcard',
      text: '选项卡'
    }, {
      value: 'fileupload',
      text: Formdict['header.form.fileupload']
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    }, {
      value: 'datetime',
      text: Formdict['model.form.datetime']
    }, {
      value: 'textarea',
      text: Formdict['model.form.textarea']
    }, {
      value: 'funcvar',
      text: Formdict['header.form.funcvar']
    }, {
      value: 'hint',
      text: '提示'
    }, {
      value: 'split',
      text: '分隔线'
    }]
  } else if (subtable) {
    _openType.push({
      value: 'linkMain',
      text: Formdict['header.form.linkMain']
    })
  }
  if (card.type === 'textarea' || card.type === 'fileupload' || card.type === 'multiselect' || card.type === 'checkbox') {
  if (['fileupload', 'multiselect', 'checkbox'].includes(card.type)) {
    _fieldlength = 512
  } else if (['textarea', 'brafteditor'].includes(card.type)) {
    _fieldlength = 8000
  }
  return [
@@ -1767,65 +2216,13 @@
      label: Formdict['model.form.type'],
      initVal: card.type,
      required: true,
      options: [{
        value: 'text',
        text: Formdict['model.form.text']
      }, {
        value: 'number',
        text: Formdict['model.form.number']
      }, {
        value: 'select',
        text: Formdict['model.form.select']
      }, {
        value: 'multiselect',
        text: Formdict['model.form.multiselect']
      }, {
        value: 'link',
        text: Formdict['model.form.link']
      }, {
        value: 'switch',
        text: '开关'
      }, {
        value: 'checkbox',
        text: '多选框'
      }, {
        value: 'radio',
        text: '单选框'
      }, {
        value: 'checkcard',
        text: '选项卡'
      }, {
        value: 'fileupload',
        text: Formdict['header.form.fileupload']
      }, {
        value: 'date',
        text: Formdict['model.form.dateday']
      }, {
        value: 'datemonth',
        text: Formdict['model.form.datemonth']
      }, {
        value: 'datetime',
        text: Formdict['model.form.datetime']
      }, {
        value: 'textarea',
        text: Formdict['model.form.textarea']
      }, {
        value: 'hint',
        text: '提示'
      }, {
        value: 'color',
        text: Formdict['model.form.color']
      }, {
        value: 'funcvar',
        text: Formdict['header.form.funcvar']
      },
      ..._openType]
      options: _openType
    },
    {
      type: 'text',
      key: 'initval',
      label: Formdict['header.form.initval'],
      tooltip: '下拉多选与多选框,添加多个初始值请使用“,”号分隔。',
      tooltip: '下拉多选与多选框,添加多个初始值请使用“,”号分隔。注:下拉选择、联动菜单或单选框中$first表示选择第一项',
      initVal: card.initval || '',
      required: false
    },
@@ -1842,14 +2239,30 @@
      key: 'openVal',
      label: '开启值',
      initVal: card.openVal || '',
      required: true
      required: false
    },
    {
      type: 'text',
      key: 'closeVal',
      label: '关闭值',
      initVal: card.closeVal || '',
      required: true
      required: false
    },
    {
      type: 'text',
      key: 'openText',
      label: '开启提示',
      initVal: card.openText || '',
      required: false,
      forbid: appType === 'mob'
    },
    {
      type: 'text',
      key: 'closeText',
      label: '关闭提示',
      initVal: card.closeText || '',
      required: false,
      forbid: appType === 'mob'
    },
    {
      type: 'radio',
@@ -1882,6 +2295,9 @@
    {
      type: 'number',
      key: 'width',
      min: 1,
      max: 24,
      precision: 0,
      label: '卡片宽度',
      initVal: card.width || 4,
      tooltip: '栅格布局,每行等分为24列。',
@@ -1926,7 +2342,7 @@
    {
      type: 'radio',
      key: 'setAll',
      label: Formdict['header.form.setAll'],
      label: '设置空值',
      initVal: card.setAll || 'false',
      options: [{
        value: 'true',
@@ -2023,6 +2439,9 @@
    {
      type: 'number',
      key: 'decimal',
      min: 0,
      max: 18,
      precision: 0,
      label: Formdict['header.form.decimal'],
      initVal: card.decimal || 0,
      required: true
@@ -2044,6 +2463,9 @@
    {
      type: 'number',
      key: 'fieldlength',
      min: 1,
      max: 1000000,
      precision: 0,
      label: Formdict['model.form.field'] + Formdict['model.length'],
      tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512',
      initVal: card.fieldlength || _fieldlength,
@@ -2052,8 +2474,12 @@
    {
      type: 'number',
      key: 'maxRows',
      label: Formdict['header.form.maxRows'],
      initVal: card.maxRows || 6,
      min: 1,
      max: 100,
      precision: 0,
      label: appType === 'mob' ? '行数' : Formdict['header.form.maxRows'],
      tooltip: appType === 'mob' ? '行数为空时,高度自适应' : '',
      initVal: card.maxRows || (appType === 'mob' ? '' : 6),
      required: false
    },
    {
@@ -2079,24 +2505,41 @@
      type: 'select',
      key: 'fileType',
      label: '显示方式',
      initVal: card.fileType || 'text',
      initVal: card.fileType || (appType === 'mob' ? 'picture-card' : 'text'),
      options: [{
        value: 'text',
        text: '文件'
      }, {
        value: 'picture',
        text: '图文信息'
      }, {
        value: 'picture-card',
        text: '图片卡'
      }, {
        value: 'text',
        text: '文件'
      }]
    },
    {
      type: 'number',
      key: 'maxfile',
      min: 0,
      max: 1000,
      precision: 0,
      label: '最大文件数',
      initVal: card.maxfile || '',
      tooltip: '等于0时不做限制。',
      required: false
    },
    {
      type: 'radio',
      key: 'hidelabel',
      label: '隐藏名称',
      initVal: card.hidelabel || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
@@ -2152,6 +2595,34 @@
    },
    {
      type: 'radio',
      key: 'cursor',
      label: '光标',
      initVal: card.cursor || 'left',
      options: [{
        value: 'right',
        text: '右对齐'
      }, {
        value: 'left',
        text: '左对齐'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'radio',
      key: 'scan',
      label: '扫码',
      initVal: card.scan || 'false',
      options: [{
        value: 'true',
        text: '启用'
      }, {
        value: 'false',
        text: '不启用'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'radio',
      key: 'readin',
      label: Formdict['header.form.readin'],
      tooltip: Formdict['header.form.readin.tooltip'],
@@ -2179,24 +2650,130 @@
      }]
    },
    {
      type: 'color',
      key: 'backgroundColor',
      label: '背景色',
      initVal: card.backgroundColor || '',
      required: false
    },
    {
      type: 'color',
      key: 'borderColor',
      label: '边框颜色',
      initVal: card.borderColor || '',
      required: false
    },
    {
      type: 'radio',
      key: 'entireLine',
      label: '占据整行',
      initVal: card.entireLine || 'false',
      required: false,
      key: 'declareType',
      label: '数据类型',
      tooltip: '声明变量时的类型,时间格式datetime或文本格式nvarchar(50)。',
      initVal: card.declareType || 'datetime',
      options: [{
        value: 'datetime',
        text: 'datetime'
      }, {
        value: 'nvarchar(50)',
        text: 'nvarchar(50)'
      }]
    },
    {
      type: 'radio',
      key: 'mode',
      label: '模式',
      initVal: card.mode || 'picker',
      options: [{
        value: 'picker',
        text: '选择器'
      }, {
        value: 'calendar',
        text: '日历'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'number',
      key: 'span',
      min: 1,
      max: 24,
      precision: 0,
      label: '表单宽度',
      initVal: card.span || (['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type) ? 24 : 12),
      tooltip: '栅格布局整行24等分。',
      required: true,
      forbid: appType === 'mob'
    },
    {
      type: 'number',
      key: 'labelwidth',
      min: 1,
      max: 100,
      precision: 1,
      label: '名称宽度',
      initVal: card.labelwidth || 33.3,
      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: '是'
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: '否'
        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',
      key: 'rduri',
      label: '转存接口',
      rows: 1,
      initVal: card.rduri || '',
      tooltip: '图片转存在同一单点服务器下的其他业务系统。',
      required: false,
      readonly: false
    },
    {
      type: 'textarea',
      key: 'proRduri',
      label: '正式接口',
      rows: 1,
      initVal: card.proRduri || '',
      tooltip: '正式系统转存接口,图片转存在同一单点服务器下的其他业务系统。',
      required: false,
      readonly: false
    },
    {
      type: 'text',
      key: 'suffix',
      label: '后缀名',
      tooltip: '可以上传文件的后缀名,多个类型用逗号分隔,空值时不校验。',
      initVal: card.suffix || '',
      required: false,
      readonly: false
    },
    {
      type: 'radio',
      key: 'encryption',
      label: '加密传输',
      initVal: card.encryption || 'false',
      initVal: card.type === 'brafteditor' ? (card.encryption || 'true') : (card.encryption || 'false'),
      options: [{
        value: 'true',
        text: Formdict['model.true']
@@ -2208,7 +2785,7 @@
    {
      type: 'radio',
      key: 'interception',
      label: '截取',
      label: '截取空格',
      initVal: card.interception || 'false',
      tooltip: '提交时,是否截取首尾的空白字符。',
      options: [{
@@ -2218,6 +2795,21 @@
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'count',
      label: '计数功能',
      initVal: card.count || 'false',
      tooltip: '显示输入的字符数,设置行数时生效,注:加密传输时最大值与字段长度不等。',
      options: [{
        value: 'true',
        text: '开启'
      }, {
        value: 'false',
        text: '关闭'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'select',
@@ -2239,20 +2831,63 @@
      readonly: false
    },
    {
      type: 'multiselect',
      key: 'linkSubField',
      label: Formdict['model.form.linkform'],
      tooltip: '在切换选项时会把信息自动填入关联的表单(文本或数字表单)中。',
      initVal: card.linkSubField || [],
      options: inputfields
      type: 'text',
      key: 'tooltip',
      label: '悬浮提示',
      tooltip: '鼠标悬浮于提示文字上方时,显示提示信息。',
      initVal: card.tooltip || '',
      required: false,
      forbid: appType === 'mob'
    },
    {
      type: 'text',
      key: 'tooltip',
      label: '表单注释',
      tooltip: '鼠标悬浮于提示文字上方时,显示注释。',
      initVal: card.tooltip || '',
      key: 'extra',
      label: '底部提示',
      tooltip: '显示于表单底部。',
      initVal: card.extra || '',
      required: false,
      forbid: appType === 'mob'
    },
    {
      type: 'text',
      key: 'emptyText',
      label: '空值文本',
      tooltip: '空值的提示文本,选择设置空值时有效,默认值为《空》。',
      initVal: card.emptyText || '',
      required: false
    },
    {
      type: 'radio',
      key: 'enter',
      label: '回车事件',
      initVal: (card.type === 'text' || card.type === 'number') ? (card.enter || 'sub') : (card.enter || 'false'),
      tooltip: '点击Enter键,或文本类表单输入回车符。',
      options: [{
        value: 'sub',
        text: '提交'
      }, {
        value: 'tab',
        text: '切换'
      }, {
        value: 'false',
        text: '无动作'
      }]
    },
    {
      type: 'select',
      key: 'tabField',
      label: '切换字段',
      initVal: card.tabField || '',
      options: tabfields,
      required: false
    },
    {
      type: 'multiselect',
      key: 'linkSubField',
      label: Formdict['model.form.linkform'],
      tooltip: '在切换选项时会把信息自动填入关联的表单(文本或数字表单)中。注:使用选项卡且设为可多选时无效。',
      initVal: card.linkSubField || [],
      options: inputfields
    },
    {
      type: 'multiselect',
@@ -2283,17 +2918,17 @@
      initVal: card.label || '',
      required: true
    },
    {
      type: 'select',
      key: 'type',
      label: Formdict['model.form.tabType'],
      initVal: card.type || 'SubTable',
      required: true,
      options: [{
        value: 'SubTable',
        text: Formdict['model.menu.tab.subtable']
      }]
    },
    // {
    //   type: 'select',
    //   key: 'type',
    //   label: Formdict['model.form.tabType'],
    //   initVal: card.type || 'SubTable',
    //   required: true,
    //   options: [{
    //     value: 'SubTable',
    //     text: Formdict['model.menu.tab.subtable']
    //   }]
    // },
    {
      type: 'select',
      key: 'linkTab',