|
|
|
|
@ -119,7 +119,7 @@
|
|
|
|
|
|
|
|
|
|
</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="width:250px;border: 1px solid #eee; padding: 10px;">
|
|
|
|
|
<div style="margin-bottom: 5px;">物理书架:</div>
|
|
|
|
|
@ -138,10 +138,49 @@
|
|
|
|
|
/>
|
|
|
|
|
</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;">
|
|
|
|
|
<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 v-if="smwj.shelfId && smwj.list.length>0" style="width: 560px;margin-left: 20px;display: flex;flex-wrap: wrap">
|
|
|
|
|
|
|
|
|
|
<div v-for="(item,index) in smwj.list" class="smwjList">
|
|
|
|
|
@ -164,6 +203,10 @@
|
|
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<div class="myProgress" v-show="openProgress">
|
|
|
|
|
<el-progress type="circle" :percentage="percentage"></el-progress>
|
|
|
|
|
<div style="margin-top:20px;">拼命识别中...</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -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;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|