BUG修改

This commit is contained in:
a0049873 2023-01-10 14:08:47 +08:00
parent bc5ee885e0
commit ea66cc2228
2 changed files with 101 additions and 69 deletions

View File

@ -373,7 +373,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
for (const key in this.refsParseArray) { for (const key in this.refsParseArray) {
console.log('11111111111', data) console.log('11111111111', data)
this.$refs[key] && this.$refs[key].getDataInfo && this.$refs[key].getDataInfo(data) this.$refs[key] && this.$refs[key].IntegratedServicesGetDataInfo && this.$refs[key].IntegratedServicesGetDataInfo(data)
} }
const _imgObj = data.fuseAttrList.find(v => v.attrType == '服务图片') || {} const _imgObj = data.fuseAttrList.find(v => v.attrType == '服务图片') || {}
this.imageUrl = _imgObj.attrValue this.imageUrl = _imgObj.attrValue
@ -387,7 +387,7 @@ export default {
// }) // })
// console.log('2', arr2) // console.log('2', arr2)
// this.abilityListObj[k] = arr2 // this.abilityListObj[k] = arr2
this.$refs['abilityAdd' + (index + 1)].getDataInfo(data) this.$refs['abilityAdd' + (index + 1)].IntegratedServicesGetDataInfo(data)
}) })
console.log('this.dataForm----详情-------->', this.dataForm) console.log('this.dataForm----详情-------->', this.dataForm)

View File

@ -63,7 +63,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-popconfirm <el-popconfirm
confirm-button-text="确认" confirm-button-text="确认"
cancel-button-text="不用了" cancel-button-text="取消"
icon="el-icon-info" icon="el-icon-info"
icon-color="red" icon-color="red"
title="确定删除该实例数据吗?" title="确定删除该实例数据吗?"
@ -86,117 +86,149 @@ export default {
props: { props: {
dataForm: { dataForm: {
type: Object, type: Object,
default: () => {}, default: () => {}
}, },
title: { title: {
type: String, type: String,
default: "", default: ''
}, },
typeList: { typeList: {
type: Array, type: Array,
default: () => [], default: () => []
}, }
}, },
watch: { watch: {
dataInfo: { dataInfo: {
handler(newVal) { handler (newVal) {
this.dataInfo = newVal; this.dataInfo = newVal
this.$emit("update", { this.$emit('update', {
title: this.title, title: this.title,
list: newVal, list: newVal
}); })
}, },
deep: true, deep: true,
immediate: true, immediate: true
}, },
count: { count: {
handler(newVal) { handler (newVal) {
this.count = newVal; this.count = newVal
this.$emit("updateCount", { this.$emit('updateCount', {
title: this.title, title: this.title,
count: newVal, count: newVal
}); })
}, },
deep: true, deep: true,
immediate: true, immediate: true
}
}, },
}, data () {
data() {
return { return {
count: "", count: '',
dataInfo: [], dataInfo: []
}; }
}, },
methods: { methods: {
addBaseInfo() { addBaseInfo () {
let data = { const data = {
name: "", name: '',
type: "", type: '',
dept: "", dept: ''
}; }
this.dataInfo.push(data); this.dataInfo.push(data)
}, },
handleDelete(row) { handleDelete (row) {
this.dataInfo.splice(row, 1); this.dataInfo.splice(row, 1)
}, },
getDataInfo(dataForm) { getDataInfo (dataForm) {
let arr = []; let arr = []
if (dataForm && (dataForm.id || dataForm.id === 0)) { if (dataForm && (dataForm.id || dataForm.id === 0)) {
if (this.title === "基础设施") { if (this.title === '基础设施') {
this.count = dataForm.infrastructureCount; this.count = dataForm.infrastructureCount
} }
if (this.title === "组件服务") { if (this.title === '组件服务') {
this.count = dataForm.componentCount; this.count = dataForm.componentCount
} }
if (this.title === "数据资源") { if (this.title === '数据资源') {
this.count = dataForm.dataSourceCount; this.count = dataForm.dataSourceCount
} }
let fuseAttrList = dataForm.fuseAttrList || []; const fuseAttrList = dataForm.fuseAttrList || []
let obj = fuseAttrList.find((v) => v.attrType === this.title) || {}; const obj = fuseAttrList.find((v) => v.attrType === this.title) || {}
let attrValue = JSON.parse(obj.attrValue || "[]"); const attrValue = JSON.parse(obj.attrValue || '[]')
if (attrValue.length > 0) { if (attrValue.length > 0) {
attrValue.map((v) => { attrValue.map((v) => {
arr.push(v); arr.push(v)
}); })
} else { } else {
arr = []; arr = []
} }
} else { } else {
arr = []; arr = []
} }
this.dataInfo = arr; this.dataInfo = arr
},
IntegratedServicesGetDataInfo (dataForm) {
let arr = []
if (dataForm && (dataForm.id || dataForm.id === 0)) {
if (this.title === '基础设施') {
this.count = dataForm.infrastructureCount
}
if (this.title === '组件服务') {
this.count = dataForm.componentCount
}
if (this.title === '数据资源') {
this.count = dataForm.dataSourceCount
}
const fuseAttrList = dataForm.fuseResourceList || []
const obj = fuseAttrList.filter((v) => v.type === this.title)
console.log('回显数据=======>', obj)
if (obj.length > 0) {
obj.map((v) => {
v.name = v.resourceName
v.dept = v.deptName
v.type = v.typeSecond
arr.push(v)
})
} else {
arr = []
}
} else {
arr = []
}
this.dataInfo = arr
}, },
// //
addItem() { addItem () {
let index = this.dataInfo.length - 1; const index = this.dataInfo.length - 1
if (this.dataInfo[index][this.keyTextObj.descObj.key] === "") { if (this.dataInfo[index][this.keyTextObj.descObj.key] === '') {
return this.$message.warning("请填写完整信息!"); return this.$message.warning('请填写完整信息!')
} }
this.dataInfo.push({ this.dataInfo.push({
[this.keyTextObj.descObj.key]: "", [this.keyTextObj.descObj.key]: ''
}); })
}, },
// //
deleteItem(index) { deleteItem (index) {
this.$confirm("确认是否删除?", "提示", { this.$confirm('确认是否删除?', '提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning'
}) })
.then(() => { .then(() => {
this.$message({ this.$message({
type: "success", type: 'success',
message: "删除成功!", message: '删除成功!'
});
this.dataInfo.splice(index, 1);
}) })
.catch(() => {}); this.dataInfo.splice(index, 1)
}, })
}, .catch(() => {})
}; }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .el-table thead { ::v-deep .el-table thead {