Hu Cheng 2 gadi atpakaļ
vecāks
revīzija
3a9f3103c5

+ 4 - 0
src/plugin/highcharts.js

@@ -1,4 +1,8 @@
 import Highcharts from "highcharts";
 import stockInit from "highcharts/modules/stock";
+import boostInit from "highcharts/modules/boost";
+import exportingInit from "highcharts/modules/exporting";
 
 stockInit(Highcharts);
+boostInit(Highcharts);
+exportingInit(Highcharts);

+ 33 - 42
src/views/project/data/edit/index.vue

@@ -8,9 +8,6 @@
       <n-gi>
         <n-card class="h-full">
           <n-list>
-            <template #header>
-              <n-checkbox v-model:value="selectedAll" />
-            </template>
             <template #footer>
               <n-space align="center">
                 <n-button size="small" type="primary">全选择</n-button>
@@ -65,11 +62,11 @@
           </n-space>
           <n-card>
             <n-scrollbar style="max-height: 600px">
-              <highcharts
+              <Chart
                 ref="chart"
                 constructor-type="stockChart"
                 :options="chartOptions"
-              ></highcharts>
+              ></Chart>
             </n-scrollbar>
           </n-card>
         </n-space>
@@ -196,23 +193,30 @@
 </template>
 
 <script setup>
-import { Chart as highcharts } from "highcharts-vue";
+import { Chart } from "highcharts-vue";
 
 const chart = ref(null);
 
-const onUpdateValues = () => {
-  let data = getData(n);
-  chart.value.chart.addSeries({
-    data,
-    lineWidth: 0.5,
-    cursor: "pointer",
-    events: {
-      click() {
-        modal.showModal = true;
-        modal.title = "详情";
+const onUpdateValues = (values, meta) => {
+  console.log(meta);
+  if (meta.actionType === "check") {
+    let data = getData(n);
+    chart.value.chart.addSeries({
+      id: meta.value,
+      name: meta.value,
+      data,
+      lineWidth: 0.5,
+      cursor: "pointer",
+      events: {
+        click() {
+          modal.showModal = true;
+          modal.title = "详情";
+        },
       },
-    },
-  });
+    });
+  } else {
+    chart.value.chart.get(meta.value).remove();
+  }
 };
 
 const handleDelete = () => {
@@ -221,14 +225,10 @@ const handleDelete = () => {
 
 const range = ref(null);
 
-const generalOptions = ["groode", "veli good", "emazing", "lidiculous"].map(
-  (v) => ({
-    label: v,
-    value: v,
-  })
-);
-
-const selectedAll = ref(null);
+const generalOptions = ["a", "b", "c", "d", "e", "f", "g"].map((v) => ({
+  label: v,
+  value: v,
+}));
 
 // 表单数据
 const formValue = reactive({
@@ -259,7 +259,7 @@ function getData(n) {
     b,
     c,
     spike;
-  for (i = 0; i < n; i = i + 1) {
+  for (let i = 0; i < n; i = i + 1) {
     if (i % 100 === 0) {
       a = 2 * Math.random();
     }
@@ -279,20 +279,23 @@ function getData(n) {
   return arr;
 }
 let n = 1000000;
-let data = getData(n);
 
 // 图表配置
 const chartOptions = {
+  legend: {
+    enabled: true,
+  },
   accessibility: {
     enabled: false,
   },
 
   chart: {
-    zoomType: "x",
+    zoomType: "xy",
   },
 
   boost: {
     useGPUTranslations: true,
+    seriesThreshold: 5,
   },
 
   title: {
@@ -307,19 +310,7 @@ const chartOptions = {
     valueDecimals: 2,
   },
 
-  series: [
-    {
-      data,
-      lineWidth: 0.5,
-      cursor: "pointer",
-      events: {
-        click() {
-          modal.showModal = true;
-          modal.title = "详情";
-        },
-      },
-    },
-  ],
+  series: [],
 };
 
 // 对话框数据源

+ 1 - 31
src/views/project/equipment/index.vue

@@ -16,25 +16,7 @@
           搜索
         </n-button>
       </n-input-group>
-      <n-space>
-        <n-space align="center">
-          <span>分类名称 </span>
-          <n-input-group>
-            <n-input
-              style="width: 300px"
-              v-model:value="formValue.T_name"
-              placeholder="请输入分类名称"
-            />
-            <n-popconfirm @positive-click="editDeviceClassInfo">
-              <template #trigger>
-                <n-button type="primary">修改分类</n-button>
-              </template>
-              是否确认编辑?
-            </n-popconfirm>
-          </n-input-group>
-        </n-space>
-        <n-button type="primary" @click="showAddModal">批量导入</n-button>
-      </n-space>
+      <n-button type="primary" @click="showAddModal">批量导入</n-button>
     </n-space>
     <n-data-table
       :key="(row) => row.Id"
@@ -85,7 +67,6 @@ import {
   editDeviceClassListData,
   deleteDeviceClassListData,
   getDeviceClass,
-  editDeviceClass,
 } from "@/api";
 
 const message = useMessage();
@@ -108,7 +89,6 @@ const rules = {
     required: true,
     message: "不能为空",
     trigger: "blur",
-    type: "number",
   },
 };
 
@@ -305,16 +285,6 @@ const getDeviceList = async () => {
   deviceList.value = res.Data.List;
 };
 
-// 设备分类(修改)
-const editDeviceClassInfo = async () => {
-  const { data: res } = await editDeviceClass({
-    Id: props.taskId,
-    T_name: formValue.T_name,
-  });
-  message.success(res.Msg);
-  getDeviceClassInfo();
-};
-
 // 设备分类(获取)
 const getDeviceClassInfo = async () => {
   const { data: res } = await getDeviceClass({

+ 1 - 1
src/views/project/scheme/index.vue

@@ -5,7 +5,7 @@
       <n-breadcrumb-item>实施方案</n-breadcrumb-item>
     </n-breadcrumb>
     <n-scrollbar style="max-height: 650px">
-      <div class="w-1/2 mx-auto">
+      <div class="w-1/3 mx-auto">
         <n-form
           ref="formRef"
           :model="formValue"