From bb5455da328724ba3b4ccb61da0a71eb5beed016 Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期日, 27 四月 2025 18:08:07 +0800 Subject: [PATCH] 样式修改 --- src/views/chronology/index.vue | 966 ++++++++++++-------------------------------------------- 1 files changed, 207 insertions(+), 759 deletions(-) diff --git a/src/views/chronology/index.vue b/src/views/chronology/index.vue index 1161cbc..57d1426 100644 --- a/src/views/chronology/index.vue +++ b/src/views/chronology/index.vue @@ -30,7 +30,13 @@ <div>鍏朵粬</div> </div> </div> - <div class="contentBox"> + <div + class="contentBox" + element-loading-text="骞磋氨鍔犺浇涓�" + element-loading-spinner="el-icon-loading" + element-loading-background="rgba(0, 0, 0, 0)" + v-loading="!showList" + > <div class="chartsBox"> <div class="chartsItemBox" @@ -43,793 +49,197 @@ class="gradchild" v-for="(citem, cindex) in item.list" :style="{ background: citem.color }" - @mouseover="showDetail(index, cindex, 1)" + @click.stop="showDetail(index, cindex, 1, $event)" :key="cindex" > <div class="detailDialog" v-if="citem.showDetail"> - <!-- <div class="dialogContent" @click="gotoDetail(citem)"> --> + <div + class="closeBtn" + @click.stop="closeDetail(index, cindex, 0)" + > + <i class="el-icon-close"></i> + </div> <floatingWindow :info="citem" /> - <!-- </div> --> </div> </div> </div> - <div class="item-circle"></div> + <div class="item-circle" @click="showYearWindow(index, 1)"></div> <div class="item-text"> <div class=""> - {{ item.year }} + {{ item.name.split("锛�")[0] }} </div> <div style="margin-top: 10px"> - {{ item.name }} + {{ item.age }} </div> + </div> + <div class="yaerWindow" v-if="item.showDetail"> + <div class="closeBtn" @click="closeYearWindow(index, 0)"> + <i class="el-icon-close"></i> + </div> + <yearWindow :info="item" /> </div> </div> </div> </div> + <div></div> </div> </div> </div> </template> <script> -import echarts from "@/assets/js/echarts.min.js"; +import moment from "moment"; import floatingWindow from "./floatingWindow.vue"; +import yearWindow from "./yearWindow.vue"; + export default { components: { floatingWindow, + yearWindow, }, data() { return { - contentList: [ - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1938", - type: "journal", - id: "1", - }, - ], - name: "鍑虹敓", - year: "1938", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - type: "image", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - type: "book", - id: "2", - }, - ], - name: "涓�宀�", - year: "1939", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "2", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - type: "video", - id: "3", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - type: "audio", - id: "4", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - id: "5", - }, - ], - name: "3宀�", - year: "1941", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#6F8F5A", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "2", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - id: "3", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - id: "4", - }, - { - color: "#B9A587", - showDetail: false, - name: "鐜嬫案鐐�", - id: "5", - }, - ], - name: "4宀�", - year: "1941", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - { - list: [ - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#87A7B9", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - { - color: "#CB9D9D", - showDetail: false, - name: "鐜嬫案鐐�", - year: "1937", - id: "1", - }, - ], - name: "5宀�", - year: "1942", - }, - ], + contentList: [], + currentYear: null, + showList: false, + colorList: { + journal: "#87a7b9", + books: "#c48787", + video: "#6f8f5a", + audio: "#b9a587", + newspaper: "#8d77b3", + other: "#009f9f", + }, }; }, + mounted() { + this.getListData(); + }, + methods: { - gotoDetail(item) {}, - showDetail(index, cindex, type) { + showYearWindow(item, event) { + console.log(item, "item"); for (let i = 0; i < this.contentList.length; i++) { const item = this.contentList[i]; - for (let j = 0; j < item.list.length; j++) { - const citem = item.list[j]; - this.$set(citem, "showDetail", false); + this.$set(item, "showDetail", false); + } + this.contentList[item].showDetail = true; + }, + closeYearWindow(item) { + for (let i = 0; i < this.contentList.length; i++) { + const item = this.contentList[i]; + this.$set(item, "showDetail", false); + } + }, + gotoDetail(item) {}, + getListData() { + this.MG.resource + .getItem({ + path: "WYY_chronology", + fields: { + year: [], + age: [], + eventOverview: [], + eventPictures: [], + }, + paging: { + start: 0, + size: 999, + }, + }) + .then(async (res) => { + for (let i = 0; i < res.datas.length; i++) { + const item = res.datas[i]; + this.$set(item, "showDetail", false); + const listData = await this.getYearResource(item); + if (listData.length > 0) { + this.$set(item, "list", listData); + console.log(item, "item"); + } + } + + console.log(this.contentList, "this.contentList"); + this.contentList = res.datas; + this.showList = true; + }); + }, + + async getYearResource(item) { + const endDate = item.year.split("/")[0] + "/12/31 23:59:59"; + const startDate = item.year.split("/")[0] + "/01/01 00:00:00"; + const yearDataList = await this.MG.resource.getItem({ + path: "*", + queryType: "*", + fields: { + "year>=": startDate, + "year<=": endDate, + source: [], + IssueNumber: [], + author: [], + authorsUnits: [], + abstract: [], + keyWords: [], + subjectAffiliation: [], + file: [], + }, + SysType: "CmsItem", + paging: { + start: 0, + size: 999, + }, + }); + const filterList = yearDataList.datas.filter((item) => { + return item.cmsItemType != "chronology" && item.cmsItemType != "AWARD"; + }); + + if (filterList && filterList.length > 0) { + for (let i = 0; i < filterList.length; i++) { + const item = filterList[i]; + if (item.file) { + const requestCtx = + this.config.requestCtx + `/file/api/ApiDownload?md5=${item.file}`; + this.$set(item, "fileLink", requestCtx); + } + this.$set(item, "showDetail", false); + this.$set(item, "color", this.colorList[item.cmsItemType]); } } - if (type == 1) { - this.contentList[index].list[cindex].showDetail = true; - } else { - this.contentList[index].list[cindex].showDetail = false; + + if (filterList.length > 0) { + console.log(filterList, "filterList"); } + return filterList; + }, + closeDetail(index, cindex, type) { + for (let i = 0; i < this.contentList.length; i++) { + const item = this.contentList[i]; + if (item && item.length > 0) { + for (let j = 0; j < item.list.length; j++) { + const citem = item.list[j]; + this.$set(citem, "showDetail", false); + } + } + } + this.contentList[index].list[cindex].showDetail = false; + }, + showDetail(index, cindex, type, event) { + console.log(event, "event"); + for (let i = 0; i < this.contentList.length; i++) { + const item = this.contentList[i]; + if (item && item.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 (this.contentList[index].list[cindex].type) { + this.contentList[index].list[cindex].showDetail = true; + } + console.log(this.contentList[index].list, "this.contentList[index].list[cindex]"); }, }, }; @@ -873,6 +283,12 @@ display: flex; align-items: end; overflow: auto; + + ::v-deep .el-loading-spinner .el-loading-text { + font-size: 14px; + color: #937950; + } + .chartsBox { white-space: nowrap; padding: 0 80px; @@ -885,7 +301,7 @@ // } /* 瀵逛簬WebKit娴忚鍣ㄥ拰Blink寮曟搸锛堝Chrome, Opera锛� */ ::-webkit-scrollbar { - width: 16px; /* 婊氬姩鏉$殑瀹藉害 */ + width: 4px; /* 婊氬姩鏉$殑瀹藉害 */ height: 16px; /* 婊氬姩鏉$殑楂樺害 */ } @@ -895,7 +311,8 @@ ::-webkit-scrollbar-thumb { background: #b9a587; /* 婊氬姩鏉℃粦鍧楃殑棰滆壊 */ - border-radius: 16px; /* 婊氬姩鏉℃粦鍧楃殑鍦嗚 */ + border-radius: 2px; /* 婊氬姩鏉℃粦鍧楃殑鍦嗚 */ + width: 4px; } ::-webkit-scrollbar-thumb:hover { @@ -904,14 +321,14 @@ } } .page-header { - height: 102px; + height: 9.4%; width: 100%; text-align: left; margin-bottom: 8px; border-bottom: 2px solid #937950; p { - padding: 35px 0 34px 0; + padding: 1.6% 0 1.55% 0; font-family: Alimama DongFangDaKai; font-size: 30px; text-indent: 1em; @@ -929,6 +346,7 @@ .chartsItem { width: 100%; height: 100%; + position: relative; } .item-grad { @@ -946,6 +364,14 @@ position: relative; } +.gradchild:hover { + width: 25px; + height: 25px; + margin-top: 2px; + margin-right: 2px; + cursor: pointer; + position: relative; +} .item-circle { width: 100%; height: 20px; @@ -988,10 +414,10 @@ } .detailDialog { position: absolute; - // left: -54px; - // bottom: 50px; - top: -550%; - width: 400px; + top: -700%; + transform: translateY(20%); + transform: translateX(-50%); + width: 524px; z-index: 9999; cursor: pointer; background: #fff; @@ -999,13 +425,35 @@ box-shadow: 2px 2px 4px 1px rgba(0, 0, 0, 0.5); } +.yaerWindow { + position: absolute; + left: -54px; + bottom: 50px; + width: 700px; + z-index: 9999; + cursor: pointer; + background: #fff; + 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: 15px; + padding: 5px; z-index: 20; box-sizing: border-box; } +.closeBtn { + position: absolute; + width: 20px; + height: 20px; + top: 10px; + right: 5px; + z-index: 999; +} +::v-deep .el-loading-spinner { + color: #937950 !important; +} </style> -- Gitblit v1.9.1