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

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

View File

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