修改 问题库

This commit is contained in:
hanshaozhuang
2022-07-08 18:07:22 +08:00
parent 0c562f21af
commit a8256a8d8e
2 changed files with 1521 additions and 316 deletions
+136 -316
View File
@@ -3,6 +3,16 @@
<div id="my-questions"> <div id="my-questions">
<div class="search-area"> <div class="search-area">
<el-form :inline="true" :model="questionSerach" > <el-form :inline="true" :model="questionSerach" >
<el-form-item class="el-form-item search-item" label="标准">
<el-select v-model="questionSerach.classification">
<el-option
v-for="opt in classificationOption"
:key="opt.value"
:value="opt.value"
:label="opt.label"
></el-option>
</el-select>
</el-form-item>
<el-form-item class="el-form-item search-item" label="标准号"> <el-form-item class="el-form-item search-item" label="标准号">
<el-input v-model="questionSerach.standardEncdoing" placeholder="根据标准号查询"></el-input> <el-input v-model="questionSerach.standardEncdoing" placeholder="根据标准号查询"></el-input>
</el-form-item> </el-form-item>
@@ -24,243 +34,46 @@
</el-form> </el-form>
</div> </div>
<div class="tab-box"> <div class="tab-box">
<el-tabs
type="border-card" <el-table
style="height: 100%" ref="selections"
class="type-tabs" tooltip-effect="dark"
v-model="activeName" style="width: 100%; flex: auto;"
@tab-click="sourceClick" class="drag-table"
tab-position="left" height="92%"
border
:loading="tableLoading"
:data="tableData"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
> >
<el-tab-pane name="INLAND" label="国内标准"> <el-table-column show-overflow-tooltip label="分类" prop="classification" align="center" min-width="50" :formatter="formatClassification"></el-table-column>
<div v-if="!standList || standList.length === 0"> <el-table-column show-overflow-tooltip label="标准号/问题分类" width="150" align="center" prop="standardEncdoing"></el-table-column>
<div style="padding: 20px;"> <el-table-column show-overflow-tooltip label="标准名称" prop="standardName" align="center" min-width="100"></el-table-column>
暂无数据 <el-table-column show-overflow-tooltip label="问题描述" prop="problemDescription" align="center" min-width="300"></el-table-column>
</div> <el-table-column prop="questionTime" width="150" align="center" label="提问日期"></el-table-column>
</div> <el-table-column label="操作" align="center" width="50" fixed="right">
<div style="height: 100%" v-else> <template slot-scope="scope">
<el-tabs <div @click.stop style="display: inline-block">
class="question-box" <el-dropdown trigger="click" @command="handleCommand2">
type="border-card" <i class="iconfont">&#xe61e;</i>
v-model="activestand" <el-dropdown-menu slot="dropdown">
@tab-click="standClick" <el-dropdown-item :command="[scope.row, '查看']">查看</el-dropdown-item>
style="height: 100%" <el-dropdown-item :command="[scope.row, '订阅']">订阅</el-dropdown-item>
tab-position="left" </el-dropdown-menu>
> </el-dropdown>
<template v-for="stand in standList"> </div>
<el-tab-pane class="com-box" :name="stand.standardId"> </template>
<template slot="label"> </el-table-column>
<stand-item :stand="stand"></stand-item> </el-table>
</template> <!--分页-->
<div v-if="!questionsList || questionsList.length === 0"> <pagination
<div style="padding: 20px;"> v-show="this.tableLoading === false"
暂无数据 style="position: relative;"
</div> :page="questionSerach.page"
</div> :total="tableTotal"
<div style="height: 100%" v-else> @pageChange="handleSelectPageChange"
<el-tabs @pageSizeChange="handleSelectPageSizeChange"></pagination>
class="question-box"
type="border-card"
style="height: 100%"
v-model="activeQue"
@tab-click="questionClick"
tab-position="left"
>
<template v-for="question in questionsList">
<el-tab-pane class="com-box" :name="question.id">
<template slot="label">
<questions-item :question="question"></questions-item>
</template>
<div class="contentClass">
<template v-for="(item, index) in answerList">
<div class="clearfix">
<div class="answer-box" >
<question-item-info :answer="item"></question-item-info>
</div>
</div>
</template>
</div>
</el-tab-pane>
</template>
</el-tabs>
</div>
</el-tab-pane>
</template>
</el-tabs>
</div>
</el-tab-pane>
<el-tab-pane name="FOREIGN" label="海外标准">
<div v-if="!standList || standList.length === 0">
<div style="padding: 20px;">
暂无数据
</div>
</div>
<div style="height: 100%" v-else>
<el-tabs
class="question-box"
type="border-card"
v-model="activestand"
@tab-click="standClick"
style="height: 100%"
tab-position="left"
>
<template v-for="stand in standList">
<el-tab-pane class="com-box" :name="stand.standardId">
<template slot="label">
<stand-item :stand="stand"></stand-item>
</template>
<div v-if="!questionsList || questionsList.length === 0">
<div style="padding: 20px;">
暂无数据
</div>
</div>
<div style="height: 100%" v-else>
<el-tabs
class="question-box"
type="border-card"
style="height: 100%"
v-model="activeQue"
@tab-click="questionClick"
tab-position="left"
>
<template v-for="question in questionsList">
<el-tab-pane class="com-box" :name="question.id">
<template slot="label">
<questions-item :question="question"></questions-item>
</template>
<div class="contentClass">
<template v-for="(item, index) in answerList">
<div class="clearfix">
<div class="answer-box" >
<question-item-info :answer="item"></question-item-info>
</div>
</div>
</template>
</div>
</el-tab-pane>
</template>
</el-tabs>
</div>
</el-tab-pane>
</template>
</el-tabs>
</div>
</el-tab-pane>
<el-tab-pane name="BUSINESS_STAND" label="企业标准">
<div v-if="!standList || standList.length === 0">
<div style="padding: 20px;">
暂无数据
</div>
</div>
<div style="height: 100%" v-else>
<el-tabs
class="question-box"
type="border-card"
v-model="activestand"
@tab-click="standClick"
style="height: 100%"
tab-position="left"
>
<template v-for="stand in standList">
<el-tab-pane class="com-box" :name="stand.standardId">
<template slot="label">
<stand-item :stand="stand"></stand-item>
</template>
<div v-if="!questionsList || questionsList.length === 0">
<div style="padding: 20px;">
暂无数据
</div>
</div>
<div style="height: 100%" v-else>
<el-tabs
class="question-box"
type="border-card"
style="height: 100%"
v-model="activeQue"
@tab-click="questionClick"
tab-position="left"
>
<template v-for="question in questionsList">
<el-tab-pane class="com-box" :name="question.id">
<template slot="label">
<questions-item :question="question"></questions-item>
</template>
<div class="contentClass">
<template v-for="(item, index) in answerList">
<div class="clearfix">
<div class="answer-box" >
<question-item-info :answer="item"></question-item-info>
</div>
</div>
</template>
</div>
</el-tab-pane>
</template>
</el-tabs>
</div>
</el-tab-pane>
</template>
</el-tabs>
</div>
</el-tab-pane>
<el-tab-pane name="OTHER" label="公共问题">
<div v-if="!standList || standList.length === 0">
<div style="padding: 20px;">
暂无数据
</div>
</div>
<div style="height: 100%" v-else>
<el-tabs
class="question-box"
type="border-card"
v-model="activestand"
@tab-click="standClick"
style="height: 100%"
tab-position="left"
>
<template v-for="stand in standList">
<el-tab-pane class="com-box" :name="stand.standardId">
<template slot="label">
<stand-item :stand="stand"></stand-item>
</template>
<div v-if="!questionsList || questionsList.length === 0">
<div style="padding: 20px;">
暂无数据
</div>
</div>
<div style="height: 100%" v-else>
<el-tabs
class="question-box"
type="border-card"
style="height: 100%"
v-model="activeQue"
@tab-click="questionClick"
tab-position="left"
>
<template v-for="question in questionsList">
<el-tab-pane class="com-box" :name="question.id">
<template slot="label">
<questions-item :question="question"></questions-item>
</template>
<div class="contentClass">
<template v-for="(item, index) in answerList">
<div class="clearfix">
<div class="answer-box" >
<question-item-info :answer="item"></question-item-info>
</div>
</div>
</template>
</div>
</el-tab-pane>
</template>
</el-tabs>
</div>
</el-tab-pane>
</template>
</el-tabs>
</div>
</el-tab-pane>
</el-tabs>
</div> </div>
<!--提问弹窗 --> <!--提问弹窗 -->
<el-dialog <el-dialog
@@ -687,6 +500,31 @@
</div> </div>
</div> </div>
</el-drawer> </el-drawer>
<!-- 详情抽屉-->
<el-drawer
class="drawer-table"
title="查看问题"
:wrapperClosable="false"
:visible.sync="answerListDrawer"
size="900px"
custom-class="demo-drawer"
>
<div class="demo-drawer-content">
<!-- <loading :loading="lawInfoTableLoading">数据获取中</loading>-->
<div style="height: 90%;overflow-y: auto;">
<template v-for="(item, index) in answerList">
<div class="clearfix">
<div class="answer-box" >
<question-item-info :answer="item"></question-item-info>
</div>
</div>
</template>
</div>
<div slot="footer" class="demo-drawer-footer">
<el-button class="common-button-default" size="mini" @click="answerListDrawer = false">取消</el-button>
</div>
</div>
</el-drawer>
</div> </div>
</template> </template>
@@ -766,13 +604,37 @@ export default {
{required: true, message: '请输入问题', trigger: 'blur'}, {required: true, message: '请输入问题', trigger: 'blur'},
], ],
}, },
classificationOption: [
{
value: 'INLAND',
label: '国内标准'
},
{
value: 'FOREIGN',
label: '海外标准'
},
{
value: 'BUSINESS_STAND',
label: '企业标准'
},
{
value: 'OTHER',
label: '公共问题'
}
],
tableData: [],
tableLoading: false,
tableTotal: 0,
questionSerach:{ questionSerach:{
classification: 'INLAND', classification: 'INLAND',
standardName: '', //标准名称 standardName: '', //标准名称
standardEncdoing: '', //标准编号 standardEncdoing: '', //标准编号
problemDescription: '', //关键词/问题描述 problemDescription: '', //关键词/问题描述
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
}, },
answerList: [], answerList: [],
answerListDrawer: false,
answer: '', answer: '',
standList: [], standList: [],
standIdList: [], standIdList: [],
@@ -781,33 +643,9 @@ export default {
} }
}, },
mounted(){ mounted(){
if(this.$route.query.queId){ this.questionSerach.standardName = this.$route.query.standName
this.questionSerach.standardName = this.$route.query.standName this.questionSerach.classification = this.$route.query.standType
this.questionSerach.classification = this.$route.query.standType this.searchBtn()
this.activeName = this.$route.query.standType
this.standSearch()
}else{
switch (this.standType){
case 'INLAND':
this.standSearch2()
break
case 'FOREIGN':
this.activeName = 'FOREIGN'
this.questionSerach.classification = 'FOREIGN'
this.standSearch2()
break
case 'BUSINESS_STAND':
this.activeName = 'BUSINESS_STAND'
this.questionSerach.classification = 'BUSINESS_STAND'
this.standSearch2()
break
case 'OTHER':
this.activeName = 'OTHER'
this.questionSerach.classification = 'OTHER'
this.standSearch2()
break
}
}
// 查询各下拉框数据 // 查询各下拉框数据
this.$http.get("sys/dictype/getDicTypeListCode", "", { this.$http.get("sys/dictype/getDicTypeListCode", "", {
_this: this, _this: this,
@@ -820,6 +658,34 @@ export default {
}); });
}, },
methods:{ methods:{
formatClassification(e){
for (let i=0; i<this.classificationOption.length; i++){
if(e.classification === this.classificationOption[i].value){
return this.classificationOption[i].label
}
}
},
// 展示区域 更多
handleCommand2 (command) {
switch (command[1]) {
case '查看':
this.handleDetail(command[0])
break
}
},
handleDetail(row){
console.log('row = ', row)
this.$http.get('lawss/AskQuestions/getAskQuestionsByakId',{
id: row.id,
state: 'yes'
},{
_this: this
}, res => {
this.answerListDrawer = true
this.answerList = res.data
}, e => {
})
},
refreshStandMap(){ refreshStandMap(){
this.standMap = new Map() this.standMap = new Map()
this.standList.forEach(item=>{ this.standList.forEach(item=>{
@@ -1029,9 +895,6 @@ export default {
this.questionSerach.standardEncdoing = '' this.questionSerach.standardEncdoing = ''
this.standSearch() this.standSearch()
}, },
standClick(){
this.queSearch()
},
questionClick(){ questionClick(){
sessionStorage.setItem('queId', this.activeQue) sessionStorage.setItem('queId', this.activeQue)
this.$http.get('lawss/AskQuestions/getAskQuestionsByakId',{ this.$http.get('lawss/AskQuestions/getAskQuestionsByakId',{
@@ -1087,18 +950,19 @@ export default {
questioner: this.$store.getters.userInfo.userId, //提问人 questioner: this.$store.getters.userInfo.userId, //提问人
problemDescription: '', //关键词/问题描述 problemDescription: '', //关键词/问题描述
} }
this.standSearch2() this.searchBtn()
}, },
searchBtn(){ searchBtn(){
this.questionSerach.classification = this.activeType
this.questionSerach.questioner = '' this.questionSerach.questioner = ''
this.$http.get('lawss/AskQuestions/retrieve',{ this.tableLoading = true
this.$http.postData('lawss/AskQuestions/list',{
...this.questionSerach ...this.questionSerach
},{ },{
_this: this _this: this
}, res => { }, res => {
this.standList = res.data this.tableData = res.data.records
this.refreshStandMap() this.tableTotal = res.total
this.tableLoading = false
}) })
}, },
//问题查询 //问题查询
@@ -1113,31 +977,7 @@ export default {
this.questionsList = res.data this.questionsList = res.data
}) })
}, },
//回答查询
ansSearch(){
this.$http.get('lawss/AskQuestions/getReplyDetails',{
classification: this.questionSerach.classification,
answerer: this.$store.getters.userInfo.userId,
}, {
_this: this,
}, res => {
})
},
//查询提问标准 //查询提问标准
standSearch(){
this.$http.get('lawss/AskQuestions/getAskQuestionsDetails',{ ...this.questionSerach },{
_this: this
}, res =>{
this.standList = res.data
this.refreshStandMap()
if(this.$route.query.queId){
this.activestand = this.standList[0].standardId
this.queSearch()
}
}, e => {
})
},
standSearch2(){ standSearch2(){
let qId = this.$route.query.standId let qId = this.$route.query.standId
let queNumber = 0 let queNumber = 0
@@ -1240,27 +1080,7 @@ export default {
_this: this _this: this
}, res => { }, res => {
this.dialogVisible = false this.dialogVisible = false
switch (this.standType){ this.searchBtn()
case 'INLAND':
this.standSearch2()
break
case 'FOREIGN':
this.activeName = 'FOREIGN'
this.questionSerach.classification = 'FOREIGN'
this.standSearch2()
break
case 'BUSINESS_STAND':
this.activeName = 'BUSINESS_STAND'
this.questionSerach.classification = 'BUSINESS_STAND'
this.standSearch2()
break
case 'OTHER':
this.activeName = 'OTHER'
this.questionSerach.classification = 'OTHER'
this.standSearch2()
break
}
this.queSearch()
}, e => { }, e => {
}) })
File diff suppressed because it is too large Load Diff