From 2b8cbeec005f8ac6f65818da28fc239cf82fc716 Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期一, 28 四月 2025 10:50:31 +0800 Subject: [PATCH] 字体文件 --- src/assets/css/base.css | 11 +++ src/views/home/index.vue | 5 + src/assets/font/SourceHanSerifCN-Bold.otf | 0 src/layout/index.vue | 2 src/views/chronology/index.vue | 107 +++++++++++++++++++++++++---------- src/assets/font/SourceHanSerifCN-Regular.otf | 0 src/views/directory/index.vue | 17 ++++- 7 files changed, 107 insertions(+), 35 deletions(-) diff --git a/src/assets/css/base.css b/src/assets/css/base.css index 91c9d9d..8e41ba6 100644 --- a/src/assets/css/base.css +++ b/src/assets/css/base.css @@ -98,6 +98,17 @@ font-family: "LanTing"; src: url(../font/鍏颁涵榛慭 GBK.TTF); } + +@font-face { + font-family: "siyuanBold"; + src: url(../font/SourceHanSerifCN-Bold.otf); +} +@font-face { + font-family: "siyuan"; + src: url(../font/SourceHanSerifCN-Regular.otf); +} + + /* HTML5 display-role reset for older browsers */ article, aside, diff --git a/src/assets/font/SourceHanSerifCN-Bold.otf b/src/assets/font/SourceHanSerifCN-Bold.otf new file mode 100644 index 0000000..77656b1 --- /dev/null +++ b/src/assets/font/SourceHanSerifCN-Bold.otf Binary files differ diff --git a/src/assets/font/SourceHanSerifCN-Regular.otf b/src/assets/font/SourceHanSerifCN-Regular.otf new file mode 100644 index 0000000..c5930e7 --- /dev/null +++ b/src/assets/font/SourceHanSerifCN-Regular.otf Binary files differ diff --git a/src/layout/index.vue b/src/layout/index.vue index f26e3d5..0308721 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,7 +1,7 @@ <template> <div class="homeLayoutBox"> <div class="leftMenu"> - <div class="leftMenuTitle" @click="$router.push('/home')">鐜嬫案鐐庨櫌澹�</div> + <div style="cursor: pointer;" class="leftMenuTitle" @click="$router.push('/home')">鐜嬫案鐐庨櫌澹�</div> <div class="leftMenuContent"> <p>瀛︽湳鎬濇兂浼犳壙</p> <p>澶氱淮搴︽暟鎹簱</p> diff --git a/src/views/chronology/index.vue b/src/views/chronology/index.vue index 57d1426..e202f0f 100644 --- a/src/views/chronology/index.vue +++ b/src/views/chronology/index.vue @@ -49,10 +49,14 @@ class="gradchild" v-for="(citem, cindex) in item.list" :style="{ background: citem.color }" - @click.stop="showDetail(index, cindex, 1, $event)" + @click.self="showDetail(index, cindex, 1, $event)" :key="cindex" > - <div class="detailDialog" v-if="citem.showDetail"> + <div + class="detailDialog" + :style="popupStyle" + v-if="citem.showChildDetail" + > <div class="closeBtn" @click.stop="closeDetail(index, cindex, 0)" @@ -91,6 +95,7 @@ import moment from "moment"; import floatingWindow from "./floatingWindow.vue"; import yearWindow from "./yearWindow.vue"; +import { nextTick } from "vue"; export default { components: { @@ -109,6 +114,10 @@ audio: "#b9a587", newspaper: "#8d77b3", other: "#009f9f", + }, + popupStyle: { + left: "0", + top: "0", }, }; }, @@ -155,6 +164,10 @@ const listData = await this.getYearResource(item); if (listData.length > 0) { this.$set(item, "list", listData); + for (let j = 0; j < listData.length; j++) { + const element = listData[j]; + this.$set(element, "showChildDetail", false); + } console.log(item, "item"); } } @@ -214,32 +227,62 @@ closeDetail(index, cindex, type) { for (let i = 0; i < this.contentList.length; i++) { const item = this.contentList[i]; - if (item && item.length > 0) { + if (item && item.list?.length > 0) { for (let j = 0; j < item.list.length; j++) { const citem = item.list[j]; - this.$set(citem, "showDetail", false); + this.$set(citem, "showChildDetail", false); } } } this.contentList[index].list[cindex].showDetail = false; + + console.log( + this.contentList[index].list, + "this.contentList[index].list[cindex]" + ); }, showDetail(index, cindex, type, event) { - console.log(event, "event"); + const rect = event.target.getBoundingClientRect(); + const screenWidth = window.innerWidth; + const popupWidth = 542; // 鍋囪寮规瀹藉害涓�200px + // 鍒ゆ柇瑙﹀彂鍏冪礌浣嶇疆 + if (rect.left + rect.width / 2 < screenWidth / 2) { + // 宸︿晶鏄剧ず寮规鍦ㄥ彸渚� + this.popupStyle = { + left: `${rect.right}px`, + top: `${rect.bottom - 150}px`, + }; + } else { + // 鍙充晶鏄剧ず寮规鍦ㄥ乏渚� + this.popupStyle = { + left: `${rect.left - popupWidth}px`, + top: `${rect.bottom - 150}px`, + }; + } + console.log(this.popupStyle.top, "this.top"); + console.log(this.popupStyle.left, "this.left"); + // if (rect.left - popupWidth < 0) { + // // 宸︿晶绌洪棿涓嶈冻鏃跺己鍒跺彸渚ф樉绀� + // this.popupStyle.left = `${rect.right}px`; + // } else if (rect.right + popupWidth > screenWidth) { + // // 鍙充晶绌洪棿涓嶈冻鏃跺己鍒跺乏渚ф樉绀� + // this.popupStyle.left = `${rect.left - popupWidth}px`; + // } for (let i = 0; i < this.contentList.length; i++) { const item = this.contentList[i]; - if (item && item.length > 0) { + if (item && item.list?.length > 0) { for (let j = 0; j < item.list.length; j++) { const citem = item.list[j]; - this.$set(citem, "showDetail", false); - item.showDetail = false; + if (citem.showChildDetail) { + this.contentList[i].list[j].showDetail = false; + citem.showChildDetail = false; + } } } } - if (this.contentList[index].list[cindex].type) { - this.contentList[index].list[cindex].showDetail = true; + this.contentList[index].list[cindex].showChildDetail = true; } - console.log(this.contentList[index].list, "this.contentList[index].list[cindex]"); }, }, }; @@ -364,13 +407,18 @@ position: relative; } -.gradchild:hover { - width: 25px; - height: 25px; - margin-top: 2px; - margin-right: 2px; - cursor: pointer; - position: relative; +// .gradchild :hover { +// transform: scale(1.1); +// z-index: 999; +// } + +/* 閲嶇疆瀛愬厓绱犵殑鏍峰紡 */ +// .gradchild:hover .detailDialog { +// transform: scale(1); +// z-index: 999; +// } +.item-circle :hover ::before { + background-color: #b9a587 !important; } .item-circle { width: 100%; @@ -413,10 +461,7 @@ align-items: center; } .detailDialog { - position: absolute; - top: -700%; - transform: translateY(20%); - transform: translateX(-50%); + position: fixed; width: 524px; z-index: 9999; cursor: pointer; @@ -436,15 +481,15 @@ border: 2px solid #cbbeaa; box-shadow: 2px 2px 4px 1px rgba(0, 0, 0, 0.5); } -.detailDialog .dialogContent { - width: 100%; - height: 100%; - background-color: #fff; - position: relative; - padding: 5px; - z-index: 20; - box-sizing: border-box; -} +// .detailDialog .dialogContent { +// width: 100%; +// height: 100%; +// background-color: #fff; +// position: relative; +// padding: 5px; +// z-index: 20; +// box-sizing: border-box; +// } .closeBtn { position: absolute; width: 20px; diff --git a/src/views/directory/index.vue b/src/views/directory/index.vue index b056e02..3b4d41b 100644 --- a/src/views/directory/index.vue +++ b/src/views/directory/index.vue @@ -28,7 +28,7 @@ <!-- 鍥捐〃鏄剧ず --> <div class="charts-main" - v-if="activeTabs == 'chart'" + v-show="activeTabs == 'chart'" v-loading="loading" element-loading-text="鍥捐〃鍔犺浇涓�" element-loading-spinner="el-icon-loading" @@ -134,7 +134,15 @@ 鑱岀О锛歿{ currentNodeInfo.professionalTitle || "-" }} </p> </div> - <div style="text-align: left; line-height: 22px;max-height:200px;overflow-y: auto; padding: 10px;" > + <div + style=" + text-align: left; + line-height: 22px; + max-height: 200px; + overflow-y: auto; + padding: 10px; + " + > <div v-html="currentNodeInfo.studentProfile"></div> </div> <!-- <div @@ -158,7 +166,7 @@ </transition> </div> <!-- 鍒楄〃鏄剧ず --> - <div class="page-main" v-if="activeTabs == 'list'"> + <div class="page-main" v-show="activeTabs == 'list'"> <div v-loading="loading" style="min-height: 550px" @@ -308,6 +316,9 @@ changeTab(key) { this.activeTabs = key; console.log(this.activeTabs, "activeTabs"); + if (key == "chart") { + this.initChart(); + } }, initChart() { this.chart = echarts.init(this.$refs.chart); diff --git a/src/views/home/index.vue b/src/views/home/index.vue index b17288f..9259896 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -129,6 +129,8 @@ background-size: 98% 95%; position: relative; box-sizing: border-box; + font-family: siyuan; + } .bgBox { width: 100%; @@ -206,10 +208,13 @@ font-size: 40px; font-weight: 600; margin-top: 20px; + font-family: siyuan; } .menuSubTitle { font-size: 28px; margin-top: 20px; + font-family: siyuan; + } .menuLine { margin-top: 40px; -- Gitblit v1.9.1