|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <div class="tw-flex">
|
|
|
|
|
|
+ <div class="tw-flex tw-gap-4" style="background-color: #e1e6f1">
|
|
<a-table
|
|
<a-table
|
|
row-key="id"
|
|
row-key="id"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
@@ -7,13 +7,20 @@
|
|
:pagination="{ pageSize: 200, hideOnSinglePage: true }"
|
|
:pagination="{ pageSize: 200, hideOnSinglePage: true }"
|
|
></a-table>
|
|
></a-table>
|
|
|
|
|
|
- <a-button @click="openModal">说明</a-button>
|
|
|
|
|
|
+ <div class="tw-flex tw-gap-4">
|
|
|
|
+ <div style="width: 400px; height: 300px">
|
|
|
|
+ <v-chart class="chart" :option="chartOption(props.questions)" />
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <a-button @click="openModal">说明</a-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import EventBus from "@/plugins/eventBus";
|
|
import EventBus from "@/plugins/eventBus";
|
|
import { Question } from "@/types";
|
|
import { Question } from "@/types";
|
|
|
|
+import { EChartsOption } from "echarts/types/dist/shared";
|
|
|
|
|
|
const props = defineProps<{ questions: Question[] }>();
|
|
const props = defineProps<{ questions: Question[] }>();
|
|
|
|
|
|
@@ -38,4 +45,29 @@ const columns = [
|
|
function openModal() {
|
|
function openModal() {
|
|
EventBus.emit("SHOW_SETTING", "DESCRIBE050");
|
|
EventBus.emit("SHOW_SETTING", "DESCRIBE050");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+function chartOption(questions: any) {
|
|
|
|
+ console.log(questions);
|
|
|
|
+ return {
|
|
|
|
+ title: {
|
|
|
|
+ text: "难度",
|
|
|
|
+ left: "left",
|
|
|
|
+ },
|
|
|
|
+ xAxis: {
|
|
|
|
+ type: "category",
|
|
|
|
+ data: questions.map((v) => v.mainNumber + "-" + v.subNumber),
|
|
|
|
+ name: "题号",
|
|
|
|
+ },
|
|
|
|
+ yAxis: {
|
|
|
|
+ type: "value",
|
|
|
|
+ },
|
|
|
|
+ series: [
|
|
|
|
+ {
|
|
|
|
+ data: questions.map((v) => v.difficulty),
|
|
|
|
+ type: "line",
|
|
|
|
+ smooth: true,
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ } as EChartsOption;
|
|
|
|
+}
|
|
</script>
|
|
</script>
|