mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 10:56:44 +08:00
提交调整优化
This commit is contained in:
@@ -47,9 +47,9 @@
|
||||
<div class="field">
|
||||
<div style="padding:0;" :class="fielclassjor ? 'fieldactive' :'' " @click="majorall()">全部</div>
|
||||
<div class="fieldbox">
|
||||
<div :class="item.fielclass ? 'fieldactive' :'' " @click="fieldmajor(item)" v-for="(item,idx) in speciData" :key="'d'+idx">{{item.name}}</div>
|
||||
<div :class="item.fielclass ? 'fieldactive' :'' " @click="fieldmajor(item)" v-for="(item,idx) in speciData" :key="'d'+idx">{{item.name}}({{item.explanation}})</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- <el-radio-group style="display:flex;" v-model="queryCondition.majorType" size="mini" @change="search()">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
@@ -243,41 +243,6 @@ export default {
|
||||
timeShow,
|
||||
author
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["userInfo", "portalCase"]),
|
||||
word: function() {
|
||||
if (this.showAll == false) {
|
||||
//对文字进行处理
|
||||
return "展开";
|
||||
} else {
|
||||
return "收起";
|
||||
}
|
||||
},
|
||||
isMore() {
|
||||
let isOk = true;
|
||||
if (this.caseList.list.length === this.caseList.count) {
|
||||
isOk = false;
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
tagList(){ //列表属性,用于计算
|
||||
let list=[];
|
||||
if(this.keyWord){
|
||||
list.push({ type:'0', code:'keyword', name:this.keyWord, checked:true})
|
||||
}
|
||||
this.domain.forEach(item=>{
|
||||
if(item.fielclass){
|
||||
list.push(item);
|
||||
}
|
||||
});
|
||||
this.speciData.forEach(item=>{
|
||||
if(item.fielclass){
|
||||
list.push(item);
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||
@@ -298,8 +263,6 @@ export default {
|
||||
ankingList: [],//排行数据1
|
||||
Popularity: [],//排行数据2
|
||||
Positive: [],//排行数据3
|
||||
//Profess: [],
|
||||
//optionsList: [],
|
||||
protocolDialogVisible: false,
|
||||
protocolConfirmButton: true,
|
||||
queryCondition: {
|
||||
@@ -321,27 +284,78 @@ export default {
|
||||
type2: 0,
|
||||
type3: 0,
|
||||
isFind: false,
|
||||
//searchTags: [],
|
||||
//orgData: [],
|
||||
fielclass:true,
|
||||
fielclassjor:true,
|
||||
// orgDomainData:'',
|
||||
// orgsto:[],
|
||||
// majorTypeData:'',
|
||||
// majsto:[],
|
||||
// Domarr:[],
|
||||
// majarr:[],
|
||||
// domData:[],
|
||||
// majData:[],
|
||||
localSessionKey:this.$xpage.constants.localCaseFiltersKey
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapGetters(["userInfo", "portalCase"]),
|
||||
word: function() {
|
||||
if (this.showAll == false) {
|
||||
//对文字进行处理
|
||||
return "展开";
|
||||
} else {
|
||||
return "收起";
|
||||
}
|
||||
},
|
||||
isMore() {
|
||||
let isOk = true;
|
||||
if (this.caseList.list.length === this.caseList.count) {
|
||||
isOk = false;
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
tagList(){ //列表属性,用于计算
|
||||
let list=[];
|
||||
if(this.keyWord){
|
||||
list.push({type:'0', code:'keyword', name:this.keyWord, checked:true})
|
||||
}
|
||||
this.domain.forEach(item=>{
|
||||
if(item.fielclass){
|
||||
list.push(item);
|
||||
}
|
||||
});
|
||||
this.speciData.forEach(item=>{
|
||||
if(item.fielclass){
|
||||
list.push(item);
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// if(this.searchTags.length == 0){
|
||||
// this.queryCondition.majorType = null;
|
||||
// this.queryCondition.orgDomain = null;
|
||||
// };
|
||||
this.specialized();
|
||||
let $this=this;
|
||||
// if(this.speciData.length==0){
|
||||
// this.specialized();
|
||||
// }
|
||||
// if(this.domain.length==0){
|
||||
// this.getdomain();
|
||||
// }
|
||||
|
||||
Promise.all([apiDict.items("org_domain"),apiCase.majorTypes()]).then(rs=>{
|
||||
if(rs[0].status==200){
|
||||
rs[0].result.forEach(item =>{
|
||||
item.fielclass = false;
|
||||
item.type='org_domain';
|
||||
})
|
||||
this.domain = rs[0].result;
|
||||
}
|
||||
if(rs[1].status==200){
|
||||
rs[1].result.forEach(item =>{
|
||||
item.fielclass = false;
|
||||
item.type='major_type';
|
||||
})
|
||||
this.speciData = rs[1].result;
|
||||
}
|
||||
this.loadLocalFilters();
|
||||
this.$nextTick(function() {
|
||||
$this.initHeight = document.getElementById("searchBox").offsetHeight;
|
||||
$this.closeSearch();
|
||||
});
|
||||
this.search();
|
||||
});
|
||||
|
||||
if (!this.portalCase.readProtocol) {
|
||||
this.protocolDialogVisible = true;
|
||||
}
|
||||
@@ -353,47 +367,61 @@ export default {
|
||||
this.getPopularity();
|
||||
this.searchterm();
|
||||
this.getPositive();
|
||||
//this.getProfess();
|
||||
this.getdomain();
|
||||
// this.getCaseData();
|
||||
this.search();
|
||||
this.couresreso();
|
||||
window.addEventListener("scroll", this.handleScroll);
|
||||
|
||||
},
|
||||
|
||||
watch: {
|
||||
// queryCondition:{
|
||||
// handler(newValue,oldValue){
|
||||
// this.getCaseData()
|
||||
// },
|
||||
// deep:true,
|
||||
// immediate:true
|
||||
// }
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener("scroll", this.handleScroll);
|
||||
},
|
||||
methods: {
|
||||
saveLocalFilters(){
|
||||
let typeCodeList=[];
|
||||
this.tagList.forEach(item=>{
|
||||
typeCodeList.push({
|
||||
type:item.type,
|
||||
code:item.code,
|
||||
name:item.name
|
||||
})
|
||||
});
|
||||
let typeCodeString=JSON.stringify(typeCodeList);
|
||||
sessionStorage.setItem(this.localSessionKey,typeCodeString);
|
||||
},
|
||||
loadLocalFilters(t){
|
||||
let hasData=sessionStorage.getItem(this.localSessionKey);
|
||||
if(hasData){
|
||||
let typeCodeList=JSON.parse(hasData);
|
||||
typeCodeList.forEach(item=>{
|
||||
if(item.type=='0'){
|
||||
this.keyWord=item.name;
|
||||
}else if(item.type=='major_type'){
|
||||
this.speciData.some(m=>{
|
||||
if(m.code==item.code){
|
||||
m.fielclass=true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
|
||||
}else if(item.type=='org_domain'){
|
||||
this.domain.some(m=>{
|
||||
if(m.code==item.code){
|
||||
m.fielclass=true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
majorall(){
|
||||
this.queryCondition.majorType = '';
|
||||
this.fielclassjor=true;
|
||||
this.speciData.forEach(item=>{
|
||||
item.fielclass = false;
|
||||
})
|
||||
// if(this.fielclassjor){
|
||||
// let narr = this.fieldData;
|
||||
// this.fieldData = narr.filter(item => {
|
||||
// if(item.type == 'major_type') {
|
||||
// console.log(item);
|
||||
// item.fielclass = false;
|
||||
// return false;
|
||||
// }else{
|
||||
// return true;
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
//this.getCaseData();
|
||||
this.search();
|
||||
},
|
||||
domainall(){
|
||||
@@ -403,116 +431,17 @@ export default {
|
||||
item.fielclass = false;
|
||||
})
|
||||
this.fielclass=true;
|
||||
|
||||
// if(this.fielclass){
|
||||
// var newArr = this.fieldData;
|
||||
// this.fieldData = newArr.filter(item => {
|
||||
// if(item.type == 'org_domain') {
|
||||
// console.log(item);
|
||||
// item.fielclass = false;
|
||||
// return false;
|
||||
// console.log(this.fieldData)
|
||||
// }else{
|
||||
// return true;
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
//this.getCaseData();
|
||||
this.search();
|
||||
},
|
||||
fieldmajor(item){//专业分类
|
||||
this.fielclassjor = false;
|
||||
item.fielclass = !item.fielclass;
|
||||
this.search();
|
||||
// if(item.fielclass){
|
||||
// let has=this.fieldData.some(fd=>{
|
||||
// return fd.code==item.code;
|
||||
// });
|
||||
// if(!has){
|
||||
// this.fieldData.push(item);
|
||||
// }
|
||||
// }else{
|
||||
// let delIdx=-1;
|
||||
// this.fieldData.some((fd,fdidx)=>{
|
||||
// if(fd.code==item.code){
|
||||
// delIdx=fdidx;
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// });
|
||||
// if(delIdx>-1){
|
||||
// this.fieldData.splice(delIdx,1);
|
||||
// }
|
||||
// }
|
||||
// this.majsto.push(item.code);
|
||||
// this.majorTypeData = this.majsto.toString()//传给后端
|
||||
// this.queryCondition.majorType = this.majorTypeData;
|
||||
//this.getCaseData();
|
||||
|
||||
//this.ceshiorg();
|
||||
},
|
||||
// ceshiorg(){//判断专业
|
||||
// this.majData = [];
|
||||
// this.fieldData.forEach(itx =>{
|
||||
// if(itx.type == 'major_type'){
|
||||
// console.log(typeof itx);
|
||||
// if(itx.fielclass == true){
|
||||
// this.majData.push(itx)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// console.log(this.majData);
|
||||
// let b = JSON.stringify(this.majData);
|
||||
// if(b == '[]'){
|
||||
// this.fielclassjor=true;
|
||||
// }
|
||||
// },
|
||||
// ceshidom(){//判断组织
|
||||
// this.domData = [];
|
||||
// this.fieldData.forEach(itx =>{
|
||||
// if(itx.type == 'org_domain'){
|
||||
// console.log(typeof itx);
|
||||
// if(itx.fielclass == true){
|
||||
// this.domData.push(itx)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// let b = JSON.stringify(this.domData);
|
||||
// if(b == '[]'){
|
||||
// this.fielclass=true;
|
||||
// }
|
||||
// },
|
||||
fieldswich(item){//组织领域
|
||||
this.fielclass=false;
|
||||
item.fielclass = !item.fielclass;
|
||||
|
||||
// if(item.fielclass){
|
||||
// let has=this.fieldData.some(fd=>{
|
||||
// return fd.code==item.code;
|
||||
// });
|
||||
// //console.log(has,'has')
|
||||
// if(!has){
|
||||
// this.fieldData.push(item);
|
||||
// }
|
||||
// }else{
|
||||
// let delIdx=-1;
|
||||
// this.fieldData.some((fd,fdidx)=>{
|
||||
// if(fd.code==item.code){
|
||||
// delIdx=fdidx;
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// });
|
||||
// if(delIdx>-1){
|
||||
// this.fieldData.splice(delIdx,1);
|
||||
// }
|
||||
// }
|
||||
// this.orgsto.push(item.code);
|
||||
// this.orgDomainData = this.orgsto.toString()//传给后端
|
||||
// this.queryCondition.orgDomain = this.orgDomainData;
|
||||
//this.getCaseData();
|
||||
this.search();
|
||||
//this.ceshidom();
|
||||
},
|
||||
|
||||
banJump() {
|
||||
@@ -527,30 +456,28 @@ export default {
|
||||
this.resonimg = lmj[0]
|
||||
})
|
||||
},
|
||||
specialized(){
|
||||
let $this=this;
|
||||
apiCase.majorTypes().then(res =>{
|
||||
if(res.status == 200){
|
||||
if (res.status == 200) {
|
||||
res.result.forEach(item =>{
|
||||
item.fielclass = false;
|
||||
item.type='major_type';
|
||||
})
|
||||
specialized(){
|
||||
let $this=this;
|
||||
apiCase.majorTypes().then(res =>{
|
||||
if(res.status == 200){
|
||||
if (res.status == 200){
|
||||
res.result.forEach(item =>{
|
||||
item.fielclass = false;
|
||||
item.type='major_type';
|
||||
})
|
||||
}
|
||||
this.speciData = res.result;
|
||||
this.loadLocalFilters(1);
|
||||
//this.Profess=res.result;
|
||||
this.$nextTick(function() {
|
||||
$this.initHeight = document.getElementById("searchBox").offsetHeight;
|
||||
$this.closeSearch();
|
||||
});
|
||||
}
|
||||
this.speciData = res.result;
|
||||
//this.Profess=res.result;
|
||||
this.$nextTick(function() {
|
||||
$this.initHeight = document.getElementById("searchBox").offsetHeight;
|
||||
$this.closeSearch();
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
jumcasedet(item) {
|
||||
this.$router.push({path:'/case/detail',query:{id:item.id}});
|
||||
|
||||
this.$router.push({path:'/case/detail',query:{id:item.id}});
|
||||
},
|
||||
debounce(func, wait) {
|
||||
// 非立即执行
|
||||
@@ -614,13 +541,14 @@ export default {
|
||||
},
|
||||
async getdomain() {
|
||||
let key = "org_domain";
|
||||
await apiDict.items(key).then(res => {
|
||||
await apiDict.items("org_domain").then(res => {
|
||||
if (res.status == 200) {
|
||||
res.result.forEach(item =>{
|
||||
item.fielclass = false;
|
||||
item.type=key;
|
||||
})
|
||||
this.domain = res.result;
|
||||
this.loadLocalFilters(2);
|
||||
// if(res.result.length > 0) {
|
||||
// this.orgDomainLevel(res.result)
|
||||
// }
|
||||
@@ -758,6 +686,7 @@ export default {
|
||||
this.getCaseData();
|
||||
},
|
||||
async getCaseData() {
|
||||
this.saveLocalFilters();
|
||||
// this.fieldData
|
||||
//this.queryCondition.pageIndex = 1;
|
||||
let orgDomainList=[];
|
||||
|
||||
Reference in New Issue
Block a user