Przeglądaj źródła

1.修复答题显示问题

jzp 13 godzin temu
rodzic
commit
2ce9f11019

+ 8 - 0
src/api/live/live.js

@@ -139,3 +139,11 @@ export function generateCode(data) {
     params: data
     params: data
   })
   })
 }
 }
+
+export function createAppLink(data) {
+    return request({
+        url: '/live/live/createAppLink',
+        method: 'get',
+        params: data
+    })
+}

+ 20 - 11
src/views/course/courseWatchLog/deptWatchLog.vue

@@ -414,13 +414,14 @@
         </el-table-column>
         </el-table-column>
         <el-table-column label="课程名称" align="center" prop="courseName"/>
         <el-table-column label="课程名称" align="center" prop="courseName"/>
         <el-table-column label="小节名称" align="center" prop="videoName"/>
         <el-table-column label="小节名称" align="center" prop="videoName"/>
-        <el-table-column label="是否全部正确" align="center" prop="isRightText"/>
+        <el-table-column label="是否全部正确" align="center" prop="isRight">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <dict-tag :options="sysCompanyOr" :value="scope.row.isRight" style="margin-bottom: 5px;"></dict-tag>
           <dict-tag :options="sysCompanyOr" :value="scope.row.isRight" style="margin-bottom: 5px;"></dict-tag>
-          <el-button type="text" size="mini" @click="showContentDialog(scope.row.questionJson)">
+          <el-button type="text" size="mini" @click="showContentDialog(scope.row)">
             查看详情
             查看详情
           </el-button>
           </el-button>
         </template>
         </template>
+          </el-table-column>
         <el-table-column label="销售名称" align="center" prop="companyUserName"/>
         <el-table-column label="销售名称" align="center" prop="companyUserName"/>
         <el-table-column label="企微员工名称" align="center" prop="qwUserName"/>
         <el-table-column label="企微员工名称" align="center" prop="qwUserName"/>
         <el-table-column label="公司名称" align="center" prop="companyName"/>
         <el-table-column label="公司名称" align="center" prop="companyName"/>
@@ -506,8 +507,8 @@
             <div>题目:<span style="color: #0464f4">{{item.title}}</span></div>
             <div>题目:<span style="color: #0464f4">{{item.title}}</span></div>
             <div>答题:<span style="color: #000000">{{item.answer}}</span></div>
             <div>答题:<span style="color: #000000">{{item.answer}}</span></div>
             <div>是否答题正确:
             <div>是否答题正确:
-              <span :style="{color: item.status === 1 ? 'green' : 'red'}">
-                {{ item.status === 1 ? '正确' : '错误' }}
+                <span :style="{color: contentDialog.isRight === 1 ? 'green' : 'red'}">
+                {{ contentDialog.isRight === 1 ? '正确' : '错误' }}
             </span>
             </span>
             </div>
             </div>
           </el-card>
           </el-card>
@@ -596,6 +597,7 @@ export default {
       //发送的消息
       //发送的消息
       contentDialog:{
       contentDialog:{
         isDialogVisible:false,
         isDialogVisible:false,
+          isRight:null,
         json: [],
         json: [],
       },
       },
 
 
@@ -619,6 +621,8 @@ export default {
       title: "",
       title: "",
       // 是否显示弹出层
       // 是否显示弹出层
       open: false,
       open: false,
+        //是否
+        sysCompanyOr:[],
 
 
       //答题记录
       //答题记录
       openAnswerLog: false,
       openAnswerLog: false,
@@ -717,6 +721,9 @@ export default {
     this.getDicts("sys_course_watch_log_type").then(response => {
     this.getDicts("sys_course_watch_log_type").then(response => {
       this.logTypeOptions = response.data;
       this.logTypeOptions = response.data;
     });
     });
+      this.getDicts("sys_company_or").then(response => {
+          this.sysCompanyOr = response.data;
+      });
 
 
     // 设置默认当天时间 xgb 防止频繁查询大量数据
     // 设置默认当天时间 xgb 防止频繁查询大量数据
     this.setToday();
     this.setToday();
@@ -731,13 +738,15 @@ export default {
               this.RewardType=res.rewardType;
               this.RewardType=res.rewardType;
           })
           })
       },
       },
-    showContentDialog(questionJson){
-      // 解析 JSON 字符串为 JavaScript 对象
-      // 替换非法换行符等控制字符
-      const sanitizedJson = questionJson.replace(/[\u0000-\u001F\u007F]/g, '');
-      this.contentDialog.json = JSON.parse(sanitizedJson);
-
-      this.contentDialog.isDialogVisible = true;
+    showContentDialog(row){
+        const questionJson = row.questionJson;
+        // 解析 JSON 字符串为 JavaScript 对象
+        // 替换非法换行符等控制字符
+        const sanitizedJson = questionJson.replace(/[\u0000-\u001F\u007F]/g, '');
+        this.contentDialog.json = JSON.parse(sanitizedJson);
+        this.contentDialog.isRight = row.isRight;
+
+        this.contentDialog.isDialogVisible = true;
     },
     },
 
 
 
 

+ 12 - 4
src/views/course/courseWatchLog/index.vue

@@ -495,7 +495,7 @@
         <el-table-column label="是否全部正确" align="center" prop="isRight">
         <el-table-column label="是否全部正确" align="center" prop="isRight">
           <template slot-scope="scope">
           <template slot-scope="scope">
             <dict-tag :options="sysCompanyOr" :value="scope.row.isRight" style="margin-bottom: 5px;"></dict-tag>
             <dict-tag :options="sysCompanyOr" :value="scope.row.isRight" style="margin-bottom: 5px;"></dict-tag>
-            <el-button type="text" size="mini" @click="showContentDialog(scope.row.questionJson)">
+            <el-button type="text" size="mini" @click="showContentDialog(scope.row)">
               查看详情
               查看详情
             </el-button>
             </el-button>
           </template>
           </template>
@@ -684,8 +684,8 @@
             <div>题目:<span style="color: #0464f4">{{item.title}}</span></div>
             <div>题目:<span style="color: #0464f4">{{item.title}}</span></div>
             <div>答题:<span style="color: #000000">{{item.answer}}</span></div>
             <div>答题:<span style="color: #000000">{{item.answer}}</span></div>
             <div>是否答题正确:
             <div>是否答题正确:
-              <span :style="{color: item.status === 1 ? 'green' : 'red'}">
-                {{ item.status === 1 ? '正确' : '错误' }}
+              <span :style="{color: contentDialog.isRight === 1 ? 'green' : 'red'}">
+                {{ contentDialog.isRight === 1 ? '正确' : '错误' }}
             </span>
             </span>
             </div>
             </div>
           </el-card>
           </el-card>
@@ -912,10 +912,13 @@ export default {
       // 表单校验
       // 表单校验
       rules: {
       rules: {
       },
       },
+    //是否
+    sysCompanyOr:[],
 
 
       //发送的消息
       //发送的消息
       contentDialog:{
       contentDialog:{
         isDialogVisible:false,
         isDialogVisible:false,
+          isRight:null,
         json: [],
         json: [],
       },
       },
 
 
@@ -953,6 +956,9 @@ export default {
     this.getDicts("sys_course_project").then(response => {
     this.getDicts("sys_course_project").then(response => {
       this.projectOptions = response.data;
       this.projectOptions = response.data;
     });
     });
+      this.getDicts("sys_company_or").then(response => {
+          this.sysCompanyOr = response.data;
+      });
     // 查询营期名称
     // 查询营期名称
     listPeriodLabel().then(response => {
     listPeriodLabel().then(response => {
       this.scheduleLists = response.rows;
       this.scheduleLists = response.rows;
@@ -973,11 +979,13 @@ export default {
           })
           })
       },
       },
 
 
-    showContentDialog(questionJson){
+    showContentDialog(row){
+        const questionJson = row.questionJson;
       // 解析 JSON 字符串为 JavaScript 对象
       // 解析 JSON 字符串为 JavaScript 对象
       // 替换非法换行符等控制字符
       // 替换非法换行符等控制字符
       const sanitizedJson = questionJson.replace(/[\u0000-\u001F\u007F]/g, '');
       const sanitizedJson = questionJson.replace(/[\u0000-\u001F\u007F]/g, '');
       this.contentDialog.json = JSON.parse(sanitizedJson);
       this.contentDialog.json = JSON.parse(sanitizedJson);
+        this.contentDialog.isRight = row.isRight;
 
 
       this.contentDialog.isDialogVisible = true;
       this.contentDialog.isDialogVisible = true;
     },
     },

+ 84 - 1
src/views/live/live/index.vue

@@ -246,6 +246,11 @@
               >
               >
                 <i class="el-icon-service"></i> 查看小程序链接
                 <i class="el-icon-service"></i> 查看小程序链接
               </el-dropdown-item>
               </el-dropdown-item>
+                <el-dropdown-item
+                    @click.native="handleAppLink(scope.row)"
+                >
+                    <i class="el-icon-service"></i> 查看App跳转链接
+                </el-dropdown-item>
               <el-dropdown-item
               <el-dropdown-item
                 v-if="scope.row.liveCodeUrl == null"
                 v-if="scope.row.liveCodeUrl == null"
                 @click.native="handleGenerateCode(scope.row)"
                 @click.native="handleGenerateCode(scope.row)"
@@ -422,6 +427,25 @@
     <el-button type="primary" @click="rtmpUrlVisible = false">确 定</el-button>
     <el-button type="primary" @click="rtmpUrlVisible = false">确 定</el-button>
   </span>
   </span>
     </el-dialog>
     </el-dialog>
+
+      <el-dialog title="选择销售公司" :visible.sync="statusDialog.open" width="500px" append-to-body>
+          <el-form ref="corpForm" :model="corpForm" :rules="corpIdRules" label-width="100px">
+              <el-form-item label="状态" prop="corpId">
+                  <el-select v-model="corpForm.corpId" placeholder="请选择销售公司" size="small">
+                      <el-option
+                          v-for="dict in myQwCompanyList"
+                          :key="dict.dictValue"
+                          :label="dict.dictLabel"
+                          :value="dict.dictValue"
+                      />
+                  </el-select>
+              </el-form-item>
+          </el-form>
+          <div slot="footer" class="dialog-footer">
+              <el-button @click="statusDialog.open = false">取 消</el-button>
+              <el-button type="primary" @click="submitCorpIdForm(corpForm)">提 交</el-button>
+          </div>
+      </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -437,18 +461,26 @@ import {
   handleShelfOrUn,
   handleShelfOrUn,
   handleDeleteSelected,
   handleDeleteSelected,
   finishLive,
   finishLive,
-  startLive, copyLive,generateCode
+  startLive, copyLive,generateCode,createAppLink
 } from "@/api/live/live";
 } from "@/api/live/live";
 import { exportLiveMsgComments } from "@/api/live/liveMsg";
 import { exportLiveMsgComments } from "@/api/live/liveMsg";
+import { getMyQwCompanyList} from "@/api/qw/user";
 import Editor from '@/components/Editor/wang';
 import Editor from '@/components/Editor/wang';
 import user from '@/store/modules/user';
 import user from '@/store/modules/user';
 import VideoUpload from "@/components/LiveVideoUpload/single.vue";
 import VideoUpload from "@/components/LiveVideoUpload/single.vue";
+import {listTag} from "@/api/qw/tag";
 
 
 export default {
 export default {
   name: "Live",
   name: "Live",
   components: { Editor,VideoUpload },
   components: { Editor,VideoUpload },
   data() {
   data() {
     return {
     return {
+        //公司列表
+      myQwCompanyList:[],
+        statusDialog: {
+            open: false,
+            title: "选择销售公司"
+        },
       liveTypeDictList: [],
       liveTypeDictList: [],
       // 是否只读
       // 是否只读
       isViewOnly:false,
       isViewOnly:false,
@@ -510,7 +542,17 @@ export default {
         fileName: null,
         fileName: null,
         fileSize: null,
         fileSize: null,
         lineOne: null,
         lineOne: null,
+
       },
       },
+        corpForm: {
+            liveId: null,
+            corpId:null,
+        },
+        corpIdRules: {
+            corpId: [
+                {required: true, message: '企微公司不能为空', trigger: 'change'}
+            ]
+        },
       // 表单校验
       // 表单校验
       rules: {
       rules: {
         liveName: [
         liveName: [
@@ -555,6 +597,19 @@ export default {
     this.getDicts("live_type").then((response) => {
     this.getDicts("live_type").then((response) => {
       this.liveTypeDictList = response.data;
       this.liveTypeDictList = response.data;
     });
     });
+      getMyQwCompanyList().then(response => {
+          this.myQwCompanyList = response.data;
+          if(this.myQwCompanyList!=null){
+              this.corpForm.corpId=this.myQwCompanyList[0].dictValue
+
+              var listTagFrom={corpId:this.corpForm.corpId}
+              listTag(listTagFrom).then(response => {
+                  this.tagList = response.rows;
+              });
+              this.getList();
+
+          }
+      });
   },
   },
   watch: {
   watch: {
     'form.startTime': {
     'form.startTime': {
@@ -613,6 +668,34 @@ export default {
         confirmButtonText: '确定',
         confirmButtonText: '确定',
       });
       });
     },
     },
+
+      handleAppLink(row){
+          this.corpForm = {
+              liveId: row.liveId,
+          };
+          this.statusDialog.open = true;
+      },
+
+      submitCorpIdForm(corpForm){
+          this.statusDialog.open = false;
+          this.$confirm('是否确认生成App跳转直播链接?', "警告", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+          }).then(() => {
+              createAppLink(corpForm).then(response=>{
+                  this.$alert(
+                      `<div style="white-space: pre-wrap; word-break: break-all;">${response.realLink}</div>`,
+                      'App 跳转直播链接',
+                      {
+                          confirmButtonText: '确定',
+                          dangerouslyUseHTMLString: true,
+                          customClass: 'link-alert-dialog'
+                      }
+                  );
+              })
+          }).catch(() => {});
+      },
     beforeAvatarUpload(file) {
     beforeAvatarUpload(file) {
       const isLt1M = file.size / 1024 / 1024 < 1;
       const isLt1M = file.size / 1024 / 1024 < 1;
       if (!isLt1M) {
       if (!isLt1M) {