Просмотр исходного кода

wanda-adm:feat > 删除表格轮廓线展示,表头添加单位

shaun-sheep 4 лет назад
Родитель
Сommit
ca3a7c0c3c

+ 12 - 12
src/permission.ts

@@ -10,25 +10,25 @@ NProgress.configure({ showSpinner: false });
 const whiteList = ["/login"];
 
 router.beforeEach(async (to: Route, _: Route, next: any) => {
-  // Start progress bar
+  // 加载进度条
   NProgress.start();
 
-  // Determine whether the user has logged in
+  // 确定用户是否已登录
 //   if (UserModule.token) {
 //     if (to.path === "/login") {
-//       // If is logged in, redirect to the home page
+//       // 如果已登录,请重定向到主页
 //       next({ path: "/" });
 //       NProgress.done();
 //     } else {
-//       // Check whether the user has obtained his permission roles
+//       // 检查用户是否已获得其角色权限
 //       if (UserModule.roles.length === 0) {
 //         try {
-//           // Get user info, including roles
+//           // 获取用户信息,包括角色
 //           await UserModule.GetUserInfo();
-//           // Set the replace: true, so the navigation will not leave a history record
+//           // 设置replace:true,这样导航就不会留下历史记录
 //           next({ ...to, replace: true });
 //         } catch (err) {
-//           // Remove token and redirect to login page
+//           // 删除令牌并重定向到登录页
 //           UserModule.ResetToken();
 //           Message.error(err || "Has Error");
 //           next(`/login?redirect=${to.path}`);
@@ -39,12 +39,12 @@ router.beforeEach(async (to: Route, _: Route, next: any) => {
 //       }
 //     }
 //   } else {
-//     // Has no token
+//     // 没有令牌
 //     if (whiteList.indexOf(to.path) !== -1) {
-//       // In the free login whitelist, go directly
+//       // 在免费登录白名单中,直接进入
 //       next();
 //     } else {
-//       // Other pages that do not have permission to access are redirected to the login page.
+//       // 其他没有访问权限的页面将重定向到登录页面。
 //       next(`/login?redirect=${to.path}`);
 //       NProgress.done();
 //     }
@@ -53,9 +53,9 @@ router.beforeEach(async (to: Route, _: Route, next: any) => {
 });
 
 router.afterEach((to: Route) => {
-  // Finish progress bar
+  // 完成进度条
   NProgress.done();
 
-  // set page title
+  // 设置页面标题
   document.title = to.meta.title;
 });

+ 1 - 1
src/router/index.ts

@@ -62,7 +62,7 @@ export default new Router({
                     path: "index",
                     component: () =>
                         import(
-                            /* webpackChunkName: "project" */ "@/layout/components/Navbar/MessageSever/MsgAllDetails.vue"
+                            /* webpackChunkName: "allDetails" */ "@/layout/components/Navbar/MessageSever/MsgAllDetails.vue"
                         ),
                     meta: {
                         title: "消息中心"

+ 10 - 18
src/views/maintain/device/index.vue

@@ -51,20 +51,9 @@
             <template v-if="next">
                 <div class="align" style="height: 400px">
                     <span class="text ">设备类别</span>
-                    <el-select
-                        v-model="deviceVal"
-                        placeholder="请选择"
-                        clearable
-                        filterable
-                    >
-                        <el-option
-                            v-for="item in list"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
-
-                        />
-                    </el-select>
+                    <el-cascader :options="options" clearable v-model="deviceVal" @change="changeLinshi"
+                                 class="adm-select"></el-cascader>
+
                 </div>
                 <el-button type="primary" class="fr" @click="handleNext">下一步</el-button>
             </template>
@@ -74,7 +63,7 @@
                 <el-button type="default" class="fr ml-10">重置</el-button>
             </template>
             <template v-else>
-                <dataForm/>
+                <dataForm :dataFormList="dataFormList"/>
                 <el-button type="primary" class="fr ml-10">确定</el-button>
                 <el-button type="default" class="fr" @click="handlePosition">维护位置</el-button>
             </template>
@@ -84,7 +73,7 @@
 <script lang="ts">
 import { Component, Vue } from "vue-property-decorator";
 import { AdmMultiTable, AdmSearch, dataForm, Pagination, Statistics } from '../components/index'
-import { BeatchQueryParam, dictInfo, dictType } from "@/api/equipComponent";
+import { BeatchQueryParam, dictInfo } from "@/api/equipComponent";
 import { queryCount, queryEquip } from "@/api/datacenter";
 import { UserModule } from "@/store/modules/user";
 import tools from "@/utils/maintain"
@@ -309,8 +298,11 @@ export default class extends Vue {
         if (Object.keys(this.headerInformation).length > 0) {
             this.headerInformation.dictStages.forEach(item => {
                 if (this.currentHeader == item.name) {
-                    item.infos && item.infos.forEach(val => header.push(val))
-
+                    // item.infos && item.infos.forEach(val => header.push(val))
+                    item.infos && item.infos.forEach(val => {
+                        val.name = val.unit ? `${ val.name }(${ val.unit })` : val.name
+                        header.push(val)
+                    })
                 }
             })
         }

+ 22 - 22
src/views/maintain/space/index.vue

@@ -37,20 +37,9 @@
 
 <script lang="ts">
 import { Component, Vue } from "vue-property-decorator";
-import {
-    AdmMultiTable,
-    AdmSearch,
-    Pagination,
-    Statistics,
-} from "../components/index";
+import { AdmMultiTable, AdmSearch, Pagination, Statistics, } from "../components/index";
 import spaceGraph from "./components/spaceGraph.vue";
-import {
-    buildingQuery,
-    dictQuery,
-    floorQuery,
-    queryCountSpace,
-    queryZone,
-} from "@/api/datacenter";
+import { buildingQuery, dictQuery, floorQuery, queryCountSpace, queryZone, } from "@/api/datacenter";
 import tools from "@/utils/maintain";
 import { BeatchQueryParam } from "@/api/equipComponent";
 import { UserModule } from "@/store/modules/user";
@@ -249,7 +238,7 @@ export default class spaceIndex extends Vue {
                     pageSize: this.paginationList.size,
                     orders: "createTime desc, localName desc, localId desc, id asc",
                 };
-    
+
                 if (this.building.length === 1) {
                     param2.filters = "";
                     switch (this.building[0]) {
@@ -258,14 +247,14 @@ export default class spaceIndex extends Vue {
                             break;
                         case "all":
                             delete param2.filters;
-    
+
                             break;
                     }
                 } else if (this.building.length === 2) {
                     switch (this.building[1]) {
                         case "noKnow":
                             param2.filters = `buildingId='${this.building[0]}';floorId='isnull'`;
-    
+
                             break;
                         case "all":
                             param2.filters = `buildingId='${this.building[0]}'`;
@@ -274,7 +263,7 @@ export default class spaceIndex extends Vue {
                             param2.filters = `buildingId='${this.building[0]}';floorId='${this.building[1]}'`;
                     }
                 }
-    
+
                 let promise = new Promise((resolve) => {
                     dictQuery(param).then((res) => {
                         resolve(res);
@@ -300,6 +289,13 @@ export default class spaceIndex extends Vue {
                             dictStages.push(item);
                         }
                     });
+                    dictStages.map((val,index) => {
+                        val.name = val.unit ? `${ val.name }(${ val.unit })` : val.name
+                        if (val.path == 'outline') {
+                            dictStages.splice(index,1)
+                        }
+                        return val
+                    })
                     basicInfos.map((item) => {
                         if (item.path == "building") {
                             item.path = "buildingSign";
@@ -309,7 +305,7 @@ export default class spaceIndex extends Vue {
                         }
                         return item;
                     });
-    
+
                     this.headersStage = {
                         basicInfos: {
                             name: "模型解析",
@@ -331,10 +327,14 @@ export default class spaceIndex extends Vue {
                         if (item.floor) {
                             item.floorSign = item.floor.localName;
                         }
-                        item = {
-                            ...item,
-                            outline: JSON.stringify(item.outline),
-                        };
+                        // 删除轮廓线
+                        if (item.outline) {
+                            delete item.outline
+                        }
+                        // item = {
+                        //     ...item,
+                        //     outline: JSON.stringify(item.outline),
+                        // };
                         return item;
                     });
                     //  列表信息展示,获取动态数据

+ 1 - 0
src/views/maintain/system/index.vue

@@ -309,6 +309,7 @@ export default class extends Vue {
                     if (i.includes(item.path)) {
                         basicInfos.push(item);
                     } else {
+                        item.name = item.unit ? `${ item.name }(${ item.unit })` : item.name
                         dictStages.push(item);
                     }
                 });