diff --git a/test/webservice/webdemoproject/.idea/workspace.xml b/test/webservice/webdemoproject/.idea/workspace.xml index b440e683..475f7912 100644 --- a/test/webservice/webdemoproject/.idea/workspace.xml +++ b/test/webservice/webdemoproject/.idea/workspace.xml @@ -1,12 +1,7 @@ - - - - - - + + + + \ No newline at end of file diff --git a/test/webservice/webdemoproject/css/scan.css b/test/webservice/webdemoproject/css/scan.css index 36825f8e..e6eb9e22 100644 --- a/test/webservice/webdemoproject/css/scan.css +++ b/test/webservice/webdemoproject/css/scan.css @@ -82,8 +82,10 @@ ul { } .el-container .el-header .menuContainer { - float: left; - margin-left: 15px; + /*float: left;*/ + /*margin-left: 15px;*/ + /*height: 80px;*/ + overflow-x: auto; } .el-container .el-header .menuContainer ul { @@ -218,3 +220,10 @@ ul { .cursor-pointer { cursor: pointer } + + +.menuStyle { + display: inline-block; + /*margin-left: 10px;*/ + margin: 5px; +} diff --git a/test/webservice/webdemoproject/js/WebScanController.js b/test/webservice/webdemoproject/js/WebScanController.js index 2af62e23..f81a6ccb 100644 --- a/test/webservice/webdemoproject/js/WebScanController.js +++ b/test/webservice/webdemoproject/js/WebScanController.js @@ -448,11 +448,11 @@ }, //插入本地图像(需返回成功后前端缩略图才能作相应的UI修改) - insertLocalImage: function (imagePath, insertIndex, callBack) { + insertLocalImage: function (imagePath, insertIndex, idenInfo, callBack) { const that = this this.sendCommand({ func: "insert_local_image", - iden: that.wslicence, + iden: JSON.stringify(idenInfo), image_path: imagePath, insert_pos: insertIndex,//插入位置,-1表示最后 image_tag: ''//标签名,可以为空 @@ -501,11 +501,11 @@ }, //修改图像 - modifyImage: function (imageIndex, imageBase64, callBack) { + modifyImage: function (imageIndex, imageBase64, idenInfo, callBack) { const that = this this.sendCommand({ func: "modify_image", - iden: that.wslicence, + iden: idenInfo == null ? that.wslicence : JSON.stringify(idenInfo), image_index: imageIndex, image_base64: imageBase64 }, callBack) diff --git a/test/webservice/webdemoproject/js/scanWeb.js b/test/webservice/webdemoproject/js/scanWeb.js index 0a3f952f..ef912159 100644 --- a/test/webservice/webdemoproject/js/scanWeb.js +++ b/test/webservice/webdemoproject/js/scanWeb.js @@ -292,8 +292,10 @@ new Vue({ this.eleMessage(info.info, info.is_error ? 'error' : 'warning') break case "scan_image"://图片回调 - this.appendLog('图片回调:' + info.image_path) - console.log('图片回调:' + info.image_path) + let imagePath = info.image_path + + this.appendLog('图片回调:' + imagePath) + console.log('图片回调:' + imagePath + ' info:' + JSON.stringify(info)) let that = this if (this.scanMode == 'insert') {//是插入扫描 @@ -306,18 +308,25 @@ new Vue({ this.curInsertIndex = this.selectImageObj.index } - console.log('插入扫描:待插入index:' + this.curInsertIndex + " path:" + info.image_path) - this.WebScanController.insertLocalImage(info.image_path, this.curInsertIndex, function (insertInfo) { - console.log('插入扫描:插入index' + that.curInsertIndex) - - that.urls.splice(that.curInsertIndex, 0, { - path: info.image_path, + console.log('插入扫描:待插入index:' + this.curInsertIndex + " path:" + imagePath) + this.WebScanController.insertLocalImage(imagePath, this.curInsertIndex, + { + path: imagePath, thumbnail: info.image_base64, base64: info.image_base64 - }); - that.curInsertIndex++ - that.$forceUpdate() - }) + }, + function (insertInfo) { + console.log('插入扫描:插入index' + that.curInsertIndex) + let idenInfo = JSON.parse(insertInfo.iden); + + that.urls.splice(that.curInsertIndex, 0, { + path: idenInfo.path, + thumbnail: idenInfo.thumbnail, + base64: idenInfo.base64 + }); + that.curInsertIndex++ + that.$forceUpdate() + }) } else if (this.scanMode == 'cover') {//是覆盖扫描 @@ -333,15 +342,20 @@ new Vue({ } if (this.needCoverCount > 0) {//还在覆盖范围内,直接覆盖掉 - this.WebScanController.modifyImage(this.curCoverIndex, info.image_base64, function (modifyInfo) { + this.WebScanController.modifyImage(this.curCoverIndex, info.image_base64, { + base64: info.image_base64, + thumbnail: info.image_base64, + path: imagePath + }, function (modifyInfo) { console.log('覆盖扫描:修改成功 index:' + that.curCoverIndex) console.log('覆盖前:index==' + that.curCoverIndex + ' path:' + that.urls[that.curCoverIndex].path) + let idenInfo = JSON.parse(modifyInfo.iden); that.urls[that.curCoverIndex] = { - base64: info.image_base64, - thumbnail: info.image_base64, - path: info.image_path + base64: idenInfo.base64, + thumbnail: idenInfo.thumbnail, + path: idenInfo.path } console.log('覆盖后:index==' + that.curCoverIndex + ' path:' + that.urls[that.curCoverIndex].path) @@ -351,12 +365,18 @@ new Vue({ that.$forceUpdate() }) } else {//之后都是新增的往后添加了 - this.WebScanController.insertLocalImage(info.image_path, this.urls.length, function (result) { + this.WebScanController.insertLocalImage(imagePath, this.urls.length, { + path: imagePath, + thumbnail: info.image_base64, + base64: info.image_base64 + }, function (result) { console.log('覆盖扫描:插入成功 index:' + that.urls.length) + let idenInfo = JSON.parse(result.iden); + that.urls.push({ - path: info.image_path, - thumbnail: info.image_base64, - base64: info.image_base64 + path: idenInfo.path, + thumbnail: idenInfo.thumbnail, + base64: idenInfo.base64 }) that.$forceUpdate() @@ -374,12 +394,20 @@ new Vue({ let that = this; - this.WebScanController.insertLocalImage(info.image_path, this.urls.length, function (result) { - console.log('正常扫描:插入成功 index:' + that.urls.length) + + this.WebScanController.insertLocalImage(imagePath, this.urls.length, { + path: imagePath, + thumbnail: info.image_base64, + base64: info.image_base64 + }, function (result) { + let idenInfo = JSON.parse(result.iden); + + console.log('正常扫描:插入成功 index:' + that.urls.length + ' path:' + idenInfo.path) + that.urls.push({ - path: info.image_path, - thumbnail: info.image_base64, - base64: info.image_base64 + path: idenInfo.path, + thumbnail: idenInfo.thumbnail, + base64: idenInfo.base64 }) that.$nextTick(function () { if (that.$refs.imageArea) { @@ -1023,7 +1051,7 @@ new Vue({ that.WebScanController.imageAddWatermark(modifyIndex, that.waterMarkInfo, true, function (info) { console.log('添加水印成功:') - that.WebScanController.modifyImage(modifyIndex, info.image_base64, function (modifyInfo) { + that.WebScanController.modifyImage(modifyIndex, info.image_base64, {}, function (modifyInfo) { console.log('添加水印:修改' + modifyIndex + '成功:') that.urls[modifyIndex].thumbnail = info.image_base64 that.urls[modifyIndex].base64 = info.image_base64 @@ -1056,7 +1084,7 @@ new Vue({ this.WebScanController.imageAddWatermark(imageIndex, markInfoParams, true, function (markInfo) { console.log('多张添加水印成功:index:' + imageIndex) let resultImage = markInfo.image_base64 - that.WebScanController.modifyImage(imageIndex, resultImage, function (modifyInfo) { + that.WebScanController.modifyImage(imageIndex, resultImage, {}, function (modifyInfo) { console.log('多张添加水印:修改' + imageIndex + '成功:') that.urls[imageIndex].thumbnail = resultImage that.urls[imageIndex].base64 = resultImage @@ -1249,9 +1277,9 @@ new Vue({ this.totalAngle = 0 this.canvas.discardActiveObject() let that = this - console.log('准备加载图像到画布:' + JSON.stringify(imageSrc)) + // console.log('准备加载图像到画布:' + JSON.stringify(imageSrc)) new fabric.Image.fromURL(imageSrc ? imageSrc.base64 : null, function (image) { - console.log('加载图像:image===' + image) + // console.log('加载图像:image===' + image) let result = imageSrc ? image : null that.image = result that.canvas.add(image) @@ -1452,7 +1480,7 @@ new Vue({ let firstPath = info.image_path_list[0] let secondPath = info.image_path_list[1] - that.WebScanController.modifyImage(currentIndex, secondBase64, function (info) { + that.WebScanController.modifyImage(currentIndex, secondBase64, {}, function (info) { console.log('图像拆分:第二张修改成功...') that.urls[currentIndex] = { base64: secondBase64, @@ -1886,7 +1914,7 @@ new Vue({ console.log('save image dataUrl:' + dataUrl) - this.WebScanController.modifyImage(this.selectImageObj.index, dataUrl, function (info) { + this.WebScanController.modifyImage(this.selectImageObj.index, dataUrl, {}, function (info) { console.log('修改图像成功:' + JSON.stringify(info)) that.eleUnloadding() that.undoStack.length = 0; @@ -2073,7 +2101,7 @@ new Vue({ console.log('save image dataUrl:' + dataUrl) - that.WebScanController.modifyImage(currentIndex, dataUrl, function (info) { + that.WebScanController.modifyImage(currentIndex, dataUrl, {}, function (info) { that.eleUnloadding() console.log('修改成功') that.urls[currentIndex].base64 = dataUrl diff --git a/test/webservice/webdemoproject/webDemo.html b/test/webservice/webdemoproject/webDemo.html index 082f7c23..fdaaeae6 100644 --- a/test/webservice/webdemoproject/webDemo.html +++ b/test/webservice/webdemoproject/webDemo.html @@ -9,7 +9,7 @@ - + + + + + + -
  • +
  • -
  • + + -
  • -
  • + +
  • -
  • + +
  • -
  • + +
  • - + + +