Skip to content

Commit

Permalink
fix: 隐藏了超时问卷的提交按钮 (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
xixiIBN5100 authored Oct 5, 2024
1 parent 665bd3d commit 2289714
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/pages/Home/questionnaireItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ import { useMainStore } from '@/stores';
import CryptoJS from 'crypto-js';
import { ElMessage } from 'element-plus';

const baseURL = import.meta.env.VITE_COPY_LINK;
const tempStore = useMainStore().useTempStore();

const props = defineProps<{
title: string,
idName: number,
Expand Down Expand Up @@ -100,7 +100,7 @@ const delQuestionnaire = (id: number) => {
const copyShareCode = () => {
const Key = 'JingHong';
const encryptedId = CryptoJS.AES.encrypt(props.idName+'',Key).toString();
navigator.clipboard.writeText( "https://qa.lonesome.cn/View?id=" + encryptedId);
navigator.clipboard.writeText( baseURL + "/View?id=" + encryptedId);
ElMessage({
message: '链接复制成功',
type: 'success',
Expand Down
8 changes: 6 additions & 2 deletions src/pages/View/view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</div>
</div>
<div class="flex justify-center items-center py-50">
<button class="btn w-1/3 bg-red-800 text-red-50" @click="showModal('QuestionnaireSubmit')" v-if="decryptedId !== ''" >提交问卷</button>
<button class="btn w-1/3 bg-red-800 text-red-50" @click="showModal('QuestionnaireSubmit')" v-if="decryptedId !== '' && !isOutDate" >提交问卷</button>
</div>
</div>
<modal modal-id="QuestionnaireSubmit">
Expand Down Expand Up @@ -121,6 +121,7 @@
const loginStore = useMainStore().useLoginStore();
const decryptedId = ref<string | null>()
const allowSend = ref(true)
const isOutDate = ref(false)
onMounted(() => {
loginStore.setShowHeader(false);
Expand Down Expand Up @@ -163,7 +164,10 @@
}
});
loading.value = false
} else {
} else if (res.code === 200509){
isOutDate.value = true
ElNotification.error(res.msg);
}else {
ElNotification.error(res.msg);
}
},
Expand Down

0 comments on commit 2289714

Please sign in to comment.