king
2024-08-25 326aa6b3effaccc71cfe0775d47b0f29eb3695a6
src/templates/sharecomponent/chartgroupcomponent/index.jsx
@@ -5,9 +5,7 @@
import { DownOutlined, UpOutlined } from '@ant-design/icons'
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import { getChartViewForm } from '@/templates/zshare/formconfig'
import { getChartViewForm } from './formconfig'
import ChartForm from './chartform'
import DragChartView from './dragchartview'
@@ -22,7 +20,6 @@
  }
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    chartlist: null,      // 图表集
    card: null,           // 编辑中元素
    formlist: null,       // 表单信息
@@ -206,14 +203,13 @@
   */
  deletechart = (plot) => {
    const { config } = this.props
    const { dict } = this.state
    let _this = this
    let that = this
    confirm({
      content: dict['model.confirm'] + dict['model.delete'] + ` ${plot.title} ?`,
      content: `确定删除 ${plot.title} ?`,
      onOk() {
        let _chartlist = fromJS(_this.state.chartlist).toJS()
        let _chartview = _this.state.chartview
        let _chartlist = fromJS(that.state.chartlist).toJS()
        let _chartview = that.state.chartview
        _chartlist = _chartlist.filter(item => item.uuid !== plot.uuid)
@@ -221,11 +217,11 @@
          _chartview = _chartlist[0].uuid
        }
        _this.setState({
        that.setState({
          chartlist: _chartlist,
          chartview: _chartview
        })
        _this.props.updatechartgroup({...config, charts: _chartlist}, _chartview)
        that.props.updatechartgroup({...config, charts: _chartlist}, _chartview)
      },
      onCancel() {}
    })
@@ -254,9 +250,10 @@
    }
  }
  // 已弃用,不在开放添加通道
  render() {
    const { config } = this.props
    const { dict, chartlist, modaltype, card, chartview } = this.state
    const { chartlist, modaltype, card, chartview } = this.state
    return (
      <div className="model-table-chartview-list">
@@ -282,7 +279,6 @@
          destroyOnClose
        >
          <ChartForm
            dict={dict}
            card={card}
            formlist={this.state.formlist}
            inputSubmit={this.submitChart}