Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 隐藏了超时问卷的提交按钮 #88

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading