|
@@ -17,6 +17,7 @@
|
|
@keyup.enter="onSearch"
|
|
@keyup.enter="onSearch"
|
|
:style="{ color: colorValue }"
|
|
:style="{ color: colorValue }"
|
|
@blur="searchVal = searchVal.trim()"
|
|
@blur="searchVal = searchVal.trim()"
|
|
|
|
+ @keydown="searchValChange"
|
|
/>
|
|
/>
|
|
<i
|
|
<i
|
|
class="search-icon"
|
|
class="search-icon"
|
|
@@ -127,18 +128,14 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tubiao" id="echarts">
|
|
<div class="tubiao" id="echarts">
|
|
- <div class="tubiao_top">
|
|
|
|
- <span v-show="currentTBdata.name">
|
|
|
|
- {{ currentTBdata.name }}
|
|
|
|
- </span>
|
|
|
|
-
|
|
|
|
- <span v-show="currentTBdata.value">
|
|
|
|
- {{ currentTBdata.value }}
|
|
|
|
- </span>
|
|
|
|
- <span v-show="currentTBdata.ratio">
|
|
|
|
- {{ currentTBdata.ratio }}%
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <el-switch
|
|
|
|
+ v-model="ratioShow"
|
|
|
|
+ inactive-text="比例"
|
|
|
|
+ :width="26"
|
|
|
|
+ style="margin-left: 24px"
|
|
|
|
+ @change="changeratioShow"
|
|
|
|
+ >
|
|
|
|
+ </el-switch>
|
|
<div id="main_echarts" class="main_echarts"></div>
|
|
<div id="main_echarts" class="main_echarts"></div>
|
|
<div class="cut_download">
|
|
<div class="cut_download">
|
|
<span
|
|
<span
|
|
@@ -445,6 +442,7 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ ratioShow: false,
|
|
chsFhList: [",", "。", "”", ":", "》", "《", "?", "!", ";"],
|
|
chsFhList: [",", "。", "”", ":", "》", "《", "?", "!", ";"],
|
|
loading: false,
|
|
loading: false,
|
|
LeftLoading: false,
|
|
LeftLoading: false,
|
|
@@ -467,11 +465,21 @@ export default {
|
|
"#FF8000",
|
|
"#FF8000",
|
|
"#FF55F3",
|
|
"#FF55F3",
|
|
"#CEB800",
|
|
"#CEB800",
|
|
- "#CB1975",
|
|
|
|
- "#00D8B4",
|
|
|
|
- "#00CEFF",
|
|
|
|
- "#3274FF",
|
|
|
|
- "#00B60A",
|
|
|
|
|
|
+ // "#CB1975",
|
|
|
|
+ // "#00D8B4",
|
|
|
|
+ // "#00CEFF",
|
|
|
|
+ // "#3274FF",
|
|
|
|
+ // "#00B60A",
|
|
|
|
+ // 等级颜色
|
|
|
|
+ "#B6D58A",
|
|
|
|
+ "#66AE5B",
|
|
|
|
+ "#35776B",
|
|
|
|
+ "#73CDDE",
|
|
|
|
+ "#4CA6EE",
|
|
|
|
+ "#3873CB",
|
|
|
|
+ "#9031AA",
|
|
|
|
+ "#CBCBCB",
|
|
|
|
+ "#888888",
|
|
],
|
|
],
|
|
SearchwordNumber: 0,
|
|
SearchwordNumber: 0,
|
|
searchWord: [],
|
|
searchWord: [],
|
|
@@ -495,6 +503,7 @@ export default {
|
|
routerData: null,
|
|
routerData: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ watch: {},
|
|
methods: {
|
|
methods: {
|
|
// 词表
|
|
// 词表
|
|
gowordTable() {
|
|
gowordTable() {
|
|
@@ -509,11 +518,11 @@ export default {
|
|
closeSearchhighlight() {
|
|
closeSearchhighlight() {
|
|
this.ArticelData.forEach((item) => {
|
|
this.ArticelData.forEach((item) => {
|
|
// item.forEach((items) => {
|
|
// item.forEach((items) => {
|
|
- item.forEach((itemss) => {
|
|
|
|
- itemss.text.forEach((itemsss) => {
|
|
|
|
- itemsss.color = null;
|
|
|
|
- });
|
|
|
|
|
|
+ item.forEach((itemss) => {
|
|
|
|
+ itemss.text.forEach((itemsss) => {
|
|
|
|
+ itemsss.color = null;
|
|
});
|
|
});
|
|
|
|
+ });
|
|
// });
|
|
// });
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -667,6 +676,18 @@ export default {
|
|
this.colorValue = item;
|
|
this.colorValue = item;
|
|
this.colorIndex = index;
|
|
this.colorIndex = index;
|
|
},
|
|
},
|
|
|
|
+ searchValChange(e) {
|
|
|
|
+ if (this.searchVal.length == 1 && e.keyCode == 8) {
|
|
|
|
+ if (
|
|
|
|
+ this.colorIndex == this.searchWord.length + 1 ||
|
|
|
|
+ this.searchWord.length == 0
|
|
|
|
+ ) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.colorIndex = this.searchWord.length + 1;
|
|
|
|
+ this.colorValue = this.searchColorList[this.colorIndex];
|
|
|
|
+ }
|
|
|
|
+ },
|
|
onSearch() {
|
|
onSearch() {
|
|
if (!this.searchVal) {
|
|
if (!this.searchVal) {
|
|
return;
|
|
return;
|
|
@@ -682,18 +703,24 @@ export default {
|
|
}
|
|
}
|
|
this.type = "";
|
|
this.type = "";
|
|
this.calculateSearchwordNumber();
|
|
this.calculateSearchwordNumber();
|
|
- this.searchVal = "";
|
|
|
|
- this.colorIndex++;
|
|
|
|
- this.colorValue = this.searchColorList[this.colorIndex];
|
|
|
|
|
|
+ // this.searchVal = "";
|
|
},
|
|
},
|
|
// 词表跳转高亮
|
|
// 词表跳转高亮
|
|
async wordTablehighlight(data, color) {
|
|
async wordTablehighlight(data, color) {
|
|
|
|
+ this.colorValue = color;
|
|
|
|
+ this.searchColorList.forEach((item, i) => {
|
|
|
|
+ if (color == item) {
|
|
|
|
+ this.colorIndex = i;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.searchVal = data[data.length - 1];
|
|
let arr = [];
|
|
let arr = [];
|
|
await data.forEach((item) => {
|
|
await data.forEach((item) => {
|
|
this.calculateIndex(this.textContent, item).then((res) => {
|
|
this.calculateIndex(this.textContent, item).then((res) => {
|
|
arr.push(res);
|
|
arr.push(res);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ this.SearchwordNumber = arr[arr.length - 1].length; //高亮最后一次
|
|
// 匹配高亮
|
|
// 匹配高亮
|
|
this.ArticelData.forEach((item) => {
|
|
this.ArticelData.forEach((item) => {
|
|
item.forEach((items) => {
|
|
item.forEach((items) => {
|
|
@@ -724,10 +751,10 @@ export default {
|
|
});
|
|
});
|
|
this.SearchwordNumber = 0;
|
|
this.SearchwordNumber = 0;
|
|
// 高亮全部
|
|
// 高亮全部
|
|
- arr.forEach((item) => {
|
|
|
|
- this.SearchwordNumber += item.length;
|
|
|
|
- });
|
|
|
|
- // this.SearchwordNumber = arr[arr.length - 1].length; //高亮最后一次
|
|
|
|
|
|
+ // arr.forEach((item) => {
|
|
|
|
+ // this.SearchwordNumber += item.length;
|
|
|
|
+ // });
|
|
|
|
+ this.SearchwordNumber = arr[arr.length - 1].length; //高亮最后一次
|
|
// 匹配高亮
|
|
// 匹配高亮
|
|
this.ArticelData.forEach((item) => {
|
|
this.ArticelData.forEach((item) => {
|
|
item.forEach((items) => {
|
|
item.forEach((items) => {
|
|
@@ -755,18 +782,6 @@ export default {
|
|
// 找出对应字符的索引
|
|
// 找出对应字符的索引
|
|
calculateIndex(txt, key) {
|
|
calculateIndex(txt, key) {
|
|
return new Promise((reslove, reject) => {
|
|
return new Promise((reslove, reject) => {
|
|
- // let newtxt = "";
|
|
|
|
- // let txtarr = [];
|
|
|
|
- // txtarr = txt.split("");
|
|
|
|
- // txtarr.forEach((item, i) => {
|
|
|
|
- // if (this.chsFhList.indexOf(item) != -1) {
|
|
|
|
- // txtarr.splice(i, 1);
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // txtarr.forEach((item, i) => {
|
|
|
|
- // newtxt += item;
|
|
|
|
- // });
|
|
|
|
-
|
|
|
|
// 去除标点
|
|
// 去除标点
|
|
let keylength = key.length;
|
|
let keylength = key.length;
|
|
let arr = [];
|
|
let arr = [];
|
|
@@ -803,6 +818,8 @@ export default {
|
|
this.seleLevelMapList = [];
|
|
this.seleLevelMapList = [];
|
|
sessionStorage.setItem("tablehighlight", false);
|
|
sessionStorage.setItem("tablehighlight", false);
|
|
}
|
|
}
|
|
|
|
+ this.colorIndex = 0;
|
|
|
|
+ this.colorValue = this.searchColorList[this.colorIndex];
|
|
this.closeSearchhighlight();
|
|
this.closeSearchhighlight();
|
|
},
|
|
},
|
|
cutHeaderText(type) {
|
|
cutHeaderText(type) {
|
|
@@ -824,7 +841,7 @@ export default {
|
|
}
|
|
}
|
|
let newnode = document.createElement("div");
|
|
let newnode = document.createElement("div");
|
|
newnode.id = "main_echarts";
|
|
newnode.id = "main_echarts";
|
|
- newnode.style.width = "256px";
|
|
|
|
|
|
+ newnode.style.width = "342px";
|
|
newnode.style.height = "256px";
|
|
newnode.style.height = "256px";
|
|
newnode.style.margin = "0 auto";
|
|
newnode.style.margin = "0 auto";
|
|
|
|
|
|
@@ -833,6 +850,9 @@ export default {
|
|
reslove();
|
|
reslove();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ changeratioShow() {
|
|
|
|
+ this.createEcharts("main_echarts", "柱状图", this.leftList, 0);
|
|
|
|
+ },
|
|
// 图表
|
|
// 图表
|
|
createEcharts(id, type, data, index) {
|
|
createEcharts(id, type, data, index) {
|
|
this.chartIndex = index;
|
|
this.chartIndex = index;
|
|
@@ -845,21 +865,44 @@ export default {
|
|
let valueStype = [];
|
|
let valueStype = [];
|
|
let value = [];
|
|
let value = [];
|
|
let leidaList = [];
|
|
let leidaList = [];
|
|
- newdata.forEach((item) => {
|
|
|
|
- item.value = item.value;
|
|
|
|
- item.name = item.name;
|
|
|
|
- name.push(item.name);
|
|
|
|
- valueStype.push({
|
|
|
|
- value: item.value,
|
|
|
|
- percent: item.ratio + "%",
|
|
|
|
|
|
+ // 去除括号
|
|
|
|
+ if (this.xifen) {
|
|
|
|
+ newdata.forEach((item) => {
|
|
|
|
+ item.name = item.name.replace("(", "");
|
|
|
|
+ item.name = item.name.replace(")", "");
|
|
});
|
|
});
|
|
- value.push(item.value);
|
|
|
|
- leidaList.push({
|
|
|
|
- name: item.name,
|
|
|
|
- // max: data[data.length - 1].number,
|
|
|
|
- // max: 100, //这个总数需要等接口
|
|
|
|
|
|
+ }
|
|
|
|
+ // 比例开关
|
|
|
|
+ if (this.ratioShow) {
|
|
|
|
+ newdata.forEach((item) => {
|
|
|
|
+ item.value = item.ratio;
|
|
|
|
+ item.name = item.name;
|
|
|
|
+ name.push(item.name);
|
|
|
|
+ valueStype.push({
|
|
|
|
+ value: item.ratio,
|
|
|
|
+ percent: item.ratio + "%",
|
|
|
|
+ });
|
|
|
|
+ value.push(item.ratio);
|
|
|
|
+ leidaList.push({
|
|
|
|
+ name: item.name,
|
|
|
|
+ });
|
|
});
|
|
});
|
|
- });
|
|
|
|
|
|
+ } else {
|
|
|
|
+ newdata.forEach((item) => {
|
|
|
|
+ item.value = item.value;
|
|
|
|
+ item.name = item.name;
|
|
|
|
+ name.push(item.name);
|
|
|
|
+ valueStype.push({
|
|
|
|
+ value: item.value,
|
|
|
|
+ percent: item.ratio + "%",
|
|
|
|
+ });
|
|
|
|
+ value.push(item.value);
|
|
|
|
+ leidaList.push({
|
|
|
|
+ name: item.name,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
var chartDom = document.getElementById(id);
|
|
var chartDom = document.getElementById(id);
|
|
this.myChart = echarts.init(chartDom);
|
|
this.myChart = echarts.init(chartDom);
|
|
var option = null;
|
|
var option = null;
|
|
@@ -884,6 +927,9 @@ export default {
|
|
"#888888",
|
|
"#888888",
|
|
];
|
|
];
|
|
if (type == "饼状图") {
|
|
if (type == "饼状图") {
|
|
|
|
+ newdata.forEach((item) => {
|
|
|
|
+ item.name = item.name + item.ratio + "%";
|
|
|
|
+ });
|
|
option = {
|
|
option = {
|
|
color: this.xifen ? color2 : color1,
|
|
color: this.xifen ? color2 : color1,
|
|
series: [
|
|
series: [
|
|
@@ -892,10 +938,6 @@ export default {
|
|
type: "pie",
|
|
type: "pie",
|
|
radius: ["40%", "70%"],
|
|
radius: ["40%", "70%"],
|
|
data: newdata,
|
|
data: newdata,
|
|
- label: {
|
|
|
|
- show: false,
|
|
|
|
- position: "center",
|
|
|
|
- },
|
|
|
|
itemStyle: {
|
|
itemStyle: {
|
|
borderColor: "#f5f5f5",
|
|
borderColor: "#f5f5f5",
|
|
borderWidth: 5,
|
|
borderWidth: 5,
|
|
@@ -1006,7 +1048,6 @@ export default {
|
|
arr.splice(index, 1, item);
|
|
arr.splice(index, 1, item);
|
|
return arr;
|
|
return arr;
|
|
});
|
|
});
|
|
-
|
|
|
|
return [data, ...helper].map((item, index) => {
|
|
return [data, ...helper].map((item, index) => {
|
|
return {
|
|
return {
|
|
type: "radar",
|
|
type: "radar",
|
|
@@ -1107,6 +1148,11 @@ export default {
|
|
this.allRatio += item.ratio * 1;
|
|
this.allRatio += item.ratio * 1;
|
|
this.allValue += item.value;
|
|
this.allValue += item.value;
|
|
});
|
|
});
|
|
|
|
+ res.data.result.forEach((item) => {
|
|
|
|
+ if (item.value != 0) {
|
|
|
|
+ item.ratio = ((item.value / this.allValue) * 100).toFixed(2);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
this.allRatio = this.allRatio.toFixed(2);
|
|
this.allRatio = this.allRatio.toFixed(2);
|
|
this.leftList = res.data.result;
|
|
this.leftList = res.data.result;
|
|
|
|
|
|
@@ -1625,7 +1671,7 @@ export default {
|
|
padding: 12px 15px;
|
|
padding: 12px 15px;
|
|
.right_main_top {
|
|
.right_main_top {
|
|
display: flex;
|
|
display: flex;
|
|
- justify-content: space-around;
|
|
|
|
|
|
+ justify-content: end;
|
|
align-items: center;
|
|
align-items: center;
|
|
font-weight: 600;
|
|
font-weight: 600;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
@@ -1642,11 +1688,12 @@ export default {
|
|
.articel {
|
|
.articel {
|
|
width: 640px;
|
|
width: 640px;
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|
|
- margin-top: 17px;
|
|
|
|
|
|
+ margin-top: 40px;
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
.paragraph {
|
|
.paragraph {
|
|
display: flex;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
|
|
+ margin-bottom: 22px;
|
|
// .sentence {
|
|
// .sentence {
|
|
// display: flex;
|
|
// display: flex;
|
|
// flex-wrap: wrap;
|
|
// flex-wrap: wrap;
|