|
@@ -47,7 +47,10 @@
|
|
|
<div class="my-container" id="div-main">
|
|
|
<div class="row block-padding">
|
|
|
<div class="col-lg-4 col-md-4">
|
|
|
- <h2>任务({{num}})</h2>
|
|
|
+ <h2>任务({{num}})
|
|
|
+ <button style="background-color: darkblue;" @click="SYPage()">首页</button>
|
|
|
+ <button style="background-color: darkblue;" @click="beforePage()">上一页</button>
|
|
|
+ <button style="background-color: darkblue;" @click="afterPage()">下一页</button></h2>
|
|
|
<div style="height: 270px;">
|
|
|
<div class="row">
|
|
|
<div class="col-lg-2 col-md-2 center no-padding" style="width: 19%;">订单号</div>
|
|
@@ -85,7 +88,7 @@
|
|
|
</div>
|
|
|
<div class="col-lg-8 col-md-8" >
|
|
|
<img id="imgInfo" src="/files/imgInfo.jpg" width="100%" height="100%"/>
|
|
|
- <iframe id="frameMain" width="98%" border="0" frameborder="0" v-bind:src="filepath" style="background-color:#ffffff"></iframe>
|
|
|
+ <iframe id="frameMain" width="100%" border="0" frameborder="0" v-bind:src="filepath" style="background-color:#ffffff"></iframe>
|
|
|
<img id="imgType" src="" width="auto" />
|
|
|
<video id="videoType" src="" controls width="auto" > </video>
|
|
|
<div id="textType" width="auto" ></div>
|
|
@@ -120,15 +123,42 @@
|
|
|
$("#imgType").height($(window).height()-110);
|
|
|
$("#videoType").height($(window).height()-110);
|
|
|
|
|
|
+ const taskList2 = ServiceProduceTask.getEsopTaskList();
|
|
|
+
|
|
|
var vm = new Vue({
|
|
|
el: '#div-main',
|
|
|
data: {
|
|
|
taskList: [],
|
|
|
taskList2: [],
|
|
|
filepath:"",
|
|
|
- num:0
|
|
|
+ num:taskList2.length,
|
|
|
+ pIndex:0,
|
|
|
+ pSize:10
|
|
|
},
|
|
|
methods: {
|
|
|
+ SYPage(){
|
|
|
+ this.taskList2 = taskList2.slice(0, 10);
|
|
|
+ },
|
|
|
+ beforePage(){
|
|
|
+ if(this.pIndex == 0){
|
|
|
+ alert("已是第一页");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.pIndex = this.pIndex - 10;
|
|
|
+ this.pSize = this.pSize - 10;
|
|
|
+ this.taskList2 = taskList2.slice(this.pIndex, this.pSize);
|
|
|
+ console.log(this.pIndex+"========"+this.pSize);
|
|
|
+ },
|
|
|
+ afterPage(){
|
|
|
+ if(this.pSize >= taskList2.length){
|
|
|
+ alert("已是最后一页");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.pIndex = this.pSize;
|
|
|
+ this.pSize = this.pSize + 10;
|
|
|
+ this.taskList2 = taskList2.slice(this.pIndex, this.pSize);
|
|
|
+ console.log(this.pIndex+"========"+this.pSize);
|
|
|
+ },
|
|
|
showfile: function (name,file) {
|
|
|
if(file=='pdf'){
|
|
|
hideAll();
|
|
@@ -155,59 +185,60 @@
|
|
|
this.taskList = ServiceProduceTask.getEsopFileList(code);
|
|
|
},
|
|
|
loadData:function(){
|
|
|
- this.cacheDataObject = {};
|
|
|
- //
|
|
|
- const taskList2 = ServiceProduceTask.getEsopTaskList();
|
|
|
- this.num = taskList2.length;
|
|
|
- this.cacheDataObject.taskList2 = {
|
|
|
- data: taskList2,
|
|
|
- pagesize: 11,
|
|
|
- pageindex: 0
|
|
|
- }
|
|
|
- this.taskList2 = taskList2.slice(0, this.cacheDataObject.taskList2.pagesize);
|
|
|
+ // this.cacheDataObject = {};
|
|
|
+ // //
|
|
|
+ // const taskList2 = ServiceProduceTask.getEsopTaskList();
|
|
|
+ // this.num = taskList2.length;
|
|
|
+ // this.cacheDataObject.taskList2 = {
|
|
|
+ // data: taskList2,
|
|
|
+ // pagesize: 11,
|
|
|
+ // pageindex: 0
|
|
|
+ // }
|
|
|
+ // this.taskList2 = taskList2.slice(0, this.cacheDataObject.taskList2.pagesize);
|
|
|
},
|
|
|
// 从服务器加载数据并显示
|
|
|
refreshData: function () {
|
|
|
// 关闭定时器
|
|
|
- clearInterval(this.timer_short);
|
|
|
- this.loadData();
|
|
|
+ // clearInterval(this.timer_short);
|
|
|
+ // this.loadData();
|
|
|
// 开启定时器
|
|
|
- this.timer_short = setInterval(this.scrollData, 30000);
|
|
|
+ // this.timer_short = setInterval(this.scrollData, 30000);
|
|
|
},
|
|
|
// 轮播数据
|
|
|
scrollData: function () {
|
|
|
- for (var key in this.cacheDataObject) {
|
|
|
- const dataList = this.cacheDataObject[key].data;
|
|
|
- const pagesize = this.cacheDataObject[key].pagesize;
|
|
|
- var pageindex = this.cacheDataObject[key].pageindex + 1;
|
|
|
- if (dataList.length > pagesize) {
|
|
|
- const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
|
|
|
- pagesize > 0 ? 1 : 0);
|
|
|
- if (pageindex >= pagesum)
|
|
|
- pageindex = 0;
|
|
|
- this.cacheDataObject[key].pageindex = pageindex;
|
|
|
- const startIndex = pageindex * pagesize;
|
|
|
- const remainSum = dataList.length - startIndex;
|
|
|
- const recordSum = remainSum >= pagesize ? pagesize : remainSum;
|
|
|
-
|
|
|
- const keyPar = dataList.slice(startIndex, startIndex + pagesize);
|
|
|
- if(keyPar.length < 1){
|
|
|
- continue;
|
|
|
- }
|
|
|
- this[key] = dataList.slice(startIndex, startIndex + pagesize);
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (var key in this.cacheDataObject) {
|
|
|
+ // const dataList = this.cacheDataObject[key].data;
|
|
|
+ // const pagesize = this.cacheDataObject[key].pagesize;
|
|
|
+ // var pageindex = this.cacheDataObject[key].pageindex + 1;
|
|
|
+ // if (dataList.length > pagesize) {
|
|
|
+ // const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
|
|
|
+ // pagesize > 0 ? 1 : 0);
|
|
|
+ // if (pageindex >= pagesum)
|
|
|
+ // pageindex = 0;
|
|
|
+ // this.cacheDataObject[key].pageindex = pageindex;
|
|
|
+ // const startIndex = pageindex * pagesize;
|
|
|
+ // const remainSum = dataList.length - startIndex;
|
|
|
+ // const recordSum = remainSum >= pagesize ? pagesize : remainSum;
|
|
|
+
|
|
|
+ // const keyPar = dataList.slice(startIndex, startIndex + pagesize);
|
|
|
+ // if(keyPar.length < 1){
|
|
|
+ // continue;
|
|
|
+ // }
|
|
|
+ // this[key] = dataList.slice(startIndex, startIndex + pagesize);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.timer_long = setInterval(this.refreshData, 60000);
|
|
|
- this.refreshData();
|
|
|
+ this.taskList2 = taskList2.slice(this.pIndex, this.pSize);
|
|
|
+ // this.timer_long = setInterval(this.refreshData, 60000);
|
|
|
+ // this.refreshData();
|
|
|
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
- clearInterval(this.timer_long);
|
|
|
- clearInterval(this.timer_short);
|
|
|
+ // clearInterval(this.timer_long);
|
|
|
+ // clearInterval(this.timer_short);
|
|
|
}
|
|
|
});
|
|
|
</script>
|