Commit 5acf2840 by 潘建波

feat 任务设置增加10条分页,增加滚动控制修改任务后滚动条还在当前的位置

1 parent 0bb93399
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"test:unit": "vue-cli-service test:unit", "test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"analyzer": "cross-env use_analyzer=true npm run serve", "analyzer": "cross-env use_analyzer=true npm run serve",
"commit": "git add . && git-cz" "commit": "git-cz"
}, },
"dependencies": { "dependencies": {
"@svgdotjs/svg.js": "^3.0.16", "@svgdotjs/svg.js": "^3.0.16",
...@@ -90,5 +90,10 @@ ...@@ -90,5 +90,10 @@
"browserslist": [ "browserslist": [
"> 1%", "> 1%",
"last 2 versions" "last 2 versions"
] ],
"config":{
"commitizen":{
"path":"./node_modules/cz-conventional-changelog"
}
}
} }
...@@ -166,6 +166,7 @@ export default { ...@@ -166,6 +166,7 @@ export default {
priority: "normal", priority: "normal",
period: true period: true
}, },
pedittype:"add",
vchanAry: [], vchanAry: [],
platT: [], platT: [],
sessionData: {}, sessionData: {},
...@@ -187,10 +188,6 @@ export default { ...@@ -187,10 +188,6 @@ export default {
}; };
}, },
props: { props: {
pedittype: {
type: String,
default: "add"
},
freeList: { freeList: {
type: Array, type: Array,
// eslint-disable-next-line vue/require-valid-default-prop // eslint-disable-next-line vue/require-valid-default-prop
...@@ -205,12 +202,13 @@ export default { ...@@ -205,12 +202,13 @@ export default {
var freeArr = []; var freeArr = [];
this.freeList.forEach(ele => { this.freeList.forEach(ele => {
if (ele.license_info && ele.license_info.platType) { if (ele.license_info && ele.license_info.platType) {
this.platT.set(ele.license_info.platType); this.platT.push(ele.license_info.platType);
} }
}); });
} }
}, },
initData(type, pdata) { initData(type, pdata) {
this.pedittype = type;
this.platT = []; this.platT = [];
this.setvisible = true; this.setvisible = true;
if (type == "add") { if (type == "add") {
...@@ -229,6 +227,7 @@ export default { ...@@ -229,6 +227,7 @@ export default {
}; };
} }
if (type == "edit") { if (type == "edit") {
this.pedittype = type;
if (pdata.start_time) { if (pdata.start_time) {
let startT = pdata.start_time; let startT = pdata.start_time;
let endT = pdata.end_time; let endT = pdata.end_time;
......
...@@ -234,9 +234,10 @@ ...@@ -234,9 +234,10 @@
background background
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:page-sizes="[30, 50, 100, 200]" :page-sizes="[10, 30, 50, 100, 200]"
layout="total, prev, pager, next,sizes, jumper" layout="total, prev, pager, next,sizes, jumper"
:current-page="page" :current-page="page"
:page-size="30"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:total="total" :total="total"
...@@ -283,7 +284,8 @@ export default { ...@@ -283,7 +284,8 @@ export default {
subTaskData: [], subTaskData: [],
pedittype: "add", pedittype: "add",
currentRow: {}, currentRow: {},
assign_ip: "" assign_ip: "",
curscrollTop:0
}; };
}, },
components: { components: {
...@@ -408,6 +410,7 @@ export default { ...@@ -408,6 +410,7 @@ export default {
}, },
query() { query() {
this.page = 1; this.page = 1;
this.curscrollTop = 0;
this.getTaskList(); this.getTaskList();
}, },
getTaskList() { getTaskList() {
...@@ -448,14 +451,23 @@ export default { ...@@ -448,14 +451,23 @@ export default {
} }
}); });
this.tableData = res.list_data; this.tableData = res.list_data;
this.$nextTick(() => {
this.$refs.table.$el.children[2].scrollTop = this.curscrollTop;
});
} }
}) })
.catch(error => {}); .catch(error => {});
}, },
editVideo(index, row) { editVideo(index, row) {
this.setsSrollTop();
this.$refs.editvideo.showModal(row); this.$refs.editvideo.showModal(row);
}, },
editTask(type, index, row) { editTask(type, index, row) {
if(type === "add") {
this.curscrollTop = 0;
} else {
this.setsSrollTop();
}
this.$refs.editset.initData(type, row); this.$refs.editset.initData(type, row);
this.pedittype = type; this.pedittype = type;
this.$nextTick(() => { this.$nextTick(() => {
...@@ -463,6 +475,7 @@ export default { ...@@ -463,6 +475,7 @@ export default {
}); });
}, },
setTaskStatus(data, type) { setTaskStatus(data, type) {
this.setsSrollTop();
if (data.status == "NotInTimeOfDay") { if (data.status == "NotInTimeOfDay") {
return; return;
} }
...@@ -494,12 +507,16 @@ export default { ...@@ -494,12 +507,16 @@ export default {
} }
}); });
}); });
},
setsSrollTop() {
this.curscrollTop = this.$refs.table.$el.children[2].scrollTop;
} }
}, },
mounted() { mounted() {
this.getTaskList(); this.getTaskList();
}, },
created() { created() {
this.curscrollTop = 0;
this.getFreelist(); this.getFreelist();
} }
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!