Kaynağa Gözat

配置工程 全局变量和仪器。

jiaxiaoqiang 3 ay önce
ebeveyn
işleme
aace5d7aba

+ 1 - 1
src/api/config/index.ts

@@ -11,7 +11,7 @@ import { AxiosPromise } from "axios";
 //测试仪器配置分页查询
 export function instrumentConfigPage(queryParams?: object): AxiosPromise<any> {
   return request({
-    url: "/api/v1/instrumentConfig/page",
+    url: "/api/v1/test/engrInstrumentConfig/page",
     method: "post",
     data: queryParams,
   });

+ 4 - 0
src/views/modules/global-config/global-config.vue

@@ -265,6 +265,10 @@ const globalHandledel = (index: number, row: any) => {
           </div>
         </div>
       </el-tab-pane>
+      <el-tab-pane label="执行终端" name="执行终端"
+        >跟仪器配置一样只是 instrumentProperty 仪器属性(1工程仪器 2执行仪器)
+        仪器类型是字典要选择</el-tab-pane
+      >
     </el-tabs>
 
     <configAddVue ref="configChildRef" @save="configSaveFun"></configAddVue>

+ 2 - 0
src/views/modules/project-config/configs/properites.ts

@@ -31,6 +31,8 @@ export interface InforPropertyModel {
   maxValue?: string;
   inputOrOutput?: "input" | "output";
   bindValue?: string; //这个是el-form 会绑定的值
+  bindCode?: string; //  //编号
+  bindLabel?: string; //这个是el-mention 会绑定的值 然后将id给 bindCode
 }
 
 interface HJNodeData2 {

+ 44 - 3
src/views/modules/project-config/project-config.vue

@@ -89,9 +89,39 @@ const getFlowData = () => {
 };
 
 //选择测试项目相关  每次点击需要重新获取中间的流程的数据
-const onSelectTestPro = (pro) => {
+const onSelectTestPro = () => {
   getFlowData();
 };
+
+// 全局变量和仪器列表选择相关
+const configData: Record<string, any[]> = {
+  "@": [
+    {
+      label: "Fuphoenixes",
+      value: "Fuphoenixes",
+      id: "111",
+    },
+    {
+      label: "kooriookami",
+      value: "222",
+    },
+  ],
+  "#": [
+    {
+      label: "Fuphoenixes",
+      value: "333",
+    },
+    {
+      label: "kooriookami",
+      value: "444",
+    },
+  ],
+};
+const configOptions = ref([]);
+
+const handleSearch = (_: string, prefix: string) => {
+  configOptions.value = configData[prefix] || [];
+};
 </script>
 
 <template>
@@ -111,7 +141,7 @@ const onSelectTestPro = (pro) => {
       <TitleHeader>属性配置</TitleHeader>
       <div class="form-box" v-if="infoVisible">
         <el-form rer="formRef" label-position="top">
-          <el-form-item label="唯一名称">
+          <el-form-item label="节点标识名称">
             <el-input
               v-model="selectedNode!.data.information.nodeName"
             ></el-input>
@@ -121,7 +151,18 @@ const onSelectTestPro = (pro) => {
             :label="property.proName"
             :key="property.proName"
           >
-            <el-input v-model="property.bindValue"></el-input>
+            <el-mention
+              v-model="property.bindLabel"
+              :options="configOptions"
+              :prefix="['@', '#']"
+              whole
+              @search="handleSearch"
+              @select="
+                (opt) => {
+                  property.bindCode = opt.code;
+                }
+              "
+            />
           </el-form-item>
         </el-form>
       </div>