|
@@ -1,7 +1,7 @@
|
1
|
1
|
<template>
|
2
|
2
|
<el-tabs v-model="activeName">
|
3
|
3
|
<el-tab-pane label="基础信息" name="detail">
|
4
|
|
- <el-form ref="form" :model="building" label-width="160px">
|
|
4
|
+ <el-form ref="form" :model="building" label-width="160px" class="building-form">
|
5
|
5
|
<el-form-item label="楼盘编号">
|
6
|
6
|
<el-input v-model="building.code"></el-input>
|
7
|
7
|
</el-form-item>
|
|
@@ -101,7 +101,7 @@
|
101
|
101
|
</el-radio-group>
|
102
|
102
|
</el-form-item>
|
103
|
103
|
<el-form-item label="项目备注">
|
104
|
|
- <div id="websiteEditorElem" style="height: 400px"></div>
|
|
104
|
+ <rich-editor v-model="building.remark" style="height: 400px" />
|
105
|
105
|
</el-form-item>
|
106
|
106
|
<el-form-item label="楼盘区域">
|
107
|
107
|
<el-input v-model="building.buildingArea"></el-input>
|
|
@@ -238,14 +238,10 @@
|
238
|
238
|
import { createNamespacedHelpers } from 'vuex'
|
239
|
239
|
import apis from '../../config/api'
|
240
|
240
|
import { mapState } from 'vuex'
|
241
|
|
-import E from 'wangeditor'
|
242
|
241
|
|
243
|
242
|
const { mapState: mapBuildingState, mapActions: mapBuildingActions, mapMutations: mapBuildingMutations } = createNamespacedHelpers('building')
|
244
|
|
-
|
245
|
243
|
const { mapActions: mapApartmentActions } = createNamespacedHelpers('apartment')
|
246
|
244
|
|
247
|
|
-const { mapActions: mapImgActions } = createNamespacedHelpers('img')
|
248
|
|
-
|
249
|
245
|
export default {
|
250
|
246
|
data () {
|
251
|
247
|
var _self = this
|
|
@@ -334,9 +330,6 @@ export default {
|
334
|
330
|
'editApartment',
|
335
|
331
|
'deleteApartment'
|
336
|
332
|
]),
|
337
|
|
- ...mapImgActions([
|
338
|
|
- 'uploadImg'
|
339
|
|
- ]),
|
340
|
333
|
getSaleTypeName (id) {
|
341
|
334
|
return (this.saleType.filter(x => x.id == id) [0] || {}).name
|
342
|
335
|
},
|
|
@@ -503,54 +496,37 @@ export default {
|
503
|
496
|
this.getAparmentList()
|
504
|
497
|
})
|
505
|
498
|
})
|
|
499
|
+ },
|
|
500
|
+ initData () {
|
|
501
|
+ if ((this.$route.query.id || '') !== '') {
|
|
502
|
+ this.getAparmentList()
|
|
503
|
+ this.getDetail({id: this.$route.query.id}).then(data => {
|
|
504
|
+ this.buildingProperty = data.propertyType.split(',')
|
|
505
|
+ this.imgList = data.buildingImg.map(x => {
|
|
506
|
+ return {
|
|
507
|
+ name: x.imgId,
|
|
508
|
+ url: x.url
|
|
509
|
+ }
|
|
510
|
+ })
|
|
511
|
+ this.tags = data.buildingTag.map(x => x.tagName)
|
|
512
|
+ })
|
|
513
|
+ }
|
506
|
514
|
}
|
507
|
515
|
},
|
508
|
516
|
mounted () {
|
509
|
|
- const _that = this
|
510
|
|
- const phoneEditor = new E('#websiteEditorElem')
|
511
|
|
- phoneEditor.customConfig.onchange = function (html) {
|
512
|
|
- _that.building = {..._that.building, remark: html}
|
513
|
|
- }
|
514
|
|
- phoneEditor.customConfig.customUploadImg = function (files, insert) {
|
515
|
|
- _that.uploadImg(files[0]).then(data => {
|
516
|
|
- insert(data[0])
|
517
|
|
- })
|
518
|
|
- }
|
519
|
|
- phoneEditor.customConfig.menus = [
|
520
|
|
- 'head', // 标题
|
521
|
|
- 'bold', // 粗体
|
522
|
|
- 'fontSize', // 字号
|
523
|
|
- 'fontName', // 字体
|
524
|
|
- 'italic', // 斜体
|
525
|
|
- 'underline', // 下划线
|
526
|
|
- 'strikeThrough', // 删除线
|
527
|
|
- 'foreColor', // 文字颜色
|
528
|
|
- 'backColor', // 背景颜色
|
529
|
|
- 'justify', // 对齐方式
|
530
|
|
- 'image', // 插入图片
|
531
|
|
- ]
|
532
|
|
- phoneEditor.create()
|
533
|
|
- if ((this.$route.query.id || '') !== '') {
|
534
|
|
- this.getAparmentList()
|
535
|
|
- window.console.log(this.getDetail)
|
536
|
|
- this.getDetail({id: this.$route.query.id}).then(data => {
|
537
|
|
- this.buildingProperty = data.propertyType.split(',')
|
538
|
|
- phoneEditor.txt.html(data.remark)
|
539
|
|
- this.imgList = data.buildingImg.map(x => {
|
540
|
|
- return {
|
541
|
|
- name: x.imgId,
|
542
|
|
- url: x.url
|
543
|
|
- }
|
544
|
|
- })
|
545
|
|
- this.tags = data.buildingTag.map(x => x.tagName)
|
546
|
|
- })
|
547
|
|
- } else {
|
548
|
|
- phoneEditor.txt.html('')
|
549
|
|
- }
|
|
517
|
+ this.initData()
|
550
|
518
|
}
|
551
|
519
|
}
|
552
|
520
|
</script>
|
553
|
521
|
|
|
522
|
+<style lang="scss" scoped>
|
|
523
|
+.building-form {
|
|
524
|
+ width: 60%;
|
|
525
|
+ min-width: 500px;
|
|
526
|
+}
|
|
527
|
+</style>
|
|
528
|
+
|
|
529
|
+
|
554
|
530
|
<style lang="scss">
|
555
|
531
|
.header{
|
556
|
532
|
width: 50px;
|