评论管理

This commit is contained in:
ChenXinXin committed 2024-05-21 13:40:42 +08:00
1 parent 1f99dcd134
commit 6aadef58bf
6 files changed
+293 -11

No files matched your search

+49 -1
View File
@@ -159,6 +159,31 @@
</v-col>
</v-row>
<!-- 评论列表 -->
<v-row class="mt-4" v-if="isSubmitDrawerShown" >
<v-col cols="12" sm="12" md="12">
<div class="text-subtitle-2 mb-2 mx-4 font-weight-bold">
评论列表
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon
color="grey"
dark
v-bind="attrs"
v-on="on"
small
>
mdi-alert-circle-outline
</v-icon>
</template>
<span>如果是审批单申请人添加的备注,就只给当前审批人发送(已经通过审批人的不会收到提醒);
如果是已经审批了的审批人添加的备注,就给其他当前节点未审批的审批人和申请人发送消息提醒。</span>
</v-tooltip>
</div>
<task-comment-list :comments.sync="updateItem.taskCommentList" @confirm="doUiAction('postComment')" />
</v-col>
</v-row>
<!--抽屉关闭按钮-->
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
@click="isSubmitDrawerShown = false">
@@ -201,6 +226,8 @@
{% include 'component/tpl/formComponentList.html' %}
{% include 'component/taskHistory.html' %}
{% include 'common/jianghuJs/fixedTableHeightV4.html' %}
{% include 'component/taskCommentList.html' %}
<!-- <<<<<<<<<<<<< 加载页面组件 -->
<script type="module">
@@ -299,6 +326,11 @@
this.getTableData();
this.getTaskHistoryData();
break;
case 'postComment':
await this.doPostComment();
this.getTableData();
this.getTaskHistoryData();
break;
default:
console.error("[doUiAction] uiActionId not find", { uiActionId });
break;
@@ -351,7 +383,7 @@
this.updateItem.taskInfo = JSON.parse(funObj.taskInfo);
this.updateItem.taskWorkflow = JSON.parse(funObj.taskWorkflow);
this.updateItem.taskFormInput = JSON.parse(funObj.taskFormInput);
this.updateItem.taskComment = ''; // 备注
this.updateItem.taskCommentList = funObj.taskCommentList && JSON.parse(funObj.taskCommentList) || [];
},
async getTaskWorkflow({ taskId }){
@@ -408,6 +440,22 @@
this.updateItemId = null;
},
// ---------- <<<<<<<<<<< 审核、查看 uiAction --------
// ---------- 保存评论 uiAction >>>>>>>>>>>> --------
async doPostComment() {
const { taskId, taskCommentList, taskInitUser, taskEditUserList,...data } = this.updateItem
await window.jianghuAxios({
data: {
appData: {
pageId: 'approvalManagement',
actionId: 'updateComment',
actionData: { taskCommentList, taskInitUser, taskEditUserList },
where: { taskId },
}
}
})
},
// ---------- 保存评论 uiAction >>>>>>>>>>>> --------
}
})
</script>
+48
View File
@@ -122,6 +122,31 @@
</v-col>
</v-row>
<!-- 评论列表 -->
<v-row class="mt-4" v-if="isViewDrawerShown" >
<v-col cols="12" sm="12" md="12">
<div class="text-subtitle-2 mb-2 mx-4 font-weight-bold">
评论列表
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon
color="grey"
dark
v-bind="attrs"
v-on="on"
small
>
mdi-alert-circle-outline
</v-icon>
</template>
<span>如果是审批单申请人添加的备注,就只给当前审批人发送(已经通过审批人的不会收到提醒);
如果是已经审批了的审批人添加的备注,就给其他当前节点未审批的审批人和申请人发送消息提醒。</span>
</v-tooltip>
</div>
<task-comment-list :comments.sync="viewItem.taskCommentList" @confirm="doUiAction('postComment')" />
</v-col>
</v-row>
<!--抽屉关闭按钮-->
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
@click="isViewDrawerShown = false">
@@ -163,6 +188,8 @@
{% include 'component/tpl/formComponentList.html' %}
{% include 'component/taskHistory.html' %}
{% include 'common/jianghuJs/fixedTableHeightV4.html' %}
{% include 'component/taskCommentList.html' %}
<!-- <<<<<<<<<<<<< 加载页面组件 -->
<script type="module">
@@ -239,6 +266,10 @@
await this.doAmendTask(uiActionData);
await this.getTableData();
break;
case 'postComment':
await this.doPostComment();
await this.getTableData();
break;
default:
console.error("[doUiAction] uiActionId not find", { uiActionId });
break;
@@ -282,6 +313,7 @@
// ---------- 查看 uiAction >>>>>>>>>>>> --------
async prepareViewItemData(funObj) {
this.viewItem = _.cloneDeep(funObj);
this.viewItem.taskCommentList = this.viewItem.taskCommentList && JSON.parse(this.viewItem.taskCommentList) || []
},
async getTaskWorkflow({ taskId }){
@@ -348,6 +380,22 @@
await window.vtoast.success("修改数据成功");
},
// ---------- 修正 uiAction >>>>>>>>>>>> --------
// ---------- 保存评论 uiAction >>>>>>>>>>>> --------
async doPostComment() {
const { taskId, taskCommentList, taskInitUser, taskEditUserList,...data } = this.viewItem
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'updateComment',
actionData: { taskCommentList, taskInitUser, taskEditUserList },
where: { taskId },
}
}
})
},
// ---------- 保存评论 uiAction >>>>>>>>>>>> --------
}
})
</script>