sc
This commit is contained in:
@@ -4,8 +4,8 @@ VITE_NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
# VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
|
||||
# 小程序接口请求路劲
|
||||
VITE_APPLET_URL='https://cloud.ahduima.com'
|
||||
|
||||
42
src/api/xjapplet/discount.js
Normal file
42
src/api/xjapplet/discount.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getVipDiscountList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/member/discount/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const addVipDiscount = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/member/discount/add',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const updateVipDiscount = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/member/discount/update',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteVipDiscount = async (id) => {
|
||||
return await request.delete({
|
||||
url: '/admin-api/applet/xunjia/member/discount/delete?discountId=' + id
|
||||
})
|
||||
}
|
||||
|
||||
export const getUserDiscountList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/user/discount/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const giveUserDiscount = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/user/discount/add',
|
||||
data
|
||||
})
|
||||
}
|
||||
32
src/api/xjapplet/resell.js
Normal file
32
src/api/xjapplet/resell.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getResellList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/distribution/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const addResell = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/distribution/add',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const updateResell = async (data) => {
|
||||
return await request.put({
|
||||
url: '/admin-api/applet/xunjia/distribution/update',
|
||||
data
|
||||
})
|
||||
}
|
||||
export const deleteResell = async (id) => {
|
||||
return await request.delete({
|
||||
url: '/admin-api/applet/xunjia/distribution/delete?distributionId=' + id
|
||||
})
|
||||
}
|
||||
export const getResellDetail = async (id) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/distribution/' + id
|
||||
})
|
||||
}
|
||||
@@ -2,7 +2,48 @@ import request from '@/config/axios'
|
||||
|
||||
export const getUserMemberList = async (params) => {
|
||||
return await request.get({
|
||||
url: 'http://xj.ahduima.com/xunjia/driver-api/tdSysUserMember/duima/user/member/list',
|
||||
url: '/admin-api/applet/xunjia/user/member/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const giveUserMember = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/user/member/add',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const getVipTypeList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/member/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const addVipType = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/member/add',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const updateVipType = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/member/update',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteVipType = async (id) => {
|
||||
return await request.delete({
|
||||
url: '/admin-api/applet/xunjia/member/memberId?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
export const getVipTypeOptions = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/member/simple-list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
67
src/api/xjapplet/vipdatabase.js
Normal file
67
src/api/xjapplet/vipdatabase.js
Normal file
@@ -0,0 +1,67 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const addJx = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/question/jx/add',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const getJxQuestionList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/question/jx/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const delJxData = async (id) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/question/jx/delete?id=${id}`
|
||||
})
|
||||
}
|
||||
|
||||
export const addMj = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/secret/add',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const getMjList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/secret/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const delMj = async (secretId) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/secret/delete?secretId=${secretId}`
|
||||
})
|
||||
}
|
||||
|
||||
export const clearMj = async (secretId) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/secret/clear?secretId=${secretId}`
|
||||
})
|
||||
}
|
||||
|
||||
export const getMjQuestionList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/secret/question/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const addMjQuestion = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/secret/question/add',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const delMjQuestion = async (id) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/secret/question/delete?id=${id}`
|
||||
})
|
||||
}
|
||||
@@ -1,41 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
export const searchQuestion = async (param) => {
|
||||
return await request.get({
|
||||
url: 'http://localhost/tiku-api/tiku/xunjia/question/list',
|
||||
url: '/admin-api/applet/xunjia/question/list',
|
||||
params: param
|
||||
})
|
||||
}
|
||||
|
||||
export const updateQuestion = async (data) => {
|
||||
return await request.put({
|
||||
url: 'http://localhost/tiku-api/tiku/xunjia/question/update',
|
||||
url: '/admin-api/applet/xunjia/question/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const addQuestion = async (data) => {
|
||||
return await request.post({
|
||||
url: 'http://localhost/tiku-api/tiku/xunjia/question/add',
|
||||
url: '/admin-api/applet/xunjia/question/add',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteQuestion = async (id) => {
|
||||
return await request.delete({
|
||||
url: 'http://localhost/tiku-api/tiku/xunjia/question/delete?id=' + id
|
||||
url: '/admin-api/applet/xunjia/question/delete?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
export const uploadFile = async (data) => {
|
||||
return await request.post({
|
||||
url: 'http://localhost/tiku-api/tiku/xunjia/question/upload',
|
||||
url: '/admin-api/applet/xunjia/question/upload',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const getQuestionSort = async (param) => {
|
||||
return await request.get({
|
||||
url: 'http://localhost/tiku-api/tiku/xunjia/question/sort/list',
|
||||
url: '/admin-api/applet/xunjia/question/sort/list',
|
||||
params: param
|
||||
})
|
||||
}
|
||||
@@ -46,42 +46,3 @@ export const getMjList = async (params) => {
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const addMj = async (data) => {
|
||||
return await request.post({
|
||||
url: 'http://localhost/tiku-api/tiku/xunjia/secret/add',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const delMj = async (secretId) => {
|
||||
return await request.delete({
|
||||
url: `http://localhost/tiku-api/tiku/xunjia/secret/delete?secretId=${secretId}`
|
||||
})
|
||||
}
|
||||
|
||||
export const clearMj = async (secretId) => {
|
||||
return await request.delete({
|
||||
url: `http://localhost/tiku-api/tiku/xunjia/secret/clear?secretId=${secretId}`
|
||||
})
|
||||
}
|
||||
|
||||
export const getMjQuestionList = async (params) => {
|
||||
return await request.get({
|
||||
url: 'http://localhost/tiku-api/tiku/xunjia/secret/question/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const addMjQuestion = async (data) => {
|
||||
return await request.post({
|
||||
url: 'http://localhost/tiku-api/tiku/xunjia/secret/question/add',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const delMjQuestion = async (id) => {
|
||||
return await request.delete({
|
||||
url: `http://localhost/tiku-api/tiku/xunjia/secret/question/delete?id=${id}`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
v-model:page-size="pageSize"
|
||||
:small="small"
|
||||
:background="true"
|
||||
:page-sizes="[10, 20, 30, 50, 100]"
|
||||
:page-sizes="[10, 50, 100, 500, 1000]"
|
||||
:pager-count="pagerCount"
|
||||
:total="total"
|
||||
class="float-right mt-15px mb-15px"
|
||||
|
||||
@@ -140,8 +140,7 @@ service.interceptors.response.use(
|
||||
// 二进制数据则直接返回
|
||||
if (
|
||||
response.request.responseType === 'blob' ||
|
||||
response.request.responseType === 'arraybuffer' ||
|
||||
!data.code
|
||||
response.request.responseType === 'arraybuffer'
|
||||
) {
|
||||
return response.data
|
||||
}
|
||||
|
||||
@@ -12,14 +12,17 @@
|
||||
<el-button type="primary" @click="handleAdd">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="tableData">
|
||||
<el-table v-loading="loading" :data="tableData" max-height="calc(100vh - 200px)">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="phone" label="手机号" />
|
||||
<el-table-column prop="name" label="姓名" />
|
||||
<el-table-column prop="mark" label="标记" />
|
||||
<el-table-column label="小程序码" align="center" width="140px">
|
||||
<el-table-column label="小程序码" align="center" width="120px">
|
||||
<template #default="{ row }">
|
||||
<img :src="row.qrCode" style="width: 100px; height: 100px" />
|
||||
<img
|
||||
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.appletUrl}`"
|
||||
style="width: 80px; height: 80px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120px">
|
||||
@@ -60,11 +63,13 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Resell">
|
||||
import { getResellList, addResell, updateResell } from '@/api/xjapplet/resell'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const searchForm = ref({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 50,
|
||||
phone: '',
|
||||
name: ''
|
||||
})
|
||||
@@ -72,6 +77,7 @@ const searchForm = ref({
|
||||
const tableData = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
const loading = ref(false)
|
||||
const showDialog = ref(false)
|
||||
|
||||
const form = ref({
|
||||
@@ -85,13 +91,22 @@ const rules = {
|
||||
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
searchList()
|
||||
})
|
||||
|
||||
function searchList() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
function getList() {
|
||||
console.log(searchForm.value)
|
||||
loading.value = true
|
||||
getResellList(searchForm.value).then((response) => {
|
||||
tableData.value = response.list
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
@@ -109,9 +124,19 @@ async function handleSave() {
|
||||
if (!valid) return
|
||||
|
||||
// 调用接口
|
||||
if (form.value.id) {
|
||||
updateResell(form.value).then(() => {
|
||||
message.success('修改成功')
|
||||
showDialog.value = false
|
||||
message.success('成功')
|
||||
searchList()
|
||||
})
|
||||
} else {
|
||||
addResell(form.value).then(() => {
|
||||
message.success('新增成功')
|
||||
showDialog.value = false
|
||||
searchList()
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="UserDiscount">
|
||||
import { getUserMemberList } from '@/api/xjapplet/vip'
|
||||
import { getUserDiscountList, giveUserDiscount } from '@/api/xjapplet/discount'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
@@ -81,12 +81,10 @@ function searchList() {
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
getUserMemberList(searchForm.value).then((response) => {
|
||||
if (response.code === 200) {
|
||||
tableList.value = response.data
|
||||
getUserDiscountList(searchForm.value).then((response) => {
|
||||
tableList.value = response.list
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -111,9 +109,15 @@ async function sureAdd() {
|
||||
if (!valid) return
|
||||
|
||||
// 调用接口
|
||||
showDialog.value = false
|
||||
giveUserDiscount(form.value).then((response) => {
|
||||
if (response) {
|
||||
message.success('赠送成功')
|
||||
showDialog.value = false
|
||||
searchList()
|
||||
} else {
|
||||
message.error('赠送失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -7,20 +7,19 @@
|
||||
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column label="折扣描述" align="center" prop="desc" min-width="140" />
|
||||
<el-table-column label="折扣描述" align="center" prop="description" min-width="140" />
|
||||
<el-table-column label="折扣价" align="center" prop="discount" />
|
||||
<el-table-column label="有效期" align="center" prop="duration" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="状态" align="center">
|
||||
<el-table-column label="单位" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-model="row.isActive"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="启用"
|
||||
inactive-text="禁用"
|
||||
disabled
|
||||
/>
|
||||
<el-tag v-if="row.unit == 1">天</el-tag>
|
||||
<el-tag v-else type="danger">年</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="editDiscount(row)">修改</el-button>
|
||||
<el-button type="primary" link @click="deleteDiscount(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -34,8 +33,8 @@
|
||||
|
||||
<el-dialog title="折扣详情" v-model="showDialog" width="500px">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-form-item label="折扣类型" prop="type">
|
||||
<el-select v-model="form.type" style="width: 100%">
|
||||
<el-form-item label="折扣类型" prop="discountType">
|
||||
<el-select v-model="form.discountType" style="width: 100%" :disabled="form.id">
|
||||
<el-option
|
||||
v-for="item in discountTypeOptions"
|
||||
:key="item.value"
|
||||
@@ -47,7 +46,7 @@
|
||||
<el-form-item label="折扣描述">
|
||||
{{ discountDesc }}
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type == 1" label="科目" prop="subject">
|
||||
<el-form-item v-if="form.discountType == 1" label="科目" prop="subject" :disabled="form.id">
|
||||
<el-select v-model="form.subject" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in subjectOptions"
|
||||
@@ -58,22 +57,22 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="变量1" prop="param1">
|
||||
<el-select v-model="form.param1" style="width: 100%" clearable>
|
||||
<el-select v-model="form.param1" style="width: 100%" clearable :disabled="form.id">
|
||||
<el-option
|
||||
v-for="item in vipTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.memberId"
|
||||
:label="item.memberName"
|
||||
:value="item.memberId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="变量2" prop="param2">
|
||||
<el-select v-model="form.param2" style="width: 100%">
|
||||
<el-select v-model="form.param2" style="width: 100%" :disabled="form.id">
|
||||
<el-option
|
||||
v-for="item in vipTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.memberId"
|
||||
:label="item.memberName"
|
||||
:value="item.memberId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -90,15 +89,6 @@
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="isActive">
|
||||
<el-switch
|
||||
v-model="form.isActive"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="启用"
|
||||
inactive-text="禁用"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
@@ -112,16 +102,30 @@
|
||||
</template>
|
||||
|
||||
<script setup name="VipDiscount">
|
||||
import { getUserMemberList } from '@/api/xjapplet/vip'
|
||||
import {
|
||||
getVipDiscountList,
|
||||
addVipDiscount,
|
||||
updateVipDiscount,
|
||||
deleteVipDiscount
|
||||
} from '@/api/xjapplet/discount'
|
||||
|
||||
import { getVipTypeOptions } from '@/api/xjapplet/vip'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const searchForm = ref({
|
||||
phone: '',
|
||||
pageNo: 1,
|
||||
pageSize: 50
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
searchList()
|
||||
|
||||
getVipTypeOptions().then((response) => {
|
||||
vipTypeOptions.value = response
|
||||
})
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
@@ -129,9 +133,9 @@ const total = ref(0)
|
||||
const discountTypeOptions = [
|
||||
{
|
||||
label: '【$科目】模考首次通过后,在拥有【$会员名1】的情况下,购买【$会员名2】,享折扣价',
|
||||
value: 1
|
||||
value: '1'
|
||||
},
|
||||
{ label: '之前拥有过【$会员名1】,购买【$会员名2】,享折扣价', value: 2 }
|
||||
{ label: '之前拥有过【$会员名1】,购买【$会员名2】,享折扣价', value: '2' }
|
||||
]
|
||||
|
||||
const subjectOptions = [
|
||||
@@ -140,32 +144,35 @@ const subjectOptions = [
|
||||
]
|
||||
|
||||
const unitOptions = [
|
||||
{ label: '天', value: 1 },
|
||||
{ label: '年', value: 3 }
|
||||
{ label: '天', value: '1' },
|
||||
{ label: '年', value: '3' }
|
||||
]
|
||||
|
||||
const discountDesc = computed(() => {
|
||||
const { type, subject, param1, param2, discount, duration, unit } = form.value
|
||||
let baseStr = discountTypeOptions.find((item) => item.value === type).label
|
||||
const vipTypeObj = {}
|
||||
vipTypeOptions.value.forEach((item) => {
|
||||
vipTypeObj[item.memberId] = item.memberName
|
||||
})
|
||||
const { discountType, subject, param1, param2, discount, duration, unit } = form.value
|
||||
let baseStr = discountTypeOptions.find((item) => item.value == discountType).label
|
||||
const vip1 = param1 ? vipTypeObj[param1] : '无需会员'
|
||||
const vip2 = param2 ? vipTypeObj[param2] : '会员名2'
|
||||
return baseStr
|
||||
.replace('$科目', subjectOptions.find((item) => item.value === subject).label)
|
||||
.replace(
|
||||
'$会员名1',
|
||||
vipTypeOptions.value.find((item) => item.value === param1)?.label || '无需会员'
|
||||
)
|
||||
.replace('$会员名2', vipTypeOptions.value.find((item) => item.value === param2).label)
|
||||
.replace('$科目', subjectOptions.find((item) => item.value == subject).label)
|
||||
.replace('$会员名1', vip1)
|
||||
.replace('$会员名2', vip2)
|
||||
.concat(
|
||||
`${discount || ''},有效期${duration || 0}${
|
||||
unitOptions.find((item) => item.value === unit).label
|
||||
unitOptions.find((item) => item.value == unit).label
|
||||
}`
|
||||
)
|
||||
})
|
||||
|
||||
const vipTypeOptions = ref([
|
||||
{ label: '普通会员', value: '1' },
|
||||
{ label: 'VIP会员', value: '2' }
|
||||
])
|
||||
onMounted(() => {
|
||||
searchList()
|
||||
})
|
||||
|
||||
const vipTypeOptions = ref([])
|
||||
function searchList() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
@@ -173,25 +180,23 @@ function searchList() {
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
getUserMemberList(searchForm.value).then((response) => {
|
||||
if (response.code === 200) {
|
||||
tableList.value = response.data
|
||||
getVipDiscountList(searchForm.value).then((response) => {
|
||||
tableList.value = response.list
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const showDialog = ref(false)
|
||||
const form = ref({
|
||||
type: 1,
|
||||
discountType: '1',
|
||||
subject: '1',
|
||||
param1: '1',
|
||||
param2: '2',
|
||||
param1: undefined,
|
||||
param2: undefined,
|
||||
discount: undefined,
|
||||
duration: undefined,
|
||||
unit: 1,
|
||||
isActive: 0
|
||||
unit: '1',
|
||||
description: undefined
|
||||
})
|
||||
const rules = ref({
|
||||
param2: [{ required: true, message: '请选择变量2', trigger: 'change' }],
|
||||
@@ -203,16 +208,46 @@ function addDiscount() {
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
function editDiscount(row) {
|
||||
form.value = {
|
||||
...row,
|
||||
param1: row.param1 ? Number(row.param1) : undefined,
|
||||
param2: row.param2 ? Number(row.param2) : undefined
|
||||
}
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
function deleteDiscount(row) {
|
||||
message.confirm('确定删除该折扣?').then(() => {
|
||||
deleteVipDiscount(row.id).then(() => {
|
||||
message.success('删除成功')
|
||||
searchList()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const formRef = ref(null)
|
||||
async function sureAdd() {
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
form.value.description = discountDesc.value
|
||||
|
||||
// 调用接口
|
||||
if (form.value.id) {
|
||||
updateVipDiscount(form.value).then(() => {
|
||||
showDialog.value = false
|
||||
message.success('成功')
|
||||
message.success('修改成功')
|
||||
searchList()
|
||||
})
|
||||
} else {
|
||||
addVipDiscount(form.value).then(() => {
|
||||
showDialog.value = false
|
||||
message.success('新增成功')
|
||||
searchList()
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,30 +2,20 @@
|
||||
<div>
|
||||
<el-form :model="searchForm" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.phone" placeholder="学员手机号" />
|
||||
<el-input v-model="searchForm.memberName" placeholder="会员名称" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.cartype" placeholder="选择车型" clearable filterable>
|
||||
<el-select v-model="searchForm.carTypeId" placeholder="选择车型" clearable filterable>
|
||||
<el-option label="小车" value="1001" />
|
||||
<el-option label="摩托车" value="1002" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.vipType" placeholder="选择会员类型" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in vipTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="searchList">查询</el-button>
|
||||
<el-button type="primary" @click="addVip">新增会员类型</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table v-loading="loading" :data="tableList" height="calc(100vh - 260px)">
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column label="会员名" align="center" prop="memberName" min-width="140" />
|
||||
<el-table-column label="车型" align="center" prop="carName" />
|
||||
@@ -33,29 +23,17 @@
|
||||
<el-table-column label="原价" align="center" prop="price" />
|
||||
<el-table-column label="折扣价" align="center" prop="discount" />
|
||||
<el-table-column label="有效期" align="center" prop="duration" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="状态" align="center">
|
||||
<el-table-column label="单位" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-model="row.isActive"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="启用"
|
||||
inactive-text="禁用"
|
||||
disabled
|
||||
/>
|
||||
<el-tag v-if="row.unit == 1">天</el-tag>
|
||||
<el-tag v-else type="danger">年</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客服赠送" align="center">
|
||||
<el-table-column label="使用方式" align="center" prop="typeName" />
|
||||
<el-table-column label="操作" width="160">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-model="row.canGive"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="可赠送"
|
||||
inactive-text="不可赠送"
|
||||
disabled
|
||||
/>
|
||||
<el-button type="primary" link @click="editVip(row)">修改</el-button>
|
||||
<el-button type="primary" link @click="handleDelete(row.memberId)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -72,8 +50,8 @@
|
||||
<el-form-item label="会员名称" prop="memberName">
|
||||
<el-input v-model="form.memberName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车型" prop="cartype">
|
||||
<el-select v-model="form.cartype" style="width: 100%">
|
||||
<el-form-item label="车型" prop="carTypeId">
|
||||
<el-select v-model="form.carTypeId" style="width: 100%">
|
||||
<el-option label="小车" value="1001" />
|
||||
<el-option label="摩托车" value="1002" />
|
||||
</el-select>
|
||||
@@ -99,23 +77,11 @@
|
||||
<el-radio :label="3">年</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="isActive">
|
||||
<el-switch
|
||||
v-model="form.isActive"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="启用"
|
||||
inactive-text="禁用"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客服赠送" prop="canGive">
|
||||
<el-switch
|
||||
v-model="form.canGive"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="可赠送"
|
||||
inactive-text="不可赠送"
|
||||
/>
|
||||
<el-form-item label="使用方式" prop="type">
|
||||
<el-checkbox-group v-model="form.type">
|
||||
<el-checkbox :label="1"> 用户购买 </el-checkbox>
|
||||
<el-checkbox :label="2"> 客服赠送 </el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -130,10 +96,11 @@
|
||||
</template>
|
||||
|
||||
<script setup name="VipType">
|
||||
import { getUserMemberList } from '@/api/xjapplet/vip'
|
||||
import { getVipTypeList, addVipType, updateVipType, deleteVipType } from '@/api/xjapplet/vip'
|
||||
const message = useMessage()
|
||||
const searchForm = ref({
|
||||
phone: '',
|
||||
memberName: '',
|
||||
carTypeId: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 50
|
||||
})
|
||||
@@ -142,11 +109,9 @@ const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
const vipTypeOptions = ref([
|
||||
{ label: '普通会员', value: '1' },
|
||||
{ label: 'VIP会员', value: '2' }
|
||||
])
|
||||
|
||||
onMounted(() => {
|
||||
searchList()
|
||||
})
|
||||
function searchList() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
@@ -154,30 +119,27 @@ function searchList() {
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
getUserMemberList(searchForm.value).then((response) => {
|
||||
if (response.code === 200) {
|
||||
tableList.value = response.data
|
||||
getVipTypeList(searchForm.value).then((response) => {
|
||||
tableList.value = response.list
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const showDialog = ref(false)
|
||||
const form = ref({
|
||||
memberName: '',
|
||||
cartype: '',
|
||||
carTypeId: '',
|
||||
subjects: [],
|
||||
price: '',
|
||||
discount: '',
|
||||
duration: '',
|
||||
unit: 1,
|
||||
isActive: 0,
|
||||
canGive: 1
|
||||
type: [1]
|
||||
})
|
||||
const rules = ref({
|
||||
memberName: [{ required: true, message: '请输入会员名称', trigger: 'blur' }],
|
||||
cartype: [{ required: true, message: '请输入车型', trigger: 'change' }],
|
||||
carTypeId: [{ required: true, message: '请输入车型', trigger: 'change' }],
|
||||
subjects: [{ required: true, message: '请输入科目', trigger: 'blur' }],
|
||||
price: [{ required: true, message: '请输入价格', trigger: 'blur' }],
|
||||
discount: [{ required: true, message: '请输入折扣价', trigger: 'blur' }],
|
||||
@@ -188,6 +150,11 @@ function addVip() {
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
function editVip(row) {
|
||||
form.value = { ...row }
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
const formRef = ref(null)
|
||||
async function sureAdd() {
|
||||
if (!formRef.value) return
|
||||
@@ -195,9 +162,28 @@ async function sureAdd() {
|
||||
if (!valid) return
|
||||
|
||||
// 调用接口
|
||||
if (form.value.memberId) {
|
||||
updateVipType(form.value).then(() => {
|
||||
message.success('修改成功')
|
||||
showDialog.value = false
|
||||
message.success('赠送成功')
|
||||
searchList()
|
||||
})
|
||||
} else {
|
||||
addVipType(form.value).then(() => {
|
||||
message.success('添加成功')
|
||||
showDialog.value = false
|
||||
searchList()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function handleDelete(id) {
|
||||
message.confirm('是否确认删除该会员?').then(() => {
|
||||
deleteVipType(id).then(() => {
|
||||
message.success('删除成功')
|
||||
searchList()
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -5,36 +5,36 @@
|
||||
<el-input v-model="searchForm.phone" placeholder="学员手机号" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.cartype" placeholder="选择车型" clearable filterable>
|
||||
<el-select v-model="searchForm.carTypeId" placeholder="选择车型" clearable filterable>
|
||||
<el-option label="小车" value="1001" />
|
||||
<el-option label="摩托车" value="1002" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.vipType" placeholder="选择会员类型" clearable filterable>
|
||||
<!-- <el-form-item>
|
||||
<el-select v-model="searchForm.memberId" placeholder="选择会员类型" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in vipTypeOptions"
|
||||
v-for="item in vipOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button @click="searchList">查询</el-button>
|
||||
<el-button type="primary" @click="addVipUser">赠送会员</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table v-loading="loading" :data="tableList" height="calc(100vh - 260px)">
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column label="手机号" align="center" prop="phone" min-width="140" />
|
||||
<el-table-column label="会员名" align="center" prop="memberName" min-width="140" />
|
||||
<el-table-column label="车型" align="center" prop="carName" min-width="100" />
|
||||
<el-table-column label="车型" align="center" prop="carTypeId" min-width="100" />
|
||||
<el-table-column label="科目" align="center" prop="subjects" min-width="100" />
|
||||
<el-table-column label="开始时间" align="center" prop="startDate" min-width="100" />
|
||||
<el-table-column label="结束时间" align="center" prop="endDate" min-width="100" />
|
||||
<el-table-column label="开始时间" align="center" prop="startDate" min-width="120" />
|
||||
<el-table-column label="结束时间" align="center" prop="endDate" min-width="120" />
|
||||
<el-table-column label="操作人" align="center" prop="" min-width="100" />
|
||||
<el-table-column label="操作时间" align="center" prop="" min-width="100" />
|
||||
<el-table-column label="操作时间" align="center" prop="" min-width="120" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
@@ -49,13 +49,13 @@
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input v-model="form.phone" maxlength="11" />
|
||||
</el-form-item>
|
||||
<el-form-item label="会员类型" prop="vipType">
|
||||
<el-select v-model="form.vipType" clearable filterable style="width: 100%">
|
||||
<el-form-item label="会员类型" prop="memberId">
|
||||
<el-select v-model="form.memberId" clearable filterable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in vipTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-for="item in vipOptions"
|
||||
:key="item.memberId"
|
||||
:label="item.memberName"
|
||||
:value="item.memberId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -72,9 +72,11 @@
|
||||
</template>
|
||||
|
||||
<script setup name="VipUser">
|
||||
import { getUserMemberList } from '@/api/xjapplet/vip'
|
||||
import { getUserMemberList, giveUserMember, getVipTypeOptions } from '@/api/xjapplet/vip'
|
||||
const message = useMessage()
|
||||
const searchForm = ref({
|
||||
carTypeId: undefined,
|
||||
memberId: undefined,
|
||||
phone: '',
|
||||
pageNo: 1,
|
||||
pageSize: 50
|
||||
@@ -84,10 +86,15 @@ const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
const vipTypeOptions = ref([
|
||||
{ label: '普通会员', value: '1' },
|
||||
{ label: 'VIP会员', value: '2' }
|
||||
])
|
||||
const vipOptions = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
|
||||
getVipTypeOptions().then((response) => {
|
||||
vipOptions.value = response
|
||||
})
|
||||
})
|
||||
|
||||
function searchList() {
|
||||
searchForm.value.pageNo = 1
|
||||
@@ -97,22 +104,20 @@ function searchList() {
|
||||
function getList() {
|
||||
loading.value = true
|
||||
getUserMemberList(searchForm.value).then((response) => {
|
||||
if (response.code === 200) {
|
||||
tableList.value = response.data
|
||||
tableList.value = response.list
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const showDialog = ref(false)
|
||||
const form = ref({
|
||||
phone: '',
|
||||
vipType: ''
|
||||
memberId: ''
|
||||
})
|
||||
const rules = ref({
|
||||
phone: [{ required: true, message: '请输入用户手机号', trigger: 'blur' }],
|
||||
vipType: [{ required: true, message: '请选择会员类型', trigger: 'change' }]
|
||||
memberId: [{ required: true, message: '请选择会员类型', trigger: 'change' }]
|
||||
})
|
||||
|
||||
function addVipUser() {
|
||||
@@ -125,10 +130,15 @@ async function sureAdd() {
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
// 调用接口
|
||||
showDialog.value = false
|
||||
giveUserMember(form.value).then((response) => {
|
||||
if (response) {
|
||||
message.success('赠送成功')
|
||||
showDialog.value = false
|
||||
searchList()
|
||||
} else {
|
||||
message.error('赠送失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,29 +1,26 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-form size="small" inline label-width="68px" @submit.prevent>
|
||||
<el-form inline label-width="68px" @submit.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="车型">
|
||||
<el-radio-group v-model="queryParams.chexing" @change="searchMj">
|
||||
<el-radio label="C1">小车</el-radio>
|
||||
<el-radio label="D">摩托车</el-radio>
|
||||
<!-- <el-radio label="B2">货车</el-radio> -->
|
||||
<el-form-item label="车型" @change="searchMj">
|
||||
<el-radio-group v-model="queryParams.carTypeId">
|
||||
<el-radio label="1001">小车</el-radio>
|
||||
<el-radio label="1002">摩托车</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="科目">
|
||||
<el-radio-group v-model="queryParams.examType" @change="searchMj">
|
||||
<el-radio-group v-model="queryParams.subject" @change="searchMj">
|
||||
<el-radio label="1">科一</el-radio>
|
||||
<el-radio label="4">科四</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div style="display: flex; padding: 10px; border: 1px solid #eee; height: calc(100vh - 80px)">
|
||||
<div style="width: 350px; 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>
|
||||
<el-button type="text" @click="addMjItem">新增</el-button>
|
||||
<el-button type="primary" link @click="addMjItem">新增</el-button>
|
||||
</div>
|
||||
<el-radio-group
|
||||
v-model="mjIndex"
|
||||
@@ -33,8 +30,8 @@
|
||||
<el-radio v-for="(item, index) in mjList" :key="index" :label="index" class="flex-radio">
|
||||
<div style="flex: 1; width: 100px">{{ getMjTitle(index) }}</div>
|
||||
<div style="padding-right: 15px">
|
||||
<el-button type="text" @click="removeMj(item)">删除</el-button>
|
||||
<el-button type="text" @click="clearMjDetail(item)">清空</el-button>
|
||||
<el-button type="primary" link @click="removeMj(item)">删除</el-button>
|
||||
<el-button type="primary" link @click="clearMjDetail(item)">清空</el-button>
|
||||
</div>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -52,68 +49,75 @@
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="tableList" style="margin-top: 20px">
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column label="题目" align="left" prop="subTitle" min-width="140" />
|
||||
<el-table-column label="题目" align="left" prop="question" min-width="140" />
|
||||
<el-table-column label="选项" align="left" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<p v-if="row.optA">A:{{ row.optA }}</p>
|
||||
<p v-if="row.optB">B:{{ row.optB }}</p>
|
||||
<p v-if="row.optC">C:{{ row.optC }}</p>
|
||||
<p v-if="row.optD">D:{{ row.optD }}</p>
|
||||
<p v-if="row.chooseA">A:{{ row.chooseA }}</p>
|
||||
<p v-if="row.chooseB">B:{{ row.chooseB }}</p>
|
||||
<p v-if="row.chooseC">C:{{ row.chooseC }}</p>
|
||||
<p v-if="row.chooseD">D:{{ row.chooseD }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="答案" align="center" prop="answer" width="100" />
|
||||
<el-table-column label="章节" align="center" prop="sortName" min-width="100" />
|
||||
<el-table-column label="专项" align="center" prop="categoryTitle" width="100" />
|
||||
<el-table-column label="答案" align="center" prop="trueAnswer" width="100" />
|
||||
<el-table-column label="科目" align="center" prop="subject" width="100">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.subject == '1'">科一</span>
|
||||
<span v-if="row.subject == '4'">科四</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="章节" align="center" prop="chapterName" min-width="100" />
|
||||
<el-table-column label="图片" align="center" width="100">
|
||||
<template #default="{ row }">
|
||||
<img
|
||||
v-if="row.subPic"
|
||||
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.subPic}`"
|
||||
width="80px"
|
||||
<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}`]"
|
||||
:lazy="true"
|
||||
style="width: 80px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-button size="mini" type="text" @click="takeoutMj(row)">移出密卷</el-button>
|
||||
<el-button type="primary" link @click="takeoutMj(row)">移出密卷</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog v-model:visible="showDialog" title="新增试题" width="80%">
|
||||
<el-dialog v-model="showDialog" title="新增试题" width="80%">
|
||||
<div style="display: flex; align-items: center; margin-bottom: 20px">
|
||||
<el-input v-model="quesName" placeholder="请输入题目" clearable @keyup.enter="searchQues" />
|
||||
<el-button style="margin-left: 20px" type="primary" @click="searchQues">搜索</el-button>
|
||||
</div>
|
||||
<el-table :data="quesLit" highlight-current-row height="calc(100vh - 260px)">
|
||||
<el-table-column label="题目" align="left" prop="subTitle" min-width="140" />
|
||||
<el-table-column label="题目" align="left" prop="question" min-width="140" />
|
||||
<el-table-column label="选项" align="left" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<p v-if="row.optA">A:{{ row.optA }}</p>
|
||||
<p v-if="row.optB">B:{{ row.optB }}</p>
|
||||
<p v-if="row.optC">C:{{ row.optC }}</p>
|
||||
<p v-if="row.optD">D:{{ row.optD }}</p>
|
||||
<p v-if="row.chooseA">A:{{ row.chooseA }}</p>
|
||||
<p v-if="row.chooseB">B:{{ row.chooseB }}</p>
|
||||
<p v-if="row.chooseC">C:{{ row.chooseC }}</p>
|
||||
<p v-if="row.chooseD">D:{{ row.chooseD }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="答案" align="center" prop="answer" width="100" />
|
||||
<el-table-column label="章节" align="center" prop="sortName" width="180" />
|
||||
<el-table-column label="专项" align="center" prop="categoryTitle" width="100" />
|
||||
<el-table-column label="答案" align="center" prop="trueAnswer" width="100" />
|
||||
<el-table-column label="章节" align="center" prop="chapterName" min-width="100" />
|
||||
<el-table-column label="图片" align="center" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-image
|
||||
v-if="row.subPic"
|
||||
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.subPic}`"
|
||||
:preview-src-list="[`https://ss-cloud.ahduima.com/xjxc/pic/${row.subPic}`]"
|
||||
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}`]"
|
||||
:lazy="true"
|
||||
style="width: 80px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-button type="text" @click="sureAddQues(row)">加入密卷</el-button>
|
||||
<el-button type="primary" link @click="sureAddQues(row)">加入密卷</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -129,15 +133,14 @@ import {
|
||||
clearMj,
|
||||
getMjQuestionList,
|
||||
addMjQuestion,
|
||||
delMjQuestion,
|
||||
searchQuestion
|
||||
} from '@/api/xjapplet/xjdatabase'
|
||||
|
||||
delMjQuestion
|
||||
} from '@/api/xjapplet/vipdatabase.js'
|
||||
import { searchQuestion } from '@/api/xjapplet/xjdatabase.js'
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const queryParams = ref({
|
||||
chexing: 'C1',
|
||||
examType: '1'
|
||||
carTypeId: '1001',
|
||||
subject: '1'
|
||||
})
|
||||
const mjIndex = ref(0)
|
||||
const mjList = ref([])
|
||||
@@ -163,14 +166,14 @@ function addMjItem() {
|
||||
}
|
||||
function getMjTitle(idx) {
|
||||
const cjObj = {
|
||||
C1: '小车',
|
||||
D: '摩托车'
|
||||
1001: '小车',
|
||||
1002: '摩托车'
|
||||
}
|
||||
const kmObj = {
|
||||
1: '科一',
|
||||
4: '科四'
|
||||
}
|
||||
return `${cjObj[queryParams.value.chexing]}${kmObj[queryParams.value.examType]}考前密卷 第${
|
||||
return `${cjObj[queryParams.value.carTypeId]}${kmObj[queryParams.value.subject]}考前密卷 第${
|
||||
idx + 1
|
||||
}套`
|
||||
}
|
||||
@@ -215,9 +218,9 @@ function searchQues() {
|
||||
...queryParams.value,
|
||||
pageNo: 1,
|
||||
pageSize: 1000,
|
||||
subTitle: quesName.value
|
||||
question: quesName.value
|
||||
}).then((response) => {
|
||||
quesLit.value = response
|
||||
quesLit.value = response.list
|
||||
})
|
||||
}
|
||||
function takeoutMj(row) {
|
||||
@@ -236,7 +239,7 @@ function getQuestionList() {
|
||||
getMjQuestionList({
|
||||
secretId: mjList.value[mjIndex.value].secretId
|
||||
}).then((resp) => {
|
||||
tableList.value = resp?.sort((pre, cur) => pre.id - cur.id) || []
|
||||
tableList.value = resp
|
||||
})
|
||||
}
|
||||
function sureAddQues(row) {
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
<el-form inline label-width="68px" @submit.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="车型">
|
||||
<el-radio-group v-model="queryParams.chexing">
|
||||
<el-radio label="C1">小车</el-radio>
|
||||
<el-radio label="D">摩托车</el-radio>
|
||||
<el-radio-group v-model="queryParams.carTypeId">
|
||||
<el-radio label="1001">小车</el-radio>
|
||||
<el-radio label="1002">摩托车</el-radio>
|
||||
<!-- <el-radio label="B2">货车</el-radio> -->
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="科目">
|
||||
<el-radio-group v-model="queryParams.examType">
|
||||
<el-radio-group v-model="queryParams.subject">
|
||||
<el-radio label="1">科一</el-radio>
|
||||
<el-radio label="4">科四</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -24,32 +24,39 @@
|
||||
getQuestionList()
|
||||
}
|
||||
"
|
||||
>查询</el-button
|
||||
>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button type="primary" @click="addMjDetail">新增精选试题</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table v-loading="loading" :data="tableList" height="calc(100vh - 250px)">
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column label="题目" align="left" prop="subTitle" min-width="140" />
|
||||
<el-table-column label="题目" align="left" prop="question" min-width="140" />
|
||||
<el-table-column label="选项" align="left" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<p v-if="row.optA">A:{{ row.optA }}</p>
|
||||
<p v-if="row.optB">B:{{ row.optB }}</p>
|
||||
<p v-if="row.optC">C:{{ row.optC }}</p>
|
||||
<p v-if="row.optD">D:{{ row.optD }}</p>
|
||||
<p v-if="row.chooseA">A:{{ row.chooseA }}</p>
|
||||
<p v-if="row.chooseB">B:{{ row.chooseB }}</p>
|
||||
<p v-if="row.chooseC">C:{{ row.chooseC }}</p>
|
||||
<p v-if="row.chooseD">D:{{ row.chooseD }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="答案" align="center" prop="trueAnswer" width="100" />
|
||||
<el-table-column label="科目" align="center" prop="subject" width="100">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.subject == '1'">科一</span>
|
||||
<span v-if="row.subject == '4'">科四</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="答案" align="center" prop="answer" width="100" />
|
||||
<el-table-column label="章节" align="center" prop="sortName" min-width="100" />
|
||||
<el-table-column label="专项" align="center" prop="categoryTitle" width="100" />
|
||||
<el-table-column label="图片" align="center" width="100">
|
||||
<template #default="{ row }">
|
||||
<img
|
||||
v-if="row.subPic"
|
||||
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.subPic}`"
|
||||
width="80px"
|
||||
<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}`]"
|
||||
:lazy="true"
|
||||
style="width: 80px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -73,24 +80,24 @@
|
||||
<el-button style="margin-left: 20px" type="primary" @click="searchQues">搜索</el-button>
|
||||
</div>
|
||||
<el-table :data="quesLit" highlight-current-row height="calc(100vh - 260px)">
|
||||
<el-table-column label="题目" align="left" prop="subTitle" min-width="140" />
|
||||
<el-table-column label="题目" align="left" prop="question" min-width="140" />
|
||||
<el-table-column label="选项" align="left" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<p v-if="row.optA">A:{{ row.optA }}</p>
|
||||
<p v-if="row.optB">B:{{ row.optB }}</p>
|
||||
<p v-if="row.optC">C:{{ row.optC }}</p>
|
||||
<p v-if="row.optD">D:{{ row.optD }}</p>
|
||||
<p v-if="row.chooseA">A:{{ row.chooseA }}</p>
|
||||
<p v-if="row.chooseB">B:{{ row.chooseB }}</p>
|
||||
<p v-if="row.chooseC">C:{{ row.chooseC }}</p>
|
||||
<p v-if="row.chooseD">D:{{ row.chooseD }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="答案" align="center" prop="answer" width="100" />
|
||||
<el-table-column label="章节" align="center" prop="sortName" width="180" />
|
||||
<el-table-column label="专项" align="center" prop="categoryTitle" width="100" />
|
||||
<el-table-column label="答案" align="center" prop="trueAnswer" width="100" />
|
||||
<el-table-column label="章节" align="center" prop="chapterName" min-width="100" />
|
||||
<el-table-column label="图片" align="center" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-image
|
||||
v-if="row.subPic"
|
||||
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.subPic}`"
|
||||
:preview-src-list="[`https://ss-cloud.ahduima.com/xjxc/pic/${row.subPic}`]"
|
||||
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}`]"
|
||||
:lazy="true"
|
||||
style="width: 80px"
|
||||
/>
|
||||
</template>
|
||||
@@ -106,20 +113,16 @@
|
||||
</template>
|
||||
|
||||
<script setup name="SimpleData">
|
||||
import {
|
||||
getMjQuestionList,
|
||||
addMjQuestion,
|
||||
delMjQuestion,
|
||||
searchQuestion
|
||||
} from '@/api/xjapplet/xjdatabase'
|
||||
import { getJxQuestionList, addJx, delJxData } from '@/api/xjapplet/vipdatabase.js'
|
||||
import { searchQuestion } from '@/api/xjapplet/xjdatabase.js'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const queryParams = ref({
|
||||
chexing: 'C1',
|
||||
examType: '1',
|
||||
carTypeId: '1001',
|
||||
subject: '1',
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
pageSize: 100
|
||||
})
|
||||
|
||||
const total = ref(0)
|
||||
@@ -130,6 +133,9 @@ const showDialog = ref(false)
|
||||
const quesName = ref('')
|
||||
const quesLit = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
getQuestionList()
|
||||
})
|
||||
function addMjDetail() {
|
||||
showDialog.value = true
|
||||
}
|
||||
@@ -138,7 +144,7 @@ function searchQues() {
|
||||
...queryParams.value,
|
||||
pageNo: 1,
|
||||
pageSize: 1000,
|
||||
subTitle: quesName.value
|
||||
question: quesName.value
|
||||
}).then((response) => {
|
||||
quesLit.value = response.list
|
||||
})
|
||||
@@ -147,7 +153,7 @@ function takeoutMj(row) {
|
||||
message
|
||||
.confirm('是否确认将该题移出精选?')
|
||||
.then(function () {
|
||||
return delMjQuestion(row.id)
|
||||
return delJxData(row.id)
|
||||
})
|
||||
.then(() => {
|
||||
getQuestionList()
|
||||
@@ -156,13 +162,16 @@ function takeoutMj(row) {
|
||||
.catch(() => {})
|
||||
}
|
||||
function getQuestionList() {
|
||||
getMjQuestionList().then((resp) => {
|
||||
tableList.value = resp?.sort((pre, cur) => pre.id - cur.id) || []
|
||||
getJxQuestionList(queryParams.value).then((resp) => {
|
||||
tableList.value = resp.list
|
||||
total.value = resp.total
|
||||
})
|
||||
}
|
||||
function sureAddQues(row) {
|
||||
addMjQuestion({
|
||||
subId: row.subId
|
||||
addJx({
|
||||
questionId: row.questionId,
|
||||
carTypeId: queryParams.value.carTypeId,
|
||||
subject: queryParams.value.subject
|
||||
})
|
||||
.then((resp) => {
|
||||
if (resp) {
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="题目" prop="subTitle">
|
||||
<el-form-item label="题目" prop="question">
|
||||
<el-input
|
||||
v-model="dialogForm.subTitle"
|
||||
v-model="dialogForm.question"
|
||||
maxlength="200"
|
||||
placeholder="请输入题目"
|
||||
clearable
|
||||
@@ -51,13 +51,13 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="章节" prop="sortId">
|
||||
<el-select v-model="dialogForm.sortId" style="width: 100%">
|
||||
<el-form-item label="章节" prop="chapter">
|
||||
<el-select v-model="dialogForm.chapter" style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in sortOptions"
|
||||
:key="dict.sortId"
|
||||
:label="dict.sortName"
|
||||
:value="dict.sortId"
|
||||
v-for="dict in chapterOptions"
|
||||
:key="dict.chapterId"
|
||||
:label="dict.chapterName"
|
||||
:value="dict.chapterId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -66,8 +66,8 @@
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="题型" prop="subType">
|
||||
<el-radio-group v-model="dialogForm.subType">
|
||||
<el-form-item label="题型" prop="type">
|
||||
<el-radio-group v-model="dialogForm.type">
|
||||
<el-radio label="1">判断题</el-radio>
|
||||
<el-radio label="2">单选题</el-radio>
|
||||
<el-radio label="3">多选题</el-radio>
|
||||
@@ -76,40 +76,53 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="dialogForm.sort" maxlength="20" placeholder="请输入" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项A" prop="subTitle">
|
||||
<el-input v-model="dialogForm.optA" maxlength="200" placeholder="请输入" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项B" prop="subTitle">
|
||||
<el-input v-model="dialogForm.optB" maxlength="200" placeholder="请输入" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项C" prop="subTitle">
|
||||
<el-input v-model="dialogForm.optC" maxlength="200" placeholder="请输入" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项D" prop="subTitle">
|
||||
<el-input v-model="dialogForm.optD" maxlength="200" placeholder="请输入" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="答案" prop="answer">
|
||||
<el-form-item label="排序" prop="showOrder">
|
||||
<el-input
|
||||
v-model="dialogForm.answer"
|
||||
v-model="dialogForm.showOrder"
|
||||
maxlength="20"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项A" prop="chooseA">
|
||||
<el-input
|
||||
v-model="dialogForm.chooseA"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项B" prop="chooseB">
|
||||
<el-input
|
||||
v-model="dialogForm.chooseB"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项C" prop="chooseC">
|
||||
<el-input
|
||||
v-model="dialogForm.chooseC"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项D" prop="chooseD">
|
||||
<el-input
|
||||
v-model="dialogForm.chooseD"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
@@ -119,9 +132,21 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="难点分析" prop="infos">
|
||||
<el-form-item label="答案" prop="trueAnswer">
|
||||
<el-input
|
||||
v-model="dialogForm.infos"
|
||||
v-model="dialogForm.trueAnswer"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="难点分析" prop="bestAnswer">
|
||||
<el-input
|
||||
v-model="dialogForm.bestAnswer"
|
||||
maxlength="1000"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
@@ -131,17 +156,22 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="答题技巧" prop="dtjq">
|
||||
<el-input v-model="dialogForm.dtjq" maxlength="1000" placeholder="请输入" clearable />
|
||||
<el-form-item label="答题技巧" prop="skillInfo">
|
||||
<el-input
|
||||
v-model="dialogForm.skillInfo"
|
||||
maxlength="1000"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="技巧关键字" prop="jqWords">
|
||||
<el-form-item label="技巧关键字" prop="skillWords">
|
||||
<el-input
|
||||
v-model="dialogForm.jqWords"
|
||||
v-model="dialogForm.skillWords"
|
||||
maxlength="1000"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
@@ -151,18 +181,17 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="车型" prop="chexing">
|
||||
<span v-if="dialogForm.chexing == 'C1'">小车</span>
|
||||
<span v-if="dialogForm.chexing == 'D'">摩托车</span>
|
||||
<span v-if="dialogForm.chexing == 'B2'">货车</span>
|
||||
<el-form-item label="车型" prop="carTypeId">
|
||||
<span v-if="dialogForm.carTypeId == '1001'">小车</span>
|
||||
<span v-if="dialogForm.carTypeId == '1002'">摩托车</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="科目" prop="examType">
|
||||
<span v-if="dialogForm.examType == '1'">科一</span>
|
||||
<span v-if="dialogForm.examType == '4'">科四</span>
|
||||
<el-form-item label="科目" prop="subject">
|
||||
<span v-if="dialogForm.subject == '1'">科一</span>
|
||||
<span v-if="dialogForm.subject == '4'">科四</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -195,7 +224,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="QuesAddForm">
|
||||
import { addQuestion, updateQuestion, uploadFile, getQuestionSort } from '@/api/xjapplet/xjdatabase'
|
||||
import { addQuestion, updateQuestion, uploadFile } from '@/api/xjapplet/xjdatabase'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -204,22 +233,22 @@ const emit = defineEmits(['update'])
|
||||
const visible = ref(false)
|
||||
const canSubmit = ref(true)
|
||||
const imgUrl = ref(undefined)
|
||||
const sortOptions = ref([])
|
||||
const chapterOptions = ref([])
|
||||
const dialogForm = ref({
|
||||
id: undefined,
|
||||
sort: 0,
|
||||
showOrder: 0,
|
||||
categoryTitle: undefined,
|
||||
subTitle: undefined,
|
||||
infos: undefined,
|
||||
optA: undefined,
|
||||
optB: undefined,
|
||||
optC: undefined,
|
||||
optD: undefined,
|
||||
subPic: undefined,
|
||||
subType: undefined,
|
||||
answer: undefined,
|
||||
examType: undefined,
|
||||
dtjqPic: undefined
|
||||
question: undefined,
|
||||
bestAnswer: undefined,
|
||||
chooseA: undefined,
|
||||
chooseB: undefined,
|
||||
chooseC: undefined,
|
||||
chooseD: undefined,
|
||||
imageUrl: undefined,
|
||||
type: undefined,
|
||||
trueAnswer: undefined,
|
||||
carTypeId: undefined,
|
||||
skillInfoPic: undefined
|
||||
})
|
||||
|
||||
const dataRule = {
|
||||
@@ -227,14 +256,14 @@ const dataRule = {
|
||||
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
const open = (info = undefined) => {
|
||||
const open = (info = undefined, opts) => {
|
||||
visible.value = true
|
||||
getQuestionChapter(info)
|
||||
chapterOptions.value = opts
|
||||
resetDialogForm()
|
||||
if (info) {
|
||||
dialogForm.value = { ...info }
|
||||
if (dialogForm.value.subPic) {
|
||||
imgUrl.value = 'https://ss-cloud.ahduima.com/xjxc/pic/' + dialogForm.value.subPic
|
||||
dialogForm.value = { ...info, chapter: parseInt(info.chapter) }
|
||||
if (dialogForm.value.imageUrl) {
|
||||
imgUrl.value = 'https://ss-cloud.ahduima.com/xjxc/pic/' + dialogForm.value.imageUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,36 +272,31 @@ defineExpose({
|
||||
open
|
||||
})
|
||||
|
||||
const getQuestionChapter = (info) => {
|
||||
getQuestionSort({ chexing: info.chexing, examType: info.examType }).then((data) => {
|
||||
sortOptions.value = data
|
||||
})
|
||||
}
|
||||
const resetDialogForm = () => {
|
||||
dialogForm.value = {
|
||||
id: undefined,
|
||||
sort: 0,
|
||||
subTitle: undefined,
|
||||
infos: undefined,
|
||||
optA: undefined,
|
||||
optB: undefined,
|
||||
optC: undefined,
|
||||
optD: undefined,
|
||||
subPic: undefined,
|
||||
subType: undefined,
|
||||
answer: undefined,
|
||||
examType: undefined,
|
||||
dtjqPic: undefined,
|
||||
dtjq: undefined,
|
||||
showOrder: 0,
|
||||
question: undefined,
|
||||
bestAnswer: undefined,
|
||||
chooseA: undefined,
|
||||
chooseB: undefined,
|
||||
chooseC: undefined,
|
||||
chooseD: undefined,
|
||||
imageUrl: undefined,
|
||||
type: undefined,
|
||||
trueAnswer: undefined,
|
||||
carTypeId: undefined,
|
||||
skillInfoPic: undefined,
|
||||
skillInfo: undefined,
|
||||
jqtp: undefined,
|
||||
biaoji: undefined,
|
||||
titleWords: undefined,
|
||||
jqWords: undefined,
|
||||
skillWords: undefined,
|
||||
optaWords: undefined,
|
||||
optbWords: undefined,
|
||||
optcWords: undefined,
|
||||
optdWords: undefined,
|
||||
chexing: undefined
|
||||
carTypeId: undefined
|
||||
}
|
||||
}
|
||||
const dialogFormRef = ref(null)
|
||||
@@ -282,7 +306,7 @@ const dialogFormSubmit = async () => {
|
||||
const valid = await dialogFormRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
if (dialogForm.value.id) {
|
||||
if (dialogForm.value.questionId) {
|
||||
updateQuestion(dialogForm.value).then((response) => {
|
||||
if (response) {
|
||||
message.success('修改成功')
|
||||
@@ -306,8 +330,8 @@ const handleImport = (opt) => {
|
||||
uploadFile(data).then((resp) => {
|
||||
if (resp.code == 200) {
|
||||
message.success('文件上传成功')
|
||||
dialogForm.value.subPic = resp.data
|
||||
imgUrl.value = 'https://ss-cloud.ahduima.com/xjxc/pic/' + dialogForm.value.subPic
|
||||
dialogForm.value.imageUrl = resp.data
|
||||
imgUrl.value = 'https://ss-cloud.ahduima.com/xjxc/pic/' + dialogForm.value.imageUrl
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
<template>
|
||||
<div class="app-container" style="text-align: center">
|
||||
<el-form size="small" :inline="true" label-width="68px" @submit.prevent>
|
||||
<el-form :inline="true" label-width="68px" @submit.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="车型">
|
||||
<el-radio-group v-model="queryParams.chexing">
|
||||
<el-radio label="C1">小车</el-radio>
|
||||
<el-radio label="D">摩托车</el-radio>
|
||||
<el-radio label="B2">货车</el-radio>
|
||||
<el-radio-group v-model="queryParams.carTypeId" @change="getQuestionChapter">
|
||||
<el-radio label="1001">小车</el-radio>
|
||||
<el-radio label="1002">摩托车</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="科目">
|
||||
<el-radio-group v-model="queryParams.examType">
|
||||
<el-radio-group v-model="queryParams.subject" @change="getQuestionChapter">
|
||||
<el-radio label="1">科一</el-radio>
|
||||
<el-radio label="4">科四</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -26,7 +25,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="题目">
|
||||
<el-input
|
||||
v-model="queryParams.subTitle"
|
||||
v-model="queryParams.question"
|
||||
placeholder="请输入题目"
|
||||
clearable
|
||||
style="width: 400px"
|
||||
@@ -41,40 +40,36 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="tableList" highlight-current-row>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
highlight-current-row
|
||||
max-height="calc(100vh - 260px)"
|
||||
>
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column label="题目" align="left" prop="subTitle" min-width="140" />
|
||||
<el-table-column label="题目" align="left" prop="question" min-width="140" />
|
||||
<el-table-column label="选项" align="left" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<p v-if="row.optA">A:{{ row.optA }}</p>
|
||||
<p v-if="row.optB">B:{{ row.optB }}</p>
|
||||
<p v-if="row.optC">C:{{ row.optC }}</p>
|
||||
<p v-if="row.optD">D:{{ row.optD }}</p>
|
||||
<p v-if="row.chooseA">A:{{ row.chooseA }}</p>
|
||||
<p v-if="row.chooseB">B:{{ row.chooseB }}</p>
|
||||
<p v-if="row.chooseC">C:{{ row.chooseC }}</p>
|
||||
<p v-if="row.chooseD">D:{{ row.chooseD }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="答案" align="center" prop="answer" width="100" />
|
||||
<el-table-column label="车型" align="center" prop="chexing" width="100">
|
||||
<el-table-column label="答案" align="center" prop="trueAnswer" width="100" />
|
||||
<el-table-column label="科目" align="center" prop="subject" width="100">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.chexing == 'C1'">小车</span>
|
||||
<span v-if="row.chexing == 'D'">摩托车</span>
|
||||
<span v-if="row.chexing == 'B2'">货车</span>
|
||||
<span v-if="row.subject == '1'">科一</span>
|
||||
<span v-if="row.subject == '4'">科四</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="科目" align="center" prop="examType" width="100">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.examType == '1'">科一</span>
|
||||
<span v-if="row.examType == '4'">科四</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="章节" align="center" prop="sortName" min-width="100" />
|
||||
<el-table-column label="专项" align="center" prop="categoryTitle" width="100" />
|
||||
<el-table-column label="章节" align="center" prop="chapterName" min-width="100" />
|
||||
<el-table-column label="图片" align="center" width="100">
|
||||
<template #default="{ row }">
|
||||
<!-- <img v-if="row.subPic" :src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.subPic}`" width="80px"> -->
|
||||
<el-image
|
||||
v-if="row.subPic"
|
||||
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.subPic}`"
|
||||
:preview-src-list="[`https://ss-cloud.ahduima.com/xjxc/pic/${row.subPic}`]"
|
||||
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}`]"
|
||||
:lazy="true"
|
||||
style="width: 80px"
|
||||
/>
|
||||
@@ -101,24 +96,38 @@
|
||||
</template>
|
||||
|
||||
<script setup name="XjDatabase">
|
||||
import { searchQuestion, deleteQuestion } from '@/api/xjapplet/xjdatabase'
|
||||
import { searchQuestion, deleteQuestion, getQuestionSort } from '@/api/xjapplet/xjdatabase'
|
||||
import QuestionAddForm from './components/QuestionAddForm.vue'
|
||||
|
||||
const loading = ref(false)
|
||||
const total = ref(0)
|
||||
const tableList = ref([])
|
||||
const queryParams = reactive({
|
||||
subTitle: '',
|
||||
chexing: 'C1',
|
||||
examType: '1',
|
||||
const queryParams = ref({
|
||||
question: '',
|
||||
carTypeId: '1001',
|
||||
subject: '1',
|
||||
isPic: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 100
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
getQuestionChapter()
|
||||
})
|
||||
|
||||
const chapterOptions = ref([])
|
||||
const getQuestionChapter = () => {
|
||||
getQuestionSort({
|
||||
carTypeId: queryParams.value.carTypeId,
|
||||
subject: queryParams.value.subject
|
||||
}).then((data) => {
|
||||
chapterOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
searchQuestion(queryParams).then((response) => {
|
||||
searchQuestion(queryParams.value).then((response) => {
|
||||
tableList.value = response.list
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
@@ -130,20 +139,23 @@ function handleQuery() {
|
||||
}
|
||||
|
||||
function resetQuery() {
|
||||
queryParams.subTitle = ''
|
||||
queryParams.value.question = ''
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const dialogAddForm = ref(null)
|
||||
function handleEdit(item) {
|
||||
dialogAddForm.value.open(item)
|
||||
dialogAddForm.value.open(item, chapterOptions.value)
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
dialogAddForm.value.open({
|
||||
examType: queryParams.examType,
|
||||
chexing: queryParams.chexing
|
||||
})
|
||||
dialogAddForm.value.open(
|
||||
{
|
||||
subject: queryParams.value.subject,
|
||||
carTypeId: queryParams.value.carTypeId
|
||||
},
|
||||
chapterOptions.value
|
||||
)
|
||||
}
|
||||
|
||||
function handleDelete(id) {
|
||||
|
||||
Reference in New Issue
Block a user