BUG修改

This commit is contained in:
a0049873 2022-09-26 09:26:17 +08:00
parent 2688b764e5
commit 67e009d110
1 changed files with 37 additions and 37 deletions

View File

@ -208,7 +208,7 @@
<script>
import Cookies from 'js-cookie'
export default {
data() {
data () {
// let validatorImg = (rule, value, callback) => {
// console.log(value, 11111111)
// //
@ -231,7 +231,7 @@ export default {
area: 0,
capacity: '',
pic: '',
id: '',
id: ''
},
limit: 10,
page: 1,
@ -242,11 +242,11 @@ export default {
rules: {
name: [
{ required: true, message: '请输入会议室名称', trigger: 'blur' },
{ min: 1, trigger: 'blur' },
{ min: 1, trigger: 'blur' }
],
area: [
{ required: true, message: '请输入会议室面积', trigger: 'blur' },
{ min: 1, type: 'number', trigger: 'blur' },
{ min: 1, message: '请输入数字', type: 'number', trigger: 'blur' }
],
description: [
{ required: true, message: '请填写描述内容', trigger: 'blur' },
@ -254,22 +254,22 @@ export default {
min: 1,
max: 500,
message: '长度在 1 到 500 个字符',
trigger: 'blur',
},
],
trigger: 'blur'
}
]
},
formLabelWidth: '120px',
checkImgSuccess: true,
dialogVisible: false,
flge: '',
flge: ''
}
},
mounted() {
mounted () {
this.queryData()
},
methods: {
//
queryData() {
queryData () {
this.$http
.get(`/meeting/page?limit=${this.limit}&page=${this.page}`)
.then(({ data: res }) => {
@ -278,31 +278,31 @@ export default {
})
},
//
handleSizeChange(val) {
handleSizeChange (val) {
this.limit = val
this.queryData()
},
handleCurrentChange(val) {
handleCurrentChange (val) {
this.page = val
this.queryData()
},
//
addRooom() {
addRooom () {
this.dialogFormVisible = true
this.flge = 'add'
this.ruleForm = {}
this.fileList = []
},
handlePictureCardPreview(file) {
handlePictureCardPreview (file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
//
beforeUpload(file, fileList) {
//
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')
@ -313,17 +313,17 @@ export default {
this.checkImgSuccess = true
}
},
//
onRemove(file, fileList) {
//
onRemove (file, fileList) {
this.$nextTick(() => {
if (fileList.length == 0) {
this.checkImgSuccess = false //
this.checkImgSuccess = false //
// this.$refs.ruleForm.validate() //,
}
})
},
//
submitForm(formName, i) {
submitForm (formName, i) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (i === 'add') {
@ -337,9 +337,9 @@ export default {
})
} else if (i === 'edit') {
this.dialogFormVisible = false
this.$http.put(`/meeting`, this.ruleForm).then(({ data: res }) => {
this.$http.put('/meeting', this.ruleForm).then(({ data: res }) => {
this.ruleForm = res.data
let imgUrl = { name: res.data.name, url: res.data.pic }
const imgUrl = { name: res.data.name, url: res.data.pic }
this.fileList.push(imgUrl)
})
}
@ -350,7 +350,7 @@ export default {
})
},
//
taskDetails(row) {
taskDetails (row) {
this.ruleForm = {}
this.fileList = []
this.flge = 'look'
@ -366,45 +366,45 @@ export default {
}
})
},
//
taskUpdate(row) {
//
taskUpdate (row) {
this.dialogFormVisible = true
this.fileList = []
this.flge = 'edit'
this.ruleForm = row
if (row.pic != null) {
let imgUrl = { name: row.name, url: row.pic }
const imgUrl = { name: row.name, url: row.pic }
this.fileList.push(imgUrl)
} else {
this.fileList = []
}
},
//
taskDelete(row) {
//
taskDelete (row) {
this.$confirm('此操作将永久删除该会议室, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
})
.then(() => {
this.$http.put(`/meeting`, { delFlag: 1, id: row.id }).then(() => {
this.$http.put('/meeting', { delFlag: 1, id: row.id }).then(() => {
this.queryData()
this.$message({
type: 'success',
message: '删除成功!',
message: '删除成功!'
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
message: '已取消删除'
})
})
},
//
outDialog() {},
},
//
outDialog () {}
}
}
</script>
<style scoped lang="scss">