From 3971d8647836e1236625b04ebcf3488f609d2f55 Mon Sep 17 00:00:00 2001
From: xiaowen <372193233@qq.com>
Date: Thu, 4 Aug 2022 11:01:53 +0800
Subject: [PATCH 1/6] no message
---
components/option/bubbleWord.js | 104 ++++++++++++++++++++++++++++++++
1 file changed, 104 insertions(+)
create mode 100644 components/option/bubbleWord.js
diff --git a/components/option/bubbleWord.js b/components/option/bubbleWord.js
new file mode 100644
index 0000000..eedd2c1
--- /dev/null
+++ b/components/option/bubbleWord.js
@@ -0,0 +1,104 @@
+/*
+ * @Author: your name
+ * @Date: 2021-12-16 14:41:25
+ * @LastEditTime: 2021-12-17 10:21:38
+ * @LastEditors: Please set LastEditors
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @FilePath: /data-show/src/utils/gol/bubbleWord.js
+ */
+
+// let maskImage = new Image();
+// maskImage.src = require('@/assets/images/carSide.png');
+let colors = ['rgba(84,111,197,1)', 'rgba(145,203,116,1)', 'rgba(90,203,156,1)', 'rgba(248,200,87,1)', 'rgba(237,101,101,1)', "rgba(114,191,222,1)", 'rgba(58,162,114,1)', 'rgba(251,131,81,1)']
+//报纸的样式
+function newspaper() {
+ // let colorArr = ['#423312', '#605030', '#9A855B', '#DFC8A4'];
+ let colorArr = ['#FFF','#3373CC','#CC9D12','#54BF93']
+ let colorIndex = Math.ceil(Math.random() * 3);
+ return colorArr[colorIndex];
+}
+// 多彩的样式
+function colorfulStyle() {
+ return 'rgb(' + [
+ Math.round(Math.random() * 255),
+ Math.round(Math.random() * 255),
+ Math.round(Math.random() * 255)
+ ].join(',') + ')';
+}
+// 将后台数据转成数组
+function doWordCloud(data) {
+ let arr1 = [];
+ for (let key in data) {
+ let obj = { name: key, value: data[key] };
+ arr1.push(obj);
+ }
+ return arr1;
+}
+//创建词云
+export default function createWordCloud(data) {
+ let showData = null;
+ if (Array.isArray(data)) {
+ let words = [];
+ data.forEach(e => {
+ let o = {
+ name: e.key,
+ value: e.value
+ }
+ words.push(o)
+ })
+ showData = words;
+ } else {
+ let words = doWordCloud(data);
+ showData = words;
+ }
+ return {
+ tooltip: {
+ trigger: "axis",
+ backgroundColor: "#08182F",
+ color: "#fff",
+ borderColor: "#3373CC",
+ textStyle: {
+ color: "#fff", //设置文字颜色
+ fontSize: 9
+ },
+ extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
+ confine: true
+ },
+ series: [{
+ type: 'wordCloud',
+ shape: 'circle',
+ // rotationRange: [0, 0], //旋转角度的范围
+ rotationStep: 90, //旋转角度的步长
+ //shape: 'circle',
+ sizeRange: [6, 48], //字体大小范围
+ gridSize: 8, //字间距
+ // maskImage: maskImage,
+ left: 'center',
+ top: 'center',
+ right: null,
+ bottom: null,
+ width: '100%',
+ height: '100%',
+ drawOutOfBound: true,
+ textStyle: {
+ fontFamily: 'sans-serif',
+ fontWeight: 'bold',
+ //颜色的回调函数, []
+ color: function() {
+ return newspaper()
+ }
+ },
+ emphasis: {
+ textStyle: {
+ shadowBlur: 100,
+ shadowColor: '#333'
+ }
+ },
+ data: showData
+ // {
+ // name: 'Sam S Club',
+ // value: 10000,
+ // }
+ }]
+ }
+}
\ No newline at end of file
From 56ff2b081625dd5a124eeeba5d6d3110e4901a35 Mon Sep 17 00:00:00 2001
From: xiaowen <372193233@qq.com>
Date: Thu, 4 Aug 2022 12:05:22 +0800
Subject: [PATCH 2/6] =?UTF-8?q?=E8=AF=8D=E4=BA=91=E7=9A=84=E4=BC=98?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/indexCom/atlasChild/index.js | 34 +++++--------------------
components/word-cloud/index.js | 15 ++++++++++-
2 files changed, 20 insertions(+), 29 deletions(-)
diff --git a/components/indexCom/atlasChild/index.js b/components/indexCom/atlasChild/index.js
index c7fb57f..163be6b 100644
--- a/components/indexCom/atlasChild/index.js
+++ b/components/indexCom/atlasChild/index.js
@@ -60,23 +60,15 @@ Component({
sStartTime: sStartTime,
sEndTime: sEndTime
}
- let skey = {
- 34: 6000,
- 3: 50000,
- 20: 180000,
- 23: 30000
- }
app.globalData.request(obj).then(res => {
const data = res
const arr1 = []
Object.keys(data).forEach(key => {
- let o = [key, data[key] / skey[sTimeType]]
+ let o = [key, data[key]]
arr1.push(o)
})
- const resArr = arr1.slice(0,50)
- console.log(resArr);
this.setData({
- HotWords: resArr,
+ HotWords: arr1,
showTu: true
})
resolve(true)
@@ -96,22 +88,15 @@ Component({
sStartTime: sStartTime,
sEndTime: sEndTime
}
- let skey = {
- 34: 6000,
- 3: 50000,
- 20: 180000,
- 23: 30000
- }
app.globalData.request(obj).then(res => {
const data = res
const arr2 = []
Object.keys(data).forEach(key => {
- let list = [key, data[key] / skey[sTimeType]]
+ let list = [key, data[key]]
arr2.push(list)
})
- const resArr = arr2.slice(0,50)
this.setData({
- PositiveWords: resArr,
+ PositiveWords: arr2,
showTu1: true
})
resolve(true)
@@ -132,22 +117,15 @@ Component({
sStartTime: sStartTime,
sEndTime: sEndTime
}
- let skey = {
- 34: 1300,
- 3: 8000,
- 20: 30000,
- 23: 5000
- }
app.globalData.request(obj).then(res => {
const data = res
const arr3 = []
Object.keys(data).forEach(key => {
- let list = [key, data[key] / skey[sTimeType]]
+ let list = [key, data[key]]
arr3.push(list)
})
- const resArr = arr3.slice(0,50)
this.setData({
- NegativeWords: resArr,
+ NegativeWords: arr3,
showTu2: true
})
resolve(true)
diff --git a/components/word-cloud/index.js b/components/word-cloud/index.js
index 65962ba..7e96e78 100644
--- a/components/word-cloud/index.js
+++ b/components/word-cloud/index.js
@@ -55,7 +55,7 @@ Component({
const dpr = wx.getSystemInfoSync().pixelRatio
this.setData({
options: {
- "list": list,
+ "list": this.doData(list),
"gridSize": 10, // size of the grid in pixels
"weightFactor": 4, // number to multiply for size of each word in the list
"fontWeight": 'normal', // 'normal', 'bold' or a callback
@@ -108,5 +108,18 @@ Component({
const { detail } = event.currentTarget.dataset
this.triggerEvent('detail', detail);
},
+ doData(list = []) {
+ if(list.length === 0) {
+ return []
+ }
+ let arr = [];
+ let max = 32;
+ let maxVal = list[0][1];
+ list.forEach(ele => {
+ let a = [ele[0], ele[1] / maxVal * max];
+ arr.push(a)
+ })
+ return arr;
+ }
}
})
\ No newline at end of file
From 947a1fd0e73f0407f57c8dcc7ce1d747890221c3 Mon Sep 17 00:00:00 2001
From: xiaowen <372193233@qq.com>
Date: Thu, 4 Aug 2022 14:02:04 +0800
Subject: [PATCH 3/6] cxw-010203
---
components/option/bubbleWord.js | 104 --------------------------------
1 file changed, 104 deletions(-)
delete mode 100644 components/option/bubbleWord.js
diff --git a/components/option/bubbleWord.js b/components/option/bubbleWord.js
deleted file mode 100644
index eedd2c1..0000000
--- a/components/option/bubbleWord.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * @Author: your name
- * @Date: 2021-12-16 14:41:25
- * @LastEditTime: 2021-12-17 10:21:38
- * @LastEditors: Please set LastEditors
- * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- * @FilePath: /data-show/src/utils/gol/bubbleWord.js
- */
-
-// let maskImage = new Image();
-// maskImage.src = require('@/assets/images/carSide.png');
-let colors = ['rgba(84,111,197,1)', 'rgba(145,203,116,1)', 'rgba(90,203,156,1)', 'rgba(248,200,87,1)', 'rgba(237,101,101,1)', "rgba(114,191,222,1)", 'rgba(58,162,114,1)', 'rgba(251,131,81,1)']
-//报纸的样式
-function newspaper() {
- // let colorArr = ['#423312', '#605030', '#9A855B', '#DFC8A4'];
- let colorArr = ['#FFF','#3373CC','#CC9D12','#54BF93']
- let colorIndex = Math.ceil(Math.random() * 3);
- return colorArr[colorIndex];
-}
-// 多彩的样式
-function colorfulStyle() {
- return 'rgb(' + [
- Math.round(Math.random() * 255),
- Math.round(Math.random() * 255),
- Math.round(Math.random() * 255)
- ].join(',') + ')';
-}
-// 将后台数据转成数组
-function doWordCloud(data) {
- let arr1 = [];
- for (let key in data) {
- let obj = { name: key, value: data[key] };
- arr1.push(obj);
- }
- return arr1;
-}
-//创建词云
-export default function createWordCloud(data) {
- let showData = null;
- if (Array.isArray(data)) {
- let words = [];
- data.forEach(e => {
- let o = {
- name: e.key,
- value: e.value
- }
- words.push(o)
- })
- showData = words;
- } else {
- let words = doWordCloud(data);
- showData = words;
- }
- return {
- tooltip: {
- trigger: "axis",
- backgroundColor: "#08182F",
- color: "#fff",
- borderColor: "#3373CC",
- textStyle: {
- color: "#fff", //设置文字颜色
- fontSize: 9
- },
- extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
- confine: true
- },
- series: [{
- type: 'wordCloud',
- shape: 'circle',
- // rotationRange: [0, 0], //旋转角度的范围
- rotationStep: 90, //旋转角度的步长
- //shape: 'circle',
- sizeRange: [6, 48], //字体大小范围
- gridSize: 8, //字间距
- // maskImage: maskImage,
- left: 'center',
- top: 'center',
- right: null,
- bottom: null,
- width: '100%',
- height: '100%',
- drawOutOfBound: true,
- textStyle: {
- fontFamily: 'sans-serif',
- fontWeight: 'bold',
- //颜色的回调函数, []
- color: function() {
- return newspaper()
- }
- },
- emphasis: {
- textStyle: {
- shadowBlur: 100,
- shadowColor: '#333'
- }
- },
- data: showData
- // {
- // name: 'Sam S Club',
- // value: 10000,
- // }
- }]
- }
-}
\ No newline at end of file
From 46df9470f614a83933951e9b01ccf311192ca377 Mon Sep 17 00:00:00 2001
From: xiaowen <372193233@qq.com>
Date: Thu, 4 Aug 2022 14:48:31 +0800
Subject: [PATCH 4/6] cxw-010203
---
components/word-cloud/index.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/components/word-cloud/index.js b/components/word-cloud/index.js
index 7e96e78..ae12dfc 100644
--- a/components/word-cloud/index.js
+++ b/components/word-cloud/index.js
@@ -113,10 +113,14 @@ Component({
return []
}
let arr = [];
- let max = 32;
+ let max = 18;
let maxVal = list[0][1];
+ let a1 = []
list.forEach(ele => {
let a = [ele[0], ele[1] / maxVal * max];
+ if(ele[1] / maxVal * max >= 7) {
+ a1.push(a)
+ }
arr.push(a)
})
return arr;
From 18fd56ecd279a3f39ce6963846db3f2c05c635b9 Mon Sep 17 00:00:00 2001
From: xiaowen <372193233@qq.com>
Date: Thu, 4 Aug 2022 14:58:48 +0800
Subject: [PATCH 5/6] cxw-010203
---
components/word-cloud/index.js | 4 ----
1 file changed, 4 deletions(-)
diff --git a/components/word-cloud/index.js b/components/word-cloud/index.js
index ae12dfc..c1e8c41 100644
--- a/components/word-cloud/index.js
+++ b/components/word-cloud/index.js
@@ -115,12 +115,8 @@ Component({
let arr = [];
let max = 18;
let maxVal = list[0][1];
- let a1 = []
list.forEach(ele => {
let a = [ele[0], ele[1] / maxVal * max];
- if(ele[1] / maxVal * max >= 7) {
- a1.push(a)
- }
arr.push(a)
})
return arr;
From 8232f315a1d4530a76846ce4b9c790a4c18071a0 Mon Sep 17 00:00:00 2001
From: zx <604444282@qq.com>
Date: Thu, 4 Aug 2022 15:31:00 +0800
Subject: [PATCH 6/6] zx
---
components/option/bubbleWord.js | 2 +-
pages/insight/pages/addTheme/index.js | 32 +++++++++++++------
pages/insight/pages/addTheme/index.wxml | 22 ++++++-------
pages/insight/pages/addTheme/index.wxss | 2 +-
.../pages/brandInsight/TailInsight/index.js | 11 ++-----
.../pages/brandInsight/TailInsight/index.wxml | 3 +-
.../pages/brandInsight/weiboInsight/index.js | 11 ++-----
.../pages/eventInsight/evTailwing/index.js | 11 ++-----
.../pages/eventInsight/evTotal/index.js | 11 ++-----
.../pages/modalInsight/TailInsight/index.js | 11 ++-----
.../pages/modalInsight/weiboInsight/index.js | 11 ++-----
11 files changed, 50 insertions(+), 77 deletions(-)
diff --git a/components/option/bubbleWord.js b/components/option/bubbleWord.js
index eedd2c1..f98ceed 100644
--- a/components/option/bubbleWord.js
+++ b/components/option/bubbleWord.js
@@ -69,7 +69,7 @@ export default function createWordCloud(data) {
shape: 'circle',
// rotationRange: [0, 0], //旋转角度的范围
rotationStep: 90, //旋转角度的步长
- //shape: 'circle',
+ shape: 'circle',
sizeRange: [6, 48], //字体大小范围
gridSize: 8, //字间距
// maskImage: maskImage,
diff --git a/pages/insight/pages/addTheme/index.js b/pages/insight/pages/addTheme/index.js
index 42f1f07..692bbd7 100644
--- a/pages/insight/pages/addTheme/index.js
+++ b/pages/insight/pages/addTheme/index.js
@@ -18,12 +18,19 @@ Page({
activeIcon: 'more',
}
],
+ //表单
+ Name: '',
+ StartTime: moment().valueOf(),
+ EndTime: moment().valueOf(),
+ DetailsData: [],
+ AnalyzeWord: '', // 和 或 的主体词
+ HuoWord:'', // 和 或 的可选词
+ HuoWord2:'', // 或 的可选词
+ PaiChu: '', // 排除词
+ highAnalizeWord: '', // 高级模式分析词
+ //
active: 0,
activeNames: [],
- start: moment().format("YYYY-MM-DD HH:mm:ss"),
- startTime: moment().valueOf(),
- end: moment().format("YYYY-MM-DD HH:mm:ss"),
- endTime: moment().valueOf(),
show1: false,
show2: false,
dt: '',
@@ -40,21 +47,28 @@ Page({
onShow() {
},
+ //表单
+ themeNameInput(event) {
+ this.setData({ Name: event.detail.value})
+ },
+ //
changeTips(value) {
this.setData({
activeNames: value.detail,
});
},
- onConfirm() {
+ onConfirm(event) {
+ var time = moment(event.detail).format("YYYY-MM-DD HH:mm:ss")
this.setData({
show1: false,
- start: this.data.dt
+ StartTime: time
});
},
- onConfirm2() {
+ onConfirm2(event) {
+ var time = moment(event.detail).format("YYYY-MM-DD HH:mm:ss")
this.setData({
- show2: false,
- start: this.data.dt2
+ show1: false,
+ EndTime: time
});
},
onDisplay() {
diff --git a/pages/insight/pages/addTheme/index.wxml b/pages/insight/pages/addTheme/index.wxml
index 5e1fb38..123b2f4 100644
--- a/pages/insight/pages/addTheme/index.wxml
+++ b/pages/insight/pages/addTheme/index.wxml
@@ -11,7 +11,7 @@
主题名称
-
+
监测开始时间
@@ -21,10 +21,10 @@
-
+
-
+
@@ -76,27 +76,27 @@
必选词(必选词逗号间是和的关系)
-
+
可选词(可选词与必选词是或的关系)
-
+
- 主题词(主题词逗号之间是或的关系)
-
+ 主体词(主体词逗号之间是或的关系)
+
关键词组一(主题词逗号之间是或的关系)
-
+
关键词组二(主题词逗号之间是或的关系)
-
+
排除词(搜索结果将不会含有排除词的数据)
-
+
分析词设置
-
+
diff --git a/pages/insight/pages/addTheme/index.wxss b/pages/insight/pages/addTheme/index.wxss
index 95482f2..6bf4614 100644
--- a/pages/insight/pages/addTheme/index.wxss
+++ b/pages/insight/pages/addTheme/index.wxss
@@ -1,6 +1,6 @@
.at-content{
margin-top: 34rpx;
- width: 686rpx;
+ width: 92%;
/* height: 528rpx; */
margin-left:32rpx;
padding: 0rpx 0rpx 32rpx 0rpx;
diff --git a/pages/insight/pages/brandInsight/TailInsight/index.js b/pages/insight/pages/brandInsight/TailInsight/index.js
index 296df8a..064b0f0 100644
--- a/pages/insight/pages/brandInsight/TailInsight/index.js
+++ b/pages/insight/pages/brandInsight/TailInsight/index.js
@@ -101,18 +101,11 @@ Component({
sBrand: wx.getStorageSync('sBrand') || '',
}).then(res => {
let arr1 = [];
- let skey = {
- 34: 50,
- 3: 416,
- 20: 1500,
- 23: 250
- };
Object.keys(res).forEach(key => {
- let o = [key, res[key] / skey[wx.getStorageSync('sTimeType')]]
+ let o = [key, res[key]]
arr1.push(o)
});
- const resArr = arr1.slice(0,50);
- this.setData({wordCloudData: resArr})
+ this.setData({wordCloudData: arr1})
});
},
toEventDetail(value) {
diff --git a/pages/insight/pages/brandInsight/TailInsight/index.wxml b/pages/insight/pages/brandInsight/TailInsight/index.wxml
index dd2cd4d..5adbaa8 100644
--- a/pages/insight/pages/brandInsight/TailInsight/index.wxml
+++ b/pages/insight/pages/brandInsight/TailInsight/index.wxml
@@ -53,7 +53,8 @@
-
+
+
diff --git a/pages/insight/pages/brandInsight/weiboInsight/index.js b/pages/insight/pages/brandInsight/weiboInsight/index.js
index 9ee4cb7..6ac2401 100644
--- a/pages/insight/pages/brandInsight/weiboInsight/index.js
+++ b/pages/insight/pages/brandInsight/weiboInsight/index.js
@@ -377,18 +377,11 @@ Component({
sBrand: wx.getStorageSync('sBrand') || '',
}).then(res => {
let arr1 = [];
- let skey = {
- 34: 50,
- 3: 416,
- 20: 1500,
- 23: 250
- };
Object.keys(res).forEach(key => {
- let o = [key, res[key] / skey[wx.getStorageSync('sTimeType')]]
+ let o = [key, res[key]]
arr1.push(o)
});
- const resArr = arr1.slice(0,50);
- this.setData({wordCloudData: resArr})
+ this.setData({wordCloudData: arr1})
});
},
getKol() {
diff --git a/pages/insight/pages/eventInsight/evTailwing/index.js b/pages/insight/pages/eventInsight/evTailwing/index.js
index 46a48b5..4f7dac2 100644
--- a/pages/insight/pages/eventInsight/evTailwing/index.js
+++ b/pages/insight/pages/eventInsight/evTailwing/index.js
@@ -60,18 +60,11 @@ Component({
sRele: wx.getStorageSync('sRele') || '',
}).then(res => {
let arr1 = [];
- let skey = {
- 34: 50,
- 3: 400,
- 20: 1500,
- 23: 240
- };
Object.keys(res).forEach(key => {
- let o = [key, res[key] / skey[wx.getStorageSync('sTimeType')]]
+ let o = [key, res[key]]
arr1.push(o)
});
- const resArr = arr1.slice(0,50);
- this.setData({wordCloudData: resArr})
+ this.setData({wordCloudData: arr1})
});
},
changeWordCloud(event) {
diff --git a/pages/insight/pages/eventInsight/evTotal/index.js b/pages/insight/pages/eventInsight/evTotal/index.js
index fa9dd9c..41acaaf 100644
--- a/pages/insight/pages/eventInsight/evTotal/index.js
+++ b/pages/insight/pages/eventInsight/evTotal/index.js
@@ -129,18 +129,11 @@ Component({
sRele: wx.getStorageSync('sRele') || '',
}).then(res => {
let arr1 = [];
- let skey = {
- 34: 50,
- 3: 416,
- 20: 1500,
- 23: 250
- };
Object.keys(res).forEach(key => {
- let o = [key, res[key] / skey[wx.getStorageSync('sTimeType')]]
+ let o = [key, res[key]]
arr1.push(o)
});
- const resArr = arr1.slice(0,50);
- this.setData({wordCloudData: resArr})
+ this.setData({wordCloudData: arr1})
});
},
changeWordCloud(event) {
diff --git a/pages/insight/pages/modalInsight/TailInsight/index.js b/pages/insight/pages/modalInsight/TailInsight/index.js
index 97de4b4..f8faa88 100644
--- a/pages/insight/pages/modalInsight/TailInsight/index.js
+++ b/pages/insight/pages/modalInsight/TailInsight/index.js
@@ -89,18 +89,11 @@ Component({
sSeriesName: wx.getStorageSync('sSeriesName') || ''
}).then(res => {
let arr1 = [];
- let skey = {
- 34: 50,
- 3: 416,
- 20: 1500,
- 23: 250
- };
Object.keys(res).forEach(key => {
- let o = [key, res[key] / skey[wx.getStorageSync('sTimeType')]]
+ let o = [key, res[key]]
arr1.push(o)
});
- const resArr = arr1.slice(0,50);
- this.setData({wordCloudData: resArr})
+ this.setData({wordCloudData: arr1})
});
},
toEventDetail(value) {
diff --git a/pages/insight/pages/modalInsight/weiboInsight/index.js b/pages/insight/pages/modalInsight/weiboInsight/index.js
index 8d528c3..64984a0 100644
--- a/pages/insight/pages/modalInsight/weiboInsight/index.js
+++ b/pages/insight/pages/modalInsight/weiboInsight/index.js
@@ -285,18 +285,11 @@ Component({
sSeriesName: wx.getStorageSync('sSeriesName') || ''
}).then(res => {
let arr1 = [];
- let skey = {
- 34: 5,
- 3: 41,
- 20: 150,
- 23: 25
- };
Object.keys(res).forEach(key => {
- let o = [key, res[key] / skey[wx.getStorageSync('sTimeType')]]
+ let o = [key, res[key]]
arr1.push(o)
});
- const resArr = arr1.slice(0,50);
- this.setData({wordCloudData: resArr})
+ this.setData({wordCloudData: arr1})
});
},
getKol() {