liujq 3 years ago
parent
commit
4620b17c0a

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-1f740d40.9cb4d303.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-76743eb9.2c93cff9.css


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


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


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-02eb56e6.f7e4e444.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-1f740d40.30c3260a.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-76743eb9.6dacee40.js


+ 3 - 0
src/api/house.js

@@ -259,4 +259,7 @@ export default {
   admestatevrdetail: params => { // 楼盘航拍 - 详情
     return getRequestNoSort('/adm/estate/vr/detail', params, 'loading')
   },
+  admestateupdateprice: params => { // 楼盘自动更新均价 开关
+    return getRequestNoSort('/adm/estate/update/price', params, 'loading')
+  },
 }

+ 25 - 0
src/api/other.js

@@ -214,4 +214,29 @@ export default {
   admbankratedel: params => { // 银行利率管理 - 删除
     return getRequestNoSort('/adm/bank/rate/del', params, 'loading')
   },
+  admbrandlist: params => { // 广告- 品牌 - 列表
+    return getRequest('/adm/brand/list', params)
+  },
+  admbrandedit: params => { // 广告- 品牌 - 编辑
+    return getRequestNoSort('/adm/brand/edit', params, 'loading')
+  },
+  admbrandadd: params => { // 广告- 品牌 - 添加
+    return getRequestNoSort('/adm/brand/add', params, 'loading')
+  },
+  admbranddel: params => { // 广告- 品牌 - 删除
+    return getRequestNoSort('/adm/brand/del', params, 'loading')
+  },
+  admbranddatalist: params => { // 广告- 品牌 楼盘数据 - 列表
+    return getRequest('/adm/brand/data/list', params)
+  },
+  admbranddataedit: params => { // 广告- 品牌 楼盘数据 - 编辑
+    return getRequestNoSort('/adm/brand/data/edit', params, 'loading')
+  },
+  admbranddataadd: params => { // 广告- 品牌 楼盘数据 - 添加
+    return getRequestNoSort('/adm/brand/data/add', params, 'loading')
+  },
+  admbranddatadel: params => { // 广告- 品牌 楼盘数据 - 删除
+    return getRequestNoSort('/adm/brand/data/del', params, 'loading')
+  },
 }
+

+ 0 - 9
src/api/table.js

@@ -1,9 +0,0 @@
-import request from '@/utils/request'
-
-export function getList(params) {
-  return request({
-    url: '/vue-admin-template/table/list',
-    method: 'get',
-    params
-  })
-}

+ 98 - 0
src/views/ad/brand.vue

@@ -0,0 +1,98 @@
+<template>
+  <div class="app-container">
+    <search-form
+      :listLoading="listLoading"
+      @change="searchHandle"
+      @add="openPopup"
+    />
+    <table-list
+      :operationsDefaultLength="3"
+      :listLoading="listLoading"
+      :data="tableData"
+      :columns="listConfig"
+      :currentPage="currentPage"
+      :pageSize="pageSize"
+      :totalRecords="totalRecords"
+      @currentChange="pageHandle"
+      :isAdd="true"
+      @add="openPopup"
+    />
+    <popup-edit
+      :isShow="isPopupShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/Brand'
+import PopupEdit from './components/popup/BrandEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'x',
+  components: {
+    SearchForm,
+    PopupEdit
+  },
+  provide () {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  created () {},
+  data () {
+    return {
+      apiStr: 'other.admbrandlist',
+      searchForm: null,
+      isPopupShow: false,
+      // noCreated: true,
+      curObj: {}
+    }
+  },
+  mounted () {
+    this.listConfig = {
+      rows: [
+        { label: '品牌', prop: 'brand_name' },
+        { label: '品牌地图', prop: 'pri_image', type: 'img' },
+        { label: '更新人', prop: 'update_by' },
+        { label: '更新时间', prop: 'update_at' },
+        { label: '操作', width: 230, type: 'handle2',
+          operations: [
+            { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '楼盘列表', func: this.linkDtl, btnType: 'success' },
+            { label: '删除', func: this.delHandle, btnType: 'danger', hide: 'nosys' },
+          ]
+        }
+      ]
+    }
+  },
+  methods: {
+    delHandle (row) {
+      const msgHtml = `确定要删除该品牌吗?`
+      this.$msg(msgHtml, 'confirm', ()=> {
+        this.$api.other.admbranddel({
+          id: row.id,
+        }).then(data => {
+          this.$msgs(`删除成功!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    linkDtl (row) {
+      this.$router.push(`/ad/brandDtl?id=${row.id}&brand_name=${row.brand_name}`)
+    },
+    openPopup (row) {
+      this.curObj = row || {}
+      this.isPopupShow = true
+    },
+    closePopup (obj) {
+      this.isPopupShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    }
+  }
+}
+</script>

+ 106 - 0
src/views/ad/brandDtl.vue

@@ -0,0 +1,106 @@
+<template>
+  <div class="app-container">
+    <search-form/>
+    <table-list
+      :listLoading="listLoading"
+      :data="tableData2"
+      :columns="listConfig"
+      :currentPage="currentPage"
+      :pageSize="pageSize"
+      :totalRecords="totalRecords"
+      @currentChange="pageHandle"
+      :isAdd="true"
+      @add="openPopup"
+    />
+    <popup-edit
+      :isShow="isPopupShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/BrandDtl'
+import PopupEdit from './components/popup/BrandDtlEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'x',
+  components: {
+    SearchForm,
+    PopupEdit
+  },
+  provide () {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data () {
+    return {
+      apiStr: 'other.admbranddatalist',
+      searchForm: null,
+      isPopupShow: false,
+      noCreated: true,
+      curObj: {},
+      curId: '',
+    }
+  },
+  computed: {
+    tableData2 () {
+      let arr = [...this.tableData]
+      arr.map(item => {
+        if (Number(item.system) === 1) item.nosys = true
+      })
+      return arr
+    }
+  },
+  mounted () {
+    this.listConfig = {
+      rows: [
+        { label: '排序', prop: 'sort' },
+        { label: '楼盘ID', prop: 'estate_id' },
+        { label: '宣传图', prop: 'pri_image', type: 'img' },
+        { label: '更新人', prop: 'update_by' },
+        { label: '更新时间', prop: 'update_at' },
+        { label: '操作', width: 200, type: 'handle2',
+          operations: [
+            { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '删除', func: this.delHandle, btnType: 'danger', hide: 'nosys' },
+          ]
+        }
+      ]
+    }
+    const query = this.$route.query
+    if (query.id) {
+      this.searchForm = {
+        id: query.id
+      }
+      this.fetchData()
+    }
+  },
+  methods: {
+    delHandle (row) {
+      const msgHtml = `确定要删除该楼盘吗?`
+      this.$msg(msgHtml, 'confirm', ()=> {
+        this.$api.other.admbranddatadel({
+          id: row.id,
+        }).then(data => {
+          this.$msgs(`删除成功!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    openPopup (row) {
+      this.curObj = row || {}
+      this.isPopupShow = true
+    },
+    closePopup (obj) {
+      this.isPopupShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    }
+  }
+}
+</script>

+ 76 - 0
src/views/ad/components/popup/BrandDtlEdit.vue

@@ -0,0 +1,76 @@
+<template>
+<el-dialog
+  v-loading="loading"
+  :show-close="false"
+  :close-on-click-modal="false"
+  :visible.sync="isShow"
+  :title="this.curObj && this.curObj.typeName ? '编辑字典' : '添加字典'"
+  :fullscreen="false"
+  width="470px"
+  custom-class="xl-dialog"
+  center>
+  <base-form style="width:400px" :data="formData" ref="ruleForm" :isInline="false" labelWidth="100px">
+    <div slot="footer">
+      <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>
+</template>
+<script>
+export default {
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  mixins,
+  data() {
+    return {
+      formData: [],
+      loading: true
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        let params = {...this.curObj}
+        this.formData = [
+          { label: '楼盘', key: 'estate_id', rules: 1, type: 'selectRemote',
+            remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
+          },
+          { label: '宣传图', key: 'pri_image', type: 'uploads', rules: 1 },
+          { label: '排序', key: 'sort' },
+        ]
+        this.setDefaultValue(params)
+      }
+    }
+  },
+  methods: {
+    close (str) {
+      if (str === 'confirm' || str === 'next') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            let params = {...oldform}
+            let apiStr = 'admbranddataadd'
+            if(this.curObj && this.curObj.id) {
+              params.id = this.curObj.id
+              apiStr = 'admbranddataedit'
+            } else {
+              params.brands_id = this.parentData.searchForm.id
+            }
+            this.$api.other[apiStr](params).then(data => {
+              this.$msgs('保存成功!')
+              this.$emit('close', params)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    }
+  }
+}
+</script>

+ 202 - 0
src/views/ad/components/popup/BrandEdit.vue

@@ -0,0 +1,202 @@
+<template>
+  <div>
+    <el-dialog
+      v-loading="loading"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="curObj.id ? '编辑广告' : '添加广告'"
+      :fullscreen="false"
+      width="700px"
+      custom-class="xl-dialog"
+      center
+    >
+      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="100px">
+        <div slot="footer" style="padding-top: 20px;">
+          <el-button :class="curBannerIndex - 1 === 0 ? 'xl-form-btn t3' : 'xl-form-btn t2'" @click="bannerHandle(1)">banner1</el-button>
+          <el-button :class="curBannerIndex - 1 === 1 ? 'xl-form-btn t3' : 'xl-form-btn t2'" @click="bannerHandle(2)">banner2</el-button>
+          <el-button :class="curBannerIndex - 1 === 2 ? 'xl-form-btn t3' : 'xl-form-btn t2'" @click="bannerHandle(3)">banner3</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+        </div>
+      </base-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+export default {
+  components: { },
+  mixins,
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      formData: [],
+      loading: true,
+      cObj: {},
+      bannerArr: [{},{},{}],
+      curBannerIndex: 1
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        this.bannerArr = this.curObj.banner ? JSON.parse(this.curObj.banner) : [{},{},{}]
+        let curBannerObj = this.bannerArr[1]
+        this.cObj = {...this.curObj,
+          ad_link_img: curBannerObj.ad_link_img,
+          ad_link_type: curBannerObj.ad_link_type,
+          link_type_value: Number(curBannerObj.link_type_value),
+          link_type_name: curBannerObj.link_type_name,
+        }
+        this.getDef()
+      }
+    },
+  },
+  methods: {
+    bannerHandle (index) {
+      const oldform = this.$refs.ruleForm.baseForm
+      let bannerArr = [...this.bannerArr]
+      bannerArr[this.curBannerIndex - 1] = {
+        ad_link_img: oldform.ad_link_img,
+        ad_link_type: oldform.ad_link_type,
+        link_type_value: Number(oldform.link_type_value),
+      }
+      this.bannerArr = [...bannerArr]
+      this.curBannerIndex = index
+      this.getDef('bannerChange')
+    },
+    getDef(fieldStr) {
+      let params = { ...this.cObj }
+      if (fieldStr === 'linkType') {
+        const oldform = this.$refs.ruleForm.baseForm
+        params = {...this.cObj, ...oldform}
+        delete params.link_type_value
+      }
+      if (fieldStr === 'bannerChange') {
+        let curBannerObj = this.bannerArr[this.curBannerIndex - 1]
+        const oldform = this.$refs.ruleForm.baseForm
+        params = {...oldform}
+        params.ad_link_img = curBannerObj.ad_link_img
+        params.ad_link_type = curBannerObj.ad_link_type
+        params.link_type_value = Number(curBannerObj.link_type_value)
+        params.link_type_name = curBannerObj.link_type_name
+      }
+      if (params.ad_link_type === 'estate') {
+        this.formData = [
+          { label: '品牌馆标题', key: 'brand_name', rules: 1 },
+          { label: '品牌地图', key: 'pri_image', type: 'uploads' },
+          { label: `banner${this.curBannerIndex}图`, key: 'ad_link_img', class: 'c-2', type: 'uploads' },
+          { label: `banner${this.curBannerIndex}类型`, key: 'ad_link_type', type: 'select', class: 'c-2', options: this.$dictData.ad_link_type, changeHandle: this.linkTypeHandle, },
+          { label: '关联楼盘', key: 'link_type_value', type: 'selectRemote', class: 'scoped-two-add', changeHandle: this.ltValHandle,
+            remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
+            remoteOptions: [{ keyRO: params.link_type_name, valRO: params.link_type_value }]
+          },
+        ]
+      } else if (params.ad_link_type === 'news') {
+        this.formData = [
+          { label: '品牌馆标题', key: 'brand_name', rules: 1 },
+          { label: '品牌地图', key: 'pri_image', type: 'uploads' },
+          { label: `banner${this.curBannerIndex}图`, key: 'ad_link_img', class: 'c-2', type: 'uploads' },
+          { label: `banner${this.curBannerIndex}类型`, key: 'ad_link_type', type: 'select', class: 'c-2', options: this.$dictData.ad_link_type, changeHandle: this.linkTypeHandle, },
+          { label: '关联文章', key: 'link_type_value', type: 'selectRemote', class: 'scoped-two-add', changeHandle: this.ltValHandle,
+            remoteParams: { skey: 'title', api: `house.adminformationlist`, opKey: 'title', opVal: 'id' },
+            remoteOptions: [{ keyRO: params.link_type_name, valRO: params.link_type_value }]
+          },
+        ]
+      } else if (params.ad_link_type === 'page') {
+        this.formData = [
+          { label: '品牌馆标题', key: 'brand_name', rules: 1 },
+          { label: '品牌地图', key: 'pri_image', type: 'uploads' },
+          { label: `banner${this.curBannerIndex}图`, key: 'ad_link_img', class: 'c-2', type: 'uploads' },
+          { label: `banner${this.curBannerIndex}类型`, key: 'ad_link_type', type: 'select', class: 'c-2', options: this.$dictData.ad_link_type, changeHandle: this.linkTypeHandle, },
+          { label: '关联页面', key: 'link_type_value', class: 'scoped-two-add',},
+        ]
+      } else {
+        this.formData = [
+          { label: '品牌馆标题', key: 'brand_name', rules: 1 },
+          { label: '品牌地图', key: 'pri_image', type: 'uploads' },
+          { label: `banner${this.curBannerIndex}图`, key: 'ad_link_img', class: 'c-2', type: 'uploads' },
+          { label: `banner${this.curBannerIndex}类型`, key: 'ad_link_type', type: 'select', class: 'c-2', options: this.$dictData.ad_link_type, changeHandle: this.linkTypeHandle, },
+        ]
+      }
+      this.setDefaultValue(params)
+    },
+    ltValHandle (val, item, op) {
+      this.bannerArr[this.curBannerIndex - 1].link_type_name = op.keyRO
+    },
+    linkTypeHandle (val) {
+      this.getDef('linkType')
+    },
+    close(str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            const banner1Obj = this.bannerArr[1]
+            if (this.curBannerIndex === 1 && oldform.ad_link_img && !banner1Obj.ad_link_img) {
+              this.bannerArr[1].ad_link_img = oldform.ad_link_img
+              this.bannerArr[1].ad_link_type = oldform.ad_link_type
+              this.bannerArr[1].link_type_value = oldform.link_type_value
+            }
+            const newForm = {
+              brand_name: oldform.brand_name,
+              pri_image: oldform.pri_image,
+              banner: JSON.stringify(this.bannerArr)
+            }
+            if (this.curObj.id) newForm.id = this.curObj.id
+            let apiStr = 'admbrandadd'
+            if (newForm.id) apiStr = 'admbrandedit'
+            this.$api.other[apiStr](newForm).then(data => {
+              this.$msgs(newForm.id ? '编辑成功' : '新增成功')
+              this.curBannerIndex = 1
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.curBannerIndex = 1
+        this.setDefaultValue()
+      }
+    },
+  }
+}
+</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%;
+  }
+}
+::v-deep .img-upload {
+  height: 100px;
+  overflow: hidden;
+  .icon {
+    width: 180px;
+    height: 98px;
+    line-height: 98px;
+  }
+  .img {
+    width: 180px;
+    height: 98px;
+  }
+}
+::v-deep .scoped-two-add {
+  position: absolute;
+  top: 266px;
+  right: 74px;
+  width: 292px!important;
+}
+
+
+
+</style>

+ 33 - 0
src/views/ad/components/searchForm/Brand.vue

@@ -0,0 +1,33 @@
+<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: 'title' },
+        { label: '广告状态', key: 'ad_status', type: 'select', class: 'c-3', options: this.$dictData.ad_status },
+        { label: '投放位置', key: 'ad_position', type: 'select', class: 'c-3', options: this.$dictData.ad_position },
+        { label: '链接类型', key: 'ad_link_type', type: 'select', class: 'c-3', options: this.$dictData.ad_link_type },
+      ]
+    }
+  },
+  methods: {
+    searchHandle() {
+      const oldform = this.$refs.ruleForm.baseForm
+      const newForm = { ...oldform }
+      this.$emit('change', newForm)
+    }
+  }
+}
+</script>

+ 34 - 0
src/views/ad/components/searchForm/BrandDtl.vue

@@ -0,0 +1,34 @@
+<template>
+  <base-form :noLabel="false" :data="searchData" ref="ruleForm">
+  </base-form>
+</template>
+<script>
+export default {
+  props: {
+    listLoading: Boolean
+  },
+  inject: ['parentData'],
+  mixins,
+  data () {
+    return {
+      searchData: [
+        {label: '品牌', disabled: true, key: 'brand_name'},
+      ]
+    }
+  },
+  mounted () {
+    const query = this.parentData.$route.query || {}
+    this.setDefaultValue(query, 'searchData')
+  },
+  methods: {
+    searchHandle () {
+      const oldform = this.$refs.ruleForm.baseForm
+      let newForm = {...oldform}
+      this.$emit('change', newForm)
+    },
+    add () {
+      this.$emit('add')
+    }
+  }
+}
+</script>

+ 32 - 3
src/views/house/index.vue

@@ -15,7 +15,27 @@
       :isAdd="true"
       @add="openPopup"
       :operationsDefaultLength="3"
-    />
+      :insertSlotArr="[5]"
+    >
+      <div slot="OI5">
+        <el-table-column
+          width="70"
+          label="自动更新楼盘均价"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <el-switch
+              v-model="scope.row.update_price"
+              active-color="#13ce66"
+              inactive-color="#ff4949"
+              active-value="1"
+              inactive-value="2"
+              @change="updatePriceAutoChange(scope.row)">
+            </el-switch>
+          </template>
+        </el-table-column>
+      </div>
+    </table-list>
     <popup-edit
       :isShow="isDtlShow"
       :curObj="curObj"
@@ -121,8 +141,8 @@ export default {
         // { label: '周边医院', prop: 'hospital_type', type: 'flag', flags: arrToObj(this.$dictData.hospital_type)},
         // { label: '周边商圈', prop: 'high_street', type: 'flag', flags: arrToObj(this.$dictData.high_street)},
         // { label: '公园', prop: 'park_type', type: 'flag', flags: arrToObj(this.$dictData.park_type)},
-        { label: '创建人', prop: 'create_by' },
-        { label: '创建时间', prop: 'create_at' },
+        // { label: '创建人', prop: 'create_by' },
+        // { label: '创建时间', prop: 'create_at' },
         { label: '更新人', prop: 'update_by' },
         { label: '更新时间', prop: 'update_at' },
         { label: '操作', width: 220, type: 'handle2', operations:
@@ -144,6 +164,15 @@ export default {
     }
   },
   methods: {
+    updatePriceAutoChange (row) {
+      this.$api.house.admestateupdateprice({
+        id: row.id,
+        update_price: row.update_price,
+      }).then(res => {
+        this.$msgs('操作成功~')
+        this.fetchData()
+      })
+    },
     saveHandle (row) {
       this.$api.house.admestatesortedit({
         id: row.id,

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