king
2025-01-18 f9f60bb0dd17a764ba03faa8041f5b6e9e071553
src/templates/zshare/formconfig.jsx
@@ -261,6 +261,7 @@
      label: '数据源',
      initVal: card.dataSource || '',
      tooltip: '数据权限替换符 $@ -> /* 或 \'\'、 @$ -> */ 或 \'\'',
      placeholder: '系统变量:mk_departmentcode、mk_organization、mk_user_type。公共值:@BID@、@Appkey@、@UserID@、@SessionUid@、@LoginUID@、@lang@。',
      required: true
    },
    {
@@ -443,7 +444,7 @@
        text: '本地'
      }, {
        value: 'sso',
        text: '系统'
        text: '单点'
      }]
    },
    {
@@ -730,13 +731,8 @@
/**
 * @description 获取表单配置信息
 * @param {*} card            // 表单对象
 * @param {*} inputfields     // 可写入表单
 * @param {*} tabfields       // 可切换表单
 * @param {*} linkableFields  // 可关联表单
 * @param {*} linksupFields   // 上级表单
 */
export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, columns = []) {
export function getModalForm (card, fields, columns = []) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
@@ -771,6 +767,64 @@
    }
  } else {
    msgTemps = []
  }
  let inputfields = []
  let tabfields = []
  let linkableFields = []
  let linksupFields = []
  fields.forEach(item => {
    if (!item.field || card.field === item.field) return
    if (['text', 'number', 'textarea', 'select'].includes(item.type)) {
      inputfields.push({
        field: item.field,
        label: item.label
      })
    }
    if (item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) {
      tabfields.push({
        field: item.field,
        label: item.label
      })
    }
    if (['switch', 'check', 'popSelect'].includes(item.type)) {
      linksupFields.push({
        field: item.field,
        label: item.label
      })
    }
    if (['select', 'link', 'radio', 'checkcard', 'multiselect'].includes(item.type)) {
      linksupFields.push({
        field: item.field,
        label: item.label
      })
    }
    if (['select', 'link', 'radio', 'popSelect'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true')) {
      linkableFields.push({
        field: item.field,
        label: item.label + '-表单'
      })
    }
  })
  let _fields = linkableFields.map(cell => cell.field)
  columns.forEach(col => {
    if (col.field && !_fields.includes(col.field)) {
      linkableFields.push({
        field: col.field,
        label: col.label + '-显示列'
      })
    }
  })
  if (card.linkSubField && card.linkSubField.length > 0) {
    let fields = inputfields.map(item => item.field)
    card.linkSubField = card.linkSubField.filter(item => fields.includes(item))
  }
  inputfields = inputfields.map((item, index) => {
@@ -958,12 +1012,20 @@
  let options = card.options || []
  if (['select', 'radio', 'link'].includes(card.type) && card.setAll === 'true') { // 兼容
    options.unshift({
    let cell = {
      key: 'empty',
      Value: '',
      Text: card.emptyText || '空',
      ParentID: ''
    })
    }
    if (card.linkSubField) {
      card.linkSubField.forEach(m => {
        cell[m] = ''
      })
    }
    options.unshift(cell)
  }
  let initval = card.initval || ''
@@ -1145,7 +1207,7 @@
      label: '数据源',
      initVal: card.dataSource || '',
      tooltip: '数据权限替换符 $@ -> /* 或 \'\'、 @$ -> */ 或 \'\'',
      placeholder: '系统变量:mk_departmentcode、mk_organization、mk_user_type。公共值:@ID@、@BID@。',
      placeholder: '系统变量:mk_departmentcode、mk_organization、mk_user_type。公共值:@ID@、@BID@、@Appkey@、@UserID@、@SessionUid@、@LoginUID@、@lang@。',
      required: true,
      readonly: false
    },
@@ -1794,6 +1856,19 @@
    },
    {
      type: 'radio',
      key: 'notZero',
      label: "不可为0",
      initVal: card.notZero || 'false',
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'radio',
      key: 'database',
      label: '数据库',
      initVal: card.database || 'local',
@@ -1802,7 +1877,7 @@
        text: '本地'
      }, {
        value: 'sso',
        text: '系统'
        text: '单点'
      }]
    },
    {
@@ -1840,7 +1915,7 @@
      type: 'radio',
      key: 'readin',
      label: '自动填充',
      tooltip: '将表格选中的数据自动填充到表单中。注:在批量操作时,如想要所选行(当前字段)全部修改请设为否或首行。',
      tooltip: '将表格选中的数据自动填充到表单中。注:在批量操作时,如想要所选行(当前字段)全部修改请设为否或首行;使用“缓存”时,将在本地保存与读取表单信息,选行时使用行信息填充。',
      initVal: card.readin || 'true',
      options: [{
        value: 'true',
@@ -1851,6 +1926,9 @@
      }, {
        value: 'top',
        text: '首行'
      }, {
        value: 'local',
        text: '缓存'
      }]
    },
    {
@@ -1865,6 +1943,20 @@
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'radio',
      key: 'verifyVal',
      label: '空值验证',
      tooltip: '按钮提交时验证字段值是否为空(或数值为0)。',
      initVal: card.verifyVal || 'false',
      options: [{
        value: 'true',
        text: '开启'
      }, {
        value: 'false',
        text: '关闭'
      }]
    },
    {
@@ -2448,6 +2540,18 @@
    },
    {
      type: 'number',
      key: 'contHeidht',
      label: '高度',
      min: 1,
      max: 2000,
      precision: 1,
      initVal: card.contHeidht,
      tooltip: '富文本编辑区的高度,小于100时为窗口的百分比。',
      required: false,
      forbid: appType === 'mob'
    },
    {
      type: 'number',
      key: 'labelwidth',
      min: 1,
      max: 100,