整理项目文档并优化权限监控与安装脚本
This commit is contained in:
@@ -72,13 +72,13 @@ import VChart from "vue-echarts";
|
||||
import { registerMap, use } from "echarts/core";
|
||||
import { CanvasRenderer } from "echarts/renderers";
|
||||
import { MapChart } from "echarts/charts";
|
||||
import { TooltipComponent } from "echarts/components";
|
||||
import { TooltipComponent, VisualMapComponent } from "echarts/components";
|
||||
import chinaMapGeoJson from "../assets/china.json";
|
||||
import { fetchIpLocations } from "../api/projectPermissions";
|
||||
import type { IpLocationsResponse, IpLocationStatItem } from "../types/api";
|
||||
import { normalizeProvinceName } from "./chinaProvinceMap";
|
||||
|
||||
use([CanvasRenderer, MapChart, TooltipComponent]);
|
||||
use([CanvasRenderer, MapChart, TooltipComponent, VisualMapComponent]);
|
||||
registerMap("ctms-china", chinaMapGeoJson as any);
|
||||
|
||||
const IconGlobe = () => h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, [
|
||||
@@ -185,6 +185,11 @@ const provinceData = computed(() => {
|
||||
return Array.from(provinceMap.values());
|
||||
});
|
||||
|
||||
const maxValue = computed(() => {
|
||||
const values = provinceData.value.map((item) => item.total_count);
|
||||
return values.length ? Math.max(...values) : 100;
|
||||
});
|
||||
|
||||
const chinaMapOption = computed(() => ({
|
||||
tooltip: {
|
||||
trigger: "item",
|
||||
@@ -200,6 +205,18 @@ const chinaMapOption = computed(() => ({
|
||||
].join("<br/>");
|
||||
},
|
||||
},
|
||||
visualMap: {
|
||||
min: 0,
|
||||
max: maxValue.value,
|
||||
left: "left",
|
||||
bottom: "20",
|
||||
text: ["高", "低"],
|
||||
inRange: {
|
||||
color: ["#edf3ff", "#a5c4fd", "#6399f7", "#3b82f6", "#1d4ed8"],
|
||||
},
|
||||
show: true,
|
||||
calculable: false,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "用户分布图",
|
||||
|
||||
Reference in New Issue
Block a user