diff --git a/dangan-ui/src/api/dangan/collection.js b/dangan-ui/src/api/dangan/collection.js index 9d02656..1acbb98 100644 --- a/dangan-ui/src/api/dangan/collection.js +++ b/dangan-ui/src/api/dangan/collection.js @@ -21,3 +21,12 @@ export function collectRecongnize(data) { data: data }) } + + +// 获取进度条 +export function collectProgress() { + return request({ + url: '/dangan/collect/progress', + method: 'get' + }) +} diff --git a/dangan-ui/src/views/dangan/collection/index.vue b/dangan-ui/src/views/dangan/collection/index.vue index 23c889b..239baf0 100644 --- a/dangan-ui/src/views/dangan/collection/index.vue +++ b/dangan-ui/src/views/dangan/collection/index.vue @@ -119,7 +119,7 @@ - +
物理书架:
@@ -138,8 +138,47 @@ />
-
- 开始扫描 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 开始扫描 +
+
@@ -164,6 +203,10 @@ +
+ +
拼命识别中...
+
@@ -172,7 +215,7 @@ import { catalogTreeselect } from "@/api/system/user"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import { listBookshelf } from "@/api/dangan/bookshelf"; -import { collectSaves, collectRecongnize } from "@/api/dangan/collection"; +import { collectSaves, collectRecongnize, collectProgress } from "@/api/dangan/collection"; import '@/utils/WebScan'; export default { @@ -180,6 +223,14 @@ export default { components: {Treeselect}, data() { return { + // 颜色模式,0:黑白 1:灰色 2:彩色 + pixel: 1, + // 是否双面 + single: false, + // 是否去白页 + white: false, + // 分辨率 + resolution: 300, WebScan: null, fileList: [], dangAnID: '', @@ -213,7 +264,10 @@ export default { shelfId: undefined, wlsjNode: undefined, list: [] - } + }, + percentage: 0, + openProgress: false, + Interval : null }; }, watch: { @@ -224,6 +278,18 @@ export default { }, created() { this.getDeptTree(); + + this.getProgress() + + /*this.Interval = setInterval(()=> { + if(this.percentage===100){ + clearInterval(this.Interval); + this.Interval = null; + }else { + this.getProgress() + } + }, 2000);*/ + }, methods: { // 初始化 @@ -234,7 +300,6 @@ export default { _this.WebScan = new WebScan({ url:'http://localhost:18989/WebScan', wsUrl:'http://localhost:28989/', - /*licence:'D+1WT4eWDqLseG5433yq9w=='*/ licence:'V4tMKPYgFtW8vQr4C0s4/g==' }); @@ -277,11 +342,11 @@ export default { let form = { device: 'M3230', autofeeder: 1, - pixel: 1, - white: 0, - single: false, + pixel: this.pixel, + white: this.white, + single: this.single, format:"jpg", - resolution: 300, + resolution: this.resolution, isActual: true, isUI: false, cropAdjustTop:0, @@ -351,7 +416,9 @@ export default { this.$nextTick(() => { this.$refs.tree.setCurrentKey(this.$route.query.id); - this.dangAnNode = this.$refs.tree.getNode(this.$route.query.id) + this.dangAnNode = this.$refs.tree.getNode(this.$route.query.id); + + console.log(3132, this.dangAnNode); }); }); @@ -363,6 +430,7 @@ export default { }, // 节点单击事件 handleNodeClick(data, Node) { + console.log(23132,Node); this.dangAnID = data.id; this.dangAnNode = Node; }, @@ -393,9 +461,11 @@ export default { this.$refs.upload.clearFiles(); this.fileList.push(file); }, + // 上传文件 httpRequest(file) { console.log('httpRequest', this.fileList, file); }, + // 确认上传文件提交 submitFiles(type) { if(type===1){ if(this.smwj.list.length>0){ @@ -407,6 +477,7 @@ export default { const DaPicturesRecard = {} DaPicturesRecard.muId = this.dangAnNode.key; DaPicturesRecard.muPath = this.getAllLabels(this.dangAnNode); + DaPicturesRecard.ywType = this.dangAnNode.data.ywType; DaPicturesRecard.wlsjId = this.smwj.wlsjNode.key; DaPicturesRecard.wlsjPath = this.getAllLabels(this.smwj.wlsjNode); @@ -436,6 +507,7 @@ export default { const DaPicturesRecard = {} DaPicturesRecard.muId = this.dangAnNode.key; DaPicturesRecard.muPath = this.getAllLabels(this.dangAnNode); + DaPicturesRecard.ywType = this.dangAnNode.data.ywType; DaPicturesRecard.wlsjId = this.upload.wlsjNode.key; DaPicturesRecard.wlsjPath = this.getAllLabels(this.upload.wlsjNode); @@ -457,14 +529,17 @@ export default { } } }, + // 物理书架树选择 点击上传 selectTree(data, Node) { this.upload.shelfId = data.shelfId; this.upload.wlsjNode = Node; }, + // 物理书架树选择 扫描上传 selectTree1(data, Node) { this.smwj.shelfId = data.shelfId; this.smwj.wlsjNode = Node; }, + // 获取所有label getAllLabels(obj) { let values = ''; @@ -499,6 +574,7 @@ export default { this.pictureRecard = [...this.pictureRecard] this.checkAll = checkAll }, + // OCR识别 OCRRecognition(){ let arr = []; this.pictureRecard.forEach(item => { @@ -518,9 +594,11 @@ export default { }); } }, + // 删除 点击上传 deleteFile(index){ this.fileList.splice(index, 1); }, + // 删除 扫描上传 deleteFile1(index){ this.smwj.list.splice(index, 1); }, @@ -538,7 +616,13 @@ export default { // 创建File对象 const file = new File([blob], fileName, {type: mimeString}); return file; - } + }, + /** 查询目录列表 */ + getProgress() { + collectProgress().then(response => { + this.percentage = response*100; + }); + }, } }; @@ -568,4 +652,28 @@ export default { border-radius: 10px; overflow: hidden; } + +.myProgress{ + position: absolute; + top:0; + left:0; + width: 100%; + height: 100%; + background: rgba(255,255,255,0.8); + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + font-size: 20px; +} + +.sm_col{ + display: flex; + justify-content: space-between; + align-items: center +} + +.sm_row{ + margin-bottom: 10px; +}