Compare commits

...

3 Commits

  1. 26
      src/views/Question/Database/index.vue
  2. 34
      src/views/Question/Setting/Components/SelectSource.vue
  3. 15
      src/views/Question/Setting/index.vue
  4. 10
      src/views/Question/VipData/conponents/SecretData.vue
  5. 7
      src/views/Question/VipData/conponents/SimpleData.vue
  6. 2
      src/views/Question/VipData/index.vue

@ -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() {

@ -0,0 +1,34 @@
<template>
<div>
<el-row :gutter="20">
<el-col
:xs="24"
:sm="12"
:md="6"
:lg="6"
:xl="6"
v-for="(item, index) in appSource"
:key="index"
style="display: flex; align-items: center; border: 1px solid #eee; padding: 10px"
>
<span style="width: 120px">{{ item.name }}</span>
<el-select v-model="item.value" placeholder="请选择" class="flex-1">
<el-option label="驾考精灵" value="1" />
<el-option label="驾考宝典" value="2" />
<el-option label="驾校一点通" value="3" />
</el-select>
</el-col>
</el-row>
</div>
</template>
<script setup name="SelectSource">
const appSource = ref([
{ name: '寻驾', value: '1' },
{ name: '金武联', value: '3' },
{ name: '通关考', value: '1' },
{ name: '好驾到', value: '2' }
])
</script>
<style lang="scss" scoped></style>

@ -1,7 +1,18 @@
<template>
<div> 基础设置 </div>
<div>
<el-tabs v-model="settingName">
<el-tab-pane label="选择题库" :name="1" v-if="checkPermi(['Question:Setting:DataSource'])">
<SelectSource />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script setup name="QuestionSetting"></script>
<script setup name="QuestionSetting">
import { checkPermi } from '@/utils/permission'
import SelectSource from './Components/SelectSource.vue'
const settingName = ref(1)
</script>
<style lang="scss" scoped></style>

@ -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) => {

@ -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() {

@ -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>

Loading…
Cancel
Save