model-traceback.vue 71.0 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
      <div class="echart-no-data"
92
           v-show="!noData && !showEchartPic">
P
ph 已提交
93 94
      </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
          </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
131
                             min-width="120"
P
ph 已提交
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
                             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
155
                             min-width="120"
P
ph 已提交
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
                             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
                   class="tag-icon-container">
257 258
                <img v-if="scope.row.tag"
                     :class="'img' + scope.$index"
259
                     :src="require('@/assets/images/icon' + scope.row.tag + '.svg')">
260 261 262
                <img v-else
                     :class="'img' + scope.$index"
                     :src="require('@/assets/images/icon-down.svg')">
P
ph 已提交
263 264 265
              </div>
            </template>
          </el-table-column>
G
gaocongli 已提交
266
        </el-table>
P
ph 已提交
267
        <div class="pagination-container">
P
ph 已提交
268 269 270 271 272 273
          <el-pagination @current-change="pagination.pageChange"
                         :current-page="pagination.currentPage"
                         :page-size="pagination.pageSize"
                         :layout="pagination.layout"
                         :total="pagination.total">
          </el-pagination>
P
ph 已提交
274 275 276 277 278
          <div class="hide-count"
               v-show="recordsNumber-showNumber">
            {{$t('modelTraceback.totalHide').replace(`{n}`, (recordsNumber-showNumber))}}
          </div>
          <div class="clear"></div>
P
ph 已提交
279 280
        </div>

G
gaocongli 已提交
281 282 283 284 285
      </div>
      <div v-if="noData"
           class="no-data-page">
        <div class="no-data-img">
          <img :src="require('@/assets/images/nodata.png')"
286
               alt />
P
ph 已提交
287 288 289 290 291
          <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 已提交
292 293 294 295 296
            <p class="no-data-text">
              {{ $t('modelTraceback.click') }}
              <b> {{ $t('modelTraceback.showAllDataBtn') }}</b>
              {{ $t('modelTraceback.viewAllData') }}
            </p>
P
ph 已提交
297
          </div>
G
gaocongli 已提交
298 299 300
        </div>
      </div>
    </div>
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
    <!-- 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">
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 342
          <div class="tag-button-container">
            <el-button type="primary"
                       size="mini"
                       class="custom-btn"
                       @click="iconChangeSave(tagScope)"
                       plain>
              {{$t('public.sure')}}
            </el-button>
          </div>
          <div class="tag-button-container">
            <el-button type="primary"
                       size="mini"
                       class="custom-btn"
                       @click="clearIcon(tagScope)"
                       plain>
              {{$t('public.clear')}}
            </el-button>
          </div>
          <div class="tag-button-container">
            <el-button type="primary"
                       size="mini"
                       class="custom-btn"
                       @click="cancelChangeIcon(tagScope.row)"
                       plain>
              {{$t('public.cancel')}}
            </el-button>
          </div>
343 344 345
        </div>
      </div>
    </div>
G
gaocongli 已提交
346 347 348 349 350 351 352 353 354 355 356 357
  </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 {
358 359
      tagDialogShow: false,
      tagScope: {},
P
ph 已提交
360
      iconValue: 0,
P
update  
ph 已提交
361
      imageList: [],
P
ph 已提交
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384
      // 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 已提交
385 386
      table: {},
      summaryDirList: undefined,
P
ph 已提交
387
      text: this.$t('modelTraceback.summaryPath'),
P
ph 已提交
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402
      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 已提交
403
        'device_num',
P
ph 已提交
404
      ], // All keys whose values are int
P
ph 已提交
405
      keysOfMixed: [],
P
ph 已提交
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420
      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 已提交
421
      sortInfo: {},
P
ph 已提交
422 423
      showTable: false,
      noData: false,
P
ph 已提交
424 425 426 427 428
      haveCustomizedParams: false,
      replaceStr: {
        metric: 'metric/',
        userDefined: 'user_defined/',
      },
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
      valueType: {
        int: 'int',
        str: 'str',
        mixed: 'mixed',
        category: 'category',
        model_size: 'model_size',
        dataset_mark: 'dataset_mark',
      },
      valueName: {
        userDefined: 'userDefined',
        metric: 'metric',
        UserDefined: 'UserDefined',
        Metric: 'Metric',
      },
      labelValue: {
        loss: 'loss',
        batch_size: 'batch_size',
        epoch: 'epoch',
        learning_rate: 'learning_rate',
      },
P
ph 已提交
449 450 451 452
    };
  },
  computed: {},
  mounted() {
P
update  
ph 已提交
453
    this.imageList = [];
454
    for (let i = 1; i <= 10; i++) {
P
update  
ph 已提交
455
      const obj = {};
456
      obj.number = i;
P
update  
ph 已提交
457 458 459
      obj.iconAdd = require('@/assets/images/icon' + obj.number + '.svg');
      this.imageList.push(obj);
    }
P
ph 已提交
460
    document.title = `${this.$t('summaryManage.modelTraceback')}-MindInsight`;
P
ph 已提交
461
    document.addEventListener('click', this.blurFloat, true);
P
ph 已提交
462 463 464 465 466 467 468 469 470 471 472
    this.$store.commit('setSelectedBarList', []);
    this.getStoreList();
    this.pagination.pageChange = (page) => {
      this.pagination.currentPage = page;
      this.queryLineagesData(false);
    };
    this.$nextTick(() => {
      this.init();
    });
  },
  methods: {
P
ph 已提交
473 474 475 476 477 478
    blurFloat(event) {
      const domArr = document.querySelectorAll('.icon-dialog');
      const isActiveDom = event.path.some((item) => {
        return item.className === 'icon-dialog';
      });
      if (!isActiveDom) {
479
        this.removeIconBorder();
P
ph 已提交
480 481 482
        domArr.forEach((item) => {
          item.style.display = 'none';
        });
483
        this.tagDialogShow = false;
P
ph 已提交
484 485 486 487 488 489
      }
    },

    /**
     * Display of the icon dialog box
     * @param {Object} row
490
     * @param {Object} scope
P
ph 已提交
491
     */
492 493 494 495 496 497 498 499 500 501
    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;
502
      const dialogHeight = 130;
503
      document.getElementById('tag-dialog').style.top =
504
        window.event.clientY - dialogHeight + 'px';
505 506 507 508 509 510 511 512 513 514 515 516 517 518
    },

    /**
     * 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 已提交
519

520 521 522 523 524 525
    /**
     * Remove  icon border style
     */
    removeIconBorder() {
      const classArr = document.querySelectorAll('.icon-border');
      if (classArr.length) {
P
ph 已提交
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553
        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.
554
     * @param {Object} scope
P
ph 已提交
555
     */
556
    iconChangeSave(scope) {
557
      this.tagDialogShow = false;
558
      if (scope.row.tag === this.iconValue || this.iconValue === 0) {
P
ph 已提交
559 560
        return;
      }
561
      this.tagScope.row.tag = this.iconValue;
562 563 564 565 566
      const imgDom = document.querySelectorAll('.img' + scope.$index);
      imgDom.forEach((item) => {
        item.src = require('@/assets/images/icon' + this.iconValue + '.svg');
      });
      this.$forceUpdate();
P
ph 已提交
567
      const params = {
568
        train_id: scope.row.summary_dir,
P
ph 已提交
569
        body: {
570
          tag: this.tagScope.row.tag,
P
ph 已提交
571 572 573 574
        },
      };
      this.putChangeToLineagesData(params);
    },
575 576 577

    /**
     * clear icon
578
     * @param {Object} scope
579
     */
580
    clearIcon(scope) {
P
ph 已提交
581 582 583 584 585 586 587
      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');
      });
588
      this.tagDialogShow = false;
P
ph 已提交
589
      this.iconValue = 0;
590
      this.tagScope.row.tag = 0;
591 592 593 594
      const imgDom = document.querySelectorAll('.img' + scope.$index);
      imgDom.forEach((item) => {
        item.src = require('@/assets/images/icon-down.svg');
      });
P
ph 已提交
595
      const params = {
596
        train_id: scope.row.summary_dir,
P
ph 已提交
597
        body: {
598
          tag: 0,
P
ph 已提交
599 600 601 602 603 604 605 606 607
        },
      };
      this.putChangeToLineagesData(params);
    },
    /**
     * cancel save
     * @param {Object} row
     */
    cancelChangeIcon(row) {
608 609 610
      this.removeIconBorder();
      this.addIconBorder(row);
      this.tagDialogShow = false;
P
ph 已提交
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
    },

    /**
     * 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 已提交
637
          if (labelValue === item) {
P
ph 已提交
638 639 640 641 642 643 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
            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 已提交
672
          if (labelValue === item) {
P
ph 已提交
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 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787
            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 已提交
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803
    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 已提交
804 805 806 807 808 809 810 811 812 813
        columnOptions: {
          train_dataset_path: {
            label: this.$t('modelTraceback.trainSetPath'),
            required: true,
          },
          test_dataset_path: {
            label: this.$t('modelTraceback.testSetPath'),
            required: true,
          },
          loss: {
814
            label: this.labelValue.loss,
G
gaocongli 已提交
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
            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: {
838
            label: this.labelValue.epoch,
G
gaocongli 已提交
839 840 841
            required: false,
          },
          batch_size: {
842
            label: this.labelValue.batch_size,
G
gaocongli 已提交
843 844
            required: false,
          },
P
update  
ph 已提交
845 846 847 848
          device_num: {
            label: this.$t('modelTraceback.deviceNum'),
            required: false,
          },
G
gaocongli 已提交
849 850 851 852 853 854 855 856 857
          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 已提交
858
        otherColumn: [], // Table Column
G
gaocongli 已提交
859 860 861
        mandatoryColumn: [], // Mandatory Table Column
        optionalColumn: [], // Optional Table Column
        data: [],
P
ph 已提交
862
        // no checked list
G
gaocongli 已提交
863 864 865 866 867 868 869 870 871 872 873 874 875 876
        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 已提交
877
      };
P
ph 已提交
878
      this.keysOfMixed = [];
P
ph 已提交
879 880 881 882 883 884 885 886 887 888 889 890 891

      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 已提交
892
      this.basearr = [];
P
ph 已提交
893 894 895
      this.selectArrayValue = [];
      // Obtain the hidden summary_dir list after initialization.
      this.hidenDirChecked = this.$store.state.hidenDirChecked || [];
P
ph 已提交
896
      this.queryLineagesData(true);
G
gaocongli 已提交
897 898 899 900 901
    },
    /**
     * Column initialization
     */
    initColumm() {
P
ph 已提交
902 903 904 905 906
      this.metricList = [];
      this.userDefinedList = [];
      // hyper list
      this.hyperList = [];
      this.summaryList = [];
G
gaocongli 已提交
907 908 909 910 911 912 913 914 915 916
      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 已提交
917 918 919 920 921 922 923 924 925 926 927
      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 已提交
928
        if (item.indexOf('metric/') === 0) {
P
ph 已提交
929
          metricArray.push(item);
W
溯源  
WeiFeng 已提交
930
        } else if (item.indexOf('user_defined/') === 0) {
P
ph 已提交
931 932
          userDefinedArray.push(item);
        } else if (
933 934 935
          item === this.labelValue.epoch ||
          item === this.labelValue.batch_size ||
          item === this.labelValue.learning_rate
P
ph 已提交
936 937 938 939 940
        ) {
          hyperArray.push(item);
        } else {
          columnArray.push(item);
        }
G
gaocongli 已提交
941
      });
P
ph 已提交
942 943 944 945 946 947 948
      this.showTable = true;
      this.table.otherColumn = columnArray;
      this.metricList = metricArray;
      this.userDefinedList = userDefinedArray;
      // hyper list
      this.hyperList = hyperArray;

G
gaocongli 已提交
949 950 951
      this.table.selectedColumn = this.table.optionalColumn;
      this.table.selectAll = true;
      this.showTable = true;
P
ph 已提交
952 953 954
      this.$nextTick(() => {
        this.$refs.table.doLayout();
      });
G
gaocongli 已提交
955 956 957 958 959
    },
    /**
     * Querying All Model Version Information
     * @param {Boolean} allData Indicates whether to query all data
     */
P
ph 已提交
960 961 962 963 964 965 966 967
    queryLineagesData(allData) {
      const params = {
        body: {},
      };
      const tempParam = {
        sorted_name: this.sortInfo.sorted_name,
        sorted_type: this.sortInfo.sorted_type,
      };
G
gaocongli 已提交
968
      if (!allData) {
P
ph 已提交
969 970 971
        this.summaryDirList = this.$store.state.summaryDirList;
        this.tableFilter.summary_dir = {
          in: this.summaryDirList,
G
gaocongli 已提交
972
        };
P
ph 已提交
973 974 975

        tempParam.limit = this.pagination.pageSize;
        tempParam.offset = this.pagination.currentPage - 1;
P
ph 已提交
976 977 978 979 980 981 982 983
        params.body = Object.assign(
            params.body,
            this.chartFilter,
            tempParam,
            this.tableFilter,
        );
      } else {
        params.body = Object.assign(params.body, this.tableFilter);
G
gaocongli 已提交
984
      }
P
ph 已提交
985
      RequestService.queryLineagesData(params)
G
gaocongli 已提交
986 987 988
          .then(
              (res) => {
                if (res && res.data && res.data.object) {
989 990 991
                  const listTemp = this.setDataOfModel(res.data.object);
                  const list = JSON.parse(JSON.stringify(listTemp));
                  const tempEchartData = JSON.parse(JSON.stringify(listTemp));
G
gaocongli 已提交
992
                  if (allData) {
P
ph 已提交
993
                    let customized = {};
994
                    if (res.data.customized) {
P
ph 已提交
995
                      customized = JSON.parse(JSON.stringify(res.data.customized));
996
                      const customizedKeys = Object.keys(customized);
P
ph 已提交
997
                      if (customizedKeys.length) {
998
                        customizedKeys.forEach((i) => {
999
                          if (customized[i].type === this.valueType.int) {
1000
                            this.keysOfIntValue.push(i);
1001
                          } else if (customized[i].type === this.valueType.str) {
1002
                            this.keysOfStringValue.push(i);
1003
                          } else if (customized[i].type === this.valueType.mixed) {
P
ph 已提交
1004 1005 1006
                            // list of type mixed
                            this.keysOfMixed.push(i);
                            this.keysOfStringValue.push(i);
1007
                          }
P
ph 已提交
1008
                          if (i.startsWith(this.replaceStr.userDefined)) {
1009
                            this.labelObj.userDefined = this.valueName.userDefined;
P
ph 已提交
1010 1011 1012 1013
                            customized[i].label = customized[i].label.replace(
                                this.replaceStr.userDefined,
                                '[U]',
                            );
P
ph 已提交
1014 1015 1016 1017
                            const userDefinedObject = {value: '', label: ''};
                            userDefinedObject.value = customized[i].label;
                            userDefinedObject.label = customized[i].label;
                            this.userOptions.push(userDefinedObject);
P
ph 已提交
1018 1019 1020 1021 1022
                          } else if (i.startsWith(this.replaceStr.metric)) {
                            customized[i].label = customized[i].label.replace(
                                this.replaceStr.metric,
                                '[M]',
                            );
1023
                            this.labelObj.metric = this.valueName.metric;
P
ph 已提交
1024 1025 1026 1027 1028
                            const metricObject = {value: '', label: ''};
                            metricObject.value = customized[i].label;
                            metricObject.label = customized[i].label;
                            metricObject.disabled = true;
                            this.metricOptions.push(metricObject);
P
ph 已提交
1029
                          }
1030
                        });
P
ph 已提交
1031
                        this.haveCustomizedParams = true;
1032
                      }
P
ph 已提交
1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058
                      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 = {
1059
                          label: this.valueName.Metric,
P
ph 已提交
1060 1061 1062 1063 1064 1065 1066
                          options: this.metricOptions,
                        };
                        this.checkOptions.push(metricTemp);
                        this.basearr.push(metricTemp);
                      }
                      if (this.labelObj.userDefined) {
                        const userTemp = {
1067
                          label: this.valueName.UserDefined,
P
ph 已提交
1068 1069 1070 1071 1072 1073 1074
                          options: this.userOptions,
                        };
                        this.checkOptions.push(userTemp);
                        this.basearr.push(userTemp);
                      }
                      Object.keys(this.table.columnOptions).forEach((item) => {
                        if (
1075 1076 1077
                          item !== this.labelValue.epoch &&
                      item !== this.labelValue.learning_rate &&
                      item !== this.labelValue.batch_size
P
ph 已提交
1078
                        ) {
1079
                          const haveItem = this.table.optionsNotInCheckbox.includes(
P
ph 已提交
1080 1081
                              item,
                          );
1082
                          if (!haveItem) {
P
ph 已提交
1083 1084 1085 1086
                            const otherType = {value: '', label: ''};
                            otherType.value = this.table.columnOptions[item].label;
                            otherType.label = this.table.columnOptions[item].label;
                            if (
1087
                              otherType.value === this.labelValue.loss ||
P
update  
ph 已提交
1088 1089 1090 1091
                          otherType.value ===
                            this.$t('modelTraceback.network') ||
                          otherType.value ===
                            this.$t('modelTraceback.optimizer')
P
ph 已提交
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119
                            ) {
                              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);
                      }
1120
                    }
P
ph 已提交
1121 1122 1123 1124 1125
                    this.checkOptions.forEach((item) => {
                      item.options.forEach((option) => {
                        this.selectArrayValue.push(option.label);
                      });
                    });
P
ph 已提交
1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140
                    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 已提交
1141

P
ph 已提交
1142
                    this.noData = !res.data.object.length;
P
ph 已提交
1143 1144 1145 1146
                    this.showEchartPic = !!res.data.object.length;
                    if (this.hidenDirChecked.length) {
                      this.hidenDirChecked.forEach((dir) => {
                        tempEchartData.forEach((item, index) => {
W
溯源  
WeiFeng 已提交
1147
                          if (item.summary_dir === dir) {
P
ph 已提交
1148 1149 1150 1151
                            tempEchartData.splice(index, 1);
                          }
                        });
                      });
W
溯源  
WeiFeng 已提交
1152
                      if (tempEchartData.length === 0) {
P
ph 已提交
1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163
                        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 已提交
1164
                    Object.keys(this.table.columnOptions).forEach((i) => {
P
ph 已提交
1165
                      this.table.columnOptions[i].selected = true;
G
gaocongli 已提交
1166 1167 1168 1169
                      const flag = list.some((val) => {
                        return val[i] || val[i] === 0;
                      });
                      if (!flag) {
1170 1171
                        let haveItem = this.table.optionsNotInCheckbox.includes(i);
                        if (haveItem) {
G
gaocongli 已提交
1172 1173
                          this.table.optionsNotInCheckbox.splice(index, 1);
                        }
1174 1175
                        haveItem = this.table.optionsNotInEchart.includes(i);
                        if (haveItem) {
G
gaocongli 已提交
1176 1177
                          this.table.optionsNotInEchart.splice(index, 1);
                        }
1178 1179
                        haveItem = this.table.optionsNotInTable.includes(i);
                        if (haveItem) {
G
gaocongli 已提交
1180 1181 1182 1183 1184 1185 1186 1187
                          this.table.optionsNotInTable.splice(index, 1);
                        }

                        delete this.table.columnOptions[i];
                      }
                    });
                    this.initColumm();
                    this.initChart();
P
ph 已提交
1188 1189 1190 1191 1192
                    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 已提交
1193
                          if (item.summary_dir === dir) {
P
ph 已提交
1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215
                            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 已提交
1216 1217 1218 1219 1220
                  }

                  this.pagination.total = res.data.count || 0;
                } else {
                  this.noData = allData;
P
ph 已提交
1221
                  this.showEchartPic = !allData;
G
gaocongli 已提交
1222 1223 1224 1225 1226
                }
              },
              (error) => {
                if (allData) {
                  this.noData = allData;
P
ph 已提交
1227
                  this.showEchartPic = !allData;
G
gaocongli 已提交
1228 1229 1230
                }
              },
          )
1231 1232 1233
          .catch(() => {
            this.noData = true;
          });
G
gaocongli 已提交
1234
    },
P
ph 已提交
1235 1236 1237 1238 1239 1240 1241 1242 1243 1244

    /**
     * Selected data in the table
     * @param {Array} data
     * @return {Array}
     */
    setDataOfModel(data = []) {
      const modelLineageList = [];
      data.forEach((item) => {
        if (item.model_lineage) {
P
ph 已提交
1245 1246
          item.model_lineage.editShow = true;
          item.model_lineage.isError = false;
P
ph 已提交
1247
          item.model_lineage.summary_dir = item.summary_dir;
P
ph 已提交
1248 1249 1250 1251 1252 1253
          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 已提交
1254
          const modelData = JSON.parse(JSON.stringify(item.model_lineage));
1255
          const byteNum = 1024;
P
ph 已提交
1256
          modelData.model_size = parseFloat(
1257
              ((modelData.model_size || 0) / byteNum / byteNum).toFixed(2),
P
ph 已提交
1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287
          );
          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 已提交
1288 1289 1290 1291 1292
    /**
     * Selected data in the table
     * @param {Array} list Selected data in the table
     */
    selectionChange(list = []) {
P
ph 已提交
1293 1294 1295
      if (this.hideRecord) {
        return;
      }
G
gaocongli 已提交
1296 1297
      this.echart.showData = list.length ? list : this.echart.brushData;
      this.initChart();
P
ph 已提交
1298
      this.checkedSummary = list;
G
gaocongli 已提交
1299 1300 1301 1302 1303 1304 1305 1306
      const summaryDirFilter = [];
      this.echart.showData.forEach((i) => {
        summaryDirFilter.push(i.summary_dir);
      });
      this.tableFilter.summary_dir = {
        in: summaryDirFilter,
      };
    },
P
ph 已提交
1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331

    /**
     * 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 已提交
1332
          if (labelValue === item) {
P
ph 已提交
1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360
            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 已提交
1361
            if (item.summary_dir === dir) {
P
ph 已提交
1362 1363 1364 1365 1366 1367 1368
              tempEchartData.splice(index, 1);
            }
          });
        });
        const tableTemp = this.table.data;
        this.hidenDirChecked.forEach((dir) => {
          tableTemp.forEach((item, index) => {
W
溯源  
WeiFeng 已提交
1369
            if (item.summary_dir === dir) {
P
ph 已提交
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421
              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;
1422 1423 1424 1425
              this.$nextTick(() => {
                this.resizeChart();
                this.initChart();
              });
P
ph 已提交
1426
              const showList = list.slice(
P
ph 已提交
1427 1428 1429
                  (this.pagination.currentPage - 1) * this.pagination.pageSize,
                  this.pagination.currentPage * this.pagination.pageSize,
              );
P
ph 已提交
1430
              this.table.data = showList;
P
ph 已提交
1431 1432 1433 1434 1435 1436 1437 1438 1439
              this.recordsNumber = this.table.data.length;
              this.showNumber = this.table.data.length;
              this.pagination.total = res.data.count || 0;
            }
          },
          (error) => {},
      );
    },

G
gaocongli 已提交
1440 1441 1442 1443 1444 1445 1446
    /**
     * 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 已提交
1447 1448
      this.recordsNumber = 0;
      this.showNumber = 0;
P
ph 已提交
1449
      this.getStoreList();
G
gaocongli 已提交
1450 1451 1452 1453 1454 1455 1456
      const tempParam = {
        limit: this.pagination.pageSize,
        offset: 0,
        sorted_name: this.sortInfo.sorted_name,
        sorted_type: this.sortInfo.sorted_type,
      };
      const params = {};
P
ph 已提交
1457 1458 1459 1460 1461 1462 1463
      params.body = Object.assign(
          {},
          tempParam,
          this.tableFilter,
          this.chartFilter || {},
      );
      RequestService.queryLineagesData(params)
G
gaocongli 已提交
1464 1465 1466
          .then(
              (res) => {
                if (res && res.data && res.data.object) {
P
ph 已提交
1467
                  const list = this.setDataOfModel(res.data.object);
P
ph 已提交
1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480
                  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 已提交
1481
                  this.pagination.total = res.data.count || 0;
P
ph 已提交
1482
                  this.pagination.currentPage = 1;
G
gaocongli 已提交
1483 1484 1485 1486 1487 1488
                }
              },
              (error) => {},
          )
          .catch(() => {});
    },
P
ph 已提交
1489

G
gaocongli 已提交
1490 1491 1492 1493
    /**
     * Initializing the Eechart
     */
    initChart() {
P
ph 已提交
1494 1495 1496 1497 1498 1499
      const chartAxis = Object.keys(this.table.columnOptions).filter((i) => {
        return (
          this.table.columnOptions[i].selected &&
          !this.table.optionsNotInEchart.includes(i)
        );
      });
G
gaocongli 已提交
1500 1501
      const data = [];
      this.echart.showData.forEach((i, index) => {
P
ph 已提交
1502 1503
        let item = {};
        item = {
G
gaocongli 已提交
1504 1505 1506 1507 1508 1509 1510 1511 1512
          lineStyle: {
            normal: {
              color: CommonProperty.commonColorArr[index % 10],
            },
          },
          value: [],
        };

        chartAxis.forEach((key) => {
P
ph 已提交
1513
          if (
W
溯源  
WeiFeng 已提交
1514
            (i[key] || i[key] === 0) &&
P
ph 已提交
1515 1516 1517 1518 1519 1520 1521 1522
            this.keysOfMixed &&
            this.keysOfMixed.length &&
            this.keysOfMixed.includes(key)
          ) {
            item.value.push(i[key].toString());
          } else {
            item.value.push(i[key]);
          }
G
gaocongli 已提交
1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534
        });
        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 已提交
1535
              values[i[key].toString()] = i[key].toString();
G
gaocongli 已提交
1536 1537
            }
          });
1538
          obj.type = this.valueType.category;
G
gaocongli 已提交
1539
          obj.data = Object.keys(values);
1540
          if (key === this.valueType.dataset_mark) {
G
gaocongli 已提交
1541 1542 1543
            obj.axisLabel = {
              show: false,
            };
P
ph 已提交
1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570
          } 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 已提交
1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581
          }
        }
        if (this.keysOfIntValue.includes(key)) {
          obj.minInterval = 1;
        }
        parallelAxis.push(obj);
      });

      const echartOption = {
        backgroundColor: 'white',
        parallelAxis: parallelAxis,
1582 1583 1584
        tooltip: {
          trigger: 'axis',
        },
G
gaocongli 已提交
1585
        parallel: {
W
WeiFeng 已提交
1586
          top: 25,
G
gaocongli 已提交
1587
          left: 50,
P
ph 已提交
1588
          right: 100,
G
gaocongli 已提交
1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616
          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,
            },
1617 1618 1619
            tooltip: {
              show: true,
            },
G
gaocongli 已提交
1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637
            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);
1638 1639
      } else {
        this.echart.chart = Echarts.init(document.querySelector('#echart'));
G
gaocongli 已提交
1640 1641 1642
      }
      this.echart.chart.setOption(echartOption, true);
      window.addEventListener('resize', this.resizeChart, false);
1643 1644 1645
      this.chartEventsListen(parallelAxis);
    },
    chartEventsListen(parallelAxis) {
G
gaocongli 已提交
1646
      this.echart.chart.on('axisareaselected', (params) => {
P
ph 已提交
1647 1648
        this.recordsNumber = 0;
        this.showNumber = 0;
G
gaocongli 已提交
1649
        const key = params.parallelAxisId;
P
ph 已提交
1650 1651 1652 1653 1654 1655 1656 1657 1658
        if (
          this.keysOfMixed &&
          this.keysOfMixed.length &&
          this.keysOfMixed.includes(key)
        ) {
          this.$message.error(this.$t('modelTraceback.mixedItemMessage'));
          this.initChart();
          return;
        }
P
ph 已提交
1659 1660 1661 1662
        const list = this.$store.state.selectedBarList || [];
        const selectedAxisId = params.parallelAxisId;
        if (list.length) {
          list.forEach((item, index) => {
W
溯源  
WeiFeng 已提交
1663
            if (item === selectedAxisId) {
P
ph 已提交
1664 1665 1666 1667 1668 1669 1670
              list.splice(index, 1);
            }
          });
        }
        list.push(selectedAxisId);
        this.$store.commit('setSelectedBarList', list);

G
gaocongli 已提交
1671 1672 1673 1674
        let range = params.intervals[0] || [];
        const [axisData] = parallelAxis.filter((i) => {
          return i.id === key;
        });
1675 1676 1677 1678
        const lineLength = 2;
        if (axisData && range.length === lineLength) {
          if (axisData && axisData.id === this.valueType.model_size) {
            const byteNum = 1024;
G
gaocongli 已提交
1679
            range = [
1680 1681
              parseInt(range[0] * byteNum * byteNum, 0),
              parseInt(range[1] * byteNum * byteNum, 0),
G
gaocongli 已提交
1682 1683
            ];
          }
1684
          if (axisData.type === this.valueType.category) {
G
gaocongli 已提交
1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707
            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 已提交
1708 1709 1710 1711 1712 1713
          );
          const tableParams = {};
          tableParams.body = Object.assign(
              {},
              this.chartFilter,
              this.tableFilter,
G
gaocongli 已提交
1714 1715
              this.sortInfo,
          );
P
ph 已提交
1716
          RequestService.queryLineagesData(filterParams)
G
gaocongli 已提交
1717 1718
              .then(
                  (res) => {
P
ph 已提交
1719 1720 1721 1722 1723 1724
                    if (
                      res &&
                  res.data &&
                  res.data.object &&
                  res.data.object.length
                    ) {
P
ph 已提交
1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746
                      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) => {
1747
                          if (customized[i].type === this.valueType.int) {
P
ph 已提交
1748
                            this.keysOfIntValue.push(i);
1749
                          } else if (customized[i].type === this.valueType.str) {
P
ph 已提交
1750
                            this.keysOfStringValue.push(i);
1751
                          } else if (customized[i].type === this.valueType.mixed) {
P
ph 已提交
1752 1753 1754 1755 1756 1757 1758
                            // list of type mixed
                            this.keysOfMixed.push(i);
                            this.keysOfStringValue.push(i);
                          }
                        });
                      }

P
ph 已提交
1759
                      const list = this.setDataOfModel(res.data.object);
P
ph 已提交
1760 1761 1762 1763 1764 1765 1766 1767 1768
                      if (this.hidenDirChecked.length) {
                        this.hidenDirChecked.forEach((dir) => {
                          list.forEach((item, index) => {
                            if (item.summary_dir === dir) {
                              list.splice(index, 1);
                            }
                          });
                        });
                      }
P
update  
ph 已提交
1769 1770 1771 1772 1773 1774 1775 1776
                      if (!list.length) {
                        this.noData = true;
                        this.showEchartPic = false;
                        this.summaryDirList = [];
                        this.checkedSummary = [];
                        this.$store.commit('setSummaryDirList', []);
                        return;
                      }
P
ph 已提交
1777
                      const summaryDirList = list.map((i) => i.summary_dir);
P
ph 已提交
1778
                      this.$store.commit('setSummaryDirList', summaryDirList);
G
gaocongli 已提交
1779 1780
                      this.echart.showData = this.echart.brushData = list;
                      this.initChart();
P
ph 已提交
1781
                      this.getTableList(tableParams);
P
ph 已提交
1782 1783 1784
                    } else {
                      this.summaryDirList = [];
                      this.$store.commit('setSummaryDirList', []);
P
ph 已提交
1785
                      this.checkedSummary = [];
P
ph 已提交
1786
                      this.noData = true;
P
ph 已提交
1787
                      this.showEchartPic = false;
G
gaocongli 已提交
1788 1789 1790 1791 1792 1793 1794 1795
                    }
                  },
                  (error) => {},
              )
              .catch(() => {});
        }
      });
    },
P
ph 已提交
1796 1797 1798 1799 1800 1801 1802 1803 1804 1805
    /**
     * 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 已提交
1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819

                  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 已提交
1820 1821 1822 1823 1824 1825 1826 1827 1828
                  this.pagination.currentPage = 1;
                  this.pagination.total = this.echart.brushData.length;
                  this.$refs.table.clearSelection();
                }
              },
              (error) => {},
          )
          .catch(() => {});
    },
G
gaocongli 已提交
1829 1830 1831 1832
    /**
     * Resetting the Eechart
     */
    resetChart() {
P
ph 已提交
1833 1834 1835 1836 1837
      this.summaryDirList = undefined;
      this.$store.commit('setSummaryDirList', undefined);
      this.$store.commit('setSelectedBarList', []);
      this.noData = false;
      this.showTable = false;
P
ph 已提交
1838
      this.selectCheckAll = true;
G
gaocongli 已提交
1839
      this.chartFilter = {};
P
ph 已提交
1840
      this.tableFilter.summary_dir = undefined;
P
ph 已提交
1841
      this.sortInfo = {};
G
gaocongli 已提交
1842
      this.pagination.currentPage = 1;
P
ph 已提交
1843 1844 1845 1846 1847
      this.echart.allData = [];
      if (this.echart.chart) {
        this.echart.chart.clear();
      }
      this.init();
G
gaocongli 已提交
1848 1849
      this.$refs.table.clearSelection();
    },
P
ph 已提交
1850

G
gaocongli 已提交
1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884
    /**
     * 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 {
1885 1886 1887
        const numDigits = 4;
        if (key === this.labelValue.learning_rate) {
          let temp = value.toPrecision(numDigits);
G
gaocongli 已提交
1888 1889 1890 1891 1892
          let row = 0;
          while (temp < 1) {
            temp = temp * 10;
            row += 1;
          }
1893
          temp = this.toFixedFun(temp, numDigits);
G
gaocongli 已提交
1894
          return `${temp}${row ? `e-${row}` : ''}`;
1895
        } else if (key === this.valueType.model_size) {
G
gaocongli 已提交
1896 1897
          return value + 'MB';
        } else {
1898 1899 1900 1901 1902 1903
          const num = 1000;
          if (value < num) {
            return (
              Math.round(value * Math.pow(10, numDigits)) /
              Math.pow(10, numDigits)
            );
G
gaocongli 已提交
1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914
          } else {
            const reg = /(?=(\B)(\d{3})+$)/g;
            return (value + '').replace(reg, ',');
          }
        }
      }
    },
    /**
     * Resizing Chart
     */
    resizeChart() {
1915 1916 1917
      if (this.echart && this.echart.chart) {
        this.echart.chart.resize();
      }
G
gaocongli 已提交
1918 1919
    },
  },
P
ph 已提交
1920 1921 1922
  /**
   * Destroy the page
   */
G
gaocongli 已提交
1923
  destroyed() {
P
ph 已提交
1924 1925 1926 1927 1928 1929 1930
    if (this.checkedSummary.length) {
      const tempList = [];
      this.checkedSummary.forEach((item) => {
        tempList.push(item.summary_dir);
      });
      this.$store.commit('setSummaryDirList', tempList);
    }
G
gaocongli 已提交
1931 1932 1933 1934 1935
    if (this.echart.chart) {
      window.removeEventListener('resize', this.resizeChart, false);
      this.echart.chart.clear();
      this.echart.chart = null;
    }
P
ph 已提交
1936
    document.removeEventListener('resize', this.blurFloat);
G
gaocongli 已提交
1937 1938 1939 1940
  },
};
</script>
<style lang="scss">
W
溯源  
WeiFeng 已提交
1941 1942
.label-text {
  line-height: 20px !important;
P
ph 已提交
1943 1944
  padding-top: 20px;
  display: block !important;
W
溯源  
WeiFeng 已提交
1945 1946
}
.remark-tip {
P
ph 已提交
1947
  line-height: 20px !important;
W
溯源  
WeiFeng 已提交
1948 1949 1950
  font-size: 12px;
  white-space: pre-wrap !important;
  color: gray;
P
ph 已提交
1951
  display: block !important;
W
溯源  
WeiFeng 已提交
1952
}
P
ph 已提交
1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981
.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-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 已提交
1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004
.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 已提交
2005

G
gaocongli 已提交
2006 2007 2008 2009
#cl-model-traceback {
  height: 100%;
  overflow-y: auto;
  position: relative;
2010 2011 2012
  .el-table th.gutter {
    display: table-cell !important;
  }
P
ph 已提交
2013 2014 2015
  .icon-border {
    border: 1px solid #00a5a7 !important;
  }
2016
  #tag-dialog {
P
ph 已提交
2017 2018 2019 2020 2021 2022
    z-index: 999;
    border: 1px solid #d6c9c9;
    position: fixed;
    width: 326px;
    height: 120px;
    background-color: #efebeb;
2023
    right: 106px;
P
ph 已提交
2024 2025
    border-radius: 4px;
  }
2026 2027 2028 2029 2030 2031 2032 2033 2034 2035
  .custom-btn {
    border: 1px solid #00a5a7;
    border-radius: 2px;
    background-color: white;
    color: #00a5a7;
  }
  .custom-btn:hover {
    color: #00a5a7;
    background: #e9f7f7;
  }
P
ph 已提交
2036 2037 2038 2039 2040
  .icon-image {
    display: inline-block;
    padding: 4px;
    height: 30px;
    width: 30px;
W
溯源  
WeiFeng 已提交
2041
    border: 1px solid transparent;
P
ph 已提交
2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055
  }
  .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 已提交
2056
    height: 46px;
P
ph 已提交
2057 2058
  }
  .btn-container-margin {
2059 2060 2061 2062 2063 2064
    margin: 0 10%;
  }
  .tag-button-container {
    display: inline-block;
    width: 33.3%;
    text-align: center;
P
ph 已提交
2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101
  }
  .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 {
2102 2103
    width: 21px;
    height: 21px;
P
ph 已提交
2104 2105 2106 2107 2108 2109 2110 2111
    border: 1px solid #e6e6e6;
    cursor: pointer;
    border-radius: 2px;
  }
  .button-text {
    color: #606266 !important;
  }

G
gaocongli 已提交
2112 2113 2114 2115 2116 2117 2118 2119
  .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;
2120 2121 2122 2123 2124
    // select
    .el-select > .el-input {
      min-width: 180px !important;
      max-width: 500px !important;
    }
P
ph 已提交
2125
    .top-area {
P
ph 已提交
2126
      margin: 24px 32px 12px;
P
ph 已提交
2127 2128
      display: flex;
      justify-content: flex-end;
P
ph 已提交
2129 2130
      .select-box {
        height: 46px;
P
ph 已提交
2131 2132 2133 2134
        flex-grow: 1;
        .label-legend {
          height: 19px;
          margin-bottom: 4px;
P
ph 已提交
2135 2136 2137 2138 2139
          display: inline-block;
          position: absolute;
          right: 30px;
          height: 32px;
          line-height: 32px;
P
ph 已提交
2140 2141 2142 2143 2144 2145 2146
          div {
            display: inline-block;
            font-size: 12px;
          }
          div + div {
            margin-left: 30px;
          }
G
gaocongli 已提交
2147 2148 2149 2150
        }
      }
    }
    #echart {
P
ph 已提交
2151 2152 2153 2154 2155 2156
      height: 32%;
      padding: 0 12px;
    }
    .echart-no-data {
      height: 32%;
      width: 100%;
G
gaocongli 已提交
2157 2158 2159
    }
    .table-container {
      background-color: white;
P
ph 已提交
2160
      height: calc(68% - 130px);
P
ph 已提交
2161
      padding: 6px 32px;
G
gaocongli 已提交
2162
      position: relative;
2163 2164 2165 2166 2167
      .custom-label {
        max-width: calc(100% - 25px);
        padding: 0;
        vertical-align: middle;
      }
G
gaocongli 已提交
2168 2169 2170
      a {
        cursor: pointer;
      }
P
ph 已提交
2171 2172 2173
      .clear {
        clear: both;
      }
P
ph 已提交
2174 2175 2176 2177
      .hide-count {
        height: 32px;
        line-height: 32px;
        color: red;
P
ph 已提交
2178 2179
        float: right;
        margin-right: 10px;
P
ph 已提交
2180
      }
G
gaocongli 已提交
2181
      .el-pagination {
P
ph 已提交
2182
        float: right;
G
gaocongli 已提交
2183 2184 2185
        margin-right: 32px;
        bottom: 10px;
      }
P
ph 已提交
2186 2187 2188
      .pagination-container {
        height: 40px;
      }
G
gaocongli 已提交
2189 2190 2191 2192 2193 2194 2195 2196 2197
    }
    .no-data-page {
      width: 100%;
      height: 100%;
      padding-top: 200px;
      .no-data-img {
        background: #fff;
        text-align: center;
        height: 100%;
P
ph 已提交
2198
        width: 310px;
G
gaocongli 已提交
2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211
        margin: auto;
        img {
          max-width: 100%;
        }
        p {
          font-size: 16px;
          padding-top: 10px;
        }
      }
    }
  }
}
</style>