Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
|
a5e6218806 | |
|
4f6ca271c0 | |
|
c46475239e |
|
@ -1,6 +1,6 @@
|
|||
// 站点主色
|
||||
// tips: 要达到整站主题修改效果, 请确保[$--color-primary]站点主色与[/src/element-ui-theme/index.js]文件中[import './element-[#17B3A3]/index.css']当前主题色一致
|
||||
$--color-primary: #409EFF;
|
||||
$--color-primary: #0E99DE;
|
||||
|
||||
// Navbar
|
||||
$navbar--background-color: $--color-primary;
|
||||
|
|
|
@ -6,9 +6,9 @@ export default {
|
|||
// 页面文档可视高度(随窗口改变大小)
|
||||
documentClientHeight: 0,
|
||||
// 导航条, 布局风格, defalut(默认) / inverse(反向)
|
||||
navbarLayoutType: 'default',
|
||||
navbarLayoutType: 'inverse',
|
||||
// 侧边栏, 布局皮肤, light(浅色) / dark(黑色)
|
||||
sidebarLayoutSkin: 'dark',
|
||||
sidebarLayoutSkin: 'light',
|
||||
// 侧边栏, 折叠状态
|
||||
sidebarFold: false,
|
||||
// 侧边栏, 菜单
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<el-input v-model="dataForm.userName" placeholder="姓名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button @click="getData()">查询</el-button>
|
||||
<!-- <el-button v-if="isAuth('stu:user:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>-->
|
||||
<el-button v-if="isAuth('teach:user:delete')" type="danger" @click="deleteHandle()"
|
||||
:disabled="dataListSelections.length <= 0">批量删除
|
||||
|
@ -17,7 +17,7 @@
|
|||
|
||||
</el-form>
|
||||
|
||||
<el-table @sort-change="sortChange" :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
|
||||
<el-table @sort-change="sortChange" @filter-change="filterChange" :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50">
|
||||
</el-table-column>
|
||||
|
@ -45,7 +45,25 @@
|
|||
<!-- </el-table-column>-->
|
||||
|
||||
<el-table-column
|
||||
column-key="majorId"
|
||||
:filter-multiple="false"
|
||||
:filters="[
|
||||
{text: '语文', value: 1},
|
||||
{text: '地理', value: 4},
|
||||
{text: '历史', value: 7},
|
||||
{text: '政治', value: 8}
|
||||
]"
|
||||
:filter-method="filterMajor"
|
||||
prop="majorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="学科">
|
||||
<template slot-scope="scope">
|
||||
{{ isMajor(scope.row.majorId) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
header-align="center"
|
||||
align="center"
|
||||
prop="groupId"
|
||||
|
@ -102,6 +120,7 @@ export default {
|
|||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
groupIdes: [],
|
||||
majorIds: 0,
|
||||
json_fields: {
|
||||
"序号": "index",
|
||||
"姓名": "userName",
|
||||
|
@ -180,6 +199,19 @@ export default {
|
|||
}
|
||||
|
||||
},
|
||||
filterChange(value) {
|
||||
const majorFilter = value.majorId || []
|
||||
const majorIds = majorFilter.join(',')
|
||||
this.majorIds = majorIds
|
||||
console.log("11111",this.majorIds)
|
||||
|
||||
// 重置页码到第一页
|
||||
this.pageIndex = 1
|
||||
// 恢复默认分页选项
|
||||
this.myPageSize = [5, 10, 20, 50, 100, 500]
|
||||
|
||||
this.getDataList('', '', this.majorIds)
|
||||
},
|
||||
// Excel导出
|
||||
async getExportExcel(){
|
||||
let excelData=[]
|
||||
|
@ -217,10 +249,18 @@ export default {
|
|||
// return "未分组"
|
||||
// }
|
||||
},
|
||||
async getData(){
|
||||
if(this.majorIds === 0){
|
||||
console.log(this.majorIds);
|
||||
this.getDataList()
|
||||
return;
|
||||
}
|
||||
this.getDataList('','',this.majorIds)
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList(prop='',sort='') {
|
||||
async getDataList(prop='', sort='', arr='') {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
await this.$http({
|
||||
url: this.$http.adornUrl('/teach/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
|
@ -228,7 +268,8 @@ export default {
|
|||
'limit': this.pageSize,
|
||||
'userName': this.dataForm.userName,
|
||||
'prop': prop,
|
||||
'sort': sort
|
||||
'sort': sort,
|
||||
'arr': arr
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 200) {
|
||||
|
@ -239,18 +280,29 @@ export default {
|
|||
this.totalCount = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
this.queryCount(0)
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
if(this.majorIds === 0){
|
||||
console.log(this.majorId);
|
||||
this.getDataList()
|
||||
return;
|
||||
}
|
||||
this.getDataList('','',this.majorIds)
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val
|
||||
if(this.majorIds === 0){
|
||||
console.log(this.majorIds);
|
||||
this.getDataList()
|
||||
return;
|
||||
}
|
||||
this.getDataList('','',this.majorIds)
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle(val) {
|
||||
|
@ -290,6 +342,19 @@ export default {
|
|||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 学科过滤
|
||||
filterMajor(value, row) {
|
||||
return row.majorId == value;
|
||||
},
|
||||
// 学科转换
|
||||
isMajor(majorId) {
|
||||
switch (majorId) {
|
||||
case 1: return '语文'
|
||||
case 4: return '地理'
|
||||
case 7: return '历史'
|
||||
case 8: return '政治'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<el-input v-model="dataForm.userName" placeholder="姓名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button @click="getData()">查询</el-button>
|
||||
<!-- <el-button v-if="isAuth('stu:user:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>-->
|
||||
<el-button v-if="isAuth('stu:user:delete')" type="danger" @click="deleteHandle()"
|
||||
:disabled="dataListSelections.length <= 0">批量删除
|
||||
|
@ -15,7 +15,7 @@
|
|||
<el-button type='primary'>导出</el-button>
|
||||
</download-excel>
|
||||
</el-form>
|
||||
<el-table @sort-change="sortChange" :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
|
||||
<el-table @sort-change="sortChange" @filter-change="filterChange" :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50">
|
||||
</el-table-column>
|
||||
|
@ -42,6 +42,25 @@
|
|||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<el-table-column
|
||||
column-key="majorId"
|
||||
:filter-multiple="false"
|
||||
:filters="[
|
||||
{text: '语文', value: 1},
|
||||
{text: '地理', value: 4},
|
||||
{text: '历史', value: 7},
|
||||
{text: '政治', value: 8}
|
||||
]"
|
||||
:filter-method="filterMajor"
|
||||
prop="majorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="学科">
|
||||
<template slot-scope="scope">
|
||||
{{ isMajor(scope.row.majorId) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
header-align="center"
|
||||
align="center"
|
||||
|
@ -100,6 +119,7 @@ export default {
|
|||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
groupIdes: [],
|
||||
majorIds: 0,
|
||||
json_fields: {
|
||||
"序号":"index",
|
||||
"姓名": "userName",
|
||||
|
@ -171,6 +191,19 @@ export default {
|
|||
}
|
||||
|
||||
},
|
||||
filterChange(value) {
|
||||
const majorFilter = value.majorId || []
|
||||
const majorIds = majorFilter.join(',')
|
||||
this.majorIds = majorIds
|
||||
console.log("11111",this.majorIds)
|
||||
|
||||
// 重置页码到第一页
|
||||
this.pageIndex = 1
|
||||
// 恢复默认分页选项
|
||||
this.myPageSize = [5, 10, 20, 50, 100, 500]
|
||||
|
||||
this.getDataList('', '', this.majorIds)
|
||||
},
|
||||
// Excel导出
|
||||
async getExportExcel(){
|
||||
let excelData=[]
|
||||
|
@ -205,8 +238,16 @@ export default {
|
|||
// return "未分组"
|
||||
// }
|
||||
},
|
||||
async getData(){
|
||||
if(this.majorIds === 0){
|
||||
console.log(this.majorIds);
|
||||
this.getDataList()
|
||||
return;
|
||||
}
|
||||
this.getDataList('','',this.majorIds)
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList(prop='',sort='') {
|
||||
getDataList(prop='', sort='', arr='') {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/stu/list'),
|
||||
|
@ -216,7 +257,8 @@ export default {
|
|||
'limit': this.pageSize,
|
||||
'userName': this.dataForm.userName,
|
||||
'prop': prop,
|
||||
'sort': sort
|
||||
'sort': sort,
|
||||
'arr': arr // 新增筛选参数
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 200) {
|
||||
|
@ -227,18 +269,29 @@ export default {
|
|||
this.totalCount = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
this.queryCount(0)
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
if(this.majorIds === 0){
|
||||
console.log(this.majorId);
|
||||
this.getDataList()
|
||||
return;
|
||||
}
|
||||
this.getDataList('','',this.majorIds)
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val
|
||||
if(this.majorIds === 0){
|
||||
console.log(this.majorId);
|
||||
this.getDataList()
|
||||
return;
|
||||
}
|
||||
this.getDataList('','',this.majorIds)
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle(val) {
|
||||
|
@ -278,6 +331,17 @@ export default {
|
|||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
filterMajor(value, row) {
|
||||
return row.majorId == value;
|
||||
},
|
||||
isMajor(majorId) {
|
||||
switch (majorId) {
|
||||
case 1: return '语文'
|
||||
case 4: return '地理'
|
||||
case 7: return '历史'
|
||||
case 8: return '政治'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<el-input v-model="dataForm.userName" placeholder="姓名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button @click="getData()">查询</el-button>
|
||||
<el-button v-if="isAuth('stu:user:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('wai:user:delete')" type="danger" @click="deleteHandle()"
|
||||
:disabled="dataListSelections.length <= 0">批量删除
|
||||
|
@ -100,13 +100,19 @@
|
|||
<el-table-column sortable="custom" prop="sex" header-align="center" align="center" label="性别">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isAuth('sys:user:list')"
|
||||
:show-overflow-tooltip="true"
|
||||
min-width="120"
|
||||
column-key="majorId"
|
||||
:filter-multiple="false"
|
||||
:filters="[{text: '语文', value: 1}, {text: '地理', value: 4}, {text: '历史', value: 7}, {text: '政治', value: 8}]"
|
||||
filter-placement="bottom-end"
|
||||
prop="majorId" header-align="center" align="center" label="学科">
|
||||
:filters="[
|
||||
{text: '语文', value: 1},
|
||||
{text: '地理', value: 4},
|
||||
{text: '历史', value: 7},
|
||||
{text: '政治', value: 8}
|
||||
]"
|
||||
:filter-method="filterMajor"
|
||||
prop="majorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="学科">
|
||||
<template slot-scope="scope">
|
||||
{{ isMajor(scope.row.majorId) }}
|
||||
</template>
|
||||
|
@ -226,6 +232,7 @@ export default {
|
|||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
groupIdes: [],
|
||||
majorIds: 0,
|
||||
json_fields: {
|
||||
"序号": "index",
|
||||
"姓名": "userName",
|
||||
|
@ -327,25 +334,18 @@ export default {
|
|||
// const property = column["property"];
|
||||
// return row[property] === value;
|
||||
// },
|
||||
filterChange(value){
|
||||
console.log(value)
|
||||
let arr=''
|
||||
console.log(value["el-table_1_column_7"])
|
||||
value["el-table_1_column_7"].forEach((item) => {
|
||||
if (item) {
|
||||
arr += item + ','
|
||||
}
|
||||
})
|
||||
this.getDataList('','',arr).then(()=>{
|
||||
this.myPageSize=[this.totalCount]
|
||||
if (value["el-table_1_column_7"].length===0){
|
||||
this.myPageSize=[5,10, 20, 50, 100,500]
|
||||
}
|
||||
})
|
||||
filterChange(value) {
|
||||
const majorFilter = value.majorId || []
|
||||
const majorIds = majorFilter.join(',')
|
||||
this.majorIds = majorIds
|
||||
//console.log(this.majorIds)
|
||||
|
||||
// value.forEach((item) => {
|
||||
// console.log(item)
|
||||
// })
|
||||
// 重置页码到第一页
|
||||
this.pageIndex = 1
|
||||
// 恢复默认分页选项
|
||||
this.myPageSize = [5, 10, 20, 50, 100, 500]
|
||||
|
||||
this.getDataList('', '', majorIds)
|
||||
},
|
||||
|
||||
isMajor(majorId) {
|
||||
|
@ -510,8 +510,16 @@ export default {
|
|||
// return "未分组"
|
||||
// }
|
||||
},
|
||||
async getData(){
|
||||
if(this.majorIds === 0){
|
||||
console.log(this.majorIds);
|
||||
this.getDataList()
|
||||
return;
|
||||
}
|
||||
this.getDataList('','',this.majorIds)
|
||||
},
|
||||
// 获取数据列表
|
||||
async getDataList(prop='',sort='',arr='') {
|
||||
async getDataList(prop = '', sort = '', arr = '') {
|
||||
this.dataListLoading = true
|
||||
await this.$http({
|
||||
url: this.$http.adornUrl('/wai/list'),
|
||||
|
@ -522,7 +530,7 @@ export default {
|
|||
'userName': this.dataForm.userName,
|
||||
'prop': prop,
|
||||
'sort': sort,
|
||||
'arr':arr
|
||||
'arr': arr
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 200) {
|
||||
|
@ -539,13 +547,24 @@ export default {
|
|||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.pageIndex = 1 // 切换分页大小时重置到第一页
|
||||
if(this.majorIds === 0){
|
||||
console.log(this.majorIds);
|
||||
this.getDataList()
|
||||
return;
|
||||
}
|
||||
this.getDataList('','',this.majorIds)
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val
|
||||
console.log("1111",val)
|
||||
if(this.majorIds === 0){
|
||||
console.log(this.majorIds);
|
||||
this.getDataList()
|
||||
return;
|
||||
}
|
||||
this.getDataList('','',this.majorIds)
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle(val) {
|
||||
|
@ -646,6 +665,10 @@ export default {
|
|||
this.waiCount = {...data.data}
|
||||
})
|
||||
},
|
||||
// 新增学科过滤方法
|
||||
filterMajor(value, row) {
|
||||
return row.majorId == value;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue