fanghuisheng 3 лет назад
Родитель
Сommit
3e8f0d47da

+ 0 - 9
public/static/config.js

@@ -1,18 +1,9 @@
 // api 请求路径
 
-
 var PLATFROM_CONFIG = {};
 // PLATFROM_CONFIG.baseUrl = "http://172.16.120.104:8010/" //杨强本地
 // PLATFROM_CONFIG.baseUrl = "http://172.16.1.196:8010/" //超博本地
 
-// let aUrl = window.location.host
-// let arrUrl = aUrl.split(':')
-
-// alert(arrUrl[0])
-
-// console.log('goooooo' + process.env.VUE_APP_BASE_URL);
-// console.log('goooooo' + process.env.VUE_APP_ENV);
-
 PLATFROM_CONFIG.baseUrl = "https://qhome.usky.cn/uskypower/" //线上--->测试
 PLATFROM_CONFIG.images = "https://qhome.usky.cn/uskyfile/" //线上图片--->测试
 PLATFROM_CONFIG.fileUrl = "https://qhome.usky.cn/uskyfile/" //xlsx文件访问路径--->测试

+ 3 - 8
src/App.vue

@@ -8,17 +8,12 @@ import store from '@/store'
 
 export default defineComponent({
   setup() {
-    let hasToken = store.getters['user/accessToken']
-
     watchEffect((fn, options) => {
       fn, options
-      if (!hasToken) {
-        store.commit('getMiddleConfig') //中间页主体页面配置
-        // router.push({
-        //   path: '/login',
-        // })
-      }
+
+      var hasToken = store.getters['user/accessToken']
       if (hasToken) {
+        store.commit('getMiddleConfig') //中间页主体页面配置
         store.commit('publicSiteList') //获取站点下拉信息
       }
     })

+ 0 - 2
src/layout/vab-tabs/index.vue

@@ -204,8 +204,6 @@ export default {
       })
     },
     async addTabs(tag) {
-      console.log('tag')
-      console.log(tag)
 
       if (tag.meta && tag.meta.title && tag.meta.tagHidden !== true) {
         let matched = [tag.name]

+ 1 - 3
src/store/modules/tagsBar.js

@@ -26,9 +26,7 @@ const mutations = {
         }
 
         state.visitedRoutes.push(Object.assign({}, route))
-        console.log('state.visitedRoutes')
-        console.log(state.visitedRoutes)
-            // state.visitedRoutes = state.visitedRoutes.shift()
+        // state.visitedRoutes = state.visitedRoutes.shift()
     },
     /**
      * @author chuzhixin 1204505056@qq.com

+ 1 - 2
src/views/alarmManage/dialogComponent.vue

@@ -181,8 +181,7 @@ export default defineComponent({
 
     const dataSet = reactive({
       uploadUrl:
-        process.env.VUE_APP_BASE_URL +
-        '/patrolInspectionDevice/pictureUpload',
+        process.env.VUE_APP_BASE_URL + '/patrolInspectionDevice/pictureUpload',
       fileList: [],
     })
 

+ 14 - 69
src/views/index/components/VersionInformation.vue

@@ -1,11 +1,5 @@
 <template>
   <div class="version-information" style="margin-top: 0">
-    <!-- <div class="columns">
-      <div class="layoutItem" v-for="item in mainData" :key="item.i">
-        <b>{{ item.i }}</b>
-        : [{{ item.x }}, {{ item.y }}, {{ item.w }}, {{ item.h }}]
-      </div>
-    </div> -->
     <div class="vueGridLayout" v-if="!editModelBool">
       <div class="board" style="width: 100%">
         <div class="home">
@@ -62,72 +56,13 @@
                 v-if="item.colorType === 'iconText'"
                 style="display: flex; height: 100%"
               >
-                <div
-                  style="padding: 0px 20px; text-align: center; margin: auto 0"
-                >
-                  <img :src="item.iconPath" alt="" />
-                </div>
-                <div style="margin: auto 0">
-                  <div
-                    :style="{
-                      color: item.dataNameColor,
-                      'font-size': item.dataNameFont + 'px',
-                    }"
-                  >
-                    {{ item.dataName }}
-                  </div>
-                  <div
-                    :style="{
-                      color: item.dataValueColor,
-                      'font-size': item.dataValueFont + 'px',
-                      'font-weight': 800,
-                    }"
-                  >
-                    {{
-                      item.textValue === null || item.textValue === ''
-                        ? '暂无数据'
-                        : item.textValue
-                    }}
-                  </div>
-                </div>
+                <divIconText :item="item"></divIconText>
               </div>
               <div v-if="item.colorType === 'echarts'">
-                <div
-                  :style="{
-                    padding: '0px 5px',
-                  }"
-                >
-                  <img :src="item.iconPath" alt="" />
-                  <span
-                    :style="{
-                      color: item.dataValueColor,
-                      'font-weight': 800,
-                      'padding-top': '1px',
-                      'padding-left': '5px',
-                    }"
-                  >
-                    {{ item.dataName }}
-                  </span>
-                </div>
+                <divEcharts :item="item"></divEcharts>
               </div>
               <div v-if="item.colorType === 'tabls'">
-                <div
-                  :style="{
-                    padding: '0px 5px',
-                  }"
-                >
-                  <img :src="item.iconPath" alt="" />
-                  <span
-                    :style="{
-                      color: item.dataValueColor,
-                      'font-weight': 800,
-                      'padding-top': '1px',
-                      'padding-left': '5px',
-                    }"
-                  >
-                    {{ item.dataName }}
-                  </span>
-                </div>
+                <div-tabls :item="item"></div-tabls>
               </div>
             </grid-item>
           </grid-layout>
@@ -162,9 +97,16 @@
 <script>
 import { dependencies, devDependencies } from '*/package.json'
 import { GridLayout, GridItem } from 'vue-grid-layout'
+// 布局模板 开始
+import divIconText from './componentDiv/divIconText.vue'
+import divTabls from './componentDiv/divTabls.vue'
+import divEcharts from './componentDiv/divEcharts.vue'
+// 布局模板 结束
+// 编辑模板 开始
 import iconText from './componentModel/iconText.vue'
 import Echarts from './componentModel/echarts.vue'
 import Atabls from './componentModel/Atabls.vue'
+// 编辑模板 结束
 import * as api from '@/api/index/index.js'
 
 import { useStore } from 'vuex'
@@ -178,6 +120,10 @@ export default defineComponent({
     iconText,
     Echarts,
     Atabls,
+
+    divIconText,
+    divTabls,
+    divEcharts,
   },
   setup() {
     const store = useStore()
@@ -194,7 +140,6 @@ export default defineComponent({
           siteId: store.state.siteId,
         })
         .then((requset) => {
-          console.log(requset.data)
           mainData.value = requset.data
         })
     }

+ 52 - 0
src/views/index/components/componentDiv/divEcharts.vue

@@ -0,0 +1,52 @@
+<template>
+  <div
+    :style="{
+      padding: '0px 5px',
+    }"
+  >
+    <img :src="item.iconPath" alt="" />
+    <span
+      :style="{
+        color: item.dataValueColor,
+        'font-weight': 800,
+        'padding-top': '1px',
+        'padding-left': '5px',
+      }"
+    >
+      {{ item.dataName }}
+    </span>
+  </div>
+</template>
+<script>
+import { defineComponent, ref, onMounted } from 'vue'
+export default defineComponent({
+  props: {
+    item: Object,
+  },
+  setup(props, context) {
+    context
+
+    const item = ref(props.item)
+
+    onMounted(() => {
+      // console.log('aaaaaaaaaaaaaa', item)
+    })
+
+    return {
+      item,
+    }
+  },
+})
+</script>
+<style lang="less" scoped>
+.vue-grid-item {
+  border-radius: 5px;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+</style>

+ 50 - 0
src/views/index/components/componentDiv/divIconText.vue

@@ -0,0 +1,50 @@
+<template>
+  <div style="padding: 0px 20px; text-align: center; margin: auto 0">
+    <img :src="item.iconPath" alt="" />
+  </div>
+  <div style="margin: auto 0">
+    <div
+      :style="{
+        color: item.dataNameColor,
+        'font-size': item.dataNameFont + 'px',
+      }"
+    >
+      {{ item.dataName }}
+    </div>
+    <div
+      :style="{
+        color: item.dataValueColor,
+        'font-size': item.dataValueFont + 'px',
+        'font-weight': 800,
+      }"
+    >
+      {{
+        item.textValue === null || item.textValue === ''
+          ? '暂无数据'
+          : item.textValue
+      }}
+    </div>
+  </div>
+</template>
+<script>
+import { defineComponent, ref, onMounted } from 'vue'
+
+export default defineComponent({
+  props: {
+    item: Object,
+  },
+  setup(props, context) {
+    context
+
+    const item = ref(props.item)
+
+    onMounted(() => {
+      // console.log('aaaaaaaaaaaaaa', item)
+    })
+
+    return {
+      item,
+    }
+  },
+})
+</script>

+ 40 - 0
src/views/index/components/componentDiv/divTabls.vue

@@ -0,0 +1,40 @@
+<template>
+  <div
+    :style="{
+      padding: '0px 5px',
+    }"
+  >
+    <img :src="item.iconPath" alt="" />
+    <span
+      :style="{
+        color: item.dataValueColor,
+        'font-weight': 800,
+        'padding-top': '1px',
+        'padding-left': '5px',
+      }"
+    >
+      {{ item.dataName }}
+    </span>
+  </div>
+</template>
+<script>
+import { defineComponent, ref, onMounted } from 'vue'
+export default defineComponent({
+  props: {
+    item: Object,
+  },
+  setup(props, context) {
+    context
+
+    const item = ref(props.item)
+
+    onMounted(() => {
+      console.log('aaaaaaaaaaaaaa', item)
+    })
+
+    return {
+      item,
+    }
+  },
+})
+</script>