diff --git a/sgzb-ui/src/views/repairTest/repair/dialogThreeForm.vue b/sgzb-ui/src/views/repairTest/repair/dialogThreeForm.vue index d5f4a159..66c266be 100644 --- a/sgzb-ui/src/views/repairTest/repair/dialogThreeForm.vue +++ b/sgzb-ui/src/views/repairTest/repair/dialogThreeForm.vue @@ -200,7 +200,8 @@ export default { }, data() { return { - actionUrl: process.env.VUE_APP_BASE_API + '/sgzb-system/sys/file/upload', + // actionUrl: process.env.VUE_APP_BASE_API + '/sgzb-system/sys/file/upload', + actionUrl: process.env.VUE_APP_BASE_API + '/system/sys/file/upload', // uploadTip: '只能上传jpg/png文件,且不超过500kb', fileIds: [], fileList: [], @@ -239,7 +240,7 @@ export default { this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); }, beforeRemove(file, fileList) { - return this.$confirm(`确定移除 ${file.name}?`); + // return this.$confirm(`确定移除 ${file.name}?`); }, handleSuccess(response, fileList) { this.fileList = fileList diff --git a/sgzb-ui/src/views/repairTest/repair/selectTree.vue b/sgzb-ui/src/views/repairTest/repair/selectTree.vue index f0013705..7e82c25c 100644 --- a/sgzb-ui/src/views/repairTest/repair/selectTree.vue +++ b/sgzb-ui/src/views/repairTest/repair/selectTree.vue @@ -77,8 +77,14 @@ export default { } }, watch: { - clearable(val) { - console.log('val', val); + // clearable(val) { + // console.log('val-----', val); + // }, + clearable: { + handler: function(val,old) { + }, + // 立即以obj.name的当前值触发回调 + immediate: true }, filterText(val) { this.$refs.selectTree.filter(val) @@ -187,18 +193,22 @@ export default { color: #666666; pointer-events: none; } + .el-input.is-focus { .el-icon- { transform: rotate(0deg); } } + .el-input__inner { height: 36px; line-height: 36px; } + .el-input__icon { line-height: 36px; } + .el-tree-node__content { height: 32px; } diff --git a/sgzb-ui/src/views/repairTest/repair/upload.vue b/sgzb-ui/src/views/repairTest/repair/upload.vue index dd1c00fc..69603561 100644 --- a/sgzb-ui/src/views/repairTest/repair/upload.vue +++ b/sgzb-ui/src/views/repairTest/repair/upload.vue @@ -11,6 +11,8 @@ :file-list="fileList" :headers="headers" :on-success="handleSuccess" + :data="uploadData" + :before-upload="beforeUpload" > 点击上传 @@ -51,6 +53,9 @@ export default { headers: { Authorization: "Bearer " + getToken(), }, + uploadData: { + type: "sx" + }, } }, methods: { @@ -71,6 +76,18 @@ export default { return this.$confirm(`确定移除 ${file.name} ?`).then(() => { this.$emit('before-remove', file, fileList); }).catch(() => { }); + }, + beforeUpload(file) { + console.log('file', file); + const isJPGorPNG = file.type == 'image/png' || file.type == 'image/jpg' || file.type == 'image/jpeg'; + const isLt5M = file.size / 1024 / 1024 < 2; // 小于2MB + if (!isJPGorPNG) { + this.$message.error('只能上传 JPG/PNG/jpeg 格式的图片'); + } + if (!isLt5M) { + this.$message.error('上传图片大小不能超过 2MB'); + } + return isJPGorPNG && isLt5M; } } };