|
|
@@ -1,47 +1,75 @@
|
|
|
-<!-- -->
|
|
|
<template>
|
|
|
<div class="tab4-5">
|
|
|
<div class="top">
|
|
|
- 学籍查询
|
|
|
<div class="search">
|
|
|
<el-input
|
|
|
- placeholder="姓名搜索"
|
|
|
+ placeholder="请输入学籍号查询"
|
|
|
suffix-icon="el-icon-search"
|
|
|
- v-model="search"
|
|
|
+ v-model="formData.searchKey"
|
|
|
>
|
|
|
</el-input>
|
|
|
<span class="btn" @click="mySearch"></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 内容 -->
|
|
|
- <div class="conten">
|
|
|
- <div class="row" v-for="i in 10" :key="i" @click="$router.push('/tab4-5-1')">
|
|
|
- <img src="../../assets/img/demo.png" alt="" />
|
|
|
- <p>张国荣</p>
|
|
|
+ <div class="conten conNull" v-if="baseTxt && myArr.length === 0">
|
|
|
+ 没有此学员!请确认后重新输入!
|
|
|
+ </div>
|
|
|
+ <div class="conten" v-else>
|
|
|
+ <div
|
|
|
+ class="row"
|
|
|
+ v-for="item in myArr"
|
|
|
+ :key="item.id"
|
|
|
+ @click="lookBigImg(item)"
|
|
|
+ >
|
|
|
+ <img class="imgLook" :src="baseURL + item.thumb" alt="" />
|
|
|
+ <p :title="item.name">{{ item.name }}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 分页 -->
|
|
|
- <!-- :page-sizes="[15, 30, 45, 60]"
|
|
|
- :current-page="from2.pageNum"
|
|
|
- @current-change="currentChange"
|
|
|
- @size-change="sizeChange"
|
|
|
- -->
|
|
|
- <div class="paging">
|
|
|
- <el-pagination layout="prev,pager,next,jumper" :total="100">
|
|
|
- </el-pagination>
|
|
|
+
|
|
|
+ <!-- 点击领导详情 -->
|
|
|
+ <div class="details" v-show="details">
|
|
|
+ <div class="left">
|
|
|
+ <div class="el-icon-arrow-left" @click="details = false"></div>
|
|
|
+ <img :src="baseURL + txtObj.thumb" alt="" v-if='txtObj.thumb'/>
|
|
|
+ <p>{{ txtObj.name }}</p>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <div>
|
|
|
+ <span>基本信息</span>
|
|
|
+ </div>
|
|
|
+ <p>性别:{{ txtObj.sex === "M" ? "男" : "女" }}</p>
|
|
|
+ <p>政治面貌:{{ txtObj.politics }}</p>
|
|
|
+ <p>学籍号:{{ txtObj.num }}</p>
|
|
|
+ <p>专业:{{ txtObj.job }}</p>
|
|
|
+ <div>
|
|
|
+ <span>校园动态</span>
|
|
|
+ </div>
|
|
|
+ <div class="intro" v-html="txtObj.description"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
<script>
|
|
|
+import axios from "@/utils/request";
|
|
|
+import { studentList } from "@/utils/api";
|
|
|
export default {
|
|
|
- name: 'tab4-5',
|
|
|
+ name: "tab4-5",
|
|
|
components: {},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
// 这里存放数据
|
|
|
return {
|
|
|
- search: ''
|
|
|
- }
|
|
|
+ baseTxt: false,
|
|
|
+ details: false,
|
|
|
+ txtObj: {},
|
|
|
+ myArr: [],
|
|
|
+ formData: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 999,
|
|
|
+ searchKey: "",
|
|
|
+ },
|
|
|
+ baseURL: "",
|
|
|
+ };
|
|
|
},
|
|
|
// 监听属性 类似于data概念
|
|
|
computed: {},
|
|
|
@@ -49,31 +77,65 @@ export default {
|
|
|
watch: {},
|
|
|
// 方法集合
|
|
|
methods: {
|
|
|
- mySearch () {
|
|
|
- console.log('点击了搜索')
|
|
|
- }
|
|
|
+ //点击图片,查看详情
|
|
|
+ lookBigImg(val) {
|
|
|
+ this.details = true;
|
|
|
+ this.txtObj = val;
|
|
|
+ },
|
|
|
+ mySearch() {
|
|
|
+ // console.log("点击了搜索");
|
|
|
+ if (this.formData.searchKey.trim() === "")
|
|
|
+ return this.$message.warning("请输入学籍号");
|
|
|
+ this.formData.pageNum = 1;
|
|
|
+ this.studentList(this.formData);
|
|
|
+ },
|
|
|
+ // 封装获取列表函数
|
|
|
+ async studentList(data) {
|
|
|
+ const res = await studentList(data);
|
|
|
+ this.total = res.data.total;
|
|
|
+ this.myArr = res.data.records;
|
|
|
+ this.baseTxt = true;
|
|
|
+ },
|
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created () {},
|
|
|
+ created() {
|
|
|
+ // 获取服务器前缀地址
|
|
|
+ this.baseURL = axios.defaults.baseURL;
|
|
|
+ // this.studentList(this.formData);
|
|
|
+ },
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
- mounted () {},
|
|
|
- beforeCreate () {}, // 生命周期 - 创建之前
|
|
|
- beforeMount () {}, // 生命周期 - 挂载之前
|
|
|
- beforeUpdate () {}, // 生命周期 - 更新之前
|
|
|
- updated () {}, // 生命周期 - 更新之后
|
|
|
- beforeDestroy () {}, // 生命周期 - 销毁之前
|
|
|
- destroyed () {}, // 生命周期 - 销毁完成
|
|
|
- activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
-}
|
|
|
+ mounted() {},
|
|
|
+ beforeCreate() {}, // 生命周期 - 创建之前
|
|
|
+ beforeMount() {}, // 生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, // 生命周期 - 更新之前
|
|
|
+ updated() {}, // 生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, // 生命周期 - 销毁之前
|
|
|
+ destroyed() {}, // 生命周期 - 销毁完成
|
|
|
+ activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang='less' scoped>
|
|
|
+/deep/::-webkit-scrollbar-thumb {
|
|
|
+ background-color: #b9412e !important;
|
|
|
+ outline: 1px solid #b9412e !important;
|
|
|
+ outline-offset: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.conNull {
|
|
|
+ display: flex;
|
|
|
+ font-size: 30px;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ color: #b9412e !important;
|
|
|
+}
|
|
|
.tab4-5 {
|
|
|
- position: relative;
|
|
|
- min-width: 1600px;
|
|
|
- height: 100%;
|
|
|
- padding: 40px 40px 0;
|
|
|
+ // position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: 750px;
|
|
|
+ min-width: 1500px;
|
|
|
color: black;
|
|
|
.top {
|
|
|
+ height: 50px;
|
|
|
position: relative;
|
|
|
width: 100%;
|
|
|
text-align: center;
|
|
|
@@ -81,8 +143,10 @@ export default {
|
|
|
font-size: 26px;
|
|
|
font-weight: 700;
|
|
|
.search {
|
|
|
- right: 140px;
|
|
|
- bottom: 0;
|
|
|
+ width: 500px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ bottom: 0px;
|
|
|
position: absolute;
|
|
|
.btn {
|
|
|
cursor: pointer;
|
|
|
@@ -96,31 +160,109 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.conten {
|
|
|
- width: 1500px;
|
|
|
- margin: 30px auto 0;
|
|
|
+ margin-top: 30px;
|
|
|
+ min-width: 1556px;
|
|
|
+ height: 680px;
|
|
|
display: flex;
|
|
|
- justify-content: start;
|
|
|
flex-wrap: wrap;
|
|
|
+ justify-content: center;
|
|
|
+ overflow-y: auto;
|
|
|
.row {
|
|
|
cursor: pointer;
|
|
|
- margin: 40px 50px;
|
|
|
+ margin: 20px 64px 10px 0;
|
|
|
+ width: 260px;
|
|
|
+ height: 316px;
|
|
|
+
|
|
|
+ & > img {
|
|
|
+ object-fit: cover;
|
|
|
+ border: 2px solid #b9412e;
|
|
|
+ width: 260px;
|
|
|
+ height: 280px;
|
|
|
+ }
|
|
|
+ & > p {
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #b9412e;
|
|
|
+ margin-top: 12px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .row:nth-of-type(5n) {
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .paging {
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ bottom: 20px;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ }
|
|
|
+ .details {
|
|
|
+ background-color: #fff;
|
|
|
+ z-index: 9999;
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ display: flex;
|
|
|
+ // width: calc(100% - 160px);
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ padding: 0px 0 0 80px;
|
|
|
+ color: #707070;
|
|
|
+ .left {
|
|
|
+ margin-right: 100px;
|
|
|
+ padding-top: 50px;
|
|
|
width: 200px;
|
|
|
height: auto;
|
|
|
+ & > div {
|
|
|
+ margin-left: -12px;
|
|
|
+ cursor: pointer;
|
|
|
+ font-size: 50px;
|
|
|
+ margin-bottom: 30px;
|
|
|
+ }
|
|
|
& > img {
|
|
|
width: 200px;
|
|
|
height: 230px;
|
|
|
object-fit: cover;
|
|
|
}
|
|
|
- & > p {
|
|
|
+ & > P {
|
|
|
margin-top: 8px;
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
|
+ .right {
|
|
|
+ flex: 1;
|
|
|
+ padding-top: 100px;
|
|
|
+ & > div {
|
|
|
+ margin-top: 30px;
|
|
|
+ width: 1000px;
|
|
|
+ border-bottom: 1px solid #afafaf;
|
|
|
+ & > span {
|
|
|
+ transform: translateY(2px);
|
|
|
+ width: 105px;
|
|
|
+ border-bottom: 4px solid #b9412e;
|
|
|
+ display: block;
|
|
|
+ height: 50px;
|
|
|
+ font-size: 26px;
|
|
|
+ font-weight: 700;
|
|
|
+ color: #b9412e;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ & > p {
|
|
|
+ margin: 15px 0;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ .intro {
|
|
|
+ padding-top: 15px;
|
|
|
+ margin-top: 0px;
|
|
|
+ height: 450px;
|
|
|
+ overflow-y: auto;
|
|
|
+ border-bottom: none;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- .paging{
|
|
|
- position: absolute;
|
|
|
- left: 50%;
|
|
|
- bottom: 50px;
|
|
|
- transform: translateX(-50%);
|
|
|
- }}
|
|
|
+}
|
|
|
</style>
|