Bladeren bron

课程管理网课加人

Changpeng Duan 4 jaren geleden
bovenliggende
commit
428df31209
1 gewijzigde bestanden met toevoegingen van 26 en 7 verwijderingen
  1. 26 7
      pc/src/views/courseEdit.vue

+ 26 - 7
pc/src/views/courseEdit.vue

@@ -49,6 +49,7 @@
                     element-loading-background="rgba(0, 0, 0, 0.8)"
                     class=""
                     :row-class-name="tableRowClassName"
+                    @selection-change="handleSelectionChange"
             >
                 >
                 <el-table-column
@@ -196,6 +197,7 @@
                             <el-select v-model="scope.row.BindId"
                                        @change="bindSensorToTmepUser(scope.row)"
                                        @focus="getSelectHrSensors(scope.row)"
+                                       :disabled="scope.row.isOnline == 1"
                                        filterable
                                        v-if="!scope.row.Sn" placeholder="请选心率带">
                                 <el-option
@@ -207,6 +209,7 @@
                             </el-select>
 
                             <el-button @click="takeTempBack(scope.row)" type="danger" v-if="scope.row.Sn"
+                                       :disabled="scope.row.isOnline == 1"
                                        icon="el-icon-cpu">
                                 {{ scope.row.Sn }}
                                 临时设备收回
@@ -217,13 +220,14 @@
                 <el-table-column
                         prop="isOnline"
                         label="是否网课"
+                        type="selection"
                         width="120"
                         sortable
                 >
-                    <template slot-scope="scope">
-                        <el-checkbox label="网课" v-model="scope.row.isOnline" name="type"
-                                     @change="showOrDiss(scope.row)"></el-checkbox>
-                    </template>
+                    <!--<template slot-scope="scope">-->
+                    <!--<el-checkbox label="网课" v-model="scope.row.isOnline" name="type"-->
+                    <!--@change="showOrDiss(scope.row)"></el-checkbox>-->
+                    <!--</template>-->
                 </el-table-column>
                 <el-table-column
                         prop="Status"
@@ -271,7 +275,6 @@
                                        @click="getClassOverTempDel(scope.row)">
                                 删除
                             </el-button>
-                            &nbsp;
                             <span v-if="FinishClass != 3 && scope.row.IsTmpUser == 1">
                                 <el-button type="warning" round
                                            v-if="scope.row.Status == 1 || scope.row.Status == 3 && FinishClass == 2 "
@@ -516,13 +519,22 @@
         methods: {
             // 禁用或启用绑定心率带
             showOrDiss(row) {
-                console.log(row);
+                // console.log(row);
                 // if (row.isOnline == 1) {
                 //     row.isOnline = 0
                 // } else {
                 //     row.isOnline = 1
                 // }
             },
+            handleSelectionChange(val) {
+                let row = '';
+                for (let t in this.tableData) {
+                    this.tableData[t].isOnline = 0;
+                }
+                for (let v in val) {
+                    val[v].isOnline = 1;
+                }
+            },
             // 请选心率带
             bindSensorToUser(row) {
                 let that = this;
@@ -1475,7 +1487,6 @@
             },
             PkNum(to) {
                 let that = this;
-                console.log(to);
                 if (to == 2) {
                     that.panel.groupList = [
                         {label: '红队', value: 1},
@@ -1603,4 +1614,12 @@
     /*/deep/ .el-table .yellow-row {*/
     /*background: #fbe56e;*/
     /*}*/
+
+    /deep/ .el-table__header .el-table-column--selection .cell .el-checkbox:after {
+        content: " 是否网课";
+    }
+
+    /deep/ .el-table__body-wrapper .el-table-column--selection .cell .el-checkbox:after {
+        content: " 网课";
+    }
 </style>