|
@@ -21,7 +21,6 @@
|
|
|
<el-upload
|
|
|
class="image-uploader"
|
|
|
:multiple="false"
|
|
|
- :before-upload="beforeUpload"
|
|
|
:drag="true"
|
|
|
action=""
|
|
|
:limit="1"
|
|
@@ -39,7 +38,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { upLoad } from '@/api/schoolTimetable'
|
|
|
+import { upLoad } from '@/api/schoolTimetable'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -111,18 +110,23 @@ export default {
|
|
|
const form = new FormData()
|
|
|
// 文件对象
|
|
|
form.append('file', fileObj)
|
|
|
+ for (var value of form.values()) {
|
|
|
+ console.log(value)
|
|
|
+ this.ruleForm.file = value
|
|
|
+ }
|
|
|
// form.append('comId', this.comId)
|
|
|
- console.log('-----', form)
|
|
|
- this.ruleForm.file = form
|
|
|
+ // console.log((JSON.stringify(fileObj))
|
|
|
+ // console.log(JSON.stringify(form.get('file')))
|
|
|
+ // this.ruleForm.file = value
|
|
|
},
|
|
|
submitForm(formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
console.log(this.ruleForm)
|
|
|
// alert('submit!')
|
|
|
- // upLoad().then(res => {
|
|
|
- // console.log(res)
|
|
|
- // })
|
|
|
+ upLoad(this.ruleForm).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
} else {
|
|
|
console.log('error submit!!')
|
|
|
return false
|