Преглед изворни кода

修改集团首页弹窗样式

fujunwen пре 4 година
родитељ
комит
f8749be84d

+ 21 - 0
public/systemConf.js

@@ -35,6 +35,27 @@ var __systemConf = {
         //开发
         serve_editerUrl: 'http://localhost:8091/wandaEditer/', // 编辑器地址
         serve_wandaBmGuideUrl: 'http://localhost:8090/wandaBmGuide/', //管理书地址
+        // 显示项目资料的广场ID,滁州南谯万达广场
+        /**
+         * 后期维护,将需要显示项目资料,查看图纸的广场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)
+}

+ 4 - 0
src/assets/css/rotation.css

@@ -45,6 +45,10 @@
   border-radius: 4px;
   /* cursor: not-allowed; */
 }
+.overview .view-title .view-button-disabled{
+    opacity: 0.5;
+    cursor: not-allowed;
+}
 .overview .view-title .view-button img {
   display: inline-block;
   height: 16px;

+ 5 - 0
src/assets/css/rotation.less

@@ -50,6 +50,11 @@
                 margin-right: 6px;
             }
         }
+        .view-button-disabled{
+            opacity: 0.5;
+            cursor: not-allowed;
+        }
+
     }
     .view-box {
         height: calc(100% - 32px);

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

@@ -4,7 +4,7 @@
         <el-dialog :visible.sync='visible' :fullscreen='true' @close='closeModal'>
             <!-- 除了清单和原理页面,别的都有记录事项detailDialog页面 -->
             <div slot='title' class='header-title' v-if='Object.keys(dialogInfo).length>0'>
-                <span class='title-name'>{{systemName}}-{{dialogInfo.label}}</span>
+                <span class='title-name'>{{dialogInfo.label}}-{{systemName}}</span>
                 <!-- icon图标,显示规则 -->
                 <!-- // title右侧 icon入口
                 // 1. 主要设备清单, 系统原理图 不显示 icon
@@ -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%;'>

+ 15 - 4
src/views/equipment/index.vue

@@ -14,15 +14,15 @@
                 <ul v-for='(eve,index) in everySystem' :key='"o"+index'>
                     <li class='li-style' :class='{"is-active": eve.id}' @click='dialogVisible(eve)'>
                         <span class='circle'></span>
-                        <!-- <el-button
+                        <el-button
                             type='text'
                             disabled
                             class='hanzi2'
                             title='数字化移交系统上线后可用'
-                            v-if='eve.label=="查看图纸"'
+                            v-if='eve.label=="查看图纸" && !showLookPic'
                             style='text-align:left'
-                        >{{eve.label}}</el-button>-->
-                        <span class='hanzi'>{{eve.label}}</span>
+                        >{{eve.label}}</el-button>
+                        <span class='hanzi' v-else>{{eve.label}}</span>
                     </li>
                 </ul>
             </div>
@@ -101,6 +101,8 @@ export default {
             keyFL: 'keyFL' + new Date().getTime(),
             keyLd: 'keyLd_' + new Date().getTime(),
             ShowDialog: false, //是否显示弹窗
+            showLookPic:false,
+
         }
     },
     components: { floorList, eqDialog, floorMap },
@@ -271,6 +273,15 @@ export default {
             }
         },
     },
+    created(){
+         /**
+         * 是否显示,可以点击的查看图纸
+         * 根据配置文件中,配置的广场ID显示查看图纸
+         */
+        if(window.__systemConf.conf.showLookPic_projectData.includes(this.plazaId)){
+            this.showLookPic = true
+        }   
+    },
     mounted() {
         // if (Object.keys(this.floorObj).length > 0) {
         //     this.floorInfo = this.floorObj

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

+ 19 - 3
src/views/overview/index.vue

@@ -11,8 +11,14 @@
                 <span>项目基本信息</span>
             </nav>
             <!-- <el-button type='info' plain disabled> -->
-            <div title='数字化移交系统上线后可用'>
-                <div class='view-button' :disabled='true' @click='findxmzl'>
+            <div v-if='!projectDataFlag' title='数字化移交系统上线后可用'>
+                <div class='view-button view-button-disabled' :disabled='true'>
+                    <img src='../../assets/imgs/wd.png' alt />
+                    项目资料
+                </div>
+            </div>
+            <div v-else>
+                <div class='view-button' @click='findxmzl'>
                     <img src='../../assets/imgs/wd.png' alt />
                     项目资料
                 </div>
@@ -150,6 +156,7 @@ export default {
             va: '',
             spanArr: [], //二维数组,用于存放单元格合并规则
             position: 0, //用于存储相同项的开始index
+            projectDataFlag: false, //项目资料按钮是否可以点击
         }
     },
     methods: {
@@ -257,7 +264,7 @@ export default {
                 this.$refs.picModal.showModal(this.pic2, type)
             }
         },
-        findxmzl() {
+        findxmzl() { 
             if (this.shuzihuayijiao) {
                 window.open(`${this.shuzihuayijiao}`, true)
             }
@@ -331,6 +338,15 @@ export default {
     },
     created() {
         this.init()
+        /**
+         * 是否可以点击项目资料
+         * 根据配置文件中,配置的广场id 可以点击
+         */
+        if(window.__systemConf.conf.showLookPic_projectData.includes(this.plazaId)){
+            this.projectDataFlag = true 
+        }else{
+            this.projectDataFlag = false
+        }
     },
     computed: {
         ...mapGetters(['isPreview', 'pic', 'plazaId']),