提交 0312dfb3 编写于 作者: 刘英杰's avatar 刘英杰

保存

上级 1aa1b839
流水线 #31168 已失败
因为 它太大了无法显示 源差异 。您可以改为 查看blob。
......@@ -31,7 +31,7 @@
</template>
<template #actionAndDetails="{ row }">
<a @click="eltDetails(row)">查看留言</a>
<a @click="eltDetails(row);">查看留言</a>
<Button @click="rowEdit(row)" type="primary" size="small" style="margin-left: 8px">编辑</Button>
<Poptip confirm transfer title="是否确认删除?" @on-ok="rowDelete(row)">
<Button type="error" size="small" style="margin-left: 8px">删除</Button>
......@@ -51,42 +51,77 @@
@onSubmit="modalSubmit">
</CEditModal>
<!-- 管理员评价Modal -->
<Modal
v-model="eltModalShow"
:title="eltModalTitle"
:transfer="false"
:width="60"
@on-cancel="eltModalShow = false">
<!-- loading -->
<Spin v-if="eltModalLoading" fix size="large"></Spin>
<List v-if="eltTableData.length != 0" item-layout="vertical">
<ListItem v-for="item in eltTableData" :key="item.id">
<ListItemMeta
:description="`评价人:${item.evaluate_card}`"
:title="item.name"/>
<p>
<Rate
v-model="item.grade"
allow-half
disabled
icon="md-star"/>
</p>
<p>{{ item.content }}</p>
<template #extra>
<img
v-for="file in item.file_list"
:key="file.id"
:src="file.path"
style="width: 200px"
@click="eltImgPreview(file)">
</template>
</ListItem>
</List>
<p v-else style="text-align: center;">暂无评价</p>
<template #footer>
<Button @click="eltModalShow = false">关闭</Button>
</template>
</Modal>
<!-- <Modal-->
<!-- v-model="eltModalShow"-->
<!-- :title="eltModalTitle"-->
<!-- :transfer="false"-->
<!-- :width="60"-->
<!-- @on-cancel="eltModalShow = false">-->
<!-- &lt;!&ndash; loading &ndash;&gt;-->
<!-- <Spin v-if="eltModalLoading" fix size="large"></Spin>-->
<!-- <List v-if="eltTableData.length != 0" item-layout="vertical">-->
<!-- <ListItem v-for="item in eltTableData" :key="item.id">-->
<!-- <ListItemMeta-->
<!-- :description="`评价人:${item.evaluate_card}`"-->
<!-- :title="item.name"/>-->
<!-- <p>-->
<!-- <Rate-->
<!-- v-model="item.grade"-->
<!-- allow-half-->
<!-- disabled-->
<!-- icon="md-star"/>-->
<!-- </p>-->
<!-- <p>{{ item.content }}</p>-->
<!-- <template #extra>-->
<!-- <img-->
<!-- v-for="file in item.file_list"-->
<!-- :key="file.id"-->
<!-- :src="file.path"-->
<!-- style="width: 200px"-->
<!-- @click="eltImgPreview(file)">-->
<!-- </template>-->
<!-- </ListItem>-->
<!-- </List>-->
<!-- <p v-else style="text-align: center;">暂无评价</p>-->
<!-- <template #footer>-->
<!-- <Button @click="eltModalShow = false">关闭</Button>-->
<!-- </template>-->
<!-- </Modal>-->
<Drawer :closable="false" width="640" :styles="{paddingBottom:0 }" v-model="eltModalShow">
<div v-if="!hfFlag" style="width: 100%;height: 100px;display: flex;justify-content: space-between;align-items: center;">
<Avatar icon="ios-person" />
<Input style="width: 70%;" v-model="commonFormValidate.message" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="留言..."></Input>
<Button type="primary" @click="handleCommonSubmit('ly')">留言</Button>
</div>
<div v-for="(item,index) in eltTableData" :key="index" style="width: 100%;min-height: 80px; margin: 10px 0; display: flex;align-items: center;flex-wrap: wrap">
<div style="width: 10%;height:50% ;margin-bottom: auto;">
<Avatar icon="ios-person" />
</div>
<div style="width: 90%;height:100%;">
<h3>{{item.send_name}}</h3>
<p>{{item.message}}</p>
<p style="margin-bottom: 15px">{{item.createtime}}<span @click="hfFlag =true;commonFormValidate.parent_id = item.id" style="color: #1e93ff;margin-left: 20px;cursor: pointer">回复</span></p>
<div v-for="(ite,inde) in item.children" :key="inde" style="width: 100%;min-height: 50px;display: flex">
<div style="width: 10%;height:100% ">
<Avatar icon="ios-person" />
</div>
<div style="width: 80%;min-height:100%;">
<p>{{ite.send_name}}:<span>{{ite.message}}</span></p>
<p></p>
<p>{{ite.createtime}}
<!-- <span @click="hfFlag =true;commonFormValidate.parent_id = ite.id" style="color: #1e93ff;margin-left: 20px;cursor: pointer">回复</span>-->
</p>
</div>
</div>
</div>
<div style="height: 1px;background: #d3d6da;width: 100%"></div>
</div>
<div v-if="hfFlag" style=" background: white; width: 100%;height: 100px;display: flex;justify-content: space-between;align-items: center;position: sticky;bottom: 0;">
<Avatar icon="ios-person" />
<Input style="width: 70%;" v-model="commonFormValidate.message" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="回复..."></Input>
<Button type="primary" @click="handleCommonSubmit('hf');">回复</Button>
</div>
</Drawer>
</Card>
</div>
</template>
......@@ -111,6 +146,12 @@ export default {
},
data(){
return {
hfFlag:false,
commonFormValidate:{
"community_id": "",
"parent_id": "",
"message": ""
},
// 搜索项
searchCondList: [
{ id: 'name', name: '社区名称', type: 'input', show: true, optList: [] },
......@@ -128,7 +169,7 @@ export default {
{ key: 'name', title: '社区名称', align: 'center', minWidth: 150, show: true },
{ key: 'building', title: '楼栋范围', align: 'center', minWidth: 180, show: true },
{ key: 'remark', title: '备注', align: 'center', minWidth: 180, show: true },
{ slot: 'actionAndDetails', title: '操作', align: 'center', minWidth: 120, show: true, fixed: 'right' },
{ slot: 'actionAndDetails', title: '操作', align: 'center', minWidth: 180, show: true, fixed: 'right' },
],
tableLoading: false,
......@@ -238,7 +279,154 @@ export default {
this.getData()
},
methods: {
handleCommonSubmit(key,row){
//留言/回复
const strategy = {
'ly':()=>{
this.hooks.myEncapsulationFunction(() => {
return this.asc.postApiCommunityUserComment({...this.commonFormValidate,
"parent_id": "",}).then(res => {
this.eltDetails({...this.commonFormValidate,id:this.commonFormValidate.community_id})
return res;
});
})
},
'hf':()=>{
this.hooks.myEncapsulationFunction(() => {
return this.asc.postApiCommunityUserComment({...this.commonFormValidate}).then(res => {
this.eltDetails({...this.commonFormValidate,id:this.commonFormValidate.community_id})
return res;
});
})
},
}
strategy[key]()
},
limitToTwoLevels(data = [
{
"children": [
{
"children": [
{
"children": [
{
"children": [ {
"children": [ {
"children": [],
"id": "1859154053657923584",
"community_id": "1859079239752617984",
"parent_id": "1859153733976461312",
"send_card": "asc666",
"send_name": "asc666",
"message": "我觉得不OK",
"createtime": "2024-11-20 16:37"
}],
"id": "1859154053657923584",
"community_id": "1859079239752617984",
"parent_id": "1859153733976461312",
"send_card": "asc666",
"send_name": "asc666",
"message": "我觉得不OK",
"createtime": "2024-11-20 16:37"
}
],
"id": "1859154053657923584",
"community_id": "1859079239752617984",
"parent_id": "1859153733976461312",
"send_card": "asc666",
"send_name": "asc666",
"message": "我觉得不OK",
"createtime": "2024-11-20 16:37"
}
],
"id": "1859154053657923584",
"community_id": "1859079239752617984",
"parent_id": "1859153733976461312",
"send_card": "asc666",
"send_name": "asc666",
"message": "我觉得不OK",
"createtime": "2024-11-20 16:37"
}
],
"id": "1859154053657923584",
"community_id": "1859079239752617984",
"parent_id": "1859153733976461312",
"send_card": "asc666",
"send_name": "asc666",
"message": "我觉得不OK",
"createtime": "2024-11-20 16:37"
}
],
"id": "1859153733976461312",
"community_id": "1859079239752617984",
"parent_id": "",
"send_card": "asc666",
"send_name": "asc666",
"message": "不错不错好极了",
"createtime": "2024-11-20 16:36"
},
{
"children": [
{
"children": [
{
"children": [],
"id": "1859154053657923584",
"community_id": "1859079239752617984",
"parent_id": "1859153733976461312",
"send_card": "asc666",
"send_name": "asc666",
"message": "我觉得不OK",
"createtime": "2024-11-20 16:37"
}],
"id": "1859154053657923584",
"community_id": "1859079239752617984",
"parent_id": "1859153733976461312",
"send_card": "asc666",
"send_name": "asc666",
"message": "我觉得不OK",
"createtime": "2024-11-20 16:37"
}
],
"id": "1859153733976461312",
"community_id": "1859079239752617984",
"parent_id": "",
"send_card": "asc666",
"send_name": "asc666",
"message": "不错不错好极了",
"createtime": "2024-11-20 16:36"
}
]) {
//便利留言数据为二层
return data.map(item => {
let flattenedChildren = []; // 用来存储二层的所有子节点
function processChildren(children, isSecondLevel) {
children.forEach(child => {
if (isSecondLevel || (child.children && child.children.length > 0)) {
// 如果是第二层节点或有更深层级的子节点,则将其直接添加到 flattenedChildren
flattenedChildren.push({ ...child, children: [] });
// 如果有更深层的子节点,继续递归处理它们
if (child.children && child.children.length > 0) {
processChildren(child.children, true); // 深层子节点标记为第二层
}
} else {
// 如果是第二层以下且没有子节点,直接添加
flattenedChildren.push(child);
}
});
}
// 如果有子节点,处理第一层的子节点
if (item.children && item.children.length > 0) {
processChildren(item.children, false);
}
// 将所有平移后的子节点赋值为根节点的 children
return { ...item, children: flattenedChildren };
});
},
// 搜索
search(val) {
......@@ -288,10 +476,14 @@ export default {
this.eltModalShow = true
this.eltModalLoading = true
this.eltModalTitle = row.name + '的留言'
this.commonFormValidate.community_id = row.id
this.commonFormValidate.name = row.name
this.asc.getApiCommunityGetCommentAll({community_id : row.id}).then(res => {
// console.log('查看评价结果', res)
if (res.code == 1) {
this.eltTableData = res.response
this.eltTableData = this.limitToTwoLevels(res.response)
this.commonFormValidate.message = ''
this.hfFlag = false
} else {
this.$Message.error(res.msg_detail)
}
......
......@@ -9,7 +9,6 @@
@onSubmit="search"
@onReset="reset"></SearchCondForm>
<Button disabled type="primary" class="ivu-ml-8"><Icon type="md-trash" />清空黑名单</Button>
<!-- 数据table -->
<CTable
......@@ -32,9 +31,11 @@
</template>
<template #action="{ row }">
<a @click="eltDetails(row)">评价</a>
<Poptip confirm transfer title="是否确认删除?" @on-ok="rowDelete(row)">
<Button type="error" size="small" style="margin-left: 8px">删除</Button>
<Poptip confirm transfer title="是否确认?" @on-ok="approval('no',row)">
<Button type="error" size="small" style="margin-left: 8px">不通过</Button>
</Poptip>
<Poptip confirm transfer title="是否确认?" @on-ok="approval('yes',row)">
<Button type="primary" size="small" style="margin-left: 8px">通过</Button>
</Poptip>
</template>
</CTable>
......@@ -118,30 +119,24 @@ export default {
return {
// 搜索项
searchCondList: [
{ id: 'card_name', name: '卡号或姓名', type: 'input', show: true, optList: [] },
{ id: 'begin_time', name: '开始时间', type: 'datetime', show: true, optList: [] },
{ id: 'end_time', name: '结束时间', type: 'datetime', show: true, optList: [] },
{ id: 'state', name: '状态', type: 'select', show: true, optList: [{value:"0",label:'过期'},{value:"1",label:'生效'},{value:"2",label:'强制取消'}] },
{ id: 'send_name', name: '姓名', type: 'input', show: true, optList: [] },
{ id: 'message', name: '留言内容', type: 'input', show: true, optList: [] },
],
// 搜索条件
params:{
page_index: 1,
page_size: 10,
card_name: "",
begin_time: "",
end_time: "",
state: "",
"send_name": "",
"message": "",
"page_index": 1,
"page_size": 10
},
tableColumns:[
{ type: 'index', title: '序号', align: 'center', width: 80, show: true, fixed: 'left' },
{ key: 'card', title: '卡号', align: 'center', minWidth: 120, show: true },
{ key: 'name', title: '姓名', align: 'center', minWidth: 150, show: true },
{ key: 'createtime', title: '开始时间', align: 'center', minWidth: 180, show: true },
{ key: 'end_time', title: '结束时间', align: 'center', minWidth: 180, show: true },
{ slot: 'state', title: '状态', align: 'center', minWidth: 150, show: true },
{ key: 'remark', title: '备注', align: 'center', minWidth: 200, show: true },
{ slot: 'action', title: '操作', align: 'center', minWidth: 120, show: true, fixed: 'right' },
{ key: 'send_card', title: '卡号', align: 'center', minWidth: 120, show: true },
{ key: 'send_name', title: '姓名', align: 'center', minWidth: 150, show: true },
{ key: 'message', title: '内容', align: 'center', minWidth: 180, show: true },
{ key: 'createtime', title: '留言时间', align: 'center', minWidth: 180, show: true },
{ slot: 'action', title: '操作', align: 'center', minWidth: 160, show: true, fixed: 'right' },
],
tableLoading: false,
......@@ -151,7 +146,10 @@ export default {
tableFullscreen: false,
dataCount: 0,
collapse: false,
defaultFormData: {
"comment_id": "",
"audit_status": 1,//-1 no 0await 1 yes
},
//#region 评价
// 评价Modal
eltModalShow: false,
......@@ -229,6 +227,35 @@ export default {
this.getData()
},
methods: {
approval(key,row){
///审核
const strategy = {
'yes':()=>{
this.hooks.myEncapsulationFunction(() => {
return this.asc.getApiCommunityCommentAudit({
comment_id:row.id,
audit_status:1
}).then(res => {
this.getData()
return res;
});
})
},
'no':()=>{
this.hooks.myEncapsulationFunction(() => {
return this.asc.getApiCommunityCommentAudit({
comment_id:row.id,
audit_status:'-1'
}).then(res => {
this.getData()
return res;
});
})
},
}
strategy[key]()
},
// 搜索
search(val) {
Object.keys(val).forEach(a => {
......@@ -250,7 +277,7 @@ export default {
// 查询列表
getData(){
this.tableLoading = true
this.asc.postApiEvaluateGetBlacklist(this.params).then(res => {
this.asc.postApiCommunityGetCommentAuditList(this.params).then(res => {
// console.log('查询数据', res)
this.tableData = res.response.data
this.dataCount = res.response.data_count
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或