diff --git a/src/api/system/whiteList/index.ts b/src/api/system/whiteList/index.ts new file mode 100644 index 0000000..a515a69 --- /dev/null +++ b/src/api/system/whiteList/index.ts @@ -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 } }) +} diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index abfee01..90ce241 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -110,7 +110,6 @@ - - -
-

软件白名单

- - 添加 - - - - - - -
@@ -381,25 +360,7 @@ import { CommonStatusEnum } from '@/utils/constants' import AppAdd from './components/app-add.vue' import * as AppApi from '@/api/exam/app' import { time } from 'console' -// 白名单数据 -interface WhiteItem { - name: string; -} -const newWhiteItem = ref('') -const addWhiteItem = () => { - const name = newWhiteItem.value.trim() - if (!name) return - if (form.value.whiteList.some(item => item.name === name)) return // 防止重复 - form.value.whiteList.push({ name }) - newWhiteItem.value = '' - handleFormChange(); -} - -const removeWhiteItem = (row) => { - form.value.whiteList = form.value.whiteList.filter(item => item.name !== row.name) - handleFormChange(); -} const props = defineProps({ taskId: { type: String, @@ -430,8 +391,7 @@ const form = ref({ warn: '', isScore: '', isScoreDetail: '', - isDelete: '', - whiteList: [] as WhiteItem[], // 明确类型 + isDelete: '' }) const tableData = ref([]) // 列表的数 const showAdd = ref(false) diff --git a/src/views/task/selftrans/random/components/steps/step3/index.vue b/src/views/task/selftrans/random/components/steps/step3/index.vue index 782c0ae..3d42899 100644 --- a/src/views/task/selftrans/random/components/steps/step3/index.vue +++ b/src/views/task/selftrans/random/components/steps/step3/index.vue @@ -347,27 +347,6 @@ - -
-

软件白名单

- - 添加 - - - - - - - -
@@ -381,25 +360,7 @@ import { CommonStatusEnum } from '@/utils/constants' import AppAdd from './components/app-add.vue' import * as AppApi from '@/api/exam/app' import { time } from 'console' -// 白名单数据 -interface WhiteItem { - name: string; -} -const newWhiteItem = ref('') -const addWhiteItem = () => { - const name = newWhiteItem.value.trim() - if (!name) return - if (form.value.whiteList.some(item => item.name === name)) return // 防止重复 - form.value.whiteList.push({ name }) - newWhiteItem.value = '' - handleFormChange(); -} - -const removeWhiteItem = (row) => { - form.value.whiteList = form.value.whiteList.filter(item => item.name !== row.name) - handleFormChange(); -} const props = defineProps({ taskId: { type: String, @@ -430,8 +391,7 @@ const form = ref({ warn: '', isScore: '', isScoreDetail: '', - isDelete: '', - whiteList: [] as WhiteItem[], // 明确类型 + isDelete: '' }) const tableData = ref([]) // 列表的数 const showAdd = ref(false) diff --git a/src/views/task/sprint/components/steps/step3/index.vue b/src/views/task/sprint/components/steps/step3/index.vue index def62eb..3d42899 100644 --- a/src/views/task/sprint/components/steps/step3/index.vue +++ b/src/views/task/sprint/components/steps/step3/index.vue @@ -347,27 +347,6 @@ - -
-

软件白名单

- - 添加 - - - - - - - -
@@ -381,25 +360,7 @@ import { CommonStatusEnum } from '@/utils/constants' import AppAdd from './components/app-add.vue' import * as AppApi from '@/api/exam/app' import { time } from 'console' -// 白名单数据 -interface WhiteItem { - name: string; -} -const newWhiteItem = ref('') -const addWhiteItem = () => { - const name = newWhiteItem.value.trim() - if (!name) return - if (form.value.whiteList.some(item => item.name === name)) return // 防止重复 - form.value.whiteList.push({ name }) - newWhiteItem.value = '' - handleFormChange(); -} - -const removeWhiteItem = (row) => { - form.value.whiteList = form.value.whiteList.filter(item => item.name !== row.name) - handleFormChange(); -} const props = defineProps({ taskId: { type: String, @@ -430,8 +391,7 @@ const form = ref({ warn: '', isScore: '', isScoreDetail: '', - isDelete: '', - whiteList: [] as WhiteItem[], // 明确类型 + isDelete: '' }) const tableData = ref([]) // 列表的数 const showAdd = ref(false) diff --git a/src/views/task/trans/components/steps/step3/index.vue b/src/views/task/trans/components/steps/step3/index.vue index 782c0ae..eaaa673 100644 --- a/src/views/task/trans/components/steps/step3/index.vue +++ b/src/views/task/trans/components/steps/step3/index.vue @@ -347,27 +347,6 @@ - -
-

软件白名单

- - 添加 - - - - - - - -
@@ -381,25 +360,6 @@ import { CommonStatusEnum } from '@/utils/constants' import AppAdd from './components/app-add.vue' import * as AppApi from '@/api/exam/app' import { time } from 'console' -// 白名单数据 -interface WhiteItem { - name: string; -} -const newWhiteItem = ref('') - -const addWhiteItem = () => { - const name = newWhiteItem.value.trim() - if (!name) return - if (form.value.whiteList.some(item => item.name === name)) return // 防止重复 - form.value.whiteList.push({ name }) - newWhiteItem.value = '' - handleFormChange(); -} - -const removeWhiteItem = (row) => { - form.value.whiteList = form.value.whiteList.filter(item => item.name !== row.name) - handleFormChange(); -} const props = defineProps({ taskId: { type: String, @@ -430,8 +390,7 @@ const form = ref({ warn: '', isScore: '', isScoreDetail: '', - isDelete: '', - whiteList: [] as WhiteItem[], // 明确类型 + isDelete: '' }) const tableData = ref([]) // 列表的数 const showAdd = ref(false)