style:调整代码格式和顺序

- 修改了多个组件文件的代码结构
- 优化了代码缩进和空格使用
- 调整了部分代码的顺序以提高可读性
This commit is contained in:
陈昱达
2025-03-18 19:29:58 +08:00
parent e1c1429a47
commit 97fc07a161
7 changed files with 25 additions and 24 deletions

View File

@@ -4,7 +4,7 @@ import { onMounted } from 'vue';
import appBridge from '@/assets/js/appBridge';
import utils from '@/assets/js/common';
onMounted(async () => {
onMounted(async() => {
if (utils.getParameter('digitalYiliToken')) {
// 隐藏/显示 header
appBridge.setHeaderShown(false);

View File

@@ -13,12 +13,12 @@ const question = defineModel<question>('element', {
// eslint-disable-next-line
const activeComponent = computed<Component>(() => {
switch (question.value.question_type) {
case 8:
return MatrixText;
case 9:
return MatrixRadio;
case 10:
return MatrixCheckbox;
case 8:
return MatrixText;
case 9:
return MatrixRadio;
case 10:
return MatrixCheckbox;
}
});

View File

@@ -30,9 +30,9 @@
<p>{{ element.config.prompt_right }}</p>
</div>
<RateCharacter
v-model:model="value"
:config="element.config"
:index="optionIndex"
v-model:model="value"
@change="handleRateChange"
/>
</div>

View File

@@ -9,7 +9,7 @@ import { showFailToast } from 'vant';
const contentShow = ref(false);
const show = ref(false);
onMounted(async () => {
onMounted(async() => {
if (utils.getSessionStorage('xToken')) {
const appToken = utils.getSessionStorage('xToken');
getUserInfo(appToken)

View File

@@ -61,7 +61,7 @@ import endPng from '@/assets/img/publish/end.png';
const survey = ref({
project_name: ''
});
const fetchSurveys = async () => {
const fetchSurveys = async() => {
const params = {
page: 1,
per_page: 10,

View File

@@ -134,7 +134,7 @@ const onLoad = () => {
fetchSurveys();
}, 500);
};
const fetchSurveys = async () => {
const fetchSurveys = async() => {
const params = {
page: form.value.page,
per_page: form.value.pageSize,
@@ -172,7 +172,7 @@ const deleteItem = (item) => {
showCancelButton: true,
confirmButtonColor: '#03B03C'
})
.then(async () => {
.then(async() => {
const res = await deleteSurveys(item.sn);
if (res.data.message) {
showToast(res.data.message);
@@ -196,7 +196,7 @@ const copyItem = (item) => {
showCancelButton: true,
confirmButtonColor: '#03B03C'
})
.then(async () => {
.then(async() => {
const res = await copySurveys(item.sn);
if (res.data.code === 200 || res.data.code === 201) {
showSuccessToast('复制成功');
@@ -237,7 +237,7 @@ const editItem = (item) => {
});
};
// 保存为模板
const saveTemplate = async (item) => {
const saveTemplate = async(item) => {
const data = JSON.parse(JSON.stringify(item));
const res = await saveTemplates(item.sn, data);
if (res.data.code === 200 || res.data.code === 201) {

View File

@@ -271,8 +271,8 @@
</template>
</van-cell>
<van-cell-group
:border="false"
v-if="questionInfo.survey.is_ip_number === 1"
:border="false"
class="child-group"
>
<van-field
@@ -435,14 +435,14 @@ const questionEvent = (item) => {
options:
item.json.options.length > 0
? item.json.options.map((item) => {
return item.map((it) => {
return {
...it,
// 主键生成
id: uuidv4()
};
});
})
return item.map((it) => {
return {
...it,
// 主键生成
id: uuidv4()
};
});
})
: []
})
);
@@ -579,7 +579,7 @@ const previewQuestion = () => {
router.push({ name: 'preview', query: { ...route.query } });
};
onMounted(async () => {
onMounted(async() => {
await getQuestionDetail();
});
</script>
@@ -795,6 +795,7 @@ onMounted(async () => {
:deep(.van-cell) {
padding: 8px;
}
.survey-action {
position: fixed;
bottom: 0;