You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
1.7 KiB
75 lines
1.7 KiB
<template>
|
|
<div>
|
|
<vxe-modal
|
|
:value="isShow"
|
|
show-footer
|
|
title="会议室"
|
|
show-confirm-button
|
|
:width="600"
|
|
:height="400"
|
|
esc-closable
|
|
:fullscreen="$store.getters.device === 'mobile'"
|
|
@input="e => $emit('update:isShow',e)"
|
|
>
|
|
<el-form ref="elForm" :model="form" :rules="rules" label-position="top" label-width="100">
|
|
<el-form-item label="名字" prop="name">
|
|
<el-input v-model="form.name" />
|
|
</el-form-item>
|
|
<el-form-item label="排序" prop="myindex">
|
|
<el-input-number v-model="form.myindex" controls-position="right" :precision="0" />
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
<template #footer>
|
|
<el-button type="primary" :loading="loading" @click="submit">确认</el-button>
|
|
</template>
|
|
</vxe-modal>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { save } from '@/api/meetingRoom'
|
|
export default {
|
|
props: {
|
|
isShow: {
|
|
type: Boolean,
|
|
default: false,
|
|
required: true
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
loading: false,
|
|
form: {
|
|
name: '',
|
|
myindex: 0
|
|
},
|
|
rules: {}
|
|
}
|
|
},
|
|
computed: {},
|
|
methods: {
|
|
submit() {
|
|
this.$refs['elForm'].validate(async valid => {
|
|
if (valid) {
|
|
this.loading = true
|
|
try {
|
|
await save(this.form)
|
|
this.$message.success('新增成功')
|
|
this.$emit('refresh')
|
|
this.$emit('update:isShow', false)
|
|
this.loading = false
|
|
this.$refs['elForm'].resetFields()
|
|
} catch (err) {
|
|
this.loading = false
|
|
}
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
</style>
|