Bladeren bron

wanda-adm:feat > 添加、编辑,关系总览等

shaun-sheep 4 jaren geleden
bovenliggende
commit
ef4300bcd8

+ 12 - 1
public/index.html

@@ -21,6 +21,17 @@
   html {
     height: 100%;
   }
-
+  ::-webkit-scrollbar {
+      width: 8px;
+      height: 8px;
+  }
+  ::-webkit-scrollbar-thumb {
+      height: 50px;
+      outline-offset: -2px;
+      outline: 2px solid #dddee0;
+      border: 2px solid #dddee0;
+      background-color: #dddee0;
+      border-radius: 4px;
+  }
 </style>
 </html>

+ 10 - 0
src/api/datacenter.ts

@@ -80,3 +80,13 @@ export function queryCountSystem(postParams: any): any {
 export function queryCountSpace(postParams: any): any {
     return httputils.postJson(`${ baseApi }/object/zone/count`, postParams)
 }
+
+// 查询关系总览
+export function relationshipOverview(postParams: any): any {
+    return httputils.postJson(`${ baseApi }/rel/graphic/overview`, postParams)
+}
+
+// 查询关系数量
+export function relationshipCount(postParams: any): any {
+    return httputils.postJson(`${ baseApi }/rel/graphic/query/count`, postParams)
+}

+ 2 - 1
src/components/business/baseDataForm.vue

@@ -14,9 +14,10 @@
                                 <el-input
                                     :disabled="!item.editable"
                                     v-if="item.dataType == 'STRING'"
-                                    v-model="form[item.classification]"/>
+                                    v-model="form[item.path]"/>
                                 <el-input
                                     v-else-if="item.path == 'classification'"
+                                    v-model="form[item.path]"
                                     disabled
                                 />
                                 <el-input

+ 1 - 2
src/components/business/dataForm.vue

@@ -17,8 +17,7 @@
                         <el-tab-pane v-for="(item,index) in paneMsg" :key="index" :label="item"
                                      :name="index.toString()"/>
                     </el-tabs>
-                    <div class="table">
-
+                    <div class="table" style="height: 200px;overflow: auto">
                         <el-row :gutter="18">
                             <el-col :span="item.dataType == 'ATTACHMENT'? 24:8"
                                     :key="item.path"

+ 5 - 1
src/components/public/adm-multi-table.vue

@@ -19,7 +19,7 @@
                 <el-table-column
                     v-for="(child, index) in item.data"
                     :key="index"
-                    :label="child.unit ? child.name + child.unit : child.name"
+                    :label="child.unit ? child.name + ' (' + child.unit + ')': child.name"
                     :prop="child.path"
                     align="center"
                 >
@@ -52,6 +52,10 @@ export default class extends Vue {
         return row
     }
 
+
+    created() {
+    }
+
     @Watch("headersStage", { immediate: true, deep: true })
     onCurrentHeaderChange() {
         this.$nextTick(() => {

+ 1 - 1
src/components/public/adm-pagination.vue

@@ -14,7 +14,7 @@
 <script lang="ts">
 // 当前页,总数,范围
 interface Pagination {
-    page:number,
+    page:number
     size: number
     total: number
     sizes: []

+ 1 - 1
src/components/public/uploadImgs.vue

@@ -39,7 +39,7 @@
                     <video style="display:none;" id="video" controls/>
                 </div>
             </div>
-            <details-dialog :title="'图片'" :iframeSrc="iframeSrc" :dialog="dialog" :setData="imagesArr"></details-dialog>
+<!--            <details-dialog :title="'图片'" :iframeSrc="iframeSrc" :dialog="dialog" :setData="imagesArr"></details-dialog>-->
         </div>
     </template>
 

+ 8 - 5
src/permission.ts

@@ -1,19 +1,22 @@
 import router from "./router/index";
 import NProgress from "nprogress";
 import "nprogress/nprogress.css";
-import { Message } from "element-ui";
 import { Route } from "vue-router";
-import { UserModule } from "@/store/modules/user";
 
 NProgress.configure({ showSpinner: false });
 
 const whiteList = ["/login"];
 
 router.beforeEach(async (to: Route, _: Route, next: any) => {
-  // 加载进度条
-  NProgress.start();
+    // let routeList = []
+    console.log(to)
+    if (to.path == '/maintain/relation') {
+    }
 
-  // 确定用户是否已登录
+    // 加载进度条
+    NProgress.start();
+
+    // 确定用户是否已登录
 //   if (UserModule.token) {
 //     if (to.path === "/login") {
 //       // 如果已登录,请重定向到主页

+ 12 - 3
src/router/index.ts

@@ -143,7 +143,7 @@ export default new Router({
                     component: () =>
                         import(
                             /* webpackChunkName: "system" */ "@/views/maintain/system/index.vue"
-                        ),
+                            ),
                     meta: { title: "系统" }
                 },
                 {
@@ -151,8 +151,17 @@ export default new Router({
                     component: () =>
                         import(
                             /* webpackChunkName: "relationship" */ "@/views/maintain/relationship/index.vue"
-                        ),
-                    meta: { title: "关系" }
+                            ),
+                    meta: { title: "关系" },
+
+                }, {
+                    path: "relation",
+                    component: () =>
+                        import(
+                            /* webpackChunkName: "relationship" */ "@/views/maintain/relationship/relation/index.vue"
+                            ),
+                    meta: { title: "关系", hidden: true },
+
                 }
             ]
         },

+ 34 - 0
src/utils/maintain.ts

@@ -48,7 +48,41 @@ export const tools = {
         let minute = now.getMinutes();
         let second = now.getSeconds();
         return year + "-" + month + "-" + (date > 10 ? date : '0' + date) + " " + hour + ":" + (minute > 10 ? minute : '0' + minute) + ":" + (second > 10 ? second : '0' + second);
+    },
+    /**
+     * @param arr [a,b,c]
+     *
+     * val value
+     */
+    returnNewObj: (data: any, arr: any, val: any) => {
+        if (arr.length > 1) {
+            let k = arr.shift()
+            if (!data[k]) {
+                data[k] = {}
+            }
+            tools.returnNewObj(data[k], arr, val)
+        } else {
+            let curk = arr[0]
+            data[curk] = val;
+        }
+    },
+    /**
+     * @param data Object
+     * @returns 将对象中 key 为a.b.c 转换为a:{b:{c:''}}
+     */
+    formatData: (data: any) => {
+        let newData = JSON.parse(JSON.stringify(data))
+        for (let key in newData) {
+            if (key.indexOf('.') > -1) {
+                let arr = key.split('.')
+                tools.returnNewObj(newData, arr, newData[key])
+                delete newData[key]
+            }
+        }
+        return newData
     }
+
+
 }
 export default tools
 

+ 263 - 5
src/views/maintain/relationship/index.vue

@@ -1,12 +1,270 @@
 <template>
-    <div>关系</div>
+    <div class="relationship" v-loading="loading">
+        <template v-for="(item,index) in content">
+            <p class="title" :key="index">架构从属关系</p>
+            <section v-for="(child,childIndex) in item.childGraphicTypeList" :key="childIndex">
+                <p class="ship-title">{{ child.graphTypeName }}
+                    <i class="iconfont icon-xiangmuguanli"></i>
+                </p>
+                <el-row :gutter="20">
+                    <el-col :span="8" v-for="(relation,relIndex) in child.relationTypeProjectList" :key="relIndex"
+                            class="card">
+                        <el-card shadow="hover">
+                            <article class="ship-card-title">
+                                <el-tooltip
+                                    :content="relation.relationTypeName"
+                                    placement="top">
+                                    <span>{{ relation.relationTypeName }}</span>
+                                </el-tooltip>
+                                <el-tooltip
+                                    :content="relation.relationTypeCode"
+                                    placement="top">
+                                    <span>{{ relation.relationTypeCode }}</span>
+                                </el-tooltip>
+                            </article>
+                            <el-row class="ship-card-content">
+                                <el-col :span="12">
+                                    <article class="ship-card-object">
+                                        <p>主要连接对象</p>
+                                        <el-tooltip
+                                            :content="relation.conneObject"
+                                            placement="top"
+                                        >
+                                            <p>{{ relation.conneObject }}</p>
+                                        </el-tooltip>
+                                    </article>
+                                </el-col>
+                                <el-col :span="1">
+                                    <div class="border"></div>
+                                </el-col>
+                                <el-col :span="11" class="ship-card-object">
+                                    <article>
+                                        <p>连接数量</p>
+                                        <p>{{ relation.count }}</p>
+                                    </article>
+                                </el-col>
+                            </el-row>
+                            <article class="ship-card-time">
+                                <span v-show="relation.computationalState === 3">关系计算中...</span>
+                                <span v-show="relation.computationalState === 5">计算失败</span>
+                                <span
+                                    v-show="relation.computationalState !== 3  && relation.computingTime">最后一次计算时间 {{
+                                        relation.computingTime
+                                    }}</span>
+                                <span style="float: right">
+                                <el-tooltip
+                                    content="启动计算"
+                                    placement="top">
+                                    <el-badge
+                                        style="margin-bottom: 4px;"
+                                        :is-dot="relation.computationalState === 2 || relation.computationalState === 5">
+                                        <el-button
+                                            @click="computed(relation)"
+                                            :disabled="!relation.source && !relation.automatic"
+                                            circle
+                                            type=""
+                                            plain
+                                            icon="iconfont icon-yizhixingjianchagongju"
+                                            class="sm-button">
+                                        </el-button>
+                                    </el-badge>
+                                </el-tooltip>
+                                <el-tooltip
+                                    content="手动编辑"
+                                    placement="top">
+                                    <el-button
+                                        :disabled="relation.manual === 1"
+                                        :style="{ 'border': ( relation.manual=== 1? '1px solid #DCDFE6' :'') } "
+                                        @click="manual(relation)"
+                                        circle
+                                        class="sm-button"
+                                        type=""
+                                        plain
+                                        icon="iconfont icon-bianji">
+                                    </el-button>
+
+                                </el-tooltip>
+                                </span>
+
+                            </article>
+                        </el-card>
+                    </el-col>
+
+                </el-row>
+            </section>
+
+        </template>
+    </div>
 </template>
 
-<script>
-export default {
-    name: "index"
+<script lang="ts">
+import { Component, Vue } from "vue-property-decorator";
+import { relationshipCount, relationshipOverview } from "@/api/datacenter"
+@Component({
+    name: "relationShip"
+})
+export default class extends Vue {
+    loading = false
+    content = []
+
+
+    created() {
+        this.init()
+    }
+
+    init() {
+        this.loading = true
+        let promise = new Promise(resolve => {
+            relationshipOverview({}).then(res => {
+                resolve(res)
+            })
+        })
+        let promise1 = new Promise(resolve => {
+            relationshipCount({}).then(res => {
+                resolve(res)
+            })
+        })
+        Promise.all([promise, promise1]).then(res => {
+            this.loading = false;
+            let content = []
+            content = res[0].content
+            this.transform(content, res[1].content);
+            this.content = content;
+        })
+    }
+
+    transform(list1, list2) {
+        let countInfo = {}; // { graphTypeName: { Id: count } }
+        list2.forEach(item => {
+            countInfo[item.graphTypeName] = countInfo[item.graphTypeName] || {};
+            let rList = item.relationTypeProjectList;
+            rList.forEach(r => {
+                countInfo[item.graphTypeName][r.id] = r.count;
+            });
+        });
+        let changeList = [];
+        list1.forEach(item => {
+            // 这里保存的是引用
+            if (item.childGraphicTypeList) {
+                changeList.push(...item.childGraphicTypeList);
+            }
+        });
+        changeList.length > 0 &&
+        changeList.forEach(item => {
+            let name = item.graphTypeName;
+            let rList = item.relationTypeProjectList;
+            rList && rList.forEach(r => {
+                r.count = countInfo[name][r.id];
+            });
+        });
+    }
+
+    computed() {
+
+    }
+
+    manual() {
+        this.$router.push({
+            path: 'relation',
+            meta: [{ title: '222', hidden: true }]
+        })
+    }
 }
 </script>
 
-<style scoped>
+<style scoped lang="scss">
+.relationship {
+    height: 100%;
+
+    .title {
+        text-indent: 10px;
+        color: #646C73;
+        margin: 12px 0;
+        padding-bottom: 10px;
+        border-bottom: 1px solid #E1E7EA;
+    }
+
+    section {
+        margin: 12px;
+
+        .card {
+            margin: 10px 0;
+        }
+
+        .ship-title {
+            border-left: 7px solid #555555;
+            margin-bottom: 10px;
+            text-indent: 10px;
+            font-weight: 500;
+            color: #646C73;
+
+            i {
+                margin-left: 10px;
+            }
+        }
+
+        .ship-card-title {
+            span {
+                font-size: 18px;
+                color: #1F2429;
+                font-weight: 600;
+            }
+
+            span:last-child {
+                float: right;
+                color: #8D9399;
+                font-size: 14px;
+            }
+
+        }
+    }
+
+
+    .ship-card-content {
+        margin: 35px 0;
+
+        .ship-card-object {
+            p {
+                color: #C3C7CB;
+                margin-bottom: 7px;
+
+                &:last-child {
+                    color: #1F2429;
+                    font-size: 16px;
+                    font-weight: 600;
+                }
+            }
+        ;
+        }
+
+        .border {
+            width: 1px;
+            height: 45px;
+            background: #D8D8D8;
+        }
+
+    }
+
+    .ship-card-time {
+        overflow: hidden;
+
+        span {
+            font-size: 12px;
+            color: #C3C7CB;
+        }
+
+        .sm-button {
+            margin-right: 5px;
+        }
+
+        i {
+            float: right;
+            color: #8D9399;
+            font-size: 14px;
+            margin: 0 5px;
+            cursor: pointer;
+        }
+
+    }
+}
 </style>

+ 15 - 0
src/views/maintain/relationship/relation/components/addRelationDialog.vue

@@ -0,0 +1,15 @@
+<template>
+<el-dialog>
+
+</el-dialog>
+</template>
+
+<script>
+export default {
+    name: 'addRelationDialog'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
src/views/maintain/relationship/relation/components/excelDialog.vue

@@ -0,0 +1,13 @@
+<template>
+<el-dialog>ccc</el-dialog>
+</template>
+
+<script>
+export default {
+    name: 'excelDialog'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 92 - 0
src/views/maintain/relationship/relation/components/table.vue

@@ -0,0 +1,92 @@
+<template>
+    <el-table
+        :data="tableData"
+        :span-method="objectSpanMethod"
+        :header-cell-style="{ background: '#e1e4e5',color: '#2b2b2b', lineHeight: '30px' }"
+        class="table"
+        style="width: 100%;"
+        height="100%"
+    >
+        <el-table-column
+            prop="Name"
+            label="空间本地名称"
+            align="left"
+            min-width="140"
+        >
+        </el-table-column>
+        <el-table-column
+            prop="LocalID"
+            label="空间本地编码"
+            align="left"
+            min-width="140"
+        >
+        </el-table-column>
+        <el-table-column
+            prop="LocalName"
+            label="建筑-楼层"
+            align="left"
+            min-width="140"
+        >
+        </el-table-column>
+        <el-table-column
+            prop="CADID"
+            label="BIM构件名称"
+            align="left"
+            min-width="100"
+        >
+        </el-table-column>
+        <el-table-column
+            class-name="td-bl"
+            prop="cName"
+            label="系统分类"
+            width="180"
+            align="left"
+        >
+        </el-table-column>
+
+        <el-table-column
+            prop="cLocalName"
+            label="设备类型名称"
+            align="left"
+        >
+        </el-table-column>
+        <el-table-column
+            prop="cCADID"
+            label="设备本地编码"
+            align="left"
+        >
+        </el-table-column>
+        <el-table-column
+            label="操作"
+            align="left"
+        >
+            <template slot-scope="scope">
+                <el-button slot="reference" size="mini" icon="el-icon-delete"
+                           @click="deleteObject(scope.$index, scope.row)"/>
+            </template>
+        </el-table-column>
+    </el-table>
+</template>
+
+<script lang="ts">
+import { Component, Vue } from "vue-property-decorator";
+
+@Component({
+    name: 'relation-table'
+})
+export default class extends Vue {
+    tableData = []
+
+    objectSpanMethod() {
+
+    }
+
+    deleteObject() {
+
+    }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 61 - 0
src/views/maintain/relationship/relation/index.vue

@@ -0,0 +1,61 @@
+<template>
+    <div class="relation">
+        <div class="header">
+            <el-button class="el-icon-back"></el-button>
+            <el-button type="primary">添加关系</el-button>
+            <el-button style="float: right">上传Excel</el-button>
+        </div>
+        <el-row class="content">
+            <el-col :span="12" class="object">
+                <p>主对象</p>
+                <span>类型:</span>
+                <el-select v-model="mainObject" placeholder="请选择" style="margin-right: 10px"></el-select>
+                <AdmSearch/>
+            </el-col>
+            <el-col :span="12" class="object">
+                <p>从对象</p>
+                <span>类型:</span>
+                <el-select v-model="mainObject" placeholder="请选择" style="margin-right: 10px"></el-select>
+                <AdmSearch/>
+            </el-col>
+        </el-row>
+        <relationTable/>
+    </div>
+</template>
+
+<script lang="ts">
+import { Component, Vue } from "vue-property-decorator";
+import { AdmSearch } from "./../../components"
+import relationTable from "./components/table"
+@Component({
+    name: 'relation',
+    components: { AdmSearch,relationTable }
+})
+export default class extends Vue {
+    mainObject = ''
+
+}
+</script>
+
+<style scoped lang="scss">
+.relation {
+    background: #ffffff;
+    height: 100%;
+
+    .header {
+        padding: 12px;
+        overflow: hidden;
+        border-bottom: 1px solid #E1E7EA;
+    }
+    .content{
+        padding: 12px;
+        .object{
+            p{
+                border-left: 7px solid #555555;
+                text-indent: 10px;
+                margin-bottom: 10px;
+            }
+        }
+    }
+}
+</style>

+ 105 - 40
src/views/maintain/space/index.vue

@@ -1,6 +1,6 @@
 <template>
-    <div class="space-index">
-        <statistics :statistics-msg="statisticsMsg" />
+    <div class="adm-space">
+        <statistics :statistics-msg="statisticsMsg"/>
         <el-divider class="small-divider"></el-divider>
         <div class="tabs">
             <el-tabs v-model="activeName" type="card" @tab-click="tabChange">
@@ -9,64 +9,73 @@
             </el-tabs>
             <div class="tab-content">
                 <div class="search" :class="{ 'borderBottom': activeName==='picture' }">
-                    <el-cascader clearable ref="floorCascader" placeholder="请选择建筑楼层" :options="options" v-model="building" filterable size="small"
-                        @change="changeCascader" style="margin-right: 12px" v-if="activeName==='table'"></el-cascader>
-                    <admSearch @SearchValue="searchValue" class="item" v-if="activeName==='table'" />
+                    <el-cascader clearable ref="floorCascader" placeholder="请选择建筑楼层" :options="options"
+                                 v-model="building" filterable size="small"
+                                 @change="changeCascader" style="margin-right: 12px"
+                                 v-if="activeName==='table'"></el-cascader>
+                    <admSearch @SearchValue="searchValue" class="item" v-if="activeName==='table'"/>
 
-                    <el-cascader clearable ref="graphCascader" placeholder="请选择建筑楼层" :options="graphOptions" v-model="graphBuilding" filterable
-                        size="small" @change="changeGraphCascader" style="margin-right: 12px" v-if="activeName==='picture'" :props="graphProps">
+                    <el-cascader clearable ref="graphCascader" placeholder="请选择建筑楼层" :options="graphOptions"
+                                 v-model="graphBuilding" filterable
+                                 size="small" @change="changeGraphCascader" style="margin-right: 12px"
+                                 v-if="activeName==='picture'" :props="graphProps">
                     </el-cascader>
-                    <el-cascader v-model="zoneTypeVal" :options="zoneTypeOption" @change="changeZoneType" placeholder="请选择分区" class="item"
-                        v-if="activeName==='picture'"></el-cascader>
+                    <el-cascader v-model="zoneTypeVal" :options="zoneTypeOption" @change="changeZoneType"
+                                 placeholder="请选择分区" class="item"
+                                 v-if="activeName==='picture'"></el-cascader>
                 </div>
                 <div v-if="activeName==='table'" v-loading="loading" style="height: calc(100% - 100px);padding: 0 12px">
                     <template style="height: 100%;" v-if="building.length > 0">
-                        <admMultiTable :currentHeader="currentHeader" :headersStage="headersStage" :tableData="tableData" />
-                        <Pagination v-if="tableData.length > 0" :paginationList="paginationList" @handleCurrentChange="handleCurrentChange"
-                            @handleSizeChange="handleSizeChange" />
+                        <admMultiTable
+                            @handleCurrentEdit="handleCurrentEdit"
+                            :currentHeader="currentHeader"
+                            :headersStage="headersStage"
+                            :tableData="tableData"/>
+                        <Pagination v-if="tableData.length > 0" :paginationList="paginationList"
+                                    @handleCurrentChange="handleCurrentChange"
+                                    @handleSizeChange="handleSizeChange"/>
                     </template>
                     <div v-else class="void align">
-                        <svg-icon name="void" :width="String(120)" :height="String(123)" />
+                        <svg-icon name="void" :width="String(120)" :height="String(123)"/>
                         <p class="void-title">暂无内容</p>
                         <p class="void-tips">可点击左上角选择设备类型</p>
                     </div>
                 </div>
                 <div class="graph" v-if="activeName==='picture'">
-                    <spaceGraph ref="spaceGraph" />
+                    <spaceGraph ref="spaceGraph"/>
                 </div>
             </div>
         </div>
+        <el-dialog title="编辑空间信息" :visible.sync="dialogVisible" @close="close">
+            <baseDataForm :objectHeaders="spaceHeaders"
+                          :currRowContent="currRowContent"
+                          ref="baseDataForm"/>
+            <span slot="footer" class="dialog-footer">
+                 <el-button type="primary" @click="handleDataForm">完成</el-button>
+                 <el-button @click="dialogVisible = false">取消</el-button>
+            </span>
+        </el-dialog>
     </div>
 </template>
 
 <script lang="ts">
 import { Component, Vue } from "vue-property-decorator";
-import {
-    AdmMultiTable,
-    AdmSearch,
-    Pagination,
-    Statistics,
-} from "../components/index";
+import { AdmMultiTable, AdmSearch, baseDataForm, 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, updateZone } from "@/api/datacenter";
 import tools from "@/utils/maintain";
 import { BeatchQueryParam } from "@/api/equipComponent";
 import { UserModule } from "@/store/modules/user";
 
 @Component({
-    name: "space-index",
+    name: "adm-space",
     components: {
         Statistics,
         AdmSearch,
         AdmMultiTable,
         spaceGraph,
         Pagination,
+        baseDataForm
     },
 })
 export default class spaceIndex extends Vue {
@@ -128,6 +137,11 @@ export default class spaceIndex extends Vue {
         children: "floor",
     };
     graphBuilding = [];
+    spaceHeaders = {}
+    // 当前行数据
+    currRowContent = {}
+    // 弹窗开关
+    dialogVisible = false
     //
     // 项目id
     private get projectId(): string {
@@ -262,7 +276,6 @@ export default class spaceIndex extends Vue {
             }
         });
     }
-
     //改变楼层
     changeCascader(value) {
         //todo delete
@@ -286,7 +299,7 @@ export default class spaceIndex extends Vue {
                 zoneType: "GeneralZone",
                 pageNumber: this.paginationList.page,
                 pageSize: this.paginationList.size,
-                orders: "createTime desc, localName desc, localId desc, id asc",
+                orders: "createTime asc, localName asc, localId desc, id asc",
             };
 
             if (this.building.length === 1) {
@@ -340,7 +353,6 @@ export default class spaceIndex extends Vue {
                     }
                 });
                 dictStages.map((val, index) => {
-                    val.name = val.unit ? `${val.name}(${val.unit})` : val.name;
                     if (val.path == "outline") {
                         dictStages.splice(index, 1);
                     }
@@ -381,15 +393,26 @@ export default class spaceIndex extends Vue {
                     if (item.outline) {
                         delete item.outline;
                     }
+                    // const category = ['ENUM', 'MENUM', 'BOOLEAN']
+                    // if (item.category == 'STATIC' && item.dataType.includes(category) && item.dataSource) {
+                    //     console.log(item, item.path)
+                    // }
+
                     // item = {
                     //     ...item,
                     //     outline: JSON.stringify(item.outline),
                     // };
+
                     return item;
                 });
                 //  列表信息展示,获取动态数据
                 this.codeToDataSource = {};
                 this.all.forEach((item) => {
+                    const category = ['ENUM', 'MENUM', 'BOOLEAN']
+                    console.log(item.category,item.dataType)
+                    if (item.category == 'STATIC' && item.dataType.includes(category) && item.dataSource) {
+                        console.log(21)
+                    }
                     if (item.dataSource) {
                         try {
                             this.codeToDataSource[item.code] = {};
@@ -401,6 +424,7 @@ export default class spaceIndex extends Vue {
                             console.log(e);
                         }
                     }
+                    console.log(this.codeToDataSource,' this.codeToDataSource')
                 });
                 this.getBatch(this.tableData);
             });
@@ -442,14 +466,8 @@ export default class spaceIndex extends Vue {
                                 this.all.map((head) => {
                                     if (head.code == child.infoCode) {
                                         let contentVal = child.data;
-                                        if (
-                                            this.codeToDataSource[
-                                                child.infoCode
-                                            ]
-                                        ) {
-                                            contentVal = this.codeToDataSource[
-                                                child.infoCode
-                                            ][child.data];
+                                        if (this.codeToDataSource[child.infoCode]) {
+                                            contentVal = this.codeToDataSource[child.infoCode][child.data];
                                         }
                                         tools.setDataForKey(
                                             item,
@@ -476,6 +494,7 @@ export default class spaceIndex extends Vue {
             });
         }
     }
+
     // 修改分区类型
     changeZoneType(val) {
         this.toGraph();
@@ -487,6 +506,27 @@ export default class spaceIndex extends Vue {
         this.changeCascader();
     }
 
+    // close
+    close() {
+        // this.next = true;
+    }
+
+    // 添加/编辑 事件处理
+    handleDataForm() {
+        let from = tools.formatData(this.$refs.baseDataForm.form)
+        let param = {
+            content: [from]
+        }
+        updateZone(param).then(res => {
+            res.result == 'success' && this.$message.success('更新成功')
+            this.dialogVisible = false
+            // this.getData();
+            // this.dataCount();
+            // 默认显示全部建筑信息
+            this.changeCascader();
+        })
+    }
+
     handleSizeChange(val: number) {
         this.paginationList.size = val;
         this.changeCascader();
@@ -498,6 +538,15 @@ export default class spaceIndex extends Vue {
         this.changeCascader();
     }
 
+    // 编辑当前行
+    handleCurrentEdit(val) {
+        // this.next = false
+        this.currRowContent = val
+        this.spaceHeaders = this.headersStage
+        // this.handleNext()
+        this.dialogVisible = true
+    }
+
     // tab页切换
     tabChange() {
         if (this.activeName == "picture") {
@@ -541,7 +590,7 @@ export default class spaceIndex extends Vue {
     flex-wrap: wrap;
 }
 
-.space-index {
+.adm-space {
     background: #fff;
     padding: 12px;
     height: 100%;
@@ -587,3 +636,19 @@ export default class spaceIndex extends Vue {
     }
 }
 </style>
+<style lang="scss">
+.adm-space {
+    .el-dialog {
+        .el-dialog__body {
+            max-height: 500px !important;
+            min-height: 100px;
+            overflow-y: auto;
+            overflow-x: hidden;
+        }
+    }
+
+    .el-select, .el-date-editor.el-input, .el-date-editor.el-input__inner {
+        width: 100%;
+    }
+}
+</style>

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

@@ -222,6 +222,11 @@ export default class extends Vue {
 
             await dictQuery(param).then(res => {
                 let { basicInfos, dictStages } = this.informationArrangement(res.content)
+                // 添加系统分类
+                dictStages = dictStages.map((item) => {
+                    item = { ...item, classification: this.systemLabel };
+                    return item;
+                });
                 this.systemHeaders = {
                     basicInfos: {
                         name: "基础信息台账",