فهرست منبع

若干页面BUG修复、接口替换联调、布局修改

Koishi 1 سال پیش
والد
کامیت
329cad18d6

+ 2 - 2
README.md

@@ -19,7 +19,7 @@
         - 替换了部分字段、修改了部分BUG,表格新增列排序功能,点击对应的列将会以次数为基准进行升序或者降序排序。
 - 报警配置
     - 预警配置
-        - 
+        - 修改页面部分逻辑、替换部分字段、BUG修复。
     - 报警配置
         - 风机报警页面新增与修改报警弹窗模块重构
     - 规则修改日志
@@ -28,7 +28,7 @@
     - 设备模型
         - 替换页面内部分接口。
     - 字典维护
-        - 
+        - 页面已隐藏
 - 系统管库
     - 页面重构、现五个级别可以分别设置自己独立的规则并保存了,新增报警弹窗上限数量修改框,可根据自身需求动态修改弹窗弹出的上限值
 - 其他

+ 26 - 15
src/api/api.js

@@ -203,7 +203,7 @@ export const alarm_history = (params, timeout = 2000) => {
 // 列表接口
 export const getAlarmCountList = (params) => {
     return request({
-        url: `alarm/history/findWtFeatureStat?m=${params.timeType}&begin=${params.begin}&end=${params.end}&stationid=${params.stationid}&components=${params.components}&modelId=${params.modelId}&alarmIds=${params.alarmIds}`,
+        url: `alarm/history/findWtFeatureStat?m=${params.timeType}&begin=${params.begin}&end=${params.end}&stationid=${params.stationid}&components=${params.components}&modelId=${params.modelId}&alarmIds=${params.alarmIds}&alarmType=${params.alarmType}`,
         baseURL,
         method: "get",
     });
@@ -520,11 +520,16 @@ export const AdapterHistoryExport = (activeAI, activeWT, startTs, endTs) => {
 // ----------------------------------------基础数据- 设备管理------------------------------------------------
 //查询全部设备型号接口
 export const device_list = () => {
-    return request.get(`device/model/list`);
+    return request({
+        baseURL,
+        method: "get",
+        url: `device/model/list`,
+    });
 };
 //获取结构tree
 export function tree(params) {
     return request({
+        baseURL,
         url: "device/structure/tree/windturbine",
         method: "get",
         transformResponse: [
@@ -548,9 +553,11 @@ export function point(
     deviceId,
     model
 ) {
-    return request.get(
-        `device/metrics/page?pageNum=${pagenum}&pageSize=${pagesize}&deviceId=${deviceId}&categorydata=${categorydata}&keyword=${keyword}&model=${model}&structureCode=${code}`
-    );
+    return request({
+        baseURL,
+        url: `device/metrics/page?pageNum=${pagenum}&pageSize=${pagesize}&deviceId=${deviceId}&categorydata=${categorydata}&keyword=${keyword}&model=${model}&structureCode=${code}`,
+        method: "get",
+    });
 }
 //测点新增
 export function metrics(params) {
@@ -578,7 +585,11 @@ export const faultmode_windturbine = () => {
 };
 // 根据 structurecode get
 export const faultmode_structurecode = (params) => {
-    return request.get(`device/faultmode/windturbine/${params}`);
+    return request({
+        baseURL,
+        url: `device/faultmode/windturbine/${params}`,
+        method: "get",
+    });
 };
 // 根据 id delete
 export const faultmode_delete = (params) => {
@@ -807,7 +818,7 @@ export const getAlarmConfig = () => {
     return request({
         method: "get",
         baseURL,
-        url: "/alertrule/queryalarmtypellist",
+        url: "alertrule/queryalarmtypellist",
     });
 };
 
@@ -815,7 +826,7 @@ export const confirmAlart = (data) => {
     return request({
         method: "post",
         baseURL,
-        url: "/alarm/history/updateAlarms",
+        url: "alarm/history/updateAlarms",
         data,
         timeout: 60000
     });
@@ -825,7 +836,7 @@ export const getAlartConfig = () => {
     return request({
         method: "get",
         baseURL,
-        url: "/alarmswitch/queryAll",
+        url: "alarmswitch/queryAll",
     });
 };
 
@@ -833,7 +844,7 @@ export const saveAlartConfig = (data) => {
     return request({
         method: "post",
         baseURL,
-        url: "/alarmswitch/save",
+        url: "alarmswitch/save",
         data
     });
 };
@@ -842,7 +853,7 @@ export const getWtModel = (wpId = "") => {
     return request({
         baseURL,
         method: "get",
-        url: `/alertrule/querymodellist?wpId=${wpId}`,
+        url: `alertrule/querymodellist?wpId=${wpId}`,
     });
 };
 
@@ -850,14 +861,14 @@ export const getWpList = (types = "") => {
     return request({
         method: "get",
         baseURL,
-        url: `/alertrule/querywpllist?types=${types}`,
+        url: `alertrule/querywpllist?types=${types}`,
     });
 };
 export const getBpList = () => {
     return request({
         baseURL,
         method: "get",
-        url: `/alertrule/querysubllist`,
+        url: `alertrule/querysubllist`,
     });
 };
 
@@ -865,7 +876,7 @@ export const getPointList = (params) => {
     return request({
         method: "get",
         baseURL,
-        url: "/alertrule/querysubpointllist",
+        url: "alertrule/querysubpointllist",
         params,
     });
 };
@@ -873,7 +884,7 @@ export const saveAlarmconfiguration = (data) => {
     return request({
         method: "post",
         baseURL,
-        url: "/alarmconfiguration/save",
+        url: "alarmconfiguration/save",
         data,
     });
 };

+ 12 - 8
src/components/alarmPopupa/index.vue

@@ -345,7 +345,7 @@ export default {
           end: dayJs().format("YYYY-MM-DD HH:mm:ss"),
           isclose: false,
         },
-        5000
+        9000
       );
     },
 
@@ -451,9 +451,9 @@ export default {
 
     getAlarmBoxWidth() {
       const baseWIdth = 240;
-      let widthStep = 1;
-      for (let i = 1; i < this.$store.state.columnNumber; i++) {
-        if (this.alarmList?.[(i + 1) * this.$store.state.columnNumber]) {
+      let widthStep = 0;
+      for (let i = 0; i < this.$store.state.columnNumber; i++) {
+        if (this.alarmList?.[i * this.$store.state.columnNumber]) {
           widthStep++;
         }
       }
@@ -488,15 +488,18 @@ export default {
   justify-content: flex-end;
   align-items: flex-end;
   pointer-events: none;
+  overflow: hidden;
 
   .columnItem {
     width: 240px;
+    height: 100%;
     display: flex;
     flex-direction: column-reverse;
     align-items: center;
     font-size: 12px;
     overflow-y: scroll;
     border-radius: 8px;
+    margin-left: 4px;
     transition: 0.2s;
 
     .alarmItem {
@@ -510,6 +513,7 @@ export default {
       color: #fff;
       pointer-events: auto;
       cursor: pointer;
+
       .alarmTitle {
         display: flex;
         justify-content: flex-start;
@@ -640,11 +644,11 @@ export default {
         overflow: hidden;
       }
     }
-  }
 
-  &::-webkit-scrollbar {
-    width: 0; /* 隐藏Webkit浏览器的滚动条宽度 */
-    height: 0; /* 隐藏Webkit浏览器的滚动条高度 */
+    &::-webkit-scrollbar {
+      width: 0; /* 隐藏Webkit浏览器的滚动条宽度 */
+      height: 0; /* 隐藏Webkit浏览器的滚动条高度 */
+    }
   }
 
   &.notEmpty:hover {

+ 8 - 26
src/pages/Home.vue

@@ -24,42 +24,24 @@ import vSidebar from "../components/Sidebar.vue";
 import vTags from "../components/Tags.vue";
 import AlarmPopupa from "../components/alarmPopupa/index.vue";
 
-import { fetchStationListAll, fetchBooststation } from "/@/api/api.js";
+import { getWpList } from "/@/api/api.js";
 const store = useStore();
 const collapse = computed(() => store.state.collapse);
 onBeforeMount(async () => {
+  await getStationList();
   await getStationListAll();
   await getBooststation();
 });
-// //get 场站
-// const getStationList = async () => {
-// //   const resold = await fetchStationList();
-
-//   const resnew = await getStationinfoAll();
-// //   console.log("resold>>>>>>>>qweqwe", resold);
-//   let arr = [];
-//   resnew.data.forEach((item) => {
-//     let ddd = {
-
-//     id :item.id,
-//     name: item.name,
-//     model:item.model,
-//     modelList : item.modelList,
-//     equipmentmodel: null,
-// };
-//     arr.push(ddd);
-//   });
-
-//   // console.log("resnew>>>>>>>>123", resnew);
-//   // console.log("arr>>>>>>>>456", arr);
-//   store.dispatch("actionsStationList", arr);
-// };
+const getStationList = async () => {
+  const { data } = await getWpList("windturbine");
+  store.dispatch("actionsStationList", data);
+};
 const getStationListAll = async () => {
-  const { data } = await fetchStationListAll();
+  const { data } = await getWpList();
   store.dispatch("actionsStationListAll", data);
 };
 const getBooststation = async () => {
-  const { data } = await fetchBooststation();
+  const { data } = await getWpList("booststation");
   store.dispatch("actionsBooststationList", data);
 };
 </script>

+ 1 - 0
src/pages/Login.vue

@@ -78,6 +78,7 @@ const rules = {
 };
 
 onMounted(async () => {
+  store.commit("emptyWarning");
   await getkey();
   store.commit("clearTags");
   //使用

+ 19 - 30
src/pages/alarmConfig/bj_custom/custom.vue

@@ -59,6 +59,7 @@
             label="升压站报警"
             value="booststation"
           ></el-option>
+          <el-option key="3" label="光伏报警" value="inverter"></el-option>
         </el-select>
         <el-select
           v-model="query.wpId"
@@ -207,8 +208,8 @@
         background
         layout="total, prev, pager, next"
         hide-on-single-page
-        :current-page="query.pagenum"
-        :page-size="query.pagesize"
+        :current-page="query.pageNum"
+        :page-size="query.pageSize"
         :total="total"
         @current-change="handlePageChange"
       ></el-pagination>
@@ -232,6 +233,7 @@ import {
   fetchBooststation,
   custombj_importTemplate,
   baseURL,
+  getWpList,
 } from "/@/api/api.js";
 import { outExportExcel } from "/@/utils/exportExcel"; //引入文件
 import {
@@ -254,8 +256,8 @@ const store = useStore();
 const router = useRouter();
 const isStation = computed(() => store.getters.isStation);
 const query = reactive({
-  pagenum: 1,
-  pagesize: 4,
+  pageNum: 1,
+  pageSize: 4,
   name: "",
   wpId: "",
   rank: "",
@@ -347,29 +349,10 @@ const fetchList = computed(() => {
 });
 
 // 场站列表/升压站列表
-const stationList = computed(() => {
-  if (query.category == "windturbine") {
-    return store.state.stationListAll;
-  } else {
-    return store.state.booststationList;
-  }
-});
-watch(
-  () => stationList,
-  (val, old) => {
-    val.value.length &&
-      nextTick(async () => {
-        query.wpId = val.value[0]?.id;
-        await getData();
-      });
-  },
-  {
-    deep: true,
-    immediate: true,
-  }
-);
+const stationList = ref([]);
 let total = ref(0);
 onMounted(() => {
+  getWpArray();
   getfetchRelatePart();
   getequipmentmodel_list();
   //   getData();
@@ -379,6 +362,11 @@ const dialogclose = () => {
   state.form = {};
   getData();
 };
+const getWpArray = async () => {
+  console.log(1111, query.category);
+  const { data } = await getWpList(query.category);
+  stationList.value = data;
+};
 const getData = async () => {
   const { data } = await custombj_fetchTableData(query);
   state.tableData = data.records;
@@ -421,13 +409,14 @@ const changeStation = async () => {
 };
 //categorychanged
 const categorychanged = async () => {
-  clean();
+  getWpArray();
+  this.clean();
   getData();
 };
 
 // 分页导航
 const handlePageChange = (val) => {
-  query.pagenum = val;
+  query.pageNum = val;
   getData();
 };
 
@@ -436,8 +425,8 @@ const export2Excel = async () => {
   let tableHeader = [];
   let tableKey = [];
   const { data } = await custombj_fetchTableData({
-    pagenum: 1,
-    pagesize: total.value,
+    pageNum: 1,
+    pageSize: total.value,
     ...query,
   });
   ElMessage.success(`导出成功!`);
@@ -493,7 +482,7 @@ const clean = () => {
   query.enabled = "";
   query.rank = "";
   query.name = "";
-  query.pagenum = 1;
+  query.pageNum = 1;
   state.tableData = [];
   total.value = 0;
 };

+ 44 - 68
src/pages/alarmConfig/bj_windturbine/windturbine.vue

@@ -120,17 +120,14 @@
             {{ rankConvert(scope.row.rank) }}
           </span>
           <span v-else-if="item.code == 'alarmType'">
-            {{ alarmTypeConvert(scope.row.alarmType) }}
+            {{ alarmTypeConvert("alarmType", scope.row.alarmType) }}
           </span>
           <span v-else-if="item.code == 'deviceType'">
-            {{ alarmTypeConvert(scope.row.deviceType) }}
+            {{ alarmTypeConvert("deviceType", scope.row.deviceType) }}
           </span>
           <span v-else-if="item.code == 'enable'">
             {{ enabledConvert(scope.row.enable) }}
           </span>
-          <span v-else-if="item.code == 'characteristic'">
-            {{ charactConvert(scope.row.characteristic) }}
-          </span>
           <span v-else>
             {{ scope.row[item.code] }}
           </span>
@@ -218,8 +215,8 @@
         background
         layout="total, prev, pager, next"
         hide-on-single-page
-        :current-page="query.pagenum"
-        :page-size="query.pagesize"
+        :current-page="query.pageNum"
+        :page-size="query.pageSize"
         :total="total"
         @current-change="handlePageChange"
       ></el-pagination>
@@ -237,6 +234,7 @@ import {
   getStationinfo,
   fetchRelatePartAndAlarmType,
   fetchModel,
+  getWpList,
 } from "/@/api/api.js";
 import { outExportExcel } from "/@/utils/exportExcel"; //引入文件
 import {
@@ -254,11 +252,12 @@ import windturbinecomponents from "./windturbine_components.vue";
 const token = { token: sessionStorage.getItem("token") };
 const store = useStore();
 onMounted(() => {
+  getWpArray();
   getequipmentmodel_list();
 });
 const query = reactive({
-  pagenum: 1,
-  pagesize: 10,
+  pageNum: 1,
+  pageSize: 10,
   wpId: "",
   modelId: "",
   name: "",
@@ -275,14 +274,12 @@ const state = reactive({
     { title: "场站", code: "stationName", width: "100" },
     // { title: "设备", code: "deviceId", width: "100" },
     { title: "机型", code: "modelId" },
-    { title: "部件", code: "components" },
     { title: "报警描述", code: "description", width: "150" },
     { title: "设备部件", code: "componentsName" },
     { title: "级别", code: "rankName" },
     { title: "特性", code: "characteristic" },
     { title: "设备类型", code: "deviceType" },
     { title: "报警类型", code: "alarmType" },
-    { title: "报警类别", code: "triggerType" },
     { title: "是否启用", code: "enable" },
     { title: "是否可复位", code: "resetTableName" },
   ],
@@ -303,27 +300,15 @@ const getequipmentmodel_list = async () => {
   state.modelListAll = data;
 };
 // 场站列表/升压站列表
-const stationList = computed(() => {
-  if (query.alarmType == "windturbine") {
-    return store.state.stationListAll;
-  } else {
-    return store.state.booststationList;
-  }
-});
-watch(
-  () => stationList,
-  (val, old) => {
-    val.value.length &&
-      nextTick(async () => {
-        query.wpId = val.value[0]?.id;
-        await getData();
-      });
-  },
-  {
-    deep: true,
-    immediate: true,
-  }
-);
+const stationList = ref([]);
+const categorychanged = async (value) => {
+  query.alarmType = value;
+  getWpArray();
+};
+const getWpArray = async () => {
+  const { data } = await getWpList(query.alarmType);
+  stationList.value = data;
+};
 //型号列表
 const modelList = computed(() => {
   if (query.wpId == "") {
@@ -380,7 +365,7 @@ const handleEditClick = (row) => {
 
 // 分页导航
 const handlePageChange = (val) => {
-  query.pagenum = val;
+  query.pageNum = val;
   getData();
 };
 
@@ -429,8 +414,8 @@ const tableKey = [
 const export2Excel = async () => {
   let { name, wpId, modelId } = query;
   const res = await windturbinebj_fetchTableData({
-    pagenum: 1,
-    pagesize: 999999,
+    pageNum: 1,
+    pageSize: 999999,
     name,
     wpId,
     modelId,
@@ -457,23 +442,37 @@ const handleError = (response, file, fileList) => {
 //级别
 const rankConvert = (val) => {
   if (val == 1) {
-    return "低";
+    return "低";
   } else if (val == 2) {
-    return "中低";
+    return "低中级";
   } else if (val == 3) {
-    return "中";
+    return "中";
   } else if (val == 4) {
-    return "中高";
+    return "中高";
   } else if (val == 5) {
-    return "高";
+    return "高";
   }
 };
 // 类型
-const alarmTypeConvert = (val) => {
-  if (val === "windturbine") {
-    return "设备";
-  } else if (val === "booststation") {
-    return "升压站";
+const alarmTypeConvert = (type, val) => {
+  if (type === "alarmType") {
+    if (val === "windturbine") {
+      return "风机";
+    } else if (val === "booststation") {
+      return "升压站";
+    } else if (val === "booststation") {
+      return "光伏";
+    } else if (val === "custom") {
+      return "自定义";
+    }
+  } else {
+    if (val === "windturbine") {
+      return "风机";
+    } else if (val === "booststation") {
+      return "升压站";
+    } else if (val === "booststation") {
+      return "光伏";
+    }
   }
 };
 // 状态
@@ -484,29 +483,6 @@ const enabledConvert = (val) => {
     return "启用";
   }
 };
-
-// 特征
-const charactConvert = (val) => {
-  switch (val) {
-    case "ZC_BJ":
-      return "运转正常";
-      break;
-    case "YJ_BJ":
-      return "运转状态超出标准范围";
-      break;
-    case "GZ_BJ":
-      return "非正常停止运转";
-      break;
-    case "WH_BJ":
-      return "停机维护";
-      break;
-    case "XD_BJ":
-      return "限电/计划停机";
-      break;
-    default:
-      return;
-  }
-};
 // 报警分类
 const warningClassIfyIdConvert = (val) => {
   switch (val) {

+ 110 - 60
src/pages/baseData/FanDataStatisticTable.vue

@@ -5,6 +5,24 @@
     <el-card>
       <el-space>
         <div class="search-input">
+          <span class="lable">报警类型:</span>
+          <el-select
+            v-model="state.typeVal"
+            size="mini"
+            placeholder="全部"
+            popper-class="select"
+            @change="changeType"
+          >
+            <el-option
+              v-for="item in state.typeList"
+              :key="item.value"
+              :value="item.value"
+              :label="item.label"
+            >
+            </el-option>
+          </el-select>
+        </div>
+        <div class="search-input">
           <span class="lable">场站:</span>
           <el-select
             v-model="state.changZhan"
@@ -36,7 +54,7 @@
             </el-option>
           </el-select>
         </div>
-        <div class="search-input">
+        <div class="search-input" v-if="state.typeVal !== 'booststation'">
           <span class="lable">部件:</span>
           <el-select
             v-model="state.components"
@@ -195,7 +213,7 @@
 
 <script setup>
 import { useStore } from "vuex";
-// import BASE from "@tools/basicTool.js";
+import BASE from "@tools/basicTool.js";
 import {
   ref,
   onMounted,
@@ -210,17 +228,38 @@ import {
   fetchModel,
   fetchRelatePartAndAlarmType,
   GetAlarmId,
+  getWpList,
 } from "/@/api/api.js";
 import dayjs from "dayjs";
 onMounted(() => {
+  getWpArray();
   getequipmentmodel_list();
   getfetchRelatePart();
   //   getTableList();
 });
 
 const store = useStore();
-const changZhanArray = computed(() => store.state.stationListAll);
+const changZhanArray = ref([]);
 const state = reactive({
+  typeVal: "windturbine",
+  typeList: [
+    {
+      label: "升压站",
+      value: "booststation",
+    },
+    // {
+    //   label: "自定义",
+    //   value: "custom",
+    // },
+    {
+      label: "风机",
+      value: "windturbine",
+    },
+    {
+      label: "光伏",
+      value: "inverter",
+    },
+  ],
   tableData: [],
   tHeard: [],
   changZhan: "",
@@ -234,6 +273,16 @@ const state = reactive({
   endtime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
   dialogVisible: false,
 });
+
+const changeType = async (value) => {
+  state.typeVal = value;
+  getWpArray();
+};
+
+const getWpArray = async () => {
+  const { data } = await getWpList(state.typeVal);
+  changZhanArray.value = data;
+};
 // 机型
 const getequipmentmodel_list = async () => {
   const { data } = await fetchModel();
@@ -265,25 +314,20 @@ const componentList = computed(() => {
   }
 });
 watch(
-  () => changZhanArray,
-  (val, old) => {
-    val.value[0] &&
-      nextTick(async () => {
-        state.changZhan = changZhanArray.value[0]?.id;
-      });
-  },
-  {
-    deep: true,
-    immediate: true,
-  }
-);
-watch(
   () => [modelList, componentList],
   (val) => {
     let arr = val.map((item) => item.value);
     if (arr[0] && arr[0].length && arr[1] && arr[1].length) {
       state.modelId = [arr[0][0]?.nemCode];
-      state.components = [arr[1][0]?.nemCode];
+      let componenDefaultSelect =
+        arr[1]?.find((ele) => {
+          return ele.nemCode === "ZZ";
+        })?.nemCode || "";
+      componenDefaultSelect
+        ? (state.components = [componenDefaultSelect])
+        : arr[1]?.[0]?.nemCode
+        ? (state.components = [arr[1]?.[0]?.nemCode])
+        : (state.components = []);
       getAlarmId();
     }
   },
@@ -320,50 +364,57 @@ function getAlarmId() {
 }
 // 获取列表数据 调用接口
 function getTableList() {
-  getAlarmCountList({
-    stationid: state.changZhan || "",
-    begin: state.starttime,
-    end: state.endtime,
-    timeType: "m",
-    components: state.components,
-    modelId: state.modelId,
-    alarmIds: state.alarmIds,
-  }).then((res) => {
-    if (res.length) {
-      let tableData = [];
-      let tHeard = [];
-      let data = res;
-      data.forEach((pEle) => {
-        for (let wtId in pEle) {
-          let wtItem = data.find((tableItem) => {
-            return wtId === tableItem.windturbineId;
-          });
-          !wtItem && (wtItem = { wtId });
-          pEle[wtId].forEach((cEle) => {
-            let someRes = tHeard.some((findEle) => {
-              return findEle.label == cEle.alertText;
+  if (state.components?.length || state.typeVal === "booststation") {
+    getAlarmCountList({
+      stationid: state.changZhan || "",
+      begin: state.starttime,
+      end: state.endtime,
+      timeType: "m",
+      components: state.typeVal === "booststation" ? "" : state.components,
+      modelId: state.modelId,
+      alarmIds: state.alarmIds,
+      alarmType: state.typeVal,
+    }).then((res) => {
+      if (res.length) {
+        let tableData = [];
+        let tHeard = [];
+        let data = res;
+        data.forEach((pEle) => {
+          for (let wtId in pEle) {
+            let wtItem = data.find((tableItem) => {
+              return wtId === tableItem.windturbineId;
             });
-
-            if (!someRes) {
-              tHeard.push({
-                label: cEle.alertText,
-                code: cEle.alarmid,
+            !wtItem && (wtItem = { wtId });
+            pEle[wtId].forEach((cEle) => {
+              let someRes = tHeard.some((findEle) => {
+                return findEle.label == cEle.alertText;
               });
-            }
-            wtItem[`${cEle.alarmid}_count`] = cEle.count;
-            wtItem[`${cEle.alarmid}_time`] = cEle.time;
-            wtItem["wtname"] = cEle.windturbineCode;
-          });
-          tableData.push(wtItem);
-        }
-      });
-      state.tHeard = tHeard;
-      state.tableData = tableData;
-    } else {
-      state.tHeard = [];
-      state.tableData = [];
-    }
-  });
+
+              if (!someRes) {
+                tHeard.push({
+                  label: cEle.alertText,
+                  code: cEle.alarmid,
+                });
+              }
+              wtItem[`${cEle.alarmid}_count`] = cEle.count;
+              wtItem[`${cEle.alarmid}_time`] = cEle.time;
+              wtItem["wtname"] = cEle.windturbineCode;
+            });
+            tableData.push(wtItem);
+          }
+        });
+        state.tHeard = tHeard;
+        state.tableData = tableData;
+      } else {
+        state.tHeard = [];
+        state.tableData = [];
+      }
+    });
+  } else {
+    BASE.showMsg({
+      msg: "部件至少选择一项才可查询",
+    });
+  }
 }
 
 const thSort = function (a, b, item) {
@@ -384,7 +435,6 @@ const thSort = function (a, b, item) {
 //         parts,
 //       }).then((res) => {
 //         if (res && res.status === 20000) {
-//           console.log("弹窗数据》》》》》》》", res);
 
 //           if (res.data.length) {
 //             if (column.property !== "wtId") {

+ 12 - 18
src/pages/baseData/device.vue

@@ -15,10 +15,9 @@
         style="margin-top: 10px"
         :data="state.treedata"
         :props="state.defaultProps"
+        :default-expanded-keys="['23']"
         node-key="id"
         highlight-current
-        :default-expanded-keys="[23]"
-        :current-node-key="23"
         :expand-on-click-node="false"
         @node-click="handleNodeClick"
       />
@@ -28,22 +27,27 @@
         <!-- <el-tab-pane label="传感点">
           <point />
         </el-tab-pane> -->
-        <el-tab-pane label="遥测点" >
+        <el-tab-pane label="遥测点">
           <ycpoint />
         </el-tab-pane>
-        <el-tab-pane label="遥信点" v-if="false">
+        <el-tab-pane label="遥信点">
           <yxpoint />
         </el-tab-pane>
-        <el-tab-pane label="设备报警" v-if="false">
+
+
+        <el-tab-pane label="设备报警">
           <windturbine />
         </el-tab-pane>
-        <el-tab-pane label="故障预警" v-if="false">
+        <el-tab-pane label="故障预警">
           <custom />
         </el-tab-pane>
-        <el-tab-pane label="故障原因" v-if="false">
+
+
+        <el-tab-pane label="故障原因">
           <faultmode />
         </el-tab-pane>
-        <el-tab-pane label="基本信息" v-if="false">
+
+        <el-tab-pane label="基本信息">
           <message />
         </el-tab-pane>
       </el-tabs>
@@ -139,9 +143,6 @@ let treeVisible = ref(false);
 let editFormData = ref({});
 onMounted(async () => {
   await getData();
-  nextTick(() => {
-    handleNodeClick(state.cascaderdata[0]);
-  });
 });
 let state = reactive({
   isDel: false, //是否能被删除
@@ -242,7 +243,6 @@ const handleTreeAdd = () => {
 };
 // tree Del
 const handleTreeDel = () => {
-  console.warn(state.desc);
   if (!state.isDel) {
     ElMessage.error(`不能删除该节点!!`);
     return;
@@ -252,7 +252,6 @@ const handleTreeDel = () => {
   })
     .then(async () => {
       const res = await treeDel(state.desc.id);
-      console.warn(res);
       if (res == 1) {
         ElMessage.success(`删除成功!`);
         getData();
@@ -264,9 +263,7 @@ const handleTreeDel = () => {
 };
 // delTreeBtn
 const delTreeBtn = async () => {
-  console.warn(state.treeDelVal);
   const res = await treeDel(state.treeDelVal);
-  console.warn(res);
   if (res == 1) {
     ElMessage.success(`删除成功!`);
     getData();
@@ -278,7 +275,6 @@ const delTreeBtn = async () => {
 //保存tree add
 const saveTreeAdd = async () => {
   const res = await treeAdd(state.treeAddFormData);
-  console.warn(res);
   if (res.status == 20000) {
     ElMessage.success(`操作成功!`);
     treeVisible.value = false;
@@ -291,10 +287,8 @@ const saveTreeAdd = async () => {
 // getData
 const getData = async () => {
   const res = await tree();
-  console.warn(res);
   state.treedata = res.children.reverse();
   state.cascaderdata = cascaderforEach(res);
-  console.warn(state.cascaderdata);
 };
 
 // 递归解析基础数据

+ 244 - 136
src/pages/baseData/fan_components/custom.vue

@@ -1,91 +1,213 @@
 <template>
-    <el-row type="flex" justify="space-between">
-      <div class="handle-box" style="margin-bottom: 10px">
-        <el-button type="primary" icon="el-icon-lx-add" class="handle-edit mr10" @click="handleInsert">
-          新增记录
-        </el-button>
-        <el-button type="primary" icon="el-icon-lx-down" class="handle-edit mr10" @click="export2Excel">
-          批量导出</el-button>
-        <el-button type="primary" icon="el-icon-lx-down" class="handle-edit mr10" @click="outExe">
-          模板下载</el-button>
-        <el-upload class="handle-edit mr10" style=" display: inline;" action="/sharding/alertrule2/import"
-          :headers="token" :show-file-list="false" :on-success="handleSuccess" :on-progress="handleProgress"
-          :on-error="handleError">
-          <el-button type="primary" icon="el-icon-lx-top" @click="exportShow = true">
-            批量导入</el-button>
-        </el-upload>
-      </div>
-      <div style="display: flex; flex-direction: row; margin-bottom: 10px">
-        <el-select v-if="!isStation" v-model="query.category" class="mr10" style="width: 150px" popper-class="select">
-          <el-option key="1" label="风机" value="1"></el-option>
-          <el-option key="2" label="电气" value="2"></el-option>
-        </el-select>
-        <el-select v-if="!isStation" v-model="query.station" clearable class="mr10" style="width: 150px"
-          placeholder="全部场站" popper-class="select" @change="changeStation()">
-          <el-option v-for="item in stationList" :key="item.id" :value="item.id" :label="item.name"></el-option>
-        </el-select>
-        <el-select v-model="query.modelId" clearable class="mr10" style="width: 150px" placeholder="全部机型"
-          popper-class="select">
-          <el-option v-for="item in state.modelList" :key="item" :value="item" :label="item"></el-option>
-        </el-select>
-        <el-select v-model="query.rank" clearable class="mr10" style="width: 150px" placeholder="全部级别"
-          popper-class="select">
-          <el-option v-for="item in state.rankList" :key="item.id" :value="item.id" :label="item.name"></el-option>
-        </el-select>
-        <el-input placeholder="请输入名称" v-model="query.name" style="width: 150px" class="mr10" clearable></el-input>
-        <el-button icon="el-icon-search" type="primary" @click="getData">搜索</el-button>
-      </div>
-    </el-row>
-    <el-table :data="state.tableData" border class="table" header-cell-name="table-header"
-      :highlight-current-row="true">
-      <el-table-column label="编码" align="center" prop="id" min-width="50" />
-      <el-table-column label="场站" align="center" prop="windPowerStation.name" min-width="50" />
-      <el-table-column label="机型" align="center" prop="modelId" min-width="50" />
-      <el-table-column label="名称" align="left" prop="name" min-width="50" />
-      <el-table-column label="表达式" align="left">
-        <template #default="scope">
-          {{ scope.row.expressionShow }}
-        </template>
-      </el-table-column>
-      <el-table-column label="级别" align="center" prop="rank" min-width="20">
-        <template #default="scope">{{ rankConvert(scope.row.rank) }}</template>
-      </el-table-column>
-      <el-table-column label="类型" align="center" prop="category" min-width="20">
-        <template #default="scope">{{
-            categoryConvert(scope.row.category)
-        }}</template>
-      </el-table-column>
-      <el-table-column label="描述" align="left">
-        <template #default="scope">
-          {{ scope.row.descriptionShow }}
-        </template>
-      </el-table-column>
-      <el-table-column label="是否启用" align="center" prop="enabled" min-width="20">
-        <template #default="scope">
-          {{ enabledConvert(scope.row.enabled) }}
-        </template>
-      </el-table-column>
-      <el-table-column label="所属部件" align="center" prop="relatedParts" min-width="30">
-        <template #default="scope">
-          <span>{{ scope.row.datadictionary?.name }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center" width="100">
-        <template #default="scope">
-          <el-button type="primary" plain round size="mini" icon="el-icon-lx-edit"
-            :disabled="notEdit || scope.row.range == 1" @click="handleEditClick(scope.row)">编辑</el-button>
-          <!-- <el-button type="primary" plain round size="mini" icon="el-icon-search" @click="handleViewClick(scope.$index, scope.row)">查看</el-button> -->
-        </template>
-      </el-table-column>
-    </el-table>
-    <div class="pagination">
-      <el-pagination background layout="total, prev, pager, next" hide-on-single-page :current-page="query.pagenum"
-        :page-size="query.pagesize" :total="total" @current-change="handlePageChange"></el-pagination>
+  <el-row type="flex" justify="space-between">
+    <div class="handle-box" style="margin-bottom: 10px">
+      <el-button
+        type="primary"
+        icon="el-icon-lx-add"
+        class="handle-edit mr10"
+        @click="handleInsert"
+      >
+        新增记录
+      </el-button>
+      <el-button
+        type="primary"
+        icon="el-icon-lx-down"
+        class="handle-edit mr10"
+        @click="export2Excel"
+      >
+        批量导出</el-button
+      >
+      <el-button
+        type="primary"
+        icon="el-icon-lx-down"
+        class="handle-edit mr10"
+        @click="outExe"
+      >
+        模板下载</el-button
+      >
+      <el-upload
+        class="handle-edit mr10"
+        style="display: inline"
+        action="/sharding/alertrule2/import"
+        :headers="token"
+        :show-file-list="false"
+        :on-success="handleSuccess"
+        :on-progress="handleProgress"
+        :on-error="handleError"
+      >
+        <el-button
+          type="primary"
+          icon="el-icon-lx-top"
+          @click="exportShow = true"
+        >
+          批量导入</el-button
+        >
+      </el-upload>
     </div>
-    <customcomponents @close="dialogclose" :isVisible="state.visible" :form="state.form" />
+    <div style="display: flex; flex-direction: row; margin-bottom: 10px">
+      <el-select
+        v-if="!isStation"
+        v-model="query.category"
+        class="mr10"
+        style="width: 150px"
+        popper-class="select"
+      >
+        <el-option
+          key="windturbine"
+          label="风机"
+          value="windturbine"
+        ></el-option>
+        <el-option key="inverter" label="逆变器" value="inverter"></el-option>
+        <el-option
+          key="booststation"
+          label="升压站"
+          value="booststation"
+        ></el-option>
+      </el-select>
+      <el-select
+        v-if="!isStation"
+        v-model="query.station"
+        clearable
+        filterable
+        class="mr10"
+        style="width: 150px"
+        placeholder="全部场站"
+        popper-class="select"
+        @change="changeStation()"
+      >
+        <el-option
+          v-for="item in stationList"
+          :key="item.id"
+          :value="item.id"
+          :label="item.name"
+        ></el-option>
+      </el-select>
+      <el-select
+        v-model="query.modelId"
+        clearable
+        filterable
+        class="mr10"
+        style="width: 150px"
+        placeholder="全部机型"
+        popper-class="select"
+      >
+        <el-option
+          v-for="item in state.modelList"
+          :key="item"
+          :value="item"
+          :label="item"
+        ></el-option>
+      </el-select>
+      <el-select
+        v-model="query.rank"
+        clearable
+        filterable
+        class="mr10"
+        style="width: 150px"
+        placeholder="全部级别"
+        popper-class="select"
+      >
+        <el-option
+          v-for="item in state.rankList"
+          :key="item.id"
+          :value="item.id"
+          :label="item.name"
+        ></el-option>
+      </el-select>
+      <el-input
+        placeholder="请输入名称"
+        v-model="query.name"
+        style="width: 150px"
+        class="mr10"
+        clearable
+      ></el-input>
+      <el-button icon="el-icon-search" type="primary" @click="getData"
+        >搜索</el-button
+      >
+    </div>
+  </el-row>
+  <el-table
+    :data="state.tableData"
+    border
+    class="table"
+    header-cell-name="table-header"
+    :highlight-current-row="true"
+  >
+    <el-table-column label="编码" align="center" prop="id" min-width="50" />
+    <el-table-column
+      label="场站"
+      align="center"
+      prop="stationName"
+      min-width="50"
+    />
+    <el-table-column
+      label="机型"
+      align="center"
+      prop="modelId"
+      min-width="50"
+    />
+    <el-table-column label="名称" align="left" prop="name" min-width="50" />
+    <el-table-column label="表达式" align="left" prop="expression" />
+    <el-table-column label="级别" align="center" prop="rank" min-width="20">
+      <template #default="scope">{{ rankConvert(scope.row.rank) }}</template>
+    </el-table-column>
+    <el-table-column label="类型" align="center" prop="category" min-width="20">
+      <template #default="scope">{{
+        categoryConvert(scope.row.category)
+      }}</template>
+    </el-table-column>
+    <el-table-column label="描述" align="left" prop="description" />
+    <el-table-column
+      label="是否启用"
+      align="center"
+      prop="enabled"
+      min-width="20"
+    >
+      <template #default="scope">
+        {{ scope.row.enabled ? "启用" : "未启用" }}
+      </template>
+    </el-table-column>
+    <el-table-column
+      label="所属部件"
+      align="center"
+      prop="relatedPartsName"
+      min-width="30"
+    />
+    <el-table-column label="操作" align="center" width="100">
+      <template #default="scope">
+        <el-button
+          type="primary"
+          plain
+          round
+          size="mini"
+          icon="el-icon-lx-edit"
+          :disabled="notEdit || scope.row.range == 1"
+          @click="handleEditClick(scope.row)"
+          >编辑</el-button
+        >
+        <!-- <el-button type="primary" plain round size="mini" icon="el-icon-search" @click="handleViewClick(scope.$index, scope.row)">查看</el-button> -->
+      </template>
+    </el-table-column>
+  </el-table>
+  <div class="pagination">
+    <el-pagination
+      background
+      layout="total, prev, pager, next"
+      hide-on-single-page
+      :current-page="query.pagenum"
+      :page-size="query.pagesize"
+      :total="total"
+      @current-change="handlePageChange"
+    ></el-pagination>
+  </div>
+  <customcomponents
+    @close="dialogclose"
+    :isVisible="state.visible"
+    :form="state.form"
+  />
 </template>
 <script setup>
-import { custombj_fetchTableData, getStationinfo } from "/@/api/api.js";
+import { custombj_fetchTableData, getWtModel } from "/@/api/api.js";
 import { outExportExcel } from "/@/utils/exportExcel"; //引入文件
 import { ref, onMounted, provide, computed, reactive, watch } from "vue";
 import { useStore } from "vuex";
@@ -93,7 +215,7 @@ import { ElMessageBox, ElMessage } from "element-plus";
 import customcomponents from "./custom_components.vue";
 import { common } from "/@/composables/common";
 const { notEdit } = common();
-const token = { 'token': sessionStorage.getItem('token') }
+const token = { token: sessionStorage.getItem("token") };
 const store = useStore();
 const stationList = computed(() => store.state.stationList);
 const isStation = computed(() => store.getters.isStation);
@@ -103,53 +225,53 @@ const state = reactive({
   rankList: [
     {
       id: 1,
-      name: "低",
+      name: "低",
     },
     {
       id: 2,
-      name: "低",
+      name: "低",
     },
     {
       id: 3,
-      name: "中",
+      name: "中",
     },
     {
       id: 4,
-      name: "中高",
+      name: "中高",
     },
     {
       id: 5,
-      name: "高",
+      name: "高",
     },
   ],
   visible: false,
   form: {},
 });
 const query = reactive({
-  pagenum: 1,
-  pagesize: 10,
+  pageNum: 1,
+  pageSize: 10,
   name: "",
   station: "",
   rank: "",
   modelId: "",
-  category: "1",
+  category: "windturbine",
 });
 let total = ref(0);
 onMounted(() => {
   getData();
-  getequipmentmodel_list()
+  getequipmentmodel_list();
 });
 const dialogclose = () => {
-  state.visible = false
-  getData()
-}
+  state.visible = false;
+  getData();
+};
 const getData = async () => {
-  const res = await custombj_fetchTableData(query);
-  state.tableData = res.records;
-  total.value = res.total;
+  const { data } = await custombj_fetchTableData(query);
+  state.tableData = data.records;
+  total.value = data.total;
 };
 const handleEditClick = (row) => {
-  let obj = Object.assign({}, row)
+  let obj = Object.assign({}, row);
   state.form = obj;
   state.visible = true;
 };
@@ -164,16 +286,8 @@ const changeStation = async () => {
 };
 // 机型
 const getequipmentmodel_list = async () => {
-  const { data } = await getStationinfo(query.station);
-  if (query.station == '') {
-    let arr = []
-    data.forEach(e => {
-      arr.push(...e.modelList)
-    });
-    state.modelList = [...new Set(arr)]
-  } else {
-    state.modelList = data[0].modelList;
-  }
+  const { data } = await getWtModel(query.station);
+  state.modelList = data;
 };
 // 分页导航
 const handlePageChange = (val) => {
@@ -183,8 +297,8 @@ const handlePageChange = (val) => {
 const tableHeader = [
   "id",
   "规则名称",
-  "报警类别(1:风气;2:电气)",
-  "报警级别(1:低;2:低;3:中;4:中高;5:高)",
+  "报警类别(1:风气;2:升压站)",
+  "报警级别(1:低;2:低中级;3:中;4:中高;5:高)",
   "是否启用(0:停用;1:启用)",
   "风场",
   "风机类型",
@@ -232,37 +346,31 @@ const handleSuccess = (response, file, fileList) => {
   ElMessage.success("导入成功!");
   getData();
 };
-const handleProgress = (response, file, fileList) => { };
+const handleProgress = (response, file, fileList) => {};
 const handleError = (response, file, fileList) => {
   ElMessage.success("导入失败!");
 };
 const rankConvert = (val) => {
-  if (val === "1") {
-    return "低";
-  } else if (val === "2") {
-    return "中低";
-  } else if (val === "3") {
-    return "中";
-  } else if (val === "4") {
-    return "中高";
-  } else if (val === "5") {
-    return "高";
+  if (val === 1) {
+    return "低";
+  } else if (val === 2) {
+    return "低中级";
+  } else if (val === 3) {
+    return "中";
+  } else if (val === 4) {
+    return "中高";
+  } else if (val === 5) {
+    return "高";
   }
 };
 // 类型
 const categoryConvert = (val) => {
-  if (val === "1") {
+  if (val === "windturbine") {
     return "风机";
-  } else if (val === "2") {
-    return "电气";
-  }
-};
-// 状态
-const enabledConvert = (val) => {
-  if (val === 0) {
-    return "停用";
-  } else if (val === 1) {
-    return "启用";
+  } else if (val === "inverter") {
+    return "逆变器";
+  } else if (val === "booststation") {
+    return "升压站";
   }
 };
 </script>
@@ -271,7 +379,7 @@ const enabledConvert = (val) => {
   margin-right: 10px;
 }
 
-.el-button+.el-button {
+.el-button + .el-button {
   margin-left: 10px;
 }
 </style>

+ 153 - 57
src/pages/baseData/fan_components/custom_components.vue

@@ -1,6 +1,12 @@
 <template>
   <el-dialog v-model="isShow" width="1100px" :before-close="handleClose">
-    <el-form ref="ruleFormRef" :model="form" :rules="rules" label-position="top" label-width="200px">
+    <el-form
+      ref="ruleFormRef"
+      :model="form"
+      :rules="rules"
+      label-position="top"
+      label-width="200px"
+    >
       <el-row type="flex" justify="space-between" align="middle" :gutter="10">
         <el-col :span="15">
           <el-form-item prop="name">
@@ -8,89 +14,170 @@
             <el-input v-model="form.name" />
           </el-form-item>
         </el-col>
-        <el-col :span="9" style="
+        <el-col
+          :span="9"
+          style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          ">
+          "
+        >
           <el-form-item prop="category">
             <el-tag>报警类别</el-tag>
             <el-select v-model="form.category" class="select-mini">
-              <el-option key="1" label="风机" value="1" />
-              <el-option key="2" label="电气" value="2" />
+              <el-option
+                key="windturbine"
+                label="风机"
+                value="windturbine"
+              ></el-option>
+              <el-option
+                key="inverter"
+                label="逆变器"
+                value="inverter"
+              ></el-option>
+              <el-option
+                key="booststation"
+                label="升压站"
+                value="booststation"
+              ></el-option>
             </el-select>
           </el-form-item>
           <el-form-item prop="rank">
             <el-tag>报警级别</el-tag>
             <el-select v-model="form.rank" class="select-mini">
-              <el-option key="1" label="低" value="1" />
-              <el-option key="2" label="中低" value="2" />
-              <el-option key="3" label="中" value="3" />
-              <el-option key="4" label="中高" value="4" />
-              <el-option key="5" label="高" value="5" />
+              <el-option key="1" label="低" value="1" />
+              <el-option key="2" label="低中级" value="2" />
+              <el-option key="3" label="中" value="3" />
+              <el-option key="4" label="中高" value="4" />
+              <el-option key="5" label="高" value="5" />
             </el-select>
           </el-form-item>
           <el-form-item prop="enabled">
             <el-tag>是否启用</el-tag>
-            <el-switch v-model="form.enabled" :active-value="1" :inactive-value="0" active-color="#13ce66" />
+            <el-switch
+              v-model="form.enabled"
+              :active-value="true"
+              :inactive-value="false"
+              active-color="#13ce66"
+            />
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="10">
         <el-col :span="6">
-          <el-form-item prop="station">
+          <el-form-item prop="stationId">
             <el-tag>风场</el-tag>
-            <el-select v-model="form.station" style="width: 100%" @change="stationChange">
-              <el-option v-for="item in stationList" :key="item.id" :value="item.id" :label="item.name" />
+            <el-select
+              v-model="form.stationId"
+              style="width: 100%"
+              @change="stationChange"
+            >
+              <el-option
+                v-for="item in stationList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              />
             </el-select>
           </el-form-item>
           <el-form-item prop="modelId">
             <el-tag>风机型号</el-tag>
-            <el-select v-model="form.modelId" style="width: 100%" @change="modelIdChange">
-              <el-option v-for="item in state.modelList" :key="item" :value="item" :label="item" />
+            <el-select
+              v-model="form.modelId"
+              style="width: 100%"
+              @change="modelIdChange"
+            >
+              <el-option
+                v-for="item in state.modelList"
+                :key="item"
+                :value="item"
+                :label="item"
+              />
             </el-select>
           </el-form-item>
           <el-form-item prop="relatedParts">
             <el-tag>所属部件</el-tag>
             <el-select v-model="form.relatedParts" style="width: 100%">
-              <el-option v-for="i in state.relatePartList" :key="i.partCode" :value="i.partCode" :label="i.name" />
+              <el-option
+                v-for="i in state.relatePartList"
+                :key="i.partCode"
+                :value="i.partCode"
+                :label="i.name"
+              />
             </el-select>
           </el-form-item>
           <el-form-item prop="fault">
             <el-tag>预警类型</el-tag>
             <el-select v-model="form.project" style="width: 100%">
-              <el-option v-for="i in faultList" :key="i.value" :value="i.value" :label="i.name" />
+              <el-option
+                v-for="i in faultList"
+                :key="i.value"
+                :value="i.value"
+                :label="i.name"
+              />
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="9">
-          <el-form-item prop="expressionShow">
+          <el-form-item prop="expression">
             <el-tag>表达式</el-tag>
-            <el-input type="textarea" rows="14" v-model="form.expressionShow" :value="form.expressionShow"
-              id="expressionInput" />
+            <el-input
+              type="textarea"
+              rows="14"
+              v-model="form.expression"
+              :value="form.expression"
+              id="expressionInput"
+            />
           </el-form-item>
         </el-col>
         <el-col :span="9">
           <el-tabs type="border-card">
             <el-tab-pane label="AI测点">
               <el-input v-model="state.AIPointSearch"> </el-input>
-              <el-table size="mini" fit :show-header="false" :highlight-current-row="true" :stripe="false"
-                :border="false" height="240" :data="filterAIList" @row-dblclick="rowDbclick">
+              <el-table
+                size="mini"
+                fit
+                :show-header="false"
+                :highlight-current-row="true"
+                :stripe="false"
+                :border="false"
+                height="240"
+                :data="filterAIList"
+                @row-dblclick="rowDbclick"
+              >
                 <el-table-column prop="uniformCode" />
                 <el-table-column prop="name" />
               </el-table>
             </el-tab-pane>
             <el-tab-pane label="DI测点">
               <el-input v-model="state.DIPointSearch"> </el-input>
-              <el-table size="mini" fit :show-header="false" :highlight-current-row="true" :stripe="false"
-                :border="false" height="240" :data="filterDIList" @row-dblclick="rowDbclick">
+              <el-table
+                size="mini"
+                fit
+                :show-header="false"
+                :highlight-current-row="true"
+                :stripe="false"
+                :border="false"
+                height="240"
+                :data="filterDIList"
+                @row-dblclick="rowDbclick"
+              >
                 <el-table-column prop="uniformCode" />
                 <el-table-column prop="name" />
               </el-table>
             </el-tab-pane>
             <el-tab-pane label="函数">
-              <el-table size="mini" fit :show-header="false" :highlight-current-row="true" :stripe="false"
-                :border="false" :height="270" :data="func" @row-dblclick="tabFuncRowClickHandle">
+              <el-table
+                size="mini"
+                fit
+                :show-header="false"
+                :highlight-current-row="true"
+                :stripe="false"
+                :border="false"
+                :height="270"
+                :data="func"
+                @row-dblclick="tabFuncRowClickHandle"
+              >
                 <el-table-column min-width="60%">
                   <template #default="scope">
                     <el-popover trigger="hover" placement="bottom">
@@ -98,7 +185,7 @@
                       <p>参数:{{ scope.row.param }}</p>
                       <template #reference>
                         <span size="medium" transition="fade-in-linear">{{
-                            scope.row.lab
+                          scope.row.lab
                         }}</span>
                       </template>
                     </el-popover>
@@ -111,7 +198,7 @@
                       <p>参数:{{ scope.row.param }}</p>
                       <template #reference>
                         <span size="medium" transition="fade-in-linear">{{
-                            scope.row.name
+                          scope.row.name
                         }}</span>
                       </template>
                     </el-popover>
@@ -121,8 +208,14 @@
             </el-tab-pane>
             <el-tab-pane label="运算符">
               <el-button-group>
-                <el-button v-for="item in operator" :key="item" plain type="primary" @click="elInputSplit(item)"
-                  style="width: 60px; margin: 7px 12px; height: 40px">
+                <el-button
+                  v-for="item in operator"
+                  :key="item"
+                  plain
+                  type="primary"
+                  @click="elInputSplit(item)"
+                  style="width: 60px; margin: 7px 12px; height: 40px"
+                >
                   {{ item }}
                 </el-button>
               </el-button-group>
@@ -142,7 +235,9 @@
     <template #footer>
       <span class="dialog-footer">
         <el-button @click="closeDialog">取 消</el-button>
-        <el-button type="primary" @click="submitForm(ruleFormRef)">确 定</el-button>
+        <el-button type="primary" @click="submitForm(ruleFormRef)"
+          >确 定</el-button
+        >
       </span>
     </template>
   </el-dialog>
@@ -151,13 +246,14 @@
 import { ref, onMounted, reactive, computed, watch, nextTick } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import {
-//   fetchAIPointList,
-//   fetchDIPointList,
-//   fetchRelatePart,
+  //   fetchAIPointList,
+  //   fetchDIPointList,
+  //   fetchRelatePart,
   custombj_postSave,
   fetch_electrical_point_ai,
   fetch_electrical_point_di,
-  getStationinfo,
+  getWtModel,
+  fetchRelatePartAndAlarmType,
 } from "/@/api/api.js";
 import { useStore } from "vuex";
 const store = useStore();
@@ -168,11 +264,11 @@ onMounted(() => {
 watch(
   () => props.isVisible,
   (val, old) => {
-    isShow.value = val
+    isShow.value = val;
   },
   {
     deep: true,
-  },
+  }
 );
 watch(
   () => props.form?.id,
@@ -192,19 +288,19 @@ watch(
   () => props.form,
   (val, old) => {
     nextTick(() => {
-      form.value = val
+      form.value = val;
     });
   },
   {
     deep: true,
   }
-)
-const isShow=ref(false);
+);
+const isShow = ref(false);
 const form = ref({
   id: "",
   name: "",
   descriptionShow: "",
-  expressionShow: "",
+  expression: "",
   tag: "",
   rank: "",
   enabled: "1", // 1可用-0禁用
@@ -220,7 +316,7 @@ const form = ref({
   taskstart: "",
   relatedParts: "",
   userName: "",
-})
+});
 const emits = defineEmits(["close"]);
 const props = defineProps({
   isVisible: {
@@ -480,8 +576,8 @@ const rules = reactive({
   name: [{ required: true, message: "请输入规则名称", trigger: "blur" }],
   category: [{ required: true, message: "请选择报警类别", trigger: "change" }],
   rank: [{ required: true, message: "请选择报警级别", trigger: "change" }],
-  station: [{ required: true, message: "请选择风场", trigger: "change" }],
-  expressionShow: [
+  stationId: [{ required: true, message: "请选择风场", trigger: "change" }],
+  expression: [
     { required: true, message: "表达式不能为空", trigger: "change" },
   ],
 });
@@ -498,20 +594,20 @@ const modelIdChange = async () => {
 };
 //机型
 const getequipmentmodel_list = async () => {
-  const { data } = await getStationinfo(form.value.station);
-  state.modelList = data[0].modelList;
+  const { data } = await getWtModel(form.value.stationId);
+  state.modelList = data;
 };
 //所属部件
 const getfetchRelatePart = async () => {
-  const res = await fetchRelatePart();
+  const res = await fetchRelatePartAndAlarmType();
   state.relatePartList = res;
 };
 // 查询风场AI、DI测点
 const getfetchAIPointList = async () => {
-//   const res = await fetchAIPointList(form.value.station, form.value.modelId);
-//   state.AIPointList = res.sort(function (a, b) {
-//     return a.uniformCode - b.uniformCode;
-//   });
+  //   const res = await fetchAIPointList(form.value.station, form.value.modelId);
+  //   state.AIPointList = res.sort(function (a, b) {
+  //     return a.uniformCode - b.uniformCode;
+  //   });
 };
 const filterAIList = computed(() =>
   state.AIPointList?.filter(
@@ -568,7 +664,7 @@ const tabFuncRowClickHandle = (row) => {
     elInput.selectionStart = startPos + func.length - 1;
     elInput.selectionEnd = startPos + func.length - 1;
   }
-  form.value.expressionShow = result; // 赋值给表单中的的字段
+  form.value.expression = result; // 赋值给表单中的的字段
 };
 //rowDbclick
 const rowDbclick = (row) => {
@@ -593,14 +689,14 @@ const save = async () => {
   const res = await custombj_postSave(form.value);
   console.warn(res);
   ElMessage.success(`保存成功!`);
-  closeDialog()
+  closeDialog();
 };
 //提交
 const submitForm = async (formEl) => {
   if (!formEl) return;
   await formEl.validate((valid, fields) => {
     if (valid) {
-      save()
+      save();
     } else {
       console.log("error submit!", fields);
     }
@@ -623,8 +719,8 @@ const handleClose = () => {
 //关闭触发事件
 const closeDialog = () => {
   resetForm(ruleFormRef.value);
-  state.AIPointList = []
-  state.DIPointList = []
+  state.AIPointList = [];
+  state.DIPointList = [];
   toEmits();
 };
 </script>

+ 1 - 6
src/pages/baseData/fan_components/faultmode.vue

@@ -251,9 +251,7 @@ const handleDelete = (row) => {
     type: "warning",
   })
     .then(async () => {
-      console.warn(row);
       const res = await faultmode_delete(row.id);
-      console.warn(res);
       if (res == 1) {
         ElMessage.success(`删除成功!`);
       } else {
@@ -266,8 +264,7 @@ const handleDelete = (row) => {
 // 保存编辑
 const saveEdit = async () => {
   const res = await faultmode_add_edit(editFormData.value);
-  console.warn(res);
-  if (res.status == 20000) {
+  if (res.code === 200) {
     ElMessage.success(`操作成功!`);
     editVisible.value = false;
     getfaultmode(desc.value.code);
@@ -279,7 +276,6 @@ const saveEdit = async () => {
 const getfaultmode = async (code) => {
   const res = await faultmode_structurecode(code);
   state.faultmodeTableData = res;
-  console.warn(res);
 };
 
 // 批量导入
@@ -320,7 +316,6 @@ const export2Excel = () => {
   ];
   outExportExcel(tableHeader, tableKey, tableData, "故障模式导出excel");
 };
-
 </script>
 <style lang="scss" scoped>
 </style>

+ 34 - 177
src/pages/baseData/fan_components/windturbine.vue

@@ -98,42 +98,25 @@
         scope.row.uniformCode
       }}</template>
     </el-table-column>
-    <el-table-column label="名称" align="left" prop="chineseText" width="180" />
+    <el-table-column label="描述" align="left" prop="description" width="180" />
     <el-table-column label="停机类型" align="center" prop="characteristic" />
     <el-table-column label="风机型号" align="center" prop="modelId" />
-    <el-table-column label="报警类型" align="center" prop="warningTypeId" />
-    <el-table-column label="故障编码" align="center" prop="faultCode" />
-    <el-table-column label="报警级别" align="center" prop="levelId">
-      <template #default="scope">{{
-        levelIdConvert(scope.row.levelId)
-      }}</template>
+    <el-table-column label="报警类型" align="center" prop="alarmType" />
+    <el-table-column label="故障编码" align="center" prop="nemCode" />
+    <el-table-column label="报警级别" align="center">
+      <template #default="scope">{{ levelIdConvert(scope.row.rank) }}</template>
     </el-table-column>
-    <el-table-column
-      label="报警分类"
-      align="center"
-      prop="warningClassIfyId"
-      min-width="50"
-    >
+    <el-table-column label="报警分类" align="center" min-width="50">
       <template #default="scope">{{
-        warningClassIfyIdConvert(scope.row.warningClassIfyId)
+        warningClassIfyIdConvert(scope.row.deviceType)
       }}</template>
     </el-table-column>
-    <el-table-column
-      label="是否可以复位"
-      align="center"
-      prop="isreset"
-      min-width="50"
-    >
+    <el-table-column label="是否可以复位" align="center" min-width="50">
       <template #default="scope">{{
-        isresetConvert(scope.row.isreset)
+        scope.row.resetTable ? "是" : "否"
       }}</template>
     </el-table-column>
-    <el-table-column
-      label="是否启用"
-      align="center"
-      prop="display"
-      min-width="50"
-    >
+    <el-table-column label="是否启用" align="center" min-width="50">
       <template #default="scope">{{
         scope.row.enabled == 1 ? "是" : "否"
       }}</template>
@@ -141,13 +124,10 @@
     <el-table-column
       label="关联部件"
       align="center"
-      prop="relatedParts"
       min-width="50"
-    >
-      <template #default="scope">
-        <span>{{ relatePartConvert(scope.row.relatedParts) }}</span>
-      </template>
-    </el-table-column>
+      prop="componentsName"
+    />
+
     <el-table-column label="操作" align="center" width="100">
       <template #default="scope">
         <el-button
@@ -207,8 +187,8 @@ const state = reactive({
   form: {},
 });
 const query = reactive({
-  pagenum: 1,
-  pagesize: 10,
+  pageNum: 1,
+  pageSize: 10,
   stationId: "",
   modelId: "",
   name: "",
@@ -326,96 +306,31 @@ const handleError = (response, file, fileList) => {
 // 报警级别
 const levelIdConvert = (val) => {
   switch (val) {
-    case "ZC_BJ":
-      return "运转正常";
-      break;
-    case "YJ_BJ":
-      return "运转状态超出标准范围";
-      break;
-    case "GZ_BJ":
-      return "非正常停止运转";
-      break;
-    case "WH_BJ":
-      return "停机维护";
-      break;
-    case "XD_BJ":
-      return "限电/计划停机";
-      break;
+    case 1:
+      return "低级";
+    case 2:
+      return "低中级";
+    case 3:
+      return "中级";
+    case 4:
+      return "中高级";
+    case 5:
+      return "限电/高级";
     default:
-      return;
+      return "";
   }
 };
 // 报警分类
 const warningClassIfyIdConvert = (val) => {
   switch (val) {
-    case "bj":
-      return "变桨";
-      break;
-    case "bpq":
-      return "变频器";
-      break;
-    case "clx":
-      return "齿轮箱";
-      break;
-    case "fdj":
-      return "发电机";
-      break;
-    case "hh":
-      return "滑环";
-      break;
-    case "jcjr":
-      return "机舱加热";
-      break;
-    case "lq":
-      return "冷却";
-      break;
-    case "ph":
-      return "偏航";
-      break;
-    case "rh":
-      return "润滑";
-      break;
-    case "yy":
-      return "液压";
-      break;
-    case "zz":
-      return "主轴";
-      break;
-    case "other":
-      return "其它";
-      break;
-    case "kz":
-      return "控制";
-      break;
-    case "yl":
-      return "叶轮";
-      break;
-    case "jc":
-      return "机舱";
-      break;
-    case "xb":
-      return "箱变";
-      break;
-    case "dw":
-      return "电网";
-      break;
-    case "td":
-      return "塔底";
-      break;
-    case "fsy":
-      return "风速仪";
-      break;
-  }
-};
-// 是否可以复位
-const isresetConvert = (val) => {
-  switch (val) {
-    case 0:
-      return "是";
-      break;
-    case 1:
-      return "否";
-      break;
+    case "station":
+      return "场站";
+    case "windturbine":
+      return "风机";
+    case "booststation":
+      return "升压站";
+    default:
+      return "";
   }
 };
 
@@ -429,64 +344,6 @@ const ednaValueConvert = (val) => {
     return "DI" + val;
   }
 };
-// 关联部件
-const relatePartConvert = (val) => {
-  switch (val) {
-    case "YP":
-      return "叶片";
-      break;
-    case "LG":
-      return "轮毂";
-      break;
-    case "TZ":
-      return "塔架";
-      break;
-    case "JC":
-      return "机舱";
-      break;
-    case "KZXT":
-      return "控制系统";
-      break;
-    case "BJXT":
-      return "变桨系统";
-      break;
-    case "PHXT":
-      return "偏航系统";
-      break;
-    case "CLX":
-      return "齿轮箱";
-      break;
-    case "FDJ":
-      return "发电机";
-      return;
-    case "BPQ":
-      return "变频器";
-      return;
-    case "YYXT":
-      return "液压系统";
-      break;
-    case "FZXT":
-      return "辅助系统";
-      break;
-    case "CFXT":
-      return "测风系统";
-      break;
-    case "DWXT":
-      return "电网系统";
-      break;
-    case "TDG":
-      return "塔底柜";
-      break;
-    case "CDL":
-      return "传动链";
-      break;
-    case "QT":
-      return "其他";
-      break;
-    default:
-      break;
-  }
-};
 </script>
 <style scoped>
 .mr10 {

+ 5 - 14
src/pages/baseData/fan_components/ycpoint.vue

@@ -64,7 +64,7 @@
     height="65vh"
   >
     <el-table-column type="index" width="50" />
-    <el-table-column prop="metriccode" label="测点编码"></el-table-column>
+    <el-table-column prop="metricCode" label="测点编码"></el-table-column>
     <el-table-column label="名称">
       <template #default="scope">
         <el-popover placement="right" :width="260" trigger="click">
@@ -91,9 +91,8 @@
         </el-popover>
       </template>
     </el-table-column>
-
-    <el-table-column prop="unitname" label="单位"></el-table-column>
-    <el-table-column prop="categorydata" label="测点类型"></el-table-column>
+    <el-table-column prop="unitName" label="单位"></el-table-column>
+    <el-table-column prop="categoryData" label="测点类型"></el-table-column>
     <el-table-column prop="categorysci" label="物理类型"></el-table-column>
     <el-table-column prop="categorysci" label="数据类型"></el-table-column>
     <el-table-column prop="description" label="描述"></el-table-column>
@@ -321,7 +320,7 @@ const search = async () => {
   getPoint(desc.value);
 };
 // getPoint
-const getPoint = async (node) => {
+const getPoint = async (node, value) => {
   const res = await point(
     node.code,
     query.page,
@@ -331,7 +330,6 @@ const getPoint = async (node) => {
     "windturbine",
     state.selectModel
   );
-  console.log(123123, res);
   pageTotal.value = res.total;
   state.pointTableData = res.records?.sort((a, b) => {
     return a.id - b.id;
@@ -352,10 +350,8 @@ const handleEdit = (row) => {
 };
 //测点 add
 const postmetrics = async () => {
-  console.warn(editFormData.value);
   const res = await metrics(editFormData.value);
-  console.warn(res);
-  if (res.status == 20000) {
+  if (res.code == 200) {
     ElMessage.success(`操作成功!`);
     editVisible.value = false;
   } else {
@@ -374,9 +370,7 @@ const handleDelete = (row) => {
     type: "warning",
   })
     .then(async () => {
-      console.warn(row);
       const res = await delmetrics(row.id);
-      console.warn(res);
       if (res == 1) {
         ElMessage.success(`删除成功!`);
       } else {
@@ -390,7 +384,6 @@ const handleDelete = (row) => {
 //deviceModelAdd 新增机型
 const deviceModelAdd = async () => {
   if (state.deviceModelSel == "") return;
-  console.warn();
   let obj = {
     deviceid: editFormData.value.deviceid,
     devicemodel: state.deviceModelSel,
@@ -405,7 +398,6 @@ const deviceModelAdd = async () => {
 const getDeviceModel = async () => {
   const res = await device_list();
   state.deviceModel = res;
-  console.warn(res);
 };
 
 // 分页导航
@@ -416,7 +408,6 @@ const handlePageChange = (val) => {
 
 // 批量导入
 const handleSuccess = (response, file, fileList) => {
-  console.warn(response, file, fileList);
   ElMessage.success("导入成功!");
   getPoint(desc.value);
 };

+ 153 - 52
src/pages/baseData/fan_components/yxpoint.vue

@@ -1,8 +1,18 @@
 <template>
   <div class="devicemenu">
     <el-space wrap :size="10">
-      <el-button type="primary" @click="handleEdit(state.addFormData)" :disabled="desc.code == ''">新增</el-button>
-      <el-input v-model="state.SearchVal" placeholder="筛选" style="width: 180px" size="small" />
+      <el-button
+        type="primary"
+        @click="handleEdit(state.addFormData)"
+        :disabled="desc.code == ''"
+        >新增</el-button
+      >
+      <el-input
+        v-model="state.SearchVal"
+        placeholder="筛选"
+        style="width: 180px"
+        size="small"
+      />
       <!-- <el-select v-model="state.selectModel" class="mr10" style="width: 180px"  placeholder="全部" >
      <el-option v-for="item in state.modelList" :key="item" :value="item" :label="item"></el-option>
     </el-select>
@@ -13,16 +23,33 @@
       <el-option key="4" label="计算" value="CI"></el-option>
     </el-select> -->
       <el-button type="primary" @click="search">查询</el-button>
-      <el-upload class="upload-demo" :disabled="desc.code == ''" action="/sharding/device/input" :show-file-list="false"
-        :on-success="handleSuccess" :on-progress="handleProgress" :on-error="handleError">
+      <el-upload
+        class="upload-demo"
+        :disabled="desc.code == ''"
+        action="/sharding/device/input"
+        :show-file-list="false"
+        :on-success="handleSuccess"
+        :on-progress="handleProgress"
+        :on-error="handleError"
+      >
         <el-button :disabled="desc.code == ''" type="primary">导入</el-button>
       </el-upload>
-      <el-button type="primary" @click="export2Excel" :disabled="desc.code == ''">导出</el-button>
+      <el-button
+        type="primary"
+        @click="export2Excel"
+        :disabled="desc.code == ''"
+        >导出</el-button
+      >
     </el-space>
   </div>
-  <el-table :data="state.pointTableData" stripe style="width: 100%" height="65vh">
+  <el-table
+    :data="state.pointTableData"
+    stripe
+    style="width: 100%"
+    height="65vh"
+  >
     <el-table-column type="index" width="50" />
-    <el-table-column prop="metriccode" label="测点编码"></el-table-column>
+    <el-table-column prop="metricCode" label="测点编码"></el-table-column>
     <el-table-column label="名称">
       <template #default="scope">
         <el-popover placement="right" :width="260" trigger="click">
@@ -30,29 +57,58 @@
             <el-button type="text" size="small">{{ scope.row.name }}</el-button>
           </template>
           <el-table :data="scope.row.deviceModelMetrics" max-height="400px">
-            <el-table-column property="devicemodel" label="机型" align="center"></el-table-column>
-            <el-table-column property="uniformcode" label="统一编码" align="center"></el-table-column>
-            <el-table-column property="multiplier" label="倍率" align="center"></el-table-column>
+            <el-table-column
+              property="devicemodel"
+              label="机型"
+              align="center"
+            ></el-table-column>
+            <el-table-column
+              property="uniformcode"
+              label="统一编码"
+              align="center"
+            ></el-table-column>
+            <el-table-column
+              property="multiplier"
+              label="倍率"
+              align="center"
+            ></el-table-column>
           </el-table>
         </el-popover>
       </template>
     </el-table-column>
-
-    <el-table-column prop="unitname" label="单位"></el-table-column>
-    <el-table-column prop="categorydata" label="测点类型"></el-table-column>
+    <el-table-column prop="unitName" label="单位"></el-table-column>
+    <el-table-column prop="categoryData" label="测点类型"></el-table-column>
     <el-table-column prop="categorysci" label="物理类型"></el-table-column>
     <el-table-column prop="categorysci" label="数据类型"></el-table-column>
     <el-table-column prop="description" label="描述"></el-table-column>
     <el-table-column label="操作" width="180" align="center">
       <template #default="scope">
-        <el-button type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button>
-        <el-button type="text" icon="el-icon-delete" style="color: red" @click="handleDelete(scope.row)">删除</el-button>
+        <el-button
+          type="text"
+          icon="el-icon-edit"
+          @click="handleEdit(scope.row)"
+          >编辑</el-button
+        >
+        <el-button
+          type="text"
+          icon="el-icon-delete"
+          style="color: red"
+          @click="handleDelete(scope.row)"
+          >删除</el-button
+        >
       </template>
     </el-table-column>
   </el-table>
   <div class="pagination">
-    <el-pagination background layout="total, prev, pager, next" hide-on-single-page :current-page="query.page"
-      :page-size="query.limit" :total="pageTotal" @current-change="handlePageChange"></el-pagination>
+    <el-pagination
+      background
+      layout="total, prev, pager, next"
+      hide-on-single-page
+      :current-page="query.page"
+      :page-size="query.limit"
+      :total="pageTotal"
+      @current-change="handlePageChange"
+    ></el-pagination>
   </div>
   <!-- 传感点编辑弹出框 -->
   <el-dialog v-model="editVisible" width="40%">
@@ -87,21 +143,35 @@
         </el-col>
       </el-row>
       <el-form-item label="描述">
-        <el-input v-model="editFormData.description" :rows="3" type="textarea" clearable></el-input>
+        <el-input
+          v-model="editFormData.description"
+          :rows="3"
+          type="textarea"
+          clearable
+        ></el-input>
       </el-form-item>
       <el-row :gutter="24">
         <el-col :span="12">
           <el-form-item label="数据类型">
             <el-select v-model="editFormData.categorydata" placeholder="Select">
-              <el-option v-for="item in state.categorydataoptions" :key="item" :label="item" :value="item">
+              <el-option
+                v-for="item in state.categorydataoptions"
+                :key="item"
+                :label="item"
+                :value="item"
+              >
               </el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="结构">
-            <el-cascader v-model="editFormData.structurecode" :options="cascaderdata"
-              :props="{ checkStrictly: true, emitPath: false }" clearable />
+            <el-cascader
+              v-model="editFormData.structurecode"
+              :options="cascaderdata"
+              :props="{ checkStrictly: true, emitPath: false }"
+              clearable
+            />
           </el-form-item>
         </el-col>
       </el-row>
@@ -117,15 +187,33 @@
           </el-form-item>
         </el-col>
       </el-row>
-
       <el-form-item label="适配机型" class="deviceModelClass">
-        <el-select v-model="state.deviceModelSel" style="margin-right: 20px" placeholder="新增机型" size="mini">
-          <el-option v-for="item in state.deviceModel" :key="item.code" :label="item.code" :value="item.code">
+        <el-select
+          v-model="state.deviceModelSel"
+          style="margin-right: 20px"
+          placeholder="新增机型"
+          size="mini"
+        >
+          <el-option
+            v-for="item in state.deviceModel"
+            :key="item.code"
+            :label="item.code"
+            :value="item.code"
+          >
           </el-option>
         </el-select>
-        <el-button v-show="state.deviceModelSel != ''" size="mini" type="primary" @click="deviceModelAdd()">新增机型
+        <el-button
+          v-show="state.deviceModelSel != ''"
+          size="mini"
+          type="primary"
+          @click="deviceModelAdd()"
+          >新增机型
         </el-button>
-        <el-table :data="editFormData.deviceModelMetrics" style="width: 100%;margin-top: 10px;" max-height="200px">
+        <el-table
+          :data="editFormData.deviceModelMetrics"
+          style="width: 100%; margin-top: 10px"
+          max-height="200px"
+        >
           <el-table-column prop="devicemodel" label="机型" />
           <el-table-column label="倍率">
             <template #default="scope">
@@ -151,12 +239,18 @@
 <script setup>
 import { ref, onMounted, inject, reactive, watch } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
-import { point, metrics, delmetrics, device_list,getStationinfo } from "/@/api/api.js";
+import {
+  point,
+  metrics,
+  delmetrics,
+  device_list,
+  getWtModel,
+} from "/@/api/api.js";
 import { outExportExcel } from "/@/utils/exportExcel"; //引入文件
 onMounted(() => {
   getPoint(desc.value);
   getDeviceModel();
-  getequipmentmodel_list()
+  getequipmentmodel_list();
 });
 let editFormData = ref({});
 let editVisible = ref(false); //传感点
@@ -179,7 +273,7 @@ let state = reactive({
   selectPoint: "",
   selectModel: "",
   modelList: [],
-  categorydataoptions: ['AI', 'DI', 'CI'],
+  categorydataoptions: ["AI", "DI", "CI"],
   addFormData: {
     categorydata: "AI",
     categoryres1: null,
@@ -195,7 +289,7 @@ let state = reactive({
     id: null,
     metriccode: "",
     name: "",
-    structurecode: "101010205",
+    structurecode: "",
     unitname: null,
     unitnamecn: null,
     deviceModelMetrics: [],
@@ -207,12 +301,19 @@ const query = reactive({
 });
 let pageTotal = ref(0);
 const search = async () => {
-  getPoint(desc.value)
-}
+  getPoint(desc.value);
+};
 // getPoint
 const getPoint = async (node) => {
-  const res = await point(node.code, query.page, query.limit, state.selectPoint, state.SearchVal, 'windturbine', state.selectModel);
-  console.warn(res);
+  const res = await point(
+    node.code,
+    query.page,
+    query.limit,
+    state.selectPoint,
+    state.SearchVal,
+    "windturbine",
+    state.selectModel
+  );
   pageTotal.value = res.total;
   state.pointTableData = res.records?.sort((a, b) => {
     return a.id - b.id;
@@ -220,16 +321,15 @@ const getPoint = async (node) => {
 };
 // 机型
 const getequipmentmodel_list = async () => {
-  const { data } = await getStationinfo('');
-    let arr = []
-    data.forEach(e => {
-      arr.push(...e.modelList)
-    });
-    state.modelList = [...new Set(arr)]
+  const { data } = await getWtModel();
+  let arr = [];
+  data.forEach((e) => {
+    arr.push(...e.modelList);
+  });
+  state.modelList = [...new Set(arr)];
 };
 // 测点 编辑
 const handleEdit = (row) => {
-  console.warn(row);
   if (!row.deviceModelMetrics) {
     row.deviceModelMetrics = [];
   }
@@ -238,10 +338,8 @@ const handleEdit = (row) => {
 };
 //测点 add
 const postmetrics = async () => {
-  console.warn(editFormData.value);
   const res = await metrics(editFormData.value);
-  console.warn(res);
-  if (res.status == 20000) {
+  if (res.code == 200) {
     ElMessage.success(`操作成功!`);
     editVisible.value = false;
   } else {
@@ -260,9 +358,7 @@ const handleDelete = (row) => {
     type: "warning",
   })
     .then(async () => {
-      console.warn(row);
       const res = await delmetrics(row.id);
-      console.warn(res);
       if (res == 1) {
         ElMessage.success(`删除成功!`);
       } else {
@@ -270,13 +366,12 @@ const handleDelete = (row) => {
       }
       getPoint(desc.value);
     })
-    .catch(() => { });
+    .catch(() => {});
 };
 
 //deviceModelAdd 新增机型
 const deviceModelAdd = async () => {
   if (state.deviceModelSel == "") return;
-  console.warn();
   let obj = {
     deviceid: editFormData.value.deviceid,
     devicemodel: state.deviceModelSel,
@@ -291,7 +386,6 @@ const deviceModelAdd = async () => {
 const getDeviceModel = async () => {
   const res = await device_list();
   state.deviceModel = res;
-  console.warn(res);
 };
 
 // 分页导航
@@ -302,18 +396,25 @@ const handlePageChange = (val) => {
 
 // 批量导入
 const handleSuccess = (response, file, fileList) => {
-  console.warn(response, file, fileList);
   ElMessage.success("导入成功!");
   getPoint(desc.value);
 };
-const handleProgress = (response, file, fileList) => { };
+const handleProgress = (response, file, fileList) => {};
 const handleError = (response, file, fileList) => {
   ElMessage.success("导入失败!");
 };
 
 // 批量导出
 const export2Excel = async () => {
-  const tableData = await point(desc.value.code, 1, 99999999, state.selectPoint, state.SearchVal, 'windturbine', state.selectModel);
+  const tableData = await point(
+    desc.value.code,
+    1,
+    99999999,
+    state.selectPoint,
+    state.SearchVal,
+    "windturbine",
+    state.selectModel
+  );
   ElMessage.success(`导出成功!`);
   const tableHeader = [
     "上级结构编码",

+ 9 - 13
src/pages/customWarning/index.vue

@@ -159,9 +159,6 @@
               <span v-if="item.code == 'rank'">
                 {{ tableFilter(scope.row.rank) }}
               </span>
-              <span v-else-if="item.code == 'alarmtype'">
-                {{ tableFilter(scope.row.alarmtype) }}
-              </span>
               <span v-else-if="item.code == 'ts'">
                 {{ formatTime(scope.row.ts) }}
               </span>
@@ -187,9 +184,6 @@
               <span v-if="item.code == 'rank'">
                 {{ tableFilter(scope.row.rank) }}
               </span>
-              <span v-else-if="item.code == 'alarmtype'">
-                {{ tableFilter(scope.row.alarmtype) }}
-              </span>
               <span v-else-if="item.code == 'ts'">
                 {{ formatTime(scope.row.ts) }}
               </span>
@@ -307,12 +301,11 @@ const state = reactive({
     { title: "时间", code: "ts", width: "150" },
     { title: "场站", code: "stationname", width: "150" },
     { title: "机组", code: "devicename", width: "150" },
-    { title: "故障编码", code: "nemCode", width: "100" },
-    { title: "故障原因", code: "faultCause" },
-    { title: "故障解决方法", code: "resolvent" },
     { title: "报警信息", code: "description", width: "180" },
+    { title: "故障原因", code: "faultCause" },
+    // { title: "故障编码", code: "nemCode", width: "100" },
+    // { title: "故障解决方法", code: "resolvent" },
     { title: "级别", code: "rank", width: "80" },
-    { title: "类型", code: "alarmType", width: "80" },
     {
       title: "状态",
       code: "isCloseName",
@@ -320,13 +313,13 @@ const state = reactive({
       style: getColumnStyle,
       width: 100,
     },
+    { title: "类型", code: "deviceTypeName", width: "80" },
   ],
   tableHeader1: [
     { title: "时间", code: "ts", width: "150" },
     { title: "升压站", code: "stationname", width: "150" },
     { title: "报警信息", code: "description" },
     { title: "级别", code: "rank", width: "80" },
-    { title: "类型", code: "alarmType", width: "80" },
     {
       title: "状态",
       code: "isCloseName",
@@ -334,6 +327,7 @@ const state = reactive({
       width: 100,
       width: "80",
     },
+    { title: "类型", code: "deviceTypeName", width: "80" },
   ],
 });
 // 场站列表/升压站列表
@@ -442,6 +436,7 @@ const getAlarmHistoryt = async () => {
   query.pageTotal = data?.total;
   data?.ls?.forEach((ele) => {
     ele.isCloseName = ele.endts ? "已解除" : "未解除";
+    ele.deviceTypeName = tableFilter(ele.deviceType);
   });
   state.tableData = data?.ls;
 };
@@ -494,7 +489,7 @@ const export2Excel = async () => {
           ...item,
           ts: formatTime(item.ts),
           rank: tableFilter(item.rank),
-          alarmtype: tableFilter(item.alarmtype),
+          deviceType: tableFilter(item.deviceType),
         };
       }),
       fileName
@@ -514,13 +509,14 @@ const formatTime = (val) => {
 // 格式化
 const obj = {
   1: "低级",
-  2: "低级",
+  2: "低级",
   3: "中级",
   4: "中高级",
   5: "高级",
   booststation: "升压站",
   custom: "自定义",
   windturbine: "风机",
+  inverter: "光伏",
 };
 const messageTypeObj = {
   1: "触发",

+ 14 - 6
src/pages/safe/historywaring.vue

@@ -306,12 +306,11 @@ const state = reactive({
     { title: "时间", code: "ts", width: "150" },
     { title: "场站", code: "stationname", width: "150" },
     { title: "机组", code: "devicename", width: "150" },
-    { title: "故障编码", code: "nemCode", width: "100" },
-    { title: "故障原因", code: "faultCause" },
-    { title: "故障解决方法", code: "resolvent" },
     { title: "报警信息", code: "description", width: "180" },
+    { title: "故障原因", code: "faultCause" },
+    { title: "故障编码", code: "nemCode", width: "100" },
+    // { title: "故障解决方法", code: "resolvent" },
     { title: "级别", code: "rank", width: "80" },
-    { title: "类型", code: "alarmType", width: "80" },
     {
       title: "状态",
       code: "isCloseName",
@@ -319,13 +318,13 @@ const state = reactive({
       style: getColumnStyle,
       width: 100,
     },
+    { title: "类型", code: "alarmTypeName", width: "80" },
   ],
   tableHeader1: [
     { title: "时间", code: "ts", width: "150" },
     { title: "升压站", code: "stationname", width: "150" },
     { title: "报警信息", code: "description" },
     { title: "级别", code: "rank", width: "80" },
-    { title: "类型", code: "alarmType", width: "80" },
     {
       title: "状态",
       code: "isCloseName",
@@ -333,6 +332,7 @@ const state = reactive({
       width: 100,
       width: "80",
     },
+    { title: "类型", code: "alarmTypeName", width: "80" },
   ],
 });
 // 场站列表/升压站列表
@@ -440,6 +440,14 @@ const getAlarmHistoryt = async () => {
   query.pageTotal = data?.total;
   data?.ls?.forEach((ele) => {
     ele.isCloseName = ele.endts ? "已解除" : "未解除";
+    ele.alarmTypeName =
+      ele.alarmType === "booststation"
+        ? "升压站"
+        : ele.alarmType === "windturbine"
+        ? "风机"
+        : ele.alarmType === "inverter"
+        ? "光伏"
+        : "";
   });
   state.tableData = data?.ls;
 };
@@ -512,7 +520,7 @@ const formatTime = (val) => {
 // 格式化
 const obj = {
   1: "低级",
-  2: "低级",
+  2: "低级",
   3: "中级",
   4: "中高级",
   5: "高级",

+ 3 - 3
src/pages/safe/realwaring.vue

@@ -60,21 +60,21 @@
       <div class="cardLine">
         <div class="lineItem card">
           <Safecom
-            title="风机自定义报警"
+            title="风机警"
             deviceType="windturbine"
             alarmType="custom"
           />
         </div>
         <div class="lineItem card">
           <Safecom
-            title="光伏自定义报警"
+            title="光伏警"
             deviceType="inverter"
             alarmType="custom"
           />
         </div>
         <div class="lineItem card">
           <Safecom
-            title="升压站自定义报警"
+            title="升压站事件"
             deviceType="booststation"
             alarmType="custom"
           />

+ 4 - 5
src/pages/safe/safecomponent.vue

@@ -102,12 +102,12 @@
             width="100"
             show-overflow-tooltip
           />
-          <el-table-column
+          <!-- <el-table-column
             prop="characteristic"
             label="报警特征"
             width="100"
             show-overflow-tooltip
-          />
+          /> -->
           <el-table-column label="报警描述">
             <template #default="scope">
               <span
@@ -117,17 +117,16 @@
               >
             </template>
           </el-table-column>
-
           <el-table-column
             prop="faultCause"
             label="报警故障原因"
             show-overflow-tooltip
           />
-          <el-table-column
+          <!-- <el-table-column
             prop="resolvent"
             label="报警解决方法"
             show-overflow-tooltip
-          />
+          /> -->
           <el-table-column label="级别" width="100" show-overflow-tooltip>
             <template #default="scope">
               <el-tag

+ 15 - 15
src/router/index.js

@@ -359,21 +359,21 @@ const routes = [
                 "../pages/baseData/device.vue"
               ),
           },
-          {
-            icon: "el-icon-s-home",
-            path: "/basedata/dictionary",
-            isshow: "super_admin",
-            name: "basedatadictionary",
-            meta: {
-              title: "字典维护",
-              keepAlive: true,
-            },
-            component: () =>
-              import(
-                /* webpackChunkName: "form" */
-                "../pages/baseData/dictionary.vue"
-              ),
-          },
+          // {
+          //   icon: "el-icon-s-home",
+          //   path: "/basedata/dictionary",
+          //   isshow: "super_admin",
+          //   name: "basedatadictionary",
+          //   meta: {
+          //     title: "字典维护",
+          //     keepAlive: true,
+          //   },
+          //   component: () =>
+          //     import(
+          //       /* webpackChunkName: "form" */
+          //       "../pages/baseData/dictionary.vue"
+          //     ),
+          // },
         ],
       },
       //   {