|
|
|
|
@ -46,7 +46,7 @@
|
|
|
|
|
<template v-slot:content>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
内容:
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>内容:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<tinymce ref="tinymce" :height="200" v-model="form.content" id='tinymce'></tinymce>
|
|
|
|
|
@ -56,7 +56,7 @@
|
|
|
|
|
<template v-slot:coverPicture>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
封面图:
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>封面图:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<div v-if="form.coverPicture" style="position: relative;">
|
|
|
|
|
@ -113,7 +113,7 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {index as typeIndex} from "@/api/strategyType"
|
|
|
|
|
import {store} from "@/api/strategy"
|
|
|
|
|
import {store,save} from "@/api/strategy"
|
|
|
|
|
import {getparameter} from '@/api/system/dictionary'
|
|
|
|
|
|
|
|
|
|
import tinymce from "@/components/Tinymce"
|
|
|
|
|
@ -129,6 +129,7 @@ export default {
|
|
|
|
|
id:'',
|
|
|
|
|
action:`${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
|
|
|
|
|
|
|
|
|
|
detail:{},
|
|
|
|
|
labels:[],
|
|
|
|
|
strategyTypes:[],
|
|
|
|
|
form:{
|
|
|
|
|
@ -147,6 +148,12 @@ export default {
|
|
|
|
|
],
|
|
|
|
|
strategyTypeId:[
|
|
|
|
|
{required:true,message:'请选择类型'}
|
|
|
|
|
],
|
|
|
|
|
coverPicture:[
|
|
|
|
|
{required:true,message:'请上传封面图'}
|
|
|
|
|
],
|
|
|
|
|
content:[
|
|
|
|
|
{required:true,message:'请填写内容'}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -170,6 +177,19 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getDetail(){
|
|
|
|
|
this.form = {
|
|
|
|
|
title:this.detail.title,
|
|
|
|
|
subheading:this.detail.subheading,
|
|
|
|
|
strategyTypeId:this.detail.strategy_types_id,
|
|
|
|
|
state:!!Number(this.detail.state),
|
|
|
|
|
coverPicture:this.detail.cover_picture,
|
|
|
|
|
sortNumber:this.detail.sort_number,
|
|
|
|
|
label:this.detail.label,
|
|
|
|
|
content:this.detail.content,
|
|
|
|
|
}
|
|
|
|
|
this.$refs['tinymce'].setContent(this.form.content)
|
|
|
|
|
},
|
|
|
|
|
async getLabel(){
|
|
|
|
|
const res = await getparameter({number:'strategyLabel'})
|
|
|
|
|
this.labels = res.detail
|
|
|
|
|
@ -197,6 +217,29 @@ export default {
|
|
|
|
|
type:'success',
|
|
|
|
|
message:'新增攻略信息成功'
|
|
|
|
|
})
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
this.isShow = false
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(this.type === 'editor'){
|
|
|
|
|
save({
|
|
|
|
|
id:this.id,
|
|
|
|
|
strategy_types_id:this.form.strategyTypeId,
|
|
|
|
|
state:this.form.state ? 1 : 0,
|
|
|
|
|
sort_number:this.form.sortNumber,
|
|
|
|
|
title:this.form.title,
|
|
|
|
|
content:this.form.content,
|
|
|
|
|
subheading:this.form.subheading,
|
|
|
|
|
label:this.form.label.toString(),
|
|
|
|
|
cover_picture:this.form.coverPicture
|
|
|
|
|
}).then(res => {
|
|
|
|
|
Message({
|
|
|
|
|
type:'success',
|
|
|
|
|
message:'编辑攻略信息成功'
|
|
|
|
|
})
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
this.isShow = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -206,6 +249,9 @@ export default {
|
|
|
|
|
if(newVal){
|
|
|
|
|
this.getStrategyTypes()
|
|
|
|
|
this.getLabel()
|
|
|
|
|
if(this.type === 'editor'){
|
|
|
|
|
this.getDetail()
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
this.id = ''
|
|
|
|
|
this.type = ''
|
|
|
|
|
|