Browse Source

优化

master
陈裕财 4 years ago
parent
commit
26063bdab3
  1. 14
      src/common/js/util.js
  2. 7
      src/views/xm/core/xmTask/XmTaskList.vue
  3. 5
      src/views/xm/core/xmTask/XmTaskListForMenu.vue
  4. 17
      src/views/xm/core/xmTask/XmTaskMng.vue
  5. 11
      src/views/xm/core/xmTask/XmTaskMngBatch.vue

14
src/common/js/util.js

@ -16,13 +16,17 @@ export default {
calcTableMaxHeight(cssSelector) {
var table=document.querySelector(cssSelector);
var top=this.getPositionTop(table)
var defaultInnerHeight=913;
var innerHeight=window.innerHeight
if(top==0){
top=100/defaultInnerHeight*innerHeight
var defaultInnerHeight=913;
var pageHeight=80/defaultInnerHeight*innerHeight;
var top=100/defaultInnerHeight*innerHeight;
if(table!=null){
var rect=table.getBoundingClientRect()
if(rect && rect.top!=0){
top=rect.top;
}
}
var maxTableHeight = innerHeight - top-80/defaultInnerHeight*innerHeight;
var maxTableHeight =innerHeight-top-pageHeight;
return maxTableHeight;
},
getPositionTop(node) {

7
src/views/xm/core/xmTask/XmTaskList.vue

@ -469,12 +469,7 @@
mounted() {
this.filters.selProject=this.selProject
this.$nextTick(()=>{
var clientRect=this.$refs.taskTable.$el.getBoundingClientRect();
var subHeight=85/1000 * window.innerHeight;
if(this.selProject){
subHeight=100/1000 * window.innerHeight;
}
this.tableHeight = window.innerHeight -clientRect.y - this.$refs.taskTable.$el.offsetTop-subHeight;
this.tableHeight = util.calcTableMaxHeight('el-table');
this.getXmTasks();
});
listOption([{categoryId:'all',itemCode:'planType'},{categoryId:'all',itemCode:'taskType'},{categoryId:'all',itemCode:'urgencyLevel'},{categoryId:'all',itemCode:'priority'}]).then(res=>{

5
src/views/xm/core/xmTask/XmTaskListForMenu.vue

@ -402,11 +402,6 @@
},
mounted() {
this.$nextTick(()=>{
var subHeight=70/1000 * window.innerHeight;
if(this.isTaskCenter){
subHeight=50/1000 * window.innerHeight;
}
this.tableHeight = util.calcTableMaxHeight('el-table');
this.getXmTasks();
});

17
src/views/xm/core/xmTask/XmTaskMng.vue

@ -2441,22 +2441,7 @@ export default {
}
this.$nextTick(() => {
this.getXmTasks();
var pagination = this.$refs.pagination.$el.offsetHeight;
var clientRect = this.$refs.table.$el.getBoundingClientRect();
var subHeight = (70 / 1000) * window.innerHeight;
this.tableHeight =
window.innerHeight -
clientRect.y -
this.$refs.table.$el.offsetTop -
subHeight -
pagination;
//
/**
let self = this;
window.onresize = function() {
self.tableHeight = util.calcTableMaxHeight('el-table');
}
*/
this.tableHeight = util.calcTableMaxHeight('el-table');
listOption([
{ categoryId: "all", itemCode: "planType" },
{ categoryId: "all", itemCode: "taskType" },

11
src/views/xm/core/xmTask/XmTaskMngBatch.vue

@ -1667,16 +1667,7 @@ export default {
this.getXmTasks();
}
this.$nextTick(() => {
var clientRect = this.$refs.table.$el.getBoundingClientRect();
var subHeight = (70 / 1000) * window.innerHeight;
if (this.isTaskCenter) {
subHeight = (50 / 1000) * window.innerHeight;
}
this.tableHeight =
window.innerHeight -
clientRect.y -
this.$refs.table.$el.offsetTop -
subHeight;
this.tableHeight = util.calcTableMaxHeight('el-table');
listOption([
{ categoryId: "all", itemCode: "planType" },
{ categoryId: "all", itemCode: "taskType" },

Loading…
Cancel
Save