学习问答

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

View File

@@ -6,29 +6,19 @@
</template> </template>
<template slot="content"> <template slot="content">
<ai-card title="基层治理需要关注什么?"> <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> <template #content>
<div class="item"> <div class="item" v-for="(item, index) in info.answers" :key="index">
<div class="flex"> <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"> <div class="user-info">
<h3>汪周文</h3> <h3>{{item.createUserName}}</h3>
<p>中卫慧通-产品部</p> <p>{{item.createUserDeptName}}</p>
</div> </div>
</div> </div>
<div class="content">123</div> <div class="content" v-html="item.content"></div>
<p class="time"><span>发布于 </span>2023-01-09 16:27</p> <ai-uploader :instance="instance" disabled v-model="item.files"></ai-uploader>
</div> <p class="time"><span>发布于 </span>{{item.createTime}}</p>
<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> </div>
</template> </template>
</ai-card> </ai-card>
@@ -39,37 +29,29 @@
<script> <script>
export default { export default {
name: 'Detail', name: 'Detail',
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
params: Object params: Object
}, },
data () { data () {
return { return {
info: {}
} }
}, },
created () { created () {
this.getInfo() this.getInfo()
}, },
methods: { methods: {
getInfo () { getInfo () {
// this.instance.post(`/app/appvideovoteconfig/queryDetailByCorpId`).then(res => { this.instance.post(`/app/applearningquestion/queryDetailById?id=${this.params.id}`).then(res => {
// if (res.code == 0) { if (res.code == 0) {
// if (res.data) { if (res.data) {
// this.id = res.data.id this.info = {...res.data}
// this.form = { }
// ...res.data }
// } })
// }
// }
// })
}, },
cancel () { cancel () {
this.$emit('change', { this.$emit('change', {
type: 'List', type: 'List',
@@ -115,6 +97,13 @@
.time { .time {
margin-bottom: 16px; margin-bottom: 16px;
} }
.img-list {
img {
width: 300px;
height: 300px;
margin: 0 8px 8px 0;
}
}
} }
.item:nth-last-of-type(1) { .item:nth-last-of-type(1) {
border-bottom: 0; border-bottom: 0;

View File

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