Commit 2798952e by zhangquan

特色产品编辑添加radio

1 parent 43866653
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="upload-ctnr"> <div class="upload-ctnr">
<label v-if="name" class="label" for="">{{name}}</label> <label v-if="name" class="label" for="">{{name}}</label>
<div class="img-item" :style="defaultStyle"> <div class="img-item" :style="defaultStyle">
<div v-if="!formObj[attr]" class="add-img" @click.stop="addFile"> <div v-if="!formObj[attr]" :class="['add-img',{'disabled': disabled}]" @click.stop="addFile">
<input type="file" class="file" id="file" ref="fileRef" @change="handleFileChange" :accept="accept" /> <input type="file" class="file" id="file" ref="fileRef" @change="handleFileChange" :accept="accept" />
<i class="el-icon-plus add"></i> <i class="el-icon-plus add"></i>
<p>{{ btnName }}</p> <p>{{ btnName }}</p>
...@@ -42,6 +42,10 @@ export default { ...@@ -42,6 +42,10 @@ export default {
bigView bigView
}, },
props: { props: {
disabled: {
type: Boolean,
default: false
},
fileType: { fileType: {
type: String, type: String,
default: 'image' default: 'image'
...@@ -117,6 +121,7 @@ export default { ...@@ -117,6 +121,7 @@ export default {
this.dialogVisibleImg = true this.dialogVisibleImg = true
}, },
addFile(){ addFile(){
if(this.disabled) return;
if(this.empty){ if(this.empty){
this.$emit('clickEvent') this.$emit('clickEvent')
return; return;
...@@ -310,8 +315,11 @@ export default { ...@@ -310,8 +315,11 @@ export default {
line-height: 22px; line-height: 22px;
} }
} }
.disabled{
cursor: not-allowed;
}
.operate{ .operate{
display: block; display: none;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
......
...@@ -2,10 +2,26 @@ ...@@ -2,10 +2,26 @@
<template> <template>
<div class="ctnr"> <div class="ctnr">
<glsx-combi-form class="glsx-combi-form" ref="baseInfoRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="formObj" :formData="formData" :formRules="myRule"> <glsx-combi-form class="glsx-combi-form" ref="baseInfoRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="formObj" :formData="formData" :formRules="myRule">
<!-- 模块分割线 -->
<div class="big-title" slot="coverBigTitleSlot">产品封面设置</div> <div class="big-title" slot="coverBigTitleSlot">产品封面设置</div>
<div class="detail-title" slot="detailBigTitleSlot"> <div class="detail-title" slot="detailBigTitleSlot">
<div class="big-title">产品详情内容配置</div> <div class="big-title">产品详情内容配置</div>
</div> </div>
<div slot="moduleSlot" class="radio-slot">
<el-radio-group @change="menuRadioChange" v-model="formObj.menuId">
<el-radio v-for="item in menuList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
<div slot="zoneSlot" class="radio-slot">
<el-radio-group v-model="formObj.subMenuId">
<el-radio v-for="item in subMenuList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
<div slot="contZoneSlot" class="radio-slot">
<el-radio-group v-model="formObj.type">
<el-radio :label="formObj.type">{{contentType[formObj.type]}}</el-radio>
</el-radio-group>
</div>
<div slot="businessSlot" class="business-slot"> <div slot="businessSlot" class="business-slot">
<span class="module">{{routeInfo.menuName}}</span> <span class="module">{{routeInfo.menuName}}</span>
<i class="el-icon-arrow-right arrow-right"></i> <i class="el-icon-arrow-right arrow-right"></i>
...@@ -44,10 +60,10 @@ ...@@ -44,10 +60,10 @@
<Upload tip="建议尺寸:最大5M,宽度750px" btnName="上传详情图" :formObj="selectedtypeList[curTypeIdx]" attr="posterUrl" @delImage="delImage"></Upload> <Upload tip="建议尺寸:最大5M,宽度750px" btnName="上传详情图" :formObj="selectedtypeList[curTypeIdx]" attr="posterUrl" @delImage="delImage"></Upload>
</div> </div>
<div slot="detailVideoSlot"> <div slot="detailVideoSlot">
<Upload btnName="上传详情视频" fileType="video" :formObj="selectedtypeList[curTypeIdx]" @delImage="delImage" attr="videoUrl"></Upload> <Upload :disabled="!!selectedtypeList[curTypeIdx].buttonEventType || !!selectedtypeList[curTypeIdx].posterEventType" btnName="上传详情视频" fileType="video" :formObj="selectedtypeList[curTypeIdx]" @delImage="delImage" attr="videoUrl"></Upload>
</div> </div>
<div slot="mouseEventSlot" class="link-slot"> <div slot="mouseEventSlot" class="link-slot">
<el-checkbox @change="showBox($event, 'mouseShow')" @click.stop="showBox(1, 'mouseShow')" v-model="selectedtypeList[curTypeIdx].posterEventType">长按跳链接</el-checkbox> <el-checkbox @change="showBox($event, 'mouseShow')" :disabled="!!selectedtypeList[curTypeIdx].videoUrl" @click.stop="showBox(1, 'mouseShow')" v-model="selectedtypeList[curTypeIdx].posterEventType">长按跳链接</el-checkbox>
<span class="link-btn" ref="mouseNameRef" @click="mouseShow = true">链接</span> <span class="link-btn" ref="mouseNameRef" @click="mouseShow = true">链接</span>
<!-- 鼠标链接弹窗 --> <!-- 鼠标链接弹窗 -->
<div class="link-dialog" ref="mouseRef" v-show="mouseShow && selectedtypeList[curTypeIdx].posterEventType"> <div class="link-dialog" ref="mouseRef" v-show="mouseShow && selectedtypeList[curTypeIdx].posterEventType">
...@@ -56,7 +72,7 @@ ...@@ -56,7 +72,7 @@
</div> </div>
</div> </div>
<div slot="buttonEventSlot" class="link-slot"> <div slot="buttonEventSlot" class="link-slot">
<el-checkbox @change="showBox($event, 'btnShow')" v-model="selectedtypeList[curTypeIdx].buttonEventType">按钮跳链接</el-checkbox> <el-checkbox @change="showBox($event, 'btnShow')" :disabled="!!selectedtypeList[curTypeIdx].videoUrl" v-model="selectedtypeList[curTypeIdx].buttonEventType">按钮跳链接</el-checkbox>
<span ref="btnNameRef" v-if="!selectedtypeList[curTypeIdx].buttonEventName" @click.stop="showBox(1, 'btnShow')" class="link-btn">链接</span> <span ref="btnNameRef" v-if="!selectedtypeList[curTypeIdx].buttonEventName" @click.stop="showBox(1, 'btnShow')" class="link-btn">链接</span>
<span ref="btnNameRef" v-else class="link-btn" @click.stop="showBox(1, 'btnShow')">{{selectedtypeList[curTypeIdx].buttonEventName}}</span> <span ref="btnNameRef" v-else class="link-btn" @click.stop="showBox(1, 'btnShow')">{{selectedtypeList[curTypeIdx].buttonEventName}}</span>
<!-- 按钮链接弹窗 --> <!-- 按钮链接弹窗 -->
...@@ -91,7 +107,7 @@ import util from '@/utils/util' ...@@ -91,7 +107,7 @@ import util from '@/utils/util'
import ProdCoverDialog from './components/ProdCoverDialog' import ProdCoverDialog from './components/ProdCoverDialog'
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
export default { export default {
name: 'addProd', name: 'addProd',
components: { components: {
glsxCombiForm, glsxCombiForm,
...@@ -111,6 +127,12 @@ import glsxCombiForm from '@/components/glsx-combi-form' ...@@ -111,6 +127,12 @@ import glsxCombiForm from '@/components/glsx-combi-form'
isEditType: false, isEditType: false,
coverVisible: false, coverVisible: false,
routeInfo: {}, routeInfo: {},
contentType: {
1: '特色产品',
2: '案例视频',
3: '营销海报',
4: '操作指引'
},
contentTypeObj: { contentTypeObj: {
id: '', id: '',
name: '' name: ''
...@@ -133,6 +155,9 @@ import glsxCombiForm from '@/components/glsx-combi-form' ...@@ -133,6 +155,9 @@ import glsxCombiForm from '@/components/glsx-combi-form'
trigger: 'change' trigger: 'change'
} }
], ],
module: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
zone: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
contZone: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
title: [{ required: true, message: '请输入图片/视频标题', trigger: 'change' }], title: [{ required: true, message: '请输入图片/视频标题', trigger: 'change' }],
phone: [{ required: true, message: '请输入联系电话', trigger: 'change' }], phone: [{ required: true, message: '请输入联系电话', trigger: 'change' }],
view: [{ required: true, message: '请输入观看人数', trigger: 'change' }], view: [{ required: true, message: '请输入观看人数', trigger: 'change' }],
...@@ -208,6 +233,24 @@ import glsxCombiForm from '@/components/glsx-combi-form' ...@@ -208,6 +233,24 @@ import glsxCombiForm from '@/components/glsx-combi-form'
}, },
{ {
label: '业务模块', label: '业务模块',
name: 'module',
isHide: true,
addHtml: 'moduleSlot'
},
{
label: '业务专区',
name: 'zone',
isHide: true,
addHtml: 'zoneSlot'
},
{
label: '内容专区',
name: 'contZone',
isHide: true,
addHtml: 'contZoneSlot'
},
{
label: '业务模块',
name: 'business', name: 'business',
addHtml: 'businessSlot' addHtml: 'businessSlot'
}, },
...@@ -289,10 +332,17 @@ import glsxCombiForm from '@/components/glsx-combi-form' ...@@ -289,10 +332,17 @@ import glsxCombiForm from '@/components/glsx-combi-form'
curTypeIdx: 0, curTypeIdx: 0,
contentTypeList: [], contentTypeList: [],
selectedtypeList: [], selectedtypeList: [],
menuList: [],
btnShow: false, btnShow: false,
mouseShow: false mouseShow: false
} }
}, },
computed: {
subMenuList(){
const target = this.menuList.find(item => item.id == this.formObj.menuId)
return target?.childList || []
}
},
created(){ created(){
const urlParam = this.$route.params const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id)) this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
...@@ -301,7 +351,15 @@ import glsxCombiForm from '@/components/glsx-combi-form' ...@@ -301,7 +351,15 @@ import glsxCombiForm from '@/components/glsx-combi-form'
this.formObj.subMenuId = subMenuId this.formObj.subMenuId = subMenuId
this.formObj.type = 1 this.formObj.type = 1
if(id) { if(id) {
this.formData.forEach(item => {
const hideItemList = ['module', 'zone', 'contZone']
if(hideItemList.includes(item.name)){
item.isHide = false
}
if(item.name=='business') item.isHide = true
});
this.getContentDetail() this.getContentDetail()
this.getMenuList()
}else{ }else{
this.getContentTypeList() this.getContentTypeList()
} }
...@@ -313,6 +371,20 @@ import glsxCombiForm from '@/components/glsx-combi-form' ...@@ -313,6 +371,20 @@ import glsxCombiForm from '@/components/glsx-combi-form'
document.removeEventListener("click", this.eventListener); document.removeEventListener("click", this.eventListener);
}, },
methods: { methods: {
getMenuList() {
this.$apis.discover.getMenuListApi({}).then(res => {
this.getContentDetail()
if(res?.length){
this.menuList = res
}
})
},
menuRadioChange(e){
const target = this.menuList.find(item => item.id == e)
if(target?.childList?.length) {
this.formObj.subMenuId = target?.childList[0]?.id
}
},
eventListener(e){ eventListener(e){
console.log(13) console.log(13)
if (!this.$refs?.btnRef?.contains(e.target) && !this.$refs?.btnNameRef?.contains(e.target)) this.btnShow = false; if (!this.$refs?.btnRef?.contains(e.target) && !this.$refs?.btnNameRef?.contains(e.target)) this.btnShow = false;
...@@ -459,9 +531,12 @@ import glsxCombiForm from '@/components/glsx-combi-form' ...@@ -459,9 +531,12 @@ import glsxCombiForm from '@/components/glsx-combi-form'
}, },
addContentType(){ addContentType(){
this.isEditType = true this.isEditType = true
},
goListPage(){
this.$router.push({path: '/discoverManager/index'})
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<GLCombiForm class="search-wrap" ref="searchRef" labelWidth="154px" defaultWidth="432px" @handleOk="handleSearch" @handleRest="handleReset" :formObj="searchFormObj" :formData="searchFormData"> <GLCombiForm class="search-wrap" ref="searchRef" labelWidth="154px" defaultWidth="432px" @handleOk="handleSearch" @handleRest="handleReset" :formObj="searchFormObj" :formData="searchFormData">
</GLCombiForm> </GLCombiForm>
<div class="operate-wrap"> <div class="operate-wrap">
<span class="table-title">商品列表</span> <span class="table-title">内容列表</span>
<div class="operate-btn"> <div class="operate-btn">
<el-button :size="size" type="primary">新增<i class="el-icon-arrow-down arrow-icon"></i></el-button> <el-button :size="size" type="primary">新增<i class="el-icon-arrow-down arrow-icon"></i></el-button>
<div class="dropdown-wrap"> <div class="dropdown-wrap">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!