|
@@ -21,7 +21,8 @@
|
|
|
</div>
|
|
|
<div class="__cus-manage_content-main">
|
|
|
<div class="cloud">
|
|
|
- <div id="cloudId"/>
|
|
|
+ <cloudG2 :data="state.query.result.data"/>
|
|
|
+<!-- <cloudEcharts :data="state.query.result.data"/>-->
|
|
|
</div>
|
|
|
<div class="page">
|
|
|
<CusPage
|
|
@@ -38,8 +39,9 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import {getCurrentInstance, onMounted, reactive, ref} from "vue";
|
|
|
-import { Chart } from '@antv/g2';
|
|
|
import {useDictionaryStore} from "@/stores";
|
|
|
+import cloudG2 from './cloud-g2.vue'
|
|
|
+import cloudEcharts from './cloud-echarts.vue'
|
|
|
|
|
|
const DictionaryStore = useDictionaryStore()
|
|
|
const {proxy} = getCurrentInstance()
|
|
@@ -102,21 +104,27 @@ const onPage = (pageNum, pageSize) => {
|
|
|
setTimeout(() => {
|
|
|
state.query.result.total = 100
|
|
|
const arr = []
|
|
|
- for (let i = 0; i < state.query.page.pageSize; i++) {
|
|
|
+ for (let i = 0; i < 50; i++) {
|
|
|
const str = []
|
|
|
- for (let k = 0; k < proxy.$util.randomNum(1, 20); k++) {
|
|
|
+ for (let k = 0; k < i + 1; k++) {
|
|
|
str.push('啊')
|
|
|
}
|
|
|
arr.push({
|
|
|
id: i,
|
|
|
name: str.join(''),
|
|
|
- count: proxy.$util.randomNum(1, 1000),
|
|
|
+ count: proxy.$util.randomNum(1, 100),
|
|
|
startTime: '2020-04-06 12:34:22',
|
|
|
endTime: '2023-11-26 03:29:14',
|
|
|
+ username: '张三',
|
|
|
+ length: str.length
|
|
|
})
|
|
|
}
|
|
|
+ // arr.push({
|
|
|
+ // id: 1,
|
|
|
+ // name: '啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊',
|
|
|
+ // count: 10
|
|
|
+ // })
|
|
|
state.query.result.data = arr
|
|
|
- initChart()
|
|
|
state.query.loading = false
|
|
|
}, 1000)
|
|
|
// sysIndexFindIndexByPage(proxy.$util.formatGetParam(params)).then(res => {
|
|
@@ -125,37 +133,6 @@ const onPage = (pageNum, pageSize) => {
|
|
|
// state.query.loading = false
|
|
|
// })
|
|
|
}
|
|
|
-const initChart = () => {
|
|
|
- const data = state.query.result.data.map(v => {
|
|
|
- v.value = v.count
|
|
|
- v.text = v.name
|
|
|
- return v
|
|
|
- })
|
|
|
- if (state.chartChangeData) {
|
|
|
- state.chartChangeData(data)
|
|
|
- } else {
|
|
|
- const chart = new Chart({
|
|
|
- container: 'cloudId',
|
|
|
- autoFit: true,
|
|
|
- })
|
|
|
- chart.wordCloud()
|
|
|
- .data(data)
|
|
|
- .layout({
|
|
|
- spiral: 'rectangular',
|
|
|
- fontSize: [20, 100],
|
|
|
- })
|
|
|
- .encode('color', 'text')
|
|
|
- .tooltip({
|
|
|
- items: [
|
|
|
- {name: '数量', field: 'count'},
|
|
|
- {name: '首次查询日期', field: 'startTime'},
|
|
|
- {name: '最近查询日期', field: 'endTime'},
|
|
|
- ]
|
|
|
- })
|
|
|
- chart.render();
|
|
|
- state.chartChangeData = (data) => chart.changeData(data)
|
|
|
- }
|
|
|
-}
|
|
|
onMounted(() => {
|
|
|
initDictionary()
|
|
|
})
|