mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-01 19:49:10 +08:00
fix(环境管理): 修复环境管理环境参数查询报错&添加断言脚本复制脚本
This commit is contained in:
parent
8a8e584886
commit
cab1b4d1e0
@ -1,5 +1,5 @@
|
||||
<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>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@ -26,6 +26,7 @@
|
||||
(e: 'change', val: ScriptItem): void; // 数据发生变化
|
||||
(e: 'update:data'): void; // 数据发生变化
|
||||
(e: 'deleteScriptItem', id: string | number): void; // 删除脚本
|
||||
(e: 'copy'): void;
|
||||
}>();
|
||||
|
||||
const condition = useVModel(props, 'data', emit);
|
||||
@ -52,4 +53,4 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped></style>
|
||||
|
@ -133,6 +133,7 @@
|
||||
:disabled="props.disabled"
|
||||
@change="handleChange"
|
||||
@delete-script-item="deleteScriptItem"
|
||||
@copy="copyItem"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -411,6 +412,12 @@
|
||||
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) => {
|
||||
switch (val.assertionType) {
|
||||
case ResponseAssertionType.RESPONSE_HEADER:
|
||||
|
@ -7,12 +7,8 @@
|
||||
class="w-[240px]"
|
||||
@search="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>
|
||||
<batchAddKeyVal
|
||||
:add-type-text="t('project.environmental.env.constantBatchAddTip')"
|
||||
@ -172,7 +168,7 @@
|
||||
innerParams.value = [...backupParams.value];
|
||||
} else {
|
||||
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];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user