Browse Source

修改查看流程BUG

徐桐章 4 years ago
parent
commit
0022166c47
1 changed files with 17 additions and 8 deletions
  1. 17 8
      src/views/companyManage/procedureManage.vue

+ 17 - 8
src/views/companyManage/procedureManage.vue

@@ -4,7 +4,7 @@
  * @Autor: XuTongZhang
  * @Date: 2020-07-28 16:00:46
  * @LastEditors: XuTongZhang
- * @LastEditTime: 2020-08-10 16:28:03
+ * @LastEditTime: 2020-08-11 12:58:31
 -->
 <template>
   <div class="indexPage">
@@ -61,16 +61,16 @@
             <div>
               {{item.questionName}}
             </div>
-            <video v-if="item.videoIdList && item.videoIdList.length" :src="downList.some(i => i.id === (activeId||item.videoIdList[0])) ? $img + downList.find(i => i.id === (activeId||item.videoIdList[0])).videoPath : ''" controls></video>
-            <div class="flex">
-               <div v-for="(i, j) in item.videoIdList" :key="j" class="active" @click="active = j,activeId = j" :class="active === j ? 'is-active' : ''">{{downList.some(k => k.id === i) ? downList.find(k => k.id === i).videoName : '无数据'}}</div>
+            <video width="100%" v-if="item.videoIdList && item.videoIdList.length" :src="downList.some(i => i.id === item.videoIdList[item.active]) ? $img + downList.find(i => i.id === item.videoIdList[item.active]).videoPath : ''" controls></video>
+            <div class="flex">{{item.active}}
+               <div v-for="(i, j) in item.videoIdList" :key="i" class="active" @click="updateActive(item, index, j)" :class="item.active === j ? 'is-active' : ''">{{downList.some(k => k.id === i) ? downList.find(k => k.id === i).videoName : '无数据'}}</div>
             </div>
           </div>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="close">取 消</el-button>
-        <el-button @click="addDomain" type="success">新增</el-button>
+        <el-button v-if="state!==2" @click="addDomain" type="success">新增</el-button>
         <el-button type="primary" v-if="state!==2" @click="branch">确 定</el-button>
       </div>
     </el-dialog>
@@ -100,7 +100,6 @@ export default {
           { key: 1 }
         ]
       },
-      info: {},
       state: 0,
       active: 0,
       activeId: '',
@@ -174,9 +173,15 @@ export default {
           this.downList = res.list
         })
     },
+    updateActive (item, index, j) {
+      console.log(item, index, j)
+      // this.form.questionList[index].active = j
+      item.active = j
+      this.$set(this.form.questionList, index, item)
+      console.log(this.form.questionList[index].active)
+    },
     add () {
       this.open()
-      this.info = {}
       this.state = 0
     },
     getDetails (row) {
@@ -188,7 +193,11 @@ export default {
         .then((res) => {
           this.open()
           this.form = JSON.parse(JSON.stringify(res.object))
-          this.info = res.object
+          this.form.questionList = this.form.questionList.map(item => {
+            item.active = 0
+            return item
+          })
+          console.log(this.form)
         })
     },
     details (row) {