修改bug 56576 资料中心 新增 附件上传了 但是提示不能为空

56558 左侧树状图点击标准新闻,然后点击新增,输入信息以及上传附件信息,提交 程序异常
This commit is contained in:
hanshaozhuang
2022-07-15 13:54:38 +08:00
parent ffe0156cb2
commit 8a9d689e18
@@ -247,6 +247,25 @@
label-width="130px"
v-if="showInfoModal"
>
<el-form-item label="所属目录" prop="treeId" class="add-form-item">
<el-select ref="treeSelect" class="tree-select" v-model="attributeEO.treeId" value-key="id" placeholder="请选择所属目录">
<el-option class="tree-select-option" :value="attributeEO.treeId" :label="attributeEO.treeName">
<el-tree
ref="tree"
node-key="id"
class="tree-line"
icon-class="icon-tree"
:indent="0"
:props="props"
:data="treeList"
:default-expanded-keys="['1']"
highlight-current
@node-click="selectTreeClick"
:filter-node-method="filterNode">
</el-tree>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="类型"
prop="dataType"
@@ -363,8 +382,13 @@ export default {
dataTitle: '',
dataExplain: '',
attachFileId: '',
treeId: '',
treeName: ''
},
attributeEOFormRules: {
treeId: [
{required: true, message: '所属目录不能为空', trigger: 'change'},
],
dataType: [
{required: true, message: '类型不能为空', trigger: 'change'},
],
@@ -462,8 +486,15 @@ export default {
treeClick(treeNode) {
this.selectSarMenu = treeNode
this.dataCenterSearch.treeId = treeNode.id === '1' ? '' : treeNode.id
this.attributeEO.treeId = treeNode.id === '1' ? '' : treeNode.id
this.attributeEO.treeName = treeNode.name
this.searchInfo()
},
selectTreeClick(treeNode) {
this.dataCenterSearch.treeId = treeNode.id === '1' ? '' : treeNode.id
this.attributeEO.treeId = treeNode.id === '1' ? '' : treeNode.id
this.attributeEO.treeName = treeNode.name
},
// 树节点鼠标移入移出
mouseenter(data) {
if (data.name !== '我的收藏') {
@@ -706,7 +737,8 @@ export default {
dataType: '',
dataTitle: '',
attachFileId: '',
treeId: this.selectSarMenu.id
treeId: this.selectSarMenu ? this.selectSarMenu.id : this.treeList[0].id,
treeName: this.selectSarMenu ? this.selectSarMenu.name : this.treeList[0].name
}
this.fileList = []
},
@@ -743,7 +775,7 @@ export default {
saveInfo() {
this.submitLoading = true
this.$refs['attributeEO'].validate((valid) => {
if (valid && this.attributeEO.attachFileId !== '') {
if (valid) {
if (this.attributeTitle === '新增'){
this.$http.postData(
'fileMaterialCenter/file-material',
@@ -777,9 +809,7 @@ export default {
}
)
}
} else {
this.$message.error('附件不能为空')
}else{
this.submitLoading = false
}
})
@@ -792,6 +822,8 @@ export default {
dataType: '',
dataTitle: '',
attachFileId: '',
treeId: '',
treeName: ''
}
})
this.showInfoModal = false
@@ -1013,4 +1045,14 @@ export default {
overflow-y: auto;
}
}
.tree-select{
.el-select-dropdown__item{
height: auto;
line-height: normal;
}
}
.tree-select-option{
height: auto;
padding: 0;
}
</style>