Jelajahi Sumber

合并冲突

YaolongHan 4 tahun lalu
induk
melakukan
ba3baae8c8

+ 2 - 1
package.json

@@ -40,7 +40,8 @@
         "vue-pdf": "^4.1.0",
         "vue-quill-editor": "^3.0.6",
         "vue-router": "^3.1.3",
-        "vuex": "^3.4.0"
+        "vuex": "^3.4.0",
+        "xlsx": "^0.16.9"
     },
     "devDependencies": {
         "@typescript-eslint/eslint-plugin": "^2.26.0",

+ 16 - 0
src/api/equipmentList.js

@@ -70,3 +70,19 @@ export function queryBrand({ getParams }) {
 export function queryPicList({ getParams }) {
     return httputils.getJson(`/data/file/getCadList`, getParams)
 }
+// 设备设施-表格模板上传
+export function uploadExcelTemplate({ getParams, data }) {
+    return httputils.postupload(`/data/file/uploadExcelTemplate`, getParams, data)
+}
+// 设备设施-表格上传
+export function uploadExcel({ getParams, data }) {
+    return httputils.postupload(`/data/file/uploadExcel`, getParams, data)
+}
+// 设备设施-表格下载
+export function downloadExcel({ getParams }) {
+    return httputils.download(`/data/file/downloadExcel`, getParams)
+}
+// 设备设施-表格预览
+export function previewExecl({ getParams }) {
+    return httputils.preview(`/data/file/downloadExcel`, getParams)
+}

+ 84 - 27
src/api/httputils.js

@@ -34,6 +34,16 @@ axiosservice.interceptors.request.use(
                 isPreview: isPreview, //默认false,当预览开启的时候是true
             }
         }
+        // Excel文件上传
+        if (config.url.includes('/data/file/uploadExcel')) {
+            config.headers['Content-Type'] = 'multipart/form-data'
+            config.transformRequest = [
+                function (data, headers) {
+                    return data
+                },
+            ]
+        }
+
         return config
     },
     (error) => {
@@ -42,7 +52,7 @@ axiosservice.interceptors.request.use(
 )
 
 axiosservice.interceptors.response.use(
-    function(res) {
+    function (res) {
         //在这里对返回的数据进行处理
         let resp = res.data
         if (resp.result === 'unauthc') {
@@ -66,7 +76,7 @@ axiosservice.interceptors.response.use(
         }
         return res
     },
-    function(err) {
+    function (err) {
         if (err.response.status == 401) {
             store.commit('SETISREQUESTtAUTH', 'err')
             router.push({
@@ -145,10 +155,11 @@ export default {
             throw err
         }
     },
-    async postupload(url, data) {
+    async postupload(url, params, data) {
         try {
             let response = await axiosservice({
                 url,
+                params,
                 data,
                 method: 'post',
                 headers: {
@@ -160,32 +171,78 @@ export default {
             throw err
         }
     },
-    download(url, requestData) {
+    async download(url, params) {
         // 响应类型:arraybuffer, blob
-        axiosservice
-            .post(url, requestData, {
-                responseType: 'blob',
-            })
-            .then((resp) => {
-                let headers = resp.headers
-                let contentType = headers['content-type']
-                if (!resp.data) {
-                    console.error('响应异常:', resp)
-                    return false
-                } else {
-                    //console.log("下载文件:", resp)
-                    const blob = new Blob([resp.data], {
-                        type: contentType,
-                    })
-                    const contentDisposition = resp.headers['content-disposition']
-                    let fileName = 'unknown'
-                    if (contentDisposition) {
-                        fileName = window.decodeURI(resp.headers['content-disposition'].split('=')[1])
+        return new Promise((resolve, reject) => {
+            axiosservice
+                .get(url, {
+                    params,
+                    responseType: 'blob',
+                })
+                .then((resp) => {
+                    let headers = resp.headers
+                    let contentType = headers['content-type']
+                    if (!resp.data?.size) {
+                        console.error('响应异常:', resp)
+                        resolve({ msg: '文件不存在,下载失败!' })
+                        return false
+                    } else {
+                        //console.log("下载文件:", resp)
+                        const blob = new Blob([resp.data], {
+                            type: contentType,
+                        })
+                        const contentDisposition = resp.headers['content-disposition']
+                        let fileName = 'unknown'
+                        if (contentDisposition) {
+                            fileName = window.decodeURI(resp.headers['content-disposition'].split('=')[1])
+                        }
+                        downFile(blob, fileName)
+                        resolve()
                     }
-                    downFile(blob, fileName)
-                }
-            })
-            .catch(function(error) {})
+                })
+                .catch(function (error) { })
+        })
+
+    },
+    // 预览
+    async preview(url, params) {
+        // 响应类型:arraybuffer, blob
+        return new Promise((resolve, reject) => {
+            axiosservice
+                .get(url, {
+                    params,
+                    responseType: 'blob',
+                })
+                .then((resp) => {
+                    let headers = resp.headers
+                    let contentType = headers['content-type']
+                    if (!resp.data?.size) {
+                        console.error('响应异常:', resp)
+                        resolve({ msg: '文件不存在,下载失败!' })
+                        return false
+                    } else {
+                        //console.log("下载文件:", resp)
+                        const blob = new Blob([resp.data], {
+                            type: contentType,
+                        })
+                        // const contentDisposition = resp.headers['content-disposition']
+                        // let fileName = 'unknown'
+                        // if (contentDisposition) {
+                        //     fileName = window.decodeURI(resp.headers['content-disposition'].split('=')[1])
+                        // }
+                        
+                      var reader = new FileReader()
+                        reader.onload = function() {
+                            resolve(this.result)
+                        }
+                        reader.readAsArrayBuffer(blob)
+                        
+                        
+                    }
+                })
+                .catch(function (error) { })
+        })
+
     },
     axios: axiosservice,
 }

+ 2 - 0
src/components/floorMap/darkColorIndex.vue

@@ -554,6 +554,8 @@ export default {
             console.log("errr", res.err);
             return;
           }
+          // 改变底图演示
+          ItemColor.spaceColor = new SColor("#55586F");
           this.fParser = new SFloorParser(null);
           this.fParser.parseData(res);
                    // 改变底图演示

+ 8 - 1
src/components/floorMap/index.vue

@@ -11,6 +11,7 @@
     <!-- 搜索框(仅在供电系统显示) -->
 
     <el-select
+      v-show="showShopSerch"
       class="serchShop"
       v-model="serchmsg"
       filterable
@@ -289,6 +290,7 @@ export default {
       serchmsg: "", //搜索信息
       options: [],
       serchlist: [], //搜索list
+      showShopSerch: false //展示商铺搜索
     };
   },
   props: {
@@ -888,7 +890,8 @@ export default {
       }
       this.clearHightLight();
       // 清空搜索框
-      this.clearShop()
+      this.options = [];
+      this.serchmsg = '';
     },
     // 选中电井关联的商铺高亮
     setHightLight(arr) {
@@ -1050,6 +1053,10 @@ export default {
     },
     getEvent() {
       bus.$on("changeShow", (res) => {
+      // 如果是供电系统则展示搜索商铺选框
+    const categoryId  = this.categoryId ?this.categoryId: this.$cookie.get("categoryId");
+    categoryId == 'GDXT' ? this.showShopSerch = true :this.showShopSerch = false;
+
         this.topologyParser &&
           this.topologyParser.zoneLegendList.forEach((t) => {
             let id = t.data.GraphElementId;

+ 37 - 3
src/components/menuList.vue

@@ -8,7 +8,7 @@
       <div class="downright"></div>
       <div class="home-box">
         <img v-if="!showStyle" src="@/assets/imgs/logo.png" alt />
-        <img v-else src="@/assets/imgs/logo1.png" alt="" />
+        <img width="24px" height="24px" v-else src="@/assets/imgs/logo1.png" alt="" />
         <span>{{ plazaName || "万达集团" }}</span>
         <!-- <span v-if='plazas'>{{plazas.length>0?formatter(plazaId,plazas):'--'}}</span> -->
       </div>
@@ -370,15 +370,19 @@ export default {
     justify-content: space-between;
     background: linear-gradient(180deg, #103979 0%, #162653 100%);
     margin-right: 0px;
+    height:76px;
     .downright {
       position: absolute;
       width: 0;
       height: 0;
-      border-left: 20px solid transparent;
-      border-bottom: 48px solid #0c102c;
+      border-left: 40px solid transparent;
+      border-bottom: 76px solid #0c102c;
       right: 0px;
       top: 0;
     }
+    span{
+      font-size: 30px;
+    }
   }
 
   .btnlist {
@@ -467,10 +471,40 @@ export default {
     padding-left: 3px;
   }
 }
+ .btnlist-style {
+    display: flex;
+    align-content: center;
+    margin-top: 28px;
+    & > div {
+      line-height: 48px;
+      text-align: center;
+       padding-left: 12px;
+      box-sizing: border-box;
+      background: url("../assets/imgs/btn-rect.png") no-repeat;
+      float: left;
+      max-width: 142px;
+      min-width: 100px;
+      height: 48px;
+      margin: 0 8px;
+      cursor: pointer;
+      transition: all 0.2s;
+      color: #fff;
+    }
+    .is-active {
+      color: #95bfff;
+      font-weight: bolder;
+      background: url("../assets/imgs/btn-rect-active.png") no-repeat;
+    }
+  }
 .menu-style {
   background: #0c102c;
   display: flex;
   justify-content: space-between;
+  height: 76px;
+      .home-right{
+      margin-top: 28px;
+      height: 48px;
+    }
 }
 .checkkout {
   display: flex;

+ 18 - 1
src/lib/items/SImageLegendItem.ts

@@ -57,7 +57,24 @@ export class SImageLegendItem extends SIconTextItem {
         }
         this.update()
     }
-
+    get selected() {
+        return this._selected && this.selectable && this.enabled;
+    }
+    set selected(value) {
+        if (this.selected == value) {
+            return;
+        }
+        this._selected = value;
+        if (value) {
+            this.img.scale = 1.6;
+            this.zOrder = ItemOrder.highLightOrder;
+        }
+        else {
+            this.img.scale = 1;
+            this.zOrder = ItemOrder.markOrder;
+        }
+        this.update();
+    }
     /**
      * 构造函数
      *

File diff ditekan karena terlalu besar
+ 830 - 478
src/views/equipment/index.vue


+ 1 - 1
src/views/homepage/Circle.js

@@ -18,7 +18,7 @@ export class SCircle {
         this.circleY = canvas.height / 2;  //中心y坐标
         this.radius = radius; //圆环半径
         this.lineWidth = 5;  //圆形线条的宽度
-        this.fontSize = radius *3/4; //字体大小
+        this.fontSize = radius *3/5; //字体大小
         this.baseName = '本月总任务'
     }
 

+ 65 - 55
src/views/homepage/darkColor.vue

@@ -504,58 +504,55 @@ export default {
     // 获取右侧统计数据
     getRightstatic() {
       // 设置圆环半径
-        const BoxDom = document.getElementsByClassName("canvas-circle")[0];
-        this.canvasCircle = 0;
-        if (BoxDom.offsetHeight > BoxDom.offsetWidth) {
-          this.canvasCircle = BoxDom.offsetWidth / 2;
-        } else {
-          this.canvasCircle = BoxDom.offsetHeight / 2;
-        }
-        // 对右侧数据做遍历
-        this.statisticsList.forEach((statisticItem) => {
-          const TYPE = statisticItem.type; // 类型
-          const Dom = document.getElementById(`canvas_${TYPE}`);
-          // 设置Dom得width\height
-          Dom.height = this.canvasCircle * 2;
-          Dom.width = this.canvasCircle * 2;
-          this.projectStatistics(
-            statisticItem.type,
-            statisticItem.system,
-            statisticItem.type == 1
-              ? moment().format("YYYYMM")
-              : moment().format("YYYY")
-          ).then((res) => {
-            let circle_basename = null;
-            statisticItem.type == 1
-              ? (circle_basename = "本月总任务")
-              : (circle_basename = "本年总任务");
-            const circle = new SCircle(
-              `canvas_${TYPE}`,
-              this.canvasCircle * 0.7
-            );
-            circle.baseName = circle_basename;
-            // 总数
-            let total = 0;
-            // 即将预期
-            let due_num = 0;
-            //  未完成任务
-            let unfinished = 0;
-            // 累计统计
-            res.data.forEach((item) => {
-              total = total + item.total;
-              due_num = due_num + item.due_num;
-              unfinished = unfinished + item.unfinished;
-            });
-            // 赋值
-            Object.assign(statisticItem, {
-              total,
-              due_num,
-              unfinished,
-            });
-            circle.persentTransform(total, due_num, unfinished);
-            circle.setText(total);
+      const BoxDom = document.getElementsByClassName("canvas-circle")[0];
+      this.canvasCircle = 0;
+      if (BoxDom.offsetHeight > BoxDom.offsetWidth) {
+        this.canvasCircle = BoxDom.offsetWidth / 2;
+      } else {
+        this.canvasCircle = BoxDom.offsetHeight / 2;
+      }
+      // 对右侧数据做遍历
+      this.statisticsList.forEach((statisticItem) => {
+        const TYPE = statisticItem.type; // 类型
+        const Dom = document.getElementById(`canvas_${TYPE}`);
+        // 设置Dom得width\height
+        Dom.height = this.canvasCircle * 2;
+        Dom.width = this.canvasCircle * 2;
+        this.projectStatistics(
+          statisticItem.type,
+          statisticItem.system,
+          statisticItem.type == 1
+            ? moment().format("YYYYMM")
+            : moment().format("YYYY")
+        ).then((res) => {
+          let circle_basename = null;
+          statisticItem.type == 1
+            ? (circle_basename = "本月总任务")
+            : (circle_basename = "本年总任务");
+          const circle = new SCircle(`canvas_${TYPE}`, this.canvasCircle * 0.7);
+          circle.baseName = circle_basename;
+          // 总数
+          let total = 0;
+          // 即将预期
+          let due_num = 0;
+          //  未完成任务
+          let unfinished = 0;
+          // 累计统计
+          res.data.forEach((item) => {
+            total = total + item.total;
+            due_num = due_num + item.due_num;
+            unfinished = unfinished + item.unfinished;
           });
+          // 赋值
+          Object.assign(statisticItem, {
+            total,
+            due_num,
+            unfinished,
+          });
+          circle.persentTransform(total, due_num, unfinished);
+          circle.setText(total);
         });
+      });
     },
   },
   created() {
@@ -587,7 +584,7 @@ export default {
   .homepage {
     width: 100%;
     height: 100%;
-    padding: 56px 16px 40px 16px;
+    padding: 30px 16px 40px 16px;
     box-sizing: border-box;
     display: flex;
     .system-main-title {
@@ -601,8 +598,9 @@ export default {
       color: #95bfff;
       position: relative;
       h4 {
-        color: #fff;
+        color: #95bfff;
         margin-left: 18px;
+        font-size: 18px;
       }
       .downright {
         position: absolute;
@@ -675,7 +673,7 @@ export default {
             .system-equipments-container {
               position: relative;
               width: 88%;
-              padding: 10px;
+              padding: 6px;
               margin-left: 18%;
               .more {
                 position: absolute;
@@ -969,7 +967,7 @@ export default {
       box-sizing: border-box;
       .box {
         width: 100%;
-        height: ~"calc((100% - 30px) / 3)";
+        height: ~"calc((100% - 60px) / 3)";
         background: radial-gradient(#20284f 20%, transparent 20%) 0 0;
         background-color: transparent;
         background-size: 8px 8px;
@@ -987,6 +985,18 @@ export default {
               background: rgba(22, 73, 206, 0.36) !important;
               color: #fff !important;
             }
+            /deep/.p-select-search {
+              .p-select-search-box {
+                background-color: rgba(22, 73, 206, 0.36) !important;
+                border: 1px solid #2e5772 !important;
+                .p-select-choice-name {
+                  color: white !important;
+                }
+                .p-select-search-input {
+                  color: white !important;
+                }
+              }
+            }
           }
         }
         .box-bottom {
@@ -1007,7 +1017,7 @@ export default {
           .msg {
             flex: 1;
             padding: 0 0 0 20px;
-            white-space:nowrap;
+            white-space: nowrap;
             box-sizing: border-box;
             .msg-item:nth-of-type(1) {
               display: flex;