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

保存

上级 1aa1b839
流水线 #31168 已失败
因为 它太大了无法显示 源差异 。您可以改为 查看blob。
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</template> </template>
<template #actionAndDetails="{ row }"> <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> <Button @click="rowEdit(row)" type="primary" size="small" style="margin-left: 8px">编辑</Button>
<Poptip confirm transfer title="是否确认删除?" @on-ok="rowDelete(row)"> <Poptip confirm transfer title="是否确认删除?" @on-ok="rowDelete(row)">
<Button type="error" size="small" style="margin-left: 8px">删除</Button> <Button type="error" size="small" style="margin-left: 8px">删除</Button>
...@@ -51,42 +51,77 @@ ...@@ -51,42 +51,77 @@
@onSubmit="modalSubmit"> @onSubmit="modalSubmit">
</CEditModal> </CEditModal>
<!-- 管理员评价Modal --> <!-- 管理员评价Modal -->
<Modal <!-- <Modal-->
v-model="eltModalShow" <!-- v-model="eltModalShow"-->
:title="eltModalTitle" <!-- :title="eltModalTitle"-->
:transfer="false" <!-- :transfer="false"-->
:width="60" <!-- :width="60"-->
@on-cancel="eltModalShow = false"> <!-- @on-cancel="eltModalShow = false">-->
<!-- loading --> <!-- &lt;!&ndash; loading &ndash;&gt;-->
<Spin v-if="eltModalLoading" fix size="large"></Spin> <!-- <Spin v-if="eltModalLoading" fix size="large"></Spin>-->
<List v-if="eltTableData.length != 0" item-layout="vertical"> <!-- <List v-if="eltTableData.length != 0" item-layout="vertical">-->
<ListItem v-for="item in eltTableData" :key="item.id"> <!-- <ListItem v-for="item in eltTableData" :key="item.id">-->
<ListItemMeta <!-- <ListItemMeta-->
:description="`评价人:${item.evaluate_card}`" <!-- :description="`评价人:${item.evaluate_card}`"-->
:title="item.name"/> <!-- :title="item.name"/>-->
<p> <!-- <p>-->
<Rate <!-- <Rate-->
v-model="item.grade" <!-- v-model="item.grade"-->
allow-half <!-- allow-half-->
disabled <!-- disabled-->
icon="md-star"/> <!-- 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> </p>
<p>{{ item.content }}</p> </div>
<template #extra> </div>
<img </div>
v-for="file in item.file_list" <div style="height: 1px;background: #d3d6da;width: 100%"></div>
:key="file.id" </div>
:src="file.path" <div v-if="hfFlag" style=" background: white; width: 100%;height: 100px;display: flex;justify-content: space-between;align-items: center;position: sticky;bottom: 0;">
style="width: 200px" <Avatar icon="ios-person" />
@click="eltImgPreview(file)"> <Input style="width: 70%;" v-model="commonFormValidate.message" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="回复..."></Input>
</template> <Button type="primary" @click="handleCommonSubmit('hf');">回复</Button>
</ListItem> </div>
</List> </Drawer>
<p v-else style="text-align: center;">暂无评价</p>
<template #footer>
<Button @click="eltModalShow = false">关闭</Button>
</template>
</Modal>
</Card> </Card>
</div> </div>
</template> </template>
...@@ -111,6 +146,12 @@ export default { ...@@ -111,6 +146,12 @@ export default {
}, },
data(){ data(){
return { return {
hfFlag:false,
commonFormValidate:{
"community_id": "",
"parent_id": "",
"message": ""
},
// 搜索项 // 搜索项
searchCondList: [ searchCondList: [
{ id: 'name', name: '社区名称', type: 'input', show: true, optList: [] }, { id: 'name', name: '社区名称', type: 'input', show: true, optList: [] },
...@@ -128,7 +169,7 @@ export default { ...@@ -128,7 +169,7 @@ export default {
{ key: 'name', title: '社区名称', align: 'center', minWidth: 150, show: true }, { key: 'name', title: '社区名称', align: 'center', minWidth: 150, show: true },
{ key: 'building', title: '楼栋范围', align: 'center', minWidth: 180, show: true }, { key: 'building', title: '楼栋范围', align: 'center', minWidth: 180, show: true },
{ key: 'remark', 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, tableLoading: false,
...@@ -238,7 +279,154 @@ export default { ...@@ -238,7 +279,154 @@ export default {
this.getData() this.getData()
}, },
methods: { 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) { search(val) {
...@@ -288,10 +476,14 @@ export default { ...@@ -288,10 +476,14 @@ export default {
this.eltModalShow = true this.eltModalShow = true
this.eltModalLoading = true this.eltModalLoading = true
this.eltModalTitle = row.name + '的留言' this.eltModalTitle = row.name + '的留言'
this.commonFormValidate.community_id = row.id
this.commonFormValidate.name = row.name
this.asc.getApiCommunityGetCommentAll({community_id : row.id}).then(res => { this.asc.getApiCommunityGetCommentAll({community_id : row.id}).then(res => {
// console.log('查看评价结果', res) // console.log('查看评价结果', res)
if (res.code == 1) { if (res.code == 1) {
this.eltTableData = res.response this.eltTableData = this.limitToTwoLevels(res.response)
this.commonFormValidate.message = ''
this.hfFlag = false
} else { } else {
this.$Message.error(res.msg_detail) this.$Message.error(res.msg_detail)
} }
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
@onSubmit="search" @onSubmit="search"
@onReset="reset"></SearchCondForm> @onReset="reset"></SearchCondForm>
<Button disabled type="primary" class="ivu-ml-8"><Icon type="md-trash" />清空黑名单</Button>
<!-- 数据table --> <!-- 数据table -->
<CTable <CTable
...@@ -32,9 +31,11 @@ ...@@ -32,9 +31,11 @@
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<a @click="eltDetails(row)">评价</a> <Poptip confirm transfer title="是否确认?" @on-ok="approval('no',row)">
<Poptip confirm transfer title="是否确认删除?" @on-ok="rowDelete(row)"> <Button type="error" size="small" style="margin-left: 8px">不通过</Button>
<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> </Poptip>
</template> </template>
</CTable> </CTable>
...@@ -118,30 +119,24 @@ export default { ...@@ -118,30 +119,24 @@ export default {
return { return {
// 搜索项 // 搜索项
searchCondList: [ searchCondList: [
{ id: 'card_name', name: '卡号或姓名', type: 'input', show: true, optList: [] }, { id: 'send_name', name: '姓名', type: 'input', show: true, optList: [] },
{ id: 'begin_time', name: '开始时间', type: 'datetime', show: true, optList: [] }, { id: 'message', name: '留言内容', type: 'input', 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:'强制取消'}] },
], ],
// 搜索条件 // 搜索条件
params:{ params:{
page_index: 1, "send_name": "",
page_size: 10, "message": "",
card_name: "", "page_index": 1,
begin_time: "", "page_size": 10
end_time: "",
state: "",
}, },
tableColumns:[ tableColumns:[
{ type: 'index', title: '序号', align: 'center', width: 80, show: true, fixed: 'left' }, { type: 'index', title: '序号', align: 'center', width: 80, show: true, fixed: 'left' },
{ key: 'card', title: '卡号', align: 'center', minWidth: 120, show: true }, { key: 'send_card', title: '卡号', align: 'center', minWidth: 120, show: true },
{ key: 'name', title: '姓名', align: 'center', minWidth: 150, show: true }, { key: 'send_name', title: '姓名', align: 'center', minWidth: 150, show: true },
{ key: 'createtime', title: '开始时间', align: 'center', minWidth: 180, show: true }, { key: 'message', title: '内容', align: 'center', minWidth: 180, show: true },
{ key: 'end_time', title: '结束时间', align: 'center', minWidth: 180, show: true }, { key: 'createtime', title: '留言时间', align: 'center', minWidth: 180, show: true },
{ slot: 'state', title: '状态', align: 'center', minWidth: 150, show: true }, { slot: 'action', title: '操作', align: 'center', minWidth: 160, show: true, fixed: 'right' },
{ key: 'remark', title: '备注', align: 'center', minWidth: 200, show: true },
{ slot: 'action', title: '操作', align: 'center', minWidth: 120, show: true, fixed: 'right' },
], ],
tableLoading: false, tableLoading: false,
...@@ -151,7 +146,10 @@ export default { ...@@ -151,7 +146,10 @@ export default {
tableFullscreen: false, tableFullscreen: false,
dataCount: 0, dataCount: 0,
collapse: false, collapse: false,
defaultFormData: {
"comment_id": "",
"audit_status": 1,//-1 no 0await 1 yes
},
//#region 评价 //#region 评价
// 评价Modal // 评价Modal
eltModalShow: false, eltModalShow: false,
...@@ -229,6 +227,35 @@ export default { ...@@ -229,6 +227,35 @@ export default {
this.getData() this.getData()
}, },
methods: { 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) { search(val) {
Object.keys(val).forEach(a => { Object.keys(val).forEach(a => {
...@@ -250,7 +277,7 @@ export default { ...@@ -250,7 +277,7 @@ export default {
// 查询列表 // 查询列表
getData(){ getData(){
this.tableLoading = true this.tableLoading = true
this.asc.postApiEvaluateGetBlacklist(this.params).then(res => { this.asc.postApiCommunityGetCommentAuditList(this.params).then(res => {
// console.log('查询数据', res) // console.log('查询数据', res)
this.tableData = res.response.data this.tableData = res.response.data
this.dataCount = res.response.data_count this.dataCount = res.response.data_count
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或