林旭祥 8 miesięcy temu
rodzic
commit
887fc140ff

+ 10 - 3
src/components/ChooseStudent/index.vue

@@ -24,7 +24,8 @@
           </div>
           <div class="tableBox">
             <el-table ref="myTable" :data="tableData" class="table" :class="{ 'table2': props.selectType == 'single' }"
-              @cell-click="handleCellClickChange" @row-dblclick="handleDblclick" highlight-current-row>
+              @cell-click="handleCellClickChange" @row-dblclick="handleDblclick" @select-all="handleSelectAll"
+              highlight-current-row>
               <el-table-column type="selection" width="55" v-if="props.selectType == 'multiple'" />
               <el-table-column label="头像" width="120">
                 <template #default="scope">
@@ -212,6 +213,11 @@ const handleCellClickChange = (data: any) => {
   }
 };
 
+//全选操作
+const handleSelectAll = (data: any) => {
+  selectValue.value = data;
+};
+
 //多选行
 const handleSelectionChange = (data: any) => {
   selectValue.value = data;
@@ -416,8 +422,9 @@ defineExpose({
               overflow: hidden;
               box-sizing: border-box;
               border: 1px solid rgba(255, 255, 255, 0.5);
-              margin-bottom: 5px;
-              font-size:12px;
+              margin: 0 auto 5px auto;
+              font-size: 12px;
+
               img {
                 width: 100%;
               }

+ 8 - 0
src/types/auto-imports.d.ts

@@ -296,6 +296,10 @@ declare module 'vue' {
   interface GlobalComponents {}
   interface ComponentCustomProperties {
     readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
+    readonly ElLoading: UnwrapRef<typeof import('element-plus/es')['ElLoading']>
+    readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
+    readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
+    readonly ElNotification: UnwrapRef<typeof import('element-plus/es')['ElNotification']>
     readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
     readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
     readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
@@ -575,6 +579,10 @@ declare module '@vue/runtime-core' {
   interface GlobalComponents {}
   interface ComponentCustomProperties {
     readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
+    readonly ElLoading: UnwrapRef<typeof import('element-plus/es')['ElLoading']>
+    readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
+    readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
+    readonly ElNotification: UnwrapRef<typeof import('element-plus/es')['ElNotification']>
     readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
     readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
     readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>