king
2020-09-14 76427d51a079a5fd1f45bf7188249e7a4647ae05
src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx
@@ -16,8 +16,11 @@
import card1 from '@/assets/img/card1.png'
import card2 from '@/assets/img/card2.png'
import card3 from '@/assets/img/card3.png'
// import card4 from '@/assets/img/card4.png'
import card4 from '@/assets/img/card4.png'
import card5 from '@/assets/img/card5.png'
import card6 from '@/assets/img/card6.png'
import card7 from '@/assets/img/card7.png'
import card8 from '@/assets/img/card8.png'
import './index.scss'
const syslegends = {
@@ -121,15 +124,30 @@
      subelement: ['content', 'avatar']
    },
    {
      uuid: 'card6',
      url: card6,
      subelement: ['content', 'header']
    },
    {
      uuid: 'card3',
      url: card3,
      subelement: ['content', 'avatar', 'header']
    },
    // {
    //   uuid: 'card4',
    //   url: card4,
    //   subelement: ['content', 'avatar', 'bottom']
    // },
    {
      uuid: 'card8',
      url: card8,
      subelement: ['content', 'bottom']
    },
    {
      uuid: 'card4',
      url: card4,
      subelement: ['content', 'avatar', 'bottom']
    },
    {
      uuid: 'card7',
      url: card7,
      subelement: ['content', 'header', 'bottom']
    },
    {
      uuid: 'card5',
      url: card5,
@@ -192,7 +210,9 @@
      columns: _columns,
      selectlegend: _selectlegend,
      formlist: formlist.map(item => {
        if (item.key === 'height' && ['table', 'card'].includes(_type)) {
        if (item.key === 'actions' && ['table'].includes(_type)) { // 按钮组
          item.hidden = true
        } else if (item.key === 'height' && ['table', 'card'].includes(_type)) {
          item.hidden = true
        } else if (item.key === 'widthType' && _type === 'card') {
          item.hidden = false
@@ -204,7 +224,7 @@
          item.hidden = false
        } else if (item.key === 'switch' && _type === 'card') {
          item.hidden = false
        } else if (item.key === 'insert') {
        } else if (item.key === 'extraAction') {
          item.hidden = _type !== 'card'
        } else if (item.key === 'bgfield') {
          item.hidden = _type !== 'card'
@@ -244,7 +264,9 @@
        legends: syslegends[value] || null,
        selectlegend: syslegends[value] ? syslegends[value][0] : null,
        formlist: formlist.map(item => {
          if (item.key === 'height' && ['table', 'card'].includes(value)) {
          if (item.key === 'actions' && ['table'].includes(value)) { // 按钮组
            item.hidden = true
          } else if (item.key === 'height' && ['table', 'card'].includes(value)) {
            item.hidden = true
          } else if (item.key === 'widthType' && value === 'card') {
            item.hidden = false
@@ -258,7 +280,7 @@
            item.hidden = false
          } else if (item.key === 'switch' && value === 'card') {
            item.hidden = false
          } else if (item.key === 'insert') {
          } else if (item.key === 'extraAction') {
            item.hidden = value !== 'card'
          } else if (item.key === 'bgfield') {
            item.hidden = value !== 'card'
@@ -379,7 +401,12 @@
      } else if (item.type === 'select') { // 下拉搜索
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal || '',
                rules: [
@@ -440,7 +467,12 @@
      } else if (item.type === 'multiselect') { // 多选
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal || []
              })(
@@ -478,7 +510,7 @@
            card: 'credit-card'
          }
          if (result.chartType === 'line' || result.chartType === 'bar' || result.chartType === 'line') {
          if (result.chartType === 'line' || result.chartType === 'bar' || result.chartType === 'pie') {
            if (selectlegend && this.props.card.modelId !== selectlegend.uuid) {
              result = {...result, ...selectlegend.options}
            }
@@ -528,7 +560,8 @@
                widthType: 'ratio',
                width: 32,
                avatarWidth: 32,
                radius: 'true'
                radius: 'true',
                display: 'inline'
              }
            }