From 4d02d50d41965a71c83272a2d020b864914261f1 Mon Sep 17 00:00:00 2001 From: zxj Date: Sun, 16 Nov 2025 15:40:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=A4=BE=E6=8B=9B=E6=96=B0=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E9=A1=B9=E7=9B=AE=E5=AD=A6=E4=B9=A0=E9=A1=B5=E7=BB=86?= =?UTF-8?q?=E8=8A=82=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomInfoMessage.vue | 112 +++ src/components/NewEmployeeGuideDialog.vue | 12 +- src/components/PortalHeader.vue | 2 +- src/main.js | 65 +- src/views/new-employee/StudyPage.vue | 159 ++-- src/views/new-employee/WelcomePage.vue | 24 +- src/views/portal/course/Index.vue | 1020 +++++++++++++-------- 7 files changed, 905 insertions(+), 489 deletions(-) create mode 100644 src/components/CustomInfoMessage.vue diff --git a/src/components/CustomInfoMessage.vue b/src/components/CustomInfoMessage.vue new file mode 100644 index 00000000..98afcc05 --- /dev/null +++ b/src/components/CustomInfoMessage.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/src/components/NewEmployeeGuideDialog.vue b/src/components/NewEmployeeGuideDialog.vue index cf282c30..9f71ab2a 100644 --- a/src/components/NewEmployeeGuideDialog.vue +++ b/src/components/NewEmployeeGuideDialog.vue @@ -19,10 +19,16 @@ type="primary" :loading="processing" @click="handleConfirmClick" + v-if="showBtn" > 立即学习 - + 取消 @@ -46,6 +52,10 @@ export default { type: Boolean, default: false, }, + showBtn: { + type: Boolean, + default: true, + }, onConfirm: { type: Function, default: null, diff --git a/src/components/PortalHeader.vue b/src/components/PortalHeader.vue index 99349f05..28eac5e7 100644 --- a/src/components/PortalHeader.vue +++ b/src/components/PortalHeader.vue @@ -429,7 +429,7 @@ export default { two: urlPre + "/grow180/login", three: this.webBaseUrl + "/study/index?study=1", // four: 'https://m.qingxuetang.com/x/?appId=qxtcorp306130', - five: urlPre + "/new-employee/welcome", + five: this.webBaseUrl + "/new-employee/welcome", six: this.webBaseUrl + "/web/contributor/index", seven: this.webBaseUrl + "/grateful/index", }; diff --git a/src/main.js b/src/main.js index 3c3b4968..e262db19 100644 --- a/src/main.js +++ b/src/main.js @@ -20,8 +20,8 @@ import '@/assets/styles/uc.scss' // global css import Pagination from "@/components/Pagination"; import Remark from "@/components/Remark"; import './security'; //security control -import VueAwesomeSwiper from 'vue-awesome-swiper'; -import 'swiper/dist/css/swiper.css'; +import VueAwesomeSwiper from 'vue-awesome-swiper'; +import 'swiper/dist/css/swiper.css'; Vue.use(VueAwesomeSwiper) import watermark from './utils/warterMark.js' import Bus from './utils/bus.js' @@ -35,44 +35,44 @@ Vue.config.productionTip = false Vue.prototype.$xpage = xpage; -Vue.prototype.msgSuccess = function(msg) { - this.$message({ showClose: true, message: msg, type: "success", offset: 50 }); +Vue.prototype.msgSuccess = function (msg) { + this.$message({ showClose: true, message: msg, type: "success", offset: 50 }); } //用来筛选图标是否显示的方法,字符串和数组都支持,如果传入其他值或者不传值图标全显示 -Vue.prototype.$iconFilter = function(hideArray) { - let iconOpinion = { - isRemark: false, - isShare: false, - isCollect: false, - isPraise: false, - isBrowse: false - } - if (typeof hideArray == 'string') { - iconOpinion[hideArray] = true - } - if (hideArray instanceof Array) { - hideArray.forEach(item => { - iconOpinion[item] = true; - }) - } - return iconOpinion +Vue.prototype.$iconFilter = function (hideArray) { + let iconOpinion = { + isRemark: false, + isShare: false, + isCollect: false, + isPraise: false, + isBrowse: false + } + if (typeof hideArray == 'string') { + iconOpinion[hideArray] = true + } + if (hideArray instanceof Array) { + hideArray.forEach(item => { + iconOpinion[item] = true; + }) + } + return iconOpinion } -Vue.prototype.msgError = function(msg) { - this.$message({ showClose: true, message: msg, type: "error" }); +Vue.prototype.msgError = function (msg) { + this.$message({ showClose: true, message: msg, type: "error" }); } -Vue.prototype.msgInfo = function(msg) { - this.$message.info(msg); +Vue.prototype.msgInfo = function (msg) { + this.$message.info(msg); } //高亮显示 -Vue.prototype.$keywordActiveShow=function(str,keyword){ +Vue.prototype.$keywordActiveShow = function (str, keyword) { //color:#588afc暂时用老系统颜色,ui给的颜色是这个值 - if(!str||str.indexOf(keyword)===-1||keyword==''){ + if (!str || str.indexOf(keyword) === -1 || keyword == '') { return str } - return str.replace(keyword,`${keyword}`) + return str.replace(keyword, `${keyword}`) } Vue.prototype.webBaseUrl = process.env.VUE_APP_PUBLIC_PATH; @@ -83,9 +83,10 @@ Vue.component('Remark', Remark) Vue.use(Element, { - size: VueCookies.get('size') || 'medium' // set element-ui default size + size: VueCookies.get('size') || 'medium' // set element-ui default size }) +// VueCookies.set('token', "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJjb21wYW55Q29kZSI6IkMwMDEiLCJ1SWQiOiI5NjUzNDIwMjc0OTc2MDcxNjgiLCJjb21wYW55SWQiOiIxMDQxNjczOTc3Mzc5OTQ2NDk2IiwibG9naW5JZCI6IjE5MzgwNTQ2NDY2OTAxNzcwMjYiLCJpc3MiOiJodHRwOi8vdS5ib2UuY29tIiwiR2l2ZW5OYW1lIjoiYm9ldSIsImV4cCI6MTc1MDkxMDQwOTc0NiwidXNlck5hbWUiOiLmnY7njonlhrAiLCJ1c2VySWQiOiI2QjA0OUZBRi1DMzE0LTdDQ0YtMEQyOC0wRDIzRjRDNDI1MzEifQ==.7f03d1ce991253197f0e733ba554496e8de715595b169b505bed8831ede565a9", 1) // 加入百度统计 router.beforeEach((to, from, next) => { if (to.path) { @@ -97,7 +98,7 @@ router.beforeEach((to, from, next) => { }) new Vue({ - router, - store, - render: h => h(App) + router, + store, + render: h => h(App) }).$mount('#app') diff --git a/src/views/new-employee/StudyPage.vue b/src/views/new-employee/StudyPage.vue index 25a1e65a..7e324060 100644 --- a/src/views/new-employee/StudyPage.vue +++ b/src/views/new-employee/StudyPage.vue @@ -61,21 +61,23 @@
{{ it.name }}
-
+
未开始 + 进行中 已完成
@@ -127,32 +129,37 @@ >
- - - -
- +
+ + + +
+
+ + + +
+
+ + +
@@ -162,8 +169,14 @@
成绩单
- 成 绩 下 载成绩下载
学习进度
@@ -205,10 +218,12 @@ @@ -217,6 +232,8 @@
+ +
@@ -225,6 +242,7 @@ import portalHeader from "@/components/PortalHeader.vue"; import portalFooter from "@/components/PortalFooter.vue"; import portalFloatTools from "@/components/PortalFloatTools.vue"; import NewEmployeeGuideDialog from "@/components/NewEmployeeGuideDialog.vue"; +import CustomInfoMessage from "@/components/CustomInfoMessage.vue"; import { mapGetters } from "vuex"; import { getWelcomeData, @@ -232,6 +250,7 @@ import { getStuProjectProcess, downloadSocialRecruitReport, getSzxygProjectInfo, + enrollRequest, } from "@/api/new-employee/newEmployee"; import { start } from "nprogress"; @@ -242,13 +261,14 @@ export default { portalFooter, portalFloatTools, NewEmployeeGuideDialog, + CustomInfoMessage, }, data() { return { flag: "all", status: "all", page: 1, - pageSize: 10, + pageSize: 20, total: 0, loading: false, projectId: "", @@ -276,6 +296,12 @@ export default { }, computed: { ...mapGetters(["userInfo"]), + // 判断下载按钮是否应该禁用 + isDownloadDisabled() { + // 只有在审核通过(3)且学习进度为100时才可下载 + // 其他情况(报名失败1、审核中2、审核失败4、进度未到100)都禁用 + return this.approvalResults != 3 || this.progressRing.total != 100; + }, }, methods: { async initIds() { @@ -343,24 +369,24 @@ export default { ); }, async onDownload() { - if (!this.projectId || !this.studentId) { - this.$message.warning("缺少项目信息或学员信息"); - return; - } + // if (!this.projectId || !this.studentId) { + // this.$message.warning("缺少项目信息或学员信息"); + // return; + // } if (this.approvalResults != 2) { - this.$message.warning( - "您的报名正在审核中,无法下载成绩单,请审核通过后下载" - ); + // this.$refs.customMessage.show( + // "您的报名正在审核中,无法下载成绩单,请审核通过后下载" + // ); return; } if (this.approvalResults != 4) { - this.$message.warning( - "请您重新报名,重新报名不影响当前学习进度,请在审核通过后下载成绩单" - ); + // this.$refs.customMessage.show( + // "请您重新报名,重新报名不影响当前学习进度,请在审核通过后下载成绩单" + // ); return; } if (this.progressRing.total != 100) { - this.$message.warning("请您完成学习课程后下载成绩单"); + // this.$message.warning("请您完成学习课程后下载成绩单"); return; } try { @@ -375,15 +401,22 @@ export default { this.$message.error("下载失败"); } }, - returnEnroll() { - this.$router.push("/new-employee/welcome"); + async returnEnroll() { + // this.$router.push("/new-employee/welcome"); + const res = await enrollRequest(); + if (res.data.sendToOaSuccess != 0) { + this.$refs.customMessage.show("报名失败,请联系XXXX,联系方式:XXXXXX"); + } else { + this.$refs.customMessage.show("您已重新报名成功"); + this.approvalResults = 2; + } }, }, async mounted() { const res = await getWelcomeData(); // 社招新员工项目标识:0否,1是 if (res.data.approvalResults == 1) { - this.$message.error("未报名或报名失败,请前往报名页面进行报名"); + this.$refs.customMessage.show("未报名或报名失败,请前往报名页面进行报名"); this.$router.push("/new-employee/welcome"); } // 1报名失败、2审核中、3审核通过、4审核失败 @@ -448,7 +481,7 @@ export default { /* 筛选条 */ .filters { - padding: 8px 12px; + padding: 0px 12px 8px; display: flex; gap: 24px; align-items: center; @@ -600,12 +633,6 @@ export default { text-align: right; font-size: 14px; } -.item-right.link { - color: #0f80ff; -} -.item-right.done { - color: #8a8f99; -} .item-right.score { font-weight: 700; } @@ -665,7 +692,7 @@ export default { /* 单选按钮组胶囊皮肤(替代 Tabs),保持外观一致 */ .pill-radios { - padding-top: 8px; + padding-top: 20px; } .pill-radios >>> .el-radio-button__inner { background: #f3f5f8; @@ -733,8 +760,8 @@ export default { font-weight: 600; } .btn-outline { - background: #ffffff; - color: rgba(0, 120, 252, 1); + background: rgba(0, 120, 252, 1); + color: #fff; border: 1px solid rgba(0, 120, 252, 1); width: 120px; } @@ -754,6 +781,18 @@ export default { color: #ffffff; box-shadow: 0 2px 8px rgba(26, 192, 127, 0.35); } +.btn-long.btn-disabled, +.btn-long:disabled { + background: #cccccc !important; + color: #ffffff !important; + cursor: not-allowed !important; + box-shadow: none !important; +} +.btn-long.btn-disabled:hover, +.btn-long:disabled:hover { + background: #cccccc !important; + transform: none !important; +} .progress-circles { display: flex; diff --git a/src/views/new-employee/WelcomePage.vue b/src/views/new-employee/WelcomePage.vue index 54f8310d..37ad9cd3 100644 --- a/src/views/new-employee/WelcomePage.vue +++ b/src/views/new-employee/WelcomePage.vue @@ -67,6 +67,8 @@ :onCancel="() => (infoConfirmDialogVisible = false)" @close="handleDialogClose" /> + + @@ -74,10 +76,11 @@ import { mapGetters } from "vuex"; import { getWelcomeData, enrollRequest } from "@/api/new-employee/newEmployee"; import NewEmployeeGuideDialog from "@/components/NewEmployeeGuideDialog.vue"; +import CustomInfoMessage from "@/components/CustomInfoMessage.vue"; export default { name: "WelcomePage", - components: { NewEmployeeGuideDialog }, + components: { NewEmployeeGuideDialog, CustomInfoMessage }, data() { return { userName: "", @@ -115,19 +118,22 @@ export default { // 报名按钮点击 async handleEnrollClick() { - this.infoConfirmDialogVisible = true; + if (this.approvalResults == "1" || this.approvalResults == "4") { + const res = await enrollRequest(); + if (res.data.sendToOaSuccess != 0) { + this.$refs.customMessage.show( + "报名失败,请联系XXXX,联系方式:XXXXXX" + ); + return; + } + } else { + this.infoConfirmDialogVisible = true; + } }, // 确认按钮 async handleConfirm() { try { - if (this.approvalResults == "1" || this.approvalResults == "4") { - const res = await enrollRequest(); - if (res.data.sendToOaSuccess != 0) { - this.$message.error("报名失败,请联系XXXX,联系方式:XXXXXX"); - return; - } - } this.$router.push("/new-employee/study"); } catch (error) { console.error("提交失败:", error); diff --git a/src/views/portal/course/Index.vue b/src/views/portal/course/Index.vue index 787b52bb..acb5dde7 100644 --- a/src/views/portal/course/Index.vue +++ b/src/views/portal/course/Index.vue @@ -1,17 +1,26 @@