|
|
@@ -32,11 +32,11 @@
|
|
|
</view>
|
|
|
<view class="m_right_footer">
|
|
|
<view class="m_paging">
|
|
|
- <text selectable="true"class="m_paging_item m_paging_upper" @click="onClick_last" v-show="pageCount>1">上一页</text>
|
|
|
- <text selectable="true"class="m_paging_item" :key="i" v-for="i in pageCount" @click="paging(i)" :class="i==index?'p_act':''">
|
|
|
+ <text selectable="true"class="m_paging_item m_paging_upper" @click="onClick_last" v-show="currentPage>1">上一页</text>
|
|
|
+ <text selectable="true"class="m_paging_item" :key="i" v-for="i in currentPage" @click="paging(i)" :class="i==currentPage?'p_act':''">
|
|
|
{{i}}
|
|
|
</text>
|
|
|
- <text selectable="true"class="m_paging_item m_paging_lower" @click="onClick_next" v-show="pageCount>1">下一页</text>
|
|
|
+ <text selectable="true"class="m_paging_item m_paging_lower" @click="onClick_next" v-show="currentPage>1">下一页</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -51,6 +51,7 @@
|
|
|
</view>
|
|
|
<view class="addStu-addBox df jcfe">
|
|
|
<button class="addStu-addBtn df jcc aic" @click="onClick_addStu_add">添加</button>
|
|
|
+ <button class="addStu-addBtn df jcc aic" @click="onClick_cancel">取消</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -63,10 +64,18 @@
|
|
|
data() {
|
|
|
return {
|
|
|
isShowAdd: false,
|
|
|
+
|
|
|
+ pageTotalNum:1,
|
|
|
+ currentPage:1,
|
|
|
+ totalItem:2,
|
|
|
+ // dataUsers_all: [],
|
|
|
+ bShowLastPageBtn:false,
|
|
|
+ bShowNextPageBtn:false,
|
|
|
+
|
|
|
//当前页数
|
|
|
- index: 1,
|
|
|
+ // index: 1,
|
|
|
//总计页数
|
|
|
- pageCount: 0,
|
|
|
+ // currentPage: 0,
|
|
|
//所有学生
|
|
|
allStudent: null,
|
|
|
//当前页学生
|
|
|
@@ -86,37 +95,100 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- paging(index) {
|
|
|
- this.index = index;
|
|
|
- this.updateTable();
|
|
|
- },
|
|
|
- onClick_last() {
|
|
|
- if (this.index > 1) {
|
|
|
- this.index--;
|
|
|
- this.updateTable();
|
|
|
+ paging(i) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+
|
|
|
+ let fromIndex = this.totalItem*(i-1);
|
|
|
+ let toIndex = fromIndex+this.totalItem;
|
|
|
+
|
|
|
+ let data = {
|
|
|
+ "UserID": mydata_userInfo.userID,
|
|
|
+ "BeginNum": fromIndex, //用户数组索引
|
|
|
+ "EndNum": toIndex, //用户数组索引结束
|
|
|
}
|
|
|
+
|
|
|
+ uni.request({
|
|
|
+ header: {
|
|
|
+ 'Content-Type': 'application/json;charset=UTF-8'
|
|
|
+ },
|
|
|
+ url: mydata_api + '/user/getallstudent',
|
|
|
+ method: 'POST',
|
|
|
+ data: data,
|
|
|
+ dataType: 'json',
|
|
|
+ success: (res) => {
|
|
|
+ //100成功
|
|
|
+ if (res.data.Code == 100) {
|
|
|
+ console.log("请求全部资产", res);
|
|
|
+ this.allStudent = res.data.Items;
|
|
|
+ this.pageTotalNum = Math.ceil(res.data.AllOfItem/this.totalItem);
|
|
|
+ this.currentPage = i;
|
|
|
+ this.showNextOrLastPageBtn();
|
|
|
+ }
|
|
|
+ //200失败
|
|
|
+ else {
|
|
|
+ console.log('suc200', res);
|
|
|
+ }
|
|
|
+ uni.hideLoading();
|
|
|
+ },
|
|
|
+ fail: (res) => {
|
|
|
+ console.log("请求失败****");
|
|
|
+ uni.hideLoading();
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
- onClick_next() {
|
|
|
- if (this.index < this.pageCount) {
|
|
|
- this.index++;
|
|
|
- this.updateTable();
|
|
|
+ initPage() {
|
|
|
+ this.paging(1);
|
|
|
+ },
|
|
|
+ onClick_last()
|
|
|
+ {
|
|
|
+ this.currentPage--;
|
|
|
+ this.paging(this.currentPage);
|
|
|
+ },
|
|
|
+ onClick_next()
|
|
|
+ {
|
|
|
+ this.currentPage++;
|
|
|
+ this.paging(this.currentPage);
|
|
|
+ },
|
|
|
+ showNextOrLastPageBtn()
|
|
|
+ {
|
|
|
+ if(this.pageTotalNum==this.currentPage)
|
|
|
+ {
|
|
|
+ this.bShowLastPageBtn = true;
|
|
|
+ this.bShowNextPageBtn = false;
|
|
|
+ }
|
|
|
+ else if(1==this.currentPage)
|
|
|
+ {
|
|
|
+ this.bShowLastPageBtn = false;
|
|
|
+ this.bShowNextPageBtn = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ this.bShowLastPageBtn = true;
|
|
|
+ this.bShowNextPageBtn = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.pageTotalNum==1){
|
|
|
+ this.bShowLastPageBtn = false;
|
|
|
+ this.bShowNextPageBtn = false;
|
|
|
}
|
|
|
},
|
|
|
onClick_addStudent() {
|
|
|
this.isShowAdd = true;
|
|
|
},
|
|
|
updateInfo() {
|
|
|
- this.index = 1;
|
|
|
+ // this.index = 1;
|
|
|
this.allStudent = userController.studentList;
|
|
|
// console.log('this.allStudent=',this.allStudent)
|
|
|
- this.pageCount = Math.ceil(this.allStudent.length / 7);
|
|
|
+ // this.currentPage = Math.ceil(this.allStudent.length / 7);
|
|
|
this.updateTable();
|
|
|
// console.log("学生管理,更新页面", this.allStudent);
|
|
|
},
|
|
|
updateTable() {
|
|
|
this.curPageStudentList = [];
|
|
|
for (let i = 0; i < 7; i++) {
|
|
|
- let student = this.allStudent[(this.index - 1) * 7 + i];
|
|
|
+ let student = this.allStudent[(this.currentPage - 1) * 7 + i];
|
|
|
if (student) {
|
|
|
let astudent = {
|
|
|
"userName": student.IlabAccount,
|
|
|
@@ -150,6 +222,11 @@
|
|
|
userController.updateStudentList(self.updateInfo,null)
|
|
|
}, null);
|
|
|
},
|
|
|
+ onClick_cancel(){
|
|
|
+ this.isShowAdd = false;
|
|
|
+ this.addStudentData = {};
|
|
|
+ userController.updateStudentList(this.updateInfo,null)
|
|
|
+ },
|
|
|
onClick_XSSYQK(studentI){
|
|
|
// console.log("实验情况studentI=",studentI);
|
|
|
let UserID = this.allStudent[studentI].UserID;
|
|
|
@@ -280,11 +357,11 @@
|
|
|
line-height: 140rpx;
|
|
|
}
|
|
|
|
|
|
- tbody tr:hover {
|
|
|
- // color: #fff;
|
|
|
- background: #FDEBEC;
|
|
|
- // opacity: 0.08;
|
|
|
- }
|
|
|
+ // tbody tr:hover {
|
|
|
+ // // color: #fff;
|
|
|
+ // background: #FDEBEC;
|
|
|
+ // // opacity: 0.08;
|
|
|
+ // }
|
|
|
|
|
|
.m-table-hander {
|
|
|
background-color: #FFF8F7;
|