king
2021-09-01 31ec63f0419895876cbaba99637a884a32d33d0d
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 获取树形页面设置表单配置信息
@@ -288,14 +288,80 @@
 */
export function getSearchForm (card, linkableFields) {
  let roleList = sessionStorage.getItem('sysRoles')
  let appType = sessionStorage.getItem('appType')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch {
    } catch (e) {
      roleList = []
    }
  } else {
    roleList = []
  }
  let typeOptions = []
  if (appType === 'mob') {
    typeOptions = [{
      value: 'range',
      text: '数值(区间)'
    }, {
      value: 'checkcard',
      text: '选项卡'
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    }, {
      value: 'daterange',
      text: Formdict['model.form.daterange']
    }]
  } 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']
    }]
  }
  if (card.focus) {
    if (['text', 'multiselect'].includes(card.type)) {
      card.match = 'like'
    } else if (['select', 'link', 'checkcard'].includes(card.type)) {
      card.match = '='
    } else if (card.type === 'date') {
      card.match = '>='
    } else if (['datemonth', 'dateweek', 'daterange', 'range'].includes(card.type)) {
      card.match = 'between'
    }
  }
  return [
@@ -322,34 +388,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',
@@ -363,7 +402,7 @@
      type: 'text',
      key: 'initval',
      label: Formdict['header.form.initval'],
      tooltip: '类型为下拉菜单时,初始值应为数据的Value值(使用数据源时,应为《值·字段》的值)',
      tooltip: '类型为下拉菜单时,初始值应为数据的Value值(使用数据源时,应为《值·字段》的值);类型为数值(区间)时,初始值使用逗号拼接,例如 3,10',
      initVal: card.initval,
      required: false
    },
@@ -385,7 +424,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']
@@ -393,6 +432,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',
@@ -405,7 +513,7 @@
    {
      type: 'options',
      key: 'options',
      label: '',
      label: '选项',
      initVal: card.options || [],
      required: true,
      readonly: false
@@ -506,20 +614,6 @@
        text: '>='
      }]
    },
    // {
    //   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',
@@ -540,8 +634,23 @@
      max: 24,
      label: Formdict['header.form.ratio'],
      tooltip: '栅格布局,每行等分为24列。',
      initVal: card.ratio,
      initVal: card.ratio || 6,
      forbid: appType === 'mob',
      required: false
    },
    {
      type: 'radio',
      key: 'multiple',
      label: '可多选',
      initVal: card.multiple || 'false',
      required: true,
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'radio',
@@ -569,19 +678,44 @@
        text: Formdict['model.false']
      }]
    },
    // {
    //   type: 'radio',
    //   key: 'transfer',
    //   label: '传递',
    //   initVal: card.transfer || 'false',
    //   tooltip: '数据查询时,类型字段是否作为参数传递,类型字段对应值为 {"日": "day", "周": "week", "月": "month", "季": "quarter", "年": "year", "自定义": "customized"}。',
    //   options: [{
    //     value: 'true',
    //     text: Formdict['model.true']
    //   }, {
    //     value: 'false',
    //     text: Formdict['model.false']
    //   }]
    // },
    {
      type: 'radio',
      key: 'transfer',
      label: '传递',
      initVal: card.transfer || 'false',
      tooltip: '数据查询时,类型字段是否作为参数传递,类型字段对应值为 {"日": "day", "周": "week", "月": "month", "季": "quarter", "年": "year", "自定义": "customized"}。',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
      type: 'number',
      key: 'maxValue',
      label: '最大值',
      initVal: card.maxValue,
      forbid: appType !== 'mob',
      required: true
    },
    {
      type: 'number',
      key: 'minValue',
      label: '最小值',
      initVal: card.minValue,
      forbid: appType !== 'mob',
      required: true
    },
    {
      type: 'number',
      key: 'step',
      label: '步长',
      initVal: card.step,
      tooltip: '步长取值必须大于 0,并且可被 (max - min) 整除',
      forbid: appType !== 'mob',
      required: true
    },
    {
      type: 'radio',
@@ -595,6 +729,50 @@
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'advanced',
      label: '高级搜索',
      initVal: card.advanced || 'false',
      forbid: appType === 'mob',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'inputType',
      label: '输入样式',
      initVal: card.inputType || 'input',
      required: false,
      forbid: appType === null,
      options: [{
        value: 'input',
        text: '输入框'
      }, {
        value: 'search',
        text: '搜索框'
      }]
    },
    {
      type: 'color',
      key: 'backgroundColor',
      label: '背景色',
      initVal: card.backgroundColor || '',
      tooltip: '设置背景色后,选中效果由背景颜色控制。',
      required: false
    },
    {
      type: 'color',
      key: 'borderColor',
      label: '边框颜色',
      initVal: card.borderColor || '',
      required: false
    },
    {
      type: 'multiselect',
@@ -616,6 +794,8 @@
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, functip, config, usefulFields, type, menulist = [], printTemps = []) {
  let columns = (config.columns || []).filter(col => col.field)
  let opentypes = [
    {
      value: 'pop',
@@ -667,7 +847,11 @@
  }
  let refresh = []
  if (type === 'subtable') { // 子表页面,可设置刷新主表及同级标签
    if (card.focus) {
      card.popClose = 'maingrid'
    }
    refresh.push({
      value: 'maingrid',
      text: Formdict['header.form.refresh.maingrid']
@@ -698,6 +882,9 @@
      }, {
        value: 'print',
        text: '标签打印'
      }, {
        value: 'closetab',
        text: '标签关闭'
      }]
    },
    {
@@ -723,19 +910,24 @@
      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 || '',
@@ -744,18 +936,18 @@
    },
    {
      type: 'text',
      key: 'sql',
      label: Formdict['model.form.tablename'],
      initVal: card.sql || config.setting.tableName || '',
      required: true
    },
    {
      type: 'text',
      key: 'label',
      label: '按钮名称',
      initVal: card.label,
      required: true,
      readonly: false
    },
    {
      type: 'text',
      key: 'sql',
      label: Formdict['model.form.tablename'],
      initVal: card.sql || config.setting.tableName || '',
      required: true
    },
    {
      type: 'text',
@@ -768,17 +960,17 @@
      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',
@@ -821,7 +1013,7 @@
    {
      type: 'text',
      key: 'url',
      label: Formdict['model.form.newpage.url'],
      label: Formdict['model.pageUrl'],
      initVal: card.url || '',
      required: true
    },
@@ -848,12 +1040,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',
@@ -864,7 +1115,7 @@
      readonly: false
    },
    {
      type: 'select',
      type: 'radio',
      key: 'position',
      label: Formdict['header.form.position'],
      initVal: card.position || 'toolbar',
@@ -905,6 +1156,14 @@
      label: Formdict['model.form.linkmenu'],
      initVal: card.linkmenu || [],
      required: true,
      options: menulist
    },
    {
      type: 'cascader',
      key: 'refreshTab',
      label: '刷新标签',
      initVal: card.refreshTab || [],
      required: false,
      options: menulist
    },
    {
@@ -1058,7 +1317,70 @@
        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
    },
    {
      type: 'radio',
      key: 'display',
      label: '显示方式',
      initVal: card.display || 'modal',
      required: true,
      options: [{
        value: 'modal',
        text: '模态框'
      }, {
        value: 'drawer',
        text: '抽屉'
      }]
    },
    {
      type: 'number',
      key: 'ratio',
      min: 1,
      max: 24,
      precision: 0,
      label: '比例',
      initVal: card.ratio || 85,
      tooltip: '小于100为宽度(或高度)百分比,大于100为像素值。',
      required: true
    },
    {
      type: 'radio',
      key: 'placement',
      label: '抽屉方向',
      initVal: card.placement || 'right',
      tooltip: '使用抽屉时有效。',
      required: false,
      options: [{
        value: 'right',
        text: '右侧'
      }, {
        value: 'left',
        text: '左侧'
      }, {
        value: 'top',
        text: '上侧'
      }, {
        value: 'bottom',
        text: '下侧'
      }]
    },
  ]
}
@@ -1067,16 +1389,20 @@
 * @param {object} card       // 搜索条件对象
 * @param {Array}  menulist   // 菜单列表-用于字段透视
 */
export function getColumnForm (card, menulist = []) {
export function getColumnForm (card, menulist = [], fields = []) {
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch {
    } catch (e) {
      roleList = []
    }
  } else {
    roleList = []
  }
  if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) {
    card.perspective = ''
  }
  return [
@@ -1116,6 +1442,9 @@
      }, {
        value: 'textarea',
        text: Formdict['model.form.textarea']
      }, {
        value: 'index',
        text: '序号'
      }]
    },
    {
@@ -1256,6 +1585,9 @@
      }, {
        value: 'percent',
        text: '百分比'
      }, {
        value: 'abs',
        text: '绝对值'
      }],
      required: false
    },
@@ -1323,8 +1655,11 @@
      type: 'radio',
      key: 'perspective',
      label: '字段透视',
      initVal: card.perspective || 'linkmenu',
      initVal: card.perspective || '',
      options: [{
        value: '',
        text: '无'
      }, {
        value: 'linkmenu',
        text: '菜单'
      }, {
@@ -1337,15 +1672,23 @@
      key: 'linkmenu',
      label: Formdict['model.menu'],
      initVal: card.linkmenu || [],
      required: false,
      required: true,
      options: menulist
    },
    {
      type: 'text',
      type: 'textarea',
      key: 'linkurl',
      label: '链接地址',
      initVal: card.linkurl || '',
      required: false
      required: true
    },
    {
      type: 'multiselect',
      key: 'linkfields',
      label: '关联字段',
      initVal: card.linkfields || [],
      required: false,
      options: fields
    },
    {
      type: 'multiselect',
@@ -1370,7 +1713,7 @@
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch {
    } catch (e) {
      roleList = []
    }
  } else {
@@ -1820,6 +2163,7 @@
 * @param {*} subtable        // 是否为子表表单
 */
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, subtable = false) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
    try {
@@ -1831,25 +2175,133 @@
          label: role.text
        }
      })
    } catch {
    } catch (e) {
      roleList = []
    }
  } else {
    roleList = []
  }
  
  let _openType = []
  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: '分隔线'
  }, {
    value: 'linkMain',
    text: Formdict['header.form.linkMain']
  }]
  let _fieldlength = 50
  if (subtable) {
    _openType.push({
      value: 'linkMain',
      text: Formdict['header.form.linkMain']
    })
  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: '分隔线'
    }]
  }
  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 [
@@ -1875,65 +2327,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
    },
@@ -1950,14 +2350,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',
@@ -1990,7 +2406,10 @@
    {
      type: 'number',
      key: 'width',
      label: '卡片宽度',
      min: 1,
      max: 24,
      precision: 0,
      label: '元素宽度',
      initVal: card.width || 4,
      tooltip: '栅格布局,每行等分为24列。',
      required: true
@@ -2131,6 +2550,9 @@
    {
      type: 'number',
      key: 'decimal',
      min: 0,
      max: 18,
      precision: 0,
      label: Formdict['header.form.decimal'],
      initVal: card.decimal || 0,
      required: true
@@ -2152,6 +2574,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,
@@ -2160,8 +2585,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
    },
    {
@@ -2181,29 +2610,36 @@
      }, {
        value: 'letter&number',
        text: Formdict['header.form.letter&number']
      }, {
        value: 'phone',
        text: '手机号'
      }]
    },
    {
      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
    },
    {
@@ -2260,6 +2696,37 @@
    },
    {
      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: 'false',
        text: '禁用'
      }, {
        value: 'simple',
        text: '单次'
      }, {
        value: 'multi',
        text: '连续'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'radio',
      key: 'readin',
      label: Formdict['header.form.readin'],
      tooltip: Formdict['header.form.readin.tooltip'],
@@ -2288,23 +2755,157 @@
    },
    {
      type: 'radio',
      key: 'entireLine',
      label: '占据整行',
      initVal: card.entireLine || 'false',
      required: false,
      key: 'hidelabel',
      label: '隐藏名称',
      initVal: card.hidelabel || 'false',
      options: [{
        value: 'true',
        text: '是'
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: '否'
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'arrange',
      label: '元素排列',
      initVal: card.arrange || 'adaptive',
      forbid: appType !== 'mob',
      options: [{
        value: 'line',
        text: '整行'
      }, {
        value: 'adaptive',
        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)'
      }]
    },
    {
      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: 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',
      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']
@@ -2316,7 +2917,7 @@
    {
      type: 'radio',
      key: 'interception',
      label: '截取',
      label: '截取空格',
      initVal: card.interception || 'false',
      tooltip: '提交时,是否截取首尾的空白字符。',
      options: [{
@@ -2326,6 +2927,35 @@
        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',
@@ -2341,7 +2971,7 @@
      type: 'text',
      key: 'supvalue',
      label: '显示值',
      tooltip: '请填写显示值,只有上级表单值与显示值相同时,该表单才会显示,注:多个值用逗号分隔。',
      tooltip: '请填写显示值,只有上级表单值与显示值相同时,该表单才会显示,注:1、多个值用逗号分隔;2、上级表单初始值为$first时暂未处理。',
      initVal: card.supvalue || '',
      required: true,
      readonly: false
@@ -2352,6 +2982,24 @@
      label: '悬浮提示',
      tooltip: '鼠标悬浮于提示文字上方时,显示提示信息。',
      initVal: card.tooltip || '',
      required: false,
      forbid: appType === 'mob'
    },
    {
      type: 'text',
      key: 'extra',
      label: '底部提示',
      tooltip: '显示于表单底部。',
      initVal: card.extra || '',
      required: false,
      forbid: appType === 'mob'
    },
    {
      type: 'text',
      key: 'placeholder',
      label: '提示信息',
      tooltip: '字段预期值的提示信息。',
      initVal: card.placeholder || '',
      required: false
    },
    {
@@ -2391,7 +3039,7 @@
      type: 'multiselect',
      key: 'linkSubField',
      label: Formdict['model.form.linkform'],
      tooltip: '在切换选项时会把信息自动填入关联的表单(文本或数字表单)中。',
      tooltip: '在切换选项时会把信息自动填入关联的表单(文本或数字表单)中。注:使用选项卡且设为可多选时无效。',
      initVal: card.linkSubField || [],
      options: inputfields
    },
@@ -2424,17 +3072,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',