From 46e3f7c548f596deb46eee8dd0a368abf65fd424 Mon Sep 17 00:00:00 2001 From: zyronon Date: Thu, 6 Jun 2024 22:30:11 +0800 Subject: [PATCH] save --- components.d.ts | 2 - src/assets/css/style.scss | 2 +- src/pages/pc/word/EditWordDict.vue | 164 ++++++++++++++++++++++------- src/pages/test/test.vue | 44 +++++++- src/router.ts | 2 +- 5 files changed, 167 insertions(+), 47 deletions(-) diff --git a/components.d.ts b/components.d.ts index 40b4d3ff..08997e38 100644 --- a/components.d.ts +++ b/components.d.ts @@ -26,8 +26,6 @@ declare module 'vue' { ElSelect: typeof import('element-plus/es')['ElSelect'] ElSlider: typeof import('element-plus/es')['ElSlider'] ElSwitch: typeof import('element-plus/es')['ElSwitch'] - ElTable: typeof import('element-plus/es')['ElTable'] - ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTableV2: typeof import('element-plus/es')['ElTableV2'] Empty: typeof import('./src/components/Empty.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/src/assets/css/style.scss b/src/assets/css/style.scss index ad58716e..1e2a7a38 100644 --- a/src/assets/css/style.scss +++ b/src/assets/css/style.scss @@ -156,7 +156,7 @@ html, body { z-index: 1; height: 100%; width: 100%; - font-size: 14rem; + font-size: .9rem; display: flex; flex-direction: column; } diff --git a/src/pages/pc/word/EditWordDict.vue b/src/pages/pc/word/EditWordDict.vue index 67be5523..e6380e50 100644 --- a/src/pages/pc/word/EditWordDict.vue +++ b/src/pages/pc/word/EditWordDict.vue @@ -1,7 +1,7 @@ - @@ -244,14 +263,79 @@ const columns = [ - - +
+
+
+
+
+ + +
+ 列表循环设置 +
+
+ 翻转 + 随机 +
+
+
+ +
+
+
+
+ + 全选 +
+
{{ checkedTotal }}/{{ list.length }}
+
+
+
+ + + + + +
+
diff --git a/src/pages/test/test.vue b/src/pages/test/test.vue index b843cd83..50e7fb8e 100644 --- a/src/pages/test/test.vue +++ b/src/pages/test/test.vue @@ -48,6 +48,37 @@ async function check() { console.log('data',data) // this.setState(data) } + + +const generateColumns = (length = 10, prefix = 'column-', props?: any) => + Array.from({ length }).map((_, columnIndex) => ({ + ...props, + key: `${prefix}${columnIndex}`, + dataKey: `${prefix}${columnIndex}`, + title: `Column ${columnIndex}`, + width: 150, + })) + +const generateData = ( + columns: ReturnType, + length = 200, + prefix = 'row-' +) => + Array.from({ length }).map((_, rowIndex) => { + return columns.reduce( + (rowData, column, columnIndex) => { + rowData[column.dataKey] = `Row ${rowIndex} - Col ${columnIndex}` + return rowData + }, + { + id: `${prefix}${rowIndex}`, + parentId: null, + } + ) + }) + +const columns = generateColumns(10) +const data1 = generateData(columns, 1000) @@ -65,14 +103,14 @@ async function check() { .page { position: relative; z-index: 1; - font-size: 14rem; + font-size: 1rem; color: black; .data{ display: flex; flex-direction: column; - gap: 10rem; - width: 300rem; + gap: 1rem; + width: 30rem; } } \ No newline at end of file diff --git a/src/router.ts b/src/router.ts index ac1c1e3f..28cc87af 100644 --- a/src/router.ts +++ b/src/router.ts @@ -52,7 +52,7 @@ export const routes: RouteRecordRaw[] = [ // {path: '/mobile/simple', component: SimplePage}, // {path: '/mobile/about', component: About}, // {path: '/mobile/feedback', component: Feedback}, - // {path: '/test', component: Test}, + {path: '/test', component: Test}, // {path: '/', redirect: '/pc/practice'}, ]