Commit 819b5812 by zhuxiaomei

首页修改

parent a4ba7c16
......@@ -29,4 +29,5 @@ export default {
deletePlanSampler:data=>http.post('/drs/v1/sampling_plan/delete_plan_sampler', data).then(res=>res),
saveSubmitPlan:data=>http.post('/drs/v1/sampling_plan/save_submit_plan', data).then(res=>res),
getSamplerPlace:data=>http.post('/drs/v1/sampling_plan/search_selected_sampler_place', data).then(res=>res),
searchModelCount:data=>http.post('/drs/v1/sampling_plan/search_model_count', data).then(res=>res),
}
......@@ -8,7 +8,7 @@
<div>
<div class="title">我创建的抽样计划</div>
<!--todo 每个模块的数量-->
<div class="num">3</div>
<div class="num">{{ planCount }}</div>
</div>
</div>
<div class="box-c box-c-2">
......@@ -18,7 +18,7 @@
<img src="@/assets/home/task.png"></div>
<div class="cont">
<div class="title">我的双随机任务</div>
<div class="num">4</div>
<div class="num">{{ taskCount }}</div>
</div>
</div>
<div @click="_goto('/sampling_list/sampling_task')">
......@@ -27,7 +27,7 @@
<img src="@/assets/home/task-edit.png"></div>
<div class="cont">
<div class="title">抽样信息录入</div>
<div class="num">4</div>
<div class="num">{{ samplingCount }}</div>
</div>
</div>
</div>
......@@ -38,7 +38,7 @@
<img src="@/assets/home/message.png"></div>
<div class="cont">
<div class="title">消息</div>
<div class="num">4</div>
<div class="num">{{ msgCount }}</div>
</div>
</div>
<div @click="_goto('/history_sampling/sampling_list')">
......@@ -64,6 +64,7 @@
</template>
<script>
import {samplingPlan, message} from '../api/index'
import FooterBar from '@/components/FooterBar.vue'
export default {
......@@ -72,7 +73,12 @@ export default {
FooterBar
},
data() {
return {}
return {
planCount: '',
taskCount: '',
samplingCount: '',
msgCount: ''
}
},
mounted() {
const that = this
......@@ -83,8 +89,21 @@ export default {
}
})()
}
that._getNum()
},
methods: {
_getNum: async function () {
const result = await samplingPlan.searchModelCount()
if (result) {
this.planCount = result.planCount
this.taskCount = result.taskCount
this.samplingCount = result.samplingCount
}
const msgResult = await message.myPage({page: 1, rows: 1, service: 'drs', read: 0})
if (msgResult) {
this.msgCount = msgResult.total
}
},
_goto(uri) {
this.$router.push(uri)
}
......
......@@ -23,6 +23,7 @@ import indexImg1 from '../assets/index/1.png'
import indexImg11 from '../assets/index/11.png'
import indexImg13 from '../assets/index/13.png'
import FooterBar from '@/components/FooterBar.vue'
import {samplingPlan} from "../api";
export default {
name: "Home",
......@@ -38,6 +39,9 @@ export default {
{img: indexImg11, title: '历史任务', uri: '/history_sampling/sampling_list'},
{img: indexImg13, title: '双随机实现流程', uri: '/flow_chart'},
],
planCount:'',
taskCount:'',
samplingCount:''
}
},
mounted() {
......@@ -49,8 +53,17 @@ export default {
}
})()
}
that._getNum()
},
methods: {
_getNum:async function(){
const result = await samplingPlan.searchModelCount()
if(result){
this.planCount = result.planCount
this.taskCount = result.taskCount
this.samplingCount = result.samplingCount
}
},
_goto(item) {
this.$router.push(item.uri)
}
......
......@@ -8,7 +8,7 @@
<div>
<div class="title">我创建的抽样计划</div>
<!--todo 每个模块的数量-->
<div class="num">3</div>
<div class="num">{{ planCount }}</div>
</div>
</div>
<div class="box-c box-c-2" @click="_goto('/sampling_task/sampling_task')">
......@@ -17,7 +17,7 @@
<img src="@/assets/home/task.png"></div>
<div>
<div class="title">我的双随机任务</div>
<div class="num">4</div>
<div class="num">{{ taskCount }}</div>
</div>
</div>
<div class="box-c box-c-3" @click="_goto('/sampling_list/sampling_task')">
......@@ -26,7 +26,7 @@
<img src="@/assets/home/task-edit.png"></div>
<div>
<div class="title">抽样信息录入</div>
<div class="num">4</div>
<div class="num">{{ samplingCount }}</div>
</div>
</div>
<div class="box-c box-c-4" @click="_goto('/message')">
......@@ -35,7 +35,7 @@
<img src="@/assets/home/message.png"></div>
<div>
<div class="title">消息</div>
<div class="num">4</div>
<div class="num">{{ msgCount }}</div>
</div>
</div>
......@@ -62,6 +62,7 @@
<script>
import FooterBar from '@/components/FooterBar.vue'
import {samplingPlan, message} from "../api";
export default {
name: "Home",
......@@ -69,7 +70,12 @@ export default {
FooterBar
},
data() {
return {}
return {
planCount: '',
taskCount: '',
samplingCount: '',
msgCount: ''
}
},
mounted() {
const that = this
......@@ -80,8 +86,21 @@ export default {
}
})()
}
that._getNum()
},
methods: {
_getNum: async function () {
const result = await samplingPlan.searchModelCount()
if (result) {
this.planCount = result.planCount
this.taskCount = result.taskCount
this.samplingCount = result.samplingCount
}
const msgResult = await message.myPage({page: 1, rows: 1, service: 'drs', read: 0})
if (msgResult) {
this.msgCount = msgResult.total
}
},
_goto(uri) {
this.$router.push(uri)
}
......@@ -125,18 +144,23 @@ img {
.box-c:nth-child(1) {
background-image: linear-gradient(45deg, #10239e, #adc6ff)
}
.box-c:nth-child(2) {
background-image:linear-gradient(45deg, #536DFE, #00B0Ff)
background-image: linear-gradient(45deg, #536DFE, #00B0Ff)
}
.box-c:nth-child(3) {
background-image: linear-gradient(45deg, #00B0Ff, #536DFE);
}
.box-c:nth-child(4) {
background-image: linear-gradient(45deg, #00BFA6, #0036ff)
}
.box-c:nth-child(5) {
background-image: linear-gradient(45deg, #0036ff, #00BFA6);
}
.box-c:nth-child(6) {
background-image: linear-gradient(45deg, #00474f, #87e8de)
......@@ -172,6 +196,7 @@ img {
}
}
.title {
font-weight: bold;
font-size: 18px
......
......@@ -197,6 +197,7 @@ export default {
page: this.page,
rows: this.rows,
planId: this.planId,
uid:this.$global.getUserInfo().id,
...this.formObj
};
if (this.key) {
......
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