|
|
@@ -0,0 +1,112 @@
|
|
|
+<template>
|
|
|
+ <el-dialog
|
|
|
+ v-if="visible"
|
|
|
+ :title="form.id?'编辑场馆':'新建场馆'"
|
|
|
+ :visible.sync="visible"
|
|
|
+ width="900px"
|
|
|
+ >
|
|
|
+ <el-form v-loading="isLoading" :model="form" label-width="100px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="名称">
|
|
|
+ <el-input v-model="form.name"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="开放时间">
|
|
|
+ <el-input v-model="form.businessHours"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item label="图片">
|
|
|
+ <el-upload
|
|
|
+ :file-list="fileList"
|
|
|
+ action="#"
|
|
|
+ list-type="picture-card"
|
|
|
+ name="fileData"
|
|
|
+ :http-request="uploaderHandle"
|
|
|
+ :on-success="uploadSuccess"
|
|
|
+ :auto-upload="true"
|
|
|
+ >
|
|
|
+ <i slot="default" class="el-icon-plus"/>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="描述">
|
|
|
+ <el-input v-model="form.describe" type="textarea"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="简介">
|
|
|
+ <el-input v-model="form.brief" type="textarea"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="地址">
|
|
|
+ <el-input v-model="form.address"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="联系人">
|
|
|
+ <el-input v-model="form.contacts"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="联系电话">
|
|
|
+ <el-input v-model="form.contactNumber"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="visible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="handleSubmit">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+import { save, updateById } from '@/api/role'
|
|
|
+import { uploaderHandle } from '@/api/upload'
|
|
|
+
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ isLoading: false,
|
|
|
+ listAllAuthorities: [],
|
|
|
+ form: {},
|
|
|
+ fileList: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ uploaderHandle,
|
|
|
+ uploadSuccess(res, file, fileList) {
|
|
|
+ file.url = res.url
|
|
|
+ this.fileList = fileList
|
|
|
+ },
|
|
|
+ open(data) {
|
|
|
+ this.visible = true
|
|
|
+ // this.fileList = [{ url: 'http://127.0.0.1:9800/src/2022/01/25/2ce4b244c380c7e178f982bad02d844c.png' }]
|
|
|
+ this.form = Object.assign({}, data)
|
|
|
+ },
|
|
|
+ handleSubmit() {
|
|
|
+ console.log(this.form)
|
|
|
+ // this.isLoading = true
|
|
|
+ // if (this.form.id) {
|
|
|
+ // updateById(this.form.id, this.form).then(() => {
|
|
|
+ // this.visible = false
|
|
|
+ // this.$emit('ok')
|
|
|
+ // }).finally(() => {
|
|
|
+ // this.isLoading = false
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // save(this.form).then(res => {
|
|
|
+ // this.visible = false
|
|
|
+ // this.$emit('ok')
|
|
|
+ // }).finally(() => {
|
|
|
+ // this.isLoading = false
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|