Browse Source

修复部分bug

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

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

@ -17,7 +17,7 @@
</template> </template>
<template slot="coverPicture" slot-scope="text, record"> <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>
<template slot="type" slot-scope="text, record"> <template slot="type" slot-scope="text, record">

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

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

Loading…
Cancel
Save