fix(项目管理): 修复环境变量按应用场景筛选点击无响应的缺陷

--bug=1034504 --user=王孝刚 【项目设置】创建/编辑环境-通用配置-按应用场景筛选点击无响应 https://www.tapd.cn/55049933/s/1453083
This commit is contained in:
wxg0103 2024-01-22 19:40:31 +08:00 committed by wxg0103
parent 352e466a30
commit e5e612c8c0
1 changed files with 10 additions and 1 deletions

View File

@ -332,7 +332,7 @@ export default {
watch: { watch: {
items: { items: {
handler(v) { handler(v) {
if (!this.selectVariable) { if (this.needInitData()) {
this.initData(v); this.initData(v);
} }
}, },
@ -341,6 +341,15 @@ export default {
}, },
}, },
methods: { methods: {
needInitData() {
if (this.selectVariable) {
return false;
}
if (this.condition.filters && this.condition.filters.scope && this.condition.filters.scope.length > 0) {
return false;
}
return true;
},
remove: function (index) { remove: function (index) {
const dataIndex = this.pageData.findIndex((d) => d.name === index.name); const dataIndex = this.pageData.findIndex((d) => d.name === index.name);
if (dataIndex !== -1) { if (dataIndex !== -1) {