Browse Source

增加全部关系总览编辑

qule 3 years ago
parent
commit
7ff54ad35c

+ 7 - 3
src/components/old-adm/ledger/components/lib/system.vue

@@ -122,14 +122,18 @@ export default {
     changeArr(arr) {
       let data = [];
       arr.forEach(item => {
-        data.push({ classCode: item.classCode || item.code, categoryName: item.categoryName || item.name });
+        data.push({ 
+          classCode: item.classCode || item.code, 
+          categoryName: item.categoryName || item.name,
+          isDelivery: item?.isDelivery
+        });
       });
       // console.log(data, 'data')
       return data;
     },
     deliverChange(val) {
-      this.query = {...this.query, isDelivery: val ? 'Visible' : 'all'};
-      this.options = val ? this.full_options.filter(item => item?.isDelivery) : this.full_options;
+      this.query = {...this.query, isDelivery: val ? 'Visible' : 'all'}; 
+      this.options = val ? this.full_options.filter(item => item?.isDelivery === 1) : this.full_options;   
       this.$emit("change", this.query)
     }
   }

+ 297 - 0
src/components/old-adm/relation/components/relationShip/Modal/addRelationShip.vue

@@ -0,0 +1,297 @@
+<template>
+  <div class="change-relation-ship">
+    <el-dialog
+      :title="values.addShip"
+      :visible.sync="addShipDialog"
+    >
+      <el-form
+        :model="ruleForm"
+        status-icon
+        :rules="rules"
+        ref="ruleForm"
+        label-width="100px"
+        class="demo-ruleForm"
+      >
+        <div style="display: flex;justify-content: flex-end; margin-right: 24px">
+          <el-checkbox v-model="isDelivery" @change="getData">仅项目交付范围内</el-checkbox>
+        </div>
+        <p class="mb-20 color-AAA">{{values.codeTip}}</p>
+<!--        <el-form-item-->
+<!--          :label="values.codeTitle"-->
+<!--          prop="code"-->
+<!--          class="mb-20"-->
+<!--        >-->
+<!--          <el-input-->
+<!--            v-model="ruleForm.code"-->
+<!--            autocomplete="off"-->
+<!--            :placeholder="values.pleaseEnter"-->
+<!--          />-->
+<!--        </el-form-item>-->
+        <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
+                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"
+              style="margin-bottom: 26px;"
+              :key="index"
+              :prop="`codeList.${index}.value`"
+              :rules="rules.codeList"
+              :error="item.fromError"
+            >
+              <el-input
+                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="addShipDialog = false"
+          >{{values.cancel}}
+          </el-button>
+        </el-form-item>
+
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+// import {} from "../../../../api/relation/api";
+import Relation from '@/controller/old-adm/relationController'
+const { relAdd } = Relation
+
+export default {
+  name: "addRelationShip",
+  props: ['values'],
+  data() {
+    var checkCode = (rule, value, callback) => {
+      //TODO
+      callback()
+    }
+    var checkMain = (rule, value, callback) => {
+      //TODO
+      callback()
+      }
+      var codeList = (rule, value, callback) => {
+        //TODO
+        console.log(value)
+        callback()
+      }
+      return {
+        isDelivery: true, //默认选择项目交付范围内
+        mainError:'',
+        fromError:'',
+        addShipDialog: false,
+        // disabled: true,
+        optionsCode: [{
+          value: 'cadId',
+          label: 'CADID图纸编码'
+        }, {
+          value: 'name',
+          label: '名称'
+        }, {
+          value: 'id',
+          label: 'ID'
+        }, {
+          value: 'localId',
+          label: '本地编码'
+        }, {
+          value: 'localName',
+          label: '本地名称'
+        }],
+        codeValue: '',
+        MainObject: `(限制条件:${localStorage.getItem('MainObject') || '无'} )`,
+        FromObject: `(限制条件:${localStorage.getItem('FromObject') || '无'} )`,
+        ruleForm: {
+          main: '',
+          codeList: [{
+            value: '',
+            fromError: '',
+            key: +new Date()
+          }]
+        },
+        rules: {
+          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'}
+          ]
+        }
+      }
+    },
+    computed:{
+      disabled() {
+        return this.codeValue === '' ? 'disabled':false
+      },
+
+    },
+    watch:{},
+    methods: {
+      addCode() {
+        this.ruleForm.codeList.push({
+          value: '',
+          key: Date.now(),
+          fromError: ''
+        })
+      },
+      removeCode(item) {
+        var index = this.ruleForm.codeList.indexOf(item)
+        if (index !== -1) {
+          this.ruleForm.codeList.splice(index, 1)
+        }
+      },
+      submitForm(formName) {
+        this.$refs[formName].validate( async valid => {
+          console.log(valid,'valid')
+          if (valid) {
+            let arr = []
+            for(let item  of this.ruleForm.codeList) {
+              item.fromError = ''
+              if(item.value) {
+                arr = arr.concat(item.value)
+              }
+            }
+            let param = {
+              fromContent:arr,
+              mainContent:this.ruleForm.main,
+              relType:localStorage.getItem('RelManualType'),
+              type:this.codeValue,
+              isDelivery: this.isDelivery ? 1 : 0
+            }
+            //清空添加value
+            let that = this
+            const res = await relAdd(param)
+            if (res.result === "failure") {
+              
+              if(res.errorType == 1) {
+                // this.mainError = res.data.Message
+                this.$nextTick(()=>{this.mainError = res.message})
+              } else if(res.errorType == 2) {
+                const str = res.message.split(':')
+                this.$nextTick(()=>{
+                  this.ruleForm.codeList.forEach(t => {
+                    if (str.length > 1 && t.value == str[0]) {
+                      t.fromError = res.message;
+                      t.key = +new Date()
+                    }
+                  })
+                })
+              } else {
+                this.$message.error(res.message);
+              }
+
+            } else if (res.result === "success") {
+              this.$message.success(res.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 lang="less">
+  @color-text: #AAA;
+  .change-relation-ship {
+    /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>

+ 161 - 0
src/components/old-adm/relation/components/relationShip/Modal/editRelationShip.vue

@@ -0,0 +1,161 @@
+<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>
+  export default {
+    name: "addRelationShip",
+    props: ['values'],
+    data() {
+      var codeList = (rule, value, callback) => {
+        //TODO
+        callback()
+      }
+      return {
+        editShipDialog: false,
+        ruleForm: {
+          code: '',
+          main: '',
+          codeList: [{
+            value: ''
+          }]
+        },
+        rules: {
+          codeList: [
+            {required: true, message: '请输入对应识别编码', trigger: 'blur'},
+            {validator: codeList, trigger: 'blur'}
+          ]
+        }
+      }
+    },
+    methods: {
+      addCode() {
+        this.ruleForm.codeList.push({
+          value: '',
+          key: Date.now()
+        })
+      },
+      removeCode(item) {
+        var index = this.ruleForm.codeList.indexOf(item)
+        if (index !== -1) {
+          this.ruleForm.codeList.splice(index, 1)
+        }
+      },
+      submitForm(formName) {
+        this.$refs[formName].validate(valid => {
+          if (valid) {
+            this.editShipDialog = false
+            console.log('success')
+          } else {
+            console.log('error')
+            return false
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped lang="less">
+  @color-text: #AAA;
+  .change-relation-ship {
+    /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>

+ 301 - 0
src/components/old-adm/relation/components/relationShip/Modal/exportExcel.vue

@@ -0,0 +1,301 @@
+<template>
+  <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}}{{graphicTypeNum}}
+          </p>
+
+          <a :href="downloadProject('excel')" download target="_self">
+
+            <!--          <a :href=`${baseUrl}${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
+        v-loading="loading"
+        class="upload-demo"
+        :drag="true"
+        :action="`${baseUrl}${dataCenter}/graphic/import`"
+        multiple
+        :show-file-list='false'
+        name="file"
+        :headers="headers"
+        :data="dataId"
+        :before-upload="beforeUpload"
+        :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> -->
+      <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>
+import { mapGetters } from 'vuex'
+import storage from '@/utils/storageUtil'
+import Relation from '@/controller/old-adm/relationController'
+const { graphicTypeNumber } = Relation
+import Scan  from '@/utils/scanUtil'
+const { baseUril:baseUrl, datacenter:dataCenter } = Scan
+
+export default {
+  name: "exportExcel",
+  props: ['values', 'length'],
+  data() {
+    return {
+      // relationCount:localStorage.getItem('count'),
+      loading: false,
+      dialogExport: false,
+      dialogProcess: false,
+      graphicTypeNum: 0,
+      activities: [],
+      baseUrl: baseUrl,
+      dataCenter: dataCenter
+    }
+  },
+  computed: {
+    ...mapGetters('layout', ['projectId']),
+    headers() {
+      return {
+        //头信息中的 ProjectId 改为 projectId    nh-2021.11.25
+        'projectId': this.projectId,
+        'Comming': 'adm',
+        'Account': storage.get("user_name")
+      }
+    },
+    dataId() {
+      return {
+        relType: localStorage.getItem('RelationType') || '',
+        zoneType: localStorage.getItem('ZoneType') || '',
+        projectId: this.projectId
+      }
+    },
+  },
+  methods: {
+      getGraphicTypeNum() {
+        const params = {
+            type: this.dataId.relType
+        }
+        graphicTypeNumber(params, res => {
+            if (res.content && res.content.length) {
+                this.graphicTypeNum = res.content[0] && res.content[0].count || 0;
+            }
+        })
+      },
+      downloadProject(str) {
+        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 = `${baseUrl}${dataCenter}/graphic/export?projectId=${this.projectId}${relType}${zoneType}&code=对象ID`;
+        } else {
+          url = `${baseUrl}${dataCenter}/graphic/report-downloads?projectId=${this.projectId}${relType}${zoneType}`;
+        }
+        return url
+      },
+      beforeUpload() {
+        this.loading = true;
+      },
+      progress(event, file, fileList) {
+        // console.log(event.file, fileList)
+      },
+      success(event, file, fileList) {
+        this.loading = false;
+        if (event.content && event.content[0] && event.content[0].state === "0") {
+            this.activities = [{
+                content: '数据文件处理中..',
+                size: 'large',
+                type: 'primary',
+                icon: 'el-icon-check',
+                color: '#0bbd87'
+            }, {
+                content: `关系全部导入成功(导入关系:${event.content[0].successCount} 条)`,
+                color: '#0bbd87',
+                icon: 'el-icon-check',
+                size: 'large',
+                type: 'success',
+            }]
+        } else if (event.content && event.content[0] && event.content[0].state === "1") {
+            this.activities = [{
+                content: '数据文件处理中..',
+                size: 'large',
+                type: 'primary',
+                icon: 'el-icon-check',
+                color: '#0bbd87'
+            }, {
+                content: `关系部分导入成功(导入成功:${event.content[0].successCount} 条;导入失败:${event.content[0].failCount} 条)`,
+                color: '#0bbd87',
+                icon: 'el-icon-check',
+                size: 'large',
+                type: 'success',
+            }]
+        } else if (event.content && event.content[0] && event.content[0].state === "2") {
+            this.activities = [{
+                content: '数据文件处理中..',
+                size: 'large',
+                type: 'primary',
+                icon: 'el-icon-check',
+                color: '#0bbd87'
+            }, {
+                content: '关系导入失败!',
+                color: '#f56c6c',
+                icon: 'el-icon-close',
+                size: 'large',
+                type: 'primary',
+            }]
+        } else {
+            this.activities = [{
+                content: '数据文件处理中..',
+                size: 'large',
+                type: 'primary',
+                icon: 'el-icon-check',
+                color: '#0bbd87'
+            }, {
+                content: '关系导入失败!',
+                color: '#f56c6c',
+                icon: 'el-icon-close',
+                size: 'large',
+                type: 'primary',
+            }]
+        }
+        this.dialogExport = false;
+        this.dialogProcess = true;
+        this.$emit('upDataTable')
+      },
+      error(event, file, fileList) {
+        this.loading = false;
+        this.activities = [{
+            content: '数据文件处理中..',
+            size: 'large',
+            type: 'primary',
+            icon: 'el-icon-check',
+            color: '#0bbd87'
+        }, {
+            content: '文件上传失败!',
+            color: '#f56c6c',
+            icon: 'el-icon-close',
+            size: 'large',
+            type: 'primary',
+        }]
+        this.dialogExport = false;
+        this.dialogProcess = true;
+        this.$emit('upDataTable')
+      },
+      errBack() {
+        this.dialogProcess = false
+      },
+      finish() {
+        this.dialogProcess = false
+        this.dialogExport = false
+        this.$emit('upDataTable')
+      },
+
+  },
+  watch: {
+      dialogExport(val) {
+          if(val) {
+              this.getGraphicTypeNum();
+          }
+      }
+  }
+  }
+</script>
+
+<style scoped lang="less">
+  .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;
+
+    }
+
+    /deep/ .el-upload-dragger {
+      width: 600px;
+      margin: 0 auto;
+    }
+  }
+</style>

+ 27 - 2
src/components/old-adm/relation/overview/index.vue

@@ -47,6 +47,7 @@ export default {
   data() {
     return {
       content: [],
+      fullContent: [],
       countNumber: [],
       loading: false,
       source: [], //源端数据
@@ -75,9 +76,31 @@ export default {
   },
   methods: {
     toggleRelation() {
+      const param = this.currentRelation === 'deliver' ? 'all' : 'deliver';
       
-      this.currentRelation = this.currentRelation === 'deliver' ? 'all' : 'deliver'
+      this.content = this.filterRelation(this.fullContent, param)
+      
+      this.currentRelation = param
+
     },
+    /**
+     * @description: 过滤显示关系
+     * @param {array} fullData
+     * @param {string} relation
+     * @return {*}
+     */   
+    filterRelation(fullData, relation='all') {
+      if (fullData.length) {
+        const res = fullData.map(item => ({
+          ...item,
+          childGraphicTypeList: item.childGraphicTypeList.map(subitem => ({
+            ...subitem,
+            relationTypeProjectList: subitem.relationTypeProjectList.filter(sub_subitem => relation === 'deliver' ? sub_subitem?.deliveryType === 0 : sub_subitem?.deliveryType !== 0 )
+          }))
+        }))
+        return res
+      }
+    }, 
     init() {
       this.loading = true;
       let dataNumber = {
@@ -95,7 +118,9 @@ export default {
       })
       Promise.all([promise1, promise2]).then(values => {
         this.countNumber = values[1].content;
-        this.content = values[0].content;
+        // this.content = values[0].content;
+        this.fullContent = values[0].content;
+        this.content = this.filterRelation(values[0].content, this.currentRelation);
         this.transform(this.content, this.countNumber);
         this.loading = false;
       })

+ 503 - 0
src/components/old-adm/relation/relationShip/index.vue

@@ -0,0 +1,503 @@
+<template>
+    <div class="relation-ship" v-loading="loading">
+        <section style="margin-top: 20px">
+            <el-button style="padding: 10px" icon="el-icon-back" @click="back" />
+            <el-button type="primary" @click="addBtn">添加关系 </el-button>
+            <el-button type="default" style="float: right" @click="excel"> Excel导出 </el-button>
+        </section>
+        <section>
+            <el-row>
+                <el-col :span="12">
+                    <p class="border-left-8">
+                        主对象 <span>{{ MainObject }}</span>
+                    </p>
+                    <label>所属建筑楼层:</label>
+                    <el-select disabled v-model="buildValue">
+                        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
+                    </el-select>
+                    <label>类型:</label>
+                    <el-cascader :options="typeList" :props="props" collapse-tags clearable disabled />
+                    <el-input
+                        placeholder="请输入"
+                        @keyup.enter.native="queryTable(1)"
+                        v-model="mainValue"
+                        style="margin-left: 5px"
+                        class="min-margin"
+                    >
+                        <i slot="suffix" class="el-input__icon el-icon-search cursor" @click="queryTable(1)" />
+                    </el-input>
+                </el-col>
+                <el-col :span="12">
+                    <p class="border-left-8">
+                        从对象 <span>{{ FromObject }}</span>
+                    </p>
+                    <label>所属建筑楼层:</label>
+                    <el-select disabled v-model="buildValue">
+                        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
+                    </el-select>
+                    <label>类型:</label>
+                    <el-cascader :options="typeList" :props="props" collapse-tags clearable disabled />
+                    <el-input
+                        placeholder="请输入"
+                        @keyup.enter.native="queryTable(2)"
+                        v-model="formValue"
+                        style="margin-left: 5px"
+                        class="min-margin"
+                    >
+                        <i slot="suffix" class="el-input__icon el-icon-search cursor" @click="queryTable(2)" />
+                    </el-input>
+                </el-col>
+            </el-row>
+        </section>
+
+        <section class="table-list" :style="tableData && tableData.length ? 'height:calc(100% - 250px)' : 'height:100%'">
+            <!--              :span-method="objectSpanMethod"
+      -->
+            <el-table
+                :data="tableData"
+                :span-method="objectSpanMethod"
+                :header-cell-style="{ background: '#e1e4e5', color: '#2b2b2b', lineHeight: '30px' }"
+                :cell-style="cellStyle"
+                class="table"
+                style="width: 100%"
+                height="100%"
+            >
+                <el-table-column prop="Name" label="全局名称" width="180" align="left" min-width="100"> </el-table-column>
+                <el-table-column prop="LocalID" label="本地编码" align="left" min-width="100"> </el-table-column>
+                <el-table-column prop="LocalName" label="本地名称" align="left" min-width="100"> </el-table-column>
+                <el-table-column prop="CADID" label="CADID" align="left" min-width="100"> </el-table-column>
+                <el-table-column label="对象详情" prop="btn" align="center" min-width="90">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="mini" @click="lookOver(scope.$index, scope.row)">查看 </el-button>
+                    </template>
+                </el-table-column>
+                <el-table-column class-name="td-bl" prop="cName" label="全局名称" width="180" align="left"> </el-table-column>
+                <el-table-column prop="cLocalID" align="left" label="本地编码"> </el-table-column>
+                <el-table-column prop="cLocalName" label="本地名称" align="left"> </el-table-column>
+                <el-table-column prop="cCADID" label="CADID" align="left"> </el-table-column>
+                <el-table-column label="对象详情" align="center">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="mini" @click="lookOver(scope.$index, scope.row)">查看 </el-button>
+                    </template>
+                </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>
+        </section>
+        <!-- 分页 -->
+        <el-pagination
+            class="relation-ship-pagination"
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-sizes="pageSizes"
+            :page-size="pageSize"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+            style="float: right; margin-top: 10px; padding: 2px 5px"
+        >
+        </el-pagination>
+
+        <exportExcel ref="export" :values="values" :length="length" @upDataTable="upDataTable" />
+        <addRelationShip ref="addShipComponent" :values="values" @update="update" />
+        <editRelationShip ref="editShipComponent" :values="values" />
+    </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import exportExcel from "@/components/old-adm/relation/components/relationShip/Modal/exportExcel";
+import addRelationShip from "@/components/old-adm/relation/components/relationShip/Modal/addRelationShip";
+import editRelationShip from "@/components/old-adm/relation/components/relationShip/Modal/editRelationShip";
+// import { relDelete, relQuery } from "../../../api/relation/api";
+import Relation from '@/controller/old-adm/relationController'
+const { relDelete, relQuery } = Relation
+
+export default {
+    name: "index",
+    data() {
+        return {
+            MainObject: `(限制条件:${localStorage.getItem("MainObject") || "无"})`,
+            FromObject: `(限制条件:${localStorage.getItem("FromObject") || "无"})`,
+            pageSizes: [10, 20, 50, 100],
+            pageSize: 50,
+            currentPage: 1,
+            total: 0,
+            values: {
+                relation_maintenance: "关系维护",
+                optionTips: `请下载最新<${localStorage.getItem("RelationTypeName")}>数据进行手动维护`, //请下载最新最新 xxxx 数据进行手动维护
+                currentNum: "当前关系数量:",
+                download: "下载模板(含数据)",
+                lastTime: `最后更新时间为:${localStorage.getItem("ComputingTime") || ""}`, //最后更新时间为
+                uploadTxt: "将Excel文件拖到此处,或<em>单击上传Excel文件<em>",
+                uploadTips: "上传的Excel数据将完全覆盖当前关系表(关系表先前数据不会保留)",
+                downloadFile: " 下载报告文件",
+                back: "返回",
+                done: "完成",
+                addShip: "添加关系",
+                editShip: "编辑关系",
+                codeTip: "请填写主被控设备对象识别编码",
+                deviceTip: "请填写主被控设备对象设备号",
+                codeTitle: "识别编码对应:",
+                mainObject: "主对象:",
+                affiliatedObject: "从对象:",
+                pleaseEnter: "请输入",
+                pleaseEnterCode: "请输入识别编码",
+                add: "添加",
+                cancel: "取消",
+                delete: "删除关系",
+            },
+            mainValue: "",
+            formValue: "",
+            options: [
+                {
+                    value: "all",
+                    label: "全选",
+                },
+                {
+                    value: "选项2",
+                    label: "双皮奶",
+                },
+                {
+                    value: "选项3",
+                    label: "蚵仔煎",
+                },
+                {
+                    value: "选项4",
+                    label: "龙须面",
+                },
+                {
+                    value: "选项5",
+                    label: "北京烤鸭",
+                },
+            ],
+            buildValue: "all",
+            props: { multiple: true },
+            typeList: [
+                {
+                    value: 1,
+                    label: "东南",
+                    children: [
+                        {
+                            value: 2,
+                            label: "上海",
+                        },
+                        {
+                            value: 7,
+                            label: "江苏",
+                        },
+                        {
+                            value: 12,
+                            label: "浙江",
+                        },
+                    ],
+                },
+                {
+                    value: 17,
+                    label: "西北",
+                    children: [
+                        {
+                            value: 18,
+                            label: "陕西",
+                        },
+                        {
+                            value: 21,
+                            label: "新疆维吾尔族自治区",
+                        },
+                    ],
+                },
+            ],
+            tableData: [],
+            delParam: {},
+            loading: false,
+            needMergeArr: ["Name", "LocalID", "LocalName", "CADID", "btn"],
+            rowMergeArrs: {},
+            length: "",
+            // needMergeArr: ['name', 'id'], // 有合并项的列
+            // rowMergeArrs: {}, // 包含需要一个或多个合并项信息的对象
+        };
+    },
+    components: { exportExcel, addRelationShip, editRelationShip },
+    created() {
+        this.$store.dispatch("setBreadcrumb", [
+            {
+                label: "全部关系总览",
+                path: "/relation/overview",
+            },
+            {
+                label: "全部关系总览",
+                path: "/relation/overview",
+            },
+            {
+                label: localStorage.getItem("RelationTypeName"),
+            },
+        ]);
+        this.init();
+    },
+    watch: {
+        projectId() {
+            this.init();
+        },
+    },
+    computed: {
+        ...mapGetters("layout", ["projectId"]),
+    },
+    mounted() {
+        // this.getSpanArr(this.tableData)
+    },
+    methods: {
+        deepCopy(obj) {
+            return JSON.parse(JSON.stringify(obj));
+        },
+        upDataTable() {
+            this.init();
+        },
+        init() {
+            this.loading = true;
+            let data = {
+                projectId: this.projectId,
+                objectType: 1,
+                relType: localStorage.getItem("RelManualType"),
+                pageSize: this.pageSize,
+                // PageSize: 10000000,
+                pageNumber: this.currentPage,
+            };
+            relQuery(data, (res) => {
+                this.filterTable(res);
+                this.length = res.total || 0;
+                this.total = res.total;
+                this.loading = false;
+            });
+        },
+        filterTable(list) {
+            let arr = [];
+            if (list.content.length) {
+                list.content.forEach((i) => {
+                    i.objectInfo &&
+                        i.objectInfo.forEach((j) => {
+                            arr.push({
+                                Name: i.name,
+                                LocalName: i.localName,
+                                LocalID: i.localId,
+                                CADID: i.cadId,
+                                cName: j.name,
+                                cLocalName: j.localName,
+                                cLocalID: j.localId,
+                                cCADID: j.cadId,
+                                Id: i.id,
+                                cId: j.id,
+                            });
+                        });
+                });
+                this.tableData = this.deepCopy(arr);
+                this.rowMergeArrs = this.rowMergeHandle(this.needMergeArr, this.tableData); // 处理数据
+            } else {
+                this.tableData = [];
+            }
+            // this.length = this.tableData.length
+        },
+        back() {
+            this.$router.go(-1);
+        },
+
+        addBtn() {
+            this.$refs.addShipComponent.addShipDialog = true;
+        },
+        excel() {
+            this.$refs.export.dialogExport = true;
+        },
+        queryTable(i) {
+            let param = {},
+                relType = localStorage.getItem("RelManualType");
+            if (i === 1) {
+                param = {
+                    objectType: 1,
+                    relType,
+                    vague: this.mainValue,
+                };
+            } else {
+                param = {
+                    objectType: 2,
+                    relType,
+                    vagueTo: this.formValue,
+                };
+            }
+            relQuery(param, (res) => {
+                this.filterTable(res);
+                // console.log(res, '==object==')
+            });
+        },
+        //分页更换size
+        handleSizeChange(val) {
+            this.currentPage = 1;
+            this.pageSize = val;
+            this.init();
+        },
+        //分页更换页
+        handleCurrentChange(val) {
+            this.currentPage = val;
+            this.init();
+        },
+        update() {
+            this.init();
+        },
+        lookOver(index, row) {
+            this.$message.info("开发中");
+            console.log(index, row);
+
+            return false;
+
+            // this.$refs.editShipComponent.editShipDialog = true
+        },
+        deleteObject(index, row) {
+            this.delParam = {
+                fromId: row.Id,
+                relType: localStorage.getItem("RelManualType"),
+                toId: row.cId,
+            };
+            this.$confirm("确定删除吗?", "提示", {
+                confirmButtonText: "确 定",
+                cancelButtonText: "取 消",
+            })
+                .then(() => {
+                    this.confirmDelete();
+                })
+                .catch(() => {
+                    this.$message({
+                        type: "info",
+                        message: "已取消删除",
+                    });
+                });
+        },
+        confirmDelete() {
+            relDelete(this.delParam, (res) => {
+                this.init();
+                this.$message.success("删除成功");
+            });
+        },
+        cellStyle({ row, column, rowIndex, columnIndex }) {
+            if (column.label === "全局名称") {
+                return {
+                    background: "#f9f9f9",
+                    color: "#606266",
+                    lineHeight: "30px",
+                };
+            }
+        },
+
+        objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+            if (column.property === "Name") return this.mergeAction("Name", rowIndex, column);
+            // if (column.property === 'LocalID' && row.LocalID != undefined) return this.mergeAction('LocalID', rowIndex, column);
+            // if (column.property === 'LocalName' && row.LocalName != undefined) return this.mergeAction('LocalName', rowIndex, column);
+            // if (column.property === 'CADID' && row.CADID != undefined) return this.mergeAction('CADID', rowIndex, column);
+            if (column.property === "btn") return this.mergeAction("Name", rowIndex, column);
+        },
+        mergeAction(val, rowIndex, colData) {
+            let _row = this.rowMergeArrs[val].rowArr[rowIndex];
+            let _col = _row > 0 ? 1 : 0;
+            return [_row, _col];
+        },
+        rowMergeHandle(arr, data) {
+            if (!Array.isArray(arr) && !arr.length) return false;
+            if (!Array.isArray(data) && !data.length) return false;
+            let needMerge = {};
+            arr.forEach((i) => {
+                needMerge[i] = {
+                    rowArr: [],
+                    rowMergeNum: 0,
+                };
+                data.forEach((item, index) => {
+                    if (index === 0) {
+                        needMerge[i].rowArr.push(1);
+                        needMerge[i].rowMergeNum = 0;
+                    } else {
+                        if (item[i] === data[index - 1][i]) {
+                            needMerge[i].rowArr[needMerge[i].rowMergeNum] += 1;
+                            needMerge[i].rowArr.push(0);
+                        } else {
+                            needMerge[i].rowArr.push(1);
+                            needMerge[i].rowMergeNum = index;
+                        }
+                    }
+                });
+            });
+            return needMerge;
+        },
+    },
+};
+</script>
+
+<style scoped lang="less">
+.relation-ship {
+    @media screen and (max-width: 1500px) {
+        .min-margin {
+            margin-top: 10px;
+        }
+    }
+
+    .cursor {
+        cursor: pointer;
+    }
+
+    /deep/ .el-input__inner {
+        width: 220px;
+        padding-right: 25px;
+    }
+
+    /deep/ .el-input {
+        width: auto;
+    }
+
+    /deep/ .el-table__body-wrappe {
+    }
+
+    .table-list {
+        width: 100%;
+        display: block;
+        /*height: calc(100% - 71px);*/
+    }
+
+    .table {
+        width: 100%;
+        margin-top: 20px;
+
+        .el-button {
+            border: none;
+            background: transparent;
+
+            &:link,
+            &:visited,
+            &:hover,
+            &:active {
+                background: #f5f7fa;
+            }
+        }
+    }
+
+    .border-left-8 {
+        border-left: 8px solid black;
+        margin: 10px 0;
+        font-weight: 600;
+        text-indent: 10px;
+
+        span {
+            color: #aaaaaa;
+            margin-left: 20px;
+        }
+    }
+
+    .relation-ship-pagination {
+        /deep/ .el-input__inner {
+            width: auto;
+            padding-right: 25px;
+        }
+
+        /deep/ .el-select .el-input {
+            width: auto;
+        }
+    }
+}
+</style>

+ 40 - 0
src/controller/old-adm/relationController.ts

@@ -3,6 +3,7 @@ import { customHttpUtils } from '@/utils/http/customHttpUtils'
 import ScanUtil from '@/utils/scanUtil'
 import storage from '@/utils/storageUtil'
 import lstorage from '@/utils/old-adm/localStorage'
+import {graphhic_pre} from './preTypes'
  
 export default class Relation{
     static http = new baseHttpUtils();
@@ -103,4 +104,43 @@ export default class Relation{
         const res = await Relation.http.postRequest(`${ScanUtil.datacenter}/calc_special/sys-direction?BlockId=${param.BlockId}&${buildId}Domain=${param.Domain}&SystemName=${param.SystemName}&isSource=${param.isSource}`, param);
         return fn ? fn(res) : res
     }
+    /**
+     * @description: 删除关系
+     * @param {*}
+     * @return {*}
+     */    
+
+    static async relDelete(param, fn) {
+        const res = await Relation.http.postRequest(`${ScanUtil.datacenter}/rel-manual-calc/del`, param);
+        return fn ? fn(res) : res
+    }
+    /**
+     * @description:  查询关系数据
+     * @param {*} param
+     * @param {*} fn
+     * @return {*}
+     */    
+    static async relQuery(param, fn) {
+        const res = await Relation.http.postRequest(`${ScanUtil.datacenter}/rel-manual-calc/query`, param);
+        return fn ? fn(res) : res
+    }
+    /**
+     * @description: 添加关系数据
+     * @param {*} param
+     * @return {*}
+     */    
+    static async relAdd(param) {
+        const res = await Relation.http.postRequest(`${ScanUtil.datacenter}/rel-manual-calc/add`, param);
+        return  res
+    }
+    /**
+     * @description: 查询总览数量-根据类型查询关系数量
+     * @param {*} param
+     * @param {*} fn
+     * @return {*}
+     */    
+    static async graphicTypeNumber(param, fn) {
+        const res = await Relation.http.postRequest(`${graphhic_pre}/type/query-count?type=${param.type}`, param);
+        return fn ? fn(res) : res
+    }
 }

+ 6 - 0
src/router/system.js

@@ -20,6 +20,7 @@ import repetitionGraphy from '@/components/old-adm/ready/buildfloor/repetitionGr
 
 // 全部关系总览
 import overView from '@/components/old-adm/relation/overview'
+import relationShip from '@/components/old-adm/relation/relationShip'
 
 //cad核查图纸管理
 import cadDrawingManage from '@/components/cadDrawingManage'
@@ -128,6 +129,11 @@ export default [
         name: "全部关系总览",
         component: overView,
       },
+      {
+        path: '/relation/relationShip',
+        name: "编辑关系",
+        component: relationShip,
+      },
     ],
   },
   {