Hu Cheng 2 年 前
コミット
c832ded9fd
5 ファイル変更91 行追加16 行削除
  1. 3 3
      index.html
  2. 1 1
      src/common/index.js
  3. 61 5
      src/plugin/highcharts.js
  4. 24 5
      src/views/data/edit/index.vue
  5. 2 2
      src/views/equipment/index.vue

+ 3 - 3
index.html

@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <html lang="en">
   <head>
-    <meta charset="UTF-8">
-    <link rel="icon" href="/favicon.ico">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta charset="UTF-8" />
+    <link rel="icon" href="/favicon.ico" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>冷链验证报告生成系统</title>
   </head>
   <body>

+ 1 - 1
src/common/index.js

@@ -1,4 +1,4 @@
-import { getUpFileToken } from "@/api";
+import { getUpFileToken } from '@/api';
 
 // 获取上传token
 export const getFileToken = async (T_suffix) => {

+ 61 - 5
src/plugin/highcharts.js

@@ -1,8 +1,64 @@
-import Highcharts from "highcharts";
-import stockInit from "highcharts/modules/stock";
-import boostInit from "highcharts/modules/boost";
-import exportingInit from "highcharts/modules/exporting";
-import exportDataInit from "highcharts/modules/export-data";
+import Highcharts from 'highcharts';
+import stockInit from 'highcharts/modules/stock';
+import boostInit from 'highcharts/modules/boost';
+import exportingInit from 'highcharts/modules/exporting';
+import exportDataInit from 'highcharts/modules/export-data';
+
+Highcharts.setOptions({
+  lang: {
+    contextButtonTitle: '图表导出菜单',
+    decimalPoint: '.',
+    downloadJPEG: '下载JPEG图片',
+    downloadPDF: '下载PDF文件',
+    downloadPNG: '下载PNG文件',
+    downloadSVG: '下载SVG文件',
+    drillUpText: '返回 {series.name}',
+    loading: '加载中',
+    months: [
+      '一月',
+      '二月',
+      '三月',
+      '四月',
+      '五月',
+      '六月',
+      '七月',
+      '八月',
+      '九月',
+      '十月',
+      '十一月',
+      '十二月',
+    ],
+    noData: '没有数据',
+    numericSymbols: ['千', '兆', 'G', 'T', 'P', 'E'],
+    printChart: '打印图表',
+    resetZoom: '恢复缩放',
+    resetZoomTitle: '恢复图表',
+    shortMonths: [
+      'Jan',
+      'Feb',
+      'Mar',
+      'Apr',
+      'May',
+      'Jun',
+      'Jul',
+      'Aug',
+      'Sep',
+      'Oct',
+      'Nov',
+      'Dec',
+    ],
+    thousandsSep: ',',
+    weekdays: [
+      '星期一',
+      '星期二',
+      '星期三',
+      '星期四',
+      '星期五',
+      '星期六',
+      '星期天',
+    ],
+  },
+});
 
 stockInit(Highcharts);
 boostInit(Highcharts);

+ 24 - 5
src/views/data/edit/index.vue

@@ -24,7 +24,7 @@
                     <n-checkbox :value="item.T_id" />
                   </template>
                   <template #suffix>
-                    <n-space>
+                    <n-space :wrap="false">
                       <EditClass
                         :task="task"
                         :taskClass="item"
@@ -53,7 +53,7 @@
         </n-list>
       </n-card>
       <n-card class="h-full col-span-3">
-        <div class="flex flex-col gap-y-3">
+        <div class="h-full flex flex-col gap-y-3">
           <n-space align="center">
             <n-date-picker
               v-model:formatted-value="queryData.Time_start"
@@ -76,18 +76,27 @@
             <AddVue :class-list="classList" :task="task" />
             <SetVue @submit="handleSet" />
           </n-space>
-          <TemplateForm :task="task" :class-list="classList" />
+          <div>
+            <TemplateForm :task="task" :class-list="classList" />
+          </div>
+          <div class="flex justify-end">
+            <n-button type="primary" @click="isShowChart2 = !isShowChart2"
+              >显示湿度曲线图</n-button
+            >
+          </div>
           <n-scrollbar
-            :style="{ maxHeight: `${height - 350}px` }"
+            :style="{ maxHeight: `${height - 380}px` }"
             trigger="none"
           >
             <Chart
+              calss="h-full"
               ref="chart1"
               constructor-type="stockChart"
               :options="chartOptions1"
             ></Chart>
             <Chart
-              v-if="checkValues.length !== 0"
+              calss="h-full"
+              v-if="isShowChart2"
               ref="chart2"
               constructor-type="stockChart"
               :options="chartOptions2"
@@ -156,6 +165,8 @@ const task = window.sessionStorage.getItem('task')
   ? JSON.parse(window.sessionStorage.getItem('task'))
   : {};
 
+const isShowChart2 = ref(false);
+
 const chart1 = ref(null);
 const chart2 = ref(null);
 
@@ -400,6 +411,10 @@ const chartOptions1 = {
   },
 
   series: [],
+
+  scrollbar: {
+    enabled: false,
+  },
 };
 const chartOptions2 = {
   xAxis: {
@@ -445,6 +460,10 @@ const chartOptions2 = {
   },
 
   series: [],
+
+  scrollbar: {
+    enabled: false,
+  },
 };
 
 // 删除

+ 2 - 2
src/views/equipment/index.vue

@@ -120,8 +120,8 @@ const columns = [
         {},
         {
           default: () =>
-            ['修改编号', '删除'].map((item) => {
-              if (item === '修改编号') {
+            ['修改', '删除'].map((item) => {
+              if (item === '修改') {
                 return h(
                   NButton,
                   {