aff
This commit is contained in:
20
src/constants/queryWhitelist.js
Normal file
20
src/constants/queryWhitelist.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
// 司法/特殊名单等预设接口编码,与后端 LegacyHardcodedAPICodes 保持一致,后续可在此累加
|
||||||
|
export const JUDICIAL_API_CODES = [
|
||||||
|
// flxg — 司法
|
||||||
|
'FLXG0V4B',
|
||||||
|
'FLXG2E8F',
|
||||||
|
'FLXG3A9B',
|
||||||
|
'FLXG5A3B',
|
||||||
|
'FLXG7E8F',
|
||||||
|
'FLXG9C1D',
|
||||||
|
'FLXGCA3D',
|
||||||
|
'FLXGDEA8',
|
||||||
|
'FLXGDEA9',
|
||||||
|
'FLXGHB4F',
|
||||||
|
'FLXGK5D2',
|
||||||
|
// jrzq — 特殊名单
|
||||||
|
'JRZQV7MD',
|
||||||
|
'JRZQ8A2D',
|
||||||
|
// qygl — 企业司法失信
|
||||||
|
'QYGL2S0W'
|
||||||
|
]
|
||||||
@@ -50,24 +50,32 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="生效接口" prop="api_codes">
|
<el-form-item label="生效接口" prop="api_codes">
|
||||||
<el-select
|
<div class="api-codes-field">
|
||||||
v-model="form.api_codes"
|
<el-select
|
||||||
multiple
|
v-model="form.api_codes"
|
||||||
filterable
|
multiple
|
||||||
allow-create
|
filterable
|
||||||
default-first-option
|
allow-create
|
||||||
placeholder="选择或输入 API 编码"
|
default-first-option
|
||||||
class="w-full"
|
placeholder="选择或输入 API 编码"
|
||||||
@change="handleApiCodesChange"
|
class="w-full"
|
||||||
>
|
@change="handleApiCodesChange"
|
||||||
<el-option label="全部接口 (*)" value="*" />
|
>
|
||||||
<el-option
|
<el-option label="全部接口 (*)" value="*" />
|
||||||
v-for="product in productOptions"
|
<el-option
|
||||||
:key="product.code"
|
v-for="product in productOptions"
|
||||||
:label="`${product.code} - ${product.name}`"
|
:key="product.code"
|
||||||
:value="product.code"
|
:label="`${product.code} - ${product.name}`"
|
||||||
/>
|
:value="product.code"
|
||||||
</el-select>
|
/>
|
||||||
|
</el-select>
|
||||||
|
<div class="api-codes-actions">
|
||||||
|
<el-button link type="primary" size="small" @click="selectJudicialApis">
|
||||||
|
一键选司法接口
|
||||||
|
</el-button>
|
||||||
|
<span class="api-codes-actions-tip">({{ JUDICIAL_API_CODES.length }} 个,可继续手动追加)</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-tip">选择「全部接口」时仅对入参<strong>必填身份证</strong>的 API 生效,企业类等无身份证入参的接口不受影响</div>
|
<div class="form-tip">选择「全部接口」时仅对入参<strong>必填身份证</strong>的 API 生效,企业类等无身份证入参的接口不受影响</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@@ -85,6 +93,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { productAdminApi, queryWhitelistApi, userApi } from '@/api'
|
import { productAdminApi, queryWhitelistApi, userApi } from '@/api'
|
||||||
|
import { JUDICIAL_API_CODES } from '@/constants/queryWhitelist.js'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { computed, reactive, ref, watch } from 'vue'
|
import { computed, reactive, ref, watch } from 'vue'
|
||||||
|
|
||||||
@@ -164,6 +173,18 @@ const handleApiCodesChange = (codes) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const selectJudicialApis = () => {
|
||||||
|
const current = form.api_codes.filter((code) => code !== '*')
|
||||||
|
const before = new Set(current)
|
||||||
|
form.api_codes = [...new Set([...current, ...JUDICIAL_API_CODES])]
|
||||||
|
const added = form.api_codes.length - before.size
|
||||||
|
if (added > 0) {
|
||||||
|
ElMessage.success(`已添加 ${added} 个司法接口,可继续手动追加`)
|
||||||
|
} else {
|
||||||
|
ElMessage.info('司法接口已全部选中')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const searchUsers = async (query) => {
|
const searchUsers = async (query) => {
|
||||||
if (!query) return
|
if (!query) return
|
||||||
userLoading.value = true
|
userLoading.value = true
|
||||||
@@ -256,4 +277,20 @@ const handleClosed = () => {
|
|||||||
padding: 0 4px;
|
padding: 0 4px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.api-codes-field {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.api-codes-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.api-codes-actions-tip {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #9ca3af;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ const handleDelete = async (row) => {
|
|||||||
const handleImportLegacy = async () => {
|
const handleImportLegacy = async () => {
|
||||||
try {
|
try {
|
||||||
await ElMessageBox.confirm(
|
await ElMessageBox.confirm(
|
||||||
'将导入原 processor 中 17 条硬编码身份证为「全局规则」(user_id=*,name=*,全部接口)。已存在的会自动跳过。',
|
'将导入原 processor 中 17 条硬编码身份证为「全局规则」(user_id=*,name=*)。生效接口为原硬编码所在的司法、特殊名单等 API 编码,并非全部接口。已存在的会自动跳过。',
|
||||||
'导入历史硬编码',
|
'导入历史硬编码',
|
||||||
{ type: 'info', confirmButtonText: '开始导入' }
|
{ type: 'info', confirmButtonText: '开始导入' }
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user