学习问答

This commit is contained in:
liuye
2023-01-10 10:40:01 +08:00
parent 5aa5438dd6
commit a63e704b1e
3 changed files with 38 additions and 50 deletions

View File

@@ -28,7 +28,7 @@ export default {
},
data() {
return {
component: "Detail",
component: "List",
params: {},
include: []
};
@@ -40,7 +40,7 @@ export default {
this.params = data.params;
}
if (data.type === "list") {
if (data.type === "List") {
this.component = "List";
this.params = data.params;

View File

@@ -6,29 +6,19 @@
</template>
<template slot="content">
<ai-card title="基层治理需要关注什么?">
<div slot="right" class="right-text">汪周文发布于2023-01-09 <span>已有15个回答</span></div>
<div slot="right" class="right-text">{{info.createUserName}}发布于{{info.createTime}} <span>已有{{info.answerCount}}个回答</span></div>
<template #content>
<div class="item">
<div class="item" v-for="(item, index) in info.answers" :key="index">
<div class="flex">
<img src="https://img0.baidu.com/it/u=1705694933,4002952892&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=281" alt="">
<img :src="item.createUserAvatar" alt="">
<div class="user-info">
<h3>汪周文</h3>
<p>中卫慧通-产品部</p>
<h3>{{item.createUserName}}</h3>
<p>{{item.createUserDeptName}}</p>
</div>
</div>
<div class="content">123</div>
<p class="time"><span>发布于 </span>2023-01-09 16:27</p>
</div>
<div class="item">
<div class="flex">
<img src="https://img0.baidu.com/it/u=1705694933,4002952892&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=281" alt="">
<div class="user-info">
<h3>汪周文</h3>
<p>中卫慧通-产品部</p>
</div>
</div>
<div class="content">123</div>
<p class="time"><span>发布于 </span>2023-01-09 16:27</p>
<div class="content" v-html="item.content"></div>
<ai-uploader :instance="instance" disabled v-model="item.files"></ai-uploader>
<p class="time"><span>发布于 </span>{{item.createTime}}</p>
</div>
</template>
</ai-card>
@@ -39,37 +29,29 @@
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
info: {}
}
},
created () {
this.getInfo()
},
methods: {
getInfo () {
// this.instance.post(`/app/appvideovoteconfig/queryDetailByCorpId`).then(res => {
// if (res.code == 0) {
// if (res.data) {
// this.id = res.data.id
// this.form = {
// ...res.data
// }
// }
// }
// })
this.instance.post(`/app/applearningquestion/queryDetailById?id=${this.params.id}`).then(res => {
if (res.code == 0) {
if (res.data) {
this.info = {...res.data}
}
}
})
},
cancel () {
this.$emit('change', {
type: 'List',
@@ -115,6 +97,13 @@
.time {
margin-bottom: 16px;
}
.img-list {
img {
width: 300px;
height: 300px;
margin: 0 8px 8px 0;
}
}
}
.item:nth-last-of-type(1) {
border-bottom: 0;

View File

@@ -6,11 +6,12 @@
<template slot="content">
<ai-table class="ai-table" :tableData="tableData" :col-configs="colConfigs" :total="page.total"
:current.sync="page.current" :size.sync="page.size" @getList="getList" :dict="dict">
<el-table-column slot="index" type="index" width="100px" label="序号" align="center"></el-table-column>
<el-table-column slot="options" label="操作" align="center" fixed="right" width="200">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="add(row.id)">详情</el-button>
<el-button type="text" @click="toDelete(row.id)">删除</el-button>
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
<el-button type="text" @click="del(row.id)">删除</el-button>
</div>
</template>
</el-table-column>
@@ -26,11 +27,11 @@ export default {
return {
tableData: [],
colConfigs: [
{ prop: "name", label: "序号" },
{ prop: "companyCategory", label: "问题", dict: "twoNewOrgCompanyCategory"},
{ prop: "companyPhone", label: "提问人员" },
{ prop: "administratorName", label: "提问时间" },
{ prop: "administratorPhone", label: "回答数" },
{ slot: 'index', label: '序号'},
{ prop: "content", label: "问题"},
{ prop: "createUserName", label: "提问人员" },
{ prop: "createTime", label: "提问时间" },
{ prop: "answerCount", label: "回答数" },
{ slot: "options" },
],
page: {
@@ -53,11 +54,9 @@ export default {
},
methods: {
getList() {
this.instance.post(`/app/apptwoneworganization/list`, null, {
this.instance.post(`/app/applearningquestion/list`, null, {
params: {
...this.page,
...this.search,
bizType: 0
}
}).then(res => {
if (res.code == 0) {
@@ -66,17 +65,17 @@ export default {
}
})
},
add(id) {
toDetail(id) {
this.$emit("change", {
type: "Add",
type: "Detail",
params: {
id: id || ""
}
})
},
toDelete(id) {
del(id) {
this.$confirm("删除后不可恢复,确定删除该数据?").then(() => {
this.instance.post(`/app/apptwoneworganization/delete?ids=${id}`).then(res => {
this.instance.post(`/app/applearningquestion/deleteQuestion?id=${id}`).then(res => {
if (res.code == 0) {
this.$message.success("删除成功!");
this.getList();