diff --git a/cmdb-ui/src/modules/cmdb/assets/dashboard_empty.png b/cmdb-ui/src/modules/cmdb/assets/dashboard_empty.png new file mode 100644 index 0000000..59cf19c Binary files /dev/null and b/cmdb-ui/src/modules/cmdb/assets/dashboard_empty.png differ diff --git a/cmdb-ui/src/modules/cmdb/views/custom_dashboard/chart.vue b/cmdb-ui/src/modules/cmdb/views/custom_dashboard/chart.vue index 8808e6d..53a775e 100644 --- a/cmdb-ui/src/modules/cmdb/views/custom_dashboard/chart.vue +++ b/cmdb-ui/src/modules/cmdb/views/custom_dashboard/chart.vue @@ -32,19 +32,28 @@ v-if="options.chartType === 'table'" :span-method="mergeRowMethod" :border="!options.ret" - :show-header="!!options.ret" + show-overflow + show-header-overflow >
{ + this.attributes = res.attributes + const _data = [] + this.keyLength = this.options?.attr_ids?.length ?? 0 + const _columnName = [] + this.options.attr_ids.forEach((attr) => { + const _find = this.attributes.find((item) => item.id === attr) + _columnName.push(_find?.alias || _find?.name) + }) + this.columnName = _columnName + this.formatTableData(_data, this.data, {}) + this.tableData = _data + }) } } }, @@ -248,15 +270,15 @@ export default { } .cmdb-dashboard-grid-item-chart-icon { > i { - font-size: 4vw; + font-size: 40px; } > img { - width: 4vw; + width: 40px; } > span { display: inline-block; - width: 4vw; - height: 4vw; + width: 40px; + height: 40px; font-size: 50px; text-align: center; line-height: 50px; diff --git a/cmdb-ui/src/modules/cmdb/views/custom_dashboard/chartForm.vue b/cmdb-ui/src/modules/cmdb/views/custom_dashboard/chartForm.vue index a4ee0c0..ff2c294 100644 --- a/cmdb-ui/src/modules/cmdb/views/custom_dashboard/chartForm.vue +++ b/cmdb-ui/src/modules/cmdb/views/custom_dashboard/chartForm.vue @@ -82,7 +82,14 @@ prop="attr_ids" v-if="(['bar', 'line', 'pie'].includes(chartType) && form.category === 1) || chartType === 'table'" > - + {{ attr.alias || attr.name }} @@ -116,7 +123,7 @@ -
+
预览