Changpeng Duan 5 lat temu
rodzic
commit
b1b3e1d695
4 zmienionych plików z 51 dodań i 21 usunięć
  1. 4 1
      pc/src/main.js
  2. 37 17
      pc/src/views/courseEdit.vue
  3. 3 3
      pc/src/views/online.vue
  4. 7 0
      pc/vue.config.js

+ 4 - 1
pc/src/main.js

@@ -14,15 +14,18 @@ Vue.use(VCharts);
 Vue.use(ElementUI);
 
 let headBpi = 'http://cal.beswell.com:85/';
+let headCpi = "http://cal.beswell.com:85/DataTransfer/";
 if (process.env.NODE_ENV === 'development') {
     // 显示控制台
     // let vConsole = new VConsole();
     // 演示版本数据
     // require('./Mock/index.js');
     headBpi = '/bpi/';
+    headCpi = '/cpi/';
 } else {
     // let vConsole = new VConsole();
-    headBpi = 'http://cal.beswell.com:85/'
+    headBpi = 'http://cal.beswell.com:85/';
+    headCpi = "http://cal.beswell.com:85/DataTransfer/";
 }
 
 // 演示版本数据

+ 37 - 17
pc/src/views/courseEdit.vue

@@ -50,6 +50,7 @@
                     class=""
                     :row-class-name="tableRowClassName"
                     @selection-change="handleSelectionChange"
+                    ref="multipleTable"
             >
                 >
                 <el-table-column
@@ -166,7 +167,7 @@
                             <el-select v-model="scope.row.BindId"
                                        @change="bindSensorToUser(scope.row)"
                                        @focus="getSelectHrSensors(scope.row)"
-                                       :disabled="scope.row.isOnline == 1"
+                                       :disabled="scope.row.IsOnline == 1"
                                        filterable
                                        v-if="!scope.row.BindId" placeholder="请选心率带">
                                 <el-option
@@ -186,7 +187,7 @@
                             </el-select>
                             <el-button @click="takeBack(scope.row)" :type="scope.row.IsPrivate == 1 ?'primary':'danger'"
                                        v-if="scope.row.BindId"
-                                       :disabled="scope.row.isOnline == 1"
+                                       :disabled="scope.row.IsOnline == 1"
                                        icon="el-icon-cpu">
                                 {{ scope.row.Sn }} {{scope.row.IsPrivate == 1 ? '私有':''}}
                                 设备收回
@@ -197,7 +198,7 @@
                             <el-select v-model="scope.row.BindId"
                                        @change="bindSensorToTmepUser(scope.row)"
                                        @focus="getSelectHrSensors(scope.row)"
-                                       :disabled="scope.row.isOnline == 1"
+                                       :disabled="scope.row.IsOnline == 1"
                                        filterable
                                        v-if="!scope.row.Sn" placeholder="请选心率带">
                                 <el-option
@@ -208,7 +209,7 @@
                                 </el-option>
                             </el-select>
                             <el-button @click="takeTempBack(scope.row)" type="danger" v-if="scope.row.Sn"
-                                       :disabled="scope.row.isOnline == 1"
+                                       :disabled="scope.row.IsOnline == 1"
                                        icon="el-icon-cpu">
                                 {{ scope.row.Sn }}
                                 临时设备收回
@@ -217,16 +218,20 @@
                     </template>
                 </el-table-column>
                 <el-table-column
-                        prop="isOnline"
+                        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">
+                        <div v-if=" scope.row.HrSubmitFlag != 1">
+                            <el-checkbox label="网课" v-model="scope.row.IsOnline" name="type"
+                                         @change="showOrDiss(scope.row)"></el-checkbox>
+                        </div>
+                        <div v-if="scope.row.IsOnline == 1 && scope.row.HrSubmitFlag == 1">
+                            网课学员
+                        </div>
+                    </template>
                 </el-table-column>
                 <el-table-column
                         prop="Status"
@@ -527,10 +532,10 @@
             handleSelectionChange(val) {
                 let row = '';
                 for (let t in this.tableData) {
-                    this.tableData[t].isOnline = 0;
+                    this.tableData[t].IsOnline = 0;
                 }
                 for (let v in val) {
-                    val[v].isOnline = 1;
+                    val[v].IsOnline = 1;
                 }
             },
             // 请选心率带
@@ -574,6 +579,18 @@
                     }
                 })
             },
+            toggleSelection(rows) {
+                // if(rows.IsOnline == 1){
+                //     // 网课学生状态置入
+                //
+                // }
+                if (rows) {
+                    rows.forEach(row => {
+                        console.log(row);
+                        this.$refs.multipleTable.toggleRowSelection(1);
+                    });
+                }
+            },
             // 临时会员绑定心率带
             bindSensorToTmepUser(row) {
                 let that = this;
@@ -774,8 +791,8 @@
                 let that = this;
                 // 没绑心率带不能开课,预约未到的不管他
                 for (var i = 0; i < this.tableData.length; i++) {
-                    console.log(this.tableData[i].isOnline);
-                    if (this.tableData[i].Sn == 0 && this.tableData[i].Status != 2 && this.tableData[i].isOnline != 1) {
+                    console.log(this.tableData[i].IsOnline);
+                    if (this.tableData[i].Sn == 0 && this.tableData[i].Status != 2 && this.tableData[i].IsOnline != 1) {
                         that.$message.error("会员" + this.tableData[i].Name + '没绑心率带,不能开课');
                         return false
                     }
@@ -822,7 +839,7 @@
                         birthday: row.Birthday,
                         is_tmp_user: row.IsTmpUser,
                         is_private: row.IsPrivate,
-                        isOnline: row.isOnline,
+                        IsOnline: row.IsOnline,
                     }
                 }
                 // 确认上课
@@ -1287,6 +1304,8 @@
                                     }
                                 });
                             }
+
+
                             that.allTableData = json.Rs;
                             that.recordsTotal = json.Rs.length;
                         } else {
@@ -1404,7 +1423,8 @@
             getClassDetailAndSnAdd(row) {
                 let begin_time = parseInt(new Date().valueOf() / 1000);
                 let duRs = [];
-                if (!row.Sn && row.isOnline == 0) {
+                console.log(row);
+                if (!row.Sn && !row.IsOnline) {
                     this.$message.error(row.Name + '没有绑定心率带');
                     return false
                 }
@@ -1425,7 +1445,7 @@
                     birthday: row.Birthday,
                     is_tmp_user: row.IsTmpUser,
                     is_private: row.IsPrivate,
-                    isOnline: row.isOnline,
+                    isOnline: row.IsOnline ? 1 : 0,
                 };
                 duRs = '{"Rs":' + JSON.stringify(duRs).toString() + '}';
                 let that = this;

+ 3 - 3
pc/src/views/online.vue

@@ -16,7 +16,6 @@
                             :value="item.SvId">
                     </el-option>
                 </el-select>
-
             </div>
 
             <el-button @click="full_screen" v-if="!screen_full" icon="el-icon-full-screen" type="primary">全屏</el-button>
@@ -142,7 +141,7 @@
                     offline: 0,
                     time: '00:00:00',
                 },
-                VenueId: 0,//所选区域
+                VenueId: '',//所选区域
                 classState: 0,//0 下课 1上课
                 students: [],
                 VenueOption: [],
@@ -276,8 +275,9 @@
                     if (json.Code == 0) {
                         that.loading = false;
                         if (json.Rs) {
-                            that.EqSn = json.Rs.EqSn;
+                            that.EqSn = json.Rs[0].EqSn;
                         } else {
+                            that.$message.error('当前区域没有设置显示设备');
                             that.EqSn = '';
                         }
                     } else {

+ 7 - 0
pc/vue.config.js

@@ -16,6 +16,13 @@ module.exports = {
                 pathRewrite: {
                     '^/bpi': '',
                 }
+            },
+            '/cbi':{
+                target: 'http://192.168.0.62:9010/',
+                changeOrigin: true,
+                pathRewrite: {
+                    '^/cbi': '',
+                }
             }
         }
     },