stjdydayou 4 anos atrás
pai
commit
5c048f27c0

+ 25 - 14
src/views/bz/base/venue/DialogForm.vue

@@ -11,7 +11,7 @@
           <el-row :gutter="24">
             <el-col :span="12">
               <el-form-item label="名称">
-                <el-input v-model="form.name"/>
+                <el-input v-model="form.baseDataInfo.name"/>
               </el-form-item>
             </el-col>
             <el-col :span="12">
@@ -34,17 +34,17 @@
             </el-upload>
           </el-form-item>
           <el-form-item label="地址">
-            <el-input v-model="form.address"/>
+            <el-input v-model="form.baseDataInfo.address"/>
           </el-form-item>
           <el-row :gutter="24">
             <el-col :span="12">
               <el-form-item label="联系人">
-                <el-input v-model="form.contacts"/>
+                <el-input v-model="form.baseDataInfo.contacts"/>
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="联系电话">
-                <el-input v-model="form.contactNumber"/>
+                <el-input v-model="form.baseDataInfo.contactNumber"/>
               </el-form-item>
             </el-col>
           </el-row>
@@ -56,7 +56,7 @@
         </el-col>
       </el-row>
       <el-form-item label="简介">
-        <el-input v-model="form.brief" type="textarea" rows="10"/>
+        <el-input v-model="form.baseDataInfo.brief" type="textarea" rows="10"/>
       </el-form-item>
     </el-form>
     <div slot="footer" class="dialog-footer">
@@ -79,7 +79,9 @@ export default {
       visible: false,
       isLoading: false,
       listAllAuthorities: [],
-      form: {},
+      form: {
+        baseDataInfo: {}
+      },
       fileList: [],
       map: null,
       marker: null,
@@ -99,15 +101,23 @@ export default {
       this.visible = true
       this.isLoading = false
       this.fileList = []
+      if (data && data.baseDataInfo) {
+        const baseDataInfo = data.baseDataInfo
+        if (baseDataInfo.litpics) {
+          baseDataInfo.litpics.forEach(o => {
+            this.fileList.push({ url: o })
+          })
+        }
 
-      if (data.litpics) {
-        data.litpics.forEach(o => {
-          this.fileList.push({ url: o })
-        })
+        this.lng = baseDataInfo?.lng
+        this.lat = baseDataInfo?.lat
+
+        this.form = Object.assign({}, data)
+      } else {
+        this.form = {
+          baseDataInfo: {}
+        }
       }
-      this.form = Object.assign({}, data)
-      this.lng = data.lng
-      this.lat = data.lat
     },
     aMapClick(e) {
       this.lng = e.lnglat.lng
@@ -119,7 +129,8 @@ export default {
         litpics.push(o.url)
       })
       this.isLoading = true
-      const param = { ...this.form, lng: this.lng, lat: this.lat, litpics }
+      const param = { ...this.form, baseDataInfo: { ...this.form.baseDataInfo, lng: this.lng, lat: this.lat, litpics } }
+      console.log(param)
       if (this.form.id) {
         updateById(this.form.id, param).then(() => {
           this.visible = false

+ 10 - 9
src/views/bz/base/venue/index.vue

@@ -30,24 +30,25 @@
     >
       <el-table-column type="selection" width="55"/>
       <el-table-column label="ID" prop="id" width="150"/>
-      <el-table-column label="名称" prop="name"/>
+      <el-table-column label="名称" prop="baseDataInfo.name"/>
+      <el-table-column label="开放时间" prop="businessHours"/>
       <el-table-column label="缩略图" width="80">
         <template slot-scope="scope">
-          {{ scope.row.litpics.length }}张
+          {{ scope.row.baseDataInfo.litpics.length }}张
         </template>
       </el-table-column>
-      <el-table-column label="简介" prop="brief"/>
-      <el-table-column label="地址" prop="address"/>
-      <el-table-column label="联系人" prop="contacts"/>
-      <el-table-column label="联系电话" prop="contactNumber"/>
+      <!--      <el-table-column label="简介" prop="baseDataInfo.brief"/>-->
+      <el-table-column label="地址" prop="baseDataInfo.address"/>
+      <el-table-column label="联系人" prop="baseDataInfo.contacts" width="150"/>
+      <el-table-column label="联系电话" prop="baseDataInfo.contactNumber" width="150"/>
       <el-table-column label="位置信息">
         <template slot-scope="scope">
-          [ {{ scope.row.lng }}, {{ scope.row.lat }} ]
+          [ {{ scope.row.baseDataInfo.lng }}, {{ scope.row.baseDataInfo.lat }} ]
         </template>
       </el-table-column>
       <el-table-column label="操作" width="70" fixed="right">
         <template slot-scope="scope">
-          <el-button v-permission="['app.key.edit']"  type="text" @click.native="$refs.dialogForm.open(scope.row)">编辑</el-button>
+          <el-button v-permission="['app.key.edit']" type="text" @click.native="$refs.dialogForm.open(scope.row)">编辑</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -64,7 +65,7 @@
 </template>
 
 <script>
-import { findPage, deleteByIds } from '@/api/bz/base/venue'
+import { deleteByIds, findPage } from '@/api/bz/base/venue'
 import { dateTimeFormatter } from '@/utils/formater'
 import DialogForm from './DialogForm'