|
|
@@ -48,7 +48,7 @@
|
|
|
</el-input>
|
|
|
</div>
|
|
|
<div class="content_right">
|
|
|
- <el-button class="button_border_gray">
|
|
|
+ <el-button class="button_border_gray" @click="Refresh">
|
|
|
<img src="@/assets/icon/refresh.svg" alt="" style="margin-right: 5px;">刷新
|
|
|
</el-button>
|
|
|
<el-button class="button_border" @click="OpenSubject">开通科目</el-button>
|
|
|
@@ -91,9 +91,9 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="nicknames" label="运维人员" align="center">
|
|
|
+ <el-table-column prop="sysUserName" label="运维人员" align="center">
|
|
|
<template #default="{ row }">
|
|
|
- {{ row.nicknames || '-' }}
|
|
|
+ {{ row.sysUserName || '-' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="280" fixed="right" align="center">
|
|
|
@@ -103,7 +103,7 @@
|
|
|
<div v-else class="button_editor text_color_orange" @click="ChangeStatus(row)">冻结</div>
|
|
|
<div class="button_editor" @click="EditUser(row)">编辑</div>
|
|
|
<div class="button_editor" @click="OpenAuth(row)">权限</div>
|
|
|
- <div class="button_editor">重置密码</div>
|
|
|
+ <div class="button_editor" @click="resetPassWord(row)">重置密码</div>
|
|
|
<div class="button_editor" @click="GoTeach(row)">进入学校</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -116,6 +116,7 @@
|
|
|
<AddUser v-if="showDialog" @AddUser="RefTable" />
|
|
|
<AuthConfig v-if="authData.showDialog" />
|
|
|
<SubjectList v-if="subjectShowDialog" />
|
|
|
+ <ResetPassword v-if="passwordDialog.dialogShow" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -125,8 +126,9 @@ import SearchMain from '@/views/school/SearchMain.vue'
|
|
|
import AddUser from '@/views/school/addUser.vue'
|
|
|
import AuthConfig from '@/views/school/authConfig.vue'
|
|
|
import SubjectList from '@/views/school/subjectList.vue'
|
|
|
+import ResetPassword from '@/components/resetPassword.vue'
|
|
|
import { Search } from '@element-plus/icons-vue'
|
|
|
-import { getSchoolNumber, getSchoolList, changeStatus, loginTeach } from '@/api/school'
|
|
|
+import { getSchoolNumber, getSchoolList, changeStatus } from '@/api/school'
|
|
|
import { ref, reactive, provide, onMounted } from 'vue'
|
|
|
interface UserNumber {
|
|
|
allUser: number
|
|
|
@@ -151,7 +153,7 @@ interface User {
|
|
|
startDate: String;
|
|
|
endDate: String;
|
|
|
sysUserId: String;
|
|
|
- nicknames: String;
|
|
|
+ sysUserName: String;
|
|
|
cityAndAreaName: String;
|
|
|
}
|
|
|
const tableData = ref<User[]>([])
|
|
|
@@ -172,10 +174,19 @@ const authData = reactive({
|
|
|
schoolName: '',
|
|
|
tenantCode: ''
|
|
|
})
|
|
|
+const passwordDialog = reactive({
|
|
|
+ dialogShow: false,
|
|
|
+ id: '',
|
|
|
+ type: '',
|
|
|
+ name: '',
|
|
|
+ label: '',
|
|
|
+ remark: ''
|
|
|
+}) // 重置密码弹窗数据
|
|
|
provide('showDialog', showDialog) // 新增用户弹窗是否展示
|
|
|
provide('dialogData', dialogData) // 新增用户弹窗数据
|
|
|
provide('authData', authData) // 设置权限弹窗数据
|
|
|
provide('subjectShowDialog', subjectShowDialog) // 开通科目弹窗数据
|
|
|
+provide('passwordDialog', passwordDialog) // 重置密码弹窗数据
|
|
|
onMounted(() => {
|
|
|
GetSchoolNumber()
|
|
|
GetSchoolList()
|
|
|
@@ -186,7 +197,7 @@ const addUser = () => {
|
|
|
dialogData.pageType = 'add'
|
|
|
}
|
|
|
// 编辑
|
|
|
-const EditUser = (row) => {
|
|
|
+const EditUser = (row: any) => {
|
|
|
console.log(row)
|
|
|
showDialog.value = true
|
|
|
dialogData.pageType = 'edit'
|
|
|
@@ -194,7 +205,7 @@ const EditUser = (row) => {
|
|
|
dialogData.tenantName = row.tenantName
|
|
|
}
|
|
|
// 设置权限
|
|
|
-const OpenAuth = (row) => {
|
|
|
+const OpenAuth = (row: any) => {
|
|
|
authData.id = row.id
|
|
|
authData.schoolName = row.tenantName
|
|
|
authData.tenantCode = row.tenantCode
|
|
|
@@ -213,7 +224,7 @@ const searchData = ref({
|
|
|
userId: ''
|
|
|
})
|
|
|
// 筛选项查询
|
|
|
-const FnSearch = (data) => {
|
|
|
+const FnSearch = (data: any) => {
|
|
|
searchData.value = data.value
|
|
|
GetSchoolList()
|
|
|
}
|
|
|
@@ -223,7 +234,7 @@ const SearchChange = () => {
|
|
|
}
|
|
|
// 获取用户数量
|
|
|
const GetSchoolNumber = () => {
|
|
|
- getSchoolNumber().then(res => {
|
|
|
+ getSchoolNumber().then((res: any) => {
|
|
|
if(res.code == 200 && res.data) {
|
|
|
userNumber.value = res.data
|
|
|
}
|
|
|
@@ -240,36 +251,49 @@ const GetSchoolList = () => {
|
|
|
queryStr: schoolNameCode.value
|
|
|
}
|
|
|
tableLoading.value = true
|
|
|
- getSchoolList(params).then(res => {
|
|
|
+ getSchoolList(params).then((res: any) => {
|
|
|
if(res.code == 200 && res.data) {
|
|
|
tableData.value = res.data
|
|
|
}
|
|
|
tableLoading.value = false
|
|
|
- }).catch(err => {
|
|
|
+ }).catch(() => {
|
|
|
tableLoading.value = false
|
|
|
})
|
|
|
}
|
|
|
// 新增/修改学校信息后刷新列表
|
|
|
-const RefTable = (val) => {
|
|
|
+const RefTable = (val: any) => {
|
|
|
showDialog.value = val
|
|
|
GetSchoolList()
|
|
|
}
|
|
|
// 改变用户状态
|
|
|
-const ChangeStatus = (row) => {
|
|
|
+const ChangeStatus = (row: any) => {
|
|
|
console.log(row)
|
|
|
changeStatus({
|
|
|
id: row.id,
|
|
|
status: row.status == 0 ? 1 : 0
|
|
|
- }).then(res => {
|
|
|
+ }).then((res: any) => {
|
|
|
if(res.code == 200) {
|
|
|
GetSchoolList()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-const GoTeach = (row) => {
|
|
|
+const GoTeach = (row: any) => {
|
|
|
let accessToken = localStorage.getItem('token')
|
|
|
window.open(`https://dev3.k12100.net/#/otherLogin?schoolId=${row.id}&adminToken=${accessToken}`)
|
|
|
}
|
|
|
+const resetPassWord = (row: any) => {
|
|
|
+ passwordDialog.dialogShow = true
|
|
|
+ passwordDialog.id = row.id
|
|
|
+ passwordDialog.type = '2'
|
|
|
+ passwordDialog.name = row.tenantName
|
|
|
+ passwordDialog.label = '学校名称'
|
|
|
+ passwordDialog.remark = '学校编号'
|
|
|
+}
|
|
|
+const Refresh = () => {
|
|
|
+ schoolTypeSelect.value = " "
|
|
|
+ schoolNameCode.value = ""
|
|
|
+ GetSchoolList()
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|