Compare commits
3 Commits
5709cc6822
...
hyc
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e225586dbc | ||
73f11746ca | |||
![]() |
5d3ea6728a |
30
src/api/system/whiteList/index.ts
Normal file
30
src/api/system/whiteList/index.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
export interface WhiteVO {
|
||||||
|
name: string
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取白名单列表
|
||||||
|
export const getAppWhiteListCenter = (params:WhiteVO) => {
|
||||||
|
return request.get({ url: '/exam/white/getAppWhiteListCenter',params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
export const addAppWhite = (data) => {
|
||||||
|
return request.post({ url: '/exam/white/addAppWhite', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
export const updateAppWhite = (data) => {
|
||||||
|
return request.put({ url: '/exam/white/updateAppWhite', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export const delWhite = (id) => {
|
||||||
|
return request.delete({ url: `/exam/white/delWhite/${id}` })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取详情
|
||||||
|
export const getWhite = (id) => {
|
||||||
|
return request.get({ url: '/exam/white/getWhite', params: { id } })
|
||||||
|
}
|
@@ -110,7 +110,6 @@
|
|||||||
<el-table-column :width="300" align="center" label="操作">
|
<el-table-column :width="300" align="center" label="操作">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['system:role:update']"
|
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="openForm('update', scope.row.id)"
|
@click="openForm('update', scope.row.id)"
|
||||||
@@ -118,7 +117,6 @@
|
|||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['system:permission:assign-role-menu']"
|
|
||||||
link
|
link
|
||||||
preIcon="ep:basketball"
|
preIcon="ep:basketball"
|
||||||
title="菜单权限"
|
title="菜单权限"
|
||||||
@@ -138,7 +136,6 @@
|
|||||||
数据权限
|
数据权限
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['system:role:delete']"
|
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.row.id)"
|
@click="handleDelete(scope.row.id)"
|
||||||
|
@@ -100,7 +100,7 @@
|
|||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column label="学校用户编号" align="center" prop="id" />
|
<el-table-column label="学校用户编号" align="center" prop="id" />
|
||||||
<el-table-column label="学校用户名" align="center" prop="name" />
|
<el-table-column label="学校名称" align="center" prop="name" />
|
||||||
<el-table-column label="学校用户权限" align="center" prop="packageId">
|
<el-table-column label="学校用户权限" align="center" prop="packageId">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag v-if="scope.row.packageId === 0" type="danger">中心服务器</el-tag>
|
<el-tag v-if="scope.row.packageId === 0" type="danger">中心服务器</el-tag>
|
||||||
|
125
src/views/system/white/index.vue
Normal file
125
src/views/system/white/index.vue
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索栏 -->
|
||||||
|
<el-form :inline="true" :model="queryParams" class="mb-4">
|
||||||
|
<el-form-item label="名称"> <el-input v-model="queryParams.name" placeholder="请输入白名单名称" clearable class="!w-240px" @keyup.enter="getList" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="getList">
|
||||||
|
<Icon icon="ep:search" /> 搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="resetQuery">
|
||||||
|
<Icon icon="ep:refresh" /> 重置
|
||||||
|
</el-button>
|
||||||
|
<el-button type="success" plain @click="openForm('create')">
|
||||||
|
<Icon icon="ep:plus" />
|
||||||
|
新增 </el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<!-- 表格区域 -->
|
||||||
|
<el-table :data="list" v-loading="loading" border stripe>
|
||||||
|
<el-table-column prop="id" label="ID" align="center" width="80" />
|
||||||
|
<el-table-column prop="name" label="名称" align="center" />
|
||||||
|
<el-table-column label="操作" align="center" width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" link @click="openForm('update', scope.row.id)">
|
||||||
|
<Icon icon="ep:edit" /> 修改
|
||||||
|
</el-button>
|
||||||
|
<el-button type="danger" link @click="handleDelete(scope.row.id)">
|
||||||
|
<Icon icon="ep:delete" /> 删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 新增/修改弹窗 -->
|
||||||
|
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="500px">
|
||||||
|
<el-form ref="formRef" :model="form" label-width="80px">
|
||||||
|
<el-form-item label="名称" prop="name" required>
|
||||||
|
<el-input v-model="form.name" placeholder="请输入名称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</ContentWrap> </template> <script lang="ts" setup> import { ref, reactive } from 'vue'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import * as WhiteApi from '@/api/system/whiteList'
|
||||||
|
// 你可以把 API 封装在这个文件里 // 数据
|
||||||
|
const loading = ref(false)
|
||||||
|
const list = ref([])
|
||||||
|
const total = ref(0)
|
||||||
|
const queryParams = reactive({ pageNo: 1, pageSize: 10, name: '' })
|
||||||
|
// 弹窗相关
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const dialogTitle = ref('')
|
||||||
|
const formRef = ref()
|
||||||
|
const form = reactive({ id: '', name: '', path: '', remark: '' })
|
||||||
|
// 获取列表
|
||||||
|
const getList = async () => { loading.value = true
|
||||||
|
const params = {
|
||||||
|
...queryParams,
|
||||||
|
|
||||||
|
}
|
||||||
|
try { const res = await WhiteApi.getAppWhiteListCenter(params)
|
||||||
|
list.value = res.list
|
||||||
|
total.value = res.total
|
||||||
|
|
||||||
|
} finally
|
||||||
|
{
|
||||||
|
loading.value = false
|
||||||
|
} }
|
||||||
|
// 重置
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryParams.name = ''
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
// 打开弹窗
|
||||||
|
const openForm = async (type: string, id?: string) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
if (type === 'create') {
|
||||||
|
dialogTitle.value = '新增白名单'
|
||||||
|
Object.assign(form, { id: '', name: '', path: '', remark: '' })
|
||||||
|
} else {
|
||||||
|
dialogTitle.value = '修改白名单'
|
||||||
|
const data = await WhiteApi.getWhite(id)
|
||||||
|
Object.assign(form, data) }
|
||||||
|
} // 提交
|
||||||
|
const submitForm = async () => {
|
||||||
|
if (!form.name) {
|
||||||
|
ElMessage.warning('请输入名称')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (form.id) {
|
||||||
|
await WhiteApi.updateAppWhite(form)
|
||||||
|
ElMessage.success('修改成功')
|
||||||
|
} else {
|
||||||
|
await WhiteApi.addAppWhite(form)
|
||||||
|
ElMessage.success('新增成功')
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
// 删除
|
||||||
|
const handleDelete = async (id: string) => {
|
||||||
|
ElMessageBox.confirm('确认删除该白名单?', '提示', {
|
||||||
|
type: 'warning'
|
||||||
|
}).then(async () => {
|
||||||
|
await WhiteApi.delWhite(id)
|
||||||
|
ElMessage.success('删除成功')
|
||||||
|
getList() }) }
|
||||||
|
// 初始化
|
||||||
|
getList()
|
||||||
|
</script>
|
@@ -360,7 +360,6 @@ import { CommonStatusEnum } from '@/utils/constants'
|
|||||||
import AppAdd from './components/app-add.vue'
|
import AppAdd from './components/app-add.vue'
|
||||||
import * as AppApi from '@/api/exam/app'
|
import * as AppApi from '@/api/exam/app'
|
||||||
import { time } from 'console'
|
import { time } from 'console'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
taskId: {
|
taskId: {
|
||||||
type: String,
|
type: String,
|
||||||
|
Reference in New Issue
Block a user