-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+ 复制
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
diff --git a/frontend/src/views/machine/testScript/components/testScriptPopup.vue b/frontend/src/views/machine/testScript/components/testScriptPopup.vue
index 52b07bd..a187d01 100644
--- a/frontend/src/views/machine/testScript/components/testScriptPopup.vue
+++ b/frontend/src/views/machine/testScript/components/testScriptPopup.vue
@@ -7,6 +7,7 @@
width="1400px">
+ 基础信息
@@ -20,23 +21,14 @@
placeholder="请选择标准推行年份"
/>
-
-
-
-
-
-
+
取 消
- 保存
+ 保存脚本
+ 脚本另存为
@@ -49,9 +41,11 @@ import { computed, ref } from 'vue'
import { useDictStore } from '@/stores/modules/dict'
import TestScriptDetail from '@/views/machine/testScript/components/testScriptDetail.vue';
import { type TestScript } from '@/api/device/interface/testScript';
-
+import type { Dict } from '@/api/system/dictionary/interface';
+import {getDictTreeList} from '@/api/system/dictionary/dictTree'
+import type { CascaderOption } from 'element-plus';
const modeId = ref()
-
+const secondLevelOptions: any[] = [];
// 定义弹出组件元信息
const dialogFormRef = ref()
@@ -108,19 +102,52 @@ const dictStore = useDictStore()
// 打开弹窗,可能是新增,也可能是编辑
-const open = (sign: string,row: any,currentMode: string) => {
+const open = async (sign: string,row: any,currentMode: string,id:string) => {
+ const dictCode = '测试脚本字典表'; // 替换为实际需要的字典代码
+ const resDictTree: Dict.ResDictTree = {
+ name: dictCode,
+ id: '',
+ pid: '',
+ pids: '',
+ code: '',
+ sort: 0
+ };
+ const result = await getDictTreeList(resDictTree);
+ //allOptions.value = convertToOptions(result.data as Dict.ResDictTree[]);
+ const allOptions = convertToOptions(result.data as Dict.ResDictTree[]);
+ // 提取第二层节点
+ allOptions.forEach(option => {
+ if (option.children && option.children.length > 0) {
+ secondLevelOptions.push(...option.children);
+ }
+ });
+
+ console.log('secondLevelOptions',secondLevelOptions);
+
+ if(id != ''){//新增的时候才会重新赋值值类型
+ formContent.value.valueType = id
+ }
titleType.value = sign
modeId.value = dictStore.getDictData('Pattern').find(item => item.name === currentMode)?.id;
+
+
// 重置表单
dialogFormRef.value?.resetFields()
dialogVisible.value = true
}
+
+ // 转换函数
+ const convertToOptions = (dictTree: Dict.ResDictTree[]): CascaderOption[] => {
+ return dictTree.map(item => ({
+ value: item.id,
+ label: item.name,
+ children: item.children ? convertToOptions(item.children) : undefined
+ }));
+ };
// 对外映射
defineExpose({ open })
-const props = defineProps<{
- refreshTable: (() => Promise
) | undefined;
-}>()
+
diff --git a/frontend/src/views/machine/testScript/components/valueTypePopup.vue b/frontend/src/views/machine/testScript/components/valueTypePopup.vue
new file mode 100644
index 0000000..f277f57
--- /dev/null
+++ b/frontend/src/views/machine/testScript/components/valueTypePopup.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取 消
+ 新增
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/views/machine/testScript/index.vue b/frontend/src/views/machine/testScript/index.vue
index 8bc865a..a75d8f4 100644
--- a/frontend/src/views/machine/testScript/index.vue
+++ b/frontend/src/views/machine/testScript/index.vue
@@ -23,8 +23,9 @@
-