@ued_fpi/data-visual 1.4.12 → 1.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -119,7 +119,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
119
119
  key: 0,
120
120
  class: "box",
121
121
  direction: "y",
122
- time: 10
122
+ time: unref(disasterList).length * 5
123
123
  }, {
124
124
  default: withCtx(() => [
125
125
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(disasterList), (item, index) => {
@@ -138,7 +138,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
138
138
  }), 128))
139
139
  ]),
140
140
  _: 1
141
- })) : (openBlock(), createBlock(_sfc_main$1, {
141
+ }, 8, ["time"])) : (openBlock(), createBlock(_sfc_main$1, {
142
142
  key: 1,
143
143
  type: "noDataTime",
144
144
  class: "box"
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, onMounted, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeStyle, unref, toDisplayString } from 'vue';
1
+ import { defineComponent, computed, ref, onMounted, openBlock, createElementBlock, createElementVNode, Fragment, renderList, unref, normalizeStyle, toDisplayString } from 'vue';
2
2
  import requestControl from '../../service/request.mjs';
3
3
  import { useThemeHook } from '../../../utils.mjs';
4
4
  import '../../utils/highchartsPiePlugins.mjs';
@@ -24,18 +24,25 @@ const __default__ = {
24
24
  };
25
25
  const _sfc_main = /* @__PURE__ */ defineComponent({
26
26
  ...__default__,
27
+ props: {
28
+ riskLevelList: {
29
+ type: Array,
30
+ default() {
31
+ return [
32
+ { title: "重大风险", key: "majorRiskCompany" },
33
+ { title: "较大风险", key: "largerRiskCompany" },
34
+ { title: "一般风险", key: "generalRiskCompany" },
35
+ { title: "低风险", key: "lowRiskCompany" }
36
+ ];
37
+ }
38
+ }
39
+ },
27
40
  setup(__props) {
41
+ const props = __props;
28
42
  const { isDark } = useThemeHook();
29
- const colors = ["#F84439", "#FDBD00", "#15F3A3", "#00DEFF"];
30
- const colors_light = ["#FF4D4F", "#FAAD14", "#52C41A", "#1677FF"];
31
- const LinearGradientColor = [["#FF4A4A", "#FF7474"], ["#FDBD00", "#F4A93B"], ["#15F3A3", "#11D68F"], ["#59AEDE", "#338EC1"]];
32
- const LinearGradientColor_light = [["#FF4A4A", "#FF7474"], ["#FDBD00", "#F4A93B"], ["#15F3A3", "#11D68F"], ["#1677FF", "#85B8FF"]];
33
- const riskLevel = ref([
34
- { title: "高风险", key: "majorRiskCompany" },
35
- { title: "较大风险", key: "largerRiskCompany" },
36
- { title: "一般风险", key: "generalRiskCompany" },
37
- { title: "低风险", key: "lowRiskCompany" }
38
- ]);
43
+ const colors = ["#F84439", "#FD7A00", "#FDBD00", "#00DEFF"];
44
+ const colors_light = ["#F84439", "#FD7A00", "#FDBD00", "#00DEFF"];
45
+ const riskLevel = computed(() => props.riskLevelList);
39
46
  const levelData = ref({
40
47
  majorRiskCompany: 0,
41
48
  largerRiskCompany: 0,
@@ -97,7 +104,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
97
104
  });
98
105
  });
99
106
  }
100
- const color = isDark ? LinearGradientColor : LinearGradientColor_light;
107
+ const color = isDark ? colors : colors_light;
101
108
  highcharts.chart("pieChart", {
102
109
  chart: {
103
110
  type: "pie",
@@ -119,12 +126,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
119
126
  title: {
120
127
  text: null
121
128
  },
122
- colors: [
123
- { linearGradient: { x1: 0, y1: 1, x2: 1, y2: 0 }, stops: [[0, color[0][0]], [1, color[0][1]]] },
124
- { linearGradient: { x1: 0, y1: 1, x2: 1, y2: 0 }, stops: [[0, color[1][0]], [1, color[1][1]]] },
125
- { linearGradient: { x1: 0, y1: 1, x2: 1, y2: 0 }, stops: [[0, color[2][0]], [1, color[2][1]]] },
126
- { linearGradient: { x1: 0, y1: 1, x2: 1, y2: 0 }, stops: [[0, color[3][0]], [1, color[3][1]]] }
127
- ],
129
+ colors: color,
128
130
  tooltip: { enabled: false },
129
131
  plotOptions: {
130
132
  pie: {
@@ -157,7 +159,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
157
159
  createElementVNode("div", _hoisted_2, [
158
160
  _hoisted_3,
159
161
  createElementVNode("div", _hoisted_4, [
160
- (openBlock(true), createElementBlock(Fragment, null, renderList(riskLevel.value, (level, idx) => {
162
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(riskLevel), (level, idx) => {
161
163
  return openBlock(), createElementBlock("div", {
162
164
  key: level.key,
163
165
  class: "legend-item"