|
@@ -10,48 +10,48 @@ export default {
|
|
|
data() {
|
|
|
let range = this.$util.dateUtil.getNearlyMonthRange();
|
|
|
return {
|
|
|
- today: this.$moment(range.endDate, 'YYYY/MM/DD'),
|
|
|
+ today: this.$moment(range.endDate, "YYYY/MM/DD"),
|
|
|
envData: [],
|
|
|
queryData: {
|
|
|
- companyId: '0',
|
|
|
- deptId: '0',
|
|
|
- timeRange: range
|
|
|
+ companyId: "0",
|
|
|
+ deptId: "0",
|
|
|
+ timeRange: range,
|
|
|
},
|
|
|
coreData: [
|
|
|
{
|
|
|
- title: '累计检查人数(人/月)',
|
|
|
+ title: "累计检查人数(人/月)",
|
|
|
num: 0,
|
|
|
- historyDesc: '同比',
|
|
|
- historyNum: 0
|
|
|
+ historyDesc: "同比",
|
|
|
+ historyNum: 0,
|
|
|
},
|
|
|
{
|
|
|
- title: '健康人数(人/月)',
|
|
|
+ title: "健康人数(人/月)",
|
|
|
num: 0,
|
|
|
- historyDesc: '同比',
|
|
|
- historyNum: 0
|
|
|
+ historyDesc: "同比",
|
|
|
+ historyNum: 0,
|
|
|
},
|
|
|
{
|
|
|
- title: '亚健康人数(人/月)',
|
|
|
+ title: "亚健康人数(人/月)",
|
|
|
num: 0,
|
|
|
- unit: '元',
|
|
|
- historyDesc: '同比',
|
|
|
- historyNum: 0
|
|
|
+ unit: "元",
|
|
|
+ historyDesc: "同比",
|
|
|
+ historyNum: 0,
|
|
|
},
|
|
|
{
|
|
|
type: 1,
|
|
|
isHighLight: false,
|
|
|
- title: '最多患病问题',
|
|
|
- content: ''
|
|
|
+ title: "最多患病问题",
|
|
|
+ content: "",
|
|
|
},
|
|
|
{
|
|
|
type: 1,
|
|
|
isHighLight: false,
|
|
|
- title: '值得关注',
|
|
|
+ title: "值得关注",
|
|
|
showStar: true,
|
|
|
- content: ''
|
|
|
+ content: "",
|
|
|
},
|
|
|
- ]
|
|
|
- }
|
|
|
+ ],
|
|
|
+ };
|
|
|
},
|
|
|
components: {
|
|
|
Query,
|
|
@@ -65,86 +65,92 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
- this.$util.asyncPromise(
|
|
|
- this.getCoreData(),
|
|
|
- this.getEnvInfo(),
|
|
|
- );
|
|
|
- },
|
|
|
- reset() {
|
|
|
+ this.$util.asyncPromise(this.getCoreData(), this.getEnvInfo());
|
|
|
},
|
|
|
+ reset() {},
|
|
|
search(data) {
|
|
|
this.$util.asyncPromise(
|
|
|
- this.getCoreData(),
|
|
|
- this.$refs.LifeHealthyHomeChart.getData(),
|
|
|
- )
|
|
|
+ this.getCoreData(),
|
|
|
+ this.$refs.LifeHealthyHomeChart.getData()
|
|
|
+ );
|
|
|
},
|
|
|
getCoreData() {
|
|
|
- return apiLifeHealthyHome.getCoreData(this.queryData).then(res=>{
|
|
|
- this.coreData[0].num = res.list[0].value
|
|
|
- this.coreData[0].historyNum = res.list[0].compare
|
|
|
- this.coreData[1].num = res.list[1].value
|
|
|
- this.coreData[1].historyNum = res.list[1].compare
|
|
|
- this.coreData[2].num = res.list[2].value
|
|
|
- this.coreData[2].historyNum = res.list[2].compare
|
|
|
- this.coreData[3].content = res.list[3].value
|
|
|
- this.coreData[4].content = res.worthAttention
|
|
|
- })
|
|
|
+ return apiLifeHealthyHome.getCoreData(this.queryData).then((res) => {
|
|
|
+ this.coreData[0].num = res.list[0].value;
|
|
|
+ this.coreData[0].historyNum = res.list[0].compare;
|
|
|
+ this.coreData[1].num = res.list[1].value;
|
|
|
+ this.coreData[1].historyNum = res.list[1].compare;
|
|
|
+ this.coreData[2].num = res.list[2].value;
|
|
|
+ this.coreData[2].historyNum = res.list[2].compare;
|
|
|
+ this.coreData[3].content = res.list[3].value;
|
|
|
+ this.coreData[4].content = res.worthAttention;
|
|
|
+ });
|
|
|
},
|
|
|
getEnvInfo(date) {
|
|
|
if (date) {
|
|
|
- this.queryData['date'] = date;
|
|
|
+ this.queryData["date"] = date;
|
|
|
} else {
|
|
|
- this.queryData['date'] = this.today;
|
|
|
+ this.queryData["date"] = this.today;
|
|
|
}
|
|
|
|
|
|
- return apiLifeHealthyHome.getEnvironmentalDetection(this.queryData).then(res=>{
|
|
|
- let envData = [];
|
|
|
- res.forEach(item=>{
|
|
|
- let obj = {};
|
|
|
- obj['title'] = item.title.toUpperCase();
|
|
|
- obj['value'] = item.value;
|
|
|
- if (item.type == '1') {
|
|
|
- obj['icon'] = 'life/'+item.key+'_green.png';
|
|
|
- } else {
|
|
|
- obj['icon'] = 'life/'+item.key+'_blue.png';
|
|
|
- }
|
|
|
- envData.push(obj)
|
|
|
+ return apiLifeHealthyHome
|
|
|
+ .getEnvironmentalDetection(this.queryData)
|
|
|
+ .then((res) => {
|
|
|
+ let envData = [];
|
|
|
+ res.forEach((item) => {
|
|
|
+ let obj = {};
|
|
|
+ obj["title"] = item.title.toUpperCase();
|
|
|
+ obj["value"] = item.value;
|
|
|
+ if (item.type == "1") {
|
|
|
+ obj["icon"] = "life/" + item.key + "_green.png";
|
|
|
+ } else {
|
|
|
+ obj["icon"] = "life/" + item.key + "_blue.png";
|
|
|
+ }
|
|
|
+ envData.push(obj);
|
|
|
+ });
|
|
|
+ this.envData = envData;
|
|
|
});
|
|
|
- this.envData = envData;
|
|
|
- })
|
|
|
},
|
|
|
onEnvDateChange(val) {
|
|
|
this.getEnvInfo(val);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div class="lifeHealthyHome">
|
|
|
- <div class="page-query-core">
|
|
|
- <a-row>
|
|
|
- <a-col>
|
|
|
- <div class="lifeHealthyHome-query">
|
|
|
- <Query :query-data.sync="queryData" :show="['company','dept','time']" :reset="reset"
|
|
|
- :search="search"></Query>
|
|
|
- </div>
|
|
|
- </a-col>
|
|
|
- <a-col>
|
|
|
- <div class="lifeHealthyHome-core">
|
|
|
- <Card title="核心指标">
|
|
|
- <CoreData :data-list="coreData"></CoreData>
|
|
|
- </Card>
|
|
|
- </div>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- </div>
|
|
|
- <a-row >
|
|
|
+ <div class="page-query-core">
|
|
|
+ <a-row>
|
|
|
+ <a-col style="margin-bottom: 10px">
|
|
|
+ <div class="lifeHealthyHome-query">
|
|
|
+ <Query
|
|
|
+ :query-data.sync="queryData"
|
|
|
+ :show="['company', 'dept', 'time']"
|
|
|
+ :reset="reset"
|
|
|
+ :search="search"
|
|
|
+ ></Query>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ <a-col>
|
|
|
+ <div class="lifeHealthyHome-core">
|
|
|
+ <Card title="核心指标">
|
|
|
+ <CoreData :data-list="coreData"></CoreData>
|
|
|
+ </Card>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
+ <a-row>
|
|
|
<a-col :span="18">
|
|
|
<div class="lifeHealthyHome-left">
|
|
|
<div class="lifeHealthyHome-detail ioc-card-content">
|
|
|
<Card title="小屋分析">
|
|
|
- <LifeHealthyHomeChart ref="LifeHealthyHomeChart" :query-data="queryData" :height="430"></LifeHealthyHomeChart>
|
|
|
+ <LifeHealthyHomeChart
|
|
|
+ ref="LifeHealthyHomeChart"
|
|
|
+ :query-data="queryData"
|
|
|
+ :height="430"
|
|
|
+ ></LifeHealthyHomeChart>
|
|
|
</Card>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -154,32 +160,79 @@ export default {
|
|
|
<div class="lifeHealthyHome-top ioc-card-content">
|
|
|
<Card title="环境监测">
|
|
|
<template #title-extra>
|
|
|
- <a-date-picker size="small" style="width: 120px" :default-value="today" :valueFormat="'YYYY/MM/DD'" @change="onEnvDateChange" />
|
|
|
+ <a-date-picker
|
|
|
+ size="small"
|
|
|
+ style="width: 120px"
|
|
|
+ :default-value="today"
|
|
|
+ :valueFormat="'YYYY/MM/DD'"
|
|
|
+ @change="onEnvDateChange"
|
|
|
+ />
|
|
|
</template>
|
|
|
|
|
|
- <a-row :gutter="[12,18]" style="padding: 12px">
|
|
|
- <a-col style="color: #B3B3B3">
|
|
|
- <div style="width: 50%;display: inline-block;text-align: center">
|
|
|
- <span style="background-color: #73e6ac;display: inline-block;width: 14px;height: 14px;"></span>
|
|
|
- <span style="display: inline-block;vertical-align: text-bottom;margin-left: 12px">室内</span>
|
|
|
+ <a-row :gutter="[12, 18]" style="padding: 12px">
|
|
|
+ <a-col style="color: #b3b3b3">
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ width: 50%;
|
|
|
+ display: inline-block;
|
|
|
+ text-align: center;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ style="
|
|
|
+ background-color: #73e6ac;
|
|
|
+ display: inline-block;
|
|
|
+ width: 14px;
|
|
|
+ height: 14px;
|
|
|
+ "
|
|
|
+ ></span>
|
|
|
+ <span
|
|
|
+ style="
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: text-bottom;
|
|
|
+ margin-left: 12px;
|
|
|
+ "
|
|
|
+ >室内</span
|
|
|
+ >
|
|
|
</div>
|
|
|
- <div style="width: 50%;display: inline-block;text-align: center">
|
|
|
- <span style="background-color: #80d4ff;display: inline-block;width: 14px;height: 14px"></span>
|
|
|
- <span style="display: inline-block;vertical-align: text-bottom;margin-left: 12px">室外</span>
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ width: 50%;
|
|
|
+ display: inline-block;
|
|
|
+ text-align: center;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ style="
|
|
|
+ background-color: #80d4ff;
|
|
|
+ display: inline-block;
|
|
|
+ width: 14px;
|
|
|
+ height: 14px;
|
|
|
+ "
|
|
|
+ ></span>
|
|
|
+ <span
|
|
|
+ style="
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: text-bottom;
|
|
|
+ margin-left: 12px;
|
|
|
+ "
|
|
|
+ >室外</span
|
|
|
+ >
|
|
|
</div>
|
|
|
</a-col>
|
|
|
- <a-col :span="12" v-for="(item,index) in envData" :key="index" >
|
|
|
- <LifeHealthyHomeMonitor :title="item.title" :value="item.value" :icon="item.icon"></LifeHealthyHomeMonitor>
|
|
|
+ <a-col :span="12" v-for="(item, index) in envData" :key="index">
|
|
|
+ <LifeHealthyHomeMonitor
|
|
|
+ :title="item.title"
|
|
|
+ :value="item.value"
|
|
|
+ :icon="item.icon"
|
|
|
+ ></LifeHealthyHomeMonitor>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</Card>
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-col>
|
|
|
-
|
|
|
-
|
|
|
</a-row>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -191,6 +244,10 @@ export default {
|
|
|
vertical-align: top;
|
|
|
.lifeHealthyHome-query {
|
|
|
width: 100%;
|
|
|
+ background: #fff;
|
|
|
+ height: 60px;
|
|
|
+ padding: 10px;
|
|
|
+ border-radius: 5px;
|
|
|
}
|
|
|
.lifeHealthyHome-core {
|
|
|
width: 100%;
|
|
@@ -218,4 +275,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|