king
2020-05-20 4c775de9de07291b345fd5c975a87230ddedd5ca
src/templates/zshare/formconfig.jsx
@@ -1217,7 +1217,7 @@
 * @param {object} card       // 搜索条件对象
 * @param {Array}  roleList   // 角色列表-黑名单
 */
export function getChartViewForm (card, roleList = []) {
export function getChartViewForm (card, roleList = [], _columns) {
  let _charts = [{
    value: 'line',
    text: '折线图'
@@ -1332,6 +1332,16 @@
        value: 'roll',
        text: '滚动'
      }]
    },
    {
      type: 'select',
      key: 'bgfield',
      label: '背景控制',
      initVal: card.bgfield || '',
      required: false,
      readonly: false,
      hidden: true,
      options: _columns
    },
    {
      type: 'multiselect',
@@ -2092,6 +2102,7 @@
      label: '数据类型',
      initVal: card.datatype || 'dynamic',
      required: true,
      forbid: !['detail', 'header'].includes(_type),
      options: [{
        value: 'dynamic',
        text: '动态'
@@ -2101,11 +2112,27 @@
      }]
    },
    {
      type: 'radio',
      key: 'type',
      label: '类型',
      initVal: card.type || 'picture',
      required: true,
      forbid: !['avatar'].includes(_type),
      options: [{
        value: 'picture',
        text: '图片'
      }, {
        value: 'icon',
        text: '图标'
      }]
    },
    {
      type: 'text',
      key: 'content',
      label: '内容',
      initVal: card.content || '',
      required: true
      required: true,
      forbid: !['detail', 'header'].includes(_type),
    },
    {
      type: 'select',
@@ -2113,6 +2140,7 @@
      label: '字段',
      initVal: card.field || '',
      required: true,
      forbid: !['detail', 'header', 'avatar'].includes(_type),
      options: _columns
    },
    {
@@ -2121,7 +2149,7 @@
      label: '加粗',
      initVal: card.bold || 'false',
      required: true,
      forbid: _type !== 'detail',
      forbid: !['detail'].includes(_type),
      options: [{
        value: 'true',
        text: '是'
@@ -2136,7 +2164,7 @@
      label: '宽度',
      initVal: card.width || '',
      required: false,
      forbid: _type !== 'detail',
      forbid: !['detail'].includes(_type),
      options: [{
        value: '',
        text: '100%'
@@ -2150,13 +2178,51 @@
    },
    {
      type: 'radio',
      key: 'widthType',
      label: '宽度设置',
      initVal: card.widthType || 'absolute',
      required: false,
      forbid: !['avatar'].includes(_type),
      hidden: true,
      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: 'number',
      key: 'size',
      label: '字体大小',
      initVal: card.size || 14,
      min: 12,
      max: 500,
      required: false,
      hidden: true,
      forbid: !['avatar'].includes(_type)
    },
    {
      type: 'radio',
      key: 'align',
      label: '对齐',
      initVal: card.align || '',
      initVal: card.align || 'left',
      required: false,
      forbid: _type !== 'detail',
      forbid: !['detail'].includes(_type),
      options: [{
        value: '',
        value: 'left',
        text: '左'
      }, {
        value: 'align-center',
@@ -2167,13 +2233,31 @@
      }]
    },
    {
      type: 'radio',
      key: 'show',
      label: '显示',
      initVal: card.show || '',
      required: false,
      forbid: !['bottom'].includes(_type),
      options: [{
        value: 'icon',
        text: '图标'
      }, {
        value: 'text',
        text: '文字'
      }, {
        value: 'all',
        text: '全部'
      }]
    },
    {
      type: 'multiselect',
      key: 'actions',
      label: '按钮组',
      tooltip: '',
      initVal: card.actions || [],
      initVal: card.actions ? card.actions.map(cell => cell.value) : [],
      required: false,
      forbid: _type !== 'header',
      forbid: !['header', 'bottom'].includes(_type),
      options: _actions
    },
  ]