评论功能开发
This commit is contained in:
parent
90b374c684
commit
f21946644d
|
@ -0,0 +1,114 @@
|
|||
<template>
|
||||
<div class="wrapper">
|
||||
<div>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmitHandle()"
|
||||
:label-width="$i18n.locale === 'en-US' ? '120px' : 'auto'"
|
||||
>
|
||||
<el-form-item label="评论内容">
|
||||
<el-input
|
||||
v-model="dataForm.comment"
|
||||
:disabled="fieldDisabled"
|
||||
placeholder="评论内容"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- 流程综合组件 -->
|
||||
<ren-process-multiple
|
||||
v-if="processVisible"
|
||||
updateInstanceIdUrl="/processForm/tabilityapplication/updateInstanceId"
|
||||
saveFormUrl="/processForm/tabilityapplication"
|
||||
dataFormName="dataForm"
|
||||
ref="renProcessMultiple"
|
||||
></ren-process-multiple>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import processModule from '@/mixins/process-module'
|
||||
export default {
|
||||
// 注入公共方法
|
||||
mixins: [processModule],
|
||||
components: {},
|
||||
props: {
|
||||
// fromList: {
|
||||
// // type: Array,
|
||||
// // default: () => {
|
||||
// // return []
|
||||
// // }
|
||||
// }
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
// processVisible: true,
|
||||
visible: false,
|
||||
// 表单属性是否可编辑
|
||||
fieldDisabled: false,
|
||||
dataForm: [],
|
||||
id: '',
|
||||
shifoushizujian: true
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
computed: {},
|
||||
methods: {
|
||||
init () {
|
||||
this.visible = true
|
||||
// this.getInfo(this.$router.currentRoute.params.params.params.resourceDTO.id)
|
||||
// this.dataForm = this.$router.currentRoute.params.params.params.resourceDTO
|
||||
// this.id=this.$router.currentRoute
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dataForm.resetFields()
|
||||
// if (this.dataForm.id) {
|
||||
// 如业务KEY已存在,不允许编辑
|
||||
this.fieldDisabled = true
|
||||
// this.id = this.$router.currentRoute.businessKey
|
||||
this.getInfo(this.$router.currentRoute.params.businessKey)
|
||||
console.log('id', this.$router.currentRoute.params.businessKey)
|
||||
// }
|
||||
})
|
||||
},
|
||||
getInfo (id) {
|
||||
this.$http.get('/resourceMountApply/' + id).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.dataForm = res.data.resourceDTO
|
||||
if (this.dataForm.type != '应用资源') {
|
||||
this.shifoushizujian = false
|
||||
} else {
|
||||
this.shifoushizujian = true
|
||||
}
|
||||
console.log('this.dataForm', this.dataForm)
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
// this.dataForm = this.$router.currentRoute.params.id
|
||||
this.init()
|
||||
console.log('fromList', this.$router.currentRoute.params.businessKey)
|
||||
// this.dataForm = this.$router.currentRoute.params.params.params.resourceDTO
|
||||
var callbacks = {
|
||||
startProcessSuccessCallback: this.closeCurrentTab,
|
||||
startProcessErrorCallback: this.startProcessErrorCallback,
|
||||
taskHandleSuccessCallback: this.closeCurrentTab,
|
||||
taskHandleErrorCallback: this.taskHandleErrorCallback,
|
||||
formSaveSuccessCallback: null,
|
||||
formSaveErrorCallback: null
|
||||
}
|
||||
// 初始化综合组件
|
||||
this.initProcessMultiple(callbacks)
|
||||
},
|
||||
mounted () {}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.kuandukuandukuandu{
|
||||
max-width:1500px;
|
||||
}
|
||||
.wrapper {
|
||||
}
|
||||
</style>
|
|
@ -2,7 +2,7 @@
|
|||
* @Author: hisense.wuhongjian
|
||||
* @Date: 2022-04-27 19:34:30
|
||||
* @LastEditors: hisense.wuhongjian
|
||||
* @LastEditTime: 2022-04-28 19:26:07
|
||||
* @LastEditTime: 2022-06-23 21:08:01
|
||||
* @Description: 告诉大家这是什么
|
||||
-->
|
||||
<template>
|
||||
|
@ -46,7 +46,8 @@
|
|||
(scope.row.params && scope.row.params.user) ||
|
||||
(scope.row.params && scope.row.params.applyUserName) ||
|
||||
(scope.row.params && scope.row.params.userName) ||
|
||||
(scope.row.params && scope.row.params.undercarriageUserName)
|
||||
(scope.row.params && scope.row.params.undercarriageUserName)||
|
||||
(scope.row.params && scope.row.params.name)
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -62,7 +63,8 @@
|
|||
(scope.row.params &&
|
||||
scope.row.params.resourceDTO &&
|
||||
scope.row.params.resourceDTO.name) ||
|
||||
(scope.row.params && scope.row.params.undercarriageReason)
|
||||
(scope.row.params && scope.row.params.undercarriageReason)||
|
||||
(scope.row.params && scope.row.params.comment)
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -126,41 +128,42 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import mixinViewModule from "@/mixins/view-module";
|
||||
import processModule from "@/mixins/process-module";
|
||||
import mixinViewModule from '@/mixins/view-module'
|
||||
import processModule from '@/mixins/process-module'
|
||||
export default {
|
||||
mixins: [mixinViewModule, processModule],
|
||||
data () {
|
||||
return {
|
||||
mixinViewModuleOptions: {
|
||||
getDataListURL: "/act/task/myToDoTaskPage",
|
||||
getDataListURL: '/act/task/myToDoTaskPage',
|
||||
getDataListIsPage: true,
|
||||
activatedIsNeed: true,
|
||||
deleteIsBatch: true,
|
||||
deleteIsBatchKey: "deploymentId",
|
||||
deleteIsBatchKey: 'deploymentId'
|
||||
},
|
||||
dataForm: {
|
||||
taskName: "",
|
||||
taskId: "",
|
||||
taskName: '',
|
||||
taskId: ''
|
||||
},
|
||||
processInstanceId: "",
|
||||
};
|
||||
processInstanceId: ''
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
// 处理
|
||||
taskHandle (row) {
|
||||
console.log('row======================>', row, this.forwardHandleUrl)
|
||||
if (!row.businessKey) {
|
||||
return this.$message.error(this.$t("task.businessKeyError"));
|
||||
return this.$message.error(this.$t('task.businessKeyError'))
|
||||
}
|
||||
this.getProcDefRouteSet(row, this.forwardHandleUrl);
|
||||
this.getProcDefRouteSet(row, this.forwardHandleUrl)
|
||||
},
|
||||
taskDetail (row) {
|
||||
if (!row.businessKey) {
|
||||
return this.$message.error(this.$t("task.detailError"));
|
||||
return this.$message.error(this.$t('task.detailError'))
|
||||
}
|
||||
this.getProcDefRouteSet(row, this.forwardTaskDetail)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.getProcDefRouteSet(row, this.forwardTaskDetail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
/*
|
||||
* @Author: hisense.wuhongjian
|
||||
* @Date: 2022-06-14 09:43:30
|
||||
* @LastEditors: hisense.wuhongjian
|
||||
* @LastEditTime: 2022-06-23 20:04:39
|
||||
* @Description: 告诉大家这是什么
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function demandComment(data) {
|
||||
|
@ -7,6 +14,13 @@ export function demandComment(data) {
|
|||
data,
|
||||
})
|
||||
}
|
||||
export function demandCommentApply(data) {
|
||||
return request({
|
||||
url: '/comment/center/apply',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
export function demandCommentPage(params) {
|
||||
return request({
|
||||
|
|
|
@ -186,15 +186,14 @@
|
|||
</div>
|
||||
<a-list
|
||||
class="comment-list"
|
||||
:header="`全部${total} 评论`"
|
||||
:header="`全部${total || 0} 评论`"
|
||||
item-layout="horizontal"
|
||||
:data-source="evaluateData"
|
||||
>
|
||||
<template #renderItem="{ item }">
|
||||
<a-list-item>
|
||||
<a-comment :author="item.name">
|
||||
<template v-if="item.name == user.applyUserName" #actions>
|
||||
<!-- <span @click="evaluateUpdate">修改</span> -->
|
||||
<!-- <template v-if="item.name == user.applyUserName" #actions>
|
||||
<a-popconfirm
|
||||
title="确定删除评论?"
|
||||
ok-text="确定"
|
||||
|
@ -204,7 +203,7 @@
|
|||
>
|
||||
<span>删除</span>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
</template> -->
|
||||
<template #content>
|
||||
<p v-if="!evaluateUpdateStatus">
|
||||
{{ item.comment }}
|
||||
|
@ -250,6 +249,7 @@
|
|||
demandComment,
|
||||
demandCommentPage,
|
||||
demandCommentDelete,
|
||||
demandCommentApply,
|
||||
} from '@/api/demandCenter'
|
||||
import { getUser, getUserInfo } from '@/api/home'
|
||||
import { getDemandForm } from '@/api/personalCenter'
|
||||
|
@ -293,10 +293,17 @@
|
|||
createDeptName: user.applyUserDeptName,
|
||||
comment: myComment.value,
|
||||
name: user.applyUserName,
|
||||
}).then(() => {
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.data.code == '0') {
|
||||
demandCommentApply({ id: res.data.data.id }).then((res1) => {
|
||||
if (res1.data.code == '0') {
|
||||
message.success('提交评价成功!')
|
||||
myComment.value = ''
|
||||
evaluateList()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
// const evaluateUpdateStatus = ref(false)
|
||||
|
|
Loading…
Reference in New Issue