|
@@ -45,9 +45,15 @@
|
|
<el-button type="primary" icon="icon icon-search" @click="toPage(1)"
|
|
<el-button type="primary" icon="icon icon-search" @click="toPage(1)"
|
|
>查询</el-button
|
|
>查询</el-button
|
|
>
|
|
>
|
|
- <el-button type="warning" icon="icon icon-share" @click="toPage(1)"
|
|
|
|
- >导入</el-button
|
|
|
|
|
|
+ <upload-button
|
|
|
|
+ :upload-url="uploadUrl"
|
|
|
|
+ :format="['xls', 'xlsx']"
|
|
|
|
+ :upload-data="uploadData"
|
|
|
|
+ @upload-error="uplaodError"
|
|
|
|
+ @upload-success="uploadSuccess"
|
|
>
|
|
>
|
|
|
|
+ <el-button type="warning" icon="icon icon-share">导入</el-button>
|
|
|
|
+ </upload-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
@@ -66,7 +72,7 @@
|
|
<el-table-column prop="roleName" label="角色"></el-table-column>
|
|
<el-table-column prop="roleName" label="角色"></el-table-column>
|
|
<el-table-column prop="courseName" label="科目"></el-table-column>
|
|
<el-table-column prop="courseName" label="科目"></el-table-column>
|
|
<el-table-column prop="enable" label="状态"></el-table-column>
|
|
<el-table-column prop="enable" label="状态"></el-table-column>
|
|
- <el-table-column label="操作" align="center">
|
|
|
|
|
|
+ <el-table-column label="操作" align="center" width="120px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
class="btn-table-icon"
|
|
class="btn-table-icon"
|
|
@@ -76,7 +82,7 @@
|
|
? 'icon icon-circle-stop'
|
|
? 'icon icon-circle-stop'
|
|
: 'icon icon-circle-caret-right'
|
|
: 'icon icon-circle-caret-right'
|
|
"
|
|
"
|
|
- @click="toEdit(scope.row)"
|
|
|
|
|
|
+ @click="toEnable(scope.row)"
|
|
:title="scope.row.enable ? '禁用' : '启用'"
|
|
:title="scope.row.enable ? '禁用' : '启用'"
|
|
></el-button>
|
|
></el-button>
|
|
<el-button
|
|
<el-button
|
|
@@ -90,8 +96,8 @@
|
|
class="btn-table-icon"
|
|
class="btn-table-icon"
|
|
type="text"
|
|
type="text"
|
|
icon="icon icon-circle-lock"
|
|
icon="icon icon-circle-lock"
|
|
- @click="toEdit(scope.row)"
|
|
|
|
- title="确认"
|
|
|
|
|
|
+ @click="toResetPwd(scope.row)"
|
|
|
|
+ title="重置密码"
|
|
></el-button>
|
|
></el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -108,24 +114,17 @@
|
|
</el-pagination>
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
- <!-- modify-data -->
|
|
|
|
- <modify-data
|
|
|
|
- :instance="curUser"
|
|
|
|
- @modified="getList"
|
|
|
|
- ref="ModifyData"
|
|
|
|
- ></modify-data>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { ABLE_TYPE } from "@/constants/enumerate";
|
|
import { ABLE_TYPE } from "@/constants/enumerate";
|
|
-import { userListPage } from "../api";
|
|
|
|
-import ModifyData from "../components/ModifyData";
|
|
|
|
|
|
+import { userListPage, ableUser, updatePwd } from "../api";
|
|
|
|
+import UploadButton from "@/components/UploadButton";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "user-manage",
|
|
name: "user-manage",
|
|
- components: { ModifyData },
|
|
|
|
|
|
+ components: { UploadButton },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
filter: {
|
|
filter: {
|
|
@@ -139,12 +138,17 @@ export default {
|
|
visible: false,
|
|
visible: false,
|
|
ABLE_TYPE,
|
|
ABLE_TYPE,
|
|
roles: [],
|
|
roles: [],
|
|
- users: [{ id: "1" }],
|
|
|
|
- curUser: {}
|
|
|
|
|
|
+ users: [{ id: "1", enable: false }],
|
|
|
|
+ // import
|
|
|
|
+ uploadUrl: this.GLOBAL.domain + "/api/print/basic/user/add",
|
|
|
|
+ uploadData: {
|
|
|
|
+ schoolId: this.$ls.get("schoolId"),
|
|
|
|
+ userId: this.$ls.get("user", { id: "" }).id
|
|
|
|
+ }
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- // this.getList();
|
|
|
|
|
|
+ this.getList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
indexMethod(index) {
|
|
indexMethod(index) {
|
|
@@ -156,7 +160,7 @@ export default {
|
|
pageNumber: this.current,
|
|
pageNumber: this.current,
|
|
pageSize: this.size
|
|
pageSize: this.size
|
|
};
|
|
};
|
|
- data.enable *= 1;
|
|
|
|
|
|
+ datas.enable *= 1;
|
|
const data = await userListPage(datas);
|
|
const data = await userListPage(datas);
|
|
this.users = data.records;
|
|
this.users = data.records;
|
|
this.total = data.total;
|
|
this.total = data.total;
|
|
@@ -165,6 +169,13 @@ export default {
|
|
this.current = page;
|
|
this.current = page;
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
|
|
+ async toEnable(row) {
|
|
|
|
+ await ableUser({
|
|
|
|
+ userId: row.id,
|
|
|
|
+ enable: !row.enable
|
|
|
|
+ });
|
|
|
|
+ row.enable = !row.enable;
|
|
|
|
+ },
|
|
toEdit(row) {
|
|
toEdit(row) {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
name: "UserEdit",
|
|
name: "UserEdit",
|
|
@@ -172,6 +183,20 @@ export default {
|
|
userId: row.id
|
|
userId: row.id
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ },
|
|
|
|
+ async toResetPwd(row) {
|
|
|
|
+ await updatePwd({
|
|
|
|
+ userId: row.userId,
|
|
|
|
+ password: "123456"
|
|
|
|
+ });
|
|
|
|
+ this.$message.success("密码重置成功!");
|
|
|
|
+ },
|
|
|
|
+ uplaodError(msg) {
|
|
|
|
+ this.$message.error(msg);
|
|
|
|
+ },
|
|
|
|
+ uploadSuccess(res) {
|
|
|
|
+ this.$message.success("上传成功!");
|
|
|
|
+ this.getList();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|