| | |
| | | <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", |
| | |
| | | { |
| | | 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", |
| | |
| | | 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> |
| | |
| | | </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> |
| | |
| | | </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> |
| | | |