Procházet zdrojové kódy

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

haojianlong před 3 roky
rodič
revize
16615a2b27

+ 3 - 2
package.json

@@ -26,6 +26,7 @@
     "normalize.css": "^8.0.1",
     "nprogress": "^0.2.0",
     "path-to-regexp": "^6.2.0",
+    "polybooljs": "1.2.0",
     "register-service-worker": "^1.7.1",
     "vue": "^2.6.12",
     "vue-class-component": "^7.2.6",
@@ -33,8 +34,8 @@
     "vue-router": "^3.4.8",
     "vue-svgicon": "^3.2.9",
     "vuex": "^3.5.1",
-    "vuex-module-decorators": "^1.0.1",
-    "polybooljs": "1.2.0"
+    "vuex-class": "^0.3.2",
+    "vuex-module-decorators": "^1.0.1"
   },
   "devDependencies": {
     "@babel/core": "^7.12.10",

+ 6 - 5
src/components/Breadcrumb/index.vue

@@ -2,7 +2,8 @@
     <el-breadcrumb class="app-breadcrumb" separator="/">
         <transition-group name="breadcrumb">
             <el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.path">
-                <span v-if="item.redirect === 'noredirect' || index === breadcrumbs.length - 1" class="no-redirect">{{ item.meta.title }}</span>
+                <span v-if="item.redirect === 'noredirect' || index === breadcrumbs.length - 1"
+                      class="no-redirect">{{ item.meta.title }}</span>
                 <a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
             </el-breadcrumb-item>
         </transition-group>
@@ -42,10 +43,10 @@ export default class extends Vue {
         });
     }
 
-    private isDashboard(route: RouteRecord) {
-        const name = route && route.meta && route.meta.title;
-        return name === "Dashboard";
-    }
+    // private isDashboard(route: RouteRecord) {
+    //     const name = route && route.meta && route.meta.title;
+    //     return name === "Dashboard";
+    // }
 
     private pathCompile(path: string) {
         // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561

+ 1 - 1
src/layout/components/AppMain.vue

@@ -17,6 +17,6 @@ export default class extends Vue {}
 
 <style lang="scss" scoped>
 .app-main {
-    height: calc(100% - 48px);
+    height: calc(100% - 58px);
 }
 </style>

+ 3 - 2
src/layout/components/Navbar/index.vue

@@ -1,8 +1,9 @@
 <template>
     <div class="navbar">
-        <span class="title" v-show="sidebar.opened"><i class="iconfont icon-wandajituan"></i></span>
+        <span class="title" v-show="sidebar.opened">
+            <i class="iconfont icon-wandajituan"></i>
+        </span>
         <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggle-click="toggleSideBar" />
-
         <div class="right-menu">
             <ul class="header-nav">
                 <li class="header-nav-notification">

+ 7 - 0
src/layout/index.vue

@@ -7,6 +7,7 @@
             <breadcrumb id="breadcrumb-container" class="breadcrumb-container"/>
             <hr/>
             <app-main/>
+        <div class="copy-right">当前版本:V 0.0.1</div>
         </div>
     </div>
 </template>
@@ -49,6 +50,12 @@ export default class extends mixins(ResizeMixin) {
     position: relative;
     height: 100%;
     width: 100%;
+    .copy-right{
+        display: flex;
+        justify-content: center;
+        font-size: 12px;
+        line-height: 1.5;
+    }
 }
 
 .drawer-bg {

+ 0 - 8
src/router/index.ts

@@ -198,14 +198,6 @@ export default new Router({
                             ),
                     meta: { title: "平面图" }
                 },
-                {
-                    path: "mapping",
-                    component: () =>
-                        import(
-                            /* webpackChunkName: "mapping" */ "@/views/management/mapping/index.vue"
-                            ),
-                    meta: { title: "xxxxxxx" }
-                }
             ]
         },
         {

+ 6 - 3
src/views/maintain/relationship/index.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="relationship" v-loading="loading">
         <template v-for="(item,index) in content">
-            <p class="title" >架构从属关系</p>
+            <p class="title">架构从属关系</p>
             <section v-for="(child,childIndex) in item.childGraphicTypeList" :key="childIndex">
                 <p class="ship-title">{{ child.graphTypeName }}
                     <i class="iconfont icon-xiangmuguanli"></i>
@@ -47,7 +47,9 @@
                             <article class="ship-card-time">
                                 <span v-if="relation.computationalState === 3">关系计算中...</span>
                                 <span v-else-if="relation.computationalState === 5">计算失败</span>
-                                <span v-else-if="relation.computationalState !== 3  && relation.computingTime">最后一次计算时间 {{ relation.computingTime }}</span>
+                                <span v-else-if="relation.computationalState !== 3  && relation.computingTime">最后一次计算时间 {{
+                                        relation.computingTime
+                                    }}</span>
                                 <span v-else-if="relation.times">最后一次计算时间 {{ relation.times }}</span>
                                 <span style="float: right">
                                 <el-tooltip
@@ -163,7 +165,7 @@ export default class extends Vue {
 
     manual(relation) {
         console.log(relation.relationTypeName)
-        this.$router.push({ path: 'relation', query:relation})
+        this.$router.push({ path: 'relation', query: relation })
     }
 }
 </script>
@@ -171,6 +173,7 @@ export default class extends Vue {
 <style scoped lang="scss">
 .relationship {
     height: 100%;
+    overflow: auto;
 
     .title {
         text-indent: 10px;

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

@@ -1,15 +1,272 @@
 <template>
-<el-dialog>
-
-</el-dialog>
+  <div class="change-relation-ship">
+    <el-dialog
+      :title="values.addShip"
+      :before-close="closeDialog"
+      :visible.sync="addShipDialog"
+    >
+      <el-form
+        :model="ruleForm"
+        status-icon
+        :rules="rules"
+        ref="ruleForm"
+        label-width="100px"
+        class="demo-ruleForm"
+      >
+        <p class="mb-20 color-AAA">{{ values.codeTip }}</p>
+        <el-form-item :label="values.codeTitle" class="mb-20">
+          <el-select v-model="codeValue" placeholder="请选择">
+            <el-option
+              v-for="item in optionsCode"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-row class="mb-20">
+          <el-col :span="12">
+            <p class="mb-20">
+              {{ values.mainObject }}
+              <span class="fw-bold color-AAA">{{ MainObject }}</span>
+            </p>
+            <el-form-item prop="main" :error="mainError">
+              <el-input
+                style="width: 220px"
+                v-model="ruleForm.main"
+                autocomplete="off"
+                :placeholder="values.pleaseEnterCode"
+                :disabled="disabled"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <p class="mb-20">
+              {{ values.affiliatedObject }}
+              <span class="fw-bold color-AAA">{{ FromObject }}</span>
+            </p>
+            <el-form-item
+              v-for="(item, index) in ruleForm.codeList"
+              :key="index"
+              :prop="`codeList.${index}.value`"
+              :rules="rules.codeList"
+              :error="fromError"
+            >
+              <el-input
+                style="width: 220px"
+                v-model="item.value"
+                :placeholder="values.pleaseEnterCode"
+                :disabled="disabled"
+              />
+              <el-button
+                @click.prevent="removeCode(item)"
+                icon="el-icon-circle-close"
+                type="text"
+                :disabled="disabled"
+              />
+            </el-form-item>
+            <el-form-item>
+              <el-button
+                @click="addCode"
+                icon="el-icon-circle-plus-outline"
+                style="width: 220px"
+                :disabled="disabled"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item>
+          <el-button
+            type="primary"
+            class="fr ml-20"
+            @click="submitForm('ruleForm')"
+            >{{ values.add }}
+          </el-button>
+          <el-button class="fr" @click="closeDialog"
+            >{{ values.cancel }}
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
 </template>
 
-<script>
-export default {
-    name: 'addRelationDialog'
+<script lang="ts">
+// import {relAdd} from "../../../../api/relation/api";
+import { Component, Prop, Vue, Watch, Emit } from "vue-property-decorator";
+let checkCode = (rule: any, value: any, callback: any) => {
+  //TODO
+  callback();
+};
+let checkMain = (rule: any, value: any, callback: any) => {
+  //TODO
+  callback();
+};
+let codeList = (rule: any, value: any, callback: any) => {
+  //TODO
+  callback();
+};
+@Component({
+  name: "addRelationShip",
+  // props:['addRelationValue','values']
+})
+export default class extends Vue {
+  @Prop({ default: false }) addRelationValue?: boolean;
+  @Prop({ default: {} }) values?: any;
+
+  mainError = "";
+  fromError = "";
+  addShipDialog = false; //是否显示tooltip
+  optionsCode = [
+    {
+      value: "cadId",
+      label: "CADID图纸编码",
+    },
+    {
+      value: "name",
+      label: "设备名称",
+    },
+    {
+      value: "id",
+      label: "设备ID",
+    },
+    {
+      value: "localId",
+      label: "本地编码",
+    },
+    {
+      value: "localName",
+      label: "本地名称",
+    },
+  ];
+  codeValue: string = "";
+  MainObject: string = `(限制条件:${
+    localStorage.getItem("MainObject") || "无"
+  } )`;
+  FromObject: string = `(限制条件:${
+    localStorage.getItem("FromObject") || "无"
+  } )`;
+  ruleForm: any = {
+    main: "",
+    codeList: [
+      {
+        value: "",
+      },
+    ],
+  };
+  rules: object = {
+    code: [
+      { required: true, message: "请输入对应识别编码", trigger: "blur" },
+      { validator: checkCode, trigger: "blur" },
+    ],
+    main: [
+      { required: true, message: "请输入对应识别编码", trigger: "blur" },
+      { validator: checkMain, trigger: "blur" },
+    ],
+    codeList: [
+      { required: true, message: "请输入对应识别编码", trigger: "blur" },
+      { validator: codeList, trigger: "blur" },
+    ],
+  };
+
+  public get disabled() {
+    return this.codeValue === "" ? "disabled" : false;
+  }
+  @Watch("addRelationValue")
+  getRelationValue(val: any, oldVal: any) {
+    if (val) {
+      this.addShipDialog = val;
+    }
+  }
+  // methods
+  addCode() {
+    this.ruleForm.codeList.push({
+      value: "",
+      key: Date.now(),
+    });
+  }
+  closeDialog() {
+    this.addShipDialog = false;
+    this.$emit("closeAddRelation");
+  }
+  removeCode(item: any) {
+    var index = this.ruleForm.codeList.indexOf(item);
+    if (index !== -1) {
+      this.ruleForm.codeList.splice(index, 1);
+    }
+  }
+  submitForm(formName: string) {
+    this.$refs[formName].validate((valid: any) => {
+      if (valid) {
+        let arr: any[] = [];
+        for (let item of this.ruleForm.codeList) {
+          if (item.value) {
+            arr = arr.concat(item.value);
+          }
+        }
+        let param = {
+          FromContent: arr,
+          MainContent: this.ruleForm.main,
+          RelType: localStorage.getItem("RelManualType"),
+          Type: this.codeValue,
+        };
+        //清空添加value
+        let that = this;
+        // relAdd(param).then(res => {
+        //   if (res.data.Result === "failure") {
+        //     if(res.data.ErrorType == 1) {
+        //       // this.mainError = res.data.Message
+        //       this.$nextTick(()=>{this.mainError = res.data.Message})
+        //     } else if(res.data.ErrorType == 2) {
+        //       this.$nextTick(()=>{this.fromError = res.data.Message})
+        //     } else {
+        //       this.$message.error(res.data.Message);
+        //     }
+
+        //   } else if (res.data.Result === "success") {
+        //     this.$message.success(res.data.Message);
+        //     this.$emit('update')
+        //     that.addShipDialog = false
+        //     that.codeValue = ''
+        //     that.ruleForm.codeList = [{value:''}]
+        //     that.ruleForm.main = ''
+        //   }
+        // })
+      } else {
+        console.log("error");
+        return false;
+      }
+    });
+  }
 }
 </script>
 
-<style scoped>
+<style scoped lang="scss">
+$color-text: #aaa;
+.change-relation-ship {
+  ::v-deep .el-form-item__label {
+    width: auto !important;
+  }
+
+  .fr {
+    float: right;
+  }
 
+  .mb-20 {
+    margin-bottom: 20px;
+  }
+
+  .ml-20 {
+    margin-left: 20px;
+  }
+
+  .color-AAA {
+    color: $color-text;
+  }
+
+  .fw-bold {
+    font-weight: bold;
+  }
+}
 </style>

+ 156 - 0
src/views/maintain/relationship/relation/components/editRelationDialog.vue

@@ -0,0 +1,156 @@
+<template>
+  <div class="change-relation-ship">
+    <el-dialog :title="values.editShip" :visible.sync="editShipDialog">
+      <el-form
+        :model="ruleForm"
+        status-icon
+        :rules="rules"
+        ref="ruleForm"
+        label-width="100px"
+        class="demo-ruleForm"
+      >
+        <p class="mb-20 color-AAA">{{ values.deviceTip }}</p>
+        <el-row class="mb-20">
+          <el-col :span="12">
+            <p class="mb-20">
+              {{ values.mainObject }}
+              <span class="fw-bold color-AAA"
+                >(包括:XXXX类型,XXXX类型)限制条件</span
+              >
+            </p>
+            <el-form-item>
+              <el-input v-model="ruleForm.main" autocomplete="off" disabled />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <p class="mb-20">
+              {{ values.affiliatedObject }}
+              <span class="fw-bold color-AAA"
+                >(包括:XXXX类型,XXXX类型)限制条件</span
+              >
+            </p>
+            <el-form-item
+              v-for="(item, index) in ruleForm.codeList"
+              :key="index"
+              :prop="`codeList.${index}.value`"
+              :rules="rules.codeList"
+            >
+              <el-input
+                v-model="item.value"
+                :placeholder="values.pleaseEnterCode"
+              />
+              <el-button
+                @click.prevent="removeCode(item)"
+                icon="el-icon-circle-close"
+                type="text"
+              />
+            </el-form-item>
+            <el-form-item>
+              <el-button
+                @click="addCode"
+                icon="el-icon-circle-plus-outline"
+                style="width: 220px"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item>
+          <el-button>{{ values.delete }} </el-button>
+          <el-button
+            type="primary"
+            class="fr ml-20"
+            @click="submitForm('ruleForm')"
+            >{{ values.add }}
+          </el-button>
+          <el-button class="fr" @click="editShipDialog = false"
+            >{{ values.cancel }}
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch, Emit } from "vue-property-decorator";
+var codeList = (rule: any, value: any, callback: any) => {
+  //TODO
+  callback();
+};
+@Component({
+  name: "addRelationShip",
+  props: ["values"],
+})
+export default class extends Vue {
+  editShipDialog: boolean = false;
+  ruleForm: object = {
+    code: "",
+    main: "",
+    codeList: [
+      {
+        value: "",
+      },
+    ],
+  };
+  rules: object = {
+    codeList: [
+      { required: true, message: "请输入对应识别编码", trigger: "blur" },
+      { validator: codeList, trigger: "blur" },
+    ],
+  };
+
+  addCode() {
+    this.ruleForm.codeList.push({
+      value: "",
+      key: Date.now(),
+    });
+  }
+
+  removeCode(item: any) {
+    var index = this.ruleForm.codeList.indexOf(item);
+    if (index !== -1) {
+      this.ruleForm.codeList.splice(index, 1);
+    }
+  }
+  submitForm(formName: string) {
+    this.$refs[formName].validate((valid) => {
+      if (valid) {
+        this.editShipDialog = false;
+        console.log("success");
+      } else {
+        console.log("error");
+        return false;
+      }
+    });
+  }
+}
+</script>
+
+<style scoped lang="scss">
+$color-text: #aaa;
+.change-relation-ship {
+  ::v-deep .el-form-item__label {
+    width: auto !important;
+  }
+
+  .fr {
+    float: right;
+  }
+
+  .mb-20 {
+    margin-bottom: 20px;
+  }
+
+  .ml-20 {
+    margin-left: 20px;
+  }
+
+  .color-AAA {
+    color: $color-text;
+  }
+
+  .fw-bold {
+    font-weight: bold;
+  }
+}
+</style>

+ 192 - 5
src/views/maintain/relationship/relation/components/excelDialog.vue

@@ -1,13 +1,200 @@
 <template>
-<el-dialog>ccc</el-dialog>
+  <div class="export-excel">
+    <el-dialog
+      :title="values.relation_maintenance"
+      :visible.sync="dialogExport"
+    >
+      <p class="option-tip">{{ values.optionTips }}</p>
+      <el-row :span="24">
+        <el-col :span="8">
+          <p>
+            <i class="iconfont icon-doc-line" />
+            {{ values.currentNum }}{{ length }}
+          </p>
+
+          <a :href="downloadProject('excel')">
+            <!--          <a :href=`/api/datacenter/graphic/export?code=对象ID${localStorage.getItem('RelationType')?relType=${localStorage.getItem('RelationType')} : null}${ localStorage.getItem('ZoneType') ? `&zoneType=${localStorage.getItem('ZoneType')}` : null}` >-->
+            <el-button type="primary" class="mt-10">
+              {{ values.download }}
+            </el-button>
+          </a>
+        </el-col>
+        <el-col :span="10">
+          {{ values.lastTime }}
+        </el-col>
+      </el-row>
+      <el-upload
+        class="upload-demo"
+        :drag="true"
+        action="/api/datacenter/graphic/import"
+        multiple
+        :show-file-list="false"
+        name="file"
+        :headers="headers"
+        :data="dataId"
+        :on-progress="progress"
+        :on-success="success"
+        :on-error="error"
+      >
+        <i class="el-icon-upload" />
+        <div class="el-upload__text" v-html="values.uploadTxt" />
+        <div class="upload__tip danger" slot="tip">{{ values.uploadTips }}</div>
+      </el-upload>
+    </el-dialog>
+    <!--手动编辑:手动维护.process结束-->
+    <el-dialog
+      :title="values.relation_maintenance"
+      :visible.sync="dialogProcess"
+    >
+      <div class="block">
+        <el-timeline>
+          <el-timeline-item
+            v-for="(activity, index) in activities"
+            :key="index"
+            :icon="activity.icon"
+            :type="activity.type"
+            :color="activity.color"
+            :size="activity.size"
+          >
+            {{ activity.content }}
+          </el-timeline-item>
+        </el-timeline>
+      </div>
+      <!--            下载报告-->
+      <a :href="downloadProject('report')">
+        <el-button>{{ values.downloadFile }}</el-button>
+      </a>
+      <footer slot="footer" class="dialog-footer">
+        <el-button @click="errBack">{{ values.back }}</el-button>
+        <el-button type="primary" @click="finish">{{ values.done }} </el-button>
+      </footer>
+    </el-dialog>
+  </div>
 </template>
 
-<script>
-export default {
-    name: 'excelDialog'
+<script lang="ts">
+import { mapGetters } from "vuex";
+import { namespace } from "vuex-class";
+const userModule = namespace("user");
+import { Component, Prop, Vue, Watch, Emit } from "vue-property-decorator";
+// import storage from "@/framework/utils/storage";
+@Component({
+  name: "exportExcel",
+  props: ["values", "length"],
+})
+export default class extends Vue {
+  // relationCount:localStorage.getItem('count'),
+  dialogExport: boolean = false;
+  dialogProcess: boolean = false;
+  activities: any[] = [
+    {
+      content: "数据文件处理中..",
+      size: "large",
+      type: "primary",
+      icon: "el-icon-check",
+      color: "#0bbd87",
+    },
+    {
+      content: "数据处理成功",
+      color: "#0bbd87",
+      icon: "el-icon-check",
+      size: "large",
+      type: "primary",
+    },
+  ];
+
+  // 获取vuex中的参数
+  @userModule.Getter("projectId") public projectId?: string;
+  @userModule.Getter("username") public username?: string;
+  public get headers() {
+    return {
+      ProjectId: this.projectId,
+      Comming: "adm",
+      Account: this.username,
+    };
+  }
+
+  public get dataId() {
+    return {
+      relType: localStorage.getItem("RelationType") || "",
+      zoneType: localStorage.getItem("ZoneType") || "",
+      projectId: this.projectId,
+    };
+  }
+
+  downloadProject(str: string) {
+    let relType =
+      localStorage.getItem("RelationType") != ""
+        ? `?relType=${localStorage.getItem("RelationType")}`
+        : "";
+    let zoneType =
+      localStorage.getItem("ZoneType") != ""
+        ? `&zoneType=${localStorage.getItem("ZoneType")}`
+        : "";
+    let url;
+    if (str === "excel") {
+      relType = localStorage.getItem("RelationType")
+        ? `&relType=${localStorage.getItem("RelationType")}`
+        : "";
+      url = `/api/datacenter/graphic/export?projectId=${this.projectId}&code=对象ID${relType}${zoneType}`;
+    } else {
+      url = `/api/datacenter/graphic/report-downloads${relType}${zoneType}`;
+    }
+    return url;
+  }
+  progress(event: any, file: any, fileList: any[]) {
+    // console.log(event.file, fileList)
+  }
+  success(event: any, file: any, fileList: any[]) {
+    this.dialogExport = true;
+    this.dialogProcess = true;
+  }
+  error(event: any, file: any, fileList: any[]) {
+    this.dialogExport = true;
+    this.dialogProcess = true;
+  }
+  errBack() {
+    this.dialogProcess = false;
+  }
+  finish() {
+    this.dialogProcess = false;
+    this.dialogExport = false;
+    this.$emit("upDataTable");
+  }
 }
 </script>
 
-<style scoped>
+<style scoped lang="scss">
+.export-excel {
+  .mt-10 {
+    margin-top: 10px;
+  }
+
+  .danger {
+    color: #d9001b;
+  }
 
+  .font-big {
+    font-weight: 600;
+  }
+
+  .exist-title {
+    font-size: 12px;
+    color: #aaaaaa;
+  }
+
+  .option-tip {
+    font-size: 18px;
+    font-weight: 600;
+  }
+
+  .upload-demo {
+    margin: 20px 0;
+  }
+
+  ::v-deep .el-upload-dragger {
+    width: 600px;
+    margin: 0 auto;
+  }
+}
 </style>

+ 116 - 48
src/views/maintain/relationship/relation/index.vue

@@ -1,70 +1,138 @@
 <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 :tableHeader="tableHeader"/>
+  <div class="relation">
+    <div class="header">
+      <el-button class="el-icon-back" @click="goBack"></el-button>
+      <el-button type="primary" @click="addRelation">添加关系</el-button>
+      <el-button style="float: right" @click="updataExecl">上传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 :tableHeader="tableHeader" />
+    <addRelationDialog
+      @closeAddRelation="addRelationValue = false"
+      :addRelationValue="addRelationValue"
+      :values="values"
+    />
+    <excelDialog :values="values" ref="excelDialog"></excelDialog>
+    <editRelationDialog :values="values"></editRelationDialog>
+  </div>
 </template>
 
 <script lang="ts">
 import { Component, Vue } from "vue-property-decorator";
-import { AdmSearch } from "./../../components"
-import relationTable from "./components/table"
+import { AdmSearch } from "./../../components";
+import relationTable from "./components/table";
 import tableHeader from "@/views/maintain/relationship/components/tableHeader";
+import addRelationDialog from "./components/addRelationDialog.vue";
+import editRelationDialog from "./components/editRelationDialog.vue";
+import excelDialog from "./components/excelDialog.vue";
+
 @Component({
-    name: 'relation',
-    components: { AdmSearch, relationTable }
+  name: "relation",
+  components: { AdmSearch, relationTable, addRelationDialog, excelDialog,editRelationDialog },
 })
 export default class extends Vue {
-    mainObject = ''
-    //表头数据
-    tableHeader = []
+  mainObject = "";
+  //表头数据
+  tableHeader = [];
+  // 是否添加关系
+  addRelationValue: Boolean = false;
+  // 传入tip需要得字段
+  values: object = {
+    relation_maintenance: "关系维护",
+    optionTips: `请下载最新最新<${this.$route.query.relationTypeName}>数据进行手动维护`, //请下载最新最新 xxxx 数据进行手动维护
+    currentNum: "当前关系数量:",
+    download: "下载模板(含数据)",
+    lastTime: `最后更新时间为:${this.$route.query.lastUpdate || ""}`, //最后更新时间为
+    uploadTxt: "将Excel文件拖到此处,或<em>单击上传Excel文件<em>",
+    uploadTips: "上传的Excel数据将完全覆盖当前关系表(关系表先前数据不会保留)",
+    downloadFile: " 下载报告文件",
+    back: "返回",
+    done: "完成",
+    addShip: "添加关系",
+    editShip: "编辑关系",
+    codeTip: "请填写主被控设备对象识别编码",
+    deviceTip: "请填写主被控设备对象设备号",
+    codeTitle: "识别编码对应:",
+    mainObject: "主对象:",
+    affiliatedObject: "从对象:",
+    pleaseEnter: "请输入",
+    pleaseEnterCode: "请输入识别编码",
+    add: "添加",
+    cancel: "取消",
+    delete: "删除关系",
+  };
 
-    created() {
-        let relationTypeName = this.$route.query.relationTypeName
-        this.tableHeader = tableHeader[relationTypeName]
-    }
+  /////////////////////////////////////////
+  // 方法
+
+  /**
+   * 返回页面上一级
+   */
+  goBack() {
+    this.$router.go(-1);
+  }
+  /**
+   * 上传 execl
+   */
+  updataExecl() {
+    this.$refs.excelDialog.dialogExport = true;
+  }
+
+  /**
+   * 添加关系
+   */
+  addRelation() {
+    this.addRelationValue = true;
+  }
+  created() {
+    let relationTypeName = this.$route.query.relationTypeName;
+    this.tableHeader = tableHeader[relationTypeName];
+  }
 }
 </script>
 
 <style scoped lang="scss">
 .relation {
-    background: #ffffff;
-    height: 100%;
+  background: #ffffff;
+  height: 100%;
 
-    .header {
-        padding: 12px;
-        overflow: hidden;
-        border-bottom: 1px solid #E1E7EA;
-    }
+  .header {
+    padding: 12px;
+    overflow: hidden;
+    border-bottom: 1px solid #e1e7ea;
+  }
 
-    .content {
-        padding: 12px;
+  .content {
+    padding: 12px;
 
-        .object {
-            p {
-                border-left: 7px solid #555555;
-                text-indent: 10px;
-                margin-bottom: 10px;
-            }
-        }
+    .object {
+      p {
+        border-left: 7px solid #555555;
+        text-indent: 10px;
+        margin-bottom: 10px;
+      }
     }
+  }
 }
 </style>

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

@@ -296,7 +296,7 @@ export default class spaceIndex extends Vue {
                 pageSize: this.paginationList.size,
                 orders: "createTime asc, localName asc, localId desc, id asc",
             };
-            let search = this.inputSearch ? `;localName contain '${ this.inputSearch }' or localId contain '${ this.inputSearch }'` : undefined
+            let search = this.inputSearch ? `;localName contain '${ this.inputSearch }' or localId contain '${ this.inputSearch }'` : ''
             if (this.building.length === 1) {
                 param2.filters = "";
                 switch (this.building[0]) {