style:调整代码格式和顺序
- 修改了多个组件文件的代码结构 - 优化了代码缩进和空格使用 - 调整了部分代码的顺序以提高可读性
This commit is contained in:
@@ -4,7 +4,7 @@ import { onMounted } from 'vue';
|
|||||||
import appBridge from '@/assets/js/appBridge';
|
import appBridge from '@/assets/js/appBridge';
|
||||||
import utils from '@/assets/js/common';
|
import utils from '@/assets/js/common';
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async() => {
|
||||||
if (utils.getParameter('digitalYiliToken')) {
|
if (utils.getParameter('digitalYiliToken')) {
|
||||||
// 隐藏/显示 header
|
// 隐藏/显示 header
|
||||||
appBridge.setHeaderShown(false);
|
appBridge.setHeaderShown(false);
|
||||||
|
|||||||
@@ -30,9 +30,9 @@
|
|||||||
<p>{{ element.config.prompt_right }}</p>
|
<p>{{ element.config.prompt_right }}</p>
|
||||||
</div>
|
</div>
|
||||||
<RateCharacter
|
<RateCharacter
|
||||||
|
v-model:model="value"
|
||||||
:config="element.config"
|
:config="element.config"
|
||||||
:index="optionIndex"
|
:index="optionIndex"
|
||||||
v-model:model="value"
|
|
||||||
@change="handleRateChange"
|
@change="handleRateChange"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { showFailToast } from 'vant';
|
|||||||
const contentShow = ref(false);
|
const contentShow = ref(false);
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async() => {
|
||||||
if (utils.getSessionStorage('xToken')) {
|
if (utils.getSessionStorage('xToken')) {
|
||||||
const appToken = utils.getSessionStorage('xToken');
|
const appToken = utils.getSessionStorage('xToken');
|
||||||
getUserInfo(appToken)
|
getUserInfo(appToken)
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ import endPng from '@/assets/img/publish/end.png';
|
|||||||
const survey = ref({
|
const survey = ref({
|
||||||
project_name: ''
|
project_name: ''
|
||||||
});
|
});
|
||||||
const fetchSurveys = async () => {
|
const fetchSurveys = async() => {
|
||||||
const params = {
|
const params = {
|
||||||
page: 1,
|
page: 1,
|
||||||
per_page: 10,
|
per_page: 10,
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ const onLoad = () => {
|
|||||||
fetchSurveys();
|
fetchSurveys();
|
||||||
}, 500);
|
}, 500);
|
||||||
};
|
};
|
||||||
const fetchSurveys = async () => {
|
const fetchSurveys = async() => {
|
||||||
const params = {
|
const params = {
|
||||||
page: form.value.page,
|
page: form.value.page,
|
||||||
per_page: form.value.pageSize,
|
per_page: form.value.pageSize,
|
||||||
@@ -172,7 +172,7 @@ const deleteItem = (item) => {
|
|||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
confirmButtonColor: '#03B03C'
|
confirmButtonColor: '#03B03C'
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async() => {
|
||||||
const res = await deleteSurveys(item.sn);
|
const res = await deleteSurveys(item.sn);
|
||||||
if (res.data.message) {
|
if (res.data.message) {
|
||||||
showToast(res.data.message);
|
showToast(res.data.message);
|
||||||
@@ -196,7 +196,7 @@ const copyItem = (item) => {
|
|||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
confirmButtonColor: '#03B03C'
|
confirmButtonColor: '#03B03C'
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async() => {
|
||||||
const res = await copySurveys(item.sn);
|
const res = await copySurveys(item.sn);
|
||||||
if (res.data.code === 200 || res.data.code === 201) {
|
if (res.data.code === 200 || res.data.code === 201) {
|
||||||
showSuccessToast('复制成功');
|
showSuccessToast('复制成功');
|
||||||
@@ -237,7 +237,7 @@ const editItem = (item) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 保存为模板
|
// 保存为模板
|
||||||
const saveTemplate = async (item) => {
|
const saveTemplate = async(item) => {
|
||||||
const data = JSON.parse(JSON.stringify(item));
|
const data = JSON.parse(JSON.stringify(item));
|
||||||
const res = await saveTemplates(item.sn, data);
|
const res = await saveTemplates(item.sn, data);
|
||||||
if (res.data.code === 200 || res.data.code === 201) {
|
if (res.data.code === 200 || res.data.code === 201) {
|
||||||
|
|||||||
@@ -271,8 +271,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell-group
|
<van-cell-group
|
||||||
:border="false"
|
|
||||||
v-if="questionInfo.survey.is_ip_number === 1"
|
v-if="questionInfo.survey.is_ip_number === 1"
|
||||||
|
:border="false"
|
||||||
class="child-group"
|
class="child-group"
|
||||||
>
|
>
|
||||||
<van-field
|
<van-field
|
||||||
@@ -579,7 +579,7 @@ const previewQuestion = () => {
|
|||||||
router.push({ name: 'preview', query: { ...route.query } });
|
router.push({ name: 'preview', query: { ...route.query } });
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async() => {
|
||||||
await getQuestionDetail();
|
await getQuestionDetail();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -795,6 +795,7 @@ onMounted(async () => {
|
|||||||
:deep(.van-cell) {
|
:deep(.van-cell) {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.survey-action {
|
.survey-action {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user