Skip to content

Commit 7b0d527

Browse files
authored
perf[style]: refine dashboard style in mobile (#2060)
1 parent 0b8baeb commit 7b0d527

File tree

6 files changed

+56
-7
lines changed

6 files changed

+56
-7
lines changed

src/views/dashboard/admin/components/BarChart.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export default {
3030
}
3131
},
3232
mounted() {
33-
this.initChart()
33+
this.$nextTick(() => {
34+
this.initChart()
35+
})
3436
this.__resizeHandler = debounce(() => {
3537
if (this.chart) {
3638
this.chart.resize()

src/views/dashboard/admin/components/LineChart.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ export default {
4545
}
4646
},
4747
mounted() {
48-
this.initChart()
48+
this.$nextTick(() => {
49+
this.initChart()
50+
})
51+
4952
if (this.autoResize) {
5053
this.__resizeHandler = debounce(() => {
5154
if (this.chart) {

src/views/dashboard/admin/components/PanelGroup.vue

+37-2
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ export default {
7373
<style lang="scss" scoped>
7474
.panel-group {
7575
margin-top: 18px;
76-
.card-panel-col{
76+
77+
.card-panel-col {
7778
margin-bottom: 32px;
7879
}
80+
7981
.card-panel {
8082
height: 108px;
8183
cursor: pointer;
@@ -86,61 +88,94 @@ export default {
8688
background: #fff;
8789
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
8890
border-color: rgba(0, 0, 0, .05);
91+
8992
&:hover {
9093
.card-panel-icon-wrapper {
9194
color: #fff;
9295
}
96+
9397
.icon-people {
94-
background: #40c9c6;
98+
background: #40c9c6;
9599
}
100+
96101
.icon-message {
97102
background: #36a3f7;
98103
}
104+
99105
.icon-money {
100106
background: #f4516c;
101107
}
108+
102109
.icon-shopping {
103110
background: #34bfa3
104111
}
105112
}
113+
106114
.icon-people {
107115
color: #40c9c6;
108116
}
117+
109118
.icon-message {
110119
color: #36a3f7;
111120
}
121+
112122
.icon-money {
113123
color: #f4516c;
114124
}
125+
115126
.icon-shopping {
116127
color: #34bfa3
117128
}
129+
118130
.card-panel-icon-wrapper {
119131
float: left;
120132
margin: 14px 0 0 14px;
121133
padding: 16px;
122134
transition: all 0.38s ease-out;
123135
border-radius: 6px;
124136
}
137+
125138
.card-panel-icon {
126139
float: left;
127140
font-size: 48px;
128141
}
142+
129143
.card-panel-description {
130144
float: right;
131145
font-weight: bold;
132146
margin: 26px;
133147
margin-left: 0px;
148+
134149
.card-panel-text {
135150
line-height: 18px;
136151
color: rgba(0, 0, 0, 0.45);
137152
font-size: 16px;
138153
margin-bottom: 12px;
139154
}
155+
140156
.card-panel-num {
141157
font-size: 20px;
142158
}
143159
}
144160
}
145161
}
162+
163+
@media (max-width:550px) {
164+
.card-panel-description {
165+
display: none;
166+
}
167+
168+
.card-panel-icon-wrapper {
169+
float: none !important;
170+
width: 100%;
171+
height: 100%;
172+
margin: 0 !important;
173+
174+
.svg-icon {
175+
display: block;
176+
margin: 14px auto !important;
177+
float: none !important;
178+
}
179+
}
180+
}
146181
</style>

src/views/dashboard/admin/components/PieChart.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export default {
2828
}
2929
},
3030
mounted() {
31-
this.initChart()
31+
this.$nextTick(() => {
32+
this.initChart()
33+
})
3234
this.__resizeHandler = debounce(() => {
3335
if (this.chart) {
3436
this.chart.resize()
@@ -58,7 +60,6 @@ export default {
5860
bottom: '10',
5961
data: ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
6062
},
61-
calculable: true,
6263
series: [
6364
{
6465
name: 'WEEKLY WRITE ARTICLES',

src/views/dashboard/admin/components/RaddarChart.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export default {
3030
}
3131
},
3232
mounted() {
33-
this.initChart()
33+
this.$nextTick(() => {
34+
this.initChart()
35+
})
3436
this.__resizeHandler = debounce(() => {
3537
if (this.chart) {
3638
this.chart.resize()

src/views/dashboard/admin/index.vue

+6
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,10 @@ export default {
115115
margin-bottom: 32px;
116116
}
117117
}
118+
119+
@media (max-width:1024px) {
120+
.chart-wrapper {
121+
padding: 8px;
122+
}
123+
}
118124
</style>

0 commit comments

Comments
 (0)