代码格式优化,去除多余的引入

This commit is contained in:
田岩
2025-09-01 10:54:27 +08:00
parent 828186c1d4
commit 4eebd75345
36 changed files with 100 additions and 250 deletions
+5 -17
View File
@@ -17,19 +17,14 @@
</template>
<script setup>
import { ref, reactive, nextTick, onMounted } from 'vue';
import { ref, reactive} from 'vue';
import { queryTraExamPapersPage } from '@/api/testingHall.js';
import { queryTraCrsBbsInfoByCrsId } from '@/api/courseDetail.js';
import itemVue from './content-item.vue';
const status = ref('loadmore'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
const limit = 20;
const total = ref(-1);
const page = ref(0);
const data_list = reactive([]);
const triggered = ref(false);
const _freshing = ref(false);
const offset = ref(0);
const scrollRef = ref(null);
const props = defineProps({
index: {
@@ -37,16 +32,9 @@
default: 0
}
});
const onRefresh = () => {
if (_freshing.value) return;
_freshing.value = true;
setTimeout(() => {
triggered.value = false;
_freshing.value = false;
}, 1000);
};
const getData = (from = '', searchText = '') => {
if (from == 'first') {
if (from === 'first') {
if (total.value !== -1) return;
status.value = 'loading';
total.value = -1;
@@ -64,9 +52,9 @@
page: page.value,
limit: limit
};
if (props.index == 1) {
if (props.index === 1) {
params.examStat = 'Y';
} else if (props.index == 2) {
} else if (props.index === 2) {
params.examStat = 'N';
}
queryTraExamPapersPage(params)