230320a303 2 年之前
父節點
當前提交
941f6a48dc

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-6e5da2bd.a742f2bc.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-e44beb78.91304cdf.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-f3c367f6.b133293e.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.26126857.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-6a7b0822.05c500ae.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-6e5da2bd.482cb142.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-e44beb78.11661516.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-f3c367f6.e44d1516.js


+ 22 - 0
src/api/facility.js

@@ -0,0 +1,22 @@
+/**
+  * 房
+*/
+import { getRequest, getRequestNoSort } from '@/utils/request'
+
+export default {
+  admfacilitylist: params => { // 公共配套 列表接口
+    return getRequest('/adm/facility/list', params)
+  },
+  admfacilityadd: params => { // 公共配套 添加
+    return getRequestNoSort('/adm/facility/add', params, 'loading')
+  },
+  admfacilityedit: params => { // 公共配套 编辑
+    return getRequestNoSort('/adm/facility/edit', params, 'loading')
+  },
+  admfacilitydetail: params => { // 公共配套 详情
+    return getRequestNoSort('/adm/facility/detail', params, 'loading')
+  },
+  admfacilitydel: params => { // 公共配套 删除
+    return getRequestNoSort('/adm/facility/del', params, 'loading')
+  },
+}

+ 2 - 0
src/api/index.js

@@ -3,10 +3,12 @@ import house from './house'
 import user from './user'
 import other from './other'
 import school from './school'
+import facility from './facility'
 export default {
   base,
   house,
   user,
   other,
   school,
+  facility,
 }

+ 279 - 0
src/views/facillity/components/popup/IndexEdit.vue

@@ -0,0 +1,279 @@
+<template>
+  <div>
+    <el-dialog
+      v-loading="loading"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="'编辑公共配套'"
+      :fullscreen="false"
+      width="700px"
+      custom-class="xl-dialog"
+      center
+    >
+      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px" :insertSlotArr="[3,5]">
+        <div slot="OI3" class="scoped-img-area">
+          <div class="sia-title">更多图片</div>
+          <div class="sia-op" v-for="(imgsrc,index) in imagesArr" :key="index">
+            <img class="img" :src="imgsrc + '_adm0'" alt="img" @click="openbigImg(imgsrc + '_adm0')">
+            <span class="close" @click="imgDel(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" />
+          </el-upload>
+        </div>
+        <div slot="OI5" class="scoped-other-form">
+          <el-form-item label="点位坐标" class="scoped-item-two item">
+            纬度N<el-input v-model="cObj.latitude" disabled />
+            经度E<el-input v-model="cObj.longitude" disabled />
+            <el-button type="primary" class="map-btn" size="small" @click="handleMap">点击从地图获取</el-button>
+          </el-form-item>
+        </div>
+        <div slot="footer" style="padding-top: 20px;">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </base-form>
+    </el-dialog>
+    <handle-map :is-show="isShowMap" @close="closeMap" />
+    <popup-big-img :is-show="bigImgShow" :src="`${bigImgSrc}`" @close="closebigImg" />
+  </div>
+</template>
+<script>
+import handleMap from '@/components/Common/Map'
+import bigImgPopup from '_m/bigImgPopup.js'
+export default {
+  components: { handleMap },
+  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 {
+      imagesArr: [],
+      domainUrl,
+      token,
+      formData: [],
+      loading: true,
+      cObj: {},
+      isShowMap: false
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        if (this.curObj.id) {
+          this.$api.facility.admfacilitydetail({id: this.curObj.id}).then(res => {
+            let curData = res || {}
+            this.cObj = curData || {}
+            if (curData.images && curData.images.length > 0) this.imagesArr = curData.images.split(',')
+            this.getDef()
+          })
+        } else {
+          this.cObj = this.curObj
+          this.getDef()
+        }
+      }
+    },
+  },
+  methods: {
+    imgDel (index) {
+      this.imagesArr.splice(index, 1)
+      this.imagesArr = [...this.imagesArr]
+    },
+    roomAreaUploadSuccess(res, file) {
+      const data = res.data || {}
+      let urls = this.imagesArr || []
+      urls.push(`${data.url}`)
+      this.imagesArr = 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
+    },
+    getDef (str) {
+      let params = { ...this.cObj }
+      this.formData = [
+        { label: '名称', key: 'name', class: 'c-2', rules: 1 },
+        { label: '排序', key: 'sort', class: 'c-2', rules: 1 },
+        { label: '主图', key: 'pri_image', type: 'upload', class: 'c-2', rules: 1 },
+        { label: '航拍背景图', key: 'vr_image', class: 'c-2', type: 'cuImg',
+          options: {
+            w: 375,
+            h: 250,
+          }
+        },
+        { label: '当前航拍key', key: 'vr_key', class: 'c-2'},
+        { label: '地址', key: 'address' },
+        { label: '备注', key: 'remarked', type: 'textarea' },
+      ]
+      params.pri_image = this.IMadd(params.pri_image)
+      if (!params.sort) params.sort = 1
+      this.setDefaultValue(params)
+    },
+    close(str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            const newForm = { ...oldform }
+            newForm.longitude = this.cObj.longitude
+            newForm.latitude = this.cObj.latitude
+            newForm.pri_image = this.IMdel(newForm.pri_image)
+            if (this.imagesArr && this.imagesArr.length > 0) {
+              newForm.images = this.imagesArr.join(',')
+            }
+            if (!newForm.longitude) return this.$msgw('请选择经度!')
+            else if (!newForm.latitude) return this.$msgw('请选择纬度!')
+            let apiStr = 'admfacilityadd'
+            if (this.curObj.id) {
+              newForm.id = this.curObj.id
+              apiStr = 'admfacilityedit'
+            }
+            this.$api.facility[apiStr](newForm).then(data => {
+              this.$msgs(this.curObj.id ? '编辑成功' : '新增成功')
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    },
+    handleMap() { // 定位
+      this.isShowMap = true
+      const pointObj = {
+        latitude: this.cObj.latitude || '',
+        longitude: this.cObj.longitude || '',
+        address: this.cObj.address || ''
+      }
+      this.$root.$emit('handleMap', pointObj)
+    },
+    closeMap(obj) {
+      if (obj) {
+        const oldform = this.$refs.ruleForm.baseForm
+        const newForm = { ...oldform, ...obj }
+        this.cObj = newForm
+        this.setDefaultValue(newForm)
+      }
+      this.isShowMap = false
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+@import '../../../../styles/libEdit.scss';
+.lib-edit {
+  padding-top: 0;
+  ::v-deep .el-form-item {
+    margin-bottom: 10px;
+  }
+  ::v-deep .el-date-editor.el-input {
+    width: 100%;
+  }
+}
+.scoped-other-form {
+  .scoped-item-two {
+    .el-input {
+      display: inline-block;
+      width: 115px;
+      margin: 0 10px;
+      ::v-deep input {
+        text-align: center;
+      }
+    }
+  }
+}
+.map-btn{
+  height: 36px;
+}
+
+
+
+
+
+
+.scoped-img-area {
+  padding-left: 40px;
+  margin-bottom: 20px;
+  .sia-title {
+    font-size: 14px;
+    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>

+ 30 - 0
src/views/facillity/components/searchForm/Index.vue

@@ -0,0 +1,30 @@
+<template>
+  <base-form slot="content" ref="ruleForm" :data="searchData">
+    <div slot="footer">
+      <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
+      <!-- <el-button :loading="listLoading" icon="el-icon-document" class="xl-form-btn bgc2" @click="toExportExcel">导出{{ this.$route.meta.title }}信息</el-button> -->
+    </div>
+  </base-form>
+</template>
+<script>
+export default {
+  props: {
+    listLoading: Boolean
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      searchData: [
+        { label: '名称', key: 'name' },
+      ]
+    }
+  },
+  methods: {
+    searchHandle() {
+      const oldform = this.$refs.ruleForm.baseForm
+      const newForm = { ...oldform }
+      this.$emit('change', newForm)
+    }
+  }
+}
+</script>

二進制
src/views/facillity/img/icon_g_close.png


+ 106 - 0
src/views/facillity/index.vue

@@ -0,0 +1,106 @@
+<template>
+  <div class="app-container">
+    <search-form
+      :list-loading="listLoading"
+      @change="searchHandle"
+    />
+    <table-list
+      :list-loading="listLoading"
+      :data="tableData2"
+      :columns="listConfig"
+      :current-page="currentPage"
+      :page-size="pageSize"
+      :total-records="totalRecords"
+      @currentChange="pageHandle"
+      @sizeChange="sizeChange"
+      :isAdd="true"
+      @add="openPopup"
+      :operationsDefaultLength="6"
+    />
+    <popup-edit
+      :isShow="isDtlShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/Index'
+import PopupEdit from './components/popup/IndexEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'index',
+  components: {
+    SearchForm,
+    PopupEdit,
+  },
+  provide() {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data() {
+    return {
+      apiStr: 'facility.admfacilitylist',
+      searchForm: null,
+      isDtlShow: false,
+      curObj: {},
+    }
+  },
+  computed: {
+    tableData2() {
+      const arr = [...this.tableData]
+      arr.map(item => {
+        item.pri_image = this.IMadd(item.pri_image)
+      })
+      return arr
+    }
+  },
+  created() {},
+  mounted() {
+    this.listConfig = {
+      rows: [
+        { label: '排序', prop: 'sort', type: 'input', width: 80},
+        { label: '名称', prop: 'name', fullShow: true, minWidth: 200, align: "left" },
+        { label: '图片', prop: 'pri_image', type: 'img' },
+        { label: '备注', prop: 'remarked', fullShow: true, minWidth: 300, align: "left" },
+        { label: '更新时间', prop: 'update_at' },
+        { label: '操作', width: 200, type: 'handle2', operations:
+          [
+            { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '删除', func: this.delHandle, btnType: 'danger' },
+          ]
+        }
+      ]
+    }
+  },
+  methods: {
+    delHandle(row) {
+      this.$msg(`您确定要删除该配套吗?`, 'confirm', () => {
+        this.$api.facility.admfacilitydel({
+          id: row.id,
+        }).then(data => {
+          this.$msgs(`已删除!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    openPopup(row) {
+      if (row && row.id) {
+        this.curObj = row
+      } else {
+        this.curObj = {}
+      }
+      this.isDtlShow = true
+    },
+    closePopup(obj) {
+      this.isDtlShow = false
+      if (obj) {
+        this.fetchData() 
+      }
+    }
+  }
+}
+</script>

+ 7 - 0
src/views/school/components/popup/IndexEdit.vue

@@ -149,6 +149,13 @@ export default {
           { label: '主图', key: 'pri_image', type: 'upload', class: 'c-2' },
           { label: '学区范围图', key: 'district_img', type: 'upload', class: 'c-2' },
           { label: '学区范围', key: 'district',type: 'textarea' },
+          { label: '当前航拍key', key: 'vr_key', class: 'c-2'},
+          { label: '航拍背景图', key: 'vr_image', class: 'c-2', type: 'cuImg',
+            options: {
+              w: 375,
+              h: 250,
+            }
+          },
           { label: '对口楼盘', key: 'estate_dk_list', multiple: true, type: 'selectRemote',
             remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
             remoteOptions: remoteOptionsHouse

Some files were not shown because too many files changed in this diff