Răsfoiți Sursa

首页menusCard组件高度优化,echart显示优化,综合分析页面底部菜单上传数据逻辑优化。

DESKTOP-6LTVLN7\Liumouren 2 ani în urmă
părinte
comite
e6f514a153

+ 2 - 2
src/components/chart/LineChart.vue

@@ -113,9 +113,9 @@ export default {
           }
         },
         yAxis: {
-          min: parseFloat(dataMin - dataMin/10).toFixed(2),
+          min: dataMax === dataMin ? dataMax : parseFloat(dataMin - (dataMax - dataMin) / 2).toFixed(2),
           max: parseFloat(dataMax).toFixed(2),
-          interval: dataMax === dataMin ? dataMax : parseFloat(dataMax - dataMin + dataMin/10).toFixed(2),
+          interval: dataMax === dataMin ? dataMax : parseFloat(dataMax - dataMin).toFixed(2),
           type: "value",
           scale: true,
           splitLine: {

+ 16 - 45
src/components/common/BottomForm/UploadingData.vue

@@ -1,11 +1,6 @@
 <template>
   <!-- 上传数据弹窗 -->
-  <el-dialog
-    title="上传数据"
-    :visible.sync="dialogVisible"
-    :before-close="handleClose"
-    width="400px"
-  >
+  <el-dialog title="上传数据" :visible.sync="dialogVisible" :before-close="handleClose" width="400px">
     <template slot="title">
       <div class="dialogTitle">
         <div class="dialogTitleIcon"></div>
@@ -23,15 +18,12 @@
         :before-remove="beforeRemove"
         :before-upload="beforeAvatarUpload"
         multiple
-        :limit="1"
         :on-exceed="handleExceed"
         :file-list="fileList"
       >
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
-        <div class="el-upload__tip" slot="tip">
-          *仅支持Geojson格式文件,且不超过5MB
-        </div>
+        <div class="el-upload__tip" slot="tip">*仅支持Geojson格式文件,且不超过5MB</div>
       </el-upload>
     </div>
     <span slot="footer" class="dialog-footer">
@@ -57,7 +49,7 @@ export default {
       // 上传文件列表
       fileList: [],
       // 上传数据弹窗显示状态
-      dialogVisible: false,
+      dialogVisible: false
     };
   },
   mounted() {
@@ -83,13 +75,6 @@ export default {
     handleClose() {
       if (this.dialogVisible) {
         this.clearDialogVisible();
-        this.$confirm("确认关闭?")
-          .then((_) => {
-            console.log("确认关闭吗");
-
-            this.clearDialogVisible();
-          })
-          .catch((_) => {});
       }
     },
     // 上传数据关闭
@@ -101,16 +86,14 @@ export default {
     },
     // 上传数据表单提交
     subMitDialogVisible() {
-      this.$message.success("数据上传成功!");
       setTimeout(() => {
         if (map2DViewer.analysisGroups[`upload_layer_unique`]) {
-          map2DViewer.map.fitBounds(
-            map2DViewer.analysisGroups[`upload_layer_unique`].getBounds()
-          );
+          this.$message.success("数据上传成功!");
+          map2DViewer.map.fitBounds(map2DViewer.analysisGroups[`upload_layer_unique`].getBounds());
         }
         let options = {
           id: "upload_layer_unique",
-          label: "我的图层1",
+          label: "我的图层1"
         };
         this.$bus.$emit("addUploadLayerEvent", options);
       }, 1000);
@@ -119,7 +102,7 @@ export default {
     },
     // 文件列表移除文件时
     handleRemove(file, fileList) {
-      console.log(file, fileList);
+      console.log("删除数据中移除文件", file, fileList);
     },
     // 点击文件列表中已上传的文件时
     handlePreview(file) {
@@ -127,25 +110,20 @@ export default {
     },
     // 文件超出个数限制时
     handleExceed(files, fileList) {
-      this.$message.warning(
-        `当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
-          files.length + fileList.length
-        } 个文件`
-      );
+      // this.$message.warning(
+      //   `当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
+      //     files.length + fileList.length
+      //   } 个文件`
+      // );
     },
     // 删除文件之前
     beforeRemove(file, fileList) {
-      this.$store.state.mapMethodsCollection
-        .get("RENDER")
-        .deletePolygonLayer("upload_layer");
-      delete map2DViewer.polygons["upload_layer"];
       this.$message.success(`文件${file.name}移除成功!`);
       return true;
     },
     // 文件上传成功时
     handleSuccess(response, file, fileList) {
       this.getActionData(file);
-      // console.log("文件上传成功", response, file, fileList);
     },
     // 根据上传的文件渲染到地图中
     uploadRENDER(geoJson) {
@@ -164,19 +142,13 @@ export default {
           let geometry = JSON.stringify(ele);
           this.$store.state.mapMethodsCollection
             .get("RENDER")
-            .addSinglePolygon(
-              geometry,
-              cid,
-              "rgb(0,255,255)",
-              uniqueId,
-              "我的图层",
-              "土地资源"
-            );
+            .addSinglePolygon(geometry, cid, "rgb(0,255,255)", uniqueId, "我的图层", "土地资源");
         });
       }
     },
     // 读取file对象内容
     getActionData(file) {
+      // console.log();
       const __this = this;
       var reader = new FileReader(); // 新建一个FileReader
       reader.readAsText(file.raw, "UTF-8"); // 读取文件
@@ -184,7 +156,6 @@ export default {
         //读取文件完毕执行此函数
         const dataJson = JSON.parse(evt.target.result);
         __this.uploadRENDER(dataJson);
-        // console.log("上传的文件内容:", dataJson);
       };
     },
     // 上传文件之前
@@ -198,9 +169,9 @@ export default {
         this.$message.error("上传文件大小不能超过 5MB!");
       }
       return isJPG && isLt5M;
-    },
+    }
   },
-  watch: {},
+  watch: {}
 };
 </script>
 <style lang="less" scoped>

+ 2 - 2
src/components/layout/MenuCard.vue

@@ -81,7 +81,7 @@
     <div class="menuMainBox_main" v-if="menuData.type === 'card'">
       <!-- 上部 -->
       <div class="menuMainBox_main_top" v-if="!menuData.topSolt">
-        <slot name="top"> </slot>
+        <!-- <slot name="top"> </slot> -->
         <TopCard v-if="menuData.commonName == 'TOP'" :dataList="menuData.topData" :columnName="menuData.field" />
       </div>
       <div class="menuMainBox_main_top" v-if="menuData.topSolt">
@@ -1126,7 +1126,7 @@ export default {
   position: relative;
   padding-top: 10px;
   width: 100%;
-  height: calc(100% - 30px);
+  height: calc(100% - 36px);
   background-image: --webkit-linear-gradient(to top, @topTitleMinLeft, @topTitleBgLeft);
   background-image: --moz-linear-gradient(to top, @topTitleMinLeft, @topTitleBgLeft);
   background-image: linear-gradient(to top, @topTitleMinLeft, @topTitleBgLeft);

+ 1 - 0
src/config/common.js

@@ -1182,6 +1182,7 @@ export const menuOnLine = {
         title: "历年频发问题TOP10",
         titleWidth: 81,
         menuIndex: "1",
+        boxHeight: 320,
         position: "right",
         minDomWidth: 1000,
         getUrl: "/dms/content/selectGroupByCountOrderBy",