This commit is contained in:
zcx
2025-06-16 10:08:59 +08:00
parent 99ed1be271
commit 0632fa2362
10 changed files with 132 additions and 58 deletions

View File

@@ -0,0 +1,24 @@
<template>
<IFrame :src="src" />
</template>
<script lang="ts" setup>
import * as ConfigApi from '@/api/infra/config'
defineOptions({ name: 'InfraSwagger' })
const loading = ref(true) // 是否加载中
const src = ref(import.meta.env.VITE_BASE_URL + '/doc.html') // Knife4j UI
// const src = ref(import.meta.env.VITE_BASE_URL + '/swagger-ui') // Swagger UI
/** 初始化 */
onMounted(async () => {
try {
const data = await ConfigApi.getConfigKey('url.swagger')
if (data && data.length > 0) {
src.value = data
}
} finally {
loading.value = false
}
})
</script>

View File

@@ -264,7 +264,7 @@ const open = (info = undefined, opts) => {
if (info) {
dialogForm.value = { ...info, chapter: parseInt(info.chapter) }
if (dialogForm.value.imageUrl) {
imgUrl.value = 'https://ss-cloud.ahduima.com/xjxc/pic/' + dialogForm.value.imageUrl
imgUrl.value = dialogForm.value.imageUrl.includes('http') ? dialogForm.value.imageUrl : 'https://ss-cloud.ahduima.com/xjxc/pic/' + dialogForm.value.imageUrl
}
}
info.source = info.source

View File

@@ -82,8 +82,8 @@
<template #default="{ row }">
<el-image
v-if="row.imageUrl"
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`"
:preview-src-list="[`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`]"
:src="getShowImg(row)"
:preview-src-list="[getShowImg(row)]"
:lazy="true"
style="width: 80px"
preview-teleported
@@ -176,6 +176,10 @@ const getQuestionChapter = () => {
})
}
function getShowImg(row) {
return row.imageUrl.includes('http') ? row.imageUrl : `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
}
function getList() {
loading.value = true
searchQuestion(queryParams.value).then((response) => {
@@ -205,10 +209,19 @@ function handleAdd() {
)
}
function handleDelete(id) {
deleteQuestion(id).then(() => {
getList()
})
function handleDelete(row) {
message
.confirm('是否确认删除该题?')
.then(function () {
deleteQuestion(row.id, row.source).then(() => {
getList()
})
})
.then(() => {
getQuestionList()
message.success('删除题目成功')
})
.catch(() => {})
}
function handleChangeSource() {

View File

@@ -101,6 +101,7 @@
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`"
:preview-src-list="[`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`]"
:lazy="true"
preview-teleported
style="width: 80px"
/>
</template>
@@ -142,9 +143,10 @@
<template #default="{ row }">
<el-image
v-if="row.imageUrl"
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`"
:preview-src-list="[`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`]"
:src="getShowImg(row)"
:preview-src-list="[getShowImg(row)]"
:lazy="true"
preview-teleported
style="width: 80px"
/>
</template>
@@ -189,7 +191,8 @@ watch(
const queryParams = ref({
carTypeId: '1001',
subject: '1'
subject: '1',
source: props.source
})
const mjIndex = ref(0)
const mjList = ref([])
@@ -203,6 +206,10 @@ onMounted(() => {
searchMj()
})
function getShowImg(row) {
return row.imageUrl.includes('http') ? row.imageUrl : `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
}
function addMjItem() {
addMj(queryParams.value).then((res) => {
if (res) {
@@ -231,7 +238,7 @@ function removeMj(item) {
message
.confirm('是否确认删除密卷?')
.then(function () {
return delMj(item.secretId)
return delMj(item.secretId, queryParams.value.source)
})
.then(() => {
searchMj()
@@ -243,7 +250,7 @@ function clearMjDetail(item) {
message
.confirm('是否确认清空密卷题目?')
.then(function () {
return clearMj(item.secretId)
return clearMj(item.secretId, queryParams.value.source)
})
.then(() => {
getQuestionList()
@@ -277,7 +284,7 @@ function takeoutMj(row) {
message
.confirm('是否确认将该题移出密卷?')
.then(function () {
return delMjQuestion(row.id)
return delMjQuestion(row.id, queryParams.value.source)
})
.then(() => {
getQuestionList()
@@ -287,7 +294,8 @@ function takeoutMj(row) {
}
function getQuestionList() {
getMjQuestionList({
secretId: mjList.value[mjIndex.value].secretId
secretId: mjList.value[mjIndex.value].secretId,
source: queryParams.value.source
}).then((resp) => {
tableList.value = resp
})
@@ -295,7 +303,8 @@ function getQuestionList() {
function sureAddQues(row) {
addMjQuestion({
secretId: mjList.value[mjIndex.value].secretId,
subId: row.subId
subId: row.subId,
source: queryParams.value.source
})
.then((resp) => {
if (resp) {

View File

@@ -56,9 +56,10 @@
<template #default="{ row }">
<el-image
v-if="row.imageUrl"
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`"
:preview-src-list="[`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`]"
:src="getShowImg(row)"
:preview-src-list="[getShowImg(row)]"
:lazy="true"
preview-teleported
style="width: 80px"
/>
</template>
@@ -109,6 +110,7 @@
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`"
:preview-src-list="[`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`]"
:lazy="true"
preview-teleported
style="width: 80px"
/>
</template>
@@ -146,6 +148,7 @@ const message = useMessage() // 消息弹窗
const queryParams = ref({
carTypeId: '1001',
subject: '1',
source: props.source,
pageNo: 1,
pageSize: 100
})
@@ -161,6 +164,11 @@ const quesLit = ref([])
onMounted(() => {
getQuestionList()
})
function getShowImg(row) {
return row.imageUrl.includes('http') ? row.imageUrl : `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
}
function addMjDetail() {
showDialog.value = true
}
@@ -178,7 +186,7 @@ function takeoutMj(row) {
message
.confirm('是否确认将该题移出精选?')
.then(function () {
return delJxData(row.id)
return delJxData(row.id, queryParams.value.source)
})
.then(() => {
getQuestionList()
@@ -196,7 +204,8 @@ function sureAddQues(row) {
addJx({
questionId: row.questionId,
carTypeId: queryParams.value.carTypeId,
subject: queryParams.value.subject
subject: queryParams.value.subject,
source: queryParams.value.source
})
.then((resp) => {
if (resp) {