mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 04:46:44 +08:00
增加一个显示名称机构名称的访求 cutOrgNamePath
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-row class="article-add">
|
<el-row class="article-add">
|
||||||
<el-form ref="form" :rules="rules" :model="addForm" label-position="right" label-width="80px">
|
<el-form ref="askForm" :rules="askFormRules" :model="askForm" label-position="right" label-width="80px">
|
||||||
<el-dialog :close-on-click-modal='false' title="提问题" label-width="80px" :visible.sync="askQuestionDialog">
|
<el-dialog :close-on-click-modal='false' title="提问题" label-width="80px" :visible.sync="askQuestionDialog">
|
||||||
<!-- <el-form ref="askForm" :model="askForm" :rules="askFormRules" label-position="right" > -->
|
<!-- <el-form ref="askForm" :model="askForm" :rules="askFormRules" label-position="right" > -->
|
||||||
<el-form-item label="标题:" prop="title">
|
<el-form-item label="标题:" prop="title">
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<el-form-item label="内容:" prop="content">
|
<el-form-item label="内容:" prop="content">
|
||||||
<el-input type="textarea" v-model="askForm.content" placeholder="请输入问题内容" :rows="8"></el-input>
|
<el-input type="textarea" v-model="askForm.content" placeholder="请输入问题内容" :rows="8"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- </el-form> -->
|
<!-- </el-form> -->
|
||||||
<el-form-item >
|
<el-form-item >
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
@@ -41,9 +41,9 @@
|
|||||||
<el-button type="primary" @click="addQaData" :disabled="!askForm.checked">发布问题</el-button>
|
<el-button type="primary" @click="addQaData" :disabled="!askForm.checked">发布问题</el-button>
|
||||||
<el-button @click="askQuestionDialog = false">取 消</el-button>
|
<el-button @click="askQuestionDialog = false">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-dialog class="checked-show" :visible.sync="askFormCheckedShow" top="14vh" width="800px" :show-close="false" :modal="false">
|
<el-dialog class="checked-show" :visible.sync="askFormCheckedShow" top="14vh" width="800px" :show-close="false" :modal="false">
|
||||||
<agreement></agreement>
|
<agreement></agreement>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
.el-form-item__content{
|
.el-form-item__content{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
|
||||||
dl {
|
dl {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
|||||||
@@ -18,8 +18,31 @@ export const cutFullName = (fullName,num) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return newName;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**截取机构名称路径namePath最后两段,不包含第一个 */
|
||||||
|
export const cutOrgNamePath = (namePath) => {
|
||||||
|
let newName=namePath;
|
||||||
|
if(newName){
|
||||||
|
let names=newName.split('/');
|
||||||
|
let len=names.length;
|
||||||
|
//使用最后两们
|
||||||
|
if(len>3){
|
||||||
|
newName=names[len-2]+'/'+names[len-1];
|
||||||
|
}else if(len==2){
|
||||||
|
//去掉第一位,只是取第二位
|
||||||
|
newName=names[1];
|
||||||
|
}
|
||||||
|
// if(names.length>1){
|
||||||
|
// newName=names[1];
|
||||||
|
// if(num==2){
|
||||||
|
// if(names.length>2){
|
||||||
|
// newName+="/"+names[2];
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
return newName;
|
return newName;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<span class="grade">{{userData.level}}</span>
|
<span class="grade">{{userData.level}}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="personal-info">{{userInfo.departName}}</p>
|
<p class="personal-info">{{cutOrgNamePath(userInfo.departFullName)}}</p>
|
||||||
<a href="uc/study/task">
|
<a href="uc/study/task">
|
||||||
<div class="personal-box">
|
<div class="personal-box">
|
||||||
<span>代办</span>
|
<span>代办</span>
|
||||||
@@ -195,13 +195,11 @@
|
|||||||
<div class="case-inter">
|
<div class="case-inter">
|
||||||
<div class="case-inter-box">
|
<div class="case-inter-box">
|
||||||
<div class="case-inter-left">
|
<div class="case-inter-left">
|
||||||
<authorInfo :avatar="ca.authorInfo.avatar" :info="ca.authorInfo.orgInfo" :name="ca.authorInfo.name"
|
<authorInfo :avatar="ca.authorInfo.avatar" :info="ca.authorInfo.orgInfo" :name="ca.authorInfo.name" :sex="ca.authorInfo.sex" :aid="userInfo.aid"></authorInfo>
|
||||||
:sex="ca.authorInfo.sex" :aid="userInfo.aid"></authorInfo>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="interact-bar-index"
|
<div class="interact-bar-index"
|
||||||
style="font-size: 12px;color: #6E7B84;display: flex;line-height: 30px;">
|
style="font-size: 12px;color: #6E7B84;display: flex;line-height: 30px;">
|
||||||
<interactBar :type="3" :readonly="true" :comments="false" :praises="false" :favorites="false"
|
<interactBar :type="3" :readonly="true" :comments="false" :praises="false" :favorites="false" :data="ca" :shares="false" :views="true"></interactBar>人观看
|
||||||
:data="ca" :shares="false" :views="true"></interactBar>人观看
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -417,7 +415,8 @@
|
|||||||
import {
|
import {
|
||||||
toScore,
|
toScore,
|
||||||
cutFullName,
|
cutFullName,
|
||||||
formatUserNumber
|
formatUserNumber,
|
||||||
|
cutOrgNamePath
|
||||||
} from '@/utils/tools.js';
|
} from '@/utils/tools.js';
|
||||||
import {
|
import {
|
||||||
swiper,
|
swiper,
|
||||||
@@ -456,6 +455,7 @@
|
|||||||
totalStudyHour:0
|
totalStudyHour:0
|
||||||
},
|
},
|
||||||
formatNum:formatUserNumber,
|
formatNum:formatUserNumber,
|
||||||
|
cutOrgNamePath:cutOrgNamePath,
|
||||||
//userInfo: {},
|
//userInfo: {},
|
||||||
ankingList: [],
|
ankingList: [],
|
||||||
answersList: [],
|
answersList: [],
|
||||||
@@ -516,7 +516,7 @@
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
//this.userInfo = this.$store.getters.userInfo;
|
//this.userInfo = this.$store.getters.userInfo;
|
||||||
// console.log(this.this.userInfo)
|
//console.log(this.userInfo,'userInfo');
|
||||||
this.getCourseData(1);
|
this.getCourseData(1);
|
||||||
this.getCaseData();
|
this.getCaseData();
|
||||||
this.getArticleData();
|
this.getArticleData();
|
||||||
@@ -527,6 +527,7 @@
|
|||||||
this.getAnkingData();
|
this.getAnkingData();
|
||||||
this.getLevel();
|
this.getLevel();
|
||||||
this.getQaAnswers();
|
this.getQaAnswers();
|
||||||
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['userInfo','studyTaskCount']),
|
...mapGetters(['userInfo','studyTaskCount']),
|
||||||
@@ -586,7 +587,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.scorelist = res.result;
|
this.scorelist = res.result;
|
||||||
console.log(this.scorelist,'this.scorelist');
|
//console.log(this.scorelist,'this.scorelist');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -665,6 +666,8 @@
|
|||||||
this.pageIndex = 0;
|
this.pageIndex = 0;
|
||||||
}
|
}
|
||||||
this.isNext = true;
|
this.isNext = true;
|
||||||
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
console.log('加载课程信息失败:' + res.error);
|
console.log('加载课程信息失败:' + res.error);
|
||||||
@@ -1241,7 +1244,7 @@
|
|||||||
.swiper-container{
|
.swiper-container{
|
||||||
// background-color: rgba($color: #000000, $alpha: 0.2);
|
// background-color: rgba($color: #000000, $alpha: 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user