<template>
  <div>
    <div class="title">
      设备控制
      <div class="title_time">{{ currentDate }}</div>
    </div>
    <div class="card">
      <div class="screen">
        <div>
          选择电站&ensp;&ensp;<el-select v-model="Singlevalue" placeholder="选择电站" size="large" style="width: 240px">
            <el-option v-for="item in cities" :key="item.id" :label="item.stationName" :value="item.id" />
          </el-select>
        </div>
        &ensp;&ensp; &ensp;&ensp;
        <div>
          设备名称&ensp;&ensp;<el-input v-model="emsdevicename" style="width: 300px" size="large" placeholder="输入设备名称" />
        </div>
        <!-- <div>
            &ensp;&ensp;&ensp;&ensp;
            岗位名称&ensp;&ensp;<el-input
              v-model="postName"
              style="width: 300px"
              size="large"
              placeholder="输入岗位名称"
            />
          </div> -->
        &ensp;&ensp; &ensp;&ensp;
        <div>
          <el-button type="primary" size="large" color="#0052d9" @click="query(0)">查询</el-button>
          <el-button size="large" @click="query(1)">重置</el-button>&ensp;&ensp;
        </div>
      </div>
      <div class="screen1"></div>
    </div>
    <div class="card cardbottom">
      <!-- <el-button type="primary" size="large" color="#0052d9" @click="newaddition">新增</el-button> -->

      <div>&ensp;</div>
      <el-table :data="tableData.records" style="width: 100%" border show-overflow-tooltip>
        <el-table-column prop="eid" label="设备编号" />
        <el-table-column prop="emsDeviceId" label="设备名称" />
        <el-table-column prop="powerName" label="归属电站" />
        <el-table-column prop="binding" label="绑定状态" align="center">
          <template #default="scope">
            <!-- <div v-if="scope.row.binding == 1">绑定</div>
              <div v-else>未绑定</div> -->

            <div v-if="scope.row.binding == 1">已绑定</div>
            <div v-if="scope.row.binding == 0">未绑定</div>
          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="创建时间" />
        <el-table-column prop="updateTime" label="修改时间" />
        <!-- <el-table-column prop="url" label="设备图片" align="center" width="200">
          <template #default="scope">
            <div class="elimageurl">
              <div v-for="(item, index) in scope.row.url" :key="index">
                <el-image
                  style="width: 60px; height: 60px; margin-right: 10px"
                  :src="item"
                  :zoom-rate="1.2"
                  :max-scale="7"
                  :min-scale="0.2"
                  :preview-teleported="true"
                  :preview-src-list="scope.row.url"
                  :initial-index="index"
                  fit="cover"
                />
              </div>
            </div>

          </template>
        </el-table-column> -->
        <el-table-column prop="value" label="设备启停控制" align="center" width="200">
          <template #default="scope">
            <el-switch
              v-model="scope.row.binding"
              active-value="1"
              inactive-value="0"
              @change="changeswitch(scope.row)"
              size="large"
            />
          </template>
        </el-table-column>

        <el-table-column label="设备运行策略" align="center">
          <template #default="scope">
            <el-button color="#0052d9" type="primary" @click="newition(scope.row)"> 配置 </el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页组件 -->
      <div class="pagination">
        <div></div>
        <slot name="pagination">
          <Pagination :pageable="pageable" :handle-size-change="handleSizeChange" :handle-current-change="handleCurrentChange" />
        </slot>
      </div>
    </div>
    <el-dialog v-model="dialogVisible" title="参数配置" width="1200" :before-close="handleClose" border>
      <template #footer>
        <div class="dialog_footer2">夜间电网充放电配置(市电)</div>
        <div class="dialog_footer">
          充电开始时间&ensp;&ensp;&ensp;&ensp;

          <el-time-select
            v-model="Sys_Params_cz1"
            style="width: 240px"
            :max-time="Sys_Params_cy1"
            class="mr-4"
            placeholder="充电开始时间"
            start="00:00"
            step="00:01"
            end="24:00"
          />
          &ensp;&ensp;&ensp;&ensp; 充电结束时间&ensp;&ensp;&ensp;&ensp;

          <el-time-select
            v-model="Sys_Params_cy1"
            style="width: 240px"
            :max-time="Sys_Params_fz1"
            :min-time="Sys_Params_cz1"
            placeholder="充电结束时间"
            start="00:00"
            step="00:01"
            end="24:00"
            @change="handleFocus(1)"
          />
          &ensp;&ensp;&ensp;&ensp;充电功率&ensp;&ensp;
          <el-input
            type="number"
            v-model="Sys_Params_VPP_ChargePower_1"
            min="0"
            max="100"
            style="width: 160px"
            placeholder="请输入充电功率"
            @input="ChargePower1input"
          />
          &ensp;&ensp;
        </div>
        <div class="dialog_footer">
          放电开始时间&ensp;&ensp;&ensp;&ensp;

          <el-time-select
            v-model="Sys_Params_fz1"
            style="width: 240px"
            :min-time="Sys_Params_cy1"
            :max-time="Sys_Params_fy1"
            class="mr-4"
            placeholder="放电开始时间"
            start="00:00"
            step="00:01"
            end="24:00"
          />
          &ensp;&ensp;&ensp;&ensp; 放电结束时间&ensp;&ensp;&ensp;&ensp;

          <el-time-select
            v-model="Sys_Params_fy1"
            style="width: 240px"
            :min-time="Sys_Params_fz1"
            :max-time="Sys_Params_cz2"
            placeholder="放电结束时间"
            start="00:00"
            step="00:01"
            end="24:00"
            @change="handleFocus(2)"
          />
          &ensp;&ensp;&ensp;&ensp;放电功率&ensp;&ensp;
          <el-input
            v-model="Sys_Params_VPP_DischargePower_1"
            type="number"
            min="0"
            max="100"
            style="width: 160px"
            placeholder="请输入放电功率"
            @input="ChargePower2input"
          />
          &ensp;&ensp;
        </div>
        <div class="dialog_footer2">白天光伏充放电配置(光电)</div>

        <div class="dialog_footer">
          充电开始时间&ensp;&ensp;&ensp;&ensp;

          <el-time-select
            v-model="Sys_Params_cz2"
            style="width: 240px"
            :min-time="Sys_Params_fy1"
            :max-time="Sys_Params_cy2"
            class="mr-4"
            placeholder="充电开始时间"
            start="00:00"
            step="00:01"
            end="24:00"
          />

          &ensp;&ensp;&ensp;&ensp; 充电结束时间&ensp;&ensp;&ensp;&ensp;

          <el-time-select
            v-model="Sys_Params_cy2"
            style="width: 240px"
            :min-time="Sys_Params_cz2"
            :max-time="Sys_Params_fz2"
            placeholder="充电结束时间"
            start="00:00"
            step="00:01"
            end="24:00"
            @change="handleFocus(3)"
          />
          &ensp;&ensp;&ensp;&ensp;充电功率&ensp;&ensp;
          <el-input
            v-model="Sys_Params_VPP_ChargePower_2"
            type="number"
            min="0"
            max="100"
            style="width: 160px"
            placeholder="请输入充电功率"
            @input="ChargePower3input"
          />
          &ensp;&ensp;
        </div>
        <div class="dialog_footer">
          放电开始时间&ensp;&ensp;&ensp;&ensp;

          <el-time-select
            v-model="Sys_Params_fz2"
            style="width: 240px"
            :min-time="Sys_Params_cy2"
            :max-time="Sys_Params_fy2"
            class="mr-4"
            placeholder="放电开始时间"
            start="00:00"
            step="00:01"
            end="24:00"
          />

          &ensp;&ensp;&ensp;&ensp; 放电结束时间&ensp;&ensp;&ensp;&ensp;

          <el-time-select
            v-model="Sys_Params_fy2"
            style="width: 240px"
            :min-time="Sys_Params_fz2"
            placeholder="放电结束时间"
            start="00:00"
            step="00:01"
            end="24:00"
          />
          &ensp;&ensp;&ensp;&ensp;放电功率&ensp;&ensp;
          <el-input
            v-model="Sys_Params_VPP_DischargePower_2"
            type="number"
            min="0"
            max="100"
            style="width: 160px"
            placeholder="请输入放电功率"
            @input="ChargePower4input"
          />
          &ensp;&ensp;
        </div>
        <div class="dialog_footer1">
          <el-button type="primary" @click="determine" size="large" color="#0052d9"> 确定 </el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<!--  

-->
<script setup lang="ts">
import { selectemssytemNameURL, stationstationName, periodoftimeURL, mqttsendURL } from "@/api/home/Multisite";
import Pagination from "@/components/ProTable/components/Pagination.vue";
import { onMounted, ref, Ref } from "vue";
import { Station } from "@/api/interface";
// import UploadImgs from "@/components/Upload/Imgs.vue";
// import { useAuthButtons } from "@/hooks/useAuthButtons";
import { ElMessage, ElMessageBox } from "element-plus";

// const { BUTTONS } = useAuthButtons();
// 绑定设备
const Singlevalue = ref("");
const cities: Ref<Station.todo[]> = ref([]);
// 编辑绑定设备
const powerstation: Ref<Station.todo[]> = ref([]);

const poststationstationName = async () => {
  const { data } = await stationstationName({});
  const res = await stationstationName({});
  powerstation.value = res.data;
  cities.value = data;
  cities.value.unshift({
    id: "",
    stationName: "全部",
    energyMgrMode: 0,
    priceCfgMode: 0,
    sortNo: 0,
    timezone: ""
  });
  Singlevalue.value = data[0].id;
};
const query = (val: any) => {
  if (val == 0) {
    getplatformuserlist();
  } else {
    (emsdevicename.value = ""), (Singlevalue.value = "");
    getplatformuserlist();
  }
};
// 编辑
const emsId = ref();
const dialogVisible = ref();
const strategy = ref();
const muserlistObj = ref<{ [key: string]: any }>({});
// const muserlist = ref([]);

const newition = async (row: { url: never[]; emsDeviceId: any; eid: any; periodoftime: any }) => {
  dialogVisible.value = true;

  emsId.value = row.eid;
  strategy.value = row.periodoftime;

  for (let index = 0; index < strategy.value.length; index++) {
    for (let i = 0; i < strategy.value[index].length; i++) {
      // 将 value 转换为整数
      strategy.value[index][i].value = Number(strategy.value[index][i].value) | 0;

      const key = strategy.value[index][i].k; // 使用 'k' 属性作为键
      const value = strategy.value[index][i].value + "";
      const value1 = String(value).padStart(2, "0");
      // 将键值对推入 muserlist Sys_Params_VPP_ChargePower_1:30

      // 将键值对存入 muserlistObj
      muserlistObj.value[key] = value1;
    }
  }

  // 从 muserlistObj.value 中获取值并赋值给 Sys_Params_*
  Sys_Params_VPP_ChargePower_1.value = muserlistObj.value["Sys_Params_VPP_ChargePower_1"] || 0;
  Sys_Params_cz1.value = `${muserlistObj.value["Sys_Params_VPP_Charge_StartHour_1"] || ""}:${muserlistObj.value["Sys_Params_VPP_Charge_StartMin_1"] || ""}`;
  Sys_Params_cy1.value = `${muserlistObj.value["Sys_Params_VPP_Charge_StopHour_1"] || ""}:${muserlistObj.value["Sys_Params_VPP_Charge_StopMin_1"] || ""}`;

  Sys_Params_VPP_ChargePower_2.value = muserlistObj.value["Sys_Params_VPP_ChargePower_2"] || 0;
  Sys_Params_cz2.value = `${muserlistObj.value["Sys_Params_VPP_Charge_StartHour_2"] || ""}:${muserlistObj.value["Sys_Params_VPP_Charge_StartMin_2"] || ""}`;
  Sys_Params_cy2.value = `${muserlistObj.value["Sys_Params_VPP_Charge_StopHour_2"] || ""}:${muserlistObj.value["Sys_Params_VPP_Charge_StopMin_2"] || ""}`;

  Sys_Params_VPP_DischargePower_1.value = muserlistObj.value["Sys_Params_VPP_DischargePower_1"] || 0;
  Sys_Params_fz1.value = `${muserlistObj.value["Sys_Params_VPP_Discharge_StartHour_1"] || ""}:${muserlistObj.value["Sys_Params_VPP_Discharge_StartMin_1"] || ""}`;
  Sys_Params_fy1.value = `${muserlistObj.value["Sys_Params_VPP_Discharge_StopHour_1"] || ""}:${muserlistObj.value["Sys_Params_VPP_Discharge_StopMin_1"] || ""}`;

  Sys_Params_VPP_DischargePower_2.value = muserlistObj.value["Sys_Params_VPP_DischargePower_2"] || 0;
  Sys_Params_fz2.value = `${muserlistObj.value["Sys_Params_VPP_Discharge_StartHour_2"] || ""}:${muserlistObj.value["Sys_Params_VPP_Discharge_StartMin_2"] || ""}`;
  Sys_Params_fy2.value = `${muserlistObj.value["Sys_Params_VPP_Discharge_StopHour_2"] || ""}:${muserlistObj.value["Sys_Params_VPP_Discharge_StopMin_2"] || ""}`;
  // setTimeout(() => {
  //   loading.close();
  //   getplatformuserlist();
  // }, 2000);
};
const Switchvalue = ref();

const changeswitch = async (row: { eid: any; value: string }) => {
  // console.log("Switch value:", newValue);
  console.log("Switch value:", row);

  if (row.value == "0") {
    Switchvalue.value = "确定关闭设备吗?";
  } else {
    Switchvalue.value = "确定开启设备吗?";
  }
  ElMessageBox.confirm(Switchvalue.value, "设备控制", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning"
  })
    .then(async () => {
      let obj = {
        deviceId: row.eid,
        value: row.value == "0" ? "0" : "1",
        id: "7721e827-610e-4d15-8497-3590eb120c5f",
        name: "Sys_Cmd_StartStop"
      };
      const { data } = await mqttsendURL(obj);
      const res = data as { msg?: string }; // 类型断言，msg 是可选的

      ElMessage({
        type: "success",
        message: res.msg ?? "操作成功" // 如果 msg 不存在，使用默认值
      });
    })
    .catch(() => {
      ElMessage({
        type: "info",
        message: "取消操作"
      });
      row.value = row.value === "1" ? "0" : "1"; // 恢复到原来的状态
    });
};
// 确定
const determine = async () => {
  if (
    Sys_Params_VPP_ChargePower_1.value == 0 ||
    Sys_Params_VPP_ChargePower_2.value == 0 ||
    Sys_Params_cz1.value == undefined ||
    Sys_Params_cy1.value == undefined ||
    Sys_Params_cz2.value == undefined ||
    Sys_Params_cy2.value == undefined ||
    Sys_Params_VPP_DischargePower_1.value == 0 ||
    Sys_Params_VPP_DischargePower_2.value == 0 ||
    Sys_Params_fz1.value == undefined ||
    Sys_Params_fy1.value == undefined ||
    Sys_Params_fz2.value == undefined ||
    Sys_Params_fy2.value == undefined
  ) {
    ElMessage({
      type: "warning",
      message: "请输入充放电时间及功率" // 如果 msg 不存在，使用默认值
    });
    return;
  }

  let obj = [
    [
      {
        value: Sys_Params_VPP_ChargePower_1.value,
        id: "c50df00f-1c76-49a5-b3ed-70452bf40182",
        k: "Sys_Params_VPP_ChargePower_1"
      },
      {
        value: Sys_Params_cz1.value.split(":")[0],
        id: "96df77d1-0367-4b11-b4d0-94d854ee4e03",
        k: "Sys_Params_VPP_Charge_StartHour_1"
      },
      {
        value: Sys_Params_cz1.value.split(":")[1],
        id: "1ce66892-15ea-44a4-b6ba-cc85668ed060",
        k: "Sys_Params_VPP_Charge_StartMin_1"
      },
      {
        value: Sys_Params_cy1.value.split(":")[0],
        id: "5a40a3c7-03c0-4f35-ad0d-8dd0b12e3fe8",
        k: "Sys_Params_VPP_Charge_StopHour_1"
      },
      {
        value: Sys_Params_cy1.value.split(":")[1],
        id: "6a1ab2a9-e8f4-4687-83d5-7214fa246c4c",
        k: "Sys_Params_VPP_Charge_StopMin_1"
      }
    ],
    [
      {
        value: Sys_Params_VPP_ChargePower_2.value,
        id: "b3d2a5f1-79ba-40f8-8458-fa6fd5cec7c1",
        k: "Sys_Params_VPP_ChargePower_2"
      },
      {
        value: Sys_Params_cz2.value.split(":")[0],
        id: "8f80fdef-bbd2-4099-bf0b-7213de084f99",
        k: "Sys_Params_VPP_Charge_StartHour_2"
      },
      {
        value: Sys_Params_cz2.value.split(":")[1],

        id: "6fb9fe2b-b7d9-43c6-80b8-bcc67a5ddba5",
        k: "Sys_Params_VPP_Charge_StartMin_2"
      },
      {
        value: Sys_Params_cy2.value.split(":")[0],
        id: "cad0cec9-97fe-42b6-8f42-87816bd7d5fe",
        k: "Sys_Params_VPP_Charge_StopHour_2"
      },
      {
        value: Sys_Params_cy2.value.split(":")[1],
        id: "c73dfc92-d76a-45ea-9ffe-1628547cf850",
        k: "Sys_Params_VPP_Charge_StopMin_2"
      }
    ],
    [
      {
        value: Sys_Params_VPP_DischargePower_1.value,
        id: "1b1822f4-a28f-4e1a-bf7f-93ddeca96a59",
        k: "Sys_Params_VPP_DischargePower_1"
      },
      {
        value: Sys_Params_fz1.value.split(":")[0],

        id: "84005a81-1a5d-4fb2-9077-a7b277e9c489",
        k: "Sys_Params_VPP_Discharge_StartHour_1"
      },
      {
        value: Sys_Params_fz1.value.split(":")[1],

        id: "b2ed27a4-4afa-4cbf-a59e-fdb24df82658",
        k: "Sys_Params_VPP_Discharge_StartMin_1"
      },
      {
        value: Sys_Params_fy1.value.split(":")[0],

        id: "3d149d90-82c5-4ebf-89d2-3dad5773b5d5",
        k: "Sys_Params_VPP_Discharge_StopHour_1"
      },
      {
        value: Sys_Params_fy1.value.split(":")[1],

        id: "ce2904d4-42d2-4cb2-bef8-4ba1bd9a6687",
        k: "Sys_Params_VPP_Discharge_StopMin_1"
      }
    ],
    [
      {
        value: Sys_Params_VPP_DischargePower_2.value,
        id: "13b67750-d6fe-4198-8b2c-6a2a34a12c6c",
        k: "Sys_Params_VPP_DischargePower_2"
      },
      {
        value: Sys_Params_fz2.value.split(":")[0],
        id: "dc2ab3f4-0c0a-4444-8600-800ca3ac138d",
        k: "Sys_Params_VPP_Discharge_StartHour_2"
      },
      {
        value: Sys_Params_fz2.value.split(":")[1],
        id: "07f2edcb-2ef8-4ab8-94c0-fdc1fb057b2e",
        k: "Sys_Params_VPP_Discharge_StartMin_2"
      },
      {
        value: Sys_Params_fy2.value.split(":")[0],
        id: "3d61e26d-915c-4e26-86f4-52d0244deaac",
        k: "Sys_Params_VPP_Discharge_StopHour_2"
      },
      {
        value: Sys_Params_fy2.value.split(":")[1],
        id: "ffe51d70-8cc5-443a-8724-f7d796beaca3",
        k: "Sys_Params_VPP_Discharge_StopMin_2"
      }
    ]
  ];
  console.log(obj);

  const { data } = await periodoftimeURL(emsId.value, obj);
  const res = data as { msg?: string }; // 类型断言，msg 是可选的

  ElMessage({
    type: "success",
    message: res.msg ?? "操作成功" // 如果 msg 不存在，使用默认值
  });
  getplatformuserlist();
  dialogVisible.value = false;
};
// 弹出取消
const handleClose = () => {
  dialogVisible.value = false;
};
const tableData = ref();
const emsdevicename = ref("");
const pageable = ref({
  pn: 1,
  ps: 10,
  total: 0
});

// 表格操作 Hooks
const handleSizeChange = async (e: any) => {
  pageable.value.ps = e;
  getplatformuserlist();
};
const handleCurrentChange = async (e: any) => {
  pageable.value.pn = e;

  getplatformuserlist();
};
// 时间
const Sys_Params_cz1 = ref("");
const Sys_Params_cy1 = ref("");
const Sys_Params_fz1 = ref("");
const Sys_Params_fy1 = ref("");
const Sys_Params_cz2 = ref("");
const Sys_Params_cy2 = ref("");
const Sys_Params_fz2 = ref("");
const Sys_Params_fy2 = ref("");
// 时间

// 功率
const Sys_Params_VPP_ChargePower_1 = ref(0);
const Sys_Params_VPP_ChargePower_2 = ref(0);
const Sys_Params_VPP_DischargePower_1 = ref(0);
const Sys_Params_VPP_DischargePower_2 = ref(0);

// 处理点击事件
const handleFocus = (a: number) => {
  if (a == 1) {
    if (Sys_Params_cy1.value) {
      // 解析当前时间
      const [hour, minute] = Sys_Params_cy1.value.split(":").map(Number);

      // 增加一分钟
      let newMinute = minute + 1;
      let newHour = hour;

      // 处理分钟超过 59 的情况
      if (newMinute > 59) {
        newMinute = 0;
        newHour += 1;

        // 处理小时超过 23 的情况
        if (newHour > 23) {
          newHour = 0;
        }
      }

      // 格式化时间
      const formattedTime = `${String(newHour).padStart(2, "0")}:${String(newMinute).padStart(2, "0")}`;

      // 更新 Sys_Params_cy1 的值
      Sys_Params_fz1.value = formattedTime;
    }
  } else if (a == 2) {
    if (Sys_Params_fy1.value) {
      // 解析当前时间
      const [hour, minute] = Sys_Params_fy1.value.split(":").map(Number);

      // 增加一分钟
      let newMinute = minute + 1;
      let newHour = hour;

      // 处理分钟超过 59 的情况
      if (newMinute > 59) {
        newMinute = 0;
        newHour += 1;

        // 处理小时超过 23 的情况
        if (newHour > 23) {
          newHour = 0;
        }
      }

      // 格式化时间
      const formattedTime = `${String(newHour).padStart(2, "0")}:${String(newMinute).padStart(2, "0")}`;

      // 更新 Sys_Params_cy1 的值
      Sys_Params_cz2.value = formattedTime;
    }
  } else if (a == 3) {
    if (Sys_Params_cy2.value) {
      // 解析当前时间
      const [hour, minute] = Sys_Params_cy2.value.split(":").map(Number);

      // 增加一分钟
      let newMinute = minute + 1;
      let newHour = hour;

      // 处理分钟超过 59 的情况
      if (newMinute > 59) {
        newMinute = 0;
        newHour += 1;

        // 处理小时超过 23 的情况
        if (newHour > 23) {
          newHour = 0;
        }
      }

      // 格式化时间
      const formattedTime = `${String(newHour).padStart(2, "0")}:${String(newMinute).padStart(2, "0")}`;

      // 更新 Sys_Params_cy1 的值
      Sys_Params_fz2.value = formattedTime;
    }
  }
};
const getplatformuserlist = async () => {
  let obj = {
    powerId: Singlevalue.value, //查询电站id
    emsdeviceId: emsdevicename.value, // 设备名称
    pn: pageable.value.pn,
    ps: pageable.value.ps
  };
  const { data } = await selectemssytemNameURL(obj);
  tableData.value = data;
  pageable.value.total = tableData.value.total;
};
const ChargePower1input = async (e: any) => {
  if (e < 0) {
    Sys_Params_VPP_ChargePower_1.value = 0;
  } else if (e > 100) {
    Sys_Params_VPP_ChargePower_1.value = 100;
  }
};
const ChargePower2input = async (e: any) => {
  if (e < 0) {
    Sys_Params_VPP_DischargePower_1.value = 0;
  } else if (e > 100) {
    Sys_Params_VPP_DischargePower_1.value = 100;
  }
};
const ChargePower3input = async (e: any) => {
  if (e < 0) {
    Sys_Params_VPP_ChargePower_2.value = 0;
  } else if (e > 100) {
    Sys_Params_VPP_ChargePower_2.value = 100;
  }
};
const ChargePower4input = async (e: any) => {
  if (e < 0) {
    Sys_Params_VPP_DischargePower_2.value = 0;
  } else if (e > 100) {
    Sys_Params_VPP_DischargePower_2.value = 100;
  }
};
const currentDate = ref();

onMounted(() => {
  const current = localStorage.getItem("currentDate");
  if (current) {
    currentDate.value = current;
  }
  poststationstationName();
  getplatformuserlist();
});
</script>
<style scoped lang="scss">
@import "./index.scss";
</style>
<!--  

-->
