-
@@ -34,6 +34,7 @@ export default {
title: "销售额类别占比",
icon: "el-icon-help-filled",
description: "销售额类别",
+ minWidth:9,
components: {
xEcharts
},
@@ -54,7 +55,7 @@ export default {
trigger: 'item'
},
legend: {
- left: '70%',
+ left: '60%',
top: 'center',
width: 50,
formatter: (name)=> {
@@ -79,7 +80,7 @@ export default {
{
name: 'Access From',
type: 'pie',
- radius: ['50%', '80%'],
+ radius: ['30%', '60%'],
avoidLabelOverlap: false,
center:['30%','50%'],
itemStyle: {
diff --git a/src/views/home/widgets/index.vue b/src/views/home/widgets/index.vue
index 36b6cad..327d91e 100644
--- a/src/views/home/widgets/index.vue
+++ b/src/views/home/widgets/index.vue
@@ -16,14 +16,14 @@
@@ -85,6 +85,7 @@
this.defaultGrid = this.$tool.data.get("defaultgrid") || this.$config.DEFAULT_GRID
this.widgets = this.$tool.data.get('widgets');
+ console.log(this.widgets)
if (this.widgets.length==0) {
this.widgets = JSON.parse(JSON.stringify(this.defaultGrid))
}
@@ -100,7 +101,8 @@
key: key,
title: allComps[key].title,
icon: allComps[key].icon,
- description: allComps[key].description
+ description: allComps[key].description,
+ minWidth:allComps[key].minWidth
})
}
@@ -111,12 +113,11 @@
comp.disabled = true
}
}
- // console.log(allCompsList)
+ console.log(allCompsList)
return allCompsList
},
myCompsList(){
var myGrid = this.$tool.data.get("dashboardgrid")
- console.log(this.$tool.data.get("dashboardgrid"))
if (myGrid.length>0) {
return this.allCompsList.filter(item => !item.disabled && myGrid.includes(item.key))
}
@@ -131,6 +132,13 @@
this.$nextTick(() => {
const scale = this.$refs.widgets.offsetWidth / oldWidth
this.$refs.widgets.style.setProperty('transform', `scale(${scale})`)
+ this.setDomWidth(this.widgets)
+ })
+ },
+ //缩小窗口刷新元素
+ setDomWidth(data){
+ data.map(res=>{
+ this.sizeChange(res.name)
})
},
//追加
@@ -173,7 +181,7 @@
//修改组件大小
sizeChange(name){
// console.log(this.$refs[`components${name}`])
- this.$refs[`components${name}`].refView()
+ this.$refs[`components${name}`].refView&&this.$refs[`components${name}`].refView()
}
}
}