Commit b8ef2ee4 by zhangquan

bug修复

1 parent d5e0dd09
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
</div> </div>
<span v-if="tip" :class="['tip', {'tip-bottom': placement=='bottom'}]">{{ tip }}</span> <span v-if="tip" :class="['tip', {'tip-bottom': placement=='bottom'}]">{{ tip }}</span>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%"> <el-dialog append-to-body class="image-dialog" :visible.sync="dialogVisibleImg" width="30%">
<big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="formObj[attr]" :dialogType="dialogType"></big-view> <big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="formObj[attr]" :dialogType="dialogType"></big-view>
</el-dialog> </el-dialog>
</div> </div>
...@@ -146,6 +146,12 @@ export default { ...@@ -146,6 +146,12 @@ export default {
} }
}, },
uploadImg(e) { uploadImg(e) {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
var reader = new FileReader() var reader = new FileReader()
reader.readAsDataURL(file) reader.readAsDataURL(file)
...@@ -157,8 +163,10 @@ export default { ...@@ -157,8 +163,10 @@ export default {
this.formObj[this.attr] = res this.formObj[this.attr] = res
this.$emit('uploadSuccess', {attr : this.attr, url: res}) this.$emit('uploadSuccess', {attr : this.attr, url: res})
this.$refs.fileRef.value = '' this.$refs.fileRef.value = ''
loading.close()
}).catch(err => { }).catch(err => {
this.$refs.fileRef.value = '' this.$refs.fileRef.value = ''
loading.close()
}) })
} }
}, },
...@@ -181,8 +189,12 @@ export default { ...@@ -181,8 +189,12 @@ export default {
upload upload
.uploaded(file) .uploaded(file)
.then(res => { .then(res => {
self.formObj[this.attr] = res.video.url let url = res.video.url
self.$emit('uploadSuccess', {attr : this.attr, url: res.video.url}) if(url && url.indexOf('https')<0){
url = url.replace('http','https')
}
self.formObj[this.attr] = url
self.$emit('uploadSuccess', {attr : this.attr, url})
}) })
.finally(end => { .finally(end => {
loading.close() loading.close()
......
...@@ -192,7 +192,8 @@ export default { ...@@ -192,7 +192,8 @@ export default {
{ {
required: true, required: true,
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
let noProblemNum = 0, len = this.selectedtypeList.length let noProblemNum = 0, len = this.selectedtypeList?.length || 0
if(!len) callback(new Error(`请选择展开详情`))
for(let i=0;i<len;i++){ for(let i=0;i<len;i++){
const item = this.selectedtypeList[i] const item = this.selectedtypeList[i]
if(!item.posterUrl) { if(!item.posterUrl) {
...@@ -274,7 +275,8 @@ export default { ...@@ -274,7 +275,8 @@ export default {
name: 'title', name: 'title',
type: 'input', type: 'input',
isDisabled: false, isDisabled: false,
maxlength: 50 maxlength: 18,
showLimit: true
}, },
{ {
label: '联系电话', label: '联系电话',
...@@ -543,7 +545,7 @@ export default { ...@@ -543,7 +545,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.ctnr{ .ctnr{
padding: 20px 20px 0; padding: 20px 20px 34px;
background-color: #fff; background-color: #fff;
.glsx-combi-form{ .glsx-combi-form{
.big-title{ .big-title{
...@@ -694,15 +696,10 @@ export default { ...@@ -694,15 +696,10 @@ export default {
} }
} }
.footer-btn{ }
padding: 20px;
// border-top: 1px solid #E5E5E5; .gl-footer{
height: 64px; margin-top: 16px;
display: flex;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -101,7 +101,9 @@ export default { ...@@ -101,7 +101,9 @@ export default {
label: '海报标题', label: '海报标题',
name: 'proName', name: 'proName',
isHide: false, isHide: false,
type: 'input' type: 'input',
maxlength: 8,
showLimit: true
}, },
{ {
label: '海报图片', label: '海报图片',
......
...@@ -102,12 +102,16 @@ export default { ...@@ -102,12 +102,16 @@ export default {
{ {
label: '封面标题', label: '封面标题',
name: 'proName', name: 'proName',
type: 'input' type: 'input',
maxlength: 12,
showLimit: true
}, },
{ {
label: '内容标题', label: '内容标题',
name: 'title', name: 'title',
type: 'input' type: 'input',
maxlength: 18,
showLimit: true
}, },
{ {
label: '主视频', label: '主视频',
......
...@@ -170,6 +170,9 @@ ...@@ -170,6 +170,9 @@
this.menuForm = {...this.menuForm, position, type} this.menuForm = {...this.menuForm, position, type}
if(type=='add') this.menuForm.name = '' if(type=='add') this.menuForm.name = ''
this.menuVisible = true this.menuVisible = true
this.$nextTick(()=>{
this.$refs?.menuRef?.clearValidate();
})
}, },
commitMenu(){ commitMenu(){
this.$refs.menuRef.validate(valid => { this.$refs.menuRef.validate(valid => {
...@@ -185,7 +188,6 @@ ...@@ -185,7 +188,6 @@
} }
const api = params.id ? 'updateMenuApi' : 'addMenuApi' const api = params.id ? 'updateMenuApi' : 'addMenuApi'
this.$apis.discover[api](params).then(res => { this.$apis.discover[api](params).then(res => {
console.log(res)
if(res){ if(res){
this.menuVisible = false this.menuVisible = false
this.$message.success(`${params.id ? '修改成功' : '新增成功'}`) this.$message.success(`${params.id ? '修改成功' : '新增成功'}`)
...@@ -199,6 +201,9 @@ ...@@ -199,6 +201,9 @@
this.boxShow = true this.boxShow = true
const {id, sceneCode, name} = item const {id, sceneCode, name} = item
this.menuForm = {...this.menuForm, id, sceneCode, name, level} this.menuForm = {...this.menuForm, id, sceneCode, name, level}
},
closeMenuDialog(){
this.menuVisible = false
} }
} }
} }
......
<template> <template>
<GLDialog mode="mid" append-to-body :close-on-click-modal="false" title="创建封面" :visible.sync="visible" :before-close="onCancel" @onOk="onOk" @onCancel="onCancel"> <GLDialog mode="mid" :close-on-click-modal="false" title="创建封面" :visible.sync="visible" :before-close="onCancel" @onOk="onOk" @onCancel="onCancel">
<glsx-combi-form class="glsx-combi-form" ref="detailRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="detailFormObj" :formData="detailFormData" :formRules="detailRules"> <glsx-combi-form class="glsx-combi-form" ref="detailRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="detailFormObj" :formData="detailFormData" :formRules="detailRules">
<div slot="coverSlot"> <div slot="coverSlot">
<Upload tip="建议尺寸:最大5M,176*120px" :formObj="detailFormObj" btnName="上传封面" attr="url"></Upload> <Upload tip="建议尺寸:最大5M,176*120px" :formObj="detailFormObj" btnName="上传封面" attr="url"></Upload>
...@@ -32,7 +32,9 @@ export default { ...@@ -32,7 +32,9 @@ export default {
{ {
label: '封面标题', label: '封面标题',
name: 'title', name: 'title',
type: 'input' type: 'input',
maxlength: 12,
showLimit: true
}, },
{ {
label: '内容标题', label: '内容标题',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!