From 32702d7bf48ed961e8f89f487fb5de264b7649cc Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期日, 24 八月 2025 22:10:36 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/xiehe_website --- src/views/classManage/jobDetail.vue | 63 + src/views/personalCenter/teacherCertification.vue | 569 ++++++++--------- src/views/personalCenter/class.vue | 6 src/views/personalCenter/course.vue | 8 src/views/personalCenter/myCollection.vue | 120 +-- src/views/classManage/talkDetail.vue | 41 src/views/classManage/config.ts | 18 src/views/classManage/index.vue | 31 src/views/classManage/classHome.vue | 39 + src/assets/main.css | 23 src/views/classManage/infoList.vue | 1 src/assets/images/personalCenter/collect-click.png | 0 src/views/classManage/studentJob.vue | 63 + src/views/classManage/jobManage.vue | 33 src/views/personalCenter/config.ts | 44 src/views/personalCenter/index.vue | 74 +- src/views/classManage/interactionDetail.vue | 1 src/views/classManage/teachingPlan.vue | 485 +++++++-------- src/views/personalCenter/userInfo.vue | 62 - src/views/classManage/components/questionDom.vue | 21 src/views/courseManage/components/class.vue | 44 src/assets/base.css | 1 src/layout/baseLayout.vue | 6 src/views/personalCenter/activeCode.vue | 61 - src/views/personalCenter/myApply.vue | 4 src/views/personalCenter/myCart.vue | 26 src/App.vue | 6 27 files changed, 922 insertions(+), 928 deletions(-) diff --git a/src/App.vue b/src/App.vue index 91dc281..53ed234 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,9 +7,3 @@ <template> <el-config-provider :locale="zhCn"> <RouterView /></el-config-provider> </template> - -<style scoped> -#app { - width: 100%; -} -</style> diff --git a/src/assets/base.css b/src/assets/base.css index 20413dc..1d863ee 100644 --- a/src/assets/base.css +++ b/src/assets/base.css @@ -91,6 +91,7 @@ font-size: 100%; font: inherit; vertical-align: baseline; + white-space: normal; } /* HTML5 display-role reset for older browsers */ article, diff --git a/src/assets/images/personalCenter/collect-click.png b/src/assets/images/personalCenter/collect-click.png index 633b0a9..28091a3 100644 --- a/src/assets/images/personalCenter/collect-click.png +++ b/src/assets/images/personalCenter/collect-click.png Binary files differ diff --git a/src/assets/main.css b/src/assets/main.css index ca9da38..9419e49 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -7,11 +7,23 @@ --el-color-primary-light-7: #019e58 !important; --el-color-primary-dark-2: #019e58 !important; --el-color-primary-dark-3: #019e58 !important; + --el-button-border-color: #019e58 !important; } /* 鍩虹鏍峰紡 */ * { outline: none; +} + +html, +body { + width: 100%; + height: 100%; +} + +#app { + width: 100%; + height: 100%; } /* 灞呬腑甯冨眬 */ @@ -51,11 +63,11 @@ } .titleBox { - background: #d8f7e6; padding: 8px 10px; font-weight: 700; - color: #00873c; + color: #019e58; font-size: 14px; + padding: 10px; box-sizing: border-box; } @@ -224,11 +236,12 @@ } .wait, .main { - color: #019e58; + color: #fc9b1e; } .grey { color: #949494; } -.el-dialog__header { - padding: 0; /* 鎴栬�呰嚜瀹氫箟鐨勫�� */ +.mainbg{ + background:#00873c; + color:#fff; } diff --git a/src/layout/baseLayout.vue b/src/layout/baseLayout.vue index 8ebe117..847ca3f 100644 --- a/src/layout/baseLayout.vue +++ b/src/layout/baseLayout.vue @@ -3,8 +3,8 @@ <Header class="header"></Header> <div class="layoutContentBox" id="layout"> <RouterView /> - <Footer class="footer"></Footer> </div> + <Footer class="footer"></Footer> <login ref="loginRef"></login> </div> </template> @@ -35,14 +35,13 @@ <style lang="less" scoped> .layoutBox { width: 100%; - height: 100vh; + height: 100%; display: flex; flex-direction: column; background-color: #fff; .layoutContentBox { flex: 1; - height: auto; } .header { @@ -54,7 +53,6 @@ @media screen and (min-width: 1200px) { .layoutContentBox { flex: 1; - overflow: auto; } } </style> diff --git a/src/views/classManage/classHome.vue b/src/views/classManage/classHome.vue index 9a0dfad..11842b1 100644 --- a/src/views/classManage/classHome.vue +++ b/src/views/classManage/classHome.vue @@ -26,8 +26,8 @@ </div> <div class="infoBox"> <div class="main">{{ currentClass?.bookName }}</div> - <div class="job">浣滆�咃細{{ classInfo?.author ?? '-' }}</div> - <div class="job">ISBN锛歿{ classInfo?.isbn ?? '-' }}</div> + <div class="job">浣滆�咃細{{ currentClass?.author ?? '-' }}</div> + <div class="job">ISBN锛歿{ currentClass?.isbn ?? '-' }}</div> </div> </div> <div class="line"></div> @@ -283,10 +283,13 @@ .getCourseClass({ ClassIdOrRefCode: String(classInfo.id), }) - .then((res: any) => { + .then(async (res: any) => { if (res) { + const detail = await getBookDetail(res.linkProductDto.product.id) res.bookName = res.linkProductDto.product.name - res.bookIcon = getPublicImage(res.linkProductDto.product.icon, 100) + res.bookIcon = detail.icon ?? defaultImg + res.author = detail.author + res.isbn = detail.isbn res.classTime = moment(res.beginDate).format('YYYY.MM.DD') + '--' + @@ -507,9 +510,30 @@ console.log(e) }) } +// 鑾峰彇鏁欐潗璇︽儏 +const getBookDetail = async (id: string) => { + const query = { + path: '*', + queryType: '*', + productId: id, + coverSize: { + height: 300, + width: 210, + }, + fields: { + author: [], + isbn: [], + }, + } + const res = await MG.store.getProductDetail(query) + return res.datas ?? null +} </script> <style lang="less" scoped> +.main { + color: #019e58; +} .nullBox { width: 100%; display: flex; @@ -532,6 +556,7 @@ height: 190px; margin-top: 30px; border-radius: 10px; + border: 1px solid #019e58; .title { width: 80px; text-align: center; @@ -626,8 +651,6 @@ .titleBox { display: flex; align-items: center; - margin: 10px 0; - font-size: 16px; .title { width: 100%; display: flex; @@ -665,7 +688,6 @@ .titleBox { display: flex; align-items: center; - margin: 10px 0; .border { width: 4px; height: 23px; @@ -676,7 +698,7 @@ } .notBox { width: 100%; - height: 100px; + height: 120px; display: flex; align-items: center; justify-content: center; @@ -747,6 +769,7 @@ width: 100%; height: calc(100% - 63px); padding: 5px 25px; + box-sizing: border-box; overflow: auto; .noticeItem { display: flex; diff --git a/src/views/classManage/components/questionDom.vue b/src/views/classManage/components/questionDom.vue index a1aa349..5e88756 100644 --- a/src/views/classManage/components/questionDom.vue +++ b/src/views/classManage/components/questionDom.vue @@ -62,6 +62,20 @@ <div v-html="item.userAnswer"></div> </div> </div> + <!-- <div class="shortAnswer" v-if="item.questionType == 'shortAnswer' && !isJudge"> + <div class="anSwer" v-if="!isPreview"> + <div class="anSwerText" v-if="item.questionAnswer" style="margin: 15px 0"> + <span style="min-width: 40px">绛旀锛�</span + ><span v-html="item.questionAnswer"></span> + </div> + <div :class="isPreview ? 'questionAnalysisCon' : ''" v-if="item.questionAnalysisCon"> + 鍒嗘瀽锛�<span v-html="item.questionAnalysisCon"></span> + </div> + </div> + <div v-else> + <div v-html="item.userAnswer"></div> + </div> + </div> --> <div v-if="isJudge"> <div class="shortAnswer anSwerText" v-if="item.answer" style="margin: 15px 0"> <span v-html="item.answer"></span> @@ -237,7 +251,9 @@ const emit = defineEmits(['selectQuestion', 'deleteItem', 'judgeUpdate']) -onMounted(() => {}) +// onMounted(() => { +// console.log(props.questionList) +// }) const checkItems = (e: Event, item: any) => { emit('selectQuestion', item) @@ -264,6 +280,9 @@ padding: 10px; box-sizing: border-box; font-family: PingFang SC; + span { + white-space: pre-wrap !important; + } .questionT { // display: flex; flex-wrap: wrap; diff --git a/src/views/classManage/config.ts b/src/views/classManage/config.ts index b7af87f..06f1bd7 100644 --- a/src/views/classManage/config.ts +++ b/src/views/classManage/config.ts @@ -76,15 +76,15 @@ transform="translate(-63.9 -63.9)" /> </svg>` }, - { - label: '鏁欏浜掑姩', - key: '9', - path: 'teachInteraction', - icon: `<svg xmlns="http://www.w3.org/2000/svg" width="16.2" height="16.2" viewBox="0 0 1024 1024"> - <path - d="M447.766594 480.256747H252.078775C126.599562 480.256747 24.274252 377.931437 24.274252 252.452225S125.852662 24.647702 252.078775 24.647702 479.883297 126.973012 479.883297 252.452225V448.140044c0 17.925602-14.191101 32.116703-32.116703 32.116703zM252.078775 88.134209c-90.374909 0-164.318016 73.943107-164.318016 164.318016s73.943107 164.318016 164.318016 164.318016h164.318016v-164.318016c0-90.374909-73.943107-164.318016-164.318016-164.318016zM251.331875 999.352298C125.852662 999.352298 23.527352 897.026988 23.527352 771.547775s102.32531-227.804522 227.804523-227.804522H447.766594c17.178702 0 32.116703 14.191101 32.116703 32.116703v196.434719c-0.7469 124.732312-103.07221 227.057622-228.551422 227.057623z m0-392.122539c-90.374909 0-164.318016 73.943107-164.318017 164.318016s73.943107 164.318016 164.318017 164.318016 164.318016-73.943107 164.318016-164.318016v-164.318016h-164.318016zM773.415026 999.352298c-125.479212 0-227.804522-102.32531-227.804523-227.804523V575.113056c0-17.178702 14.191101-32.116703 32.116703-32.116703h196.43472c125.479212 0 227.804522 102.32531 227.804522 227.804522 0 36.598104-8.962801 72.449307-25.394603 104.56601-8.215901 15.684902-26.888403 21.660102-42.573304 13.444202-15.684902-8.215901-21.660102-26.888403-13.444201-42.573304 11.950401-23.153902 18.672502-49.295405 18.672502-75.436908 0-90.374909-73.943107-164.318016-164.318016-164.318016h-164.318016v164.318016c0 90.374909 73.943107 164.318016 164.318016 164.318016 17.178702 0 34.357403-2.9876 50.042305-8.2159 16.431802-5.228301 34.357403 3.7345 39.585703 20.166301 5.228301 16.431802-3.7345 34.357403-20.166302 39.585704-23.900802 8.962801-47.054705 12.697301-70.955506 12.697302zM773.415026 480.256747H577.727206c-17.178702 0-32.116703-14.191101-32.116703-32.116703V252.452225c0-125.479212 102.32531-227.804522 227.804523-227.804523s227.804522 102.32531 227.804522 227.804523-102.32531 227.804522-227.804522 227.804522z m-164.318017-63.486506h164.318017c90.374909 0 164.318016-73.943107 164.318016-164.318016s-73.943107-164.318016-164.318016-164.318016-164.318016 73.943107-164.318017 164.318016v164.318016z" /> -</svg>` - }, + // { + // label: '鏁欏浜掑姩', + // key: '9', + // path: 'teachInteraction', + // icon: `<svg xmlns="http://www.w3.org/2000/svg" width="16.2" height="16.2" viewBox="0 0 1024 1024"> + // <path + // d="M447.766594 480.256747H252.078775C126.599562 480.256747 24.274252 377.931437 24.274252 252.452225S125.852662 24.647702 252.078775 24.647702 479.883297 126.973012 479.883297 252.452225V448.140044c0 17.925602-14.191101 32.116703-32.116703 32.116703zM252.078775 88.134209c-90.374909 0-164.318016 73.943107-164.318016 164.318016s73.943107 164.318016 164.318016 164.318016h164.318016v-164.318016c0-90.374909-73.943107-164.318016-164.318016-164.318016zM251.331875 999.352298C125.852662 999.352298 23.527352 897.026988 23.527352 771.547775s102.32531-227.804522 227.804523-227.804522H447.766594c17.178702 0 32.116703 14.191101 32.116703 32.116703v196.434719c-0.7469 124.732312-103.07221 227.057622-228.551422 227.057623z m0-392.122539c-90.374909 0-164.318016 73.943107-164.318017 164.318016s73.943107 164.318016 164.318017 164.318016 164.318016-73.943107 164.318016-164.318016v-164.318016h-164.318016zM773.415026 999.352298c-125.479212 0-227.804522-102.32531-227.804523-227.804523V575.113056c0-17.178702 14.191101-32.116703 32.116703-32.116703h196.43472c125.479212 0 227.804522 102.32531 227.804522 227.804522 0 36.598104-8.962801 72.449307-25.394603 104.56601-8.215901 15.684902-26.888403 21.660102-42.573304 13.444202-15.684902-8.215901-21.660102-26.888403-13.444201-42.573304 11.950401-23.153902 18.672502-49.295405 18.672502-75.436908 0-90.374909-73.943107-164.318016-164.318016-164.318016h-164.318016v164.318016c0 90.374909 73.943107 164.318016 164.318016 164.318016 17.178702 0 34.357403-2.9876 50.042305-8.2159 16.431802-5.228301 34.357403 3.7345 39.585703 20.166301 5.228301 16.431802-3.7345 34.357403-20.166302 39.585704-23.900802 8.962801-47.054705 12.697301-70.955506 12.697302zM773.415026 480.256747H577.727206c-17.178702 0-32.116703-14.191101-32.116703-32.116703V252.452225c0-125.479212 102.32531-227.804522 227.804523-227.804523s227.804522 102.32531 227.804522 227.804523-102.32531 227.804522-227.804522 227.804522z m-164.318017-63.486506h164.318017c90.374909 0 164.318016-73.943107 164.318016-164.318016s-73.943107-164.318016-164.318016-164.318016-164.318016 73.943107-164.318017 164.318016v164.318016z" /> + // </svg>` + // }, { label: '璇濋', key: '8', diff --git a/src/views/classManage/index.vue b/src/views/classManage/index.vue index 8495815..71e6c84 100644 --- a/src/views/classManage/index.vue +++ b/src/views/classManage/index.vue @@ -52,7 +52,6 @@ import { ref, watch, provide, onMounted, inject } from 'vue' import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router' import { menu } from './config' -import { getPublicImage } from '@/assets/js/middleGround/tool' import defaultImg from '@/assets/images/default-book-img.png' const router: any = useRouter() @@ -90,9 +89,29 @@ path.value = to.path }) -onMounted(() => { +// 鑾峰彇鏁欐潗璇︽儏 +const getBookDetail = async (id: string) => { + const query = { + path: '*', + queryType: '*', + productId: id, + coverSize: { + height: 300, + width: 210, + }, + fields: { + author: [], + isbn: [], + }, + } + const res = await MG.store.getProductDetail(query) + return res.datas ?? null +} + +onMounted(async () => { classInfo.value = JSON.parse(route.query.classInfo) - classIcon.value = classInfo.value.icon ?? defaultImg + const detail = await getBookDetail(classInfo.value.bookId) + classIcon.value = detail.icon ?? defaultImg menu.forEach((item) => { if ('/' + item.path === path.value) { label.value = item.label @@ -173,6 +192,9 @@ flex: 1; height: auto; } + .main { + color: #019e58; + } .classContentBox { padding: 10px 40px; display: flex; @@ -198,7 +220,7 @@ margin-bottom: 10px; display: flex; .iconBox { - width: 90px; + width: 100px; height: 120px; img { width: 100%; @@ -212,6 +234,7 @@ .main { font-size: 16px; line-height: 20px; + color: #019e58; } .job { // padding:10px; diff --git a/src/views/classManage/infoList.vue b/src/views/classManage/infoList.vue index a26748e..43d8c7f 100644 --- a/src/views/classManage/infoList.vue +++ b/src/views/classManage/infoList.vue @@ -225,6 +225,7 @@ z-index: 99; background: #fff; box-shadow: 0px 0px 20px 1px #eeeeee83; + box-sizing: border-box; } .contentBox { width: 100%; diff --git a/src/views/classManage/interactionDetail.vue b/src/views/classManage/interactionDetail.vue index 7da4da6..7ac64d7 100644 --- a/src/views/classManage/interactionDetail.vue +++ b/src/views/classManage/interactionDetail.vue @@ -335,6 +335,7 @@ z-index: 99; background: #fff; box-shadow: 0px 0px 20px 1px #eeeeee83; + box-sizing: border-box; } .contentBox { width: 100%; diff --git a/src/views/classManage/jobDetail.vue b/src/views/classManage/jobDetail.vue index ea7a47f..45e06c0 100644 --- a/src/views/classManage/jobDetail.vue +++ b/src/views/classManage/jobDetail.vue @@ -253,20 +253,20 @@ const options = ref([ { label: '鍏ㄩ儴', - value: 'all' + value: 'all', }, { label: '鏈壒鏀�', - value: 'WaitCheck' + value: 'WaitCheck', }, { label: '宸叉壒鏀�', - value: 'Normal' + value: 'Normal', }, { label: '鏈彁浜�', - value: 'WaitSubmit' - } + value: 'WaitSubmit', + }, ]) let pages = reactive({ @@ -274,7 +274,7 @@ page: 1, pageSize: 15, count: 0, - loading: true + loading: true, }) const questionKey = [ @@ -288,7 +288,7 @@ 'Embedded_QuestionBank_QuestionType', 'Embedded_QuestionBank_Score', 'Embedded_QuestionBank_Stem', - 'Embedded_QuestionBank_StemStyle' + 'Embedded_QuestionBank_StemStyle', ] // 鍒嗛〉 @@ -343,7 +343,7 @@ taskId: classInfo?.taskWorkId, classId: classInfo?.id, filterList, - searchList + searchList, } MG.edu .getTaskSubmitList(data) @@ -356,7 +356,7 @@ { name: '绠�绛旈', totalScore: 0, value: 'shortAnswer', data: [] }, { name: '璁鸿堪棰�', totalScore: 0, value: 'discuss', data: [] }, { name: '杩炵嚎棰�', totalScore: 0, value: 'matching', data: [] }, - { name: '鍒嗙被棰�', totalScore: 0, value: 'classification', data: [] } + { name: '鍒嗙被棰�', totalScore: 0, value: 'classification', data: [] }, ] try { let list: any = [] @@ -368,7 +368,7 @@ type: item.type, state: item.state, submit: item.submit, - updateTaskSubmitCmsItemRequests: [] + updateTaskSubmitCmsItemRequests: [], } item.singleChoiceName = '鍗曢�夐' item.singleChoiceArr = [] @@ -423,23 +423,23 @@ const lenghtArr = [...res.datas] singleChoiceLength.value = lenghtArr.reduce( (max: any, obj: any) => Math.max(max, obj.singleChoiceArr.length), - 0 + 0, ) multipleChoiceLength.value = lenghtArr.reduce( (max: any, obj: any) => Math.max(max, obj.multipleChoiceArr.length), - 0 + 0, ) judgeLength.value = lenghtArr.reduce( (max: any, obj: any) => Math.max(max, obj.judgeArr.length), - 0 + 0, ) completionLength.value = lenghtArr.reduce( (max: any, obj: any) => Math.max(max, obj.completionArr.length), - 0 + 0, ) otherLength.value = lenghtArr.reduce( (max: any, obj: any) => Math.max(max, obj.otherArr.length), - 0 + 0, ) tableLoading.value = false tableData.value = res.datas @@ -463,7 +463,7 @@ taskId: classInfo?.taskWorkId, // taskData?.id path: String(classInfo?.taskCmsId), //taskData?.rootCmsItemId type: '*', - keys: questionKey + keys: questionKey, } MG.edu .getTaskCmsItem(data) @@ -498,7 +498,7 @@ .catch((e: any) => { ElMessage({ message: '鍒楄〃鑾峰彇澶辫触', - type: 'error' + type: 'error', }) tableLoading.value = false console.log(e) @@ -531,7 +531,7 @@ questionType: item.Embedded_QuestionBank_QuestionType, questionAnalysisCon: item.Embedded_QuestionBank_AnalysisCon, questionAnswer: item.Embedded_QuestionBank_Answer, - customAnswer: null + customAnswer: null, } } catch (error) { console.log(item) @@ -564,7 +564,7 @@ taskId: classInfo?.taskWorkId, classId: classInfo?.id, filterList, - searchList + searchList, } MG.edu .getUnSubmitList(data) @@ -581,7 +581,7 @@ ...item, index: index + 1, createDate: moment(item.createDate).format('YYYY-MM-DD'), - appUserId: item.appUser.id + appUserId: item.appUser.id, } }) pages.count = totalSize @@ -604,7 +604,7 @@ if (item) { const requestData = { classId: classInfo?.id, - requests: [] + requests: [], } const data = JSON.parse(item) listData.forEach((citem: any) => { @@ -617,7 +617,7 @@ score: uitem.score, answer: uitem.answer, state: 'Normal', - comments: 'judge' + comments: 'judge', } }) } @@ -668,7 +668,7 @@ content, type: 'Normal', cmsTypeRefCode: '', - newDataListRequest: [] + newDataListRequest: [], } MG.ugc .newTopicMessage(data) @@ -676,7 +676,7 @@ if (res) { ElMessage({ type: 'success', - message: '宸插偓浜�' + message: '宸插偓浜�', }) } }) @@ -691,8 +691,8 @@ { compareType: 'Contains', keywords: searchKey.value, - field: 'Name' - } + field: 'Name', + }, ] pages.page = 1 if (workState.value != 'WaitSubmit') { @@ -712,6 +712,7 @@ .classManagePage-nav { width: 100%; + box-sizing: border-box; padding: 0 20px; height: 40px; border-bottom: 1px solid #e6e8ed; @@ -737,6 +738,7 @@ z-index: 99; background: #fff; box-shadow: 0px 0px 20px 1px #eeeeee83; + box-sizing: border-box; } .contentBox { width: 100%; @@ -799,6 +801,14 @@ align-items: center; justify-content: space-between; padding: 10px 0; + .selectState { + display: flex; + align-items: center; + width: 200px; + span { + min-width: 50px; + } + } .searchBox { width: 300px; float: left; @@ -826,6 +836,7 @@ border-radius: 5px; margin: 10px auto; padding-bottom: 20px; + box-sizing: border-box; .pubContent { position: relative; height: 80vh; diff --git a/src/views/classManage/jobManage.vue b/src/views/classManage/jobManage.vue index 6e3c07c..495e873 100644 --- a/src/views/classManage/jobManage.vue +++ b/src/views/classManage/jobManage.vue @@ -389,7 +389,7 @@ align-center v-model="visibleView" destroy-on-close - width="900" + width="1200" > <template #header> <div class="viewTitle">宸查�夐鐩�</div> @@ -445,7 +445,7 @@ align-center v-model="visibleLook" destroy-on-close - width="900" + width="1200" > <template #header> <div class="viewTitle">棰勮浣滀笟</div> @@ -914,18 +914,22 @@ if (questionKey != null) { for (let fieldKey of questionKey) { if (item.datas[fieldKey]) { - const values = JSON.parse(item.datas[fieldKey]) - if (values.length > 0) { - // 鐢ㄥ瓧娈靛悕澶勭悊杩斿洖鐨勫瓧娈靛�� - if (values[0].Value) { - item[fieldKey] = values[0].Value - } else if (values[0].Data) { - item[fieldKey] = values[0].Data.Value - } else if (!values[0].Value && values[0].FileList?.length > 0) { - item[fieldKey] = values[0].FileList - } else { - item[fieldKey] = '-' + try { + const values = JSON.parse(item.datas[fieldKey]) + if (values.length > 0) { + // 鐢ㄥ瓧娈靛悕澶勭悊杩斿洖鐨勫瓧娈靛�� + if (values[0].Value) { + item[fieldKey] = values[0].Value + } else if (values[0].Data) { + item[fieldKey] = values[0].Data.Value + } else if (!values[0].Value && values[0].FileList?.length > 0) { + item[fieldKey] = values[0].FileList + } else { + item[fieldKey] = '-' + } } + } catch (error) { + console.log(error, item.datas[fieldKey], item) } } } @@ -1885,6 +1889,9 @@ justify-content: center; align-items: center; padding: 20px 0; + span { + min-width: 80px; + } } } } diff --git a/src/views/classManage/studentJob.vue b/src/views/classManage/studentJob.vue index 5cc6186..605da75 100644 --- a/src/views/classManage/studentJob.vue +++ b/src/views/classManage/studentJob.vue @@ -105,8 +105,8 @@ { value: config.taskType.homeWork, field: 'Type', - subFilters: [] - } + subFilters: [], + }, ]) // task const taskData = reactive({ @@ -118,7 +118,7 @@ state: '', groupId: '', beginDate: '', - endDate: '' + endDate: '', }) const visiblePub = ref(false) @@ -137,7 +137,7 @@ 'Embedded_QuestionBank_QuestionType', 'Embedded_QuestionBank_Score', 'Embedded_QuestionBank_Stem', - 'Embedded_QuestionBank_StemStyle' + 'Embedded_QuestionBank_StemStyle', ] let pages = reactive({ @@ -145,7 +145,7 @@ page: 1, pageSize: 15, count: 0, - loading: false + loading: false, }) // 浣滀笟鍒楄〃 const tableData: any = ref([]) @@ -180,11 +180,11 @@ size: pages.pageSize, sort: { type: 'Desc', - field: 'CreateDate' + field: 'CreateDate', }, filterList, searchList, - groupId: classInfo?.id + groupId: classInfo?.id, } MG.edu .getTaskList(data) @@ -208,7 +208,7 @@ ...item, totalScore: item.judgeScore + item.otherScore, beginDate: moment(item.beginDate).format('YYYY-MM-DD'), - endDate: moment(item.endDate).format('YYYY-MM-DD') + endDate: moment(item.endDate).format('YYYY-MM-DD'), } }) } else { @@ -228,8 +228,8 @@ { compareType: 'Contains', keywords: searchKey.value, - field: 'Name' - } + field: 'Name', + }, ] pages.page = 1 pages.currentPage = 1 @@ -256,29 +256,37 @@ // 绛旈 const answer = (item: any) => { - router.push({ - path: '/bookService/details/answer', - query: { - answerTitle: item.name, - taskId: item.id, - groupId: classInfo?.id, - answerType: 'task' - } + ElMessage({ + type: 'warning', + message: '姝e湪寤鸿涓�...', }) + // router.push({ + // path: '/bookService/details/answer', + // query: { + // answerTitle: item.name, + // taskId: item.id, + // groupId: classInfo?.id, + // answerType: 'task', + // }, + // }) } // 棰勮 const preview = (item: any) => { - router.push({ - path: '/bookService/details/answer', - query: { - answerTitle: item.name, - taskId: item.id, - groupId: classInfo?.id, - answerType: 'task', - isPreview: 'true' - } + ElMessage({ + type: 'warning', + message: '姝e湪寤鸿涓�...', }) + // router.push({ + // path: '/bookService/details/answer', + // query: { + // answerTitle: item.name, + // taskId: item.id, + // groupId: classInfo?.id, + // answerType: 'task', + // isPreview: 'true', + // }, + // }) } </script> @@ -343,6 +351,7 @@ border-radius: 5px; margin: 10px auto; padding-bottom: 20px; + box-sizing: border-box; .pubContent { height: 800px; } diff --git a/src/views/classManage/talkDetail.vue b/src/views/classManage/talkDetail.vue index 299bb45..773ca9b 100644 --- a/src/views/classManage/talkDetail.vue +++ b/src/views/classManage/talkDetail.vue @@ -159,7 +159,7 @@ publisher: userInfo?.name ?? '', publishRole: userInfo?.role ?? '', icon: userInfo.icon ?? '', - type: userInfo.type ?? '' + type: userInfo.type ?? '', } const data = { description: '', @@ -171,13 +171,13 @@ content: JSON.stringify(textObj), type: 'Normal', cmsTypeRefCode: '', - newDataListRequest: [] + newDataListRequest: [], } MG.ugc.newTopicMessage(data).then((res: any) => { if (res) { ElMessage({ message: '宸插洖澶�', - type: 'success' + type: 'success', }) dialogVisible.value = false textarea.value = '' @@ -190,7 +190,7 @@ const getTopicInfo = () => { const pramas = { classId: classInfo.id, - refCodes: [config.refCode.talk] + refCodes: [config.refCode.talk], } MG.edu.getClassTopic(pramas).then((res: any) => { const list = res @@ -211,11 +211,11 @@ { keywords: classInfo.MessageName, field: 'Name', - compareType: 'Contains' - } + compareType: 'Contains', + }, ], appRefCode: config.appRefCode, - topicIdOrRefCode: String(talkTopicInfo.value.id) + topicIdOrRefCode: String(talkTopicInfo.value.id), } MG.ugc.getTopicMessageList(data).then((res: any) => { const list = res.datas @@ -231,7 +231,7 @@ item.createDate = moment(item.createDate).format('YYYY-MM-DD HH:mm:ss') item.updateDate = moment(item.updateDate).format('YYYY-MM-DD HH:mm:ss') return { - ...item + ...item, } }) ownData.value = list[0] @@ -246,7 +246,7 @@ start: 0, size: 999, parentId: ownData?.value.id, - topicIdOrRefCode: String(talkTopicInfo.value.id) + topicIdOrRefCode: String(talkTopicInfo.value.id), } MG.ugc.getTopicMessageSubList(data).then((res: any) => { const list = res.datas @@ -265,7 +265,7 @@ item.createDate = moment(item.createDate).format('YYYY-MM-DD HH:mm:ss') item.updateDate = moment(item.updateDate).format('YYYY-MM-DD HH:mm:ss') return { - ...item + ...item, } }) }) @@ -274,13 +274,13 @@ // 鍒犻櫎鍥炲璇濋 const removeMessageItem = (item: any) => { const data = { - messageIds: [item.id] + messageIds: [item.id], } MG.ugc.delTopicMessage(data).then((res: any) => { if (res) { ElMessage({ message: '宸插垹闄�', - type: 'success' + type: 'success', }) } getMessage() @@ -298,7 +298,7 @@ state: 'Normal', content: JSON.stringify(item.publicText), newDataRequests: [], - updateDataRequests: [] + updateDataRequests: [], } MG.ugc .updateTopicMessage(data) @@ -306,7 +306,7 @@ if (res) { ElMessage({ type: 'success', - message: '宸插彂甯�' + message: '宸插彂甯�', }) getMessage() } @@ -327,7 +327,6 @@ background: #fff; .classManagePage-nav { - width: 100%; padding: 0 20px; height: 40px; border-bottom: 1px solid #e6e8ed; @@ -339,7 +338,6 @@ background: #fff; } .classManagePage-content { - width: 100%; position: relative; .backBtn { width: 100%; @@ -353,13 +351,14 @@ z-index: 99; background: #fff; box-shadow: 0px 0px 20px 1px #eee; + box-sizing: border-box; } .talkBox { - width: 100%; display: flex; justify-content: space-between; align-items: flex-start; - padding: 0 20px; + padding: 20px; + box-sizing: border-box; .leftBox { flex: 1; min-width: 500px; @@ -375,9 +374,11 @@ height: 60px; border-bottom: 1px solid #e7eaec; line-height: 60px; + box-sizing: border-box; } :deep(.inputBox) { padding: 20px 30px; + box-sizing: border-box; position: relative; .el-textarea__inner { @@ -397,7 +398,6 @@ padding: 0 30px; box-sizing: border-box; .MessageHeader { - width: 100%; display: flex; justify-content: space-between; align-items: center; @@ -411,6 +411,7 @@ } .MessageContent { padding: 0 60px; + box-sizing: border-box; padding-bottom: 20px; margin-bottom: 10px; font-family: PingFang SC; @@ -442,6 +443,7 @@ justify-content: space-between; align-items: center; border-bottom: 1px solid #e7eaec; + box-sizing: border-box; .talkUser { display: flex; @@ -457,6 +459,7 @@ overflow: auto; padding: 20px 30px; + box-sizing: border-box; .contentTilte { font-family: PingFang SC; font-weight: bold; diff --git a/src/views/classManage/teachingPlan.vue b/src/views/classManage/teachingPlan.vue index 6c24358..ddb6454 100644 --- a/src/views/classManage/teachingPlan.vue +++ b/src/views/classManage/teachingPlan.vue @@ -12,11 +12,7 @@ <div class="titleBox"> <div class="titleOptions"> <span>鏁欏璁″垝</span> - <el-button - v-if="userInfo?.role == 'Teacher'" - @click="openPlan()" - type="primary" - round + <el-button v-if="userInfo?.role == 'Teacher'" @click="openPlan()" type="primary" round >鏂板缓 <el-icon style="margin-left: 3px"><Plus /></el-icon ></el-button> </div> @@ -29,12 +25,7 @@ @keydown.enter="searchData()" > <template #append> - <el-button - type="primary" - @click="searchData()" - class="searchBtn" - :icon="Search" - /> + <el-button type="primary" @click="searchData()" class="searchBtn" :icon="Search" /> </template> </el-input> </div> @@ -80,7 +71,7 @@ v-for="(item, index) in scope.row.datas.uploadResources" :key="index" > - {{ item.FileName + "." + item.Extension }} + {{ item.FileName + '.' + item.Extension }} </span> </div> </template> @@ -140,12 +131,7 @@ </el-col> <el-col :span="20"> <div class="grid-content ep-bg-purple-light" /> - <el-input - v-model="taskItem.title" - placeholder="璇峰~鍐欏悕绉�" - size="large" - clearable - /> + <el-input v-model="taskItem.title" placeholder="璇峰~鍐欏悕绉�" size="large" clearable /> </el-col> </el-row> <el-row> @@ -174,12 +160,7 @@ </el-cascader> </div> <div class="btngroup"> - <el-button - type="primary" - @click="addGroup" - style="height: 40px" - :icon="Plus" - /> + <el-button type="primary" @click="addGroup" style="height: 40px" :icon="Plus" /> <el-button type="warning" :disabled="dynamicList.length == 1" @@ -211,12 +192,7 @@ ></el-input> </div> <div class="btngroup"> - <el-button - type="primary" - @click="addGroup" - style="height: 40px" - :icon="Plus" - /> + <el-button type="primary" @click="addGroup" style="height: 40px" :icon="Plus" /> <el-button type="warning" :disabled="dynamicList.length == 1" @@ -246,13 +222,7 @@ >涓婁紶</el-button > </el-upload> --> - <el-upload - class="upload" - drag - action="#" - multiple - :http-request="fileUpload" - > + <el-upload class="upload" drag action="#" multiple :http-request="fileUpload"> <el-icon class="el-icon--upload"><upload-filled /></el-icon> <div class="el-upload__text">鎷栨嫿鎴栫偣鍑绘枃浠朵笂浼�</div> </el-upload> @@ -306,112 +276,112 @@ </template> <script setup lang="ts"> -import { Search, ArrowRight, Plus, Minus } from "@element-plus/icons-vue"; -import { ElMessage } from "element-plus"; -import { reactive, ref, onMounted, inject, watch } from "vue"; -import { useRoute } from "vue-router"; -import axios from "axios"; +import { Search, ArrowRight, Plus, Minus } from '@element-plus/icons-vue' +import { ElMessage } from 'element-plus' +import { reactive, ref, onMounted, inject, watch } from 'vue' +import { useRoute } from 'vue-router' +import axios from 'axios' -const route: any = useRoute(); -const MG: any = inject("MG"); -const config: any = inject("config"); -const tool: any = inject("toolClass"); -const classInfo = JSON.parse(route.query.classInfo); -const userInfo = ref(); -const searchKey = ref(""); -const visible = ref(false); -const dynamicList: any = ref([]); -const tableData: any = ref([]); -const classItem = ref([]); -const fileList: any = ref([]); -const chapterList: any = ref([]); -const childrenList: any = ref([]); -const taskData: any = ref(); +const route: any = useRoute() +const MG: any = inject('MG') +const config: any = inject('config') +const tool: any = inject('toolClass') +const classInfo = JSON.parse(route.query.classInfo) +const userInfo = ref() +const searchKey = ref('') +const visible = ref(false) +const dynamicList: any = ref([]) +const tableData: any = ref([]) +const classItem = ref([]) +const fileList: any = ref([]) +const chapterList: any = ref([]) +const childrenList: any = ref([]) +const taskData: any = ref() // 鏂板缓鏁欏璁″垝闃叉姈 -const newLoading = ref(false); -const teachPlanvalue = ref(""); +const newLoading = ref(false) +const teachPlanvalue = ref('') const taskItem = reactive({ - title: "", - selectChapter: "", - referenceMaterial: "", - explain: "", - uploadResources: "", -}); + title: '', + selectChapter: '', + referenceMaterial: '', + explain: '', + uploadResources: '', +}) let pages = reactive({ page: 1, pageSize: 13, count: 0, loading: false, -}); +}) onMounted(() => { - const list = [{ key: 1, parentVal: "", childVal: "" }]; - dynamicList.value = list; - const userCache: any = localStorage.getItem(config.userInfoKey); + const list = [{ key: 1, parentVal: '', childVal: '' }] + dynamicList.value = list + const userCache: any = localStorage.getItem(config.userInfoKey) if (userCache) { - userInfo.value = JSON.parse(userCache); + userInfo.value = JSON.parse(userCache) } - pages.loading = true; - getTaskList(); -}); + pages.loading = true + getTaskList() +}) const searchData = () => { - pages.page = 1; - getTaskCmsList(); -}; + pages.page = 1 + getTaskCmsList() +} const openPlan = () => { - visible.value = true; - taskItem.title = ""; - taskItem.selectChapter = ""; - taskItem.referenceMaterial = ""; - taskItem.explain = ""; - taskItem.uploadResources = ""; - dynamicList.value = [{ key: 1, parentVal: "", childVal: "" }]; - fileList.value = []; -}; + visible.value = true + taskItem.title = '' + taskItem.selectChapter = '' + taskItem.referenceMaterial = '' + taskItem.explain = '' + taskItem.uploadResources = '' + dynamicList.value = [{ key: 1, parentVal: '', childVal: '' }] + fileList.value = [] +} const reduceGroup = () => { - dynamicList.value.pop(); -}; + dynamicList.value.pop() +} const addGroup = () => { - const source = dynamicList.value[dynamicList.value.length - 1]; - const obj = { key: source.key++, parentVal: "", childVal: "" }; - dynamicList.value.push(obj); -}; + const source = dynamicList.value[dynamicList.value.length - 1] + const obj = { key: source.key++, parentVal: '', childVal: '' } + dynamicList.value.push(obj) +} const handleSizeChange = (val: number) => { - pages.pageSize = val; - getTaskCmsList(); -}; + pages.pageSize = val + getTaskCmsList() +} const handleCurrentChange = (val: number) => { - pages.page = val; - getTaskCmsList(); -}; + pages.page = val + getTaskCmsList() +} // 鏂板缓浠诲姟 const newTask = () => { const data = { - name: classInfo?.name + "鏁欏璁″垝", - description: "", - icon: "", + name: classInfo?.name + '鏁欏璁″垝', + description: '', + icon: '', type: config.taskType.teachingPlan, - state: "Normal", + state: 'Normal', groupId: classInfo?.id, order: 0, - beginDate: "2024-09-09T03:38:07.167Z", - endDate: "2024-09-09T03:38:07.167Z", + beginDate: '2024-09-09T03:38:07.167Z', + endDate: '2024-09-09T03:38:07.167Z', duration: 0, - }; + } MG.edu .newTask(data) .then((res: any) => {}) .catch((e: any) => { - console.log(e); - }); -}; + console.log(e) + }) +} // 鑾峰彇浠诲姟鍒楄〃 const getTaskList = () => { @@ -421,70 +391,71 @@ filterList: [ { value: config.taskType.teachingPlan, - field: "Type", + field: 'Type', subFilters: [], }, ], searchList: [], groupId: classInfo?.id, - }; + } MG.edu .getTaskList(data) .then((res: any) => { - if (res.datas.length == 0 && userInfo.value.role == "Teacher") { - newTask(); + if (res.datas.length == 0 && userInfo.value.role == 'Teacher') { + newTask() } if (res.datas.length > 0) { - taskData.value = res.datas[0]; - classInfo.taskId = taskData.value?.id; - classInfo.rootTaskCmsId = taskData.value?.rootCmsItemId; + taskData.value = res.datas[0] + classInfo.taskId = taskData.value?.id + classInfo.rootTaskCmsId = taskData.value?.rootCmsItemId } - getTypeByCode(); + getTypeByCode() if (classInfo.bookRefCode) { - getCatalogueList(); + getCatalogueList() } }) .catch((e: any) => { - console.log(e); - }); -}; + console.log(e) + }) +} // 鍓嶅線闃呰鍣� const toRead = (item: any) => { // config.textReaderUrl // 'http://192.168.3.132:8005/#/home' + return ElMessage.warning('姝e湪寤鸿涓�...') if (classInfo.bookRefCode) { const url = config.textReaderUrl + - "?bookId=" + + '?bookId=' + classInfo?.bookRefCode + - "&token=" + + '&token=' + localStorage.getItem(config.tokenKey) + - "&chapter=" + + '&chapter=' + item.parentVal + - "&startPage=" + - item.childVal; - window.open(url, "_blank"); + '&startPage=' + + item.childVal + window.open(url, '_blank') } else { - ElMessage.warning("褰撳墠绔犺妭鏃犳硶璺宠浆"); + ElMessage.warning('褰撳墠绔犺妭鏃犳硶璺宠浆') } -}; +} // 涓嬭浇涓婁紶璧勬簮 const downloadRes = (item: any) => { - const url = config.requestCtx + "/file/api/ApiDownload?md5=" + item.Md5; - window.open(url, "_blank"); -}; + const url = config.requestCtx + '/file/api/ApiDownload?md5=' + item.Md5 + window.open(url, '_blank') +} // 閫夋嫨鍣� const parentSelect = (val: any, item: any) => { if (val?.length) { - const str = val[2]; - const obj = findObj(chapterList.value, str); - item.parentVal = obj.chapter; - item.childVal = obj.start; + const str = val[2] + const obj = findObj(chapterList.value, str) + item.parentVal = obj.chapter + item.childVal = obj.start } -}; +} // 鏂囦欢涓婁紶 const fileUpload = (file: any) => { @@ -499,87 +470,86 @@ // ElMessage.error('涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃 300KB!') // return reject() // } - const FileName = file.file.name.split(".")[0]; - const Extension = file.file.name.split(".")[1]; - const FileType = file.file.type; - let size = 1024; + const FileName = file.file.name.split('.')[0] + const Extension = file.file.name.split('.')[1] + const FileType = file.file.type + let size = 1024 tool .getFileMd5(file.file, size * 1024) .then((e: string) => { if (!fileList.value.find((item: any) => item.md5 == e)) { - const imgData = new FormData(); - imgData.append("Md5", e); - imgData.append("FileName", FileName); - imgData.append("Extension", Extension); - imgData.append("FileType", FileType); - imgData.append("MetaData", null); - imgData.append("file", file.file); + const imgData = new FormData() + imgData.append('Md5', e) + imgData.append('FileName', FileName) + imgData.append('Extension', Extension) + imgData.append('FileType', FileType) + imgData.append('MetaData', null) + imgData.append('file', file.file) MG.file.upload(imgData).then(() => { fileList.value.push({ md5: e, - linkType: "LinkFile", - linkProtectType: "Public", + linkType: 'LinkFile', + linkProtectType: 'Public', fileName: FileName, extension: Extension, url: config.requestCtx + `鈥�/file鈥�/api鈥�/ApiDownload?md5=` + e, - }); - }); + }) + }) } else { - ElMessage.warning("褰撳墠鏂囦欢宸蹭笂浼狅紝璇峰嬁閲嶅鎿嶄綔锛�"); + ElMessage.warning('褰撳墠鏂囦欢宸蹭笂浼狅紝璇峰嬁閲嶅鎿嶄綔锛�') } }) .catch((e: any) => { - console.error(e); - }); - }); -}; + console.error(e) + }) + }) +} // 鑾峰彇绔犺妭鐩綍 const getCatalogueList = () => { - const url = - config.requestCtx + "/books/resource/" + classInfo?.bookRefCode + "/information.json"; + const url = config.requestCtx + '/books/resource/' + classInfo?.bookRefCode + '/information.json' axios .get(url) .then((res) => { if (res.data?.data.length > 0) { - const datas = res.data.data; - const list = datas?.filter((item: any) => item.children?.length > 0); - chapterList.value = changeCascaderData(list); + const datas = res.data.data + const list = datas?.filter((item: any) => item.children?.length > 0) + chapterList.value = changeCascaderData(list) } }) .catch((e) => { - console.log(e); - }); -}; + console.log(e) + }) +} // 閫掑綊鏇存暟缁� const changeCascaderData = (data: any) => { for (const item of data) { - item.value = item.start; + item.value = item.start if (item.children?.length > 0) { - changeCascaderData(item.children); + changeCascaderData(item.children) } } - return data; -}; + return data +} // 閫掑綊鏌ユ壘 const findObj = (arr: any, val: any) => { for (let i = 0; i < arr.length; i++) { - const obj = arr[i]; + const obj = arr[i] if (obj.start === val) { - return obj; // 鎵惧埌鐩爣瀵硅薄锛岀洿鎺ヨ繑鍥� + return obj // 鎵惧埌鐩爣瀵硅薄锛岀洿鎺ヨ繑鍥� } if (obj.children && obj.children.length > 0) { // 濡傛灉褰撳墠瀵硅薄鏈夊瓙瀵硅薄锛岄�掑綊鏌ユ壘瀛愬璞� - const found: any = findObj(obj.children, val); + const found: any = findObj(obj.children, val) if (found) { - return found; // 鍦ㄥ瓙瀵硅薄涓壘鍒扮洰鏍囧璞★紝杩斿洖 + return found // 鍦ㄥ瓙瀵硅薄涓壘鍒扮洰鏍囧璞★紝杩斿洖 } } } - return null; -}; + return null +} // 鑾峰彇绫诲瀷瀛楁 const getTypeByCode = () => { @@ -588,16 +558,16 @@ refCodes: [config.refCode.teachingPlan], }) .then((res: any) => { - const data = res[0]?.cmsTypeLinks[0]?.children; + const data = res[0]?.cmsTypeLinks[0]?.children if (data?.length) { - classItem.value = data; + classItem.value = data } - getTaskCmsList(); + getTaskCmsList() }) .catch((err: any) => { - console.log(err); - }); -}; + console.log(err) + }) +} // 鑾峰彇浠诲姟涓嬬殑璧勬簮鍒楄〃 const getTaskCmsList = () => { @@ -608,81 +578,80 @@ ? [ { keywords: searchKey.value, - field: "Name", - compareType: "Contains", + field: 'Name', + compareType: 'Contains', }, ] : [], taskId: classInfo?.taskId, path: String(classInfo?.rootTaskCmsId), - type: "*", - keys: ["referenceMaterial", "Name", "selectChapter", "uploadResources", "explain"], - }; + type: '*', + keys: ['referenceMaterial', 'Name', 'selectChapter', 'uploadResources', 'explain'], + } MG.edu .getTaskCmsItem(data) .then((res: any) => { - pages.loading = false; - pages.count = res.totalSize; + pages.loading = false + pages.count = res.totalSize for (let i = 0; i < res.datas.length; i++) { - const item = res.datas[i]; + const item = res.datas[i] // 澶勭悊瀛楁 if (taskItem != null) { for (let fieldKey in taskItem) { if (item.datas[fieldKey]) { - const values = JSON.parse(item.datas[fieldKey]); + const values = JSON.parse(item.datas[fieldKey]) if (values.length > 0) { // 鐢ㄥ瓧娈靛悕澶勭悊杩斿洖鐨勫瓧娈靛�� if (values[0].Value) { - item.datas[fieldKey] = values[0].Value; + item.datas[fieldKey] = values[0].Value } else if (values[0].Data) { - item.datas[fieldKey] = values[0].Data.Value; + item.datas[fieldKey] = values[0].Data.Value } else if (!values[0].Value && values[0].FileList?.length > 0) { - item.datas[fieldKey] = values[0].FileList; + item.datas[fieldKey] = values[0].FileList } else { - item.datas[fieldKey] = "-"; + item.datas[fieldKey] = '-' } - if (fieldKey == "selectChapter" && values[0].Value) { - const data = JSON.parse(values[0].Value); - item.datas["selectChapter"] = data.map((citem: any) => { + if (fieldKey == 'selectChapter' && values[0].Value) { + const data = JSON.parse(values[0].Value) + item.datas['selectChapter'] = data.map((citem: any) => { if (classInfo.bookRefCode) { - const dataS = findObj(chapterList.value, citem.childVal); + const dataS = findObj(chapterList.value, citem.childVal) return { ...citem, parentName: - chapterList.value.find( - (sitem: any) => sitem.chapter == citem.parentVal - )?.label + - "---" + + chapterList.value.find((sitem: any) => sitem.chapter == citem.parentVal) + ?.label + + '---' + dataS?.label, - }; + } } else { return { ...citem, - parentName: citem.parentVal + "---" + citem.childVal, - }; + parentName: citem.parentVal + '---' + citem.childVal, + } } - }); + }) } - if (fieldKey == "selectChapter" && !values[0].Value) { - item.datas["selectChapter"] = []; + if (fieldKey == 'selectChapter' && !values[0].Value) { + item.datas['selectChapter'] = [] } } - const index = i; - item.datas["index"] = index + 1; + const index = i + item.datas['index'] = index + 1 } } } } - tableData.value = res.datas; + tableData.value = res.datas }) .catch((e: any) => { ElMessage({ - message: "鍒楄〃鑾峰彇澶辫触", - type: "error", - }); - console.log(e); - }); -}; + message: '鍒楄〃鑾峰彇澶辫触', + type: 'error', + }) + console.log(e) + }) +} // 鍒犻櫎璧勬簮 const removeTaskItem = (item: any) => { @@ -694,53 +663,53 @@ path: String(classInfo?.rootTaskCmsId), }, ], - }; + } MG.edu .removeTaskCmsItemList(data) .then((res: any) => { if (res) { ElMessage({ - message: "鍒犻櫎鎴愬姛", - type: "success", - }); - getTaskCmsList(); + message: '鍒犻櫎鎴愬姛', + type: 'success', + }) + getTaskCmsList() } }) .catch((e: any) => { ElMessage({ - message: "鍒犻櫎澶辫触", - type: "error", - }); - }); -}; + message: '鍒犻櫎澶辫触', + type: 'error', + }) + }) +} // 涓轰换鍔℃柊寤鸿祫婧� const newTaskCmsItems = () => { - newLoading.value = true; - taskItem.selectChapter = JSON.stringify(dynamicList.value); + newLoading.value = true + taskItem.selectChapter = JSON.stringify(dynamicList.value) if (!taskItem.title) { ElMessage({ - message: "璇峰~鍐欐暀瀛﹀悕绉�", - type: "warning", - }); - newLoading.value = false; - return false; + message: '璇峰~鍐欐暀瀛﹀悕绉�', + type: 'warning', + }) + newLoading.value = false + return false } - if (dynamicList.value[0]?.parentVal == "") { + if (dynamicList.value[0]?.parentVal == '') { ElMessage({ - message: "璇烽�夋嫨鏁欏绔犺妭", - type: "warning", - }); - newLoading.value = false; - return false; + message: '璇烽�夋嫨鏁欏绔犺妭', + type: 'warning', + }) + newLoading.value = false + return false } if (fileList.value.length == 0) { ElMessage({ - message: "璇蜂笂浼犳暀瀛︽枃浠�", - type: "warning", - }); - newLoading.value = false; - return false; + message: '璇蜂笂浼犳暀瀛︽枃浠�', + type: 'warning', + }) + newLoading.value = false + return false } const data = { groupId: classInfo?.id, @@ -749,33 +718,29 @@ newGroupCmsItemRequests: [ { name: taskItem.title, - description: "", - icon: "", + description: '', + icon: '', type: config.refCode.teachingPlan, - state: "Normal", + state: 'Normal', order: 0, - newDataListRequest: tool.worksDataBytool( - classItem.value, - taskItem, - fileList.value - ), + newDataListRequest: tool.worksDataBytool(classItem.value, taskItem, fileList.value), newCmsItemAndFileLinkListRequest: [], newChildrenListRequest: [], }, ], - }; + } MG.edu.newTaskCmsItem(data).then((res: any) => { - newLoading.value = false; + newLoading.value = false if (res) { ElMessage({ - message: "鏂板缓鎴愬姛", - type: "success", - }); - visible.value = false; - getTaskCmsList(); + message: '鏂板缓鎴愬姛', + type: 'success', + }) + visible.value = false + getTaskCmsList() } - }); -}; + }) +} // // 缂栬緫璧勬簮 // const editOpen = (item: any) => { diff --git a/src/views/courseManage/components/class.vue b/src/views/courseManage/components/class.vue index bac25b3..debe2a1 100644 --- a/src/views/courseManage/components/class.vue +++ b/src/views/courseManage/components/class.vue @@ -10,7 +10,7 @@ </div> <el-button type="primary" class="applyStartClasses" @click="applyClass">鐢宠寮�鐝�</el-button> </div> - <div class="classListBox" v-loading="pages.loading"> + <div class="classListBox" v-if="classList.length > 0" v-loading="pages.loading"> <div class="classItem" v-for="(item, index) in classList" :key="index"> <div class="itemHeader"> <div class="title">{{ item.name }}</div> @@ -137,7 +137,7 @@ page: 1, pageSize: 6, count: 0, - loading: true + loading: true, }) const searchData = () => { @@ -156,7 +156,7 @@ size: pages.pageSize, sort: { type: 'Desc', - field: 'CreateDate' + field: 'CreateDate', }, filterList: [], searchList: searchKey.value @@ -164,14 +164,14 @@ { keywords: searchKey.value, field: 'Name', - compareType: 'Contains' - } + compareType: 'Contains', + }, ] - : [] + : [], }) .then((res: any) => { pages.loading = false - pages.count = res.totalSize; + pages.count = res.totalSize classList.value = res.datas.map((item: any) => { return { ...item, @@ -179,7 +179,7 @@ id: item.id, icon: item.icon ? getPublicImage(item.icon, 80) : '', introduction: item.description, - reason: item.applyReturnMsg ? JSON.parse(item.applyReturnMsg).reason : '' + reason: item.applyReturnMsg ? JSON.parse(item.applyReturnMsg).reason : '', } }) refreshParent() @@ -191,7 +191,7 @@ formData.value = { name: '', num: '', - date: '' + date: '', } applyClassDialog.value = true } @@ -205,7 +205,7 @@ const formData = ref({ name: '', num: '', - date: '' + date: '', }) const submit = () => { @@ -221,7 +221,7 @@ endDate: moment(formData.value.date[1]).format('YYYY-MM-DD'), config: '', price: 0, - maxUserCount: formData.value.num + maxUserCount: formData.value.num, }) .then((res: any) => { if (res) { @@ -247,7 +247,7 @@ await toClipboard(text) ElMessage({ message: '澶嶅埗鎴愬姛', - type: 'success' + type: 'success', }) } catch (e) { console.error(e) @@ -257,7 +257,7 @@ // 鍒犻櫎鐝骇 const delClass = (item: any) => { const data = { - ids: [item.id] + ids: [item.id], } MG.edu .delCourseClass(data) @@ -265,7 +265,7 @@ if (res) { ElMessage({ message: '宸插垹闄�', - type: 'success' + type: 'success', }) getData() } @@ -273,7 +273,7 @@ .catch((err: any) => { ElMessage({ message: '鍒犻櫎澶辫触', - type: 'error' + type: 'error', }) console.log(err) }) @@ -284,7 +284,7 @@ page: 1, pageSize: 10, count: 0, - loading: false + loading: false, }) const courseListData = ref([]) @@ -335,14 +335,14 @@ if (item.applyState == 'WaitAudit') { ElMessage({ message: '姝e湪瀹℃牳涓�....', - type: 'warning' + type: 'warning', }) return false } if (item.applyState == 'Reject') { ElMessage({ message: '瀹℃牳鏈�氳繃', - type: 'warning' + type: 'warning', }) return false } @@ -356,13 +356,13 @@ bookId: bookData.id, author: bookData.author, isbn: bookData.isbn, - bookRefCode: bookData.refCode + bookRefCode: bookData.refCode, } let page = uRouter.resolve({ path: '/classManage', query: { - classInfo: JSON.stringify(classinfo) - } + classInfo: JSON.stringify(classinfo), + }, }) window.open(page.href, '_blank') } @@ -423,7 +423,7 @@ margin-top: 10px; font-size: 12px; background-color: #fff; - color: #3b93fe; + color: #019e58; padding: 0 6px; border-radius: 50px; overflow: hidden; diff --git a/src/views/personalCenter/activeCode.vue b/src/views/personalCenter/activeCode.vue index 9ea3775..8a5b72d 100644 --- a/src/views/personalCenter/activeCode.vue +++ b/src/views/personalCenter/activeCode.vue @@ -7,7 +7,7 @@ <el-input class="inputBox" v-model="activateCode" placeholder="璇疯緭鍏ユ縺娲荤爜"> <template #append> <el-button - style="background-color: #019e58; color: #fff" + style="background-color: #144941; color: #fff" @click="userActiveCodeGet" :loading="loading" >婵�娲�</el-button @@ -41,17 +41,14 @@ @click="goBookDetails(pItem.id, pItem.name, pItem.defaultSaleMethodId)" > <div class="cover"> - <img - :src="pItem.icon ? getPublicImage(pItem.icon, '', '') : bookCover" - alt="" - /> + <img :src="pItem.icon ? pItem.icon : bookCover" alt="" /> </div> <div class="info"> <div class="bookType" style="margin-bottom: 10px" v-if="pItem.type"> {{ pItem.type }} </div> - <span :title="pItem.name">{{ pItem.name }}</span> - <span v-if="pItem.author">{{ pItem.author }}</span> + <span class="title" :title="pItem.name">{{ pItem.name }}</span> + <span class="author" v-if="pItem.author">{{ pItem.author }}</span> </div> </div> </div> @@ -155,7 +152,7 @@ return citem.data.sequenceNum == '007EB8E7' && citem.data.value })?.data?.value const obj = { - icon: item.productList[index]?.icon, + icon: getPublicImage(item.productList[index]?.icon, '', '150'), id: item.productList[index]?.id, name: item.productList[index]?.name, author, @@ -194,31 +191,12 @@ } // 璺宠浆涔︽湰璇︽儏 const goBookDetails = async (id: number, name: string, defaultSaleMethodId: number) => { - let parentData = await MG.store.getProductBySaleMethod({ - saleMethodId: defaultSaleMethodId, + router.push({ + path: '/bookdetail', + query: { + bookId: id, + }, }) - if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalCourses') { - router.push({ - path: '/bookdetail', - query: { - bookId: parentData.id, - }, - }) - } else if (parentData.storeLinks[0].storeRefCode == 'digitalTextbooks') { - router.push({ - path: '/bookdetail', - query: { - bookId: parentData.id, - }, - }) - } else { - router.push({ - path: '/bookdetail', - query: { - bookId: id, - }, - }) - } } </script> <style lang="less" scoped> @@ -254,7 +232,7 @@ border: 1px solid #edecec; background: #edf4f2; .flex1 span { - color: #019e58; + color: #000; } } @@ -278,12 +256,13 @@ margin-bottom: 20px; .cover { - width: 106px; + width: 116px; height: 150px; border-radius: 0px 0px 0px 0px; border: 1px solid #019e58; position: relative; margin: auto; + margin-bottom: 5px; img { width: 100%; @@ -324,10 +303,8 @@ } span { - font-weight: bold; line-height: 25px; display: -webkit-box; - margin-bottom: 5px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; @@ -335,6 +312,18 @@ padding: 5px 0; box-sizing: border-box; text-align: center; + font-family: + Microsoft YaHei UI, + Microsoft YaHei UI; + font-size: 16px; + } + .title { + font-weight: bold; + color: #000000; + } + .author { + font-weight: 400; + color: #333333; } } } diff --git a/src/views/personalCenter/class.vue b/src/views/personalCenter/class.vue index f6a6dff..b614495 100644 --- a/src/views/personalCenter/class.vue +++ b/src/views/personalCenter/class.vue @@ -42,7 +42,9 @@ <template #footer> <div class="dialog-footer"> <el-button @click="dialogVisible = false"> 鍙栨秷 </el-button> - <el-button type="primary" @click="joinClass()"> 纭 </el-button> + <el-button type="primary" :disabled="!classDetail?.name" @click="joinClass()"> + 鍔犲叆 + </el-button> </div> </template> </el-dialog> @@ -394,7 +396,7 @@ margin-top: 10px; font-size: 12px; background-color: #fff; - color: #3b93fe; + color: #019e58; padding: 0 6px; border-radius: 50px; overflow: hidden; diff --git a/src/views/personalCenter/config.ts b/src/views/personalCenter/config.ts index 3d72291..e4b662a 100644 --- a/src/views/personalCenter/config.ts +++ b/src/views/personalCenter/config.ts @@ -9,16 +9,16 @@ </svg> `, }, - { - label: '璐墿杞�', - key: '2', - path: 'myCart', - icon: `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> - <path - d="M1 2.68571C1 2.30701 1.32622 2 1.72862 2H2.27096C3.19434 2 3.74721 2.58422 4.06336 3.1273C4.27408 3.48932 4.42653 3.90919 4.54577 4.28933C4.57806 4.28694 4.61078 4.28571 4.64387 4.28571H16.7849C17.5914 4.28571 18.1738 5.01204 17.9527 5.74199L16.177 11.6017C15.8498 12.6818 14.8012 13.4266 13.6079 13.4266H7.82937C6.62618 13.4266 5.57145 12.6696 5.25303 11.5777L4.51422 9.04411L3.2915 5.15957L3.28952 5.15277C3.13825 4.63361 2.99629 4.14862 2.78534 3.78624C2.58048 3.43433 2.41718 3.37143 2.27096 3.37143H1.72862C1.32622 3.37143 1 3.06442 1 2.68571ZM5.92822 8.71113L6.6583 11.2147C6.80304 11.7111 7.28247 12.0551 7.82937 12.0551H13.6079C14.1503 12.0551 14.6269 11.7166 14.7758 11.2257L16.463 5.65714H4.96902L5.91484 8.66222C5.91997 8.67849 5.92442 8.69477 5.92822 8.71113ZM9.25768 16.1714C9.25768 17.1813 8.38781 18 7.3147 18C6.24162 18 5.37172 17.1813 5.37172 16.1714C5.37172 15.1615 6.24162 14.3429 7.3147 14.3429C8.38781 14.3429 9.25768 15.1615 9.25768 16.1714ZM7.80045 16.1714C7.80045 15.919 7.58297 15.7143 7.3147 15.7143C7.04643 15.7143 6.82895 15.919 6.82895 16.1714C6.82895 16.4239 7.04643 16.6286 7.3147 16.6286C7.58297 16.6286 7.80045 16.4239 7.80045 16.1714ZM16.0581 16.1714C16.0581 17.1813 15.1883 18 14.1151 18C13.042 18 12.1722 17.1813 12.1722 16.1714C12.1722 15.1615 13.042 14.3429 14.1151 14.3429C15.1883 14.3429 16.0581 15.1615 16.0581 16.1714ZM14.6009 16.1714C14.6009 15.919 14.3834 15.7143 14.1151 15.7143C13.8469 15.7143 13.6294 15.919 13.6294 16.1714C13.6294 16.4239 13.8469 16.6286 14.1151 16.6286C14.3834 16.6286 14.6009 16.4239 14.6009 16.1714Z" - /> -</svg>`, - }, +// { +// label: '璐墿杞�', +// key: '2', +// path: 'myCart', +// icon: `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> +// <path +// d="M1 2.68571C1 2.30701 1.32622 2 1.72862 2H2.27096C3.19434 2 3.74721 2.58422 4.06336 3.1273C4.27408 3.48932 4.42653 3.90919 4.54577 4.28933C4.57806 4.28694 4.61078 4.28571 4.64387 4.28571H16.7849C17.5914 4.28571 18.1738 5.01204 17.9527 5.74199L16.177 11.6017C15.8498 12.6818 14.8012 13.4266 13.6079 13.4266H7.82937C6.62618 13.4266 5.57145 12.6696 5.25303 11.5777L4.51422 9.04411L3.2915 5.15957L3.28952 5.15277C3.13825 4.63361 2.99629 4.14862 2.78534 3.78624C2.58048 3.43433 2.41718 3.37143 2.27096 3.37143H1.72862C1.32622 3.37143 1 3.06442 1 2.68571ZM5.92822 8.71113L6.6583 11.2147C6.80304 11.7111 7.28247 12.0551 7.82937 12.0551H13.6079C14.1503 12.0551 14.6269 11.7166 14.7758 11.2257L16.463 5.65714H4.96902L5.91484 8.66222C5.91997 8.67849 5.92442 8.69477 5.92822 8.71113ZM9.25768 16.1714C9.25768 17.1813 8.38781 18 7.3147 18C6.24162 18 5.37172 17.1813 5.37172 16.1714C5.37172 15.1615 6.24162 14.3429 7.3147 14.3429C8.38781 14.3429 9.25768 15.1615 9.25768 16.1714ZM7.80045 16.1714C7.80045 15.919 7.58297 15.7143 7.3147 15.7143C7.04643 15.7143 6.82895 15.919 6.82895 16.1714C6.82895 16.4239 7.04643 16.6286 7.3147 16.6286C7.58297 16.6286 7.80045 16.4239 7.80045 16.1714ZM16.0581 16.1714C16.0581 17.1813 15.1883 18 14.1151 18C13.042 18 12.1722 17.1813 12.1722 16.1714C12.1722 15.1615 13.042 14.3429 14.1151 14.3429C15.1883 14.3429 16.0581 15.1615 16.0581 16.1714ZM14.6009 16.1714C14.6009 15.919 14.3834 15.7143 14.1151 15.7143C13.8469 15.7143 13.6294 15.919 13.6294 16.1714C13.6294 16.4239 13.8469 16.6286 14.1151 16.6286C14.3834 16.6286 14.6009 16.4239 14.6009 16.1714Z" +// /> +// </svg>`, +// }, { label: '鎴戠殑涔︽灦', key: '3', @@ -112,18 +112,18 @@ </g> </svg>`, }, - { - label: '鎴戠殑璁㈠崟', - key: '8', - path: 'myOrder', - icon: `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> - <g id="Group 201"> - <path id="Vector" - d="M17.4571 4C17.4571 3.80109 17.5384 3.61032 17.6831 3.46967C17.8278 3.32902 18.024 3.25 18.2286 3.25C18.4332 3.25 18.6294 3.32902 18.7741 3.46967C18.9187 3.61032 19 3.80109 19 4V17.25C19 18.7687 17.7336 20 16.1714 20H3.82857C2.26643 20 1 18.7687 1 17.25V2.75C1 1.23125 2.26643 2.34375e-08 3.82857 0H18.2286C18.4332 4.19176e-09 18.6294 0.0790176 18.7741 0.21967C18.9187 0.360322 19 0.551088 19 0.75C19 0.948912 18.9187 1.13968 18.7741 1.28033C18.6294 1.42098 18.4332 1.5 18.2286 1.5H3.82857C3.65973 1.5 3.49254 1.53233 3.33655 1.59515C3.18056 1.65797 3.03882 1.75004 2.91943 1.86612C2.80004 1.98219 2.70534 2.11999 2.64073 2.27165C2.57611 2.4233 2.54286 2.58585 2.54286 2.75V17.25C2.54286 17.4142 2.57611 17.5767 2.64073 17.7284C2.70534 17.88 2.80004 18.0178 2.91943 18.1339C3.03882 18.25 3.18056 18.342 3.33655 18.4048C3.49254 18.4677 3.65973 18.5 3.82857 18.5H16.1714C16.3403 18.5 16.5075 18.4677 16.6635 18.4048C16.8194 18.342 16.9612 18.25 17.0806 18.1339C17.2 18.0178 17.2947 17.88 17.3593 17.7284C17.4239 17.5767 17.4571 17.4142 17.4571 17.25V4ZM5.88571 8.25C5.68112 8.25 5.4849 8.17098 5.34023 8.03033C5.19556 7.88968 5.11429 7.69891 5.11429 7.5C5.11429 7.30109 5.19556 7.11032 5.34023 6.96967C5.4849 6.82902 5.68112 6.75 5.88571 6.75H14.1143C14.3189 6.75 14.5151 6.82902 14.6598 6.96967C14.8044 7.11032 14.8857 7.30109 14.8857 7.5C14.8857 7.69891 14.8044 7.88968 14.6598 8.03033C14.5151 8.17098 14.3189 8.25 14.1143 8.25H5.88571ZM5.88571 12.25C5.68112 12.25 5.4849 12.171 5.34023 12.0303C5.19556 11.8897 5.11429 11.6989 5.11429 11.5C5.11429 11.3011 5.19556 11.1103 5.34023 10.9697C5.4849 10.829 5.68112 10.75 5.88571 10.75H11.0286C11.2332 10.75 11.4294 10.829 11.5741 10.9697C11.7187 11.1103 11.8 11.3011 11.8 11.5C11.8 11.6989 11.7187 11.8897 11.5741 12.0303C11.4294 12.171 11.2332 12.25 11.0286 12.25H5.88571Z" - /> - </g> -</svg>`, - }, +// { +// label: '鎴戠殑璁㈠崟', +// key: '8', +// path: 'myOrder', +// icon: `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> +// <g id="Group 201"> +// <path id="Vector" +// d="M17.4571 4C17.4571 3.80109 17.5384 3.61032 17.6831 3.46967C17.8278 3.32902 18.024 3.25 18.2286 3.25C18.4332 3.25 18.6294 3.32902 18.7741 3.46967C18.9187 3.61032 19 3.80109 19 4V17.25C19 18.7687 17.7336 20 16.1714 20H3.82857C2.26643 20 1 18.7687 1 17.25V2.75C1 1.23125 2.26643 2.34375e-08 3.82857 0H18.2286C18.4332 4.19176e-09 18.6294 0.0790176 18.7741 0.21967C18.9187 0.360322 19 0.551088 19 0.75C19 0.948912 18.9187 1.13968 18.7741 1.28033C18.6294 1.42098 18.4332 1.5 18.2286 1.5H3.82857C3.65973 1.5 3.49254 1.53233 3.33655 1.59515C3.18056 1.65797 3.03882 1.75004 2.91943 1.86612C2.80004 1.98219 2.70534 2.11999 2.64073 2.27165C2.57611 2.4233 2.54286 2.58585 2.54286 2.75V17.25C2.54286 17.4142 2.57611 17.5767 2.64073 17.7284C2.70534 17.88 2.80004 18.0178 2.91943 18.1339C3.03882 18.25 3.18056 18.342 3.33655 18.4048C3.49254 18.4677 3.65973 18.5 3.82857 18.5H16.1714C16.3403 18.5 16.5075 18.4677 16.6635 18.4048C16.8194 18.342 16.9612 18.25 17.0806 18.1339C17.2 18.0178 17.2947 17.88 17.3593 17.7284C17.4239 17.5767 17.4571 17.4142 17.4571 17.25V4ZM5.88571 8.25C5.68112 8.25 5.4849 8.17098 5.34023 8.03033C5.19556 7.88968 5.11429 7.69891 5.11429 7.5C5.11429 7.30109 5.19556 7.11032 5.34023 6.96967C5.4849 6.82902 5.68112 6.75 5.88571 6.75H14.1143C14.3189 6.75 14.5151 6.82902 14.6598 6.96967C14.8044 7.11032 14.8857 7.30109 14.8857 7.5C14.8857 7.69891 14.8044 7.88968 14.6598 8.03033C14.5151 8.17098 14.3189 8.25 14.1143 8.25H5.88571ZM5.88571 12.25C5.68112 12.25 5.4849 12.171 5.34023 12.0303C5.19556 11.8897 5.11429 11.6989 5.11429 11.5C5.11429 11.3011 5.19556 11.1103 5.34023 10.9697C5.4849 10.829 5.68112 10.75 5.88571 10.75H11.0286C11.2332 10.75 11.4294 10.829 11.5741 10.9697C11.7187 11.1103 11.8 11.3011 11.8 11.5C11.8 11.6989 11.7187 11.8897 11.5741 12.0303C11.4294 12.171 11.2332 12.25 11.0286 12.25H5.88571Z" +// /> +// </g> +// </svg>`, +// }, { label: '鎴戠殑鐢宠', key: '9', diff --git a/src/views/personalCenter/course.vue b/src/views/personalCenter/course.vue index 4beadb8..b83b991 100644 --- a/src/views/personalCenter/course.vue +++ b/src/views/personalCenter/course.vue @@ -235,9 +235,9 @@ pages.count = res.totalSize courseList.value = res.datas.map((item: any) => { if (item.icon) { - item.icon = getPublicImage(item.icon, 80) + item.icon = getPublicImage(item.icon, '', 140) } else if (item.linkProduct?.icon) { - item.icon = getPublicImage(item.linkProduct.icon, 80) + item.icon = getPublicImage(item.linkProduct.icon, '', 140) } else { item.icon = defaultImg } @@ -538,8 +538,8 @@ flex: 1; display: flex; .imgBox { - width: 90px; - height: 120px; + width: 110px; + height: 140px; margin-right: 20px; box-shadow: 0px 0px 20px 1px #ccc; } diff --git a/src/views/personalCenter/index.vue b/src/views/personalCenter/index.vue index 978d06c..b20e53c 100644 --- a/src/views/personalCenter/index.vue +++ b/src/views/personalCenter/index.vue @@ -1,43 +1,41 @@ <template> - <page> - <div class="contentBox"> - <div class="breadcrumbBox"> - <span>浣嶇疆锛�</span> - <el-breadcrumb :separator-icon="ArrowRight"> - <el-breadcrumb-item>涓汉涓績</el-breadcrumb-item> - <el-breadcrumb-item>{{ label }}</el-breadcrumb-item> - </el-breadcrumb> - </div> - <el-divider /> - <div class="personalPage clear"> - <div class="leftList fl"> - <ul class="menu"> - <li - v-for="item in listMenu" - :key="item.key" - @click="goRouter(item)" - :class="`/${item.path}` === path ? 'activeItem hover' : 'menuItem hover'" + <div class="contentBox"> + <div class="breadcrumbBox"> + <span>浣嶇疆锛�</span> + <el-breadcrumb :separator-icon="ArrowRight"> + <el-breadcrumb-item>涓汉涓績</el-breadcrumb-item> + <el-breadcrumb-item>{{ label }}</el-breadcrumb-item> + </el-breadcrumb> + </div> + <el-divider style="margin: 5px 0;" /> + <div class="personalPage clear"> + <div class="leftList fl"> + <ul class="menu"> + <li + v-for="item in listMenu" + :key="item.key" + @click="goRouter(item)" + :class="`/${item.path}` === path ? 'activeItem hover' : 'menuItem hover'" + > + <span + :style="{ + fill: `/${item.path}` === path ? '#fff' : '#000', + }" + v-html="item.icon" > - <span - :style="{ - fill: `/${item.path}` === path ? '#fff' : '#000', - }" - v-html="item.icon" - > - </span> - <span>{{ item.label }}</span> - </li> - </ul> - </div> - <div class="rightContent"> - <div> - <!-- 璁╀富浣撳仛瀛愯矾鐢辩殑鏄剧ず --> - <router-view /> - </div> + </span> + <span>{{ item.label }}</span> + </li> + </ul> + </div> + <div class="rightContent"> + <div> + <!-- 璁╀富浣撳仛瀛愯矾鐢辩殑鏄剧ず --> + <router-view /> </div> </div> </div> - </page> + </div> </template> <script setup lang="ts"> @@ -92,6 +90,12 @@ } </script> <style lang="less" scoped> +.homePage { + min-width: 1220px; + min-height: calc(100vh - 61.8%); + background-color: #fff; + padding-bottom: 100px; +} .breadcrumbBox { display: flex; padding: 20px; diff --git a/src/views/personalCenter/myApply.vue b/src/views/personalCenter/myApply.vue index 6bf18b6..cb67f0c 100644 --- a/src/views/personalCenter/myApply.vue +++ b/src/views/personalCenter/myApply.vue @@ -31,7 +31,9 @@ 璇曠敤鏈熼檺锛�<span>{{ item.updateDate }}</span> -- <span>{{ item.feedBack.endDate }}</span> </div> - <div style="color: orangered" v-if="item.isExpiry">闃呰鏈熼檺锛�<span>宸茶繃鏈�</span></div> + <div class="no" style="color: orangered" v-if="item.isExpiry"> + 闃呰鏈熼檺锛�<span>宸茶繃鏈�</span> + </div> <div class="time">鐢宠鏃堕棿锛歿{ item.updateDate }}</div> </div> <div class="reasonForFailure" style="margin: 10px 0" v-if="item.state == 'Reject'"> diff --git a/src/views/personalCenter/myCart.vue b/src/views/personalCenter/myCart.vue index e9ea084..3c03131 100644 --- a/src/views/personalCenter/myCart.vue +++ b/src/views/personalCenter/myCart.vue @@ -44,7 +44,7 @@ <el-table-column label="鍏ㄩ��" width="200"> <template #default="scope"> - <div style="position: relative; width: 110px"> + <div style="position: relative;width: 120px;"> <el-image :src="scope.row.imgUrl ? scope.row.imgUrl : defaultImg" class="bookImg"> </el-image> <div @@ -104,7 +104,7 @@ 鎬讳环锛�<span v-if="sumUnitprice">楼{{ sumUnitprice.toFixed(2) }}</span> <span v-else>楼0.00</span> </p> - <el-button class="button" type="warning" @click="goPaymentPage">缁撶畻</el-button> + <el-button class="button" type="primary" @click="goPaymentPage">缁撶畻</el-button> </div> </div> </div> @@ -117,14 +117,13 @@ import { ElTable, ElMessage } from 'element-plus' import { reactive } from 'vue' import { useRouter } from 'vue-router' -import { InfoFilled } from '@element-plus/icons-vue' import { useUserStore } from '@/store' import { getPublicImage } from '@/assets/js/middleGround/tool.js' import defaultImg from '@/assets/images/default-book-img.png' const dialogVisible = ref(false) const router = useRouter() const userStore = useUserStore() -const MG = inject('MG') +const MG: any = inject('MG') const total = ref() const multipleTableRef = ref() const loading = ref(true) @@ -244,17 +243,8 @@ } MG.store.getShoppingCartProductList(query).then((res) => { const newData = res.datas.map((item) => { - console.log(item.saleMethod.type, 'item.saleMethod.type') - if (item.productMonWithLinkDto.links[0].storeRefCode == 'digitalTextbooks') { - item.typeTxt = '鏁板瓧鏁欐潗' - item.productType = '鏁板瓧鏁欐潗' - } else if (item.productMonWithLinkDto.links[0].storeRefCode == 'digitalCourses') { - item.typeTxt = '鏁板瓧璇剧▼' - item.productType = '鏁板瓧璇剧▼' - } else { - item.typeTxt = '鐢靛瓙涔�' - item.productType = '鍥句功鏈嶅姟-鐢靛瓙涔�' - } + item.typeTxt = '鏁板瓧鏁欐潗' + item.productType = '鏁板瓧鏁欐潗' // console.log(item.saleMethod.id); console.log(item.saleMethod.type, 'item.saleMethod.type') @@ -308,7 +298,6 @@ router.push({ name: 'paymentPage', query: { - crumbsKey: key, orderNumber: orderNumber.value, // type: route.query.type, type: 'shoppingCart', @@ -488,8 +477,8 @@ .el-image__inner { box-shadow: 0px 0px 20px 1px #ccc; object-fit: contain !important; - width: 110px; - height: 140px; + width: 120px; + height: 160px; } .el-icon { @@ -527,6 +516,7 @@ right: 0; margin: 0 !important; border-radius: 0px 0px 0px 5px; + box-sizing: border-box; p { display: flex; diff --git a/src/views/personalCenter/myCollection.vue b/src/views/personalCenter/myCollection.vue index c2b0b54..fccd321 100644 --- a/src/views/personalCenter/myCollection.vue +++ b/src/views/personalCenter/myCollection.vue @@ -15,19 +15,15 @@ currentCollect == 'book' || currentCollect == 'textBooks' ? 'bookCartContent cartContent' : currentCollect == 'course' - ? 'courseCartContent cartContent' - : 'cartContent' + ? 'courseCartContent cartContent' + : 'cartContent' " > <div class="collectList flex jc-sb clear" v-if="collectList.length > 0 && !pages.loading" > - <div - v-for="(item, index) in collectList" - :key="index" - class="collectList-item fl" - > + <div v-for="(item, index) in collectList" :key="index" class="collectList-item fl"> <div class="cover" @click="goBookDetails(item.id, item.name)"> <img :src="item.icon" alt="" /> </div> @@ -35,10 +31,7 @@ <span>{{ item.name }}</span> </div> <div class="currentBtn hover" @click="setCoolect(item)"> - <img - src="@/assets/images/personalCenter/collect-click.png" - alt="star" - /> + <img src="@/assets/images/personalCenter/collect-click.png" alt="star" /> </div> </div> </div> @@ -66,43 +59,43 @@ </template> <script setup lang="ts"> -import { reactive, ref, onMounted, inject, watch } from "vue"; -import { ElMessage, ElMessageBox } from "element-plus"; -import { useUserStore } from "@/store"; -import { useRouter } from "vue-router"; -const userStore = useUserStore(); -const router = useRouter(); -const MG: any = inject("MG"); -const config: any = inject("config"); -let currentCollect = ref("book"); -let collectList = ref([]); -const background = ref(false); -const disabled = ref(false); +import { reactive, ref, onMounted, inject, watch } from 'vue' +import { ElMessage, ElMessageBox } from 'element-plus' +import { useUserStore } from '@/store' +import { useRouter } from 'vue-router' +const userStore = useUserStore() +const router = useRouter() +const MG: any = inject('MG') +const config: any = inject('config') +let currentCollect = ref('textBooks') +let collectList = ref([]) +const background = ref(false) +const disabled = ref(false) let pages = reactive({ page: 1, pageSize: 10, count: 0, loading: false, -}); -let linkType = ref("FavoriteBookCity"); +}) +let linkType = ref('FavoriteBookCity') const tabCart = (event: Event) => { - pages.page = 1; - pages.loading = true; - collectList.value = []; - currentCollect.value = event.props.name; - if (currentCollect.value == "textBooks") { - linkType.value = "FavoriteBookCity"; + pages.page = 1 + pages.loading = true + collectList.value = [] + currentCollect.value = event.props.name + if (currentCollect.value == 'textBooks') { + linkType.value = 'FavoriteBookCity' } - getDataList(); -}; + getDataList() +} function getDataList() { - pages.loading = true; + pages.loading = true MG.store .getProductList({ handelEBooK: true, - queryType: "AppUserProductLink", + queryType: 'AppUserProductLink', linkType: linkType.value, paging: { start: pages.pageSize * pages.page - pages.pageSize, @@ -110,17 +103,17 @@ }, }) .then((res) => { - collectList.value = res.datas; - pages.count = res.total; - pages.loading = false; + collectList.value = res.datas + pages.count = res.total + pages.loading = false }) .catch(() => { - pages.loading = false; - }); + pages.loading = false + }) } onMounted(() => { - getDataList(); -}); + getDataList() +}) // watch( // () => userStore.token, @@ -130,16 +123,16 @@ // ) const handleCurrentChange = (val: number) => { - pages.page = val; - getDataList(); -}; + pages.page = val + getDataList() +} const setCoolect = (item) => { - ElMessageBox.confirm("纭畾瑕佸彇娑堟敹钘忓悧锛�", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", + ElMessageBox.confirm('纭畾瑕佸彇娑堟敹钘忓悧锛�', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', autofocus: false, - type: "warning", + type: 'warning', }) .then(() => { MG.store @@ -149,24 +142,24 @@ }) .then(() => { ElMessage({ - message: "鏀惰棌宸插彇娑堬紒", - type: "success", - }); - pages.page = 1; - getDataList(); - }); + message: '鏀惰棌宸插彇娑堬紒', + type: 'success', + }) + pages.page = 1 + getDataList() + }) }) - .catch(() => {}); -}; + .catch(() => {}) +} // 璺宠浆涔︽湰璇︽儏 const goBookDetails = (id: number, name: string) => { router.push({ - path: "/bookdetail", + path: '/bookdetail', query: { bookId: id, }, - }); -}; + }) +} </script> <style lang="less" scoped> .cartClass { @@ -287,12 +280,11 @@ padding: 2px; background-color: #fff; position: absolute; - top: 10px; - right: 10px; + top: 5px; + right: 2px; img { - width: 16px; - height: 16px; + height: 20px; } } diff --git a/src/views/personalCenter/teacherCertification.vue b/src/views/personalCenter/teacherCertification.vue index 65747f0..833f624 100644 --- a/src/views/personalCenter/teacherCertification.vue +++ b/src/views/personalCenter/teacherCertification.vue @@ -35,7 +35,7 @@ <span class="wait" v-else>寰呰璇�</span> </el-form-item> <el-form-item label="瀛︽牎锛�" prop="schoolName"> - <span v-if="!editState">{{ teacherInfo.schoolName || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.schoolName || '-' }}</span> <el-input v-else v-model="teacherInfo.schoolName" @@ -44,7 +44,7 @@ /> </el-form-item> <el-form-item label="鐪熷疄濮撳悕锛�" prop="fullName"> - <span v-if="!editState">{{ teacherInfo.fullName || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.fullName || '-' }}</span> <el-input v-else v-model="teacherInfo.fullName" @@ -53,12 +53,8 @@ /> </el-form-item> <el-form-item label="鑱岀О锛�"> - <span v-if="!editState">{{ teacherInfo.positionalTitle || "-" }}</span> - <el-select - v-else - v-model="teacherInfo.positionalTitle" - placeholder="璇烽�夋嫨鑱岀О" - > + <span v-if="!editState">{{ teacherInfo.positionalTitle || '-' }}</span> + <el-select v-else v-model="teacherInfo.positionalTitle" placeholder="璇烽�夋嫨鑱岀О"> <el-option v-for="item in teachPosts" :key="item.value" @@ -68,7 +64,7 @@ </el-select> </el-form-item> <el-form-item label="浠绘暀璇剧▼锛�" prop="courseName"> - <span v-if="!editState">{{ teacherInfo.courseName || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.courseName || '-' }}</span> <el-input v-else v-model="teacherInfo.courseName" @@ -77,7 +73,7 @@ /> </el-form-item> <el-form-item label="鎵嬫満鍙凤細" prop="phone"> - <span v-if="!editState">{{ teacherInfo.phone || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.phone || '-' }}</span> <el-input v-else v-model="teacherInfo.phone" @@ -86,7 +82,7 @@ /> </el-form-item> <el-form-item label="搴ф満锛�" prop="telphone"> - <span v-if="!editState">{{ teacherInfo.telphone || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.telphone || '-' }}</span> <el-input v-else v-model="teacherInfo.telphone" @@ -95,7 +91,7 @@ /> </el-form-item> <el-form-item label="閭锛�" prop="email"> - <span v-if="!editState">{{ teacherInfo.email || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.email || '-' }}</span> <el-input v-else v-model="teacherInfo.email" @@ -104,7 +100,7 @@ /> </el-form-item> <el-form-item label="璇︾粏鍦板潃锛�" prop="detailedAddress"> - <span v-if="!editState">{{ teacherInfo.detailedAddress || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.detailedAddress || '-' }}</span> <el-input v-else v-model="teacherInfo.detailedAddress" @@ -182,11 +178,7 @@ <div class="footer-box"> <span class="myDialog-footer" v-if="!loading && editState"> <el-button @click="closeDialog(teacherFormRef)"> 鍙栨秷</el-button> - <el-button - type="primary" - @click="submitBtn(teacherFormRef)" - :loading="subLoading" - > + <el-button type="primary" @click="submitBtn(teacherFormRef)" :loading="subLoading"> 鎻愪氦</el-button > </span> @@ -210,12 +202,7 @@ </template> </el-dialog> <!-- 鏌ョ湅鍘熷洜 --> - <el-dialog - align-center - :close-on-click-modal="false" - v-model="dialogReason" - title="椹冲洖鍘熷洜" - > + <el-dialog align-center :close-on-click-modal="false" v-model="dialogReason" title="椹冲洖鍘熷洜"> <div class="reason" v-if="reasonTxt"> {{ reasonTxt }} </div> @@ -225,23 +212,23 @@ </template> <script setup lang="ts"> -import { reactive, ref, watch, defineEmits, inject, onMounted } from "vue"; -import type { FormInstance, FormRules } from "element-plus"; -import { ElMessage } from "element-plus"; -import tool from "@/assets/js/toolClass.js"; -import { getTopicMsgCmsItemFile } from "@/assets/js/middleGround/tool.js"; -import { useUserStore } from "@/store"; -const userStore = useUserStore(); -const MG: any = inject("MG"); -const config: any = inject("config"); +import { reactive, ref, watch, defineEmits, inject, onMounted } from 'vue' +import type { FormInstance, FormRules } from 'element-plus' +import { ElMessage } from 'element-plus' +import tool from '@/assets/js/toolClass.js' +import { getTopicMsgCmsItemFile } from '@/assets/js/middleGround/tool.js' +import { useUserStore } from '@/store' +const userStore = useUserStore() +const MG: any = inject('MG') +const config: any = inject('config') // 璇佷欢楠岃瘉 const valiCertificate = (rule: any, value: any, callback: any) => { if (fileList.value.length == 0) { - callback(new Error("璇蜂笂浼犵浉鍏宠瘉浠�")); + callback(new Error('璇蜂笂浼犵浉鍏宠瘉浠�')) } else { - callback(); + callback() } -}; +} // const validateTelphone = (rule: any, value: any, callback: any) => { // if (value !== "" && !config.reg_telphone.test(value)) { @@ -251,128 +238,125 @@ // }; const validatePhone = (rule: any, value: any, callback: any) => { - if (value === "") { - callback(new Error("璇疯緭鍏ヨ仈绯荤數璇�")); + if (value === '') { + callback(new Error('璇疯緭鍏ヨ仈绯荤數璇�')) } else { if (!config.reg_tel.test(value)) { - callback(new Error("璇疯緭鍏ユ纭牸寮忕殑鐢佃瘽")); + callback(new Error('璇疯緭鍏ユ纭牸寮忕殑鐢佃瘽')) } - callback(); + callback() } -}; +} const validateEmail = (rule: any, value: any, callback: any) => { - let myreg = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/; - if (value === "") { - callback(new Error("璇疯緭鍏ョ數瀛愰偖绠�")); + let myreg = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/ + if (value === '') { + callback(new Error('璇疯緭鍏ョ數瀛愰偖绠�')) } else { if (!myreg.test(value)) { - callback(new Error("璇疯緭鍏ユ纭牸寮忕殑鐢靛瓙閭")); + callback(new Error('璇疯緭鍏ユ纭牸寮忕殑鐢靛瓙閭')) } - callback(); + callback() } -}; +} const props = defineProps({ isShow: Boolean, -}); +}) -let teacherDialog = ref(false); //寮圭獥 -let loading = ref(false); -let subLoading = ref(false); -const teachPosts = ref([]); +let teacherDialog = ref(false) //寮圭獥 +let loading = ref(false) +let subLoading = ref(false) +const teachPosts = ref([]) const teacherInfo = reactive({ - schoolName: "", //瀛︽牎鍚嶇О - fullName: "", //濮撳悕 - positionalTitle: "", //鑱岀О - courseName: "", //浠昏鏁欑▼ - phone: "", //鑱旂郴鐢佃瘽 - telphone: "", //搴ф満 - email: "", //鑱旂郴閭 - detailedAddress: "", //閫氳鍦板潃 + schoolName: '', //瀛︽牎鍚嶇О + fullName: '', //濮撳悕 + positionalTitle: '', //鑱岀О + courseName: '', //浠昏鏁欑▼ + phone: '', //鑱旂郴鐢佃瘽 + telphone: '', //搴ф満 + email: '', //鑱旂郴閭 + detailedAddress: '', //閫氳鍦板潃 relevantCertificates: [], //鐩稿叧璇佷欢 - state: "", //瀹℃牳鐘舵�侀粯璁ゅ緟瀹℃牳 + state: '', //瀹℃牳鐘舵�侀粯璁ゅ緟瀹℃牳 agree: false, -}); -const topicMessageList = ref([]); -const topicId = ref(); -const worksInfo = ref([]); -const userId = ref(); -const teacherFormRef = ref<FormInstance>(); +}) +const topicMessageList = ref([]) +const topicId = ref() +const worksInfo = ref([]) +const userId = ref() +const teacherFormRef = ref<FormInstance>() interface TeacherInfo { - schoolName: string; - fullName: string; - courseName: string; - telphone: string; - phone: string; - email: string; - detailedAddress: string; - relevantCertificates: string[]; + schoolName: string + fullName: string + courseName: string + telphone: string + phone: string + email: string + detailedAddress: string + relevantCertificates: string[] } const teacherRules = reactive<FormRules<TeacherInfo>>({ - schoolName: [{ required: true, message: "瀛︽牎鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }], - fullName: [{ required: true, message: "鐪熷疄濮撳悕涓嶈兘涓虹┖", trigger: "blur" }], - courseName: [{ required: true, message: "浠绘暀璇剧▼涓嶈兘涓虹┖", trigger: "blur" }], + schoolName: [{ required: true, message: '瀛︽牎鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' }], + fullName: [{ required: true, message: '鐪熷疄濮撳悕涓嶈兘涓虹┖', trigger: 'blur' }], + courseName: [{ required: true, message: '浠绘暀璇剧▼涓嶈兘涓虹┖', trigger: 'blur' }], // telphone: [{ validator: validateTelphone, trigger: "blur" }], - phone: [{ required: true, validator: validatePhone, trigger: "blur" }], - email: [{ required: true, validator: validateEmail, trigger: "blur" }], - detailedAddress: [{ required: true, message: "璇︾粏鍦板潃涓嶈兘涓虹┖", trigger: "blur" }], - relevantCertificates: [ - { required: true, validator: valiCertificate, trigger: "change" }, - ], -}); -const fileList = ref([]); -const editState = ref<boolean>(true); + phone: [{ required: true, validator: validatePhone, trigger: 'blur' }], + email: [{ required: true, validator: validateEmail, trigger: 'blur' }], + detailedAddress: [{ required: true, message: '璇︾粏鍦板潃涓嶈兘涓虹┖', trigger: 'blur' }], + relevantCertificates: [{ required: true, validator: valiCertificate, trigger: 'change' }], +}) +const fileList = ref([]) +const editState = ref<boolean>(true) watch(props, (newValue) => { // 缁熺洃鍚琾rops鐨勫�煎彉鍖栵紝鍔ㄦ�佷慨鏀筰sShow鐨勫�� - teacherDialog.value = newValue.isShow; + teacherDialog.value = newValue.isShow if (teacherDialog.value) { - getpositionalTitle(); - getAgreement(); + getpositionalTitle() + getAgreement() if (localStorage.getItem(config.tokenKey)) { - getUserRole(); + getUserRole() } } -}); +}) // 鑾峰彇鑱岀О function getpositionalTitle() { const data = { - refCodes: ["positionalTitle"], - }; + refCodes: ['positionalTitle'], + } MG.store.getProductTypeField(data).then((res) => { try { - const list = res[0]; - const options = JSON.parse(list.config).option; - teachPosts.value = options; + const list = res[0] + const options = JSON.parse(list.config).option + teachPosts.value = options } catch (error) { - teachPosts.value = []; + teachPosts.value = [] } - }); + }) } // 鑾峰彇鐧诲綍鐢ㄦ埛韬唤 function getUserRole() { - loading.value = true; + loading.value = true MG.identity.getCurrentAppUser().then((res) => { if (res) { - getType(); - userId.value = res.userId; - let userInfo = res.infoList.find((item: any) => item.type == "userInfo"); - let userTypeObj = res.infoList.find((item: any) => item.type == "userType"); + getType() + userId.value = res.userId + let userInfo = res.infoList.find((item: any) => item.type == 'userInfo') + let userTypeObj = res.infoList.find((item: any) => item.type == 'userType') const userData = { - userName: userInfo && userInfo.data ? JSON.parse(userInfo.data).name : "", - school: userInfo && userInfo.data ? JSON.parse(userInfo.data).school : "", - address: userInfo && userInfo.data ? JSON.parse(userInfo.data).address : "", - userType: - userTypeObj && userTypeObj.data ? JSON.parse(userTypeObj.data).userType : "", - }; - let teacherRole = res.roleLinks.find((item) => item.role.refCode == "teacher"); - let teacherInfos = res.infoList.find((item) => item.type == "teacherInfo"); - let wechatInfo = res.infoList.find((item) => item.type == "WeChat"); - let studentInfo = res.infoList.find((item) => item.type == "Default"); - let phoneInfo = res.secretList.find((item) => item.type == "MobilePhone"); - let emailInfo = res.secretList.find((item) => item.type == "EMail"); + userName: userInfo && userInfo.data ? JSON.parse(userInfo.data).name : '', + school: userInfo && userInfo.data ? JSON.parse(userInfo.data).school : '', + address: userInfo && userInfo.data ? JSON.parse(userInfo.data).address : '', + userType: userTypeObj && userTypeObj.data ? JSON.parse(userTypeObj.data).userType : '', + } + let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') + let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') + let wechatInfo = res.infoList.find((item) => item.type == 'WeChat') + let studentInfo = res.infoList.find((item) => item.type == 'Default') + let phoneInfo = res.secretList.find((item) => item.type == 'MobilePhone') + let emailInfo = res.secretList.find((item) => item.type == 'EMail') if (teacherRole && teacherInfos) { userStore.setUserInfo({ ...userData, @@ -380,22 +364,22 @@ phoneNumber: phoneInfo?.credential, Email: emailInfo ? emailInfo.credential : JSON.parse(teacherInfos.data).email, icon: wechatInfo?.icon, - role: "Teacher", + role: 'Teacher', roleId: teacherRole.role.id, userId: res.userId, - }); + }) } else if (wechatInfo) { userStore.setUserInfo({ ...userData, ...wechatInfo, phoneNumber: phoneInfo?.credential, Email: emailInfo?.credential, - role: "Student", + role: 'Student', userId: res.userId, - }); + }) } else if (studentInfo) { if (!studentInfo?.fullName) { - teacherInfo.fullName = userStore.userInfo!.userName; + teacherInfo.fullName = userStore.userInfo!.userName } userStore.setUserInfo({ ...userData, @@ -403,9 +387,9 @@ icon: wechatInfo?.icon, phoneNumber: phoneInfo?.credential, Email: emailInfo?.credential, - role: "Student", + role: 'Student', userId: res.userId, - }); + }) } else if (phoneInfo) { userStore.setUserInfo({ ...userData, @@ -413,321 +397,313 @@ name: phoneInfo?.credential, icon: phoneInfo?.icon, phoneNumber: phoneInfo?.credential, - role: "Student", + role: 'Student', userId: res.userId, - }); + }) } - teacherInfo.phone = userStore.userInfo!.phoneNumber; - teacherInfo.schoolName = userStore.userInfo!.school; - teacherInfo.detailedAddress = userStore.userInfo!.address; + teacherInfo.phone = userStore.userInfo!.phoneNumber + teacherInfo.schoolName = userStore.userInfo!.school + teacherInfo.detailedAddress = userStore.userInfo!.address } - }); + }) } function getType() { const data = { - refCodes: ["teacherCertification"], - }; + refCodes: ['teacherCertification'], + } MG.resource.getCmsTypeByRefCode(data).then((res) => { - worksInfo.value = res[0].cmsTypeLinks[0].children; - newGetTeacherInfo(); - }); + worksInfo.value = res[0].cmsTypeLinks[0].children + newGetTeacherInfo() + }) } // 鏂囦欢涓婁紶 function fileUpload(file) { - console.log(file, 2); + console.log(file, 2) return new Promise((resolve, reject) => { - const isJPG = file.file.type === "image/jpeg" || file.file.type === "image/png"; - const isLt2M = (0.5 * file.file.size) / 1024 / 1024 < 0.5; + const isJPG = file.file.type === 'image/jpeg' || file.file.type === 'image/png' + const isLt2M = (0.5 * file.file.size) / 1024 / 1024 < 0.5 if (!isJPG) { - ElMessage.error("涓婁紶鏂囦欢鍙兘鏄� jpg/png 鏍煎紡!"); - return reject(); + ElMessage.error('涓婁紶鏂囦欢鍙兘鏄� jpg/png 鏍煎紡!') + return reject() } if (!isLt2M) { - ElMessage.error("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃 500KB!"); - return reject(); + ElMessage.error('涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃 500KB!') + return reject() } - const FileName = file.file.name.split(".")[0]; - const Extension = file.file.name.split(".")[1]; - const FileType = file.file.type; - let size = 1024; + const FileName = file.file.name.split('.')[0] + const Extension = file.file.name.split('.')[1] + const FileType = file.file.type + let size = 1024 tool .getFileMd5(file.file, size * 1024) .then((e) => { - console.log(e, 2); + console.log(e, 2) if (!fileList.value.find((item) => item.md5 == e)) { - const imgData = new FormData(); - imgData.append("Md5", e); - imgData.append("FileName", FileName); - imgData.append("Extension", Extension); - imgData.append("FileType", FileType); - imgData.append("MetaData", null); - imgData.append("file", file.file); + const imgData = new FormData() + imgData.append('Md5', e) + imgData.append('FileName', FileName) + imgData.append('Extension', Extension) + imgData.append('FileType', FileType) + imgData.append('MetaData', null) + imgData.append('file', file.file) MG.file.upload(imgData).then(() => { fileList.value.push({ md5: e, - linkType: "LinkFile", - linkProtectType: "Public", + linkType: 'LinkFile', + linkProtectType: 'Public', url: config.requestCtx + `/file/GetPreViewImage?md5=` + e, - }); - }); + }) + }) } else { - ElMessage.error("褰撳墠鏂囦欢宸蹭笂浼狅紝璇峰嬁閲嶅鎿嶄綔锛�"); + ElMessage.error('褰撳墠鏂囦欢宸蹭笂浼狅紝璇峰嬁閲嶅鎿嶄綔锛�') } }) .catch((e) => { - console.error(e); - }); - }); + console.error(e) + }) + }) } // 璇佷欢鍒犻櫎 function handleRemove(file) { for (let i = 0; i < fileList.value.length; i++) { if (fileList.value[i].md5 == file.md5) { - fileList.value.splice(i, 1); + fileList.value.splice(i, 1) } } } // 鐩戝惉鏂囦欢鍒楄〃鍙樺寲锛屽悓姝ヤ慨鏀瑰睍绀哄垪琛� -const showFileList = ref([]); +const showFileList = ref([]) watch( fileList, (newValue) => { showFileList.value = newValue.map( - (item) => config.requestCtx + `/file/GetPreViewImage?md5=` + item.md5 - ); + (item) => config.requestCtx + `/file/GetPreViewImage?md5=` + item.md5, + ) }, - { immediate: true, deep: true } -); + { immediate: true, deep: true }, +) // 鍏抽棴寮规锛屽洖璋冪埗灞傛柟娉� -const emit = defineEmits(["dialogChange"]); +const emit = defineEmits(['dialogChange']) const closeDialog = (formEl: FormInstance | undefined) => { - if (!formEl) return; - formEl.resetFields(); - teacherDialog.value = false; - emit("dialogChange", teacherDialog.value); -}; + if (!formEl) return + formEl.resetFields() + teacherDialog.value = false + emit('dialogChange', teacherDialog.value) +} // 鏁欏笀鍗忚 -const dialogVisibleTecher = ref(false); -const protocolTxt = ref(""); +const dialogVisibleTecher = ref(false) +const protocolTxt = ref('') const getAgreement = () => { let query = { - path: "protocol", + path: 'protocol', fields: { content: [], }, - }; + } MG.resource.getItem(query).then((res) => { try { - const data = res.datas.find( - (e) => e.refCode == "teacherCertificationAgreement" - ); - protocolTxt.value = data ? data.content : "鏆傛棤鍗忚"; + const data = res.datas.find((e) => e.refCode == 'teacherCertificationAgreement') + protocolTxt.value = data ? data.content : '鏆傛棤鍗忚' } catch (error) { - protocolTxt.value = "鏆傛棤鍗忚"; + protocolTxt.value = '鏆傛棤鍗忚' } - }); -}; + }) +} //鏁欏笀淇℃伅 function newGetTeacherInfo() { const data = { start: 0, size: 10, - topicIdOrRefCode: "teacherRoleApproval", + topicIdOrRefCode: 'teacherRoleApproval', appRefCode: config.appRefCode, sort: { - type: "Desc", - field: "CreateDate", + type: 'Desc', + field: 'CreateDate', }, - }; + } MG.ugc.getTopicMessageList(data).then((res) => { try { - fileList.value = []; - const resData = res.datas.find((i) => i.appUserCreator.userId === userId.value); + fileList.value = [] + const resData = res.datas.find((i) => i.appUserCreator.userId === userId.value) if (resData) { - if (resData.state == "WaitAudit") { - editState.value = false; + if (resData.state == 'WaitAudit') { + editState.value = false } else { - editState.value = true; + editState.value = true } - let info = getTopicMsgCmsItemFile(worksInfo.value, resData.cmsItemDataList); - teacherInfo.fullName = info.fullName; - teacherInfo.schoolName = info.schoolName; - teacherInfo.positionalTitle = info.positionalTitle; - teacherInfo.courseName = info.courseName; - teacherInfo.phone = info.phone; - teacherInfo.telphone = info.telphone ? info.telphone : ""; - teacherInfo.email = info.email; - teacherInfo.detailedAddress = info.detailedAddress ? info.detailedAddress : ""; - teacherInfo.relevantCertificates = info.relevantCertificates; - teacherInfo.agree = true; - teacherInfo.state = resData.state; - topicId.value = resData.id; - topicMessageList.value = resData.cmsItemDataList; + let info = getTopicMsgCmsItemFile(worksInfo.value, resData.cmsItemDataList) + teacherInfo.fullName = info.fullName + teacherInfo.schoolName = info.schoolName + teacherInfo.positionalTitle = info.positionalTitle + teacherInfo.courseName = info.courseName + teacherInfo.phone = info.phone + teacherInfo.telphone = info.telphone ? info.telphone : '' + teacherInfo.email = info.email + teacherInfo.detailedAddress = info.detailedAddress ? info.detailedAddress : '' + teacherInfo.relevantCertificates = info.relevantCertificates + teacherInfo.agree = true + teacherInfo.state = resData.state + topicId.value = resData.id + topicMessageList.value = resData.cmsItemDataList if (resData.feedBack != null) { - reasonTxt.value = JSON.parse(resData.feedBack).reason; + reasonTxt.value = JSON.parse(resData.feedBack).reason } if (teacherInfo.relevantCertificates.length > 0) { - if (typeof teacherInfo.relevantCertificates == "object") { + if (typeof teacherInfo.relevantCertificates == 'object') { teacherInfo.relevantCertificates.forEach((ele) => { let imgObj = { md5: ele.file.md5, - linkType: "LinkFile", - linkProtectType: "Public", + linkType: 'LinkFile', + linkProtectType: 'Public', url: config.requestCtx + `/file/GetPreViewImage?md5=` + ele.file.md5, - }; - fileList.value.push(imgObj); - }); + } + fileList.value.push(imgObj) + }) } else { let imgObj = { md5: teacherInfo.relevantCertificates, - linkType: "LinkFile", - linkProtectType: "Public", + linkType: 'LinkFile', + linkProtectType: 'Public', url: - config.requestCtx + - `/file/GetPreViewImage?md5=` + - teacherInfo.relevantCertificates, - }; - fileList.value.push(imgObj); + config.requestCtx + `/file/GetPreViewImage?md5=` + teacherInfo.relevantCertificates, + } + fileList.value.push(imgObj) } } - loading.value = false; + loading.value = false } else { - loading.value = false; + loading.value = false } } catch (error) { - loading.value = false; + loading.value = false } - }); + }) } //鏁欏笀璁よ瘉鎻愪氦 const submitBtn = async (formEl: FormInstance | undefined) => { - if (!formEl) return; + if (!formEl) return await formEl.validate((valid, fields) => { if (valid) { if (teacherInfo.agree) { - subLoading.value = true; + subLoading.value = true if (topicMessageList.value.length > 0) { let dataRequests = tool.UpdateworksDataBytool( worksInfo.value, topicMessageList.value, teacherInfo, - fileList.value - ); + fileList.value, + ) const data = { - description: "", - icon: "", + description: '', + icon: '', id: topicId.value, - topicIdOrRefCode: "teacherRoleApproval", - name: teacherInfo.fullName + "", - content: "", - state: "WaitAudit", - type: "teacherRegister", + topicIdOrRefCode: 'teacherRoleApproval', + name: teacherInfo.fullName + '', + content: '', + state: 'WaitAudit', + type: 'teacherRegister', newDataRequests: dataRequests.newData, updateDataRequests: dataRequests.updateData, delDataRequest: { ids: [], }, - }; - let basicInfo = JSON.parse(JSON.stringify(teacherInfo)); - delete basicInfo.worksInfo; - delete basicInfo.state; + } + let basicInfo = JSON.parse(JSON.stringify(teacherInfo)) + delete basicInfo.worksInfo + delete basicInfo.state const userInfo = { requests: [ { data: JSON.stringify(basicInfo), - name: teacherInfo.fullName + "", - type: "newTeacherInfo", + name: teacherInfo.fullName + '', + type: 'newTeacherInfo', }, ], - }; + } MG.identity.setAppUserInfo(userInfo).then((res) => { if (res) { MG.ugc.updateTopicMessage(data).then(() => { if (res !== false) { ElMessage({ - message: "鎻愪氦鎴愬姛锛佽绛夊緟瀹℃牳...", - type: "success", - }); - teacherDialog.value = false; - subLoading.value = false; - newGetTeacherInfo(); + message: '鎻愪氦鎴愬姛锛佽绛夊緟瀹℃牳...', + type: 'success', + }) + teacherDialog.value = false + subLoading.value = false + newGetTeacherInfo() } else { - subLoading.value = false; + subLoading.value = false } - }); + }) } else { - subLoading.value = true; + subLoading.value = true } - }); + }) } else { const data = { - topicIdOrRefCode: "teacherRoleApproval", - name: teacherInfo.fullName + "", - content: "", - state: "WaitAudit", - type: "teacherRegister", - cmsTypeRefCode: "teacherCertification", - newDataListRequest: tool.worksDataBytool( - worksInfo.value, - teacherInfo, - fileList.value - ), - }; + topicIdOrRefCode: 'teacherRoleApproval', + name: teacherInfo.fullName + '', + content: '', + state: 'WaitAudit', + type: 'teacherRegister', + cmsTypeRefCode: 'teacherCertification', + newDataListRequest: tool.worksDataBytool(worksInfo.value, teacherInfo, fileList.value), + } - let basicInfo = JSON.parse(JSON.stringify(teacherInfo)); - delete basicInfo.worksInfo; - delete basicInfo.state; + let basicInfo = JSON.parse(JSON.stringify(teacherInfo)) + delete basicInfo.worksInfo + delete basicInfo.state const userInfo = { requests: [ { data: JSON.stringify(basicInfo), - name: teacherInfo.fullName + "", - type: "teacherInfo", + name: teacherInfo.fullName + '', + type: 'teacherInfo', }, ], - }; + } MG.identity.setAppUserInfo(userInfo).then((res) => { MG.ugc.newTopicMessage(data).then(() => { if (res !== false) { ElMessage({ - message: "鎻愪氦鎴愬姛锛佽绛夊緟瀹℃牳...", - type: "success", - }); - teacherDialog.value = false; - newGetTeacherInfo(); - subLoading.value = false; + message: '鎻愪氦鎴愬姛锛佽绛夊緟瀹℃牳...', + type: 'success', + }) + teacherDialog.value = false + newGetTeacherInfo() + subLoading.value = false } else { - subLoading.value = false; + subLoading.value = false } - }); - }); + }) + }) } } else { ElMessage({ - message: "璇峰悓鎰忋�婃暀甯堣璇佹湇鍔℃潯娆俱�嬶紒", - type: "warning", - }); + message: '璇峰悓鎰忋�婃暀甯堣璇佹湇鍔℃潯娆俱�嬶紒', + type: 'warning', + }) } } - }); -}; + }) +} //鍘熷洜鏌ョ湅 -const dialogReason = ref(false); -const reasonTxt = ref(""); +const dialogReason = ref(false) +const reasonTxt = ref('') const lookReason = () => { - dialogReason.value = true; -}; -defineExpose({ getUserRole }); + dialogReason.value = true +} +defineExpose({ getUserRole }) </script> <style lang="less"> .myDialog { @@ -737,7 +713,7 @@ } .body-box { padding: 10px 20px 40px; - height: 80vh; + height: 70vh; overflow-y: auto; } @@ -760,7 +736,7 @@ padding: 15px; border-top: 1px solid #f4f4f4; text-align: right; - height: 63px; + box-sizing: border-box; } .myDialog-footer { @@ -784,6 +760,7 @@ .main { font-weight: bold; text-align: center; + color: #019e58; } } @@ -831,7 +808,7 @@ } .fileList .fileImgBox:hover { - border-color: #019E58; + border-color: #019e58; } .agree-msg { @@ -842,10 +819,14 @@ .agree { margin-left: 5px; + .main { + text-align: center; + color: #019e58; + } } .term { - color: #019E58; + color: #019e58; } } .reason { diff --git a/src/views/personalCenter/userInfo.vue b/src/views/personalCenter/userInfo.vue index ef1bb0f..3f2c5c2 100644 --- a/src/views/personalCenter/userInfo.vue +++ b/src/views/personalCenter/userInfo.vue @@ -8,7 +8,7 @@ <div class="info-box flex"> <span class="label">鐢ㄦ埛鍚嶏細</span> <span class="text">{{ userStore?.userInfo.name }}</span> - <span class="change-info hover" @click="changeUserInfo('password')">淇敼瀵嗙爜</span> + <!-- <span class="change-info hover" @click="changeUserInfo('password')">淇敼瀵嗙爜</span> --> </div> <div class="info-box flex"> <span class="label">寰俊璁よ瘉:</span> @@ -28,7 +28,7 @@ userStore?.userInfo?.phoneNumber ? '鏇存崲鎵嬫満鍙�' : '缁戝畾' }}</span> </div> - <div class="info-box flex"> + <!-- <div class="info-box flex"> <span class="label">閭锛�</span> <span class="text">{{ userStore?.userInfo?.Email ? userStore.userInfo?.Email : '--' @@ -36,21 +36,9 @@ <span class="change-info hover" @click="changeUserInfo('email')">{{ userStore?.userInfo?.Email ? '鏇存崲閭' : '缁戝畾閭' }}</span> - </div> + </div> --> </div> </div> - <!-- <div class="content-item"> - <div class="item-title flex jc-sb"> - <span>鐢ㄦ埛绫诲瀷</span> - <span class="change-info hover" @click="updateUserInfo()">淇敼</span> - </div> - <div class="item-box"> - <div class="info-box flex"> - <span class="label">鐢ㄦ埛绫诲瀷锛�</span> - <span class="text">{{ userInfo.userType }}</span> - </div> - </div> - </div> --> <div class="content-item"> <div class="item-title flex jc-sb"> <span>鏁欏笀璁よ瘉</span> @@ -73,24 +61,12 @@ <span class="text wait" v-if="teacherState == 'WaitAudit'">绛夊緟瀹℃牳</span> <span class="text yes" v-else-if="teacherState == 'Normal'">宸茶璇�</span> <span class="text no" v-else-if="teacherState == 'Reject'">宸查┏鍥�</span> - <span class="text wait" v-if="teacherState === ''">寰呰璇�</span> + <span class="text no" v-if="teacherState === ''">寰呰璇�</span> </div> <div v-if="teacherState == 'Reject'"> <span class="title">椹冲洖鍘熷洜</span> : <span @click="lookReason()" class="wait hover">鏌ョ湅鍘熷洜</span> </div> - </div> - </div> - </div> - <div class="content-item"> - <div class="item-title flex jc-sb"> - <span>鎴戠殑绉垎</span> - <span class="record hover" @click="recordDialog()">绉垎璁板綍</span> - </div> - <div class="item-box"> - <div class="info-box flex"> - <span class="label">绉垎锛�</span> - <span class="text">{{ userInfo.integral }}</span> </div> </div> </div> @@ -109,7 +85,7 @@ class="myDialogs" @close="closeUserInfoDialog(userFormRef)" > - <div> + <div class="dialog-content"> <el-form ref="userFormRef" :model="userInfoForm" @@ -161,22 +137,6 @@ </el-button> </div> </el-form-item> - <el-form-item label="鏂板瘑鐮侊細" prop="password" v-if="changeType == 'password'"> - <el-input - type="password" - v-model="userInfoForm.password" - autocomplete="off" - placeholder="璇疯緭鍏�8-16浣嶆柊瀵嗙爜,涓斾笉鑳戒负绾暟瀛�" - /> - </el-form-item> - <el-form-item label="纭瀵嗙爜锛�" prop="confirmPassword" v-if="changeType == 'password'"> - <el-input - type="password" - v-model="userInfoForm.confirmPassword" - autocomplete="off" - placeholder="璇疯緭鍏ョ‘璁ゅ瘑鐮�" - /> - </el-form-item> </el-form> </div> <template #footer> @@ -211,7 +171,7 @@ </div> </el-dialog> <!-- 鐢ㄦ埛绫诲瀷淇敼 --> - <login ref="loginRef"></login> + <!-- <login ref="loginRef"></login> --> <!-- 鏌ョ湅鍘熷洜 --> <el-dialog align-center @@ -272,11 +232,12 @@ <script setup lang="ts"> import { reactive, ref, inject, onMounted, watch } from 'vue' import type { FormInstance, FormRules } from 'element-plus' +import verify from '@/components/sliderImg/component/verify.vue' +import '@/components/sliderImg/sliderImg.js' +import '@/components/sliderImg/sliderImg.css' import { ElMessage } from 'element-plus' import { useUserStore } from '@/store' -// import wxlogin from 'vue-wxlogin' import teacherCertification from './teacherCertification.vue' -import login from '@/layout/components/login.vue' const userStore = useUserStore() import moment from 'moment' const MG: any = inject('MG') @@ -1053,6 +1014,11 @@ .myDialogs { width: 628px; + .dialog-content { + padding: 20px 0; + box-sizing: border-box; + } + .el-dialog__header { padding: 15px; margin-right: 0; -- Gitblit v1.9.1