Browse Source

优化

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

20
src/common/js/util.js

@ -14,15 +14,19 @@ function padding(s, len) {
export default { export default {
calcTableMaxHeight(cssSelector) {
calcTableMaxHeight(cssSelector) {
var table=document.querySelector(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 maxTableHeight = innerHeight - top-80/defaultInnerHeight*innerHeight;
var innerHeight=window.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-pageHeight;
return maxTableHeight; return maxTableHeight;
}, },
getPositionTop(node) { getPositionTop(node) {

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

@ -468,13 +468,8 @@
}, },
mounted() { mounted() {
this.filters.selProject=this.selProject 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.$nextTick(()=>{
this.tableHeight = util.calcTableMaxHeight('el-table');
this.getXmTasks(); this.getXmTasks();
}); });
listOption([{categoryId:'all',itemCode:'planType'},{categoryId:'all',itemCode:'taskType'},{categoryId:'all',itemCode:'urgencyLevel'},{categoryId:'all',itemCode:'priority'}]).then(res=>{ listOption([{categoryId:'all',itemCode:'planType'},{categoryId:'all',itemCode:'taskType'},{categoryId:'all',itemCode:'urgencyLevel'},{categoryId:'all',itemCode:'priority'}]).then(res=>{

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

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

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

@ -2440,23 +2440,8 @@ export default {
this.filters.product = this.xmProduct; this.filters.product = this.xmProduct;
} }
this.$nextTick(() => { 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.getXmTasks();
this.tableHeight = util.calcTableMaxHeight('el-table');
listOption([ listOption([
{ categoryId: "all", itemCode: "planType" }, { categoryId: "all", itemCode: "planType" },
{ categoryId: "all", itemCode: "taskType" }, { categoryId: "all", itemCode: "taskType" },

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

@ -1666,17 +1666,8 @@ export default {
if (this.visible == true) { if (this.visible == true) {
this.getXmTasks(); 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.$nextTick(() => {
this.tableHeight = util.calcTableMaxHeight('el-table');
listOption([ listOption([
{ categoryId: "all", itemCode: "planType" }, { categoryId: "all", itemCode: "planType" },
{ categoryId: "all", itemCode: "taskType" }, { categoryId: "all", itemCode: "taskType" },

Loading…
Cancel
Save