|
@@ -4,34 +4,62 @@
|
|
|
<!-- <el-icon :size="23" class="camera"><VideoCameraFilled /></el-icon> -->
|
|
<!-- <el-icon :size="23" class="camera"><VideoCameraFilled /></el-icon> -->
|
|
|
<span class="cameratxt">民宿管理/房型管理</span>
|
|
<span class="cameratxt">民宿管理/房型管理</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div>
|
|
|
|
|
|
|
+ <div class="scroll">
|
|
|
<div class="middle">
|
|
<div class="middle">
|
|
|
<div class="filter">
|
|
<div class="filter">
|
|
|
<div class="condition">
|
|
<div class="condition">
|
|
|
<span>关键字 : </span>
|
|
<span>关键字 : </span>
|
|
|
- <el-input :clearable="true" @clear="searchBtn" v-model="searchInput.keyWord" class="w-50 m-2"
|
|
|
|
|
- placeholder="请输入房型" style="width: 150px" />
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ :clearable="true"
|
|
|
|
|
+ @clear="searchBtn"
|
|
|
|
|
+ v-model="searchInput.keyWord"
|
|
|
|
|
+ class="w-50 m-2"
|
|
|
|
|
+ placeholder="请输入房型"
|
|
|
|
|
+ style="width: 150px"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
- <el-button style="margin-left: 20px" color="rgba(9, 101, 98, 1)" type="primary" class="search"
|
|
|
|
|
- @click="searchBtn"><el-icon>
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ style="margin-left: 20px"
|
|
|
|
|
+ color="rgba(9, 101, 98, 1)"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ class="search"
|
|
|
|
|
+ @click="searchBtn"
|
|
|
|
|
+ ><el-icon>
|
|
|
<Search />
|
|
<Search />
|
|
|
- </el-icon> <span>查询</span></el-button>
|
|
|
|
|
|
|
+ </el-icon>
|
|
|
|
|
+ <span>查询</span></el-button
|
|
|
|
|
+ >
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 按钮列表 -->
|
|
<!-- 按钮列表 -->
|
|
|
<div class="gongneng">
|
|
<div class="gongneng">
|
|
|
- <el-button type="primary" color="rgba(9, 101, 98, 1)" @click="addlist"><img src="@/assets/add.png"
|
|
|
|
|
- style="width: 14px; height: 14px; margin-right: 4px" alt="" /><span>添加房型</span></el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" color="rgba(9, 101, 98, 1)" @click="addlist"
|
|
|
|
|
+ ><img
|
|
|
|
|
+ src="@/assets/add.png"
|
|
|
|
|
+ style="width: 14px; height: 14px; margin-right: 4px"
|
|
|
|
|
+ alt=""
|
|
|
|
|
+ /><span>添加房型</span></el-button
|
|
|
|
|
+ >
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="footer" v-loading="loading">
|
|
<div class="footer" v-loading="loading">
|
|
|
- <el-table :row-class-name="tableRowClassName" :data="tableData.list" @selection-change="handleSelectionChange"
|
|
|
|
|
- style="width: 100%" :header-cell-style="{
|
|
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ :row-class-name="tableRowClassName"
|
|
|
|
|
+ :data="tableData.list"
|
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :header-cell-style="{
|
|
|
background: 'rgba(240, 243, 247, 1)',
|
|
background: 'rgba(240, 243, 247, 1)',
|
|
|
height: '50px',
|
|
height: '50px',
|
|
|
border: 0,
|
|
border: 0,
|
|
|
- }">
|
|
|
|
|
|
|
+ }"
|
|
|
|
|
+ >
|
|
|
<!-- <el-table-column align="center" type="selection" width="80" /> -->
|
|
<!-- <el-table-column align="center" type="selection" width="80" /> -->
|
|
|
- <el-table-column width="150" align="center " type="index" label="序号" />
|
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ width="150"
|
|
|
|
|
+ align="center "
|
|
|
|
|
+ type="index"
|
|
|
|
|
+ label="序号"
|
|
|
|
|
+ />
|
|
|
<el-table-column align="center" prop="hName" label="房型" />
|
|
<el-table-column align="center" prop="hName" label="房型" />
|
|
|
<el-table-column align="center" prop="price" label="房费(元)" />
|
|
<el-table-column align="center" prop="price" label="房费(元)" />
|
|
|
<el-table-column align="center" prop="number" label="数量" />
|
|
<el-table-column align="center" prop="number" label="数量" />
|
|
@@ -40,8 +68,16 @@
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<div class="edit">
|
|
<div class="edit">
|
|
|
<div class="look" @click="edit(scope.row)">编辑</div>
|
|
<div class="look" @click="edit(scope.row)">编辑</div>
|
|
|
- <el-popconfirm width="220" confirm-button-text="确认" cancel-button-text="取消" :icon="InfoFilled"
|
|
|
|
|
- icon-color="#f89626" title="是否删除此房型?" @confirm="del(scope.row)" @cancel="cancelEvent">
|
|
|
|
|
|
|
+ <el-popconfirm
|
|
|
|
|
+ width="220"
|
|
|
|
|
+ confirm-button-text="确认"
|
|
|
|
|
+ cancel-button-text="取消"
|
|
|
|
|
+ :icon="InfoFilled"
|
|
|
|
|
+ icon-color="#f89626"
|
|
|
|
|
+ title="是否删除此房型?"
|
|
|
|
|
+ @confirm="del(scope.row)"
|
|
|
|
|
+ @cancel="cancelEvent"
|
|
|
|
|
+ >
|
|
|
<template #reference>
|
|
<template #reference>
|
|
|
<div class="del">删除</div>
|
|
<div class="del">删除</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -51,11 +87,28 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<!-- 添加房型弹窗 -->
|
|
<!-- 添加房型弹窗 -->
|
|
|
- <el-dialog class="addStaff" v-model="addDialogVisible" :close-on-click-modal="false"
|
|
|
|
|
- :close-on-press-escape="false" :title="dialongTitle" align-center width="900" :before-close="cancelAdd">
|
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ class="addStaff"
|
|
|
|
|
+ v-model="addDialogVisible"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ :close-on-press-escape="false"
|
|
|
|
|
+ :title="dialongTitle"
|
|
|
|
|
+ align-center
|
|
|
|
|
+ width="900"
|
|
|
|
|
+ :before-close="cancelAdd"
|
|
|
|
|
+ >
|
|
|
<div class="slider">
|
|
<div class="slider">
|
|
|
- <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="100px" class="demo-ruleForm"
|
|
|
|
|
- size="default" label-position="left" status-icon :inline="true">
|
|
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ ref="ruleFormRef"
|
|
|
|
|
+ :model="ruleForm"
|
|
|
|
|
+ :rules="rules"
|
|
|
|
|
+ label-width="100px"
|
|
|
|
|
+ class="demo-ruleForm"
|
|
|
|
|
+ size="default"
|
|
|
|
|
+ label-position="left"
|
|
|
|
|
+ status-icon
|
|
|
|
|
+ :inline="true"
|
|
|
|
|
+ >
|
|
|
<div class="titles"><span>房型信息</span></div>
|
|
<div class="titles"><span>房型信息</span></div>
|
|
|
<div class="form_item tag">
|
|
<div class="form_item tag">
|
|
|
<div class="items">
|
|
<div class="items">
|
|
@@ -65,11 +118,22 @@
|
|
|
<div class="img img1">
|
|
<div class="img img1">
|
|
|
<div class="updateImg">
|
|
<div class="updateImg">
|
|
|
<div class="imglist" v-if="fileList.list.length">
|
|
<div class="imglist" v-if="fileList.list.length">
|
|
|
- <div class="imgItem" v-for="i in fileList.list" :key="i.id">
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="imgItem"
|
|
|
|
|
+ v-for="i in fileList.list"
|
|
|
|
|
+ :key="i.id"
|
|
|
|
|
+ >
|
|
|
<img :src="i.url" alt="" />
|
|
<img :src="i.url" alt="" />
|
|
|
<div class="lookImg">
|
|
<div class="lookImg">
|
|
|
- <img src="@/assets/lookImg.png" alt="" @click="lookImg(i)" />
|
|
|
|
|
- <div class="delimg" @click="handleRemove(i)"></div>
|
|
|
|
|
|
|
+ <img
|
|
|
|
|
+ src="@/assets/lookImg.png"
|
|
|
|
|
+ alt=""
|
|
|
|
|
+ @click="lookImg(i)"
|
|
|
|
|
+ />
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="delimg"
|
|
|
|
|
+ @click="handleRemove(i)"
|
|
|
|
|
+ ></div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -77,11 +141,25 @@
|
|
|
<img src="#" alt="" />
|
|
<img src="#" alt="" />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <el-upload class="avatar-uploader" action="" list-type="picture" :on-preview="handlePreview"
|
|
|
|
|
- :on-change="handleChange" :http-request="handleUpload" :before-upload="beforeAvatarUpload">
|
|
|
|
|
|
|
+ <el-upload
|
|
|
|
|
+ class="avatar-uploader"
|
|
|
|
|
+ action=""
|
|
|
|
|
+ list-type="picture"
|
|
|
|
|
+ :on-preview="handlePreview"
|
|
|
|
|
+ :on-change="handleChange"
|
|
|
|
|
+ :http-request="handleUpload"
|
|
|
|
|
+ :before-upload="beforeAvatarUpload"
|
|
|
|
|
+ >
|
|
|
<template #trigger>
|
|
<template #trigger>
|
|
|
- <el-button type="primary" color="rgba(9, 101, 98, 1)" @click="updateImg">上传图片</el-button>
|
|
|
|
|
- <span class="zhu">(注:最多可上传6张图片,建议按16:9的比例)</span>
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ color="rgba(9, 101, 98, 1)"
|
|
|
|
|
+ @click="updateImg"
|
|
|
|
|
+ >上传图片</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="zhu"
|
|
|
|
|
+ >(注:最多可上传6张图片,建议按16:9的比例)</span
|
|
|
|
|
+ >
|
|
|
</template>
|
|
</template>
|
|
|
<!-- <template #tip>
|
|
<!-- <template #tip>
|
|
|
<div class="el-upload__tip">
|
|
<div class="el-upload__tip">
|
|
@@ -103,26 +181,46 @@
|
|
|
placeholder="请输入房型名称"
|
|
placeholder="请输入房型名称"
|
|
|
clearable
|
|
clearable
|
|
|
/> -->
|
|
/> -->
|
|
|
- <el-select v-model="ruleForm.hName" class="m-2" placeholder="请选择民宿类型">
|
|
|
|
|
- <el-option v-for="i in houseType" :label="i.name" :value="i.name" />
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="ruleForm.hName"
|
|
|
|
|
+ class="m-2"
|
|
|
|
|
+ placeholder="请选择民宿类型"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="i in houseType"
|
|
|
|
|
+ :label="i.name"
|
|
|
|
|
+ :value="i.name"
|
|
|
|
|
+ />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="items">
|
|
<div class="items">
|
|
|
<el-form-item label="房费 :" prop="price">
|
|
<el-form-item label="房费 :" prop="price">
|
|
|
- <el-input v-model="ruleForm.price" placeholder="请输入房费" clearable />
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="ruleForm.price"
|
|
|
|
|
+ placeholder="请输入房费"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form_item">
|
|
<div class="form_item">
|
|
|
<div class="items">
|
|
<div class="items">
|
|
|
<el-form-item label="数量 :" prop="number">
|
|
<el-form-item label="数量 :" prop="number">
|
|
|
- <el-input v-model="ruleForm.number" placeholder="请输入此房型数量" clearable />
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="ruleForm.number"
|
|
|
|
|
+ placeholder="请输入此房型数量"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="items">
|
|
<div class="items">
|
|
|
<el-form-item label="面积 :" prop="hAreas">
|
|
<el-form-item label="面积 :" prop="hAreas">
|
|
|
- <el-input v-model="ruleForm.hAreas" placeholder="请输入面积大小" clearable></el-input>
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="ruleForm.hAreas"
|
|
|
|
|
+ placeholder="请输入面积大小"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ ></el-input>
|
|
|
㎡
|
|
㎡
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</div>
|
|
</div>
|
|
@@ -141,39 +239,66 @@
|
|
|
<div class="del"></div>
|
|
<div class="del"></div>
|
|
|
</div> -->
|
|
</div> -->
|
|
|
<div class="li">
|
|
<div class="li">
|
|
|
- <div class="li_items" v-for="i in ruleForm.houseNumbers" :key="i.id">
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="li_items"
|
|
|
|
|
+ v-for="i in ruleForm.houseNumbers"
|
|
|
|
|
+ :key="i.id"
|
|
|
|
|
+ >
|
|
|
<!-- <span>{{ i.numberName }}</span> -->
|
|
<!-- <span>{{ i.numberName }}</span> -->
|
|
|
- <div class="li_item" :class="i.numberName ? '' : 'li_item_warning'">
|
|
|
|
|
- <el-input v-model="i.numberName" placeholder="房间号" @input="roomNumber" />
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="li_item"
|
|
|
|
|
+ :class="i.numberName ? '' : 'li_item_warning'"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="i.numberName"
|
|
|
|
|
+ placeholder="房间号"
|
|
|
|
|
+ @input="roomNumber"
|
|
|
|
|
+ />
|
|
|
<div class="del" @click="delRoom(i)"></div>
|
|
<div class="del" @click="delRoom(i)"></div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="warning" v-if="!i.numberName">请填写房间号</div>
|
|
|
|
|
|
|
+ <div class="warning" v-if="!i.numberName">
|
|
|
|
|
+ 请填写房间号
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="addRoom" @click="addRoom">
|
|
<div class="addRoom" @click="addRoom">
|
|
|
<img src="@/assets/addRoom.png" alt="" />
|
|
<img src="@/assets/addRoom.png" alt="" />
|
|
|
<span>新增房间</span>
|
|
<span>新增房间</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="titles">
|
|
<div class="titles">
|
|
|
- <span>房型配置</span><span>(最多可选择5个描述展示,管理端房型配置管理)</span>
|
|
|
|
|
|
|
+ <span>房型配置</span
|
|
|
|
|
+ ><span>(最多可选择5个描述展示,管理端房型配置管理)</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form_item">
|
|
<div class="form_item">
|
|
|
<div class="items">
|
|
<div class="items">
|
|
|
<el-form-item label="选择配置 :" prop="hConfig">
|
|
<el-form-item label="选择配置 :" prop="hConfig">
|
|
|
- <el-checkbox-group @change="checkHouse" v-model="checkedCities" :max="5">
|
|
|
|
|
- <el-checkbox v-for="city in cities" :key="city.id" :label="city.id">{{ city.name }}</el-checkbox>
|
|
|
|
|
|
|
+ <el-checkbox-group
|
|
|
|
|
+ @change="checkHouse"
|
|
|
|
|
+ v-model="checkedCities"
|
|
|
|
|
+ :max="5"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-checkbox
|
|
|
|
|
+ v-for="city in cities"
|
|
|
|
|
+ :key="city.id"
|
|
|
|
|
+ :label="city.id"
|
|
|
|
|
+ >{{ city.name }}</el-checkbox
|
|
|
|
|
+ >
|
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<el-form-item class="options">
|
|
<el-form-item class="options">
|
|
|
- <el-button color="rgba(9, 101, 98, 1)" class="queding" type="primary" @click="submitAdd(ruleFormRef)">
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ color="rgba(9, 101, 98, 1)"
|
|
|
|
|
+ class="queding"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="submitAdd(ruleFormRef)"
|
|
|
|
|
+ >
|
|
|
确认
|
|
确认
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button @click="cancelAdd(ruleFormRef)">取消</el-button>
|
|
<el-button @click="cancelAdd(ruleFormRef)">取消</el-button>
|
|
@@ -186,12 +311,25 @@
|
|
|
<!-- 分页组件 -->
|
|
<!-- 分页组件 -->
|
|
|
<div class="pageSize">
|
|
<div class="pageSize">
|
|
|
<span></span>
|
|
<span></span>
|
|
|
- <el-pagination background :current-page="currentPage" :page-size="pageSize"
|
|
|
|
|
- layout="total, prev, pager, next, jumper, slot" :total="total" @update:current-page="handleCurrentChange" />
|
|
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ background
|
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
|
+ layout="total, prev, pager, next, jumper, slot"
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ @update:current-page="handleCurrentChange"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="bgImg" v-if="bgImg">
|
|
<div class="bgImg" v-if="bgImg">
|
|
|
- <el-carousel @click="bgImg = false" ref="bgImgs" indicator-position arrow="always" :autoplay="false" trigger>
|
|
|
|
|
|
|
+ <el-carousel
|
|
|
|
|
+ @click="bgImg = false"
|
|
|
|
|
+ ref="bgImgs"
|
|
|
|
|
+ indicator-position
|
|
|
|
|
+ arrow="always"
|
|
|
|
|
+ :autoplay="false"
|
|
|
|
|
+ trigger
|
|
|
|
|
+ >
|
|
|
<el-carousel-item v-for="item in bgImgList" :key="item.id">
|
|
<el-carousel-item v-for="item in bgImgList" :key="item.id">
|
|
|
<img :src="item.url" alt="" />
|
|
<img :src="item.url" alt="" />
|
|
|
</el-carousel-item>
|
|
</el-carousel-item>
|
|
@@ -201,7 +339,14 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, reactive, watch, nextTick, onBeforeMount, onUnmounted } from "vue";
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ ref,
|
|
|
|
|
+ reactive,
|
|
|
|
|
+ watch,
|
|
|
|
|
+ nextTick,
|
|
|
|
|
+ onBeforeMount,
|
|
|
|
|
+ onUnmounted,
|
|
|
|
|
+} from "vue";
|
|
|
import { useRouter } from "vue-router";
|
|
import { useRouter } from "vue-router";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import { Calendar } from "@element-plus/icons-vue";
|
|
import { Calendar } from "@element-plus/icons-vue";
|
|
@@ -210,6 +355,8 @@ import { dayjs } from "element-plus";
|
|
|
import lodash from "lodash";
|
|
import lodash from "lodash";
|
|
|
import axios from "axios";
|
|
import axios from "axios";
|
|
|
import { useStore } from "vuex";
|
|
import { useStore } from "vuex";
|
|
|
|
|
+import COS from "cos-js-sdk-v5";
|
|
|
|
|
+
|
|
|
const store = useStore();
|
|
const store = useStore();
|
|
|
const api = ref("");
|
|
const api = ref("");
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -418,20 +565,66 @@ const handleUpload = async (file) => {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
console.log(file, "2222");
|
|
console.log(file, "2222");
|
|
|
- let data = new FormData();
|
|
|
|
|
- data.set("files", file.file);
|
|
|
|
|
- let res = await axios({
|
|
|
|
|
- method: "post",
|
|
|
|
|
- url: api.value + "/file/cos/upload",
|
|
|
|
|
- headers: {},
|
|
|
|
|
- data: data,
|
|
|
|
|
|
|
+ const cos = new COS({
|
|
|
|
|
+ SecretId: "AKIDJSP9gz469yZv77tQjotsgHguvjIgtvkL",
|
|
|
|
|
+ SecretKey: "b3MVRD1g8RYS9g195oMkvukQvDKZfbOz",
|
|
|
|
|
+ SecurityToken: "1320402385",
|
|
|
|
|
+ Bucket: "jinganminsu-1320402385",
|
|
|
|
|
+ Region: "ap-nanjing",
|
|
|
});
|
|
});
|
|
|
- console.log(res, "图片上传成功");
|
|
|
|
|
- if (res.data.code == 1) {
|
|
|
|
|
- // res.data.uid = file.file.uid;
|
|
|
|
|
- fileList.list.push({ url: res.data.data, uid: file.file.uid });
|
|
|
|
|
- ruleForm.fileListJson = fileList.list;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const files = file.file;
|
|
|
|
|
+ console.log(files, "files文件");
|
|
|
|
|
+
|
|
|
|
|
+ const key = file.file.name; // 设置上传到 COS 后的文件名
|
|
|
|
|
+
|
|
|
|
|
+ cos.putObject(
|
|
|
|
|
+ {
|
|
|
|
|
+ Bucket: "jinganminsu-1320402385",
|
|
|
|
|
+ Region: "ap-nanjing",
|
|
|
|
|
+ Key: key,
|
|
|
|
|
+ Body: files,
|
|
|
|
|
+ onProgress: function (progressData) {
|
|
|
|
|
+ console.log(JSON.stringify(progressData));
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ function (err, data) {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ console.error(err, "请求失败");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.log(data, "请求成功");
|
|
|
|
|
+ // ruleForm.coverImg = "https://" + data.Location;
|
|
|
|
|
+ // let arr = {
|
|
|
|
|
+ // uid: file.file.uid,
|
|
|
|
|
+ // url: "https://" + data.Location,
|
|
|
|
|
+ // };
|
|
|
|
|
+
|
|
|
|
|
+ // fileList.list = fileList.list.concat([arr]);
|
|
|
|
|
+ // ruleForm.fileListJson = fileList.list;
|
|
|
|
|
+ // 成功
|
|
|
|
|
+ // res.data.uid = file.file.uid;
|
|
|
|
|
+ fileList.list.push({
|
|
|
|
|
+ url: "https://" + data.Location,
|
|
|
|
|
+ uid: file.file.uid,
|
|
|
|
|
+ });
|
|
|
|
|
+ ruleForm.fileListJson = fileList.list;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ // let data = new FormData();
|
|
|
|
|
+ // data.set("files", file.file);
|
|
|
|
|
+ // let res = await axios({
|
|
|
|
|
+ // method: "post",
|
|
|
|
|
+ // url: api.value + "/file/cos/upload",
|
|
|
|
|
+ // headers: {},
|
|
|
|
|
+ // data: data,
|
|
|
|
|
+ // });
|
|
|
|
|
+ // console.log(res, "图片上传成功");
|
|
|
|
|
+ // if (res.data.code == 1) {
|
|
|
|
|
+ // // res.data.uid = file.file.uid;
|
|
|
|
|
+ // fileList.list.push({ url: res.data.data, uid: file.file.uid });
|
|
|
|
|
+ // ruleForm.fileListJson = fileList.list;
|
|
|
|
|
+ // }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
//添加房型 (--------------------------------------)
|
|
//添加房型 (--------------------------------------)
|
|
@@ -521,24 +714,26 @@ watch(
|
|
|
(newVal, oldVal) => {
|
|
(newVal, oldVal) => {
|
|
|
console.log(newVal, "监听房间数量");
|
|
console.log(newVal, "监听房间数量");
|
|
|
if (ruleForm.number <= 999) {
|
|
if (ruleForm.number <= 999) {
|
|
|
- let arr = []
|
|
|
|
|
|
|
+ let arr = [];
|
|
|
if (newVal > 0) {
|
|
if (newVal > 0) {
|
|
|
for (let i = 0; i < newVal; i++) {
|
|
for (let i = 0; i < newVal; i++) {
|
|
|
arr[i] = {
|
|
arr[i] = {
|
|
|
numberName: "",
|
|
numberName: "",
|
|
|
- id: Math.random().toString(36).substr(3, i + 1),
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ id: Math.random()
|
|
|
|
|
+ .toString(36)
|
|
|
|
|
+ .substr(3, i + 1),
|
|
|
|
|
+ };
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
arr.forEach((item, index) => {
|
|
arr.forEach((item, index) => {
|
|
|
ruleForm.houseNumbers.forEach((i, ind) => {
|
|
ruleForm.houseNumbers.forEach((i, ind) => {
|
|
|
if (index == ind) {
|
|
if (index == ind) {
|
|
|
- item.numberName = i.numberName
|
|
|
|
|
- item.id = i.id
|
|
|
|
|
|
|
+ item.numberName = i.numberName;
|
|
|
|
|
+ item.id = i.id;
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- ruleForm.houseNumbers = arr
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ ruleForm.houseNumbers = arr;
|
|
|
console.log(arr, "根据数量添加空房间");
|
|
console.log(arr, "根据数量添加空房间");
|
|
|
} else {
|
|
} else {
|
|
|
ElMessage({
|
|
ElMessage({
|
|
@@ -548,10 +743,10 @@ watch(
|
|
|
center: true,
|
|
center: true,
|
|
|
});
|
|
});
|
|
|
console.log(newVal.slice(0, 3));
|
|
console.log(newVal.slice(0, 3));
|
|
|
- ruleForm.number = newVal.slice(0, 3)
|
|
|
|
|
|
|
+ ruleForm.number = newVal.slice(0, 3);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-)
|
|
|
|
|
|
|
+);
|
|
|
|
|
|
|
|
// 新增房间号
|
|
// 新增房间号
|
|
|
const addRoom = () => {
|
|
const addRoom = () => {
|
|
@@ -562,7 +757,7 @@ const addRoom = () => {
|
|
|
};
|
|
};
|
|
|
ruleForm.houseNumbers.push(arr);
|
|
ruleForm.houseNumbers.push(arr);
|
|
|
if (ruleForm.houseNumbers.length > 0) {
|
|
if (ruleForm.houseNumbers.length > 0) {
|
|
|
- ruleForm.number = ruleForm.houseNumbers.length
|
|
|
|
|
|
|
+ ruleForm.number = ruleForm.houseNumbers.length;
|
|
|
}
|
|
}
|
|
|
// console.log(ruleForm.houseNumbers.length, "房间数量");
|
|
// console.log(ruleForm.houseNumbers.length, "房间数量");
|
|
|
};
|
|
};
|
|
@@ -572,9 +767,9 @@ const delRoom = (i) => {
|
|
|
return i.id != item.id;
|
|
return i.id != item.id;
|
|
|
});
|
|
});
|
|
|
if (ruleForm.houseNumbers.length > 0) {
|
|
if (ruleForm.houseNumbers.length > 0) {
|
|
|
- ruleForm.number = ruleForm.houseNumbers.length
|
|
|
|
|
|
|
+ ruleForm.number = ruleForm.houseNumbers.length;
|
|
|
} else {
|
|
} else {
|
|
|
- ruleForm.number = ""
|
|
|
|
|
|
|
+ ruleForm.number = "";
|
|
|
}
|
|
}
|
|
|
// console.log(ruleForm.houseNumbers.length, "房间数量");
|
|
// console.log(ruleForm.houseNumbers.length, "房间数量");
|
|
|
};
|
|
};
|
|
@@ -829,8 +1024,9 @@ onUnmounted(() => {
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
.content-box {
|
|
.content-box {
|
|
|
- width: 97.5%;
|
|
|
|
|
- height: 89%;
|
|
|
|
|
|
|
+ min-width: 1000px;
|
|
|
|
|
+ width: calc(100vw - 240px);
|
|
|
|
|
+ height: calc(100vh - 105px);
|
|
|
margin: 20px auto;
|
|
margin: 20px auto;
|
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
@@ -842,7 +1038,7 @@ onUnmounted(() => {
|
|
|
// width: calc(100wh - 40px);
|
|
// width: calc(100wh - 40px);
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- height: 60px;
|
|
|
|
|
|
|
+
|
|
|
margin: 0 30px;
|
|
margin: 0 30px;
|
|
|
border-bottom: 1px solid #ccc;
|
|
border-bottom: 1px solid #ccc;
|
|
|
color: rgb(0, 0, 0);
|
|
color: rgb(0, 0, 0);
|
|
@@ -850,7 +1046,9 @@ onUnmounted(() => {
|
|
|
font-weight: 600;
|
|
font-weight: 600;
|
|
|
|
|
|
|
|
span {
|
|
span {
|
|
|
- margin-right: 20px;
|
|
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ height: 60px;
|
|
|
|
|
+ line-height: 60px;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -858,7 +1056,10 @@ onUnmounted(() => {
|
|
|
color: rgba(111, 182, 184, 1);
|
|
color: rgba(111, 182, 184, 1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ .scroll {
|
|
|
|
|
+ height: calc(100% - 61px);
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+ }
|
|
|
.middle {
|
|
.middle {
|
|
|
width: 96%;
|
|
width: 96%;
|
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|
|
@@ -934,11 +1135,11 @@ onUnmounted(() => {
|
|
|
|
|
|
|
|
.footer {
|
|
.footer {
|
|
|
width: 96%;
|
|
width: 96%;
|
|
|
- height: 550px;
|
|
|
|
|
|
|
+ // height: 550px;
|
|
|
margin: 10px auto 30px;
|
|
margin: 10px auto 30px;
|
|
|
|
|
|
|
|
.el-table--fit {
|
|
.el-table--fit {
|
|
|
- height: 100%;
|
|
|
|
|
|
|
+ // height: 100%;
|
|
|
|
|
|
|
|
:deep(.el-table__header-wrapper) {
|
|
:deep(.el-table__header-wrapper) {
|
|
|
background-color: #000;
|
|
background-color: #000;
|
|
@@ -1047,7 +1248,6 @@ onUnmounted(() => {
|
|
|
width: 720px;
|
|
width: 720px;
|
|
|
|
|
|
|
|
.el-upload {
|
|
.el-upload {
|
|
|
-
|
|
|
|
|
// margin-top: 20px;
|
|
// margin-top: 20px;
|
|
|
.zhu {
|
|
.zhu {
|
|
|
color: rgba(212, 48, 48, 1);
|
|
color: rgba(212, 48, 48, 1);
|
|
@@ -1203,7 +1403,6 @@ onUnmounted(() => {
|
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
.li_items {
|
|
.li_items {
|
|
|
-
|
|
|
|
|
// span {
|
|
// span {
|
|
|
// margin-right: 40px;
|
|
// margin-right: 40px;
|
|
|
// }
|
|
// }
|
|
@@ -1323,7 +1522,6 @@ onUnmounted(() => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.el-pagination {
|
|
.el-pagination {
|
|
|
-
|
|
|
|
|
// width: 1600px;
|
|
// width: 1600px;
|
|
|
:deep(.el-pagination__total) {
|
|
:deep(.el-pagination__total) {
|
|
|
color: #000;
|
|
color: #000;
|