From 8de56bd07c5a6804358e41b174019b1f1dc57b4a Mon Sep 17 00:00:00 2001 From: QDKF Date: Wed, 17 Sep 2025 22:41:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AF=81=E4=B9=A6=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=87=E6=BB=A4=E5=8A=A8=E7=94=BB=EF=BC=8C?= =?UTF-8?q?=E7=A9=BA=E7=8A=B6=E6=80=81=E6=A0=B7=E5=BC=8F=EF=BC=8C=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pnpm-lock.yaml | 26 ++ .../teacher/certificate/CertificateDetail.vue | 164 +++++++++-- .../certificate/CertificateManagement.vue | 276 ++++++++++++++++-- 3 files changed, 410 insertions(+), 56 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4cd483b..c6f6841 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@types/sortablejs': + specifier: ^1.15.8 + version: 1.15.8 '@vicons/ionicons5': specifier: ^0.13.0 version: 0.13.0 @@ -59,6 +62,9 @@ importers: vue-router: specifier: ^4.5.1 version: 4.5.1(vue@3.5.18(typescript@5.9.2)) + vuedraggable: + specifier: ^4.1.0 + version: 4.1.0(vue@3.5.18(typescript@5.9.2)) devDependencies: '@types/dplayer': specifier: ^1.25.5 @@ -589,6 +595,9 @@ packages: '@types/node@24.2.1': resolution: {integrity: sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ==} + '@types/sortablejs@1.15.8': + resolution: {integrity: sha512-b79830lW+RZfwaztgs1aVPgbasJ8e7AXtZYHTELNXZPsERt4ymJdjV4OccDbHQAvHrCcFpbF78jkm0R6h/pZVg==} + '@uppy/companion-client@2.2.2': resolution: {integrity: sha512-5mTp2iq97/mYSisMaBtFRry6PTgZA6SIL7LePteOV5x0/DxKfrZW3DEiQERJmYpHzy7k8johpm2gHnEKto56Og==} @@ -1451,6 +1460,9 @@ packages: resolution: {integrity: sha512-ig5qOnCDbugFntKi6c7Xlib8bA6xiJVk8O+WdFrV3wxbMqeHO0hXFQC4nAhPVWfZfi8255lcZkNhtIBINCc4+Q==} engines: {node: '>=12.17.0'} + sortablejs@1.14.0: + resolution: {integrity: sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==} + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -1644,6 +1656,11 @@ packages: typescript: optional: true + vuedraggable@4.1.0: + resolution: {integrity: sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==} + peerDependencies: + vue: ^3.0.1 + vueuc@0.4.64: resolution: {integrity: sha512-wlJQj7fIwKK2pOEoOq4Aro8JdPOGpX8aWQhV8YkTW9OgWD2uj2O8ANzvSsIGjx7LTOc7QbS7sXdxHi6XvRnHPA==} peerDependencies: @@ -2085,6 +2102,8 @@ snapshots: dependencies: undici-types: 7.10.0 + '@types/sortablejs@1.15.8': {} + '@uppy/companion-client@2.2.2': dependencies: '@uppy/utils': 4.1.3 @@ -3077,6 +3096,8 @@ snapshots: snabbdom@3.6.2: {} + sortablejs@1.14.0: {} + source-map-js@1.2.1: {} speakingurl@14.0.1: {} @@ -3242,6 +3263,11 @@ snapshots: optionalDependencies: typescript: 5.9.2 + vuedraggable@4.1.0(vue@3.5.18(typescript@5.9.2)): + dependencies: + sortablejs: 1.14.0 + vue: 3.5.18(typescript@5.9.2) + vueuc@0.4.64(vue@3.5.18(typescript@5.9.2)): dependencies: '@css-render/vue3-ssr': 0.15.14(vue@3.5.18(typescript@5.9.2)) diff --git a/src/views/teacher/certificate/CertificateDetail.vue b/src/views/teacher/certificate/CertificateDetail.vue index 8161922..36e0e1a 100644 --- a/src/views/teacher/certificate/CertificateDetail.vue +++ b/src/views/teacher/certificate/CertificateDetail.vue @@ -8,7 +8,7 @@
- +

证书信息

@@ -30,7 +30,7 @@
- +
-
- -
- -
+ +
+

未找到相关记录

+

没有找到包含"{{ searchKeyword }}"的颁发记录,请尝试其他关键词

+ +
+ + +
+

暂无颁发记录

+

还没有颁发任何证书,点击"颁发证书"开始颁发

+ +
+ + +
+ + + +
- + @@ -164,6 +172,15 @@ const issuanceRecords = ref([ // 模态框状态 const showIssuanceModal = ref(false) +// 搜索关键词 +const searchKeyword = ref('') + +// 筛选条件 +const selectedClass = ref('') + +// 强制重新渲染的key +const listKey = ref(0) + // 表格列定义 const columns = [ { @@ -285,6 +302,25 @@ const handleDelete = (record: IssuanceRecord) => { message.success('删除成功') } +// 清除搜索 +const clearSearch = () => { + searchKeyword.value = '' + message.info('已清除搜索条件') +} + +// 处理搜索输入 +const handleSearchInput = () => { + // 搜索输入时触发过滤动画 + listKey.value++ +} + +// 处理筛选变化 +const handleFilterChange = () => { + // 筛选变化时触发过滤动画 + listKey.value++ + message.info('筛选条件已更新') +} + // 处理颁发确认 const handleIssuanceConfirm = (selectedExams: any[]) => { console.log('选中的考试/学习项目:', selectedExams) @@ -578,7 +614,7 @@ const handleIssuanceConfirm = (selectedExams: any[]) => { .certificate-detail { flex-direction: column; } - + .left-section { max-width: none; } @@ -590,22 +626,100 @@ const handleIssuanceConfirm = (selectedExams: any[]) => { gap: 15px; align-items: flex-start; } - + .toolbar-actions { flex-wrap: wrap; gap: 8px; } - + .search-box input { width: 150px; } - + .record-table { font-size: 12px; } - - th, td { + + th, + td { padding: 8px 4px; } } + +/* ========== 过滤动画效果 ========== */ + +/* 表格过渡动画 */ +.table-fade-enter-active, +.table-fade-leave-active { + transition: all 0.3s ease; +} + +.table-fade-enter-from { + opacity: 0; + transform: translateY(20px); +} + +.table-fade-leave-to { + opacity: 0; + transform: translateY(-20px); +} + +.table-fade-move { + transition: transform 0.3s ease; +} + +/* ========== 空状态样式 ========== */ + +.empty-state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 300px; + background: #fff; + margin: 20px; + border-radius: 8px; + text-align: center; + padding: 40px 20px; +} + + +.empty-state h3 { + color: #333; + font-size: 18px; + margin: 0 0 12px 0; + font-weight: 500; +} + +.empty-state p { + color: #666; + font-size: 14px; + margin: 0 0 20px 0; + line-height: 1.5; + max-width: 280px; +} + +.empty-state .btn { + padding: 8px 20px; + font-size: 14px; +} + +/* 搜索空状态样式 */ +.search-empty h3 { + color: #666; +} + +.search-empty p { + color: #999; +} + +.btn-secondary { + background: #f5f5f5; + color: #666; +} + +.btn-secondary:hover { + background: #e6e6e6; + border-color: #bfbfbf; +} \ No newline at end of file diff --git a/src/views/teacher/certificate/CertificateManagement.vue b/src/views/teacher/certificate/CertificateManagement.vue index 04ce9c6..e131d12 100644 --- a/src/views/teacher/certificate/CertificateManagement.vue +++ b/src/views/teacher/certificate/CertificateManagement.vue @@ -6,7 +6,7 @@
- @@ -14,44 +14,79 @@
+
- -
-
-
- + +
+
+

搜索中...

+
-
-
-
{{ certificate.name }}
-
证书分类: {{ certificate.category }}
-
-
- -
- - - @@ -103,7 +138,7 @@