提交代码

This commit is contained in:
gongjiale 2023-01-10 12:09:53 +08:00
parent 31f3c10abb
commit 3906b9ea0f
3 changed files with 72 additions and 73 deletions

View File

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

View File

@ -177,6 +177,7 @@ export default {
},
//
addServe () {
debugger
// this.addOrUpdateVisible = true
this.modalType = 'add'
if (this.choose === 0) {

View File

@ -297,7 +297,7 @@
const returnType = router.currentRoute.value.query.type
const districtType = router.currentRoute.value.query.districtType
const hiddenBackFlag = router.currentRoute.value.query.hiddenBackFlag
const imgSrcYyzy = ref(require('@/assets/newHome/empty.png'))
const imgSrcYyzy = ref(require('@/assets/home/fn/cjtd.png'))
document.documentElement.style.transition = 'all 0.3s ease'
document.documentElement.scrollTop = 0
document.body.style.transition = 'all 0.3s ease'