Bladeren bron

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/pc-admin

魏熙美 6 jaren geleden
bovenliggende
commit
108354e1ea
4 gewijzigde bestanden met toevoegingen van 810 en 27 verwijderingen
  1. 420
    0
      src/views/carouselFigure/edit.vue
  2. 232
    0
      src/views/carouselFigure/list.vue
  3. 29
    0
      src/views/index.js
  4. 129
    27
      src/views/project/edit.vue

+ 420
- 0
src/views/carouselFigure/edit.vue Bestand weergeven

@@ -0,0 +1,420 @@
1
+<template>
2
+    <div class="edit-carousel">
3
+      <el-form ref="form" :model="building" label-width="180px">
4
+        <el-form-item label="所属项目:">
5
+          <el-select v-model="buildingProperty" multiple placeholder="请选择">
6
+            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
7
+          </el-select>
8
+        </el-form-item>
9
+        <el-form-item label="主图:">
10
+          <el-upload
11
+            :action="upFileUrl"
12
+            name='file'
13
+            list-type="picture-card"
14
+            :headers="uploadHeaders"
15
+            :file-list="imgList"
16
+            :show-file-list="true"
17
+            :before-upload="beforeImgUpload"
18
+            :on-success="handleAvatarSuccess"
19
+            :on-remove="handleRemove">
20
+            <i class="el-icon-plus"></i>
21
+          </el-upload>
22
+          <el-dialog :visible.sync="dialogVisible">
23
+            <img width="100%" :src="dialogImageUrl" alt="">
24
+          </el-dialog>
25
+        </el-form-item>
26
+        <el-form-item label="标题:">
27
+          <el-input v-model="building.tel"></el-input>
28
+        </el-form-item>
29
+        <el-form-item label="发布位置:">
30
+          <el-select v-model="buildingProperty" multiple placeholder="请选择">
31
+            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
32
+          </el-select>
33
+        </el-form-item>
34
+        <el-form-item label="类型:">
35
+          <el-select v-model="buildingProperty" multiple placeholder="请选择">
36
+            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
37
+          </el-select>
38
+        </el-form-item>
39
+        <el-form-item label="发布内容:">
40
+          <div id="websiteEditorElem" style="height: 400px"></div>
41
+        </el-form-item>
42
+        <el-form-item label="发布内容:" class="publish">
43
+          <p>活动名称展示处 <span class="choose">请选择</span></p>
44
+        </el-form-item>
45
+        <el-form-item label="状态:">
46
+          <el-select v-model="buildingProperty" multiple placeholder="请选择">
47
+            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
48
+          </el-select>
49
+        </el-form-item>
50
+        <el-form-item>
51
+          <el-button type="primary" @click="onSubmit">保存</el-button>
52
+          <el-button @click="onCancel">取消</el-button>
53
+        </el-form-item>
54
+      </el-form>
55
+    </div>    
56
+</template>
57
+
58
+<script>
59
+import { createNamespacedHelpers } from "vuex";
60
+import apis from "../../config/api";
61
+import { mapState } from "vuex";
62
+import E from "wangeditor";
63
+
64
+const {
65
+  mapState: mapBuildingState,
66
+  mapActions: mapBuildingActions,
67
+  mapMutations: mapBuildingMutations
68
+} = createNamespacedHelpers("building");
69
+
70
+const { mapActions: mapApartmentActions } = createNamespacedHelpers(
71
+  "apartment"
72
+);
73
+
74
+const { mapActions: mapImgActions } = createNamespacedHelpers("img");
75
+
76
+export default {
77
+  data() {
78
+    var _self = this;
79
+    return {
80
+      upFileUrl: apis.file.upload.url,
81
+      commPrefix: "",
82
+      imgurl: "",
83
+      loadingZm: false,
84
+      activeName: "detail",
85
+      dialogImageUrl: "",
86
+      dialogVisible: false,
87
+      dialogApartImageUrl: "",
88
+      dialogApartVisible: false,
89
+      showHx: false,
90
+      imgList: [],
91
+      tags: [],
92
+      buildingProperty: [],
93
+      aparments: [],
94
+      aparmentInfo: {},
95
+      aparmentImg: [],
96
+      saleType: [
97
+        {
98
+          id: 1,
99
+          name: "待定"
100
+        },
101
+        {
102
+          id: 2,
103
+          name: "售罄"
104
+        },
105
+        {
106
+          id: 3,
107
+          name: "在售"
108
+        }
109
+      ]
110
+    };
111
+  },
112
+  computed: {
113
+    ...mapBuildingState({
114
+      detail: x => x.detail
115
+    }),
116
+    ...mapState({
117
+      dicts: x => x.dicts
118
+    }),
119
+    building: {
120
+      get() {
121
+        return this.detail;
122
+      },
123
+      set(val) {
124
+        return this.updateDetail(val);
125
+      }
126
+    },
127
+    propertyType() {
128
+      return (this.dicts || []).filter(x => x.type === "propertyType");
129
+    },
130
+    uploadHeaders() {
131
+      const token = localStorage.getItem("x-token") || "";
132
+      return {
133
+        Authorization: `Bearer ${token}`
134
+      };
135
+    }
136
+  },
137
+  methods: {
138
+    ...mapBuildingMutations(["updateDetail"]),
139
+    ...mapBuildingActions(["getDetail", "addBuilding", "editBuilding"]),
140
+    ...mapApartmentActions([
141
+      "getApartments",
142
+      "getApartmentDetail",
143
+      "addApartment",
144
+      "editApartment",
145
+      "deleteApartment"
146
+    ]),
147
+    ...mapImgActions(["uploadImg"]),
148
+    getSaleTypeName(id) {
149
+      return (this.saleType.filter(x => x.id == id)[0] || {}).name;
150
+    },
151
+    onCancel() {
152
+      this.$router.push({ name: "buildinglist" });
153
+    },
154
+    handleRemove(file, fileList) {
155
+      this.imgList = fileList;
156
+    },
157
+    handleAparmentRemove(file, fileList) {
158
+      this.aparmentImg = fileList;
159
+    },
160
+
161
+    beforeImgUpload(file) {
162
+      if (file.type !== "image/jpeg" && file.type !== "image/png") {
163
+        this.$message.error("上传图片只能是 JPG 或 PNG 格式!");
164
+        return false;
165
+      }
166
+      // if (file.size / 1024 > 300) {
167
+      //   this.$message.error('图片大小不允许超过300k!')
168
+      //   return false
169
+      // }
170
+      this.loading = this.$loading({
171
+        lock: true,
172
+        text: "上传中...",
173
+        spinner: "el-icon-loading",
174
+        background: "rgba(0, 0, 0, 0.7)"
175
+      });
176
+
177
+      return true;
178
+    },
179
+    handleAvatarSuccess(res) {
180
+      this.imgList = [
181
+        ...this.imgList,
182
+        {
183
+          url: res.data
184
+        }
185
+      ];
186
+      this.loading.close();
187
+    },
188
+    handleMapImgSuccess(res) {
189
+      this.building = { ...this.building, mapImg: res.data };
190
+      this.loading.close();
191
+    },
192
+    handlePosterSuccess(res) {
193
+      this.building = { ...this.building, poster: res.data };
194
+      this.loading.close();
195
+    },
196
+    handleAparmentSuccess(res) {
197
+      this.aparmentImg = [
198
+        ...this.aparmentImg,
199
+        {
200
+          url: res.data
201
+        }
202
+      ];
203
+      this.loading.close();
204
+    },
205
+    onSubmit() {
206
+      const imgs = this.imgList.map((x, i) => {
207
+        return {
208
+          imgType: "banner",
209
+          url: x.url,
210
+          orderNo: i + 1
211
+        };
212
+      });
213
+      const tag = this.tags.map(x => {
214
+        return {
215
+          tagName: x
216
+        };
217
+      });
218
+      const building = {
219
+        ...this.building,
220
+        img: imgs,
221
+        propertyType: this.buildingProperty.join(","),
222
+        tag
223
+      };
224
+      if (!building.buildingId) {
225
+        // 新增
226
+        this.addBuilding({
227
+          onSuccess: this.onCancel,
228
+          detail: JSON.stringify(building)
229
+        });
230
+      } else {
231
+        // 修改
232
+        this.editBuilding({
233
+          onSuccess: this.onCancel,
234
+          detail: JSON.stringify(building)
235
+        });
236
+      }
237
+    },
238
+    FormatDate(date) {
239
+      return (date || "").split("T")[0] === "0001-01-01"
240
+        ? ""
241
+        : (date || "").split("T")[0];
242
+    },
243
+    saveAparment() {
244
+      const imgs = this.aparmentImg.map((x, i) => {
245
+        return {
246
+          imgType: "aparment",
247
+          url: x.url,
248
+          orderNo: i + 1
249
+        };
250
+      });
251
+      if (!this.aparmentInfo.apartmentId) {
252
+        this.addApartment(
253
+          JSON.stringify({
254
+            ...this.aparmentInfo,
255
+            img: imgs
256
+          })
257
+        ).then(() => {
258
+          this.getAparmentList();
259
+          this.showHx = false;
260
+        });
261
+      } else {
262
+        this.editApartment(
263
+          JSON.stringify({
264
+            ...this.aparmentInfo,
265
+            img: imgs
266
+          })
267
+        ).then(() => {
268
+          this.getAparmentList();
269
+          this.showHx = false;
270
+        });
271
+      }
272
+    },
273
+    addHx() {
274
+      this.aparmentImg = [];
275
+      this.aparmentInfo = { buildingId: this.building.buildingId };
276
+      this.showHx = true;
277
+    },
278
+    getAparmentList() {
279
+      this.getApartments({ buildingId: this.$route.query.id }).then(data => {
280
+        this.aparments = data;
281
+      });
282
+    },
283
+    handleEdit(row) {
284
+      this.aparmentImg = [];
285
+      this.getApartmentDetail({
286
+        id: row.apartmentId
287
+      }).then(data => {
288
+        console.log("...", data);
289
+        this.aparmentImg = data.buildingImgList.map(x => {
290
+          return {
291
+            name: x.imgId,
292
+            url: x.url
293
+          };
294
+        });
295
+        this.aparmentInfo = data;
296
+        this.showHx = true;
297
+      });
298
+    },
299
+    handleDel(row) {
300
+      this.$confirm("确认删除此数据?", "提示", {
301
+        confirmButtonText: "确定",
302
+        cancelButtonText: "取消",
303
+        type: "warning"
304
+      }).then(() => {
305
+        if (this.building.status === 1) {
306
+          this.$message.error("当前楼盘处于发布状态,不允许删除!");
307
+          return false;
308
+        }
309
+        this.deleteApartment({
310
+          id: row.apartmentId
311
+        }).then(() => {
312
+          this.getAparmentList();
313
+        });
314
+      });
315
+    }
316
+  },
317
+  mounted() {
318
+    const _that = this;
319
+    const phoneEditor = new E("#websiteEditorElem");
320
+    phoneEditor.customConfig.onchange = function(html) {
321
+      _that.building = { ..._that.building, remark: html };
322
+    };
323
+    phoneEditor.customConfig.customUploadImg = function(files, insert) {
324
+      _that.uploadImg(files[0]).then(data => {
325
+        insert(data[0]);
326
+      });
327
+    };
328
+    phoneEditor.customConfig.menus = [
329
+      "head", // 标题
330
+      "bold", // 粗体
331
+      "fontSize", // 字号
332
+      "fontName", // 字体
333
+      "italic", // 斜体
334
+      "underline", // 下划线
335
+      "strikeThrough", // 删除线
336
+      "foreColor", // 文字颜色
337
+      "backColor", // 背景颜色
338
+      "justify", // 对齐方式
339
+      "image" // 插入图片
340
+    ];
341
+    phoneEditor.create();
342
+    if ((this.$route.query.id || "") !== "") {
343
+      this.getAparmentList();
344
+      window.console.log(this.getDetail);
345
+      this.getDetail({ id: this.$route.query.id }).then(data => {
346
+        this.buildingProperty = data.propertyType.split(",");
347
+        phoneEditor.txt.html(data.remark);
348
+        this.imgList = data.buildingImg.map(x => {
349
+          return {
350
+            name: x.imgId,
351
+            url: x.url
352
+          };
353
+        });
354
+        this.tags = data.buildingTag.map(x => x.tagName);
355
+      });
356
+    } else {
357
+      phoneEditor.txt.html("");
358
+    }
359
+  }
360
+};
361
+</script>
362
+
363
+<style lang="scss">
364
+.header {
365
+  width: 50px;
366
+  height: 50px;
367
+  img {
368
+    width: 100%;
369
+    height: 100%;
370
+  }
371
+}
372
+.avatar-uploader .el-upload {
373
+  border: 1px dashed #d9d9d9;
374
+  border-radius: 6px;
375
+  cursor: pointer;
376
+  position: relative;
377
+  overflow: hidden;
378
+}
379
+.avatar-uploader .el-upload:hover {
380
+  border-color: #409eff;
381
+}
382
+.avatar-uploader-icon {
383
+  font-size: 28px;
384
+  color: #8c939d;
385
+  width: 178px;
386
+  height: 178px;
387
+  line-height: 178px;
388
+  text-align: center;
389
+}
390
+.avatar {
391
+  width: 178px;
392
+  height: 178px;
393
+  display: block;
394
+}
395
+.edit-carousel {
396
+  .el-select {
397
+    max-width: 300px !important;
398
+  }
399
+  .el-input {
400
+    max-width: 400px;
401
+  }
402
+  .publish{
403
+    p{
404
+      margin: 0;
405
+      font-size: 15.4px;
406
+      .choose{
407
+        color: blue;
408
+      }
409
+    }
410
+  }
411
+}
412
+
413
+.el-select-dropdown {
414
+  z-index: 10003 !important;
415
+}
416
+
417
+.el-date-picker {
418
+  z-index: 10002 !important;
419
+}
420
+</style>

+ 232
- 0
src/views/carouselFigure/list.vue Bestand weergeven

@@ -0,0 +1,232 @@
1
+<template>
2
+  <div>
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h">
6
+          <el-button size="mini" type="success" @click='addDynamic'>新增</el-button>
7
+        </div>
8
+      </div>
9
+      <div class="moreFilter"></div>
10
+    </div>
11
+    <el-table
12
+      :data="dynamics.list || []"
13
+      >
14
+      <el-table-column
15
+        type="index">
16
+        <template slot-scope="scope">
17
+          <span>{{ GetIndex(scope.$index) }}</span>
18
+        </template>
19
+      </el-table-column>
20
+      <el-table-column
21
+        label="主图">
22
+        <template slot-scope="scope">
23
+          <div class="header">
24
+            <img :src="scope.row.imgUrl" alt="" />
25
+          </div>
26
+        </template>
27
+      </el-table-column>
28
+      <el-table-column
29
+        prop="title"
30
+        label="类型">
31
+      </el-table-column>
32
+      <el-table-column
33
+        prop="desc"
34
+        label="发布位置2">
35
+      </el-table-column>
36
+      <el-table-column
37
+        prop="createDate"
38
+        label="发布时间">
39
+      </el-table-column>
40
+      <el-table-column
41
+        label="状态"
42
+        >
43
+        <template slot-scope="scope">
44
+          <span>{{scope.row.status == 1 ? '启用' : '停用'}}</span>
45
+        </template>
46
+      </el-table-column>
47
+      <el-table-column
48
+        fixed="right"
49
+        label="操作"
50
+        width="180">
51
+        <template slot-scope="scope">
52
+          <el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status === 0" size="small">编辑</el-button>
53
+          <el-button type="text" @click="handlePulic(scope.row)" size="small" v-if="scope.row.status === 0">启用</el-button>
54
+          <el-button type="text" @click="handleUnPulic(scope.row)" size="small" v-if="scope.row.status === 1">禁用</el-button>
55
+
56
+        </template>
57
+      </el-table-column>
58
+    </el-table>
59
+    <el-pagination
60
+      small
61
+      style="margin-top:10px;"
62
+      layout="prev, pager, next"
63
+      :current-page.sync="currentPage"
64
+      :pageSize="pageSize"
65
+      :total="dynamics.total || 0"
66
+      @current-change="getList"
67
+    >
68
+    </el-pagination>
69
+  </div>
70
+</template>
71
+
72
+<script>
73
+import { createNamespacedHelpers } from 'vuex';
74
+
75
+const {mapState: mapDynamicState, mapActions: mapDynamicActions} = createNamespacedHelpers('dynamic')
76
+const {mapState: mapBuildingState, mapActions: mapBuildingActions} = createNamespacedHelpers('building')
77
+
78
+export default {
79
+  data() {
80
+    return {
81
+      pageSize: 20,
82
+      currentPage: 1,
83
+      name: '',
84
+      buildingId: '',
85
+    }
86
+  },
87
+  computed: {
88
+    ...mapDynamicState({
89
+      dynamics: x => x.dynamics
90
+    }),
91
+    ...mapBuildingState({
92
+      buildings: x => x.buildings
93
+    })
94
+  },
95
+  methods: {
96
+    ...mapDynamicActions([
97
+      'getDynamics',
98
+      'setDetailNull',
99
+      'deleteDynamics',
100
+      'publicDynamic',
101
+      'cancelDynamic'
102
+    ]),
103
+    ...mapBuildingActions([
104
+      'getBuildings',
105
+    ]),
106
+    GetIndex (inx) {
107
+      return (this.currentPage - 1) * this.pageSize + inx + 1
108
+    },
109
+    FormatDate (date) {
110
+      if (date) {
111
+        return dayjs(date).formate('yyyy-MM-DD HH:mm:ss')
112
+      } else {
113
+        return ''
114
+      }
115
+    },
116
+    getList () {
117
+      this.getDynamics({
118
+        pageNum: this.currentPage,
119
+        pageSize: this.pageSize,
120
+        name: this.name,
121
+        buildingId: this.buildingId
122
+      })
123
+    },
124
+    getBuildingName (id) {
125
+      return ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {}).buildingName || ''
126
+    },
127
+    search () {
128
+      this.currentPage = 1
129
+      this.getList()
130
+    },
131
+    handleEdit (row) {
132
+      this.setDetailNull()
133
+      this.$router.push({name: 'editCarousel', query: {id: row.dynamicId}})
134
+    },
135
+    handlePulic (row) {
136
+      this.$confirm('确认发布此数据?', '提示', {
137
+        confirmButtonText: '确定',
138
+        cancelButtonText: '取消',
139
+        type: 'warning'
140
+      }).then(() => {
141
+        this.publicDynamic({
142
+          id: row.dynamicId
143
+        }).then(() => {
144
+          this.getList()
145
+        })
146
+      })
147
+    },
148
+    handleUnPulic (row) {
149
+      this.$confirm('确认取消发布此数据?', '提示', {
150
+        confirmButtonText: '确定',
151
+        cancelButtonText: '取消',
152
+        type: 'warning'
153
+      }).then(() => {
154
+        this.cancelDynamic({
155
+          id: row.dynamicId}).then(() => {
156
+          this.getList()
157
+        })
158
+      })
159
+    },
160
+    handleDel (row) {
161
+      this.$confirm('确认删除此数据?', '提示', {
162
+        confirmButtonText: '确定',
163
+        cancelButtonText: '取消',
164
+        type: 'warning'
165
+      }).then(() => {
166
+        if (row.status === 1) {
167
+          this.$message.error('当前活动处于发布状态,不允许删除!')
168
+          return false
169
+        }
170
+        this.deleteDynamics({
171
+          id: row.dynamicId
172
+        }).then(() => {
173
+          this.getList()
174
+        })
175
+      })
176
+    },
177
+    addDynamic () {
178
+      this.setDetailNull()
179
+      this.$router.push({name: 'editCarousel'})
180
+    }
181
+  },
182
+  created () {
183
+    this.getBuildings({
184
+      pageNum: 1,
185
+      pageSize: 100,
186
+    }).then(() => {
187
+      this.getList()
188
+    })
189
+  }
190
+}
191
+</script>
192
+
193
+<style lang="scss" scoped>
194
+.header{
195
+  width: 50px;
196
+  height: 50px;
197
+  img{
198
+    width: 100%;
199
+    height: 100%;
200
+  }
201
+}
202
+
203
+.system-table-search{
204
+  width: calc(100% - 40px);
205
+  margin: 20px auto 0;
206
+}
207
+
208
+.system-table-search li{
209
+  margin-right: 20px;
210
+}
211
+
212
+.system-table-search ul{
213
+  font-size: 0;
214
+  white-space: nowrap;
215
+}
216
+
217
+.system-table-search ul>li{
218
+  display: inline-block;
219
+}
220
+
221
+.flex-h {
222
+  display: flex;
223
+  display: -webkit-flex;
224
+}
225
+
226
+.flex-item {
227
+  flex: 1;
228
+  -webkit-flex: 1;
229
+  position: relative;
230
+  overflow: hidden;
231
+}
232
+</style>

+ 29
- 0
src/views/index.js Bestand weergeven

@@ -131,6 +131,35 @@ const pages = [
131 131
           menuShow: true,
132 132
           title: '客户列表',
133 133
         },
134
+      },
135
+    ]
136
+  },
137
+  {
138
+    path: 'carouselFigure',
139
+    name: 'carouselFigure',
140
+    component: () => import('./index.vue'),
141
+    meta: {
142
+      menuShow: true,
143
+      title: '轮播图管理',
144
+    },
145
+    children: [
146
+      {
147
+        path: 'carouselList',
148
+        name: 'carouselList',
149
+        component: () => import('./carouselFigure/list.vue'),
150
+        meta: {
151
+          menuShow: true,
152
+          title: '轮播图列表',
153
+        },
154
+      },
155
+      {
156
+        path: 'editCarousel',
157
+        name: 'editCarousel',
158
+        component: () => import('./carouselFigure/edit.vue'),
159
+        meta: {
160
+          menuShow: false,
161
+          title: '编辑轮播图',
162
+        },
134 163
       }
135 164
     ]
136 165
   },

+ 129
- 27
src/views/project/edit.vue Bestand weergeven

@@ -68,17 +68,22 @@
68 68
 
69 69
   <el-tab-pane label="交通及周边设施">
70 70
     <el-form ref="form" :model="building" label-width="160px">
71
-     <el-form-item label="项目地图图片">
71
+     <el-form-item label="项目地图图片">
72 72
         <el-upload
73
-          class="avatar-uploader"
74
-          :action="upFileUrl"
75
-          name='file'
76
-          :show-file-list="false"
77
-          :before-upload="beforeImgUpload"
78
-          :on-success="handleAvatarSuccess">
79
-          <img v-if="building.imgUrl" :src="building.imgUrl" class="avatar">
80
-          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
81
-        </el-upload>
73
+            :action="upFileUrl"
74
+            name='file'
75
+            list-type="picture-card"
76
+            :headers="uploadHeaders"
77
+            :file-list="imgList1"
78
+            :show-file-list="true"
79
+            :before-upload="beforeImgUpload"
80
+            :on-success="handleAvatarSuccess1"
81
+            :on-remove="handleRemove">
82
+            <i class="el-icon-plus"></i>
83
+          </el-upload>
84
+          <el-dialog :visible.sync="dialogVisible">
85
+            <img width="100%" :src="dialogImageUrl1" alt="">
86
+          </el-dialog>
82 87
       </el-form-item>
83 88
       <el-form-item label="项目地址:">
84 89
         <el-input v-model="building.desc" ></el-input>
@@ -109,18 +114,24 @@
109 114
   </el-tab-pane>
110 115
   <el-tab-pane label="户型相册">
111 116
     <el-form ref="form" :model="building" label-width="150px">
117
+      <p class="title">户型:</p>
112 118
       <div v-for="(item,index) in 2" :key="index" class="apartment-box">
113
-        <el-form-item label="户型:">
119
+        <el-form-item label="户型:">
114 120
           <el-upload
115
-            class="avatar-uploader"
116 121
             :action="upFileUrl"
117 122
             name='file'
118
-            :show-file-list="false"
123
+            list-type="picture-card"
124
+            :headers="uploadHeaders"
125
+            :file-list="imgList2"
126
+            :show-file-list="true"
119 127
             :before-upload="beforeImgUpload"
120
-            :on-success="handleAvatarSuccess">
121
-            <img v-if="building.imgUrl" :src="building.imgUrl" class="avatar">
122
-            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
128
+            :on-success="handleAvatarSuccess2"
129
+            :on-remove="handleRemove">
130
+            <i class="el-icon-plus"></i>
123 131
           </el-upload>
132
+          <el-dialog :visible.sync="dialogVisible">
133
+            <img width="100%" :src="dialogImageUrl2" alt="">
134
+          </el-dialog>
124 135
         </el-form-item>
125 136
         <el-form-item label="标题:">
126 137
           <el-input v-model="building.desc" ></el-input>
@@ -147,23 +158,62 @@
147 158
     <el-form-item>
148 159
       <el-button type="primary" @click="onSubmit">添加户型</el-button>
149 160
     </el-form-item>
150
-    <el-form-item label="项目主图">
161
+    <p class="title">项目相册:</p>
162
+      <el-form-item label="效果图">
151 163
           <el-upload
152 164
             :action="upFileUrl"
153 165
             name='file'
154 166
             list-type="picture-card"
155 167
             :headers="uploadHeaders"
156
-            :file-list="imgList"
168
+            :file-list="imgList3"
157 169
             :show-file-list="true"
158 170
             :before-upload="beforeImgUpload"
159
-            :on-success="handleAvatarSuccess"
171
+            :on-success="handleAvatarSuccess3"
160 172
             :on-remove="handleRemove">
161 173
             <i class="el-icon-plus"></i>
162 174
           </el-upload>
163 175
           <el-dialog :visible.sync="dialogVisible">
164
-            <img width="100%" :src="dialogImageUrl" alt="">
176
+            <img width="100%" :src="dialogImageUrl3" alt="">
165 177
           </el-dialog>
166
-        </el-form-item>
178
+      </el-form-item>
179
+      <el-form-item label="实景图">
180
+          <el-upload
181
+            :action="upFileUrl"
182
+            name='file'
183
+            list-type="picture-card"
184
+            :headers="uploadHeaders"
185
+            :file-list="imgList4"
186
+            :show-file-list="true"
187
+            :before-upload="beforeImgUpload"
188
+            :on-success="handleAvatarSuccess4"
189
+            :on-remove="handleRemove">
190
+            <i class="el-icon-plus"></i>
191
+          </el-upload>
192
+          <el-dialog :visible.sync="dialogVisible">
193
+            <img width="100%" :src="dialogImageUrl4" alt="">
194
+          </el-dialog>
195
+      </el-form-item>
196
+      <el-form-item label="样板间">
197
+          <el-upload
198
+            :action="upFileUrl"
199
+            name='file'
200
+            list-type="picture-card"
201
+            :headers="uploadHeaders"
202
+            :file-list="imgList5"
203
+            :show-file-list="true"
204
+            :before-upload="beforeImgUpload"
205
+            :on-success="handleAvatarSuccess5"
206
+            :on-remove="handleRemove">
207
+            <i class="el-icon-plus"></i>
208
+          </el-upload>
209
+          <el-dialog :visible.sync="dialogVisible">
210
+            <img width="100%" :src="dialogImageUrl5" alt="">
211
+          </el-dialog>
212
+      </el-form-item>
213
+      <el-form-item>
214
+        <el-button type="primary" @click="onSubmit">保存</el-button>
215
+        <el-button @click="onCancel">取消</el-button>
216
+      </el-form-item>
167 217
     </el-form>
168 218
   </el-tab-pane>
169 219
 
@@ -197,8 +247,18 @@ export default {
197 247
       upFileUrl: apis.file.upload.url,
198 248
       radio: "1",
199 249
       showHx: false,
250
+      dialogVisible: false,
251
+      dialogImageUrl1: "",
252
+      dialogImageUrl2: "",
253
+      dialogImageUrl3: "",
254
+      dialogImageUrl4: "",
255
+      dialogImageUrl5: "",
200 256
       markers: [],
201
-      imgList: [],
257
+      imgList1: [],
258
+      imgList2: [],
259
+      imgList3: [],
260
+      imgList4: [],
261
+      imgList5: [],
202 262
       tags: [],
203 263
       buildingProperty: [],
204 264
       aparments: [],
@@ -324,9 +384,45 @@ export default {
324 384
 
325 385
       return true;
326 386
     },
327
-    handleAvatarSuccess(res) {
328
-      this.imgList = [
329
-        ...this.imgList,
387
+    handleAvatarSuccess1(res) {
388
+      this.imgList1 = [
389
+        ...this.imgList1,
390
+        {
391
+          url: res.data
392
+        }
393
+      ];
394
+      this.loading.close();
395
+    },
396
+    handleAvatarSuccess2(res) {
397
+      this.imgList2 = [
398
+        ...this.imgList2,
399
+        {
400
+          url: res.data
401
+        }
402
+      ];
403
+      this.loading.close();
404
+    },
405
+    handleAvatarSuccess3(res) {
406
+      this.imgList3 = [
407
+        ...this.imgList3,
408
+        {
409
+          url: res.data
410
+        }
411
+      ];
412
+      this.loading.close();
413
+    },
414
+    handleAvatarSuccess4(res) {
415
+      this.imgList4 = [
416
+        ...this.imgList4,
417
+        {
418
+          url: res.data
419
+        }
420
+      ];
421
+      this.loading.close();
422
+    },
423
+    handleAvatarSuccess5(res) {
424
+      this.imgList5 = [
425
+        ...this.imgList5,
330 426
         {
331 427
           url: res.data
332 428
         }
@@ -561,9 +657,15 @@ export default {
561 657
   .el-input {
562 658
     max-width: 300px;
563 659
   }
564
-  .el-select{
565
-    max-width: 250px!important;
660
+  .el-select {
661
+    max-width: 250px !important;
566 662
     margin-right: 20px;
567 663
   }
568 664
 }
665
+.title{
666
+  font-size: 20px;
667
+  font-weight: 600;
668
+  color: #000;
669
+  margin: 8px 20px;
670
+}
569 671
 </style>