ZhaoJing преди 1 година
родител
ревизия
976c3961c6

+ 1 - 1
src/pages/jsd/wdkc/zbkc/live.vue

@@ -79,7 +79,7 @@
                     <span>相关文档</span>
                     <i></i>
                 </div>
-            	<homeworkBlock :id="tzk_id" :dxa="chapter_info.tzk_dxa_file" :homework="chapter_info.tzk_ksce_file" :file="chapter_info.tzk_files_json" :zjr="chapter_info.tzk_zjr_user_id" @filePre="filePre"></homeworkBlock>
+            	<homeworkBlock :id="tzk_id" :dxa="chapter_info.tzk_dxa_file" :homework="chapter_info.tzk_ksce_file" :file="chapter_info.tzk_files_json" :zjr="chapter_info.tzk_zjr_user_id" :ks_id="chapter_info.tzk_ksce_tq_id" @filePre="filePre"></homeworkBlock>
             </div>
    		 </div>
   </div>

+ 2 - 2
src/pages/xsd/wdbm/chapter.vue

@@ -103,7 +103,7 @@ const linkTo = (name) => {
 };
 let apiName;
 function filterData() {
-    page = 1;
+    form_query.page = 1;
     getListData(apiName);
 }
 if (route.params.tjk_id) {
@@ -145,7 +145,7 @@ function getListData(name) {
 }
 
 let handleSelectionChange = (val) => {
-    page = val;
+    form_query.page = val;
     getListData(apiName);
 };
 // 报名

+ 2 - 0
src/pages/xsd/wdbm/index.vue

@@ -411,6 +411,8 @@ function getDetailList() {
   detail_loading = true;
   let data = {
     tbm_lclx,
+    page: bm_page,
+    limit: bm_limit,
     tbm_user_id: user.value.user_id,
     M5jxrcL:'',
   };

+ 3 - 1
src/pages/xsd/wdjf/index.vue

@@ -14,7 +14,7 @@
         </ul>
         <nodata v-else></nodata>
         <div class="mt-20px flex justify-center">
-            <el-pagination v-model:current-page="page" v-model:page-size="limit" layout="total, prev, pager, next"
+            <el-pagination v-model:current-page="cur_page" v-model:page-size="limit" layout="total, prev, pager, next"
                 :total="total" :background="true" @current-change="handleSelectionChange"></el-pagination>
         </div>
     </div>
@@ -30,6 +30,8 @@ let cur_page = $ref(1);
 let listData = $ref([])
 function initData() {
     let data = {
+        limit,
+        page: cur_page,
         create_user_id: user.value.user_id
     }
     jf_list(data).then(res => {

+ 9 - 2
src/pages/zbkc/detailIsLive.vue

@@ -64,7 +64,7 @@
                     <i></i>
                 </div>
                 <homeworkBlock :id="tzk_id" :dxa="chapter_info.tzk_dxa_file" :homework="chapter_info.tzk_ksce_file"
-                    :file="chapter_info.tzk_files_json" :zjr="chapter_info.tzk_zjr_user_id" @filePre="filePre">
+                    :file="chapter_info.tzk_files_json" :zjr="chapter_info.tzk_zjr_user_id" :ks_id="chapter_info.tzk_ksce_tq_id" @filePre="filePre">
                 </homeworkBlock>
             </div>
         </div>
@@ -125,6 +125,7 @@ function getChapterDetail() {
         if (res.code === "1") {
             chapter_info = res.data.one_info;
             course_title = res.data.one_info.tzk_ksmc;
+            // user.value.user_id !== chapter_info.tzk_zjr_user_id
             if (user.value.user_id !== chapter_info.tzk_zjr_user_id) {
                 let width = liveBox.value.parentElement.offsetWidth;
                 liveBox.value.style.width = width + 'px';
@@ -575,11 +576,17 @@ $color: #1259a1;
     text-align: center;
 }
 
-:deep(.chat) {
+:deep(.home) {
     // background-color: rgba($color:#fff, $alpha: .7);
     position: absolute;
     top: 60px;
     right: 10px;
 
 }
+:deep(.chat){
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    z-index: 100;
+}
 </style>

+ 59 - 32
src/pages/zbkc/homework.vue

@@ -1,7 +1,7 @@
 <script setup>
 import { user } from '~/store/index';
 import downLoadFile1 from '@/utils/download'
-import mammoth from 'mammoth/mammoth.browser';
+import { ElRadioGroup, ElRadio, ElCheckboxGroup, ElCheckbox } from 'element-plus'
 const props = defineProps({
     id: String,
     homework: String,
@@ -9,10 +9,11 @@ const props = defineProps({
     dxa: String,
     user_id: String,
     zjr: String,
+    ks_id: String,
 })
 const chatBox = ref()
 const ws = new WebSocket("wss://socket.txhlwxx.com")
-const emits = defineEmits(['filePre', 'edit', 'download', 'enter'])
+const emits = defineEmits(['filePre', 'edit'])
 // let userList = ref(undefined)
 const msgList = ref([])
 
@@ -22,29 +23,11 @@ let title = $ref('')
 let filecontent = $ref('');
 let fileName = $ref('');
 let downItem = $ref('');
-let ban_id = $ref([]);
-let isBanned = $ref(false)
-let ban_me = $ref(false);
+
 let login_data = $ref({});
 let login_id = $ref([]);
-let wordText = $ref();
-function getWordText(url) {
-    console.log(url);
-    const xhr = new XMLHttpRequest();
-    xhr.open("get", url, true);
-    xhr.responseType = "arraybuffer";
-    xhr.onload = () => {
-        if (xhr.status == 200) {
-            mammoth.convertToHtml({ arrayBuffer: new Uint8Array(xhr.response) }).then((resultObject) => {
-                console.log(resultObject, 'rej');
-                nextTick(() => {
-                    wordText = resultObject.value;
-                });
-            });
-        }
-    };
-    xhr.send();
-}
+let testInfo = $ref([]);
+let answer = $ref();
 ws.addEventListener('message', (e) => {
     if (e.data) {
         try {
@@ -63,18 +46,34 @@ ws.addEventListener('message', (e) => {
             }
             if (data.type === 'say') {
                 const [id, name] = data.from_client_name.split('|')
-                const fileType = data.content?.split(";")[2]?.split('|')[1];
-                fileName = data.content.split(";")[0];
-                filecontent = data.content?.split(";")[2].split('|')[0];
+                console.log(data.content, 'cc');
+                let fileType
+                if (data.content.includes('|')) {
+                    fileType = data.content?.split(";")[2]?.split('|')[1];
+                    fileName = data.content.split(";")[0];
+                    filecontent = data.content?.split(";")[2].split('|')[0];
+                }
+                // user.value.user_id !== props?.zjr
                 if (fileType && user.value.user_id !== props?.zjr) {
-
                     downItem = data.content
                     switch (fileType) {
                         case 'home':
                             title = '作业';
                             wordVisiable = true;
-                            let url = getFullUrl(filecontent)
-                            getWordText(url)
+                            request({
+                                url: '/txwx/question/index',
+                                data: {
+                                    tq_id: props?.ks_id,
+                                    tqr_data_type: '4',
+                                    tqr_data_id: props?.id,
+                                    tqr_pos: '1'
+                                }
+                            }).then(res => {
+                                if (res.code == '1') {
+                                    testInfo = res.data.page_data;
+                                }
+                            })
+                            // let url = getFullUrl(filecontent)
                             break
                         case 'file':
                             title = '文件';
@@ -137,7 +136,7 @@ function download(item) {
 </script>
 
 <template>
-    <div class="w-300px h-400px flex flex-col shadow chat">
+    <div class="w-300px h-400px flex flex-col shadow home">
         <!--  v-if="user.user_id === props?.zjr" -->
         <div v-if="user.user_id === props?.zjr" class="h-100 overflow-hidden overflow-y-auto flex-auto home_scroll" ref="chatBox">
             <div class="right-nav ml-20px">
@@ -205,15 +204,39 @@ function download(item) {
 
             </div>
         </el-dialog>
-        <el-dialog  v-model="wordVisiable" :title="title">
-            <div id="wordView" v-html="wordText"></div>
+        <el-dialog v-model="wordVisiable" :title="title">
+            <div v-if="testInfo.length > 0">
+                <div v-for="item in testInfo" :key="item.tq_id">
+                    <div class="flex">
+                        <div class="leading-loose" v-html="item.tq_content"></div>
+                        <div class="min-w-60px">
+                            <span class="py-3px px-10px rounded-10px bg-hex-1259A1 text-white text-12px">{{
+                                item.tq_type_name }}</span>
+                        </div>
+                    </div>
+                    <ElRadioGroup v-if="item.tq_type == '1'" class="my-10px" size="30" v-model="item.answer">
+                        <el-radio size="30" class="mr-15px" v-for="e in item.tq_option_choosen" :label="e"><span
+                                class="px-10px">{{ e }}</span></el-radio>
+                    </ElRadioGroup>
+                    <ElCheckboxGroup v-else-if="item.tq_type == '2'" v-model="item.answer">
+                        <el-checkbox v-for="e in item.tq_option_choosen"><span class="px-10px">{{ e }}</span></el-checkbox>
+                    </ElCheckboxGroup>
+                    <ElRadioGroup v-else class="my-10px" size="30" v-model="item.answer">
+                        <el-radio size="30" class="mr-15px" v-for="e in item.tq_option_choosen" :label="e"><span
+                                class="px-10px">{{ e }}</span></el-radio>
+                    </ElRadioGroup>
+                </div>
+            </div>
+
         </el-dialog>
+
     </div>
 </template>
 
 <style lang="scss" scoped>
 $color: #1259A1;
 
+
 .chat_li {
     // background-color: rgba($color: #000000, $alpha: .4);
     height: 40px;
@@ -309,4 +332,8 @@ $color: #1259A1;
         background: rgba(108, 93, 211, 0.2);
     }
 }
+
+::v-deep .western {
+    line-height: 30px !important;
+}
 </style>