浏览代码

temp save

liujq 4 年之前
父节点
当前提交
58f3b831b9

文件差异内容过多而无法显示
+ 0 - 0
dist/index.html


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/chunk-d5eb97f8.08117882.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.09e962a5.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.20a72103.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/chunk-2c68db8f.857f3124.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/chunk-2c68db8f.d648a80e.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/chunk-d5eb97f8.4ee00696.js


+ 3 - 0
src/api/house.js

@@ -100,6 +100,9 @@ export default {
   adminformationdel: params => { // 洪楼文章删除
     return getRequestNoSort('/adm/information/del', params, 'loading')
   },
+  adminformationcountcache: params => { // 洪楼文章 统计更新
+    return getRequestNoSort('/adm/information/count/cache', params, 'loading')
+  },
   admlandlist: params => { // 土拍 - 列表接口
     return getRequest('/adm/land/list', params)
   },

+ 2 - 0
src/api/index.js

@@ -1,8 +1,10 @@
 import base from './base'
 import house from './house'
 import user from './user'
+import other from './other'
 export default {
   base,
   house,
   user,
+  other,
 }

+ 22 - 0
src/api/other.js

@@ -0,0 +1,22 @@
+/**
+  * 其它
+*/
+import { getRequest, getRequestNoSort } from '@/utils/request'
+
+export default {
+  admadvertslist: params => { // 广告 - 列表
+    return getRequest('/adm/adverts/list', params)
+  },
+  admadvertsedit: params => { // 广告 - 编辑
+    return getRequestNoSort('/adm/adverts/edit', params, 'loading')
+  },
+  admadvertsadd: params => { // 广告 - 添加
+    return getRequestNoSort('/adm/adverts/add', params, 'loading')
+  },
+  admadvertsdel: params => { // 广告 - 删除
+    return getRequestNoSort('/adm/adverts/del', params, 'loading')
+  },
+  admadvertsdetail: params => { // 广告 - 详情
+    return getRequestNoSort('/adm/adverts/detail', params, 'loading')
+  },
+}

+ 11 - 0
src/router/index.js

@@ -117,6 +117,17 @@ export let moreRoutes = [
       meta: { title: '学校管理', icon: 'dashboard' }
     }]
   },
+  {
+    path: '/ad',
+    component: Layout,
+    redirect: '/ad/index',
+    children: [{
+      path: 'index',
+      name: 'AdIndex',
+      component: () => import('@/views/ad/index'),
+      meta: { title: '广告管理', icon: 'dashboard' }
+    }]
+  },
   {
     path: '/qa',
     component: Layout,

+ 188 - 0
src/views/ad/components/popup/IndexEdit.vue

@@ -0,0 +1,188 @@
+<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="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </base-form>
+      <div v-if="posTips" class="scoped-tips">当前投放位置的尺寸建议:
+        <span class="s">{{posTips}}</span>
+      </div>
+      <div class="scoped-tips2">注:当前时间超过结束时间,则投放结束</div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+export default {
+  components: { },
+  mixins,
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      formData: [],
+      loading: true,
+      cObj: {},
+      posTips: '',
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        if (val) {
+          if (this.curObj.id) {
+            this.$api.other.admadvertsdetail({id: this.curObj.id}).then(res => {
+              let curData = res || {}
+              curData.startEndTime = [curData.start_at, curData.end_at]
+              this.cObj = curData || {}
+              this.getDef()
+            })
+          } else {
+            this.cObj = this.curObj
+            this.getDef()
+          }
+        }
+      }
+    },
+  },
+  methods: {
+    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 (params.ad_link_type === 'estate') {
+        this.formData = [
+          { label: '广告标题', key: 'title', class: 'c-2', rules: 1 },
+          { label: '投放位置', key: 'ad_position', type: 'select', class: 'c-2', options: this.$dictData.ad_position, rules: 1, changeHandle: this.posHandle },
+          { label: '链接类型', 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: 'c-2', 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 }
+          },
+          { label: '图片', key: 'images', type: 'upload', rules: 1 },
+          { label: '投放时间', label2: '开始时间', label3: '结束时间', key: 'startEndTime', type: 'datePicker', rules: 1},
+          { label: '备注', key: 'remarked', type: 'textarea'},
+        ]
+      } else if (params.ad_link_type === 'news') {
+        this.formData = [
+          { label: '广告标题', key: 'title', class: 'c-2', rules: 1 },
+          { label: '投放位置', key: 'ad_position', type: 'select', class: 'c-2', options: this.$dictData.ad_position, rules: 1, changeHandle: this.posHandle },
+          { label: '链接类型', 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: 'c-2', changeHandle: this.ltValHandle,
+            remoteParams: { skey: 'title', api: `house.adminformationlist`, opKey: 'title', opVal: 'id' },
+            remoteOptions: { keyRO: params.link_type_name, valRO: params.link_type_value }
+          },
+          { label: '图片', key: 'images', type: 'upload', rules: 1 },
+          { label: '投放时间', label2: '开始时间', label3: '结束时间', key: 'startEndTime', type: 'datePicker', rules: 1},
+          { label: '备注', key: 'remarked', type: 'textarea'},
+        ]
+      } else {
+        this.formData = [
+          { label: '广告标题', key: 'title', class: 'c-2', rules: 1 },
+          { label: '投放位置', key: 'ad_position', type: 'select', class: 'c-2', options: this.$dictData.ad_position, rules: 1, changeHandle: this.posHandle },
+          { label: '链接类型', key: 'ad_link_type', type: 'select', class: 'c-2', options: this.$dictData.ad_link_type, changeHandle: this.linkTypeHandle, },
+          { label: '图片', key: 'images', type: 'upload', rules: 1 },
+          { label: '投放时间', label2: '开始时间', label3: '结束时间', key: 'startEndTime', type: 'datePicker', rules: 1},
+          { label: '备注', key: 'remarked', type: 'textarea'},
+        ]
+      }
+      this.setDefaultValue(params)
+    },
+    ltValHandle (val, item, op) {
+      this.cObj.link_type_name = op.keyRO
+    },
+    linkTypeHandle (val) {
+      this.getDef('linkType')
+    },
+    posHandle (val, item, op) {
+      this.posTips = op.option1
+    },
+    close(str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            const newForm = { ...oldform }
+            if (this.curObj.id) newForm.id = this.curObj.id
+            let apiStr = 'admadvertsadd'
+            if (newForm.id) apiStr = 'admadvertsedit'
+            newForm.start_at = newForm.startEndTime[0]
+            newForm.end_at = newForm.startEndTime[1]
+            delete newForm.startEndTime
+            newForm.link_type_name = this.cObj.link_type_name
+            this.$api.other[apiStr](newForm).then(data => {
+              this.$msgs(newForm.id ? '编辑成功' : '新增成功')
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        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: 180px;
+  overflow: hidden;
+  .icon {
+    width: 278px;
+  }
+  .img {
+    width: 278px;
+  }
+}
+.scoped-tips {
+  position: absolute;
+  width: 110px;
+  top: 160px;
+  right: 150px;
+  color: #666;
+  font-size: 14px;
+  .s {
+    display: block;
+    color: #f15264;
+    font-weight: bold;
+  }
+}
+.scoped-tips2 {
+  position: absolute;
+  width: 260px;
+  top: 350px;
+  right: 0;
+  color: #f15264;
+  font-size: 14px;
+  font-weight: bold;
+}
+</style>

+ 33 - 0
src/views/ad/components/searchForm/Index.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>

二进制
src/views/ad/img/icon_g_close.png


+ 106 - 0
src/views/ad/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"
+      :isAdd="true"
+      @add="openPopup"
+    />
+    <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: 'other.admadvertslist',
+      searchForm: null,
+      isDtlShow: false,
+      curObj: {},
+    }
+  },
+  computed: {
+    tableData2() {
+      const arr = [...this.tableData,]
+      arr.map(item => {})
+      return arr
+    }
+  },
+  created() {},
+  mounted() {
+    this.listConfig = {
+      rows: [
+        { label: '广告标题', prop: 'title' },
+        { label: '广告图片', prop: 'images', type: 'img' },
+        { label: '投放位置', prop: 'ad_position', type: 'flag', flags: arrToObj(this.$dictData.ad_position) }, 
+        { label: '开始时间', prop: 'start_at' },
+        { label: '结束时间', prop: 'end_at' },
+        { label: '链接类型', prop: 'ad_link_type', type: 'flag', flags: arrToObj(this.$dictData.ad_link_type) }, 
+        { label: '备注', prop: 'remarked' },
+        { label: '更新人', prop: 'update_by' },
+        { label: '更新时间', prop: 'update_at' },
+        { label: '操作', width: 120, type: 'handle2', operations:
+          [
+            { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '删除', func: this.delHandle, btnType: 'danger' },
+          ]
+        }
+      ]
+    }
+  },
+  methods: {
+    delHandle(row) {
+      this.$msg(`您确定要删除该广告吗?`, 'confirm', () => {
+        this.$api.other.admadvertsdel({
+          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>

+ 6 - 0
src/views/news/components/searchForm/Index.vue

@@ -4,6 +4,7 @@
       <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
       <el-button type="small" icon="el-icon-plus" class="xl-form-btn bgc1" @click="openPopup">添加公众号文章</el-button>
       <el-button type="small" icon="el-icon-plus" class="xl-form-btn bgc2" @click="openIESPopup">添加新资讯</el-button>
+      <el-button :loading="listLoading" class="xl-form-btn bgc4" @click="updateHandle">更新统计</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>
@@ -25,6 +26,11 @@ export default {
     }
   },
   methods: {
+    updateHandle () {
+      this.$api.house.adminformationcountcache().then(res => {
+        this.$msg('更新成功!')
+      })
+    },
     openPopup () {
       this.parentData.openPopup()
     },

部分文件因为文件数量过多而无法显示