model-traceback.vue 69.2 KB
Newer Older
G
gaocongli 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<!--
Copyright 2020 Huawei Technologies Co., Ltd.All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<template>
17
  <div id="cl-model-traceback">
G
gaocongli 已提交
18
    <div class="cl-model-right">
P
ph 已提交
19
      <div class="top-area">
P
ph 已提交
20 21 22
        <div class="select-box"
             v-if="!noData &&
             (!summaryDirList || (summaryDirList && summaryDirList.length))">
P
ph 已提交
23
          <div v-show="showTable && !noData"
P
ph 已提交
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
               class="select-container">
            <!-- multiple collapse-tags -->
            <div class="display-column"> {{$t('modelTraceback.displayColumn')}}</div>
            <div class="inline-block-set">
              <el-select v-model="selectArrayValue"
                         multiple
                         collapse-tags
                         @change="selectValueChange"
                         :placeholder="$t('public.select')"
                         @focus="selectinputFocus">
                <div class="select-input-button">
                  <div class="select-inner-input">
                    <el-input v-model="keyWord"
                              @input="myfilter"
                              :placeholder="$t('public.search')"></el-input>
                  </div>
P
update  
ph 已提交
40 41 42
                  <button type="text"
                          @click="allSelect"
                          class="select-all-button"
P
ph 已提交
43 44 45
                          :class="[selectCheckAll ? 'checked-color' : 'button-text',
                          basearr.length > checkOptions.length ? 'btn-disabled' : '']"
                          :disabled="basearr.length > checkOptions.length">
P
ph 已提交
46
                    {{$t('public.selectAll')}}
P
update  
ph 已提交
47 48 49 50
                  </button>
                  <button type="text"
                          @click="deselectAll"
                          class="deselect-all-button"
51
                          :class="[!selectCheckAll ? 'checked-color' : 'button-text',
P
ph 已提交
52 53
                               basearr.length > checkOptions.length ? 'btn-disabled' : '']"
                          :disabled="basearr.length > checkOptions.length">
P
ph 已提交
54
                    {{$t('public.deselectAll')}}
P
update  
ph 已提交
55
                  </button>
P
ph 已提交
56 57 58 59 60 61 62 63 64
                </div>
                <el-option-group v-for="group in checkOptions"
                                 :key="group.label"
                                 :label="group.label">
                  <el-option v-for="item in group.options"
                             :key="item.value"
                             :label="item.label"
                             :value="item.value"
                             :disabled="item.disabled"
P
ph 已提交
65
                             :title="item.disabled ? $t('modelTraceback.mustExist') : ''">
P
ph 已提交
66 67 68 69 70 71 72 73 74
                  </el-option>
                </el-option-group>
              </el-select>
            </div>
            <div class="label-legend"
                 v-if="haveCustomizedParams">
              <div>[U]: {{$t('modelTraceback.userDefined')}}</div>
              <div>[M]: {{$t('modelTraceback.metric')}}</div>
            </div>
P
ph 已提交
75
          </div>
G
gaocongli 已提交
76
        </div>
P
ph 已提交
77 78 79 80 81 82
        <div class="btns">
          <el-button class="custom-btn"
                     @click="resetChart"
                     type="primary"
                     size="mini"
                     plain
P
ph 已提交
83
                     v-if="(!noData && basearr.length) ||
P
ph 已提交
84 85 86 87
                   (noData && summaryDirList && !summaryDirList.length)">
            {{ $t('modelTraceback.showAllData') }}</el-button>
        </div>

G
gaocongli 已提交
88 89
      </div>
      <div id="echart"
P
ph 已提交
90
           v-show="!noData && showEchartPic"></div>
P
ph 已提交
91 92 93 94
      <div class="echart-no-data"
           v-show="!showEchartPic">
      </div>
      <div class="btns-container"
P
ph 已提交
95
           v-show="showTable && !noData">
P
ph 已提交
96 97 98 99 100 101 102 103 104 105 106
        <el-button type="primary"
                   size="mini"
                   class="custom-btn"
                   @click="hiddenRecords"
                   plain>{{$t('modelTraceback.hide')}}</el-button>
        <el-button type="primary"
                   size="mini"
                   class="custom-btn"
                   @click="unhideRecords"
                   plain>{{$t('modelTraceback.unhide')}}</el-button>
      </div>
G
gaocongli 已提交
107 108
      <div class="table-container"
           v-show="showTable && !noData">
P
ph 已提交
109
        <el-table ref="table"
G
gaocongli 已提交
110 111 112 113
                  :data="table.data"
                  tooltip-effect="light"
                  height="calc(100% - 40px)"
                  @selection-change="selectionChange"
114
                  @sort-change="sortChange"
G
gaocongli 已提交
115 116 117
                  row-key="summary_dir">
          <el-table-column type="selection"
                           width="55"
P
ph 已提交
118
                           :reserve-selection="true"
P
ph 已提交
119
                           v-show="showTable && !noData">
P
ph 已提交
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
          </el-table-column>

          <!--metric table column-->
          <el-table-column :label="$t('modelTraceback.metricLabel')"
                           align="center"
                           v-if="metricList.length">
            <el-table-column v-for="key in metricList"
                             :key="key"
                             :prop="key"
                             :label="table.columnOptions[key].label.substring(3)"
                             show-overflow-tooltip
                             min-width="150"
                             sortable="custom">
              <template slot="header"
                        slot-scope="scope">
                <div class="custom-label"
                     :title="scope.column.label">
                  {{scope.column.label}}
                </div>
              </template>
              <template slot-scope="scope">
                <span>{{formatNumber(key,scope.row[key])}}</span>
              </template>
            </el-table-column>
          </el-table-column>

          <!--user Defined table column-->
          <el-table-column :label="$t('modelTraceback.userDefinedLabel')"
                           align="center"
                           v-if="userDefinedList.length">
            <el-table-column v-for="key in userDefinedList"
                             :key="key"
                             :prop="key"
                             :label="table.columnOptions[key].label.substring(3)"
                             show-overflow-tooltip
                             min-width="150"
                             sortable="custom">
              <template slot="header"
                        slot-scope="scope">
                <div class="custom-label"
                     :title="scope.column.label">
                  {{scope.column.label}}
                </div>
              </template>
              <template slot-scope="scope">
                <span>{{formatNumber(key,scope.row[key])}}</span>
              </template>
            </el-table-column>
          </el-table-column>

          <!--hyper List table column-->
          <el-table-column :label="$t('modelTraceback.hyperLabel')"
                           align="center"
                           v-if="hyperList.length">
            <el-table-column v-for="key in hyperList"
                             :key="key"
                             :prop="key"
                             :label="table.columnOptions[key].label"
                             show-overflow-tooltip
179
                             min-width="154"
P
ph 已提交
180 181 182 183 184 185 186 187 188
                             sortable="custom">
              <template slot="header"
                        slot-scope="scope">
                <div class="custom-label"
                     :title="scope.column.label">
                  {{scope.column.label}}
                </div>
              </template>
              <template slot-scope="scope">
P
ph 已提交
189
                <span>{{formatNumber(key, scope.row[key])}}</span>
P
ph 已提交
190 191 192 193 194
              </template>
            </el-table-column>
          </el-table-column>
          <!--other column-->
          <el-table-column v-for="key in table.otherColumn"
G
gaocongli 已提交
195 196 197
                           :key="key"
                           :prop="key"
                           :label="table.columnOptions[key].label"
P
ph 已提交
198
                           :fixed="table.columnOptions[key].label === text ? true : false"
G
gaocongli 已提交
199
                           show-overflow-tooltip
P
update  
ph 已提交
200
                           min-width="150"
201 202 203 204 205 206 207 208
                           sortable="custom">
            <template slot="header"
                      slot-scope="scope">
              <div class="custom-label"
                   :title="scope.column.label">
                {{ scope.column.label }}
              </div>
            </template>
G
gaocongli 已提交
209 210
            <template slot-scope="scope">
              <a v-if="key === 'summary_dir'"
211 212
                 @click="jumpToTrainDashboard(scope.row[key])">{{ scope.row[key] }}</a>
              <span v-else>{{ formatNumber(key, scope.row[key]) }}</span>
G
gaocongli 已提交
213 214
            </template>
          </el-table-column>
P
ph 已提交
215
          <!-- remark column -->
W
溯源  
WeiFeng 已提交
216
          <el-table-column fixed="right"
P
ph 已提交
217
                           width="260">
W
溯源  
WeiFeng 已提交
218 219 220 221 222 223
            <template slot="header">
              <div>
                <div class="label-text">{{$t('public.remark')}}</div>
                <div class="remark-tip">{{$t('modelTraceback.remarkTips')}}</div>
              </div>
            </template>
P
ph 已提交
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
            <template slot-scope="scope">
              <div class="edit-text-container"
                   v-show="scope.row.editShow">{{scope.row.remark}}</div>
              <div class="inline-block-set">
                <i class="el-icon-edit"
                   @click="editRemarks(scope.row)"
                   v-show="scope.row.editShow"></i>
                <el-input type="text"
                          v-model="scope.row.remark"
                          v-show="!scope.row.editShow"
                          :placeholder="$t('public.enter')"
                          class="remark-input-style"></el-input>
                <i class="el-icon-check"
                   @click="saveRemarksValue(scope.row)"
                   v-show="!scope.row.editShow"></i>
                <i class="el-icon-close"
                   @click="cancelRemarksValue(scope.row)"
                   v-show="!scope.row.editShow"></i>
                <div class="validation-error"
                     v-show="scope.row.isError">
                  {{$t('modelTraceback.remarkValidation')}}
                </div>
              </div>
            </template>
          </el-table-column>
          <!-- tag -->
          <el-table-column label="tag"
                           fixed="right"
                           prop="tag"
                           sortable="custom">
            <template slot-scope="scope">
255
              <div @click="showAllIcon(scope.row,scope)"
P
ph 已提交
256 257 258 259 260
                   class="tag-icon-container">
                <i v-if="!scope.row.tag"
                   class="el-icon-arrow-down"></i>
                <img :id="scope.row.summary_dir"
                     v-if="scope.row.tag"
261
                     :src="require('@/assets/images/icon' + scope.row.tag + '.svg')">
P
ph 已提交
262 263
                <img :id="scope.row.summary_dir"
                     v-else
264
                     :src="''">
P
ph 已提交
265 266 267
              </div>
            </template>
          </el-table-column>
G
gaocongli 已提交
268
        </el-table>
P
ph 已提交
269
        <div class="pagination-container">
P
ph 已提交
270 271 272 273 274 275
          <el-pagination @current-change="pagination.pageChange"
                         :current-page="pagination.currentPage"
                         :page-size="pagination.pageSize"
                         :layout="pagination.layout"
                         :total="pagination.total">
          </el-pagination>
P
ph 已提交
276 277 278 279 280
          <div class="hide-count"
               v-show="recordsNumber-showNumber">
            {{$t('modelTraceback.totalHide').replace(`{n}`, (recordsNumber-showNumber))}}
          </div>
          <div class="clear"></div>
P
ph 已提交
281 282
        </div>

G
gaocongli 已提交
283 284 285 286 287
      </div>
      <div v-if="noData"
           class="no-data-page">
        <div class="no-data-img">
          <img :src="require('@/assets/images/nodata.png')"
288
               alt />
P
ph 已提交
289 290 291 292 293
          <p class="no-data-text"
             v-show="!summaryDirList || (summaryDirList && summaryDirList.length)">
            {{ $t('public.noData') }}</p>
          <div v-show="summaryDirList && !summaryDirList.length">
            <p class="no-data-text">{{ $t('modelTraceback.noDataFound') }}</p>
P
ph 已提交
294 295 296 297 298
            <p class="no-data-text">
              {{ $t('modelTraceback.click') }}
              <b> {{ $t('modelTraceback.showAllDataBtn') }}</b>
              {{ $t('modelTraceback.viewAllData') }}
            </p>
P
ph 已提交
299
          </div>
G
gaocongli 已提交
300 301 302
        </div>
      </div>
    </div>
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
    <!-- tag dialog -->
    <div v-show="tagDialogShow"
         id="tag-dialog"
         class="icon-dialog">
      <div>
        <div class="icon-image-container">
          <div class="icon-image"
               v-for="item in imageList"
               :key="item.number"
               :class="[tagScope.row && item.number === tagScope.row.tag ? 'icon-border':'']"
               @click="iconValueChange(tagScope.row, item.number, $event)">
            <img :src="item.iconAdd">
          </div>
        </div>
        <div class="btn-container-margin">
          <el-button type="primary"
                     size="mini"
                     class="custom-btn"
                     @click="iconChangeSave(tagScope.row)"
                     plain>
            {{$t('public.sure')}}
          </el-button>
          <el-button type="primary"
                     size="mini"
                     class="custom-btn"
                     @click="clearIcon(tagScope.row)"
                     plain>
            {{$t('public.clear')}}
          </el-button>
          <el-button type="primary"
                     size="mini"
                     class="custom-btn"
                     @click="cancelChangeIcon(tagScope.row)"
                     plain>
            {{$t('public.cancel')}}
          </el-button>
        </div>
      </div>
    </div>
G
gaocongli 已提交
342 343 344 345 346 347 348 349 350 351 352 353
  </div>
</template>
<script>
import RequestService from '../../services/request-service';
import CommonProperty from '@/common/common-property.js';
import Echarts from 'echarts';

export default {
  props: {},
  watch: {},
  data() {
    return {
354 355
      tagDialogShow: false,
      tagScope: {},
P
ph 已提交
356
      iconValue: 0,
P
update  
ph 已提交
357
      imageList: [],
P
ph 已提交
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
      // Select all
      selectCheckAll: true,
      // Number of data records returned by the interface.
      recordsNumber: 0,
      showNumber: 0,
      showEchartPic: true,
      hideRecord: false,
      hidenDirChecked: [],
      beforeEditValue: '',
      keyWord: '',
      basearr: [],
      labelObj: {metric: '', userDefined: ''},
      userOptions: [],
      metricOptions: [],
      hyperOptions: [],
      otherTypeOptions: [],
      checkOptions: [],
      selectArrayValue: [],
      // metric list
      metricList: [],
      userDefinedList: [],
      hyperList: [],
      summaryList: [],
P
ph 已提交
381 382
      table: {},
      summaryDirList: undefined,
P
ph 已提交
383
      text: this.$t('modelTraceback.summaryPath'),
P
ph 已提交
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398
      checkedSummary: [],
      keysOfStringValue: [
        'summary_dir',
        'network',
        'optimizer',
        'loss_function',
        'train_dataset_path',
        'test_dataset_path',
        'dataset_mark',
      ], // All keys whose values are character strings
      keysOfIntValue: [
        'train_dataset_count',
        'test_dataset_count',
        'epoch',
        'batch_size',
P
update  
ph 已提交
399
        'device_num',
P
ph 已提交
400
      ], // All keys whose values are int
P
ph 已提交
401
      keysOfMixed: [],
P
ph 已提交
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416
      echart: {
        chart: null,
        allData: [],
        brushData: [],
        showData: [],
      },
      pagination: {
        currentPage: 1,
        pageSize: 8,
        total: 0,
        layout: 'total, prev, pager, next, jumper',
        pageChange: {},
      },
      chartFilter: {}, // chart filter condition
      tableFilter: {lineage_type: {in: ['model']}}, // table filter condition
P
ph 已提交
417
      sortInfo: {},
P
ph 已提交
418 419
      showTable: false,
      noData: false,
P
ph 已提交
420 421 422 423 424
      haveCustomizedParams: false,
      replaceStr: {
        metric: 'metric/',
        userDefined: 'user_defined/',
      },
P
ph 已提交
425 426 427 428
    };
  },
  computed: {},
  mounted() {
P
update  
ph 已提交
429
    this.imageList = [];
430
    for (let i = 1; i <= 10; i++) {
P
update  
ph 已提交
431
      const obj = {};
432
      obj.number = i;
P
update  
ph 已提交
433 434 435
      obj.iconAdd = require('@/assets/images/icon' + obj.number + '.svg');
      this.imageList.push(obj);
    }
P
ph 已提交
436
    document.title = `${this.$t('summaryManage.modelTraceback')}-MindInsight`;
P
ph 已提交
437
    document.addEventListener('click', this.blurFloat, true);
P
ph 已提交
438 439 440 441 442 443 444 445 446 447 448
    this.$store.commit('setSelectedBarList', []);
    this.getStoreList();
    this.pagination.pageChange = (page) => {
      this.pagination.currentPage = page;
      this.queryLineagesData(false);
    };
    this.$nextTick(() => {
      this.init();
    });
  },
  methods: {
P
ph 已提交
449 450 451 452 453 454
    blurFloat(event) {
      const domArr = document.querySelectorAll('.icon-dialog');
      const isActiveDom = event.path.some((item) => {
        return item.className === 'icon-dialog';
      });
      if (!isActiveDom) {
455
        this.removeIconBorder();
P
ph 已提交
456 457 458
        domArr.forEach((item) => {
          item.style.display = 'none';
        });
459
        this.tagDialogShow = false;
P
ph 已提交
460 461 462 463 464 465
      }
    },

    /**
     * Display of the icon dialog box
     * @param {Object} row
466
     * @param {Object} scope
P
ph 已提交
467
     */
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493
    showAllIcon(row, scope) {
      this.iconValue = row.tag >= 0 ? row.tag : 0;
      this.tagScope = scope;
      if (this.tagDialogShow) {
        this.tagDialogShow = false;
        this.removeIconBorder();
        return;
      }
      this.addIconBorder(row);
      this.tagDialogShow = true;
      document.getElementById('tag-dialog').style.top =
        window.event.clientY - 130 + 'px';
    },

    /**
     * Add icon border style
     * @param {Object} row
     */
    addIconBorder(row) {
      const iconImage = document.querySelectorAll('.icon-image');
      iconImage.forEach((item, index) => {
        if (index + 1 === row.tag) {
          item.classList.add('icon-border');
        }
      });
    },
P
ph 已提交
494

495 496 497 498 499 500
    /**
     * Remove  icon border style
     */
    removeIconBorder() {
      const classArr = document.querySelectorAll('.icon-border');
      if (classArr.length) {
P
ph 已提交
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
        classArr.forEach((item) => {
          item.classList.remove('icon-border');
        });
      }
    },

    /**
     * icon value change
     * @param {Object} row
     * @param {Number} num
     *  @param {Object} event
     */
    iconValueChange(row, num, event) {
      const classWrap = event.path.find((item) => {
        return item.className === 'icon-dialog';
      });
      const classArr = classWrap.querySelectorAll('.icon-border');
      classArr.forEach((item) => {
        item.classList.remove('icon-border');
      });
      const htmDom = event.path.find((item) => {
        return item.nodeName === 'DIV';
      });
      htmDom.classList.add('icon-border');
      this.iconValue = num;
    },
    /**
     * Save the modification of the icon.
     * @param {Object} row
     */
    iconChangeSave(row) {
532
      this.tagDialogShow = false;
W
溯源  
WeiFeng 已提交
533
      if (row.tag === this.iconValue || this.iconValue === 0) {
P
ph 已提交
534 535
        return;
      }
536
      this.tagScope.row.tag = this.iconValue;
P
ph 已提交
537
      const id = row.summary_dir;
538 539
      const img = document.getElementById(id);
      img.src = require('@/assets/images/icon' + this.iconValue + '.svg');
P
ph 已提交
540 541 542
      const params = {
        train_id: row.summary_dir,
        body: {
543
          tag: this.tagScope.row.tag,
P
ph 已提交
544 545 546 547
        },
      };
      this.putChangeToLineagesData(params);
    },
548 549 550 551 552

    /**
     * clear icon
     * @param {Object} row
     */
P
ph 已提交
553
    clearIcon(row) {
P
ph 已提交
554 555 556 557 558 559 560
      const classWrap = event.path.find((item) => {
        return item.className === 'icon-dialog';
      });
      const classArr = classWrap.querySelectorAll('.icon-border');
      classArr.forEach((item) => {
        item.classList.remove('icon-border');
      });
561
      this.tagDialogShow = false;
P
ph 已提交
562
      this.iconValue = 0;
563 564 565
      this.tagScope.row.tag = 0;
      const img = document.getElementById(row.summary_dir);
      img.src = '';
P
ph 已提交
566 567 568
      const params = {
        train_id: row.summary_dir,
        body: {
569
          tag: 0,
P
ph 已提交
570 571 572 573 574 575 576 577 578
        },
      };
      this.putChangeToLineagesData(params);
    },
    /**
     * cancel save
     * @param {Object} row
     */
    cancelChangeIcon(row) {
579 580 581
      this.removeIconBorder();
      this.addIconBorder(row);
      this.tagDialogShow = false;
P
ph 已提交
582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607
    },

    /**
     * Select all
     */
    allSelect() {
      if (this.selectCheckAll) {
        return;
      }
      this.selectArrayValue = [];
      this.checkOptions.forEach((item) => {
        item.options.forEach((option) => {
          this.selectArrayValue.push(option.label);
        });
      });
      this.selectCheckAll = !this.selectCheckAll;
      let allList = [];
      const listA = [this.$t('modelTraceback.summaryPath')];
      allList = this.selectArrayValue.concat(listA);
      //  Set selected of the column data in the table to false;
      Object.keys(this.table.columnOptions).filter((i) => {
        this.table.columnOptions[i].selected = false;
      });
      allList.forEach((item) => {
        Object.keys(this.table.columnOptions).filter((i) => {
          const labelValue = this.table.columnOptions[i].label;
W
溯源  
WeiFeng 已提交
608
          if (labelValue === item) {
P
ph 已提交
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642
            this.table.columnOptions[i].selected = true;
          }
        });
      });
      this.initChart();
      this.initColumm();
      this.$nextTick(() => {
        this.$refs.table.doLayout();
      });
    },

    /**
     * deselect all
     */
    deselectAll() {
      this.selectArrayValue = [];
      this.checkOptions.forEach((item) => {
        item.options.forEach((option) => {
          if (option.disabled) {
            this.selectArrayValue.push(option.label);
          }
        });
      });
      this.selectCheckAll = false;
      let allList = [];
      const listA = [this.$t('modelTraceback.summaryPath')];
      allList = this.selectArrayValue.concat(listA);
      // Set selected to false for these columns in the table.
      Object.keys(this.table.columnOptions).filter((i) => {
        this.table.columnOptions[i].selected = false;
      });
      allList.forEach((item) => {
        Object.keys(this.table.columnOptions).filter((i) => {
          const labelValue = this.table.columnOptions[i].label;
W
溯源  
WeiFeng 已提交
643
          if (labelValue === item) {
P
ph 已提交
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758
            this.table.columnOptions[i].selected = true;
          }
        });
      });
      this.initChart();
      this.initColumm();
    },
    /**
     * Edit remarks
     * @param {Object} row
     */
    editRemarks(row) {
      row.editShow = false;
      row.isError = false;
      this.beforeEditValue = row.remark;
    },

    /**
     * Save remarks
     * @param {Object} row
     */
    saveRemarksValue(row) {
      const tagValidation = new RegExp('^[a-zA-Z0-9\u4e00-\u9fa5_.-]{1,128}$');
      const result = row.remark.length ? tagValidation.test(row.remark) : true;
      if (result) {
        row.isError = false;
        row.editShow = true;
        const params = {
          train_id: row.summary_dir,
          body: {
            remark: row.remark,
          },
        };
        this.putChangeToLineagesData(params);
      } else {
        row.isError = true;
      }
    },

    /**
     * Cancel save editing
     * @param {Object} row
     */
    cancelRemarksValue(row) {
      row.editShow = true;
      row.remark = this.beforeEditValue;
      row.isError = false;
    },

    /**
     *After the remark or tag is modified, invoke the interface and save the modification.
     * @param {Object} params
     */
    putChangeToLineagesData(params) {
      RequestService.putLineagesData(params)
          .then(
              (res) => {
                if (res) {
                  this.$message.success(this.$t('modelTraceback.changeSuccess'));
                }
              },
              (error) => {},
          )
          .catch(() => {});
    },

    selectinputFocus() {
      this.keyWord = '';
      this.checkOptions = this.basearr;
    },
    /**
     * Input search filtering in the select module.
     */
    myfilter() {
      const queryString = this.keyWord;
      const restaurants = this.basearr;
      const results = queryString
        ? this.createFilter(queryString, restaurants)
        : restaurants;
      this.checkOptions = results;
    },

    /**
     *Input search filtering in the select module.
     * @param {String} queryString
     * @param {Array} restaurants
     * @return {Array}
     */
    createFilter(queryString, restaurants) {
      const list = [];
      restaurants.forEach((item) => {
        const object = {};
        const options = [];
        if (item.options) {
          item.options.forEach((item) => {
            if (
              item.label.toLowerCase().indexOf(queryString.toLowerCase()) >= 0
            ) {
              const tempObj = {};
              tempObj.label = item.label;
              tempObj.value = item.value;
              tempObj.disabled = item.disabled;
              options.push(tempObj);
            }
          });
        }
        if (options.length > 0) {
          object.label = item.label;
          object.options = options;
          list.push(object);
        }
      });
      return list;
    },

P
ph 已提交
759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774
    getStoreList() {
      this.summaryDirList = this.$store.state.summaryDirList;
      if (this.summaryDirList) {
        this.tableFilter.summary_dir = {
          in: this.summaryDirList,
        };
      } else {
        this.tableFilter.summary_dir = undefined;
      }
    },

    /**
     * Initialization
     */
    init() {
      this.table = {
G
gaocongli 已提交
775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812
        columnOptions: {
          train_dataset_path: {
            label: this.$t('modelTraceback.trainSetPath'),
            required: true,
          },
          test_dataset_path: {
            label: this.$t('modelTraceback.testSetPath'),
            required: true,
          },
          loss: {
            label: 'loss',
            required: true,
          },
          network: {
            label: this.$t('modelTraceback.network'),
            required: true,
          },
          optimizer: {
            label: this.$t('modelTraceback.optimizer'),
            required: true,
          },
          train_dataset_count: {
            label: this.$t('modelTraceback.trainingSampleNum'),
            required: false,
          },
          test_dataset_count: {
            label: this.$t('modelTraceback.testSampleNum'),
            required: false,
          },
          learning_rate: {
            label: this.$t('modelTraceback.learningRate'),
            required: false,
          },
          epoch: {
            label: 'epoch',
            required: false,
          },
          batch_size: {
813
            label: 'steps_per_epoch',
G
gaocongli 已提交
814 815
            required: false,
          },
P
update  
ph 已提交
816 817 818 819
          device_num: {
            label: this.$t('modelTraceback.deviceNum'),
            required: false,
          },
G
gaocongli 已提交
820 821 822 823 824 825 826 827 828
          model_size: {
            label: this.$t('modelTraceback.modelSize'),
            required: false,
          },
          loss_function: {
            label: this.$t('modelTraceback.lossFunc'),
            required: false,
          },
        }, // All options of the column in the table
P
ph 已提交
829
        otherColumn: [], // Table Column
G
gaocongli 已提交
830 831 832
        mandatoryColumn: [], // Mandatory Table Column
        optionalColumn: [], // Optional Table Column
        data: [],
P
ph 已提交
833
        // no checked list
G
gaocongli 已提交
834 835 836 837 838 839 840 841 842 843 844 845 846 847
        optionsNotInCheckbox: [
          'summary_dir',
          'train_dataset_path',
          'test_dataset_path',
        ],
        optionsNotInEchart: [
          'summary_dir',
          'train_dataset_path',
          'test_dataset_path',
        ],
        optionsNotInTable: ['dataset_mark'],
        selectedColumn: [],
        selectAll: false, // Whether to select all columns
        indeterminate: false,
P
ph 已提交
848
      };
P
ph 已提交
849
      this.keysOfMixed = [];
P
ph 已提交
850 851 852 853 854 855 856 857 858 859 860 861 862

      this.userOptions = [];
      this.metricOptions = [];
      // metric list
      this.metricList = [];
      // User-defined list
      this.userDefinedList = [];
      // hyper list
      this.hyperList = [];
      this.summaryList = [];
      this.hyperOptions = [];
      this.otherTypeOptions = [];
      this.checkOptions = [];
P
update  
ph 已提交
863
      this.basearr = [];
P
ph 已提交
864 865 866
      this.selectArrayValue = [];
      // Obtain the hidden summary_dir list after initialization.
      this.hidenDirChecked = this.$store.state.hidenDirChecked || [];
P
ph 已提交
867
      this.queryLineagesData(true);
G
gaocongli 已提交
868 869 870 871 872
    },
    /**
     * Column initialization
     */
    initColumm() {
P
ph 已提交
873 874 875 876 877
      this.metricList = [];
      this.userDefinedList = [];
      // hyper list
      this.hyperList = [];
      this.summaryList = [];
G
gaocongli 已提交
878 879 880 881 882 883 884 885 886 887
      this.table.mandatoryColumn = Object.keys(this.table.columnOptions).filter(
          (i) => {
            return this.table.columnOptions[i].required;
          },
      );
      this.table.optionalColumn = Object.keys(this.table.columnOptions).filter(
          (i) => {
            return !this.table.columnOptions[i].required;
          },
      );
P
ph 已提交
888 889 890 891 892 893 894 895 896 897 898
      const columnList = Object.keys(this.table.columnOptions).filter((i) => {
        return (
          !this.table.optionsNotInTable.includes(i) &&
          this.table.columnOptions[i].selected
        );
      });
      const metricArray = [];
      const userDefinedArray = [];
      const columnArray = [];
      const hyperArray = [];
      columnList.forEach((item) => {
W
溯源  
WeiFeng 已提交
899
        if (item.indexOf('metric/') === 0) {
P
ph 已提交
900
          metricArray.push(item);
W
溯源  
WeiFeng 已提交
901
        } else if (item.indexOf('user_defined/') === 0) {
P
ph 已提交
902 903
          userDefinedArray.push(item);
        } else if (
W
溯源  
WeiFeng 已提交
904 905 906
          item === 'epoch' ||
          item === 'batch_size' ||
          item === 'learning_rate'
P
ph 已提交
907 908 909 910 911
        ) {
          hyperArray.push(item);
        } else {
          columnArray.push(item);
        }
G
gaocongli 已提交
912
      });
P
ph 已提交
913 914 915 916 917 918 919
      this.showTable = true;
      this.table.otherColumn = columnArray;
      this.metricList = metricArray;
      this.userDefinedList = userDefinedArray;
      // hyper list
      this.hyperList = hyperArray;

G
gaocongli 已提交
920 921 922
      this.table.selectedColumn = this.table.optionalColumn;
      this.table.selectAll = true;
      this.showTable = true;
P
ph 已提交
923 924 925
      this.$nextTick(() => {
        this.$refs.table.doLayout();
      });
G
gaocongli 已提交
926 927 928 929 930
    },
    /**
     * Querying All Model Version Information
     * @param {Boolean} allData Indicates whether to query all data
     */
P
ph 已提交
931 932 933 934 935 936 937 938
    queryLineagesData(allData) {
      const params = {
        body: {},
      };
      const tempParam = {
        sorted_name: this.sortInfo.sorted_name,
        sorted_type: this.sortInfo.sorted_type,
      };
G
gaocongli 已提交
939
      if (!allData) {
P
ph 已提交
940 941 942
        this.summaryDirList = this.$store.state.summaryDirList;
        this.tableFilter.summary_dir = {
          in: this.summaryDirList,
G
gaocongli 已提交
943
        };
P
ph 已提交
944 945 946

        tempParam.limit = this.pagination.pageSize;
        tempParam.offset = this.pagination.currentPage - 1;
P
ph 已提交
947 948 949 950 951 952 953 954
        params.body = Object.assign(
            params.body,
            this.chartFilter,
            tempParam,
            this.tableFilter,
        );
      } else {
        params.body = Object.assign(params.body, this.tableFilter);
G
gaocongli 已提交
955
      }
P
ph 已提交
956
      RequestService.queryLineagesData(params)
G
gaocongli 已提交
957 958 959
          .then(
              (res) => {
                if (res && res.data && res.data.object) {
P
ph 已提交
960
                  const list = this.setDataOfModel(res.data.object);
G
gaocongli 已提交
961
                  if (allData) {
P
ph 已提交
962
                    let customized = {};
963
                    if (res.data.customized) {
P
ph 已提交
964
                      customized = JSON.parse(JSON.stringify(res.data.customized));
965
                      const customizedKeys = Object.keys(customized);
P
ph 已提交
966
                      if (customizedKeys.length) {
967 968 969 970 971
                        customizedKeys.forEach((i) => {
                          if (customized[i].type === 'int') {
                            this.keysOfIntValue.push(i);
                          } else if (customized[i].type === 'str') {
                            this.keysOfStringValue.push(i);
P
ph 已提交
972 973 974 975
                          } else if (customized[i].type === 'mixed') {
                            // list of type mixed
                            this.keysOfMixed.push(i);
                            this.keysOfStringValue.push(i);
976
                          }
P
ph 已提交
977
                          if (i.startsWith(this.replaceStr.userDefined)) {
P
ph 已提交
978
                            this.labelObj.userDefined = 'userDefined';
P
ph 已提交
979 980 981 982
                            customized[i].label = customized[i].label.replace(
                                this.replaceStr.userDefined,
                                '[U]',
                            );
P
ph 已提交
983 984 985 986
                            const userDefinedObject = {value: '', label: ''};
                            userDefinedObject.value = customized[i].label;
                            userDefinedObject.label = customized[i].label;
                            this.userOptions.push(userDefinedObject);
P
ph 已提交
987 988 989 990 991
                          } else if (i.startsWith(this.replaceStr.metric)) {
                            customized[i].label = customized[i].label.replace(
                                this.replaceStr.metric,
                                '[M]',
                            );
P
ph 已提交
992 993 994 995 996 997
                            this.labelObj.metric = 'metric';
                            const metricObject = {value: '', label: ''};
                            metricObject.value = customized[i].label;
                            metricObject.label = customized[i].label;
                            metricObject.disabled = true;
                            this.metricOptions.push(metricObject);
P
ph 已提交
998
                          }
999
                        });
P
ph 已提交
1000
                        this.haveCustomizedParams = true;
1001
                      }
P
ph 已提交
1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056
                      this.checkOptions = [
                        {
                          label: '',
                          options: [
                            {
                              value: this.$t('modelTraceback.dataProcess'),
                              label: this.$t('modelTraceback.dataProcess'),
                              disabled: true,
                            },
                          ],
                        },
                      ];
                      this.basearr = [
                        {
                          label: '',
                          options: [
                            {
                              value: this.$t('modelTraceback.dataProcess'),
                              label: this.$t('modelTraceback.dataProcess'),
                              disabled: true,
                            },
                          ],
                        },
                      ];
                      if (this.labelObj.metric) {
                        const metricTemp = {
                          label: 'Metric',
                          options: this.metricOptions,
                        };
                        this.checkOptions.push(metricTemp);
                        this.basearr.push(metricTemp);
                      }
                      if (this.labelObj.userDefined) {
                        const userTemp = {
                          label: 'UserDefined',
                          options: this.userOptions,
                        };
                        this.checkOptions.push(userTemp);
                        this.basearr.push(userTemp);
                      }
                      Object.keys(this.table.columnOptions).forEach((item) => {
                        if (
                          item !== 'epoch' &&
                      item !== 'learning_rate' &&
                      item !== 'batch_size'
                        ) {
                          const index = this.table.optionsNotInCheckbox.indexOf(
                              item,
                          );
                          if (index < 0) {
                            const otherType = {value: '', label: ''};
                            otherType.value = this.table.columnOptions[item].label;
                            otherType.label = this.table.columnOptions[item].label;
                            if (
                              otherType.value === 'loss' ||
P
update  
ph 已提交
1057 1058 1059 1060
                          otherType.value ===
                            this.$t('modelTraceback.network') ||
                          otherType.value ===
                            this.$t('modelTraceback.optimizer')
P
ph 已提交
1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088
                            ) {
                              otherType.disabled = true;
                            }
                            this.otherTypeOptions.push(otherType);
                          }
                        } else {
                          const hyperObject = {value: '', label: ''};
                          hyperObject.value = this.table.columnOptions[item].label;
                          hyperObject.label = this.table.columnOptions[item].label;
                          this.hyperOptions.push(hyperObject);
                        }
                      });
                      if (this.hyperOptions.length) {
                        const hyperTemp = {
                          label: this.$t('modelTraceback.hyperLabel'),
                          options: this.hyperOptions,
                        };
                        this.checkOptions.push(hyperTemp);
                        this.basearr.push(hyperTemp);
                      }
                      if (this.otherTypeOptions.length) {
                        const otherTemp = {
                          label: this.$t('modelTraceback.otherLabel'),
                          options: this.otherTypeOptions,
                        };
                        this.checkOptions.push(otherTemp);
                        this.basearr.push(otherTemp);
                      }
1089
                    }
P
ph 已提交
1090 1091 1092 1093 1094
                    this.checkOptions.forEach((item) => {
                      item.options.forEach((option) => {
                        this.selectArrayValue.push(option.label);
                      });
                    });
P
ph 已提交
1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109
                    this.table.columnOptions = Object.assign(
                        {
                          summary_dir: {
                            label: this.$t('modelTraceback.summaryPath'),
                            required: true,
                          },
                          dataset_mark: {
                            label: this.$t('modelTraceback.dataProcess'),
                            required: true,
                          },
                        },
                        customized,
                        this.table.columnOptions,
                    );
                    this.$store.commit('customizedColumnOptions', customized);
G
gaocongli 已提交
1110

P
ph 已提交
1111
                    this.noData = !res.data.object.length;
P
ph 已提交
1112 1113 1114 1115 1116
                    this.showEchartPic = !!res.data.object.length;
                    if (this.hidenDirChecked.length) {
                      const tempEchartData = this.setDataOfModel(res.data.object);
                      this.hidenDirChecked.forEach((dir) => {
                        tempEchartData.forEach((item, index) => {
W
溯源  
WeiFeng 已提交
1117
                          if (item.summary_dir === dir) {
P
ph 已提交
1118 1119 1120 1121
                            tempEchartData.splice(index, 1);
                          }
                        });
                      });
W
溯源  
WeiFeng 已提交
1122
                      if (tempEchartData.length === 0) {
P
ph 已提交
1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133
                        this.showEchartPic = false;
                      } else {
                        this.showEchartPic = true;
                        this.echart.allData = tempEchartData;
                        this.echart.brushData = tempEchartData;
                      }
                    } else {
                      this.echart.allData = list;
                      this.echart.brushData = list;
                    }
                    this.echart.showData = this.echart.brushData;
G
gaocongli 已提交
1134
                    Object.keys(this.table.columnOptions).forEach((i) => {
P
ph 已提交
1135
                      this.table.columnOptions[i].selected = true;
G
gaocongli 已提交
1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157
                      const flag = list.some((val) => {
                        return val[i] || val[i] === 0;
                      });
                      if (!flag) {
                        let index = this.table.optionsNotInCheckbox.indexOf(i);
                        if (index >= 0) {
                          this.table.optionsNotInCheckbox.splice(index, 1);
                        }
                        index = this.table.optionsNotInEchart.indexOf(i);
                        if (index >= 0) {
                          this.table.optionsNotInEchart.splice(index, 1);
                        }
                        index = this.table.optionsNotInTable.indexOf(i);
                        if (index >= 0) {
                          this.table.optionsNotInTable.splice(index, 1);
                        }

                        delete this.table.columnOptions[i];
                      }
                    });
                    this.initColumm();
                    this.initChart();
P
ph 已提交
1158 1159 1160 1161 1162
                    const tempList = list.slice(0, this.pagination.pageSize);
                    this.recordsNumber = tempList.length;
                    if (this.hidenDirChecked.length) {
                      this.hidenDirChecked.forEach((dir) => {
                        tempList.forEach((item, index) => {
W
溯源  
WeiFeng 已提交
1163
                          if (item.summary_dir === dir) {
P
ph 已提交
1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185
                            tempList.splice(index, 1);
                          }
                        });
                      });
                    }
                    this.showNumber = tempList.length;
                    this.table.data = tempList;
                  } else {
                    const tempList = list.slice(0, this.pagination.pageSize);
                    this.recordsNumber = tempList.length;
                    this.hidenDirChecked = this.$store.state.hidenDirChecked || [];
                    if (this.hidenDirChecked.length) {
                      this.hidenDirChecked.forEach((dir) => {
                        tempList.forEach((item, index) => {
                          if (item.summary_dir === dir) {
                            tempList.splice(index, 1);
                          }
                        });
                      });
                    }
                    this.showNumber = tempList.length;
                    this.table.data = tempList;
G
gaocongli 已提交
1186 1187 1188 1189 1190
                  }

                  this.pagination.total = res.data.count || 0;
                } else {
                  this.noData = allData;
P
ph 已提交
1191
                  this.showEchartPic = !allData;
G
gaocongli 已提交
1192 1193 1194 1195 1196
                }
              },
              (error) => {
                if (allData) {
                  this.noData = allData;
P
ph 已提交
1197
                  this.showEchartPic = !allData;
G
gaocongli 已提交
1198 1199 1200 1201 1202
                }
              },
          )
          .catch(() => {});
    },
P
ph 已提交
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212

    /**
     * Selected data in the table
     * @param {Array} data
     * @return {Array}
     */
    setDataOfModel(data = []) {
      const modelLineageList = [];
      data.forEach((item) => {
        if (item.model_lineage) {
P
ph 已提交
1213 1214
          item.model_lineage.editShow = true;
          item.model_lineage.isError = false;
P
ph 已提交
1215
          item.model_lineage.summary_dir = item.summary_dir;
P
ph 已提交
1216 1217 1218 1219 1220 1221
          item.model_lineage.remark = item.added_info.remark
            ? item.added_info.remark
            : '';
          item.model_lineage.tag = item.added_info.tag
            ? item.added_info.tag
            : 0;
P
ph 已提交
1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254
          const modelData = JSON.parse(JSON.stringify(item.model_lineage));
          modelData.model_size = parseFloat(
              ((modelData.model_size || 0) / 1024 / 1024).toFixed(2),
          );
          const keys = Object.keys(modelData.metric || {});
          if (keys.length) {
            keys.forEach((key) => {
              if (modelData.metric[key] || modelData.metric[key] === 0) {
                const temp = this.replaceStr.metric + key;
                modelData[temp] = modelData.metric[key];
              }
            });
            delete modelData.metric;
          }
          const udkeys = Object.keys(modelData.user_defined || {});
          if (udkeys.length) {
            udkeys.forEach((key) => {
              if (
                modelData.user_defined[key] ||
                modelData.user_defined[key] === 0
              ) {
                const temp = this.replaceStr.userDefined + key;
                modelData[temp] = modelData.user_defined[key];
              }
            });
            delete modelData.user_defined;
          }
          modelLineageList.push(modelData);
        }
      });
      return modelLineageList;
    },

G
gaocongli 已提交
1255 1256 1257 1258 1259
    /**
     * Selected data in the table
     * @param {Array} list Selected data in the table
     */
    selectionChange(list = []) {
P
ph 已提交
1260 1261 1262
      if (this.hideRecord) {
        return;
      }
G
gaocongli 已提交
1263 1264
      this.echart.showData = list.length ? list : this.echart.brushData;
      this.initChart();
P
ph 已提交
1265
      this.checkedSummary = list;
G
gaocongli 已提交
1266 1267 1268 1269 1270 1271 1272 1273
      const summaryDirFilter = [];
      this.echart.showData.forEach((i) => {
        summaryDirFilter.push(i.summary_dir);
      });
      this.tableFilter.summary_dir = {
        in: summaryDirFilter,
      };
    },
P
ph 已提交
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298

    /**
     * Selected data in the table
     */
    selectValueChange() {
      const list = [];
      this.basearr.forEach((item) => {
        item.options.forEach((option) => {
          list.push(option.label);
        });
      });
      if (list.length > this.selectArrayValue.length) {
        this.selectCheckAll = false;
      } else {
        this.selectCheckAll = true;
      }
      let allList = [];
      const listA = [this.$t('modelTraceback.summaryPath')];
      allList = this.selectArrayValue.concat(listA);
      Object.keys(this.table.columnOptions).filter((i) => {
        this.table.columnOptions[i].selected = false;
      });
      allList.forEach((item) => {
        Object.keys(this.table.columnOptions).filter((i) => {
          const labelValue = this.table.columnOptions[i].label;
W
溯源  
WeiFeng 已提交
1299
          if (labelValue === item) {
P
ph 已提交
1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327
            this.table.columnOptions[i].selected = true;
          }
        });
      });
      this.initChart();
      this.initColumm();
    },

    /**
     * Hidden records
     */
    hiddenRecords() {
      this.hideRecord = true;
      if (this.checkedSummary.length) {
        this.checkedSummary.forEach((i) => {
          this.hidenDirChecked.push(i.summary_dir);
        });
      }
      this.checkedSummary = [];
      this.summaryDirList = this.$store.state.summaryDirList;
      this.tableFilter.summary_dir = {
        in: this.summaryDirList,
      };
      this.$store.commit('setHidenDirChecked', this.hidenDirChecked);
      if (this.hidenDirChecked.length) {
        const tempEchartData = this.echart.brushData;
        this.hidenDirChecked.forEach((dir) => {
          tempEchartData.forEach((item, index) => {
W
溯源  
WeiFeng 已提交
1328
            if (item.summary_dir === dir) {
P
ph 已提交
1329 1330 1331 1332 1333 1334 1335
              tempEchartData.splice(index, 1);
            }
          });
        });
        const tableTemp = this.table.data;
        this.hidenDirChecked.forEach((dir) => {
          tableTemp.forEach((item, index) => {
W
溯源  
WeiFeng 已提交
1336
            if (item.summary_dir === dir) {
P
ph 已提交
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388
              tableTemp.splice(index, 1);
            }
          });
        });
        this.table.data = tableTemp;
        this.showNumber = tableTemp.length;
        this.echart.showData = tempEchartData;
        // Restore the style of the table selection box.
        this.$refs.table.clearSelection();
        if (this.echart.showData.length > 0) {
          this.initChart();
        } else {
          this.showEchartPic = false;
        }
      }
      this.hideRecord = false;
    },
    /**
     * Unhide
     */
    unhideRecords() {
      this.showEchartPic = true;
      this.$refs.table.clearSelection();
      this.$store.commit('setHidenDirChecked', []);
      if (this.hidenDirChecked.length) {
        this.checkedSummary = [];
        this.hidenDirChecked = [];
      }
      const params = {
        body: {},
      };
      const tempParam = {
        sorted_name: this.sortInfo.sorted_name,
        sorted_type: this.sortInfo.sorted_type,
      };
      this.summaryDirList = this.$store.state.summaryDirList;
      this.tableFilter.summary_dir = {
        in: this.summaryDirList,
      };
      params.body = Object.assign(
          params.body,
          this.chartFilter,
          tempParam,
          this.tableFilter,
      );
      RequestService.queryLineagesData(params).then(
          (res) => {
            if (res && res.data && res.data.object) {
              const list = this.setDataOfModel(res.data.object);
              this.echart.allData = list;
              this.echart.brushData = list;
              this.echart.showData = this.echart.brushData;
1389 1390 1391 1392
              this.$nextTick(() => {
                this.resizeChart();
                this.initChart();
              });
P
ph 已提交
1393
              const showList = list.slice(
P
ph 已提交
1394 1395 1396
                  (this.pagination.currentPage - 1) * this.pagination.pageSize,
                  this.pagination.currentPage * this.pagination.pageSize,
              );
P
ph 已提交
1397
              this.table.data = showList;
P
ph 已提交
1398 1399 1400 1401 1402 1403 1404 1405 1406
              this.recordsNumber = this.table.data.length;
              this.showNumber = this.table.data.length;
              this.pagination.total = res.data.count || 0;
            }
          },
          (error) => {},
      );
    },

G
gaocongli 已提交
1407 1408 1409 1410 1411 1412 1413
    /**
     * Sort data in the table
     * @param {Object} column current column
     */
    sortChange(column) {
      this.sortInfo.sorted_name = column.prop;
      this.sortInfo.sorted_type = column.order;
P
ph 已提交
1414 1415
      this.recordsNumber = 0;
      this.showNumber = 0;
P
ph 已提交
1416
      this.getStoreList();
G
gaocongli 已提交
1417 1418 1419 1420 1421 1422 1423
      const tempParam = {
        limit: this.pagination.pageSize,
        offset: 0,
        sorted_name: this.sortInfo.sorted_name,
        sorted_type: this.sortInfo.sorted_type,
      };
      const params = {};
P
ph 已提交
1424 1425 1426 1427 1428 1429 1430
      params.body = Object.assign(
          {},
          tempParam,
          this.tableFilter,
          this.chartFilter || {},
      );
      RequestService.queryLineagesData(params)
G
gaocongli 已提交
1431 1432 1433
          .then(
              (res) => {
                if (res && res.data && res.data.object) {
P
ph 已提交
1434
                  const list = this.setDataOfModel(res.data.object);
P
ph 已提交
1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447
                  const tempList = list.slice(0, this.pagination.pageSize);
                  this.recordsNumber = tempList.length;
                  if (this.hidenDirChecked.length) {
                    this.hidenDirChecked.forEach((dir) => {
                      tempList.forEach((item, index) => {
                        if (item.summary_dir === dir) {
                          tempList.splice(index, 1);
                        }
                      });
                    });
                  }
                  this.showNumber = tempList.length;
                  this.table.data = tempList;
G
gaocongli 已提交
1448
                  this.pagination.total = res.data.count || 0;
P
ph 已提交
1449
                  this.pagination.currentPage = 1;
G
gaocongli 已提交
1450 1451 1452 1453 1454 1455
                }
              },
              (error) => {},
          )
          .catch(() => {});
    },
P
ph 已提交
1456

G
gaocongli 已提交
1457 1458 1459 1460
    /**
     * Initializing the Eechart
     */
    initChart() {
P
ph 已提交
1461 1462 1463 1464 1465 1466
      const chartAxis = Object.keys(this.table.columnOptions).filter((i) => {
        return (
          this.table.columnOptions[i].selected &&
          !this.table.optionsNotInEchart.includes(i)
        );
      });
G
gaocongli 已提交
1467 1468
      const data = [];
      this.echart.showData.forEach((i, index) => {
P
ph 已提交
1469 1470
        let item = {};
        item = {
G
gaocongli 已提交
1471 1472 1473 1474 1475 1476 1477 1478 1479
          lineStyle: {
            normal: {
              color: CommonProperty.commonColorArr[index % 10],
            },
          },
          value: [],
        };

        chartAxis.forEach((key) => {
P
ph 已提交
1480
          if (
W
溯源  
WeiFeng 已提交
1481
            (i[key] || i[key] === 0) &&
P
ph 已提交
1482 1483 1484 1485 1486 1487 1488 1489
            this.keysOfMixed &&
            this.keysOfMixed.length &&
            this.keysOfMixed.includes(key)
          ) {
            item.value.push(i[key].toString());
          } else {
            item.value.push(i[key]);
          }
G
gaocongli 已提交
1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501
        });
        data.push(item);
      });

      const parallelAxis = [];
      chartAxis.forEach((key, index) => {
        const obj = {dim: index, scale: true, id: key};
        obj.name = this.table.columnOptions[key].label;
        if (this.keysOfStringValue.includes(key)) {
          const values = {};
          this.echart.showData.forEach((i) => {
            if (i[key] || i[key] === 0) {
P
ph 已提交
1502
              values[i[key].toString()] = i[key].toString();
G
gaocongli 已提交
1503 1504 1505 1506 1507 1508 1509 1510
            }
          });
          obj.type = 'category';
          obj.data = Object.keys(values);
          if (key === 'dataset_mark') {
            obj.axisLabel = {
              show: false,
            };
P
ph 已提交
1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537
          } else {
            obj.axisLabel = {
              formatter: function(val) {
                const strs = val.split('');
                let str = '';
                if (val.length > 100) {
                  return val.substring(0, 12) + '...';
                } else {
                  if (chartAxis.length < 10) {
                    for (let i = 0, s = ''; (s = strs[i++]); ) {
                      str += s;
                      if (!(i % 16)) {
                        str += '\n';
                      }
                    }
                  } else {
                    for (let i = 0, s = ''; (s = strs[i++]); ) {
                      str += s;
                      if (!(i % 12)) {
                        str += '\n';
                      }
                    }
                  }
                  return str;
                }
              },
            };
G
gaocongli 已提交
1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548
          }
        }
        if (this.keysOfIntValue.includes(key)) {
          obj.minInterval = 1;
        }
        parallelAxis.push(obj);
      });

      const echartOption = {
        backgroundColor: 'white',
        parallelAxis: parallelAxis,
1549 1550 1551
        tooltip: {
          trigger: 'axis',
        },
G
gaocongli 已提交
1552
        parallel: {
W
WeiFeng 已提交
1553
          top: 25,
G
gaocongli 已提交
1554
          left: 50,
P
ph 已提交
1555
          right: 100,
G
gaocongli 已提交
1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583
          bottom: 10,
          parallelAxisDefault: {
            type: 'value',
            nameLocation: 'end',
            nameGap: 6,
            nameTextStyle: {
              color: '#000000',
              fontSize: 14,
            },
            axisLine: {
              lineStyle: {
                color: '#6D7278',
              },
            },
            axisTick: {
              lineStyle: {
                color: '#6D7278',
              },
            },
            axisLabel: {
              textStyle: {
                fontSize: 10,
                color: '#6C7280',
              },
            },
            areaSelectStyle: {
              width: 40,
            },
1584 1585 1586
            tooltip: {
              show: true,
            },
G
gaocongli 已提交
1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612
            realtime: false,
          },
        },
        series: {
          type: 'parallel',
          lineStyle: {
            normal: {
              width: 1,
              opacity: 1,
            },
          },
          data: data,
        },
      };

      if (this.echart.chart) {
        this.echart.chart.off('axisareaselected', null);
        window.removeEventListener('resize', this.resizeChart, false);
      }

      this.echart.chart = Echarts.init(document.querySelector('#echart'));
      this.echart.chart.setOption(echartOption, true);
      window.addEventListener('resize', this.resizeChart, false);

      // select use api
      this.echart.chart.on('axisareaselected', (params) => {
P
ph 已提交
1613 1614 1615
        // key of mixed item
        this.recordsNumber = 0;
        this.showNumber = 0;
G
gaocongli 已提交
1616
        const key = params.parallelAxisId;
P
ph 已提交
1617 1618 1619 1620 1621 1622 1623 1624 1625
        if (
          this.keysOfMixed &&
          this.keysOfMixed.length &&
          this.keysOfMixed.includes(key)
        ) {
          this.$message.error(this.$t('modelTraceback.mixedItemMessage'));
          this.initChart();
          return;
        }
P
ph 已提交
1626 1627 1628 1629
        const list = this.$store.state.selectedBarList || [];
        const selectedAxisId = params.parallelAxisId;
        if (list.length) {
          list.forEach((item, index) => {
W
溯源  
WeiFeng 已提交
1630
            if (item === selectedAxisId) {
P
ph 已提交
1631 1632 1633 1634 1635 1636 1637
              list.splice(index, 1);
            }
          });
        }
        list.push(selectedAxisId);
        this.$store.commit('setSelectedBarList', list);

G
gaocongli 已提交
1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673
        let range = params.intervals[0] || [];
        const [axisData] = parallelAxis.filter((i) => {
          return i.id === key;
        });

        if (axisData && range.length === 2) {
          if (axisData && axisData.id === 'model_size') {
            range = [
              parseInt(range[0] * 1024 * 1024, 0),
              parseInt(range[1] * 1024 * 1024, 0),
            ];
          }
          if (axisData.type === 'category') {
            const rangeData = {};
            for (let i = range[0]; i <= range[1]; i++) {
              rangeData[axisData.data[i]] = axisData.data[i];
            }
            const rangeDataKey = Object.keys(rangeData);
            this.chartFilter[key] = {
              in: rangeDataKey,
            };
          } else {
            if (this.keysOfIntValue.includes(key)) {
              range[1] = Math.floor(range[1]);
              range[0] = Math.ceil(range[0]);
            }
            this.chartFilter[key] = {
              le: range[1],
              ge: range[0],
            };
          }
          const filterParams = {};
          filterParams.body = Object.assign(
              {},
              this.chartFilter,
              this.tableFilter,
P
ph 已提交
1674 1675 1676 1677 1678 1679
          );
          const tableParams = {};
          tableParams.body = Object.assign(
              {},
              this.chartFilter,
              this.tableFilter,
G
gaocongli 已提交
1680 1681
              this.sortInfo,
          );
P
ph 已提交
1682
          RequestService.queryLineagesData(filterParams)
G
gaocongli 已提交
1683 1684
              .then(
                  (res) => {
P
ph 已提交
1685 1686 1687 1688 1689 1690
                    if (
                      res &&
                  res.data &&
                  res.data.object &&
                  res.data.object.length
                    ) {
P
ph 已提交
1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724
                      let customized = {};
                      customized = JSON.parse(JSON.stringify(res.data.customized));
                      const customizedKeys = Object.keys(customized);
                      if (customizedKeys.length) {
                        this.keysOfStringValue = [
                          'summary_dir',
                          'network',
                          'optimizer',
                          'loss_function',
                          'train_dataset_path',
                          'test_dataset_path',
                          'dataset_mark',
                        ];
                        this.keysOfIntValue = [
                          'train_dataset_count',
                          'test_dataset_count',
                          'epoch',
                          'batch_size',
                          'device_num',
                        ];
                        this.keysOfMixed = [];
                        customizedKeys.forEach((i) => {
                          if (customized[i].type === 'int') {
                            this.keysOfIntValue.push(i);
                          } else if (customized[i].type === 'str') {
                            this.keysOfStringValue.push(i);
                          } else if (customized[i].type === 'mixed') {
                            // list of type mixed
                            this.keysOfMixed.push(i);
                            this.keysOfStringValue.push(i);
                          }
                        });
                      }

P
ph 已提交
1725
                      const list = this.setDataOfModel(res.data.object);
P
ph 已提交
1726 1727 1728 1729 1730 1731 1732 1733 1734
                      if (this.hidenDirChecked.length) {
                        this.hidenDirChecked.forEach((dir) => {
                          list.forEach((item, index) => {
                            if (item.summary_dir === dir) {
                              list.splice(index, 1);
                            }
                          });
                        });
                      }
P
update  
ph 已提交
1735 1736 1737 1738 1739 1740 1741 1742
                      if (!list.length) {
                        this.noData = true;
                        this.showEchartPic = false;
                        this.summaryDirList = [];
                        this.checkedSummary = [];
                        this.$store.commit('setSummaryDirList', []);
                        return;
                      }
P
ph 已提交
1743
                      const summaryDirList = list.map((i) => i.summary_dir);
P
ph 已提交
1744
                      this.$store.commit('setSummaryDirList', summaryDirList);
G
gaocongli 已提交
1745 1746
                      this.echart.showData = this.echart.brushData = list;
                      this.initChart();
P
ph 已提交
1747
                      this.getTableList(tableParams);
P
ph 已提交
1748 1749 1750
                    } else {
                      this.summaryDirList = [];
                      this.$store.commit('setSummaryDirList', []);
P
ph 已提交
1751
                      this.checkedSummary = [];
P
ph 已提交
1752
                      this.noData = true;
P
ph 已提交
1753
                      this.showEchartPic = false;
G
gaocongli 已提交
1754 1755 1756 1757 1758 1759 1760 1761
                    }
                  },
                  (error) => {},
              )
              .catch(() => {});
        }
      });
    },
P
ph 已提交
1762 1763 1764 1765 1766 1767 1768 1769 1770 1771
    /**
     * Get table data
     * @param {Object} tableParams
     */
    getTableList(tableParams) {
      RequestService.queryLineagesData(tableParams)
          .then(
              (res) => {
                if (res && res.data && res.data.object && res.data.object.length) {
                  const list = this.setDataOfModel(res.data.object);
P
ph 已提交
1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785

                  if (this.hidenDirChecked.length) {
                    this.hidenDirChecked.forEach((dir) => {
                      list.forEach((item, index) => {
                        if (item.summary_dir === dir) {
                          list.splice(index, 1);
                        }
                      });
                    });
                  }
                  const tempList = list.slice(0, this.pagination.pageSize);
                  this.recordsNumber = tempList.length;
                  this.showNumber = tempList.length;
                  this.table.data = tempList;
P
ph 已提交
1786 1787 1788 1789 1790 1791 1792 1793 1794
                  this.pagination.currentPage = 1;
                  this.pagination.total = this.echart.brushData.length;
                  this.$refs.table.clearSelection();
                }
              },
              (error) => {},
          )
          .catch(() => {});
    },
G
gaocongli 已提交
1795 1796 1797 1798
    /**
     * Resetting the Eechart
     */
    resetChart() {
P
ph 已提交
1799 1800 1801 1802 1803
      this.summaryDirList = undefined;
      this.$store.commit('setSummaryDirList', undefined);
      this.$store.commit('setSelectedBarList', []);
      this.noData = false;
      this.showTable = false;
P
ph 已提交
1804
      this.selectCheckAll = true;
G
gaocongli 已提交
1805
      this.chartFilter = {};
P
ph 已提交
1806
      this.tableFilter.summary_dir = undefined;
P
ph 已提交
1807
      this.sortInfo = {};
G
gaocongli 已提交
1808
      this.pagination.currentPage = 1;
P
ph 已提交
1809 1810 1811 1812 1813
      this.echart.allData = [];
      if (this.echart.chart) {
        this.echart.chart.clear();
      }
      this.init();
G
gaocongli 已提交
1814 1815
      this.$refs.table.clearSelection();
    },
P
ph 已提交
1816

G
gaocongli 已提交
1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850
    /**
     * Jump to the training dashboard
     * @param {String} id
     */
    jumpToTrainDashboard(id) {
      const trainId = encodeURIComponent(id);
      const routeUrl = this.$router.resolve({
        path: '/train-manage/training-dashboard',
        query: {id: trainId},
      });
      window.open(routeUrl.href, '_blank');
    },
    /**
     * Keep the number with n decimal places.
     * @param {Number} num
     * @param {Number} pow Number of decimal places
     * @return {Number}
     */
    toFixedFun(num, pow) {
      if (isNaN(num) || isNaN(pow) || !num || !pow) {
        return num;
      }
      return Math.round(num * Math.pow(10, pow)) / Math.pow(10, pow);
    },
    /**
     * Formatting Data
     * @param {String} key
     * @param {String} value
     * @return {Object}
     */
    formatNumber(key, value) {
      if (isNaN(value) || !value) {
        return value;
      } else {
P
ph 已提交
1851 1852
        if (key === 'learning_rate') {
          let temp = value.toPrecision(4);
G
gaocongli 已提交
1853 1854 1855 1856 1857
          let row = 0;
          while (temp < 1) {
            temp = temp * 10;
            row += 1;
          }
P
ph 已提交
1858
          temp = this.toFixedFun(temp, 4);
G
gaocongli 已提交
1859 1860 1861 1862 1863
          return `${temp}${row ? `e-${row}` : ''}`;
        } else if (key === 'model_size') {
          return value + 'MB';
        } else {
          if (value < 1000) {
P
ph 已提交
1864
            return Math.round(value * Math.pow(10, 4)) / Math.pow(10, 4);
G
gaocongli 已提交
1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878
          } else {
            const reg = /(?=(\B)(\d{3})+$)/g;
            return (value + '').replace(reg, ',');
          }
        }
      }
    },
    /**
     * Resizing Chart
     */
    resizeChart() {
      this.echart.chart.resize();
    },
  },
P
ph 已提交
1879 1880 1881
  /**
   * Destroy the page
   */
G
gaocongli 已提交
1882
  destroyed() {
P
ph 已提交
1883 1884 1885 1886 1887 1888 1889
    if (this.checkedSummary.length) {
      const tempList = [];
      this.checkedSummary.forEach((item) => {
        tempList.push(item.summary_dir);
      });
      this.$store.commit('setSummaryDirList', tempList);
    }
G
gaocongli 已提交
1890 1891 1892 1893 1894
    if (this.echart.chart) {
      window.removeEventListener('resize', this.resizeChart, false);
      this.echart.chart.clear();
      this.echart.chart = null;
    }
P
ph 已提交
1895
    document.removeEventListener('resize', this.blurFloat);
G
gaocongli 已提交
1896 1897 1898 1899
  },
};
</script>
<style lang="scss">
W
溯源  
WeiFeng 已提交
1900 1901
.label-text {
  line-height: 20px !important;
P
ph 已提交
1902 1903
  padding-top: 20px;
  display: block !important;
W
溯源  
WeiFeng 已提交
1904 1905
}
.remark-tip {
P
ph 已提交
1906
  line-height: 20px !important;
W
溯源  
WeiFeng 已提交
1907 1908 1909
  font-size: 12px;
  white-space: pre-wrap !important;
  color: gray;
P
ph 已提交
1910
  display: block !important;
W
溯源  
WeiFeng 已提交
1911
}
P
ph 已提交
1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945
.el-color-dropdown__main-wrapper,
.el-color-dropdown__value,
.el-color-alpha-slider {
  display: none;
}
.el-tag.el-tag--info .el-tag__close {
  color: #fff;
}
// select
.el-select > .el-input {
  min-width: 280px !important;
  max-width: 500px !important;
}
.select-inner-input {
  width: calc(100% - 140px);
  margin: 2px 4px;
  display: inline-block;
}
.select-input-button {
  position: relative;
}
.el-select-group__title {
  font-size: 14px;
  font-weight: 700;
}
.el-select-dropdown__item.selected {
  font-weight: 400;
}
.checked-color {
  color: #00a5a7 !important;
}
.el-tag.el-tag--info .el-tag__close {
  display: none;
}
P
update  
ph 已提交
1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968
.btn-disabled {
  cursor: not-allowed !important;
}
.select-all-button {
  padding: 4px 0;
  display: inline-block;
  position: absolute;
  right: 80px;
  padding: 5px;
  height: 32px;
  border: none;
  background: none;
}
.deselect-all-button {
  padding: 4px 0;
  display: inline-block;
  position: absolute;
  right: 10px;
  padding: 5px;
  height: 32px;
  border: none;
  background: none;
}
P
ph 已提交
1969

G
gaocongli 已提交
1970 1971 1972 1973
#cl-model-traceback {
  height: 100%;
  overflow-y: auto;
  position: relative;
P
ph 已提交
1974 1975 1976 1977

  .icon-border {
    border: 1px solid #00a5a7 !important;
  }
1978
  #tag-dialog {
P
ph 已提交
1979 1980 1981 1982 1983 1984
    z-index: 999;
    border: 1px solid #d6c9c9;
    position: fixed;
    width: 326px;
    height: 120px;
    background-color: #efebeb;
1985
    right: 106px;
P
ph 已提交
1986 1987
    border-radius: 4px;
  }
1988 1989 1990 1991 1992 1993 1994 1995 1996 1997
  .custom-btn {
    border: 1px solid #00a5a7;
    border-radius: 2px;
    background-color: white;
    color: #00a5a7;
  }
  .custom-btn:hover {
    color: #00a5a7;
    background: #e9f7f7;
  }
P
ph 已提交
1998 1999 2000 2001 2002
  .icon-image {
    display: inline-block;
    padding: 4px;
    height: 30px;
    width: 30px;
W
溯源  
WeiFeng 已提交
2003
    border: 1px solid transparent;
P
ph 已提交
2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017
  }
  .icon-image-container {
    margin: 16px 10px 18px;
  }
  .edit-text-container {
    display: inline-block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .btns {
    margin-left: 20px;
    padding-top: 12px;
P
ph 已提交
2018
    height: 46px;
P
ph 已提交
2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069
  }
  .btn-container-margin {
    margin: 0 55px 10px;
  }
  .btns-container {
    padding: 14px 32px 4px;
  }
  .table-container .el-icon-edit {
    margin-left: 5px;
  }
  .table-container i {
    font-size: 18px;
    margin: 0 2px;
    color: #00a5a7;
    cursor: pointer;
  }
  .table-container .el-icon-close {
    color: #f56c6c;
  }
  .table-container .validation-error {
    color: #ff0000;
  }
  .select-container {
    padding: 10px 0;
    position: relative;
    display: flex;
  }
  .display-column {
    display: inline-block;
    padding-right: 6px;
    height: 32px;
    line-height: 32px;
  }
  .inline-block-set {
    display: inline-block;
  }
  .remark-input-style {
    width: 140px;
  }
  .tag-icon-container {
    width: 22px;
    height: 22px;
    border: 1px solid #e6e6e6;
    background-color: white;
    cursor: pointer;
    border-radius: 2px;
  }
  .button-text {
    color: #606266 !important;
  }

G
gaocongli 已提交
2070 2071 2072 2073 2074 2075 2076 2077 2078
  .cl-model-right {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #ffffff;
    -webkit-box-shadow: 0 1px 0 0 rgba(200, 200, 200, 0.5);
    box-shadow: 0 1px 0 0 rgba(200, 200, 200, 0.5);
    overflow: hidden;

P
ph 已提交
2079
    .top-area {
P
ph 已提交
2080
      margin: 24px 32px 12px;
P
ph 已提交
2081 2082
      display: flex;
      justify-content: flex-end;
P
ph 已提交
2083 2084
      .select-box {
        height: 46px;
P
ph 已提交
2085 2086 2087 2088
        flex-grow: 1;
        .label-legend {
          height: 19px;
          margin-bottom: 4px;
P
ph 已提交
2089 2090 2091 2092 2093
          display: inline-block;
          position: absolute;
          right: 30px;
          height: 32px;
          line-height: 32px;
P
ph 已提交
2094 2095 2096 2097 2098 2099 2100
          div {
            display: inline-block;
            font-size: 12px;
          }
          div + div {
            margin-left: 30px;
          }
G
gaocongli 已提交
2101 2102 2103 2104
        }
      }
    }
    #echart {
P
ph 已提交
2105 2106 2107 2108 2109 2110
      height: 32%;
      padding: 0 12px;
    }
    .echart-no-data {
      height: 32%;
      width: 100%;
G
gaocongli 已提交
2111 2112 2113
    }
    .table-container {
      background-color: white;
P
ph 已提交
2114
      height: calc(68% - 130px);
P
ph 已提交
2115
      padding: 6px 32px;
G
gaocongli 已提交
2116
      position: relative;
2117 2118 2119 2120 2121
      .custom-label {
        max-width: calc(100% - 25px);
        padding: 0;
        vertical-align: middle;
      }
G
gaocongli 已提交
2122 2123 2124
      a {
        cursor: pointer;
      }
P
ph 已提交
2125 2126 2127
      .clear {
        clear: both;
      }
P
ph 已提交
2128 2129 2130 2131
      .hide-count {
        height: 32px;
        line-height: 32px;
        color: red;
P
ph 已提交
2132 2133
        float: right;
        margin-right: 10px;
P
ph 已提交
2134
      }
G
gaocongli 已提交
2135
      .el-pagination {
P
ph 已提交
2136
        float: right;
G
gaocongli 已提交
2137 2138 2139
        margin-right: 32px;
        bottom: 10px;
      }
P
ph 已提交
2140 2141 2142
      .pagination-container {
        height: 40px;
      }
G
gaocongli 已提交
2143 2144 2145 2146 2147 2148 2149 2150 2151
    }
    .no-data-page {
      width: 100%;
      height: 100%;
      padding-top: 200px;
      .no-data-img {
        background: #fff;
        text-align: center;
        height: 100%;
P
ph 已提交
2152
        width: 310px;
G
gaocongli 已提交
2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165
        margin: auto;
        img {
          max-width: 100%;
        }
        p {
          font-size: 16px;
          padding-top: 10px;
        }
      }
    }
  }
}
</style>