230320a303 1 tahun lalu
induk
melakukan
c61c04c013

File diff ditekan karena terlalu besar
+ 0 - 0
dist/index.html


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/css/chunk-c427f250.150d9906.css


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/app.36314a1e.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/app.49913ce9.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/chunk-c0120d04.cb1e63fb.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/chunk-c427f250.fea41767.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/chunk-df23cf0c.e7942bc4.js


+ 6 - 0
src/api/house.js

@@ -37,6 +37,12 @@ export default {
   admestatephotoedit: params => { // 楼盘相册编辑接口
     return getRequestNoSort('/adm/estate/photo/edit', params, 'loading')
   },
+  estateprivimglist: params => { // 楼盘相册2接口
+    return getRequestNoSort('/adm/estate/privimg/list', params, 'loading')
+  },
+  estateprivimgedit: params => { // 楼盘相册2编辑接口
+    return getRequestNoSort('/adm/estate/privimg/edit', params, 'loading')
+  },
   admestatenewslist: params => { // 楼盘动态列表接口
     return getRequest('/adm/estate/news/list', params)
   },

+ 210 - 0
src/views/house/components/popup/PhotoEdit2.vue

@@ -0,0 +1,210 @@
+<template>
+  <div>
+    <el-drawer
+      v-loading="loading"
+      :show-close="false"
+      :title="'编辑相册'"
+      :wrapper-closable="false"
+      :close-on-press-escape="false"
+      :visible.sync="isShow"
+      size="960px"
+      custom-class="xl-drawer"
+      direction="rtl"
+    >
+      <div class="scoped-img-area" v-for="(item, iIndex) in imagesArr" :key="iIndex">
+        <div class="sia-title">{{item.key}}</div>
+        <div class="sia-op" v-for="(imgsrc,index) in item.urls" :key="index">
+          <img class="img" :src="imgsrc + '_adm0'" alt="img" @click="openbigImg(imgsrc + '_adm0')">
+          <span class="close" @click="imgDel(iIndex, index)"></span>
+        </div>
+        <el-upload
+          class="sia-img"
+          :action="`${domainUrl}/adm/upload/cloud`"
+          :data="{logic_type: 'estate', token}"
+          name="upload"
+          :show-file-list="false"
+          :on-success="roomAreaUploadSuccess"
+          :before-upload="roomAreaUploadBefore"
+          >
+          <i class="el-icon-plus icon" @click="addImgHandle(iIndex)" />
+        </el-upload>
+      </div>
+      <div class="xl-form">
+        <div class="xl-form-footer fixed" style="width:960px;padding-top: 20px;border-top: 1px solid #dcdcdc;right:0;">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </div>
+    </el-drawer>
+    <popup-big-img :is-show="bigImgShow" :src="`${bigImgSrc}`" @close="closebigImg" />
+  </div>
+</template>
+<script>
+import bigImgPopup from '_m/bigImgPopup.js'
+export default {
+  components: { },
+  mixins: [...mixins, bigImgPopup],
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    let domainUrl = process.env.VUE_APP_BASE_API
+    const token = window.sessionStorage.getItem('fp_token')
+    return {
+      domainUrl,
+      token,
+      loading: false,
+      formData: [],
+      cObj: {},
+      isShowMap: false,
+      imagesArr: [],
+      curIndex: 0,
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        let imagesArr = [{key: '内部相册库', val: 1}]
+        if (this.curObj.id) {
+          this.loading = true
+          this.$api.house.estateprivimglist({estate_id: this.curObj.id}).then(res => {
+            let curArr = res.data ? JSON.parse(res.data) : []
+            curArr.forEach(item => {
+              imagesArr.map(one => {
+                if (item.val === one.val) {
+                  one.urls = item.urls
+                }
+              })
+            })
+            this.imagesArr = [...imagesArr]
+            this.loading = false
+          }).catch(err => {
+            this.loading = false
+          })
+        }
+      }
+    },
+  },
+  methods: {
+    addImgHandle (index) {
+      this.curIndex = index
+    },
+    imgDel (iIndex, index) {
+      this.imagesArr[iIndex].urls.splice(index, 1)
+      this.imagesArr = [...this.imagesArr]
+    },
+    roomAreaUploadSuccess(res, file) {
+      const data = res.data || {}
+      let urls = this.imagesArr[this.curIndex].urls || []
+      urls.push(`${data.url}`)
+      this.imagesArr[this.curIndex].urls = urls
+      this.imagesArr = [...this.imagesArr]
+    },
+    roomAreaUploadBefore(file) {
+      const isJPGPNG = file.type === 'image/jpeg' || file.type === 'image/png'
+      const isLt2M = file.size / 1024 / 1024 < 2
+      if (!isJPGPNG) {
+        this.$message.error('上传图片只能是 JPG PNG 格式!')
+      }
+      if (!isLt2M) {
+        this.$message.error('上传图片大小不能超过 2M!')
+      }
+      return isJPGPNG && isLt2M
+    },
+    close (str) {
+      if (str === 'confirm') {
+        const newForm = { }
+        if (this.curObj.id) newForm.estate_id = this.curObj.id
+        let cArr = []
+        this.imagesArr.forEach(obj => {
+          const imgArr = obj.urls || []
+          if (imgArr.length > 0) {
+            cArr.push({
+              key: obj.key,
+              val: obj.val,
+              urls: imgArr
+            })
+          } 
+        })
+        newForm.private_img = JSON.stringify(cArr)
+        let apiStr = 'estateprivimgedit'
+        if (this.curObj.id) apiStr = 'estateprivimgedit'
+        this.$api.house[apiStr](newForm).then(data => {
+          this.$msgs(newForm.id ? '编辑成功' : '新增成功')
+          this.$emit('close', newForm)
+          this.curIndex = 0
+        })
+      } else {
+        this.$emit('close')
+        this.curIndex = 0
+      }
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+.scoped-img-area {
+  padding-left: 20px;
+  margin-bottom: 20px;
+  .sia-title {
+    font-size: 16px;
+    padding-bottom: 10px;
+    color: #666;
+    font-weight: bold;
+  }
+  .sia-op {
+    display: inline-block;
+    vertical-align: middle;
+    margin-right: 10px;
+    margin-bottom: 10px;
+    border: 1px solid #f2f2f2;
+    width: 80px;
+    height: 80px;
+    position: relative;
+    &:hover {
+      .img-big {
+        display: block;
+      }
+    }
+    .img {
+      width: 80px;
+      height: 80px;
+    }
+    .close {
+      position: absolute;
+      width: 20px;
+      height: 20px;
+      top: -10px;
+      right: -10px;
+      background: url(../../../../assets/icon_g_close.png) no-repeat;
+      background-size: 20px;
+      cursor: pointer;
+    }
+    .img-big {
+      position: absolute;
+      bottom: 0;
+      left: 0;
+      width: 400px;
+      height: auto;
+      display: none;
+      box-shadow: 10px 10px 10px #ccc;
+      z-index: 99;
+    }
+  }
+  .sia-img {
+    display: inline-block;
+    vertical-align: middle;
+    width: 80px;
+    height: 80px;
+    overflow: hidden;
+    border: 1px dashed #999;
+    margin-bottom: 10px;
+    .el-icon-plus {
+      color: #999;
+      padding: 30px;
+    }
+  }
+}
+</style>

+ 23 - 0
src/views/house/index.vue

@@ -47,6 +47,11 @@
       :curObj="curObj"
       @close="closePhotoPopup"
     />
+    <photo2-edit
+      :isShow="isPhoto2Show"
+      :curObj="curObj"
+      @close="closePhoto2Popup"
+    />
     <vr-edit
       :isShow="isVrShow"
       :curObj="curObj"
@@ -69,6 +74,7 @@ import { arrToObj } from '@/utils'
 import SearchForm from './components/searchForm/Index'
 import PopupEdit from './components/popup/IndexEdit'
 import PhotoEdit from './components/popup/PhotoEdit'
+import Photo2Edit from './components/popup/PhotoEdit2'
 import VrEdit from './components/popup/VrEdit'
 import ThemeHouseEdit from './components/popup/ThemeHouseEdit'
 import HelpRule from './components/popup/HelpRule'
@@ -79,6 +85,7 @@ export default {
     SearchForm,
     PopupEdit,
     PhotoEdit,
+    Photo2Edit,
     VrEdit,
     ThemeHouseEdit,
     HelpRule,
@@ -95,6 +102,7 @@ export default {
       searchForm: null,
       isDtlShow: false,
       isPhotoShow: false,
+      isPhoto2Show: false,
       isVrShow: false,
       // noCreated: true,
       curObj: {},
@@ -152,6 +160,7 @@ export default {
             { label: '保存排序', func: this.saveHandle, btnType: 'success' },
             { label: '编辑信息', func: this.openPopup, btnType: 'primary' },
             { label: '编辑相册', func: this.openPhotoPopup, btnType: 'info' },
+            { label: '内部相册库', func: this.openPhoto2Popup, btnType: 'info' },
             { label: '楼盘航拍', func: this.openVrPopup, btnType: 'primary' },
             { label: '置业顾问', func: this.openSale, btnType: 'info' },
             { label: '楼盘动态', func: this.openNews, btnType: 'info' },
@@ -235,6 +244,20 @@ export default {
         this.fetchData()
       }
     },
+    openPhoto2Popup(row) {
+      if (row && row.id) {
+        this.curObj = row
+      } else {
+        this.curObj = {}
+      }
+      this.isPhoto2Show = true
+    },
+    closePhoto2Popup(obj) {
+      this.isPhoto2Show = false
+      if (obj) {
+        this.fetchData()
+      }
+    },
     openPopup(row) {
       if (row && row.id) {
         this.curObj = row

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini