Browse Source

fix:G2组件添加字体类型

liu.shiyi 1 year ago
parent
commit
9637a4d52e

+ 17 - 1
data-room-ui/packages/G2Plots/进度图/仪表盘.js

@@ -1,4 +1,4 @@
-
+import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 const version = '2023092201'
 // 分类
@@ -87,6 +87,21 @@ const setting = [
     tabName: 'custom',
     groupName: 'graph'
   },
+  {
+    label: '指标字体类型',
+    // 设置组件类型
+    type: 'select',
+    // 字段
+    field: 'statistic_title_style_fontFamily',
+    // 对应options中的字段
+    optionField: 'statistic.title.style.fontFamily',
+    // 是否多选
+    multiple: false,
+    value: '',
+    tabName: 'custom',
+    options: fontList,
+    groupName: 'graph'
+  },
   {
     label: '标签内容',
     // 设置组件类型
@@ -174,6 +189,7 @@ const option = {
       style: {
         fontSize: 20,
         lineHeight: 2,
+        fontFamily: '',
         color: '#d0d0d0'
       },
       formatter: ({ percent }) => `${(percent * 100).toFixed(0)}%`

+ 19 - 3
data-room-ui/packages/G2Plots/进度图/水波图.js

@@ -1,4 +1,4 @@
-
+import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 const version = '2023092201'
 // 分类
@@ -92,6 +92,21 @@ const setting = [
     tabName: 'custom',
     groupName: 'graph'
   },
+  {
+    label: '字体类型',
+    // 设置组件类型
+    type: 'select',
+    // 字段
+    field: 'statistic_content_style_fontFamily',
+    // 对应options中的字段
+    optionField: 'statistic.content.style.fontFamily',
+    // 是否多选
+    multiple: false,
+    value: '',
+    tabName: 'custom',
+    options: fontList,
+    groupName: 'graph'
+  },
   {
     label: '边框宽度',
     // 设置组件类型
@@ -136,7 +151,7 @@ const setting = [
     value: '#598BF2',
     tabName: 'custom',
     groupName: 'graph'
-  },
+  }
 ]
 
 const data = [
@@ -187,7 +202,8 @@ const option = {
       style: {
         fontSize: 20,
         lineHeight: 1,
-        fill: '#d0d0d0'
+        fill: '#d0d0d0',
+        fontFamily: ''
       }
     }
   }

+ 17 - 1
data-room-ui/packages/G2Plots/进度图/矩形水波图.js

@@ -1,4 +1,4 @@
-
+import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 const version = '2023092201'
 // 分类
@@ -92,6 +92,21 @@ const setting = [
     tabName: 'custom',
     groupName: 'graph'
   },
+  {
+    label: '字体类型',
+    // 设置组件类型
+    type: 'select',
+    // 字段
+    field: 'statistic_content_style_fontFamily',
+    // 对应options中的字段
+    optionField: 'statistic.content.style.fontFamily',
+    // 是否多选
+    multiple: false,
+    value: '',
+    tabName: 'custom',
+    options: fontList,
+    groupName: 'graph'
+  },
   {
     label: '边框宽度',
     // 设置组件类型
@@ -173,6 +188,7 @@ const option = {
       style: {
         fontSize: 20,
         lineHeight: 1,
+        fontFamily: '',
         fill: '#d0d0d0'
       }
     }

+ 17 - 1
data-room-ui/packages/G2Plots/进度图/进度仪表盘.js

@@ -1,4 +1,4 @@
-
+import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 const version = '2023092201'
 // 分类
@@ -63,6 +63,21 @@ const setting = [
     tabName: 'custom',
     groupName: 'graph'
   },
+  {
+    label: '指标字体类型',
+    // 设置组件类型
+    type: 'select',
+    // 字段
+    field: 'statistic_title_style_fontFamily',
+    // 对应options中的字段
+    optionField: 'statistic.title.style.fontFamily',
+    // 是否多选
+    multiple: false,
+    value: '',
+    tabName: 'custom',
+    options: fontList,
+    groupName: 'graph'
+  },
   {
     label: '指标位置',
     // 设置组件类型
@@ -140,6 +155,7 @@ const option = {
       style: {
         fontSize: 20,
         lineHeight: 2,
+        fontFamily: '',
         color: '#d0d0d0'
       },
       formatter: ({ percent }) => `${(percent * 100).toFixed(0)}%`

+ 17 - 1
data-room-ui/packages/G2Plots/进度图/进度指标环图.js

@@ -1,3 +1,4 @@
+import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 const version = '2023092201'
 // 分类
@@ -123,6 +124,21 @@ const setting = [
     tabName: 'custom',
     groupName: 'graph'
   },
+  {
+    label: '指标字体类型',
+    // 设置组件类型
+    type: 'select',
+    // 字段
+    field: 'statistic_content_style_fontFamily',
+    // 对应options中的字段
+    optionField: 'statistic.content.style.fontFamily',
+    // 是否多选
+    multiple: false,
+    value: '',
+    tabName: 'custom',
+    options: fontList,
+    groupName: 'graph'
+  },
   {
     label: '指标位置',
     // 设置组件类型
@@ -169,7 +185,7 @@ const option = {
     //   offsetY: 0
     // },
     content: {
-      style: { fill: '#fafafa', fontSize: 28, lineHeight: 2 },
+      style: { fill: '#fafafa', fontSize: 28, fontFamily: '', lineHeight: 2 },
       offsetY: 0
     }
   }

+ 17 - 1
data-room-ui/packages/G2Plots/进度图/进度环图.js

@@ -1,3 +1,4 @@
+import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 const version = '2023092201'
 // 分类
@@ -123,6 +124,21 @@ const setting = [
     tabName: 'custom',
     groupName: 'graph'
   },
+  {
+    label: '指标字体类型',
+    // 设置组件类型
+    type: 'select',
+    // 字段
+    field: 'statistic_content_style_fontFamily',
+    // 对应options中的字段
+    optionField: 'statistic.content.style.fontFamily',
+    // 是否多选
+    multiple: false,
+    value: '',
+    tabName: 'custom',
+    options: fontList,
+    groupName: 'graph'
+  },
   {
     label: '指标位置',
     // 设置组件类型
@@ -169,7 +185,7 @@ const option = {
       offsetY: 0
     },
     content: {
-      style: { fill: '#fafafa', fontSize: 28, lineHeight: 2 },
+      style: { fill: '#fafafa', fontSize: 28, fontFamily: '', lineHeight: 2 },
       offsetY: 0
     }
   }

+ 17 - 1
data-room-ui/packages/G2Plots/进度图/钻石水波图.js

@@ -1,4 +1,4 @@
-
+import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 const version = '2023092201'
 // 分类
@@ -92,6 +92,21 @@ const setting = [
     tabName: 'custom',
     groupName: 'graph'
   },
+  {
+    label: '字体类型',
+    // 设置组件类型
+    type: 'select',
+    // 字段
+    field: 'statistic_content_style_fontFamily',
+    // 对应options中的字段
+    optionField: 'statistic.content.style.fontFamily',
+    // 是否多选
+    multiple: false,
+    value: '',
+    tabName: 'custom',
+    options: fontList,
+    groupName: 'graph'
+  },
   {
     label: '边框宽度',
     // 设置组件类型
@@ -171,6 +186,7 @@ const option = {
       style: {
         fontSize: 20,
         lineHeight: 1,
+        fontFamily: '',
         fill: '#d0d0d0'
       }
     }

+ 17 - 1
data-room-ui/packages/G2Plots/饼图/基础环图.js

@@ -1,4 +1,4 @@
-
+import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 const version = '2023092501'
 // 分类
@@ -200,6 +200,21 @@ const setting = [
     tabName: 'custom',
     groupName: 'graph'
   },
+  {
+    label: '副标题字体类型',
+    // 设置组件类型
+    type: 'select',
+    // 字段
+    field: 'statistic_content_style_fontFamily',
+    // 对应options中的字段
+    optionField: 'statistic.content.style.fontFamily',
+    // 是否多选
+    multiple: false,
+    value: '',
+    tabName: 'custom',
+    options: fontList,
+    groupName: 'graph'
+  },
   {
     label: '外环半径',
     // 设置组件类型
@@ -367,6 +382,7 @@ const option = {
         lineHeight: 2,
         overflow: 'hidden',
         textOverflow: 'ellipsis',
+        fontFamily: '',
         color: '#d0d0d0',
         fontSize: 30
       }