|
@@ -1,14 +1,18 @@
|
|
|
<script setup lang="ts">
|
|
|
import CpmdHeader from '@/components/CpmdHeader.vue';
|
|
|
+import CpmdQuestionnaire from '@/components/CpmdQuestionnaire.vue'
|
|
|
import { onMounted, onUnmounted, ref } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { format } from 'date-fns/format';
|
|
|
const router = useRouter()
|
|
|
|
|
|
+//调用子组件的ref
|
|
|
+const question = ref<any>()
|
|
|
+
|
|
|
//持久化设置 菜单状态
|
|
|
import { menuStatusStore, userInfoStore } from '@/stores'
|
|
|
import { isHaveManage } from '@/utils/test';
|
|
|
-import { userPlanApi, userPlanDetailApi } from '@/api/home';
|
|
|
+import { queryIsQuestionApi, userPlanApi, userPlanDetailApi } from '@/api/home';
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
const userInfo = userInfoStore();
|
|
|
const menuStatus = menuStatusStore();
|
|
@@ -29,7 +33,18 @@ const planList = ref<any>([
|
|
|
// return hour + ':时'
|
|
|
// }
|
|
|
//点击了开始测试--跳转到测试页面
|
|
|
-const startPlan = (val: any) => {
|
|
|
+const startPlan = async (val: any) => {
|
|
|
+ //先判断
|
|
|
+ //是否做了问卷
|
|
|
+ //如果未做问卷需要弹出问卷的弹出框
|
|
|
+ //做完以后开始测试
|
|
|
+ let res: any = await queryIsQuestionApi()
|
|
|
+ if (res.data != null) {
|
|
|
+ //此时是问卷未做
|
|
|
+ //调用问卷组件打开
|
|
|
+ question.value.open(res.data)
|
|
|
+ return
|
|
|
+ }
|
|
|
let nextFlag = '';
|
|
|
let type = '';
|
|
|
if (val.scaleList.length > 0) {
|
|
@@ -199,7 +214,7 @@ const planNumGet = async () => {
|
|
|
let temp: any = await userPlanDetailApi(params)
|
|
|
planList.value[i].list = temp.data
|
|
|
}
|
|
|
-
|
|
|
+ debugger;
|
|
|
//-------------处理SCL90的完成状态----------------
|
|
|
for (let i = 0; i < planList.value.length; i++) {
|
|
|
//
|
|
@@ -317,6 +332,10 @@ onUnmounted(() => {
|
|
|
<div class="task_content">
|
|
|
<div class="title">{{ subItem.name }}</div>
|
|
|
<div class="des">预计用时{{ subItem.expectTime }}</div>
|
|
|
+ <div
|
|
|
+ :style="{ color: subItem.isCompleted == '1' ? 'green' : 'red' }">
|
|
|
+ {{
|
|
|
+ subItem.isCompleted == '1' ? '已完成' : '未完成' }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -456,6 +475,7 @@ onUnmounted(() => {
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <CpmdQuestionnaire ref="question" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<style lang="scss" scoped>
|