king
2021-11-17 c51f5e007a3e03c9d6731ab7f28f0080de009990
src/templates/zshare/formconfig.jsx
@@ -314,9 +314,9 @@
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    }, {
      value: 'daterange',
      text: Formdict['model.form.daterange']
    // }, {
    //   value: 'daterange',
    //   text: Formdict['model.form.daterange']
    }]
  } else {
    typeOptions = [{
@@ -678,6 +678,20 @@
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'query',
      label: '参与查询',
      initVal: card.query || 'true',
      tooltip: '是否作为 where 条件,参与数据查询。',
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    // {
    //   type: 'radio',
    //   key: 'transfer',
@@ -720,14 +734,14 @@
    {
      type: 'radio',
      key: 'labelShow',
      label: '显示名称',
      label: '名称',
      initVal: card.labelShow || 'true',
      options: [{
        value: 'true',
        text: Formdict['model.true']
        text: '显示'
      }, {
        value: 'false',
        text: Formdict['model.false']
        text: '隐藏'
      }]
    },
    {
@@ -746,11 +760,25 @@
    },
    {
      type: 'radio',
      key: 'dropdown',
      label: '下拉框',
      initVal: card.dropdown || 'true',
      forbid: appType === 'mob',
      options: [{
        value: 'true',
        text: '定宽'
      }, {
        value: 'false',
        text: '自适应'
      }]
    },
    {
      type: 'radio',
      key: 'inputType',
      label: '输入样式',
      initVal: card.inputType || 'input',
      tooltip: '使用高级搜索时无效。',
      required: false,
      forbid: appType === null,
      options: [{
        value: 'input',
        text: '输入框'
@@ -826,19 +854,10 @@
    }
  ]
  // 标签类型,主表才会存在表单标签页
  let tabTems = [{
    value: 'FormTab',
    text: '表单标签页'
  }]
  if (type === 'subtable') {
    tabTems = []
  }
  if (card.execSuccess === 'view' || card.execSuccess === 'refresh') { // refresh为表单标签页
    card.execSuccess = 'grid'
  }
  if (card.execError === 'view' || card.execSuccess === 'refresh') {
  if (card.execError === 'view' || card.execError === 'refresh') {
    card.execError = 'grid'
  }
  if (card.popClose === 'view') {
@@ -858,6 +877,13 @@
      value: 'equaltab',
      text: Formdict['header.form.refresh.equaltab']
    })
  }
  if (card.OpenType === 'blank') {
    card.OpenType = 'tab'
  }
  if (!card.control && card.controlField) {
    card.control = 'disabled'
  }
  return [
@@ -1125,20 +1151,6 @@
      options: []
    },
    {
      type: 'select',
      key: 'tabTemplate',
      label: '标签类型',
      initVal: card.tabTemplate || '',
      required: true,
      options: [
        {
          value: 'ThdMenu',
          text: Formdict['model.menu.level3']
        },
        ...tabTems
      ]
    },
    {
      type: 'cascader',
      key: 'linkmenu',
      label: Formdict['model.form.linkmenu'],
@@ -1155,45 +1167,21 @@
      options: menulist
    },
    {
      type: 'radio',
      key: 'afterExecSuccess',
      label: Formdict['header.form.afterExecSuccess'],
      initVal: card.afterExecSuccess || 'close',
      required: true,
      options: [{
        value: 'close',
        text: Formdict['model.close']
      }, {
        value: 'notclose',
        text: Formdict['model.notclose']
      }]
    },
    {
      type: 'radio',
      key: 'afterExecError',
      label: Formdict['header.form.afterExecError'],
      initVal: card.afterExecError || 'notclose',
      required: true,
      options: [{
        value: 'close',
        text: Formdict['model.close']
      }, {
        value: 'notclose',
        text: Formdict['model.notclose']
      }]
    },
    {
      type: refresh.length === 0 ? 'radio' : 'select',
      key: 'execSuccess',
      label: Formdict['model.form.afterSuccess'],
      initVal: card.execSuccess || 'never',
      tooltip: '选择刷新行时,如果选择多条数据会刷新表格。',
      required: true,
      options: [{
        value: 'never',
        text: Formdict['header.form.refresh.never']
        text: '不刷新'
      }, {
        value: 'grid',
        text: Formdict['header.form.refresh.grid']
        text: '刷新表格'
      }, {
        value: 'line',
        text: '刷新行'
      },
      ...refresh]
    },
@@ -1202,13 +1190,17 @@
      key: 'execError',
      label: Formdict['model.form.afterError'],
      initVal: card.execError || 'never',
      tooltip: '选择刷新行时,如果选择多条数据会刷新表格。',
      required: true,
      options: [{
        value: 'never',
        text: Formdict['header.form.refresh.never']
        text: '不刷新'
      }, {
        value: 'grid',
        text: Formdict['header.form.refresh.grid']
        text: '刷新表格'
      }, {
        value: 'line',
        text: '刷新行'
      },
      ...refresh]
    },
@@ -1220,10 +1212,10 @@
      required: true,
      options: [{
        value: 'never',
        text: Formdict['header.form.refresh.never']
        text: '不刷新'
      }, {
        value: 'grid',
        text: Formdict['header.form.refresh.grid']
        text: '刷新表格'
      },
      ...refresh]
    },
@@ -1324,23 +1316,6 @@
      }]
    },
    {
      type: 'select',
      key: 'controlField',
      label: '控制字段',
      tooltip: '禁用控制字段,可根据数据控制按钮是否禁用。',
      initVal: card.controlField || '',
      required: false,
      options: [{label: '无', field: ''}, ...columns]
    },
    {
      type: 'text',
      key: 'controlVal',
      label: '控制值',
      tooltip: '当选择控制字段,且字段值与控制值相等时,按钮会禁用,多个值用逗号分隔。',
      initVal: card.controlVal || '',
      required: false
    },
    {
      type: 'radio',
      key: 'display',
      label: '显示方式',
@@ -1391,11 +1366,45 @@
      key: 'preFunc',
      label: '前置函数',
      initVal: card.preFunc || '',
      tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行。`,
      tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行;当前置函数返回中ErrCode等于-1时,将不再执行内部函数。`,
      fields: usefulFields,
      tooltipClass: 'middle',
      required: false,
      readonly: false
    },
    {
      type: 'radio',
      key: 'control',
      label: '按钮控制',
      initVal: card.control || '',
      required: false,
      options: [{
        value: '',
        text: '无'
      }, {
        value: 'disabled',
        text: '禁用'
      }, {
        value: 'hidden',
        text: '隐藏'
      }]
    },
    {
      type: 'select',
      key: 'controlField',
      label: '控制字段',
      tooltip: '控制字段,可根据数据控制按钮的隐藏或禁用。',
      initVal: card.controlField || '',
      required: true,
      options: columns
    },
    {
      type: 'text',
      key: 'controlVal',
      label: '控制值',
      tooltip: '当选择控制字段,且字段值与控制值相等时,按钮会隐藏或禁用,多个值用逗号分隔。',
      initVal: card.controlVal || '',
      required: false
    },
  ]
}
@@ -2176,9 +2185,8 @@
 * @param {*} tabfields       // 可切换表单
 * @param {*} linkableFields  // 可关联表单
 * @param {*} linksupFields   // 上级表单
 * @param {*} subtable        // 是否为子表表单
 */
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, subtable = false) {
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
@@ -2597,6 +2605,70 @@
      required: false
    },
    {
      type: 'select',
      key: 'minDate',
      label: '最小值',
      initVal: card.minDate || '',
      required: false,
      options: [{
        value: '',
        text: '无'
      }, {
        value: '0',
        text: '当天'
      }, {
        value: '-1',
        text: '前一天'
      }, {
        value: '-2',
        text: '前两天'
      }, {
        value: '-3',
        text: '前三天'
      }, {
        value: '-7',
        text: '前七天'
      }, {
        value: '-30',
        text: '前30天'
      }, {
        value: '-90',
        text: '前90天'
      }]
    },
    {
      type: 'select',
      key: 'maxDate',
      label: '最大值',
      initVal: card.maxDate || '',
      required: false,
      options: [{
        value: '',
        text: '无'
      }, {
        value: '0',
        text: '当天'
      }, {
        value: '1',
        text: '后一天'
      }, {
        value: '2',
        text: '后两天'
      }, {
        value: '3',
        text: '后三天'
      }, {
        value: '7',
        text: '后七天'
      }, {
        value: '30',
        text: '后30天'
      }, {
        value: '90',
        text: '后90天'
      }]
    },
    {
      type: 'number',
      key: 'fieldlength',
      min: 1,
@@ -2644,17 +2716,20 @@
      type: 'select',
      key: 'fileType',
      label: '显示方式',
      initVal: card.fileType || (appType === 'mob' ? 'picture-card' : 'text'),
      initVal: card.fileType || 'text',
      options: [{
        value: 'text',
        text: '文件'
      }, {
      },
      {
        value: 'picture',
        text: '图文信息'
      }, {
      },
      {
        value: 'picture-card',
        text: '图片卡'
      }]
      }],
      forbid: appType === 'mob'
    },
    {
      type: 'number',
@@ -2725,11 +2800,11 @@
      label: '光标',
      initVal: card.cursor || 'left',
      options: [{
        value: 'right',
        text: '右对齐'
      }, {
        value: 'left',
        text: '左对齐'
      }, {
        value: 'right',
        text: '右对齐'
      }],
      forbid: appType !== 'mob'
    },
@@ -2779,6 +2854,20 @@
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'radio',
      key: 'dropdown',
      label: '下拉框',
      initVal: card.dropdown || 'true',
      forbid: appType === 'mob',
      options: [{
        value: 'true',
        text: '定宽'
      }, {
        value: 'false',
        text: '自适应'
      }]
    },
    {
@@ -2837,20 +2926,20 @@
        text: 'nvarchar(50)'
      }]
    },
    {
      type: 'radio',
      key: 'mode',
      label: '模式',
      initVal: card.mode || 'picker',
      options: [{
        value: 'picker',
        text: '选择器'
      }, {
        value: 'calendar',
        text: '日历'
      }],
      forbid: appType !== 'mob'
    },
    // {
    //   type: 'radio',
    //   key: 'mode',
    //   label: '模式',
    //   initVal: card.mode || 'picker',
    //   options: [{
    //     value: 'picker',
    //     text: '选择器'
    //   }, {
    //     value: 'calendar',
    //     text: '日历'
    //   }],
    //   forbid: appType !== 'mob'
    // },
    {
      type: 'number',
      key: 'span',
@@ -2972,6 +3061,21 @@
    },
    {
      type: 'radio',
      key: 'place',
      label: '排列',
      initVal: card.place || 'left_right',
      tooltip: '提示文字与输入框的位置关系。',
      forbid: appType !== 'mob',
      options: [{
        value: 'left_right',
        text: '左右'
      }, {
        value: 'up_down',
        text: '上下'
      }]
    },
    {
      type: 'radio',
      key: 'count',
      label: '计数功能',
      initVal: card.count || 'false',
@@ -3072,6 +3176,28 @@
      options: inputfields
    },
    {
      type: 'number',
      key: 'marginTop',
      label: '上边距(px)',
      initVal: card.marginTop || 0,
      min: 0,
      max: 1000,
      precision: 0,
      required: false,
      forbid: appType !== 'mob'
    },
    {
      type: 'number',
      key: 'marginBottom',
      label: '下边距(px)',
      initVal: card.marginBottom || 0,
      min: 0,
      max: 1000,
      precision: 0,
      required: false,
      forbid: appType !== 'mob'
    },
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],