Browse Source

修改上传图片的bug

master
rose 4 years ago
parent
commit
bffc6a99f2
  1. 2
      debug.log
  2. 2
      src/App.vue
  3. 9
      src/components/Banner/BannerAdd.vue
  4. 7
      src/components/Challenge/ChallengeAdd.vue
  5. 3
      src/components/Contact/ContactAdd.vue
  6. 3
      src/components/Course/CourseAdd.vue
  7. 9
      src/components/Development/DevelopmentAdd.vue
  8. 7
      src/components/Institute/InstituteAdd.vue
  9. 8
      src/components/Partner/PartnerAdd.vue
  10. 7
      src/components/Transfer/TransferAdd.vue
  11. 7
      src/components/innovativeService/innovativeServiceAdd.vue
  12. 3
      src/views/College/components/CollegeAdd.vue

2
debug.log

@ -1,2 +1,4 @@
[0517/095630.764:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
[0517/145027.865:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
[0519/171440.450:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
[0521/142118.231:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)

2
src/App.vue

@ -39,7 +39,7 @@ export default {
},
created() {
// //
// // //
const userId = '1218763410024566784';
const params = { userId };
this.getUserId(params);

9
src/components/Banner/BannerAdd.vue

@ -2,12 +2,12 @@
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal
:maskClosable="false"
:mask-closable="false"
@cancel="$emit('closeModal')"
destroyOnClose
destroy-on-close
footer
title="添加轮播图"
v-model="visible"
:visible="visible"
width="700px"
>
<a-form :form="form" @submit="handleSubmit">
@ -82,7 +82,7 @@
list-type="picture"
name="files"
>
<a-button v-show="fileList.length - 0 === 0">
<a-button>
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
@ -221,6 +221,7 @@ export default {
this.$emit('closeModal');
this.$emit('handleTableChange');
if (code === 200) {
this.fileList.splice(0,this.fileList.length);
this.$message.success('添加成功');
// TODO:
} else {

7
src/components/Challenge/ChallengeAdd.vue

@ -7,7 +7,7 @@
destroy-on-close
footer
title="添加服务"
v-model="visible"
:visible="visible"
width="700px"
>
<a-form :form="form" @submit="handleSubmit">
@ -99,7 +99,7 @@
list-type="picture"
name="files"
>
<a-button v-show="fileList.length - 0 === 0">
<a-button>
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
@ -211,6 +211,9 @@ export default {
const res = await saveService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.fileList.splice(0,this.fileList.length);
this.orders = ''
console.log("清空了数组===>",this.fileList)
this.$emit('handleTableChange');
this.$emit('closeModal');
this.$message.success('添加成功');

3
src/components/Contact/ContactAdd.vue

@ -175,7 +175,7 @@
},
]"
>
<a-button v-show="fileList.length - 0 === 0">
<a-button>
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
@ -306,6 +306,7 @@ export default {
const { data, msg, code } = res.data;
//
if (code === 200) {
this.fileList.splice(0,this.fileList.length);
this.$message.success('添加成功');
this.$emit('handleTableChange');
} else {

3
src/components/Course/CourseAdd.vue

@ -99,7 +99,7 @@
list-type="picture"
name="files"
>
<a-button v-show="fileList.length - 0 === 0">
<a-button>
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
@ -211,6 +211,7 @@ export default {
const res = await saveService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.fileList.splice(0,this.fileList.length);
this.$emit('handleTableChange');
this.$emit('closeModal');
this.$message.success('添加成功');

9
src/components/Development/DevelopmentAdd.vue

@ -2,9 +2,9 @@
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal
:maskClosable="false"
:mask-closable="false"
@cancel="$emit('closeModal')"
destroyOnClose
destroy-on-close
footer
title="添加成果"
v-model="visible"
@ -359,7 +359,7 @@
},
]"
>
<a-button v-show="fileList.length - 0 === 0">
<a-button>
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
@ -508,9 +508,9 @@ const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: 'DevelopmentAdd',
props: { visible: { type: Boolean, default: false }, typeLists: { type: Array, default: () => [] } },
components: { QuillEditor },
mixins: [addMixin],
props: { visible: { type: Boolean, default: false }, typeLists: { type: Array, default: () => [] } },
data() {
return {
formItemLayout,
@ -619,6 +619,7 @@ export default {
const { data, msg, code } = res.data;
//
if (code === 200) {
this.fileList.splice(0,this.fileList.length);
this.$message.success('添加成功');
this.$emit('handleTableChange');
} else {

7
src/components/Institute/InstituteAdd.vue

@ -2,9 +2,9 @@
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal
:maskClosable="false"
:mask-closable="false"
@cancel="$emit('closeModal')"
destroyOnClose
destroy-on-close
footer
title="添加实验室"
v-model="visible"
@ -98,7 +98,7 @@
},
]"
>
<a-button v-show="fileList.length - 0 === 0">
<a-button>
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
@ -231,6 +231,7 @@ export default {
const { data, msg, code } = res.data;
//
if (code === 200) {
this.fileList.splice(0,this.fileList.length);
this.$message.success('添加成功');
this.$emit('handleTableChange');
} else {

8
src/components/Partner/PartnerAdd.vue

@ -2,10 +2,10 @@
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal
:maskClosable="false"
:mask-closable="false"
:title="`添加${partnerOptions.type === 1 ? '合作伙伴' : '衍生企业'} `"
@cancel="$emit('closeModal')"
destroyOnClose
destroy-on-close
footer
v-model="visible"
width="700px"
@ -30,7 +30,7 @@
<!-- logo -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="公司logo" required>
<a-upload :action="upload" :before-upload="beforeUpload" @change="handleChange" list-type="picture" name="files">
<a-button v-show="fileList.length - 0 === 0"> <a-icon type="upload" />选择图片 </a-button>
<a-button> <a-icon type="upload" />选择图片 </a-button>
</a-upload>
</a-form-item>
<!-- 公司类型 -->
@ -65,8 +65,8 @@ const formItemLayout = {
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: 'PartnerAdd',
props: { visible: { type: Boolean, default: false } },
components: { QuillEditor },
props: { visible: { type: Boolean, default: false } },
data() {
return {
formItemLayout,

7
src/components/Transfer/TransferAdd.vue

@ -2,9 +2,9 @@
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal
:maskClosable="false"
:mask-closable="false"
@cancel="$emit('closeModal')"
destroyOnClose
destroy-on-close
footer
title="添加仪器"
v-model="visible"
@ -175,7 +175,7 @@
},
]"
>
<a-button v-show="fileList.length - 0 === 0">
<a-button>
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
@ -306,6 +306,7 @@ export default {
const { data, msg, code } = res.data;
//
if (code === 200) {
this.fileList = []
this.$message.success('添加成功');
this.$emit('handleTableChange');
} else {

7
src/components/innovativeService/innovativeServiceAdd.vue

@ -2,9 +2,9 @@
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal
:maskClosable="false"
:mask-closable="false"
@cancel="$emit('closeModal')"
destroyOnClose
destroy-on-close
footer
title="添加服务"
v-model="visible"
@ -99,7 +99,7 @@
list-type="picture"
name="files"
>
<a-button v-show="fileList.length - 0 === 0">
<a-button>
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
@ -211,6 +211,7 @@ export default {
const res = await saveService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.fileList.splice(0,this.fileList.length);
this.$emit('handleTableChange');
this.$emit('closeModal');
this.$message.success('添加成功');

3
src/views/College/components/CollegeAdd.vue

@ -68,7 +68,7 @@
<!-- 封面图片 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="封面图片">
<a-upload :action="upload" :before-upload="beforeUpload" @change="handleChange" class="ml-3" list-type="picture" name="files">
<a-button v-show="fileList.length - 0 === 0"> <a-icon type="upload" />选择封面图片 </a-button>
<a-button> <a-icon type="upload" />选择封面图片 </a-button>
</a-upload>
</a-form-item>
<!-- 时间 -->
@ -209,6 +209,7 @@ export default {
const res = await academySave(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.fileList.splice(0,this.fileList.length);
this.$emit('handleTableChange');
this.$emit('closeModal');
this.$message.success('添加成功');

Loading…
Cancel
Save