1.新增书籍排序功能 2.新增图片两两互换功能
This commit is contained in:
parent
d95455e512
commit
920b9943a8
|
@ -164,3 +164,14 @@ ul{
|
|||
.canvas-container{
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
|
||||
.el-dropdown-link {
|
||||
cursor: pointer;
|
||||
color: #409EFF;
|
||||
}
|
||||
.el-icon-arrow-down {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 605 B |
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -189,7 +189,7 @@
|
|||
},
|
||||
majorPDFFile: function (callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', this.url + "/majorPdfFile?pid="+this.clientId, true);
|
||||
xhr.open('GET', this.url + "/majorPdfFile?pid=" + this.clientId, true);
|
||||
xhr.responseType = "blob"; // 返回类型blob
|
||||
xhr.onload = function () {
|
||||
callback(this);
|
||||
|
@ -203,24 +203,24 @@
|
|||
},
|
||||
majorTiff: function (callback) {
|
||||
jQuery.ajax({
|
||||
type:'post',
|
||||
url:this.url+"/majorTiff",
|
||||
cache:false,
|
||||
data:{
|
||||
"pid":this.clientId
|
||||
type: 'post',
|
||||
url: this.url + "/majorTiff",
|
||||
cache: false,
|
||||
data: {
|
||||
"pid": this.clientId
|
||||
},
|
||||
success:function(data){
|
||||
success: function (data) {
|
||||
callback(data);
|
||||
},
|
||||
error:function(){
|
||||
result = new Result(500,"网络错误",null);
|
||||
error: function () {
|
||||
result = new Result(500, "网络错误", null);
|
||||
callback(result);
|
||||
}
|
||||
})
|
||||
},
|
||||
majorTiffFile: function (callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', this.url + "/majorTiffFile?pid="+this.clientId, true);
|
||||
xhr.open('GET', this.url + "/majorTiffFile?pid=" + this.clientId, true);
|
||||
xhr.responseType = "blob"; // 返回类型blob
|
||||
xhr.onload = function () {
|
||||
callback(this);
|
||||
|
@ -251,7 +251,7 @@
|
|||
},
|
||||
majorZipFile: function (callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', this.url + "/downLoadZipFile?pid="+this.clientId, true);
|
||||
xhr.open('GET', this.url + "/downLoadZipFile?pid=" + this.clientId, true);
|
||||
xhr.responseType = "blob"; // 返回类型blob
|
||||
xhr.onload = function () {
|
||||
callback(this);
|
||||
|
@ -498,6 +498,41 @@
|
|||
callback(result);
|
||||
}
|
||||
})
|
||||
},
|
||||
exchangeImage: function (indexs, callback) {
|
||||
jQuery.ajax({
|
||||
type: 'post',
|
||||
url: this.url + "/image/exchangeImage",
|
||||
cache: false,
|
||||
data: {
|
||||
"pid": this.clientId,
|
||||
"indexs": indexs
|
||||
},
|
||||
success: function (data) {
|
||||
callback(data);
|
||||
},
|
||||
error: function () {
|
||||
let result = new Result(500, "网络错误", null);
|
||||
callback(result);
|
||||
}
|
||||
})
|
||||
},
|
||||
bookSort: function (callback) {
|
||||
jQuery.ajax({
|
||||
type: 'post',
|
||||
url: this.url + "/image/bookSort",
|
||||
cache: false,
|
||||
data: {
|
||||
"pid": this.clientId
|
||||
},
|
||||
success: function (data) {
|
||||
callback(data);
|
||||
},
|
||||
error: function () {
|
||||
let result = new Result(500, "网络错误", null);
|
||||
callback(result);
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
window.WebScan = WebScan;
|
||||
|
|
|
@ -1543,6 +1543,61 @@ new Vue({
|
|||
},
|
||||
})
|
||||
},
|
||||
exchangeImage: function () {
|
||||
if (this.selectManyImages == null || this.selectManyImages == undefined ||
|
||||
this.selectManyImages.length <= 0) {
|
||||
this.eleMessage("请选择要交换的图像!", "warning");
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.selectManyImages.length != 2) {
|
||||
this.eleMessage("请选择两张图像进行交换!", "warning");
|
||||
return;
|
||||
}
|
||||
|
||||
var that = this;
|
||||
|
||||
var loading = that.eleLoadding();
|
||||
that.WebScan.exchangeImage(that.selectManyImages, function (result) {
|
||||
loading.close();
|
||||
if (result.code == 200) {
|
||||
|
||||
var sortList = that.selectManyImages.sort();
|
||||
|
||||
let first = that.urls[sortList[0]];
|
||||
let last = that.urls[sortList[1]];
|
||||
|
||||
that.urls.splice(sortList[0], 1, last)
|
||||
that.urls.splice(sortList[1], 1, first)
|
||||
|
||||
|
||||
} else {
|
||||
that.eleMessage(result.msg, "warning");
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
bookSort: function () {//是否是按照书籍类型来排序
|
||||
if (this.urls == null || this.urls.length <= 0) {
|
||||
this.eleMessage("该批次不包含图像", "warning");
|
||||
return;
|
||||
}
|
||||
|
||||
let that = this;
|
||||
let loading = that.eleLoadding();
|
||||
|
||||
that.WebScan.bookSort(function (result) {
|
||||
loading.close();
|
||||
if (result.code == 200) {
|
||||
|
||||
if (result.data != null && result.data.length > 0) {
|
||||
that.urls = result.data;
|
||||
}
|
||||
|
||||
} else {
|
||||
that.eleMessage(result.msg, "warning");
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
@ -42,6 +42,31 @@
|
|||
<el-header height="70px">
|
||||
<div class="menuContainer">
|
||||
<ul>
|
||||
<!-- <li>
|
||||
<el-dropdown>
|
||||
<div>
|
||||
<div style="text-align: center;">
|
||||
<img src="images/icons/setup.png"/>
|
||||
</div>
|
||||
<span
|
||||
>
|
||||
书籍拆分排序<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item>
|
||||
<div>
|
||||
<div class="iconContainer">
|
||||
<img src="images/icons/setup.png"/>
|
||||
</div>
|
||||
<div class="menus">扫描设定</div>
|
||||
</div>
|
||||
</el-dropdown-item>
|
||||
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</li>-->
|
||||
<li @click="setup()">
|
||||
<div class="iconContainer">
|
||||
<img src="images/icons/setup.png"/>
|
||||
|
@ -96,6 +121,18 @@
|
|||
</div>
|
||||
<div class="menu">垂直合并</div>
|
||||
</li>
|
||||
<li @click="bookSort()">
|
||||
<div class="iconContainer">
|
||||
<img src="images/icons/book_sort.png" style="height:31px"/>
|
||||
</div>
|
||||
<div class="menu">书籍自动排序</div>
|
||||
</li>
|
||||
<li @click="exchangeImage()">
|
||||
<div class="iconContainer">
|
||||
<img src="images/icons/exchange.png" style="height:31px"/>
|
||||
</div>
|
||||
<div class="menu">图片互换</div>
|
||||
</li>
|
||||
<li @click="upload()">
|
||||
<div class="iconContainer">
|
||||
<img src="images/icons/upload.png"/>
|
||||
|
|
Loading…
Reference in New Issue