diff --git a/src/components/charts/panel.scss b/src/components/charts/panel.scss index e214edd9..87ac02f4 100644 --- a/src/components/charts/panel.scss +++ b/src/components/charts/panel.scss @@ -106,6 +106,12 @@ font-size: 16px; color: #666666; } + .single-value__unit { + font-weight: normal; + padding-left: 10px; + color: #666; + font-size: 20px; + } } } &>.cn-chart__single-value.cn-chart__single-value--icon-right { diff --git a/src/components/entities/EntityList.vue b/src/components/entities/EntityList.vue index aea772be..79aada4b 100644 --- a/src/components/entities/EntityList.vue +++ b/src/components/entities/EntityList.vue @@ -26,45 +26,45 @@ diff --git a/src/components/entities/entities.scss b/src/components/entities/entities.scss index dac0f542..0bb674c8 100644 --- a/src/components/entities/entities.scss +++ b/src/components/entities/entities.scss @@ -70,18 +70,27 @@ } } .cn-entity__body { + overflow: hidden; + .body__row { + display: flex; padding: 0 0 0 20px; color: #666; .body__row-label { padding-right: 15px; } + .body__row-value { + width: calc(100% - 150px); + overflow: hidden; + text-overflow: ellipsis; + } } .body__detail { padding: 10px 0 0 20px; color: $--color-primary; cursor: pointer; + } } } diff --git a/src/views/charts/Chart.vue b/src/views/charts/Chart.vue index f29a027d..6bad8208 100644 --- a/src/views/charts/Chart.vue +++ b/src/views/charts/Chart.vue @@ -83,7 +83,10 @@ :icon="singleValue.icon" > - + { if (response.code === 200) { @@ -518,6 +521,11 @@ export default { gridColumn, gridRow } + }, + handleSingleValue () { + return function (value) { + return Number(value) < 0.01 ? '< 0.01' : this.$_.round(value, 2) + } } }, mounted () { @@ -537,6 +545,7 @@ export default { setup (props) { const chartInfo = JSON.parse(JSON.stringify(props.chart)) chartInfo.category = getTypeCategory(props.chart.type) + chartInfo.params = chartInfo.params ? JSON.parse(chartInfo.params) : null return { chartInfo, layoutConstant, diff --git a/src/views/entities/EntityExplorer.vue b/src/views/entities/EntityExplorer.vue index 827e0a97..b83b0f86 100644 --- a/src/views/entities/EntityExplorer.vue +++ b/src/views/entities/EntityExplorer.vue @@ -90,11 +90,8 @@ export default { default: break } const data = await this.loadFilterData(this.filterType, key) - if (this.$_.isEmpty(data)) { - this.filterData[index].hasnotMore = true - } else { - this.filterData[index].data = this.$_.concat(this.filterData[index].data, data) - } + this.filterData[index].data = this.$_.concat(this.filterData[index].data, data) + this.filterData[index].hasnotMore = this.$_.isEmpty(data) || data.length < 10 }, async loadFilterData (filterType, key) { let data @@ -174,6 +171,7 @@ export default { Promise.all(requests).then(responses => { data.forEach((d, i) => { d.data = responses[i] + d.hasnotMore = this.$_.isEmpty(responses[i]) || responses[i].length < 10 }) this.filterData = data }) @@ -222,6 +220,7 @@ export default { key: 'country', childrenKey: 'region', data: country, + hasnotMore: this.$_.isEmpty(country) || country.length < 10, filterType: this.filterType, loadFilter }) @@ -229,9 +228,11 @@ export default { title: this.$t('entities.asn'), key: 'asn', data: asn, + hasnotMore: this.$_.isEmpty(asn) || asn.length < 10, filterType: this.filterType, loadFilter }) + console.info(this.filterData) }, setup () { const filterType = ref(Object.keys(entityType)[0])