diff --git a/src/plugins/icon.ts b/src/plugins/icon.ts
index 1f485371..b195e340 100644
--- a/src/plugins/icon.ts
+++ b/src/plugins/icon.ts
@@ -1,4 +1,5 @@
import {
+ Add as AddIcon,
Close as CloseIcon,
Remove as RemoveIcon,
Resize as ResizeIcon,
@@ -52,6 +53,7 @@ import {
ColorWand as ColorWandIcon,
ArrowBack as ArrowBackIcon,
ArrowForward as ArrowForwardIcon,
+ ArrowDown as ArrowDownIcon,
Planet as PawIcon,
Search as SearchIcon,
ChevronUpOutline as ChevronUpOutlineIcon,
@@ -101,6 +103,8 @@ import {
} from '@vicons/carbon'
const ionicons5 = {
+ // 新增
+ AddIcon,
// 帮助(问号)
HelpOutlineIcon,
// 添加
@@ -206,6 +210,8 @@ const ionicons5 = {
ArrowBackIcon,
// 前进
ArrowForwardIcon,
+ // 向下
+ ArrowDownIcon,
// 狗爪
PawIcon,
// 搜索(放大镜)
diff --git a/src/plugins/naive.ts b/src/plugins/naive.ts
index ab4dbb1f..0d004df7 100644
--- a/src/plugins/naive.ts
+++ b/src/plugins/naive.ts
@@ -57,6 +57,7 @@ import {
NProgress,
NDatePicker,
NGrid,
+ NGi,
NGridItem,
NList,
NListItem,
@@ -160,6 +161,7 @@ const naive = create({
NProgress,
NDatePicker,
NGrid,
+ NGi,
NGridItem,
NList,
NListItem,
diff --git a/src/settings/chartThemes/index.ts b/src/settings/chartThemes/index.ts
index d066d858..7a205c1c 100644
--- a/src/settings/chartThemes/index.ts
+++ b/src/settings/chartThemes/index.ts
@@ -31,6 +31,9 @@ export const chartColors = {
// 默认主题
export const defaultTheme = 'dark'
+// 默认展示的选择器颜色列表
+export const swatchesColors = ['#232324', '#2a2a2b', '#313132', '#373739', '#757575', '#e0e0e0', '#eeeeee', '#fafafa']
+
// 主题色列表
export type ChartColorsNameType = keyof typeof chartColorsName
export const chartColorsName = {
@@ -48,21 +51,6 @@ export const chartColorsName = {
roma: '罗马红'
}
-// 主题色列表
-export const chartColorsshow = {
- dark: 'linear-gradient(to right, #4992ff 0%, #7cffb2 100%)',
- customed: 'linear-gradient(to right, #5470c6 0%, #91cc75 100%)',
- macarons: 'linear-gradient(to right, #2ec7c9 0%, #b6a2de 100%)',
- walden: 'linear-gradient(to right, #3fb1e3 0%, #6be6c1 100%)',
- purplePassion: 'linear-gradient(to right, #9b8bba 0%, #e098c7 100%)',
- vintage: 'linear-gradient(to right, #d87c7c 0%, #919e8b 100%)',
- chalk: 'linear-gradient(to right, #fc97af 0%, #87f7cf 100%)',
- westeros: 'linear-gradient(to right, #516b91 0%, #edafda 100%)',
- wonderland: 'linear-gradient(to right, #4ea397 0%, #22c3aa 100%)',
- essos: 'linear-gradient(to right, #893448 0%, #d95850 100%)',
- shine: 'linear-gradient(to right, #c12e34 0%, #0098d9 100%)',
- roma: 'linear-gradient(to right, #e01f54 0%, #5e4ea5 100%)'
-}
// 渐变主题色列表(主色1、主色2、阴影、渐变1、渐变2)
export const chartColorsSearch = {
dark: ['#4992ff', '#7cffb2', 'rgba(68, 181, 226, 0.3)', 'rgba(73, 146, 255, 0.5)', 'rgba(124, 255, 178, 0.5)'],
diff --git a/src/styles/common/mixins/mixins.scss b/src/styles/common/mixins/mixins.scss
index 5cb85f5f..ec6f2ccd 100644
--- a/src/styles/common/mixins/mixins.scss
+++ b/src/styles/common/mixins/mixins.scss
@@ -17,7 +17,7 @@
}
@mixin deep() {
- :deep(*) {
+ :deep() {
@content;
}
}
diff --git a/src/utils/style.ts b/src/utils/style.ts
index 8e8605d3..0fa9400a 100644
--- a/src/utils/style.ts
+++ b/src/utils/style.ts
@@ -86,6 +86,16 @@ export function darken(color: string, concentration: number) {
return Color(color).darken(concentration).toString()
}
+/**
+ * hsl 转成16进制
+ * @param hsl
+ * @returns
+ */
+export function hslToHex(hslString: string): string {
+ const color = Color(hslString);
+ return color.hex()
+}
+
/**
* * 修改主题色
* @param themeName 主题名称
diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/components/ChartThemeColor/index.vue b/src/views/chart/ContentConfigurations/components/CanvasPage/components/ChartThemeColor/index.vue
index fdca3b4a..9dd2e32b 100644
--- a/src/views/chart/ContentConfigurations/components/CanvasPage/components/ChartThemeColor/index.vue
+++ b/src/views/chart/ContentConfigurations/components/CanvasPage/components/ChartThemeColor/index.vue
@@ -1,5 +1,14 @@
-
+
+
+
+
+
diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRender/index.ts b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRender/index.ts
new file mode 100644
index 00000000..0008d299
--- /dev/null
+++ b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRender/index.ts
@@ -0,0 +1,3 @@
+import CreateColorRender from './index.vue'
+
+export { CreateColorRender }
diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRender/index.vue b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRender/index.vue
new file mode 100644
index 00000000..6bcdd75e
--- /dev/null
+++ b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRender/index.vue
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+ 名称:
+
+
+ 底部图表仅展示 7 条数据
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 删除颜色
+
+
+
+
+
+
+
+
+
+
+
+ 扩展色:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/barOptions.ts b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/barOptions.ts
new file mode 100644
index 00000000..e9a1048b
--- /dev/null
+++ b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/barOptions.ts
@@ -0,0 +1,47 @@
+import { echartOptionProfixHandle } from '@/packages/public'
+
+export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
+
+const seriesHandle = (color: string[]) => {
+ const numHandle = (numsi: number, i: number) => parseInt(`${numsi * Math.random()}`, 10) * 2
+ const nums = [60, 51, 200, 334, 366, 456, 223]
+
+ return color.map((item, index) => ({
+ name: `data${index + 1}`,
+ type: 'bar',
+ data: nums.map((numsItem, numsi) => numHandle(numsItem, index))
+ }))
+}
+
+export const option = (color: string[]) => {
+ return echartOptionProfixHandle(
+ {
+ tooltip: {
+ trigger: 'axis',
+ showContent: false,
+ axisPointer: {
+ type: 'shadow'
+ }
+ },
+ grid: {
+ left: '3%',
+ right: '4%',
+ bottom: '3%',
+ containLabel: true
+ },
+ xAxis: {
+ type: 'category',
+ data: color.map((e, i) => `data${i + 1}`),
+ axisTick: {
+ alignWithLabel: true
+ }
+ },
+ yAxis: {
+ show: true,
+ type: 'value'
+ },
+ series: seriesHandle(color || [])
+ },
+ includes
+ )
+}
diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/index.ts b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/index.ts
new file mode 100644
index 00000000..cf82cfcc
--- /dev/null
+++ b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/index.ts
@@ -0,0 +1,3 @@
+import CreateColorRenderChart from './index.vue'
+
+export { CreateColorRenderChart }
diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/index.vue b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/index.vue
new file mode 100644
index 00000000..2733e982
--- /dev/null
+++ b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/index.vue
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/lineOptions.ts b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/lineOptions.ts
new file mode 100644
index 00000000..2a41700d
--- /dev/null
+++ b/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/lineOptions.ts
@@ -0,0 +1,72 @@
+import { echartOptionProfixHandle } from '@/packages/public'
+import { graphic } from 'echarts/core'
+import { fade, hslToHex } from '@/utils'
+
+export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
+
+const seriesHandle = (color: string[]) => {
+ const numHandle = (numsi: number, i: number) => parseInt(`${numsi * Math.random()}`, 10) * 2
+ const nums = [130, 251, 200, 334, 366, 456, 223]
+
+ return color.map((item, index) => ({
+ name: `data${index + 1}`,
+ type: 'line',
+ smooth: true,
+ lineStyle: {
+ width: 1,
+ type: 'solid'
+ },
+ emphasis: {
+ focus: 'series'
+ },
+ areaStyle: {
+ opacity: 0.8,
+ color: new graphic.LinearGradient(0, 0, 0, 1, [
+ {
+ offset: 1,
+ color: item
+ },
+ {
+ offset: 0,
+ color: item
+ }
+ ])
+ },
+ showSymbol: false,
+ data: nums.reverse().map((numsItem, numsi) => numHandle(numsItem, index))
+ }))
+}
+
+export const option = (color: string[]) => {
+ return echartOptionProfixHandle(
+ {
+ tooltip: {
+ trigger: 'axis',
+ showContent: false,
+ axisPointer: {
+ type: 'shadow'
+ }
+ },
+ grid: {
+ left: '3%',
+ right: '4%',
+ bottom: '3%',
+ containLabel: true
+ },
+ xAxis: {
+ type: 'category',
+ boundaryGap: false,
+ data: color.map((e, i) => `data${i + 1}`),
+ axisTick: {
+ alignWithLabel: true
+ }
+ },
+ yAxis: {
+ show: true,
+ type: 'value'
+ },
+ series: seriesHandle(color || [])
+ },
+ includes
+ )
+}
diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue b/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue
index fc5a915e..f4ac2d24 100644
--- a/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue
+++ b/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue
@@ -128,6 +128,7 @@