Jay
2024-11-22 328968f75a4dd4292ebc71f01d759a824765ac72
src/views/data/point/DaPointChart.vue
@@ -41,7 +41,8 @@
          :loading="exportLoading"
          v-hasPermi="['data:point:export']"
        >
          <Icon icon="ep:download" />导出
          <Icon icon="ep:download"/>
          导出
        </el-button>
      </el-form-item>
    </el-form>
@@ -55,12 +56,14 @@
  import * as DaPoint from '@/api/data/da/point/daPointChart'
  import {getYMDHM0} from "@/utils/dateUtil"
  import download from "@/utils/download";
  const message = useMessage() // 消息弹窗
  const visible = ref(false);
  const chartDom = ref(null);
  let myChart = null;
  const chartParams = reactive({
    codes:[],
  pointNo: undefined,
    startDate : undefined,
    endDate: undefined,
  })
@@ -72,7 +75,7 @@
    startTime: getYMDHM0(new Date() - 60 * 60 * 1000),
    endTime: "",
  });
  const loading = ref(true) // 列表的加载中
  /** 打开弹窗 */
  const open = async (row: object) => {
    visible.value = true
@@ -164,18 +167,20 @@
      }
    }
  }
  /** 导出按钮操作 */
  const exportLoading = ref(false)
  const handleExport = async () => {
    chartParams.codes=[dataForm.value.pointNo];
    chartParams.startDate = dataForm.value.startTime;
    chartParams.endDate = dataForm.value.endTime;
    try {
      // 导出的二次确认
      await message.exportConfirm()
      // 发起导出
      exportLoading.value = true
      const data = await DaPoint.exportDaPointValue(chartParams)
    const data = await DaPoint.exportDaPointValue({
      pointNo: dataForm.value.pointNo,
      start: dataForm.value.startTime,
      end: dataForm.value.endTime
    })
      download.excel(data, dataForm.value.pointName +'.xls')
    } catch {
    } finally {