yunxing 4 rokov pred
rodič
commit
05af899ca2

+ 2 - 2
src/App.vue

@@ -1,6 +1,6 @@
 <template>
     <!-- ios头部padding适配 -->
-    <div id='app' :class='isIOS?"ios-padding":""'>
+    <div id='app' >
         <div id='fengMap' class='fengMap'></div>
         <!-- 顶部navbar -->
         <NarBar class='nav-bar' v-if='!$route.meta.hideNarBar' />
@@ -146,7 +146,7 @@ export default {
 <style lang="less">
 @import './style/common.less';
 .ios-padding {
-    padding-top: 15px;
+    // padding-top: 15px;
     box-sizing: border-box;
 }
 // navbar高度

+ 0 - 40
src/api/coreDeviceReport.js

@@ -1,40 +0,0 @@
-// 核心设备报表 接口
-import httputils from '@/api/httputils'
-/**
- * 系统列表
- */
-export function querySystemList() {
-    return httputils.getJson(`/data/sms_systemcfg/querySmsxt`)
-}
-/**
- * 系统下的设备
- * @param { 接口地址 } url
- * @param { 接口参数 } getParams
- */
-export function queryEquipmentList(url, getParams) {
-    return httputils.getJson(url, getParams)
-}
-/**
- * 表数据
- */
-export function queryTableData(url, postParams) {
-    return httputils.postJson(url, postParams)
-}
-
-/**
- * 设备台账下所有历史事项信息
- * @param { 接口地址 } url
- * @param { 接口参数 } getParams
- */
-export function queryHistoryTableData(url, getParams) {
-    return httputils.getJson(url, getParams)
-}
-
-/**
- * 获取图片/报告详情
- * @param { 接口地址 } url
- * @param { 接口参数 } getParams
- */
-export function queryDetailData(url, getParams) {
-    return httputils.getJson(url, getParams)
-}

+ 1 - 58
src/api/equipmentList.js

@@ -3,61 +3,4 @@ import httputils from '@/api/httputils'
 // 设备设施-主要设备清单
 export function queryEquipmentList({ data, postParams }) {
     return httputils.fetchJson(`/data/sms_asset/queryStatistics`, data, postParams)
-}
-
-// 设备设施-主要设备清单详情
-export function queryAsset({ data, postParams }) {
-    return httputils.fetchJson(`/data/sms_asset/query`, data, postParams)
-}
-
-// 设备设施-主要设备清单详情(不过滤设备类型)
-export function queryAssetAll({ data, postParams }) {
-    return httputils.fetchJson(`/data/sms_asset/queryByClassStructure`, data, postParams)
-}
-
-// 设备设施-主要材料清单
-export function queryMaterialList({ getParams }) {
-    return httputils.getJson(`/data/sms_material/query`, getParams)
-}
-
-// 设备设施-维保事项
-export function queryWbsms({ data, getParams }) {
-    return httputils.getJson(`/data/sms_wbsms/query`, data, getParams)
-}
-
-// 设备设施-维修事项
-export function queryWx({ data, getParams }) {
-    return httputils.getJson(`/data/sms_wx/query`, data, getParams)
-}
-// 设备设施-维修专业事项
-export function queryWxzy({ data, getParams }) {
-    return httputils.fetchJson(`/data/sms_wxzy/query`, data, getParams)
-}
-//设备设施-维修-查图片
-export function queryWxzyImg({ data, getParams }) {
-    return httputils.getJson(`/data/sms_wxzy/queryImg`, data, getParams)
-}
-// 设备设施-专维
-export function queryZw({ data, getParams }) {
-    return httputils.getJson(`/data/sms_zw/query`, data, getParams)
-}
-
-// 设备设施-其他事项
-export function queryQtsx({ data, getParams }) {
-    return httputils.getJson(`/data/sms_qtsx/query`, data, getParams)
-}
-
-// 设备设施-记录事项
-export function queryRecord({ getParams }) {
-    return httputils.getJson(` /data/sms_wxwbsxline/query`, getParams)
-}
-
-// 设备设施=查看图纸
-export function queryxxx({ getParams }) {
-    return httputils.getJson(`/data/xxX`, getParams)
-}
-
-// 设备设施-楼层电井口(间)控制商铺范围清单
-export function queryShops({ getParams }) {
-    return httputils.getJson(`/data/sms_shops/query`, getParams)
-}
+}

+ 0 - 32
src/api/homePage.js

@@ -1,32 +0,0 @@
-import httputils from '@/api/httputils'
-
-// 查询首页系统卡片
-export function getCardList({ getParams }) {
-    return httputils.getJson(`/data/home/querySystemCard`, getParams)
-}
-
-// 综合事项记录
-export function getQueryList({ getParams }) {
-    return httputils.getJson(`/data/sms_zhsxjl/query`, getParams)
-}
-
-// 说明书变更记录
-export function getChangeList({ getParams }) {
-    return httputils.getJson(`/data/rpt_change_record/query`, getParams)
-}
-
-// ==================== 集团首页接口 =======================
-// 查询项目信息统计数量
-export function getPlazaInfoCount({ getParams }) {
-    return httputils.getJson(`/data/home/queryPlazaInfoCount`, getParams)
-}
-
-// 查询首页系统卡片
-export function querySystemCard({ getParams }) {
-    return httputils.getJson(`/data/home/querySystemCard`, getParams)
-}
-
-// 查询集团首页事项状态统计
-export function queryEventStatus({ getParams }) {
-    return httputils.getJson(`/data/home/queryEventStatus`, getParams)
-}

+ 1 - 0
src/api/httputils.js

@@ -104,6 +104,7 @@ export default {
     },
 
     async getJson(url, params) {
+        console.log(url, params)
         try {
             let response = await axiosservice({
                 url,

+ 0 - 89
src/api/legendLibrary.js

@@ -1,89 +0,0 @@
-import httputils from '@/api/httputils'
-// 图例库-查询
-export function queryLegend({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/graphElement/query`, postParams)
-}
-// 图例库-新增
-export function createLegend({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/graphElement/create`, postParams)
-}
-// 图例库-新增
-// export function createLegend({
-//     postParams
-// }) {
-//     return httputils.postJson(`/serve/topology-wanda/graphElement/create`, postParams)
-// }
-//图例库-更新
-export function updateLegend({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/graphElement/update`, postParams)
-}
-//图例库-作废
-export function deleteLegend({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/graphElement/deleteByFlag`, postParams)
-}
-//图例库-系统tree查询
-export function getLegendTree({ getParams }) {
-    return httputils.getJson(`/serve/topology-wanda/graphCategory/queryByGroup`, getParams)
-}
-
-//图例库-系统tree相关表格查询
-export function queryRelation({ data, postParams }) {
-    return httputils.fetchJson(`/serve/topology-wanda/graphRelation/query`, data, postParams)
-}
-//图例库-更新关系图
-export function updateRelation({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/graphRelation/update`, postParams)
-}
-//图例库-系统tree相关表格删除
-export function deleteRelation({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/graphRelation/delete`, postParams)
-}
-//图例库-上传图片
-export function uploadImg({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/Picture/create`, postParams)
-}
-//图例库-穿梭框的搜索
-export function getTransfer({ getParams }) {
-    return httputils.getJson(`/serve/topology-wanda/graphElement/search`, getParams)
-}
-//图例库typeId
-export function queryTypeId({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/graphElement/type/query`, postParams)
-}
-// 搜索图铺位可视化类型信息
-export function getVisualization({ getParams }) {
-    return httputils.getJson(`/serve/topology-wanda/graphElement/type/search`, getParams)
-}
-// 图例分层展示
-export function groupByCategory({ getParams }) {
-    // return httputils.getJson(`/serve/topology-wanda/graphRelation/groupByCategory`, getParams)
-    return httputils.getJson(`/serve/topology-wanda/graphElement/groupByInfoSystem`, getParams)
-}
-// 图例搜索
-export function graphElementSearch({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/graphElement/search`, postParams)
-}
-// 更新图例关系信息
-// export function graphElementUpdate({
-//     postParams
-// }) {
-//     return httputils.postJson(`/serve/topology-wanda/graphRelation/update`, postParams)
-
-// }
-
-// 业下设备分类和位置分类树形结构
- 
- 
- 
-
-export function queryDeviceAndPOsition({
-    postParams
-}) {
- 
-    return httputils.postJson(`/data/t_system_wzfl/query`, postParams)
-}
-
-//图形查询
-export function queryPics({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/graph/query`, postParams)
-}

+ 0 - 18
src/api/other.js

@@ -3,21 +3,3 @@ import httputils from '@/api/httputils'
 export function queryGlams({ getParams }) {
     return httputils.getJson(`/data/sms_zhsxjl/query`, getParams)
 }
-// 第三方检测事项
-export function queryDsfrw({ getParams }) {
-    return httputils.getJson(`/data/sms_dsfrw/query`, getParams)
-}
-//综合事项管理-综合记录事项弹框
-export function queryZhsxjl({ getParams }) {
-    return httputils.getJson(`/data/sms_zhsxjl/queryWindown`, getParams)
-}
-
-// 辅助用房管理-广场辅助用房汇总统计报
-export function querygcfzyfhz({ getParams }) {
-    return httputils.getJson(`/data/sms_gcfzyfhz/query`, getParams)
-}
-
-// 辅助用房管理-广场辅助用房调改变更记录
-export function queryfzyfchange({ getParams }) {
-    return httputils.getJson(`/data/sms_fzyfchange/query`, getParams)
-}

+ 8 - 0
src/api/overview.js

@@ -3,3 +3,11 @@ import httputils from '@/api/httputils'
 export function queryFact({ getParams }) {
     return httputils.getJson(`/data/plaza/fact`, getParams)
 }
+// 根据类型统计说明书更新记录数量
+export function queryRecordCount({ getParams }) {
+    return httputils.getJson(`/data/rpt_change_record/queryObjTypeCount`, getParams)
+}
+// 查询事件类型下拉菜单
+export function queryEventypes({ data, postParams }) {
+    return httputils.fetchJson(`/data/base/queryOptions`, data, postParams)
+}

+ 0 - 45
src/api/public.js

@@ -1,54 +1,9 @@
 import httputils from "@/api/httputils"
-// 查询图片
-export function queryPic({ getParams }) {
-    return httputils.getJson(`/data/sms_proimgup/query`, getParams)
-}
-
-// 查询下拉框
-export function querySelect({ data, postParams }) {
-    return httputils.fetchJson(`/data/base/queryOptions`, data, postParams)
-}
-
-// 查询Tab数据统计数量
-export function queryTab({ data, postParams }) {
-    return httputils.fetchJson(`/data/base/queryTabStatistics`, data, postParams)
-}
-
-// 查询图例统计信息
-export function queryStatis({ data, postParams }) {
-    return httputils.fetchJson(`/serve/topology-wanda/graphElement/statistic/query`, data, postParams)
-}
-
-// 图例-查询图片
-//  /serve/topology-wanda/Picture/eqruy/{id}
-
-// 更新图例系统信息
-export function updateStatis({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/graphElement/statistic/update`, postParams)
-}
-
-// 查询系统图备注-(后期可能不需要)
-export function queryRead({ data, postParams }) {
-    return httputils.fetchJson(`/serve/topology-wanda/graph/read`, data, postParams)
-}
-
-// 修改系统图备注
-export function updateRead({ postParams }) {
-    return httputils.postJson(`/serve/topology-wanda/graph/updateNote`, postParams)
-}
 
 //查询系统图展示所需数据 --平面图业务数据
 export function readGroup(postParams) {
     return httputils.postJson(`/serve/topology-wanda/graph/read`, postParams)
 }
-// 查询草稿箱数量
-export function queryDraftNum(data) {
-    return httputils.postJson(`/serve/topology-wanda/graph/query`, data)
-}
-// 查询铺位名称
-export function queryBrand({ data, postParams }) {
-    return httputils.fetchJson(`/data/tb_brand_intentiondetail/query`, data, postParams)
-}
 //记录PV/UV
 export function getPvUv(data, postParams) {
     return httputils.fetchJson(`/data/pvuv/save`, data, postParams)

+ 0 - 52
src/api/room.js

@@ -1,52 +0,0 @@
-/*
- * @Author: your name
- * @Date: 2020-06-28 13:41:05
- * @LastEditTime: 2020-07-06 11:43:33
- * @LastEditors: your name
- * @Description: In User Settings Edit
- * @FilePath: \wanda-bm-guide\src\api\room.js
- */
-
-import httputils from '@/api/httputils'
-
-// 机房-机房布置图
-export function xx({ getParams }) {
-    return httputils.getJson(`/data/sms_zhsxjl/query`, getParams)
-}
-
-// 机房-配电室低压柜及出线明细表
-export function queryDygjcxline({ getParams }) {
-    return httputils.getJson(
-        `/data/sms_dygjcxline
-/query`,
-        getParams
-    )
-}
-
-// 机房-机房内核心设备
-export function queryHxsb({ data, postParams }) {
-    return httputils.fetchJson(`/data/sms_asset/queryStatistics`, data, postParams)
-}
-
-// 机房-机房内核心设备钻取表
-export function queryHxsbDetail({ data, postParams }) {
-    return httputils.fetchJson(`/data/sms_asset/query`, data, postParams)
-}
-
-// 机房-维修记录
-export function queryWxjf({ getParams }) {
-    return httputils.getJson(`/data/sms_wx/query`, getParams)
-}
-
-//机房-维保记录
-// export function queryWb2({ data, postParams }) {
-//     return httputils.fetchJson(`/data/sms_wbzy/query`, data, postParams)
-// }
-//设备设施-日常维保
-export function queryWb({ getParams }) {
-    return httputils.getJson(`/data/sms_wbzy/query`, getParams)
-}
-// 查询位置属于哪个系统
-export function querySystem({ getParams }) {
-    return httputils.getJson(`/data/t_system_wzfl/querySystem`, getParams)
-}

+ 6 - 1
src/components/Navbar.vue

@@ -17,8 +17,13 @@ import { NavBar, Icon, Tabbar, TabbarItem } from 'vant'
 Vue.use(NavBar).use(Icon)
 import { mapGetters } from 'vuex'
 import store from '@/store'
+window.__scanCallback = function (data) {
+    console.log('__scanCallback')
+    console.log(data)
+    alert(data.text)
+}
 window.scanCallback = function (data) {
-    console.log(11111)
+    console.log('scanCallback')
     console.log(data)
     alert(data.text)
 }

+ 31 - 4
src/router/index.ts

@@ -1,4 +1,5 @@
 import Vue from 'vue'
+import store from '@/store'
 import VueRouter, { RouteConfig } from 'vue-router'
 // 解决Vue-Router升级导致的Uncaught(in promise) navigation guard问题
 const originalPush = VueRouter.prototype.push
@@ -8,7 +9,8 @@ VueRouter.prototype.push = function push(location, onResolve, onReject) {
     // @ts-ignore
     return originalPush.call(this, location).catch((err) => err)
 }
-
+// @ts-ignore
+import { getPvUv } from '@/api/public.js'
 Vue.use(VueRouter)
 
 const routes: Array<RouteConfig> = [
@@ -26,7 +28,7 @@ const routes: Array<RouteConfig> = [
     // 项目概况
     {
         path: '/overview',
-        name: 'overview',
+        name: 'Overview',
         component: () => import(/* webpackChunkName: "overview" */ '../views/overview/index.vue'),
         meta: {
             keepAlive: true,
@@ -89,7 +91,7 @@ const routes: Array<RouteConfig> = [
         name: 'UpdateRecord',
         component: () => import(/* webpackChunkName: "updateRecord" */ '../views/overview/UpdateRecord.vue'),
         meta: {
-            keepAlive: false,
+            keepAlive: true,
             showTabbar: false,
             hideNarBar: true,
         },
@@ -123,5 +125,30 @@ const router = new VueRouter({
     base: process.env.BASE_URL,
     routes,
 })
-
+// 跳入路由后要对发送pvuv
+router.afterEach((to) => {
+    console.log(to)
+    // 项目概览,楼层功能,设备设施,其他事项 记录pupv
+    let pupvArr = ['Overview', 'FloorFunc', 'EquipmentFacilities', 'OtherMatter']
+    // @ts-ignore
+    if (!pupvArr.includes(to.name)) {
+        return true
+    }
+    let postParams = {
+        type: 'router',
+        target: to.name,
+        parameter: to.path,
+        app: 'H5',
+    }
+    const data = {
+        plazaId: store.getters['plazaId'],
+    }
+    getPvUv(data, postParams)
+        .then((res: any) => {
+            console.log('pvuv', res)
+        })
+        .catch((res: any) => {
+            console.log('error', res)
+        })
+})
 export default router

+ 35 - 7
src/views/overview/UpdateRecord.vue

@@ -2,7 +2,7 @@
     <div class='update-record'>
         <van-nav-bar title='说明书更新记录' left-arrow @click-left='backPage' />
         <van-dropdown-menu active-color='#1989fa'>
-            <van-dropdown-item v-model='value1' :options='option1' />
+            <van-dropdown-item v-model='objType' :options='option' />
         </van-dropdown-menu>
         <div class='record'>
             <!-- 引入list,触底更新 -->
@@ -39,21 +39,29 @@ import { NavBar, DropdownMenu, DropdownItem, List } from 'vant'
 Vue.use(NavBar)
 Vue.use(DropdownMenu).use(DropdownItem)
 Vue.use(List)
-import { getChangeList } from '@/api/homePage'
+// import { getChangeList } from '@/api/homePage'
+import { queryEventypes } from '@/api/overview'
+import { querySelect } from '@/api/public'
+
 export default {
     name: 'UpdateRecord',
     props: {},
     components: {},
     data() {
         return {
-            value1: 0,
-            option1: [
+            plazaId: '1000423',
+            objType: 0,
+            option: [
                 { text: '全部', value: 0 },
                 { text: '重要维保', value: 1 },
-                { text: '重要维修', value: 2 },
-                { text: '其他事项', value: 3 },
-                { text: '综合事项', value: 4 },
+                { text: '重要维修', value: 4 },
+                { text: '其他事项', value: 5 },
+                { text: '综合事项', value: 3 },
             ],
+            // 1: '重要维保',
+            // 3: '综合事项',
+            // 4: '重要维修',
+            // 5: '其他事项',
             list: [],
             loading: false,
             finished: false,
@@ -70,10 +78,30 @@ export default {
         getChangeList(params).then((res) => {
             console.log(res)
         })
+        this.querySelect()
     },
     beforeMount() {},
     mounted() {},
     methods: {
+        /**
+         *
+         */
+        async querySelect() {
+            let data = {
+                    plazaId: this.plazaId,
+                },
+                postParams = [
+                    {
+                        tableName: 'rpt_change_record',
+                        columnName: {
+                            objtype: 'objtype',
+                        },
+                    },
+                ]
+            let resData = await queryEventypes({ data, postParams })
+            console.log('%c======', 'color:blue')
+            console.log(resData)
+        },
         // 返回上一个页面(项目概况)
         backPage() {
             this.$router.go(-1)

+ 202 - 41
src/views/overview/index.vue

@@ -6,7 +6,8 @@
         <div class='my-swipe'>
             <van-swipe :autoplay='0' indicator-color='white'>
                 <van-swipe-item v-for='(image, index) in imgList' :key='index'>
-                    <van-image fit='contain' :src='image' />
+                    <span class='type-name'>{{ image.typename }}</span>
+                    <van-image fit='contain' :src='image.url' />
                 </van-swipe-item>
             </van-swipe>
         </div>
@@ -15,11 +16,15 @@
             <!-- 建筑综合信息 -->
             <van-tab class='buiding-tab' title='建筑综合信息'>
                 <div class='building-info'>
-                    <div class='cell'>
+                    <!-- <div class='cell'>
                         <span class='left'>项目名称:</span>
-                        <span class='right'>三明万达广场</span>
+                        <span class='right'>{{plazaName}}</span>
+                    </div>-->
+                    <div class='cell' v-for='(item, index) in build' :key='index'>
+                        <span class='left'>{{ item.project }}:</span>
+                        <span class='right'>{{ item.basic }}</span>
                     </div>
-                    <div class='cell'>
+                    <!-- <div class='cell'>
                         <span class='left'>项目地址:</span>
                         <span class='right'>福建省三明市梅列区东乾二路1号15幢三明万达广场4楼办公室</span>
                     </div>
@@ -51,40 +56,60 @@
                     <div class='cell'>
                         <span class='left'>移交时间:</span>
                         <span class='right'>6.45㎡,其中地上5.82万㎡、地下0.63万㎡</span>
-                    </div>
+                    </div>-->
                 </div>
             </van-tab>
             <!-- 施工单位信息 -->
             <van-tab title='施工单位信息' class='sgdw-info'>
                 <van-tabs type='card' color='#E5EEF6' title-active-color='#025baa' title-inactive-color='#666666'>
                     <van-tab title='总包'>
-                        <ul class='zb'>
+                        <ul class='zb' v-if='showTotalContractInfo'>
                             <li class='title'>
-                                <i>icon</i>中国建筑第二工程局有限公司
+                                <!-- <i>icon</i>中国建筑第二工程局有限公司 -->
+                                <i class='iconfont wanda-gongsiqiye'></i>
+                                {{ totalContractInfo.unit }}
                             </li>
                             <li class='system'>
-                                <span class='card'>消防电</span>
-                                <span class='card'>土建</span>
-                                <span class='card'>弱电</span>
-                                <span class='card'>机电</span>
-                                <span class='card'>给排水</span>
                                 <!-- <span class='card'>消防电</span>
                                 <span class='card'>土建</span>
                                 <span class='card'>弱电</span>
                                 <span class='card'>机电</span>
                                 <span class='card'>给排水</span>-->
+                                <span class='card' v-for='(item, index) in totalContractInfo.professional' :key='index'>{{ item }}</span>
                             </li>
                             <li class='name'>
-                                <i>icon</i>张三
+                                <i class='iconfont wanda-renwu-ren'></i>
+                                {{ totalContractInfo.name }}
                             </li>
                             <li class='phone'>
-                                <i>icon</i>19220010211
+                                <i class='iconfont wanda-dianhua'></i>
+                                {{ totalContractInfo.phone }}
                             </li>
                         </ul>
+                        <ul class='zb' v-else>
+                            <!-- TODO:  暂无数据 -->
+                            <van-empty description='暂无数据' />
+                        </ul>
                     </van-tab>
                     <van-tab title='分包'>
-                        <ul class='fb'>
-                            <li class='fb-card' v-for='i in 5' :key='i'>
+                        <ul class='fb' v-if='subcontractInfo.length'>
+                            <li class='fb-card' v-for='(item, index) in subcontractInfo' :key='index'>
+                                <div class='card-left'>{{ item[0].professional }}</div>
+                                <div class='card-right'>
+                                    <div class='info' v-for='(detail, dIndex) in item' :key='dIndex'>
+                                        <p class='company'>{{ detail.unit }}</p>
+                                        <p class='name-phone'>
+                                            <span>{{ detail.name || '--' }}</span>
+                                            <span>{{ detail.phone || '--' }}</span>
+                                        </p>
+                                        <!-- <p class='name-phone'>
+                                            <span>张伟</span>
+                                            <span>0411-86666924</span>
+                                        </p>-->
+                                    </div>
+                                </div>
+                            </li>
+                            <!-- <li class='fb-card' v-for='i in 5' :key='i'>
                                 <div class='card-left'>消防水</div>
                                 <div class='card-right'>
                                     <div class='info'>
@@ -122,7 +147,11 @@
                                         </p>
                                     </div>
                                 </div>
-                            </li>
+                            </li>-->
+                        </ul>
+                        <ul class='fb' v-else>
+                            <!-- TODO:  暂无数据 -->
+                            <van-empty description='暂无数据' />
                         </ul>
                     </van-tab>
                 </van-tabs>
@@ -131,28 +160,34 @@
         <div class='bottom'>
             <!-- <span v-if='false'>近一个月,重要维保8条,重要维修3条,其他事项5条,综合事项10条</span> -->
             <van-notice-bar
-                v-if='true'
+                v-if='showNoticeBar'
                 class='bottom-notice'
                 background='#e5eef6'
                 color='#025baa'
                 speed='50'
                 scrollable
-                text='近一个月,重要维保8条,重要维修3条,其他事项5条,综合事项10条'
+                :text='noticeBarText'
             />
             <span v-else>近一个月,说明书无更新</span>
-            <van-icon v-show='true' class='building-arrow' name='arrow' size='14px' @click='goToUpdateRecord' />
+            <van-icon v-show='showNoticeBar' class='building-arrow' name='arrow' size='14px' @click='goToUpdateRecord' />
         </div>
     </div>
 </template>
 <script>
 import Vue from 'vue'
-import { Button, Icon, Swipe, SwipeItem, Lazyload, Image as VanImage, Tab, Tabs } from 'vant'
+// vant 按需引入
+import { Button, Icon, Swipe, SwipeItem, Lazyload, Image as VanImage, Tab, Tabs, Empty, NoticeBar } from 'vant'
 Vue.use(Button).use(Icon).use(Swipe).use(SwipeItem).use(Lazyload).use(VanImage)
 Vue.use(Tab).use(Tabs)
-import { NoticeBar } from 'vant'
 Vue.use(NoticeBar)
+Vue.use(Empty)
+// lodash
+import { isEmpty } from 'lodash'
+// moment
+import moment from 'moment'
 import ImagePreview1 from '@/components/ImagePreview'
-// import ConstructionUnitInfo from './ConstructionUnitInfo'
+// 接口
+import { queryFact, queryRecordCount } from '@/api/overview'
 export default {
     name: 'Overview',
     props: {},
@@ -161,7 +196,21 @@ export default {
         return {
             showImgPreview: true,
             imgList: ['https://img.yzcdn.cn/vant/apple-1.jpg', 'https://img.yzcdn.cn/vant/apple-2.jpg'],
-            active: 0,
+            active: 0, //  激活的tab页 0:建筑综合信息 1:施工单位信息
+            plazaId: '1000423', //广场ID
+            plazaName: '', //广场名称
+            build: [], //建筑综合信息
+            totalContractInfo: {}, //总包信息
+            showTotalContractInfo: true, //是否显示总包信息
+            subcontractInfo: [], //分包信息
+            showNoticeBar: true, //底部noticeBar 显隐
+            noticeBarText: '', //底部noticeBar 文本
+            objtypeDict: {
+                1: '重要维保',
+                3: '综合事项',
+                4: '重要维修',
+                5: '其他事项',
+            },
         }
     },
     watch: {
@@ -170,6 +219,11 @@ export default {
             console.log(val)
         },
     },
+    created() {
+        this.queryBaseInfo()
+        this.queryRecordCountFunc()
+    },
+
     beforeMount() {},
     mounted() {
         console.log('项目概况页面mounted')
@@ -179,18 +233,111 @@ export default {
         this.openPreview()
     },
     methods: {
+        /**
+         * 查询广场概况
+         */
+        async queryBaseInfo() {
+            let getParams = {
+                plazaId: this.plazaId,
+            }
+            let data = await queryFact({ getParams })
+            console.log(data)
+            // 顶部轮播图
+            this.imgList = data.pic2.concat(data.pic1)
+            this.plazaName = data.plazaName
+            // 建筑综合信息
+            this.build = data.build
+            //总包信息
+            let totalContractInfoArr = data.constructions.filter((v) => v.type === '总包')
+            if (totalContractInfoArr) {
+                this.showTotalContractInfo = true
+            } else {
+                this.showTotalContractInfo = false
+            }
+            let totalContractInfo = {
+                unit: totalContractInfoArr[0]?.unit || '--',
+                name: totalContractInfoArr[0]?.name || '--',
+                phone: totalContractInfoArr[0]?.phone || '--',
+                professional: [],
+            }
+            totalContractInfoArr.map((item) => {
+                item.professional && totalContractInfo.professional.push(item.professional)
+            })
+            this.totalContractInfo = totalContractInfo
+            //分包信息,组合页面需要展示的分包信息
+            let subcontractInfoArr = data.constructions.filter((v) => v.type === '分包')
+            subcontractInfoArr.sort((a, b) => b.professional.localeCompare(a.professional, 'zh'))
+            let subcontractInfo = []
+            /**
+             * 构造二维数组
+             */
+            subcontractInfo[0] = [subcontractInfoArr[0]]
+            let __index = 0
+            subcontractInfoArr.map((item, index) => {
+                if (index >= 1) {
+                    if (item.professional === subcontractInfo[__index][0].professional) {
+                        subcontractInfo[__index].push(item)
+                    } else {
+                        __index++
+                        subcontractInfo[__index] = [item]
+                    }
+                }
+            })
+            this.subcontractInfo = subcontractInfo
+            console.log(subcontractInfo)
+        },
+        /**
+         * 查询近三十天说明书更新记录
+         *
+         */
+        async queryRecordCountFunc() {
+            let getParams = {
+                plazaId: this.plazaId, //广场id 必填
+                changeDateStartDate: moment().subtract(1, 'months').format('YYYYMMDD000000'), //变更记录开始时间 格式yyyyMMddHHmiss 必填
+                changeDateEndDate: moment().format('YYYYMMDD000000'), //变更记录结束时间 格式yyyyMMddHHmiss 必填
+            }
+            let data = await queryRecordCount({ getParams })
+            console.log(data)
+            if (!data || data.result !== 'success') {
+                this.showNoticeBar = false //底部noticeBar 显隐
+                this.noticeBarText = ''
+                return true
+            }
+            data = data.data
+            data.sort((a, b) => a.objtype - b.objtype)
+            this.showNoticeBar = true
+            this.noticeBarText = ''
+
+            /* 
+            // 测试数据
+            data = [
+                {
+                    cnt: 6,
+                    objtype: 4, //变更内容类型(1:重要维保 3:综合事项 4:重要维修 5:其他事项)
+                },
+                { cnt: 10, objtype: 1 },
+                { cnt: 45, objtype: 3 },
+                { cnt: 4, objtype: 5 },
+            ] */
+            // 文本处理
+            let noticeBarText = '近一个月,'
+            data.map((item) => {
+                noticeBarText += `${this.objtypeDict[item.objtype]} ${item.cnt} 条,`
+            })
+            this.noticeBarText = noticeBarText.slice(0, noticeBarText.length - 1)
+        },
         openPreview() {
             this.showImgPreview = true
-            this.imgList = [
-                'https://img.yzcdn.cn/vant/apple-1.jpg',
-                'https://img.yzcdn.cn/vant/apple-2.jpg',
-                'https://img.yzcdn.cn/vant/apple-1.jpg',
-                'https://img.yzcdn.cn/vant/apple-2.jpg',
-                'https://img.yzcdn.cn/vant/apple-1.jpg',
-                'https://img.yzcdn.cn/vant/apple-2.jpg',
-                'https://img.yzcdn.cn/vant/apple-1.jpg',
-                'https://img.yzcdn.cn/vant/apple-2.jpg',
-            ].slice(0, parseInt(Math.random() * 8 + 1))
+            // this.imgList = [
+            //     'https://img.yzcdn.cn/vant/apple-1.jpg',
+            //     'https://img.yzcdn.cn/vant/apple-2.jpg',
+            //     'https://img.yzcdn.cn/vant/apple-1.jpg',
+            //     'https://img.yzcdn.cn/vant/apple-2.jpg',
+            //     'https://img.yzcdn.cn/vant/apple-1.jpg',
+            //     'https://img.yzcdn.cn/vant/apple-2.jpg',
+            //     'https://img.yzcdn.cn/vant/apple-1.jpg',
+            //     'https://img.yzcdn.cn/vant/apple-2.jpg',
+            // ].slice(0, parseInt(Math.random() * 8 + 1))
         },
         /**
          * 跳转说明书更新记录
@@ -201,7 +348,7 @@ export default {
     },
 }
 </script>
-<style lang='less' scoped>
+<style lang="less" scoped>
 .overview {
     width: 100%;
     height: calc(100% - 150px);
@@ -218,6 +365,19 @@ export default {
             width: 100%;
             height: 100%;
             .van-swipe-item {
+                position: relative;
+                .type-name {
+                    display: inline-block;
+                    width: 100px;
+                    padding: 10px 0 10px 20px;
+                    position: absolute;
+                    z-index: 10;
+                    left: 0;
+                    background: linear-gradient(270deg, rgba(4, 22, 39, 0) 0%, #020d18 100%);
+                    color: #fff;
+                    font-size: 16px;
+                    border-radius: 4px;
+                }
                 .van-image {
                     height: 100%;
                 }
@@ -290,13 +450,13 @@ export default {
                     height: 25px;
                     line-height: 25px;
                     margin-bottom: 10px;
+                    display: flex;
+                    align-items: center;
                 }
                 i {
                     display: inline-block;
                     overflow: hidden;
-                    width: 15px;
-                    height: 15px;
-                    margin-right: 5px;
+                    margin-right: 10px;
                 }
 
                 .title {
@@ -369,9 +529,10 @@ export default {
                                     padding-right: 10px;
                                 }
                                 & > :nth-child(2) {
-                                    width: auto;
+                                    width: 100px;
+                                    text-align: right;
                                     height: auto;
-                                    display: flex;
+                                    display: inline-block;
                                     align-items: center;
                                 }
                             }
@@ -422,4 +583,4 @@ export default {
         color: lightgreen;
     }
 }
-</style>
+</style>

BIN
管理说明书对接文档0922.pdf