修改bug
This commit is contained in:
parent
1432635d4e
commit
b8f643abe0
74
src/api/manage/mkJigsaw/index.ts
Normal file
74
src/api/manage/mkJigsaw/index.ts
Normal file
@ -0,0 +1,74 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MkJigsawVO, MkJigsawForm, MkJigsawQuery } from '@/api/manage/mkJigsaw/types';
|
||||
|
||||
/**
|
||||
* 查询拼图游戏列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listMkJigsaw = (query?: MkJigsawQuery): AxiosPromise<MkJigsawVO[]> => {
|
||||
return request({
|
||||
url: '/manage/mkJigsaw/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询拼图游戏详细
|
||||
* @param id
|
||||
*/
|
||||
export const getMkJigsaw = (id: string | number): AxiosPromise<MkJigsawVO> => {
|
||||
return request({
|
||||
url: '/manage/mkJigsaw/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增拼图游戏
|
||||
* @param data
|
||||
*/
|
||||
export const addMkJigsaw = (data: MkJigsawForm) => {
|
||||
return request({
|
||||
url: '/manage/mkJigsaw',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改拼图游戏
|
||||
* @param data
|
||||
*/
|
||||
export const updateMkJigsaw = (data: MkJigsawForm) => {
|
||||
return request({
|
||||
url: '/manage/mkJigsaw',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除拼图游戏
|
||||
* @param id
|
||||
*/
|
||||
export const delMkJigsaw = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/manage/mkJigsaw/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 商品下拉列表
|
||||
* @param query
|
||||
*/
|
||||
export const productall = (query: Array<string | number>) => {
|
||||
return request({
|
||||
url: '/manage/product/all',
|
||||
method: 'gte',
|
||||
params: query
|
||||
});
|
||||
};
|
206
src/api/manage/mkJigsaw/types.ts
Normal file
206
src/api/manage/mkJigsaw/types.ts
Normal file
@ -0,0 +1,206 @@
|
||||
export interface MkJigsawVO {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 任务类别 0-普适拼图任务 1-心愿拼图任务
|
||||
*/
|
||||
category: number;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
productId: string | number;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
productName: string;
|
||||
|
||||
/**
|
||||
* 活动开始时间
|
||||
*/
|
||||
startDate: string;
|
||||
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
endDate: string;
|
||||
|
||||
/**
|
||||
* 拼图配置数量
|
||||
*/
|
||||
jigsawConfigCount: number;
|
||||
|
||||
/**
|
||||
* 得奖配置人数
|
||||
*/
|
||||
awardConfigCount: number;
|
||||
|
||||
/**
|
||||
* 控制得奖拼图
|
||||
*/
|
||||
controlJigsawIndex: number;
|
||||
|
||||
/**
|
||||
* 参与人数
|
||||
*/
|
||||
joinCount: number;
|
||||
|
||||
/**
|
||||
* 实际得奖人数
|
||||
*/
|
||||
awardCount: number;
|
||||
|
||||
/**
|
||||
* 发布状态 0-未发布 1-已发布
|
||||
*/
|
||||
status: number;
|
||||
|
||||
}
|
||||
|
||||
export interface MkJigsawForm extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* 任务类别 0-普适拼图任务 1-心愿拼图任务
|
||||
*/
|
||||
category?: number;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
productId?: string | number;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
productName?: string;
|
||||
|
||||
/**
|
||||
* 活动开始时间
|
||||
*/
|
||||
startDate?: string;
|
||||
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
endDate?: string;
|
||||
|
||||
/**
|
||||
* 拼图配置数量
|
||||
*/
|
||||
jigsawConfigCount?: number;
|
||||
|
||||
/**
|
||||
* 得奖配置人数
|
||||
*/
|
||||
awardConfigCount?: number;
|
||||
|
||||
/**
|
||||
* 控制得奖拼图
|
||||
*/
|
||||
controlJigsawIndex?: number;
|
||||
|
||||
/**
|
||||
* 参与人数
|
||||
*/
|
||||
joinCount?: number;
|
||||
|
||||
/**
|
||||
* 实际得奖人数
|
||||
*/
|
||||
awardCount?: number;
|
||||
|
||||
/**
|
||||
* 发布状态 0-未发布 1-已发布
|
||||
*/
|
||||
status?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface MkJigsawQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* 任务类别 0-普适拼图任务 1-心愿拼图任务
|
||||
*/
|
||||
category?: number;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
productId?: string | number;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
productName?: string;
|
||||
|
||||
/**
|
||||
* 活动开始时间
|
||||
*/
|
||||
startDate?: string;
|
||||
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
endDate?: string;
|
||||
|
||||
/**
|
||||
* 拼图配置数量
|
||||
*/
|
||||
jigsawConfigCount?: number;
|
||||
|
||||
/**
|
||||
* 得奖配置人数
|
||||
*/
|
||||
awardConfigCount?: number;
|
||||
|
||||
/**
|
||||
* 控制得奖拼图
|
||||
*/
|
||||
controlJigsawIndex?: number;
|
||||
|
||||
/**
|
||||
* 参与人数
|
||||
*/
|
||||
joinCount?: number;
|
||||
|
||||
/**
|
||||
* 实际得奖人数
|
||||
*/
|
||||
awardCount?: number;
|
||||
|
||||
/**
|
||||
* 发布状态 0-未发布 1-已发布
|
||||
*/
|
||||
status?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="70px">
|
||||
<el-form-item label="活动名称" prop="">
|
||||
<el-input class="inputWidth" placeholder="请输入活动名称" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.activityName" class="inputWidth" placeholder="请输入活动名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="挑选玩友" prop="">
|
||||
<el-select v-model="queryParams.isSelected" class="inputWidth" placeholder="请选择是否挑选玩友" clearable>
|
||||
@ -238,8 +238,8 @@ const publisherAddress = ref({});
|
||||
const Mapvalue = ref({});
|
||||
const Mapvaluetwo = ref({});
|
||||
const note_publish_list = ref([
|
||||
{ value: 2, label: '已发布' },
|
||||
{ value: 2, label: '未发布' },
|
||||
{ value: 3, label: '已发布' },
|
||||
{ value: 0, label: '未发布' },
|
||||
{ value: 1, label: '草稿' }
|
||||
]);
|
||||
const activityFormRef = ref<ElFormInstance>();
|
||||
@ -360,6 +360,9 @@ const handleQuery = () => {
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryParams.value.status = '';
|
||||
queryParams.value.isSelected = '';
|
||||
queryParams.value.activityName = '';
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
@ -470,9 +473,7 @@ const registrationCountnum = async (row) => {
|
||||
activityUserstotal.value = res.total;
|
||||
numdialog.visible = true;
|
||||
};
|
||||
const chakanhandle = async (row?: ActivityVO) => {
|
||||
|
||||
};
|
||||
const chakanhandle = async (row?: ActivityVO) => {};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -83,8 +83,8 @@
|
||||
v-model="form.number"
|
||||
placeholder="请输入联系电话"
|
||||
style="width: 300px"
|
||||
oninput="if(value.length>11)value=value.slice(0,11)"
|
||||
onkeyup="this.value = this.value.replace(/[^\d]/g,'');"
|
||||
oninput="if(value.length>20)value=value.slice(0,20)"
|
||||
οnkeyup="value=value.replace(/[^\d\-\d]/g,'')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商家图片">
|
||||
@ -267,6 +267,8 @@ const handleUpdate = async (row?: HotelVO) => {
|
||||
const res = await getHotel(_id);
|
||||
res.data.regionCode = res.data?.county || res.data?.city || res.data?.province;
|
||||
Object.assign(form.value, res.data);
|
||||
center.value = { lat: row.latitude, lng: row.longitude };
|
||||
geometries.value = [{ styleId: 'marker', position: { lat: row.latitude, lng: row.longitude } }];
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改住宿';
|
||||
};
|
||||
@ -429,3 +431,5 @@ onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
|
351
src/views/manage/mkJigsaw/index.vue
Normal file
351
src/views/manage/mkJigsaw/index.vue
Normal file
@ -0,0 +1,351 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="任务名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入任务名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态" prop="category">
|
||||
<el-select v-model="queryParams.category" placeholder="请选择任务状态" clearable>
|
||||
<el-option v-for="dict in mk_jigsaw_task_catagory" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['manage:mkJigsaw:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="mkJigsawList">
|
||||
<el-table-column label="任务名称" align="center" prop="name" />
|
||||
<el-table-column label="任务类别" align="center" prop="category">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="mk_jigsaw_task_catagory" :value="scope.row.category" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品ID" align="center" prop="productId" />
|
||||
<el-table-column label="商品名称" align="center" prop="productName" />
|
||||
<el-table-column label="商品类别" align="center" prop="productCategory" />
|
||||
<el-table-column label="商品图片" align="center" prop="productImage" />
|
||||
<el-table-column label="活动时间" align="center" prop="startDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.startDate, '{y}.{m}.{d}') }}~{{ parseTime(scope.row.endDate, '{y}.{m}.{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="拼图数量" align="center" prop="jigsawConfigCount" />
|
||||
<el-table-column label="设置得奖人数" align="center" prop="awardConfigCount" />
|
||||
<el-table-column label="参与人数" align="center" prop="joinCount" />
|
||||
<el-table-column label="实际得奖人数" align="center" prop="awardCount" />
|
||||
<el-table-column label="拼图碎片获得人数" align="center" prop="awardCount">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link>查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="拼图详情" align="center" prop="awardCount">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link>查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发布状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.status }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" align="center" prop="awardCount" />
|
||||
<el-table-column label="创建时间" align="center" prop="awardCount" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button v-hasPermi="['manage:mkJigsaw:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button v-hasPermi="['manage:mkJigsaw:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改拼图游戏对话框 -->
|
||||
<el-dialog v-model="dialog.visible" :title="dialog.title" width="50%" append-to-body>
|
||||
<el-form ref="mkJigsawFormRef" :model="form" :rules="rules" label-width="140px">
|
||||
<el-form-item label="任务名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入任务名称" style="width: 300px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务类别" prop="category">
|
||||
<el-select v-model="form.category" placeholder="请选择任务类别" style="width: 300px">
|
||||
<el-option v-for="dict in mk_jigsaw_task_catagory" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择商品" prop="productId">
|
||||
<el-input v-model="form.productId" placeholder="请选择商品" style="width: 300px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="活动时间" prop="startDate">
|
||||
<el-date-picker v-model="form.startDate" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择活动开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="设置拼图数量" prop="jigsawConfigCount">
|
||||
<el-input v-model="form.jigsawConfigCount" placeholder="请输入拼图配置数量" style="width: 300px" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="得奖人数" prop="awardConfigCount">
|
||||
<el-input v-model="form.awardConfigCount" placeholder="请输入得奖人数" style="width: 300px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="控制得奖拼图" prop="controlJigsawIndex">
|
||||
<el-select v-model="form.controlJigsawIndex" placeholder="请选择控制得奖拼图" style="width: 300px" @change="selectnumlist">
|
||||
<el-option v-for="dict in numlist" :key="dict.label" :label="dict.label" :value="dict.label"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div class="numlistclasss">
|
||||
<div v-for="item in numlistdata" :key="item.name">
|
||||
<el-form-item :label="`${item.name}:可获得概率`">
|
||||
<el-input v-model="item.probability" placeholder="请输入概率" style="width: 100px" />%
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MkJigsaw" lang="ts">
|
||||
import { listMkJigsaw, getMkJigsaw, delMkJigsaw, addMkJigsaw, updateMkJigsaw } from '@/api/manage/mkJigsaw';
|
||||
import { MkJigsawVO, MkJigsawQuery, MkJigsawForm } from '@/api/manage/mkJigsaw/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { mk_jigsaw_task_catagory } = toRefs<any>(proxy?.useDict('mk_jigsaw_task_catagory'));
|
||||
|
||||
const mkJigsawList = ref<MkJigsawVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const mkJigsawFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
const numlist = ref([
|
||||
{ value: '1', label: '片数1' },
|
||||
{ value: '2', label: '片数2' },
|
||||
{ value: '3', label: '片数3' },
|
||||
{ value: '4', label: '片数4' },
|
||||
{ value: '5', label: '片数5' },
|
||||
{ value: '6', label: '片数6' },
|
||||
{ value: '7', label: '片数7' },
|
||||
{ value: '8', label: '片数8' },
|
||||
{ value: '9', label: '片数9' }
|
||||
]);
|
||||
const numlistdata = ref([
|
||||
{ probability: '', name: '片数1' },
|
||||
{ probability: '', name: '片数2' },
|
||||
{ probability: '', name: '片数3' },
|
||||
{ probability: '', name: '片数4' },
|
||||
{ probability: '', name: '片数5' },
|
||||
{ probability: '', name: '片数6' },
|
||||
{ probability: '', name: '片数7' },
|
||||
{ probability: '', name: '片数8' },
|
||||
{ probability: '', name: '片数9' }
|
||||
]);
|
||||
const initFormData: MkJigsawForm = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
category: undefined,
|
||||
productId: undefined,
|
||||
productName: undefined,
|
||||
startDate: undefined,
|
||||
endDate: undefined,
|
||||
jigsawConfigCount: 9,
|
||||
awardConfigCount: undefined,
|
||||
controlJigsawIndex: undefined,
|
||||
joinCount: undefined,
|
||||
awardCount: undefined,
|
||||
status: undefined
|
||||
};
|
||||
const data = reactive<PageData<MkJigsawForm, MkJigsawQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
category: undefined,
|
||||
productId: undefined,
|
||||
productName: undefined,
|
||||
startDate: undefined,
|
||||
endDate: undefined,
|
||||
jigsawConfigCount: undefined,
|
||||
awardConfigCount: undefined,
|
||||
controlJigsawIndex: undefined,
|
||||
joinCount: undefined,
|
||||
awardCount: undefined,
|
||||
status: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: 'ID不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
|
||||
category: [{ required: true, message: '任务类别 0-普适拼图任务 1-心愿拼图任务不能为空', trigger: 'change' }],
|
||||
productId: [{ required: true, message: '商品ID不能为空', trigger: 'blur' }],
|
||||
productName: [{ required: true, message: '商品名称不能为空', trigger: 'blur' }],
|
||||
startDate: [{ required: true, message: '活动开始时间不能为空', trigger: 'blur' }],
|
||||
endDate: [{ required: true, message: '活动结束时间不能为空', trigger: 'blur' }],
|
||||
jigsawConfigCount: [{ required: true, message: '拼图配置数量不能为空', trigger: 'blur' }],
|
||||
awardConfigCount: [{ required: true, message: '得奖配置人数不能为空', trigger: 'blur' }],
|
||||
controlJigsawIndex: [{ required: true, message: '控制得奖拼图不能为空', trigger: 'blur' }],
|
||||
joinCount: [{ required: true, message: '参与人数不能为空', trigger: 'blur' }],
|
||||
awardCount: [{ required: true, message: '实际得奖人数不能为空', trigger: 'blur' }],
|
||||
status: [{ required: true, message: '发布状态 0-未发布 1-已发布不能为空', trigger: 'change' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询拼图游戏列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listMkJigsaw(queryParams.value);
|
||||
mkJigsawList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
mkJigsawFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: MkJigsawVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加拼图任务';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: MkJigsawVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getMkJigsaw(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改拼图任务';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
mkJigsawFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateMkJigsaw(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addMkJigsaw(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: MkJigsawVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除拼图游戏编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delMkJigsaw(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'manage/mkJigsaw/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`mkJigsaw_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
const selectnumlist = () => {
|
||||
numlistdata.value = ([
|
||||
{ probability: '', name: '片数1' },
|
||||
{ probability: '', name: '片数2' },
|
||||
{ probability: '', name: '片数3' },
|
||||
{ probability: '', name: '片数4' },
|
||||
{ probability: '', name: '片数5' },
|
||||
{ probability: '', name: '片数6' },
|
||||
{ probability: '', name: '片数7' },
|
||||
{ probability: '', name: '片数8' },
|
||||
{ probability: '', name: '片数9' }
|
||||
]);
|
||||
console.log(form.value.controlJigsawIndex);
|
||||
numlistdata.value = numlistdata.value.filter((i) => i.name !== form.value.controlJigsawIndex);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.numlistclasss {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
> div {
|
||||
width: 33%;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -79,7 +79,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="笔记评论数" align="center" prop="commentCount">
|
||||
<template #default="scope">
|
||||
<el-button type="text">{{ scope.row.commentCount }}</el-button>
|
||||
<el-button type="text" @click="handleComment(scope.row)">{{ scope.row.commentCount }}</el-button>
|
||||
<!-- <image-preview :src="scope.row.productImageUrl" /> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -161,6 +161,17 @@
|
||||
<div>{{ formatlocation(form.location) }}</div>
|
||||
<div v-html="form.content"></div>
|
||||
</el-dialog>
|
||||
<!-- 评论详情 -->
|
||||
<el-dialog v-model="comment.visible" title="评论详情" width="600px" append-to-body>
|
||||
<div class="commentList">
|
||||
<commentRows :biz-id="comment.bizId"></commentRows>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer noTopPadding">
|
||||
<el-button @click="cancel">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -168,6 +179,8 @@
|
||||
import { listNotebook, getNotebook, delNotebook, addNotebook, updateNotebook, tagall, contentall } from '@/api/manage/notebook';
|
||||
import { NotebookVO, NotebookQuery, NotebookForm } from '@/api/manage/notebook/types';
|
||||
import { hotelall } from '@/api/manage/route';
|
||||
import { reactive } from 'vue';
|
||||
import { string } from "vue-types";
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const notebookList = ref<NotebookVO[]>([]);
|
||||
@ -184,8 +197,31 @@ const queryFormRef = ref<ElFormInstance>();
|
||||
const notebookFormRef = ref<ElFormInstance>();
|
||||
const value = ref('');
|
||||
const tagvalue = ref('');
|
||||
const addressvalue = ref('');
|
||||
const comment = reactive({
|
||||
visible: false,
|
||||
bizId: null
|
||||
});
|
||||
//导入父组件传递的值
|
||||
const props = defineProps({
|
||||
noteBookTagIds: {
|
||||
type: string,
|
||||
default: () => ''
|
||||
},
|
||||
autoTableHeight: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
parentName: {
|
||||
type: String,
|
||||
default: () => ''
|
||||
},
|
||||
sys_user_tagOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
});
|
||||
|
||||
const addressvalue = ref('');
|
||||
const statusoptions = [
|
||||
{
|
||||
value: '1',
|
||||
@ -243,6 +279,26 @@ const data = reactive<PageData<NotebookForm, NotebookQuery>>({
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
// 查看评论详情
|
||||
const handleComment = async (row: any) => {
|
||||
comment.bizId = row.id;
|
||||
comment.visible = true;
|
||||
};
|
||||
// 监听父组件传递的tagIds,当tagIds发生变化时,重新获取数据
|
||||
watch(
|
||||
() => props.noteBookTagIds,
|
||||
(newVal, oldVal) => {
|
||||
console.log(newVal);
|
||||
queryParams.value.tagIds = newVal;
|
||||
if (newVal) {
|
||||
//获取数据
|
||||
nextTick(() => {
|
||||
getTableList();
|
||||
});
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
/**
|
||||
* 标签格式化
|
||||
*/
|
||||
@ -262,12 +318,10 @@ const formatTag = (tagId: string | null) => {
|
||||
const formatlocation = (tagId: string | null) => {
|
||||
let tagString = '';
|
||||
let arrlist = tagId?.split(',').map(Number);
|
||||
|
||||
for (let i = 0; i < sys_user_contentOptions.value.length; i++) {
|
||||
const element = sys_user_contentOptions.value[i];
|
||||
for (let j = 0; j < arrlist.length; j++) {
|
||||
const conten = arrlist[j];
|
||||
|
||||
if (conten == element.id) {
|
||||
tagString += ',' + element.name;
|
||||
}
|
||||
@ -297,6 +351,7 @@ const getContent = async () => {
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
comment.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
@ -337,7 +392,7 @@ const handleUpdate = async (row?: NotebookVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getNotebook(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
tagvalue.value = form.value.tagId.split(',').map(Number);
|
||||
tagvalue.value = form.value.tagId.split(',');
|
||||
addressvalue.value = form.value.location.split(',');
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改笔记';
|
||||
@ -409,7 +464,21 @@ const handleExport = () => {
|
||||
`notebook_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
// 监听父组件传递的tagIds,当tagIds发生变化时,重新获取数据
|
||||
watch(
|
||||
() => props.noteBookTagIds,
|
||||
(newVal, oldVal) => {
|
||||
console.log(newVal);
|
||||
queryParams.value.tagIds = newVal;
|
||||
if (newVal) {
|
||||
//获取数据
|
||||
nextTick(() => {
|
||||
getTableList();
|
||||
});
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getTag(); //标签库
|
||||
|
@ -24,32 +24,37 @@
|
||||
</transition>
|
||||
|
||||
<el-table v-loading="loading" :height="autoTableHeight" :data="RouteList" border @selection-change="handleSelectionChange">
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="线路标题" align="center" prop="title" />
|
||||
<el-table-column label="ID" align="center" prop="id" width="180px" fixed />
|
||||
<el-table-column label="线路标题" align="center" prop="title" width="150px" show-overflow-tooltip fixed />
|
||||
<el-table-column label="线路封面" align="center" prop="" />
|
||||
<el-table-column label="线路标签" align="center" prop="tagId">
|
||||
<el-table-column label="线路标签" align="center" prop="tagId" width="150px" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ formatTag(scope.row.tagId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="涉及行政区" align="center" prop="region" width="150px" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.region == '' ? '' : scope.row.region == '[]' ? '' : addressdata(scope.row.region) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="行程天数" align="center" prop="routeDays">
|
||||
<template #default="scope">
|
||||
<div>{{ scope.row.routeDays }}天</div>
|
||||
<div v-if="scope.row.routeDays">{{ scope.row.routeDays }}天</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="行程里数" align="center" prop="routeMileage">
|
||||
<template #default="scope">
|
||||
<div>{{ scope.row.routeMileage }}公里</div>
|
||||
<div v-if="scope.row.routeMileage">{{ scope.row.routeMileage }}公里</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="行驶时长" align="center" prop="routeDriveHour">
|
||||
<template #default="scope">
|
||||
<div>{{ scope.row.routeDriveHour }}小时</div>
|
||||
<div v-if="scope.row.routeDriveHour">{{ scope.row.routeDriveHour }}小时</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最佳时间" align="center" prop="appropriateTime">
|
||||
<template #default="scope">
|
||||
<div>{{ scope.row.appropriateTime }}月</div>
|
||||
<div v-if="scope.row.appropriateTime">{{ scope.row.appropriateTime }}月</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="行程" align="center" prop="">
|
||||
@ -68,15 +73,25 @@
|
||||
<el-tag v-if="scope.row.status == 3" type="primary">已发布</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160px">
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button v-if="scope.row.status != 3" v-hasPermi="['system:Route:edit']" link type="primary" @click="handleUpdate(scope.row)"
|
||||
<el-button
|
||||
v-if="scope.row.status == 0 || scope.row.status == 1"
|
||||
v-hasPermi="['system:Route:edit']"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button v-if="scope.row.status != 3" v-hasPermi="['system:Route:remove']" link type="primary" @click="handleDelete(scope.row)"
|
||||
<el-button
|
||||
v-if="scope.row.status == 0 || scope.row.status == 1"
|
||||
v-hasPermi="['system:Route:remove']"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button v-if="scope.row.status != 3" v-hasPermi="['system:Route:remove']" link type="primary" @click="handleDelete(scope.row)"
|
||||
<el-button v-if="scope.row.status == 0" v-hasPermi="['system:Route:remove']" link type="primary" @click="handleDelete(scope.row)"
|
||||
>发布</el-button
|
||||
>
|
||||
<el-button v-if="scope.row.status == 3" v-hasPermi="['system:Route:remove']" link type="primary" @click="handleDelete(scope.row)"
|
||||
@ -217,10 +232,10 @@
|
||||
<!-- 预览-->
|
||||
<el-dialog v-model="yulandialog.visible" :title="yulandialog.title" width="60%" append-to-body>
|
||||
<el-form ref="RouteFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<div>{{ form.title }}</div>
|
||||
<div>线路标题:{{ form.title }}</div>
|
||||
<!-- <el-form-item label="路线封面" prop="attribute">-->
|
||||
<div>{{ formatTag(tagvalue) }}</div>
|
||||
<div>{{ addressdata(form.region) }}</div>
|
||||
<div>路线标签:{{ formatTag(tagvalue) }}</div>
|
||||
<div>涉及的行政区域:{{ addressdata(form.region) }}</div>
|
||||
<!-- <el-form-item label="涉及的行政区域" prop="treevalue">-->
|
||||
<!-- <el-cascader v-model="treevalue" :options="regiontree" :props="props" clearable placeholder="请选择涉及的行政区域" style="width: 400px" />-->
|
||||
<!-- </el-form-item>-->
|
||||
@ -270,7 +285,7 @@ import { listRoute, getRoute, delRoute, addRoute, updateRoute, getRegionTree, ho
|
||||
import { RouteVO, RouteQuery, RouteForm } from '@/api/manage/route/types';
|
||||
import { Plus } from '@element-plus/icons-vue';
|
||||
import { contentall, tagall } from '@/api/manage/notebook';
|
||||
|
||||
import { ElMessage } from 'element-plus';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const autoTableHeight = ref<number>(750);
|
||||
const RouteList = ref<RouteVO[]>([]);
|
||||
@ -290,9 +305,10 @@ const treevalue = ref('');
|
||||
const hotelallvalue = ref('');
|
||||
|
||||
const note_publish_list = ref([
|
||||
{ label: '已发布', value: 2 },
|
||||
{ label: '审核中', value: 1 },
|
||||
{ label: '未发布', value: 0 }
|
||||
{ label: '已发布', value: 3 },
|
||||
{ label: '审核中', value: 2 },
|
||||
{ label: '未发布', value: 0 },
|
||||
{ label: '草稿', value: 1 }
|
||||
]);
|
||||
const regiontree = ref([]);
|
||||
const props = { multiple: true, value: 'id' };
|
||||
@ -514,33 +530,32 @@ const handleUpdate = async (row?: RouteVO) => {
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
bookrouteDetailsList.value = form.value.routeDetailsList;
|
||||
tagvalue.value = form.value.tagId.split(',');
|
||||
console.log(tagvalue.value);
|
||||
const arr = form.value.region.split(',');
|
||||
// 使用循环将数组中的元素转换为整数
|
||||
const result = [];
|
||||
console.log(arr.length);
|
||||
if (arr.length > 1) {
|
||||
for (let i = 0; i < arr.length; i += 2) {
|
||||
result.push([parseInt(arr[i]), parseInt(arr[i + 1])]);
|
||||
}
|
||||
treevalue.value = result;
|
||||
} else {
|
||||
treevalue.value = form.value.region.split(',').map(Number);
|
||||
}
|
||||
console.log(result, arr);
|
||||
tagvalue.value =form.value.tagId==''?'': form.value.tagId.split(',');
|
||||
treevalue.value = JSON.parse(form.value.region);
|
||||
dialog.title = '修改路线';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = (type) => {
|
||||
form.value.tagId = tagvalue.value.join(',');
|
||||
console.log(treevalue.value, '22222');
|
||||
form.value.region = treevalue.value.join(',');
|
||||
const submitForm = async (type) => {
|
||||
form.value.tagId = tagvalue?.value.length != 0 ? tagvalue?.value.join(',') : '';
|
||||
form.value.region = treevalue?.value ? JSON.stringify(treevalue?.value) : '';
|
||||
form.value.status = Number(type);
|
||||
form.value.routeDetailsList = bookrouteDetailsList.value;
|
||||
console.log(form.value, bookrouteDetailsList.value);
|
||||
// return;
|
||||
if (type == 1) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.title == '' || form.value.title == undefined) {
|
||||
ElMessage.error('线路标题必填');
|
||||
buttonLoading.value = false;
|
||||
return;
|
||||
}
|
||||
if (form.value.id) {
|
||||
await updateRoute(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addRoute(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
await getList();
|
||||
} else {
|
||||
RouteFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
@ -550,13 +565,11 @@ const submitForm = (type) => {
|
||||
await addRoute(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
if (type == 1) {
|
||||
} else {
|
||||
dialog.visible = false;
|
||||
}
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
@ -716,7 +729,7 @@ const addressdata = (ids: string | null) => {
|
||||
const item = regiontree.value[i];
|
||||
if (ids?.includes(item.id)) {
|
||||
// addressarray.push(item);
|
||||
addressarray += ',' + item.label;
|
||||
addressarray += ');(' + item.label;
|
||||
if (item.children) {
|
||||
for (let j = 0; j < item.children.length; j++) {
|
||||
const arr = item.children[j];
|
||||
@ -732,7 +745,7 @@ const addressdata = (ids: string | null) => {
|
||||
}
|
||||
}
|
||||
console.log(addressarray, 'qqqq');
|
||||
return addressarray;
|
||||
return addressarray.substring(2) + ')';
|
||||
};
|
||||
//添加景点
|
||||
const addjingdain = () => {
|
Loading…
Reference in New Issue
Block a user