|
|
@@ -18,16 +18,18 @@
|
|
|
</view>
|
|
|
<view class="px-20 py-8 border border-solid rounded-full text-24 text-white"
|
|
|
:class="[isFinished ? 'bg-success border-success' : 'bg-primary border-primary']" @click="handleStartExam">
|
|
|
- <text>{{ isFinished ? '查看分析' : '继续考试' }}</text>
|
|
|
+ <text>{{ isFinished ? '查看分析' : '开始考试' }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
-import { EnumPaperType, EnumSimulatedRecordStatus } from '@/common/enum';
|
|
|
+import { EnumPaperType, EnumSimulatedRecordStatus, EnumUserRole } from '@/common/enum';
|
|
|
import { Study, Transfer } from '@/types';
|
|
|
import { useTransferPage } from '@/hooks/useTransferPage';
|
|
|
+import { useAuth } from '@/hooks/useAuth';
|
|
|
|
|
|
+const { hasPermission } = useAuth();
|
|
|
const { transferTo } = useTransferPage();
|
|
|
const props = defineProps<{
|
|
|
data: Study.VHSPaper;
|
|
|
@@ -38,26 +40,29 @@ const isFinished = computed(() => {
|
|
|
});
|
|
|
|
|
|
const handleStartExam = () => {
|
|
|
- if (isFinished.value) {
|
|
|
- transferTo('/pagesStudy/pages/simulation-analysis/simulation-analysis', {
|
|
|
- data: {
|
|
|
- examineeId: props.data.examineeId,
|
|
|
- paperType: EnumPaperType.SIMULATED
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- const pageOptions: Transfer.ExamAnalysisPageOptions = {
|
|
|
- paperType: EnumPaperType.SIMULATED,
|
|
|
- readonly: false,
|
|
|
- simulationInfo: {
|
|
|
- name: props.data.paperName,
|
|
|
- // 难受
|
|
|
- examineeId: props.data.id,
|
|
|
+ const hasAuth = hasPermission([EnumUserRole.VIP]);
|
|
|
+ if (hasAuth) {
|
|
|
+ if (isFinished.value) {
|
|
|
+ transferTo('/pagesStudy/pages/simulation-analysis/simulation-analysis', {
|
|
|
+ data: {
|
|
|
+ examineeId: props.data.examineeId,
|
|
|
+ paperType: EnumPaperType.SIMULATED
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ const pageOptions: Transfer.ExamAnalysisPageOptions = {
|
|
|
+ paperType: EnumPaperType.SIMULATED,
|
|
|
+ readonly: false,
|
|
|
+ simulationInfo: {
|
|
|
+ name: props.data.paperName,
|
|
|
+ // 难受
|
|
|
+ examineeId: props.data.id,
|
|
|
+ }
|
|
|
}
|
|
|
+ transferTo('/pagesStudy/pages/exam-start/exam-start', {
|
|
|
+ data: pageOptions,
|
|
|
+ });
|
|
|
}
|
|
|
- transferTo('/pagesStudy/pages/exam-start/exam-start', {
|
|
|
- data: pageOptions,
|
|
|
- });
|
|
|
}
|
|
|
}
|
|
|
|