添加住宿管理
This commit is contained in:
parent
1c13daa605
commit
7e320b8a68
400
src/views/manage/accommodation/index.vue
Normal file
400
src/views/manage/accommodation/index.vue
Normal file
@ -0,0 +1,400 @@
|
|||||||
|
<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="id">
|
||||||
|
<el-input v-model="queryParams.id" placeholder="请输入住宿商家名称" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="发布状态" prop="tagId">
|
||||||
|
<!-- <el-input v-model="queryParams.tagId" placeholder="请输入标签" clearable @keyup.enter="handleQuery" /> -->
|
||||||
|
<el-select v-model="queryParams.tagId" placeholder="请选择发布状态" style="width: 240px" @keyup.enter="handleQuery">
|
||||||
|
<el-option v-for="item in statusoptions" :key="item.value" :label="item.label" :value="item.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:notebook:add']" type="primary" plain icon="Plus" @click="handleAdd">新增 </el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['manage:notebook:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['manage:notebook:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['manage:notebook:export']" type="warning" plain icon="Download"
|
||||||
|
@click="handleExport">导出 </el-button>
|
||||||
|
</el-col> -->
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="notebookList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column v-if="true" label="ID" align="center" prop="id" />
|
||||||
|
<el-table-column label="住宿商家名称" align="center" prop="title" />
|
||||||
|
<el-table-column label="商家图片" align="center" prop="cover">
|
||||||
|
<template #default="scope">
|
||||||
|
<image-preview :src="scope.row.cover" :width="50" :height="50" />
|
||||||
|
<!-- <image-preview :src="scope.row.productImageUrl" /> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商家地理位置" align="center" prop="cover" />
|
||||||
|
<el-table-column label="联系方式" align="center" prop="status" />
|
||||||
|
<el-table-column label="发布状态" align="center" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag v-if="scope.row.status == 0" type="info">未发布</el-tag>
|
||||||
|
<el-tag v-if="scope.row.status == 1" type="success">审核中</el-tag>
|
||||||
|
<el-tag v-if="scope.row.status == 2" type="primary">发布</el-tag>
|
||||||
|
|
||||||
|
<!-- <image-preview :src="scope.row.productImageUrl" /> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作人" align="center" prop="updateByName" show-overflow-tooltip />
|
||||||
|
<el-table-column label="操作时间" align="center" prop="updateTime" width="200px" />
|
||||||
|
<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:notebook:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-tooltip content="发布" placement="top">
|
||||||
|
<el-button v-hasPermi="['manage:notebook:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-tooltip content="删除" placement="top">
|
||||||
|
<el-button v-hasPermi="['manage:notebook: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="60%" append-to-body>
|
||||||
|
<el-form ref="notebookFormRef" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="住宿商家名称" prop="title">
|
||||||
|
<el-input v-model="form.title" placeholder="请输入住宿商家名称" style="width: 300px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话" prop="tagId">
|
||||||
|
<el-input v-model="form.tagId" placeholder="请输入联系电话" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商家照片" prop="cover">
|
||||||
|
<imageUpload :model-value="form.cover" :file-size="20" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="地理位置" prop="introduce">
|
||||||
|
<el-input v-model="searchLocation" type="text" placeholder="请输入地址信息" @keyup.enter="debouncedSearch" />
|
||||||
|
</el-form-item>
|
||||||
|
<tlbs-map
|
||||||
|
ref="map"
|
||||||
|
style="margin-left: 80px"
|
||||||
|
api-key="
|
||||||
|
6XFBZ-SAVLT-JGIX2-VOLMK-6S2H3-XUBGO"
|
||||||
|
:center="center"
|
||||||
|
:zoom="zoom"
|
||||||
|
:control="control"
|
||||||
|
@click="onClick"
|
||||||
|
>
|
||||||
|
<tlbs-multi-marker :geometries="geometries" :styles="styles" :options="mapoptions" />
|
||||||
|
</tlbs-map>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div style="display: flex; justify-content: space-between">
|
||||||
|
<div>
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">预 览</el-button>
|
||||||
|
<el-button @click="cancel">存草稿</el-button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">提 交</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 笔记详情-->
|
||||||
|
<el-dialog v-model="concentdialog.visible" title="笔记详情" width="50%" append-to-body>
|
||||||
|
<div>{{ form.title }}</div>
|
||||||
|
<div>{{ form.content }}</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Notebook" lang="ts">
|
||||||
|
import { listNotebook, getNotebook, delNotebook, addNotebook, updateNotebook } from '@/api/manage/notebook';
|
||||||
|
import { NotebookVO, NotebookQuery, NotebookForm } from '@/api/manage/notebook/types';
|
||||||
|
import { debounce } from '@/utils/debounce';
|
||||||
|
import { jsonp } from 'vue-jsonp';
|
||||||
|
const map = ref(null);
|
||||||
|
const center = ref({ lat: 39.145902, lng: 117.17546 });
|
||||||
|
const zoom = ref(20);
|
||||||
|
const onClick = (e: Event) => {
|
||||||
|
console.log(e);
|
||||||
|
};
|
||||||
|
const control = reactive({
|
||||||
|
scale: {},
|
||||||
|
zoom: {
|
||||||
|
position: 'topLeft'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const searchLocation = ref(''); // 搜索地点
|
||||||
|
|
||||||
|
const geometries = ref([{ styleId: 'marker', position: { lat: 39.145902, lng: 117.17546 } }]);
|
||||||
|
const styles = reactive({
|
||||||
|
marker: {
|
||||||
|
width: 20,
|
||||||
|
height: 30,
|
||||||
|
anchor: { x: 10, y: 30 }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const mapoptions = reactive({
|
||||||
|
minZoom: 5,
|
||||||
|
maxZoom: 20
|
||||||
|
});
|
||||||
|
//输入位置,搜索位置
|
||||||
|
const performSearch = async (text) => {
|
||||||
|
// 这里简单模拟延迟,模拟真实的异步请求耗时
|
||||||
|
// await new Promise((resolve) => setTimeout(resolve, 500));
|
||||||
|
// 假设这里根据输入的文本去查找匹配的数据,实际中替换成真实逻辑
|
||||||
|
if (text === '') {
|
||||||
|
console.log('搜索内容为空');
|
||||||
|
} else {
|
||||||
|
console.log('搜索内容为:', text);
|
||||||
|
// 调用腾讯地图API进行搜索,并展示在地图上
|
||||||
|
// geocoder(text).then((result) => {
|
||||||
|
// console.log(result);
|
||||||
|
// });
|
||||||
|
jsonp('https://apis.map.qq.com/ws/geocoder/v1', {
|
||||||
|
address: text,
|
||||||
|
key: '6XFBZ-SAVLT-JGIX2-VOLMK-6S2H3-XUBGO',
|
||||||
|
output: 'jsonp'
|
||||||
|
}).then((data) => {
|
||||||
|
console.log(data);
|
||||||
|
center.value.lat = data.result.location.lat;
|
||||||
|
center.value.lng = data.result.location.lng;
|
||||||
|
geometries.value = [{ styleId: 'marker', position: { lat: data.result.location.lat, lng: data.result.location.lng } }];
|
||||||
|
console.log(map.value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const debouncedSearch = debounce(performSearch, 300); // 创建防抖后的搜索函数,延迟设为300毫秒
|
||||||
|
|
||||||
|
// 监听输入框内容变化,调用防抖后的搜索函数
|
||||||
|
watch(searchLocation, (newValue) => {
|
||||||
|
debouncedSearch(newValue);
|
||||||
|
});
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
|
const notebookList = ref<NotebookVO[]>([]);
|
||||||
|
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 notebookFormRef = ref<ElFormInstance>();
|
||||||
|
const value = ref('');
|
||||||
|
|
||||||
|
const options = [
|
||||||
|
{
|
||||||
|
value: 'Option1',
|
||||||
|
label: 'Option1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'Option2',
|
||||||
|
label: 'Option2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'Option3',
|
||||||
|
label: 'Option3'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'Option4',
|
||||||
|
label: 'Option4'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'Option5',
|
||||||
|
label: 'Option5'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
const statusoptions = [
|
||||||
|
{
|
||||||
|
value: '1',
|
||||||
|
label: '全部'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '2',
|
||||||
|
label: '已发布'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '3',
|
||||||
|
label: '未发布'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
const dialog = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: ''
|
||||||
|
});
|
||||||
|
const concentdialog = reactive<DialogOption>({
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
const initFormData: NotebookForm = {
|
||||||
|
id: undefined,
|
||||||
|
userid: undefined,
|
||||||
|
title: undefined,
|
||||||
|
content: undefined,
|
||||||
|
cover: undefined,
|
||||||
|
status: undefined,
|
||||||
|
tagId: undefined
|
||||||
|
};
|
||||||
|
const data = reactive<PageData<NotebookForm, NotebookQuery>>({
|
||||||
|
form: { ...initFormData },
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
id: undefined,
|
||||||
|
userid: undefined,
|
||||||
|
title: undefined,
|
||||||
|
content: undefined,
|
||||||
|
cover: undefined,
|
||||||
|
status: undefined,
|
||||||
|
tagId: undefined,
|
||||||
|
params: {}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
id: [{ required: true, message: '笔记ID不能为空', trigger: 'blur' }],
|
||||||
|
title: [{ required: true, message: '攻略名称不能为空', trigger: 'blur' }],
|
||||||
|
content: [{ required: true, message: '攻略内容不能为空', trigger: 'blur' }],
|
||||||
|
cover: [{ required: true, message: '笔记封面不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '帐号状态不能为空', trigger: 'change' }],
|
||||||
|
tagId: [{ required: true, message: '标签不能为空', trigger: 'blur' }],
|
||||||
|
longitude: [{ required: true, message: '经度不能为空', trigger: 'blur' }],
|
||||||
|
latitude: [{ required: true, message: '纬度不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询笔记列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
const res = await listNotebook(queryParams.value);
|
||||||
|
notebookList.value = res.rows;
|
||||||
|
total.value = res.total;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 取消按钮 */
|
||||||
|
const cancel = () => {
|
||||||
|
reset();
|
||||||
|
dialog.visible = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData };
|
||||||
|
notebookFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
const handleSelectionChange = (selection: NotebookVO[]) => {
|
||||||
|
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?: NotebookVO) => {
|
||||||
|
reset();
|
||||||
|
const _id = row?.id || ids.value[0];
|
||||||
|
const res = await getNotebook(_id);
|
||||||
|
Object.assign(form.value, res.data);
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = '修改住宿商家';
|
||||||
|
};
|
||||||
|
const contenttext = async (row?: NotebookVO) => {
|
||||||
|
const _id = row?.id;
|
||||||
|
const res = await getNotebook(_id);
|
||||||
|
Object.assign(form.value, res.data);
|
||||||
|
concentdialog.visible = true;
|
||||||
|
};
|
||||||
|
/** 提交按钮 */
|
||||||
|
const submitForm = () => {
|
||||||
|
notebookFormRef.value?.validate(async (valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
buttonLoading.value = true;
|
||||||
|
if (form.value.id) {
|
||||||
|
await updateNotebook(form.value).finally(() => (buttonLoading.value = false));
|
||||||
|
} else {
|
||||||
|
await addNotebook(form.value).finally(() => (buttonLoading.value = false));
|
||||||
|
}
|
||||||
|
console.log(form.value.cover);
|
||||||
|
|
||||||
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
|
// dialog.visible = false;
|
||||||
|
await getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (row?: NotebookVO) => {
|
||||||
|
const _ids = row?.id || ids.value;
|
||||||
|
await proxy?.$modal.confirm('是否确认删除笔记编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||||
|
await delNotebook(_ids);
|
||||||
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
|
await getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = () => {
|
||||||
|
proxy?.download(
|
||||||
|
'manage/notebook/export',
|
||||||
|
{
|
||||||
|
...queryParams.value
|
||||||
|
},
|
||||||
|
`notebook_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
</script>
|
@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter"
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
:leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
@ -33,17 +32,16 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPermi="['manage:notebook:add']" type="primary" plain icon="Plus" @click="handleAdd">新增
|
<el-button v-hasPermi="['manage:notebook:add']" type="primary" plain icon="Plus" @click="handleAdd">新增 </el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['manage:notebook:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
||||||
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPermi="['manage:notebook:edit']" type="success" plain icon="Edit" :disabled="single"
|
<el-button v-hasPermi="['manage:notebook:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
||||||
@click="handleUpdate()">修改
|
>删除
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button v-hasPermi="['manage:notebook:remove']" type="danger" plain icon="Delete" :disabled="multiple"
|
|
||||||
@click="handleDelete()">删除
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
@ -68,42 +66,50 @@
|
|||||||
<el-table-column label="标签" align="center" prop="status" />
|
<el-table-column label="标签" align="center" prop="status" />
|
||||||
<el-table-column label="笔记详情" align="center" prop="tagId">
|
<el-table-column label="笔记详情" align="center" prop="tagId">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="text">查看详情</el-button>
|
<el-button type="text" @click="contenttext(scope.row)">查看详情</el-button>
|
||||||
<!-- <image-preview :src="scope.row.productImageUrl" /> -->
|
<!-- <image-preview :src="scope.row.productImageUrl" /> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="笔记评论数" align="center" prop="tagId">
|
<el-table-column label="笔记评论数" align="center" prop="commentCount">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="text">{{ scope.row.tagId }}</el-button>
|
<el-button type="text">{{ scope.row.commentCount }}</el-button>
|
||||||
<!-- <image-preview :src="scope.row.productImageUrl" /> -->
|
<!-- <image-preview :src="scope.row.productImageUrl" /> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="笔记点赞数" align="center" prop="tagId" />
|
<el-table-column label="笔记点赞数" align="center" prop="likeCount" />
|
||||||
<el-table-column label="发布状态" align="center" prop="tagId" />
|
<el-table-column label="发布状态" align="center" prop="status">
|
||||||
<el-table-column label="操作人" align="center" prop="tagId" />
|
<template #default="scope">
|
||||||
<el-table-column label="操作时间" align="center" prop="tagId" />
|
<el-tag v-if="scope.row.status == 0" type="info">未发布</el-tag>
|
||||||
|
<el-tag v-if="scope.row.status == 1" type="success">审核中</el-tag>
|
||||||
|
<el-tag v-if="scope.row.status == 2" type="primary">发布</el-tag>
|
||||||
|
|
||||||
|
<!-- <image-preview :src="scope.row.productImageUrl" /> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作人" align="center" prop="updateByName" show-overflow-tooltip />
|
||||||
|
<el-table-column label="操作时间" align="center" prop="updateTime" width="200px" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="修改" placement="top">
|
<el-tooltip content="编辑" placement="top">
|
||||||
<el-button v-hasPermi="['manage:notebook:edit']" link type="primary" icon="Edit"
|
<el-button v-hasPermi="['manage:notebook:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||||
@click="handleUpdate(scope.row)"></el-button>
|
</el-tooltip>
|
||||||
|
<el-tooltip content="发布" placement="top">
|
||||||
|
<el-button v-hasPermi="['manage:notebook:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="删除" placement="top">
|
<el-tooltip content="删除" placement="top">
|
||||||
<el-button v-hasPermi="['manage:notebook:remove']" link type="primary" icon="Delete"
|
<el-button v-hasPermi="['manage:notebook:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
||||||
@click="handleDelete(scope.row)"></el-button>
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
<pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
|
||||||
:total="total" @pagination="getList" />
|
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 添加或修改笔记对话框 -->
|
<!-- 添加或修改笔记对话框 -->
|
||||||
<el-dialog v-model="dialog.visible" :title="dialog.title" width="60%" append-to-body>
|
<el-dialog v-model="dialog.visible" :title="dialog.title" width="60%" append-to-body>
|
||||||
<el-form ref="notebookFormRef" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="notebookFormRef" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="笔记标题" prop="title">
|
<el-form-item label="笔记标题" prop="title">
|
||||||
<el-input v-model="form.title" placeholder="请输入攻略名称" style="width: 300px;" />
|
<el-input v-model="form.title" placeholder="请输入攻略名称" style="width: 300px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="笔记标签" prop="tagId">
|
<el-form-item label="笔记标签" prop="tagId">
|
||||||
<!-- <el-input v-model="form.tagId" placeholder="请输入标签" /> -->
|
<!-- <el-input v-model="form.tagId" placeholder="请输入标签" /> -->
|
||||||
@ -115,19 +121,31 @@
|
|||||||
<el-input v-model="form.tagId" placeholder="请输入标签" />
|
<el-input v-model="form.tagId" placeholder="请输入标签" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="笔记照片" prop="cover">
|
<el-form-item label="笔记照片" prop="cover">
|
||||||
<imageUpload :modelValue="form.cover" :fileSize="20" />
|
<imageUpload :model-value="form.cover" :file-size="20" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="笔记内容">
|
<el-form-item label="笔记内容">
|
||||||
<editor v-model="form.content" :min-height="192" />
|
<editor v-model="form.content" :min-height="192" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div style="display: flex;justify-content: space-between">
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
<div>
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">预 览</el-button>
|
||||||
|
<el-button @click="cancel">存草稿</el-button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">提 交</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!-- 笔记详情-->
|
||||||
|
<el-dialog v-model="concentdialog.visible" title="笔记详情" width="50%" append-to-body>
|
||||||
|
<div>{{ form.title }}</div>
|
||||||
|
<div>{{ form.content }}</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -148,49 +166,51 @@ const total = ref(0);
|
|||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const notebookFormRef = ref<ElFormInstance>();
|
const notebookFormRef = ref<ElFormInstance>();
|
||||||
const value = ref('')
|
const value = ref('');
|
||||||
|
|
||||||
const options = [
|
const options = [
|
||||||
{
|
{
|
||||||
value: 'Option1',
|
value: 'Option1',
|
||||||
label: 'Option1',
|
label: 'Option1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'Option2',
|
value: 'Option2',
|
||||||
label: 'Option2',
|
label: 'Option2'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'Option3',
|
value: 'Option3',
|
||||||
label: 'Option3',
|
label: 'Option3'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'Option4',
|
value: 'Option4',
|
||||||
label: 'Option4',
|
label: 'Option4'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'Option5',
|
value: 'Option5',
|
||||||
label: 'Option5',
|
label: 'Option5'
|
||||||
},
|
}
|
||||||
]
|
];
|
||||||
const statusoptions = [
|
const statusoptions = [
|
||||||
{
|
{
|
||||||
value: '1',
|
value: '1',
|
||||||
label: '全部',
|
label: '全部'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '2',
|
value: '2',
|
||||||
label: '已发布',
|
label: '已发布'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '3',
|
value: '3',
|
||||||
label: '未发布',
|
label: '未发布'
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
const dialog = reactive<DialogOption>({
|
const dialog = reactive<DialogOption>({
|
||||||
visible: false,
|
visible: false,
|
||||||
title: ''
|
title: ''
|
||||||
});
|
});
|
||||||
|
const concentdialog = reactive<DialogOption>({
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
const initFormData: NotebookForm = {
|
const initFormData: NotebookForm = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
userid: undefined,
|
userid: undefined,
|
||||||
@ -284,7 +304,12 @@ const handleUpdate = async (row?: NotebookVO) => {
|
|||||||
dialog.visible = true;
|
dialog.visible = true;
|
||||||
dialog.title = '修改笔记';
|
dialog.title = '修改笔记';
|
||||||
};
|
};
|
||||||
|
const contenttext = async (row?: NotebookVO) => {
|
||||||
|
const _id = row?.id;
|
||||||
|
const res = await getNotebook(_id);
|
||||||
|
Object.assign(form.value, res.data);
|
||||||
|
concentdialog.visible = true;
|
||||||
|
};
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
const submitForm = () => {
|
const submitForm = () => {
|
||||||
notebookFormRef.value?.validate(async (valid: boolean) => {
|
notebookFormRef.value?.validate(async (valid: boolean) => {
|
||||||
|
@ -95,7 +95,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-form-item label="添加行程" prop="intro">
|
<el-form-item label="添加行程" prop="intro">
|
||||||
<el-button type="primary" :icon="Plus">添加</el-button>
|
<el-button type="primary" :icon="Plus" @click="add">添加</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -111,11 +111,11 @@
|
|||||||
<!-- 添加或修改行程 -->
|
<!-- 添加或修改行程 -->
|
||||||
<el-dialog :title="addressdialog.title" v-model="addressdialog.visible" width="60%" append-to-body>
|
<el-dialog :title="addressdialog.title" v-model="addressdialog.visible" width="60%" append-to-body>
|
||||||
<el-form ref="articleFormRef" :model="form" :rules="rules" label-width="120px">
|
<el-form ref="articleFormRef" :model="form" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="路线标题" prop="isOpen">
|
<el-form-item label="标题" prop="isOpen">
|
||||||
<el-input v-model="form.isOpen" placeholder="请输入路线标题" style="width: 300px;" />
|
<el-input v-model="form.isOpen" placeholder="请输入标题" style="width: 300px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="路线封面" prop="attribute">
|
<el-form-item label="描述" prop="attribute">
|
||||||
<imageUpload :modelValue="form.attribute" :fileSize="20" />
|
<el-input v-model="form.isOpen" placeholder="请输入描述" style="width: 300px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="路线标签" prop="province">
|
<el-form-item label="路线标签" prop="province">
|
||||||
<!-- <el-input v-model="form.province" placeholder="请输入省code" /> -->
|
<!-- <el-input v-model="form.province" placeholder="请输入省code" /> -->
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["src/*"]
|
"@/*": ["src/*"]
|
||||||
},
|
},
|
||||||
|
// "types": ["@types/element-plus","volar/overrides","vite/client"],
|
||||||
"types": ["vite/client"],
|
"types": ["vite/client"],
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
|
Loading…
Reference in New Issue
Block a user