From 0632fa236239449e8a10e8b72b76d3839328e5ab Mon Sep 17 00:00:00 2001 From: zcx <377075991@qq.com> Date: Mon, 16 Jun 2025 10:08:59 +0800 Subject: [PATCH] sc --- .vscode/settings.json | 5 ++ src/api/xjapplet/vipdatabase.js | 16 ++--- src/api/xjapplet/xjdatabase.js | 4 +- src/router/modules/remaining.ts | 58 +++++++++---------- src/styles/index.scss | 14 +++++ src/views/Basic/Swagger/index.vue | 24 ++++++++ .../Database/Components/QuestionAddForm.vue | 2 +- src/views/Question/Database/index.vue | 25 ++++++-- .../VipData/conponents/SecretData.vue | 25 +++++--- .../VipData/conponents/SimpleData.vue | 17 ++++-- 10 files changed, 132 insertions(+), 58 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 src/views/Basic/Swagger/index.vue diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4e71344 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "i18n-ally.localesPaths": [ + "src/locales" + ] +} \ No newline at end of file diff --git a/src/api/xjapplet/vipdatabase.js b/src/api/xjapplet/vipdatabase.js index 2eca4d0..6f3884f 100644 --- a/src/api/xjapplet/vipdatabase.js +++ b/src/api/xjapplet/vipdatabase.js @@ -14,9 +14,9 @@ export const getJxQuestionList = async (params) => { }) } -export const delJxData = async (id) => { +export const delJxData = async (id, source) => { return await request.delete({ - url: `/admin-api/applet/xunjia/question/jx/delete?id=${id}` + url: `/admin-api/applet/xunjia/question/jx/delete?id=${id}&source=${source}` }) } @@ -34,15 +34,15 @@ export const getMjList = async (params) => { }) } -export const delMj = async (secretId) => { +export const delMj = async (secretId, source) => { return await request.delete({ - url: `/admin-api/applet/xunjia/secret/delete?secretId=${secretId}` + url: `/admin-api/applet/xunjia/secret/delete?secretId=${secretId}&source=${source}` }) } -export const clearMj = async (secretId) => { +export const clearMj = async (secretId, source) => { return await request.delete({ - url: `/admin-api/applet/xunjia/secret/clear?secretId=${secretId}` + url: `/admin-api/applet/xunjia/secret/clear?secretId=${secretId}&source=${source}` }) } @@ -60,8 +60,8 @@ export const addMjQuestion = async (data) => { }) } -export const delMjQuestion = async (id) => { +export const delMjQuestion = async (id, source) => { return await request.delete({ - url: `/admin-api/applet/xunjia/secret/question/delete?id=${id}` + url: `/admin-api/applet/xunjia/secret/question/delete?id=${id}&source=${source}` }) } diff --git a/src/api/xjapplet/xjdatabase.js b/src/api/xjapplet/xjdatabase.js index 3cebccf..599b392 100644 --- a/src/api/xjapplet/xjdatabase.js +++ b/src/api/xjapplet/xjdatabase.js @@ -20,9 +20,9 @@ export const addQuestion = async (data) => { }) } -export const deleteQuestion = async (id) => { +export const deleteQuestion = async (id, source) => { return await request.delete({ - url: '/admin-api/applet/xunjia/question/delete?id=' + id + url: `/admin-api/applet/xunjia/question/delete?id=${id}&source=${source}` }) } diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 7c246dd..ae216bd 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -33,23 +33,23 @@ const { t } = useI18n() } **/ const remainingRouter: AppRouteRecordRaw[] = [ - { - path: '/redirect', - component: Layout, - name: 'Redirect', - children: [ - { - path: '/redirect/:path(.*)', - name: 'Redirect', - component: () => import('@/views/Redirect/Redirect.vue'), - meta: {} - } - ], - meta: { - hidden: true, - noTagsView: true - } - }, + // { + // path: '/redirect', + // component: Layout, + // name: 'Redirect', + // children: [ + // { + // path: '/redirect/:path(.*)', + // name: 'Redirect', + // component: () => import('@/views/Redirect/Redirect.vue'), + // meta: {} + // } + // ], + // meta: { + // hidden: true, + // noTagsView: true + // } + // }, { path: '/', component: Layout, @@ -72,18 +72,18 @@ const remainingRouter: AppRouteRecordRaw[] = [ } ] }, - // { - // path: '/swagger', - // component: () => import('@/views/Basic/Swagger/index.vue'), - // name: 'swagger', - // meta: { - // title: '接口文档', - // noCache: true, - // hidden: true, - // canTo: true, - // icon: '' - // } - // }, + { + path: '/swagger', + component: () => import('@/views/Basic/Swagger/index.vue'), + name: 'swagger', + meta: { + title: '接口文档', + noCache: true, + hidden: true, + canTo: true, + icon: '' + } + }, { path: '/user', component: Layout, diff --git a/src/styles/index.scss b/src/styles/index.scss index f4e9f17..1378add 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -97,4 +97,18 @@ /* 去除 Firefox 中的指示器 */ .el-input__inner[type='number'] { -moz-appearance: textfield; +} + +.flex-radio{ + display: flex; + width: 100%; + align-items: center; + line-height: 40px; + height: 40px; + .el-radio__label { + display: flex; + width: 100%; + align-items: center; + font-size: 16px; + } } \ No newline at end of file diff --git a/src/views/Basic/Swagger/index.vue b/src/views/Basic/Swagger/index.vue new file mode 100644 index 0000000..8404015 --- /dev/null +++ b/src/views/Basic/Swagger/index.vue @@ -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> diff --git a/src/views/Question/Database/Components/QuestionAddForm.vue b/src/views/Question/Database/Components/QuestionAddForm.vue index 5e03dc0..bd6fea8 100644 --- a/src/views/Question/Database/Components/QuestionAddForm.vue +++ b/src/views/Question/Database/Components/QuestionAddForm.vue @@ -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 diff --git a/src/views/Question/Database/index.vue b/src/views/Question/Database/index.vue index 836e15f..e82e0a7 100644 --- a/src/views/Question/Database/index.vue +++ b/src/views/Question/Database/index.vue @@ -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() { diff --git a/src/views/Question/VipData/conponents/SecretData.vue b/src/views/Question/VipData/conponents/SecretData.vue index 1eefd92..86ba048 100644 --- a/src/views/Question/VipData/conponents/SecretData.vue +++ b/src/views/Question/VipData/conponents/SecretData.vue @@ -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) { diff --git a/src/views/Question/VipData/conponents/SimpleData.vue b/src/views/Question/VipData/conponents/SimpleData.vue index 38ddb3d..1a5a80b 100644 --- a/src/views/Question/VipData/conponents/SimpleData.vue +++ b/src/views/Question/VipData/conponents/SimpleData.vue @@ -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) { -- 2.38.1.windows.1