From c832bf2e80ac465e71b7a1c1f7a59d4252030989 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 05 Aug 2025 17:33:08 +0800
Subject: [PATCH] feat:事件工单滚动条
---
src/views/system/user.vue | 851 ++++++++++++++++++++++++++++----------------------------
1 files changed, 429 insertions(+), 422 deletions(-)
diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index edd9fb3..09c1674 100644
--- a/src/views/system/user.vue
+++ b/src/views/system/user.vue
@@ -1,132 +1,60 @@
<template>
- <el-row>
- <el-col :span="5">
- <div class="box">
+ <div class="manage-p-all-10 manage-p-t-0 manage-h-0 manage-flex-1 manage-flex">
+ <div
+ class="manage-p-all-20 manage-flex-2 manage-h-100 manage-b-r-5 manage-box-s-b-b manage-overflow-h manage-b-c-w">
+ <div class="box ">
<el-scrollbar>
- <basic-container>
+ <div class="manage-w-100 manage-h-100">
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
- </basic-container>
+ </div>
</el-scrollbar>
</div>
- </el-col>
- <el-col :span="19">
- <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"
- :before-open="beforeOpen"
- v-model:page="page"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad"
- >
+ </div>
+
+ <div
+ class="manage-p-all-10 manage-p-t-0 manage-p-b-0 manage-flex-9 manage-h-100 manage-flex manage-box-s-b-b manage-f-d-c">
+ <div class="manage-p-all-20 manage-h-100 manage-box-s-b-b manage-b-c-w manage-b-r-5">
+ <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"
+ :before-open="beforeOpen" v-model:page="page" @search-change="searchChange" @search-reset="searchReset"
+ @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+ @refresh-change="refreshChange" @on-load="onLoad">
<template #menu-left>
- <el-button
- v-if="permission.user_add && !auditMode"
- type="primary"
- icon="el-icon-plus"
- @click="$refs.crud.rowAdd()"
- >新 增
+ <el-button v-if="permission.user_add && !auditMode" type="primary" icon="el-icon-plus"
+ @click="$refs.crud.rowAdd()">新 增
</el-button>
- <el-button
- type="danger"
- plain
- icon="el-icon-delete"
- v-if="permission.user_delete && !auditMode"
- @click="handleDelete"
- >删 除
+ <el-button type="danger" plain icon="el-icon-delete" v-if="permission.user_delete && !auditMode"
+ @click="handleDelete">删 除
</el-button>
- <el-button
- type="primary"
- plain
- icon="el-icon-operation"
- v-if="userInfo.role_name.includes('admin') && !auditMode"
- @click="handleAudit"
- >审 核
+ <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="danger" plain icon="el-icon-close" v-if="userInfo.role_name.includes('admin') && auditMode"
+ @click="handleAuditRefuse">拒 绝
</el-button>
- <el-button
- type="primary"
- plain
- icon="el-icon-refresh-left"
- v-if="userInfo.role_name.includes('admin') && auditMode"
- @click="handleAuditBack"
- >返 回
+ <el-button type="primary" plain icon="el-icon-refresh-left"
+ v-if="userInfo.role_name.includes('admin') && auditMode" @click="handleAuditBack">返 回
</el-button>
- <el-button
- type="info"
- plain
- v-if="permission.user_role && !auditMode"
- icon="el-icon-user"
- @click="handleGrant"
- >角色配置
+ <el-button type="info" plain v-if="permission.user_role && !auditMode" icon="el-icon-user"
+ @click="handleGrant">角色配置
</el-button>
- <el-button
- type="info"
- plain
- v-if="permission.user_reset && !auditMode"
- icon="el-icon-refresh"
- @click="handleReset"
- >密码重置
+ <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"
- >账号解封
+ <el-button type="info" plain v-if="userInfo.role_name.includes('admin') && !auditMode"
+ icon="el-icon-coordinate" @click="handleLock">账号解封
</el-button>
- <el-button
- type="success"
- plain
- v-if="userInfo.role_name.includes('admin') && !auditMode"
- icon="el-icon-upload"
- @click="handleImport"
- >导入
+ <el-button type="success" plain v-if="userInfo.role_name.includes('admin') && !auditMode"
+ icon="el-icon-upload" @click="handleImport">导入
</el-button>
- <el-button
- type="warning"
- plain
- v-if="userInfo.role_name.includes('admin') && !auditMode"
- icon="el-icon-download"
- @click="handleExport"
- >导出
+ <el-button type="warning" plain v-if="userInfo.role_name.includes('admin') && !auditMode"
+ icon="el-icon-download" @click="handleExport">导出
</el-button>
</template>
<template #tenantName="{ row }">
@@ -141,18 +69,11 @@
<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"
- :default-checked-keys="roleTreeObj"
- :props="props"
- >
+ <el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id" ref="treeRole"
+ :default-checked-keys="roleTreeObj" :props="props">
</el-tree>
<template #footer>
<span class="dialog-footer">
@@ -171,24 +92,12 @@
</avue-form>
</el-dialog>
<el-dialog title="用户平台配置" append-to-body v-model="platformBox">
- <avue-crud
- :option="platformOption"
- :table-loading="platformLoading"
- :data="platformData"
- ref="platformCrud"
- v-model="platformForm"
- :before-open="platformBeforeOpen"
- v-model:page="platformPage"
- :permission="platformPermissionList"
- @row-update="platformRowUpdate"
- @search-change="platformSearchChange"
- @search-reset="platformSearchReset"
- @selection-change="platformSelectionChange"
- @current-change="platformCurrentChange"
- @size-change="platformSizeChange"
- @refresh-change="platformRefreshChange"
- @on-load="platformOnLoad"
- >
+ <avue-crud :option="platformOption" :table-loading="platformLoading" :data="platformData" ref="platformCrud"
+ v-model="platformForm" :before-open="platformBeforeOpen" v-model:page="platformPage"
+ :permission="platformPermissionList" @row-update="platformRowUpdate" @search-change="platformSearchChange"
+ @search-reset="platformSearchReset" @selection-change="platformSelectionChange"
+ @current-change="platformCurrentChange" @size-change="platformSizeChange"
+ @refresh-change="platformRefreshChange" @on-load="platformOnLoad">
<template #tenantName="{ row }">
<el-tag>{{ row.tenantName }}</el-tag>
</template>
@@ -197,9 +106,9 @@
</template>
</avue-crud>
</el-dialog>
- </basic-container>
- </el-col>
- </el-row>
+ </div>
+ </div>
+ </div>
</template>
<script>
@@ -216,39 +125,42 @@
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: {},
+ form: {
+ flightStartTime: null, // 飞行事件开始时间
+ flightEndTime: null, // 飞行事件结束时间
+ },
search: {},
roleBox: false,
excelBox: false,
@@ -285,17 +197,22 @@
nodeKey: 'id',
lazy: true,
treeLoad: function (node, resolve) {
- const parentId = node.level === 0 ? 0 : node.data.id;
- getDeptLazyTree(parentId).then(res => {
+ const parentId = node.level === 0 ? 0 : node.data.id
+ console.log(node, 666)
+ const param = {
+ parentId: parentId,
+ level: node.level
+ }
+ getDeptLazyTree(param).then(res => {
resolve(
res.data.data.map(item => {
return {
...item,
leaf: !item.hasChildren,
- };
+ }
})
- );
- });
+ )
+ })
},
addBtn: false,
menu: false,
@@ -308,8 +225,6 @@
},
},
option: {
- height: 'auto',
- calcHeight: 140,
tip: false,
searchShow: true,
searchMenuSpan: 6,
@@ -320,6 +235,9 @@
viewBtn: true,
dialogType: 'drawer',
dialogClickModal: false,
+
+ height: 'auto',
+ calcHeight: 20,
column: [
{
label: '登录账号',
@@ -453,6 +371,7 @@
viewDisplay: false,
rules: [{ required: true, validator: validatePass2, trigger: 'blur' }],
},
+
],
},
{
@@ -460,18 +379,18 @@
prop: 'detailInfo',
icon: 'el-icon-s-order',
column: [
- {
- label: '用户昵称',
- prop: 'name',
- hide: true,
- rules: [
- {
- required: true,
- message: '请输入用户昵称',
- trigger: 'blur',
- },
- ],
- },
+ // {
+ // label: '用户昵称',
+ // prop: 'name',
+ // hide: true,
+ // rules: [
+ // {
+ // required: true,
+ // message: '请输入用户昵称',
+ // trigger: 'blur',
+ // },
+ // ],
+ // },
{
label: '用户姓名',
prop: 'realName',
@@ -569,8 +488,12 @@
type: 'tree',
multiple: true,
dicData: [],
+ // props: {
+ // label: 'title',
+ // },
props: {
- label: 'title',
+ label: 'name',
+ value: 'id',
},
checkStrictly: true,
slot: true,
@@ -582,24 +505,58 @@
},
],
},
- // {
- // label: '所属岗位',
- // prop: 'postId',
- // type: 'tree',
- // multiple: true,
- // dicData: [],
- // props: {
- // label: 'postName',
- // value: 'id',
- // },
- // rules: [
- // {
- // required: true,
- // message: '请选择所属岗位',
- // trigger: 'click',
- // },
- // ],
- // },
+
+ ],
+ },
+ {
+ 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',
+ valueFormat: 'HH:mm',
+ rules: [
+ {
+ required: false,
+ message: '请输入飞行开始时间',
+ trigger: 'blur',
+ },
+ ],
+ },
+ {
+ label: '飞行结束时间',
+ prop: 'flightEndTime',
+ type: 'time',
+ format: 'HH:mm',
+ valueFormat: 'HH:mm',
+ rules: [
+ {
+ required: false,
+ message: '请输入飞行结束时间',
+ trigger: 'blur',
+ },
+ ],
+ },
+
+
+
],
},
],
@@ -730,163 +687,206 @@
},
],
},
- };
+ }
},
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)
},
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) {
+ 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;
- });
- getPostList(tenantId).then(res => {
- const column = this.findObject(this.option.group, 'postId');
- 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) {
- row.deptId = func.join(row.deptId);
- row.roleId = func.join(row.roleId);
- row.postId = func.join(row.postId);
+ 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 (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) {
- row.deptId = func.join(row.deptId);
- row.roleId = func.join(row.roleId);
- row.postId = func.join(row.postId);
+ 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)
+
+ 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
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: '确定',
@@ -894,25 +894,25 @@
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: '确定',
@@ -920,21 +920,21 @@
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: '确定',
@@ -942,25 +942,25 @@
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: '确定',
@@ -968,37 +968,37 @@
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: '确定',
@@ -1006,171 +1006,178 @@
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
+ `/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) {
+ // 格式化时间为 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}`
},
},
-};
+}
</script>
-<style>
+<style lang="scss" scoped>
.box {
- height: 800px;
-}
-
-.el-scrollbar {
height: 100%;
}
-.box .el-scrollbar__wrap {
- overflow: scroll;
+::v-deep(.el-scrollbar) {
+ height: 100%;
+
+ .el-scrollbar__wrap {
+ overflow: auto;
+ }
}
</style>
--
Gitblit v1.9.3