|
@@ -1,35 +1,40 @@
|
|
|
<template>
|
|
|
<div class="page--sub-push">
|
|
|
<div class="page-content">
|
|
|
+ <div class="clearfix">
|
|
|
+ <span class="card-title">订阅推送</span>
|
|
|
+ <el-button v-if="canSubmanager" @click="goManage" class="sub-manager" type="plain" icon="el-icon-jy-edit">订阅管理
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
<div class="border-box">
|
|
|
- <TimeSelector @onChange="changeTime" selectorType="line">
|
|
|
+ <TimeSelector ref="timeSelector" selectorTime="sub" @onChange="changeTime" selectorType="line">
|
|
|
<div slot="header">选择时间:</div>
|
|
|
</TimeSelector>
|
|
|
<AreaSelector @onChange="changeArea" ref="areaSelector" selectorType="line">
|
|
|
<div slot="header">选择区域:</div>
|
|
|
</AreaSelector>
|
|
|
- <IndustrySelector selectorType="line">
|
|
|
+ <IndustrySelector @onChange="changeIndustry" selectorType="line">
|
|
|
<div slot="header">行业:</div>
|
|
|
</IndustrySelector>
|
|
|
- <BusinessScopeSelector selectorType="line">
|
|
|
+ <IndustrySelector @onChange="changeBuyer" dataType="buyer" selectorType="line">
|
|
|
<div slot="header">采购单位类型:</div>
|
|
|
- </BusinessScopeSelector>
|
|
|
- <InfoTypeSelector selectorType="line">
|
|
|
+ </IndustrySelector>
|
|
|
+ <InfoTypeSelector @onChange="changeInfo" selectorType="line">
|
|
|
<div slot="header">信息类型:</div>
|
|
|
</InfoTypeSelector>
|
|
|
</div>
|
|
|
- <push-list :filters="filters" class="m-24" ref="pushList" :showMore="false"></push-list>
|
|
|
+ <push-list :config="config" :filters="filters" class="m-24" ref="pushList" :showMore="false"></push-list>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { Button } from 'element-ui'
|
|
|
import PushList from '@/components/push-list/PushList.vue'
|
|
|
import AreaSelector from '@/components/selector/AreaSelector.vue'
|
|
|
import TimeSelector from '@/components/selector/TimeSelector.vue'
|
|
|
-import IndustrySelector from "@/components/selector/IndustrySelector.vue"
|
|
|
-import BusinessScopeSelector from "@/components/selector/BusinessScopeSelector.vue"
|
|
|
-import InfoTypeSelector from "@/components/selector/InfoTypeSelector.vue"
|
|
|
+import IndustrySelector from '@/components/selector/IndustrySelector.vue'
|
|
|
+import InfoTypeSelector from '@/components/selector/InfoTypeSelector.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'SubPush',
|
|
@@ -38,18 +43,74 @@ export default {
|
|
|
AreaSelector,
|
|
|
TimeSelector,
|
|
|
IndustrySelector,
|
|
|
- BusinessScopeSelector,
|
|
|
- InfoTypeSelector
|
|
|
+ InfoTypeSelector,
|
|
|
+ [Button.name]: Button
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ config: {
|
|
|
+ gray: true,
|
|
|
+ table: true,
|
|
|
+ collect: true
|
|
|
+ },
|
|
|
filters: {
|
|
|
area: '',
|
|
|
- time: ''
|
|
|
+ time: '',
|
|
|
+ selectTime: '',
|
|
|
+ city: '',
|
|
|
+ buyerclass: '',
|
|
|
+ subtype: '',
|
|
|
+ subscopeclass: '',
|
|
|
+ key: '',
|
|
|
+ vt: 'm',
|
|
|
+ exportNum: ''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ mounted () {
|
|
|
+ this.initQuery()
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ initQuery () {
|
|
|
+ const tempTime = this.$refs.timeSelector.getState()
|
|
|
+ let time = tempTime.exact
|
|
|
+ if (tempTime.exact === 'exact') {
|
|
|
+ time = tempTime.start / 1000 + '_' + tempTime.end / 1000
|
|
|
+ }
|
|
|
+ this.filters.selectTime = time
|
|
|
+ this.filters.time = time
|
|
|
+ this.doQuery()
|
|
|
+ },
|
|
|
+ formatIndustryMap (item) {
|
|
|
+ const tempArr = []
|
|
|
+ Object.keys(item).forEach(v => {
|
|
|
+ const tempItem = item[v]
|
|
|
+ if (Array.isArray(tempItem)) {
|
|
|
+ tempItem.forEach(vv => {
|
|
|
+ tempArr.push(`${v}_${vv}`)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return tempArr
|
|
|
+ },
|
|
|
+ changeIndustry (item) {
|
|
|
+ this.filters.subscopeclass = this.formatIndustryMap(item).join(',')
|
|
|
+ this.doQuery()
|
|
|
+ },
|
|
|
+ changeBuyer (item) {
|
|
|
+ this.filters.buyerclass = this.formatIndustryMap(item).join(',')
|
|
|
+ this.doQuery()
|
|
|
+ },
|
|
|
+ changeInfo (item) {
|
|
|
+ this.filters.subtype = item.join(',')
|
|
|
+ this.doQuery()
|
|
|
+ },
|
|
|
+ doQuery () {
|
|
|
+ this.$refs.pushList.doQuery(this.filters)
|
|
|
+ },
|
|
|
+ goManage () {
|
|
|
+ this.$router.push('/set_subscribe/config')
|
|
|
+ },
|
|
|
changeTime (item) {
|
|
|
let time = parseInt(item.start / 1000)
|
|
|
if (item.end) {
|
|
@@ -57,10 +118,12 @@ export default {
|
|
|
}
|
|
|
if (item.start === 0 && item.end === 0) {
|
|
|
this.filters.time = ''
|
|
|
+ this.filters.selectTime = ''
|
|
|
} else {
|
|
|
this.filters.time = time
|
|
|
+ this.filters.selectTime = time
|
|
|
}
|
|
|
- this.$refs.pushList.doQuery(this.filters)
|
|
|
+ this.doQuery()
|
|
|
},
|
|
|
changeArea (item) {
|
|
|
const area = Object.keys(item).map(v => {
|
|
@@ -70,17 +133,48 @@ export default {
|
|
|
return v
|
|
|
})
|
|
|
this.filters.area = area.join(',')
|
|
|
- this.$refs.pushList.doQuery(this.filters)
|
|
|
+ this.doQuery()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ canSubmanager () {
|
|
|
+ return !this.$store.state.user.info?.isSubCount
|
|
|
}
|
|
|
},
|
|
|
- computed: {},
|
|
|
created () {}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+ @include diy-icon('edit', 20, 20);
|
|
|
.page--sub-push {
|
|
|
background-color: #fff;
|
|
|
+ .card-title {
|
|
|
+ font-size: 24px;
|
|
|
+ color: #1d1d1d;
|
|
|
+ line-height: 36px;
|
|
|
+ }
|
|
|
+ .clearfix .sub-manager {
|
|
|
+ float: right;
|
|
|
+ margin-bottom: 24px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .sub-manager {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 8px 16px;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 24px;
|
|
|
+ color: #1d1d1d;
|
|
|
+ border-color: #E0E0E0;
|
|
|
+
|
|
|
+ &.el-button:focus,
|
|
|
+ &.el-button:hover {
|
|
|
+ color: inherit;
|
|
|
+ background-color: inherit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.page-content {
|
|
|
width: 1200px;
|
|
|
margin: 0 auto;
|