{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/src/components/form_supplement_flowpanel.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/src/components/form_supplement_flowpanel.vue","mtime":1740130327257},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/babel-loader/lib/index.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport API from \"@/api.js\";\nexport default {\n props: [\"act\",\"openParams\",\"approvers\"],\n data: function() {\n return {\n signMode: \"TEXT\",//意见填写模式,SIGN:手写 TEXT:文本输入\n suggestBoxVisible: false,\n attitude: \"\",\n showInput: false, //是否展示添加常见意见框 开始false\n showEditFirst: false, //展示编辑意见框 \n\n showDelAndEdit: false, //开始false\n allSuggests: [],\n showEditSecond: false, //开始false\n input:'',\n inputSecond: \"\",\n opinionId: \"\", //更新意见信息的ID\n currentNodeId: \"\",\n existCanvas: false, //是否存在手写签名\n canvasWidth:0,\n };\n },\n created() {\n this.getSuggest();\n },\n\n mounted() {\n // 准备手写签名画布\n this.canvas = this.$refs.canvas; //指定canvas\n this.ctx = this.canvas.getContext(\"2d\"); //设置2D渲染区域\n this.ctx.fillStyle = \"#fff\";\n this.ctx.fillRect(0, 0, 500, 142);\n //this.ctx.lineWidth = 1;//设置线的宽度\n },\n methods: {\n //清除画布数据\n clear() {\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n this.existCanvas = false;\n },\n\n touchStart(ev) {\n ev = ev || event\n ev.preventDefault()\n this.canvasMoveUse = true;\n let rect = this.$refs.canvas.getBoundingClientRect();\n if (ev.touches.length == 1) {\n let obj = {\n x: ev.targetTouches[0].clientX,\n y: ev.targetTouches[0].clientY,\n }\n const canvasX = obj.x - this.$refs.canvas.offsetLeft;\n const canvasY = obj.y - rect.top;\n this.ctx.beginPath(); // 移动的起点\n this.ctx.moveTo(canvasX, canvasY);\n }\n },\n touchMove(ev) {\n if (this.canvasMoveUse) {\n // 只有允许移动时调用\n let rect = this.$refs.canvas.getBoundingClientRect();\n if (ev.touches.length == 1) {\n let obj = {\n x: ev.targetTouches[0].clientX,\n y: ev.targetTouches[0].clientY,\n }\n let canvasX;\n let canvasY;\n canvasX = obj.x - this.$refs.canvas.offsetLeft;\n canvasY = obj.y - rect.top;\n this.ctx.lineTo(canvasX, canvasY);\n this.ctx.stroke();\n }\n }\n },\n touchEnd() {\n this.existCanvas = true;\n this.canvasMoveUse = false;\n },\n \n getSignImageData() {\n if (this.existCanvas) {\n //判断是否存在手写签名\n let pJson;\n let canvas = document.getElementById(\"canvas\");\n let signature = canvas.toDataURL(\"image/png\");\n let str = signature.replace(\"data:image/png;base64,\", \"\");\n pJson = {\n type: \"image/png;base64\",\n data: str\n };\n return pJson;\n }else {\n return false;\n }\n \n },\n\n //保存重新编辑的意见\n updateSuggestion() {\n let opId = this.opinionId,\n opinion = this.inputSecond;\n API.updateOpinion(this.$root.user.id, opId, opinion, {\n onSucess: response => {\n if (response.data.data) {\n let id = response.data.data.id;\n let content = response.data.data.content;\n for (let i = 0; i < this.allSuggests.length; i++) {\n if (this.allSuggests[i].id == id) {\n this.allSuggests[i].content = content;\n this.inputSecond = \"\";\n }\n }\n }\n }\n });\n },\n\n //重新编辑意见\n editSuggestion(id, content) {\n this.inputSecond = content;\n this.opinionId = id;\n },\n\n //删除意见\n deleteSuggestion(id) {\n let opId = id;\n API.deleteComments(this.$root.user.id, opId, {\n onSucess: response => {\n if (response.data.data) {\n let delId = response.data.data.id;\n let allSug = this.allSuggests;\n for (let i = 0; i < allSug.length; i++) {\n if (allSug[i].id == delId) {\n allSug.splice(i, 1);\n i--;\n }\n }\n this.allSuggest = allSug;\n }\n }\n });\n },\n\n //添加意见\n addSuggestion() {\n let opinion = this.input;\n API.addCommonOpinions(this.$root.user.id, opinion, {\n onSucess: response => {\n let newSuggest = response.data.data;\n this.allSuggests.push(newSuggest);\n this.input = \"\";\n }\n });\n },\n\n // 选中的数据放进文本框中\n putData(content) {\n if (this.showDelAndEdit == false) {\n if (!this.attitude) {\n this.attitude = content;\n } else if (this.attitude) {\n this.attitude = this.attitude + \",\" + content;\n }\n }\n },\n\n editSuggest() {\n this.showInput = true;\n this.showEditFirst = false;\n this.showEditSecond = true;\n this.showDelAndEdit = true;\n },\n\n cancelAddSuggest(num) {\n if (num == 1) {\n this.showInput = false;\n this.showDelAndEdit = false;\n this.showEditFirst = false;\n } else if (num == 2) {\n this.showInput = false;\n this.showDelAndEdit = false;\n this.showEditSecond = false;\n }\n },\n\n showInputBox() {\n this.showInput = true;\n this.showEditFirst = true;\n },\n\n //隐藏小意见框\n hiddenSuggest() {\n this.suggestBoxVisible = !this.suggestBoxVisible;\n },\n\n changeSignMode() {\n if (this.signMode == \"TEXT\") {\n let screenWidth = document.body.clientWidth;\n this.canvasWidth = Math.ceil(screenWidth - (screenWidth * 0.25));\n this.signMode = \"SIGN\";\n }\n else {\n this.signMode = \"TEXT\";\n }\n },\n\n //获取返回的数据\n getSuggest() {\n this.$api.getCommonOpinions(this.$root.user.id, {\n onSucess: response => {\n this.allSuggests = response.data.data;\n }\n });\n },\n\n //提交\n onSubmit() {\n let appId = this.openParams.appId;\n let instanceId = this.approvers[0].instanceId;\n let attitude = this.attitude;\n this.$api.supplement(appId, instanceId, attitude, {\n onSucess: response => {\n let act = response.data;\n this.$emit(\"action\", act);\n }\n });\n },\n }\n};\n",null]}