bug提交

This commit is contained in:
zhangzhuliang 2022-08-17 17:33:57 +08:00
parent 080682f6b7
commit 9eaa4ca9bb
3 changed files with 243 additions and 27 deletions

View File

@ -65,6 +65,8 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog <el-dialog
:destroy-on-close="true"
:close-on-click-modal="false"
@close="outDialog" @close="outDialog"
:title=" :title="
flge === 'add' flge === 'add'
@ -104,21 +106,24 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="会议室面积" label="会议室面积(m²)"
prop="area" prop="area"
:label-width="formLabelWidth" :label-width="formLabelWidth"
> >
<el-input v-model="ruleForm.area" style="width: 90%"></el-input> <el-input
v-model.number="ruleForm.area"
style="width: 90%"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="可容纳人数" label="可容纳人数(人)"
prop="capacity" prop="capacity"
:label-width="formLabelWidth" :label-width="formLabelWidth"
> >
<el-input <el-input
v-model="ruleForm.capacity" v-model.number="ruleForm.capacity"
style="width: 90%" style="width: 90%"
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -144,7 +149,7 @@
> >
<div v-if="flge != 'look'"> <div v-if="flge != 'look'">
<span slot="tip" class="el-upload__tip"> <span slot="tip" class="el-upload__tip">
支持图片类型且不超过500kb 支持图片jpgjpegpng类型只能上传一张图片且不超过100MB
</span> </span>
</div> </div>
<!-- :file-list="fileList" --> <!-- :file-list="fileList" -->
@ -156,6 +161,7 @@
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:on-success="onSuccess" :on-success="onSuccess"
:on-remove="onRemove" :on-remove="onRemove"
:on-exceed="beforeUpload"
:file-list="fileList" :file-list="fileList"
list-type="picture-card" list-type="picture-card"
:limit="1" :limit="1"
@ -240,13 +246,19 @@ export default {
], ],
area: [ area: [
{ required: true, message: '请输入会议室面积', trigger: 'blur' }, { required: true, message: '请输入会议室面积', trigger: 'blur' },
{ min: 1, trigger: 'blur' }, { min: 1, type: 'number', trigger: 'blur' },
], ],
description: [ description: [
{ required: true, message: '请填写描述内容', trigger: 'blur' }, { required: true, message: '请填写描述内容', trigger: 'blur' },
{
min: 1,
max: 500,
message: '长度在 1 到 500 个字符',
trigger: 'blur',
},
], ],
}, },
formLabelWidth: '100px', formLabelWidth: '120px',
checkImgSuccess: true, checkImgSuccess: true,
dialogVisible: false, dialogVisible: false,
flge: '', flge: '',
@ -285,11 +297,21 @@ export default {
this.dialogImageUrl = file.url this.dialogImageUrl = file.url
this.dialogVisible = true this.dialogVisible = true
}, },
//
beforeUpload(file, fileList) {
this.$message.error('最多只能上传一张图片!')
},
// //
onSuccess(response, file, fileList) { onSuccess(response, file, fileList) {
const isLt2M = file.size / 1024 / 1024 < 100
if (!isLt2M) {
this.$message.error('上传图片大小不能超过100MB')
this.fileList = []
} else {
this.ruleForm.pic = response.data this.ruleForm.pic = response.data
// this.$refs.ruleForm.clearValidate() // // this.$refs.ruleForm.clearValidate() //
this.checkImgSuccess = true this.checkImgSuccess = true
}
}, },
// //
onRemove(file, fileList) { onRemove(file, fileList) {
@ -302,13 +324,16 @@ export default {
}, },
// //
submitForm(formName, i) { submitForm(formName, i) {
console.log(i, 9999999)
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
if (i === 'add') { if (i === 'add') {
this.dialogFormVisible = false this.dialogFormVisible = false
this.$http.post('/meeting', this.ruleForm).then(({ data: res }) => { this.$http.post('/meeting', this.ruleForm).then(({ data: res }) => {
if (res.msg === 'success') {
this.queryData() this.queryData()
} else {
this.$message.error('保存接口调用失败')
}
}) })
} else if (i === 'edit') { } else if (i === 'edit') {
this.dialogFormVisible = false this.dialogFormVisible = false
@ -356,11 +381,25 @@ export default {
}, },
// //
taskDelete(row) { taskDelete(row) {
console.log(row, '点击了删除') this.$confirm('此操作将永久删除该会议室, 是否继续?', '提示', {
this.$http confirmButtonText: '确定',
.put(`/meeting`, { delFlag: 1, id: row.id }) cancelButtonText: '取消',
.then(({ data: res }) => { type: 'warning',
})
.then(() => {
this.$http.put(`/meeting`, { delFlag: 1, id: row.id }).then(() => {
this.queryData() this.queryData()
this.$message({
type: 'success',
message: '删除成功!',
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
})
}) })
}, },
// //
@ -378,4 +417,8 @@ export default {
::v-deep .el-dialog__footer { ::v-deep .el-dialog__footer {
text-align: center; text-align: center;
} }
::v-deep .el-image {
width: 100%;
height: 100%;
}
</style> </style>

View File

@ -5,7 +5,9 @@
* @LastEditTime: 2022-08-06 15:00:49 * @LastEditTime: 2022-08-06 15:00:49
* @Description: 告诉大家这是什么 * @Description: 告诉大家这是什么
*/ */
import { createApp } from 'vue' import {
createApp
} from 'vue'
import Antd from 'ant-design-vue' import Antd from 'ant-design-vue'
import mitt from 'mitt' import mitt from 'mitt'
import App from './App' import App from './App'
@ -15,7 +17,8 @@ import store from './store'
import 'ant-design-vue/dist/antd.css' import 'ant-design-vue/dist/antd.css'
import '@/vab' import '@/vab'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import * as moment from 'moment' import * as moment from "moment"
import "dayjs/locale/zh-cn";
import vue3videoPlay from 'vue3-video-play-emiyagm' // import vue3videoPlay from 'vue3-video-play-emiyagm' //
import 'vue3-video-play-emiyagm/dist/style.css' // css import 'vue3-video-play-emiyagm/dist/style.css' // css
import ElementPlus from 'element-plus' import ElementPlus from 'element-plus'

View File

@ -78,11 +78,17 @@
v-model:value="roomCreateTime" v-model:value="roomCreateTime"
placeholder="开始时间" placeholder="开始时间"
value-format="HH:mm:ss" value-format="HH:mm:ss"
:disabledHours="disabledStartHours"
:disabledMinutes="disabledStartMinutes"
:disabledSeconds="disabledStartSeconds"
/> />
<a-time-picker <a-time-picker
v-model:value="roomEndTime" v-model:value="roomEndTime"
placeholder="结束时间" placeholder="结束时间"
value-format="HH:mm:ss" value-format="HH:mm:ss"
:disabledHours="disabledEndHours"
:disabledMinutes="disabledEndMinutes"
:disabledSeconds="disabledEndSeconds"
/> />
</a-space> </a-space>
</div> </div>
@ -102,8 +108,8 @@
<div class="topContent">{{ item.name }}</div> <div class="topContent">{{ item.name }}</div>
<div class="centerContent"> <div class="centerContent">
<span>房间号{{ item.num }}</span> <span>房间号{{ item.num }}</span>
<span>可容纳人数{{ item.capacity }}</span> <span>可容纳人数{{ item.capacity }}</span>
<span>面积{{ item.area }}</span> <span>面积{{ item.area }}</span>
</div> </div>
<div class="bottonmContent"> <div class="bottonmContent">
{{ item.description }} {{ item.description }}
@ -291,6 +297,9 @@
v-model:value="formState.startTime" v-model:value="formState.startTime"
placeholder="开始时间" placeholder="开始时间"
value-format="HH:mm:ss" value-format="HH:mm:ss"
:disabledHours="disabledTimeHours"
:disabledMinutes="disabledTimeMinutes"
:disabledSeconds="disabledTimeSeconds"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -299,6 +308,9 @@
v-model:value="formState.endTime" v-model:value="formState.endTime"
placeholder="结束时间" placeholder="结束时间"
value-format="HH:mm:ss" value-format="HH:mm:ss"
:disabledHours="disabledTimeEndHours"
:disabledMinutes="disabledTimeEndMinutes"
:disabledSeconds="disabledTimeEndSeconds"
/> />
</a-col> </a-col>
</a-row> </a-row>
@ -641,6 +653,7 @@
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { Form } from 'ant-design-vue' import { Form } from 'ant-design-vue'
import moment from 'moment'
const props = defineProps({ const props = defineProps({
// //
searchValue: { type: String, default: '' }, searchValue: { type: String, default: '' },
@ -739,12 +752,7 @@
message: '请输入预约人', message: '请输入预约人',
}, },
], ],
matter: [ matter: [{ min: 1, max: 500, required: true, message: '可输入500字内容' }],
{
required: true,
message: '请输入内容',
},
],
phone: [ phone: [
{ {
required: true, required: true,
@ -949,6 +957,168 @@
searchData() searchData()
chengguoSearch() chengguoSearch()
} }
// ----
//
const disabledStartHours = () => {
if (roomEndTime.value) {
let hours = []
let hour = moment().hour()
for (let i = hour + 1; i < 24; i++) {
hours.push(i)
}
return hours
}
}
//
const disabledStartMinutes = (selectedHour) => {
if (roomEndTime) {
let minutes = []
let hour = moment().hour()
let minute = moment().minute()
if (selectedHour === hour) {
for (let i = minute + 1; i < 60; i++) {
minutes.push(i)
}
}
return minutes
}
}
//
const disabledStartSeconds = (selectedHour, selectedMinute) => {
if (roomEndTime) {
let seconds = []
let hour = moment().hour()
let minute = moment().minute()
let second = moment().second()
if (selectedHour === hour && selectedMinute.value === minute) {
for (let i = second + 1; i < 60; i++) {
seconds.push(i)
}
}
return seconds
}
}
//
const disabledEndHours = () => {
if (roomCreateTime.value) {
let hours = []
let hour = moment().hour()
for (let i = 0; i < hour; i++) {
hours.push(i)
}
return hours
}
}
//
const disabledEndMinutes = (selectedHour) => {
if (roomCreateTime) {
let minutes = []
let hour = moment().hour()
let minute = moment().minute()
if (selectedHour === hour) {
for (let i = 0; i < minute; i++) {
minutes.push(i)
}
}
return minutes
}
}
//
const disabledEndSeconds = (selectedHour, selectedMinute) => {
if (roomCreateTime) {
let seconds = []
let hour = moment().hour()
let minute = moment().minute()
let second = moment().second()
if (selectedHour === hour && selectedMinute.value === minute) {
for (let i = 0; i < second; i++) {
seconds.push(i)
}
}
return seconds
}
}
// ----
//
const disabledTimeHours = () => {
if (formState.endTime) {
let hours = []
let hour = moment().hour()
for (let i = hour + 1; i < 24; i++) {
hours.push(i)
}
return hours
}
}
//
const disabledTimeMinutes = (selectedHour) => {
if (formState.endTime) {
let minutes = []
let hour = moment().hour()
let minute = moment().minute()
if (selectedHour === hour) {
for (let i = minute + 1; i < 60; i++) {
minutes.push(i)
}
}
return minutes
}
}
//
const disabledTimeSeconds = (selectedHour, selectedMinute) => {
if (formState.endTime) {
let seconds = []
let hour = moment().hour()
let minute = moment().minute()
let second = moment().second()
if (selectedHour === hour && selectedMinute.value === minute) {
for (let i = second + 1; i < 60; i++) {
seconds.push(i)
}
}
return seconds
}
}
//
const disabledTimeEndHours = () => {
if (formState.startTime) {
let hours = []
let hour = moment().hour()
for (let i = 0; i < hour; i++) {
hours.push(i)
}
return hours
}
}
//
const disabledTimeEndMinutes = (selectedHour) => {
if (formState.startTime) {
let minutes = []
let hour = moment().hour()
let minute = moment().minute()
if (selectedHour === hour) {
for (let i = 0; i < minute; i++) {
minutes.push(i)
}
}
return minutes
}
}
//
const disabledTimeEndSeconds = (selectedHour, selectedMinute) => {
if (formState.startTime) {
let seconds = []
let hour = moment().hour()
let minute = moment().minute()
let second = moment().second()
if (selectedHour === hour && selectedMinute.value === minute) {
for (let i = 0; i < second; i++) {
seconds.push(i)
}
}
return seconds
}
}
// //
const onRoomChange = (pageNumber) => { const onRoomChange = (pageNumber) => {
roomPage.value = pageNumber roomPage.value = pageNumber