Merge remote-tracking branch 'origin/build' into build

This commit is contained in:
aixianling
2023-01-09 17:28:41 +08:00
4 changed files with 288 additions and 12 deletions

View File

@@ -0,0 +1,63 @@
<template>
<div class="AppLearning">
<keep-alive :include="['List']">
<component
ref="component"
:is="component"
@change="onChange"
:params="params"
:instance="instance"
:dict="dict"
></component>
</keep-alive>
</div>
</template>
<script>
import List from "./components/List";
import Detail from "./components/Detail";
export default {
label: "学习问答",
name: "AppLearning",
components: { Detail, List },
props: {
instance: Function,
dict: Object,
permissions: Function
},
data() {
return {
component: "Detail",
params: {},
include: []
};
},
methods: {
onChange(data) {
if (data.type === "Detail") {
this.component = "Detail";
this.params = data.params;
}
if (data.type === "list") {
this.component = "List";
this.params = data.params;
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList();
}
});
}
}
}
};
</script>
<style scoped lang="scss">
.AppLearning {
width: 100%;
height: 100%;
}
</style>

View File

@@ -0,0 +1,123 @@
<template>
<ai-detail>
<template slot="title">
<ai-title title="返回学习回答列表" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基层治理需要关注什么?">
<div slot="right" class="right-text">汪周文发布于2023-01-09 <span>已有15个回答</span></div>
<template #content>
<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 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>
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
}
},
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
// }
// }
// }
// })
},
cancel () {
this.$emit('change', {
type: 'List',
isRefresh: true
})
}
}
}
</script>
<style scoped lang="scss">
.right-text {
color: #999!important;
span {
margin-left: 8px;
}
}
.item {
margin-bottom: 32px;
border-bottom: 1px solid #eee;
.flex {
display: flex;
img {
width: 80px;
height: 80px;
margin-right: 16px;
}
h3 {
line-height: 40px;
font-size: 30px;
font-weight: 700;
margin-bottom: 10px;
}
}
.content {
margin: 16px 0;
}
p {
line-height: 30px;
color: #999;
font-size: 14px;
}
.time {
margin-bottom: 16px;
}
}
.item:nth-last-of-type(1) {
border-bottom: 0;
margin-bottom: 0;
}
</style>

View File

@@ -0,0 +1,102 @@
<template>
<ai-list class="list">
<template slot="title">
<ai-title title="学习问答" isShowBottomBorder></ai-title>
</template>
<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="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>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</template>
<script>
export default {
name: "List",
props: { instance: Function, dict: Object, params: Object },
data() {
return {
tableData: [],
colConfigs: [
{ prop: "name", label: "序号" },
{ prop: "companyCategory", label: "问题", dict: "twoNewOrgCompanyCategory"},
{ prop: "companyPhone", label: "提问人员" },
{ prop: "administratorName", label: "提问时间" },
{ prop: "administratorPhone", label: "回答数" },
{ slot: "options" },
],
page: {
size: 10,
current: 1,
total: 0
},
search: {
name: "",
companyCategory: "",
concernDegree: ""
},
id: ""
};
},
created() {
this.dict.load("twoNewOrgCompanyCategory", "twoNewOrgConcernDegree").then(() => {
this.getList()
})
},
methods: {
getList() {
this.instance.post(`/app/apptwoneworganization/list`, null, {
params: {
...this.page,
...this.search,
bizType: 0
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.page.total = res.data.total
}
})
},
add(id) {
this.$emit("change", {
type: "Add",
params: {
id: id || ""
}
})
},
toDelete(id) {
this.$confirm("删除后不可恢复,确定删除该数据?").then(() => {
this.instance.post(`/app/apptwoneworganization/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success("删除成功!");
this.getList();
}
})
})
},
reset() {
Object.keys(this.search).forEach(e => {
this.search[e] = ""
})
this.getList()
}
}
};
</script>
<style scoped lang="scss">
.list {
height: 100%;
overflow: auto;
}
</style>

View File

@@ -20,7 +20,6 @@ import Add from "./components/Add";
export default {
label: "新经济组织管理",
name: "AppNewEconomics",
// 组件
components: { Add, List },
props: {
instance: Function,
@@ -34,17 +33,6 @@ export default {
include: []
};
},
// 计算
computed: {},
// 监听
watch: {},
// 实例创建后
created() {},
// 实例创建后
onShow() {},
// 实例渲染后
mounted() {},
// 方法
methods: {
onChange(data) {
if (data.type === "Add") {