mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-18 23:36:44 +08:00
2022年5月29日从svn移到git
This commit is contained in:
165
src/views/qa/MyList.vue
Normal file
165
src/views/qa/MyList.vue
Normal file
@@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<div>
|
||||
<Remark>
|
||||
1.我的问答,我发的问题列表信息
|
||||
<br />
|
||||
2.关于问题标题是否是必须的可以讨论下
|
||||
<br />
|
||||
</Remark>
|
||||
<div style="display: flex;justify-content: space-between;height: 40px;">
|
||||
<!-- <div style="padding-top: 5px;"> -->
|
||||
<!--
|
||||
<el-tag type="primary" style="margin-right: 20px;">最新</el-tag>
|
||||
<el-tag type="info">最热</el-tag>
|
||||
-->
|
||||
<!-- </div> -->
|
||||
<div>
|
||||
<div style="display: flex;justify-content:space-around;padding: 12px 22px 10px 18px;">
|
||||
<!--<div style="padding: 0px 5px;"><el-cascader clearable v-model="params.type" :options="typeList"></el-cascader></div>-->
|
||||
<div style="padding: 0px 5px;">
|
||||
<el-select v-model="queryObj.isResolve" style="width: 110px;" clearable placeholder="状态">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option label="待解决" :value="false"></el-option>
|
||||
<el-option label="已解决" :value="true"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="padding: 0px 5px;"><el-input clearable placeholder="搜索问题" v-model="queryObj.keyWord"></el-input></div>
|
||||
<div style="padding: 0px 5px;"><el-button icon="el-icon-search" @click="getList" type="primary" >搜索</el-button></div>
|
||||
<div style="padding-left:5px"><el-button type="primary" icon="el-icon-refresh-right" @click="reset">重置</el-button></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 12px 32px 10px 32px;"><el-button type="primary" style="width: 89px;height: 38px;" icon="el-icon-plus" @click="$refs.addQuestion.askQuestionDialog = true" size="small">提问题</el-button></div>
|
||||
</div>
|
||||
<div style="padding: 10px 0px 0px 0px;">
|
||||
<!-- <el-empty v-if="qaList.length==0" description="暂无数据"></el-empty> -->
|
||||
<qa-items @sure="getData" :keyWord="queryObj.keyWord" :items="qaList"></qa-items>
|
||||
<div v-if="qaList.length > 0 " style="text-align: center;margin-top:70px">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:current-page="queryObj.pageIndex"
|
||||
:page-size="queryObj.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="qaList.length == 0">
|
||||
<div v-if="isSearh" class="zan-wu">没有查询到相关内容</div>
|
||||
<div v-else class="zan-wu">暂无数据</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 100px;"></div>
|
||||
<addQuestion @sure="getData" ref="addQuestion"></addQuestion>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import qaItems from '@/components/Qa/ucList.vue';
|
||||
import addQuestion from '@/components/Qa/addQuestion.vue';
|
||||
import apiQa from '@/api/modules/qa.js';
|
||||
export default {
|
||||
name: 'articleMyList',
|
||||
components: { qaItems, addQuestion },
|
||||
data() {
|
||||
return {
|
||||
isSearh:false,
|
||||
queryObj: {
|
||||
pageIndex: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
qaList: [],
|
||||
total: 0,
|
||||
|
||||
typeList: [],
|
||||
newArticle: {
|
||||
dlgShow: false
|
||||
},
|
||||
askForm: {
|
||||
title: '',
|
||||
content: '',
|
||||
course: '',
|
||||
imageUrl: ''
|
||||
},
|
||||
articleList: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
|
||||
reset(){
|
||||
this.queryObj.keyWord = '',
|
||||
this.queryObj.isResolve = ''
|
||||
this.getData();
|
||||
this.isSearh = false;
|
||||
},
|
||||
getList() {
|
||||
this.isSearh = true;
|
||||
this.getData();
|
||||
},
|
||||
//获取列表数据
|
||||
getData() {
|
||||
apiQa
|
||||
.queryQuestion(this.queryObj)
|
||||
.then(res => {
|
||||
if (res.status == 200) {
|
||||
this.total = res.result.count;
|
||||
res = res.result.list;
|
||||
this.qaList = res;
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
this.$message.error('获取数据失败');
|
||||
});
|
||||
},
|
||||
handleSizeChange(item) {
|
||||
this.queryObj.pageSize = item;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange(item) {
|
||||
this.queryObj.pageIndex = item;
|
||||
this.getData();
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.uc-badge {
|
||||
margin-top: 10px;
|
||||
margin-right: 40px;
|
||||
}
|
||||
.uc-course {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
border: 1px solid #f0f0f0;
|
||||
// padding: 10px;
|
||||
.uc-course-img {
|
||||
width: 200px;
|
||||
img {
|
||||
width: 200px;
|
||||
border: 1px solid #f4f4f5;
|
||||
}
|
||||
}
|
||||
.uc-course-info {
|
||||
flex: 1;
|
||||
line-height: 28px;
|
||||
padding: 0px 10px;
|
||||
.uc-course-name {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.uc-course-text {
|
||||
color: #747474;
|
||||
}
|
||||
}
|
||||
.uc-course-btns {
|
||||
width: 150px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user