diff --git a/src/styles/pages/index.scss b/src/styles/pages/index.scss index 75c53ad..68dd9a4 100644 --- a/src/styles/pages/index.scss +++ b/src/styles/pages/index.scss @@ -12,4 +12,132 @@ body { background-color: #18181c; } +} + +.chat-container { + box-sizing: border-box; + padding: 20px; + height: 100%; + gap: 15px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + + .chat-list { + overflow-y: auto; + display: flex; + flex-direction: column; + gap: 25px; + width: 50%; + height: 100%; + // border: 1px solid red; + + .chat-item { + display: flex; + gap: 6px; + } + .user-icon { + height: 50px; + width: 50px; + } + .user-message { + flex-direction: row-reverse; + .message-content { + display: flex; + flex-direction: column; + align-items: flex-end; + } + } + .text-ros { + display: flex; + align-items: center; + gap: 6px; + } + .ai-loading { + display: flex; + align-items: center; + font-size: 14px; + gap: 10px; + color: #ffffff; + } + .ai-message { + flex-direction: row; + .message-content { + display: flex; + flex-direction: column; + align-items: flex-start; + } + .ai-hint { + font-size: 12px; + } + } + .message-content { + font-size: 14px; + font-weight: 400; + .message-time { + color: #c3cad9; + } + width: calc(100% - 110px); + padding-top: 15px; + .message-text { + width: auto; + color: #ffffff; + font-size: 15px; + margin-top: 10px; + padding: 10px 18px; + background: #282a31; + border-radius: 10px 10px 10px 10px; + } + } + } + .chat-input { + width: 50%; + .chat-suffix { + font-size: 14px; + height: 100%; + display: flex; + align-items: center; + flex-direction: column; + justify-content: space-between; + } + .chat-send { + cursor: pointer; + width: 46px; + height: 30px; + margin-bottom: 10px; + background: url('@/assets/images/ai/chat-send.png'); + background-size: 100% 100%; + } + } + .echarts-box { + height: 220px; + width: 400px; +} +.echatrs-theme { + margin-top: 10px; + display: flex; + align-items: center; + gap: 6px; + .theme-title { + font-size: 14px; + color: #cfd5e5; + font-weight: 400; + } + .theme-list { + display: flex; + align-items: center; + gap: 10px; + .theme-item { + cursor: pointer; + background: #31363e; + border-radius: 2px; + font-size: 14px; + color: #cfd5e5; + font-weight: 400; + box-sizing: border-box; + padding: 2px 10px; + } + } +} } \ No newline at end of file diff --git a/src/views/AI/chat/class/BarChart.ts b/src/views/AI/chat/class/BarChart.ts deleted file mode 100644 index ecffa1b..0000000 --- a/src/views/AI/chat/class/BarChart.ts +++ /dev/null @@ -1,150 +0,0 @@ -import * as echarts from 'echarts'; - - interface ChartData { - xData: string[]; // X轴分类数据(如['一月', '二月', '三月']) - yData: number[]; // 单一数值数组(对应X轴每个分类的值) - seriesName?: string; // 系列名称(默认'数据系列') - color?: string; // 柱状图颜色(默认主题蓝色) - } - - export class BarChart { - private chart: echarts.ECharts | null = null; - private dom: HTMLElement; - private xData: string[]; - private yData: number[]; - private seriesName: string = '数据系列'; - private currentColor: string = '#1890ff'; // 默认颜色 - - constructor(containerId: string, chartData: ChartData) { - - this.dom = document.getElementById(containerId)!; - this.xData = chartData.xData; - this.yData = chartData.yData; - this.seriesName = chartData.seriesName || this.seriesName; - this.currentColor = chartData.color || this.currentColor; - this.initChart(); - } - - private initChart(): void { - this.chart = echarts.init(this.dom); - this.setChartOptions(); - window.addEventListener('resize', () => this.chart?.resize()); - } - - private setChartOptions(): void { - const option= { - - // tooltip: { - // trigger: 'axis', - // formatter: (params) => ` - //