Browse Source

多项目

Signed-off-by: liubaiyan <632697560@qq.com>
liubaiyan 3 years ago
parent
commit
d5849c9422

+ 5 - 0
.env.dongjiu

@@ -0,0 +1,5 @@
+# .env.dongjiu
+NODE_ENV = production
+VITE_APP_TITLE = My App (dongjiu)
+VITE_BASE_API = "https://wuye.djchina.com/"
+VITE_TIME_OUT = 5000

+ 5 - 0
.env.tiantai

@@ -0,0 +1,5 @@
+# .env.tiantai
+NODE_ENV = production
+VITE_APP_TITLE = My App (tiantai)
+VITE_BASE_API = "https://wuye.tiantai.com/"
+VITE_TIME_OUT = 5000

+ 3 - 1
package.json

@@ -4,7 +4,9 @@
   "scripts": {
     "dev": "vite --host",
     "build": "vite build",
-    "serve": "vite preview"
+    "serve": "vite preview",
+    "dongjiu": "vite build --mode dongjiu",
+    "tiantai": "vite build --mode tiantai"
   },
   "dependencies": {
     "axios": "^0.21.1",

+ 9 - 0
src/api/engineering.js

@@ -119,3 +119,12 @@ export function getMaintenanceTaskDataOfEngineering (object) {
     type: 'JSON'
   })
 }
+//  工程大屏--获取项目数据
+export function getProjectDataOfEngineering (object) {
+  return request({
+    url: '/landcrm/rest/projectInfo/projectDetail',
+    method: 'post',
+    data: object,
+    type: 'FORM'
+  })
+}

+ 18 - 0
src/assets/css/public.scss

@@ -120,6 +120,14 @@
       }
     }
   }
+  .base-all-project{
+    height: calc(100% - 7vw - 15px);
+    margin-bottom: 5px;
+    background-image: url("../images/base_info_bg.png");
+    background-position: center;
+    background-repeat: no-repeat;
+    background-size: 100%;
+  }
   .base-info-container{
     width: 100%;
     height: 100%;
@@ -280,3 +288,13 @@
     }
   }
 }
+
+.tooltip-title{
+  color:#ffffff;
+  font-weight: bold;
+}
+.tooltip-dark{
+  color: $primary-color!important;
+  font-size: 1.5vh;
+  background-color: #30313380!important;
+}

BIN
src/assets/images/base_info_bg.png


+ 25 - 12
src/components/dataContainer/index.vue

@@ -4,20 +4,28 @@
     <div class="container-bg container-bg-left-bottom" />
     <div class="container-bg container-bg-right-top" />
     <div class="container-bg container-bg-right-bottom" />
-    <el-tooltip
-      :content="tipContent"
-      placement="top"
-      effect="light"
-      :disabled="!tipContent"
+    <div
+      v-if="title"
+      class="container-title"
+      :class="titlePosition == 'left' ? 'container-title-left' : 'container-title-top'"
     >
-      <div
-        v-if="title"
-        class="container-title"
-        :class="titlePosition == 'left' ? 'container-title-left' : 'container-title-top'"
+      {{ title }}
+      <el-tooltip
+        :content="tipContent"
+        placement="top"
+        popper-class="tooltip-dark"
+        effect="dark"
+        :disabled="!tipContent"
       >
-        {{ title }}
-      </div>
-    </el-tooltip>
+        <template #content>
+          <span class="tooltip-title">{{ title }}:</span>{{ tipContent }}
+        </template>
+        <i
+          v-show="tipContent"
+          class="el-icon-question"
+        />
+      </el-tooltip>
+    </div>
     <div
       :class="titlePosition == 'left' ? 'container-content-left' : 'container-content-top'"
       :style="{top: titlePosition != 'left' && !title ? '0.5vw' : '', left: titlePosition == 'left' && !title ? '0.5vw' : ''}"
@@ -48,6 +56,11 @@ export default {
 </script>
 
 <style scoped lang="scss">
+  @import '../../assets/css/storeColor';
+  .el-icon-question{
+    font-size: 1.8vh;
+    cursor: pointer;
+  }
   .container-box{
     width: calc(100% - 10px);
     height: calc(100% - 10px);

+ 59 - 31
src/views/engineeringScreen/index.vue

@@ -56,28 +56,38 @@
       <el-col :span="8">
         <el-row class="two-third-container">
           <dataContainer title="基础数据">
-            <div class="base-project-container">
+            <div
+              v-if="filterForm.projectId"
+              class="base-project-container"
+            >
               <div class="project-info">
                 <el-image
-                  src=""
+                  :src="projectOption.src"
                   fit="cover"
                   style="width: 50%; height: 15vh; float: left; margin: 0 10px 10px 0;"
                 />
-                <span class="project-info-title">DASDASDASD</span>
+                <span class="project-info-title">{{ projectOption.title }}</span>
                 <br>
-                <span class="project-info-text">萨顶顶ASDSD</span>
+                <span class="project-info-text">{{ projectOption.info }}</span>
               </div>
             </div>
+            <div
+              v-else
+              class="base-all-project"
+            />
             <div class="base-info-container">
               <div
                 class="base-info-card"
                 @click="getChartData(1)"
               >
                 <el-tooltip
-                  :content="(project ? filterForm.projectName : '所有项目') + '的设备总数'"
                   placement="top"
-                  effect="light"
+                  popper-class="tooltip-dark"
+                  effect="dark"
                 >
+                  <template #content>
+                    <span class="tooltip-title">在管设备:</span>{{ (project ? filterForm.projectName : '所有项目') + '的设备总数' }}
+                  </template>
                   <div class="base-info-title base-info-icon1">
                     在管设备
                   </div>
@@ -98,10 +108,13 @@
                 @click="getChartData(2)"
               >
                 <el-tooltip
-                  content="维修中、故障中定义为设备损坏状态,其他状态定义为完好状态"
                   placement="top"
-                  effect="light"
+                  popper-class="tooltip-dark"
+                  effect="dark"
                 >
+                  <template #content>
+                    <span class="tooltip-title">设备完好率:</span>维修中、故障中定义为设备损坏状态,其他状态定义为完好状态
+                  </template>
                   <div class="base-info-title base-info-icon2">
                     设备完好率
                   </div>
@@ -115,10 +128,13 @@
                 @click="getChartData(3)"
               >
                 <el-tooltip
-                  :content="'所有项目' + getYearAndMonth() + '巡检完成率(所有项目的任务完成数总计*100%/任务总数总计)'"
                   placement="top"
-                  effect="light"
+                  popper-class="tooltip-dark"
+                  effect="dark"
                 >
+                  <template #content>
+                    <span class="tooltip-title">巡检完成率:</span>{{ '所有项目' + getYearAndMonth() + '巡检完成率(所有项目的任务完成数总计*100%/任务总数总计)' }}
+                  </template>
                   <div class="base-info-title base-info-icon3">
                     巡检完成率
                   </div>
@@ -132,10 +148,13 @@
                 @click="getChartData(4)"
               >
                 <el-tooltip
-                  :content="'所有项目' + getYearAndMonth() + '维保完成率(所有项目的任务完成数总计*100%/任务总数总计)'"
                   placement="top"
-                  effect="light"
+                  popper-class="tooltip-dark"
+                  effect="dark"
                 >
+                  <template #content>
+                    <span class="tooltip-title">维保完成率:</span>{{ '所有项目' + getYearAndMonth() + '维保完成率(所有项目的任务完成数总计*100%/任务总数总计)' }}
+                  </template>
                   <div class="base-info-title base-info-icon4">
                     维保完成率
                   </div>
@@ -484,6 +503,7 @@ import {
   getProjectDictionary
 } from 'api/dictionary'
 import {
+  getProjectDataOfEngineering,
   getDeviceStatusDataOfEngineering,
   getDeviceStatusListOfEngineering,
   getDeviceTypeDataOfEngineering,
@@ -529,6 +549,11 @@ export default {
         { name: '运行中', key: 'running', code: 1 }
       ],
       deviceTypeOption: [],
+      projectOption: {
+        src: '',
+        title: '',
+        info: ''
+      },
       baseInfoOption: {
         deviceCount: '',
         projectCount: '',
@@ -612,6 +637,17 @@ export default {
           projectId: projectOption.projectId,
           projectName: projectOption.projectName
         }
+        getProjectDataOfEngineering({
+          projectId: this.filterForm.projectId
+        }).then(res => {
+          if (res.resultCode == 200) {
+            this.projectOption = {
+              src: res.data.imagePath,
+              title: res.data.projectName,
+              info: res.data.projectDesc
+            }
+          }
+        })
       }
       this.getScreenData()
     },
@@ -1463,29 +1499,21 @@ export default {
       height: 100%;
       margin: 4px;
       padding: 15px 5px 15px 20px;
+      .base-info-title{
+        height: 3vh;
+        font-size: 1.6vh;
+        line-height: 3vh;
+        background-size: 2.2vh;
+      }
       .base-info-data{
         width: 100%;
-        height: calc(100% - 80px);
-        float: left;
-        display: flex;
-        align-items: center;
-        color: #ffffff;
-        font-size: 32px;
-        margin: 18px 0 12px 0;
+        height: calc(100% - 6vh);
+        font-size: 2.4vh;
       }
       .base-info-tip{
-        width: 100%;
-        padding-right: 10px;
-        box-sizing: border-box;
-        height: 36px;
-        float: left;
-        color: #46aefd;
-        font-size: 12px;
-        line-height: 18px;
-        word-break: break-all;
-        span{
-          color: #ffffff;
-        }
+        height: 4vh;
+        font-size: 1.2vh;
+        line-height: 2vh;
       }
     }
   }

+ 4 - 0
src/views/index.vue

@@ -29,6 +29,10 @@ export default {
       setStore({ name: 'userNameScreen', content: this.$route.query.token })
       setStore({ name: 'tokenScreen', content: this.$route.query.token })
     }
+    if (localStorage.companyId) {
+      setStore({ name: 'companyIdScreen', content: localStorage.companyId })
+      setStore({ name: 'companyNameScreen', content: localStorage.companyName })
+    }
     this.$router.beforeEach((to, from, next) => {
       if (getToken()) {
         if (to.matched.length === 0) {

+ 1 - 1
src/views/login.vue

@@ -104,9 +104,9 @@ export default {
               clearStore({ type: 'session' })
               Cookies.set('user', res.users[0].userName)
               Cookies.set('access', 0)
-              setStore({ name: 'companyIdScreen', content: res.users[0].companyId })
               setStore({ name: 'userIdScreen', content: res.users[0].userid })
               setStore({ name: 'userNameScreen', content: res.users[0].userName })
+              setStore({ name: 'companyIdScreen', content: res.users[0].companyId })
               setStore({ name: 'companyNameScreen', content: res.users[0].companyName })
               setStore({ name: 'tokenScreen', content: res.users[0].token })
               this.$router.push({

+ 8 - 3
src/views/projectScreen/index.vue

@@ -314,8 +314,7 @@ export default {
                   return b.value - a.value
                 }).map((item, index) => {
                   return {
-                    name: item.name,
-                    value: item.value,
+                    ...item,
                     label: {
                       color: that.colorList[index],
                       fontSize: 14 * that.sizeRatio
@@ -532,7 +531,13 @@ export default {
                   data: that.taskOption.map((item, index) => {
                     return {
                       name: item.name,
-                      value: res.data[0][item.key],
+                      value: res.data[0][item.key]
+                    }
+                  }).sort((a, b) => {
+                    return b.value - a.value
+                  }).map((item, index) => {
+                    return {
+                      ...item,
                       label: {
                         color: that.colorList[index],
                         fontSize: 14 * that.sizeRatio

+ 6 - 6
vite.config.js

@@ -25,22 +25,22 @@ export default ({ command, mode }) => {
         port: 3001,
         proxy:{
           '/landcrm': {
-            // target: 'https://wuye.djchina.com/',
-            target: 'https://ebeitest.wuyeface.com:1188/',
+            target: 'https://wuye.djchina.com/',
+            // target: 'https://ebeitest.wuyeface.com:1188/',
             changeOrigin: true,
             ws: true,
             rewrite: (path) => path.replace(/^\/landcrm/, '/landcrm')
           },
           '/neikong': {
-            // target: 'https://wuye.djchina.com/',
-            target: 'https://ebeitest.wuyeface.com:1188/',
+            target: 'https://wuye.djchina.com/',
+            // target: 'https://ebeitest.wuyeface.com:1188/',
             changeOrigin: true,
             ws: true,
             rewrite: (path) => path.replace(/^\/neikong/, '/neikong')
           },
           '/datashow': {
-            // target: 'https://wuye.djchina.com/',
-            target: 'https://ebeitest.wuyeface.com:1188/',
+            target: 'https://wuye.djchina.com/',
+            // target: 'https://ebeitest.wuyeface.com:1188/',
             changeOrigin: true,
             ws: true,
             rewrite: (path) => path.replace(/^\/datashow/, '/datashow')