对接接口

This commit is contained in:
nisen
2023-09-02 14:48:59 +08:00
parent b49b83a7cf
commit 5346f360bc
7 changed files with 219 additions and 291 deletions

View File

@@ -7,12 +7,12 @@
<div class="xcontent2-main">
<div class="navTop">
<div>
<router-link to="/">首页</router-link>&nbsp;>&nbsp;
<router-link to="/grateful">首页</router-link>&nbsp;>&nbsp;
<span style="cursor: pointer;">名师好课</span>
</div>
<div style="position: relative;">
<el-input class="portal-input" placeholder="请输入课程名称" style="border-radius: 20px !important; "
@keyup.enter.native="searchJump()" clearable maxlength="50" v-model="keyword">
@keyup.enter.native="searchJump()" clearable maxlength="50" v-model="params.keyword">
</el-input>
<el-button class="sear-but" @click="searchJump()" type="primary" size="mini">搜索</el-button>
</div>
@@ -26,19 +26,17 @@
<div class="xcontent2-main">
<div class="modules-list" style="margin-top: 0;">
<div class="content">
<el-table :data="pageData" stripe border>
<el-table-column label="课程名称" prop="courseUser" align="center"></el-table-column>
<el-table-column label="课程价值" prop="auditTime" align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="教师名称" prop="auditRemark" align="center" width="200px"
show-overflow-tooltip></el-table-column>
<el-table-column label="教师工号" prop="auditRemark" align="center" width="200px"
show-overflow-tooltip></el-table-column>
<el-table :data="list" stripe border>
<el-table-column label="课程名称" prop="courseName" align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="课程价值" prop="meaning" align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="教师名称" prop="teacherName" align="center" width="150px"></el-table-column>
<el-table-column label="教师工号" prop="teacherNo" align="center" width="150px"></el-table-column>
</el-table>
<div v-if="pageData.length > 0" style="text-align: center;margin-top: 50px;">
<pagination :size="courseList.pageSize" :total="courseList.count" :page="courseList.pageIndex"
@change-size="changePageSize" @change-page="loadData" :autoScroll="false"></pagination>
<pagination style="background-color: rgba(0, 0, 0, 0);" :size="params.pageSize" :total="total"
:page="params.pageNo" @change-size="changePageSize" @change-page="loadData" :autoScroll="false">
</pagination>
</div>
</div>
</div>
</div>
@@ -48,10 +46,10 @@
</template>
<script>
import timeShow from "@/components/Portal/datetimeShow.vue";
import { teachersList } from "../../api/modules/grateful";
export default {
data: () => {
return {
keyword: '',
pageData: [
{
courseUser: '2016-05-02',
@@ -109,34 +107,42 @@ export default {
auditRemark: '上海市普陀区金沙江路 1518 弄'
},
],
courseList: {
list: [],
count: 0,
pageIndex: 1,
total: 0,
list: [],
params: {
pageNo: 1,
pageSize: 10,
},
keyword: '',
}
};
},
components: { timeShow },
mounted() {
this.getTeachersList()
},
methods: {
getTeachersList() {
teachersList(this.params).then((result) => {
console.log(result);
const { total, records } = result.data
this.total = total;
this.list = records;
})
},
searchJump() {
this.params.pageNo = 1
this.getTeachersList()
},
changePageSize(pageSize) {
this.courseList.pageSize = pageSize
loadData(pageNo) {
this.params.pageNo = pageNo
this.getTeachersList()
},
loadData(pageIndex) {
this.pageIndex = pageIndex
},
noticeDetail(item) { },
getPic(index) {
return this.webBaseUrl + "/images/listblue0" + (index + 1) + ".png";
},
changePageSize(pageSize) {
this.courseList.pageSize = pageSize;
},
loadData(pindex) {
console.log(pindex);
this.params.pageSize = pageSize;
this.getTeachersList()
},
},
};
@@ -185,7 +191,7 @@ export default {
}
.modules-list {
min-height: 555px;
// min-height: 555px;
background: #ffffff;
border-radius: 8px;