New file |
| | |
| | | <template> |
| | | <div class="login-page"> |
| | | <div class="top-nav"> |
| | | <HeaderNav class="header-main" :logo="true" /> |
| | | </div> |
| | | |
| | | <div class="middleground"> |
| | | <!-- 左侧模块区域 --> |
| | | <div class="left-modules"> |
| | | <!-- 这里将放置四个模块 --> |
| | | <div class="module-item"> |
| | | <!-- 模块内容,例如图标和文字 --> |
| | | <div class="module-icon"></div> |
| | | <div class="module-text">实验室运行模块</div> |
| | | </div> |
| | | <div class="module-item"> |
| | | <div class="module-icon"></div> |
| | | <div class="module-text">专业报告库</div> |
| | | </div> |
| | | <div class="module-item"> |
| | | <div class="module-icon"></div> |
| | | <div class="module-text">化验师QA专题报告库</div> |
| | | </div> |
| | | <div class="module-item"> |
| | | <div class="module-icon"></div> |
| | | <div class="module-text">评定模块</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 右侧日历和待办事项区域 --> |
| | | <div class="right-content"> |
| | | <!-- 日历 --> |
| | | <div class="calendar-section"> |
| | | <!-- <h3>日历</h3> --> |
| | | <el-calendar v-model="date" /> |
| | | </div> |
| | | |
| | | <!-- 待办事项 --> |
| | | <div class="todo-list-section"> |
| | | <div class="title">待办事项</div> |
| | | <!-- 待办事项列表将放置在这里 --> |
| | | <div class="todo-list"> |
| | | <div class="todo-item" v-for="i in 6" :key="i"> |
| | | <div class="todo-details"> |
| | | <div class="notice-card"> |
| | | <div class="todo-icon"> |
| | | </div> |
| | | <div class="red-notice"></div> |
| | | </div> |
| | | |
| | | |
| | | <span class="todo-title">您有 [1] 条 【项目课题方案】 等待审批</span> |
| | | </div> |
| | | <div class="todo-meta"> |
| | | <div class="me"></div> |
| | | <span class="todo-submitter">提交人: 王晓晓</span> |
| | | <div class="time"></div> |
| | | <span class="todo-submitter">2023.12.10 08:00</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { loginReq } from './service' |
| | | import HeaderNav from '../../layouts/components/HeaderNav.vue' |
| | | // 引入 Element UI 的日历组件 |
| | | // import { ElCalendar } from 'element-ui'; |
| | | export default { |
| | | name: 'Login', |
| | | components: { |
| | | HeaderNav, |
| | | // ElCalendar // 注册 ElCalendar 组件 |
| | | }, |
| | | data() { |
| | | return { |
| | | windowWidth: window.innerWidth, |
| | | |
| | | loginForm: { |
| | | username: '', |
| | | password: '' |
| | | }, |
| | | date: new Date(), |
| | | viewWidth: '', |
| | | scale: 1 |
| | | } |
| | | }, |
| | | computed: {}, |
| | | |
| | | created() { }, |
| | | mounted() { }, |
| | | methods: { |
| | | // ...mapActions(['setIsFold']), |
| | | handleKeyDown(event) { |
| | | if (event.key === 'Enter') { |
| | | this.login() |
| | | } |
| | | }, |
| | | // 添加处理窗口大小变化的方法 |
| | | handleResize() { |
| | | this.viewWidth = window.innerWidth |
| | | }, |
| | | login() { |
| | | if (this.loginForm.username == '') { |
| | | this.$message.warning('请输入账号') |
| | | return |
| | | } |
| | | if (this.loginForm.password == '') { |
| | | this.$message.warning('请输入密码') |
| | | return |
| | | } |
| | | loginReq(this.loginForm).then(res => { |
| | | sessionStorage.setItem('token', res.token) |
| | | sessionStorage.setItem('userInfo', JSON.stringify(res.userInfo.user)) |
| | | this.$router.push('/system') |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped lang="less"> |
| | | .flex { |
| | | display: flex; |
| | | } |
| | | |
| | | .j-between { |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .mt-40 { |
| | | margin-top: 40px; |
| | | } |
| | | |
| | | .login-page { |
| | | width: 100%; |
| | | height: 100vh; |
| | | background: url('../../assets/login/midBg.png') no-repeat center center; |
| | | background-size: cover; |
| | | display: flex; |
| | | flex-direction: column; |
| | | // background-attachment: fixed; |
| | | // display: flex; |
| | | // justify-content: center; |
| | | // align-items: center; |
| | | |
| | | .top-nav { |
| | | display: flex; |
| | | // justify-content: space-between; |
| | | width: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | transition: width 0.3s ease-in-out; |
| | | height: 70px; |
| | | |
| | | .header-main { |
| | | height: 70px; |
| | | min-width: 200px; |
| | | } |
| | | } |
| | | |
| | | .middleground { |
| | | flex: 1; |
| | | height: calc(100vh - 70px); |
| | | display: flex; |
| | | justify-content: space-between; |
| | | padding: 20px 20px 20px 108px; |
| | | /* 调整左右内边距 */ |
| | | |
| | | .left-modules { |
| | | width: 38%; |
| | | align-items: center; |
| | | |
| | | // padding: 140px 0; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | box-sizing: content-box; |
| | | justify-content: space-between; |
| | | /* 水平居中 */ |
| | | align-items: center; |
| | | /* 垂直居中 */ |
| | | padding: 100px 0; |
| | | } |
| | | |
| | | .module-item { |
| | | width: 37%; |
| | | height: 30%; |
| | | // width: 307px; |
| | | // height: 307px; |
| | | background-color: red; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | background: url('../../assets/login/cardBg.png'); |
| | | /* 设置模块背景图 */ |
| | | background-size: cover; |
| | | /* 背景图覆盖整个元素 */ |
| | | background-position: center top; |
| | | /* 调整背景图位置:顶部居中 */ |
| | | |
| | | .module-icon { |
| | | width: 80px; |
| | | height: 80px; |
| | | // background-color: #eee; /* Placeholder for icon */ |
| | | z-index: 1; |
| | | /* 确保图标在背景之上 */ |
| | | background-size: contain; |
| | | /* 图标背景图包含在元素内 */ |
| | | background-repeat: no-repeat; |
| | | /* 不重复 */ |
| | | background-position: 100% 100%; |
| | | /* 图标背景图居中 */ |
| | | } |
| | | |
| | | /* 为每个模块图标设置特定的背景图片 */ |
| | | &:nth-child(1) .module-icon { |
| | | background-image: url('../../assets/login/img1.png'); |
| | | } |
| | | |
| | | &:nth-child(2) .module-icon { |
| | | background-image: url('../../assets/login/img2.png'); |
| | | } |
| | | |
| | | &:nth-child(3) .module-icon { |
| | | background-image: url('../../assets/login/img3.png'); |
| | | } |
| | | |
| | | &:nth-child(4) .module-icon { |
| | | background-image: url('../../assets/login/img4.png'); |
| | | } |
| | | |
| | | .module-text { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | position: relative; |
| | | /* 为下划线定位 */ |
| | | z-index: 1; |
| | | /* 确保文字在背景之上 */ |
| | | margin-bottom: 50px; |
| | | |
| | | &::after { |
| | | content: ''; |
| | | position: absolute; |
| | | left: 50%; |
| | | /* 从文字中间开始 */ |
| | | bottom: -5px; |
| | | /* 调整下划线位置 */ |
| | | transform: translateX(-50%); |
| | | /* 使下划线居中 */ |
| | | width: 50%; |
| | | /* 调整下划线宽度 */ |
| | | height: 2px; |
| | | /* 调整下划线粗细 */ |
| | | background-color: #007bff; |
| | | /* 示例下划线颜色 */ |
| | | } |
| | | } |
| | | } |
| | | |
| | | .right-content { |
| | | width: 45%; |
| | | height: calc(100vh - 150px); |
| | | |
| | | display: flex; |
| | | /* 使日历和待办事项垂直排列 */ |
| | | flex-direction: column; |
| | | |
| | | .calendar-section { |
| | | margin-bottom: 20px; |
| | | /* 日历下方间距 */ |
| | | height: 59%; |
| | | padding: 20px; |
| | | border-radius: 14px; |
| | | background: url(../../assets/login/rili.png) no-repeat center; |
| | | |
| | | h3 { |
| | | margin-top: 0; |
| | | margin-bottom: 10px; |
| | | font-size: 18px; |
| | | color: #333; |
| | | } |
| | | |
| | | .calendar { |
| | | height: 100% !important; |
| | | width: 100% !important; |
| | | } |
| | | |
| | | /* 尝试调整 Element UI 日历的样式 */ |
| | | ::v-deep .el-calendar { |
| | | height: 100%; |
| | | width: 100%; |
| | | background: none !important; |
| | | |
| | | .el-calendar__header { |
| | | padding: 12px 0; |
| | | } |
| | | |
| | | .el-calendar__body { |
| | | padding: 0; |
| | | } |
| | | |
| | | .el-calendar-table { |
| | | thead th { |
| | | padding: 5px 0; |
| | | font-weight: normal; |
| | | } |
| | | |
| | | tbody td { |
| | | border: none; |
| | | |
| | | .el-calendar-day { |
| | | /* 调整日期单元格高度 */ |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-radius: 4px; |
| | | /* 圆角 */ |
| | | margin: 2px; |
| | | /* 单元格间距 */ |
| | | cursor: pointer; |
| | | width: 90px; |
| | | |
| | | height: 58px; |
| | | background: #FFFFFF; |
| | | border-radius: 8px; |
| | | border: 1px solid #EDEDED; |
| | | |
| | | &:hover { |
| | | background-color: #f0f0f0; |
| | | } |
| | | } |
| | | |
| | | /* 当前日期样式 */ |
| | | &.is-selected .el-calendar-day { |
| | | background-color: #007bff; |
| | | /* 示例选中颜色 */ |
| | | color: #fff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .todo-list-section { |
| | | height: 32%; |
| | | border-radius: 14px; |
| | | background-color: rgba(255, 255, 255, 1); |
| | | // overflow: auto; |
| | | padding: 24px 34px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .title { |
| | | height: 22px; |
| | | font-family: SourceHanSansCN, SourceHanSansCN; |
| | | font-weight: bold; |
| | | font-size: 18px; |
| | | color: #222222; |
| | | line-height: 22px; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .todo-list { |
| | | flex: 1; |
| | | height: 100%; |
| | | overflow: auto; |
| | | } |
| | | |
| | | /* 待办事项列表样式 */ |
| | | .todo-item { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20PX; |
| | | |
| | | /* 分隔线 */ |
| | | &:first-child { |
| | | margin-top: 3px; |
| | | } |
| | | |
| | | .todo-details { |
| | | display: flex; |
| | | align-content: center; |
| | | } |
| | | |
| | | .notice-card { |
| | | position: relative; |
| | | margin-right: 12px; |
| | | |
| | | } |
| | | |
| | | .todo-icon { |
| | | position: relative; |
| | | width: 24px; |
| | | height: 24px; |
| | | flex-shrink: 0; |
| | | background: url('../../assets//login/notice.png') no-repeat center; |
| | | background-position: center; |
| | | background-size: 100% 100%; |
| | | |
| | | } |
| | | |
| | | .red-notice { |
| | | position: absolute; |
| | | top: -3px; |
| | | right: -3px; |
| | | width: 6px; |
| | | height: 6px; |
| | | border-radius: 50%; |
| | | background: rgba(235, 65, 65, 1); |
| | | } |
| | | |
| | | .todo-title { |
| | | font-family: SourceHanSansCN, SourceHanSansCN; |
| | | font-weight: 500; |
| | | font-size: 14px; |
| | | color: #303133; |
| | | line-height: 24px; |
| | | } |
| | | |
| | | .todo-meta { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .time { |
| | | width: 14px; |
| | | height: 14px; |
| | | margin-right: 6px; |
| | | margin-left: 20px; |
| | | flex-shrink: 0; |
| | | background: url('../../assets//login/time.png') no-repeat center; |
| | | background-position: center; |
| | | background-size: 100% 100%; |
| | | } |
| | | |
| | | .me { |
| | | width: 14px; |
| | | height: 14px; |
| | | margin-right: 6px; |
| | | flex-shrink: 0; |
| | | background: url('../../assets//login/mi.png') no-repeat center; |
| | | background-position: center; |
| | | background-size: 100% 100%; |
| | | } |
| | | |
| | | .todo-submitter { |
| | | font-family: SourceHanSansCN, SourceHanSansCN; |
| | | font-weight: 400; |
| | | font-size: 12px; |
| | | color: #909399; |
| | | // line-height: 18px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | </style> |