|
|
|
@ -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() |
|
|
|
|
message.success('删除题目成功') |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
getQuestionList() |
|
|
|
|
message.success('删除题目成功') |
|
|
|
|
.catch((err) => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleChangeSource() { |
|
|
|
|