king
2023-03-02 d1f19b794216b37417e114b71c1cd7a2ac3d7748
src/templates/zshare/formconfig.jsx
@@ -1,8 +1,4 @@
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import { formRule, btnClasses } from '@/utils/option.js'
const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
/**
 * @description 获取树形页面设置表单配置信息
@@ -57,31 +53,32 @@
    {
      type: 'radio',
      key: 'interType',
      label: Formdict['header.form.intertype'],
      label: '接口类型',
      initVal: setting.interType || 'inner',
      required: false,
      readonly: false,
      options: [
        { value: 'inner', text: Formdict['model.interface.inner'] },
        { value: 'outer', text: Formdict['model.interface.outer'] }
        { value: 'inner', text: '内部' },
        { value: 'outer', text: '外部' }
      ]
    },
    {
      type: 'radio',
      key: 'sysInterface',
      label: Formdict['header.form.sysInterface'],
      label: '系统接口',
      initVal: setting.sysInterface || 'false',
      tooltip: '单点登录系统',
      required: false,
      readonly: false,
      options: [
        { value: 'true', text: Formdict['model.true'] },
        { value: 'false', text: Formdict['model.false'] }
        { value: 'true', text: '是' },
        { value: 'false', text: '否' }
      ]
    },
    {
      type: 'text',
      key: 'interface',
      label: Formdict['header.form.interface'],
      label: '接口地址',
      initVal: setting.sysInterface === 'true' ? (window.GLOB.mainSystemApi || '') : (setting.interface || ''),
      required: true,
      readonly: setting.sysInterface === 'true',
@@ -95,7 +92,7 @@
    {
      type: 'text',
      key: 'outerFunc',
      label: Formdict['header.form.outerFunc'],
      label: '外部函数',
      initVal: setting.outerFunc || '',
      required: false,
      readonly: false,
@@ -112,7 +109,7 @@
    {
      type: 'text',
      key: 'innerFunc',
      label: Formdict['header.form.innerFunc'],
      label: '内部函数',
      initVal: setting.innerFunc || '',
      tooltip: usefulFields.length ? '开头可用字符:' + usefulFields.join(', ') : '',
      placement: 'bottomLeft',
@@ -265,8 +262,8 @@
      required: false,
      readonly: false,
      options: [
        { value: 'true', text: Formdict['model.true'] },
        { value: 'false', text: Formdict['model.false'] }
        { value: 'true', text: '是' },
        { value: 'false', text: '否' }
      ]
    },
    {
@@ -277,8 +274,8 @@
      required: false,
      readonly: false,
      options: [
        { value: 'true', text: Formdict['model.true'] },
        { value: 'false', text: Formdict['model.false'] }
        { value: 'true', text: '是' },
        { value: 'false', text: '否' }
      ]
    }
  ]
@@ -289,7 +286,7 @@
 * @param {object} card           // 搜索条件对象
 * @param {Array}  linkableFields // 可关联字段
 */
export function getSearchForm (card, linkableFields, columns) {
export function getSearchForm (card, linkableFields, columns, position) {
  let roleList = sessionStorage.getItem('sysRoles')
  let appType = sessionStorage.getItem('appType')
  if (roleList) {
@@ -324,25 +321,22 @@
      text: '日期(天)'
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    // }, {
    //   value: 'daterange',
    //   text: Formdict['model.form.daterange']
      text: '日期(月)'
    }]
  } else {
    typeOptions = [{
      value: 'text',
      text: Formdict['model.form.text']
      text: '文本'
    }, {
      value: 'select',
      text: Formdict['model.form.select']
      text: '下拉选择'
    }, {
      value: 'multiselect',
      text: Formdict['model.form.multiselect']
      text: '下拉多选'
    }, {
      value: 'link',
      text: Formdict['model.form.link']
      text: '联动菜单'
    }, {
      value: 'checkcard',
      text: '选项卡'
@@ -354,13 +348,13 @@
      text: '日期(周)'
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
      text: '日期(月)'
    }, {
      value: 'daterange',
      text: Formdict['model.form.daterange']
      text: '日期(区间)'
    }, {
      value: 'group',
      text: Formdict['model.form.dategroup']
      text: '日期(组合)'
    }]
  }
@@ -390,14 +384,14 @@
    {
      type: 'text',
      key: 'label',
      label: Formdict['model.name'],
      label: '名称',
      initVal: card.label || '',
      required: true
    },
    {
      type: 'text',
      key: 'field',
      label: Formdict['model.form.field'],
      label: '字段',
      initVal: card.field || '',
      required: true,
      options: columns
@@ -405,7 +399,7 @@
    {
      type: 'select',
      key: 'type',
      label: Formdict['model.form.type'],
      label: '类型',
      initVal: card.type,
      required: true,
      options: typeOptions
@@ -420,7 +414,7 @@
    {
      type: 'text',
      key: 'initval',
      label: Formdict['header.form.initval'],
      label: '初始值',
      tooltip: '类型为下拉菜单时,初始值应为数据的Value值(使用数据源时,应为《值·字段》的值);类型为数值(区间)时,初始值使用逗号拼接,例如 3,10',
      initVal: card.initval,
      required: false
@@ -433,10 +427,10 @@
      required: true,
      options: [{
        value: '0',
        text: Formdict['header.form.custom']
        text: '自定义'
      }, {
        value: '1',
        text: Formdict['header.form.datasource']
        text: '数据源'
      }]
    },
    // {
@@ -446,10 +440,10 @@
    //   initVal: card.setAll || 'true',
    //   options: [{
    //     value: 'true',
    //     text: Formdict['model.true']
    //     text: '是'
    //   }, {
    //     value: 'false',
    //     text: Formdict['model.false']
    //     text: '否'
    //   }]
    // },
    {
@@ -495,6 +489,13 @@
      required: true
    },
    {
      type: 'text',
      key: 'colorField',
      label: '色值字段',
      initVal: card.colorField || '',
      required: true
    },
    {
      type: 'radio',
      key: 'picratio',
      label: '图片比例',
@@ -524,7 +525,7 @@
    {
      type: 'codemirror',
      key: 'dataSource',
      label: Formdict['header.form.datasource'],
      label: '数据源',
      initVal: card.dataSource || '',
      required: true
    },
@@ -612,34 +613,19 @@
      initVal: card.orderType || 'asc',
      options: [{
        value: 'asc',
        text: Formdict['header.form.asc']
        text: '正序'
      }, {
        value: 'desc',
        text: Formdict['header.form.desc']
        text: '倒序'
      }]
    },
    {
      type: 'select',
      key: 'match',
      label: Formdict['header.form.match'],
      label: '匹配模式',
      initVal: card.match || 'like',
      required: true,
      options: [{
        value: 'like',
        text: 'like'
      }, {
        value: 'equal',
        text: 'equal'
      }, {
        value: 'greater',
        text: '>'
      }, {
        value: 'less',
        text: '<'
      }, {
        value: 'greaterequal',
        text: '>='
      }]
      options: []
    },
    {
      type: 'radio',
@@ -659,7 +645,7 @@
      key: 'ratio',
      min: 1,
      max: 24,
      label: Formdict['header.form.ratio'],
      label: '比例',
      tooltip: '栅格布局,每行等分为24列。',
      initVal: card.ratio || 6,
      forbid: appType === 'mob',
@@ -699,27 +685,27 @@
    {
      type: 'radio',
      key: 'required',
      label: Formdict['model.required'],
      label: '必填',
      initVal: card.required || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
      type: 'radio',
      key: 'Hide',
      label: Formdict['model.hidden'],
      label: '隐藏',
      initVal: card.Hide || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
@@ -744,10 +730,10 @@
    //   tooltip: '数据查询时,类型字段是否作为参数传递,类型字段对应值为 {"日": "day", "周": "week", "月": "month", "季": "quarter", "年": "year", "自定义": "customized"}。',
    //   options: [{
    //     value: 'true',
    //     text: Formdict['model.true']
    //     text: '是'
    //   }, {
    //     value: 'false',
    //     text: Formdict['model.false']
    //     text: '否'
    //   }]
    // },
    {
@@ -794,13 +780,13 @@
      label: '高级搜索',
      initVal: card.advanced || 'false',
      tooltip: '在高级搜索以模态框或抽屉展开时,搜索条件在开发界面占比为6,实际效果请在运行时查看。',
      forbid: appType === 'mob',
      forbid: appType === 'mob' || position === 'header',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
@@ -860,7 +846,7 @@
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],
      label: '黑名单',
      initVal: card.blacklist || [],
      required: false,
      options: roleList || [],
@@ -882,31 +868,31 @@
  let opentypes = [
    {
      value: 'pop',
      text: Formdict['model.form.popform']
      text: '弹窗(表单)'
    }, {
      value: 'prompt',
      text: Formdict['model.form.prompt']
      text: '提示框'
    }, {
      value: 'exec',
      text: Formdict['model.form.exec']
      text: '直接执行'
    }, {
      value: 'excelIn',
      text: Formdict['model.form.excelIn']
      text: '导入Excel'
    }, {
      value: 'excelOut',
      text: Formdict['model.form.excelOut']
      text: '导出Excel'
    }, {
      value: 'popview',
      text: Formdict['model.form.popview']
      text: '弹窗(标签)'
    }, {
      value: 'tab',
      text: Formdict['model.form.tab']
      text: '标签页'
    }, {
      value: 'innerpage',
      text: Formdict['model.form.newpage']
      text: '新页面'
    }, {
      value: 'funcbutton',
      text: Formdict['model.form.funcbutton']
      text: '功能按钮'
    }
  ]
@@ -938,6 +924,8 @@
      value: 'equaltab',
      text: '刷新同级标签'
    })
  } else if (card.execSuccess === 'maingrid') {
    card.execSuccess = 'grid'
  }
  if (card.OpenType === 'blank') {
@@ -947,14 +935,26 @@
    card.control = 'disabled'
  }
  if (card.intertype === 'outer' && !card.procMode && !card.innerFunc) { // 兼容外部函数直传类型
    card.procMode = 'none'
  }
  return [
    {
      type: 'select',
      key: 'OpenType',
      label: Formdict['header.form.openType'],
      label: '打开方式',
      initVal: card.OpenType,
      required: true,
      options: opentypes
    },
    {
      type: 'text',
      key: 'label',
      label: '按钮名称',
      initVal: card.label,
      required: true,
      readonly: false
    },
    {
      type: 'select',
@@ -963,11 +963,14 @@
      initVal: card.funcType || '',
      required: true,
      options: [{
        value: 'changeuser',
        text: '切换用户'
      }, {
        value: 'print',
        text: '标签打印'
      }, {
        value: 'refund',
        text: '退款'
      }, {
        value: 'changeuser',
        text: '切换用户'
      }, {
        value: 'closetab',
        text: '标签关闭'
@@ -992,24 +995,24 @@
    {
      type: 'select',
      key: 'execMode',
      label: Formdict['model.form.execMode'],
      label: '执行方式',
      initVal: card.execMode || 'exec',
      required: true,
      options: [{
        value: 'exec',
        text: Formdict['model.form.exec']
        text: '直接执行'
      }, {
        value: 'prompt',
        text: Formdict['model.form.prompt']
        text: '提示框'
      }, {
        value: 'pop',
        text: Formdict['model.form.popform']
        text: '弹窗(表单)'
      }]
    },
    {
      type: 'radio',
      key: 'intertype',
      label: Formdict['header.form.intertype'],
      label: '接口类型',
      initVal: card.intertype || 'system',
      required: true,
      options: []
@@ -1018,7 +1021,8 @@
      type: 'radio',
      key: 'procMode',
      label: '参数处理',
      initVal: card.procMode || 'system',
      initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'),
      tooltip: '当返回值存在 mk_ex_invoke 且值为 false 时,不会调用外部接口。',
      required: true,
      options: [{
        value: 'system',
@@ -1026,35 +1030,30 @@
      }, {
        value: 'inner',
        text: '内部函数'
      }, {
        value: 'none',
        text: '无'
      }]
    },
    {
      type: 'radio',
      key: 'sqlType',
      label: Formdict['header.form.action.type'],
      label: '操作类型',
      initVal: card.sqlType || '',
      required: true,
      options: []
    },
    {
      type: 'text',
      key: 'label',
      label: '按钮名称',
      initVal: card.label,
      required: true,
      readonly: false
    },
    {
      type: 'text',
      key: 'sql',
      label: Formdict['model.form.tablename'],
      label: '表名',
      initVal: card.sql || config.setting.tableName || '',
      required: true
    },
    {
      type: 'text',
      key: 'innerFunc',
      label: Formdict['header.form.innerFunc'],
      label: '内部函数',
      initVal: card.innerFunc || '',
      tooltip: usefulFields.length ? `函数名称需以${usefulFields.join(', ')}等字符开始。` : '',
      fields: usefulFields,
@@ -1087,7 +1086,7 @@
    {
      type: 'select',
      key: 'pageTemplate',
      label: Formdict['model.form.newpage.type'],
      label: '页面类型',
      initVal: card.pageTemplate || '',
      required: true,
      options: [{
@@ -1101,10 +1100,10 @@
        text: '单据打印'
      }, {
        value: 'pay',
        text: Formdict['model.pay']
        text: '支付'
      }, {
        value: 'custom',
        text: Formdict['header.form.custom']
        text: '自定义'
      }]
    },
    {
@@ -1118,28 +1117,29 @@
    {
      type: 'text',
      key: 'url',
      label: Formdict['model.pageUrl'],
      label: '页面地址',
      initVal: card.url || '',
      required: true
    },
    {
      type: 'radio',
      key: 'sysInterface',
      label: Formdict['header.form.sysInterface'],
      label: '系统接口',
      initVal: card.sysInterface || 'false',
      tooltip: '单点登录系统',
      required: true,
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
      type: 'text',
      key: 'outerFunc',
      label: Formdict['header.form.outerFunc'],
      label: '外部函数',
      initVal: card.outerFunc || '',
      required: false,
      readonly: false
@@ -1193,7 +1193,7 @@
      type: 'radio',
      key: 'callbackType',
      label: '回调方式',
      initVal: card.callbackType || 'script',
      initVal: card.callbackType || (card.callbackFunc ? 'func' : 'none'),
      tooltip: '使用后台脚本执行时,需要配合计划任务。',
      required: true,
      options: [{
@@ -1202,6 +1202,12 @@
      }, {
        value: 'default',
        text: '后台脚本'
      }, {
        value: 'func',
        text: '回调函数'
      }, {
        value: 'none',
        text: '无'
      }]
    },
    {
@@ -1214,9 +1220,9 @@
    {
      type: 'text',
      key: 'callbackFunc',
      label: Formdict['header.form.callbackFunc'],
      label: '回调函数',
      initVal: card.callbackFunc || '',
      required: false,
      required: true,
      readonly: false
    },
    {
@@ -1227,16 +1233,16 @@
      required: true,
      options: [{
        value: 'toolbar',
        text: Formdict['header.form.toolbar']
        text: '工具栏'
      }, {
        value: 'grid',
        text: Formdict['header.form.grid']
        text: '表格'
      }]
    },
    {
      type: 'select',
      key: 'Ot',
      label: Formdict['header.form.isRequired'],
      label: '行设置',
      initVal: card.Ot || 'requiredSgl',
      required: true,
      options: []
@@ -1244,7 +1250,7 @@
    {
      type: 'cascader',
      key: 'linkmenu',
      label: Formdict['model.form.linkmenu'],
      label: '关联菜单',
      initVal: card.linkmenu || [],
      required: true,
      options: menulist
@@ -1260,9 +1266,9 @@
    {
      type: refresh.length === 0 ? 'radio' : 'select',
      key: 'execSuccess',
      label: Formdict['model.form.afterSuccess'],
      label: '成功后',
      initVal: card.execSuccess || 'grid',
      tooltip: '选择刷新行时,如果选择多条数据会刷新表格。',
      tooltip: '选择刷新行时,如果选择多条数据会刷新表格。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。',
      required: true,
      options: [{
        value: 'never',
@@ -1279,9 +1285,9 @@
    {
      type: refresh.length === 0 ? 'radio' : 'select',
      key: 'execError',
      label: Formdict['model.form.afterError'],
      label: '失败后',
      initVal: card.execError || 'never',
      tooltip: '选择刷新行时,如果选择多条数据会刷新表格。',
      tooltip: '选择刷新行时,如果选择多条数据会刷新表格。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。',
      required: true,
      options: [{
        value: 'never',
@@ -1298,7 +1304,7 @@
    {
      type: refresh.length === 0 ? 'radio' : 'select',
      key: 'popClose',
      label: Formdict['header.form.popClose'],
      label: '关闭后',
      initVal: card.popClose || 'never',
      required: true,
      options: [{
@@ -1327,14 +1333,14 @@
    {
      type: 'icon',
      key: 'icon',
      label: Formdict['model.icon'],
      label: '图标',
      initVal: card.icon,
      required: false
    },
    {
      type: 'select',
      key: 'class',
      label: Formdict['model.form.color'],
      label: '颜色',
      initVal: card.class,
      required: false,
      options: btnClasses
@@ -1352,7 +1358,7 @@
      type: 'text',
      key: 'output',
      label: '返回值',
      tooltip: '执行成功后的返回值。系统函数可指定返回的变量(以@符开头,如@id);自定义函数可指定返回字段(如id)。',
      tooltip: '执行成功后的返回值。系统函数可指定返回的变量(以@符开头,返回id时可使用@id@);自定义函数可指定返回字段(如id)。',
      initVal: card.output || '',
      required: false
    },
@@ -1367,21 +1373,21 @@
    {
      type: 'radio',
      key: 'joint',
      label: Formdict['model.form.paramJoint'],
      label: '拼接参数',
      initVal: card.joint || 'true',
      required: false,
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
      type: 'text',
      key: 'sheet',
      label: Formdict['model.form.tablename'],
      label: '表名',
      initVal: card.sheet || config.setting.tableName || '',
      required: true
    },
@@ -1393,10 +1399,10 @@
      required: false,
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
@@ -1441,7 +1447,7 @@
    {
      type: 'radio',
      key: 'placement',
      label: '抽屉方向',
      label: '弹出方向',
      initVal: card.placement || 'right',
      required: false,
      options: [{
@@ -1580,14 +1586,14 @@
    {
      type: 'text',
      key: 'label',
      label: Formdict['model.name'],
      label: '名称',
      initVal: card.label,
      required: true
    },
    {
      type: 'text',
      key: 'field',
      label: Formdict['model.form.field'],
      label: '字段',
      initVal: card.field,
      required: true,
      readonly: false
@@ -1595,24 +1601,27 @@
    {
      type: 'select',
      key: 'type',
      label: Formdict['model.form.type'],
      label: '类型',
      initVal: card.type,
      required: true,
      options: [{
        value: 'text',
        text: Formdict['model.form.text']
        text: '文本'
      }, {
        value: 'number',
        text: Formdict['model.form.number']
        text: '数字'
      }, {
        value: 'picture',
        text: Formdict['model.form.picture']
        text: '图片'
      }, {
        value: 'video',
        text: '视频'
      }, {
        value: 'link',
        text: Formdict['model.form.href']
        text: '链接'
      }, {
        value: 'textarea',
        text: Formdict['model.form.textarea']
        text: '多行文本'
      }, {
        value: 'index',
        text: '序号'
@@ -1621,7 +1630,7 @@
    {
      type: 'text',
      key: 'nameField',
      label: Formdict['model.name'] + Formdict['model.form.field'],
      label: '名称字段',
      initVal: card.nameField,
      required: false,
      readonly: false
@@ -1632,68 +1641,88 @@
      min: 1,
      max: 1000,
      decimal: 0,
      label: Formdict['model.form.columnWidth'],
      label: '列宽',
      initVal: card.Width,
      required: true
    },
    {
      type: 'radio',
      key: 'joint',
      label: Formdict['model.form.paramJoint'],
      label: '拼接参数',
      initVal: card.joint || 'true',
      required: true,
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
      type: 'radio',
      key: 'Hide',
      label: Formdict['model.hidden'],
      label: '隐藏',
      initVal: card.Hide || 'false',
      required: true,
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
      type: 'radio',
      key: 'IsSort',
      label: Formdict['model.sort'],
      label: '排序',
      initVal: card.IsSort || 'true',
      required: true,
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
      type: 'radio',
      key: 'Align',
      label: Formdict['model.form.align'],
      label: '对齐方式',
      initVal: card.Align || 'left',
      required: true,
      options: [{
        value: 'left',
        text: Formdict['model.form.alignLeft']
        text: '左对齐'
      }, {
        value: 'center',
        text: Formdict['model.form.alignCenter']
        text: '居中'
      }, {
        value: 'right',
        text: Formdict['model.form.alignRight']
        text: '右对齐'
      }]
    },
    {
      type: 'number',
      key: 'startTime',
      precision: 0,
      label: '开始时间',
      initVal: card.startTime || 0,
      tooltip: '视频开始播放的时间,用于调整视频初始化展示的界面。',
      required: false
    },
    {
      type: 'select',
      key: 'aspectRatio',
      label: '长宽比',
      initVal: card.aspectRatio || '16:9',
      required: true,
      options: [
        { value: '4:3', text: '4:3' },
        { value: '16:9', text: '16:9' }
      ]
    },
    {
      type: 'radio',
@@ -1704,10 +1733,10 @@
      required: false,
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
@@ -1719,10 +1748,10 @@
      required: false,
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
@@ -1731,25 +1760,25 @@
      min: 0,
      max: 18,
      decimal: 0,
      label: Formdict['header.form.decimal'],
      label: '小数位',
      initVal: card.decimal || 0,
      required: true
    },
    {
      type: 'number',
      key: 'fieldlength',
      label: Formdict['model.form.field'] + Formdict['model.length'],
      label: '字段长度',
      initVal: card.fieldlength || (card.type === 'text' ? 50 : 512),
      required: true
    },
    {
      type: 'select',
      key: 'format',
      label: Formdict['header.form.format'],
      initVal: card.format || '',
      label: '格式化',
      initVal: card.format || 'none',
      options: [{
        value: '',
        text: Formdict['model.empty']
        value: 'none',
        text: '无'
      }, {
        value: 'thdSeparator',
        text: '千分位'
@@ -1765,11 +1794,14 @@
    {
      type: 'select',
      key: 'textFormat',
      label: Formdict['header.form.format'],
      initVal: card.textFormat || '',
      label: '格式化',
      initVal: card.textFormat || 'none',
      options: [{
        value: '',
        text: Formdict['model.empty']
        value: 'none',
        text: '无'
      }, {
        value: 'encryption',
        text: '加密'
      }, {
        value: 'YYYY-MM-DD',
        text: 'YYYY-MM-DD'
@@ -1782,7 +1814,7 @@
    {
      type: 'text',
      key: 'prefix',
      label: Formdict['header.form.prefix'],
      label: '前缀',
      initVal: card.prefix || '',
      required: false,
      readonly: false
@@ -1790,7 +1822,7 @@
    {
      type: 'text',
      key: 'postfix',
      label: Formdict['header.form.postfix'],
      label: '后缀',
      initVal: card.postfix || '',
      tooltipClass: 'middle',
      required: false,
@@ -1798,15 +1830,39 @@
    },
    {
      type: 'number',
      key: 'maxHeight',
      key: 'span',
      min: 1,
      max: 1000,
      decimal: 0,
      label: '最大高度',
      tooltip: '图片在表格中显示的最大高度',
      tooltipClass: 'middle',
      initVal: card.maxHeight || 128,
      max: 24,
      precision: 0,
      label: '图片宽度',
      initVal: card.span || 24,
      tooltip: '栅格布局,等分为24份。',
      required: true
    },
    {
      type: 'select',
      key: 'lenWidRadio',
      label: '长宽比',
      initVal: card.lenWidRadio || '1:1',
      required: true,
      options: [
        { value: '1:1', text: '1:1' },
        { value: '4:3', text: '4:3' },
        { value: '3:2', text: '3:2' },
        { value: '16:9', text: '16:9' },
        { value: '2:1', text: '2:1' },
        { value: '3:1', text: '3:1' },
        { value: '4:1', text: '4:1' },
        { value: '5:1', text: '5:1' },
        { value: '6:1', text: '6:1' },
        { value: '7:1', text: '7:1' },
        { value: '8:1', text: '8:1' },
        { value: '9:1', text: '9:1' },
        { value: '10:1', text: '10:1' },
        { value: '3:4', text: '3:4' },
        { value: '2:3', text: '2:3' },
        { value: '9:16', text: '9:16' },
      ]
    },
    {
      type: 'radio',
@@ -1816,10 +1872,10 @@
      required: false,
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
@@ -1841,7 +1897,7 @@
    {
      type: 'cascader',
      key: 'linkmenu',
      label: Formdict['model.menu'],
      label: '菜单',
      initVal: card.linkmenu || [],
      required: true,
      options: menulist
@@ -1864,7 +1920,7 @@
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],
      label: '黑名单',
      initVal: card.blacklist || [],
      required: false,
      options: roleList
@@ -1916,7 +1972,7 @@
    {
      type: 'text',
      key: 'title',
      label: Formdict['header.form.title'],
      label: '标题',
      initVal: card.title,
      required: false
    },
@@ -1942,15 +1998,15 @@
    {
      type: 'radio',
      key: 'Hide',
      label: Formdict['model.hidden'],
      label: '隐藏',
      initVal: card.Hide,
      required: true,
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
@@ -2028,7 +2084,7 @@
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],
      label: '黑名单',
      initVal: card.blacklist || [],
      required: false,
      options: roleList
@@ -2218,10 +2274,10 @@
      forbid: !['line', 'bar'].includes(card.chartType),
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
@@ -2327,12 +2383,12 @@
/**
 * @description 获取表单配置信息
 * @param {*} card            // 表单对象
 * @param {*} inputfields     // 可关联表单
 * @param {*} inputfields     // 可写入表单
 * @param {*} tabfields       // 可切换表单
 * @param {*} linkableFields  // 可关联表单
 * @param {*} linksupFields   // 上级表单
 */
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields) {
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, columns = []) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
@@ -2351,22 +2407,46 @@
  } else {
    roleList = []
  }
  inputfields = inputfields.map((item, index) => {
    item.label = `${index + 1}、${item.field || ''}(${item.label})`
    return item
  })
  tabfields = tabfields.map((item, index) => {
    item.label = `${index + 1}、${item.field || ''}(${item.label})`
    return item
  })
  tabfields.unshift({field: '', label: '原表单'})
  linkableFields = linkableFields.map((item, index) => {
    item.label = `${index + 1}、${item.field || ''}(${item.label})`
    return item
  })
  linksupFields = linksupFields.map((item, index) => {
    item.label = `${index + 1}、${item.field || ''}(${item.label})`
    return item
  })
  
  let _openType = [{
    value: 'text',
    text: Formdict['model.form.text']
    text: '文本'
  }, {
    value: 'number',
    text: Formdict['model.form.number']
    text: '数字'
  }, {
    value: 'select',
    text: Formdict['model.form.select']
    text: '下拉选择'
  }, {
    value: 'textarea',
    text: '多行文本'
  }, {
    value: 'multiselect',
    text: Formdict['model.form.multiselect']
    text: '下拉多选'
  }, {
    value: 'link',
    text: Formdict['model.form.link']
    text: '联动菜单'
  }, {
    value: 'switch',
    text: '开关'
@@ -2387,13 +2467,10 @@
    text: '日期(天)'
  }, {
    value: 'datemonth',
    text: Formdict['model.form.datemonth']
    text: '日期(月)'
  // }, {
  //   value: 'datetime',
  //   text: '日期(分/秒)'
  }, {
    value: 'textarea',
    text: Formdict['model.form.textarea']
  }, {
    value: 'cascader',
    text: '级联菜单'
@@ -2402,13 +2479,13 @@
    text: '评分'
  }, {
    value: 'color',
    text: Formdict['model.form.color']
    text: '颜色'
  }, {
    value: 'brafteditor',
    text: '富文本'
  }, {
    value: 'funcvar',
    text: Formdict['header.form.funcvar']
    text: '函数变量'
  }, {
    value: 'hint',
    text: '提示'
@@ -2428,16 +2505,19 @@
  if (appType === 'mob') {
    _openType = [{
      value: 'text',
      text: Formdict['model.form.text']
      text: '文本'
    }, {
      value: 'number',
      text: Formdict['model.form.number']
      text: '数字'
    }, {
      value: 'select',
      text: '选择器'
    }, {
      value: 'link',
      text: Formdict['model.form.link']
      text: '联动菜单'
    }, {
      value: 'textarea',
      text: '多行文本'
    }, {
      value: 'switch',
      text: '开关'
@@ -2458,13 +2538,7 @@
      text: '日期(天)'
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    // }, {
    //   value: 'datetime',
    //   text: '日期(分/秒)'
    }, {
      value: 'textarea',
      text: Formdict['model.form.textarea']
      text: '日期(月)'
    }, {
      value: 'cascader',
      text: '级联菜单'
@@ -2473,7 +2547,7 @@
      text: '评分'
    }, {
      value: 'funcvar',
      text: Formdict['header.form.funcvar']
      text: '函数变量'
    }, {
      value: 'hint',
      text: '提示'
@@ -2523,7 +2597,7 @@
    {
      type: 'text',
      key: 'label',
      label: Formdict['model.name'],
      label: '名称',
      initVal: card.label,
      required: true,
      readonly: false
@@ -2531,15 +2605,16 @@
    {
      type: 'text',
      key: 'field',
      label: Formdict['model.form.field'],
      label: '字段',
      initVal: card.field || '',
      required: true,
      readonly: false
      readonly: false,
      options: columns
    },
    {
      type: 'select',
      key: 'type',
      label: Formdict['model.form.type'],
      label: '类型',
      initVal: card.type,
      required: true,
      options: _openType
@@ -2547,7 +2622,7 @@
    {
      type: 'text',
      key: 'initval',
      label: Formdict['header.form.initval'],
      label: '初始值',
      initVal: initval,
      required: false
    },
@@ -2646,6 +2721,13 @@
      readonly: false
    },
    {
      type: 'text',
      key: 'colorField',
      label: '色值字段',
      initVal: card.colorField || '',
      required: true
    },
    {
      type: 'radio',
      key: 'picratio',
      label: '图片比例',
@@ -2672,10 +2754,10 @@
    //   initVal: card.setAll || 'false',
    //   options: [{
    //     value: 'true',
    //     text: Formdict['model.true']
    //     text: '是'
    //   }, {
    //     value: 'false',
    //     text: Formdict['model.false']
    //     text: '否'
    //   }]
    // },
    {
@@ -2697,7 +2779,7 @@
    {
      type: 'codemirror',
      key: 'dataSource',
      label: Formdict['header.form.datasource'],
      label: '数据源',
      initVal: card.dataSource || '',
      required: true,
      readonly: false
@@ -2765,10 +2847,10 @@
      initVal: card.orderType || 'asc',
      options: [{
        value: 'asc',
        text: Formdict['header.form.asc']
        text: '正序'
      }, {
        value: 'desc',
        text: Formdict['header.form.desc']
        text: '倒序'
      }]
    },
    {
@@ -2931,7 +3013,7 @@
      type: 'text',
      key: 'separator',
      label: '连接符',
      initVal: card.separator || card.separator === undefined ? '/' : '',
      initVal: card.separator === undefined ? '/' : card.separator,
      tooltip: '表单提交时信息之间的连接符。注:连接符为空时,初始化时填充其他表单无效。',
      required: false,
      readonly: false
@@ -2956,7 +3038,7 @@
      min: 0,
      max: 18,
      precision: 0,
      label: Formdict['header.form.decimal'],
      label: '小数位',
      initVal: card.decimal || 0,
      required: true
    },
@@ -2966,7 +3048,7 @@
      min: 1,
      max: 100000,
      precision: 0,
      label: Formdict['model.form.field'] + Formdict['model.length'],
      label: '字段长度',
      // tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512',
      initVal: card.fieldlength || _fieldlength,
      required: true
@@ -2997,8 +3079,11 @@
        value: 'letter',
        text: '字母'
      }, {
        value: 'letter_number',
        text: '数字或字母'
      }, {
        value: 'letter&number',
        text: '数字、字母以及_@_.'
        text: '数字、字母以及@_.'
      }, {
        value: 'phone',
        text: '手机号'
@@ -3039,15 +3124,15 @@
    },
    {
      type: 'radio',
      key: 'allowHalf',
      label: '半选',
      initVal: card.allowHalf || 'false',
      key: 'hidden',
      label: "隐藏",
      initVal: card.hidden || 'false',
      options: [{
        value: 'true',
        text: '支持'
        text: '是'
      }, {
        value: 'false',
        text: '不支持'
        text: '否'
      }]
    },
    {
@@ -3057,36 +3142,23 @@
      initVal: card.readonly || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
      type: 'radio',
      key: 'required',
      label: Formdict['model.required'],
      label: "必填",
      initVal: card.required || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'hidden',
      label: Formdict['model.hidden'],
      initVal: card.hidden || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
@@ -3137,14 +3209,14 @@
      type: 'radio',
      key: 'readin',
      label: '自动填充',
      tooltip: '是否将表格选中的数据自动填充到表单(字段相同)',
      tooltip: '将表格选中的数据自动填充到表单中。注:在批量操作时,如想要所选行(当前字段)全部修改请设为否或首行。',
      initVal: card.readin || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }, {
        value: 'top',
        text: '首行'
@@ -3158,11 +3230,44 @@
      initVal: card.writein || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
      type: 'radio',
      key: 'colorType',
      label: '颜色类型',
      initVal: card.colorType || 'hex',
      options: [{
        value: 'hex',
        text: '16进制'
      }, {
        value: 'rgba',
        text: 'RGBA'
      }]
    },
    {
      type: 'radio',
      key: 'allowHalf',
      label: '半选',
      initVal: card.allowHalf || 'false',
      options: [{
        value: 'true',
        text: '支持'
      }, {
        value: 'false',
        text: '不支持'
      }]
    },
    {
      type: 'color',
      key: 'color',
      label: '颜色',
      initVal: card.color || '#fadb14',
      required: true
    },
    {
      type: 'number',
@@ -3203,10 +3308,10 @@
      initVal: card.hidelabel || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
@@ -3267,12 +3372,30 @@
      key: 'encryption',
      label: '加密传输',
      initVal: card.type === 'brafteditor' ? (card.encryption || 'true') : (card.encryption || 'false'),
      tooltip: '使用md5加密时,加密前内容会转为小写,加密后的md5值为32位大写。',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '无'
      }, {
        value: 'true',
        text: 'base64加密'
      }, {
        value: 'md5',
        text: 'md5加密'
      }]
    },
    {
      type: 'radio',
      key: 'inputType',
      label: '加密显示',
      initVal: card.inputType || 'text',
      required: false,
      options: [{
        value: 'text',
        text: '否'
      }, {
        value: 'password',
        text: '是'
      }]
    },
    {
@@ -3283,10 +3406,10 @@
      tooltip: '提交时,是否截取首尾的空白字符。',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '是'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '否'
      }]
    },
    {
@@ -3372,13 +3495,16 @@
      tooltip: '文件压缩或base64必须为图片,图片格式为jpg、png、gif 或 jpeg。注:base64只可上传一张图片。',
      options: [{
        value: 'false',
        text: '无'
        text: '默认'
      }, {
        value: 'true',
        text: '压缩'
      }, {
        value: 'base64',
        text: 'base64'
      }, {
        value: 'oss',
        text: 'oss上传'
      }]
    },
    {
@@ -3391,6 +3517,119 @@
      initVal: card.limit || 2,
      tooltip: '压缩起点,小于起点值的文件不进行压缩。',
      required: true
    },
    {
      type: 'radio',
      key: 'miniSet',
      label: '小程序设置',
      initVal: card.miniSet || 'default',
      options: [{
        value: 'default',
        text: '默认'
      }, {
        value: 'custom',
        text: '自定义'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'checkbox',
      key: 'mediaType',
      label: '文件类型',
      initVal: card.mediaType || ['image', 'video'],
      options: [{
        value: 'image',
        text: '图片'
      }, {
        value: 'video',
        text: '视频'
      }],
      required: true,
      forbid: appType !== 'mob'
    },
    {
      type: 'checkbox',
      key: 'sourceType',
      label: '文件来源',
      initVal: card.sourceType || ['album', 'camera'],
      options: [{
        value: 'album',
        text: '相册选择'
      }, {
        value: 'camera',
        text: '相机拍摄'
      }],
      required: true,
      forbid: appType !== 'mob'
    },
    {
      type: 'radio',
      key: 'sizeType',
      label: '图片压缩',
      initVal: card.sizeType || 'compressed',
      options: [{
        value: 'compressed',
        text: '是'
      }, {
        value: 'original',
        text: '否'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'number',
      key: 'maxDuration',
      label: '拍摄时长',
      initVal: card.maxDuration || 10,
      tooltip: '拍摄视频最长拍摄时间,单位秒。时间范围为 3s 至 60s 之间。不限制相册。',
      min: 3,
      max: 60,
      precision: 0,
      required: true,
      forbid: appType !== 'mob'
    },
    {
      type: 'radio',
      key: 'camera',
      label: '摄像头',
      initVal: card.camera || 'back',
      options: [{
        value: 'back',
        text: '后置'
      }, {
        value: 'front',
        text: '前置'
      }],
      forbid: appType !== 'mob'
    },
    {
      type: 'number',
      key: 'maxSize',
      min: 0.01,
      max: 1024,
      precision: 2,
      label: '最大值(M)',
      initVal: card.maxSize,
      tooltip: '文件最大值,超出时不允许上传,值为空时不限制。',
      required: false
    },
    {
      type: 'radio',
      key: 'lenControl',
      label: '长度控制',
      initVal: card.lenControl || 'limit',
      tooltip: '在设置字段长度后,对长度的控制方式。',
      required: false,
      options: [{
        value: 'limit',
        text: '限制输入'
      }, {
        value: 'left',
        text: '左截'
      }, {
        value: 'right',
        text: '右截'
      }]
    },
    {
      type: 'number',
@@ -3424,24 +3663,6 @@
      }, {
        value: 6,
        text: 6
      }]
    },
    {
      type: 'radio',
      key: 'lenControl',
      label: '长度控制',
      initVal: card.lenControl || 'limit',
      tooltip: '在设置字段长度后,对长度的控制方式。',
      required: false,
      options: [{
        value: 'limit',
        text: '限制输入'
      }, {
        value: 'left',
        text: '左截'
      }, {
        value: 'right',
        text: '右截'
      }]
    },
    {
@@ -3509,6 +3730,24 @@
    },
    {
      type: 'text',
      key: 'regularExtra',
      label: '正则扩展符',
      initVal: card.regularExtra || '',
      tooltip: '正则验证时允许添加的自定义字符,包括~!@#$%^&*()_+:;{}<>,.-',
      required: false,
      readonly: false
    },
    {
      type: 'text',
      key: 'regularText',
      label: '正则提示',
      initVal: card.regularText || '',
      tooltip: '正则验证时的提示信息。',
      required: false,
      readonly: false
    },
    {
      type: 'text',
      key: 'tooltip',
      label: '悬浮提示',
      tooltip: '鼠标悬浮于提示文字上方时,显示提示信息。',
@@ -3544,7 +3783,7 @@
    {
      type: 'text',
      key: 'placeholder',
      label: '提示信息',
      label: '输入提示',
      tooltip: '字段预期值的提示信息。',
      initVal: card.placeholder || '',
      required: false
@@ -3613,9 +3852,21 @@
    //   forbid: appType !== 'mob'
    // },
    {
      type: 'radio',
      key: 'empty',
      label: '空值隐藏',
      initVal: card.empty || 'show',
      tooltip: '当选项为空时,隐藏该表单。',
      required: false,
      options: [
        {value: 'show', text: '否'},
        {value: 'hidden', text: '是'},
      ]
    },
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],
      label: '黑名单',
      initVal: card.blacklist || [],
      required: false,
      options: roleList,
@@ -3638,14 +3889,14 @@
    {
      type: 'text',
      key: 'label',
      label: Formdict['header.menu.tabName'],
      label: '标签名称',
      initVal: card.label || '',
      required: true
    },
    {
      type: 'select',
      key: 'linkTab',
      label: Formdict['header.form.linkTab'],
      label: '关联标签',
      initVal: card.linkTab || '',
      required: false,
      options: []
@@ -3653,7 +3904,7 @@
    {
      type: 'icon',
      key: 'icon',
      label: Formdict['model.icon'],
      label: '图标',
      initVal: card.icon || '',
      required: false,
      forbid: type === 'CalendarPage'
@@ -3661,7 +3912,7 @@
    {
      type: 'select',
      key: 'supMenu',
      label: Formdict['header.form.supTab'],
      label: '上级标签',
      initVal: supMenu,
      required: false,
      options: menus,
@@ -3670,7 +3921,7 @@
    {
      type: 'mutilselect',
      key: 'equalTab',
      label: Formdict['header.form.equalTab'],
      label: '同级标签',
      tooltip: '如果子标签中含有刷新同级标签的按钮,在此处添加需要刷新的标签。',
      initVal: equalTab,
      required: false,