refactor: 移除冗余代码并优化代码结构

- 删除了多处不必要的 console.log 语句
- 优化了部分组件的代码结构,提高了可读性
- 移除了未使用的变量和导入
- 统一了代码格式,提高了代码的一致性
This commit is contained in:
陈昱达
2025-03-28 13:55:36 +08:00
parent ce29be95a8
commit 9de9f64d49
13 changed files with 227 additions and 115 deletions

View File

@@ -31,10 +31,7 @@ const route = useRoute();
const router = useRouter();
function goBack() {
console.log(window.history.length);
console.log(window.history.length > 1 && route.name !== 'home');
if (window.history.length > 1 && route.name !== 'home') {
console.log(1);
window.history.back();
} else {
appBridge.navigateBack();
@@ -43,7 +40,6 @@ function goBack() {
// 处理物理返回键
const handlePopState = () => {
console.log('handlePopState');
goBack();
};

View File

@@ -246,9 +246,7 @@ const confirm = ({ selectedValues }) => {
emit('saveOption');
};
const minVaule = (e) => {
console.log(actionQuestion.value.config.max);
if (actionQuestion.value.config.max) {
console.log(111);
if (Number(e.target.value) > Number(actionQuestion.value.config.max)) {
actionQuestion.value.config.min = actionQuestion.value.config.max;
}

View File

@@ -121,12 +121,10 @@ const actionQuestion = computed({
return props.modelValue;
},
set(newValue) {
console.log(`newValue`, newValue);
emit('update:modelValue', newValue);
}
});
console.log(`action question`, actionQuestion.value);
// 处理显示值如果值为0则返回空字符串以显示placeholder
const displayValue = (value) => {
return value === 0 ? '' : Number(value);

View File

@@ -84,7 +84,6 @@ const emit = defineEmits(['updateConfig']);
watch(
() => props.config,
(newConfig, oldValue) => {
console.log(`value change`, newConfig.max, newConfig.min);
// 如果最低分大于最高分或者分数过大,则取消赋值
if (newConfig.max > MAX_NUM && newConfig.min > MAX_NUM) {
// showToast({
@@ -143,7 +142,6 @@ function emitInfo() {
}
function intervalChange(value) {
console.log(value);
// localConfig.value.score_interval = value === 0 ? 1 : value;
localConfig.value = JSON.parse(JSON.stringify(localConfig.value));

View File

@@ -77,7 +77,6 @@ const sortedData = computed(() => {
const otherOptions = data.value.filter((item) => {
return !item.is_fixed && !item.is_remove_other;
});
console.log([...otherOptions, ...lastOptions, ...remoteOtherOptions]);
// 顺序 剩余选项 + 置底选项 + 排他选项
return [...otherOptions, ...lastOptions, ...remoteOtherOptions];
});

View File

@@ -15,7 +15,6 @@ const props = defineProps<{
active: boolean;
}>();
const { config } = question.value;
console.log(config);
// 答案
const answer = ref<FileList | []>([]);

View File

@@ -42,7 +42,6 @@ const emitValue = () => {
// 组件选择
const activeComponent = selectActiveComponent();
function selectActiveComponent(): Component {
console.log(`question_type`, element.value.question_type);
switch (element.value.question_type) {
case 8:
return MatrixText;
@@ -55,7 +54,6 @@ function selectActiveComponent(): Component {
}
}
console.log(`active component`, activeComponent);
// 增加 popover 的 actions
const popoverActions = [
{

View File

@@ -82,8 +82,6 @@ const element = defineModel('element', {
}
});
console.log(element.value, 1);
/**
*
* @param index {number} 索引

View File

@@ -228,7 +228,6 @@ function saveCanvasState() {
// 如果是页面刷新,则不保存状态
if (isPageRefresh) {
console.log('页面刷新,不保存画布状态');
// 清除之前保存的状态
if (window.indexedDB) {
try {

View File

@@ -98,7 +98,6 @@ const fetchSurveys = async () => {
if (nameList.length) {
survey.value.created_at = timeList[0];
}
console.log(survey.value);
} else {
// Toast()
}

View File

@@ -634,8 +634,6 @@ let settingList = [];
const getQuestionDetail = () => {
let sn = sessionStorage.getItem('sn');
if (sn) {
console.log(sn, 213123);
snQuestions({ sn: sn }).then((res) => {
if (res.data) {
questionInfo.value.survey = Object.assign({}, res.data.data.survey);

View File

@@ -24,22 +24,26 @@
<!-- <img :src="icon" alt="icon" />-->
</div>
</div>
<div v-if="styleInfo.logo_status && styleInfo.logo_url" class="example-logo" :style="[
{
'justify-content':
styleInfo.logo_site === 1
? 'flex-start'
: styleInfo.logo_site === 2
? 'center'
: 'flex-end'
},
{ 'padding-left': styleInfo.logo_site === 1 ? '20px' : '' },
{ 'padding-right': styleInfo.logo_site === 3 ? '20px' : '' },
{ position: styleInfo.head_img_status ? 'absolute' : '' },
!styleInfo.head_img_status && styleInfo.background_status
? `background-color: ${styleInfo.background_color};background-image: url(${styleInfo.background_url})`
: ''
]">
<div
v-if="styleInfo.logo_status && styleInfo.logo_url"
class="example-logo"
:style="[
{
'justify-content':
styleInfo.logo_site === 1
? 'flex-start'
: styleInfo.logo_site === 2
? 'center'
: 'flex-end'
},
{ 'padding-left': styleInfo.logo_site === 1 ? '20px' : '' },
{ 'padding-right': styleInfo.logo_site === 3 ? '20px' : '' },
{ position: styleInfo.head_img_status ? 'absolute' : '' },
!styleInfo.head_img_status && styleInfo.background_status
? `background-color: ${styleInfo.background_color};background-image: url(${styleInfo.background_url})`
: ''
]"
>
<img class="logo" :src="styleInfo.logo_url" alt="logo" />
</div>
@@ -47,8 +51,14 @@
<!-- eslint-disable-next-line -->
<div class="questions">
<!-- 提前终止和正常完成 -->
<q-last v-if="page === pages.length + 1" :code="questionsData?.action?.code" :action="questionsData?.action"
:survey="questionsData?.survey" :isAnswer="isAnswer" :isTemplate="isTemplate" />
<q-last
v-if="page === pages.length + 1"
:code="questionsData?.action?.code"
:action="questionsData?.action"
:survey="questionsData?.survey"
:isAnswer="isAnswer"
:isTemplate="isTemplate"
/>
<!-- 问卷名和描述 -->
<!-- <q-first v-else-if="page === 0" isMobile :title="questionsData?.survey?.title"
:desc="questionsData?.survey?.introduction" :questions="questionsData?.questions" :isAnswer="isAnswer"
@@ -60,8 +70,13 @@
:questionType="question.question_type" :questionIndex="question.question_index"
:showTitle="styleInfo.is_question_number && true" isMobile :isAnswer="isAnswer"> -->
<div v-for="question in questions" v-else :id="'questionIndex' + question.question_index"
:key="question.question_index" class="question">
<div
v-for="question in questions"
v-else
:id="'questionIndex' + question.question_index"
:key="question.question_index"
class="question"
>
<!-- <q-radio-->
<!-- v-if="question.question_type === 1"-->
<!-- :list="question.list"-->
@@ -77,17 +92,37 @@
<!-- :question="question"-->
<!-- />-->
<!-- 单选题 -->
<preview-choice v-if="question.question_type === 1" v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
:config="question.config" :hideOptions="question.hideOptions" :stem="question.stem"
:answerSn="questionsData.answer.sn" :answerSurveySn="questionsData.answer.survey_sn" :question="question"
@previous="previous" @next="next" @change-answer="onRelation($event, question)" />
<preview-choice
v-if="question.question_type === 1"
v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)"
:list="question.list"
:config="question.config"
:hideOptions="question.hideOptions"
:stem="question.stem"
:answerSn="questionsData.answer.sn"
:answerSurveySn="questionsData.answer.survey_sn"
:question="question"
@previous="previous"
@next="next"
@change-answer="onRelation($event, question)"
/>
<!-- 多选题 -->
<preview-checkbox v-else-if="question.question_type === 2" v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
:config="question.config" :hideOptions="question.hideOptions" :stem="question.stem"
:answerSn="questionsData.answer.sn" :answerSurveySn="questionsData.answer.survey_sn" :question="question"
@change-answer="onRelation($event, question)" @previous="previous" @next="next" />
<preview-checkbox
v-else-if="question.question_type === 2"
v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)"
:list="question.list"
:config="question.config"
:hideOptions="question.hideOptions"
:stem="question.stem"
:answerSn="questionsData.answer.sn"
:answerSurveySn="questionsData.answer.survey_sn"
:question="question"
@change-answer="onRelation($event, question)"
@previous="previous"
@next="next"
/>
<!-- &lt;!&ndash; 级联题 &ndash;&gt;-->
<!-- <q-cascader-->
<!-- v-else-if="question.question_type === 3"-->
@@ -98,19 +133,43 @@
<!-- isMobile-->
<!-- />-->
<!-- 填空题 -->
<preview-completion v-else-if="question.question_type === 4" :config="question.config" :answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)" :stem="question.stem"
:answerSn="questionsData.answer.sn" :answerSurveySn="questionsData.answer.survey_sn" :question="question"
@previous="previous" @next="next" @change-answer="onRelation($event, question)" />
<preview-completion
v-else-if="question.question_type === 4"
:config="question.config"
:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)"
:stem="question.stem"
:answerSn="questionsData.answer.sn"
:answerSurveySn="questionsData.answer.survey_sn"
:question="question"
@previous="previous"
@next="next"
@change-answer="onRelation($event, question)"
/>
<!-- 打分题 -->
<preview-rate v-else-if="question.question_type === 5" v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
:config="question.config" :question="question" isMobile @change-answer="onRelation($event, question)" />
<preview-rate
v-else-if="question.question_type === 5"
v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)"
:list="question.list"
:config="question.config"
:question="question"
isMobile
@change-answer="onRelation($event, question)"
/>
<!-- 图文说明题 -->
<preview-text-with-images :answerIndex="getQuestionIndex(questionsData.questions, question)"
:stem="question.stem" v-else-if="question.question_type === 6" :config="question.config" @previous="previous"
@next="next" v-model:answer="question.answer" :answerSn="questionsData.answer.sn"
:answerSurveySn="questionsData.answer.survey_sn" :question="question" />
<preview-text-with-images
:answerIndex="getQuestionIndex(questionsData.questions, question)"
:stem="question.stem"
v-else-if="question.question_type === 6"
:config="question.config"
@previous="previous"
@next="next"
v-model:answer="question.answer"
:answerSn="questionsData.answer.sn"
:answerSurveySn="questionsData.answer.survey_sn"
:question="question"
/>
<!-- &lt;!&ndash; 日期时间题 &ndash;&gt;-->
<!-- <q-date-->
<!-- v-else-if="question.question_type === 7"-->
@@ -120,20 +179,45 @@
<!-- isMobile-->
<!-- />-->
<!-- 矩阵填空题 -->
<preview-matrix-text v-else-if="question.question_type === 8" v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
:questionIndex="question.question_index" :config="question.config" :stem="question.stem" :question="question"
@previous="previous" @next="next" @change-answer="onRelation($event, question)" />
<preview-matrix-text
v-else-if="question.question_type === 8"
v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)"
:list="question.list"
:questionIndex="question.question_index"
:config="question.config"
:stem="question.stem"
:question="question"
@previous="previous"
@next="next"
@change-answer="onRelation($event, question)"
/>
<!-- 矩阵单选题 -->
<preview-matrix-radio v-else-if="question.question_type === 9" v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
:questionIndex="question.question_index" :config="question.config" :stem="question.stem"
:answerSn="questionsData.answer.sn" :answerSurveySn="questionsData.answer.survey_sn" :question="question"
@change-answer="onRelation($event, question)" @previous="previous" @next="next" />
<preview-matrix-radio
v-else-if="question.question_type === 9"
v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)"
:list="question.list"
:questionIndex="question.question_index"
:config="question.config"
:stem="question.stem"
:answerSn="questionsData.answer.sn"
:answerSurveySn="questionsData.answer.survey_sn"
:question="question"
@change-answer="onRelation($event, question)"
@previous="previous"
@next="next"
/>
<!-- 矩阵多选题 -->
<preview-matrix-checkbox v-else-if="question.question_type === 10" v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
:config="question.config" :question="question" @change-answer="onRelation($event, question)" />
<preview-matrix-checkbox
v-else-if="question.question_type === 10"
v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)"
:list="question.list"
:config="question.config"
:question="question"
@change-answer="onRelation($event, question)"
/>
<!-- &lt;!&ndash; 矩阵打分题 &ndash;&gt;-->
<!-- <matrix-rate-->
<!-- v-else-if="question.question_type === 11"-->
@@ -201,10 +285,16 @@
<!-- isMobile-->
<!-- />-->
<!-- 文件上传题 -->
<preview-file-upload v-else-if="question.question_type === 18" v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)" :config="question.config"
:question="question" isMobile :questionIndex="question.question_index"
@change-answer="onRelation($event, question)" />
<preview-file-upload
v-else-if="question.question_type === 18"
v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)"
:config="question.config"
:question="question"
isMobile
:questionIndex="question.question_index"
@change-answer="onRelation($event, question)"
/>
<!-- &lt;!&ndash; 地理位置题 &ndash;&gt;-->
<!-- <q-map-->
<!-- v-else-if="question.question_type === 19"-->
@@ -233,9 +323,14 @@
<!-- isMobile-->
<!-- />-->
<!-- 签名题 -->
<preview-sign v-else-if="question.question_type === 22" :config="question.config" :question="question"
v-model:answer="question.answer" :answerIndex="getQuestionIndex(questionsData.questions, question)"
@change-answer="onRelation($event, question)" />
<preview-sign
v-else-if="question.question_type === 22"
:config="question.config"
:question="question"
v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)"
@change-answer="onRelation($event, question)"
/>
<!-- &lt;!&ndash; 知情同意书 &ndash;&gt;-->
<!-- <q-consent-->
<!-- v-else-if="question.question_type === 23"-->
@@ -359,12 +454,26 @@
<!-- :question="question"-->
<!-- />-->
<!-- &lt;!&ndash; 高级题型-NPS &ndash;&gt;-->
<preview-n-p-s v-else-if="question.question_type === 106" v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)" :isPreview="isPreview"
:title="question.title" :stem="question.stem" :list="question.list" :config="question.config"
:isAnswer="isAnswer" :questionIndex="question.question_index" :label="question.title" :loading="loading"
:isTemplate="isTemplate" :showTitle="styleInfo.is_question_number" :question="question" @previous="previous"
@next="next" @change-answer="onRelation($event, question)" />
<preview-n-p-s
v-else-if="question.question_type === 106"
v-model:answer="question.answer"
:answerIndex="getQuestionIndex(questionsData.questions, question)"
:isPreview="isPreview"
:title="question.title"
:stem="question.stem"
:list="question.list"
:config="question.config"
:isAnswer="isAnswer"
:questionIndex="question.question_index"
:label="question.title"
:loading="loading"
:isTemplate="isTemplate"
:showTitle="styleInfo.is_question_number"
:question="question"
@previous="previous"
@next="next"
@change-answer="onRelation($event, question)"
/>
</div>
<!-- <LangTranslate v-if="isAnswer && styleInfo.is_yip" translate-key="PoweredByDigitalTechnologyCenterYIP"
@@ -375,14 +484,33 @@
</div>
<!-- 分页 -->
<!-- eslint-disable max-len -->
<pfe-pagination v-if="isPreview" class="pagination" :isPreview="isPreview" :page="page" :pages="pages.length + 1"
:min="styleInfo.is_home ? 0 : 1" :loading="loading" :showPrevious="styleInfo.is_up_button"
:showStart="styleInfo.is_start_button" :startText="styleInfo.start_button_text"
:showSubmit="styleInfo.is_submit_button" :submitText="localPageTimer.is_show && localPageTimer.short_time
<pfe-pagination
v-if="isPreview"
class="pagination"
:isPreview="isPreview"
:page="page"
:pages="pages.length + 1"
:min="styleInfo.is_home ? 0 : 1"
:loading="loading"
:showPrevious="styleInfo.is_up_button"
:showStart="styleInfo.is_start_button"
:startText="styleInfo.start_button_text"
:showSubmit="styleInfo.is_submit_button"
:submitText="
localPageTimer.is_show && localPageTimer.short_time
? `${localPageTimer.short_time}S`
: styleInfo.submit_button_text
" :buttonTextColor="styleInfo.button_text_color" :buttonColor="styleInfo.button_color" :nextText="localPageTimer.is_show && localPageTimer.short_time ? `${localPageTimer.short_time}S` : ''
" :nextDisabled="localPageTimer.short_time" isMobile @previous="previous" @next="next">
"
:buttonTextColor="styleInfo.button_text_color"
:buttonColor="styleInfo.button_color"
:nextText="
localPageTimer.is_show && localPageTimer.short_time ? `${localPageTimer.short_time}S` : ''
"
:nextDisabled="localPageTimer.short_time"
isMobile
@previous="previous"
@next="next"
>
</pfe-pagination>
</div>
<!-- eslint-enable max-len -->
@@ -444,7 +572,6 @@ questionsData.value?.questions && clearAnswer(questionsData.value.questions);
page.value = 1;
// 清空action
// delete questionsData.value.action;
console.log(`come in preview`, questionsData.value);
const props = defineProps({
isTemplate: {
@@ -460,12 +587,11 @@ const props = defineProps({
// 初始化 isTemplate
isTemplate.value = props.isTemplate ? props.isTemplate : route.query.is_template === '1';
console.log(`now page is template? ${isTemplate.value}`);
// 开始更新数据
getQuestions();
// 更新数据
async function getQuestions () {
async function getQuestions() {
let { data } = await AnswerApi.getQuetions({
id: route.query.sn,
data: {
@@ -487,7 +613,7 @@ async function getQuestions () {
}
// 上一页
async function previous () {
async function previous() {
if (prevLoading.value || loading.value) {
return;
}
@@ -510,7 +636,7 @@ async function previous () {
}
// 下一页
async function next (callbackBeforePage) {
async function next(callbackBeforePage) {
// console.log(`click next button`, prevLoading.value || loading.value);
// if (prevLoading.value || loading.value) {
// return;
@@ -531,7 +657,7 @@ async function next (callbackBeforePage) {
// 开始答题
// 答题
async function answer (callback, callbackBeforePage) {
async function answer(callback, callbackBeforePage) {
if ((questions.value.length || !questionsData.value.questions.length) && !props.isTemplate) {
// 表单验证(当前页)
const errors = questions.value.filter((question) => {
@@ -1040,7 +1166,7 @@ async function answer (callback, callbackBeforePage) {
}
// 关联引用
function onRelation (
function onRelation(
// 避免出现参数 undefined 情况
{ options, value, list } = {},
{ question_type: _questionType, question_index: _questionIndex, related, answer } = {}
@@ -1156,7 +1282,7 @@ function onRelation (
});
}
function jumpImmediately () {
function jumpImmediately() {
const code = questionsData.value.action?.code;
if (page.value !== pages.value.length + 1 && ![20004, 20011, 20016].includes(code)) {
return;
@@ -1209,7 +1335,7 @@ function jumpImmediately () {
}
// 更新答案
function updateAnswer (auto) {
function updateAnswer(auto) {
if (auto) {
auto.forEach((autoItem) => {
const question = questionsData.value.questions.find(
@@ -1232,7 +1358,7 @@ function updateAnswer (auto) {
}
}
// 选项隐藏
function hideOptions (hide) {
function hideOptions(hide) {
const questionIndex = hide?.question_index;
if (questionIndex) {
const question = questionsData.value.questions.find(
@@ -1243,7 +1369,7 @@ function hideOptions (hide) {
}
// 要搜索的数组和要查找的连续数字的数量n
function hasNConsecutiveNumbers (arr, n, onTrue, onFalse) {
function hasNConsecutiveNumbers(arr, n, onTrue, onFalse) {
let count = 1;
let warnStart = 0;
let prevNum = arr[0];
@@ -1266,7 +1392,7 @@ function hasNConsecutiveNumbers (arr, n, onTrue, onFalse) {
// eslint-disable
// 跳转链接
function toUrl (url) {
function toUrl(url) {
// 创建一个新的变量来存储修改后的 URL
let modifiedUrl = url;
@@ -1289,7 +1415,7 @@ function toUrl (url) {
* 清空 answer 答案
* @param questions
*/
function clearAnswer (questions) {
function clearAnswer(questions) {
if (!questions) return;
questions.forEach((question) => {
if (!question.answer) return;

View File

@@ -4,8 +4,9 @@
<div class="qrcode-box">
<img class="bg_img" :src="bg" alt="" />
<div class="content">
<p class="tit" style="overflow: auto; max-height: 50px;">{{ surveyTitle ? surveyTitle : ''
}}</p>
<p class="tit" style="overflow: auto; max-height: 50px">
{{ surveyTitle ? surveyTitle : '' }}
</p>
<p style="margin-top: 6px; font-size: 500">扫码填写问卷</p>
</div>
<img class="qrcode-img" :src="publishInfo?.img_url" alt="" />
@@ -24,7 +25,13 @@
<div v-if="status === 0 || status === 2" class="enable-box">
<img class="not-publish-icon" src="@/assets/img/publish/not_pulish.png" alt="" />
<div class="content">点击"启用"按钮后问卷才可以开始回收数据</div>
<van-button type="primary" style="margin-top: 20px" class="btn" color="#70b936" @click="openPublishModal">
<van-button
type="primary"
style="margin-top: 20px"
class="btn"
color="#70b936"
@click="openPublishModal"
>
<template #icon>
<i class="mobilefont mobilefont-fasong"></i>
</template>
@@ -102,7 +109,7 @@ const operateBtn = (item: OperateItem) => {
}
};
// 复制链接
function copyLink () {
function copyLink() {
const input = document.createElement('input');
input.value = publishInfo.value.url;
document.body.appendChild(input);
@@ -112,7 +119,7 @@ function copyLink () {
showToast('链接复制成功');
}
// 分享链接
function shareLink () {
function shareLink() {
const params = {
type: 'shareToWx',
title: surveyTitle.value
@@ -126,14 +133,13 @@ function shareLink () {
// 朋友圈1 微信好友0
scene: 0
};
console.log(params);
appBridge.shareToWeChat(params, () => {
// 分享成功
});
}
// 下载二维码
function downLoadImg () {
function downLoadImg() {
const { title, url } = publishInfo.value.download_url;
if (appBridge.isInReactNative()) {
appBridge.save2Album(url, () => {
@@ -148,7 +154,7 @@ function downLoadImg () {
document.body.removeChild(link);
}
}
async function openPublishModal () {
async function openPublishModal() {
const res = await canPlanetPublish(route.query.sn as string, publishType.value);
if (res) {
await publishSurvey({
@@ -164,7 +170,7 @@ async function openPublishModal () {
}
}
function getCode () {
function getCode() {
getQrcode(sn)
.then((res) => {
if (res.data) {
@@ -175,7 +181,7 @@ function getCode () {
showFailToast(error.data?.message || error.message || '服务器错误');
});
}
function fetchInfo () {
function fetchInfo() {
getSurveyInfo(sn)
.then((res) => {
status.value = Number(res.data.data.status);