Browse Source

修复部分bug

master
rose 4 years ago
parent
commit
b76b1a9dff
  1. 2
      src/views/College/components/CollegeDate.vue
  2. 41
      src/views/College/components/CollegeEdit.vue

2
src/views/College/components/CollegeDate.vue

@ -17,7 +17,7 @@
</template>
<template slot="coverPicture" slot-scope="text, record">
<img :src="record.coverPicture" width="50" height="50" />
<img :src="record.picUrl" width="50" height="50" />
</template>
<template slot="type" slot-scope="text, record">

41
src/views/College/components/CollegeEdit.vue

@ -10,7 +10,6 @@
v-model="editVisible"
width="700px"
>
<div>{{ editData }}</div>
<a-form :form="form" @submit="handleSubmit">
<!-- 标题 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="标题">
@ -81,8 +80,16 @@
</a-upload>
</a-form-item>
<!-- 时间 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="时间">
<a-date-picker :default-value="editData.times" class="ml-3" @change="changeBirthday" show-time />
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="时间"
>
<a-date-picker class="ml-3"
v-decorator="[ 'times', { initialValue: times }, ]"
show-time
/>
<!-- <a-date-picker class="ml-3" show-time /> -->
</a-form-item>
<!-- 类型 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="类型">
@ -104,8 +111,14 @@
</a-form-item>
<!-- 栏目 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="栏目">
<a-checkbox-group class="ml-3" @change="onChangeBan">
<a-checkbox class="my-2" v-for="(item, index) in bannersList" :key="index" :value="item.moldId">{{ item.moldName }}</a-checkbox>
<a-checkbox-group class="ml-3"
v-decorator="[ 'banner', { initialValue:banner, }, ]"
>
<a-checkbox
class="my-2"
v-for="(item, index) in bannersList" :key="index"
:value="item.moldId"
>{{ item.moldName }}</a-checkbox>
</a-checkbox-group>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
@ -170,8 +183,9 @@ export default {
this.times = this.editData.times
this.type = this.editData.type
this.whetherShow = this.editData.whetherShow
this.banner = this.editData.moldIds
this.fileList.push(this.editData.coverPicture)
console.log("======>collegeEdit",this.data)
console.log("======>collegeEdit")
},
methods: {
@ -181,13 +195,9 @@ export default {
this.fileList = []
this.editData.picUrl = ''
},
changeBirthday(date, dateString) {
// console.log(this.$moment(date._e).format('YYYY-MM-DD HH:mm:ss'));
this.times = this.$moment(date._e).format('YYYY-MM-DD HH:mm:ss');
},
onChangeBan(e) {
this.banner = e;
console.log(this.banner)
changeTime(e){
return this.$moment(e).format('YYYY-MM-DD HH:mm:ss');
},
//
handleChange(info) {
@ -221,15 +231,14 @@ export default {
if (this.fileList.length > 0 || this.editData.picUrl) {
try {
console.log("handleSubmit",values)
this.picId = this.fileList[0];
const params = {
param: {
academyId: this.editData.academyId,
banners: this.banner,
banners: values.banner,
contentUrl: values.contentUrl,
coverPicture: this.fileList[0] || this.editData.coverPicture,
intro: values.intro,
times: this.times,
times: this.changeTime(values.times._d),
title: values.title,
type: values.type,
whetherShow: values.whetherShow,

Loading…
Cancel
Save