|
@@ -91,6 +91,7 @@
|
|
<el-select v-model="school.type" placeholder="请选择组织" class="custom-select">
|
|
<el-select v-model="school.type" placeholder="请选择组织" class="custom-select">
|
|
<!-- 动态生成 <el-option> -->
|
|
<!-- 动态生成 <el-option> -->
|
|
<el-option :value="1">组织1</el-option>
|
|
<el-option :value="1">组织1</el-option>
|
|
|
|
+ <el-option :value="2">组织2</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -100,6 +101,7 @@
|
|
<el-select v-model="school.type" placeholder="请选择" class="custom-select">
|
|
<el-select v-model="school.type" placeholder="请选择" class="custom-select">
|
|
<!-- 动态生成 <el-option> -->
|
|
<!-- 动态生成 <el-option> -->
|
|
<el-option :value="1">学校1</el-option>
|
|
<el-option :value="1">学校1</el-option>
|
|
|
|
+ <el-option :value="2">学校2</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -258,17 +260,21 @@
|
|
<a @click="showstop" :style="{ color: stop ? 'black' : 'rgb(179, 179, 179)' }">已停用({{ tableData_stop.length }})</a>
|
|
<a @click="showstop" :style="{ color: stop ? 'black' : 'rgb(179, 179, 179)' }">已停用({{ tableData_stop.length }})</a>
|
|
</div>
|
|
</div>
|
|
<!-- 启用中区域 -->
|
|
<!-- 启用中区域 -->
|
|
- <div v-if="open_content" style="margin-top: -80px;width: 100%;float: left;">
|
|
|
|
|
|
+ <div v-if="open_content" style="margin-top: -80px;">
|
|
<el-table :data="paginatedData" border style="width: 94%; margin-top: 90px; margin-left: 80px;" stripe :header-cell-style="headerCellStyle">
|
|
<el-table :data="paginatedData" border style="width: 94%; margin-top: 90px; margin-left: 80px;" stripe :header-cell-style="headerCellStyle">
|
|
- <el-table-column show-overflow-tooltip prop="company_name" label="组织名称" width="300" header-align="center" align="center" />
|
|
|
|
- <el-table-column show-overflow-tooltip prop="company_number" label="组织编号" width="300" header-align="center" align="center" />
|
|
|
|
- <el-table-column show-overflow-tooltip prop="name" label="姓名" width="300" header-align="center" align="center" />
|
|
|
|
- <el-table-column show-overflow-tooltip prop="account" label="账户" width="300" header-align="center" align="center" />
|
|
|
|
- <el-table-column label="操作" width="300" header-align="center" align="center">
|
|
|
|
|
|
+ <el-table-column show-overflow-tooltip prop="company_name" label="组织名称" width="320" header-align="center" align="center" />
|
|
|
|
+ <el-table-column show-overflow-tooltip prop="company_number" label="学校名称" width="320" header-align="center" align="center" />
|
|
|
|
+ <el-table-column show-overflow-tooltip prop="name" label="姓名" width="320" header-align="center" align="center" />
|
|
|
|
+ <el-table-column show-overflow-tooltip prop="account" label="账户" width="320" header-align="center" align="center" />
|
|
|
|
+
|
|
|
|
+ <el-table-column show-overflow-toolti prop="account" label="操作" width="350" header-align="center" align="center">
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
<el-button link type="text" size="small" @click="ajax__open_stop(row.userid)">停用</el-button>
|
|
<el-button link type="text" size="small" @click="ajax__open_stop(row.userid)">停用</el-button>
|
|
<el-button link type="text" size="small" @click="run(row.userid)">移动</el-button>
|
|
<el-button link type="text" size="small" @click="run(row.userid)">移动</el-button>
|
|
|
|
+
|
|
|
|
+ <!-- 管理员操作按钮,只有当 row.type === 1 时才显示 -->
|
|
<el-button
|
|
<el-button
|
|
|
|
+ v-if="row.type === 1"
|
|
link
|
|
link
|
|
type="text"
|
|
type="text"
|
|
size="small"
|
|
size="small"
|
|
@@ -286,7 +292,6 @@
|
|
:page-size="pageSize"
|
|
:page-size="pageSize"
|
|
:total="tableData.length"
|
|
:total="tableData.length"
|
|
layout="total, prev, pager, next, jumper"
|
|
layout="total, prev, pager, next, jumper"
|
|
- @size-change="handlePageSizeChange"
|
|
|
|
@current-change="handlePageChange">
|
|
@current-change="handlePageChange">
|
|
</el-pagination>
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
@@ -295,7 +300,7 @@
|
|
<div v-if="stop_content" style="margin-top: -80px;">
|
|
<div v-if="stop_content" style="margin-top: -80px;">
|
|
<el-table :data="down_paginatedData" border style="width: 94%; margin-top: 90px; margin-left: 80px;" header-align="center" align="center" stripe :header-cell-style="headerCellStyle">
|
|
<el-table :data="down_paginatedData" border style="width: 94%; margin-top: 90px; margin-left: 80px;" header-align="center" align="center" stripe :header-cell-style="headerCellStyle">
|
|
<el-table-column show-overflow-tooltip prop="company_name" label="组织名称" width="350" header-align="center" align="center"/>
|
|
<el-table-column show-overflow-tooltip prop="company_name" label="组织名称" width="350" header-align="center" align="center"/>
|
|
- <el-table-column show-overflow-tooltip prop="company_number" label="组织编号" width="350" header-align="center" align="center"/>
|
|
|
|
|
|
+ <el-table-column show-overflow-tooltip prop="company_number" label="学校名称" width="350" header-align="center" align="center"/>
|
|
<el-table-column show-overflow-tooltip prop="name" label="姓名" width="350" header-align="center" align="center"/>
|
|
<el-table-column show-overflow-tooltip prop="name" label="姓名" width="350" header-align="center" align="center"/>
|
|
<el-table-column show-overflow-tooltip prop="account" label="账户" width="350" header-align="center" align="center"/>
|
|
<el-table-column show-overflow-tooltip prop="account" label="账户" width="350" header-align="center" align="center"/>
|
|
<el-table-column fixed="right" label="操作" width="250" header-align="center" align="center">
|
|
<el-table-column fixed="right" label="操作" width="250" header-align="center" align="center">
|
|
@@ -311,7 +316,6 @@
|
|
:page-size="down_pageSize"
|
|
:page-size="down_pageSize"
|
|
:total="tableData_stop.length"
|
|
:total="tableData_stop.length"
|
|
layout="total, prev, pager, next, jumper"
|
|
layout="total, prev, pager, next, jumper"
|
|
- @size-change="down_handlePageSizeChange"
|
|
|
|
@current-change="down_handlePageChange">
|
|
@current-change="down_handlePageChange">
|
|
</el-pagination>
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
@@ -369,10 +373,10 @@ export default {
|
|
selectedSchool: "",
|
|
selectedSchool: "",
|
|
// 启用区域分页
|
|
// 启用区域分页
|
|
currentPage: 1, // 当前第几页
|
|
currentPage: 1, // 当前第几页
|
|
- pageSize: 5, // 每页显示条目数
|
|
|
|
- // 停止区���分页
|
|
|
|
|
|
+ pageSize: 10, // 每页显示条目数
|
|
|
|
+ // 停止区域分页
|
|
down_currentPage: 1, // 当前第几页
|
|
down_currentPage: 1, // 当前第几页
|
|
- down_pageSize: 5, // 每页显示的条目数
|
|
|
|
|
|
+ down_pageSize: 10, // 每页显示的条目数
|
|
// 两个分页初始化状态
|
|
// 两个分页初始化状态
|
|
up_page: true,
|
|
up_page: true,
|
|
down_page: false,
|
|
down_page: false,
|
|
@@ -419,6 +423,20 @@ export default {
|
|
return this.tableData_stop.slice(start, end); // 获取当前页的数据
|
|
return this.tableData_stop.slice(start, end); // 获取当前页的数据
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ // 监视 currentPage 的变化
|
|
|
|
+ currentPage(newPage, oldPage) {
|
|
|
|
+ if (newPage !== oldPage) {
|
|
|
|
+ this.ajax_user_open(newPage); // 页码变化时触发 ajax_user_open
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 监视 down_currentPage 的变化
|
|
|
|
+ down_currentPage(newPage, oldPage) {
|
|
|
|
+ if (newPage !== oldPage) {
|
|
|
|
+ this.ajax_user_stop(newPage); // 页码变化时触发 ajax_user_stop
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
// 移动按钮,将isOrgFormVisible区域显示
|
|
// 移动按钮,将isOrgFormVisible区域显示
|
|
run(userid) {
|
|
run(userid) {
|
|
@@ -471,14 +489,6 @@ export default {
|
|
handlePageChange(page) {
|
|
handlePageChange(page) {
|
|
this.currentPage = page;
|
|
this.currentPage = page;
|
|
},
|
|
},
|
|
- // 启用区域 处理每页条目数量变化
|
|
|
|
- handlePageSizeChange(size) {
|
|
|
|
- this.pageSize = size;
|
|
|
|
- },
|
|
|
|
- // 停用区域 处理每页条目数量变化
|
|
|
|
- down_handlePageSizeChange(size) {
|
|
|
|
- this.down_pageSize = size;
|
|
|
|
- },
|
|
|
|
// 停用区域 页码扩展按钮
|
|
// 停用区域 页码扩展按钮
|
|
down_handlePageChange(page) {
|
|
down_handlePageChange(page) {
|
|
this.down_currentPage = page;
|
|
this.down_currentPage = page;
|
|
@@ -507,51 +517,78 @@ export default {
|
|
},
|
|
},
|
|
// 已启用
|
|
// 已启用
|
|
ajax_user_open() {
|
|
ajax_user_open() {
|
|
- const params = [API_CONFIG.ajaxstart]; // 使用配置中的接口参数
|
|
|
|
|
|
+ // 确认后发起请求
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ functionName: API_CONFIG.ajaxstart.functionName, // 使用配置中的存储过程名称
|
|
|
|
+ r_type: 1,
|
|
|
|
+ page: this.currentPage, // 使用当前页码
|
|
|
|
+ num: this.pageSize, // 每页条目数
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
// 假设 res.data[0] 是返回的用户数据数组
|
|
// 假设 res.data[0] 是返回的用户数据数组
|
|
- this.tableData = res.data[0].map(user => ({
|
|
|
|
- company_name: user.org_name || '暂无', // 组织名称
|
|
|
|
- company_number: user.org_id || '暂无', // 组织编号
|
|
|
|
- name: user.user_name || '暂无', // 姓名
|
|
|
|
- account: user.account_name || '暂无', // 账户
|
|
|
|
- userid:user.user_id,
|
|
|
|
- role: user.admin_role || 0, // 角色,假设 1 为管理员,0 为普通用户
|
|
|
|
- school:user.s_id,
|
|
|
|
- action: user.admin_role === 1
|
|
|
|
- ? '已设置管理员'
|
|
|
|
- : '设置管理员' // 根据 role 字段设置按钮文字
|
|
|
|
|
|
+ const users = res.data[0].map(user => ({
|
|
|
|
+ company_name: user.org_name || '暂无', // 组织名称
|
|
|
|
+ company_number: user.school_name || '暂无', // 学校名称
|
|
|
|
+ name: user.user_name || '暂无', // 姓名
|
|
|
|
+ account: user.account_name || '暂无', // 账户
|
|
|
|
+ userid: user.user_id,
|
|
|
|
+ role: user.admin_role || 0, // 角色,假设 1 为管理员,0 为普通用户
|
|
|
|
+ school: user.s_id,
|
|
|
|
+ type:user.usertype
|
|
}));
|
|
}));
|
|
|
|
+
|
|
|
|
+ // 只在当前页填充数据,其他页为空
|
|
|
|
+ this.tableData = Array(this.pageSize * (this.currentPage - 1)).fill(null).concat(users);
|
|
|
|
+ //读取返回数组的第一条数据的总条数来当作table.data数组的长度
|
|
|
|
+ const totalCount = res.data[0][0].total_count;
|
|
|
|
+ this.tableData.length=totalCount;
|
|
// 打印映射后的用户信息
|
|
// 打印映射后的用户信息
|
|
- // console.log("启用的用户信息:", res.data);
|
|
|
|
|
|
+ console.log("启用的用户信息:", res.data);
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
// 处理失败的响应
|
|
// 处理失败的响应
|
|
this.$message.error("查询失败");
|
|
this.$message.error("查询失败");
|
|
- console.error("请求失败,错误信息:", err); // 打印更详细的错误信息
|
|
|
|
|
|
+ console.error("请求失败,错误信息:", err); // 打印更详细的错误信息
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//停用
|
|
//停用
|
|
ajax_user_stop() {
|
|
ajax_user_stop() {
|
|
- const params = [API_CONFIG.ajaxend]; // 使用配置中的接口参数
|
|
|
|
|
|
+ // 确认后发起请求
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ functionName: API_CONFIG.ajaxstart.functionName, // 使用配置中的存储过程名称
|
|
|
|
+ r_type: 0,
|
|
|
|
+ page: this.down_currentPage, // 使用当前页码
|
|
|
|
+ num: this.down_pageSize, // 每页条目数
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
// 假设 res.data[0] 是返回的用户数据数组
|
|
// 假设 res.data[0] 是返回的用户数据数组
|
|
- this.tableData_stop = res.data[0].map(user => ({
|
|
|
|
- company_name: user.org_name || '暂无', // 组织名称
|
|
|
|
- company_number: user.org_id || '暂无', // 组织编号
|
|
|
|
- name: user.user_name || '暂无', // 姓名
|
|
|
|
- account: user.account_name || '暂无', // 账户
|
|
|
|
- userid:user.user_id,
|
|
|
|
- }));
|
|
|
|
|
|
+ const users = res.data[0].map(user => ({
|
|
|
|
+ company_name: user.org_name || '暂无', // 组织名称
|
|
|
|
+ company_number: user.school_name || '暂无', // 学校名称
|
|
|
|
+ name: user.user_name || '暂无', // 姓名
|
|
|
|
+ account: user.account_name || '暂无', // 账户
|
|
|
|
+ userid: user.user_id,
|
|
|
|
+ }));
|
|
|
|
+
|
|
|
|
+ // 只在当前页填充数据,其他页为空
|
|
|
|
+ this.tableData_stop = Array(this.down_pageSize * (this.down_currentPage - 1)).fill(null).concat(users);
|
|
|
|
+ //读取返回数组的第一条数据的总条数来当作table.data数组的长度
|
|
|
|
+ const totalCount = res.data[0][0].total_count;
|
|
|
|
+ this.tableData_stop.length = totalCount;
|
|
|
|
+
|
|
// 打印映射后的用户信息
|
|
// 打印映射后的用户信息
|
|
- // console.log("停止:", res.data);
|
|
|
|
|
|
+ console.log("停用的用户信息:", res.data);
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
// 处理失败的响应
|
|
// 处理失败的响应
|
|
this.$message.error("查询失败");
|
|
this.$message.error("查询失败");
|
|
- console.error("请求失败,错误信息:", err); // 打印更详细的错误信息
|
|
|
|
|
|
+ console.error("请求失败,错误信息:", err); // 打印更详细的错误信息
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 停用或者启用
|
|
// 停用或者启用
|
|
@@ -632,23 +669,15 @@ export default {
|
|
};
|
|
};
|
|
});
|
|
});
|
|
console.log("返回的数据为:",res.data);
|
|
console.log("返回的数据为:",res.data);
|
|
- // 获取返回的信息
|
|
|
|
- let updatedMessage = res.data[0][0].message; // 假设 res.data[0][0] 是正确的
|
|
|
|
-
|
|
|
|
- if (updatedMessage == 2) {
|
|
|
|
- // 如果返回信息是2,提示用户不是老师类型
|
|
|
|
- this.$message.error("该用户不是老师类型,无法设置为管理员");
|
|
|
|
- } else {
|
|
|
|
|
|
+ // 只有在成功执行时调用这两个函数
|
|
|
|
+ this.ajax_user_stop();
|
|
|
|
+ this.ajax_user_open();
|
|
// 如果更新成功,显示成功提示并调用 ajax_user_stop 和 ajax_user_open
|
|
// 如果更新成功,显示成功提示并调用 ajax_user_stop 和 ajax_user_open
|
|
this.$message({
|
|
this.$message({
|
|
type: 'success',
|
|
type: 'success',
|
|
message: '已成功执行!',
|
|
message: '已成功执行!',
|
|
});
|
|
});
|
|
- // // 只有在成功执行时调用这两个函数
|
|
|
|
- // this.ajax_user_stop();
|
|
|
|
- // this.ajax_user_open();
|
|
|
|
- }
|
|
|
|
- }).catch((error) => {
|
|
|
|
|
|
+ }).catch((error) => {
|
|
// 请求失败的处理
|
|
// 请求失败的处理
|
|
console.error("请求失败:", error);
|
|
console.error("请求失败:", error);
|
|
this.$message({
|
|
this.$message({
|
|
@@ -903,7 +932,10 @@ export default {
|
|
body{
|
|
body{
|
|
margin: 0px;
|
|
margin: 0px;
|
|
padding: 0px;
|
|
padding: 0px;
|
|
-
|
|
|
|
|
|
+}
|
|
|
|
+*{
|
|
|
|
+ margin: 0px;
|
|
|
|
+ padding: 0px;
|
|
}
|
|
}
|
|
/* 账户列表标题样式 */
|
|
/* 账户列表标题样式 */
|
|
.title_examine{
|
|
.title_examine{
|
|
@@ -972,13 +1004,15 @@ body{
|
|
/* 添加账户的按钮 */
|
|
/* 添加账户的按钮 */
|
|
.add-button {
|
|
.add-button {
|
|
display: flex;
|
|
display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ background-color: transparent;
|
|
border: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
color: black;
|
|
color: black;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
- margin-left: -1450px;
|
|
|
|
- margin-top: 375px;
|
|
|
|
|
|
+ margin-left: -900px;
|
|
|
|
+ margin-top: 35px;
|
|
float: left;
|
|
float: left;
|
|
}
|
|
}
|
|
/* +号图标 */
|
|
/* +号图标 */
|
|
@@ -1420,4 +1454,51 @@ body{
|
|
-webkit-box-sizing: border-box;
|
|
-webkit-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
}
|
|
|
|
+/* 停用表单的滑动条 */
|
|
|
|
+::v-deep.el-table--scrollable-x .el-table__body-wrapper{
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+}
|
|
|
|
+::v-deep.el-table__body-wrapper is-scrolling-left{
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+}
|
|
|
|
+/* 选择组织下拉菜单的鼠标悬浮效果 */
|
|
|
|
+::v-deep.el-select-dropdown__item:hover {
|
|
|
|
+ background-color: #F5F7FA;
|
|
|
|
+}
|
|
|
|
+/* 下拉菜单的滚动条 */
|
|
|
|
+::v-deep.el-select-dropdown__wrap .el-scrollbar__wrap{
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+ height: 100%;
|
|
|
|
+}
|
|
|
|
+::v-deep.el-select-dropdown__item {
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ padding: 0px 20px 0px 0px;
|
|
|
|
+ position: relative;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ color: #606266;
|
|
|
|
+ height: 35px;
|
|
|
|
+ line-height: 34px;
|
|
|
|
+ /* box-sizing: border-box; */
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ margin-left: -1px;
|
|
|
|
+}
|
|
|
|
+/* 下拉菜单的ul顶部 */
|
|
|
|
+::v-deep.el-scrollbar__view .el-select-dropdown__list {
|
|
|
|
+ list-style: none;
|
|
|
|
+ padding: 5px 0;
|
|
|
|
+ margin: 0;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+}
|
|
|
|
+/* 下拉菜单底部部分 */
|
|
|
|
+::v-deep.el-scrollbar__bar .is-vertical{
|
|
|
|
+ width: 0px;
|
|
|
|
+ height: 0px;
|
|
|
|
+}
|
|
|
|
+::v-deep.el-scrollbar__bar .is-horizontal{
|
|
|
|
+ width: 0px;
|
|
|
|
+ height: 0px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|