Commit b8ef2ee4 by zhangquan

bug修复

1 parent d5e0dd09
......@@ -26,7 +26,7 @@
</div>
</div>
<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>
</el-dialog>
</div>
......@@ -146,6 +146,12 @@ export default {
}
},
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 reader = new FileReader()
reader.readAsDataURL(file)
......@@ -157,8 +163,10 @@ export default {
this.formObj[this.attr] = res
this.$emit('uploadSuccess', {attr : this.attr, url: res})
this.$refs.fileRef.value = ''
loading.close()
}).catch(err => {
this.$refs.fileRef.value = ''
loading.close()
})
}
},
......@@ -181,8 +189,12 @@ export default {
upload
.uploaded(file)
.then(res => {
self.formObj[this.attr] = res.video.url
self.$emit('uploadSuccess', {attr : this.attr, url: res.video.url})
let 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 => {
loading.close()
......
......@@ -192,7 +192,8 @@ export default {
{
required: true,
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++){
const item = this.selectedtypeList[i]
if(!item.posterUrl) {
......@@ -274,7 +275,8 @@ export default {
name: 'title',
type: 'input',
isDisabled: false,
maxlength: 50
maxlength: 18,
showLimit: true
},
{
label: '联系电话',
......@@ -543,7 +545,7 @@ export default {
<style scoped lang="scss">
.ctnr{
padding: 20px 20px 0;
padding: 20px 20px 34px;
background-color: #fff;
.glsx-combi-form{
.big-title{
......@@ -694,15 +696,10 @@ export default {
}
}
.footer-btn{
padding: 20px;
// border-top: 1px solid #E5E5E5;
height: 64px;
display: flex;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
}
}
.gl-footer{
margin-top: 16px;
}
</style>
\ No newline at end of file
......@@ -101,7 +101,9 @@ export default {
label: '海报标题',
name: 'proName',
isHide: false,
type: 'input'
type: 'input',
maxlength: 8,
showLimit: true
},
{
label: '海报图片',
......
......@@ -102,12 +102,16 @@ export default {
{
label: '封面标题',
name: 'proName',
type: 'input'
type: 'input',
maxlength: 12,
showLimit: true
},
{
label: '内容标题',
name: 'title',
type: 'input'
type: 'input',
maxlength: 18,
showLimit: true
},
{
label: '主视频',
......
......@@ -170,6 +170,9 @@
this.menuForm = {...this.menuForm, position, type}
if(type=='add') this.menuForm.name = ''
this.menuVisible = true
this.$nextTick(()=>{
this.$refs?.menuRef?.clearValidate();
})
},
commitMenu(){
this.$refs.menuRef.validate(valid => {
......@@ -185,7 +188,6 @@
}
const api = params.id ? 'updateMenuApi' : 'addMenuApi'
this.$apis.discover[api](params).then(res => {
console.log(res)
if(res){
this.menuVisible = false
this.$message.success(`${params.id ? '修改成功' : '新增成功'}`)
......@@ -199,6 +201,9 @@
this.boxShow = true
const {id, sceneCode, name} = item
this.menuForm = {...this.menuForm, id, sceneCode, name, level}
},
closeMenuDialog(){
this.menuVisible = false
}
}
}
......
<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">
<div slot="coverSlot">
<Upload tip="建议尺寸:最大5M,176*120px" :formObj="detailFormObj" btnName="上传封面" attr="url"></Upload>
......@@ -32,7 +32,9 @@ export default {
{
label: '封面标题',
name: 'title',
type: 'input'
type: 'input',
maxlength: 12,
showLimit: true
},
{
label: '内容标题',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!