yujialong 4 years ago
parent f54b1ddcff
commit 4e0d06ed0c
  1. 2
      src/App.vue
  2. 22
      src/api/index.js
  3. BIN
      src/assets/img/login_bg.png
  4. 69
      src/layouts/header/index.vue
  5. 2
      src/pages/account/login/index.vue
  6. 9
      src/pages/quesBank/list/globalQuesBank.vue
  7. 77
      src/pages/quesBank/list/myQuesBank.vue
  8. 2
      src/pages/quesBank/list/quesBankType.vue
  9. 83
      src/pages/quesBank/list/quesDialog.vue
  10. 23
      src/pages/setting/person/index.vue
  11. 2
      src/setting.js
  12. 9
      src/store/modules/user.js
  13. 4
      src/styles/lib/_reset.scss
  14. 1
      src/styles/lib/index.scss
  15. 9
      src/styles/lib/mixin.scss

@ -10,12 +10,10 @@
export default { export default {
name: 'App', name: 'App',
created () { created () {
//sessionStorage
if (util.session.get(Setting.storeKey) ) { if (util.session.get(Setting.storeKey) ) {
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(util.session.get(Setting.storeKey)))) this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(util.session.get(Setting.storeKey))))
} }
//vuexsessionStorage
window.addEventListener("beforeunload",()=>{ window.addEventListener("beforeunload",()=>{
util.session.get(Setting.usernameKey) && util.session.set(Setting.storeKey,JSON.stringify(this.$store.state)) util.session.get(Setting.usernameKey) && util.session.set(Setting.storeKey,JSON.stringify(this.$store.state))
}) })

@ -1,14 +1,25 @@
import Setting from '@/setting'
let uploadURL = Setting.apiUploadURL
export default { export default {
logins: `management/userInfo/login`, //登录  // 登录 
logins: `management/userInfo/login`,
// oss文件管理
fileDeletion: `${uploadURL}/oss/manage/fileDeletion`,
fileupload: `${uploadURL}/oss/manage/fileupload`,
getPlayAuth: `${uploadURL}/oss/manage/getPlayAuth`,
removeMoreVideo: `${uploadURL}/oss/manage/removeMoreVideo`,
removeVideo: `${uploadURL}/oss/manage/removeVideo`,
// 查询省份城市 // 查询省份城市
queryCity: `cjEnterprise/city/queryCity`, queryCity: `cjEnterprise/city/queryCity`,
queryProvince: `cjEnterprise/province/queryProvince`, queryProvince: `cjEnterprise/province/queryProvince`,
// 个人中心 // 个人中心
userinfoUpdate:`management/userInfo/update`,//个人中心信息修改 userinfoUpdate:`management/userInfo/update`,
userinfo:`management/userInfo/getUserInfo`,//个人中心信息展示 userinfo:`management/userInfo/getUserInfo`,
getAccount:`management/userInfo/getAccount`,//账号判重 getAccount:`management/userInfo/getAccount`,
// 组织架构 // 组织架构
addStaffPro: `management/staffProfessionalArchitecture/addStaffProfessionalArchitecture`, addStaffPro: `management/staffProfessionalArchitecture/addStaffProfessionalArchitecture`,
@ -63,9 +74,6 @@ export default {
exportFailureUser: `cjEnterprise/user/exportFailure`, exportFailureUser: `cjEnterprise/user/exportFailure`,
downloadUserTemp: 'http://liuwanr.oss-cn-shenzhen.aliyuncs.com/xlsx/20201102/1604658619702.xlsx', downloadUserTemp: 'http://liuwanr.oss-cn-shenzhen.aliyuncs.com/xlsx/20201102/1604658619702.xlsx',
fileupload: `oss/manage/fileupload`,
fileDeletion: `oss/manage/fileDeletion`, //批量删除文件
// 题库分类 // 题库分类
AddOneLevel:`cjEnterprise/questionBank/AddOneLevel`, AddOneLevel:`cjEnterprise/questionBank/AddOneLevel`,
AddSecondLevel:`cjEnterprise/questionBank/AddSecondLevel`, AddSecondLevel:`cjEnterprise/questionBank/AddSecondLevel`,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 985 KiB

@ -10,48 +10,45 @@
<el-avatar :size="40" :src="avatar"></el-avatar> <el-avatar :size="40" :src="avatar"></el-avatar>
<span class="user-avator">{{userName}}</span> <span class="user-avator">{{userName}}</span>
</div> </div>
<el-divider class="ml20" direction="vertical"></el-divider> <el-divider class="m-l-20" direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="loginout">退出</el-button> <el-button type="text" class="m-l-20" @click="loginout">退出</el-button>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { mapState } from 'vuex'; import { mapState,mapActions } from 'vuex'
import { mapActions } from 'vuex'; import Setting from '@/setting'
import bus from '@/libs/bus';
import Setting from '@/setting';
import util from '@/libs/util';
export default { export default {
data() { data() {
return { return {
collapse: false,
fullscreen: false,
name: 'huoran',
message: 2,
circleUrl: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
showBackList: Setting.layout.hideNavList, showBackList: Setting.layout.hideNavList,
}; };
}, },
computed: { computed: {
...mapState('user', [ ...mapState('user', [
'userName','avatar' 'userId','avatar','userName'
]), ]),
showBack(){ showBack(){
let route = this.$route.name let route = this.$route.name
if(this.showBackList.includes(route)) return true if(this.showBackList.includes(route)) return true
return false return false
} }
},
mounted(){
}, },
methods: { methods: {
...mapActions('user', [
'logout'
]),
toPerson(){ toPerson(){
this.$router.push('/setting/person') this.$router.push('/setting/person')
}, },
loginout() { loginout() {
this.logout() sessionStorage.removeItem(Setting.usernameKey);
sessionStorage.removeItem(Setting.storeKey);
location.reload()
},
back(){
this.$router.back()
} }
}, },
}; };
@ -64,11 +61,11 @@ export default {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
margin-left: 20px; margin-left: 20px;
} i{
.goBack i{
color: #cb221c; color: #cb221c;
font-size: 20px; font-size: 20px;
} }
}
.header { .header {
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
@ -76,51 +73,49 @@ export default {
height: 60px; height: 60px;
font-size: 16px; font-size: 16px;
color: #333; color: #333;
} border-bottom: 1px solid #efefef;
.header .logo { box-shadow: 0 0 1.5625rem 0.125rem rgba(255, 45, 45, 0.14);
.logo {
float: left; float: left;
width: 170px; width: 170px;
height: 40px; height: 40px;
margin-left: 20px; margin-left: 20px;
} img{
.header .logo img{
height: 100%; height: 100%;
} }
}
.header-right { .header-right {
float: right; float: right;
padding-right: 50px; padding-right: 50px;
}
.header-user-con { .header-user-con {
display: flex; display: flex;
height: 70px; height: 70px;
align-items: center; align-items: center;
.user{ .user{
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
} }
.user-avator { .el-button--text{
margin-left: 10px; color: #333;
} }
.ml20{ .el-divider--vertical{
margin-left: 20px; width: 2px;
height: 15px;
}
.el-divider{
background-color: #333;
} }
.user-avator img { .user-avator {
margin-left: 10px;
img {
display: block; display: block;
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 50%; border-radius: 50%;
} }
.header-right .el-button--text{
color: #333;
} }
.header-right .el-divider--vertical{
width: 2px;
height: 15px;
} }
.header-right .el-divider{
background-color: #333;
} }
</style> </style>

@ -109,7 +109,7 @@ export default {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background-color: #333; background-color: rgba(51,51,51,.7);
.inner{ .inner{
display: inline-flex; display: inline-flex;
justify-content: space-between; justify-content: space-between;

@ -143,7 +143,7 @@ export default {
this.getData(); this.getData();
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val
}, },
delData(row) { delData(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
@ -172,11 +172,12 @@ export default {
this.multipleSelection = []; this.multipleSelection = [];
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}); this.$refs.table.clearSelection()
}).catch(res => {})
}) })
.catch(() => {}); .catch(() => {})
}else{ }else{
this.$message.error('请先选择数据!'); this.$message.error('请先选择数据!')
} }
}, },
dialogGetData(){ dialogGetData(){

@ -91,7 +91,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="questionStem" label="题干" align="center"> <el-table-column prop="questionStem" label="题干" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-html="scope.row.questionStem"></div> <div class="ellipsis" v-html="scope.row.questionStem"></div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="试题类型" width="120" align="center"></el-table-column> <el-table-column prop="name" label="试题类型" width="120" align="center"></el-table-column>
@ -181,7 +181,6 @@ export default {
pageGlobal: 1, pageGlobal: 1,
pageSizeGlobal: 10, pageSizeGlobal: 10,
totalGlobal: 0, totalGlobal: 0,
multipleSelectionGlobal: []
}; };
}, },
computed: { computed: {
@ -212,7 +211,11 @@ export default {
userId: this.userId userId: this.userId
}) })
.then(res => { .then(res => {
this.listData = res.data.list.list let list = res.data.list.list
list.map(n => {
n.questionStem = n.questionStem.replace(/<\/?.+?>/gi,'')
})
this.listData = list
this.total = res.data.list.totalCount this.total = res.data.list.totalCount
}) })
.catch(err => {}) .catch(err => {})
@ -299,7 +302,7 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
shareDataBatch() { shareDataBatch() {
if(this.multipleSelection.length != ''){ if(this.multipleSelection.length){
let newArr = this.multipleSelection let newArr = this.multipleSelection
let shareList = newArr.map(item => { let shareList = newArr.map(item => {
return item.id return item.id
@ -317,6 +320,7 @@ export default {
this.multipleSelection = []; this.multipleSelection = [];
this.$message.success('共享成功') this.$message.success('共享成功')
this.getData() this.getData()
this.$refs.table.clearSelection()
}).catch(res => { }).catch(res => {
this.getData() this.getData()
}) })
@ -325,62 +329,6 @@ export default {
}else{ }else{
this.$message.error('请先选择数据') this.$message.error('请先选择数据')
} }
},
cancelShareBatch() {
this.cancelShareVisible = true
this.getGlobalData()
return false
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let shareList = newArr.map(item => {
return item.id
})
this.$confirm('确定要取消共享吗?', '提示', {
type: 'info'
})
.then(() => {
let data = {
userId: this.userId,
qid: shareList
}
this.$post(this.api.saveSharing,data).then(res => {
this.multipleSelection = [];
this.$message.success('取消共享成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
}else{
this.$message.error('请先选择数据!');
}
},
getGlobalData() {
this.$post(this.api.pageByConditionSharing, {
pageNum: this.pageGlobal,
pageSize: this.pageSizeGlobal,
questionStem: '',
createUser: '',
name: ''
})
.then(res => {
this.globalData = res.data.list.list
this.totalGlobal = res.data.list.totalCount
})
.catch(err => {})
},
handleSelectionChange(val) {
this.multipleSelectionGlobal = val;
},
handleGlobalCurrentChange(val) {
this.pageGlobal = val
this.getGlobalData()
},
closeCancelShare(){
},
cancelShareSubmit(){
}, },
delAllData() { delAllData() {
if(this.multipleSelection.length){ if(this.multipleSelection.length){
@ -397,15 +345,16 @@ export default {
this.multipleSelection = []; this.multipleSelection = [];
this.$message.success('删除成功'); this.$message.success('删除成功');
this.getData() this.getData()
}).catch(res => {}); this.$refs.table.clearSelection()
}).catch(res => {})
}) })
.catch(() => {}); .catch(() => {})
}else{ }else{
this.$message.error('请先选择数据!'); this.$message.error('请先选择数据!')
} }
}, },
downLoad() { downLoad() {
location.href = this.api.getExcel location.href = 'http://39.108.250.202:9000/cjEnterprise/questions/getExcel'
}, },
showimportVisible() { showimportVisible() {
this.importVisible = true this.importVisible = true

@ -28,7 +28,7 @@
</div> </div>
<el-table :data="listData" class="table" stripe header-align="center" row-key="cid" :tree-props="treeProps"> <el-table :data="listData" class="table" stripe header-align="center" row-key="cid" :tree-props="treeProps">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="typeName" label="分类名称" align="center"></el-table-column> <el-table-column prop="typeName" label="分类名称"></el-table-column>
<el-table-column label="操作" width="200"> <el-table-column label="操作" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" v-if="scope.row.parentId == 0" @click="addSecond(scope.row)" v-auth>添加</el-button> <el-button type="text" v-if="scope.row.parentId == 0" @click="addSecond(scope.row)" v-auth>添加</el-button>

@ -31,6 +31,7 @@
</el-form-item> </el-form-item>
<el-form-item label="上传" prop="source"> <el-form-item label="上传" prop="source">
<el-upload <el-upload
:accept="acceptExt"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-error="uploadError" :on-error="uploadError"
:on-success="uploadSuccess" :on-success="uploadSuccess"
@ -39,17 +40,28 @@
:on-exceed="handleExceed" :on-exceed="handleExceed"
:action="this.api.fileupload" :action="this.api.fileupload"
:file-list="uploadList" :file-list="uploadList"
name="file"
> >
<el-button type="primary" class="ml20">上传视频/音频</el-button> <el-button type="primary" class="ml20">上传视频/音频</el-button>
</el-upload> </el-upload>
<el-link v-if="uploadFaild" type="primary" @click="showFaild">导入失败查看原因</el-link>
</el-form-item> </el-form-item>
<el-form-item label="题干" prop="questionStem"> <el-form-item label="题干" prop="questionStem">
<quill :border="true" :readonly="isDetail" :key="isDetail" v-model="topicForm.questionStem" :minHeight="150" :height="150" /> <quill :border="true" :readonly="isDetail" :key="isDetail" v-model="topicForm.questionStem" :minHeight="150" :height="150" />
</el-form-item> </el-form-item>
<el-form-item label="选项" prop="optionA" v-if="topicForm.questionType != '填空题' && topicForm.questionType != '简答题'"> <el-form-item label="选项" prop="optionA" v-if="topicForm.questionType != '填空题' && topicForm.questionType != '简答题'">
<template v-if="topicForm.questionType == '判断题'">
<div class="input flex_around bt">
<span>A</span>
<el-input placeholder="请输入题目" v-model="topicForm.judgeOptionA" disabled></el-input>
<el-radio v-model="topicForm.aisTrue" label="1">设为正确答案</el-radio>
</div>
<div class="input flex_around bt">
<span>B</span>
<el-input placeholder="请输入题目" v-model="topicForm.judgeOptionB" disabled></el-input>
<el-radio v-model="topicForm.aisTrue" label="2">设为正确答案</el-radio>
</div>
</template>
<template v-else>
<div class="input flex_around bt"> <div class="input flex_around bt">
<span>A</span> <span>A</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionA"></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionA"></el-input>
@ -60,7 +72,6 @@
<el-input placeholder="请输入题目" v-model="topicForm.optionB"></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionB"></el-input>
<el-checkbox v-model="topicForm.bisTrue">设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.bisTrue">设为正确答案</el-checkbox>
</div> </div>
<template v-if="topicForm.questionType != '判断题'">
<div class="input flex_around bt"> <div class="input flex_around bt">
<span>C</span> <span>C</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionC"></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionC"></el-input>
@ -119,6 +130,7 @@ export default {
props: ['visible','title','isDetail'], props: ['visible','title','isDetail'],
data() { data() {
return { return {
acceptExt: '.avi,.wmv,.mpg,.mpeg,.mov,.rm,.ram,.swf,.flv,.mp4,.mp3,.wma,.avi,.rm,.rmvb,.flv,.mpg,.mkv',
quesBankList: [], quesBankList: [],
typeList: [], typeList: [],
topicForm: { topicForm: {
@ -142,6 +154,8 @@ export default {
disTrue: false, disTrue: false,
eisTrue: false, eisTrue: false,
fisTrue: false, fisTrue: false,
judgeOptionA: '正确',
judgeOptionB: '错误',
answerAnalysis: '', answerAnalysis: '',
videoAudio: '' videoAudio: ''
}, },
@ -151,14 +165,11 @@ export default {
knowledgePoints: [{ required: true, message: '请填写知识点', trigger: 'blur' }], knowledgePoints: [{ required: true, message: '请填写知识点', trigger: 'blur' }],
questionType: [{ required: true, message: '请选择题型', trigger: 'change' }], questionType: [{ required: true, message: '请选择题型', trigger: 'change' }],
questionStem: [{ required: true, message: '请填写题干', trigger: 'blur' }], questionStem: [{ required: true, message: '请填写题干', trigger: 'blur' }],
// optionA: [{ required: true, message: '', trigger: 'change' }],
// optionB: [{ required: true, message: '', trigger: 'change' }]
}, },
options: 'ABCDEF', options: 'ABCDEF',
questionType: ['','单选题','多选题','判断题','简答题','填空题'], questionType: ['','单选题','多选题','判断题','简答题','填空题'],
fillList: [''], fillList: [''],
uploadList: [], uploadList: [],
uploadFaild: false
}; };
}, },
computed: { computed: {
@ -197,16 +208,24 @@ export default {
disTrue: false, disTrue: false,
eisTrue: false, eisTrue: false,
fisTrue: false, fisTrue: false,
judgeOptionA: '正确',
judgeOptionB: '错误',
answerAnalysis: list.answerAnalysis, answerAnalysis: list.answerAnalysis,
videoAudio: list.videoAudio videoAudio: list.videoAudio
}, },
this.topicForm.questionType = this.questionType[this.topicForm.typeId] this.topicForm.questionType = this.questionType[this.topicForm.typeId]
let typeId = this.topicForm.typeId let typeId = this.topicForm.typeId
if(typeId == 1 || typeId == 2 || typeId == 3){ if(typeId == 1 || typeId == 2){
let answer = this.topicForm.answer.toLowerCase().split('') let answer = this.topicForm.answer.toLowerCase().split('')
answer.forEach(n => { answer.forEach(n => {
this.topicForm[`${n}isTrue`] = true this.topicForm[`${n}isTrue`] = true
}) })
}else if(typeId == 3){
if(this.topicForm.answer == 'A'){
this.topicForm.aisTrue = '1'
}else{
this.topicForm.aisTrue = '2'
}
}else if(typeId == 5){ }else if(typeId == 5){
let fillList = [] let fillList = []
for(let n in this.topicForm) { for(let n in this.topicForm) {
@ -232,6 +251,9 @@ export default {
for(let i in this.topicForm){ for(let i in this.topicForm){
if(i.includes('isTrue')) this.topicForm[i] = false if(i.includes('isTrue')) this.topicForm[i] = false
} }
if(this.topicForm.questionType == '判断题'){
this.topicForm.aisTrue = '1'
}
}, },
saveTopics() { saveTopics() {
this.$refs.topicForm.validate((valid) => { this.$refs.topicForm.validate((valid) => {
@ -241,7 +263,18 @@ export default {
let answer = '' let answer = ''
let isInvalidAnswer = false let isInvalidAnswer = false
this.topicForm.typeId = this.questionType.indexOf(topicForm.questionType) this.topicForm.typeId = this.questionType.indexOf(topicForm.questionType)
if(topicForm.typeId != 4 && topicForm.typeId != 5){ if(this.topicForm.typeId == 3){
this.topicForm.optionA = '正确'
this.topicForm.optionB = '错误'
if(this.topicForm.aisTrue == 1){
this.topicForm.aisTrue = true
this.topicForm.answer = 'A'
}else{
this.topicForm.bisTrue = true
this.topicForm.answer = 'B'
}
}
if(topicForm.typeId == 1 || topicForm.typeId == 2 || topicForm.typeId == 3){
for(let n in topicForm) { for(let n in topicForm) {
if(n.includes('option')) { if(n.includes('option')) {
topicForm[n] != '' && ++optionCount topicForm[n] != '' && ++optionCount
@ -252,9 +285,10 @@ export default {
if(!topicForm[`option${curOpt.toUpperCase()}`].length) isInvalidAnswer = true if(!topicForm[`option${curOpt.toUpperCase()}`].length) isInvalidAnswer = true
} }
} }
if(optionCount < 2) return this.$message.warning('请至少添加两个选项!'); if(optionCount < 2) return this.$message.warning('请至少添加两个选项!')
if(!answer) return this.$message.warning('请设置正确答案!'); if(!answer) return this.$message.warning('请设置正确答案!')
if(topicForm.questionType != '多选题' && answer.length > 1) return this.$message.warning('单选题、判断题只能设置一个正确答案!'); if(topicForm.questionType == '单选题' && answer.length > 1) return this.$message.warning('单选题只能设置一个正确选项!')
if(topicForm.questionType == '多选题' && answer.length < 2) return this.$message.warning('多选题必须设置至少两个正确选项!')
if(isInvalidAnswer) return this.$message.warning('正确答案选项为空,请重新设置!'); if(isInvalidAnswer) return this.$message.warning('正确答案选项为空,请重新设置!');
this.topicForm.answer = answer.toUpperCase() this.topicForm.answer = answer.toUpperCase()
}else if(this.topicForm.typeId == 5){ }else if(this.topicForm.typeId == 5){
@ -271,24 +305,24 @@ export default {
if(this.topicForm.id) { if(this.topicForm.id) {
this.$post(this.api.updateQuestions,this.topicForm).then(res => { this.$post(this.api.updateQuestions,this.topicForm).then(res => {
if(res.success) { if(res.success) {
this.$message.success('修改成功'); this.$message.success('修改成功')
this.$emit('getData') this.$emit('getData')
}else{ }else{
this.$message.error(res.data.message); this.$message.error(res.data.message)
} }
}).catch(res => {}); }).catch(res => {})
}else{ }else{
this.$post(this.api.addQuestions,this.topicForm).then(res => { this.$post(this.api.addQuestions,this.topicForm).then(res => {
if(res.success) { if(res.success) {
this.$message.success('新增成功'); this.$message.success('新增成功')
this.$emit('getData') this.$emit('getData')
}else{ }else{
this.$message.error(res.data.message); this.$message.error(res.data.message)
} }
}).catch(res => {}); }).catch(res => {})
} }
}else{ }else{
return false; return false
} }
}) })
}, },
@ -317,6 +351,8 @@ export default {
disTrue: false, disTrue: false,
eisTrue: false, eisTrue: false,
fisTrue: false, fisTrue: false,
judgeOptionA: '正确',
judgeOptionB: '错误',
answerAnalysis: '', answerAnalysis: '',
videoAudio: '' videoAudio: ''
} }
@ -331,7 +367,7 @@ export default {
this.topicForm.id = id this.topicForm.id = id
this.topicForm.questionType = this.questionType[this.topicForm.questionType] this.topicForm.questionType = this.questionType[this.topicForm.questionType]
this.NewTopics = true this.NewTopics = true
}).catch(res => {}); }).catch(res => {})
}, },
addFill(){ addFill(){
if(this.fillList.some(n => n === '')) return this.$message.warning('请先填写当前答案') if(this.fillList.some(n => n === '')) return this.$message.warning('请先填写当前答案')
@ -343,14 +379,10 @@ export default {
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.$message.warning( this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
); )
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
this.uploadFaild = false this.topicForm.videoAudio = res.data.filesResult.fileId
if(res.data.token){
this.token = res.data.token
this.uploadFaild = true
}
}, },
showFaild(){ showFaild(){
location.href = `${this.api.export_failure}?token=${this.token}` location.href = `${this.api.export_failure}?token=${this.token}`
@ -429,4 +461,3 @@ export default {
overflow: auto; overflow: auto;
} }
</style> </style>

@ -1,26 +1,15 @@
<template> <template>
<div <div
style="width:100%;height:100%;display:flex; style="width:100%;height:100%;display:flex;align-items: center;flex-direction:column">
align-items: center;flex-direction:column "
>
<!-- 头像部分 -->
<div class="header"> <div class="header">
<img :src="avatar" class="HeadPortrait" /> <img :src="avatar" class="HeadPortrait" />
<div style="color:#cb221c;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;"> <div style="color:#cb221c;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;">
<el-upload <el-upload :action="this.api.fileupload" :on-success="changeAvatar">
class="upload-demo"
action="http://www.liuwanr.cn:8080/user/uploadUserAvatars"
:data="{userId:this.userId}"
name="file"
:limit="3"
:on-success="getRes"
>
<div>点击更改头像</div> <div>点击更改头像</div>
</el-upload> </el-upload>
</div> </div>
</div> </div>
<!-- 用户信息 -->
<div class="card"> <div class="card">
<p class="block-title" style="display: flex;justify-content: space-between;align-items: center;"> <p class="block-title" style="display: flex;justify-content: space-between;align-items: center;">
用户信息 用户信息
@ -390,12 +379,8 @@ export default {
} }
}).catch(res => {}); }).catch(res => {});
}, },
// changeAvatar(res) {
getRes(res) { this.setAvatar(res.data.filesResult.fileUrl)
this.setAvatar(res.message)
},
uploadHeadImg: function() {
this.$el.querySelector('.hiddenInput').click();
}, },
getdata() { getdata() {
this.$get(`${this.api.userinfo}?userId=${this.userId}`) this.$get(`${this.api.userinfo}?userId=${this.userId}`)

@ -17,6 +17,8 @@ const Setting = {
// 接口请求地址 // 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:8000', // apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:8000',
apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:9000', apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:9000',
// oss文件管理接口地址
apiUploadURL: 'http://8.134.8.197:8001',
// 接口请求返回错误时,弹窗的持续时间,单位:秒 // 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3, modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

@ -23,6 +23,7 @@ export default {
}, },
mutations: { mutations: {
SET_INFO: (state, info) => { SET_INFO: (state, info) => {
info.avatar && (state.avatar = info.avatar)
state.userId = info.userId state.userId = info.userId
state.roleId = info.roleId state.roleId = info.roleId
state.userName = info.userName state.userName = info.userName
@ -60,6 +61,7 @@ export default {
if(user.isPort == 0 || user.isPort == 1){ if(user.isPort == 0 || user.isPort == 1){
let routes = res.data.permissions[0].children let routes = res.data.permissions[0].children
commit('SET_INFO',{ commit('SET_INFO',{
avatar: user.userAvatars,
userId: user.userId, userId: user.userId,
roleId: user.roleId, roleId: user.roleId,
userName: user.userName, userName: user.userName,
@ -92,8 +94,13 @@ export default {
resolve() resolve()
}) })
}, },
setAvatar({ commit },avatar) { setAvatar({ state,commit },avatar) {
commit('SET_AVATAR',avatar) commit('SET_AVATAR',avatar)
let data = {
userId: state.userId,
userAvatars: avatar
}
post(api.userinfoUpdate,data).then(res => {}).catch(res => {})
}, },
} }
} }

@ -228,6 +228,10 @@ select {
text-transform: none; text-transform: none;
} }
button:focus{
outline: none;
}
button, button,
html [type="button"], html [type="button"],
[type="reset"], [type="reset"],

@ -26,3 +26,4 @@
@import "white-space"; @import "white-space";
@import "style"; @import "style";
@import "mixin";

@ -0,0 +1,9 @@
@mixin ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ellipsis{
@include ellipsis();
}
Loading…
Cancel
Save