Bläddra i källkod

解决启动计算状态标记,接口处理

shaun-sheep 4 år sedan
förälder
incheckning
4c182f15a6

+ 32 - 19
src/components/relation/overview/CardList.vue

@@ -33,13 +33,15 @@
             v-for="(relation,relIndex) in child.RelationTypeProjectList"
           >
             <el-card
-              class="card"
+              class="card "
               shadow="hover"
               style="position: relative;"
+
             >
               <!-- border:none-->
-              <!--<div class="mask"></div>-->
-              <div style="overflow: hidden">
+              <!--              <div v-show="relation.cardDisabled || relation.ComputationalState === 3 " class="mask"></div>-->
+              <div v-show="relation.ComputationalState === 3 " class="mask"></div>
+              <div style="overflow: hidden;">
                 <el-tooltip
                   :content="relation.RelationTypeName"
                   placement="top"
@@ -89,10 +91,12 @@
                   </el-col>
                 </el-row>
                 <p class="last-computed">
-                        <span
-                          v-show="relation.ComputationalState === 3 || relation.ComputationalState === 4">关系计算中...</span>
+                  <!--  <span v-show="relation.ComputationalState === 3 || relation.ComputationalState === 4">关系计算中...</span>-->
+                  <!--                  <span v-show="relation.cardDisabled || relation.ComputationalState === 3">关系计算中...</span>-->
+                  <span v-show="relation.ComputationalState === 3">关系计算中...</span>
                   <span v-show="relation.ComputationalState === 5">计算失败</span>
-                  <span v-show="relation.ComputingTime">最后一次计算时间 {{relation.ComputingTime}}</span>
+                  <span
+                    v-show="relation.ComputationalState !== 3  && relation.ComputingTime">最后一次计算时间 {{relation.ComputingTime}}</span>
                   <el-tooltip
                     content="启动计算"
                     placement="top"
@@ -177,7 +181,8 @@
     props: {
       content: Array,
       source: Array,
-      TableVisibleMoreLoading: Boolean
+      TableVisibleMoreLoading: Boolean,
+      // cardDisabled: Boolean
     },
     data() {
       return {
@@ -209,12 +214,15 @@
           allUpdateSuccess: 'xxxx全部更新成功',
           portionUpdateSuccess: ' xxxx关系部分更新成功',
           downloadFile: ' 下载报告文件',
-          equipmentSetting:''
+          equipmentSetting: ''
         },
         isComputed: {}, // 当前要计算的对象
         ManualMaintenance: {},//手动编辑对象
       }
     },
+    created() {
+      console.log(this.content)
+    },
     computed: {},
 
     methods: {
@@ -222,12 +230,13 @@
         // alert('explain click')
       },
       RelationType() {
+        // this.cardDisabled = true
         this.$emit('RelationType', this.isComputed.RelationType, this.isComputed.ZoneType)
 
       },
       computed(relation) {
         this.isComputed = relation // 当前要计算的对象
-        if(relation.RelationType) {
+        if (relation.RelationType) {
           this.$emit('calcSpecial', relation)
           if (relation.IsSource) {
             this.values.existComputed = `根据现有数据自动计算 <${relation.RelationTypeName}>`
@@ -236,6 +245,9 @@
           } else {
             this.values.autoComputed = `根据现有数据自动计算 <${relation.RelationTypeName}>`
             this.$refs.maintain.dialogTableVisible = true
+            // this.$set(relation, 'cardDisabled', true)
+
+
           }
         } else {
           this.$message.warning("设计中")
@@ -418,16 +430,17 @@
     .card {
       position: @pos-relative;
 
-      .mask {
-        background: rgba(255, 255, 255, .6);
-        position: @pos-absolute;
-        top: @pos-zero;
-        left: @pos-zero;
-        right: @pos-zero;
-        bottom: @pos-zero;
-        user-select: none;
-        z-index: 2
-      }
+    }
+
+    .mask {
+      background: rgba(255, 255, 255, .6);
+      position: @pos-absolute;
+      top: @pos-zero;
+      left: @pos-zero;
+      right: @pos-zero;
+      bottom: @pos-zero;
+      user-select: none;
+      z-index: 2
     }
 
     .relation-title {

+ 1 - 0
src/views/ready/collectsetting/index.vue

@@ -868,6 +868,7 @@
           listener = document.querySelector('.right_main'),
           distance = listener.scrollTop,
           step = total / 50;
+
         if (total > distance) {
           smoothDown()
         } else {

+ 20 - 15
src/views/relation/overview/index.vue

@@ -4,12 +4,12 @@
       v-loading="loading"
   >
     <cardList
-        :content="content"
-        :source="source"
-        :TableVisibleMoreLoading="TableVisibleMoreLoading"
-        @calcSpecial="calcSpecial"
-        @openComputed="openComputed"
-        @RelationType="RelationType"
+      :content="content"
+      :source="source"
+      :TableVisibleMoreLoading="TableVisibleMoreLoading"
+      @calcSpecial="calcSpecial"
+      @openComputed="openComputed"
+      @RelationType="RelationType"
     />
   </div>
 </template>
@@ -152,6 +152,7 @@
           let rList = item.RelationTypeProjectList
           rList.forEach(r => {
             r.count = countInfo[name][r.Id]
+            // this.$set(r, 'cardDisabled', false)
           })
         })
       },
@@ -163,15 +164,19 @@
             projectId: this.projectId
           }
         }
-        businessSpaceAll(param).then(res=> {
-          if(res.data.Result === 'failure') {
-            this.$message({
-              message: '计算失败',
-              type: 'error'
-            })
-          }
-          this.init()
-        })
+          businessSpaceAll(param).then(res=> {
+            if (res.data.Result === 'failure') {
+              this.$message({
+                message: '计算失败',
+                type: 'error'
+              })
+            } else {
+              this.init()
+            }
+
+          })
+        this.init()
+
       },
       calcSpecial(relation) {
         this.currentRelationTypeName = relation.RelationTypeName