Jelajahi Sumber

Merge branch 'master' of http://gcls-git.helxsoft.cn/GCLS/eep_page

zq 4 hari lalu
induk
melakukan
91b1401795

+ 4 - 3
src/views/book/courseware/preview/common/SoundRecord.vue

@@ -42,7 +42,6 @@
       >
       <div
         :class="['playBack', hasMicro]"
-        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
         :style="{
           backgroundColor: (microphoneStatus || hasMicro) && attrib && attrib.topic_color ? attrib.topic_color : '#000',
           maskImage: hasMicro
@@ -52,6 +51,7 @@
             : `url(${require('@/assets/voice_matrix/luyin-play.png')})`,
         }"
         class="icon-mask"
+        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
       >
         <!-- <SvgIcon icon-class="luyin-radio-play" size="24" /> -->
       </div>
@@ -89,7 +89,6 @@
       </el-select>
       <div
         :class="['playBack', hasMicro]"
-        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
         :style="{
           backgroundColor: (microphoneStatus || hasMicro) && attrib && attrib.topic_color ? attrib.topic_color : '#000',
           maskImage: hasMicro
@@ -99,6 +98,7 @@
             : `url(${require('@/assets/voice_matrix/luyin-play.png')})`,
         }"
         class="icon-mask"
+        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
       >
         <!-- <SvgIcon icon-class="luyin-radio-play" size="24" /> -->
       </div>
@@ -156,7 +156,6 @@
       </el-select>
       <div
         :class="['playBack', hasMicro]"
-        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
         :style="{
           backgroundColor: (microphoneStatus || hasMicro) && attrib && attrib.topic_color ? attrib.topic_color : '#000',
           maskImage: hasMicro
@@ -166,6 +165,7 @@
             : `url(${require('@/assets/voice_matrix/luyin-play.png')})`,
         }"
         class="icon-mask"
+        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
       >
         <!-- <SvgIcon icon-class="luyin-radio-play" size="24" /> -->
       </div>
@@ -451,6 +451,7 @@ export default {
     handleReset() {
       this.hasMicro = '';
       this.recordtime = 0;
+      this.recordFile = 1;
       window.stopAudioSound = () => {
         if (this.audio) {
           this.audio.pause();

+ 4 - 1
src/views/book/courseware/preview/components/input/InputPreview.vue

@@ -28,7 +28,7 @@
       </div>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -106,6 +106,9 @@ export default {
         gridTemplateAreas: this.showLang ? "'rich input' 'lang lang'" : "'rich input'",
       };
     },
+    retry() {
+      this.data.answer.text = '';
+    },
   },
 };
 </script>

+ 4 - 1
src/views/book/courseware/preview/components/judge/JudgePreview.vue

@@ -56,7 +56,7 @@
       </ul>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -211,6 +211,9 @@ export default {
       }
       return isCorrectType && !(selectOption.option_type === option_type) ? 'answer-right' : '';
     },
+    retry() {
+      this.answer.answer_list = [];
+    },
   },
 };
 </script>

+ 10 - 1
src/views/book/courseware/preview/components/matching/MatchingPreview.vue

@@ -36,7 +36,7 @@
       </ul>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -514,6 +514,15 @@ export default {
 
       return isRight ? 'right' : 'wrong';
     },
+    retry() {
+      this.clearLine();
+      this.$set(
+        this,
+        'answerList',
+        this.answerList.map((item) => item.map(({ mark }) => ({ mark, preMark: [], nextMark: [] }))),
+      );
+      this.$set(this, 'answer', { answer_list: [], is_right: false });
+    },
   },
 };
 </script>

+ 5 - 1
src/views/book/courseware/preview/components/select/SelectPreview.vue

@@ -39,7 +39,7 @@
       </ul>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -174,6 +174,10 @@ export default {
       }
       return answerClass;
     },
+
+    retry() {
+      this.answer.answer_list = [];
+    },
   },
 };
 </script>

+ 10 - 1
src/views/book/courseware/preview/components/sort/SortPreview.vue

@@ -41,7 +41,7 @@
       </ul>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -195,6 +195,15 @@ export default {
       this.clickIndexList = [];
       this.answer.answer_list = this.move_list.map(({ mark }) => mark);
     },
+    retry() {
+      const optionList = structuredClone(this.data.option_list);
+      this.move_list =
+        this.data.property.order_type === orderTypeList[0].value
+          ? optionList
+          : optionList.sort(() => Math.random() - 0.5);
+      this.answer.answer_list = [];
+      this.is_all_right = false;
+    },
   },
 };
 </script>

+ 11 - 1
src/views/book/courseware/preview/components/voice_matrix/VoiceMatrixPreview.vue

@@ -209,7 +209,7 @@
       </div>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -581,6 +581,16 @@ export default {
         });
       });
     },
+
+    retry() {
+      this.clearSelectCell();
+      this.selectedLine = { type: '', index: -1 };
+      this.handleParentPlay();
+      this.wavblob = null;
+      this.matrixSelectLrc = null;
+      this.data.record_list = [];
+      this.$refs.luyin?.handleReset();
+    },
   },
 };
 </script>

+ 128 - 1
src/views/personal_workbench/project/ProductionResourceManage.vue

@@ -207,6 +207,73 @@
     >
       <div ref="three" style="height: 85vh" class="three"></div>
     </el-dialog>
+    <!-- 设置项目成员资源使用权限 -->
+    <el-dialog
+      :visible.sync="sourceCanFlag"
+      width="700px"
+      append-to-body
+      :show-close="true"
+      title="项目成员资源使用权限"
+      :close-on-click-modal="false"
+    >
+      <el-table :data="memberList" :loading="tableLoading">
+        <el-table-column
+          type="index"
+          class-name="index-column"
+          label="序号"
+          width="60"
+          align="center"
+          header-align="center"
+        />
+        <el-table-column prop="user_real_name" label="真实姓名" align="center" header-align="center" />
+
+        <el-table-column prop="is_project_leader" label="项目组长" align="center" header-align="center">
+          <template slot-scope="{ row }">
+            <i v-if="row.is_project_leader === 'true'" class="el-icon-check"></i>
+          </template>
+        </el-table-column>
+        <el-table-column prop="is_can_use" label="可使用" align="center" header-align="center">
+          <template slot-scope="{ row }">
+            <i v-if="row.is_can_use === 'true'" class="el-icon-check"></i>
+          </template>
+        </el-table-column>
+        <el-table-column prop="is_can_download" label="可下载" align="center" header-align="center">
+          <template slot-scope="{ row }">
+            <i v-if="row.is_can_download === 'true'" class="el-icon-check"></i>
+          </template>
+        </el-table-column>
+        <el-table-column prop="is_can_upload" label="可上传" align="center" header-align="center">
+          <template slot-scope="{ row }">
+            <i v-if="row.is_can_upload === 'true'" class="el-icon-check"></i>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="operation" label="操作" align="center" header-align="center">
+          <template slot-scope="{ row }">
+            <span class="link" @click="setUserPopedom(row)">设置权限</span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+    <el-dialog
+      :visible="userPopedomFlag"
+      width="420px"
+      :close-on-click-modal="false"
+      :append-to-body="true"
+      :title="`设置(${userInfo.user_real_name})的资源使用权限`"
+      @close="userPopedomFlag = false"
+      v-if="userInfo"
+    >
+      <div class="popedom_list">
+        <el-switch v-model="is_can_use" active-text="可使用" />
+        <el-switch v-model="is_can_download" active-text="可下载" />
+        <el-switch v-model="is_can_upload" active-text="可上传" />
+      </div>
+      <div slot="footer">
+        <el-button @click="userPopedomFlag = false">取 消</el-button>
+        <el-button type="primary" @click="setUserPopedomSure">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -220,6 +287,8 @@ import {
   MangerUpdateResourceFile,
   MangerUpdateResourceInfo,
   MangerMoveResource,
+  GetProjectMemberResourcePopedomList,
+  SetProjectMemberResourcePopedom,
 } from '@/api/book';
 import { GetProjectBaseInfo } from '@/api/project';
 import PaginationPage from '@/components/PaginationPage.vue';
@@ -235,11 +304,14 @@ import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader.js';
 import { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader.js';
 import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
 
+import { isEnable } from '@/views/book/courseware/data/common';
+
 export default {
   name: 'ProjectResourceManager',
   components: { MenuPage, MenuTree, PaginationPage, UploadFile },
   data() {
     return {
+      isEnable,
       book_id: this.$route.params.id,
       node_list: [],
       select_node: '',
@@ -328,6 +400,14 @@ export default {
       controls: null,
       animationId: null,
       loaded: false, // 是否加载完成
+      sourceCanFlag: false, // 项目成员设置权限
+      memberList: [], // 项目成员列表
+      tableLoading: false,
+      userPopedomFlag: false,
+      userInfo: null,
+      is_can_use: false,
+      is_can_download: false,
+      is_can_upload: false,
     };
   },
   created() {
@@ -448,7 +528,49 @@ export default {
     },
 
     // 设置项目成员资源使用权限
-    handlePersonal() {},
+    handlePersonal() {
+      this.sourceCanFlag = true;
+      this.tableLoading = true;
+      this.memberList = [];
+      GetProjectMemberResourcePopedomList({ project_id: this.book_id })
+        .then((res) => {
+          this.tableLoading = false;
+          if (res.status === 1) {
+            this.memberList = res.member_list;
+          }
+        })
+        .catch(() => {
+          this.tableLoading = false;
+        });
+    },
+    /**
+     * 设置用户权限
+     */
+    setUserPopedom(row) {
+      this.userPopedomFlag = true;
+      this.userInfo = row;
+      this.is_can_use = this.isEnable(row.is_can_use);
+      this.is_can_download = this.isEnable(row.is_can_download);
+      this.is_can_upload = this.isEnable(row.is_can_upload);
+    },
+    // 确定设置用户权限
+    setUserPopedomSure() {
+      SetProjectMemberResourcePopedom({
+        project_id: this.book_id,
+        user_id: this.userInfo.user_id,
+        is_can_use: JSON.stringify(this.is_can_use),
+        is_can_download: JSON.stringify(this.is_can_download),
+        is_can_upload: JSON.stringify(this.is_can_upload),
+      })
+        .then((res) => {
+          if (res.status === 1) {
+            this.$message.success('操作成功!');
+            this.userPopedomFlag = false;
+            this.handlePersonal();
+          }
+        })
+        .catch(() => {});
+    },
 
     // 移动文件
     handleMoveFile() {
@@ -1023,4 +1145,9 @@ export default {
     }
   }
 }
+
+.popedom_list {
+  display: flex;
+  gap: 30px;
+}
 </style>