Преглед на файлове

Merge branch 'master' of http://39.106.8.246:3003/web/wanda-adm

YaolongHan преди 3 години
родител
ревизия
5792aa2d4f

+ 46 - 30
src/api/datacenter.ts

@@ -6,139 +6,155 @@ const baseApi = "/datacenter";
 
 // 创建项目
 export function projectCreate(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/project/create`, postParams);
+    return httputils.postJson(`${ baseApi }/object/project/create`, postParams);
 }
 
 // 查询项目信息
 export function projectQuery(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/project/query`, postParams);
+    return httputils.postJson(`${ baseApi }/object/project/query`, postParams);
 }
 
 // 更新项目信息
 export function projectUpdate(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/project/update`, postParams);
+    return httputils.postJson(`${ baseApi }/object/project/update`, postParams);
 }
 
 // 查询建筑信息
 export function buildingQuery(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/building/query`, postParams);
+    return httputils.postJson(`${ baseApi }/object/building/query`, postParams);
 }
 
 // 查询建筑信息
 export function floorQuery(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/floor/query`, postParams);
+    return httputils.postJson(`${ baseApi }/object/floor/query`, postParams);
 }
 
 // 字典查询
 export function dictCategoryQuery(postParams: any): any {
-    return httputils.postJson(`${baseApi}/dict/category`, postParams);
+    return httputils.postJson(`${ baseApi }/dict/category`, postParams);
 }
 
 // 查询项目下类型的信息点-->编辑器 空间功能类型 列表-->自己转成树
 export function dictQuery(postParams: any): any {
     // postParams:{
     // "filters": "code='roomFuncType'",
-    // "type": "GeneralZone"
+    // "type": "FunctionZone"
     // }
-    return httputils.postJson(`${baseApi}/dict/query`, postParams);
+    return httputils.postJson(`${ baseApi }/dict/query`, postParams);
 }
 
 // 查询空间实例
 export function PartiInstancQuery(postParams: any): any {
     // postParams:{
     // "filters": "code='roomFuncType'",
-    // "type": "GeneralZone"
+    // "type": "FunctionZone"
     // }
-    return httputils.postJson(`${baseApi}/object/zone/query`, postParams);
+    return httputils.postJson(`${ baseApi }/object/zone/query`, postParams);
 }
 
 // 查询设备信息
 export function queryEquip(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/equip/query`, postParams)
+    return httputils.postJson(`${ baseApi }/object/equip/query`, postParams)
 }
 
 // 创建设备信息
 export function createEquip(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/equip/create`, postParams)
+    return httputils.postJson(`${ baseApi }/object/equip/create`, postParams)
 }
 
 // 更新设备信息
 export function updateEquip(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/equip/update`, postParams)
+    return httputils.postJson(`${ baseApi }/object/equip/update`, postParams)
 }
 
 // 查询系统信息
 export function querySystem(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/system/query`, postParams)
+    return httputils.postJson(`${ baseApi }/object/system/query`, postParams)
 }
+
 // 查询空间信息
 export function queryZone(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/zone/query`, postParams)
+    return httputils.postJson(`${ baseApi }/object/zone/query`, postParams)
 }
 
 // 查询元空间信息
 export function queryIspace(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/ispace/query`, postParams)
+    return httputils.postJson(`${ baseApi }/object/ispace/query`, postParams)
 }
 
 // 创建空间
 export function createZone(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/zone/create`, postParams)
+    return httputils.postJson(`${ baseApi }/object/zone/create`, postParams)
 }
 
 // 更新空间
 export function updateZone(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/zone/update`, postParams)
+    return httputils.postJson(`${ baseApi }/object/zone/update`, postParams)
 }
 
 // 查询设备统计
 export function queryCount(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/equip/count`, postParams)
+    return httputils.postJson(`${ baseApi }/object/equip/count`, postParams)
 }
 
 // 查询系统统计
 export function queryCountSystem(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/system/count`, postParams)
+    return httputils.postJson(`${ baseApi }/object/system/count`, postParams)
 }
 
 // 创建系统信息
 export function createSystem(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/system/create`, postParams)
+    return httputils.postJson(`${ baseApi }/object/system/create`, postParams)
 }
 
 // 更新系统信息
 export function updateSystem(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/system/update`, postParams)
+    return httputils.postJson(`${ baseApi }/object/system/update`, postParams)
 }
 
 // 查询空间统计
 export function queryCountSpace(postParams: any): any {
-    return httputils.postJson(`${baseApi}/object/zone/count`, postParams)
+    return httputils.postJson(`${ baseApi }/object/zone/count`, postParams)
 }
 
 // 查询关系总览
 export function relationshipOverview(postParams: any): any {
-    return httputils.postJson(`${baseApi}/rel/graphic/overview`, postParams)
+    return httputils.postJson(`${ baseApi }/rel/graphic/overview`, postParams)
 }
 
 // 查询关系数量
 export function relationshipCount(postParams: any): any {
-    return httputils.postJson(`${baseApi}/rel/graphic/query/count`, postParams)
+    return httputils.postJson(`${ baseApi }/rel/graphic/query/count`, postParams)
 }
+
 // 查看关系相关的数据类型
 export function relToType(getParams: any) {
-    return httputils.getJson(`${baseApi}/rel/graphic/relToType`, getParams)
+    return httputils.getJson(`${ baseApi }/rel/graphic/relToType`, getParams)
 }
+
 // 查询关系数据
 export function relManualQuery(postParams: any) {
-    return httputils.postJson(`${baseApi}/rel/manual/query`, postParams)
+    return httputils.postJson(`${ baseApi }/rel/manual/query`, postParams)
 }
+
 // 添加关系数据
 export function relAdd(postParams: any) {
-    return httputils.postJson(`${baseApi}/rel/manual/add`, postParams)
+    return httputils.postJson(`${ baseApi }/rel/manual/add`, postParams)
 }
 
 // 删除关系数据
 export function relDel(postParams: any) {
-    return httputils.postJson(`${baseApi}/rel/manual/del`, postParams)
-}
+    return httputils.postJson(`${ baseApi }/rel/manual/del`, postParams)
+}
+
+// 关系计算
+export function relationCalc(postParams: any) {
+    const url = `${ baseApi }/relation-calc${ postParams.requestUrl }?objectTypes=${ postParams.objectTypes }&graphCode=${ postParams.graphCode }&relType=${ postParams.relType }`
+    return httputils.postJson(url, {})
+}
+
+// 更新计算时间
+export function updateCalcTime(getParams: any) {
+    const url = `${ baseApi }/rel/graphic/updateCalcTime?graphCode=${ getParams.graphCode }&relType=${ getParams.relType }&computingTime=${ getParams.computingTime }`
+    return httputils.getJson(url, {})
+}

+ 1 - 1
src/api/httputils.ts

@@ -7,7 +7,7 @@ let cancel;
 
 // 创建axios实例
 const axiosservice = axios.create({
-    timeout: 30000, // 请求超时时间
+    timeout: 3000000, // 请求超时时间
     // @ts-ignore
     retry: 4, //重新请求次数
     retryDelay: 1000, //重新请求的间隔

+ 17 - 11
src/components/Breadcrumb/index.vue

@@ -38,8 +38,8 @@ export default class extends Vue {
         let matched = this.$route.matched.filter((item) => item.meta && item.meta.title);
         const first = matched[0];
         //针对关系模块添加面包屑
-        if(first) {
-        matched = this.relationModel(matched)
+        if (first) {
+            matched = this.relationModel(matched)
         }
 
         this.breadcrumbs = matched.filter((item) => {
@@ -51,15 +51,21 @@ export default class extends Vue {
      * 关系模块
      *
      */
-    relationModel(matched:any = []){
-        if(matched.length >= 2 && matched[1].path == '/maintain/relation'){
-            matched[2] = {
-              path: "/maintain/relationship",
-              meta:{
-                  title:this.$route.query.relationTypeName,
-                  hidden: true,
-              }
-            }
+    relationModel(matched: any = []) {
+        if (matched.length >= 2 && matched[1].path == '/maintain/relation') {
+            matched[1] = {
+                path: "/maintain/relationship",
+                meta: {
+                    title: '关系',
+                }
+            },
+                matched[2] = {
+                    path: "/maintain/relationship",
+                    meta: {
+                        title: this.$route.query.relationTypeName,
+                        hidden: true,
+                    }
+                }
         }
         return matched
     }

+ 45 - 8
src/components/business/baseDataForm.vue

@@ -1,24 +1,29 @@
 <template>
     <el-row :gutter="20" class="data-form">
         <el-form label-position="top" label-width="300px" :model="form" :rules="rules" ref="form">
-            <template v-if="Object.keys(objectHeaders).length > 0">
-                <div v-for="obj in objectHeaders" :key="obj.name">
+            <template v-if="Object.keys(infoHeaders).length > 0">
+                <div v-for="obj in infoHeaders" :key="obj.name">
                     <p class="title"> {{ obj.name }}</p>
                     <el-row :gutter="18">
                         <el-col :span="item.dataType == 'ATTACHMENT'? 24:8"
                                 :key="item.path"
                                 v-for="item in obj.data"
-                                :style="{ 'height':item.dataType == 'ATTACHMENT'? 'auto':'93px' }">
+                                :style="{ 'height': item.dataType == 'ATTACHMENT'? 'auto':'93px' }">
                             <el-form-item :label="item.name" :prop="item.code">
+                                <!-- 动态数据按输入框输入 -->
                                 <el-input
-                                    v-if="item.path == 'classification' || item.path=='buildingSign' || item.path=='floorSign'"
+                                    v-if="item.category !== 'STATIC'"
+                                    v-model="form[item.path]"
+                                    :disabled="!item.editable"
+                                />
+                                <el-input
+                                    v-else-if="item.path == 'classification' || item.path=='buildingSign' || item.path=='floorSign'"
                                     v-model="form[item.path]"
                                     disabled/>
                                 <el-input
                                     :disabled="!item.editable"
                                     v-else-if="item.dataType == 'STRING'"
                                     v-model="form[item.path]"/>
-
                                 <el-input
                                     v-else-if="item.dataType == 'DOUBLE' || item.dataType == 'INTEGER'"
                                     type="number"
@@ -120,8 +125,30 @@ export default class extends Vue {
     }
     header = {}
     form = {}
-    @Prop({ default: Object }) objectHeaders ?: {}
-    @Prop({ default: Object }) currRowContent ?: {}
+    @Prop({ default: Object }) objectHeaders ?: any
+    @Prop({ default: Object }) currRowContent ?: any
+
+    private get infoHeaders(): any {
+        if (this.objectHeaders?.dictStages?.data?.length && this.objectHeaders?.basicInfos) {
+            const base: any[] = [], enclosure: any[] = []; 
+            this.objectHeaders.dictStages.data.forEach((item: any) => {
+                if (item.dataType === 'ATTACHMENT') {
+                    enclosure.push(item);
+                } else {
+                    base.push(item);
+                }
+            })
+            return {
+                basicInfos: this.objectHeaders.basicInfos,
+                dictStages: {
+                    name: this.objectHeaders.dictStages?.name,
+                    data: [...base, ...enclosure]
+                }
+            }
+        } else {
+            return this.objectHeaders;
+        }
+    }
 
     @Watch('currRowContent', { immediate: true, deep: true })
     handleRow() {
@@ -174,5 +201,15 @@ $border: 1px solid #E1E7EA;
         }
     }
 }
-
 </style>
+<style lang="scss">
+input::-webkit-outer-spin-button,
+input::-webkit-inner-spin-button {
+    -webkit-appearance: none !important;
+    margin: 0; 
+}
+
+input[type="number"] {
+    -moz-appearance: textfield;
+}
+</style>

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

@@ -52,6 +52,8 @@
                                     }}</span>
                                 <span v-else-if="relation.times">最后一次计算时间 {{ relation.times }}</span>
                                 <span style="float: right">
+
+<!--  todo  启动计算  :disabled="relation.manual === 1" 解决演示使用 -->
                                 <el-tooltip
                                     content="启动计算"
                                     placement="top">
@@ -59,6 +61,7 @@
                                         style="margin-bottom: 4px;"
                                         :is-dot="relation.computationalState === 2 || relation.computationalState === 5">
                                         <el-button
+                                            :disabled="relation.manual === 1"
                                             @click="computed(relation)"
                                             circle
                                             type=""
@@ -84,22 +87,20 @@
 
                                 </el-tooltip>
                                 </span>
-
                             </article>
                         </el-card>
                     </el-col>
-
                 </el-row>
             </section>
-
         </template>
     </div>
 </template>
 
 <script lang="ts">
 import { Component, Vue } from "vue-property-decorator";
-import { relationshipCount, relationshipOverview } from "@/api/datacenter"
+import { relationCalc, relationshipCount, relationshipOverview, updateCalcTime } from "@/api/datacenter"
 import moment from "moment";
+import { UserModule } from "@/store/modules/user";
 @Component({
     name: "relationShip"
 })
@@ -107,6 +108,13 @@ export default class extends Vue {
     loading = false
     content = []
 
+    get projectId(): string {
+        return UserModule.projectId;
+    }
+
+    get group(): string {
+        return UserModule.group
+    }
 
     created() {
         this.init()
@@ -159,8 +167,27 @@ export default class extends Vue {
         });
     }
 
-    computed(relation) {
+    computed(relation: object) {
         this.$set(relation, 'times', moment(Date.now()).format("YYYY-MM-DD HH:mm:ss"))
+        if (relation.enableCalc == 0) { // 0 不可计算
+            let param = {
+                graphCode: relation.graphicType,
+                relType: relation.relationType,
+                computingTime: moment(Date.now()).format("YYYY-MM-DD HH:mm:ss")
+            }
+            updateCalcTime(param).then(res => {
+                this.init()
+            })
+        } else {
+            let param = {
+                relType: relation.relationType,
+                objectTypes: relation.zoneType,
+                requestUrl: relation.requestUrl,
+                graphCode: relation.graphicType
+            }
+            relationCalc(param).then(res => {})
+            this.init()
+        }
     }
 
     manual(relation) {

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

@@ -129,7 +129,7 @@ export default class extends Vue {
     // },
     {
       value: "id",
-      label: "设备ID",
+      label: "ID",
     },
     {
       value: "localId",

+ 8 - 11
src/views/maintain/space/index.vue

@@ -89,7 +89,7 @@ export default class spaceIndex extends Vue {
     activeName = "table";
     building = ["all"];
 
-    zoneTypeVal = ["GeneralZone"];
+    zoneTypeVal = ["FunctionZone"];
     // 分页
     private paginationList = {
         page: 1,
@@ -101,7 +101,7 @@ export default class spaceIndex extends Vue {
     graphOptions = [];
     zoneTypeOption = [
         {
-            value: "GeneralZone",
+            value: "FunctionZone",
             label: "功能分区",
         },
         {
@@ -281,7 +281,7 @@ export default class spaceIndex extends Vue {
         if (this.building.length > 0) {
             this.loading = true;
             let param = {
-                type: "GeneralZone",
+                type: "FunctionZone",
                 orders: "sort asc, name desc",
                 pageNumber: 1,
                 pageSize: 1000,
@@ -292,7 +292,7 @@ export default class spaceIndex extends Vue {
                     { name: "building" },
                     { name: "floor", orders: "floorSequenceId desc" },
                 ],
-                zoneType: "GeneralZone",
+                zoneType: "FunctionZone",
                 pageNumber: this.paginationList.page,
                 pageSize: this.paginationList.size,
                 orders: "createTime asc, localName asc, localId desc, id asc",
@@ -540,12 +540,9 @@ export default class spaceIndex extends Vue {
 
     // 编辑当前行
     handleCurrentEdit(val: object) {
-        this.currRowContent = val
-        let pic = this.headersStage.dictStages.data.filter(i => i.dataType == 'ATTACHMENT')
-        let base = this.headersStage.dictStages.data.filter(i => i.dataType != 'ATTACHMENT')
-        this.headersStage.dictStages.data = pic.length > 0 ? [...base, ...pic] : [...base]
-        this.spaceHeaders = this.headersStage
-        this.dialogVisible = true
+        this.currRowContent = val;
+        this.spaceHeaders = this.headersStage;
+        this.dialogVisible = true;
     }
 
     // tab页切换
@@ -644,7 +641,7 @@ export default class spaceIndex extends Vue {
     .el-dialog {
         .el-dialog__body {
             padding: 20px;
-            max-height: 643px !important;
+            max-height: 550px !important;
             min-height: 100px;
             overflow-y: auto;
             overflow-x: hidden;

+ 8 - 14
src/views/maintain/system/index.vue

@@ -227,17 +227,11 @@ export default class extends Vue {
                 orders: "sort asc, name desc",
             };
 
-            await dictQuery(param).then(res => {
-                let { basicInfos, dictStages } = this.informationArrangement(res.content)
+            await dictQuery(param).then((res: any) => {
+                const { basicInfos, dictStages } = this.informationArrangement(res.content);
                 // 添加系统分类
-                let pic = [], base = []
-                dictStages.map((item) => {
+                dictStages.map((item: any) => {
                     item = { ...item, classification: this.systemLabel };
-                    if (item.dataType == 'ATTACHMENT') {
-                        pic.push(item)
-                    } else {
-                        base.push(item)
-                    }
                     return item;
                 });
                 this.systemHeaders = {
@@ -247,7 +241,7 @@ export default class extends Vue {
                     },
                     dictStages: {
                         name: "运维阶段",
-                        data: pic.length > 0 ? [...base, ...pic] : [...base],
+                        data: dictStages,
                     },
                 };
             })
@@ -267,16 +261,16 @@ export default class extends Vue {
     }
 
     // 编辑当前行
-    handleCurrentEdit(val) {
+    handleCurrentEdit(val: any) {
         this.next = false
         this.systemMsg = '编辑系统'
         this.currRowContent = val
-        this.handleNext()
+        this.systemHeaders = this.headersStage;
         this.dialogVisible = true
     }
 
     //信息点重组
-    informationArrangement(arr: []): object {
+    informationArrangement(arr: []): any {
         let basicInfos = [{ path: "classification", name: "系统分类"}],
             dictStages: any[] = [];
         this.all = arr;
@@ -489,7 +483,7 @@ $border: 1px solid #e1e7ea;
     .el-dialog {
         .el-dialog__body {
             padding: 20px;
-            max-height: 643px !important;
+            max-height: 550px !important;
             min-height: 100px;
             overflow-y: auto;
             overflow-x: hidden;

+ 103 - 9
src/views/scene/tiepoint/components/equipTab/index.vue

@@ -10,10 +10,20 @@
                 class="item"
             ></el-cascader>
             <admSearch @SearchValue="searchValue" class="item" />
+            <el-upload
+                style="float: right"
+                action="https://jsonplaceholder.typicode.com/posts/"
+                :show-file-list="false"
+                multiple
+            >
+                <el-button>上传Excle</el-button>
+            </el-upload>
+            <el-button style="float: right; margin-right: 12px" @click="handleClickDownload">下载模板</el-button>
         </div>
         <div v-loading="loading" style="height: calc(100% - 100px); padding: 0 12px; position: relative">
             <template style="height: 100%" v-if="tableData.length">
                 <admMultiTable
+                    ref="table"
                     @handleCurrentEdit="handleCurrentEdit"
                     :isDynamicMap="false"
                     :currentHeader="currentHeader"
@@ -33,14 +43,25 @@
                 <p class="void-tips">可点击左上角筛选</p>
             </div>
         </div>
+        <!--编辑 设备-->
+        <el-dialog title="编辑设备" :visible.sync="dialogVisible">
+            <template>
+                <baseDataForm :objectHeaders="headersStage" :currRowContent="currRowContent" ref="baseDataForm" />
+                <span slot="footer" class="dialog-footer">
+                    <el-button @click="dialogVisible = false">取消</el-button>
+                    <el-button type="primary" @click="handleDataForm">完成</el-button>
+                </span>
+            </template>
+        </el-dialog>
     </div>
 </template>
 <script lang="ts">
-import { Vue, Component } from "vue-property-decorator";
+import { Vue, Component, Ref } from "vue-property-decorator";
 import { allDevice, dictInfo } from "@/api/equipComponent";
 import { queryEquip, updateEquip } from "@/api/datacenter";
-import { AdmMultiTable, AdmSearch, Pagination } from "@/views/maintain/components/index";
+import { AdmMultiTable, AdmSearch, Pagination, baseDataForm } from "@/views/maintain/components/index";
 import { UserModule } from "@/store/modules/user";
+import tools from "@/utils/maintain";
 
 @Component({
     name: "EquipTab",
@@ -48,9 +69,12 @@ import { UserModule } from "@/store/modules/user";
         AdmMultiTable,
         AdmSearch,
         Pagination,
+        baseDataForm
     },
 })
 export default class EquipTab extends Vue {
+    // 信息点输入组组件
+    @Ref("baseDataForm") readonly baseDataForm!: baseDataForm;
     // 项目id
     private get projectId(): string {
         return UserModule.projectId;
@@ -93,6 +117,10 @@ export default class EquipTab extends Vue {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
     };
+    // 当前编辑行的数据
+    private currRowContent: any = {};
+    // 弹窗开关
+    private dialogVisible = false;
 
     // created钩子
     created() {
@@ -171,9 +199,11 @@ export default class EquipTab extends Vue {
             }
             const res = await queryEquip(params);
             if (res.result === "success") {
-                this.tableData = res?.content ? res.content : []; // 主体数据
-                this.paginationList.total = res?.total ? res.total : 0;
-                this.loading = false;
+                setTimeout(() => {
+                    this.tableData = res?.content ? res.content : []; // 主体数据
+                    this.paginationList.total = res?.total ? res.total : 0;
+                    this.loading = false;
+                });
             }
         } else {
             this.tableData = [];
@@ -227,6 +257,8 @@ export default class EquipTab extends Vue {
      * 切换设备类型
      */
     private handleChangeDevice() {
+        this.paginationList.page = 1;
+        this.paginationList.size = 50;
         this.getEquipData();
     }
 
@@ -239,6 +271,17 @@ export default class EquipTab extends Vue {
     }
 
     /**
+     * 下载模板
+     */
+    private handleClickDownload() {
+        console.log("下载模板");
+    }
+
+    /**
+     * 上传Excle
+     */
+
+    /**
      * 切换页码
      */
     private handleCurrentChange(val: number) {
@@ -253,6 +296,39 @@ export default class EquipTab extends Vue {
         this.paginationList.size = val;
         this.getExampleData();
     }
+
+    /**
+     * 编辑当前行
+     */
+    handleCurrentEdit(val: any) {
+        this.currRowContent = val;
+        this.dialogVisible = true;
+    }
+
+    /**
+     * 添加/编辑 事件处理
+     */
+    private handleDataForm() {
+        this.baseDataForm.submitForm(this.handleDataFormSave);
+    }
+
+    /**
+     * 更新设备数据
+     */
+    private async handleDataFormSave() {
+        let from = tools.formatData(this.baseDataForm.form);
+        if (from?.id) {
+            const param = {
+                content: [from],
+            };
+            const res = await updateEquip(param);
+            if (res.result === "success") {
+                this.$message.success("更新成功");
+                this.dialogVisible = false;
+                this.getExampleData();
+            }
+        }
+    }
 }
 </script>
 <style lang="scss" scoped>
@@ -270,14 +346,32 @@ export default class EquipTab extends Vue {
     }
 }
 // 数据暂未
-.void {
-    margin-top: 200px;
-}
 .align {
+    height: 100%;
     display: flex;
     align-items: center;
     justify-content: center;
     flex-direction: column;
     flex-wrap: wrap;
 }
-</style>
+
+::v-deep .el-dialog {
+    .el-dialog__body {
+        padding: 20px;
+        max-height: 550px !important;
+        min-height: 100px;
+        overflow-y: auto;
+        overflow-x: hidden;
+    }
+}
+
+::v-deep .el-select,
+.el-date-editor.el-input,
+.el-date-editor.el-input__inner {
+    width: 100%;
+}
+
+::v-deep .el-dialog__header {
+    border-bottom: 1px solid #d8d8d8;
+}
+</style>

+ 90 - 7
src/views/scene/tiepoint/components/systemTab/index.vue

@@ -11,8 +11,12 @@
                 class="item"
             ></el-cascader>
             <admSearch @SearchValue="searchValue" class="item" />
+            <el-upload style="float: right" action="https://jsonplaceholder.typicode.com/posts/" :show-file-list="false" multiple>
+                <el-button>上传Excle</el-button>
+            </el-upload>
+            <el-button style="float: right; margin-right: 12px" @click="handleClickDownload">下载模板</el-button>
         </div>
-        <div v-loading="loading" style="height: calc(100% - 100px); padding: 0 12px; position: relative;">
+        <div v-loading="loading" style="height: calc(100% - 100px); padding: 0 12px; position: relative">
             <template style="height: 100%" v-if="tableData.length">
                 <admMultiTable
                     @handleCurrentEdit="handleCurrentEdit"
@@ -34,15 +38,26 @@
                 <p class="void-tips">可点击左上角筛选</p>
             </div>
         </div>
+        <!--编辑 系统-->
+        <el-dialog title="编辑系统" :visible.sync="dialogVisible">
+            <template>
+                <baseDataForm :objectHeaders="headersStage" :currRowContent="currRowContent" ref="baseDataForm" />
+                <span slot="footer" class="dialog-footer">
+                    <el-button @click="dialogVisible = false">取消</el-button>
+                    <el-button type="primary" @click="handleDataForm">完成</el-button>
+                </span>
+            </template>
+        </el-dialog>
     </div>
 </template>
 <script lang="ts">
 import { Vue, Component, Ref } from "vue-property-decorator";
 import { allSystem } from "@/api/equipComponent";
-import { dictQuery, querySystem } from "@/api/datacenter";
-import { AdmMultiTable, AdmSearch, Pagination } from "@/views/maintain/components/index";
+import { dictQuery, querySystem, updateSystem } from "@/api/datacenter";
+import { AdmMultiTable, AdmSearch, Pagination, baseDataForm } from "@/views/maintain/components/index";
 import { UserModule } from "@/store/modules/user";
 import { ElCascader } from "element-ui/types/cascader";
+import tools from "@/utils/maintain";
 
 @Component({
     name: "SystemTab",
@@ -50,11 +65,14 @@ import { ElCascader } from "element-ui/types/cascader";
         AdmMultiTable,
         AdmSearch,
         Pagination,
+        baseDataForm,
     },
 })
 export default class SystemTab extends Vue {
     // 系统类筛选框
     @Ref("systemCascader") readonly systemCascader!: ElCascader;
+    // 信息点输入组组件
+    @Ref("baseDataForm") readonly baseDataForm!: baseDataForm;
 
     // 项目id
     private get projectId(): string {
@@ -93,7 +111,6 @@ export default class SystemTab extends Vue {
     private all: any = [];
     // 输入类型选项
     private codeToDataSource: any = {};
-
     // 分页
     private paginationList = {
         page: 1,
@@ -101,6 +118,10 @@ export default class SystemTab extends Vue {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
     };
+    // 当前编辑行的数据
+    private currRowContent: any = {};
+    // 弹窗开关
+    private dialogVisible = false;
 
     // created钩子
     created() {
@@ -251,6 +272,8 @@ export default class SystemTab extends Vue {
      * 切换系统类型
      */
     private handleChangeSystem() {
+        this.paginationList.page = 1;
+        this.paginationList.size = 50;
         this.getSystemData();
     }
 
@@ -263,6 +286,17 @@ export default class SystemTab extends Vue {
     }
 
     /**
+     * 下载模板
+     */
+    private handleClickDownload() {
+        console.log("下载模板");
+    }
+
+    /**
+     * 上传Excle
+     */
+
+    /**
      * 切换页码
      */
     private handleCurrentChange(val: number) {
@@ -277,6 +311,37 @@ export default class SystemTab extends Vue {
         this.paginationList.size = val;
         this.getExampleData();
     }
+
+    /**
+     * 编辑当前行
+     */
+    handleCurrentEdit(val: any) {
+        this.currRowContent = val;
+        this.dialogVisible = true;
+    }
+
+    // 添加/编辑 事件处理
+    private handleDataForm() {
+        this.baseDataForm.submitForm(this.handleDataFormSave);
+    }
+
+    /**
+     * 更新系统数据
+     */
+    private async handleDataFormSave() {
+        let from = tools.formatData(this.baseDataForm.form);
+        if (from?.id) {
+            const param = {
+                content: [from],
+            };
+            const res = await updateSystem(param);
+            if (res.result === "success") {
+                this.$message.success("更新成功");
+                this.dialogVisible = false;
+                this.getExampleData();
+            }
+        }
+    }
 }
 </script>
 <style lang="scss" scoped>
@@ -294,14 +359,32 @@ export default class SystemTab extends Vue {
     }
 }
 // 数据暂未
-.void {
-    margin-top: 200px;
-}
 .align {
+    height: 100%;
     display: flex;
     align-items: center;
     justify-content: center;
     flex-direction: column;
     flex-wrap: wrap;
 }
+
+::v-deep .el-dialog {
+    .el-dialog__body {
+        padding: 20px;
+        max-height: 550px !important;
+        min-height: 100px;
+        overflow-y: auto;
+        overflow-x: hidden;
+    }
+}
+
+::v-deep .el-select,
+.el-date-editor.el-input,
+.el-date-editor.el-input__inner {
+    width: 100%;
+}
+
+::v-deep .el-dialog__header {
+    border-bottom: 1px solid #d8d8d8;
+}
 </style>