Browse Source

查看图纸第一次接口联调

yunxing 4 years ago
parent
commit
2ba1a6e0d3

+ 20 - 1
public/systemConf.js

@@ -36,7 +36,26 @@ var __systemConf = {
         serve_editerUrl: 'http://localhost:8091/wandaEditer/', // 编辑器地址
         serve_wandaBmGuideUrl: 'http://localhost:8090/wandaBmGuide/', //管理书地址
         // 显示项目资料的广场ID,滁州南谯万达广场
-        showLookPic_projectData:['1002026',]
+        /**
+         * 后期维护,将需要显示项目资料,查看图纸的广场ID,加入到showLookPic_projectData数组中
+         */
+        showLookPic_projectData: ['1002026'],
+        // 本系统 八大系统 与 数字化移交系统中的专业对应关系
+        /**
+         * 后期维护,与产品经理商量好对应规则后,进行修改该配置文件
+         * 1. 如果八大系统中(1003,1006等)无对应 数字化移交系统, 对应关系为空字符串'',即  1003:''
+         * 2. 如果八大系统中,对应多个数字化移交系统,在该配置文件中,用 英文的, 将对应关系拼接到一起,例如  1008: '01-AR建筑,02-ST结构'
+         */
+        smsxt_szhyj: {
+            1001: '03-MEP机电', //供电系统
+            1002: '03-MEP机电', //暖通系统
+            1003: '', //消防系统
+            1004: '07-TE智能化', //弱电系统
+            1005: '03-MEP机电', //给排水系统
+            1006: '', //电梯系统
+            1007: '', //燃气系统
+            1008: '01-AR建筑,02-ST结构', //土建系统
+        },
     },
 }
 window.__systemConf = __systemConf

+ 4 - 0
src/api/equipmentList.js

@@ -61,3 +61,7 @@ export function queryxxx({ getParams }) {
 export function queryShops({ getParams }) {
     return httputils.getJson(`/data/sms_shops/query`, getParams)
 }
+// 设备设施-查看图纸
+export function queryPicList({ getParams }) {
+    return httputils.getJson(`/data/file/getCadList`, getParams)
+}

+ 1 - 1
src/views/equipment/eqDialog.vue

@@ -34,7 +34,7 @@
                 <!-- 电井商铺范围清单 -->
                 <djsp-table v-else-if='dialogInfo.id.slice(0,4)=="GJSP"' :param='param'></djsp-table>
                 <!-- 查看图纸 -->
-                <look-page v-else-if='dialogInfo.id.slice(2,4)=="TZ"' param major></look-page>
+                <look-page v-else-if='dialogInfo.id.slice(2,4)=="TZ"' :smsxt='smsxt' ></look-page>
             </div>
             <!-- 有tab的页面 -->
             <div v-else style='padding-top:16px;height:100%;'>

+ 59 - 76
src/views/equipment/table/lookPageTable.vue

@@ -10,34 +10,36 @@
                 @blur='getList(true)'
                 clearable
                 prefix-icon='el-icon-search'
-                v-model='keyword'
+                v-model='keywords'
                 style='width:220px;margin-left:12px'
             ></el-input>
         </div>
         <el-table :data='tableData' style='width: 100%' :border='true'>
             <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
-            <el-table-column prop='lb' label='楼层' width='100' show-overflow-tooltip resizable>
+            <el-table-column prop='lb' label='楼层' width='110' show-overflow-tooltip resizable>
                 <template slot-scope='{row}'>{{row.floor || '--'}}</template>
             </el-table-column>
-            <el-table-column prop='lb' label='文件目录' width='300' show-overflow-tooltip resizable>
-                <template slot-scope='{row}'>{{row.fileDir || '--'}}</template>
+            <el-table-column prop='lb' label='文件目录' width='400' show-overflow-tooltip resizable>
+                <template slot-scope='{row}'>{{row.fullPath || '--'}}</template>
             </el-table-column>
-            <el-table-column prop='sl' label='文件名' show-overflow-tooltip resizable>
-                <template slot-scope='{row}'>{{row.fileName || '--'}}</template>
+            <el-table-column prop='sl' label='文件名'  width='250' show-overflow-tooltip resizable>
+                <template slot-scope='{row}'>{{row.pathName || '--'}}</template>
             </el-table-column>
             <el-table-column prop='assetnum' label='文件类型' width='100' show-overflow-tooltip resizable>
                 <template slot-scope='{row}'>{{row.fileType || '--'}}</template>
             </el-table-column>
             <el-table-column prop='assetnum' label='上传文件名'>
-                <template slot-scope='{row}'>{{row.uploadFileName || '--'}}</template>
+                <template slot-scope='{row}'>{{row.fileName || '--'}}</template>
             </el-table-column>
             <el-table-column label='操作' width='170'>
                 <template slot-scope='{row}'>
-                    <el-button type='text' size='mini' @click='handlePreview(row)'>
+                    <!-- 无fileId,设置禁用 -->
+                    <el-button type='text' size='mini' :disabled='!Boolean(row.fileId)' @click='handlePreview(row.fileId)'>
                         <!-- <i class='el-icon-download'></i> -->
                         预览
                     </el-button>
-                    <el-button type='text' size='mini' @click='handleDown(row)'>
+                    <!-- 无fileUrl,设置禁用 -->
+                    <el-button type='text' size='mini' :disabled='!Boolean(row.fileUrl)' @click='handleDown(row.fileUrl)'>
                         <!-- <i class='el-icon-download'></i> -->
                         下载{{row.fileSize? `(${row.fileSize})` :''}}
                     </el-button>
@@ -59,7 +61,7 @@
     </div>
 </template>
 <script>
-import { queryEquipmentList } from '@/api/equipmentList.js'
+import { queryPicList } from '@/api/equipmentList.js'
 import { mapGetters } from 'vuex'
 import { random } from 'lodash'
 export default {
@@ -70,15 +72,31 @@ export default {
             total: 0,
             page: 1,
             size: 11,
-            keyword: '',
+            keywords: '',
             floor: 'all',
             fileType: '',
             files: [],
         }
     },
-    props: ['major'],
+    props: ['smsxt'],
     computed: {
-        ...mapGetters(['floorSelect']),
+        // floorSelect2 id: e.gname, name: e.code,使用的gname
+        ...mapGetters(['plazaId', 'floorSelect2']),
+    },
+    created() {
+        // 楼层筛选下拉菜单
+        this.floorData = [{ id: 'all', name: '全部' }, ...this.floorSelect2]
+    },
+    mounted() {
+        // 根据分辨率更改size值
+        this.handleResize()
+        // 查询列表
+        this.getList()
+        // 监听resize事件
+        window.addEventListener('resize', this.handleResize)
+        this.$once('hook:beforeDestroy', () => {
+            window.removeEventListener('resize', this.handleResize)
+        })
     },
     methods: {
         //序号的方法
@@ -97,73 +115,53 @@ export default {
          * @param { Boolean } initPage 是否重置页码, true是 false 否
          *                    更改楼层,搜索文件名时,重置页码
          */
-        getList(initPage) {
+        async getList(initPage) {
             // 重置页码
             if (initPage) {
                 this.total = 0
                 this.page = 1
             }
-            let postParams = {}
-            const { page, size, keyword, floor } = this
-            let data = {
+            const { plazaId, page, size, keywords, floor } = this
+            // 专业,按照配置文件中的对应关系进行转换
+            const Spes = __systemConf.conf.smsxt_szhyj[this.smsxt]
+            let getParams = {
                 page,
                 size,
+                ProjectId: '(YSY)CZWDGC', // plazaId,
+                Spes,
             }
-            console.log(data)
-            // 楼层不为全部时,上送楼层字段
-            if (floor !== 'all') {
-                postParams.floor = floor
+            // 楼层为全部时,上送完整楼层列表字段
+            if (floor === 'all') {
+                let floorArr = [],
+                    floorStr = ''
+                this.floorSelect2.map((item) => floorArr.push(item.id))
+                floorStr = floorArr.join(',')
+                getParams.Floors = floorStr
+            } else {
+                getParams.Floors = floor
             }
             // 搜索文件名/上传文件名
-            if (keyword) {
-                data.keyword = `${keyword}:fileName,uploadFileName;`
+            if (keywords) {
+                getParams.keywords = keywords
             }
-            /**
-             * 模拟数据
-             */
-            let mockData = [
-                {
-                    floor: 'F1',
-                    fileDir: '03-MEP机电/02-EL电气',
-                    fileId: '123',
-                    fileName: 'F01层结构',
-                    fileType: 'pdf',
-                    fileSize: '99.2M',
-                    uploadFileName: '万达广场 地库电梯井施工图.dwg',
-                    fireUrl: 'xxxxx',
-                },
-                {
-                    floor: 'B2',
-                    fileDir: 'dist/test2',
-                    fileId: '123',
-                    fileName: '文件2',
-                    fileType: 'cad',
-                    fileSize: '1.3M',
-                    uploadFileName: '上传文件2',
-                    fireUrl: 'xxxxx',
-                },
-            ]
-            initPage && (this.total = random(15, 90))
-            let max = this.size - 2
-            if (this.page === Math.ceil(this.total / this.size)) {
-                max = (this.total % this.size) - 2
-            }
-            for (let index = 0; index < max; index++) {
-                mockData.push({})
-            }
-            this.tableData = mockData
+            let res = await queryPicList({ getParams })
+            console.log('===========')
+            console.log(res)
+            console.log('===========')
+            this.tableData = res?.data || []
+            this.total = res?.count || 0
         },
         /**
          * 预览
          */
-        handlePreview(row) {
-            window.open('http://szhyj.wanda.cn/dwg/index.html?fileId=123456')
+        handlePreview(fileId) {
+            window.open(`http://szhyj.wanda.cn/dwg/index.html?fileId=${fileId}`)
         },
         /**
          * 下载
          */
-        handleDown(row) {
-            window.open('http://mapapp.wanda.cn/editor/fmap/1000772_54/1000772_54.fmap')
+        handleDown(fileUrl) {
+            window.open(fileUrl)
         },
         /**
          * 页面窗口变化,更新 size值
@@ -180,21 +178,6 @@ export default {
             }
         },
     },
-    created() {
-        // 楼层筛选下拉菜单
-        this.floorData = [{ id: 'all', name: '全部' }, ...this.floorSelect]
-    },
-    mounted() {
-        // 根据分辨率更改size值
-        this.handleResize()
-        // 查询列表
-        this.getList()
-        // 监听resize事件
-        window.addEventListener('resize', this.handleResize)
-        this.$once('hook:beforeDestroy', () => {
-            window.removeEventListener('resize', this.handleResize)
-        })
-    },
 }
 </script>
 <style lang="less" scoped>