应用资源关联组件、项目等弹窗名称修改
This commit is contained in:
parent
6e0b7d3e88
commit
31eee8d607
|
@ -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>
|
||||
|
|
|
@ -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 = ["未关联基础设施名称", "已关联基础设施名称"];
|
||||
//将数据传递给引入的组件
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue