{"remainingRequest":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js??ref--0-0!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/test-v5inweb-5.x-vue/src/components/o_comment.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/src/components/o_comment.vue","mtime":1739760944319},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/babel.config.js","mtime":1739760943855},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":1655715099000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\nimport Constant from \"@/Constant.js\";\nexport default {\n name: \"o-comment\",\n props: [\"id\"],\n computed: {\n field: function field() {\n var allData = this.$parent.findField(this.id);\n return allData;\n }\n },\n mounted: function mounted() {\n this.init();\n },\n data: function data() {\n return {\n Constant: Constant,\n commentData: {\n list: [],\n comment: ''\n },\n commentDetail: '',\n avatar: ''\n };\n },\n methods: {\n likeForm: function likeForm() {\n var _this = this;\n var _this$commentDetail = this.commentDetail,\n id = _this$commentDetail.id,\n likeNum = _this$commentDetail.likeNum;\n this.$api.setLike(this.field.appId, id, {\n onSucess: function onSucess(res) {\n likeNum = res.data.data;\n _this.commentDetail.likeNum = likeNum;\n _this.$forceUpdate();\n }\n });\n },\n clickLike: function clickLike(id, index, inx) {\n var _this2 = this;\n var cd = this.commentData;\n this.$api.setLike(this.field.appId, id, {\n onSucess: function onSucess(res) {\n if (res.data.data) {\n if (inx >= 0) {\n cd.list[index].replyList[inx].likeNum = res.data.data;\n } else {\n cd.list[index].likeNum = res.data.data;\n }\n _this2.$forceUpdate();\n }\n }\n });\n },\n clickUnLike: function clickUnLike(id, index, inx) {\n var _this3 = this;\n var cd = this.commentData;\n this.$api.setUnlike(this.field.appId, id, {\n onSucess: function onSucess(res) {\n if (res.data.data) {\n if (inx >= 0) {\n cd.list[index].replyList[inx].unlikeNum = res.data.data;\n } else {\n cd.list[index].unlikeNum = res.data.data;\n }\n _this3.$forceUpdate();\n }\n }\n });\n },\n replyToComments: function replyToComments(id, isShow, index, currentId, name) {\n var cd = this.commentData;\n cd.list[index].placeholder = \"回复 @\" + name;\n cd.list[index].currentId = currentId;\n if (id == currentId) {\n cd.list[index].isShowReleaseBox = !isShow;\n } else {\n cd.list[index].commentValue = '';\n // cd.list[index].placeholder = \"回复 @\" + name\n cd.list[index].isShowReleaseBox = true;\n }\n this.$forceUpdate();\n },\n postComment: function postComment(id, value, currentId, placeholder, index) {\n var _this4 = this;\n var cd = this.commentData;\n var field = this.field;\n var content = {\n comment: '',\n parentId: ''\n };\n if (id) {\n if (id == currentId) {\n //回复第一层\n content.comment = value;\n content.parentId = id;\n } else {\n //第二层回复\n content.parentId = id;\n content.comment = placeholder + \":\" + value;\n }\n } else {\n content.comment = cd.comment;\n }\n this.$api.publishComment(this.$root.appid, field.docId, content, {\n onSucess: function onSucess(res) {\n var list = res.data.data;\n if (id) {\n if (cd.list[index].replyList) {\n cd.list[index].replyList.unshift(list);\n } else {\n cd.list[index].replyList = [];\n cd.list[index].replyList.push(list);\n }\n cd.list[index].commentValue = '';\n } else {\n cd.comment = '';\n cd.list.unshift(list);\n }\n _this4.$forceUpdate();\n }\n });\n },\n init: function init() {\n var _this5 = this;\n var field = this.field;\n this.$api.getCommentList(field.appId, field.docId, {\n onSucess: function onSucess(res) {\n var list = res.data.data;\n if (list && list.length > 0) {\n list.forEach(function (el) {\n el.commentValue = '';\n el.isShowReleaseBox = false;\n el.currentId = el.id;\n el.placeholder = '';\n });\n _this5.commentData.list = list;\n list.forEach(function (el) {\n _this5.$api.getReplyList(field.appId, el.id, {\n onSucess: function onSucess(res) {\n if (res.data.data) {\n el.replyList = res.data.data;\n } else {\n el.replyList = [];\n }\n _this5.$forceUpdate();\n }\n });\n });\n }\n }\n });\n this.$api.getLikesCount(field.appId, field.docId, {\n onSucess: function onSucess(res) {\n _this5.commentDetail = res.data.data;\n }\n });\n var userId = this.$store.state.userId;\n this.$api.getUserAvatar(userId, {\n onSucess: function onSucess(res) {\n _this5.avatar = res.data.data;\n }\n });\n },\n onChange: function onChange() {}\n },\n filters: {\n writeCurrentDate: function writeCurrentDate(val) {\n var now = new Date(val);\n var year = now.getFullYear();\n var month = now.getMonth() + 1;\n var date = now.getDate();\n var hour = now.getHours();\n var minute = now.getMinutes();\n hour = hour >= 10 ? hour : '0' + hour;\n minute = minute >= 10 ? minute : '0' + minute;\n return year + \"-\" + month + \"-\" + date + \" \" + hour + \":\" + minute;\n }\n }\n};",null]}