Shannon_mu 2 years ago
parent
commit
41f600cf22

+ 0 - 5
commandCenter/src/App.vue

@@ -1,6 +1,5 @@
 <template>
     <div id="app">
-        <v-header></v-header>
         <router-view></router-view>
         <xk-modal></xk-modal>
         <div class="dmp-alert" v-if="popupsList.length !== 0">
@@ -11,7 +10,6 @@
     </div>
 </template>
 <script>
-import vHeader from '@components/common/Header.vue';
 export default {
     name: 'App',
     computed: {
@@ -19,9 +17,6 @@ export default {
             return this.$store.getters.getPopups;
         }
     },
-    components: {
-        vHeader
-    },
     created() {
         // 获取滚动条的满宽度和高度
         const $dom = document.createElement('div');

+ 8 - 3
commandCenter/src/main.js

@@ -38,9 +38,14 @@ Vue.use(ElementUI, {
 });
 
 //使用钩子函数对路由进行权限跳转
-// router.beforeEach((to, from, next) => {
-//   next()
-// });
+router.beforeEach((to, from, next) => {
+  if (to.path == '/') {
+    next('/homeIndex')
+  } else {
+    next()
+  }
+
+});
 new Vue({
   router,
   store,

+ 19 - 6
commandCenter/src/router/index.js

@@ -9,12 +9,25 @@ Vue.use(Router);
 const quietRoute = [
     {
         path: '/',
-        component: () => import('@views/commandDispatch/index.vue'),
-    }, 
-    {
-        path: '/homeIndex',
-        component: () => import('@views/commandDispatch/index.vue'),
-        meta: { title: '首页' }
+        component: () => import('@/components/common/Home.vue'),
+        children: [
+            {
+                path: '/homeIndex',
+                name: 'homeIndex',
+                component: () => import('@views/commandDispatch/index.vue'),
+                meta: { title: 'homeIndex' }
+            },
+            {
+                path: '/403',
+                component: () => import('@views/errorPage/403.vue'),
+                meta: { title: '403' }
+            },
+            {
+                path: '/404',
+                component: () => import('@views/errorPage/404.vue'),
+                meta: { title: '404' }
+            },
+        ],
     },
     {
         path: '*',

+ 99 - 0
commandCenter/src/views/commandDispatch/pop/tableList.vue

@@ -0,0 +1,99 @@
+<template>
+    <zz-table
+        :cols="cols"
+        :settings="{ showIndex: true, stripe: true }"
+        :loading="mixins_onQuery"
+        :data="mixins_list"
+        :pageset="mixins_pageset"
+        @page-change="pageChange"
+        @selection-change="selectionChange"
+    >
+        <!-- <template slot-scope="scope" slot="opt">
+            <div class="opt">
+                <el-tooltip effect="light" placement="bottom" content="详情">
+                    <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetail(scope.row)"></i>
+                </el-tooltip>
+                <el-tooltip effect="light" placement="bottom" content="终止">
+                    <i class="zoniot_font zoniot-icon-zhongzhi redText" v-if="scope.row.adStatus !== 3" @click="Scrap(scope.row.id)"></i>
+                    <i v-else class="zoniot_font zoniot-icon-zhongzhi ashText"></i>
+                </el-tooltip>
+
+                <el-tooltip effect="light" placement="bottom" content="删除">
+                    <i class="zoniot_font zoniot-icon-shanchu redText" @click="deluserbyidFn(scope.row.id)"></i>
+                </el-tooltip>
+            </div>
+        </template> -->
+    </zz-table>
+</template>
+<script>
+export default {
+    props: ['params'],
+    data() {
+        return {
+            formData: {}
+        };
+    },
+    methods: {
+        getData() {
+            this.$http
+                .get('/sc-energy/device/detail', { deviceId: this.params.row.deviceId })
+                .then(({ status, data, msg }) => {
+                    if (status == 0) {
+                        this.formData = data;
+                        console.log(data);
+                    } else {
+                        this.$message.error(msg);
+                    }
+                })
+                .catch(() => {});
+        },
+        typeStatus(val) {
+            switch (val) {
+                case 1:
+                    return '正常';
+                case 2:
+                    return '告警';
+                case 3:
+                    return '离线';
+                case 4:
+                    return '未启用';
+                case 5:
+                    return '报废';
+                default:
+                    return '--';
+            }
+        }
+    },
+    created() {
+        this.getData();
+        // console.log(this.params.row);
+    }
+};
+</script>
+<style lang="scss" scoped>
+.diyTable {
+    border: 1px solid #ffffff29;
+    border-radius: 6px;
+    font-size: 12px;
+    .list {
+        line-height: 40px;
+        display: flex;
+        border-bottom: 1px solid #ffffff29;
+        &:last-child {
+            border: none;
+        }
+        &-title {
+            width: 90px;
+            text-align: center;
+            border-right: 1px solid #ffffff29;
+        }
+        &-text {
+            width: calc(100% - 90px);
+            padding-left: 20px;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+        }
+    }
+}
+</style>