标准问答

This commit is contained in:
zyn
2023-04-13 16:51:21 +08:00
parent d51c214430
commit 4c4ccfaebd
2 changed files with 66 additions and 112 deletions
+60 -106
View File
@@ -1,57 +1,37 @@
<!-- 企标发布 -->
<!-- 标准问答 -->
<template>
<div class="release">
<!-- <ul>-->
<!-- <li v-for="item in standardReleaseList" :key="item.id" class="time-title" >-->
<!-- <div style="height: 18px;">-->
<!-- <a @click="handlePreview(item)" style="color: #333333" class="table-jump">{{ item.standName }}</a>-->
<!-- <span class="time">{{item.issueTime ? $moment(item.issueTime).format('YYYY-MM-DD') : '' }}</span>-->
<!-- </div>-->
<!-- </li>-->
<!-- </ul>-->
<el-table
ref="selection"
:data="standardReleaseList"
tooltip-effect="dark"
<el-table ref="table"
:data="data"
tooltip-effect = "dark"
border
style="cursor:pointer;"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}">
<el-table-column
label="分类"
align="center"
width="80">
</el-table-column>
<el-table-column
label="问题描述">
<template slot-scope="scope">
<!-- <span @click="handlePreview(scope.row)">{{ scope.row.standard }}</span>-->
</template>
</el-table-column>
<el-table-column
prop="standName"
label="提问人"
width="100">
<template slot-scope="scope">
<!-- <span @click="handlePreview(scope.row)">{{ scope.row.standardName }}</span>-->
</template>
</el-table-column>
<el-table-column
width="120"
label="提问时间">
<template slot-scope="scope">
<!-- <span>{{scope.row.releaseDate ? $moment(scope.row.releaseDate).format('YYYY-MM-DD') : '' }}</span>-->
</template>
</el-table-column>
</el-table>
<div class="more" v-if="!pageVerify" @click="togo">更多 </div>
<loading :loading="loading">加载中...</loading>
<pagination
v-if="pageVerify"
style="position: static;"
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<el-table-column
prop="classification"
label="类型"
width="150"
align="center">
</el-table-column>
<el-table-column
prop="problemDescription"
label="问题描述"
align="center">
</el-table-column>
<el-table-column
prop="questioner"
label="提问人"
width="150"
align="center">
</el-table-column>
<el-table-column
prop="questionTime"
label="提问时间"
width="150"
align="center">
</el-table-column>
</el-table>
<div class="more" v-if="!pageVerify" @click="togo">更多 </div>
<loading :loading="loading">加载中...</loading>
</div>
</template>
@@ -64,73 +44,47 @@ export default {
return {
loading: false,
pageVerify: false,
page: 1,
pageSize: 10,
total: 0,
putTime: '',
standardReleaseList: [], //标准问答数据
currentPage: 1,
data: [],
form:{
classification:"", // 类型
problemDescription: "", // 问题描述
},
}
},
computed: {},
watch: {},
mounted() {
this.getDate()
this.getAdvice()
// this.addDate()
},
methods: {
pageChange(page) {
this.page = page
this.pageSize = this.$store.getters.userInfo.configContent
this.getAdvice()
},
// 分页每页显示数改变后方法
pageSizeChange(pageSize) {
this.pageSize = this.$store.getters.userInfo.configContent
this.getAdvice()
// 此处需要调用接口,修改个人配置
},
togo () {
this.$router.push({path:'/releaseQA2'})
},
// 点击查看
handlePreview (item) {
// let routeUrl = this.$router.resolve({
// name: 'OtherBussStandardDetails',
// params: {
// id: item.standardId,
// pageType: 'BUSINESS_STAND'
// }
// })
// window.open(routeUrl.href, '_blank')
togo () {
this.$router.push({path:'/releaseQA2'})
},
//截取时间
getDate (date) {
return date != null ? date.substring(0, date.indexOf(' ')) : ''
},
//获取数据
getAdvice() {
this.loading = true
// 模拟加载
const timer = setInterval(() => {
this.loading = false
}, 2000)
console.log(timer)
// this.$http.get("/lawss/NewsFeed/getNewsFeed", {
// messageType: 'QYBZFB',
// page: this.page,
// pageSize: this.pageSize
// }, {
// _this: this,loading: 'loading'
// }, res => {
// this.standardReleaseList = res.data.records
// this.total = res.data.total
// this.loading = false
// }, e => {
// this.loading = false
// this.standardReleaseList = []
// this.total = 0
// })
getDate(){
this.loading = true
let form = this.form
form.userId = this.$store.getters.userInfo.account
form.pageSize = this.pageSize
form.page = this.currentPage
return new Promise((resolve,reject)=>{
this.$http.get('lawss/AskQuestions/getAskQuestionsPage', form, {_this: this }, res => {
if(res.data){
const data = res.data
this.data = data.records
this.total = data.total
this.currentPage = data.current
this.pageSize = data.size
}
this.loading = false
resolve(res)
}, e => {
this.loading = false
reject(e)
})
})
},
},
@@ -120,10 +120,10 @@ export default {
}
},
mounted() {
this.getData()
this.getDate()
},
methods: {
getData(){
getDate(){
this.loading = true
let form = this.form
form.userId = this.$store.getters.userInfo.account
@@ -147,20 +147,20 @@ export default {
})
},
onSubmit(){
this.getData()
this.getDate()
},
onClear(){
this.form.classification = ''
this.form.problemDescription = ''
this.getData()
this.getDate()
},
sizeChange(pageSize){
this.pageSize = pageSize
this.getData()
this.getDate()
},
currentChange(currentPage){
this.currentPage = currentPage
this.getData()
this.getDate()
},
handlePreview(){}
}