Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider在重绘时无法删除老的数据 #139

Open
David-Liu5460 opened this issue Apr 25, 2022 · 0 comments
Open

Slider在重绘时无法删除老的数据 #139

David-Liu5460 opened this issue Apr 25, 2022 · 0 comments

Comments

@David-Liu5460
Copy link

如下图所示:slider里面的item更新后貌似不能删除老的数据?
generateCardWithSlider() {
const tabs = this.props.tabs;
const tabTitles = this.props.tabTitles;
const isValid = Object.keys(tabs).length > 0;
const bollonTarget = ;
this.tabKeys = Object.keys(tabTitles);
const cardLen = this.tabKeys.length;

return (
  <section>
    {isValid && (
      <Slider
        slidesToShow={this.props.slider && cardLen > 6 ? 6 : cardLen}
        slidesToScroll={6}
        dots={false}
        infinite={false}
        draggable={false}
      >
        {this.tabKeys.map((key, index) => {
          const activeFlag = index === this.state.index;
          return (
            <ul
              className={`tab-items-ul ${
                activeFlag ? "active" : "in-active"
              }`}
              key={index}
            >
              <li
                data-key={key}
                className={activeFlag ? "active" : ""}
                onClick={this.tabClick.bind(this, index)}
              >
                {tabs[key] ? (
                  <React.Fragment>
                    <span className="name">
                      {tabTitles[key] === "商机转化率" ? (
                        <div>
                          <span>{tabTitles[key]}</span>
                          <Balloon
                            trigger={
                              <img
                                className='point'
                                src="https://img.alicdn.com/imgextra/i4/O1CN01Fi1cnQ1UV7ZK09is9_!!6000000002522-2-tps-28-28.png"
                              ></img>
                            }
                            closable={false}
                            align="t"
                          >
                            {$i18n.get({
                             id:'intl-mydata.init.index.Business_opportunity_conversion_rate'
                            })}
                          </Balloon>
                        </div>
                      ) : (
                        <span>{tabTitles[key]}</span>
                      )}
                    </span>
                    {this.props.terminalTypeForSlide !== "total" &&
                    (key === "ordCnt" || key === "ordAmt") ? (
                      <div className="slide-no-data" key={index}>
                        {$i18n.get({
                          id:
                            "intl-mydata.common.target-analysis.terminal.nosupport",
                          dm: "不支持区分终端"
                        })}
                        <Balloon
                          trigger={bollonTarget}
                          triggerType="hover"
                          align="t"
                        >
                          {$i18n.get({
                            id:
                              "intl-mydata.common.target-analysis.terminal.nosupporttip",
                            dm: "该指标目前不支持区分终端"
                          })}
                        </Balloon>
                      </div>
                    ) : (
                      <React.Fragment>
                        <span className="value">
                          {~key.indexOf("Rate")
                            ? `${(tabs[key].value * 100).toFixed(2)}%`
                            : Number(tabs[key].value).toLocaleString()}
                        </span>
                        <span className="compare">
                          <span className="compare-type">
                            {`${this.props.unit}:`}
                          </span>
                          {tabs[key].hasOwnProperty("cycleCrc") && (
                            <span
                              className={`compare-value ${
                                !Number(tabs[key].cycleCrc)
                                  ? "color-normal"
                                  : tabs[key].cycleCrc < 0
                                  ? "color-down"
                                  : "color-up"
                              } ${
                                this.props.isNewVersion
                                  ? "isNewVersion"
                                  : ""
                              }`}
                            >
                              {this.ratioConvert(tabs[key].cycleCrc)}
                            </span>
                          )}
                          {tabs[key] &&
                            tabs[key].hasOwnProperty("wowDiff") && (
                              <span
                                className={
                                  "compare-value " +
                                  (!Number(tabs[key].wowDiff)
                                    ? "color-normal"
                                    : tabs[key].wowDiff < 0
                                    ? "color-down"
                                    : "color-up")
                                }
                              >
                                {this.ratioConvert(tabs[key].wowDiff)}
                              </span>
                            )}
                          {tabs[key] &&
                            tabs[key].hasOwnProperty("momDiff") && (
                              <span
                                className={
                                  "compare-value " +
                                  (!Number(tabs[key].momDiff)
                                    ? "color-normal"
                                    : tabs[key].momDiff < 0
                                    ? "color-down"
                                    : "color-up")
                                }
                              >
                                {this.ratioConvert(tabs[key].momDiff)}
                              </span>
                            )}
                        </span>
                      </React.Fragment>
                    )}
                  </React.Fragment>
                ) : (
                  <React.Fragment>
                    <span className="name">
                      <span>{tabTitles[key]}</span>
                    </span>
                    <div className="slide-no-data" key={index}>
                      {$i18n.get({
                        id:
                          "intl-mydata.common.target-analysis.slidepanel.ZoneClassificationIsNotSupported",
                        dm: "不支持区分类目"
                      })}
                      <Balloon
                        trigger={bollonTarget}
                        triggerType="hover"
                        align="t"
                      >
                        {$i18n.get({
                          id:
                            "intl-mydata.common.target-analysis.slidepanel.ThisIndicatorDoesNotCurrently",
                          dm: "该指标目前不支持区分类目"
                        })}
                      </Balloon>
                    </div>
                  </React.Fragment>
                )}
              </li>
            </ul>
          );
        })}
      </Slider>
    )}
  </section>
);

}

@David-Liu5460 David-Liu5460 changed the title Slider在重绘时无法删除老的书籍 Slider在重绘时无法删除老的数据 Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant