소스 검색

feat(认知任务): 更新页面名称、优化广度训练的TS类型

JutarryWu 6 달 전
부모
커밋
f36c02e85c
3개의 변경된 파일19개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 1
      src/App.vue
  2. 9 0
      src/components.d.ts
  3. 9 5
      src/pages/cognitiveTasks/BreadthTraining/index.vue

+ 1 - 1
src/App.vue

@@ -6,7 +6,7 @@ import useRouteTransitionNameStore from '@/stores/modules/routeTransitionName'
 import useAutoThemeSwitcher from '@/hooks/useAutoThemeSwitcher'
 
 useHead({
-  title: 'Vue3 Vant Mobile',
+  title: '失眠训练系统',
   meta: [
     {
       name: 'description',

+ 9 - 0
src/components.d.ts

@@ -17,9 +17,18 @@ declare module 'vue' {
     SvgIcon: typeof import('./components/SvgIcon.vue')['default']
     TabBar: typeof import('./components/TabBar.vue')['default']
     VanButton: typeof import('vant/es')['Button']
+    VanCell: typeof import('vant/es')['Cell']
+    VanCellGroup: typeof import('vant/es')['CellGroup']
     VanConfigProvider: typeof import('vant/es')['ConfigProvider']
+    VanEmpty: typeof import('vant/es')['Empty']
+    VanIcon: typeof import('vant/es')['Icon']
     VanImage: typeof import('vant/es')['Image']
     VanNavBar: typeof import('vant/es')['NavBar']
+    VanPicker: typeof import('vant/es')['Picker']
+    VanPopup: typeof import('vant/es')['Popup']
+    VanSpace: typeof import('vant/es')['Space']
+    VanStepper: typeof import('vant/es')['Stepper']
+    VanSwitch: typeof import('vant/es')['Switch']
     VanTabbar: typeof import('vant/es')['Tabbar']
     VanTabbarItem: typeof import('vant/es')['TabbarItem']
     VoiceImp: typeof import('./components/VoiceImp/index.vue')['default']

+ 9 - 5
src/pages/cognitiveTasks/BreadthTraining/index.vue

@@ -17,6 +17,12 @@ interface IMainData {
   dataList: any[]
 }
 
+interface IMainChildData {
+  count?: number
+  score?: number
+  extraScore?: number
+}
+
 const subjectInfo = ref({
   name: '广度训练',
 })
@@ -44,9 +50,7 @@ const selectiveIndex = ref(-1) // 选择的索引
  */
 function generateBaseData() {
   // 生成选项组
-  const selectDataList: number[][] = [
-    // [3, 4, 5, 6, 7], [3, 4, 5, 6, 7], ...,
-    // [4, 5, 6, 7, 8], [4, 5, 6, 7, 8], ...,
+  const selectDataList = [
     ...Array.from({ length: 10 }).fill([3, 4, 5, 6, 7]),
     ...Array.from({ length: 10 }).fill([4, 5, 6, 7, 8]),
     ...Array.from({ length: 10 }).fill([5, 6, 7, 8, 9]),
@@ -56,7 +60,7 @@ function generateBaseData() {
     ...Array.from({ length: 10 }).fill([9, 10, 11, 12, 13]),
     ...Array.from({ length: 10 }).fill([10, 11, 12, 13, 14]),
   ]
-  selectArray = selectDataList.map((item) => {
+  selectArray = selectDataList.map((item: number[]) => {
     return shuffle(item)
   })
 
@@ -74,7 +78,7 @@ function generateBaseData() {
     ...Array.from({ length: 10 }).fill({ count: 12, score: 80, extraScore: 0 }),
   ]
 
-  mainData.dataList = baseDataList.map((item, index) => {
+  mainData.dataList = baseDataList.map((item: IMainChildData, index) => {
     return {
       index,
       ...item,