whychdw
2025-06-07 9bb2fe3742abcc4f100a4ca557842c3cc659cc8a
src/views/dcPowerStatus/standardParams.vue
@@ -1,10 +1,13 @@
<script setup name="StandardParams">
import {ref} from "vue";
import {ref, onMounted, computed} from "vue";
import {ElLoading} from "element-plus";
import ycCard from "@/components/ycCard/index.vue";
import PwButton from "@/components/pwButton.vue";
import TabButton from "@/components/TabButton/index.vue";
import HdwButton from "@/components/HdwButton/index.vue";
import NoData from "@/components/noData.vue";
import {getPwrStandParamApi} from "@/api/standardParams.js";
import addEdit from "./dialog/addEdit.vue";
const headers = [
  {
    prop: "standName",
@@ -19,27 +22,27 @@
  {
    prop: "basisVal",
    label: "基准值",
    width: "160",
    width: "80",
  },
  {
    prop: "alarmLimith",
    label: "上限",
    width: "160",
    width: "80",
  },
  {
    prop: "alarmLimithUpeper",
    label: "上上限",
    width: "160",
    width: "80",
  },
  {
    prop: "alarmLimitl",
    label: "下限",
    width: "160",
    width: "80",
  },
  {
    prop: "alarmLimitlLower",
    label: "下下限",
    width: "160",
    width: "80",
  },
  {
    prop: "fileName",
@@ -51,11 +54,46 @@
const acButton = ref(1);
function changeAcButton(num) {
  acButton.value = num;
  searchData();
}
const searchText = ref("");
const downloadText =ref("");
const fileList = ref([]);
async function searchData() {
  const loading = ElLoading.service({
    lock: true,
    text: '数据加载中...',
    background: 'rgba(0, 0, 0, 0.7)',
  });
  try {
    const rs = await getPwrStandParamApi(acButton.value);
    loading.close();
    if(rs.code === 1 && rs.data) {
      listRef.value = rs.data2;
    }else {
      listRef.value = [];
    }
  }catch (e) {
    console.log(e);
    loading.close();
  }
}
const addEditVisible = ref(false);
const dialogTitle = computed(()=>{
  return "参数设定";
});
const selectInfo = ref();
function setParams(info) {
  selectInfo.value = info;
  addEditVisible.value = true;
}
onMounted(()=>{
  changeAcButton(acButton.value);
});
</script>
<template>
@@ -82,7 +120,7 @@
                    </el-table-column>
                    <el-table-column label="操作" fixed="right" width="180" align="center">
                      <template #default="scope">
                        <el-button type="primary" size="small">参数设定</el-button>
                        <el-button type="primary" size="small" @click="setParams(scope.row)">参数设定</el-button>
                        <el-button type="success" size="small">上传</el-button>
                      </template>
                    </el-table-column>
@@ -114,6 +152,20 @@
        </div>
      </yc-card>
    </div>
    <el-dialog
      :title="dialogTitle"
      v-model="addEditVisible"
      :close-on-click-modal="false"
      class="dialog-center"
      align-center
      width="auto"
      draggable
      destroy-on-close
      center>
      <add-edit
        v-model:close="addEditVisible"
        :info="selectInfo" @success="changeAcButton(acButton)"></add-edit>
    </el-dialog>
  </div>
</template>