master
lion 8 months ago
parent 966d8fe905
commit 9ad990ab97

@ -22,27 +22,17 @@
style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:is_visible>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Visible
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.is_visible">
<el-radio :label="1">Yes</el-radio>
<el-radio :label="0">No</el-radio>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:description>
<template v-slot:is_visible>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Description
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Visible
</div>
<div class="xy-table-item-content">
<el-input type="textarea" :rows="5" v-model="form.description"></el-input>
<el-radio-group v-model="form.is_visible">
<el-radio :label="1">Yes</el-radio>
<el-radio :label="0">No</el-radio>
</el-radio-group>
</div>
</div>
</template>
@ -52,24 +42,37 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Poster
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' list-type="picture-card"
accept=".PNG,.jpg,.jpeg,.bmp,.svg" :file-list="pictureList" ref="pictureUpload" :auto-upload="true"
:on-success="handlesuccessP" :on-remove="handleRemoveP">
<el-upload :action="action" class='upload-demo' list-type="picture-card" accept=".PNG,.jpg,.jpeg,.bmp,.svg"
:file-list="pictureList" ref="pictureUpload" :auto-upload="true" :on-success="handlesuccessP"
:on-remove="handleRemoveP">
<i class="el-icon-plus"></i>
</el-upload>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Content
</div>
<div class="xy-table-item-content">
<my-tinymce v-if="showWang" :id="'content'"
@input="(e)=>{changeEditor(e,'content')}" :value="form.content"></my-tinymce>
</div>
</div>
</template>
<template v-slot:description>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Description
</div>
<div class="xy-table-item-content">
<!-- <el-input type="textarea" :rows="5" v-model="form.description"></el-input> -->
<my-tinymce v-if="showWang" :id="'description'" @input="(e)=>{changeEditor(e,'description')}"
:value="form.description"></my-tinymce>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Content
</div>
<div class="xy-table-item-content">
<my-tinymce v-if="showWang" :id="'content'" @input="(e)=>{changeEditor(e,'content')}"
:value="form.content"></my-tinymce>
</div>
</div>
</template>
</xy-dialog>
</div>
@ -89,7 +92,7 @@
},
data() {
return {
isShow: false,
isShow: false,
showWang: false,
type: 'add',
id: '',
@ -101,11 +104,12 @@
pictureList: [],
form: {
title: '',
sort: 0,
is_visible:1,
description: '',
file_ids:[],
content:''
sort: 0,
is_visible: 1,
file_ids: [],
description: '',
content: ''
},
rules: {
title: [{
@ -116,7 +120,7 @@
}
},
created() {
this.uploadOther.token = getToken();
this.uploadOther.token = getToken();
},
methods: {
handleRemoveP(file, fileList) {
@ -129,10 +133,10 @@
return
}
this.pictureList = fileList
},
changeEditor(e, type) {
this.form[type] = e
},
changeEditor(e, type) {
this.form[type] = e
},
submit() {
if (this.id) {
@ -173,19 +177,19 @@
// show_relation: ['picture'],
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.description = res.description ? res.description : ''
this.form.content = res.content?res.content:''
this.form.is_visible = res.is_visible?res.is_visible:0
this.form.sort = res.sort?res.sort:0
this.form.description = res.description ? res.description : ''
this.form.content = res.content ? res.content : ''
this.form.is_visible = res.is_visible ? res.is_visible : 0
this.form.sort = res.sort ? res.sort : 0
this.showWang = true
if (res.files) {
let _arr = []
res.files.map(item=>{
_arr.push({
name: item.original_name,
id: item.id,
url: item.url
})
if (res.files) {
let _arr = []
res.files.map(item => {
_arr.push({
name: item.original_name,
id: item.id,
url: item.url
})
})
this.pictureList = _arr
}
@ -197,21 +201,22 @@
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}else{
this.showWang = true
} else {
this.showWang = true
}
} else {
this.id = ''
this.type = "add"
this.pictureList = []
this.pictureList = []
this.showWang = false
this.form = {
title: '',
sort: 0,
is_visible:1,
sort: 0,
is_visible: 1,
file_ids: '',
description: '',
file_ids: '',
content:''
content: ''
}
this.$refs['dialog'].reset()
}
@ -224,7 +229,7 @@
<style scoped lang="scss">
::v-deep .title,
::v-deep .file_ids,
::v-deep .description,
::v-deep .description,
::v-deep .content {
flex-basis: 100%;
}

Loading…
Cancel
Save