parent
98bd86ca71
commit
b8434958cd
@ -0,0 +1,191 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:default-sort="{prop: 'date', order: 'descending'}"
|
||||
border
|
||||
stripe
|
||||
style="width: 90%">
|
||||
<el-table-column
|
||||
type="selection">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed
|
||||
label="用户编号"
|
||||
prop="id"
|
||||
sortable
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="用户名"
|
||||
prop="username"
|
||||
sortable
|
||||
width="200">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="密码"
|
||||
prop="password"
|
||||
sortable
|
||||
width="200">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="学号"
|
||||
prop="school_id"
|
||||
sortable
|
||||
width="200">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="姓名"
|
||||
prop="name"
|
||||
sortable
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="类型"
|
||||
prop="type"
|
||||
sortable
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column>
|
||||
<template slot-scope="scope">
|
||||
<el-button size="small" type="success" @click="agree(scope.row.id)">同意</el-button>
|
||||
<el-button size="small" type="danger" @click="disagree(scope.row.id)">拒绝</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="margin-top: 20px">
|
||||
<el-button type="success" @click="allAgree()">批量同意</el-button>
|
||||
<el-button type="danger" @click="allDisagree()">批量拒绝</el-button>
|
||||
<el-button @click="toggleSelection()">取消选择</el-button>
|
||||
</div>
|
||||
<el-pagination
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
background
|
||||
layout="prev, pager, next"
|
||||
@current-change="page">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "RegisterApplication",
|
||||
methods: {
|
||||
page(currentPage) {
|
||||
const _this = this
|
||||
let id = window.location.pathname.split('/')[3];
|
||||
axios.get('http://localhost:8181/userDetail/findAllUADPaged' + (currentPage) + '/20').then(function (resp) {
|
||||
console.log(resp)
|
||||
_this.tableData = resp.data
|
||||
_this.pageSize = 20
|
||||
})
|
||||
axios.get('http://localhost:8181/userDetail/findAllUADPaged').then(function (resp) {
|
||||
_this.total = resp.data
|
||||
})
|
||||
},
|
||||
toggleSelection(rows) {
|
||||
if (rows) {
|
||||
rows.forEach(row => {
|
||||
this.$refs.multipleTable.toggleRowSelection(row);
|
||||
});
|
||||
} else {
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
agree(id) {
|
||||
const _this = this
|
||||
let userid = window.location.pathname.split('/')[3];
|
||||
axios.get('http://localhost:8181/userDetail/agreeUpdate/' + id)
|
||||
this.$message({
|
||||
message: '已批准',
|
||||
type: 'success'
|
||||
});
|
||||
window.location.href = "/user/outer/" + userid + "/history";
|
||||
},
|
||||
disagree(row) {
|
||||
const _this = this
|
||||
let userid = window.location.pathname.split('/')[3];
|
||||
axios.get('http://localhost:8181/userDetail/disagreeUpdate/' + id)
|
||||
window.location.href = "/user/outer/" + userid + "/history";
|
||||
this.$message({
|
||||
message: '已拒绝',
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
allAgree() {
|
||||
let arrLength = this.$refs.multipleTable.selection.length;
|
||||
let userid = window.location.pathname.split('/')[3];
|
||||
for (let i = 0; i < arrLength; i++) {
|
||||
axios.get('http://localhost:8181/userDetail/agreeUpdate/' + this.$refs.multipleTable.selection[i].id)
|
||||
}
|
||||
this.$message({
|
||||
message: '已批量同意',
|
||||
type: 'success'
|
||||
});
|
||||
window.location.href = "/user/outer/" + userid + "/history";
|
||||
|
||||
},
|
||||
allDisagree() {
|
||||
let arrLength = this.$refs.multipleTable.selection.length;
|
||||
let userid = window.location.pathname.split('/')[3];
|
||||
for (let i = 0; i < arrLength; i++) {
|
||||
axios.get('http://localhost:8181/userDetail/disagreeUpdate/' + this.$refs.multipleTable.selection[i].id)
|
||||
}
|
||||
this.$message({
|
||||
message: '已批量拒绝',
|
||||
type: 'success'
|
||||
});
|
||||
window.location.href = "/user/outer/" + userid + "/history";
|
||||
|
||||
},
|
||||
//this.$refs.multipleTable.selection
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageSize: 20,
|
||||
total: 11,
|
||||
tableData: [{
|
||||
id: 1,
|
||||
username: 'markma',
|
||||
password: '123',
|
||||
school_id: '123456',
|
||||
name: '马铁诚',
|
||||
type: '管理员'
|
||||
}],
|
||||
multipleSelection: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const _this = this
|
||||
let id = window.location.pathname.split('/')[3];
|
||||
let type = window.location.pathname.split('/')[2];
|
||||
axios.get('http://localhost:8181/user/checkUseridAndType/' + id + '/' + type).then(function (resp) {
|
||||
if (resp.data != 'success') {
|
||||
_this.$router.push("/NoAuthority")
|
||||
} else {
|
||||
let login_id = _this.$cookieStore.getCookie("login_id")
|
||||
console.log(login_id)
|
||||
if (login_id != id) {
|
||||
_this.$router.push("/NoAuthority")
|
||||
}
|
||||
}
|
||||
})
|
||||
axios.get('http://localhost:8181/userDetail/findAllUADPaged/1/20').then(function (resp) {
|
||||
_this.tableData = resp.data
|
||||
_this.pageSize = 20
|
||||
})
|
||||
axios.get('http://localhost:8181/userDetail/findAllUADPagedNum').then(function (resp) {
|
||||
_this.total = resp.data
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in new issue