|
@@ -1,6 +1,10 @@
|
|
|
function dateFormatter (date, pattern) {
|
|
|
return new Date(date).pattern(pattern)
|
|
|
}
|
|
|
+function subscribeRequestSuccess (res) {
|
|
|
+ vm.subscribeInfo = res
|
|
|
+}
|
|
|
+
|
|
|
var vm = new Vue({
|
|
|
delimiters: ['${', '}'],
|
|
|
el: '#analysis',
|
|
@@ -25,6 +29,7 @@ var vm = new Vue({
|
|
|
data: {
|
|
|
sessStorageKey: '$data-report_analysis',
|
|
|
tabActiveName: 'analysis', // analysis/history
|
|
|
+ subscribeInfo: {},
|
|
|
tabList: [
|
|
|
{
|
|
|
label: '市场分析报告',
|
|
@@ -35,6 +40,16 @@ var vm = new Vue({
|
|
|
name: 'history'
|
|
|
}
|
|
|
],
|
|
|
+ matchWayList: [
|
|
|
+ {
|
|
|
+ name: '按标题匹配',
|
|
|
+ label: 'title'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '按全文匹配',
|
|
|
+ label: 'content'
|
|
|
+ }
|
|
|
+ ],
|
|
|
tabConf: {
|
|
|
titleActiveColor: '#2ABED1',
|
|
|
titleInactiveColor: '#5F5E64',
|
|
@@ -70,8 +85,12 @@ var vm = new Vue({
|
|
|
],
|
|
|
scrollTop: 0,
|
|
|
filtersPageShow: true,
|
|
|
+ filtersCache: {
|
|
|
+ matchway: 'title'
|
|
|
+ },
|
|
|
filters: {
|
|
|
selectKeysArr: [], // 关键词简单数组,用于恢复选择状态
|
|
|
+ matchway: 'title',
|
|
|
keys: [], // 关键词详细数组,用于提交数据
|
|
|
area: {},
|
|
|
industry: [],
|
|
@@ -85,6 +104,7 @@ var vm = new Vue({
|
|
|
},
|
|
|
filterDialogShow: {
|
|
|
keys: false,
|
|
|
+ matchway: false,
|
|
|
area: false,
|
|
|
industry: false,
|
|
|
buyerclass: false,
|
|
@@ -343,7 +363,12 @@ var vm = new Vue({
|
|
|
this.calcStickyOffset()
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ subscribeInfo (n) {
|
|
|
+ if (!this.rid && n && n.member_jy && n.member_jy.i_matchway) {
|
|
|
+ this.setDefaultMatchWay(n.member_jy.i_matchway)
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
created () {
|
|
|
this.calcLastTimeText()
|
|
@@ -373,6 +398,17 @@ var vm = new Vue({
|
|
|
utils.iosBackRefresh()
|
|
|
},
|
|
|
methods: {
|
|
|
+ setDefaultMatchWay: function (matchWay) {
|
|
|
+ // matchWay 1按标题匹配title 2按全文匹配content
|
|
|
+ var map = {
|
|
|
+ 1: 'title',
|
|
|
+ 2: 'content'
|
|
|
+ }
|
|
|
+ var defaultMatchWay = map[matchWay]
|
|
|
+ if (defaultMatchWay) {
|
|
|
+ this.filters.matchway = defaultMatchWay
|
|
|
+ }
|
|
|
+ },
|
|
|
// 设置排序方式
|
|
|
setsortType (data) {
|
|
|
this.sections.areaScatter.sortType = data
|
|
@@ -622,9 +658,18 @@ var vm = new Vue({
|
|
|
text = this.resolveSelectIndustryText(filters.industryDetail)
|
|
|
} else if (type === 'buyerclass') {
|
|
|
text = this.resolveSelectBuyerclassText(filters.buyerclass)
|
|
|
+ } else if (type === 'matchway') {
|
|
|
+ text = this.resolveSelectMatchWayText(filters.matchway)
|
|
|
}
|
|
|
return prefix + text
|
|
|
},
|
|
|
+ resolveSelectMatchWayText: function (m) {
|
|
|
+ var map = {
|
|
|
+ title: '按标题匹配',
|
|
|
+ content: '按全文匹配'
|
|
|
+ }
|
|
|
+ return map[m]
|
|
|
+ },
|
|
|
resolveSelectKeysText: function (keys) {
|
|
|
if (Array.isArray(keys)) {
|
|
|
if (keys.length === 0) {
|
|
@@ -748,6 +793,8 @@ var vm = new Vue({
|
|
|
setTimeout(function () {
|
|
|
_this.$refs.industrySelector.setState()
|
|
|
}, 0)
|
|
|
+ } else if (key = 'matchway') {
|
|
|
+ this.filtersCache[key] = this.filters[key]
|
|
|
}
|
|
|
dialog[key] = true
|
|
|
},
|
|
@@ -800,6 +847,7 @@ var vm = new Vue({
|
|
|
|
|
|
const query = {
|
|
|
keysItems: this.getSelectedKeys(),
|
|
|
+ matchingMode: this.filters.matchway,
|
|
|
rangeTime: `${parseInt(this.filters.rangeTime.start / 1000)}-${parseInt(this.filters.rangeTime.end / 1000)}`,
|
|
|
rangeTimeExtra: this.filters.rangeTime.exact,
|
|
|
area: JSON.stringify(this.filters.area),
|
|
@@ -1067,6 +1115,8 @@ var vm = new Vue({
|
|
|
this.reportFilters.buyerclass = data.buyerclass.split(',')
|
|
|
this.filters.buyerclass = this.reportFilters.buyerclass
|
|
|
}
|
|
|
+ console.log(data)
|
|
|
+ this.filters.matchway = data.matchingMode || 'content'
|
|
|
},
|
|
|
// 市场概况
|
|
|
sortMarketOverview (profile) {
|