This commit is contained in:
qsh
2025-06-17 11:12:34 +08:00
parent e40cf44f84
commit 119aab5e3f
4 changed files with 27 additions and 18 deletions

View File

@@ -58,7 +58,7 @@
v-loading="loading"
:data="tableList"
highlight-current-row
max-height="calc(100vh - 260px)"
max-height="calc(100vh - 320px)"
>
<el-table-column type="index" width="55" align="center" />
<el-table-column label="题目" align="left" prop="question" min-width="140" />
@@ -85,17 +85,17 @@
:src="getShowImg(row)"
:preview-src-list="[getShowImg(row)]"
:lazy="true"
style="width: 80px"
style="width: 90px"
preview-teleported
/>
</template>
</el-table-column>
<el-table-column label="状态" width="100">
<!-- <el-table-column label="状态" width="100">
<template #default="{ row }">
<el-tag v-if="row.isActive == 0" type="success">使用中</el-tag>
<el-tag v-else type="danger">已删除</el-tag>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="操作" align="center" width="140">
<template #default="scope">
@@ -110,7 +110,7 @@
<el-button
type="primary"
link
@click="handleDelete(scope.row.id)"
@click="handleDelete(scope.row)"
v-hasPermi="['question:database:remove']"
>
删除
@@ -120,6 +120,7 @@
</el-table>
<pagination
style="margin-bottom: 0"
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
@@ -137,6 +138,8 @@
import { searchQuestion, deleteQuestion, getQuestionSort } from '@/api/xjapplet/xjdatabase'
import QuestionAddForm from './components/QuestionAddForm.vue'
const message = useMessage()
const loading = ref(false)
const total = ref(0)
const tableList = ref([])
@@ -177,7 +180,9 @@ const getQuestionChapter = () => {
}
function getShowImg(row) {
return row.imageUrl.includes('http') ? row.imageUrl : `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
return row.imageUrl.includes('http')
? row.imageUrl
: `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
}
function getList() {
@@ -213,15 +218,14 @@ function handleDelete(row) {
message
.confirm('是否确认删除该题?')
.then(function () {
deleteQuestion(row.id, row.source).then(() => {
deleteQuestion(row.questionId, row.source).then(() => {
getList()
})
})
.then(() => {
getQuestionList()
message.success('删除题目成功')
})
.catch(() => {})
})
.catch((err) => {
console.log(err)
})
}
function handleChangeSource() {

View File

@@ -16,7 +16,7 @@
</el-form-item>
</el-row>
</el-form>
<div style="display: flex; padding: 10px; border: 1px solid #eee; height: calc(100vh - 80px)">
<div style="display: flex; padding: 10px; border: 1px solid #eee; height: calc(100vh - 220px)">
<div style="width: 300px; border-right: 1px solid #eee">
<div style="display: flex; justify-content: space-between; padding-right: 20px">
<div style="font-size: 18px; font-weight: bold">密卷</div>
@@ -207,7 +207,9 @@ onMounted(() => {
})
function getShowImg(row) {
return row.imageUrl.includes('http') ? row.imageUrl : `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
return row.imageUrl.includes('http')
? row.imageUrl
: `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
}
function addMjItem() {
@@ -288,7 +290,7 @@ function takeoutMj(row) {
})
.then(() => {
getQuestionList()
message.success('清空题目成功')
message.success('移除题目成功')
})
.catch(() => {})
}
@@ -303,7 +305,7 @@ function getQuestionList() {
function sureAddQues(row) {
addMjQuestion({
secretId: mjList.value[mjIndex.value].secretId,
subId: row.subId,
questionId: row.questionId,
source: queryParams.value.source
})
.then((resp) => {

View File

@@ -34,7 +34,7 @@
</el-form-item>
</el-row>
</el-form>
<el-table v-loading="loading" :data="tableList" height="calc(100vh - 250px)">
<el-table v-loading="loading" :data="tableList" height="calc(100vh - 270px)">
<el-table-column type="index" width="55" align="center" />
<el-table-column label="题目" align="left" prop="question" min-width="140" />
<el-table-column label="选项" align="left" min-width="140">
@@ -79,6 +79,7 @@
</el-table-column>
</el-table>
<pagination
style="margin-bottom: 0"
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
@@ -166,7 +167,9 @@ onMounted(() => {
})
function getShowImg(row) {
return row.imageUrl.includes('http') ? row.imageUrl : `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
return row.imageUrl.includes('http')
? row.imageUrl
: `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
}
function addMjDetail() {

View File

@@ -1,7 +1,7 @@
<template>
<el-tabs v-model="source" @tab-click="handleChangeSource">
<el-tab-pane v-for="item in sourceOptions" :key="item.key" :label="item.label" :name="item.key">
<el-tabs v-model="tabIndex" tab-position="left" style="height: 400px" class="profile-tabs">
<el-tabs v-model="tabIndex" tab-position="left" class="profile-tabs">
<el-tab-pane label="精选题" :name="1" v-if="checkPermi(['question:vip-data:jx'])">
<SimpleData v-if="tabIndex == 1" :source="source" />
</el-tab-pane>