Commit 7cebc2fc by 姜雷

调整数据首页样式

parent c9d35d40
...@@ -56,6 +56,7 @@ const actions = { ...@@ -56,6 +56,7 @@ const actions = {
}) })
.catch(err => { .catch(err => {
console.error(err); console.error(err);
commit(FETCH_DATA, false);
}); });
}, },
}; };
......
...@@ -55,6 +55,7 @@ const actions = { ...@@ -55,6 +55,7 @@ const actions = {
}) })
.catch(err => { .catch(err => {
console.error(err); console.error(err);
commit(FETCH_DATA, false);
}); });
}, },
}; };
......
...@@ -103,20 +103,25 @@ const actions = { ...@@ -103,20 +103,25 @@ const actions = {
data: { data: {
...entity, ...entity,
}, },
}).then(res => { })
let list = res.data; .then(res => {
if (data && data.updatePercentList) { let list = res.data;
commit(GET_PERCENT_DATA, list); if (data && data.updatePercentList) {
commit(GET_EUIPMENT_DATA, list); commit(GET_PERCENT_DATA, list);
commit(LOADING_SERVICE, false); commit(GET_EUIPMENT_DATA, list);
} else if (data && data.updateEuipmentList) { commit(LOADING_SERVICE, false);
commit(GET_EUIPMENT_DATA, list); } else if (data && data.updateEuipmentList) {
commit(LOADING_EQUIPMENT, false); commit(GET_EUIPMENT_DATA, list);
} else { commit(LOADING_EQUIPMENT, false);
commit(GET_CONSUME_DATA, list); } else {
commit(GET_CONSUME_DATA, list);
commit(LOADING_AREA, false);
}
})
.catch(err => {
console.error(err);
commit(LOADING_AREA, false); commit(LOADING_AREA, false);
} });
});
}, },
fetchReportList({ commit }, entity) { fetchReportList({ commit }, entity) {
commit(LOADING_REGIST, true); commit(LOADING_REGIST, true);
......
...@@ -95,14 +95,18 @@ export default { ...@@ -95,14 +95,18 @@ export default {
} }
.el-input, .el-input,
.filter-item-label { .filter-item-label {
width: auto; min-width: 40px;
} }
.Dashboard-Radio { .Dashboard-Radio {
display: flex; display: flex;
align-items: center; align-items: center;
justify-self: flex-end; justify-self: flex-end;
.Dashboard-Radio-item { .Dashboard-Radio-item {
margin: 0 10px 0 0; font-size: 12px;
margin: 0 5px 0 0;
.el-radio__label {
padding-left: 2px;
}
} }
} }
} }
...@@ -113,12 +117,17 @@ export default { ...@@ -113,12 +117,17 @@ export default {
border-bottom: 1px solid #f1f1f1; border-bottom: 1px solid #f1f1f1;
.filter-item { .filter-item {
margin: 0 0 0 10px; margin: 0 0 0 10px;
.filter-item-input {
width: auto;
}
} }
} }
.Dashboard-DataCard { .Dashboard-DataCard {
flex: 2; &:first-child {
flex: 2;
}
&:nth-child(2) { &:nth-child(2) {
flex: 2.5; flex: 2;
} }
&:last-child { &:last-child {
flex: 1; flex: 1;
...@@ -168,12 +177,12 @@ export default { ...@@ -168,12 +177,12 @@ export default {
// height: 400px; // height: 400px;
.Dashboard-SearchBar { .Dashboard-SearchBar {
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-between;
padding: 0; padding: 0;
height: 70px; height: 70px;
border-bottom: 1px solid #f1f1f1; border-bottom: 1px solid #f1f1f1;
.filter-item { .filter-item {
margin: 0 10px 0 0; margin: 0 0 0 10px;
.filter-item-input---normal { .filter-item-input---normal {
width: 113px; width: 113px;
} }
...@@ -205,17 +214,22 @@ export default { ...@@ -205,17 +214,22 @@ export default {
} }
} }
.Dashboard-DataCard { .Dashboard-DataCard {
flex: 2; &:first-child {
flex: 2;
}
&:nth-child(2) { &:nth-child(2) {
flex: 1.5; flex: 1.5;
} }
&:last-child {
flex: 1.5;
}
} }
} }
} }
@media screen and (max-width: $bigScreenWidth) { @media screen and (max-width: $bigScreenWidth) {
.Dashboard { .Dashboard {
.Dashboard-title { .Dashboard-title {
font-size: 16px; font-size: 14px;
} }
.Dashboard-SearchBar { .Dashboard-SearchBar {
padding: 10px 0 10px; padding: 10px 0 10px;
......
<template> <template>
<div class="Dashboard-Equipment"> <div
<div class="Dashboard-Equipment"
v-for="(item, index) in data.slice(0, 5)" :style="`width:${width}px`"
:key="index" >
class="Dashboard-Equipment-item" <template v-if="show">
>
<div <div
class="Dashboard-Equipment-icon" v-for="(item, index) in data.slice(0, 5)"
v-if="index === 0" :key="index"
class="Dashboard-Equipment-item"
> >
<img src="@/assets/images/dashboard/icon_no.1@2x.png" /> <div
class="Dashboard-Equipment-icon"
v-if="index === 0"
>
<img src="@/assets/images/dashboard/icon_no.1@2x.png" />
</div>
<div
class="Dashboard-Equipment-icon"
v-else-if="index === 1"
>
<img src="@/assets/images/dashboard/icon_no.2@2x.png" />
</div>
<div
class="Dashboard-Equipment-icon"
v-else-if="index === 2"
>
<img src="@/assets/images/dashboard/icon_no.3@2x.png" />
</div>
<div
class="Dashboard-Equipment-icon"
v-else-if="index === 3"
>
<img src="@/assets/images/dashboard/icon_4@2x.png" />
</div>
<div
class="Dashboard-Equipment-icon"
v-else
>
<img src="@/assets/images/dashboard/icon_5@2x.png" />
</div>
<div class="Dashboard-Equipment-name">{{ item.equipmentNumber }}</div>
<div
class="Dashboard-Equipment-location"
:title="item.equipmentPosition"
>
{{ item.equipmentPosition }}
</div>
<div class="Dashboard-Equipment-money">{{ item.money.toFixed(2) }}</div>
</div> </div>
<div </template>
class="Dashboard-Equipment-icon"
v-else-if="index === 1"
>
<img src="@/assets/images/dashboard/icon_no.2@2x.png" />
</div>
<div
class="Dashboard-Equipment-icon"
v-else-if="index === 2"
>
<img src="@/assets/images/dashboard/icon_no.3@2x.png" />
</div>
<div
class="Dashboard-Equipment-icon"
v-else
>NO.{{ index + 1 }}</div>
<div class="Dashboard-Equipment-name">{{ item.equipmentNumber }}</div>
<div
class="Dashboard-Equipment-location"
:title="item.equipmentPosition"
>
{{ item.equipmentPosition }}
</div>
<div class="Dashboard-Equipment-money">{{ item.money.toFixed(2) }}</div>
</div>
</div> </div>
</template> </template>
...@@ -48,6 +61,19 @@ export default { ...@@ -48,6 +61,19 @@ export default {
default: () => [], default: () => [],
}, },
}, },
data() {
return {
show: false,
width: 0,
};
},
mounted() {
let boxDom = document.querySelector('.EquipmentList');
let listDom = document.querySelector('.Dashboard-Equipment');
this.width = boxDom.clientWidth;
this.show = true;
},
}; };
</script> </script>
...@@ -80,7 +106,7 @@ export default { ...@@ -80,7 +106,7 @@ export default {
width: 64px; width: 64px;
} }
.Dashboard-Equipment-location { .Dashboard-Equipment-location {
width: 200px; width: 160px;
height: 1em; height: 1em;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -89,7 +115,7 @@ export default { ...@@ -89,7 +115,7 @@ export default {
.Dashboard-Equipment-money { .Dashboard-Equipment-money {
font-size: 16px; font-size: 16px;
text-align: right; text-align: right;
width: 116px; width: 100px;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment