Browse Source

修改测试接口--问卷

plg 2 months ago
parent
commit
5e958daff0
2 changed files with 18 additions and 5 deletions
  1. 14 3
      src/components/CpmdQuestionnaire.vue
  2. 4 2
      src/views/HomeView.vue

+ 14 - 3
src/components/CpmdQuestionnaire.vue

@@ -44,7 +44,7 @@ const ruleForm = reactive<any>({
 
 })
 //子组件调用父组件的方法
-const emit = defineEmits(['continueFun'])
+const emit = defineEmits(['continueFun', 'fatherFun'])
 
 const visible = ref<boolean>(false)
 const questionList = ref<any>()
@@ -173,6 +173,15 @@ const open = (planId: string, type: string) => {
     //拿到登录用户的信息
 
     queryQuestion(planId)
+}
+const tipFun = () => {
+    visible.value = false
+    //调用父组件的方法
+    if (transmitType.value == '0') {
+        emit('fatherFun')
+    }
+
+
 }
 //
 defineExpose({ open })
@@ -222,14 +231,16 @@ defineExpose({ open })
         </template>
     </el-dialog>
     <!-- //另一个框 弹出确认是否跳转 -->
-    <el-dialog v-model="visible" :show-close="true" width="500" style="border-radius: 20px;">
+    <!-- 关闭的时候需要调用方法 -->
+
+    <el-dialog v-model="visible" :show-close="true" :before-close="tipFun" width="500" style="border-radius: 20px;">
         <template #header>
             <div class="my-header" style="text-align: center;">
                 <div class="exit_login_title">提示</div>
                 <div class="exit_login_info" v-if="transmitType == '0'">是否跳转到测试计划页面?</div>
                 <div class="exit_login_info" v-if="transmitType == '1'">是否直接开始测试计划?</div>
                 <div class="start_button_out" style="margin-top:20px;display: flex;justify-content: space-around;">
-                    <div class="start_button_self_close" @click="visible = false">
+                    <div class="start_button_self_close" @click="tipFun">
                         取消
                     </div>
                     <div class="start_button_self" @click="comT">

+ 4 - 2
src/views/HomeView.vue

@@ -131,7 +131,9 @@ const brightStatus = (val: number) => {
   clearInterval(flag_time.value)
   flag_text.value = val
 }
-
+const father = () => {
+  queryIsQuestion()
+}
 //鼠标移出事件事件--调用轮询器
 const brightStatusLevel = () => {
   forStatus()
@@ -323,7 +325,7 @@ const brightStatusLevel = () => {
       </div>
 
     </div>
-    <CpmdQuestionnaire ref="question" />
+    <CpmdQuestionnaire ref="question" @fatherFun=father />
   </div>
 
 </template>