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

Merge branch 'dev-phrase2.1-0316' into 'release'

学情报告V2.1 code reviewer:杨广俊

学情报告V2.1 code reviewer:杨广俊

See merge request !10
# COMPONENTS
**This directory is not required, you can delete it if you don't want to use it.**
The components directory contains your Vue.js Components.
_Nuxt.js doesn't supercharge these components._
<template>
<div class="about-container">
about nuxtjs ssr
</div>
</template>
<script>
// asyncData fetch 在组件中无效
export default {
data() {
return {
name: 'about'
}
}
}
</script>
<style lang="less">
.about-container {
font-size: 18px;
}
</style>
\ No newline at end of file
此差异已折叠。
<template>
<!-- 专项合作列表 -->
<section class="coop-container">
<div
v-for="(item , index) in dataList"
:key="index"
class="coop-item"
@click="jumpByAuthId(item)"
>
<div class="coop-item-left">
<img :src="item.attachmentUrl">
</div>
<div class="coop-item-right">
<span class="coop-item-right-title">{{item.projectName}}</span>
<span class="coop-item-right-other">
<img src="../../assets/images/org.png" >
{{item.organizationNameList | subOrgNames}}
</span>
<span v-if="item.authType == 1"
class="coop-item-right-other">
<img src="../../assets/images/pub-time.png" >
2010-10-10
<!-- {{item.oldTime}} -->
<!-- <span class="pro-status" :class="{continue: item.projectStatus == 5}">
{{item.projectStatus == 5 ? '进行中' : item.projectStatus == 10 ? '已结束' : ''}}
</span> -->
</span>
<span v-else
class="coop-item-right-other"
><img src="../../assets/images/pub-time.png" >
2010.01.10 ~ 2010.10.10
<!-- {{item.projectBegintimeLong | formatTime}}-{{item.projectEndtimeLong | formatTime}} -->
<!-- <span class="pro-status" :class="{continue: item.projectStatus == 5}">
{{item.projectStatus == 5 ? '进行中' : item.projectStatus == 10 ? '已结束' : ''}}
</span> -->
</span>
</div>
</div>
<!-- <NoMoreContent v-show="dataList.length > 9"></NoMoreContent> -->
<!-- <NoContent v-show="!dataList.length && isShow"></NoContent> -->
<!-- <van-popup
v-model="showGoUpdate"
position="bottom"
:style="{ height: '4.427rem' }"
>
<div class="update-dialog-content">
<p class="title">本项目需要更新至最新版本才能参加哦</p>
<p class="update-btn v-hairline-top confirm-btn" @click="goUpdateHandler">立即更新</p>
<p class="update-btn v-hairline-top" @click="showGoUpdate = false">取消</p>
</div>
</van-popup> -->
</section>
</template>
<script>
// import NoMoreContent from "@/components/business/no-more-content";
// import NoContent from "@/components/business/no-content";
// import UpdateDialog from "@/components/business/update-dialog";
// import { setEventByModuleCode, deepCopy, getWebPageUrl } from "@/utils/index";
import { goNativePage, goPageByNative } from "@/utils/index";
// import { getAppVersion } from "@/utils";
// import { mapActions, mapGetters } from "vuex";
// import { Popup } from 'vant';
export default {
name: "coop-list-item",
data() {
return {
bgColor: "green"
};
},
props: {
dataList: {
type: Array,
default: () => []
},
},
// computed: {
// ...mapGetters(["userInfo"])
// },
components: {
// NoMoreContent,
// NoContent,
// UpdateDialog,
},
mounted() {},
filters: {
subOrgNames(orgNameList) {
let allName = orgNameList[0];
for(let i = 1; i < orgNameList.length; i ++) {
allName += `/${orgNameList[i]}`
}
if (allName && allName.length > 13) {
return allName.substring(0, 13) + '...'
} else {
return allName
}
},
// 将字符串截短至指定长度,并用在最后追加特定字符串(例如:...)
shortNameL(value, length = 15, append = '...') {
if (value && value.length > length) {
return value.substring(0, length) + append
} else {
return value
}
},
},
methods: {
jumpByAuthId(pInfo) {
// this.$sendBuriedData({
// component_tag: '467#400141'
// });
if(pInfo.authId == 1) {
goNativePage(this, pInfo);
} else {
goPageByNative(this, pInfo);
}
}
}
};
</script>
<style scoped lang="less">
.coop-container {
position: relative;
margin: 0px 15px;
&-status {
position: absolute;
top: 6px;
left: 0;
// display: block;
width: 44px;
height: 18px;
line-height: 18px;
padding: 0 0 0 4px;
background: rgba(88, 144, 221, 1);
color: #fff;
font-size: 11px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
}
.coop-item {
display: flex;
width: 100%;
height: 128px;
border-bottom: 1px solid #f0f0f0;
background: #fff;
flex-direction: row;
justify-content: center;
align-items: center;
img {
width: 115px;
height: 86px;
margin-right: 15px;
border-radius: 3px;
}
&-left {
display: flex;
position: relative;
top: 0;
}
&-right {
display: flex;
width: 215px;
flex-direction: column;
padding-top: 4px;
&-title {
height: 50px;
line-height: 23px;
font-size: 16px;
font-weight: 700;
color: rgba(55, 56, 57, 1);
}
&-other {
height: 20px;
line-height: 20px;
font-size: 13px;
font-weight: 400;
color: rgba(151, 152, 153, 1);
& > img {
position: relative;
top: 2px;
left: 0;
width: 15px;
height: 15px;
margin-right: 0;
}
.pro-status {
float: right;
font-size: 13px;
padding-right: 4px;
color: #979899;
&.continue {
color: #449284;
}
&.end {
color: #979899;
}
}
}
}
}
.update-dialog-content{
padding: 0 15px;
box-sizing: border-box;
.title{
text-align: center;
color: #373839;
font-size: 18px;
padding: 15px 0;
line-height: 25px;
}
.update-btn{
text-align: center;
height: 55px;
line-height: 55px;
font-size: 16px;
color: #979899;
&.confirm-btn{
color: #449284;
}
&.v-hairline-top::after{
border-top-width: 1px;
}
}
}
</style>
<style>
.van-overlay{
background-color: rgba(0,0,0,0.5);
}
</style>
<!-- 区域与机构选择(表头)组件 -->
<template>
<ul class="common-area-select">
<li class="center" @click="areaClick">
{{areaName}}<img v-show="!showArea" src="../../assets/images/arr-down.png"/><img v-show="showArea" src="../../assets/images/arr-up.png"/>
</li>
<li class="center" :class="{'gray': isNotVisible}" @click="orgClick">
{{orgName}}<img v-show="isNotVisible" src="../../assets/images/arr-down-white.png"/><img v-show="!showOrg && !isNotVisible" src="../../assets/images/arr-down.png"/><img v-show="showOrg && !isNotVisible" src="../../assets/images/arr-up.png"/>
</li>
</ul>
</template>
<script>
import { mapGetters } from "vuex";
export default {
props: {
areaName: {
type: String,
default: "全部"
},
orgName: {
type: String,
default: "全部机构"
},
showArea: {
type: Boolean,
default: false,
},
showOrg: {
type: Boolean,
default: false
}
},
computed: {
...mapGetters({
orgList: 'orgList',
areaDegree: 'areaDegree'
}),
isNotVisible() {
if((this.orgList && this.orgList.length == 0) || this.areaDegree == 0 || this.areaDegree == 1 || this.areaDegree == 2) {
return true;
} else {
return false;
}
}
},
methods: {
areaClick() {
this.$emit("areaClick");
},
orgClick() {
this.$emit("orgClick");
}
}
};
</script>
<style lang="less" scoped>
.common-area-select {
// padding-top: 50px;
display: flex;
width: 100%;
height: 35px;
line-height: 35px;
margin: 2px 0 10px;
flex-direction: row nowrap;
align-content: center;
align-items: center;
text-align: center;
justify-content: center; /* 水平居中 */
.center {
flex: 1;
font-size: 15px;
font-weight: 400;
color: #676869;
&.gray {
color: #C7C8C9;
}
}
img {
// padding-top: 10px;
position: relative;
left: 3px;
top: 1px;
width: 12px;
height: 12px;
}
}
</style>
......@@ -2,10 +2,7 @@
<template>
<ul class="common-area-select">
<li class="center" @click="areaClick">
{{areaName}}<img v-show="!showArea" src="../../assets/images/arr-down.png"/><img v-show="showArea" src="../../assets/images/arr-up.png"/>
</li>
<li class="center" :class="{'gray': isNotVisible}" @click="orgClick">
{{orgName}}<img v-show="isNotVisible" src="../../assets/images/arr-down-white.png"/><img v-show="!showOrg && !isNotVisible" src="../../assets/images/arr-down.png"/><img v-show="showOrg && !isNotVisible" src="../../assets/images/arr-up.png"/>
<span><img class="map" src="../../assets/images/map-icon.png"/>{{areaName}}</span><img v-show="!showArea" src="../../assets/images/arr-down.png"/><img v-show="showArea" src="../../assets/images/arr-up.png"/>
</li>
</ul>
</template>
......@@ -17,40 +14,21 @@ export default {
type: String,
default: "全部"
},
orgName: {
type: String,
default: "全部机构"
},
showArea: {
type: Boolean,
default: false,
},
showOrg: {
type: Boolean,
default: false
}
},
computed: {
...mapGetters({
orgList: 'orgList',
areaDegree: 'areaDegree'
}),
isNotVisible() {
if((this.orgList && this.orgList.length == 0) || this.areaDegree == 0 || this.areaDegree == 1 || this.areaDegree == 2) {
return true;
} else {
return false;
}
}
},
methods: {
areaClick() {
this.$emit("areaClick");
},
orgClick() {
this.$emit("orgClick");
}
}
};
</script>
......@@ -65,8 +43,8 @@ export default {
// padding-top: 50px;
display: flex;
width: 100%;
height: 35px;
line-height: 35px;
height: 44px;
line-height: 44px;
margin: 2px 0 0px;
flex-direction: row nowrap;
align-content: center;
......@@ -74,18 +52,34 @@ export default {
text-align: center;
justify-content: center; /* 水平居中 */
.center {
flex: 1;
display: flex;
flex-direction: row;
justify-content: space-between;
align-content: center;
align-items: center;
padding: 0 15px;
width: 100%;
// flex: 1;
font-size: 15px;
font-weight: 400;
color: #676869;
background: #F8F9FA;
&.gray {
color: #C7C8C9;
}
.map {
position: relative;
top: 2.5px;
left: -2px;
margin-right: 3px;
width: 16px;
height: 16px;
}
}
img {
// padding-top: 10px;
position: relative;
left: 3px;
left: 0;
top: 1px;
width: 12px;
height: 12px;
......
<!-- Tabs组件 -->
<template>
<div class="common-tabs-wrapper">
<ul class="common-tabs">
<li
v-show="(item === '总体概况'
|| item === '人群分析'
|| item === '课程分析' && projectInfo.existCourse === 1)
|| (item === '考试分析' && projectInfo.existExam === 1)
|| (item === '学习效果分析' && projectInfo.existEffect === 1)"
v-for="(item, index) in tapList"
:class="{'active': index === cIndex}"
:key="index"
@click="clickTab(index)"
>{{item}}</li>
</ul>
<span class="over"></span>
<span class="border"></span>
<div class="common-tabs-wrapper" :class="{'fixed': needFixed}">
<div class="sub-wrapper" :class="{'fixed': needFixed}">
<ul class="common-tabs" id="tabsWrapperId">
<li :id="'tabsItem' + index"
v-show="(item === '总体概况'
|| item === '人群分析'
|| item === '课程分析' && projectInfo.existCourse === 1)
|| (item === '考试分析' && projectInfo.existExam === 1)
|| (item === '学习效果分析' && projectInfo.existEffect === 1)"
v-for="(item, index) in tapList"
:class="{'active': index === cIndex}"
:key="index"
@click="clickTab(index)"
>{{item}}</li>
</ul>
<span class="over"></span>
<span class="border"></span>
</div>
</div>
</template>
<script>
......@@ -35,6 +37,10 @@ export default {
props: {
projectInfo: {
type: Object
},
needFixed: {
type: Boolean,
default: false
}
},
mounted() {},
......@@ -42,6 +48,7 @@ export default {
clickTab(index) {
this.cIndex = index;
this.$emit("tabClicked", index);
let tabsItemId = 'tabsItem' + index;
}
}
};
......@@ -49,17 +56,40 @@ export default {
<style lang="less" scoped>
.common-tabs-wrapper {
.sub-wrapper {
display: flex;
position: relative;
width: 100%;
top: 0;
left: 0;
z-index: 1;
font-size: 13px;
width: 100%;
white-space: nowrap;
&.fixed {
position: fixed;
top: 70px;
width: 100%;
z-index: 1000000000;
background: #fff;
white-space: nowrap;
overflow-x: auto;
}
}
display: flex;
position: relative;
width: 100%;
top: 0;
left: 0;
z-index: 1;
font-size: 13px;
z-index: 1000000000;
font-size: 13px;
.common-tabs {
width: 100%;
white-space: nowrap;
overflow-x: auto;
padding-bottom: 6px;
padding: 9px 0;
font-size: 13px;
// padding: 5px 0;
li {
display: inline-block;
height: 30px;
......@@ -73,6 +103,9 @@ export default {
border-radius: 30px;
&:first-child {
margin-left: 15px;
}
&:last-child {
margin-right: 15px;
}
&.active {
color: #449284;
......@@ -87,19 +120,19 @@ export default {
bottom: 0px;
left: 0;
width: 100%;
height: 6px;
z-index: 2;
height: 9px;
z-index: 10000000;
background: #fff;
}
.border {
display: block;
width: 100%;
height: 1px;
bottom: -3px;
bottom: 0px;
left: 0;
border-bottom: 1px solid #f0f1f2;
position: absolute;
z-index: 2;
z-index: 10000000;
}
}
</style>
......@@ -2,8 +2,8 @@
<template>
<div class="common-tabs-wrapper" :class="{'fixed': needFixed}">
<div class="sub-wrapper" :class="{'fixed': needFixed}">
<ul class="common-tabs">
<li
<ul class="common-tabs" id="tabsWrapperId">
<li :id="'tabsItem' + index"
v-show="(item === '总体概况'
|| item === '人群分析'
|| item === '课程分析' && projectInfo.existCourse === 1)
......@@ -15,12 +15,13 @@
@click="clickTab(index)"
>{{item}}</li>
</ul>
<span class="over"></span>
<!-- <span class="over"></span> -->
<span class="border"></span>
</div>
</div>
</template>
<script>
let scrollDom = [], maxScrollWidth = 375;
export default {
data() {
return {
......@@ -43,12 +44,15 @@ export default {
default: false
}
},
mounted() {},
mounted() {
},
methods: {
clickTab(index) {
this.cIndex = index;
this.$emit("tabClicked", index);
}
// this.scrollTabs(index);
},
}
};
</script>
......@@ -88,6 +92,9 @@ export default {
overflow-x: auto;
padding: 9px 0;
font-size: 13px;
&::-webkit-scrollbar {
display: none;
}
// padding: 5px 0;
li {
display: inline-block;
......@@ -102,6 +109,9 @@ export default {
border-radius: 30px;
&:first-child {
margin-left: 15px;
}
&:last-child {
margin-right: 15px;
}
&.active {
color: #449284;
......
此差异已折叠。
此差异已折叠。
# LAYOUTS
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your Application Layouts.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).
# MIDDLEWARE
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your application middleware.
Middleware let you define custom functions that can be run before rendering either a page or a group of pages.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware).
......@@ -19,8 +19,7 @@
"nuxt": "^2.0.0",
"v-charts": "^1.19.0",
"vant": "^2.2.13",
"web-buried-point": "^2.1.0",
"vconsole": "^3.3.4"
"web-buried-point": "^2.1.0"
},
"devDependencies": {
"@nuxtjs/axios": "^5.5.4",
......
此差异已折叠。
......@@ -9,46 +9,9 @@ export const getHospital = async (params) => {
};
/**
* 获取省列表
* 通用获取区域或机构列表
*/
export const getProvinceList = async params => {
return request({
// baseURL: 'http://10.177.11.156:10443/',
method: 'get',
params: params,
withCredentials: true,
url: 'stats/region'
});
};
/**
* 获取市列表
*/
export const getCityList = async params => {
return request({
method: 'get',
params: params,
withCredentials: true,
url: 'stats/region'
});
};
/**
* 获取县/区列表
*/
export const getCountyList = async params => {
return request({
method: 'get',
params: params,
withCredentials: true,
url: 'stats/region'
});
};
/**
* 获取乡镇列表
*/
export const getTownList = async params => {
export const getAreaOrOrgList = async params => {
return request({
method: 'get',
params: params,
......
......@@ -8,7 +8,8 @@ export const state = () => ({
orgList: [],
examTimesList: [],
examScoreList: [],
areaDegree: 0
areaDegree: 0,
currentOrgList: []
})
export const getters = {
projectId(state) {
......@@ -41,6 +42,9 @@ export const getters = {
areaDegree(state) {
return state.areaDegree;
},
currentOrgList(state) {
return state.currentOrgList;
}
}
export const mutations = {
SET_PROJECT_ID(state, projectId) {
......@@ -72,6 +76,9 @@ export const mutations = {
},
SET_AREA_DEGREE(state, areaDegree) {
state.areaDegree = areaDegree;
},
SET_CURRENT_ORG_LIST(state, currentOrgList) {
state.currentOrgList = currentOrgList;
},
}
export const actions = {
......@@ -105,4 +112,7 @@ export const actions = {
setAreaDegree({ commit }, areaDegree) {
commit('SET_AREA_DEGREE', areaDegree);
},
setCurrentOrgList({ commit }, currentOrgList) {
commit('SET_CURRENT_ORG_LIST', currentOrgList);
},
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册