应用资源关联组件、项目等弹窗名称修改

This commit is contained in:
kongjun 2022-06-24 18:12:36 +08:00
parent 6e0b7d3e88
commit 31eee8d607
2 changed files with 53 additions and 43 deletions

View File

@ -14,10 +14,10 @@
filterable
:filter-method="filterMethod"
filter-placeholder="请输入应用名称"
:titles="['未关联应用名称', '已关联应用名称']"
:titles="nameArray"
:props="{
key: 'id',
label: 'name'
label: 'name',
}"
:data="transferData"
></el-transfer>
@ -33,65 +33,71 @@
</template>
<script>
import debounce from 'lodash/debounce'
import debounce from "lodash/debounce";
export default {
components: {
},
data () {
components: {},
data() {
return {
showKey: 0,
visible: true,
transferData: [], //穿
transferValue: [], //id
}
};
},
props: {
relateInfo: {
type: Object,
default: {}
}
},
computed: {
default: {},
},
nameArray: {
type: Array,
default: ["未关联应用名称", "已关联应用名称"],
},
},
computed: {},
methods: {
close () {
this.$emit('isShowRelatePopup', false)
close() {
this.$emit("isShowRelatePopup", false);
},
//
confirmSubmitHandle: debounce(
function () {
this.$http.post('/dataResourceRel/saveDataResourceRel', {
linkType: this.relateInfo.linkType || 2,
id: this.relateInfo.id,
referenceIds: this.transferValue
}).then(({ data: res }) => {
if(res.code == 0) {
this.$message.success('关联成功!')
} else {
this.$message.error('关联失败,请联系管理员!')
}
this.$emit('isShowRelatePopup', false);
}).catch(() => { })
this.$http
.post("/dataResourceRel/saveDataResourceRel", {
linkType: this.relateInfo.linkType || 2,
id: this.relateInfo.id,
referenceIds: this.transferValue,
})
.then(({ data: res }) => {
if (res.code == 0) {
this.$message.success("关联成功!");
} else {
this.$message.error("关联失败,请联系管理员!");
}
this.$emit("isShowRelatePopup", false);
})
.catch(() => {});
},
1000,
{ leading: true, trailing: false }
),
filterMethod(query, item) {
return item.name && item.name.indexOf(query) > -1;
},
},
mounted() {
if (this.relateInfo && this.relateInfo.responseData) {
const alreadLinkedArr = this.relateInfo.responseData.alreadLinked || [];
this.transferData = alreadLinkedArr.concat(
this.relateInfo.responseData.notLinked || []
);
alreadLinkedArr.length &&
alreadLinkedArr.forEach((item) => {
this.transferValue.push(item.id);
});
}
},
mounted () {
if(this.relateInfo && this.relateInfo.responseData) {
const alreadLinkedArr = this.relateInfo.responseData.alreadLinked || [];
this.transferData = alreadLinkedArr.concat(this.relateInfo.responseData.notLinked || []);
alreadLinkedArr.length && alreadLinkedArr.forEach(item => {
this.transferValue.push(item.id);
});
}
}
}
};
</script>
<style lang="scss" scoped>
@ -125,5 +131,4 @@ export default {
height: calc(100% - 102px);
}
}
</style>

View File

@ -149,6 +149,7 @@
v-if="relateApplicationResourceVisible"
ref="relateApplication"
:relateInfo="relationData"
:nameArray="topNameArray"
@isShowRelatePopup="handleIsShowRelatePopupApply"
></relate-application>
</div>
@ -187,6 +188,7 @@ export default {
qp: false,
relateApplicationResourceVisible: false,
relationData: {}, //穿
topNameArray: [], //
};
},
watch: {},
@ -371,6 +373,7 @@ export default {
linkType: "1",
responseData: res.data,
};
this.topNameArray = ["未关联组件名称", "已关联组件名称"];
console.log(" this.relationData", this.relationData);
//
});
@ -402,6 +405,7 @@ export default {
linkType: "1",
responseData: res.data,
};
this.topNameArray = ["未关联项目名称", "已关联项目名称"];
//
});
},
@ -428,6 +432,7 @@ export default {
linkType: "1",
responseData: res.data,
};
this.topNameArray = ["未关联基础设施名称", "已关联基础设施名称"];
//
});
},