提交 661123e2 编写于 作者: Q qin_jun_yan

After the model traceability box is selected, part of the type changes, click...

After the model traceability box is selected, part of the type changes, click on the full data to modify the type array initialization problem
上级 bfbe5e87
...@@ -15,8 +15,18 @@ limitations under the License. ...@@ -15,8 +15,18 @@ limitations under the License.
--> -->
<template> <template>
<div id="cl-model-traceback"> <div id="cl-model-traceback">
<div class="cl-model-right"> <div v-if="loading"
<div class="top-area"> class="no-data-page">
<div class="no-data-img">
<img :src="require('@/assets/images/nodata.png')"
alt="" />
<p class="no-data-text">{{$t("public.dataLoading")}}</p>
</div>
</div>
<div class="cl-model-right"
v-if="!loading">
<div class="top-area"
v-show="!errorData">
<div class="select-box" <div class="select-box"
v-if="!noData && v-if="!noData &&
(!summaryDirList || (summaryDirList && summaryDirList.length))"> (!summaryDirList || (summaryDirList && summaryDirList.length))">
...@@ -277,11 +287,11 @@ limitations under the License. ...@@ -277,11 +287,11 @@ limitations under the License.
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
<div v-if="noData" <div v-if="noData"
class="no-data-page"> class="no-data-page">
<div class="no-data-img"> <div class="no-data-img"
:class="{'set-height-class':(summaryDirList && !summaryDirList.length)}">
<img :src="require('@/assets/images/nodata.png')" <img :src="require('@/assets/images/nodata.png')"
alt /> alt />
<p class="no-data-text" <p class="no-data-text"
...@@ -297,14 +307,6 @@ limitations under the License. ...@@ -297,14 +307,6 @@ limitations under the License.
</div> </div>
</div> </div>
</div> </div>
<div v-if="loading"
class="no-data-page">
<div class="no-data-img">
<img :src="require('@/assets/images/nodata.png')"
alt="" />
<p class="no-data-text">{{$t("public.dataLoading")}}</p>
</div>
</div>
</div> </div>
<!-- tag dialog --> <!-- tag dialog -->
<div v-show="tagDialogShow" <div v-show="tagDialogShow"
...@@ -364,6 +366,7 @@ export default { ...@@ -364,6 +366,7 @@ export default {
data() { data() {
return { return {
tagDialogShow: false, tagDialogShow: false,
errorData: true,
tagScope: {}, tagScope: {},
iconValue: 0, iconValue: 0,
imageList: [], imageList: [],
...@@ -394,22 +397,8 @@ export default { ...@@ -394,22 +397,8 @@ export default {
summaryDirList: undefined, summaryDirList: undefined,
text: this.$t('modelTraceback.summaryPath'), text: this.$t('modelTraceback.summaryPath'),
checkedSummary: [], checkedSummary: [],
keysOfStringValue: [ keysOfStringValue: [], // All keys whose values are character strings
'summary_dir', keysOfIntValue: [], // All keys whose values are int
'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',
'device_num',
], // All keys whose values are int
keysOfMixed: [], keysOfMixed: [],
echart: { echart: {
chart: null, chart: null,
...@@ -459,6 +448,7 @@ export default { ...@@ -459,6 +448,7 @@ export default {
}, },
computed: {}, computed: {},
mounted() { mounted() {
this.setInitListValue();
this.imageList = []; this.imageList = [];
for (let i = 1; i <= 10; i++) { for (let i = 1; i <= 10; i++) {
const obj = {}; const obj = {};
...@@ -810,6 +800,25 @@ export default { ...@@ -810,6 +800,25 @@ export default {
this.tableFilter.summary_dir = undefined; this.tableFilter.summary_dir = undefined;
} }
}, },
setInitListValue() {
this.keysOfStringValue = [
'summary_dir',
'network',
'optimizer',
'loss_function',
'train_dataset_path',
'test_dataset_path',
'dataset_mark',
]; // All keys whose values are character strings
this.keysOfIntValue = [
'train_dataset_count',
'test_dataset_count',
'epoch',
'batch_size',
'device_num',
]; // All keys whose values are int
this.keysOfMixed = [];
},
/** /**
* Initialization * Initialization
...@@ -1002,6 +1011,8 @@ export default { ...@@ -1002,6 +1011,8 @@ export default {
(res) => { (res) => {
this.loading = false; this.loading = false;
if (res && res.data && res.data.object) { if (res && res.data && res.data.object) {
this.errorData = false;
this.setInitListValue();
const listTemp = this.setDataOfModel(res.data.object); const listTemp = this.setDataOfModel(res.data.object);
const list = JSON.parse(JSON.stringify(listTemp)); const list = JSON.parse(JSON.stringify(listTemp));
const tempEchartData = JSON.parse(JSON.stringify(listTemp)); const tempEchartData = JSON.parse(JSON.stringify(listTemp));
...@@ -1237,11 +1248,13 @@ export default { ...@@ -1237,11 +1248,13 @@ export default {
this.pagination.total = res.data.count || 0; this.pagination.total = res.data.count || 0;
} else { } else {
this.errorData = true;
this.noData = allData; this.noData = allData;
this.showEchartPic = !allData; this.showEchartPic = !allData;
} }
}, },
(error) => { (error) => {
this.errorData = true;
this.loading = false; this.loading = false;
if (allData) { if (allData) {
this.noData = allData; this.noData = allData;
...@@ -1250,6 +1263,7 @@ export default { ...@@ -1250,6 +1263,7 @@ export default {
}, },
) )
.catch(() => { .catch(() => {
this.errorData = true;
this.loading = false; this.loading = false;
this.noData = true; this.noData = true;
}); });
...@@ -1443,6 +1457,7 @@ export default { ...@@ -1443,6 +1457,7 @@ export default {
RequestService.queryLineagesData(params).then( RequestService.queryLineagesData(params).then(
(res) => { (res) => {
if (res && res.data && res.data.object) { if (res && res.data && res.data.object) {
this.errorData = false;
const list = this.setDataOfModel(res.data.object); const list = this.setDataOfModel(res.data.object);
this.echart.allData = list; this.echart.allData = list;
this.echart.brushData = list; this.echart.brushData = list;
...@@ -1459,9 +1474,13 @@ export default { ...@@ -1459,9 +1474,13 @@ export default {
this.recordsNumber = this.table.data.length; this.recordsNumber = this.table.data.length;
this.showNumber = this.table.data.length; this.showNumber = this.table.data.length;
this.pagination.total = res.data.count || 0; this.pagination.total = res.data.count || 0;
} else {
this.errorData = true;
} }
}, },
(error) => {}, (error) => {
this.errorData = true;
},
); );
}, },
...@@ -1492,6 +1511,7 @@ export default { ...@@ -1492,6 +1511,7 @@ export default {
.then( .then(
(res) => { (res) => {
if (res && res.data && res.data.object) { if (res && res.data && res.data.object) {
this.errorData = false;
const list = this.setDataOfModel(res.data.object); const list = this.setDataOfModel(res.data.object);
const tempList = list.slice(0, this.pagination.pageSize); const tempList = list.slice(0, this.pagination.pageSize);
this.recordsNumber = tempList.length; this.recordsNumber = tempList.length;
...@@ -1508,11 +1528,17 @@ export default { ...@@ -1508,11 +1528,17 @@ export default {
this.table.data = tempList; this.table.data = tempList;
this.pagination.total = res.data.count || 0; this.pagination.total = res.data.count || 0;
this.pagination.currentPage = 1; this.pagination.currentPage = 1;
} else {
this.errorData = true;
} }
}, },
(error) => {}, (error) => {
this.errorData = true;
},
) )
.catch(() => {}); .catch(() => {
this.errorData = true;
});
}, },
/** /**
...@@ -1746,82 +1772,74 @@ export default { ...@@ -1746,82 +1772,74 @@ export default {
RequestService.queryLineagesData(filterParams) RequestService.queryLineagesData(filterParams)
.then( .then(
(res) => { (res) => {
if ( if (res && res.data && res.data.object) {
res && this.errorData = false;
res.data && if (res.data.object.length) {
res.data.object && let customized = {};
res.data.object.length customized = JSON.parse(
) { JSON.stringify(res.data.customized),
let customized = {}; );
customized = JSON.parse(JSON.stringify(res.data.customized)); const customizedKeys = Object.keys(customized);
const customizedKeys = Object.keys(customized); if (customizedKeys.length) {
if (customizedKeys.length) { this.setInitListValue();
this.keysOfStringValue = [ customizedKeys.forEach((i) => {
'summary_dir', if (customized[i].type === this.valueType.int) {
'network', this.keysOfIntValue.push(i);
'optimizer', } else if (customized[i].type === this.valueType.str) {
'loss_function', this.keysOfStringValue.push(i);
'train_dataset_path', } else if (
'test_dataset_path', customized[i].type === this.valueType.mixed
'dataset_mark', ) {
]; // list of type mixed
this.keysOfIntValue = [ this.keysOfMixed.push(i);
'train_dataset_count', this.keysOfStringValue.push(i);
'test_dataset_count',
'epoch',
'batch_size',
'device_num',
];
this.keysOfMixed = [];
customizedKeys.forEach((i) => {
if (customized[i].type === this.valueType.int) {
this.keysOfIntValue.push(i);
} else if (customized[i].type === this.valueType.str) {
this.keysOfStringValue.push(i);
} else if (customized[i].type === this.valueType.mixed) {
// list of type mixed
this.keysOfMixed.push(i);
this.keysOfStringValue.push(i);
}
});
}
const list = this.setDataOfModel(res.data.object);
if (this.hidenDirChecked.length) {
this.hidenDirChecked.forEach((dir) => {
list.forEach((item, index) => {
if (item.summary_dir === dir) {
list.splice(index, 1);
} }
}); });
}
const list = this.setDataOfModel(res.data.object);
if (this.hidenDirChecked.length) {
this.hidenDirChecked.forEach((dir) => {
list.forEach((item, index) => {
if (item.summary_dir === dir) {
list.splice(index, 1);
}
});
});
}
if (!list.length) {
this.noData = true;
this.showEchartPic = false;
this.summaryDirList = [];
this.checkedSummary = [];
this.$store.commit('setSummaryDirList', []);
return;
}
const summaryDirList = list.map((i) => i.summary_dir);
this.$store.commit('setSummaryDirList', summaryDirList);
this.echart.showData = this.echart.brushData = list;
this.$nextTick(() => {
this.initChart();
}); });
} this.getTableList(tableParams);
if (!list.length) { } else {
this.noData = true;
this.showEchartPic = false;
this.summaryDirList = []; this.summaryDirList = [];
this.checkedSummary = [];
this.$store.commit('setSummaryDirList', []); this.$store.commit('setSummaryDirList', []);
return; this.checkedSummary = [];
this.noData = true;
this.showEchartPic = false;
} }
const summaryDirList = list.map((i) => i.summary_dir);
this.$store.commit('setSummaryDirList', summaryDirList);
this.echart.showData = this.echart.brushData = list;
this.$nextTick(() => {
this.initChart();
});
this.getTableList(tableParams);
} else { } else {
this.summaryDirList = []; this.errorData = true;
this.$store.commit('setSummaryDirList', []);
this.checkedSummary = [];
this.noData = true;
this.showEchartPic = false;
} }
}, },
(error) => {}, (error) => {
this.errorData = true;
},
) )
.catch(() => {}); .catch(() => {
this.errorData = true;
});
} }
}); });
}, },
...@@ -1833,30 +1851,38 @@ export default { ...@@ -1833,30 +1851,38 @@ export default {
RequestService.queryLineagesData(tableParams) RequestService.queryLineagesData(tableParams)
.then( .then(
(res) => { (res) => {
if (res && res.data && res.data.object && res.data.object.length) { if (res && res.data && res.data.object) {
const list = this.setDataOfModel(res.data.object); this.errorData = false;
if (res.data.object.length) {
if (this.hidenDirChecked.length) { const list = this.setDataOfModel(res.data.object);
this.hidenDirChecked.forEach((dir) => { if (this.hidenDirChecked.length) {
list.forEach((item, index) => { this.hidenDirChecked.forEach((dir) => {
if (item.summary_dir === dir) { list.forEach((item, index) => {
list.splice(index, 1); 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;
this.pagination.currentPage = 1;
this.pagination.total = this.echart.brushData.length;
this.$refs.table.clearSelection();
} }
const tempList = list.slice(0, this.pagination.pageSize); } else {
this.recordsNumber = tempList.length; this.errorData = true;
this.showNumber = tempList.length;
this.table.data = tempList;
this.pagination.currentPage = 1;
this.pagination.total = this.echart.brushData.length;
this.$refs.table.clearSelection();
} }
}, },
(error) => {}, (error) => {
this.errorData = true;
},
) )
.catch(() => {}); .catch(() => {
this.errorData = true;
});
}, },
/** /**
* Resetting the Eechart * Resetting the Eechart
...@@ -2043,9 +2069,41 @@ export default { ...@@ -2043,9 +2069,41 @@ export default {
} }
#cl-model-traceback { #cl-model-traceback {
display: flex;
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
position: relative; position: relative;
background: #fff;
.no-data-page {
display: flex;
width: 100%;
flex: 1;
justify-content: center;
align-items: center;
.set-height-class {
height: 282px !important;
}
.no-data-img {
background: #fff;
text-align: center;
height: 200px;
width: 310px;
margin: auto;
img {
max-width: 100%;
}
p {
font-size: 16px;
padding-top: 10px;
text-align: center;
}
}
.no-data-text {
font-size: 16px;
padding-top: 10px;
text-align: center;
}
}
.el-table th.gutter { .el-table th.gutter {
display: table-cell !important; display: table-cell !important;
} }
...@@ -2151,8 +2209,9 @@ export default { ...@@ -2151,8 +2209,9 @@ export default {
.cl-model-right { .cl-model-right {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; width: 100%;
background-color: #ffffff; flex: 1;
background-color: #fff;
-webkit-box-shadow: 0 1px 0 0 rgba(200, 200, 200, 0.5); -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); box-shadow: 0 1px 0 0 rgba(200, 200, 200, 0.5);
overflow: hidden; overflow: hidden;
...@@ -2226,25 +2285,6 @@ export default { ...@@ -2226,25 +2285,6 @@ export default {
height: 40px; height: 40px;
} }
} }
.no-data-page {
width: 100%;
height: 100%;
padding-top: 200px;
.no-data-img {
background: #fff;
text-align: center;
height: 100%;
width: 310px;
margin: auto;
img {
max-width: 100%;
}
p {
font-size: 16px;
padding-top: 10px;
}
}
}
} }
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册