king
2021-05-08 6afdec0062dacbded57e166230eb22cc55ced0c1
src/templates/zshare/formconfig.jsx
@@ -2,242 +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
/**
 * @description 获取页面设置表单配置信息
 * @param {object} setting       // 菜单全局设置信息
 * @param {array}  usefulFields  // 内部函数可用的开头字符
 * @param {string} MenuID        // 菜单ID
 * @param {string} primaryKey    // 主键
 * @param {zrray}  columns       // 显示列
 * @param {string} type          // 菜单类型,main(主表)
 */
export function getSettingForm (setting, usefulFields = [], MenuID, primaryKey, columns, type) {
  let str = '^(' + usefulFields.join('|') + ')'
  let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
  return [
    {
      type: 'text',
      key: 'tableName',
      label: '表名',
      initVal: setting.tableName || '',
      required: true,
      readonly: false,
      rules: [
        {
          max: formRule.input.max,
          message: formRule.input.message
        }
      ]
    },
    {
      type: 'select',
      key: 'tableType',
      label: '表格属性',
      initVal: setting.tableType,
      required: false,
      readonly: false,
      options: [
        { value: '', text: '不可选' },
        { value: 'radio', text: '单选' },
        { value: 'checkbox', text: '多选' }
      ]
    },
    {
      type: 'radio',
      key: 'interType',
      label: Formdict['header.form.intertype'],
      initVal: setting.interType || 'inner',
      required: false,
      readonly: false,
      options: [
        { value: 'inner', text: Formdict['header.form.interface.inner'] },
        { value: 'outer', text: Formdict['header.form.interface.outer'] }
      ]
    },
    {
      type: 'radio',
      key: 'sysInterface',
      label: Formdict['header.form.sysInterface'],
      initVal: setting.sysInterface || 'false',
      required: false,
      readonly: false,
      options: [
        { value: 'true', text: Formdict['header.form.true'] },
        { value: 'false', text: Formdict['header.form.false'] }
      ]
    },
    {
      type: 'text',
      key: 'interface',
      label: Formdict['header.form.interface'],
      initVal: setting.sysInterface === 'true' ? (window.GLOB.mainSystemApi || '') : (setting.interface || ''),
      required: true,
      readonly: setting.sysInterface === 'true',
      rules: [
        {
          max: formRule.input.max,
          message: formRule.input.message
        }
      ]
    },
    {
      type: 'text',
      key: 'outerFunc',
      label: Formdict['header.form.outerFunc'],
      initVal: setting.outerFunc || '',
      required: false,
      readonly: false,
      rules: [
        {
          pattern: formRule.func.pattern,
          message: formRule.func.message
        }, {
          max: formRule.func.max,
          message: formRule.func.maxMessage
        }
      ]
    },
    {
      type: 'text',
      key: 'innerFunc',
      label: Formdict['header.form.innerFunc'],
      initVal: setting.innerFunc || '',
      tooltip: '开头可用字符:' + usefulFields.join(', '),
      required: false,
      readonly: false,
      rules: [
        {
          pattern: _patten,
          message: formRule.func.innerMessage
        }, {
          max: formRule.func.max,
          message: formRule.func.maxMessage
        }
      ]
    },
    {
      type: 'datasource',
      key: 'dataresource',
      label: '数据源',
      initVal: setting.dataresource || '',
      tooltip: '使用系统函数时,需填写数据源。注:数据权限替换符 $@ -> /* 或 \'\'、 @$ -> */ 或 \'\'',
      help: '数据ID:' + MenuID,
      required: false,
      readonly: false,
      rules: [
        {
          pattern: _patten,
          message: formRule.func.innerMessage
        }, {
          max: formRule.func.max,
          message: formRule.func.maxMessage
        }
      ]
    },
    {
      type: 'select',
      key: 'primaryKey',
      label: '主键',
      initVal: primaryKey,
      required: false,
      readonly: false,
      options: columns
    },
    {
      type: 'text',
      key: 'order',
      label: '默认排序',
      initVal: setting.order || (primaryKey ? primaryKey + ' desc' : ''),
      placeholder: 'ID asc, UID desc',
      required: true,
      readonly: false,
      rules: [
        {
          max: formRule.input.max,
          message: formRule.input.message
        }
      ]
    },
    {
      type: 'radio',
      key: 'queryType',
      label: Formdict['header.form.queryType'],
      initVal: setting.queryType || 'query',
      tooltip: '查询时,搜索条件以where条件拼接进入sql,统计时,将数据源中以“@+搜索字段”的内容,以搜索条件中的值进行替换后,提交查询,注:查询类型仅在使用系统函数时有效。',
      required: false,
      readonly: false,
      options: [
        { value: 'query', text: Formdict['header.form.query'] },
        { value: 'statistics', text: Formdict['header.form.statistics'] }
      ]
    },
    {
      type: 'radio',
      key: 'actionfixed',
      label: '按钮固定',
      initVal: setting.actionfixed ? 'true' : 'false',
      required: false,
      readonly: false,
      forbid: type !== 'main',
      options: [
        { value: 'true', text: Formdict['header.form.true'] },
        { value: 'false', text: Formdict['header.form.false'] }
      ]
    },
    {
      type: 'radio',
      key: 'columnfixed',
      label: '表头固定',
      initVal: setting.columnfixed ? 'true' : 'false',
      required: false,
      readonly: false,
      forbid: type !== 'main',
      options: [
        { value: 'true', text: Formdict['header.form.true'] },
        { value: 'false', text: Formdict['header.form.false'] }
      ]
    },
    {
      type: 'radio',
      key: 'onload',
      label: '初始化',
      initVal: setting.onload || 'true',
      required: false,
      readonly: false,
      options: [
        { value: 'true', text: '加载数据' },
        { value: 'false', text: '不加载数据' }
      ]
    },
    {
      type: 'radio',
      key: 'laypage',
      label: '是否分页',
      initVal: setting.laypage || 'true',
      required: false,
      readonly: false,
      options: [
        { value: 'true', text: Formdict['header.form.true'] },
        { value: 'false', text: Formdict['header.form.false'] }
      ]
    },
    {
      type: 'radio',
      key: 'default',
      label: '默认sql',
      initVal: setting.default || 'true',
      required: false,
      readonly: false,
      options: [
        { value: 'true', text: '执行' },
        { value: 'false', text: '不执行' }
      ]
    },
  ]
}
const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
/**
 * @description 获取树形页面设置表单配置信息
@@ -286,8 +51,8 @@
      required: false,
      readonly: false,
      options: [
        { value: 'inner', text: Formdict['header.form.interface.inner'] },
        { value: 'outer', text: Formdict['header.form.interface.outer'] }
        { value: 'inner', text: Formdict['model.interface.inner'] },
        { value: 'outer', text: Formdict['model.interface.outer'] }
      ]
    },
    {
@@ -298,8 +63,8 @@
      required: false,
      readonly: false,
      options: [
        { value: 'true', text: Formdict['header.form.true'] },
        { value: 'false', text: Formdict['header.form.false'] }
        { value: 'true', text: Formdict['model.true'] },
        { value: 'false', text: Formdict['model.false'] }
      ]
    },
    {
@@ -445,7 +210,7 @@
      key: 'mark',
      label: '顶级标识',
      initVal: setting.mark || '',
      tooltip: '父级字段值与顶级标识(默认值为空)相同时,视为顶级节点。',
      tooltip: '父级字段值与顶级标识相同时,视为顶级节点。',
      required: false,
      readonly: false,
      rules: [
@@ -461,7 +226,7 @@
      min: 2,
      max: 12,
      label: '宽度',
      tooltip: '每行分为24份,树形比例可设置为2-12(最大50%)',
      tooltip: '栅格布局,每行等分为24列,树形比例可设置为2-12(最大50%)',
      initVal: setting.width || 5,
      required: true
    },
@@ -497,8 +262,8 @@
      required: false,
      readonly: false,
      options: [
        { value: 'true', text: Formdict['header.form.true'] },
        { value: 'false', text: Formdict['header.form.false'] }
        { value: 'true', text: Formdict['model.true'] },
        { value: 'false', text: Formdict['model.false'] }
      ]
    },
    {
@@ -509,126 +274,35 @@
      required: false,
      readonly: false,
      options: [
        { value: 'true', text: Formdict['header.form.true'] },
        { value: 'false', text: Formdict['header.form.false'] }
        { value: 'true', text: Formdict['model.true'] },
        { value: 'false', text: Formdict['model.false'] }
      ]
    }
  ]
}
/**
 * @description 获取主菜单基本信息表单配置信息
 * @param {object} menu    // 主表基本信息
 * @param {object} config  // 主表配置信息
 */
export function getMainMenuForm (menu, _config) {
  return [
    {
      type: 'select',
      key: 'fstMenuId',
      label: '一级菜单',
      initVal: menu.fstMenuId,
      required: true,
      readonly: false,
      options: menu.fstMenuList
    },
    {
      type: 'select',
      key: 'parentId',
      label: '二级菜单',
      initVal: menu.ParentID,
      required: true,
      readonly: false,
      options: menu.supMenuList
    },
    {
      type: 'text',
      key: 'MenuName',
      label: Formdict['header.menu.menuName'],
      initVal: menu.MenuName,
      required: true,
      readonly: false
    },
    {
      type: 'text',
      key: 'MenuNo',
      label: Formdict['header.menu.menuNo'],
      initVal: menu.MenuNo,
      required: true,
      readonly: false
    },
    {
      type: 'select',
      key: 'opentype',
      label: Formdict['header.menu.openType'],
      initVal: menu.PageParam.OpenType,
      required: true,
      options: [{
        MenuID: 'newtab',
        text: Formdict['header.form.tab']
      }, {
        MenuID: 'newpage',
        text: Formdict['header.form.newpage']
      }, {
        MenuID: 'currenttab',
        text: Formdict['header.form.currenttab']
      }]
    },
    {
      type: 'text',
      key: 'easyCode',
      label: Formdict['header.form.easyCode'],
      initVal: _config.easyCode,
      required: false,
      readonly: false
    }
  ]
}
/**
 * @description 获取子菜单基本信息表单配置信息
 * @param {object} config  // 子表配置信息
 */
export function getSubMenuForm (config) {
  return [
    {
      type: 'text',
      key: 'MenuName',
      label: Formdict['header.menu.viewName'],
      initVal: config.tabName,
      required: true,
      readonly: false
    },
    {
      type: 'text',
      key: 'MenuNo',
      label: Formdict['header.menu.menuNo'],
      initVal: config.tabNo,
      required: true,
      readonly: false
    },
    {
      type: 'text',
      key: 'Remark',
      label: Formdict['header.menu.Remark'],
      initVal: config.Remark,
      required: false,
      readonly: false
    }
  ]
}
/**
 * @description 获取搜索条件表单配置信息
 * @param {object} card       // 搜索条件对象
 * @param {Array}  roleList   // 角色列表
 * @param {object} card           // 搜索条件对象
 * @param {Array}  linkableFields // 可关联字段
 */
export function getSearchForm (card, roleList) {
export function getSearchForm (card, linkableFields) {
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch {
      roleList = []
    }
  } else {
    roleList = []
  }
  return [
    {
      type: 'text',
      key: 'label',
      label: Formdict['header.form.name'],
      label: Formdict['model.name'],
      initVal: card.label || '',
      required: true,
      readonly: false
@@ -636,7 +310,7 @@
    {
      type: 'text',
      key: 'field',
      label: Formdict['header.form.field'],
      label: Formdict['model.form.field'],
      initVal: card.field || '',
      tooltipClass: 'middle',
      required: true,
@@ -645,36 +319,36 @@
    {
      type: 'select',
      key: 'type',
      label: Formdict['header.form.type'],
      label: Formdict['model.form.type'],
      initVal: card.type,
      required: true,
      options: [{
        value: 'text',
        text: Formdict['header.form.text']
        text: Formdict['model.form.text']
      }, {
        value: 'select',
        text: Formdict['header.form.select']
        text: Formdict['model.form.select']
      }, {
        value: 'multiselect',
        text: Formdict['header.form.multiselect']
        text: Formdict['model.form.multiselect']
      }, {
        value: 'link',
        text: Formdict['header.form.link']
        text: Formdict['model.form.link']
      }, {
        value: 'date',
        text: Formdict['header.form.dateday']
        text: Formdict['model.form.dateday']
      }, {
        value: 'dateweek',
        text: Formdict['header.form.dateweek']
        text: Formdict['model.form.dateweek']
      }, {
        value: 'datemonth',
        text: Formdict['header.form.datemonth']
        text: Formdict['model.form.datemonth']
      }, {
        value: 'daterange',
        text: Formdict['header.form.daterange']
        text: Formdict['model.form.daterange']
      }, {
        value: 'group',
        text: '日期(组合)'
        text: Formdict['model.form.dategroup']
      }]
    },
    {
@@ -689,6 +363,7 @@
      type: 'text',
      key: 'initval',
      label: Formdict['header.form.initval'],
      tooltip: '类型为下拉菜单时,初始值应为数据的Value值(使用数据源时,应为《值·字段》的值)',
      initVal: card.initval,
      required: false
    },
@@ -710,13 +385,13 @@
      type: 'radio',
      key: 'setAll',
      label: Formdict['header.form.setAll'],
      initVal: card.setAll || 'false',
      initVal: card.setAll || 'true',
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
@@ -763,12 +438,13 @@
      }]
    },
    {
      type: 'text',
      type: 'select',
      key: 'linkField',
      label: Formdict['header.form.linkField'],
      initVal: card.linkField || '',
      required: true,
      readonly: false
      readonly: false,
      options: linkableFields
    },
    {
      type: 'text',
@@ -830,20 +506,20 @@
        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: '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',
@@ -858,43 +534,40 @@
      }]
    },
    {
      type: 'radio',
      key: 'required',
      label: Formdict['header.form.field.required'],
      initVal: card.required || 'false',
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
      }]
    },
    {
      type: 'number',
      key: 'ratio',
      min: 1,
      max: 24,
      label: Formdict['header.form.ratio'],
      tooltip: '每行分为24份,比例可设置为1-24',
      tooltip: '栅格布局,每行等分为24列。',
      initVal: card.ratio,
      required: false
    },
    {
      type: 'select',
      key: 'quick',
      label: Formdict['header.form.quickadd'],
      initVal: '',
      required: false,
      options: []
      type: 'radio',
      key: 'required',
      label: Formdict['model.required'],
      initVal: card.required || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],
      initVal: card.blacklist || [],
      required: false,
      options: roleList || []
      type: 'radio',
      key: 'Hide',
      label: Formdict['model.hidden'],
      initVal: card.Hide || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
@@ -904,11 +577,32 @@
      tooltip: '数据查询时,类型字段是否作为参数传递,类型字段对应值为 {"日": "day", "周": "week", "月": "month", "季": "quarter", "年": "year", "自定义": "customized"}。',
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'labelShow',
      label: '显示名称',
      initVal: card.labelShow || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],
      initVal: card.blacklist || [],
      required: false,
      options: roleList || []
    }
  ]
}
@@ -918,61 +612,72 @@
 * @param {*} card           编辑按钮
 * @param {*} functip        生成存储过程提示
 * @param {*} config         页面配置
 * @param {*} permFuncField  存储过程可用的开始字段
 * @param {*} usefulFields   存储过程可用的开始字段
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, functip, config, permFuncField, type) {
export function getActionForm (card, functip, config, usefulFields, type, menulist = [], printTemps = []) {
  let opentypes = [
    {
      value: 'pop',
      text: Formdict['header.form.popform']
      text: Formdict['model.form.popform']
    }, {
      value: 'prompt',
      text: Formdict['header.form.prompt']
      text: Formdict['model.form.prompt']
    }, {
      value: 'exec',
      text: Formdict['header.form.exec']
      text: Formdict['model.form.exec']
    }, {
      value: 'excelIn',
      text: Formdict['header.form.excelIn']
      text: Formdict['model.form.excelIn']
    }, {
      value: 'excelOut',
      text: Formdict['header.form.excelOut']
      text: Formdict['model.form.excelOut']
    }, {
      value: 'popview',
      text: Formdict['header.form.popview']
      text: Formdict['model.form.popview']
    }, {
      value: 'tab',
      text: Formdict['model.form.tab']
    }, {
      value: 'innerpage',
      text: Formdict['model.form.newpage']
    }, {
      value: 'funcbutton',
      text: Formdict['model.form.funcbutton']
    }
  ]
  // 标签类型,主表才会存在表单标签页
  let tabTems = [{
    value: 'FormTab',
    text: '表单标签页'
  }]
  if (type === 'subtable') {
    opentypes.push({
      value: 'funcbutton',
      text: Formdict['header.form.funcbutton']
    })
  } else {
    opentypes.push({
      value: 'tab',
      text: Formdict['header.form.tab']
    }, {
      value: 'innerpage',
      text: Formdict['header.form.newpage']
    }, {
      value: 'funcbutton',
      text: Formdict['header.form.funcbutton']
    })
    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']
    })
  }
@@ -987,25 +692,63 @@
    },
    {
      type: 'radio',
      key: 'intertype',
      label: Formdict['header.form.intertype'],
      initVal: card.intertype || 'inner',
      key: 'funcType',
      label: Formdict['header.form.funcType'],
      initVal: card.funcType || '',
      required: true,
      options: [{
        value: 'inner',
        text: Formdict['header.form.interface.inner']
        value: 'changeuser',
        text: Formdict['header.form.func.changeuser']
      }, {
        value: 'outer',
        text: Formdict['header.form.interface.outer']
        value: 'print',
        text: '标签打印'
      }]
    },
    {
      type: 'select',
      key: 'execMode',
      label: Formdict['model.form.execMode'],
      initVal: card.execMode || 'exec',
      required: true,
      options: [{
        value: 'exec',
        text: Formdict['model.form.exec']
      }, {
        value: 'prompt',
        text: Formdict['model.form.prompt']
      }, {
        value: 'pop',
        text: Formdict['model.form.popform']
      }]
    },
    {
      type: 'radio',
      key: 'intertype',
      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: '系统函数'
      }, {
        value: 'inner',
        text: '内部函数'
      }]
    },
    {
      type: 'radio',
      key: 'sqlType',
      label: Formdict['header.form.action.type'],
      initVal: card.sqlType || '',
      tooltip: Formdict['header.form.actionhelp.sqlType'],
      required: false,
      required: true,
      options: []
    },
    {
@@ -1019,10 +762,9 @@
    {
      type: 'text',
      key: 'sql',
      label: Formdict['header.form.tablename'],
      label: Formdict['model.form.tablename'],
      initVal: card.sql || config.setting.tableName || '',
      tooltip: Formdict['header.form.actionhelp.tablename'],
      required: false
      required: true
    },
    {
      type: 'text',
@@ -1030,53 +772,22 @@
      label: Formdict['header.form.innerFunc'],
      initVal: card.innerFunc || '',
      tooltip: functip,
      fields: permFuncField,
      fields: usefulFields,
      tooltipClass: 'middle',
      required: false,
      required: card.intertype === 'inner',
      readonly: false
    },
    {
      type: 'select',
      key: 'funcType',
      label: Formdict['header.form.funcType'],
      initVal: card.funcType || '',
      required: true,
      options: [{
        value: 'changeuser',
        text: Formdict['header.form.func.changeuser']
      }, {
        value: 'print',
        text: Formdict['header.form.func.print']
      }]
    },
    {
      type: 'select',
      key: 'execMode',
      label: Formdict['header.form.execMode'],
      initVal: card.execMode || 'exec',
      required: true,
      options: [{
        value: 'exec',
        text: Formdict['header.form.exec']
      }, {
        value: 'prompt',
        text: Formdict['header.form.prompt']
      }, {
        value: 'pop',
        text: Formdict['header.form.popform']
      }]
    },
    {
      type: 'select',
      key: 'tabType',
      label: Formdict['header.form.tabType'],
      initVal: card.tabType || 'SubTable',
      required: true,
      options: [{
        value: 'SubTable',
        text: Formdict['header.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',
@@ -1088,21 +799,38 @@
    {
      type: 'select',
      key: 'pageTemplate',
      label: Formdict['header.form.newpage.type'],
      label: Formdict['model.form.newpage.type'],
      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']
      }, {
        value: 'custom',
        text: Formdict['header.form.custom']
      }]
    },
    {
      type: 'select',
      key: 'printTemp',
      label: '打印模板',
      initVal: card.printTemp || '',
      required: true,
      options: printTemps
    },
    {
      type: 'text',
      key: 'url',
      label: Formdict['header.form.newpage.url'],
      label: Formdict['model.pageUrl'],
      initVal: card.url || '',
      required: true
    },
@@ -1114,10 +842,10 @@
      required: true,
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
@@ -1129,12 +857,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',
@@ -1145,7 +932,7 @@
      readonly: false
    },
    {
      type: 'select',
      type: 'radio',
      key: 'position',
      label: Formdict['header.form.position'],
      initVal: card.position || 'toolbar',
@@ -1169,46 +956,57 @@
    {
      type: 'select',
      key: 'tabTemplate',
      label: '标签模板',
      initVal: card.tabTemplate || 'FormTab',
      label: '标签类型',
      initVal: card.tabTemplate || '',
      required: true,
      options: [{
        value: 'FormTab',
        text: '带标签表单'
      }]
      options: [
        {
          value: 'ThdMenu',
          text: Formdict['model.menu.level3']
        },
        ...tabTems
      ]
    },
    {
      type: 'select',
      type: 'cascader',
      key: 'linkmenu',
      label: Formdict['model.form.linkmenu'],
      initVal: card.linkmenu || [],
      required: true,
      options: menulist
    },
    {
      type: 'radio',
      key: 'afterExecSuccess',
      label: Formdict['header.form.afterExecSuccess'],
      initVal: card.afterExecSuccess || 'close',
      required: true,
      options: [{
        value: 'close',
        text: Formdict['header.close']
        text: Formdict['model.close']
      }, {
        value: 'notclose',
        text: Formdict['header.notclose']
        text: Formdict['model.notclose']
      }]
    },
    {
      type: 'select',
      type: 'radio',
      key: 'afterExecError',
      label: Formdict['header.form.afterExecError'],
      initVal: card.afterExecError || 'notclose',
      required: true,
      options: [{
        value: 'close',
        text: Formdict['header.close']
        text: Formdict['model.close']
      }, {
        value: 'notclose',
        text: Formdict['header.notclose']
        text: Formdict['model.notclose']
      }]
    },
    {
      type: 'select',
      type: refresh.length === 0 ? 'radio' : 'select',
      key: 'execSuccess',
      label: Formdict['header.form.execSuccess'],
      label: Formdict['model.form.afterSuccess'],
      initVal: card.execSuccess || 'never',
      required: true,
      options: [{
@@ -1217,16 +1015,13 @@
      }, {
        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['header.form.execError'],
      label: Formdict['model.form.afterError'],
      initVal: card.execError || 'never',
      required: true,
      options: [{
@@ -1235,13 +1030,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',
@@ -1252,16 +1045,27 @@
      }, {
        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',
      key: 'icon',
      label: Formdict['header.form.icon'],
      label: Formdict['model.icon'],
      initVal: card.icon,
      required: false,
      options: []
@@ -1269,15 +1073,29 @@
    {
      type: 'select',
      key: 'class',
      label: Formdict['header.form.class'],
      label: Formdict['model.form.color'],
      initVal: card.class,
      required: false,
      options: []
    },
    {
      type: 'radio',
      key: 'joint',
      label: Formdict['model.form.paramJoint'],
      initVal: card.joint || 'true',
      required: false,
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'text',
      key: 'sheet',
      label: Formdict['header.form.tablename'],
      label: Formdict['model.form.tablename'],
      initVal: card.sheet || config.setting.tableName || '',
      required: true
    },
@@ -1289,10 +1107,10 @@
      required: false,
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
@@ -1315,22 +1133,36 @@
/**
 * @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',
      key: 'label',
      label: Formdict['header.form.name'],
      label: Formdict['model.name'],
      initVal: card.label,
      required: true
    },
    {
      type: 'text',
      key: 'field',
      label: Formdict['header.form.field'],
      label: Formdict['model.form.field'],
      initVal: card.field,
      required: true,
      readonly: false
@@ -1338,22 +1170,36 @@
    {
      type: 'select',
      key: 'type',
      label: Formdict['header.form.type'],
      label: Formdict['model.form.type'],
      initVal: card.type,
      required: true,
      options: [{
        value: 'text',
        text: Formdict['header.form.text']
        text: Formdict['model.form.text']
      }, {
        value: 'number',
        text: Formdict['header.form.number']
        text: Formdict['model.form.number']
      }, {
        value: 'picture',
        text: Formdict['header.form.picture']
        text: Formdict['model.form.picture']
      }, {
        value: 'link',
        text: Formdict['model.form.href']
      }, {
        value: 'textarea',
        text: Formdict['header.form.textarea']
        text: Formdict['model.form.textarea']
      }, {
        value: 'index',
        text: '序号'
      }]
    },
    {
      type: 'text',
      key: 'nameField',
      label: Formdict['model.name'] + Formdict['model.form.field'],
      initVal: card.nameField,
      required: false,
      readonly: false
    },
    {
      type: 'number',
@@ -1361,53 +1207,97 @@
      min: 1,
      max: 1000,
      decimal: 0,
      label: Formdict['header.form.columnWidth'],
      label: Formdict['model.form.columnWidth'],
      initVal: card.Width,
      required: true
    },
    {
      type: 'radio',
      key: 'joint',
      label: Formdict['model.form.paramJoint'],
      initVal: card.joint || 'true',
      required: true,
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'Hide',
      label: Formdict['header.form.Hide'],
      label: Formdict['model.hidden'],
      initVal: card.Hide || 'false',
      required: true,
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'IsSort',
      label: Formdict['header.form.IsSort'],
      label: Formdict['model.sort'],
      initVal: card.IsSort || 'true',
      required: true,
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'Align',
      label: Formdict['header.form.align'],
      label: Formdict['model.form.align'],
      initVal: card.Align || 'left',
      required: true,
      options: [{
        value: 'left',
        text: Formdict['header.form.alignLeft']
        text: Formdict['model.form.alignLeft']
      }, {
        value: 'center',
        text: Formdict['header.form.alignCenter']
        text: Formdict['model.form.alignCenter']
      }, {
        value: 'right',
        text: Formdict['header.form.alignRight']
        text: Formdict['model.form.alignRight']
      }]
    },
    {
      type: 'radio',
      key: 'rowspan',
      label: '行合并',
      initVal: card.rowspan || 'false',
      tooltip: '相邻行信息相同时,单元格合并。',
      required: false,
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'sum',
      label: '显示合计',
      initVal: card.sum || 'false',
      tooltip: '合计信息只在使用系统数据源,且当前列未隐藏时有效。',
      required: false,
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
@@ -1421,28 +1311,48 @@
      required: true
    },
    {
      type: 'number',
      key: 'fieldlength',
      label: Formdict['model.form.field'] + Formdict['model.length'],
      initVal: card.fieldlength || (card.type === 'text' ? 50 : 512),
      required: true
    },
    {
      type: 'select',
      key: 'format',
      label: Formdict['header.form.format'],
      initVal: card.format || '',
      options: [{
        value: '',
        text: Formdict['header.form.empty']
        text: Formdict['model.empty']
      }, {
        value: 'thdSeparator',
        text: Formdict['header.form.thdSeparator']
      }, {
        value: 'percent',
        text: '百分比'
      }, {
        value: 'abs',
        text: '绝对值'
      }],
      required: false
    },
    {
      type: 'number',
      key: 'fieldlength',
      label: Formdict['header.form.field.length'],
      initVal: card.fieldlength || (card.type === 'text' ? 50 : 512),
      required: true
      type: 'select',
      key: 'textFormat',
      label: Formdict['header.form.format'],
      initVal: card.textFormat || '',
      options: [{
        value: '',
        text: Formdict['model.empty']
      }, {
        value: 'YYYY-MM-DD',
        text: 'YYYY-MM-DD'
      }, {
        value: 'YYYY-MM-DD HH:mm:ss',
        text: 'YYYY-MM-DD HH:mm:ss'
      }],
      required: false
    },
    {
      type: 'text',
@@ -1481,19 +1391,50 @@
      required: false,
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'perspective',
      label: '字段透视',
      initVal: card.perspective || '',
      options: [{
        value: '',
        text: '无'
      }, {
        value: 'linkmenu',
        text: '菜单'
      }, {
        value: 'linkurl',
        text: '链接'
      }]
    },
    {
      type: 'cascader',
      key: 'linkmenu',
      label: Formdict['header.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',
@@ -1508,11 +1449,23 @@
/**
 * @description 获取图表视图外部配置表单
 * @param {object} card       // 搜索条件对象
 * @param {Array}  roleList   // 角色列表-黑名单
 * @param {Array}  columns    // 显示列
 * @param {object} card         // 搜索条件对象
 * @param {Array}  columns      // 显示列
 * @param {Array}  actions      // 按钮组excel
 * @param {Array}  extraActions // 常规按钮
 */
export function getChartViewForm (card, roleList = [], _columns) {
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: '折线图'
@@ -1564,15 +1517,15 @@
    {
      type: 'radio',
      key: 'Hide',
      label: Formdict['header.form.Hide'],
      label: Formdict['model.hidden'],
      initVal: card.Hide,
      required: true,
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
@@ -1582,49 +1535,18 @@
      max: 24,
      decimal: 0,
      label: '图表宽度',
      tooltip: '每行等分为24列,24即为100%。',
      tooltip: '栅格布局,每行等分为24列。',
      initVal: card.width || 24,
      required: true
    },
    {
      type: 'radio',
      key: 'over',
      label: '超出时',
      initVal: card.over || 'whole',
      required: true,
      hidden: true,
      options: [{
        value: 'whole',
        text: '展示全部'
      }, {
        value: 'roll',
        text: '滚动'
      }]
    },
    {
      type: 'radio',
      key: 'widthType',
      label: '宽度设置',
      initVal: card.over === 'roll' ? 'absolute' : card.widthType || 'ratio',
      required: true,
      hidden: true,
      readonly: card.over === 'roll',
      options: [{
        value: 'ratio',
        text: '比例'
      }, {
        value: 'absolute',
        text: '绝对值'
      }]
    },
    {
      type: 'number',
      key: 'cardWidth',
      min: card.widthType === 'absolute' ? 50 : 1,
      max: card.widthType === 'absolute' ? 1000 : 24,
      min: 1,
      max: 24,
      decimal: 0,
      label: '卡片宽度',
      tooltip: '类型为比例时,范围1-24,24即为100%;类型为绝对值,范围50-1000。',
      tooltip: '栅格布局,每行等分为24列。',
      initVal: card.cardWidth || 6,
      hidden: true,
      required: true
@@ -1670,19 +1592,13 @@
      }]
    },
    {
      type: 'radio',
      key: 'insert',
      label: '添加卡片',
      initVal: card.insert || 'false',
      tooltip: '选择显示添加卡片,且存在操作类型为添加的按钮时,卡片尾部会增加添加功能卡片(只显示第一个添加按钮)',
      type: 'select',
      key: 'extraAction',
      label: '扩展卡片',
      initVal: card.extraAction || '',
      tooltip: '绑定不选行的按钮,卡片尾部会增加功能卡片',
      required: false,
      options: [{
        value: 'true',
        text: '显示'
      }, {
        value: 'false',
        text: '隐藏'
      }]
      options: extraActions
    },
    {
      type: 'multiselect',
@@ -1691,6 +1607,15 @@
      initVal: card.blacklist || [],
      required: false,
      options: roleList
    },
    {
      type: 'multiselect',
      key: 'actions',
      label: '扩展按钮',
      initVal: card.actions || [],
      tooltip: '可绑定已有的excel导入、导出按钮',
      required: false,
      options: actions
    }
  ]
}
@@ -1868,10 +1793,10 @@
      forbid: !['line', 'bar'].includes(card.chartType),
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
@@ -1961,13 +1886,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
    }
@@ -1978,12 +1903,30 @@
 * @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 = []) {
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, subtable = false) {
  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 = []
  let _fieldlength = 50
@@ -1994,15 +1937,17 @@
    })
  }
  if (card.type === 'textarea' || card.type === 'fileupload' || card.type === 'multiselect') {
  if (['fileupload', 'multiselect', 'checkbox'].includes(card.type)) {
    _fieldlength = 512
  } else if (['textarea', 'brafteditor'].includes(card.type)) {
    _fieldlength = 8000
  }
  return [
    {
      type: 'text',
      key: 'label',
      label: Formdict['header.form.name'],
      label: Formdict['model.name'],
      initVal: card.label,
      required: true,
      readonly: false
@@ -2010,7 +1955,7 @@
    {
      type: 'text',
      key: 'field',
      label: Formdict['header.form.field'],
      label: Formdict['model.form.field'],
      initVal: card.field || '',
      required: true,
      readonly: false
@@ -2018,42 +1963,66 @@
    {
      type: 'select',
      key: 'type',
      label: Formdict['header.form.type'],
      label: Formdict['model.form.type'],
      initVal: card.type,
      required: true,
      options: [{
        value: 'text',
        text: Formdict['header.form.text']
        text: Formdict['model.form.text']
      }, {
        value: 'number',
        text: Formdict['header.form.number']
        text: Formdict['model.form.number']
      }, {
        value: 'select',
        text: Formdict['header.form.select']
        text: Formdict['model.form.select']
      }, {
        value: 'multiselect',
        text: Formdict['header.form.multiselect']
        text: Formdict['model.form.multiselect']
      }, {
        value: 'link',
        text: Formdict['header.form.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['header.form.dateday']
        text: Formdict['model.form.dateday']
      }, {
        value: 'datemonth',
        text: Formdict['header.form.datemonth']
        text: Formdict['model.form.datemonth']
      }, {
        value: 'datetime',
        text: Formdict['header.form.datetime']
        text: Formdict['model.form.datetime']
      }, {
        value: 'textarea',
        text: Formdict['header.form.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: '分隔线'
      },
      ..._openType]
    },
@@ -2061,7 +2030,44 @@
      type: 'text',
      key: 'initval',
      label: Formdict['header.form.initval'],
      tooltip: '下拉多选与多选框,添加多个初始值请使用“,”号分隔。注:下拉选择、联动菜单或单选框中$first表示选择第一项',
      initVal: card.initval || '',
      required: false
    },
    {
      type: 'textarea',
      key: 'message',
      label: '提示信息',
      initVal: card.message || '',
      required: true,
      readonly: false
    },
    {
      type: 'text',
      key: 'openVal',
      label: '开启值',
      initVal: card.openVal || '',
      required: false
    },
    {
      type: 'text',
      key: 'closeVal',
      label: '关闭值',
      initVal: card.closeVal || '',
      required: false
    },
    {
      type: 'text',
      key: 'openText',
      label: '开启提示',
      initVal: card.openText || '',
      required: false
    },
    {
      type: 'text',
      key: 'closeText',
      label: '关闭提示',
      initVal: card.closeText || '',
      required: false
    },
    {
@@ -2080,30 +2086,99 @@
    },
    {
      type: 'radio',
      key: 'setAll',
      label: Formdict['header.form.setAll'],
      initVal: card.setAll || 'false',
      key: 'display',
      label: '显示',
      initVal: card.display || 'text',
      required: true,
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        value: 'text',
        text: '文本'
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        value: 'picture',
        text: '图片'
      }]
    },
    {
      type: 'textarea',
      key: 'dataSource',
      label: Formdict['header.form.datasource'],
      initVal: card.dataSource || '',
      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: 'ratio',
      label: '图片比例',
      initVal: card.ratio || '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: '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',
      label: '字段集',
      initVal: card.fields || [],
      required: true,
      readonly: false
    },
    {
      type: 'options',
      key: 'options',
      label: '',
      label: '选项',
      initVal: card.options || [],
      required: true,
      readonly: false
    },
    {
      type: 'codemirror',
      key: 'dataSource',
      label: Formdict['header.form.datasource'],
      initVal: card.dataSource || '',
      required: true,
      readonly: false
    },
@@ -2154,8 +2229,25 @@
      }]
    },
    {
      type: 'radio',
      key: 'multiple',
      label: '可多选',
      initVal: card.multiple || 'false',
      required: true,
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'number',
      key: 'decimal',
      min: 0,
      max: 18,
      precision: 0,
      label: Formdict['header.form.decimal'],
      initVal: card.decimal || 0,
      required: true
@@ -2177,7 +2269,10 @@
    {
      type: 'number',
      key: 'fieldlength',
      label: Formdict['header.form.field.length'],
      min: 1,
      max: 1000000,
      precision: 0,
      label: Formdict['model.form.field'] + Formdict['model.length'],
      tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512',
      initVal: card.fieldlength || _fieldlength,
      required: false
@@ -2185,6 +2280,9 @@
    {
      type: 'number',
      key: 'maxRows',
      min: 2,
      max: 100,
      precision: 0,
      label: Formdict['header.form.maxRows'],
      initVal: card.maxRows || 6,
      required: false
@@ -2196,10 +2294,10 @@
      initVal: card.regular || '',
      options: [{
        value: '',
        text: Formdict['header.form.empty']
        text: Formdict['model.empty']
      }, {
        value: 'number',
        text: Formdict['header.form.number']
        text: Formdict['model.form.number']
      }, {
        value: 'letter',
        text: Formdict['header.form.letter']
@@ -2207,40 +2305,6 @@
        value: 'letter&number',
        text: Formdict['header.form.letter&number']
      }]
    },
    {
      type: 'select',
      key: 'supField',
      label: '上级表单',
      tooltip: '上级表单为下拉选择或关联菜单,设置上级表单后,该表单受控于上级菜单,注:受控关系在该表单隐藏时失效。',
      initVal: card.supField || '',
      required: false,
      readonly: false,
      options: linksupFields
    },
    {
      type: 'text',
      key: 'supvalue',
      label: '显示值',
      tooltip: '选择上级表单后,填写显示值,只有上级表单值与显示值相同时,该表单才会显示,注:多个值用逗号分隔。',
      initVal: card.supvalue || '',
      required: true,
      readonly: false
    },
    {
      type: 'select',
      key: 'quick',
      label: Formdict['header.form.quickadd'],
      initVal: '',
      required: false,
      options: []
    },
    {
      type: 'multiselect',
      key: 'linkSubField',
      label: Formdict['header.form.linkForm'],
      initVal: card.linkSubField || [],
      options: inputfields
    },
    {
      type: 'select',
@@ -2261,9 +2325,25 @@
    {
      type: 'number',
      key: 'maxfile',
      min: 1,
      max: 1000000,
      precision: 0,
      label: '最大文件数',
      initVal: card.maxfile || '',
      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',
@@ -2272,36 +2352,36 @@
      initVal: card.readonly || 'false',
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'required',
      label: Formdict['header.form.field.required'],
      label: Formdict['model.required'],
      initVal: card.required || 'true',
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'hidden',
      label: Formdict['header.form.field.ishidden'],
      label: Formdict['model.hidden'],
      initVal: card.hidden || 'false',
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
@@ -2325,39 +2405,173 @@
      initVal: card.readin || 'true',
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'writein',
      label: '执行运算',
      tooltip: '表单提交时,是否将该字段值写入默认sql语句中。',
      initVal: card.writein || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.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: '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
    },
    {
      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
    },
    {
      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['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'interception',
      label: '截取',
      label: '截取空格',
      initVal: card.interception || 'false',
      tooltip: '提交时,是否截取首尾的空白字符。',
      options: [{
        value: 'true',
        text: Formdict['header.form.true']
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['header.form.false']
        text: Formdict['model.false']
      }]
    },
    {
      type: 'select',
      key: 'supField',
      label: '上级表单',
      tooltip: '上级表单为下拉选择、联动菜单、单选框及多选框,添加后该表单显示及隐藏将受上级表单控制,注:受控关系在该表单隐藏时失效。',
      initVal: card.supField || '',
      required: false,
      readonly: false,
      options: linksupFields
    },
    {
      type: 'text',
      key: 'supvalue',
      label: '显示值',
      tooltip: '请填写显示值,只有上级表单值与显示值相同时,该表单才会显示,注:多个值用逗号分隔。',
      initVal: card.supvalue || '',
      required: true,
      readonly: false
    },
    {
      type: 'text',
      key: 'tooltip',
      label: '悬浮提示',
      tooltip: '鼠标悬浮于提示文字上方时,显示提示信息。',
      initVal: card.tooltip || '',
      required: false
    },
    {
      type: 'text',
      key: 'extra',
      label: '底部提示',
      tooltip: '显示于表单底部。',
      initVal: card.extra || '',
      required: false
    },
    {
      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',
@@ -2388,17 +2602,17 @@
      initVal: card.label || '',
      required: true
    },
    {
      type: 'select',
      key: 'type',
      label: Formdict['header.form.tabType'],
      initVal: card.type || 'SubTable',
      required: true,
      options: [{
        value: 'SubTable',
        text: Formdict['header.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',
@@ -2410,12 +2624,12 @@
    {
      type: 'select',
      key: 'icon',
      label: Formdict['header.menu.icon'],
      label: Formdict['model.icon'],
      initVal: card.icon || '',
      required: false,
      options: [{
        value: '',
        text: Formdict['header.form.empty']
        text: Formdict['model.empty']
      }, {
        value: 'table',
        text: 'table'
@@ -2428,7 +2642,8 @@
      }, {
        value: 'line-chart',
        text: 'line-chart'
      }]
      }],
      forbid: type === 'CalendarPage'
    },
    {
      type: 'select',
@@ -2436,7 +2651,8 @@
      label: Formdict['header.form.supTab'],
      initVal: supMenu,
      required: false,
      options: menus
      options: menus,
      forbid: type === 'CalendarPage'
    },
    {
      type: 'mutilselect',
@@ -2445,7 +2661,8 @@
      tooltip: '如果子标签中含有刷新同级标签的按钮,在此处添加需要刷新的标签。',
      initVal: equalTab,
      required: false,
      options: equalTabs
      options: equalTabs,
      forbid: type === 'CalendarPage'
    },
    {
      type: 'text',
@@ -2453,7 +2670,8 @@
      label: '外键',
      tooltip: '外键旨在标签页中执行默认函数(添加)时,替换BID字段',
      initVal: card.foreignKey || '',
      required: false
      required: false,
      forbid: type === 'CalendarPage'
    },
    {
      type: 'number',
@@ -2473,7 +2691,7 @@
      initVal: card.searchPass || 'false',
      tooltip: '使用主表搜索条件时,主表的搜索条件会传入子表中。',
      required: false,
      forbid: type !== 'CommonTable',
      forbid: type !== 'CommonTable' && type !== 'CalendarPage',
      options: [{
        value: 'true',
        text: '使用'
@@ -2491,9 +2709,8 @@
 * @param {array}   _columns    // 显示列
 * @param {string}  _type       // 类型,卡片的部位
 * @param {array}   _actions    // 按钮列表
 * @param {boolean} isRatioCard // 表格宽度类型,是否为比例
 */
export function getCardDetailForm (card, _columns, _type, _actions = [], isRatioCard) {
export function getCardDetailForm (card, _columns, _type, _actions = []) {
  let actions = ''
  if (_type === 'bottom') {
    actions = card.actions ? card.actions.map(cell => cell.value) : []
@@ -2540,7 +2757,7 @@
      key: 'content',
      label: '内容',
      initVal: card.content || '',
      required: true,
      required: _type !== 'header',
      forbid: !['detail', 'header'].includes(_type),
    },
    {
@@ -2619,7 +2836,7 @@
      label: '宽度(%)',
      initVal: card.width || 100,
      required: true,
      forbid: !['detail'].includes(_type)
      forbid: !['detail', 'avatar'].includes(_type)
    },
    {
      type: 'number',
@@ -2630,34 +2847,6 @@
      initVal: card.height || 1,
      required: true,
      forbid: !['detail'].includes(_type)
    },
    {
      type: 'radio',
      key: 'widthType',
      label: '宽度设置',
      initVal: card.widthType || 'ratio',
      required: false,
      forbid: !['avatar'].includes(_type),
      hidden: true,
      readonly: !!isRatioCard,
      options: [{
        value: 'ratio',
        text: '比例'
      }, {
        value: 'absolute',
        text: '绝对值'
      }]
    },
    {
      type: 'number',
      key: 'width',
      label: '宽度值',
      initVal: card.width || 32,
      min: 1,
      max: card.widthType === 'ratio' ? 100 : 500,
      required: false,
      hidden: true,
      forbid: !['avatar'].includes(_type)
    },
    {
      type: 'radio',
@@ -2730,6 +2919,21 @@
        value: 'all',
        text: '全部'
      }]
    }
    },
    {
      type: 'radio',
      key: 'display',
      label: '显示',
      initVal: card.display || 'inline',
      required: false,
      forbid: !['avatar'].includes(_type),
      options: [{
        value: 'block',
        text: '整行'
      }, {
        value: 'inline',
        text: '自动'
      }]
    },
  ]
}