|
@@ -8,7 +8,7 @@
|
|
|
<el-col :span="20" class="main" :offset="2">
|
|
|
|
|
|
<el-table
|
|
|
- :data="applyTeacherList.list"
|
|
|
+ :data="list"
|
|
|
highlight-current-row
|
|
|
size="medium"
|
|
|
border
|
|
@@ -19,9 +19,11 @@
|
|
|
header-align="center"
|
|
|
>
|
|
|
<template scope="scope">
|
|
|
- <img :src='BASE_URL+scope.row.imgUrl' alt="" class="table-img" v-if="scope.row.imgUrl">
|
|
|
- <img src="../../assets/img/user.jpg" alt="" v-if="!scope.row.imgUrl" class="table-img">
|
|
|
- <span class="scope-name">{{scope.row.name}}</span>
|
|
|
+ <div class="scope-list">
|
|
|
+ <img :src='BASE_URL+scope.row.imgUrl' alt="" class="table-img" v-if="scope.row.imgUrl">
|
|
|
+ <img src="../../assets/img/user.jpg" alt="" v-if="!scope.row.imgUrl" class="table-img">
|
|
|
+ <span class="scope-name">{{scope.row.name}}</span>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -36,9 +38,12 @@
|
|
|
header-align="center"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="grade"
|
|
|
+ prop=""
|
|
|
label="批改年级"
|
|
|
header-align="center">
|
|
|
+ <template scope="scope">
|
|
|
+ <span v-for="(v, k) of scope.row.gradeList" :key=k v-if="v">{{v}}</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop=""
|
|
@@ -46,7 +51,7 @@
|
|
|
header-align="center"
|
|
|
>
|
|
|
<template scope="scope">
|
|
|
- <el-button type="info" round>{{scope.row.period}}</el-button>
|
|
|
+ <el-button type="info" round v-for="(v, k) of scope.row.periodList" :key=k v-if="v">{{v}}</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
@@ -116,6 +121,7 @@
|
|
|
hiddenModel:false,
|
|
|
applicantId:'',
|
|
|
operate:'',
|
|
|
+ list:[],
|
|
|
isPigai:false,
|
|
|
options: [
|
|
|
{
|
|
@@ -222,6 +228,22 @@
|
|
|
pageNo: this.filters.pageNo,
|
|
|
pageSize: this.filters.pageSize
|
|
|
});
|
|
|
+ this.applyTeacherList.list = (res => {
|
|
|
+ const d = []
|
|
|
+ for (let i in res) {
|
|
|
+ d.push( {
|
|
|
+ gradeList: this.gradeBag(i),
|
|
|
+ periodList: res[i].period.split(';'),
|
|
|
+ imgUrl: res[i].imgUrl,
|
|
|
+ name: res[i].name,
|
|
|
+ school:res[i].school,
|
|
|
+ teacherId:res[i].teacherId,
|
|
|
+ subject:res[i].subject
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return d
|
|
|
+ })(this.applyTeacherList.list)
|
|
|
+ this.list = this.applyTeacherList.list;
|
|
|
},
|
|
|
//申请审批操作
|
|
|
async ApplyOperate() {
|
|
@@ -247,6 +269,36 @@
|
|
|
s = s < 10 ? ('0' + s) : s;
|
|
|
return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
|
|
|
},
|
|
|
+ // 数组去重
|
|
|
+ uniq(array){
|
|
|
+ var temp = []; //一个新的临时数组
|
|
|
+ for (var i = 0; i < array.length; i++){
|
|
|
+ if (temp.indexOf(array[i]) == -1) {
|
|
|
+ temp.push(array[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return temp;
|
|
|
+ },
|
|
|
+ //年级封装
|
|
|
+ gradeBag:function (res) {
|
|
|
+ var arr = [];
|
|
|
+ if (this.applyTeacherList.list[res].grade) {
|
|
|
+ arr = this.applyTeacherList.list[res].grade.split(',');
|
|
|
+ } else {
|
|
|
+ arr = []
|
|
|
+ }
|
|
|
+ var arrList = [];
|
|
|
+ for (var i in arr) {
|
|
|
+ if (arr[i] == '一年级' || arr[i] == '二年级') {
|
|
|
+ arrList.push('1-2年级')
|
|
|
+ } else if (arr[i] == '三年级' || arr[i] == "四年级") {
|
|
|
+ arrList.push('3-4年级')
|
|
|
+ } else if (arr[i] == '五年级' || arr[i] == "六年级") {
|
|
|
+ arrList.push('5-6年级')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return this.uniq(arrList);
|
|
|
+ },
|
|
|
// 分页
|
|
|
pageChange(val) {
|
|
|
this.filters.pageNo = val;
|
|
@@ -300,16 +352,8 @@
|
|
|
},
|
|
|
mounted() {
|
|
|
this.SuperApplyTeacherList();
|
|
|
- // for (let j in applyTeacherList) {
|
|
|
- // applyTeacherList[j] = (res => {
|
|
|
- // const d = []
|
|
|
- // console.log(res)
|
|
|
- // // for (let i in res) {
|
|
|
- // // d.push({ gradeList: res[i].homeworkPictureUrl, isVague: res[i].isVague})
|
|
|
- // // }
|
|
|
- // return d
|
|
|
- // })(applyTeacherList)
|
|
|
- // }
|
|
|
+
|
|
|
+ console.log(this.list)
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -415,6 +459,10 @@
|
|
|
text-align: center;
|
|
|
margin-top: 15px;
|
|
|
}
|
|
|
+ .scope-list{
|
|
|
+ margin-left: 18px;
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
/*.all_pagination{*/
|
|
|
/*text-align: center !important;*/
|
|
|
/*}*/
|