提交调整优化

This commit is contained in:
daihh
2023-01-12 12:36:59 +08:00
parent 50079559e2
commit 90068fb851
7 changed files with 154 additions and 211 deletions

View File

@@ -18,6 +18,11 @@ const hrbpAuditList = function(query) {
return ajax.post('/xboe/m/course/manage/audit-pagelist', query);
}
/**HRBP已审核的列表*/
const hrbpHasAuditList = function(query) {
return ajax.post('/xboe/m/course/manage/audit-pagelist', query);
}
/**
* hrbp审核提交
* @param {Object} data

View File

@@ -51,7 +51,7 @@ export const constantRoutes = [{
hidden: true,
component: (resolve) => require(['@/views/portal/course/Index'], resolve),
name: 'course',
meta: { title: '课程', icon: 'dashboard', noCache: true, affix: false },
meta: { title: '课程',keepAlive:true, icon: 'dashboard', noCache: true, affix: false },
},
{
path: '/course/micro',
@@ -65,7 +65,7 @@ export const constantRoutes = [{
hidden: true,
component: (resolve) => require(['@/views/portal/course/Detail'], resolve),
name: 'courseDetail',
meta: { title: '课程详情', icon: 'dashboard', noCache: true, affix: false },
meta: { title: '课程详情',keepAlive:true, icon: 'dashboard', noCache: true, affix: false },
},
// 课程预览
{
@@ -105,21 +105,21 @@ export const constantRoutes = [{
hidden: true,
component: (resolve) => require(['@/views/study/coursenew'], resolve),
name: 'courseStudyIndex',
meta: { title: '课程学习', icon: 'dashboard', noCache: true, affix: false },
meta: { title: '课程学习',keepAlive:true, icon: 'dashboard', noCache: true, affix: false },
},
{
path: '/case',
hidden: true,
component: (resolve) => require(['@/views/portal/case/Index'], resolve),
name: 'case',
meta: { title: '案例', icon: 'dashboard', noCache: true, affix: false },
meta: { title: '案例',keepAlive:true, icon: 'dashboard', noCache: false, affix: true },
},
{
path: '/case/detail',
hidden: true,
component: (resolve) => require(['@/views/portal/case/Detail'], resolve),
name: 'caseDetail',
meta: { title: '案例详情', icon: 'dashboard', noCache: true, affix: false },
meta: { title: '案例详情',keepAlive:true, icon: 'dashboard', noCache: false, affix: true },
},
{
path: '/article',

View File

@@ -36,6 +36,8 @@ router.beforeEach((to, from, next) => {
} else {
//后续这里需要增加一定的控制
if (!store.getters.init) {
sessionStorage.removeItem(xpage.constants.localCaseFiltersKey);
sessionStorage.removeItem(xpage.constants.localCourseFiltersKey);
// 判断当前控制台是否已拉取完数据
store.dispatch('InitData').then(res => {
//加载白名单信息
@@ -60,6 +62,7 @@ router.beforeEach((to, from, next) => {
//NProgress.done();
})
} else {
to.meta.keepAlive = true
next();
}

View File

@@ -1,7 +1,9 @@
/**页面设置的一些常量,方便,用于一个处理只写一处,不要多处写*/
const constants={
fileBaseUrl:'/upload',
newLoginKey:'boe_new_login'
newLoginKey:'boe_new_login',
localCaseFiltersKey:'local_case_ids', //本地临时查询条件的缓存
localCourseFiltersKey:'local_course_ids',//本地临时查询条件的缓存
}
/**返回个人主页的id参数*/

View File

@@ -214,7 +214,7 @@ export default {
},
async searchData() {
this.params.status = 9;
this.params.aid=this.userInfo.aid;
this.params.auditAid=this.userInfo.aid;
this.params.userType=2;//这里指hrbp管理查询
this.params.pageIndex = this.page.pageIndex;
this.params.pageSize = this.page.pageSize;

View File

@@ -235,6 +235,10 @@ export default {
);
},
beforeRouteLeave(to, from, next){
to.meta.keepAlive=true;
next();
},
beforeDestroy(){
window.removeEventListener("scroll",this.handleScroll);
clearInterval(this.setTimeCase);

View File

@@ -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=[];