Explorar o código

调整报表点击人员在点击部门加载过慢的问题

Lijy %!s(int64=2) %!d(string=hai) anos
pai
achega
76a8271e5d

+ 20 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -152,7 +152,7 @@
                 permissions: JSON.parse(sessionStorage.getItem("permissions")),
                 radio: sessionStorage.radio!=null?sessionStorage.radio:'项目',
                 containerHeight: 0,    
-                myChart: null,
+                // myChart: null,
                 params: null,
                 widthHtval: document.body.clientWidth - 230,
                 users: [],
@@ -775,13 +775,22 @@
                 res => {
                     if (res.code == "ok") {
                         // 更具数据的长度去加每个柱子的间距
-                        for(var i in res.data.costList) {
-                            if(i>20) {
+                        // for(var i in res.data.costList) {
+                        //     if(i>20) {
+                        //         this.widthHtval = +this.widthHtval + 40
+                        //     } else {
+                        //         this.widthHtval = document.body.clientWidth - 230
+                        //     }
+                        // }
+                        // console.log(this.dayjs().add('0','day').format("YYYY-MM-DD HH:mm:ss"), '结束处理')
+                        if(res.data.costList.length > 20) {
+                            for(var i in res.data.costList) {
                                 this.widthHtval = +this.widthHtval + 40
-                            } else {
-                                this.widthHtval = document.body.clientWidth - 230
                             }
+                        } else {
+                            this.widthHtval = document.body.clientWidth - 230
                         }
+
                         var xList = []
                         var yList = []
                         var list
@@ -868,8 +877,7 @@
                             }
                         }
                         totalHours = totalHours.toFixed(1);
-                        
-                        
+                                            
                         var myChart = echarts.init(document.getElementById("container"));
                         myChart.resize({
                             width: this.widthHtval
@@ -1045,6 +1053,7 @@
             },
         },
         created() {
+            this.myChart = null
         },
         mounted() {
             this.containerHeight = window.innerHeight - 200
@@ -1092,6 +1101,10 @@
             this.jutishez()
             this.scrollFunction()
         },
+        beforeDestroy () {
+            var myChart = echarts.init(document.getElementById("container"));
+            myChart.clear()
+        },
     };
 </script>
 

+ 5 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -761,12 +761,16 @@
                 <el-button type="primary" @click="saveGroupIncharger" style="width:100%;" >保存</el-button>
             </div>
         </el-dialog>
-        <el-dialog title="修改任务分组" v-if="modGroupDialog" :visible.sync="modGroupDialog" :close-on-click-modal="false" customClass="customWidth" width="300px">
+        <el-dialog title="修改任务分组" v-if="modGroupDialog" :visible.sync="modGroupDialog" :close-on-click-modal="false" customClass="customWidth" width="400px">
             <el-form ref="form2" :model="groupForm" :rules="rules" style="margin-top:10px;">
                     <el-form-item prop="name">
                         <el-input v-model="groupForm.name" placeholder="请输入分组名称" maxlength="12"
                             show-word-limit clearable></el-input>
                     </el-form-item>
+                    <!-- <el-form-item label="编号">
+                        <el-input v-model="groupForm.code" placeholder="请输入分组编号" maxlength="20"
+                            show-word-limit clearable></el-input>
+                    </el-form-item> -->
                 </el-form>
             <div slot="footer" class="dialog-footer">
                 <el-button type="primary" @click="addGroup" style="width:100%;" >保存</el-button>