diff --git a/hb_client/src/assets/glass.png b/hb_client/src/assets/glass.png new file mode 100644 index 0000000..7b7c511 Binary files /dev/null and b/hb_client/src/assets/glass.png differ diff --git a/hb_client/src/views/mtm/materialdo.vue b/hb_client/src/views/mtm/materialdo.vue index cb20e7a..029abea 100644 --- a/hb_client/src/views/mtm/materialdo.vue +++ b/hb_client/src/views/mtm/materialdo.vue @@ -87,11 +87,38 @@ :title="tableForm.name" > + + + +
+ +
+ + 您的浏览器不支持绘图,请升级或更换浏览器! + + + + +
+
标记
+
文字
+ +
回退
+
保存
+ +
+
+
+
+
+ +
+
- - - - @@ -200,7 +223,7 @@
- 记录字段 + 记录字段
!--> - + - + + + + + + { + that.tableForm = Object.assign({}, scope.row); // copy obj + that.formID = that.tableForm.id; + that.listQueryfield.form = that.formID; + getrffieldList(that.listQueryfield).then((response) => { if (response.data) { debugger; - this.fieldList = response.data; + that.fieldList = response.data; let list = response.data.results; for(let i=0;icanvasWidth-oldX){ + ctx3.fillText(v.substring(lastSubStrIndex,i),oldX,(oldY+10)); + oldY+=20; + lineWidth=0; + lastSubStrIndex=i; + } + if(i==v.length-1){ + ctx3.fillText(v.substring(lastSubStrIndex,i+1),oldX,(oldY+10)); + } + } + inputV ="2"; + word3.value = ""; + } + } + } + } + }, + + // 文字过长超出换行toDataURL() + canvasTextAutoLine(str,canvas,initX,initY,lineHeight){ + let ctx = canvas.getContext("2d"); + let lineWidth = 0; + let canvasWidth = canvas.width; + let lastSubStrIndex= 0; + for(let i=0;icanvasWidth-initX){ + ctx.fillText(str.substring(lastSubStrIndex,i),initX,initY); + initY+=lineHeight; + lineWidth=0; + lastSubStrIndex=i; + } + if(i==str.length-1){ + ctx.fillText(str.substring(lastSubStrIndex,i+1),initX,initY); + } + } + }, + + /* // 删除批注 + restuya(){ + this.word.style.display="none"; + this.Txt.style.display="none"; + this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height); + window.location.reload(); + },*/ + + // 撤销 + back(){ + this.word.style.display="none"; + this.Txt.style.display="none"; + if(preDrawAry.length>0) { + var popData = preDrawAry.pop(); + this.ctx.putImageData(popData, 0, 0); + } + }, + + // 回退一次 + put(){ + this.ctx.putImageData(this.imgData,0,0); + }, + + //保存 + saveTu(){ + let canvas = document.getElementById('canvas'); + let image = new Image(); + image = canvas.toDataURL('image/png'); + this.canvasImg = image; + // document.getElementById('res').innerHTML = ''; + }, + + //新增记录表 handleCreate() { this.recordform = Object.assign({}, defaultrecordform); @@ -912,4 +1160,55 @@ .my-content { background: #fde2e2; } + canvas{ + border:1px solid #000000; + cursor: crosshair; + } + .canvasBtnWrap{ + display: flex; + flex-direction: column; + width: 80px; + padding-left: 20px; + justify-content: space-between; + } + .canvasBtn{ + width: 70px; + height: 35px; + line-height: 35px; + border: 1px solid #aaaaaa; + text-align: center; + border-radius: 15px; + } + .hide{ + display: none; + } + #txt{ + position: absolute; + top: 1%; + left: 1%; + width: 150px; + height: 30px; + border:1px solid #e42343; + } + #word{ + position: absolute; + width: 150px; + height: 70px; + padding: 0 2px; + background:none; + color:#e42343; + border: 1px dashed #b9b9b9; + } + #word::-webkit-input-placeholder{ + color:#e42343; + } + #word::-moz-placeholder{ + color:#e42343; + } + #word::placeholder{ + color:#e42343; + } + #res{ + display: inline-block; + }