liujq 3 years ago
parent
commit
158f5ad6ac

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-472b320a.51a276de.css


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


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


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-3d933640.d9807b6c.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-472b320a.18ba3087.js


+ 15 - 0
src/api/house.js

@@ -85,6 +85,21 @@ export default {
   admestatesortedit: params => { // 楼盘排序接口
     return getRequestNoSort('/adm/estate/sort/edit', params, 'loading')
   },
+  admncplanlist: params => { // 洪楼文章列表接口
+    return getRequest('/adm/nc/plan/list', params)
+  },
+  admncplanadd: params => { // 洪楼文章添加
+    return getRequestNoSort('/adm/nc/plan/add', params, 'loading')
+  },
+  admncplanedit: params => { // 洪楼文章编辑
+    return getRequestNoSort('/adm/nc/plan/edit', params, 'loading')
+  },
+  admncplandetail: params => { // 洪楼文章详情
+    return getRequestNoSort('/adm/nc/plan/detail', params, 'loading')
+  },
+  admncplandel: params => { // 洪楼文章删除
+    return getRequestNoSort('/adm/nc/plan/del', params, 'loading')
+  },
   adminformationlist: params => { // 洪楼文章列表接口
     return getRequest('/adm/information/list', params)
   },

+ 1 - 0
src/views/channel/components/searchForm/Index.vue

@@ -2,6 +2,7 @@
   <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-plus" class="xl-form-btn bgc2" @click="parentData.openPopup">添加</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>

+ 136 - 0
src/views/news/components/popup/OtherEdit.vue

@@ -0,0 +1,136 @@
+<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="110px">
+        <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>
+  </div>
+</template>
+<script>
+export default {
+  components: { },
+  mixins,
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      formData: [],
+      loading: true,
+      cObj: {},
+      isShowMap: false
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        if (val) {
+          if (this.curObj.id) {
+            this.$api.house.admncplandetail({id: this.curObj.id}).then(res => {
+              let curData = res || {}
+              this.cObj = curData || {}
+              this.getDef()
+            })
+          } else {
+            this.cObj = this.curObj
+            this.getDef()
+          }
+        }
+      }
+    },
+  },
+  methods: {
+    getDef() {
+      const params = { ...this.cObj }
+      this.formData = [
+        { label: '标题', key: 'title' },
+        { label: '链接', key: 'link' },
+        { label: '分类', key: 'plan_type', type: 'select', class: 'c-2', options: this.$dictData.plan_type, changeHandle: this.cateChange },
+        { label: '作者', key: 'author', class: 'c-2' },
+        { label: '状态', key: 'hide_status', type: 'select', class: 'c-2', options: this.$dictData.hide_status },
+        { label: '发布时间', key: 'create_at', class: 'c-2', type: 'datePicker', type2: 'date'},
+        { label: '主图', key: 'pri_image', type: 'cuImg',
+          options: {
+            w: 500,
+            h: 350,
+          }, class: 'c-2' },
+      ]
+      this.setDefaultValue(params)
+    },
+    cateChange (val) {
+      // let params = {...this.$refs.ruleForm.baseForm}
+      // let imgURL= ''
+      // if (val === 'hlzt') imgURL= 'http://icon.honglounews.com/news_hlzt.jpg'
+      // if (val === 'hljy' || val === 'xqsc') imgURL= 'http://icon.honglounews.com/news_hljy.jpg'
+      // if (val === 'bkfx') imgURL= 'http://icon.honglounews.com/news_bkfx.jpg'
+      // if (val === 'lppc') imgURL= 'http://icon.honglounews.com/news_lppc.jpg'
+      // if (val === 'lpwd') imgURL= 'http://icon.honglounews.com/news_lpwd.jpg'
+
+      // if (val === 'hlpd') imgURL= 'http://icon.honglounews.com/news_hlpd.jpg'
+      // if (val === 'lszt') imgURL= 'http://icon.honglounews.com/news_lszt.jpg'
+      // if (val === 'zcjd') imgURL= 'http://icon.honglounews.com/news_zcjd.jpg'
+      // if (val === 'esf') imgURL= 'http://icon.honglounews.com/news_esf.jpg'
+      // if (val === 'lsdt') imgURL= 'http://icon.honglounews.com/news_lsdt.jpg'
+      // if (val === 'scfx') imgURL= 'http://icon.honglounews.com/news_scfx.jpg'
+      // params.pri_image = imgURL
+      // 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 }
+            if (this.curObj.id) newForm.id = this.curObj.id
+            if (newForm.estate_id_list && newForm.estate_id_list.length > 0) {
+              newForm.estate_id_list = newForm.estate_id_list.join(',')
+            } else {
+              newForm.estate_id_list = ''
+            }
+            if (newForm.area_type) newForm.area_type = newForm.area_type.join(',')
+            let apiStr = 'admncplanadd'
+            newForm.news_type = 'gzh'
+            if (!newForm.create_at) delete newForm.create_at
+            if (newForm.id) apiStr = 'admncplanedit'
+            this.$api.house[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%;
+  }
+}
+</style>

+ 40 - 0
src/views/news/components/searchForm/Other.vue

@@ -0,0 +1,40 @@
+<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 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" 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: 'plan_type', type: 'select', options: this.$dictData.plan_type},
+        { label: '状态', key: 'hide_status', type: 'select', class: 'c-3', options: this.$dictData.hide_status },
+      ]
+    }
+  },
+  methods: {
+    openPopup () {
+      this.parentData.openPopup()
+    },
+    openIESPopup () {
+      this.parentData.openIESPopup()
+    },
+    searchHandle() {
+      const oldform = this.$refs.ruleForm.baseForm
+      const newForm = { ...oldform }
+      this.$emit('change', newForm)
+    }
+  }
+}
+</script>

+ 0 - 1
src/views/news/indexEditSelf.vue

@@ -116,7 +116,6 @@ export default {
             }
             let apiStr = 'adminformationadd'
             if (newForm.id) apiStr = 'adminformationedit'
-            console.log(this.content)
             if (this.content) {
               newForm.content = this.content
             } else {

+ 167 - 0
src/views/news/other.vue

@@ -0,0 +1,167 @@
+<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"
+      :insertSlotArr="[4]"
+    >
+      <div slot="OI4">
+        <el-table-column
+          width="50"
+          label="链接"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <a v-if="scope.row.news_type === 'adminadd'" :href="'https://h5.honglounews.com/wxnews.html?id=' + scope.row.id" target="_blank" class="scoped-link">链接</a>
+            <a v-else :href="scope.row.link" target="_blank" class="scoped-link">链接</a>
+          </template>
+        </el-table-column>
+      </div>
+      <div slot="otherItem">
+        <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>
+      </div>
+    </table-list>
+    <popup-edit
+      :isShow="isDtlShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+    <index-edit-self
+      :isShow="isIESShow"
+      :curObj="curObj"
+      @close="closeIESPopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/Other'
+import PopupEdit from './components/popup/OtherEdit'
+import IndexEditSelf from './components/popup/IndexEditSelf'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'index',
+  components: {
+    SearchForm,
+    PopupEdit,
+    IndexEditSelf,
+  },
+  provide() {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data() {
+    return {
+      apiStr: 'house.admncplanlist',
+      searchForm: null,
+      isDtlShow: false,
+      isIESShow: false,
+      curObj: {}
+    }
+  },
+  computed: {
+    tableData2() {
+      const arr = [...this.tableData]
+      arr.map(item => {
+        // item.pri_image = this.IMadd(item.pri_image)
+        if (item.link) {
+          item.linkStr = `${item.link.length}---${item.link.substring(item.link.length-16, item.link.length-1)}`
+        }
+        item.hideStatus = Number(item.hide_status)
+      })
+      return arr
+    }
+  },
+  created() {},
+  mounted() {
+    this.listConfig = {
+      rows: [
+        { label: '浏览数', prop: 'view_count' },
+        { label: '标题', prop: 'title', fullShow: true, minWidth: 200 }, 
+        { label: '分类', prop: 'plan_type', type: 'flag', flags: arrToObj(this.$dictData.plan_type) }, 
+        { label: '主图', prop: 'pri_image', type: 'img' },
+        { label: '链接Str', prop: 'linkStr', fullShow: true },
+        { label: '作者', prop: 'author' },
+        { label: '状态', prop: 'hideStatus', type: 'tag', tags: arrToObj(this.$dictData.hide_status) }, 
+        { label: '创建时间', prop: 'create_at' },
+        { 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.house.admncplandel({
+          id: row.id,
+        }).then(data => {
+          this.$msgs(`已删除!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    openPopup(row) {
+      if (row && row.news_type === 'adminadd') {
+        this.openIESPopup(row)
+      } else {
+        if (row && row.id) {
+          this.curObj = row
+        } else {
+          this.curObj = {}
+        }
+        this.isDtlShow = true
+      }
+    },
+    closePopup(obj) {
+      this.isDtlShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    },
+    openIESPopup(row) {
+      // if (row && row.id) {
+      //   this.curObj = row
+      // } else {
+      //   this.curObj = {}
+      // }
+      // this.isIESShow = true
+      if (row && row.id) {
+        this.$router.push(`/news/otherEdit?id=${row.id}`)
+      } else {
+        this.$router.push(`/news/otherEdit`)
+      }
+    },
+    closeIESPopup(obj) {
+      this.isIESShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+.scoped-link {
+  color: #2d8cf0;
+  text-decoration: underline;
+}
+</style>
+

+ 182 - 0
src/views/news/otherEdit.vue

@@ -0,0 +1,182 @@
+<template>
+  <div class="app-container">
+    <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="60px" :insertSlotArr="[1]">
+      <div class="scoped-textarea"  slot="OI1">
+        <div class="st-text">洪楼科技</div>
+        <tinymce ref="refContent" v-model="content" :height="500" />
+      </div>
+    </base-form>
+    <div class="xl-form scoped-bottom">
+      <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>
+</template>
+<script>
+import Tinymce from '@/components/Tinymce'
+export default {
+  components: { Tinymce },
+  mixins,
+  data() {
+    return {
+      formData: [],
+      loading: true,
+      cObj: {},
+      content: '',
+    }
+  },
+  created () {
+    const query = this.$route.query
+    if (query.id) {
+      this.$api.house.admncplandetail({id: query.id}).then(res => {
+        let curData = res || {}
+        this.cObj = curData || {}
+        this.content = curData.content || ''
+        this.getDef()
+      })
+    } else {
+      this.content = '<p>这里开始</p>\n<p>&nbsp;</p>\n<p style=\"margin: 10px 16px; padding: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; color: #333333; font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif; font-size: 17px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: 0.544px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; line-height: 2em; text-indent: 2em; text-align: center;\"><span style=\"margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; font-size: 16px;\"><span style=\"margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; letter-spacing: 2px;\">-END-</span></span></p>\n<p><span style=\"margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; color: #333333; font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; orphans: 2; text-align: justify; text-indent: 34px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; letter-spacing: 2px;\"><img class=\"wscnph\" src=\"https://img2.honglounews.com/20210603040359-8175.gif\" /></span></p>'
+      this.getDef()
+    }
+  },
+  methods: {
+    getDef() {
+      const params = { ...this.cObj }
+      this.formData = [
+        { label: '标题', key: 'title', rules: 1 },
+        { label: '分类', key: 'plan_type', rules: 1, type: 'select', class: 'c-2', options: this.$dictData.plan_type, changeHandle: this.cateChange },
+        { label: '作者', key: 'author', class: 'c-2' },
+        { label: '主图', key: 'pri_image', type: 'cuImg',
+          options: {
+            w: 500,
+            h: 350,
+          }, class: 'c-2' },
+        { label: '状态', key: 'hide_status', type: 'select', class: 'c-2', options: this.$dictData.hide_status },
+        { label: '时间', key: 'create_at', type: 'datePicker', type2: 'date'},
+      ]
+      this.setDefaultValue(params)
+    },
+    cateChange (val) {
+      // let params = {...this.$refs.ruleForm.baseForm}
+      // let imgURL= ''
+      // if (val === 'hlzt') imgURL= 'http://icon.honglounews.com/news_hlzt.jpg'
+      // if (val === 'hljy' || val === 'xqsc') imgURL= 'http://icon.honglounews.com/news_hljy.jpg'
+      // if (val === 'bkfx') imgURL= 'http://icon.honglounews.com/news_bkfx.jpg'
+      // if (val === 'lppc') imgURL= 'http://icon.honglounews.com/news_lppc.jpg'
+      // if (val === 'lpwd') imgURL= 'http://icon.honglounews.com/news_lpwd.jpg'
+
+      // if (val === 'hlpd') imgURL= 'http://icon.honglounews.com/news_hlpd.jpg'
+      // if (val === 'lszt') imgURL= 'http://icon.honglounews.com/news_lszt.jpg'
+      // if (val === 'zcjd') imgURL= 'http://icon.honglounews.com/news_zcjd.jpg'
+      // if (val === 'esf') imgURL= 'http://icon.honglounews.com/news_esf.jpg'
+      // if (val === 'lsdt') imgURL= 'http://icon.honglounews.com/news_lsdt.jpg'
+      // if (val === 'scfx') imgURL= 'http://icon.honglounews.com/news_scfx.jpg'
+      // params.pri_image = imgURL
+      // this.setDefaultValue(params)
+    },
+    fileChange (file) {
+      let reader = new FileReader();
+      let rs = reader.readAsArrayBuffer(file);
+      let blob = null;
+      reader.onload = (e) => {
+        if (typeof e.target.result === 'object') {
+          blob = new Blob([e.target.result])
+        } else {
+          blob = e.target.result
+        }
+        console.log(Object.prototype.toString.call(blob));
+      }
+    },
+    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.cObj.id) newForm.id = this.cObj.id
+            if (newForm.estate_id_list && newForm.estate_id_list.length > 0) {
+              newForm.estate_id_list = newForm.estate_id_list.join(',')
+            } else {
+              newForm.estate_id_list = ''
+            }
+            let apiStr = 'admncplanadd'
+            if (newForm.id) apiStr = 'admncplanedit'
+            if (this.content) {
+              newForm.content = this.content
+            } else {
+              this.$msg('请输入资讯文章内容')
+              return
+            }
+            newForm.news_type = 'adminadd'
+            this.$api.house[apiStr](newForm).then(data => {
+              this.$msgs(newForm.id ? '编辑成功' : '新增成功')
+              this.$emit('close', newForm)
+              this.$router.push('/news/other')
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.$router.push('/news/other')
+        this.setDefaultValue()
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+@import '../../styles/libEdit.scss';
+.app-container {
+  background: #f9f9f9;
+}
+.lib-edit {
+  width: 900px;
+  padding: 20px 20px 60px;
+  margin: 0 auto;
+  background: #fff;
+  ::v-deep .el-form-item {
+    margin-bottom: 10px;
+  }
+  ::v-deep .el-date-editor.el-input {
+    width: 100%;
+  }
+}
+
+.scoped-textarea {
+  width: 100%;
+  position: relative;
+  margin-bottom: 20px;
+  .st-text {
+    position: absolute;
+    bottom: 1px;
+    right: 14px;
+    background: #fff;
+    font-size: 12px;
+    z-index: 9;
+    height: 16px;
+    line-height: 16px;
+    padding-left: 10px;
+    padding-right: 10px;
+    color: #595959;
+    user-select: none;
+  }
+}
+
+.scoped-bottom {
+  position: fixed;
+  bottom: 0;
+  right: 0;
+  background: #fff;
+  width: 100%;
+  box-sizing: border-box;
+  padding-left: 50%;
+  padding-bottom: 20px;
+  padding-top: 20px;
+  border-top: 1px solid #dcdcdc;
+  z-index: 10;
+}
+
+::v-deep .el-drawer__body {
+  padding-bottom: 30px;
+}
+</style>

+ 0 - 0
src/views/qa/todayNews.vue → src/views/news/todayNews.vue


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