提交 3de39ca0 编写于 作者: guangjun.yang's avatar guangjun.yang

修改下拉选择

上级 c6574411
<!-- 标题组件 --> <!-- 标题组件 - 带下拉选择 -->
<template> <template>
<div class="common-title-wrapper"> <div class="common-title-wrapper">
<div class="mask"></div> <div v-show="isShowDropdown" class="mask" @click="isShowDropdown = !isShowDropdown"></div>
<ul class="mini"> <ul class="mini">
<li class="left">{{title}}</li> <li class="left">{{title}}</li>
<li class="right" v-if="needRightBtn"> <li class="right" v-if="needRightBtn" @click="isShowDropdown = !isShowDropdown">
<span>按获证比例排名</span> <span>{{cDesc || (dataList[0] && dataList[0].desc)}}</span>
<img src="../../assets/images/arr-down.png" alt /> <img src="../../assets/images/arr-down.png" alt />
</li> </li>
</ul> </ul>
<ul class="dropdown-menu"> <ul v-show="isShowDropdown" class="dropdown-menu">
<li v-for="(item, index) in dataList" :key="index"> <li v-for="(item, index) in dataList" :key="index" @click="selectSortItem(index)">
<span :class="{'active': cIndex === index }">{{item.desc}}</span> <span :class="{'active': cIndex === index }">{{item.desc}}</span>
<img v-show="cIndex === index" src="../../assets/images/sort-select-icon.png" alt=""> <img v-show="cIndex === index" src="../../assets/images/sort-select-icon.png" alt="">
</li> </li>
...@@ -27,27 +27,29 @@ export default { ...@@ -27,27 +27,29 @@ export default {
needRightBtn: { needRightBtn: {
type: Boolean, type: Boolean,
default: true default: true
},
dataList: {
type: Array,
default: () => []
} }
}, },
data() { data() {
return { return {
dataList: [{ isShowDropdown: false,
desc: '按获证比例排名',
type: 1
},{
desc: '按获证人数排名',
type: 2
},{
desc: '按参与人数排名',
type: 3
}],
cIndex: 0, cIndex: 0,
cDesc: '按获证比例排名', cDesc: '',
cType: 1 cType: 1
}; };
}, },
methods: {
methods: {
selectSortItem(index) {
this.isShowDropdown = false;
this.cIndex = index;
this.cDesc = this.dataList[index].desc;
this.cType = this.dataList[index].type;
this.$emit('selectSortItem', this.cType);
}
} }
}; };
</script> </script>
...@@ -64,7 +66,7 @@ export default { ...@@ -64,7 +66,7 @@ export default {
.mask { .mask {
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 100px;
z-index: 1002; z-index: 1002;
bottom: 0; bottom: 0;
right: 0; right: 0;
......
...@@ -217,7 +217,7 @@ export default { ...@@ -217,7 +217,7 @@ export default {
allData: {}, allData: {},
projectId: "", projectId: "",
token: token:
"8F88F86408314155B6840723FAB7DAEC" || "A7F0A8A4BB5C4EC4B78E71261B753C9C" ||
"A62E9F92365547A29724F21F29BED4F6" || "A62E9F92365547A29724F21F29BED4F6" ||
"4556EDEAAE134FE1B6E1356BF9C1B8F9", "4556EDEAAE134FE1B6E1356BF9C1B8F9",
isOrgStat: false, isOrgStat: false,
......
<template> <template>
<section> <section>
<CommonHeader title="完成天数排名"></CommonHeader> <CommonHeader title="完成天数排名"></CommonHeader>
<CommonTitleMini :title="listTitle"></CommonTitleMini> <CommonTitleMiniWithDropdown :dataList="dataList" :title="listTitle" :needRightBtn="needRightBtn" @selectSortItem="selectSortItem"></CommonTitleMiniWithDropdown>
<RankingItemDays :rankList="rankList"></RankingItemDays> <RankingItemDays :rankList="rankList"></RankingItemDays>
<CommonNoMore class="mt-10"></CommonNoMore> <CommonNoMore class="mt-10"></CommonNoMore>
</section> </section>
...@@ -11,14 +11,14 @@ const cookies = require("cookie-universal")(); ...@@ -11,14 +11,14 @@ const cookies = require("cookie-universal")();
import { getStudyTimeData } from "@/service"; import { getStudyTimeData } from "@/service";
import CommonHeader from "@/components/common/common-header"; import CommonHeader from "@/components/common/common-header";
import CommonTitleMini from "@/components/common/common-title-mini"; import CommonTitleMiniWithDropdown from "@/components/common/common-title-with-dropdown";
import RankingItemDays from "@/components/bussiness/ranking-item-days"; import RankingItemDays from "@/components/bussiness/ranking-item-days";
import CommonNoMore from "@/components/common/common-no-more"; import CommonNoMore from "@/components/common/common-no-more";
export default { export default {
data() { data() {
return { return {
listTitle: "共34个省", listTitle: '共0个省',
rankList: [], rankList: [],
queryGDParams: { queryGDParams: {
// appSelectType: 1, // appSelectType: 1,
...@@ -36,11 +36,21 @@ export default { ...@@ -36,11 +36,21 @@ export default {
type: 1 type: 1
} }
}, },
dataList: [{
desc: '按获证比例排名',
type: 1
},{
desc: '按获证人数排名',
type: 2
},{
desc: '按参与人数排名',
type: 3
}],
}; };
}, },
components: { components: {
CommonHeader, CommonHeader,
CommonTitleMini, CommonTitleMiniWithDropdown,
RankingItemDays, RankingItemDays,
CommonNoMore CommonNoMore
}, },
...@@ -63,9 +73,15 @@ export default { ...@@ -63,9 +73,15 @@ export default {
await getStudyTimeData(params).then(res => { await getStudyTimeData(params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.rankList = res.data.costRank; this.rankList = res.data.costRank;
this.listTitle = `共${this.rankList.length}个省`
} }
}); });
},
selectSortItem(type) {
// this.queryGDParams.pageCfg.type = type;
// this.getStudyTimeData(this.queryGDParams);
} }
} }
}; };
</script> </script>
......
<template> <template>
<section> <section>
<CommonHeader title="项目情况排名"></CommonHeader> <CommonHeader title="项目情况排名"></CommonHeader>
<CommonTitleMini2 :title="listTitle" :needRightBtn="needRightBtn"></CommonTitleMini2> <CommonTitleMini2 :dataList="dataList" :title="listTitle" :needRightBtn="needRightBtn" @selectSortItem="selectSortItem"></CommonTitleMini2>
<RankingList :rankList="rankList"></RankingList> <RankingList :rankList="rankList"></RankingList>
<CommonNoMore class="mt-10"></CommonNoMore> <CommonNoMore class="mt-10"></CommonNoMore>
</section> </section>
...@@ -11,14 +11,14 @@ const cookies = require("cookie-universal")(); ...@@ -11,14 +11,14 @@ const cookies = require("cookie-universal")();
import { getStudyRankData } from "@/service"; import { getStudyRankData } from "@/service";
import CommonHeader from "@/components/common/common-header"; import CommonHeader from "@/components/common/common-header";
import CommonTitleMini2 from "@/components/common/common-title-mini-2"; import CommonTitleMini2 from "@/components/common/common-title-with-dropdown";
import CommonNoMore from "@/components/common/common-no-more"; import CommonNoMore from "@/components/common/common-no-more";
import RankingList from "@/components/bussiness/ranking-item"; import RankingList from "@/components/bussiness/ranking-item";
export default { export default {
data() { data() {
return { return {
listTitle: '共34个省', listTitle: '共0个省',
rankList: [], rankList: [],
needRightBtn: true, needRightBtn: true,
queryGDParams: { queryGDParams: {
...@@ -37,6 +37,16 @@ export default { ...@@ -37,6 +37,16 @@ export default {
type: 1 type: 1
} }
}, },
dataList: [{
desc: '按获证比例排名',
type: 1
},{
desc: '按获证人数排名',
type: 2
},{
desc: '按参与人数排名',
type: 3
}],
}; };
}, },
components: { components: {
...@@ -65,9 +75,13 @@ export default { ...@@ -65,9 +75,13 @@ export default {
await getStudyRankData(params).then(res => { await getStudyRankData(params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.rankList = res.data.studyRank; this.rankList = res.data.studyRank;
// this.knowledgeEffectList = res.data.knowledgeEffectList; this.listTitle = `共${this.rankList.length}个省`
} }
}); });
},
selectSortItem(type) {
this.queryGDParams.pageCfg.type = type;
this.getStudyRankData(this.queryGDParams);
} }
}, },
......
...@@ -214,7 +214,7 @@ export const getStudyRankData = async data => { ...@@ -214,7 +214,7 @@ export const getStudyRankData = async data => {
method: 'post', method: 'post',
data: data, data: data,
withCredentials: true, withCredentials: true,
url: `stats/report/studyRank/1` url: `stats/report/studyRank/${data.pageCfg.type}`
}); });
}; };
...@@ -226,6 +226,6 @@ export const getStudyTimeData = async data => { ...@@ -226,6 +226,6 @@ export const getStudyTimeData = async data => {
method: 'post', method: 'post',
data: data, data: data,
withCredentials: true, withCredentials: true,
url: `stats/report/studyTime/1` url: `stats/report/studyTime/${data.pageCfg.type}`
}); });
}; };
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册