档案采集

master
wanglei 2 years ago
parent 030e15e783
commit 2595606053

@ -21,3 +21,12 @@ export function collectRecongnize(data) {
data: data data: data
}) })
} }
// 获取进度条
export function collectProgress() {
return request({
url: '/dangan/collect/progress',
method: 'get'
})
}

@ -119,7 +119,7 @@
</el-dialog> </el-dialog>
<el-dialog title="扫描文件上传" :visible.sync="smwj.open" width="900px" append-to-body> <el-dialog title="扫描文件上传" :visible.sync="smwj.open" width="1000px" append-to-body>
<div style="margin-bottom: 30px;display: flex;align-items:start;min-height: 250px" v-loading="smwj.loading"> <div style="margin-bottom: 30px;display: flex;align-items:start;min-height: 250px" v-loading="smwj.loading">
<div style="width:250px;border: 1px solid #eee; padding: 10px;"> <div style="width:250px;border: 1px solid #eee; padding: 10px;">
<div style="margin-bottom: 5px;">物理书架</div> <div style="margin-bottom: 5px;">物理书架</div>
@ -138,8 +138,47 @@
/> />
</div> </div>
<div v-if="smwj.shelfId && smwj.list.length===0" style="width: 560px;margin-left: 20px;"> <div v-if="smwj.shelfId && smwj.list.length===0" style="width: 650px;margin-left: 20px;">
<el-button icon="el-icon-upload2" type="primary" @click="WebScanInit"></el-button> <div>
<el-row class="sm_row" :gutter="20">
<el-col class="sm_col" :span="12">
<label>颜色模式</label>
<el-select v-model="pixel" placeholder="请选择颜色模式">
<el-option label="黑白" :value="0"></el-option>
<el-option label="灰色" :value="1"></el-option>
<el-option label="彩色" :value="2"></el-option>
</el-select>
</el-col>
<el-col class="sm_col" :span="12">
<label>单双面</label>
<el-select v-model="single" placeholder="请选择单双面">
<el-option label="单面" :value="false"></el-option>
<el-option label="双面" :value="true"></el-option>
</el-select>
</el-col>
</el-row>
<el-row class="sm_row" :gutter="20">
<el-col class="sm_col" :span="12">
<label>去白页</label>
<el-select v-model="white" placeholder="请选择去白页">
<el-option label="是" :value="true"></el-option>
<el-option label="否" :value="false"></el-option>
</el-select>
</el-col>
<el-col class="sm_col" :span="12">
<label>分辨率</label>
<el-select v-model="resolution" placeholder="请选择分辨率">
<el-option label="100" :value="100"></el-option>
<el-option label="150" :value="150"></el-option>
<el-option label="200" :value="200"></el-option>
<el-option label="300" :value="300"></el-option>
<el-option label="600" :value="600"></el-option>
</el-select>
</el-col>
</el-row>
<el-button icon="el-icon-upload2" type="primary" @click="WebScanInit"></el-button>
</div>
</div> </div>
<div v-if="smwj.shelfId && smwj.list.length>0" style="width: 560px;margin-left: 20px;display: flex;flex-wrap: wrap"> <div v-if="smwj.shelfId && smwj.list.length>0" style="width: 560px;margin-left: 20px;display: flex;flex-wrap: wrap">
@ -164,6 +203,10 @@
</el-dialog> </el-dialog>
<div class="myProgress" v-show="openProgress">
<el-progress type="circle" :percentage="percentage"></el-progress>
<div style="margin-top:20px;">拼命识别中...</div>
</div>
</div> </div>
</template> </template>
@ -172,7 +215,7 @@ import { catalogTreeselect } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listBookshelf } from "@/api/dangan/bookshelf"; import { listBookshelf } from "@/api/dangan/bookshelf";
import { collectSaves, collectRecongnize } from "@/api/dangan/collection"; import { collectSaves, collectRecongnize, collectProgress } from "@/api/dangan/collection";
import '@/utils/WebScan'; import '@/utils/WebScan';
export default { export default {
@ -180,6 +223,14 @@ export default {
components: {Treeselect}, components: {Treeselect},
data() { data() {
return { return {
// 0 1 2
pixel: 1,
//
single: false,
//
white: false,
//
resolution: 300,
WebScan: null, WebScan: null,
fileList: [], fileList: [],
dangAnID: '', dangAnID: '',
@ -213,7 +264,10 @@ export default {
shelfId: undefined, shelfId: undefined,
wlsjNode: undefined, wlsjNode: undefined,
list: [] list: []
} },
percentage: 0,
openProgress: false,
Interval : null
}; };
}, },
watch: { watch: {
@ -224,6 +278,18 @@ export default {
}, },
created() { created() {
this.getDeptTree(); this.getDeptTree();
this.getProgress()
/*this.Interval = setInterval(()=> {
if(this.percentage===100){
clearInterval(this.Interval);
this.Interval = null;
}else {
this.getProgress()
}
}, 2000);*/
}, },
methods: { methods: {
// //
@ -234,7 +300,6 @@ export default {
_this.WebScan = new WebScan({ _this.WebScan = new WebScan({
url:'http://localhost:18989/WebScan', url:'http://localhost:18989/WebScan',
wsUrl:'http://localhost:28989/', wsUrl:'http://localhost:28989/',
/*licence:'D+1WT4eWDqLseG5433yq9w=='*/
licence:'V4tMKPYgFtW8vQr4C0s4/g==' licence:'V4tMKPYgFtW8vQr4C0s4/g=='
}); });
@ -277,11 +342,11 @@ export default {
let form = { let form = {
device: 'M3230', device: 'M3230',
autofeeder: 1, autofeeder: 1,
pixel: 1, pixel: this.pixel,
white: 0, white: this.white,
single: false, single: this.single,
format:"jpg", format:"jpg",
resolution: 300, resolution: this.resolution,
isActual: true, isActual: true,
isUI: false, isUI: false,
cropAdjustTop:0, cropAdjustTop:0,
@ -351,7 +416,9 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.$route.query.id); 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) { handleNodeClick(data, Node) {
console.log(23132,Node);
this.dangAnID = data.id; this.dangAnID = data.id;
this.dangAnNode = Node; this.dangAnNode = Node;
}, },
@ -393,9 +461,11 @@ export default {
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.fileList.push(file); this.fileList.push(file);
}, },
//
httpRequest(file) { httpRequest(file) {
console.log('httpRequest', this.fileList, file); console.log('httpRequest', this.fileList, file);
}, },
//
submitFiles(type) { submitFiles(type) {
if(type===1){ if(type===1){
if(this.smwj.list.length>0){ if(this.smwj.list.length>0){
@ -407,6 +477,7 @@ export default {
const DaPicturesRecard = {} const DaPicturesRecard = {}
DaPicturesRecard.muId = this.dangAnNode.key; DaPicturesRecard.muId = this.dangAnNode.key;
DaPicturesRecard.muPath = this.getAllLabels(this.dangAnNode); DaPicturesRecard.muPath = this.getAllLabels(this.dangAnNode);
DaPicturesRecard.ywType = this.dangAnNode.data.ywType;
DaPicturesRecard.wlsjId = this.smwj.wlsjNode.key; DaPicturesRecard.wlsjId = this.smwj.wlsjNode.key;
DaPicturesRecard.wlsjPath = this.getAllLabels(this.smwj.wlsjNode); DaPicturesRecard.wlsjPath = this.getAllLabels(this.smwj.wlsjNode);
@ -436,6 +507,7 @@ export default {
const DaPicturesRecard = {} const DaPicturesRecard = {}
DaPicturesRecard.muId = this.dangAnNode.key; DaPicturesRecard.muId = this.dangAnNode.key;
DaPicturesRecard.muPath = this.getAllLabels(this.dangAnNode); DaPicturesRecard.muPath = this.getAllLabels(this.dangAnNode);
DaPicturesRecard.ywType = this.dangAnNode.data.ywType;
DaPicturesRecard.wlsjId = this.upload.wlsjNode.key; DaPicturesRecard.wlsjId = this.upload.wlsjNode.key;
DaPicturesRecard.wlsjPath = this.getAllLabels(this.upload.wlsjNode); DaPicturesRecard.wlsjPath = this.getAllLabels(this.upload.wlsjNode);
@ -457,14 +529,17 @@ export default {
} }
} }
}, },
//
selectTree(data, Node) { selectTree(data, Node) {
this.upload.shelfId = data.shelfId; this.upload.shelfId = data.shelfId;
this.upload.wlsjNode = Node; this.upload.wlsjNode = Node;
}, },
//
selectTree1(data, Node) { selectTree1(data, Node) {
this.smwj.shelfId = data.shelfId; this.smwj.shelfId = data.shelfId;
this.smwj.wlsjNode = Node; this.smwj.wlsjNode = Node;
}, },
// label
getAllLabels(obj) { getAllLabels(obj) {
let values = ''; let values = '';
@ -499,6 +574,7 @@ export default {
this.pictureRecard = [...this.pictureRecard] this.pictureRecard = [...this.pictureRecard]
this.checkAll = checkAll this.checkAll = checkAll
}, },
// OCR
OCRRecognition(){ OCRRecognition(){
let arr = []; let arr = [];
this.pictureRecard.forEach(item => { this.pictureRecard.forEach(item => {
@ -518,9 +594,11 @@ export default {
}); });
} }
}, },
//
deleteFile(index){ deleteFile(index){
this.fileList.splice(index, 1); this.fileList.splice(index, 1);
}, },
//
deleteFile1(index){ deleteFile1(index){
this.smwj.list.splice(index, 1); this.smwj.list.splice(index, 1);
}, },
@ -538,7 +616,13 @@ export default {
// File // File
const file = new File([blob], fileName, {type: mimeString}); const file = new File([blob], fileName, {type: mimeString});
return file; return file;
} },
/** 查询目录列表 */
getProgress() {
collectProgress().then(response => {
this.percentage = response*100;
});
},
} }
}; };
</script> </script>
@ -568,4 +652,28 @@ export default {
border-radius: 10px; border-radius: 10px;
overflow: hidden; 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;
}
</style> </style>

Loading…
Cancel
Save