fix(环境管理): 修复环境管理环境参数查询报错&添加断言脚本复制脚本
This commit is contained in:
parent
8a8e584886
commit
cab1b4d1e0
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<conditionContent v-model:data="condition" :disabled="props.disabled" @delete="deleteItem" />
|
<conditionContent v-model:data="condition" :disabled="props.disabled" @delete="deleteItem" @copy="emit('copy')" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
@ -26,6 +26,7 @@
|
||||||
(e: 'change', val: ScriptItem): void; // 数据发生变化
|
(e: 'change', val: ScriptItem): void; // 数据发生变化
|
||||||
(e: 'update:data'): void; // 数据发生变化
|
(e: 'update:data'): void; // 数据发生变化
|
||||||
(e: 'deleteScriptItem', id: string | number): void; // 删除脚本
|
(e: 'deleteScriptItem', id: string | number): void; // 删除脚本
|
||||||
|
(e: 'copy'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const condition = useVModel(props, 'data', emit);
|
const condition = useVModel(props, 'data', emit);
|
||||||
|
@ -52,4 +53,4 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|
|
@ -133,6 +133,7 @@
|
||||||
:disabled="props.disabled"
|
:disabled="props.disabled"
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
@delete-script-item="deleteScriptItem"
|
@delete-script-item="deleteScriptItem"
|
||||||
|
@copy="copyItem"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -411,6 +412,12 @@
|
||||||
activeKey.value = item.id;
|
activeKey.value = item.id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function copyItem() {
|
||||||
|
const tmpObj = { ...cloneDeep(getCurrentItemState.value), id: new Date().getTime().valueOf().toString() };
|
||||||
|
assertions.value.push(tmpObj);
|
||||||
|
activeKey.value = tmpObj.id;
|
||||||
|
}
|
||||||
|
|
||||||
const handleChange = (val: any) => {
|
const handleChange = (val: any) => {
|
||||||
switch (val.assertionType) {
|
switch (val.assertionType) {
|
||||||
case ResponseAssertionType.RESPONSE_HEADER:
|
case ResponseAssertionType.RESPONSE_HEADER:
|
||||||
|
|
|
@ -7,12 +7,8 @@
|
||||||
class="w-[240px]"
|
class="w-[240px]"
|
||||||
@search="handleSearch"
|
@search="handleSearch"
|
||||||
@press-enter="handleSearch"
|
@press-enter="handleSearch"
|
||||||
|
@clear="handleSearch"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
|
||||||
<span class="arco-icon-hover">
|
|
||||||
<icon-search class="cursor-pointer" @click="handleSearch" />
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</a-input-search>
|
</a-input-search>
|
||||||
<batchAddKeyVal
|
<batchAddKeyVal
|
||||||
:add-type-text="t('project.environmental.env.constantBatchAddTip')"
|
:add-type-text="t('project.environmental.env.constantBatchAddTip')"
|
||||||
|
@ -172,7 +168,7 @@
|
||||||
innerParams.value = [...backupParams.value];
|
innerParams.value = [...backupParams.value];
|
||||||
} else {
|
} else {
|
||||||
const result = backupParams.value.filter(
|
const result = backupParams.value.filter(
|
||||||
(item) => item.key.includes(searchValue.value) || item.tags.includes(searchValue.value)
|
(item) => item.key?.includes(searchValue.value) || (item.tags || []).includes(searchValue.value)
|
||||||
);
|
);
|
||||||
innerParams.value = [...result];
|
innerParams.value = [...result];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue