king
2022-04-25 9e716f3bd30820a08757845b592db73363faa48c
src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
@@ -6,19 +6,36 @@
/**
 * @description 获取显示列表单配置信息
 * @param {object} card       // 搜索条件对象
 * @param {Array}  menulist   // 菜单列表-用于字段透视
 */
export function getColumnForm (card, menulist = [], fields = []) {
export function getColumnForm (card, fields = []) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch {
    } catch (e) {
      roleList = []
    }
  } else {
    roleList = []
  }
  let menulist = []
  if (appType === 'pc') {
    menulist = sessionStorage.getItem('appMenus')
  } else if (!appType) {
    menulist = sessionStorage.getItem('fstMenuList')
  }
  if (menulist) {
    try {
      menulist = JSON.parse(menulist)
    } catch (e) {
      menulist = []
    }
  } else {
    menulist = []
  }
  let options = [{
@@ -42,6 +59,9 @@
  }, {
    value: 'colspan',
    text: '合并列'
  }, {
    value: 'formula',
    text: '公式'
  }, {
    value: 'index',
    text: '序号'
@@ -132,9 +152,9 @@
      type: 'radio',
      key: 'IsSort',
      label: Formdict['model.sort'],
      initVal: card.IsSort || 'true',
      initVal: card.IsSort || (card.isSub ? 'false' : 'true'),
      required: true,
      forbidden: card.isSub,
      // forbidden: card.isSub,
      options: [{
        value: 'true',
        text: Formdict['model.true']
@@ -210,10 +230,13 @@
        text: Formdict['model.empty']
      }, {
        value: 'thdSeparator',
        text: Formdict['header.form.thdSeparator']
        text: '千分位'
      }, {
        value: 'percent',
        text: '百分比'
      }, {
        value: 'abs',
        text: '绝对值'
      }],
      required: false
    },
@@ -247,12 +270,11 @@
      key: 'postfix',
      label: Formdict['header.form.postfix'],
      initVal: card.postfix || '',
      tooltipClass: 'middle',
      required: false,
      readonly: false
    },
    {
      type: 'radio',
      type: 'select',
      key: 'lenWidRadio',
      label: '长宽比',
      initVal: card.lenWidRadio || '1:1',
@@ -300,8 +322,8 @@
    {
      type: 'radio',
      key: 'scale',
      label: Formdict['header.form.clickscale'],
      initVal: card.scale || 'false',
      label: '点击缩放',
      initVal: card.scale || 'true',
      required: false,
      options: [{
        value: 'true',
@@ -329,10 +351,10 @@
      forbidden: appType === 'mob'
    },
    {
      type: 'cascader',
      type: appType === 'pc' ? 'select' : 'cascader',
      key: 'linkmenu',
      label: Formdict['model.menu'],
      initVal: card.linkmenu || [],
      initVal: card.linkmenu || (appType === 'pc' ? '' : []),
      required: true,
      options: menulist,
      forbidden: appType === 'mob'
@@ -355,6 +377,39 @@
      forbidden: appType === 'mob'
    },
    {
      type: 'radio',
      key: 'open',
      label: '打开方式',
      initVal: card.open || 'blank',
      required: false,
      forbid: appType !== 'pc',
      options: [
        { value: 'blank', text: '新窗口' },
        { value: 'self', text: '当前窗口' }
      ]
    },
    {
      type: 'radio',
      key: 'eval',
      label: '解析',
      initVal: card.eval || 'true',
      tooltip: '当公式内容涉及计算时请选择“是”,当公式内容为字段拼接时请选择“否”。',
      required: false,
      options: [
        { value: 'true', text: '是' },
        { value: 'false', text: '否' }
      ]
    },
    {
      type: 'textarea',
      key: 'formula',
      label: '公式',
      initVal: card.formula || '',
      tooltip: '执行时会使用查询到的数据替换相应的字段,展示获得的结果,在不使用解析时换行符或空格会替换为页面元素。可使用JS的一些语法,如:三元表达式 @field1@ > @field2@ ? 0 : 1;Math对象,取绝对值 Math.abs(@field@)、四舍五入 Math.round(@field@)等',
      placeholder: '例如:@price@ * @number@',
      required: true
    },
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],