提交 2422b3a6 编写于 作者: 杨广俊's avatar 杨广俊

代码整理

上级 d7fbc2da
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<meta name="x5-fullscreen" content="true"> <meta name="x5-fullscreen" content="true">
<title>云鹊·医</title> <title>云鹊·医</title>
</head> </head>
<body> <body id="appBody">
<div id="app"> <div id="app">
<router-view></router-view> <router-view></router-view>
</div> </div>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</template> </template>
<script> <script>
// import svgIcon from './componentsn/common/svg'; // import svgIcon from './components/common/svg';
export default { export default {
components:{ components:{
// svgIcon // svgIcon
......
...@@ -93,6 +93,9 @@ export default { ...@@ -93,6 +93,9 @@ export default {
this[orderType] = !this[orderType] this[orderType] = !this[orderType]
this.$emit('order', orderName, this[orderType]) this.$emit('order', orderName, this[orderType])
}, },
reset() {
this.showOrderIndex = 1
}
// resetShowOrderIndex(){ // resetShowOrderIndex(){
// this.showOrderIndex = 1 // this.showOrderIndex = 1
// } // }
......
...@@ -3,33 +3,33 @@ ...@@ -3,33 +3,33 @@
v-model="isShowSelection" v-model="isShowSelection"
position="top" position="top"
> >
<!-- <section v-show="isShowSelection" style="position:fixed;top:0;z-index:201;background:#fff;height:100%;overflow-x:auto;"> -->
<article class="lect-selection"> <article class="lect-selection">
<div class="lect-selection-content-mask"></div>
<section class="lect-selection-title"> <section class="lect-selection-title">
<img @click="closeSelectedPage" src="../../images/lecturer/select-delete.png"/> <img @click="closeSelectedPage" src="../../images/lecturer/select-delete.png"/>
<span>{{selectedTitle}}</span> <span>{{selectedTitle}}</span>
<span class="no-content"></span> <span class="no-content"></span>
</section> </section>
</article>
<article class="group-title"> <article class="group-title">
<section class="group-title-order"> <section class="group-title-order">
<div @click="selectedType(1)" class="group-title-order-item"> <div @click="selectedType(1)" class="group-title-order-item">
<span :class="{'active': selectedTypeIndex === 1}">全国</span> <span :class="{'active': selectedTypeIndex === 1}">{{selectedTitleTitle}}</span>
<img v-show="selectedTypeIndex === 1" src="../../images/lecturer/select-up.png"/> <img v-show="selectedTypeIndex === 1" src="../../images/lecturer/select-up.png"/>
<img v-show="selectedTypeIndex !== 1" src="../../images/lecturer/select-down.png"/> <img v-show="selectedTypeIndex !== 1" src="../../images/lecturer/select-down.png"/>
</div> </div>
<div @click="selectedType(2)" class="group-title-order-item"> <div @click="selectedType(2)" class="group-title-order-item">
<span :class="{'active': selectedTypeIndex === 2}">全部等级</span> <span :class="{'active': selectedTypeIndex === 2}">{{selectedLevelName}}</span>
<img v-show="selectedTypeIndex === 2" src="../../images/lecturer/select-up.png"/> <img v-show="selectedTypeIndex === 2" src="../../images/lecturer/select-up.png"/>
<img v-show="selectedTypeIndex !== 2" src="../../images/lecturer/select-down.png"/> <img v-show="selectedTypeIndex !== 2" src="../../images/lecturer/select-down.png"/>
</div> </div>
<div @click="selectedType(3)" class="group-title-order-item"> <div @click="selectedType(3)" class="group-title-order-item">
<span :class="{'active': selectedTypeIndex === 3}">全部科室</span> <span :class="{'active': selectedTypeIndex === 3}">{{selectedDepartName}}</span>
<img v-show="selectedTypeIndex === 3" src="../../images/lecturer/select-up.png"/> <img v-show="selectedTypeIndex === 3" src="../../images/lecturer/select-up.png"/>
<img v-show="selectedTypeIndex !== 3" src="../../images/lecturer/select-down.png"/> <img v-show="selectedTypeIndex !== 3" src="../../images/lecturer/select-down.png"/>
</div> </div>
</section> </section>
</article> </article>
</article>
<section class="lect-selection-content"> <section class="lect-selection-content">
<article class="lect-selection-content-region" v-show="selectedTypeIndex === 1"> <article class="lect-selection-content-region" v-show="selectedTypeIndex === 1">
<table class="lect-selection-content-rp-tb"> <table class="lect-selection-content-rp-tb">
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
</table> </table>
</article> </article>
</section> </section>
<!-- </section> -->
</mt-popup> </mt-popup>
</template> </template>
...@@ -106,15 +106,20 @@ export default { ...@@ -106,15 +106,20 @@ export default {
selectedAreaSubIndex: 0, selectedAreaSubIndex: 0,
selectedLevelIndex: 0, selectedLevelIndex: 0,
selectedDepartIndex: 0, selectedDepartIndex: 0,
selectedTitleTitle: '全国',
selectedAreaName: '全国', selectedAreaName: '全国',
selectedAreaSubName: '', selectedAreaSubName: '',
selectedLevelName: '全部等级', selectedLevelName: '全部等级',
selectedDepartName: '全部科室', selectedDepartName: '全部科室',
cityId: 0,
provinceId: 0, provinceId: 0,
cityId: 0,
countyId: 0, countyId: 0,
levelGrade : 0, levelGrade : 0,
departmentId: 0 departmentId: 0,
oldProinveId: -1,
oldCityId: -1,
oldCountyId: -1,
oldSelectedAreaSubIndex: -1,
} }
}, },
props: { props: {
...@@ -148,7 +153,6 @@ export default { ...@@ -148,7 +153,6 @@ export default {
}, },
mounted(){ mounted(){
}, },
beforeDestroyed(){ beforeDestroyed(){
...@@ -202,6 +206,7 @@ export default { ...@@ -202,6 +206,7 @@ export default {
if (selTitle === '全部'){ if (selTitle === '全部'){
selTitle = this.selectedAreaName selTitle = this.selectedAreaName
} }
this.selectedTitleTitle = selTitle
this.$emit('selectedData', this.$emit('selectedData',
res.data && res.data.list || [], res.data && res.data.list || [],
selTitle, selTitle,
...@@ -224,28 +229,39 @@ export default { ...@@ -224,28 +229,39 @@ export default {
}) })
}, },
// 寻找数据最大值,用于定义表格高度
getMaxRowNum(orginAreaList) {
console.log(orginAreaList)
let maxRowNum = orginAreaList.length || 31
orginAreaList.forEach((element, index) => {
// if (element.length > maxRowNum){
maxRowNum = element.cities.length > maxRowNum ? element.cities.length : maxRowNum
// }
})
return maxRowNum
},
// 处理区域数据 // 处理区域数据
handleAreaData (orginAreaList) { handleAreaData (orginAreaList) {
let handleList = [] let handleList = [], maxRowNum = this.getMaxRowNum(orginAreaList);
console.log(maxRowNum)
orginAreaList.forEach((element, index) => { orginAreaList.forEach((element, index) => {
// debugger
if( index === 0 ){ if( index === 0 ){
handleList.push({id: element.id, name: element.name, handleList.push({id: element.id, name: element.name,
cities: this.decorateCitiesData({id: 0, name: '全部', provinceId: element.id}, element.cities, 42, false)}) cities: this.decorateCitiesData({}, element.cities, maxRowNum + 1, false)})
} else { } else {
handleList.push({id: element.id, name: element.name, handleList.push({id: element.id, name: element.name,
cities: this.decorateCitiesData({id: 0, name: '全部', provinceId: element.id}, element.cities, 41)}) cities: this.decorateCitiesData({id: 0, name: '全部', provinceId: element.id}, element.cities, maxRowNum)})
} }
}); });
handleList.unshift({id:'0',name:'全国',cities: this.decorateCitiesData({id: 0, name: '全国', provinceId: 0}, [], 41)}) handleList.unshift({id:'0',name:'全国',cities: this.decorateCitiesData({id: 0, name: '全国', provinceId: 0}, [], maxRowNum)})
handleList.push({id:'',name:'',cities: []})
handleList.push({id:'',name:'',cities: []}) for (let i = orginAreaList.length; i < maxRowNum; i++) {
handleList.push({id:'',name:'',cities: []})
handleList.push({id:'',name:'',cities: []})
handleList.push({id:'',name:'',cities: []})
handleList.push({id:'',name:'',cities: []})
handleList.push({id:'',name:'',cities: []})
handleList.push({id:'',name:'',cities: []})
handleList.push({id:'',name:'',cities: []}) handleList.push({id:'',name:'',cities: []})
}
console.log('handleList: ', handleList)
return handleList return handleList
}, },
...@@ -290,9 +306,18 @@ export default { ...@@ -290,9 +306,18 @@ export default {
// 选中省或直辖市 // 选中省或直辖市
selectAreaAction(item, index) { selectAreaAction(item, index) {
if(item.name){ // debugger
if (item.name) {
this.selectedAreaIndex = index this.selectedAreaIndex = index
if (this.oldProinveId = item.provinceId) {
if (item.isMunicipality) {
this.selectedAreaSubIndex = this.oldCountyId
} else {
this.selectedAreaSubIndex = this.oldCityId
}
} else {
this.selectedAreaSubIndex = -1 this.selectedAreaSubIndex = -1
}
this.allAreaSubList = item.cities this.allAreaSubList = item.cities
this.selectedAreaName = item.name this.selectedAreaName = item.name
} }
...@@ -309,10 +334,16 @@ export default { ...@@ -309,10 +334,16 @@ export default {
this.cityId = item.cityId this.cityId = item.cityId
this.countyId = item.id this.countyId = item.id
this.provinceId = item.provinceId this.provinceId = item.provinceId
this.oldProinveId = item.provinceId
this.oldCityId = item.cityId
this.oldCountyId = item.id
} else { } else {
this.cityId = item.id this.cityId = item.id
this.countyId = 0 this.countyId = 0
this.provinceId = item.provinceId this.provinceId = item.provinceId
this.oldProinveId = item.provinceId
this.oldCityId = item.id
this.oldCountyId = 0
} }
this.closeSelectedPage() this.closeSelectedPage()
this.getYqDoctorDataByCD() this.getYqDoctorDataByCD()
...@@ -550,11 +581,11 @@ export default { ...@@ -550,11 +581,11 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../style/mixin'; @import '../../style/mixin';
.lect-selection-content { .lect-selection-content {
position: absolute; // position: absolute;
top: px2rem(122px); // top: px2rem(122px);
z-index: 201; // z-index: 201;
width: px2rem(375px); width: px2rem(375px);
height: 80%; height: 82%;
overflow: auto; overflow: auto;
font-size: px2rem(14px); font-size: px2rem(14px);
color: #666666; color: #666666;
...@@ -637,12 +668,12 @@ export default { ...@@ -637,12 +668,12 @@ export default {
.group-title { .group-title {
position: absolute; // position: absolute;
top: px2rem(80px); // top: px2rem(80px);
z-index: 202; // z-index: 202;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
padding: px2rem(4px) px2rem(25px) px2rem(16px); padding: px2rem(16px) px2rem(25px) px2rem(16px);
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
&-order { &-order {
display: flex; display: flex;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
import { teacher } from '../../utils/buryingPoint'; import { teacher } from '../../utils/buryingPoint';
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import YqyLecturerOrder from '@/componentsn/business/yqy-lecturer-order'; import YqyLecturerOrder from '@/components/business/yqy-lecturer-order';
export default { export default {
data() { data() {
return { return {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</template> </template>
<script> <script>
// import BackHeader from '../../components/teachers/back-header'; // import BackHeader from '../../components/teachers/back-header';
import BackHeader from '../../componentsn/teacher/back-header'; import BackHeader from '../../components/teacher/back-header';
export default { export default {
data () { data () {
return { return {
......
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
<script> <script>
// import { setEventByModuleCode } from '@/utils/index' // import { setEventByModuleCode } from '@/utils/index'
// import TopNav from '../../components/common/topNav'; // import TopNav from '../../components/common/topNav';
import TopNav from '../../componentsn/teacher/topNav'; import TopNav from '../../components/teacher/topNav';
// import teacherTop from '../../components/teachers/teach-top'; // import teacherTop from '../../components/teachers/teach-top';
// import BackTop from '../../components/common/backTop'; // import BackTop from '../../components/common/backTop';
import BackTop from '../../componentsn/teacher/backTop'; import BackTop from '../../components/teacher/backTop';
import {activity_action} from '../../utils/buryingPoint'; import {activity_action} from '../../utils/buryingPoint';
import { deepCopy } from '../../utils'; import { deepCopy } from '../../utils';
export default { export default {
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<script> <script>
// import teacherTop from '../../components/teachers/teach-top'; // import teacherTop from '../../components/teachers/teach-top';
import teacherTop from '../../componentsn/teacher/teach-top'; import teacherTop from '../../components/teacher/teach-top';
import {teacher,teacher_info_collect} from '../../utils/buryingPoint'; import {teacher,teacher_info_collect} from '../../utils/buryingPoint';
export default { export default {
components:{ components:{
......
此差异已折叠。
<template> <template>
<div class="main-body" ref="wrapper"> <div class="main-body" :class="{'modal-open': showSelectedPage}" ref="wrapper">
<section class="home-header"> <section class="home-header">
<div class="home-topMenu"> <div class="home-topMenu">
<YqyHomeHeader :searchFix="searchFix"/> <YqyHomeHeader :searchFix="searchFix"/>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/> />
<!-- 讲师排序 --> <!-- 讲师排序 -->
<YqyLecturerOrder groupTitle="全部讲师" @order="orderAction"/> <YqyLecturerOrder ref="lecturerOrderRef" groupTitle="全部讲师" @order="orderAction"/>
<!-- 讲师列表 --> <!-- 讲师列表 -->
<YqyTeacherList :parmData="parmDataDoctList"/> <YqyTeacherList :parmData="parmDataDoctList"/>
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
<!-- 讲师选择组件 - 弹框 --> <!-- 讲师选择组件 - 弹框 -->
<YqyLecturerSelectContent <YqyLecturerSelectContent
ref="lecturerSelContRef" ref="lecturerSelContRef"
:isShowSelectionB="showSelectedPage"
@selectedData="selectedLecturerList" @selectedData="selectedLecturerList"
/> />
...@@ -49,18 +48,18 @@ ...@@ -49,18 +48,18 @@
<script> <script>
import { Swipe, SwipeItem} from 'mint-ui'; import { Swipe, SwipeItem} from 'mint-ui';
import {mapState, mapMutations, mapActions} from 'vuex' import {mapState, mapMutations, mapActions} from 'vuex'
import BackTop from '@/componentsn/business/backTop'; import BackTop from '@/components/business/backTop';
import YqyHomeHeader from '@/componentsn/business/yqy-home-header'; import YqyHomeHeader from '@/components/business/yqy-home-header';
import YqyLecturerTitle from '@/componentsn/business/yqy-lecturer-title'; import YqyLecturerTitle from '@/components/business/yqy-lecturer-title';
import YqyLecturerSelect from '@/componentsn/business/yqy-lecturer-select'; import YqyLecturerSelect from '@/components/business/yqy-lecturer-select';
import YqyLecturerOrder from '@/componentsn/business/yqy-lecturer-order'; import YqyLecturerOrder from '@/components/business/yqy-lecturer-order';
import YqyLecturerSelectContent from '@/componentsn/business/yqy-lecturer-select-content'; import YqyLecturerSelectContent from '@/components/business/yqy-lecturer-select-content';
import YqyHotLecturer from '@/componentsn/business/yqy-hot-lecturer'; import YqyHotLecturer from '@/components/business/yqy-hot-lecturer';
import YqyTeacherList from '@/componentsn/business/yqy-teacher-list' import YqyTeacherList from '@/components/business/yqy-teacher-list'
export default { export default {
data(){ data(){
return { return {
showSelectedPage: false, showSelectedPage: true,
parmDataDoctList: [], parmDataDoctList: [],
selectedTypeIndex: 1, selectedTypeIndex: 1,
prevent: true, prevent: true,
...@@ -142,7 +141,9 @@ export default { ...@@ -142,7 +141,9 @@ export default {
}, },
beforeMount() { beforeMount() {
let appBody = document.getElementById('appBody')
appBody.style.overflow = 'hidden'
appBody.style.height = '100%'
}, },
mounted(){ mounted(){
window.addEventListener('scroll', this.scrollFun); window.addEventListener('scroll', this.scrollFun);
...@@ -159,6 +160,7 @@ export default { ...@@ -159,6 +160,7 @@ export default {
orderAction(orderName, isSortUp) { orderAction(orderName, isSortUp) {
let orderType = isSortUp ? -1 : 1 let orderType = isSortUp ? -1 : 1
let orderData = this.parmDataDoctList.slice() let orderData = this.parmDataDoctList.slice()
// let orderData = parmDataDoctList
orderData.sort((a, b)=> { orderData.sort((a, b)=> {
if (orderName === 'doctorFirstNameChar') { if (orderName === 'doctorFirstNameChar') {
return (a[orderName].charCodeAt(0) - b[orderName].charCodeAt(0)) * orderType return (a[orderName].charCodeAt(0) - b[orderName].charCodeAt(0)) * orderType
...@@ -178,6 +180,8 @@ export default { ...@@ -178,6 +180,8 @@ export default {
// 选择器组件回调 // 选择器组件回调
selectedLecturerList(paramList, selectedTitle, selectedLevelName, selectedDepartName) { selectedLecturerList(paramList, selectedTitle, selectedLevelName, selectedDepartName) {
this.parmDataDoctList = paramList this.parmDataDoctList = paramList
this.orderAction('doctorFirstNameChar', true)
this.$refs.lecturerOrderRef.reset()
this.selectedTitleTitle = selectedTitle this.selectedTitleTitle = selectedTitle
this.selectedLevelName = selectedLevelName this.selectedLevelName = selectedLevelName
this.selectedDepartName = selectedDepartName this.selectedDepartName = selectedDepartName
...@@ -496,6 +500,12 @@ export default { ...@@ -496,6 +500,12 @@ export default {
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../style/mixin.scss'; @import '../../style/mixin.scss';
.modal-open {
&, body {
overflow: hidden;
height: 100%;
}
}
.lect-selection-content { .lect-selection-content {
position: absolute; position: absolute;
top: px2rem(122px); top: px2rem(122px);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册