|
@@ -1,71 +1,175 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <highcharts
|
|
|
- constructor-type="stockChart"
|
|
|
- :options="chartOptions"
|
|
|
- ></highcharts>
|
|
|
- </div>
|
|
|
+ <n-space vertical>
|
|
|
+ <n-breadcrumb>
|
|
|
+ <n-breadcrumb-item>任务管理</n-breadcrumb-item>
|
|
|
+ <n-breadcrumb-item>数据编辑</n-breadcrumb-item>
|
|
|
+ </n-breadcrumb>
|
|
|
+ <n-grid x-gap="12" :cols="4">
|
|
|
+ <n-gi>
|
|
|
+ <n-card>
|
|
|
+ <n-list>
|
|
|
+ <template #header>
|
|
|
+ <n-checkbox v-model:checked="value"> 全选 </n-checkbox>
|
|
|
+ </template>
|
|
|
+ <template #footer>
|
|
|
+ <n-space>
|
|
|
+ <n-button>全选</n-button>
|
|
|
+ <n-button>全选</n-button>
|
|
|
+ <n-button>全选</n-button>
|
|
|
+ </n-space>
|
|
|
+ </template>
|
|
|
+ <n-list-item>
|
|
|
+ <template #prefix>
|
|
|
+ <n-checkbox v-model:checked="value" />
|
|
|
+ </template>
|
|
|
+ <template #suffix>
|
|
|
+ <n-button text>删除</n-button>
|
|
|
+ </template>
|
|
|
+ 123
|
|
|
+ </n-list-item>
|
|
|
+ <n-list-item>
|
|
|
+ <n-thing
|
|
|
+ title="Thing"
|
|
|
+ title-extra="extra"
|
|
|
+ description="description"
|
|
|
+ />
|
|
|
+ </n-list-item>
|
|
|
+ </n-list>
|
|
|
+ </n-card>
|
|
|
+ </n-gi>
|
|
|
+ <n-gi :span="3">
|
|
|
+ <n-space vertical>
|
|
|
+ <n-space>
|
|
|
+ <n-date-picker
|
|
|
+ v-model:value="range"
|
|
|
+ type="datetimerange"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ <n-button type="primary">搜索</n-button>
|
|
|
+ <n-button type="primary">导出数据</n-button>
|
|
|
+ <n-button type="primary">导入数据</n-button>
|
|
|
+ <n-button type="primary">导入数(冷链平台)</n-button>
|
|
|
+ <n-button type="primary">添加数据</n-button>
|
|
|
+ <n-button type="primary">温湿度上下限设置</n-button>
|
|
|
+ </n-space>
|
|
|
+ <n-space>
|
|
|
+ <n-button type="primary">开箱时间</n-button>
|
|
|
+ <n-button type="primary">关箱时间</n-button>
|
|
|
+ <n-button type="primary">开门时间</n-button>
|
|
|
+ <n-button type="primary">开门结束时间</n-button>
|
|
|
+ <n-button type="primary">开箱测点选择</n-button>
|
|
|
+ </n-space>
|
|
|
+ <n-card>
|
|
|
+ <n-scrollbar style="max-height: 600px">
|
|
|
+ <highcharts
|
|
|
+ constructor-type="stockChart"
|
|
|
+ :options="chartOptions"
|
|
|
+ ></highcharts>
|
|
|
+ <highcharts
|
|
|
+ constructor-type="stockChart"
|
|
|
+ :options="chartOptions"
|
|
|
+ ></highcharts>
|
|
|
+ </n-scrollbar>
|
|
|
+ </n-card>
|
|
|
+ </n-space>
|
|
|
+ </n-gi>
|
|
|
+ </n-grid>
|
|
|
+ </n-space>
|
|
|
+ <n-modal
|
|
|
+ v-model:show="modal.showModal"
|
|
|
+ :show-icon="false"
|
|
|
+ preset="dialog"
|
|
|
+ :title="modal.title"
|
|
|
+ content="你确认?"
|
|
|
+ positive-text="确认"
|
|
|
+ negative-text="删除该节点"
|
|
|
+ :negative-button-props="{ type: 'error', onClick: handleDelete }"
|
|
|
+ @positive-click="submitCallback"
|
|
|
+ >
|
|
|
+ <n-form-item>
|
|
|
+ <n-input v-model:value="value" type="text" />
|
|
|
+ </n-form-item>
|
|
|
+ </n-modal>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import data from "@/assets/data.json";
|
|
|
+const message = useMessage();
|
|
|
+
|
|
|
+const dialog = useDialog();
|
|
|
+const handleDelete = () => {
|
|
|
+ dialog.create({
|
|
|
+ content: "确定是否删除?",
|
|
|
+ positiveText: "确定",
|
|
|
+ negativeText: "取消",
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const value = ref(false);
|
|
|
+
|
|
|
+const range = ref(null);
|
|
|
|
|
|
const chartOptions = {
|
|
|
- accessibility: { enabled: false },
|
|
|
- chart: {
|
|
|
- height: 400,
|
|
|
+ type: "line",
|
|
|
+
|
|
|
+ accessibility: {
|
|
|
+ enabled: false,
|
|
|
},
|
|
|
|
|
|
title: {
|
|
|
- text: "Highcharts Stock Responsive Chart",
|
|
|
+ text: "Cumulative Sum",
|
|
|
+ align: "left",
|
|
|
},
|
|
|
|
|
|
subtitle: {
|
|
|
- text: "Click small/large buttons or change window size to test responsiveness",
|
|
|
+ text: "Displays the sum of all the previous values and the current value (only within visible range)",
|
|
|
+ align: "left",
|
|
|
+ },
|
|
|
+
|
|
|
+ plotOptions: {
|
|
|
+ series: {
|
|
|
+ cumulative: true,
|
|
|
+ pointStart: Date.UTC(2021, 0, 1),
|
|
|
+ pointIntervalUnit: "day",
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
rangeSelector: {
|
|
|
- selected: 1,
|
|
|
+ enabled: false,
|
|
|
+ },
|
|
|
+
|
|
|
+ tooltip: {
|
|
|
+ pointFormat:
|
|
|
+ '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.cumulativeSum})<br/>',
|
|
|
+ changeDecimals: 2,
|
|
|
+ valueDecimals: 2,
|
|
|
+ },
|
|
|
+
|
|
|
+ xAxis: {
|
|
|
+ minRange: 3 * 24 * 36e5,
|
|
|
+ max: Date.UTC(2021, 0, 6),
|
|
|
},
|
|
|
|
|
|
series: [
|
|
|
{
|
|
|
- name: "AAPL Stock Price",
|
|
|
- data: data,
|
|
|
- type: "area",
|
|
|
- threshold: null,
|
|
|
- tooltip: {
|
|
|
- valueDecimals: 2,
|
|
|
- },
|
|
|
cursor: "pointer",
|
|
|
events: {
|
|
|
- click: (event) => {
|
|
|
- console.log(event);
|
|
|
+ click: (p1) => {
|
|
|
+ console.log(p1);
|
|
|
},
|
|
|
},
|
|
|
+ data: [1, 2, 5, 10, 20, 50, 100, -100, 100, -100],
|
|
|
},
|
|
|
],
|
|
|
+};
|
|
|
|
|
|
- responsive: {
|
|
|
- rules: [
|
|
|
- {
|
|
|
- condition: {
|
|
|
- maxWidth: 500,
|
|
|
- },
|
|
|
- chartOptions: {
|
|
|
- chart: {
|
|
|
- height: 300,
|
|
|
- },
|
|
|
- subtitle: {
|
|
|
- text: null,
|
|
|
- },
|
|
|
- navigator: {
|
|
|
- enabled: false,
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
+const modal = reactive({
|
|
|
+ showModal: false,
|
|
|
+ title: "",
|
|
|
+});
|
|
|
+
|
|
|
+// 执行 positive 时执行的回调函数
|
|
|
+const submitCallback = () => {
|
|
|
+ message.success("Submit");
|
|
|
};
|
|
|
</script>
|
|
|
|