瀏覽代碼

Merge branch 'master' of http://maven.jgiot.com:7012/jiaxiaoqiang/chengfei-test-system

wangwenhua 4 月之前
父節點
當前提交
48d742267a

+ 13 - 11
src/components/hjflow/src/nodes/universal/UniversalNode.vue

@@ -1,18 +1,22 @@
 <script setup lang="ts">
-import type {Node} from '@vue-flow/core';
-import {inject, markRaw, onMounted} from 'vue';
-import {GrandparentMethod, HJInterNodeData, HJMethodName, HJNodeData} from '../../types/comTypes';
-import Basic from '../com/basic.vue';
-import {CirclePlus} from "@element-plus/icons-vue";
-import OperationHeader from '../com/operationHeader.vue'
+import type { Node } from "@vue-flow/core";
+import { inject, markRaw, onMounted } from "vue";
+import {
+  GrandparentMethod,
+  HJInterNodeData,
+  HJMethodName,
+  HJNodeData,
+} from "../../types/comTypes";
+import Basic from "../com/basic.vue";
+import { CirclePlus } from "@element-plus/icons-vue";
+import OperationHeader from "../com/operationHeader.vue";
 
 // 即使外部定义的类型数据再多,传进来的也是Node类型。
 const props = defineProps<HJInterNodeData>();
 
 onMounted(() => {
-  console.log('mounted', props);
+  console.log("mounted", props);
 });
-
 </script>
 
 <template>
@@ -22,12 +26,10 @@ onMounted(() => {
     </template>
     <template #default>
       <div class="content-text">
-        {{ props.data?.information?.configName ?? '请配置名称' }}
+        {{ props.data?.information?.functionName ?? "请配置名称" }}
       </div>
     </template>
-
   </Basic>
-
 </template>
 
 <style scoped lang="less">

+ 2 - 1
src/styles/variables.scss

@@ -40,7 +40,8 @@
   --hj-black-1: #1a1a1a;
   --hj-black-2: #303030;
   --hj-black-3: #404040;
-  --hj-black-4::#505050
+  --hj-black-4:#505050;
+
 
 --hj-bg: #fff;
 

+ 35 - 13
src/views/modules/project-config/com/function-col.vue

@@ -16,20 +16,23 @@ const handleChange = (val: any) => {
 };
 
 const test = (data) => {
-  console.log("test", data);
+  console.log("test", data?.data?.information?.properties);
 };
 </script>
 
 <template>
   <div class="function-col">
     <TitleHeader> 添加功能模块</TitleHeader>
-    {{ propertyData }}
-    <el-collapse v-model="activeNames" @change="handleChange">
+    <el-collapse
+      v-model="activeNames"
+      @change="handleChange"
+      class="collapse-container"
+    >
       <el-collapse-item
-        title="Consistency"
-        name="1"
+        :name="funType.name"
         v-for="(funType, index) in propertyData"
         :key="funType.id"
+        :title="funType.name"
       >
         <div class="drag-container">
           <div
@@ -54,26 +57,45 @@ const test = (data) => {
   height: calc(100vh - $main-header-height);
   background-color: $hj-black-2;
 }
+.collapse-container {
+  height: calc(100vh - $main-header-height - 65px);
+  overflow-y: auto;
+}
 .drag-container {
   display: flex;
   flex-direction: column;
   justify-content: start;
   align-items: center;
-  height: 100%;
-  width: 150px;
-  background: #ccc;
-  padding: 8px 10px;
+
+  width: 100%;
+  background-color: $hj-black-2;
+  padding: 12px 11px;
   .drag-item {
-    background: #fff;
+    background-color: rgba(0, 0, 0, 0.25);
     width: 100%;
     font-size: 14px;
     text-align: center;
-    height: 20px;
-    line-height: 20px;
+    height: 36px;
+    line-height: 36px;
     border-radius: 4px;
-    border: 1px solid rgba(204, 204, 204, 0.9);
     margin-bottom: 10px;
     cursor: pointer;
+    color: $hj-white-1;
   }
 }
+
+:deep(.el-collapse-item__content) {
+  padding: 0;
+  border: 0;
+}
+:deep(.el-collapse-item__header) {
+  background-color: rgba(0, 0, 0, 0.25);
+  color: $hj-white-1;
+  padding-left: 20px;
+  font-size: 14px;
+  border: 0;
+}
+:deep(.el-collapse, .el-collapse-item__content) {
+  border: 0;
+}
 </style>

+ 723 - 5
src/views/modules/project-config/configs/properites.ts

@@ -9,13 +9,29 @@ interface FunctionTypeModel {
   name: string;
   functions: AutoTestNodeData[]; //指的是功能模块 不是函数
 }
-// 功能块类
+export enum ExcelTypeName {
+  shuxing = "shuxing", //如果是属性,每一个都有 properties都有仪器名称,就不用在properties里再加一个仪器名称了, 在编辑节点时候,右侧给通过方法加上
+  fangfare = "fangfare",
+  tongyong = "tongyong",
+}
+// 功能块模型
 interface InformationModel {
   // 保留类型的信息以便展示
-  functionType: string;
+  functionType: ExcelTypeName;
   functionTypeId: string;
 
   functionName: string;
+  properties?: InforPropertyModel[]; //编辑node节点的时候根据这个数组展示右侧的信息
+}
+// 功能块模型有哪些属性对应的类 属性名称	初始值	数值类型	下限	上限	输入/输出
+interface InforPropertyModel {
+  proName: string;
+  defaultValue?: string;
+  proType?: "text" | "enum" | "number"; //text enum  number
+  minValue?: string;
+  maxValue?: string;
+  inputOrOutput?: "input" | "output";
+  bindValue?: string; //这个是el-form 会绑定的值
 }
 
 type HJNodeData2 = Omit<HJNodeDataModel, "information"> & {
@@ -37,9 +53,711 @@ export const propertyData = ref<FunctionTypeModel[]>([
         data: {
           label: "信号源",
           information: {
-            functionType: "功能块类别",
-            functionTypeId: "功能块类别ID",
-            functionName: "功能块名称",
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "查询仪器标识符",
+            properties: [
+              {
+                proName: "标识符",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置仪器复位",
+          },
+        },
+      },
+
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "指令完成查询",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置功率",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置输出开",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置输出关",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置脉冲调制",
+            properties: [
+              {
+                proName: "脉宽(us)",
+              },
+              {
+                proName: "周期(us)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置调制开",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置调制关",
+          },
+        },
+      },
+    ],
+  },
+
+  {
+    id: "2",
+    name: "频谱仪",
+    functions: [
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "查询仪器标识符",
+            properties: [
+              {
+                proName: "标识符",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置仪器复位",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "指令完成查询",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "关闭仪器自检",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置中心频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读中心频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置起始频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读起始频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置截止频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读截止频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置扫描带宽SPAN",
+            properties: [
+              {
+                proName: "SPAN(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读扫描带宽SPAN",
+            properties: [
+              {
+                proName: "SPAN(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "  设置全SPAN",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置参考电平REF",
+            properties: [
+              {
+                proName: "REF(dB)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读参考电平REF",
+            properties: [
+              {
+                proName: "REF(dB)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置参考电平REF自动",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置分辨率带宽RBW",
+            properties: [
+              {
+                proName: "RBW(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读分辨率带宽RBW",
+            properties: [
+              {
+                proName: "RBW(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置视频带宽VBW",
+            properties: [
+              {
+                proName: "RBW(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读视频带宽VBW",
+            properties: [
+              {
+                proName: "RBW(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置分辨率带宽RBW自动",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置视频带宽VBW自动",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "打开MARK",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "关闭MARK",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "关闭所有MARK",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置MARK频率",
+            properties: [
+              {
+                proName: "频率(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读MARK功率",
+            properties: [
+              {
+                proName: "功率(dBm)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读MARK频率",
+            properties: [
+              {
+                proName: "频率(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置扫描点数",
+            properties: [
+              {
+                proName: "点数",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读扫描点数",
+            properties: [
+              {
+                proName: "点数",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置最大保持",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "取消最大保持",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "标记峰值",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "标记次峰值",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "标记左峰值",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "标记右峰值",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "标记中心频率",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读曲线Y值",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+              {
+                proName: "Y值",
+              },
+            ],
           },
         },
       },