Forráskód Böngészése

功能模块数据类型完善。

jiaxiaoqiang 4 hónapja
szülő
commit
fe9db89284

+ 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;
 

+ 23 - 9
src/views/modules/project-config/com/function-col.vue

@@ -23,13 +23,12 @@ const test = (data) => {
 <template>
   <div class="function-col">
     <TitleHeader> 添加功能模块</TitleHeader>
-    {{ propertyData }}
     <el-collapse v-model="activeNames" @change="handleChange">
       <el-collapse-item
-        title="Consistency"
         name="1"
         v-for="(funType, index) in propertyData"
         :key="funType.id"
+        :title="funType.name"
       >
         <div class="drag-container">
           <div
@@ -60,20 +59,35 @@ const test = (data) => {
   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>

+ 39 - 4
src/views/modules/project-config/configs/properites.ts

@@ -9,13 +9,24 @@ interface FunctionTypeModel {
   name: string;
   functions: AutoTestNodeData[]; //指的是功能模块 不是函数
 }
-// 功能块
+// 功能块模型
 interface InformationModel {
   // 保留类型的信息以便展示
   functionType: string;
   functionTypeId: string;
 
   functionName: string;
+  properties: InforPropertyModel[];
+}
+// 功能块模型有哪些属性对应的类 属性名称	初始值	数值类型	下限	上限	输入/输出
+interface InforPropertyModel {
+  proName: string;
+  defaultValue?: string;
+  proType?: "text" | "enum" | "number"; //text enum  number
+  minValue?: string;
+  maxValue?: string;
+  inputOrOutput?: "input" | "output";
+  value?: string;
 }
 
 type HJNodeData2 = Omit<HJNodeDataModel, "information"> & {
@@ -37,9 +48,33 @@ export const propertyData = ref<FunctionTypeModel[]>([
         data: {
           label: "信号源",
           information: {
-            functionType: "功能块类别",
-            functionTypeId: "功能块类别ID",
-            functionName: "功能块名称",
+            functionType: "信号源",
+            functionTypeId: "1",
+            functionName: "查询仪器标识符",
+            properties: [
+              {
+                proName: "仪器名称",
+              },
+              {
+                proName: "标识符",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: "信号源",
+            functionTypeId: "1",
+            functionName: "设置仪器复位",
+            properties: [
+              {
+                proName: "仪器名称",
+              },
+            ],
           },
         },
       },