|
@@ -2,7 +2,10 @@
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { NTabs, NTab } from 'naive-ui';
|
|
|
-import * as G2Plot from '@antv/g2plot';
|
|
|
+// import * as G2Plot from '@antv/g2plot';
|
|
|
+import * as echarts from 'echarts';
|
|
|
+import { areaOptions } from '@/utils/echartOptions'
|
|
|
+// import { Area } from '@antv/g2plot';
|
|
|
import { useChatStore } from '@/stores/modules/chatStore';
|
|
|
import { BaseTable, ChatWelcome, RecodeSquareCardItem, TheSubMenu, TheChatView } from "@/components";
|
|
|
import { ChatBaseCard, ChatAnswer } from '@/components/Chat';
|
|
@@ -22,6 +25,7 @@ const answerResult = ref("");
|
|
|
const textDataSources = ref(null);
|
|
|
|
|
|
const chart = ref({});
|
|
|
+const echartRef = ref({});
|
|
|
|
|
|
// 进出水数据
|
|
|
const jsTableData = ref([]);
|
|
@@ -54,12 +58,6 @@ const handleOpenContent = async ({ id, reason: title }) => {
|
|
|
|
|
|
// 创建图表
|
|
|
const initLineChat = () => {
|
|
|
- // chart.value = new Chart({
|
|
|
- // container: 'chart',
|
|
|
- // autoFit: true,
|
|
|
- // width: 500,
|
|
|
- // height: 300,
|
|
|
- // })
|
|
|
// 准备数据
|
|
|
const data =
|
|
|
[
|
|
@@ -101,20 +99,9 @@ const initLineChat = () => {
|
|
|
}
|
|
|
]
|
|
|
|
|
|
- const lineChart = new G2Plot.Line('chartContainer', {
|
|
|
- data,
|
|
|
- xField: 'time', // 对应你的 x 轴字段
|
|
|
- yField: 'val', // 对应你的 y 轴字段
|
|
|
- animation: {
|
|
|
- appear: {
|
|
|
- animation: 'path-in',
|
|
|
- duration: 5000,
|
|
|
- },
|
|
|
- },
|
|
|
- });
|
|
|
-
|
|
|
- lineChart.render();
|
|
|
-
|
|
|
+
|
|
|
+ const echart = echarts.init(echartRef.value, 'light');
|
|
|
+ echart.setOption(areaOptions)
|
|
|
}
|
|
|
|
|
|
// 欢迎 - 问答
|
|
@@ -153,9 +140,9 @@ onMounted(() => {
|
|
|
|
|
|
<TheChatView ref="scrollRef" :is-footer="false">
|
|
|
<ChatWelcome title="您好,我是LibraAI工艺管控助手" card-title="常见处理方案:" :sub-title="[
|
|
|
- '报警分析功能具备实时监测与预警机制,检测到异常情况推送相关工作人员确保问题及时处理',
|
|
|
- '报警时间为每小时警报,请大家及时处理'
|
|
|
- ]" v-if="!textDataSources" :card-content="recommendList" @on-click="handleWelcomeRecommend" />
|
|
|
+ '报警分析功能具备实时监测与预警机制,检测到异常情况推送相关工作人员确保问题及时处理',
|
|
|
+ '报警时间为每小时警报,请大家及时处理'
|
|
|
+ ]" v-if="!textDataSources" :card-content="recommendList" @on-click="handleWelcomeRecommend" />
|
|
|
<ChatBaseCard v-show="textDataSources">
|
|
|
<div class="waring-answer-wrapper">
|
|
|
<dl class="message-inner warning-info_medium ">
|
|
@@ -182,9 +169,10 @@ onMounted(() => {
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <div div class="pt-[40px] pb-[20px]" id="chartContainer"></div>
|
|
|
-
|
|
|
+ <div class="echart-warpper">
|
|
|
+ <div id="chartContainer" class="w-[600px] h-[200px]" ref="echartRef"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
</ChatBaseCard>
|
|
|
|
|
|
<ChatAnswer :loading="false" :delay-loading="false" :toggleVisibleIcons="false" :content="answerResult"
|
|
@@ -192,4 +180,18 @@ onMounted(() => {
|
|
|
|
|
|
</TheChatView>
|
|
|
</section>
|
|
|
-</template>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.echart-warpper {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ width: 100%;
|
|
|
+ height: 260px;
|
|
|
+ // padding: 10px;
|
|
|
+ border-radius: 8px;
|
|
|
+ // background: #eee;
|
|
|
+ // border: 1px solid #ccc;
|
|
|
+}
|
|
|
+</style>
|