用户登录问题修改

This commit is contained in:
jiang 2024-11-07 15:02:38 +08:00
parent 5ac47fa006
commit 828794effa
5 changed files with 119 additions and 21 deletions

View File

@ -0,0 +1,18 @@
import request from '@/utils/request'
// 查询【请填写功能名称】列表
export function list() {
return request({
url: '/system/user/getLockUser',
method: 'get'
})
}
// 查询【请填写功能名称】详细
export function delLockUser(data) {
return request({
url: '/system/user/delLockUser',
method: 'post',
data:data
})
}

View File

@ -0,0 +1,11 @@
<script setup>
</script>
<template>
</template>
<style scoped lang="scss">
</style>

View File

@ -75,17 +75,17 @@
<el-table v-loading="loading" :data="whitelistList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="whitelistList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/> <el-table-column type="selection" width="55" align="center"/>
<el-table-column type="index" label="序号" width="50"/> <el-table-column type="index" label="序号" width="50"/>
<el-table-column label="IP地址" align="center" prop="ipAddress"> <el-table-column label="IP地址" align="center" prop="ipAddress" min-width="120px">
<template slot-scope="scope"> <template slot-scope="scope">
<span> {{scope.row.ipAddress?scope.row.ipAddress:scope.row.ipRangeStart+" - " + scope.row.ipRangeEnd}} </span> <span> {{scope.row.ipAddress?scope.row.ipAddress:scope.row.ipRangeStart+" - " + scope.row.ipRangeEnd}} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="开放时间" align="center" prop="ipRangeStart"> <el-table-column label="开放时间" align="center" prop="ipRangeStart" min-width="120px">
<template slot-scope="scope"> <template slot-scope="scope">
<span> {{!scope.row.accessStartTime?"不限时间":parseTime(scope.row.accessStartTime,'{h}:{i}:{s}')+" - " + parseTime(scope.row.accessEndTime,'{h}:{i}:{s}')}} </span> <span> {{!scope.row.accessStartTime?"不限时间":parseTime(scope.row.accessStartTime)+" - " + parseTime(scope.row.accessEndTime)}} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" key="status"> <el-table-column label="状态" align="center" key="status" min-width="20px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" <el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
@change="handleStatusChange(scope.row)" @change="handleStatusChange(scope.row)"
@ -170,17 +170,14 @@
</el-radio-group> </el-radio-group>
<el-row v-if="timeLimit === 'limited'" :gutter="24"> <el-row v-if="timeLimit === 'limited'" :gutter="24">
<el-col :span="10"> <el-col :span="10">
<el-time-picker <el-date-picker
is-range
:editable=false
v-model="form.accessStartTime" v-model="form.accessStartTime"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至" range-separator="至"
start-placeholder="开始时间" start-placeholder="开始日期"
end-placeholder="结束时间" end-placeholder="结束日期">
placeholder="选择时间范围" </el-date-picker>
>
</el-time-picker>
</el-col> </el-col>
</el-row> </el-row>
@ -472,7 +469,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids const ids = row.id || this.ids
this.$modal.confirm('是否确认删除【请填写功能名称】编号为"' + ids + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除这些数据项?').then(function() {
return delWhitelist(ids) return delWhitelist(ids)
}).then(() => { }).then(() => {
this.getList() this.getList()

View File

@ -1,11 +1,83 @@
<script setup>
</script>
<template> <template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
size="mini"
@click="handleUpdate"
:disabled="multiple"
>解除锁定
</el-button>
</el-col>
</el-row>
<el-table ref="multipleTable" v-loading="loading" @row-click="handleRowClick" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column type="index" label="序号" width="50"/>
<el-table-column label="用户名" align="center" prop="userName"/>
<el-table-column label="锁定时长(分钟)" align="center" prop="time"/>
</el-table>
</div>
</template> </template>
<style scoped lang="scss"> <script>
import { list,delLockUser} from '@/api/system/lockUser'
</style> import { delWhitelist } from '@/api/system/ipWhitelist'
export default {
name: 'LockUser',
data() {
return {
//
loading: true,
//
ids: [],
list:[],
//
multiple: true,
}
},
created() {
this.getList()
},
methods: {
/** 查询列表 */
getList() {
this.loading = true
list().then(response => {
this.list = response.data;
this.loading = false
})
},
handleRowClick(row, column, event) {
const table = this.$refs.multipleTable;
const selectedRows = table.selection;
// Check if the row is already selected
const isRowSelected = selectedRows.includes(row);
if (isRowSelected) {
// If the row is selected, unselect it
table.toggleRowSelection(row, false);
} else {
// If the row is not selected, select it
table.toggleRowSelection(row, true);
}
},
handleUpdate(){
const ids = this.ids
this.$modal.confirm('是否确认解锁这些数据项?').then(function() {
return delLockUser(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess('解锁成功')
}).catch(() => {
})
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.userName)
this.multiple = !selection.length
},
}
}
</script>

View File

@ -108,7 +108,7 @@
<el-table-column label="账号时效" align="center"> <el-table-column label="账号时效" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.isPermanent==0?"长期账号":"临时账号" }}</span> <span>{{scope.row.isPermanent==1?"长期账号":"临时账号" }}</span>
</template> </template>
</el-table-column> </el-table-column>