feat: There is no way the, 首页 tab 问答库

This commit is contained in:
super_liu
2022-06-06 15:42:37 +08:00
parent c3cd41150d
commit 1e38593880
10 changed files with 1767 additions and 1 deletions
+5
View File
@@ -151,6 +151,11 @@
path: '/standInvolveProject',
menuId: '8a9c87fe06244fb9d55e78fb281f625b'
},
{
title: '问答库', // 把 标准涉及项目 这几个字 改成 标准合规评估结果
path: '/standQA',
menuId: ''
},
// {
// title: '零部件编号申请',
// path: '/partCodeApply',
@@ -0,0 +1,183 @@
<!-- 企标发布 -->
<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"
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>
</div>
</template>
<script>
export default {
name: 'ReleaseQA',
components: {},
mixins: [],
data() {
return {
loading: false,
pageVerify: false,
page: 1,
pageSize: 10,
total: 0,
putTime: '',
standardReleaseList: [], //标准问答数据
}
},
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 () {
if(this.total && this.total > 10){
this.pageVerify = true
this.pageSize = this.$store.getters.userInfo.configContent
}else {
this.pageVerify = false
}
this.getAdvice()
},
// 点击查看
handlePreview (item) {
// let routeUrl = this.$router.resolve({
// name: 'OtherBussStandardDetails',
// params: {
// id: item.standardId,
// pageType: 'BUSINESS_STAND'
// }
// })
// window.open(routeUrl.href, '_blank')
},
//截取时间
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
// })
},
},
}
</script>
<style lang="less" scoped>
.release {
/deep/.el-table th > .cell {
font-size: 15px;
}
/deep/.el-table td > .cell{
font-size: 13px;
}
/deep/.more {
position: absolute;
right: 0;
bottom: 2px;
font-size: 12px;
float: right;
color: #4788c0;
&:hover {
color: #3a8ee6;
cursor: pointer;
}
}
width: 100%;
.time-title {
margin: 15px;
.time {
float: right;
color:#333333;
}
a {
color: #ffffff;
&:hover {
color: #e9c851;
cursor:pointer;
text-decoration: underline;
}
}
}
}
</style>
@@ -44,7 +44,7 @@
</template>
</el-table-column>
</el-table>
<div class="more" @click="togo">更多 </div>
<div class="more" v-if="!pageVerify" @click="togo">更多 </div>
<loading :loading="loading">加载中...</loading>
<pagination
v-if="pageVerify"
+6
View File
@@ -27,6 +27,10 @@
<span slot="label"><i class="el-icon-s-promotion"></i> 企业标准发布</span>
<releaseBuss></releaseBuss>
</el-tab-pane>
<el-tab-pane name="releaseQA" style="overflow-y: auto;height: 100%">
<span slot="label"><i class="el-icon-chat-line-round"></i> 标准问答</span>
<releaseQA></releaseQA>
</el-tab-pane>
</el-tabs>
</div>
</div>
@@ -47,6 +51,7 @@ import searchGroup from './components/searchGroup'
import release from './components/release'
import releaseUs from './components/releaseUs'
import releaseBuss from './components/releaseBuss'
import releaseQA from './components/releaseQA'
import solicitOpinions from './components/solicitopinions'
import navMenu from './components/navMenu'
import todoList from './components/todoList'
@@ -59,6 +64,7 @@ export default {
release,
releaseUs,
releaseBuss,
releaseQA,
navMenu,
todoList,
Empennage,
@@ -0,0 +1,190 @@
<!--我的回答-->
<template>
<div>
<el-divider style="margin: 10px 0;"></el-divider>
<div id="message-content">
<el-form ref="form" :model="form" :rules="rules">
<el-form-item prop="textarea">
<el-input
type="textarea"
:rows="2"
placeholder="请输入回答内容"
v-model="form.textarea">
</el-input>
</el-form-item>
<div>
<el-button
type="primary"
class="common-button-primary"
size="small"
style="float: right;"
@click="handleSubmit"
>提交</el-button>
<el-button
type="primary"
class="common-button-primary"
size="small"
style="float: right;margin-right: 10px;"
@click="openUploadFileDialog"
>上传文件</el-button>
<el-button
type="primary"
class="common-button-primary"
size="small"
style="float: right;"
@click="queArchive"
>问题归档</el-button>
<el-button
type="primary"
class="common-button-primary"
size="small"
style="float: right;margin-right: 10px;"
@click="invitation"
>邀请</el-button>
</div>
</el-form>
</div>
<el-dialog
width='400px'
:visible.sync="importModalshowflagtemp"
title="上传文件"
:footer-hide="true"
append-to-body
>
<el-upload
multiple
drag
:on-success="uploadSuccess"
:before-upload="beforeUpload"
:on-remove="removeOneFile"
:action="actionPath"
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx, .pdf, .PDF"
name="file"
:file-list="fileList"
ref="importFileAboutStand">
<i class="el-icon-upload"></i>
<div class="el-upload__text">点击或拖拽上传文件</div>
</el-upload>
</el-dialog>
<!-- 选择回答人-->
<Role-tree
is-title="选择回答人"
:is-visible.sync="roleFlag"
@checkedRole="checkedRole"
:nodeList="nodeList"
></Role-tree>
</div>
</template>
<script>
export default {
name: "answerItem",
data(){
return{
roleFlag: false,
nodeList: [],
// 上传地址
actionPath: 'api/att/attFile/uploadNew',
importModalshowflagtemp: false,
fileList: [],
form:{
textarea: '',
invitationId: '',
invitationName: '',
},
rules: {
textarea: [
{ required: true, message: '请输入回复内容', trigger: 'blur' },
{ min: 1, max: 500, message: '长度在 1 到 500 个字符', trigger: 'blur' }
]
},
}
},
methods:{
//提交
handleSubmit(){
this.form.fileList = this.fileList
console.log(this.form);
},
//上传文件
openUploadFileDialog(){
this.importModalshowflagtemp = true
},
//上传成功
uploadSuccess(res,file,fileList){
if(res.ok){
this.fileList.push(res.data)
this.$message.success('上传成功')
}else{
this.$message.warning(res.message)
fileList.pop()
}
this.importModalshowflagtemp = false
},
//文件上传前
beforeUpload(file){
console.log(file);
var filename = file.name;
var index1 = filename.lastIndexOf('.')
var index2 = filename.length
var fileSuffix = filename.substring(index1, index2)
//把后缀转大写
if(fileSuffix){
fileSuffix = fileSuffix.toUpperCase()
}
// 判断上传文件格式
if (fileSuffix === ".PDF" || fileSuffix === ".DOC" || fileSuffix === ".DOCX" || fileSuffix === ".PPT"
|| fileSuffix === ".PPTX" || fileSuffix === ".XLS" || fileSuffix === ".XLSX"
|| fileSuffix === ".PNG" || fileSuffix === ".JPG" || fileSuffix === ".JPEG") {
return true;
} else {
this.$message.error("文件" + file.name + "格式不正确,请上传pdf、doc、docx、ppt、pptx、xls、xlsx、png、jpg、jpeg等文件");
return false;
}
// 判断文件上传大小
if (file.size / 1024 / 1024 > 300) {
this.$message.warning("文件" + file.name + "大小不能超过300M");
return false;
}
return true;
},
//删除文件
removeOneFile(){
this.fileList.forEach((item,index) => {
if(item.name === file.name || item.id === file.id){
this.fileList.splice(index, 1)
}
})
},
checkedRole(data){
let asdId = sessionStorage.getItem('queId')
this.$http.postData('lawss/AskUser/insertAskUser',{
asdId: asdId,
usid: data[0].id,
},{
_this: this
}, res => {
if(res.ok){
this.$message.success('邀请成功')
}
}, e => {
})
},
//问题归档
queArchive(){
},
//邀请
invitation(){
this.roleFlag = true
},
},
};
</script>
<style lang="less" scoped>
#message-content{
}
</style>
@@ -0,0 +1,76 @@
<!--回答框-->
<template>
<div id="answer-item">
<div>
<div class="row">
<div class="item">
<div>回答
<span>{{answer. reply}}</span>
</div>
</div>
</div>
<div class="row">
<div class="item">
<div>附件
<span style="color: #409EFF">{{answer.annex}}</span>
</div>
</div>
</div>
<div class="row" style="float: right; margin-right: 10px">
<div class="item">
<div>{{answer.answerer}}
<span>{{answer.replyTime}}</span>
</div>
</div>
</div>
<!-- <div>-->
<!-- <el-checkbox v-model="checked">归档</el-checkbox>-->
<!-- </div>-->
</div>
<!-- <div class="footer-box">-->
<!-- </div>-->
</div>
</template>
<script>
export default {
name: "questionItemInfo",
props:['answer'],
data(){
return{
checked: true,
}
},
watch:{
answer: {
immediate: true,
deep: true,
handler(val) {
this.answer = val
}
}
}
};
</script>
<style lang="less" scoped>
#answer-item{
width: 100%;
min-width: 130px;
padding: 15px 5px;
.row {
line-height: 1.8;
}
.item {
display: inline-block;
}
.footer-box{
height: 200px;
width: 100%;
position: absolute;
bottom: 0;
border-top: 1px solid #cccccc;
}
}
</style>
@@ -0,0 +1,57 @@
<!--问题的描述-->
<template>
<div id="questions-item">
<div>
<div class="row">
<div class="item">
<div>提问
<span>{{question.problemDescription}}</span>
</div>
</div>
</div>
<div class="row">
<div class="item">
<div>{{userName}}
<span>{{question.questionTime}}</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "questions-item",
props: ['question'],
computed: {
},
data(){
return{
userName: this.$store.getters.userInfo.userName,
}
},
watch:{
question: {
immediate: true,
deep: true,
handler(val){
}
}
}
};
</script>
<style lang="less" scoped>
#questions-item{
width: 100%;
min-width: 130px;
padding:10px 0;
.row {
line-height: 1.8;
}
.item {
display: inline-block;
}
}
</style>
@@ -0,0 +1,53 @@
<!--标准的描述-->
<template>
<div id="stand-item">
<div>
<div class="row">
<div class="item">
<span>{{stand.standardEncdoing}}</span>
</div>
</div>
<div class="row">
<div class="item">
<span>{{stand.standardName}}</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "stand-item",
props: ['stand'],
computed: {
},
data(){
return{
}
},
watch:{
stand: {
immediate: true,
deep: true,
handler(val) {
this.stand = val
}
}
}
};
</script>
<style lang="less" scoped>
#stand-item{
width: 100%;
min-width: 130px;
padding:10px 0;
.row {
line-height: 1.5;
}
.item {
display: inline-block;
}
}
</style>
File diff suppressed because it is too large Load Diff
+11
View File
@@ -3304,6 +3304,17 @@ const routes = [
menuId: 'JURHS3LVP35US88ABULS'
}
},
{
path: '/standQA',
name: 'StandQA',
component: () =>
import('@/pages/regulatoryRepository/standQA'),
meta: {
requireAuth: true,
title: '问答库', // 把 标准涉及项目 这几个字 改成 标准合规评估结果
menuId: ''
}
},
// 本地产品/项目库详情页
{
path: '/localProductDetail',