Просмотр исходного кода

Merge branch 'master' into dev_duxiangyu

# Conflicts:
#	src/components/frame/pageRight.vue
duxiangyu 3 лет назад
Родитель
Сommit
a9c8986ff1

+ 2 - 1
.gitignore

@@ -1,2 +1,3 @@
 node_modules
-package-lock.json
+package-lock.json
+/adm-frontend/*

+ 31 - 0
docker/dockerfiles/adm-frontend/Dockerfile

@@ -0,0 +1,31 @@
+FROM nginx:1.16.1
+
+MAINTAINER lijie<lijie@persagy.com>
+
+ARG PROGRAM_ID
+ARG PORT_LOCAL
+
+LABEL tier=frontend
+LABEL product=bdtp
+LABEL project=adm-frontend
+LABEL name=$PROGRAM_ID
+
+#ENV JAVA_OPTS -Dfile.encoding=UTF-8 -Xms300m -Xmx1024m
+ENV TZ Asia/Shanghai
+ENV WORKER_HOME /usr/persagy/saas-web
+ENV CONFIG_PATH /data/SpringCloud
+ENV PROGRAM_NAME $PROGRAM_ID
+
+WORKDIR $WORKER_HOME
+
+RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list \
+    && apt-get update \
+    && apt-get install -y --no-install-recommends tzdata unzip \
+    && apt-get autoclean \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/*
+
+RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' > /etc/timezone
+COPY *.zip $WORKER_HOME/
+RUN unzip *.zip
+RUN rm -rf ./*.zip

+ 59 - 0
docker/k8sfiles/adm-frontend.yml

@@ -0,0 +1,59 @@
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: adm-frontend
+  labels:
+    app: adm-frontend
+spec:
+  selector:
+    app: adm-frontend
+  ports:
+    - port: 80
+      targetPort: 80
+      name: server-port
+
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: adm-frontend
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: adm-frontend
+  template:
+    metadata:
+      labels:
+        app: adm-frontend
+    spec:
+      containers:
+        - name: adm-frontend
+          image: labisenlin.persagy.com/library/adm-frontend:latest
+          imagePullPolicy: Always
+          ports:
+            - containerPort: 80
+              name: server-port
+          resources:
+            limits:
+              memory: 1Gi
+            requests:
+              memory: 512Mi
+          env:
+            - name: TZ
+              value: Asia/Shanghai
+            - name: SERVER_PORT
+              value: "80"
+          volumeMounts:
+            - name: config
+              mountPath: /etc/nginx/nginx.conf
+              subPath: path/to/nginx.conf.js
+      volumes:
+        - name: config
+          configMap:
+            name: public-config
+            defaultMode: 0777
+            items:
+              - key: nginx.conf
+                path: path/to/nginx.conf.js

+ 80 - 0
docker/k8sfiles/configmap.yml

@@ -0,0 +1,80 @@
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: adm-frontend
+  namespace: persagy
+  labels:
+    name: adm-frontend
+data:
+  nginx.conf: |
+    #user tony;
+    worker_processes 4;
+    error_log /var/log/nginx/error.log;
+    pid /run/nginx.pid;
+    worker_rlimit_nofile 100001;
+    # Load dynamic modules. See /usr/share/nginx/README.dynamic.
+    include /usr/share/nginx/modules/*.conf;
+
+    events {
+        worker_connections 1024;
+    }
+
+    http {
+        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+                          '$status $body_bytes_sent "$http_referer" '
+                          '"$http_user_agent" "$http_x_forwarded_for" "$request_time"';
+
+        access_log  /var/log/nginx/access.log  main;
+
+        sendfile            on;
+        tcp_nopush          on;
+        tcp_nodelay         on;
+        keepalive_timeout   65;
+        types_hash_max_size 2048;
+
+        include             /etc/nginx/mime.types;
+        default_type        application/octet-stream;
+
+        gzip  on;
+        gzip_min_length 1k;
+        gzip_buffers 4 16k;
+        gzip_http_version 1.1;
+        gzip_comp_level 2;
+        gzip_types text/plain application/x-javascript application/css  text/css application/xml text/javascript application/x-httpd-php
+        gzip_vary on;
+
+        server {
+            listen 80 default_server;
+            root /usr/persagy/saas-web;
+
+            # FMS
+            location /admplus {
+                try_files $uri $uri/ /adm-frontend/index.html;
+            }
+    
+            location @rewrites {
+                rewrite ^(.+)$ /index.html last;
+            }
+
+            location ~* \.(?:ico|css|js|woff|eot|otf|ttf)$ {
+                # Some basic cache-control for static files to be sent to the browser
+                add_header  Access-Control-Allow-Origin *;
+            }
+            location ~index.html
+            {
+                    add_header Cache-Control no-cache;
+            }
+        }
+
+    }
+  vue.config.js: |
+    module.exports = {
+        devServer: {
+            proxy: {
+                '/admplus': {
+                    target: 'http://adm-frontend:8838',
+                },
+            },
+        },
+    }

+ 1 - 1
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "padm",
+  "name": "adm-frontend",
   "version": "0.0.0",
   "private": true,
   "description": "",

+ 27 - 2
public/systemConf.js

@@ -1,10 +1,24 @@
 var __systemConf = {
+  //路由根路径
+  baseRouteUrl: 'adm-frontend',
   //基础数据根域名
   baseServiceUrl: '/baseService',
   //系统图服务域名
   sysGraphServiceUrl: '/sysGraphService',
   // 地图key
   mapKey: 'd42beb96e0e4fb0d49482975abeae1b7',
+  //系统图的默认配置
+  systemGraph: {
+    //配电类
+    peiDian: {
+      text: {
+        size: 16,
+        color: '#646C73',
+        weight: 600,
+        backGround: '#FFFFFF'
+      }
+    }
+  },
   //导航菜单
   menus: [{
     "id": "ready",
@@ -51,7 +65,7 @@ var __systemConf = {
       "id": "CADtuzhiguanli",
       "name": "CAD核查图纸管理",
       "orders": 7,
-      "url": "/deliver/cadDrawingManage",
+      "url": "/deliveryTools/cadDrawingManage",
       "icon": "icon-topology"
     }]
   }, {
@@ -67,4 +81,15 @@ var __systemConf = {
     }]
   }]
 };
-window.__systemConf = __systemConf;
+
+if (typeof window != 'undefined') {
+  window.__systemConf = __systemConf;
+}
+
+if (typeof module != 'undefined') {
+  module.exports = __systemConf;
+}
+
+// if (typeof export != 'undefined') {
+//   module.exports = __systemConf;
+// }

+ 211 - 6
src/components/cadDrawingManage/index.vue

@@ -1,24 +1,229 @@
 <!--
  * @Author: ql
  * @Date: 2022-01-11 14:46:04
- * @LastEditTime: 2022-01-11 17:32:34
+ * @LastEditTime: 2022-01-14 15:18:59
  * @LastEditors: Please set LastEditors
  * @FilePath: \adm-frontend\src\components\cadDrawingManage\index.vue
 -->
 <template>
-  <div>
-      <div>
-        
-      </div>
+  <div class="contentContainer">
+      <el-row class="h100">
+        <el-col :span="4" class="h100">
+          <div class="grid-content bg-purple bg h100" style="overflow-y: scroll">
+            <Tree
+                :data="options"
+                @change="selectFloorHandle"
+            />
+          </div>
+        </el-col>
+        <el-col :span="20" style="padding-left: 24px" class="h100">
+          <div class="grid-content bg-purple-light tab-right bg h100" style="padding: 0 16px 16px">
+            <div class="tab_warp">
+              <Tabs type="first-nav" :data="MENU_MAP" v-model="currentTab"  />
+            </div> 
+            <div>
+              <div style="display: flex;  justify-content: space-between;margin-top: 24px">
+                  <h3>图纸文件列表</h3>
+                  
+                  <div>
+                    <Button type="primary" :disabled='true' icon="el-icon-download">批量导出</Button>
+                    <el-upload
+                      class="upload"
+                      ref="upload"
+                      :multiple="true"
+                      action="https://jsonplaceholder.typicode.com/posts/"
+                      :file-list="fileList"
+                      :show-file-list="false"
+                      :on-change='fileChange'
+                      :on-progress='progressHandle'
+                      :auto-upload="false">
+                        <Button slot="trigger"  type="primary" icon="el-icon-download">上传.dwg CAD文件</Button>
+                    </el-upload>
+                  </div>
+                 
+              </div>
+              <div class="tableView1">
+                <el-table
+                  ref="multipleTable"
+                  :data="tableList"
+                  tooltip-effect="dark"
+                  v-loading="tableLoading"
+                  style="width: 100%"
+                  @selection-change="handleSelectionChange">
+                  <el-table-column
+                    type="selection"
+                    width="55">
+                  </el-table-column>
+                  <el-table-column
+                    label="文件名称"
+                    prop="fileName"
+                  >
+                  </el-table-column>
+                  <el-table-column 
+                    label="最新上传时间"
+                  >
+                    <template slot-scope="scope">{{ scope.row.modifiedTime }}</template>
+                  </el-table-column>
+                  <el-table-column
+                    prop="creator"
+                    label="上传人"
+                  >
+                  </el-table-column>
+                  <el-table-column
+                    fixed="right"
+                    label="操作"
+                  >
+                    <template slot-scope="scope">
+                      <el-button @click="delHandle(scope.row)" type="text" size="small">删除</el-button>
+                      <el-divider direction="vertical"></el-divider>
+                      <el-button type="text" size="small" disabled>导出</el-button>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
   </div>
 </template>
 
 <script>
+import { Tree, Tabs, Button } from 'meri-design'
+import { MENU_MAP } from '@/data/cadConst'
+import BuildController from "@/controller/old-adm/buildController"
+import cadDrawingController from '@/controller/cadDarwingController'
 export default {
+  components: {
+    Tree,
+    Tabs,
+    Button,
+  },
+  watch: {
+    currentTab(nv, ov) {
+      console.log({nv, ov})
+    }
+  },
+  data() {
+    return {
+      currentTab: 'id1',
+      MENU_MAP,
+      options: [],
+      tableList: [],  //文件列表数据
+      tableLoading: false,
+      fileList: [], //已选择文件
+      // 基础表格表头列表
+      headList: [
+        {
+            title: "文件名称", // 列的名称
+            key: "state", // 列的标识
+            show: true // 是否显示该列
+        },
+        {
+            title: "最新上传时间",
+            key: "name",
+            show: true,
+            width: 300
+        },
+        {
+            title: "上传人",
+            key: "job",
+            show: true
+        }
+      ],
+    }
+  },
+  methods: {
+    // 获取楼层信息
+    async getCascader() {
+      let param = {
+          cascade: [{ name: "floor", orders: "floorSequenceID desc", filters: `id != '${this.floorId}'` }],
+          pageNumber: 1,
+          pageSize: 50,
+      };
+    
+      this.options = await BuildController.buildDataFormat(param);
+      
+    },
+    // 选择楼层
+    selectFloorHandle(id) {
+      console.log({id})
+    },
+    // 获取文件列表数据
+    async getFileList () {
+      this.tableLoading = true
+      this.tableList = await cadDrawingController.queryFileList();
+      this.tableLoading = false
+      console.log({res})
+    },
+    fileChange(file, fileList) {
+      console.log({file, fileList})
+    },
+    progressHandle(e, file, fileList) {
+       console.log({file, fileList})
+    },
+    delHandle(row) {
+      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async() => {
+          this.tableLoading = true
+          await cadDrawingController.delFile(row);
+          this.tableLoading = false;
+          this.getFileList();
+          this.$message({
+            type: 'success',
+            message: '删除成功!'
+          });
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          });          
+        });
+    }
+
+  },
+  mounted() {
+    this.getCascader()
+    this.getFileList()
+  }
 
 }
 </script>
 
-<style>
+<style scoped lang='less'>
+  .tab-right{
+    & /deep/ .el-divider--horizontal {
+      height: 0.5px;
+    }
+    & /deep/ .upload {
+      display: inline-block;
+      margin-left: 16px;
+    }
+  }
+  .bg {
+    background: #fff;
+  }
+  .h100 {
+    height: 100%;
+  }
+  .tableView1 {
+    margin-top: 16px;
+    height: 290px
+  }
+  .tab_warp {
+    display: flex;
+    justify-content: center;
+    border-bottom: 1px solid #eff0f1;
+    box-sizing: border-box;
+    & /deep/ .p-tabs-nav-wrap {
+      box-sizing: content-box;
+      margin-bottom: -1px;
+    }
+  }
+                
 
+  
 </style>

+ 5 - 1
src/components/frame/pageRight.vue

@@ -49,12 +49,14 @@
     <div class="contentContainer">
       <router-view class="page-content"></router-view>
     </div>
+    <uploadFile />
   </div>
 </template>
 <script>
 import { mapState } from "vuex";
 import { sessionStore } from "@/store/sessionStore";
 import { logicConfig } from "@/logicConfig";
+import uploadFile from "@/components/uploadFile";
 export default {
   props: [],
   data() {
@@ -85,7 +87,9 @@ export default {
   created() {},
   watch: {},
   mounted() {},
-  components: {},
+  components: {
+    uploadFile,
+  },
 };
 </script>
 

+ 1 - 2
src/components/systemGraph/addGraph.vue

@@ -65,7 +65,6 @@ import { mapState } from "vuex";
 import { sysGraphController } from "@/controller/systemGraph/sysGraphController";
 import { logicConfig } from "@/logicConfig";
 import { Message } from "element-ui";
-import packageConfig from "../../../package.json";
 
 export default {
   props: ["isVisible"],
@@ -177,7 +176,7 @@ export default {
               this.selProject.groupCode,
               this.selProject.id,
               this.selProject.name,
-              packageConfig.name,
+              window.__systemConf.baseRouteUrl,
               false
             );
             break;

+ 204 - 17
src/components/systemGraph/edit.vue

@@ -225,13 +225,21 @@
         </div>
         <div v-if="selGraphPartType == 3">
           <div class="title titleMargin">文字</div>
-          <div class="titleText eqName">1#进线柜</div>
+          <div class="titleText eqName" v-text="selText.text">1#进线柜</div>
           <div class="detailSplitLine"></div>
           <div class="title titleMargin">
             <span>x</span>
-            <span class="coridTitleText titleText">100</span>
+            <span
+              class="coridTitleText titleText"
+              v-text="(selText.absolutePosition || {}).x"
+              >100</span
+            >
             <span class="coridTitle2">y</span>
-            <span class="coridTitleText titleText">100</span>
+            <span
+              class="coridTitleText titleText"
+              v-text="(selText.absolutePosition || {}).y"
+              >100</span
+            >
           </div>
           <div class="detailSplitLine"></div>
           <div class="title titleMargin">字体样式</div>
@@ -257,20 +265,42 @@
           </div>
           <div class="title titleMargin">字体颜色</div>
           <div class="titleMargin fontColor">
-            <input type="color" v-model="fontColor" />
+            <input
+              type="color"
+              v-model="fontColor"
+              @change="selFontColorChange"
+            />
             <div v-text="fontColor"></div>
             <div>100%</div>
           </div>
           <div class="title titleMargin">背景颜色</div>
           <div class="titleMargin fontColor">
-            <input type="color" v-model="backColor" />
-            <div v-text="backColor"></div>
+            <input
+              type="color"
+              v-model="fontBackColor"
+              @change="selFontBackColorChange"
+            />
+            <div v-text="fontBackColor"></div>
             <div>100%</div>
           </div>
         </div>
-        <div class="delBtn" v-if="selGraphPartType == 1">删除设备</div>
-        <div class="delBtn" v-if="selGraphPartType == 2">删除管线</div>
-        <div class="delBtn" v-if="selGraphPartType == 3">删除文字</div>
+        <div
+          class="delBtn"
+          v-if="selGraphPartType == 1 && operState == 1"
+          @click="delEquip"
+        >
+          删除设备
+        </div>
+        <div class="delBtn" v-if="selGraphPartType == 2 && operState == 1">
+          删除管线
+        </div>
+        <div
+          class="delBtn"
+          v-if="selGraphPartType == 3 && operState == 1"
+          @click="delText"
+        >
+          删除文字
+        </div>
       </div>
     </div>
 
@@ -378,8 +408,8 @@ export default {
       selFontSize: {},
       //字体颜色
       fontColor: "#eb5757",
-      //背景颜色
-      backColor: "#ffffff",
+      //字体背景颜色
+      fontBackColor: "#ffffff",
       //系统图原始数据
       graphOriginInfo: {},
       //系统图数据
@@ -411,6 +441,23 @@ export default {
           }
        */
       selEquip: {},
+      /*选择的文本,格式如下:
+      {
+          id:'',
+          text:'',
+          style:{
+            color: '',
+            fontSize: '',
+            backGround:'',
+            fontWeight:1
+          },
+          //文本的绝对位置
+          absolutePosition: {
+            x: 1,
+            y: 1,
+          },
+        }*/
+      selText: {},
       //是否展示左侧系统图基础信息
       isVisibleLeft: true,
     };
@@ -437,7 +484,40 @@ export default {
       console.log(this.selLineEndPoint);
     },
     //字号选择事件
-    selFontSizeChange: function () {},
+    selFontSizeChange: function () {
+      //更新graphInfo中的数据
+      this.updateGraphInfo(3, 2, { id: this.selText.id });
+      //更新图形以及图形数据源
+      this.$refs.graphc.updateDataAndGraph(3, 2, {
+        id: this.selText.id,
+        fontSize: this.selFontSize.id,
+      });
+    },
+    //字体颜色改变事件
+    selFontColorChange: function () {
+      //更新graphInfo中的数据
+      this.updateGraphInfo(3, 3, { id: this.selText.id });
+      //更新图形以及图形数据源
+      this.$refs.graphc.updateDataAndGraph(3, 3, {
+        id: this.selText.id,
+        fontColor: this.fontColor,
+      });
+    },
+    //字体backColor颜色改变事件
+    selFontBackColorChange: function () {
+      //更新graphInfo中的数据
+      this.updateGraphInfo(3, 4, { id: this.selText.id });
+      //更新图形以及图形数据源
+      this.$refs.graphc.updateDataAndGraph(3, 4, {
+        id: this.selText.id,
+        fontColor: this.fontBackColor,
+      });
+    },
+    //删除选择的文本节点
+    delText: function () {
+      this.$refs.graphc.updateDataAndGraph(3, 5, { id: this.selText.id });
+      this.updateGraphInfo(3, 5, { id: this.selText.id });
+    },
     //根据系统图ID获取系统图数据
     getDiagramById: async function () {
       this.fullscreenLoading = true;
@@ -465,12 +545,37 @@ export default {
      * type 1 设备;  2 线;  3 文本
      */
     graphClickCall: function (dataObj, type) {
+      var _this = this;
+      var oldPartType = this.selGraphPartType;
       this.selGraphPartType = type;
-      this.selEquip = dataObj || {};
+      switch (type) {
+        //设备
+        case 1:
+          this.selEquip = dataObj || {};
+          break;
+        //线
+        case 2:
+          // this.selEquip = dataObj || {};
+          break;
+        //文本
+        case 3:
+          this.selText = dataObj || {};
+          this.selFontSize =
+            _this.fontSizeArr.filter((_c) => {
+              return _c.id == _this.selText.style.fontSize;
+            })[0] || {};
+          this.fontColor = this.selText.style.color;
+          this.fontBackColor = this.selText.style.backGround;
+          break;
+      }
+
       var _this = this;
-      Vue.nextTick(function () {
-        _this.$refs.graphc.resetDraw();
-      });
+      //oldPartType为-1的时候,说明右侧面板之前是关闭的,那么展示后会导致图形区域变小,所以需要重绘图形
+      if (oldPartType == -1) {
+        Vue.nextTick(function () {
+          _this.$refs.graphc.resetDraw();
+        });
+      }
     },
     /**
      * 保存图纸按钮事件
@@ -579,6 +684,88 @@ export default {
       var newScale = this.$refs.graphc.graphScaleCompute(-0.25);
       this.$refs.graphc.graphScale(newScale);
     },
+    //删除选择的设备节点
+    delEquip: function () {
+      this.$refs.graphc.updateDataAndGraph(1, 1, { id: this.selEquip.id });
+      this.updateGraphInfo(1, 1, { id: this.selEquip.id });
+    },
+    //graphInfo中移出对应的数据
+    removeFromData: function (id) {
+      this.graphInfo.template.frame.children = remove(
+        this.graphInfo.template.frame.children
+      );
+
+      function remove(dataArr) {
+        for (let i = 0; i < dataArr.length; i++) {
+          let _dataObj = dataArr[i];
+          if (_dataObj.id == id) {
+            dataArr.splice(i, 1);
+            return dataArr;
+          }
+          if (_dataObj.compType == "container") {
+            var result = remove(_dataObj.children);
+            if (result) {
+              _dataObj.children = result;
+              return dataArr;
+            }
+          }
+        }
+        return null;
+      }
+    },
+
+    /**
+     * 更新graphInfo中的数据
+     * dataType 1 设备;  2 线;  3 文本
+     * operType 1 移除设备节点;  2 更新文本字体大小;  3 更新文本颜色;  4 更新文本背景色;  5 移除文本节点
+     * exprObj 扩展数据,支持:{id:'数据id'}
+     */
+    updateGraphInfo: function (dataType, operType, exprObj) {
+      var _this = this;
+      _each(this.graphInfo.template.frame.children);
+
+      function _each(dataArr) {
+        for (let i = 0; i < dataArr.length; i++) {
+          let _dataObj = dataArr[i];
+
+          var _id =
+            dataType == 1
+              ? _dataObj.id
+              : dataType == 3
+              ? (_dataObj.label || {}).id
+              : "";
+          if (_id == exprObj.id) {
+            switch (operType) {
+              case 1:
+                dataArr.splice(i, 1);
+                break;
+              case 2:
+                _dataObj.label.style.fontSize = _this.selFontSize.id;
+                break;
+              case 3:
+                _dataObj.label.style.color = _this.fontColor;
+                break;
+              case 4:
+                _dataObj.label.style.backGround = _this.fontBackColor;
+                break;
+              case 5:
+                _dataObj.label.content = "";
+                break;
+            }
+
+            return dataArr;
+          }
+          if (_dataObj.compType == "container") {
+            var result = _each(_dataObj.children);
+            if (result) {
+              _dataObj.children = result;
+              return dataArr;
+            }
+          }
+        }
+        return null;
+      }
+    },
   },
   created() {
     this.operState = !this.$route.query.ost
@@ -595,7 +782,7 @@ export default {
   mounted() {
     var _this = this;
     (async function () {
-      //操作状态  0 预览; 1 编辑;  2 新建
+      //操作状态  0 预览; 1 编辑;  2 新建  进来时是预览或编辑状态时需要加载系统图数据并绘图
       if (_this.operState === 0 || _this.operState === 1) {
         await _this.getDiagramById();
         _this.$refs.graphc.drawEntry(_this.graphInfo);

+ 153 - 2
src/components/systemGraph/graph.vue

@@ -39,9 +39,36 @@ export default {
           }
       */
       nodeArr: [],
-      //线数组
+      /**
+       * 线数组,格式如下:
+       * lines:[{
+          id: '',
+          path:[{x:1,y:1}],
+          style: {
+                    lineWidth: 4, //线宽
+                    lineColor: '#8D9399', //线的颜色
+                  }
+        }]
+       */
       lineArr: [],
-      //文本数组
+      /**
+       * 文本数组,格式如下:
+       * labels: [{
+          id:'',
+          text:'',
+          style:{
+            color: '',
+            fontSize: '',
+            backGround:'',
+            fontWeight:1
+          },
+          //文本的绝对位置
+          absolutePosition: {
+            x: 1,
+            y: 1,
+          },
+        }]
+       */
       labelArr: [],
       //存放图形用的一些信息点
       canvasProObj: {
@@ -140,6 +167,7 @@ export default {
         var newHeight =
           _dataObj.legendObj.size.height * _this.canvasProObj.originalScale;
         graphicsRect.drawRect(newCordObj.x, newCordObj.y, newWidth, newHeight);
+        //设置点击范围,不然click事件不会触发
         graphicsRect.hitArea = graphicsRect.getBounds();
 
         graphicsRect.name = _dataObj.id;
@@ -179,6 +207,33 @@ export default {
         pixiApp.stage.addChild(legendSprite);
       });
 
+      //文本
+      _this.labelArr.forEach((_labelObj) => {
+        var pixiTextStyle = new PIXI.TextStyle({
+          fill: _labelObj.style.color,
+          fontSize: _labelObj.style.fontSize,
+          fontWeight: _labelObj.style.fontWeight,
+          // stroke: "#ffffff",
+          // strokeThickness: _this.defaultStyle.text.fontStrokeWidth,
+        });
+        var textInstance = new PIXI.Text(_labelObj.text, pixiTextStyle);
+        textInstance.name = _labelObj.id;
+
+        let newCordObj = _this.convertCoordToLeftOrigina({
+          x: _labelObj.absolutePosition.x,
+          y: _labelObj.absolutePosition.y,
+        });
+
+        textInstance.position.set(newCordObj.x, newCordObj.y);
+        // console.log(textInstance.width, "-", textInstance.height);
+        //启用事件
+        textInstance.interactive = true;
+        textInstance.on("click", (event) => {
+          _this.clickEventCall(event, 3);
+        });
+        pixiApp.stage.addChild(textInstance);
+      });
+
       return;
       //画线
       _this.dataSource.view.diagram.lines.forEach((_cLine) => {
@@ -233,6 +288,47 @@ export default {
             x: _dataObj.location.x + absolutePosition.x,
             y: _dataObj.location.y + absolutePosition.y,
           };
+
+          //文本
+          if (_dataObj.label && _dataObj.label.content) {
+            let _labelObj = _dataObj.label;
+            _labelObj.id = _labelObj.id || Math.random().toString();
+
+            let _style = _labelObj.style || {};
+            _style.color =
+              _style.color ||
+              window.__systemConf.systemGraph.peiDian.text.color;
+            _style.fontSize =
+              _style.fontSize ||
+              window.__systemConf.systemGraph.peiDian.text.size;
+            _style.backGround =
+              _style.backGround ||
+              window.__systemConf.systemGraph.peiDian.text.backGround;
+            _style.fontWeight =
+              _style.fontWeight ||
+              window.__systemConf.systemGraph.peiDian.text.weight;
+
+            var textNewAbsolutePosition = {
+              x: _labelObj.location.x + newAbsolutePosition.x,
+              y: _labelObj.location.y + newAbsolutePosition.y,
+            };
+
+            labelArr.push({
+              id: _labelObj.id,
+              text: _labelObj.content,
+              style: {
+                color: _style.color,
+                fontSize: _style.fontSize,
+                backGround: _style.backGround,
+                fontWeight: _style.fontWeight,
+              },
+              //文本的绝对位置
+              absolutePosition: textNewAbsolutePosition,
+            });
+
+            _labelObj.style = _style;
+            _dataObj.label = _labelObj;
+          }
           switch (_dataObj.compType) {
             //容器
             case "container":
@@ -429,6 +525,61 @@ export default {
         this.canvasProObj.positionPxY
       );
     },
+    /**
+     * 从舞台上移出元素:图例、线、文本
+     * id 数据ID,即元素的name
+     * type 1 设备;  2 线;  3 文本
+     */
+    /**
+     * 更新graphInfo中的数据
+     * dataType 1 设备;  2 线;  3 文本
+     * operType 1 移除设备节点;  2 更新文本字体大小;  3 更新文本颜色;  4 更新文本背景色;  5 移除文本节点
+     * exprObj 扩展数据,支持:{id:'数据id',fontSize:'字体大小',fontColor:'文本颜色',fontBackColor:'文本背景色'}
+     */
+    updateDataAndGraph: function (dataType, operType, exprObj) {
+      // fill: _labelObj.style.color,
+      //     fontSize: _labelObj.style.fontSize,
+      //     fontWeight: _labelObj.style.fontWeight,
+      var dataArr =
+        dataType == 1
+          ? this.nodeArr
+          : dataType == 2
+          ? this.lineArr
+          : dataType == 3
+          ? this.labelArr
+          : [];
+      for (let i = 0; i < dataArr.length; i++) {
+        let _dataObj = dataArr[i];
+        if (_dataObj.id == exprObj.id) {
+          var stageChild = this.pixiApp.stage.getChildByName(exprObj.id);
+          var _stageStyle = stageChild.style;
+          switch (operType) {
+            case 1:
+            case 5:
+              dataArr.splice(i, 1);
+              this.pixiApp.stage.removeChild(stageChild);
+              break;
+            case 2:
+              _dataObj.style.fontSize = exprObj.fontSize;
+              _stageStyle.fontSize = exprObj.fontSize;
+              stageChild.style = _stageStyle;
+              break;
+            case 3:
+              _dataObj.style.color = exprObj.fontColor;
+              _stageStyle.fill = exprObj.fontColor;
+              stageChild.style = _stageStyle;
+              break;
+            case 4:
+              _dataObj.style.backGround = exprObj.fontBackColor;
+              // _stageStyle.fontSize = exprObj.fontSize;
+              // stageChild.style = _stageStyle;
+              break;
+          }
+
+          break;
+        }
+      }
+    },
   },
   created() {},
 

+ 1 - 3
src/components/systemGraph/index.vue

@@ -61,9 +61,7 @@
 <script>
 import { mapState } from "vuex";
 import { logicConfig } from "@/logicConfig";
-import packageConfig from "../../../package.json";
 import { sysGraphController } from "@/controller/systemGraph/sysGraphController";
-import { TextureLoader } from "@pixi/loaders";
 
 export default {
   props: [],
@@ -156,7 +154,7 @@ export default {
         this.selectProject.groupCode,
         this.selectProject.id,
         this.selectProject.name,
-        packageConfig.name,
+        window.__systemConf.baseRouteUrl,
         true
       );
     },

+ 52 - 0
src/components/uploadFile/index.vue

@@ -0,0 +1,52 @@
+<template>
+    <div>
+        <div v-if='uploadVisible' class="uploadWarp">
+            <el-collapse v-model="activeNames" @change="handleChange" style="position: absolute; width: 100%">
+                <el-collapse-item title="同步中.." name="1">
+                    <div>已成功同步100个文件,共200个文件</div>
+                    <el-progress :text-inside="true" :show-text='false' :stroke-width="2" :percentage="70"></el-progress>
+                </el-collapse-item>
+            </el-collapse>
+        </div>
+    </div>
+</template>
+
+<script>
+import { mapState } from 'vuex'
+export default {
+    components: {
+
+    },
+    props: [],
+    data() {
+        return {
+            activeNames: true
+        }
+    },
+    watch: {
+        uploadVisible(nv, ov) {
+            console.log({nv, ov})
+        }
+    },
+    computed: {
+        ...mapState('uploadFile', ['uploadVisible'])
+    },
+    mounted() {
+        
+        
+    },
+    methods: {
+        
+    },
+}
+</script>
+
+<style scoped lang='less'>
+    .uploadWarp {
+        position: fixed;
+        right: 32px;
+        bottom: 160px;
+        width: 420px;
+
+    }
+</style>

+ 59 - 0
src/controller/cadDarwingController.ts

@@ -0,0 +1,59 @@
+/*
+ * @Author: your name
+ * @Date: 2022-01-12 15:29:56
+ * @LastEditTime: 2022-01-14 11:34:27
+ * @LastEditors: Please set LastEditors
+ * @Description: CAD图纸核查管理
+ * @FilePath: \adm-frontend\src\controller\cadDarwingController.ts
+ */
+import { baseHttpUtils } from "@/utils/http/baseHttpUtils";
+import { customHttpUtils } from '@/utils/http/customHttpUtils'
+import { logicConfig } from "@/logicConfig";
+export default class cadDarwingController {
+    static baseUril = (window as any).__systemConf.baseServiceUrl;
+    static http = new baseHttpUtils();
+    static customHttp = new customHttpUtils()
+
+    /**
+     * @description: 查询文件列表接口
+     * @param {*}
+     * @return {*}
+     */    
+    static async queryFileList (params={}) {
+        const headers = {
+            'Content-Type': 'application/json',
+            'token': '16:31eyJhbGciOiJIUzI1NiJ9.eyJkZXZpY2VUeXBlIjoxLCJhdWQiOiJ5dXNodS1zYWFzLWNsaWVudCIsInN1YiI6Inl1c2h1LXVzZXIiLCJhY2NvdW50SWQiOiIxNDc4MjcyMTQwNjU4MjAwNTc4IiwiYWNjb3VudE5hbWUiOiLmnY7mnbAiLCJpc3MiOiJ5dXNodSIsImp0aSI6ImEyYzgwYWQxLTRkZTgtNDVjMy04ODMyLTE5MzUxNWU3OWFmMCJ9.HYLA4Tc2c4TEDRXdi9dJ39zWuVmBoGoj5VrGRJk_9Ec'
+        }
+        try {
+            const res = await this.customHttp.customRequest(`${this.baseUril}/adm-server/adm/adm-file/queryCadFiles?projectId=Pj5001120003&groupCode=XG&userId=adm`, headers, params, 'post');
+            if(res?.result != logicConfig.resultObj.success) {
+                console.log('error');
+                return []
+            }
+            return res.data
+        } catch (error) {
+            
+        } 
+    }
+    /**
+     * @description: 删除文件接口
+     * @param {*}
+     * @return {*}
+     */    
+    static async delFile(params) {
+        const headers = {
+            'Content-Type': 'application/x-www-form-urlencoded',
+            'token': '16:31eyJhbGciOiJIUzI1NiJ9.eyJkZXZpY2VUeXBlIjoxLCJhdWQiOiJ5dXNodS1zYWFzLWNsaWVudCIsInN1YiI6Inl1c2h1LXVzZXIiLCJhY2NvdW50SWQiOiIxNDc4MjcyMTQwNjU4MjAwNTc4IiwiYWNjb3VudE5hbWUiOiLmnY7mnbAiLCJpc3MiOiJ5dXNodSIsImp0aSI6ImEyYzgwYWQxLTRkZTgtNDVjMy04ODMyLTE5MzUxNWU3OWFmMCJ9.HYLA4Tc2c4TEDRXdi9dJ39zWuVmBoGoj5VrGRJk_9Ec'
+        }
+        try {
+            const res = await this.customHttp.customRequest(`${this.baseUril}/adm-server/adm/adm-file/delete?projectId=Pj5001120003&groupCode=XG&userId=adm&id=${params.id}`, headers, {}, 'post');
+            if(res?.result != logicConfig.resultObj.success) {
+                console.log('error');
+                return []
+            }
+            return res.data
+        } catch (error) {
+            
+        }
+    }
+}

+ 37 - 0
src/controller/old-adm/buildController.ts

@@ -1,5 +1,6 @@
 import FloorController from "./floorController";
 import { baseHttpUtils } from "@/utils/http/baseHttpUtils";
+import { logicConfig } from "@/logicConfig";
 
 export interface BuildReq {
   pageNumber: number;
@@ -18,6 +19,42 @@ class BuildController {
   static async buildingQuery(params: BuildReq) {
     return await this.http.postRequest(this.pre + "/building/query", params);
   }
+  /**
+   * @description: 处理楼层接口数据为树状结构
+   * @param {*} 
+   * @return {*}
+   */ 
+  static async buildDataFormat(params) {
+    try {
+      const res =  await this.buildingQuery(params);
+      if (res.result != logicConfig.resultObj.success) {
+        return;
+      }
+      return res?.content.map(item => {
+        const { id, localName:name  } = item;
+        const children =  item?.floor?.map(subitem => ({
+          id: subitem.buildingId,
+          name: subitem.localName,
+          open: false,
+          disabled: false,
+          checked: 'uncheck'
+        }))
+        return {
+          id,
+          name,
+          open: false,
+          disabled: false,
+          checked: 'uncheck',
+          children,
+        }
+
+      })
+
+    } catch (error) {
+      
+    }
+
+  } 
   static async getData(buildFloorData) {
     let data,
       buildParams = {

+ 0 - 1
src/controller/systemGraph/sysGraphController.ts

@@ -274,7 +274,6 @@ export class sysGraphController {
 
         //获取系统实例名称
         var _systemInstance = getSystemInstanceByCode(resultObj.data.systemId);
-        console.log(_systemInstance);
         resultObj.data.systemInstanceName = _systemInstance.name || '';
 
 

+ 14 - 0
src/data/cadConst.js

@@ -0,0 +1,14 @@
+/*
+ * @Author: ql
+ * @Date: 2022-01-12 11:46:51
+ * @LastEditTime: 2022-01-12 14:18:29
+ * @LastEditors: Please set LastEditors
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @FilePath: \adm-frontend\src\data\cadConst.js
+ */
+export const MENU_MAP = [
+    {name: '土建精装', id:'id1'},
+    {name: '空调专业', id:'id2' },
+    {name: '消防专业' , id:'id3'},
+    {name: '给排水专业', id:'id4' },
+]

+ 1 - 1
src/meri.js

@@ -6,4 +6,4 @@ Vue.use(Input)
 Vue.use(MSelect)
 Vue.use(Icon)
 Vue.use(Popover)
-Vue.use(ImageUpload)
+Vue.use(ImageUpload)

+ 1 - 2
src/router/index.js

@@ -1,7 +1,6 @@
 import Vue from 'vue'
 import Router from 'vue-router'
 import systemRoute from './system'
-import packageConfig from '../../package.json'
 import {authUtils} from '@/utils/authUtils'
 
 Vue.use(Router)
@@ -11,7 +10,7 @@ routes = routes.concat(systemRoute)
 
 const router = new Router({
   mode: 'history',
-  base: '/' + packageConfig.name,
+  base: '/' + window.__systemConf.baseRouteUrl,
   routes: routes
 })
 

+ 1 - 1
src/router/system.js

@@ -123,7 +123,7 @@ export default [
     component: systemGraphEdit,
   },
   {
-    path: '/deliver',
+    path: '/deliveryTools',
     name: '现场交付工具',
     component: layoutMain,
     children: [

+ 3 - 1
src/store/index.js

@@ -1,6 +1,7 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
 import layout from './modules/layout'
+import uploadFile from './modules/uploadFile'
 Vue.use(Vuex)
 
 export default new Vuex.Store({
@@ -93,6 +94,7 @@ export default new Vuex.Store({
     },
     actions: {},
     modules: {
-        layout
+        layout,
+        uploadFile
     }
 })

+ 20 - 0
src/store/modules/uploadFile.ts

@@ -0,0 +1,20 @@
+export default {
+    namespaced: true,
+    state: {
+        uploadVisible: true,
+    },
+    getters: {
+
+    },
+    mutations: {
+        updata(state, payload) {
+            console.log({state, payload})
+            for (const key in payload) {
+                state[key] = payload[key]
+            }
+        }
+    },
+    actions: {
+
+    }
+}

+ 3 - 3
vue.config.js

@@ -1,5 +1,5 @@
 const path = require('path');
-var packageConfig = require('./package.json');
+var systemConfig = require('./public/systemConf.js');
 
 function resolve(dir) {
   return path.join(__dirname, '..', dir);
@@ -39,9 +39,9 @@ module.exports = {
       filename: 'index.html'
     }
   },
-  publicPath: '/' + packageConfig.name,
+  publicPath: '/' + systemConfig.baseRouteUrl,
   //当运行vue-cli-service build时生成的生产环境构建环境的目录。用法和webpack的output.path一样,不要修改output.path
-  outputDir: packageConfig.name,
+  outputDir: systemConfig.baseRouteUrl,
   //放置打包后生成的静态资源(js、css、img、fonts)的目录,该目录相对于outputDir。
   assetsDir: 'public',
   //指定生成的index.html的输出路径,相对于outputDir。也可以是一个绝对路径。