| | |
| | | <template> |
| | | <el-row> |
| | | <el-col :span="5"> |
| | | <div class="manage-p-all-10 manage-p-t-0 manage-h-0 manage-flex-1 manage-flex"> |
| | | <div class="manage-flex-2 manage-h-100"> |
| | | <div class="box"> |
| | | <el-scrollbar> |
| | | <basic-container> |
| | |
| | | </basic-container> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | | </div> |
| | | |
| | | <div class="manage-flex-6 manage-h-100 manage-flex manage-f-d-c"> |
| | | <basic-container> |
| | | <avue-crud :option="option" v-model:search="search" :table-loading="loading" :data="data" ref="crud" |
| | | v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave" |
| | |
| | | <el-button type="primary" plain icon="el-icon-operation" |
| | | v-if="userInfo.role_name.includes('admin') && !auditMode" @click="handleAudit">审 核 |
| | | </el-button> |
| | | <el-button type="success" plain icon="el-icon-check" v-if="userInfo.role_name.includes('admin') && auditMode" |
| | | @click="handleAuditPass">通 过 |
| | | <el-button type="success" plain icon="el-icon-check" |
| | | v-if="userInfo.role_name.includes('admin') && auditMode" @click="handleAuditPass">通 过 |
| | | </el-button> |
| | | <el-button type="danger" plain icon="el-icon-close" v-if="userInfo.role_name.includes('admin') && auditMode" |
| | | @click="handleAuditRefuse">拒 绝 |
| | |
| | | <el-button type="info" plain v-if="permission.user_reset && !auditMode" icon="el-icon-refresh" |
| | | @click="handleReset">密码重置 |
| | | </el-button> |
| | | <el-button type="info" plain v-if="userInfo.role_name.includes('admin') && !auditMode" icon="el-icon-setting" |
| | | @click="handlePlatform">平台配置 |
| | | <el-button type="info" plain v-if="userInfo.role_name.includes('admin') && !auditMode" |
| | | icon="el-icon-setting" @click="handlePlatform">平台配置 |
| | | </el-button> |
| | | <el-button type="info" plain v-if="userInfo.role_name.includes('admin') && !auditMode" |
| | | icon="el-icon-coordinate" @click="handleLock">账号解封 |
| | |
| | | <template #userTypeName="{ row }"> |
| | | <el-tag>{{ row.userTypeName }}</el-tag> |
| | | </template> |
| | | |
| | | |
| | | </avue-crud> |
| | | <el-dialog title="用户角色配置" append-to-body v-model="roleBox" width="345px"> |
| | | <el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id" ref="treeRole" |
| | |
| | | </avue-crud> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | unlock, |
| | | auditPass, |
| | | auditRefuse, |
| | | } from '@/api/system/user'; |
| | | import { exportBlob } from '@/api/common'; |
| | | import { getDeptTree, getDeptLazyTree } from '@/api/system/dept'; |
| | | import { getRoleTree } from '@/api/system/role'; |
| | | import { getPostList } from '@/api/system/post'; |
| | | import { mapGetters } from 'vuex'; |
| | | import website from '@/config/website'; |
| | | import { getToken } from '@/utils/auth'; |
| | | import { downloadXls } from '@/utils/util'; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | import func from '@/utils/func'; |
| | | } from '@/api/system/user' |
| | | import { exportBlob } from '@/api/common' |
| | | import { getDeptTree, getDeptLazyTree } from '@/api/system/dept' |
| | | import { getRoleTree } from '@/api/system/role' |
| | | import { getPostList } from '@/api/system/post' |
| | | import { mapGetters } from 'vuex' |
| | | import website from '@/config/website' |
| | | import { getToken } from '@/utils/auth' |
| | | import { downloadXls } from '@/utils/util' |
| | | import NProgress from 'nprogress' |
| | | import 'nprogress/nprogress.css' |
| | | import func from '@/utils/func' |
| | | |
| | | export default { |
| | | data() { |
| | | data () { |
| | | const validatePass = (rule, value, callback) => { |
| | | if (value === '') { |
| | | callback(new Error('请输入密码')); |
| | | callback(new Error('请输入密码')) |
| | | } else { |
| | | callback(); |
| | | callback() |
| | | } |
| | | }; |
| | | } |
| | | const validatePass2 = (rule, value, callback) => { |
| | | if (value === '') { |
| | | callback(new Error('请再次输入密码')); |
| | | callback(new Error('请再次输入密码')) |
| | | } else if (value !== this.form.password) { |
| | | callback(new Error('两次输入密码不一致!')); |
| | | callback(new Error('两次输入密码不一致!')) |
| | | } else { |
| | | callback(); |
| | | callback() |
| | | } |
| | | }; |
| | | } |
| | | return { |
| | | form: { |
| | | flightStartTime: null, // 飞行事件开始时间 |
| | |
| | | nodeKey: 'id', |
| | | lazy: true, |
| | | treeLoad: function (node, resolve) { |
| | | const parentId = node.level === 0 ? 0 : node.data.id; |
| | | console.log(node,666) |
| | | const parentId = node.level === 0 ? 0 : node.data.id |
| | | console.log(node, 666) |
| | | const param = { |
| | | parentId:parentId, |
| | | level:node.level |
| | | parentId: parentId, |
| | | level: node.level |
| | | } |
| | | getDeptLazyTree(param).then(res => { |
| | | resolve( |
| | |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren, |
| | | }; |
| | | } |
| | | }) |
| | | ); |
| | | }); |
| | | ) |
| | | }) |
| | | }, |
| | | addBtn: false, |
| | | menu: false, |
| | |
| | | viewDisplay: false, |
| | | rules: [{ required: true, validator: validatePass2, trigger: 'blur' }], |
| | | }, |
| | | |
| | | |
| | | ], |
| | | }, |
| | | { |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | |
| | | ], |
| | | }, |
| | | { |
| | | { |
| | | label: '登录限制', |
| | | prop: '', |
| | | icon: 'el-icon-s-custom', |
| | | column: [ |
| | | { |
| | | { |
| | | label: '到期时间', |
| | | prop: 'expireTime', |
| | | type: 'datetime', |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | }, |
| | | { |
| | | { |
| | | label: '次数限制', |
| | | prop: 'maxLoginNum', |
| | | type: 'input', |
| | | }, |
| | | |
| | | { |
| | | { |
| | | label: '飞行开始时间', |
| | | prop: 'flightStartTime', |
| | | type: 'time', |
| | | format: 'HH:mm', |
| | | type: 'time', |
| | | format: 'HH:mm', |
| | | valueFormat: 'HH:mm', |
| | | rules: [ |
| | | { |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ], |
| | | }, |
| | | ], |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | 'form.tenantId'() { |
| | | 'form.tenantId' () { |
| | | if (this.form.tenantId !== '' && this.initFlag) { |
| | | this.initData(this.form.tenantId); |
| | | this.initData(this.form.tenantId) |
| | | } |
| | | }, |
| | | 'excelForm.isCovered'() { |
| | | 'excelForm.isCovered' () { |
| | | if (this.excelForm.isCovered !== '') { |
| | | const column = this.findObject(this.excelOption.column, 'excelFile'); |
| | | column.action = `/blade-system/user/import-user?isCovered=${this.excelForm.isCovered}`; |
| | | const column = this.findObject(this.excelOption.column, 'excelFile') |
| | | column.action = `/blade-system/user/import-user?isCovered=${this.excelForm.isCovered}` |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo', 'permission']), |
| | | permissionList() { |
| | | permissionList () { |
| | | return { |
| | | addBtn: this.validData(this.permission.user_add, false), |
| | | viewBtn: this.validData(this.permission.user_view, false), |
| | | delBtn: this.validData(this.permission.user_delete, false), |
| | | editBtn: this.validData(this.permission.user_edit, false), |
| | | }; |
| | | } |
| | | }, |
| | | platformPermissionList() { |
| | | platformPermissionList () { |
| | | return { |
| | | addBtn: false, |
| | | viewBtn: false, |
| | | delBtn: false, |
| | | editBtn: this.validData(this.permission.user_edit, false), |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | ids () { |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(','); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(',') |
| | | }, |
| | | }, |
| | | mounted() { |
| | | mounted () { |
| | | // 非租户模式默认加载管理组数据 |
| | | if (!website.tenantMode) { |
| | | this.initData(website.tenantId); |
| | | this.initData(website.tenantId) |
| | | } |
| | | this.initData(this.form.tenantId); |
| | | this.initData(this.form.tenantId) |
| | | }, |
| | | methods: { |
| | | nodeClick(data) { |
| | | this.treeDeptId = data.id; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page); |
| | | nodeClick (data) { |
| | | this.treeDeptId = data.id |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page) |
| | | }, |
| | | initData(tenantId) { |
| | | tenantId = '000000'; |
| | | initData (tenantId) { |
| | | tenantId = '000000' |
| | | getRoleTree(tenantId).then(res => { |
| | | const column = this.findObject(this.option.group, 'roleId'); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | const column = this.findObject(this.option.group, 'roleId') |
| | | column.dicData = res.data.data |
| | | }) |
| | | getDeptTree(tenantId).then(res => { |
| | | const column = this.findObject(this.option.group, 'deptId'); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | const column = this.findObject(this.option.group, 'deptId') |
| | | column.dicData = res.data.data |
| | | }) |
| | | // getPostList(tenantId).then(res => { |
| | | // const column = this.findObject(this.option.group, 'postId'); |
| | | // column.dicData = res.data.data; |
| | | // }); |
| | | }, |
| | | submitRole() { |
| | | const roleList = this.$refs.treeRole.getCheckedKeys().join(','); |
| | | submitRole () { |
| | | const roleList = this.$refs.treeRole.getCheckedKeys().join(',') |
| | | grant(this.ids, roleList).then(() => { |
| | | this.roleBox = false; |
| | | this.roleBox = false |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.onLoad(this.page); |
| | | }); |
| | | }) |
| | | this.onLoad(this.page) |
| | | }) |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | rowSave (row, done, loading) { |
| | | // 格式化时间数据 |
| | | |
| | | if (row.flightStartTime && row.flightEndTime) { |
| | | // 验证 flightEndTime 是否小于 flightStartTime |
| | | const [startHours, startMinutes] = row.flightStartTime.split(':').map(Number); |
| | | const [endHours, endMinutes] = row.flightEndTime.split(':').map(Number); |
| | | |
| | | const startTotalMinutes = startHours * 60 + startMinutes; |
| | | const endTotalMinutes = endHours * 60 + endMinutes; |
| | | if (row.flightStartTime && row.flightEndTime) { |
| | | // 验证 flightEndTime 是否小于 flightStartTime |
| | | const [startHours, startMinutes] = row.flightStartTime.split(':').map(Number) |
| | | const [endHours, endMinutes] = row.flightEndTime.split(':').map(Number) |
| | | |
| | | if (endTotalMinutes < startTotalMinutes) { |
| | | this.$message.error('飞行结束时间不能小于飞行开始时间'); |
| | | loading(); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | row.deptId = func.join(row.deptId); |
| | | row.roleId = func.join(row.roleId); |
| | | row.postId = func.join(row.postId); |
| | | const startTotalMinutes = startHours * 60 + startMinutes |
| | | const endTotalMinutes = endHours * 60 + endMinutes |
| | | |
| | | if (endTotalMinutes < startTotalMinutes) { |
| | | this.$message.error('飞行结束时间不能小于飞行开始时间') |
| | | loading() |
| | | return |
| | | } |
| | | } |
| | | |
| | | row.deptId = func.join(row.deptId) |
| | | row.roleId = func.join(row.roleId) |
| | | row.postId = func.join(row.postId) |
| | | row.name = row.realName |
| | | add(row).then( |
| | | () => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.initFlag = false |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | // 格式化时间数据 |
| | | rowUpdate (row, index, done, loading) { |
| | | // 格式化时间数据 |
| | | // if (row.flightStartTime) { |
| | | // row.flightStartTime = this.formatTime(row.flightStartTime); |
| | | // } |
| | | // if (row.flightEndTime) { |
| | | // row.flightEndTime = this.formatTime(row.flightEndTime); |
| | | // } |
| | | if (row.flightStartTime && row.flightEndTime) { |
| | | // 验证 flightEndTime 是否小于 flightStartTime |
| | | const [startHours, startMinutes] = row.flightStartTime.split(':').map(Number); |
| | | const [endHours, endMinutes] = row.flightEndTime.split(':').map(Number); |
| | | if (row.flightStartTime && row.flightEndTime) { |
| | | // 验证 flightEndTime 是否小于 flightStartTime |
| | | const [startHours, startMinutes] = row.flightStartTime.split(':').map(Number) |
| | | const [endHours, endMinutes] = row.flightEndTime.split(':').map(Number) |
| | | |
| | | const startTotalMinutes = startHours * 60 + startMinutes; |
| | | const endTotalMinutes = endHours * 60 + endMinutes; |
| | | const startTotalMinutes = startHours * 60 + startMinutes |
| | | const endTotalMinutes = endHours * 60 + endMinutes |
| | | |
| | | if (endTotalMinutes < startTotalMinutes) { |
| | | this.$message.error('飞行结束时间不能小于飞行开始时间'); |
| | | loading(); |
| | | return ; |
| | | if (endTotalMinutes < startTotalMinutes) { |
| | | this.$message.error('飞行结束时间不能小于飞行开始时间') |
| | | loading() |
| | | return |
| | | } |
| | | } |
| | | } |
| | | |
| | | row.deptId = func.join(row.deptId); |
| | | row.roleId = func.join(row.roleId); |
| | | row.postId = func.join(row.postId); |
| | | |
| | | row.deptId = func.join(row.deptId) |
| | | row.roleId = func.join(row.roleId) |
| | | row.postId = func.join(row.postId) |
| | | row.name = row.realName |
| | | update(row).then( |
| | | () => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.initFlag = false |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | rowDel(row) { |
| | | rowDel (row) { |
| | | this.$confirm('确定将选择数据删除?', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.treeDeptId = ''; |
| | | this.onLoad(this.page); |
| | | searchReset () { |
| | | this.query = {} |
| | | this.treeDeptId = '' |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | searchChange (params, done) { |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | selectionChange (list) { |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | selectionClear () { |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | handleDelete () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning('请选择至少一条数据'); |
| | | return; |
| | | this.$message.warning('请选择至少一条数据') |
| | | return |
| | | } |
| | | this.$confirm('确定将选择数据删除?', { |
| | | confirmButtonText: '确定', |
| | |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | handleAudit() { |
| | | this.auditMode = true; |
| | | this.onLoad(this.page, this.query); |
| | | handleAudit () { |
| | | this.auditMode = true |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | handleAuditPass() { |
| | | handleAuditPass () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning('请选择至少一条数据'); |
| | | return; |
| | | this.$message.warning('请选择至少一条数据') |
| | | return |
| | | } |
| | | this.$confirm('确定将选择数据通过审核?', { |
| | | confirmButtonText: '确定', |
| | |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return auditPass(this.ids); |
| | | return auditPass(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | handleAuditRefuse() { |
| | | handleAuditRefuse () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning('请选择至少一条数据'); |
| | | return; |
| | | this.$message.warning('请选择至少一条数据') |
| | | return |
| | | } |
| | | this.$confirm('确定将选择数据拒绝审核?', { |
| | | confirmButtonText: '确定', |
| | |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return auditRefuse(this.ids); |
| | | return auditRefuse(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | handleAuditBack() { |
| | | this.auditMode = false; |
| | | this.onLoad(this.page, this.query); |
| | | handleAuditBack () { |
| | | this.auditMode = false |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | handleReset() { |
| | | handleReset () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning('请选择至少一条数据'); |
| | | return; |
| | | this.$message.warning('请选择至少一条数据') |
| | | return |
| | | } |
| | | this.$confirm('确定将选择账号密码重置为123456?', { |
| | | confirmButtonText: '确定', |
| | |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return resetPassword(this.ids); |
| | | return resetPassword(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | handleGrant() { |
| | | handleGrant () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning('请选择至少一条数据'); |
| | | return; |
| | | this.$message.warning('请选择至少一条数据') |
| | | return |
| | | } |
| | | this.roleTreeObj = []; |
| | | this.roleTreeObj = [] |
| | | if (this.selectionList.length === 1) { |
| | | this.roleTreeObj = this.selectionList[0].roleId.split(','); |
| | | this.roleTreeObj = this.selectionList[0].roleId.split(',') |
| | | } |
| | | getRoleTree().then(res => { |
| | | this.roleGrantList = res.data.data; |
| | | this.roleBox = true; |
| | | }); |
| | | this.roleGrantList = res.data.data |
| | | this.roleBox = true |
| | | }) |
| | | }, |
| | | handlePlatform() { |
| | | this.platformBox = true; |
| | | handlePlatform () { |
| | | this.platformBox = true |
| | | }, |
| | | handleLock() { |
| | | handleLock () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning('请选择至少一条数据'); |
| | | return; |
| | | this.$message.warning('请选择至少一条数据') |
| | | return |
| | | } |
| | | this.$confirm('确定将选择账号解封?', { |
| | | confirmButtonText: '确定', |
| | |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return unlock(this.ids); |
| | | return unlock(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleImport() { |
| | | this.excelBox = true; |
| | | handleImport () { |
| | | this.excelBox = true |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | uploadAfter (res, done, loading, column) { |
| | | window.console.log(column) |
| | | this.excelBox = false |
| | | this.refreshChange() |
| | | done() |
| | | }, |
| | | handleExport() { |
| | | const account = func.toStr(this.search.account); |
| | | const realName = func.toStr(this.search.realName); |
| | | handleExport () { |
| | | const account = func.toStr(this.search.account) |
| | | const realName = func.toStr(this.search.realName) |
| | | this.$confirm('是否导出用户数据?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | NProgress.start() |
| | | exportBlob( |
| | | `/blade-system/user/export-user?${this.website.tokenHeader |
| | | }=${getToken()}&account=${account}&realName=${realName}` |
| | | ).then(res => { |
| | | downloadXls(res.data, `用户数据表${this.$dayjs().format('YYYY-MM-DD')}.xlsx`); |
| | | NProgress.done(); |
| | | }); |
| | | }); |
| | | downloadXls(res.data, `用户数据表${this.$dayjs().format('YYYY-MM-DD')}.xlsx`) |
| | | NProgress.done() |
| | | }) |
| | | }) |
| | | }, |
| | | handleTemplate() { |
| | | handleTemplate () { |
| | | exportBlob( |
| | | `/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}` |
| | | ).then(res => { |
| | | downloadXls(res.data, '用户数据模板.xlsx'); |
| | | }); |
| | | downloadXls(res.data, '用户数据模板.xlsx') |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | beforeOpen (done, type) { |
| | | if (['edit', 'view'].includes(type)) { |
| | | getUser(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | this.form = res.data.data |
| | | if (this.form.hasOwnProperty('deptId')) { |
| | | this.form.deptId = func.split(this.form.deptId); |
| | | this.form.deptId = func.split(this.form.deptId) |
| | | } |
| | | if (this.form.hasOwnProperty('roleId')) { |
| | | this.form.roleId = func.split(this.form.roleId); |
| | | this.form.roleId = func.split(this.form.roleId) |
| | | } |
| | | if (this.form.hasOwnProperty('postId')) { |
| | | this.form.postId = func.split(this.form.postId); |
| | | this.form.postId = func.split(this.form.postId) |
| | | } |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | this.initFlag = true; |
| | | done(); |
| | | this.initFlag = true |
| | | done() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | currentChange (currentPage) { |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | sizeChange (pageSize) { |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | refreshChange () { |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | onLoad (page, params = {}) { |
| | | this.loading = true |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query, { status: this.auditMode ? 0 : 1 }), |
| | | this.treeDeptId |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | platformRowUpdate(row, index, done, loading) { |
| | | platformRowUpdate (row, index, done, loading) { |
| | | updatePlatform(row.id, row.userType, row.userExt).then( |
| | | () => { |
| | | this.platformOnLoad(this.platformPage); |
| | | this.platformOnLoad(this.platformPage) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | platformBeforeOpen(done, type) { |
| | | platformBeforeOpen (done, type) { |
| | | if (['edit', 'view'].includes(type)) { |
| | | getUserPlatform(this.platformForm.id).then(res => { |
| | | this.platformForm = res.data.data; |
| | | }); |
| | | this.platformForm = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | platformSearchReset() { |
| | | this.platformQuery = {}; |
| | | this.platformOnLoad(this.platformPage); |
| | | platformSearchReset () { |
| | | this.platformQuery = {} |
| | | this.platformOnLoad(this.platformPage) |
| | | }, |
| | | platformSearchChange(params, done) { |
| | | this.platformQuery = params; |
| | | this.platformPage.currentPage = 1; |
| | | this.platformOnLoad(this.platformPage, params); |
| | | done(); |
| | | platformSearchChange (params, done) { |
| | | this.platformQuery = params |
| | | this.platformPage.currentPage = 1 |
| | | this.platformOnLoad(this.platformPage, params) |
| | | done() |
| | | }, |
| | | platformSelectionChange(list) { |
| | | this.platformSelectionList = list; |
| | | platformSelectionChange (list) { |
| | | this.platformSelectionList = list |
| | | }, |
| | | platformSelectionClear() { |
| | | this.platformSelectionList = []; |
| | | this.$refs.platformCrud.toggleSelection(); |
| | | platformSelectionClear () { |
| | | this.platformSelectionList = [] |
| | | this.$refs.platformCrud.toggleSelection() |
| | | }, |
| | | platformCurrentChange(currentPage) { |
| | | this.platformPage.currentPage = currentPage; |
| | | platformCurrentChange (currentPage) { |
| | | this.platformPage.currentPage = currentPage |
| | | }, |
| | | platformSizeChange(pageSize) { |
| | | this.platformPage.pageSize = pageSize; |
| | | platformSizeChange (pageSize) { |
| | | this.platformPage.pageSize = pageSize |
| | | }, |
| | | platformRefreshChange() { |
| | | this.platformOnLoad(this.platformPage, this.platformQuery); |
| | | platformRefreshChange () { |
| | | this.platformOnLoad(this.platformPage, this.platformQuery) |
| | | }, |
| | | platformOnLoad(page, params = {}) { |
| | | this.platformLoading = true; |
| | | platformOnLoad (page, params = {}) { |
| | | this.platformLoading = true |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query), |
| | | this.treeDeptId |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.platformPage.total = data.total; |
| | | this.platformData = data.records; |
| | | this.platformLoading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.platformPage.total = data.total |
| | | this.platformData = data.records |
| | | this.platformLoading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | formatTime(time) { |
| | | formatTime (time) { |
| | | // 格式化时间为 HH:mm |
| | | const date = new Date(time); |
| | | const hours = String(date.getHours()).padStart(2, '0'); |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); |
| | | return `${hours}:${minutes}`; |
| | | const date = new Date(time) |
| | | const hours = String(date.getHours()).padStart(2, '0') |
| | | const minutes = String(date.getMinutes()).padStart(2, '0') |
| | | return `${hours}:${minutes}` |
| | | }, |
| | | }, |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .box { |
| | | height: 800px; |
| | | height: 100%; |
| | | } |
| | | |
| | | .el-scrollbar { |
| | |
| | | .box .el-scrollbar__wrap { |
| | | overflow: scroll; |
| | | } |
| | | |
| | | |
| | | </style> |