Bläddra i källkod

Merge branch 'hjl' of git.sagacloud.cn:web/ibms into hjl

zhangyu 5 år sedan
förälder
incheckning
69b777ccb1

+ 8 - 1
src/components/config_point/dictionaryCascader.vue

@@ -65,6 +65,12 @@ export default {
       },
       rules: {
         dict: [{ required: true, message: '请选择对应数据字典', trigger: 'blur' }]
+      },
+      typeRelation: {
+        Pj: 'Project',
+        Bd: 'Building',
+        Fl: 'Floor',
+        VOTn: 'Tenant',
       }
     }
   },
@@ -121,13 +127,14 @@ export default {
     },
     //请求信息点
     getDataPoint(type) {
+      let that = this;
       let param = {
         data: {
           Filters: "InputMode='M' or InputMode='L'",
           PageNumber: 1,
           PageSize: 500
         },
-        type: type
+        type: this.typeRelation[type] || type
       }
       getDataDictionary(param, res => {
         let tempArr = res.Content.map(item => {

+ 17 - 4
src/components/point/dynamicdata/locationCascader.vue

@@ -34,23 +34,36 @@ export default {
       dynamicLocationList(param, res => {
         this.LocationList = res.Content[0].List;
         //添加未明确对象
+        this.LocationList = this.delNullItems(this.LocationList)
         this.LocationList.map(item => {
-          if (item.List && item.List.length) {
+          if (item.List) {
             item.List.map(child => {
-              child.List.unshift({ Name: "未明确业务空间" })
+              if (child.List) {
+                child.List.unshift({ Name: '未明确业务空间' })
+              }
             })
             item.List.unshift({ Name: '未明确楼层' })
           }
         })
         this.LocationList.unshift({ Name: '未明确建筑' })
-        //结束
       });
     },
+    delNullItems(arr) {
+      let tempArr = JSON.parse(JSON.stringify(arr))
+      let options = tempArr.map(item => {
+        if (item.Name == 'null') return undefined
+        if (item.List && item.List.length) {
+          item.List = this.delNullItems(item.List)
+        }
+        return item
+      }).filter(d => d)
+      return options
+    },
     changeCascader(val) {
       clearTimeout(this.timer);
       this.timer = setTimeout(() => {
         let tempVal = JSON.parse(JSON.stringify(val));
-        if (tempVal[tempVal.length - 1].indexOf('未明确') > -1) {
+        if (tempVal.length && tempVal[tempVal.length - 1].indexOf('未明确') > -1) {
           tempVal.splice(tempVal.length - 1, 1, '')
         }
         this.$emit("change", tempVal);

+ 1 - 1
src/views/point/config_point/steps/index.vue

@@ -116,7 +116,7 @@
         beforeRouteLeave(to, from, next) {
             let step = this.$refs.step
             let flag = step.hasOwnProperty('noSaveData') ? step.noSaveData() : false
-            if(flag){
+            if(flag || this.activeStep == 4 || this.activeStep == 3){
                 next()
             }else{
                 this.$confirm('存在数据未保存, 是否继续?', '提示', {

+ 20 - 2
src/views/point/dynamicdata/addRelation/equipRela/index.vue

@@ -46,7 +46,13 @@
               <el-table-column label="数据源" align="right" show-overflow-tooltip>
                 <template slot-scope="scope">{{ scope.row.Datasource }}</template>
               </el-table-column>
-              <el-table-column prop="LocationFlag" label="位置标签" align="right" show-overflow-tooltip></el-table-column>
+              <el-table-column label="位置标签" align="right">
+                <template slot-scope="scope">
+                  <el-tooltip :content="scope.row.LocationFlag.toString()" placement="top">
+                    <span>{{scope.row.LocationFlag.toString()}}</span>
+                  </el-tooltip>
+                </template>
+              </el-table-column>
               <el-table-column prop="SubTypeName" label="设备类型关键字" align="right" show-overflow-tooltip></el-table-column>
               <el-table-column prop="EquipmentMark" label="设备标识" show-overflow-tooltip align="right" width="200" class-name="bgf5"></el-table-column>
               <el-table-column type="selection" width="35" class-name="bgf5"></el-table-column>
@@ -317,11 +323,17 @@ export default {
     //查询左侧列表
     queryLeftTable() {
       this.lPage.pageNumber = 1;
+      if (this.$refs.lTableBody && this.$refs.lTableBody.bodyWrapper) {
+        this.$refs.lTableBody.bodyWrapper.scrollTop = 0
+      }
       this.getLeftData();
     },
     //查询右侧列表
     queryRightTable() {
       this.rPage.pageNumber = 1;
+      if (this.$refs.rTableBody && this.$refs.rTableBody.bodyWrapper) {
+        this.$refs.rTableBody.bodyWrapper.scrollTop = 0
+      }
       this.getRightData();
     },
     //获取待关联点位-左侧
@@ -362,7 +374,7 @@ export default {
         PageSize: this.rPage.pageSize,
         TypeNameList: [this.typeName]
       };
-      //处理查询条件(目前只是单个查,需后台支持)
+      //处理查询条件
       if (this.form.EquipLocalName && this.form.EquipLocalName.length) {
         param.EquipLocalName = this.form.EquipLocalName;
       }
@@ -381,6 +393,12 @@ export default {
       if (this.form.locationVal.length > 3) {
         param.RoomLocalName = this.form.locationVal[3];
       }
+      if (!this.form.locationVal.length) {
+        delete param.BuildLocalName
+        delete param.FloorLocalName
+        delete param.SpaceType
+        delete param.RoomLocalName
+      }
       this.rTableLoading = true;
       dynamicPendingobjs(param, res => {
         this.rPage.total = res.Total;

+ 2 - 1
src/views/point/dynamicdata/index.vue

@@ -17,7 +17,7 @@
           <i class="el-icon-right"></i>
         </span>
         <el-tooltip class="item" effect="dark" :content="'按对应规则自动设定实例动态参数信息点'" placement="left">
-          <el-badge :is-dot="tipsType>1" class="item">
+          <el-badge :is-dot="ruleDialogShow||tipsType>1" class="item">
             <el-button size="small" type="primary" @click="apply" icon="el-icon-refresh" style="float:right;">配置</el-button>
           </el-badge>
         </el-tooltip>
@@ -128,6 +128,7 @@ export default {
     },
     //执行对应结果
     apply() {
+      this.ruleDialogShow = false;
       this.$refs.apply.showDialog();
     },
     //规则执行弹窗