5 Commity 0757c959ae ... 5c0ae3bea6

Autor SHA1 Wiadomość Data
  qule 5c0ae3bea6 增加cad核查图纸页面 3 lat temu
  qule 1b7df2c231 Merge branch 'master' of http://39.106.8.246:3003/BDTP/adm-frontend 3 lat temu
  qule eb3cdb3657 Merge branch 'master' of http://39.106.8.246:3003/BDTP/adm-frontend 3 lat temu
  qule 45fc527609 Merge branch 'master' of http://39.106.8.246:3003/BDTP/adm-frontend 3 lat temu
  qule c043529dde 增加CAD页面 3 lat temu

+ 1 - 1
public/systemConf.js

@@ -51,7 +51,7 @@ var __systemConf = {
       "id": "CADtuzhiguanli",
       "name": "CAD核查图纸管理",
       "orders": 7,
-      "url": "/deliver/cadDrawingManage",
+      "url": "/deliveryTools/cadDrawingManage",
       "icon": "icon-topology"
     }]
   }, {

+ 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() {
@@ -82,7 +84,9 @@ export default {
   created() {},
   watch: {},
   mounted() {},
-  components: {},
+  components: {
+    uploadFile
+  },
 };
 </script>
 

+ 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 = {

+ 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 - 1
src/router/system.js

@@ -110,7 +110,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: {
+
+    }
+}