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