Commit 4dd09ea3 by 前端

Merge branch 'v3.11.0' into 'master'

V3.11.0

See merge request !14
2 parents 581c47a2 8cef5167
This diff could not be displayed because it is too large.
import { http } from '@/main'
const defaultPath = 'scrm.api.busassistant.'
const url = 'rop-scrm-busassistant/router'
// 获取菜单名称
const getMenuListApi = params => {
params.method = `${defaultPath}discover.menu.list`
return http({
url,
data: params,
sign: true
})
}
// 新增菜单
const addMenuApi = params => {
params.method = `${defaultPath}discover.menu.insert`
return http({
url,
data: params,
sign: true
})
}
// 修改菜单
const updateMenuApi = params => {
params.method = `${defaultPath}discover.menu.update`
return http({
url,
data: params,
sign: true
})
}
const getListApi = params => {
if(!params.subMenuId) {
return new Promise((resolve, reject)=>{
reject()
})
};
params.method = `${defaultPath}discover.content.page`
return http({
url,
data: params,
sign: true
})
}
const getContentTypeListApi = params => {
params.method = `${defaultPath}discover.contentType.list`
return http({
url,
data: params,
sign: true
})
}
// 图片上传
const uploadImgApi = params => {
params.method = 'scrm.api.carlife.common.uploadImg'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const updateStatusApi = params => {
params.method = `${defaultPath}discover.content.updateStatus`
return http({
url,
data: params,
sign: true
})
}
const updateContentTypeApi = params => {
params.method = `${defaultPath}discover.contentType.insertOrUpdate`
return http({
url,
data: params,
sign: true
})
}
const addContentApi = params => {
params.method = `${defaultPath}discover.content.insertOrUpdate`
return http({
url,
data: params,
sign: true
})
}
const getContentDetailApi = params => {
params.method = `${defaultPath}discover.content.detail`
return http({
url,
data: params,
sign: true
})
}
export default {
getMenuListApi,
addMenuApi,
updateMenuApi,
getListApi,
getContentTypeListApi,
updateStatusApi,
updateContentTypeApi,
addContentApi,
getContentDetailApi,
uploadImgApi
}
\ No newline at end of file
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.platform.'
const url = 'rop-scrm-shopmall/router'
// 分页查询仓库/销售中商品
const getListApi = params => {
params.method = `${defaultPath}goods.stockroom.page`
return http({
url,
data: params,
sign: true
})
}
export default {
getListApi,
}
......@@ -124,6 +124,7 @@ html {
// min-height: calc(100vh - 156px);
margin-bottom: 16px;
}
.content .approval-container {
margin-bottom: 10px;
}
......@@ -272,12 +273,15 @@ html {
.content .m-t-10 {
margin-top: 10px;
}
.content .m-t-20 {
margin-top: 20px;
}
.content .m-b-8 {
margin-bottom: 8px;
}
.content .m-b-10 {
margin-bottom: 10px;
}
......@@ -360,9 +364,11 @@ html {
.content .txt-grey {
color: #999999;
}
.content .text-e8 {
color: #eb4e4e !important;
}
.content .txt-center {
text-align: center;
}
......@@ -407,24 +413,29 @@ html {
display: flex;
flex-wrap: wrap;
}
.content .flex-align {
display: flex;
align-items: center;
}
.content .flex-top {
display: flex;
align-items: flex-start;
}
.content .flex-center {
display: flex;
justify-content: center;
align-items: center;
}
.content .flex-between {
display: flex;
justify-content: space-between;
align-items: center;
}
.content .flex-grow {
flex: 1;
}
......@@ -569,37 +580,48 @@ html {
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: #5850ff;
font-size: 16px;
}
.content .text-10 {
font-size: 10px;
}
.content .text-14 {
font-size: 14px;
}
.content .text-16 {
font-size: 16px;
}
.content .color-3 {
color: #333333;
}
.content .line-20 {
line-height: 20px;
}
.content .weight-6 {
font-weight: 600;
}
.content .weight-5 {
font-weight: 500;
}
.content .weight-4 {
font-weight: 400;
}
.content .mt-10 {
margin-top: 10px;
}
.el-tooltip__popper.is-light {
background: #ffffff;
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.08);
......@@ -607,12 +629,15 @@ html {
width: 177px;
box-sizing: border-box;
}
.el-tooltip__popper[x-placement^='top'] .popper__arrow {
border-top-color: #e4e7ed !important;
}
.el-tooltip__popper[x-placement^='top'] .popper__arrow:after {
border-top-color: #e4e7ed !important;
}
/* tab */
.myMessage {
z-index: 4000 !important;
......@@ -658,15 +683,18 @@ html {
background-color: #fdb757;
}
}
.loadingClass {
.el-icon-loading {
font-size: 22px;
}
.el-icon-loading,
.el-loading-text {
color: #5850ff !important;
}
}
.scrm-box-f {
background: #ffffff;
}
......@@ -720,3 +748,77 @@ html {
vertical-align: middle;
margin-right: 8px;
}
.operate-wrap {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.table-title {
height: 32px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
line-height: 32px;
}
.operate-btn {
.el-button {
margin-left: 8px;
}
.export-btn {
margin-left: 8px;
}
}
}
.global-title-wrap {
background: #fff;
border-radius: 4px 4px 0 0;
.title {
display: inline-block;
box-sizing: border-box;
height: 40px;
line-height: 40px;
padding: 0 32px;
font-weight: 400;
font-size: 16px;
color: #666666;
border-radius: 4px 4px 0 0;
border-top: 1px;
border-left: 1px;
border-right: 1px;
border-style: solid;
border-color: #E5E5E5;
background: #FAFAFA;
text-align: center;
cursor: pointer;
}
.curTitleCla {
font-weight: 600;
color: #5850FF;
background-color: #fff;
border-bottom: 1px solid #fff;
}
}
.global-menu {
.module {
color: #666666;
}
.arrow-right {
font-weight: 600;
margin: 0 3px;
vertical-align: middle;
}
.active {
color: #5850FF;
}
}
\ No newline at end of file
<template>
<div class="upload-ctnr">
<label v-if="name" class="label" for="">{{name}}</label>
<div class="img-item" :style="defaultStyle">
<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" />
<i class="el-icon-plus add"></i>
<p>{{ btnName }}</p>
</div>
<template v-if="formObj[attr] && isImage(formObj[attr])">
<img class="image" :src="formObj[attr]" alt="" />
<div class="operate">
<div class="btn-wrap">
<i class="el-icon-edit-outline" @click.stop="edit" v-if="isEdit"></i>
<i class="el-icon-view" @click.stop="handleLook('img')" v-else></i>
<i class="el-icon-delete" @click.stop="del"></i>
</div>
</div>
</template>
<div v-if="formObj[attr] && !isImage(formObj[attr])" class="video-panel">
<video id="video" width="100%" height="100%" preload loop muted>
<source :src="formObj[attr]" type="video/mp4" />
</video>
<i class="el-icon-video-play" @click.stop="handleLook('video')"></i>
<i class="el-icon-close" @click.stop="del"></i>
</div>
</div>
<span v-if="tip" :class="['tip', {'tip-bottom': placement=='bottom'}]">{{ tip }}</span>
<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>
</template>
<script>
import upload from '@/api/uploadApi'
import util from '@/utils/util'
import bigView from '@/components/big-view'
import uploadMixin from '@/mixins/upload'
export default {
name: 'Upload',
mixins: [uploadMixin],
components: {
bigView
},
props: {
disabled: {
type: Boolean,
default: false
},
fileType: {
type: String,
default: 'image'
},
empty: {
type: Boolean,
default: false
},
isEdit: {
type: Boolean,
default: false
},
placement: {
type: String,
default: 'right'
},
tip: {
type: String,
default: ''
},
coverAttr: {
type: String,
default: ''
},
name: {
type: String,
default: ''
},
btnName: {
type: String,
default: '上传'
},
url: {
type: String,
default: ''
},
attr: {
type: String,
default: ''
},
formObj: {
type: Object,
default: ()=>{
return {}
}
},
defaultStyle: {
type: Object,
default: ()=>{
return {}
}
}
},
data() {
return {
accept: 'image/png, image/jpeg, image/gif, image/jpg, image/webp',
dialogVisibleImg: false,
dialogType: ''
}
},
created(){
if(this.fileType=='all'){
this.accept = 'video/*, image/png, image/jpeg, image/gif, image/jpg, image/webp'
}else if(this.fileType=='video'){
this.accept = 'video/*'
}else{
this.accept = 'image/png, image/jpeg, image/gif, image/jpg, image/webp'
}
},
computed: {
},
methods: {
isImage : util.isImage,
handleLook(type) {
this.dialogType = type
this.dialogVisibleImg = true
},
addFile(){
if(this.disabled) return;
if(this.empty){
this.$emit('clickEvent')
return;
}
this.$refs.fileRef.click()
},
handleFileChange(e) {
var file = e.srcElement.files[0]
if(this.fileType=='video' && file.type?.indexOf('video')==-1) {
this.$refs.fileRef.value = ''
return this.$message.error('请上传mp4格式的视频')
}
if(this.fileType=='image' && file.type?.indexOf('image')==-1) {
this.$refs.fileRef.value = ''
return this.$message.error('请上传格式为jpg、jpeg、png、webp、gif的图片')
}
if(file.type?.indexOf('image')>-1){
this.uploadImgFn(e)
}else{
this.uploadVideo(e)
}
},
uploadImgFn(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)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const base64 = file.name.split('.').pop() + '@' + arrBase64[1]
this.$apis.discover.uploadImgApi({file: base64, fileType: 'image', compress: 1}).then(res => {
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()
})
}
},
uploadVideo(e) {
const self = this
let file = e.target.files[0]
const isLt = file.size / 1024 / 1024 < this.limitSize
// if (!isLt) {
// this.$message.error('上传视频大小不能超过' + this.limitSize + 'MB!')
// return true
// }
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
upload.init().then(res => {
if (res.status == 0) {
upload
.uploaded(file)
.then(res => {
let url = res.video.url
if(url && url.indexOf('https')<0){
url = url.replace('http','https')
}
self.formObj[self.attr] = url
if(this.coverAttr) {
self.$nextTick(()=>[
self.getImgUrl(url).then(resp => {
self.$set(self.formObj, self.coverAttr, resp)
loading.close()
}).catch(err=>{
loading.close()
})
])
}else{
loading.close()
}
self.$refs.fileRef && (self.$refs.fileRef.value = '')
self.$emit('uploadSuccess', {attr : self.attr, url})
}).catch(end => {
loading.close()
self.$refs.fileRef && (self.$refs.fileRef.value = '')
})
upload.uploadEvent('', res => {
console.log(res, '视频上传完成')
})
upload.uploadEvent('media_progress', res => {
console.log(res)
})
}
})
},
del(){
this.formObj[this.attr] = ''
this.$emit('delImage', {attr : this.attr})
},
edit() {
this.$emit('editImage', {attr : this.attr})
}
}
}
</script>
<style lang="scss" scoped>
.upload-ctnr{
display: flex;
align-items: flex-end;
.label{
display: inline-block;
vertical-align: top;
width: 154px;
height: 20px;
font-size: 14px;
color: #333333;
text-align: right;
line-height: 20px;
box-sizing: border-box;
}
.tip {
display: inline-block;
font-size: 14px;
color: #999999;
height: 20px;
line-height: 20px;
margin-left: 8px;
vertical-align: bottom;
}
.tip-bottom{
display: block;
margin-top: 8px;
margin-left: 0;
}
.img-wrap{
display: flex;
}
.img-item{
display: inline-flex;
border: 1px dashed #00000026;
box-sizing: border-box;
width: 104px;
height: 104px;
background: #0000000a;
border-radius: 4px;
position: relative;
&:hover{
.operate{
display: block;
}
}
.image{
width: 100%;
height: 100%;
z-index: 2;
position: relative;
}
.video-panel {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
video {
position: absolute;
object-fit: fill;
}
.el-icon-video-play {
z-index: 10;
font-size: 20px;
color: #fff;
cursor: pointer;
}
.el-icon-close {
position: absolute;
top: 0px;
right: 0px;
background: #000000;
color: #fff;
}
}
.add-img{
width: 100%;
height: 100%;
cursor: pointer;
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #666666;
position: relative;
.file{
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
position: absolute;
opacity: 0;
}
.add {
font-size: 18px;
font-weight: 500;
}
p {
margin-top: 12px;
height: 22px;
line-height: 22px;
}
}
.disabled{
cursor: not-allowed;
}
.operate{
display: none;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
border-radius: 4px;
z-index: 5;
.btn-wrap{
color: #fff;
white-space: nowrap;
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
i{
font-size: 16px;
cursor: pointer;
&:first-child{
margin-right: 12px;
}
}
}
}
}
}
</style>
\ No newline at end of file
<!-- 搜索 -->
<template>
<div :class="['glsx-combi-form', isEdit ? 'gl-form-page' : '']">
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<el-form :ref="formRef" :inline="isInline" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<slot v-if="item.slotName && item.isHide" :name="item.slotName" :scope="item"></slot>
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '154px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
......@@ -143,6 +144,10 @@ export default {
type: String,
default: '432px'
},
isInline: {
type: Boolean,
default: true
},
formRef: {
type: String,
default: 'formRef'
......
import { Message } from 'element-ui'
let util = {}
util.isImage = function(url) {
const suffix = url.split('.').pop()
const imageList = ['png','jpeg','jpg','webp','gif']
return imageList.includes(suffix)
}
util.cloneText = function(message) {
let input = document.createElement('input')
input.value = message
......
<!-- 专区管理 -->
<template>
<div>
<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">
<!-- 模块分割线 -->
<div class="big-title" slot="coverBigTitleSlot">产品封面设置</div>
<div class="detail-title" slot="detailBigTitleSlot">
<div class="big-title">产品详情内容配置</div>
</div>
<div slot="moduleSlot" class="radio-slot">
<el-radio-group @change="menuRadioChange('firstMenu')" v-model="routeInfo.menuId">
<el-radio v-for="item in menuList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
<div slot="attrSlot" class="radio-slot">
<el-radio-group @change="menuRadioChange()" v-model="routeInfo.secondaryMenuId">
<el-radio v-for="item in secondaryMenuList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
<div slot="sceneSlot" class="radio-slot">
<el-radio-group v-model="routeInfo.thirdMenuId">
<el-radio v-for="item in thirdMenuList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
<div slot="contentSlot" 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">
<span class="module">{{routeInfo.menuName}}</span>
<i class="el-icon-arrow-right arrow-right"></i>
<span class="module">{{routeInfo.secondaryMenuName}}</span>
<i class="el-icon-arrow-right arrow-right"></i>
<template v-if="routeInfo.thirdMenuId">
<span class="module">{{routeInfo.thirdMenuName}}</span>
<i class="el-icon-arrow-right arrow-right"></i>
</template>
<span class="module active">特色方案</span>
</div>
<div slot="coverDetailSlot" class="cover-Slot">
<Upload v-if="!formObj.prodImg" :empty="true" @clickEvent="openCoverDialog" :default-style="{width: '84px', height: '84px'}" :formObj="formObj" btnName="创建封面" attr="coverDetail"></Upload>
<div v-else class="cover-wrap">
<div class="title">{{formObj.proName}}</div>
<Upload @delImage="delCoverDetail" @editImage="editCoverDetail" :default-style="{width: '88px', height: '60px'}" :isEdit="true" :formObj="formObj" btnName="创建封面" attr="prodImg"></Upload>
</div>
</div>
<div slot="mainImageSlot" class="main-image-Slot">
<Upload placement="right" tip="图片&视频只能上传一个" fileType="all" :formObj="formObj" attr="imageUrl"></Upload>
</div>
<div slot="viewSlot" class="view-slot">
<el-input placeholder="请输入观看人数" v-model="formObj.view" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" type="text"></el-input>
</div>
<div slot="detailModuleSlot" class="expansion-detail-slot">
<div>
<div :class="['tab-item',{'active-tab': item.selected, 'editing': contentTypeObj.id && contentTypeObj.id==item.id}]" @click.stop="selectContentType(item)" v-for="item in contentTypeList" :key="item.id">
<img v-if="item.selected" class="active-label" :src="require('@/assets/active-label.png')" />
<el-input v-if="contentTypeObj.id && contentTypeObj.id==item.id" maxlength="8" v-focus v-model="contentTypeObj.name" @blur="blurContentType" type="text" class="add-input"></el-input>
<template v-else>
<span >{{ item.name }}</span>
<i class="el-icon-edit edit" @click.stop="editContentType(item)"></i>
</template>
</div>
<div v-if="!isEditType" class="tab-item add-btn" @click="addContentType"><i class="el-icon-plus"></i>新建</div>
<el-input v-else maxlength="8" v-focus v-model="contentTypeObj.name" @blur="blurContentType" type="text" class="add-input"></el-input>
</div>
</div>
<div slot="expansionDetailSlot" class="expansion-detail-slot">
<div class="global-title-wrap">
<span v-for="(item,index) in selectedtypeList" :key="index" :class="['title', {'curTitleCla': curTypeIdx==index}]" @click="changeTable(item, index)">{{item.name}}</span>
<div class="expansion-content" v-if="selectedtypeList && selectedtypeList.length">
<glsx-combi-form ref="expansionRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="selectedtypeList[curTypeIdx]" :formData="expansionFormData" :formRules="expansionRule">
<div slot="detailImageSlot">
<Upload tip="建议尺寸:最大5M,宽度750px" btnName="上传详情图" :formObj="selectedtypeList[curTypeIdx]" attr="posterUrl" @delImage="delImage"></Upload>
</div>
<div slot="detailVideoSlot">
<Upload :disabled="!!selectedtypeList[curTypeIdx].buttonEventType || !!selectedtypeList[curTypeIdx].posterEventType" btnName="上传详情视频" fileType="video" :formObj="selectedtypeList[curTypeIdx]" @delImage="delImage" attr="videoUrl"></Upload>
</div>
<div slot="mouseEventSlot" class="link-slot">
<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>
<!-- 鼠标链接弹窗 -->
<div class="link-dialog" ref="mouseRef" v-show="mouseShow && selectedtypeList[curTypeIdx].posterEventType">
<label for="">链接地址:</label>
<el-input show-word-limit maxlength="250" v-model="selectedtypeList[curTypeIdx].posterEventUrl" placeholder="请输入链接地址"></el-input>
</div>
</div>
<div slot="buttonEventSlot" class="link-slot">
<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-else class="link-btn" @click.stop="showBox(1, 'btnShow')">{{selectedtypeList[curTypeIdx].buttonEventName}}</span>
<!-- 按钮链接弹窗 -->
<div class="link-dialog button-link-dialog" ref="btnRef" v-show="btnShow && selectedtypeList[curTypeIdx].buttonEventType">
<div>
<label for="">按钮名称:</label>
<el-input show-word-limit maxlength="20" v-model="selectedtypeList[curTypeIdx].buttonEventName" placeholder="请输入按钮名称"></el-input>
</div>
<div style="margin-top: 20px;">
<label for="">链接地址:</label>
<el-input show-word-limit maxlength="250" v-model="selectedtypeList[curTypeIdx].buttonEventUrl" placeholder="请输入链接地址"></el-input>
</div>
</div>
</div>
</glsx-combi-form>
</div>
</div>
</div>
</glsx-combi-form>
<ProdCoverDialog @closeDialog="closeDialog" @confirmDialog="confirmDialog" :formObj="coverDeatilFormObj" v-if="coverVisible" :visible="coverVisible"></ProdCoverDialog>
</div>
<GLFooter class="gl-footer">
<el-button class="btn-cancle" @click="goListPage">取消</el-button>
<el-button @click="commitForm" type="primary">确定</el-button>
</GLFooter>
</div>
</template>
<script>
import Upload from '@/components/Upload'
import util from '@/utils/util'
import ProdCoverDialog from './components/ProdCoverDialog'
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'addProd',
components: {
glsxCombiForm,
Upload,
ProdCoverDialog
},
directives: {
focus: {
inserted(el) {
el.querySelector('input').focus()
},
},
},
data() {
return {
size: 'small',
isEditType: false,
coverVisible: false,
routeInfo: {},
coverDeatilFormObj: {},
contentType: {
1: '特色方案',
2: '案例视频',
3: '营销海报',
4: '操作指引'
},
contentTypeObj: {
id: '',
name: ''
},
myRule: {
business: [
{
required: true,
validator: (rule, value, callback) => {
callback()
},
trigger: 'change'
}
],
module: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
zone: [{
required: true,
validator: (rule, value, callback) => {
if (!this.routeInfo.secondaryMenuId) {
return callback(new Error('请选择业务属性'))
}else {
return callback()
}
},
trigger: 'change'
}
],
contZone: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
scene: [
{
required: true,
validator: (rule, value, callback) => {
if (this.thirdMenuList.length && !this.routeInfo.thirdMenuId) {
return callback(new Error('请选择场景细分'))
}else {
return callback()
}
},
trigger: 'change'
}
],
title: [
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入图片/视频标题'))
} else if(value.length>30) {
return callback(new Error('图片/视频标题不能大于30个字'))
}else {
return callback()
}
},
trigger: 'change'
}],
phone: [{ required: true, message: '请输入联系电话', trigger: 'change' }],
view: [{ required: true, message: '请输入观看人数', trigger: 'change' }],
coverDetail: [
{
required: true,
validator: (rule, value, callback) => {
if(!this.formObj.prodImg){
callback(new Error('产品封面不能为空'))
}else if (!this.formObj.proName) {
callback(new Error('产品名称不能为空'))
} else{
callback()
}
},
trigger: 'change'
}
],
mainImage: [
{
required: true,
validator: (rule, value, callback) => {
if (!this.formObj.imageUrl && !this.formObj.vedioUrl) {
callback(new Error('请上传产品主图片/视频'))
} else{
callback()
}
},
trigger: 'change'
}
],
detailModule: [
{
required: true,
validator: (rule, value, callback) => {
let len = this.selectedtypeList?.length || 0
if(len){
callback()
}else{
callback(new Error(`请选择详情模块`))
}
},
trigger: 'change'
}
],
expansionDetail: [
{
required: true,
validator: (rule, value, callback) => {
let noProblemNum = 0, len = this.selectedtypeList?.length || 0
for(let i=0;i<len;i++){
const item = this.selectedtypeList[i]
if(!item.posterUrl) {
callback(new Error(`请上传${item.name}的详情图片`))
}else if(item.posterEventType && !item.posterEventUrl){
callback(new Error(`请输入${item.name}图片鼠标事件的链接地址`))
}else if(item.buttonEventType && !item.buttonEventUrl){
callback(new Error(`请输入${item.name}详情按钮事件的链接地址`))
}else if(item.buttonEventType && !item.buttonEventName){
callback(new Error(`请输入${item.name}详情按钮事件的按钮名称`))
}else{
noProblemNum ++
}
}
if(noProblemNum==len){
callback()
}
},
trigger: 'change'
}
],
},
formObj:{
menuId: '',
subMenuId: '',
type: '',
proName: '',
prodImg: '',
title: '',
vedioUrl: '',
imageUrl: '',
phone: '',
view: '',
},
formData:[
{
slotName: 'coverBigTitleSlot', //分割线
isHide: true,
},
{
label: '业务模块',
name: 'module',
isHide: true,
addHtml: 'moduleSlot'
},
{
label: '业务属性',
name: 'zone',
isHide: true,
addHtml: 'attrSlot'
},
{
label: '场景细分',
name: 'scene',
isHide: true,
addHtml: 'sceneSlot'
},
{
label: '内容专区',
name: 'contZone',
isHide: true,
addHtml: 'contentSlot'
},
{
label: '业务模块',
name: 'business',
addHtml: 'businessSlot'
},
{
label: '封面详情',
name: 'coverDetail',
addHtml: 'coverDetailSlot'
},
{
slotName: 'detailBigTitleSlot', //分割线
isHide: true,
},
{
label: '产品主图片/视频',
name: 'mainImage',
addHtml: 'mainImageSlot'
},
{
label: '图片/视频标题',
name: 'title',
type: 'input',
isDisabled: false,
maxlength: 30,
showLimit: true
},
{
label: '联系电话',
name: 'phone',
type: 'input',
isDisabled: false,
maxlength: 20
},
{
label: '观看人数',
name: 'view',
addHtml: 'viewSlot'
},
{
label: '详情模块',
name: 'detailModule',
addHtml: 'detailModuleSlot'
},
{
label: '模块内容',
name: 'expansionDetail',
addHtml: 'expansionDetailSlot'
},
],
expansionFormObj: {
mouseEventLink: ''
},
expansionFormData: [
{
label: '详情图片',
name: 'detailImage',
addHtml: 'detailImageSlot'
},
{
label: '详情视频',
name: 'detailVideo',
addHtml: 'detailVideoSlot'
},
{
label: '图片鼠标事件',
name: 'mouseEvent',
addHtml: 'mouseEventSlot'
},
{
label: '详情按钮事件',
name: 'buttonEvent',
addHtml: 'buttonEventSlot'
}
],
expansionRule: {
detailImage: [
{
required: true,
validator: (rule, value, callback) => {
callback()
},
trigger: 'change'
}
],
},
curTypeIdx: 0,
contentTypeList: [],
selectedtypeList: [],
menuList: [],
btnShow: false,
mouseShow: false
}
},
computed: {
secondaryMenuList(){
const target = this.menuList.find(item => item.id == this.routeInfo.menuId)
return target?.subList || []
},
thirdMenuList(){
const target = this.secondaryMenuList.find(item => item.id == this.routeInfo.secondaryMenuId)
return target?.subList || []
}
},
created(){
const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
const { menuId, subMenuId, id } = this.routeInfo
this.formObj.menuId = menuId
this.formObj.subMenuId = subMenuId
this.formObj.type = 1
if(id) {
this.formData.forEach(item => {
const hideItemList = ['module', 'zone', 'contZone', 'scene']
if(hideItemList.includes(item.name)){
item.isHide = false
}
if(item.name=='business') item.isHide = true
});
this.getContentDetail()
this.getMenuList()
}else{
this.getContentTypeList()
}
},
mounted() {
document.addEventListener("click", this.eventListener);
},
beforeDestroy(){
document.removeEventListener("click", this.eventListener);
},
methods: {
getMenuList() {
this.$apis.discover.getMenuListApi({}).then(res => {
this.getContentDetail()
if(res?.length){
this.menuList = res
}
})
},
menuRadioChange(level){
this.routeInfo.thirdMenuId = ''
if(level=='firstMenu') this.routeInfo.secondaryMenuId = ''
},
eventListener(e){
if (!this.$refs?.btnRef?.contains(e.target) && !this.$refs?.btnNameRef?.contains(e.target)) this.btnShow = false;
if (!this.$refs?.mouseRef?.contains(e.target) && !this.$refs?.mouseNameRef?.contains(e.target)) this.mouseShow = false;
},
openCoverDialog(){
this.coverVisible = true
},
closeDialog() {
this.coverVisible = false
},
showBox(e, key){
if(e){ this[key] = true }
},
editCoverDetail(){
this.coverDeatilFormObj = {
title: this.formObj.proName,
url: this.formObj.prodImg
}
this.coverVisible = true
},
delCoverDetail(){
this.formObj.proName = ''
this.formObj.prodImg = ''
this.coverDeatilFormObj = {}
},
confirmDialog(e){
const { title, url } = e
this.formObj.proName = title
this.formObj.prodImg = url
this.closeDialog()
},
clearContentTypeInfo(){
this.contentTypeObj = {
name: '',
id: ''
}
this.isEditType = false
},
blurContentType(){
const {id , name} = this.contentTypeObj
if(!name) {
this.clearContentTypeInfo()
this.$message.error('请输入详情分类')
return;
}
const params = {
name
}
if(id) params.id = id
this.$apis.discover.updateContentTypeApi(params).then(res => {
if(res) {
this.clearContentTypeInfo()
this.$message.success(`${id ? '修改成功' : '新增成功' }`)
this.getContentTypeList(1)
}
})
},
changeTable(item, index) {
this.curTypeIdx = index
},
getContentTypeList(isEdit){
this.$apis.discover.getContentTypeListApi({}).then(res => {
if(res?.length){
this.contentTypeList = res.map(item => {
let selected = false
if(isEdit) {
let target = this.selectedtypeList.find(ele => ele.typeId == item.id)
target && (selected = true)
}
return {...item, selected}
})
}
})
},
async getContentDetail(){
await this.getContentTypeList()
this.$apis.discover.getContentDetailApi({id : this.routeInfo.id}).then(res => {
if(res?.id){
for(let key in this.formObj){
this.formObj[key] = res[key]
}
if(res.mediaType == 2){
this.formObj.imageUrl = res.vedioUrl
}
res.detailList?.forEach(item => {
const target = this.contentTypeList.find(ele => ele.id ==item.typeId)
if(target){
target.selected = true
item.name = target.name
item.selected = true
}
item.buttonEventType = item.buttonEventType == 2
item.posterEventType = item.posterEventType == 2
})
this.selectedtypeList = res.detailList
}
})
},
commitForm(){
this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
if(valid) {
let selectedtypeList = JSON.parse(JSON.stringify(this.selectedtypeList))
let formObj = JSON.parse(JSON.stringify(this.formObj))
selectedtypeList.forEach(element => {
const {posterEventType, posterEventUrl, buttonEventType, buttonEventName, buttonEventUrl} = element
element.posterEventType = posterEventType ? 2: 1
element.posterEventUrl = posterEventType ? posterEventUrl : ''
element.buttonEventType = buttonEventType ? 2: 1
element.buttonEventName = buttonEventType ? buttonEventName : ''
element.buttonEventUrl = buttonEventType ? buttonEventUrl : ''
if(this.routeInfo.id) element.contentId = this.routeInfo.id
})
const isImage = util.isImage(this.formObj.imageUrl)
const params = {
...formObj,
imageUrl: isImage ? this.formObj.imageUrl : '',
vedioUrl: isImage ? '' : this.formObj.imageUrl,
mediaType: isImage ? 1 : 2,
detailList: selectedtypeList,
subMenuId: this.routeInfo.thirdMenuId || this.routeInfo.secondaryMenuId
}
if(this.routeInfo.id) params.id = this.routeInfo.id
this.$apis.discover.addContentApi(params).then(res => {
if(res) {
this.$message.success('操作成功')
this.goListPage()
}
})
}else{
this.$message.error('请补充完整数据')
}
})
},
selectContentType(row){
const targetIdx = this.selectedtypeList.findIndex(item => item.typeId == row.id)
if(targetIdx>-1) {
row.selected = false
this.selectedtypeList.splice(targetIdx, 1)
this.curTypeIdx = 0
}else{
row.selected = true
let obj = {
name: row.name,
typeId: row.id,
selected: true,
posterEventType: false,
posterEventUrl: '',
buttonEventType: false,
buttonEventUrl: '',
buttonEventName: '',
videoUrl: '',
posterUrl: ''
}
this.selectedtypeList.push(obj)
this.curTypeIdx = this.selectedtypeList.length - 1
}
},
editContentType(item){
this.contentTypeObj = {
id: item.id,
name: item.name
}
},
addContentType(){
this.isEditType = true
},
goListPage(){
const { menuId , thirdMenuId, secondaryMenuId} = this.routeInfo
window.localStorage.setItem('menuInfo', JSON.stringify({menuId , thirdMenuId, secondaryMenuId}))
this.$router.push({path: '/discoverManager/index'})
}
}
}
</script>
<style scoped lang="scss">
.ctnr{
padding: 20px 20px 34px;
background-color: #fff;
.glsx-combi-form{
.big-title{
margin-left: 74px;
font-weight: 600;
font-size: 16px;
color: #333333;
margin-bottom: 20px;
}
.detail-title{
border-top: 1px dashed #EDEDED;
padding-top: 20px;
}
.business-slot{
.module{
color: #666666;
}
.arrow-right{
font-weight: 600;
margin:0 3px;
vertical-align: middle;
}
.active{
color: #5850FF;
}
}
.view-slot{
/deep/ .el-input{
width: 136px;
}
}
.cover-wrap{
box-shadow: 0 6px 20px 0 #7a7a7a33;
position: relative;
width: 88px;
height: 86px;
border-radius: 0 0 4px 4px;
/deep/ .img-item, /deep/ .operate{
border-radius: 4px 4px 0 0;
}
.title{
padding: 0 8px;
box-sizing: border-box;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 12px;
color: #323436;
position: absolute;
z-index: 5;
width: 100%;
text-align: center;
height: 26px;
background-color: #fff;
bottom: 0;
line-height: 26px;
border-radius: 0 0 4px 4px;
}
}
.expansion-detail-slot{
.tab-item {
display: inline-block;
margin-right: 4px;
height: 26px;
line-height: 26px;
padding: 0 20px;
background: #FAFBFE;
border: 1px solid #E8E8EA;
border-radius: 4px;
font-weight: 400;
font-size: 14px;
color: #666666;
cursor: default;
box-sizing: border-box;
position: relative;
&:hover{
.edit{
display: inline-block;
}
}
.active-label{
position: absolute;
right: -1px;
top: -1px;
width: 16px;
height: 16px;
}
.edit{
display: none;
top: 50%;
transform: translateY(-50%);
position: absolute;
cursor: pointer;
margin-left: 2px;
}
}
.active-tab{
border: 1px solid #5850FF;
color: #5850FF;
background-color: #fff;
}
.editing{
border: none;
padding: 0;
}
.add-btn{
background-color: transparent;
border: 1px dashed #00000026;
padding: 0 8px;
color: #333333;
cursor: pointer;
i {
margin-right: 4px;
font-size: 12px;
vertical-align: middle;
}
}
.add-input{
height: 26px;
width: 92px;
/deep/ .el-input__inner{
height: 26px;
margin-top: -5px;
}
}
.global-title-wrap{
.expansion-content{
border: 1px solid #E5E5E5;
width: 100%;
padding: 20px;
.link-slot{
position: relative;
/deep/ .el-checkbox__input.is-checked+.el-checkbox__label{
color: #333;
}
/deep/ .el-checkbox__label{
padding-left: 6px;
}
.link-btn{
color: #5850FF;
cursor: pointer;
margin-left: 18px;
}
.link-dialog{
border-radius: 4px;
background-color: #FAFAFA;
position: absolute;
z-index: 2;
transform: translate(0, -100%);
left: 0;
top: 0;
padding: 20px 20px 20px 0;
box-shadow: 0 4px 12px 0 #00000014;
label{
display: inline-block;
width: 154px;
text-align: right;
&::before{
content: "*";
color: #f56c6c;
margin-right: 4px;
}
}
.el-input{
width: 310px;
}
}
.button-link-dialog{
top: 100%;
transform: translate(0, 0);
}
}
}
}
}
}
}
.gl-footer{
margin-top: 16px;
}
</style>
\ No newline at end of file
<template>
<GLDialog mode="mid" :close-on-click-modal="false" :title="title" :visible.sync="visible" @onOk="onOk" :before-close="onCancel" @onCancel="onCancel">
<glsx-combi-form class="glsx-combi-form" ref="videoRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="formObj" :formData="formData" :formRules="rules">
<div slot="moduleSlot" class="radio-slot">
<el-radio-group @change="menuRadioChange('firstMenu')" v-model="contentObj.menuId">
<el-radio v-for="item in menuList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
<div slot="attrSlot" class="radio-slot">
<el-radio-group @change="menuRadioChange()" v-model="contentObj.secondaryMenuId">
<el-radio v-for="item in secondaryMenuList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
<div slot="sceneSlot" class="radio-slot">
<el-radio-group v-model="contentObj.thirdMenuId">
<el-radio v-for="item in thirdMenuList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
<div slot="contentSlot" class="radio-slot">
<el-radio-group v-model="formObj.type">
<el-radio :label="formObj.type">{{contentType[contentObj.type]}}</el-radio>
</el-radio-group>
</div>
<div slot="businessSlot" class="global-menu">
<span class="module">{{contentObj.menuName}}</span>
<i class="el-icon-arrow-right arrow-right"></i>
<span class="module">{{contentObj.secondaryMenuName}}</span>
<i class="el-icon-arrow-right arrow-right"></i>
<template v-if="contentObj.thirdMenuId">
<span class="module">{{contentObj.thirdMenuName}}</span>
<i class="el-icon-arrow-right arrow-right"></i>
</template>
<span class="module active">{{contentType[contentObj.type]}}</span>
</div>
<div slot="mainVideoSlot" class="main-video-slot">
<Upload tip="建议尺寸:最大5M" :formObj="formObj" btnName="上传海报" attr="prodImg"></Upload>
</div>
<div slot="linkConfigSlot">
<el-switch v-model="formObj.isLink" active-value="1" inactive-value="2" active-color="#5850FF" inactive-color="#E8E8EA"></el-switch>
<div class="link-tip"> 默认链接内容为特色产品中第一个产品内容详情</div>
</div>
</glsx-combi-form>
</GLDialog>
</template>
<script>
import Upload from '@/components/Upload'
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'AddVideo',
components: {
glsxCombiForm,
Upload
},
props: {
visible: {
type: Boolean,
default: false
},
contentObj: {
type: Object,
default: ()=>{
return {}
}
}
},
data(){
return {
contentType: {
1: '特色产品',
2: '案例视频',
3: '营销海报',
4: '操作指引'
},
detailVisible: false,
formObj: {
id: '',
menuId: '',
subMenuId: '',
type: '',
proName: '',
prodImg: '',
isLink: '2',
},
formData:[
{
label: '业务模块',
name: 'module',
isHide: true,
addHtml: 'moduleSlot'
},
{
label: '业务属性',
name: 'zone',
isHide: true,
addHtml: 'attrSlot'
},
{
label: '场景细分',
name: 'scene',
isHide: true,
addHtml: 'sceneSlot'
},
{
label: '内容专区',
name: 'contZone',
isHide: true,
addHtml: 'contentSlot'
},
{
label: '业务模块',
name: 'business',
isHide: false,
addHtml: 'businessSlot'
},
{
label: '海报标题',
name: 'proName',
isHide: false,
type: 'input',
maxlength: 8,
showLimit: true
},
{
label: '海报图片',
name: 'prodImg',
isHide: false,
addHtml: 'mainVideoSlot'
},
{
label: '是否配置链接',
isHide: true,
name: 'isLink',
addHtml: 'linkConfigSlot'
}
],
rules: {
isLink: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
proName: [{ required: true, message: '请输入海报标题', trigger: 'change' }],
business: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
module: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
zone: [{
required: true,
validator: (rule, value, callback) => {
if (!this.contentObj.secondaryMenuId) {
return callback(new Error('请选择业务属性'))
}else {
return callback()
}
},
trigger: 'change'
}
],
contZone: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
scene: [
{
required: true,
validator: (rule, value, callback) => {
if (this.thirdMenuList.length && !this.contentObj.thirdMenuId) {
return callback(new Error('请选择场景细分'))
}else {
return callback()
}
},
trigger: 'change'
}
],
prodImg: [
{
required: true,
validator: (rule, value, callback) => {
if (!this.formObj.prodImg) {
return callback(new Error('请上传海报图片'))
} else {
return callback()
}
},
trigger: 'change'
}
]
},
menuList: []
}
},
computed: {
title(){
return `${this.formObj.id ? '编辑': '新增'}${this.formObj.type==5 ? 'banner' : '内容'}`
},
secondaryMenuList(){
const target = this.menuList.find(item => item.id == this.contentObj.menuId)
return target?.subList || []
},
thirdMenuList(){
const target = this.secondaryMenuList.find(item => item.id == this.contentObj.secondaryMenuId)
return target?.subList || []
}
},
created() {
const { secondaryMenuId ,thirdMenuId , type} = this.contentObj
this.formObj = {...this.formObj, subMenuId: thirdMenuId || secondaryMenuId, type}
if(this.contentObj.id) {
this.formData.forEach(item => {
if(type==5){
item.isHide = !(item.name == 'isLink' || item.name == 'prodImg')
if(item.name == 'prodImg') item.label == 'banner'
}else{
const hideItemList = ['module', 'zone', 'contZone', 'scene']
if(hideItemList.includes(item.name)){
item.isHide = false
}
if(item.name=='business') item.isHide = true
}
});
this.getMenuList()
}
},
methods: {
menuRadioChange(level){
this.contentObj.thirdMenuId = ''
if(level=='firstMenu') this.contentObj.secondaryMenuId = ''
},
getMenuList() {
this.$apis.discover.getMenuListApi({}).then(res => {
this.getContentDetail()
if(res?.length){
this.menuList = res
}
})
},
closeDetailDialog(){
this.detailVisible = false
},
onCancel(){
this.contentObj.imageDialogVisible = false
// this.$emit('closeVideoDialog')
},
async getContentDetail(){
this.$apis.discover.getContentDetailApi({id: this.contentObj.id}).then(res => {
if(res?.id){
for(const key in this.formObj){
this.formObj[key] = res[key]
}
}
})
},
onOk() {
console.log(this.formObj)
this.$refs.videoRef.$refs.formRef.validate(valid => {
if(valid) {
const params = JSON.parse(JSON.stringify(this.formObj))
if(!this.contentObj.id) delete params.id
if(this.contentObj.type==3){
params.subMenuId = this.contentObj.thirdMenuId || this.contentObj.secondaryMenuId
delete params.isLink
}else{
params.subMenuId = this.contentObj.secondaryMenuId
delete params.proName
}
this.$apis.discover.addContentApi(params).then(res => {
if(res) {
this.$message.success('操作成功')
this.onCancel()
this.$parent.handleSearch();
}
})
}
})
},
}
}
</script>
<style lang="scss" scoped>
.main-video-slot{
display: flex;
/deep/ .upload-ctnr{
margin-right: 8px;
}
}
.radio-slot{
/deep/ .el-radio{
margin-right: 20px;
line-height: 25px;
.el-radio__label{
width: 100px;
display: inline-block;
}
}
}
.link-tip{
height: 17px;
line-height: 17px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 12px;
color: #999999;
}
</style>
\ No newline at end of file
<template>
<GLDialog mode="mid" :close-on-click-modal="false" :title="title" :visible.sync="visible" @onOk="onOk" :before-close="onCancel" @onCancel="onCancel">
<glsx-combi-form class="glsx-combi-form" ref="videoRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="formObj" :formData="formData" :formRules="rules">
<div slot="moduleSlot" class="radio-slot">
<el-radio-group @change="menuRadioChange('firstMenu')" v-model="contentObj.menuId">
<el-radio v-for="item in menuList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
<div slot="attrSlot" class="radio-slot">
<el-radio-group @change="menuRadioChange()" v-model="contentObj.secondaryMenuId">
<el-radio v-for="item in secondaryMenuList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
<div slot="sceneSlot" class="radio-slot">
<el-radio-group v-model="contentObj.thirdMenuId">
<el-radio v-for="item in thirdMenuList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
<div slot="contentSlot" class="radio-slot">
<el-radio-group v-model="formObj.type">
<el-radio :label="formObj.type">{{contentType[contentObj.type]}}</el-radio>
</el-radio-group>
</div>
<div slot="businessSlot" class="global-menu">
<span class="module">{{contentObj.menuName}}</span>
<i class="el-icon-arrow-right arrow-right"></i>
<span class="module">{{contentObj.secondaryMenuName}}</span>
<i class="el-icon-arrow-right arrow-right"></i>
<template v-if="contentObj.thirdMenuId">
<span class="module">{{contentObj.thirdMenuName}}</span>
<i class="el-icon-arrow-right arrow-right"></i>
</template>
<span class="module active">{{contentType[contentObj.type]}}</span>
</div>
<div slot="mainVideoSlot" class="main-video-slot">
<Upload fileType="video" :formObj="formObj" btnName="上传视频" attr="vedioUrl" coverAttr="prodImg"></Upload>
<Upload tip="建议尺寸:最大5M,138*84px" :formObj="formObj" btnName="上传视频封面" attr="prodImg"></Upload>
</div>
<div slot="viewSlot" class="view-slot">
<el-input placeholder="请输入观看人数" v-model="formObj.view" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" type="text"></el-input>
</div>
</glsx-combi-form>
</GLDialog>
</template>
<script>
import Upload from '@/components/Upload'
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'AddVideo',
components: {
glsxCombiForm,
Upload
},
props: {
visible: {
type: Boolean,
default: false
},
contentObj: {
type: Object,
default: ()=>{
return {}
}
}
},
data(){
return {
contentType: {
1: '特色产品',
2: '案例视频',
3: '营销海报',
4: '操作指引'
},
detailVisible: false,
formObj: {
id: '',
menuId: '',
subMenuId: '',
type: '',
proName: '',
title: '',
vedioUrl: '',
prodImg: '',
view: ''
},
formData:[
{
label: '业务模块',
name: 'module',
isHide: true,
addHtml: 'moduleSlot'
},
{
label: '业务属性',
name: 'zone',
isHide: true,
addHtml: 'attrSlot'
},
{
label: '场景细分',
name: 'scene',
isHide: true,
addHtml: 'sceneSlot'
},
{
label: '内容专区',
name: 'contZone',
isHide: true,
addHtml: 'contentSlot'
},
{
label: '业务模块',
name: 'business',
isHide: false,
addHtml: 'businessSlot'
},
{
label: '封面标题',
name: 'proName',
type: 'input',
maxlength: 30,
showLimit: true
},
{
label: '内容标题',
name: 'title',
type: 'input',
maxlength: 30,
showLimit: true
},
{
label: '主视频',
name: 'mainVideo',
addHtml: 'mainVideoSlot'
},
{
label: '观看人数',
name: 'view',
addHtml: 'viewSlot'
},
],
rules: {
proName: [
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入封面标题'))
} else if(value.length>30) {
return callback(new Error('封面标题不能大于30个字'))
}else {
return callback()
}
},
trigger: 'change'
}
],
title: [
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入内容标题'))
} else if(value.length>30) {
return callback(new Error('内容标题不能大于30个字'))
}else {
return callback()
}
},
trigger: 'change'
}
],
view: [{ required: true, message: '请输入观看人数', trigger: 'change' }],
business: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
module: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
zone: [{
required: true,
validator: (rule, value, callback) => {
if (!this.contentObj.secondaryMenuId) {
return callback(new Error('请选择业务属性'))
}else {
return callback()
}
},
trigger: 'change'
}
],
contZone: [{required: true, validator: (rule, value, callback) => {return callback() }, trigger: 'change'}],
scene: [
{
required: true,
validator: (rule, value, callback) => {
if (this.thirdMenuList.length && !this.contentObj.thirdMenuId) {
return callback(new Error('请选择场景细分'))
}else {
return callback()
}
},
trigger: 'change'
}
],
mainVideo: [
{
required: true,
validator: (rule, value, callback) => {
if (!this.formObj.vedioUrl) {
return callback(new Error('请上传主视频'))
} else if(!this.formObj.prodImg) {
return callback(new Error('请上传视频封面'))
}else {
return callback()
}
},
trigger: 'change'
}
]
},
menuList: []
}
},
computed: {
title(){
return `${this.formObj.id ? '编辑': '新增'}${this.contentObj.type==2 ? '案例视频' : '操作指引'}`
},
secondaryMenuList(){
const target = this.menuList.find(item => item.id == this.contentObj.menuId)
return target?.subList || []
},
thirdMenuList(){
const target = this.secondaryMenuList.find(item => item.id == this.contentObj.secondaryMenuId)
return target?.subList || []
}
},
created() {
const { secondaryMenuId ,thirdMenuId , type} = this.contentObj
this.formObj = {...this.formObj, subMenuId: thirdMenuId || secondaryMenuId, type}
if(this.contentObj.id) {
this.formData.forEach(item => {
const hideItemList = ['module', 'zone', 'contZone', 'scene']
if(hideItemList.includes(item.name)){
item.isHide = false
}
if(item.name=='business') item.isHide = true
});
this.getMenuList()
}
},
methods: {
menuRadioChange(level){
this.contentObj.thirdMenuId = ''
if(level=='firstMenu') this.contentObj.secondaryMenuId = ''
},
getMenuList() {
this.$apis.discover.getMenuListApi({}).then(res => {
this.getContentDetail()
if(res?.length){
this.menuList = res
}
})
},
closeDetailDialog(){
this.detailVisible = false
},
onCancel(){
console.log(this.contentObj)
this.contentObj.videoDialogVisible = false
// this.$emit('closeVideoDialog')
},
async getContentDetail(){
this.$apis.discover.getContentDetailApi({id: this.contentObj.id}).then(res => {
console.log(res)
if(res?.id){
for(const key in this.formObj){
this.formObj[key] = res[key]
}
}
})
},
onOk() {
console.log(this.formObj)
this.$refs.videoRef.$refs.formRef.validate(valid => {
if(valid) {
const params = JSON.parse(JSON.stringify(this.formObj))
params.subMenuId = this.contentObj.thirdMenuId || this.contentObj.secondaryMenuId
if(!this.contentObj.id) delete params.id
this.$apis.discover.addContentApi(params).then(res => {
if(res) {
this.$message.success('操作成功')
this.onCancel()
this.$parent.handleSearch();
}
})
}
})
},
}
}
</script>
<style lang="scss" scoped>
.main-video-slot{
display: flex;
/deep/ .upload-ctnr{
margin-right: 8px;
}
}
.radio-slot{
/deep/ .el-radio{
margin-right: 20px;
line-height: 25px;
.el-radio__label{
width: 100px;
display: inline-block;
}
}
}
.view-slot{
/deep/ .el-input{
width: 136px;
}
}
</style>
\ No newline at end of file
<template>
<div class="menu">
<el-tree
class="menu-tree"
:data="menuList"
node-key="id"
default-expand-all
:props="defaultProps">
<span :class="['custom-tree-node',{'menu-active': (!curModuleInfo.thirdMenuId && node.level ==2 && curModuleInfo.secondaryMenuId == data.id) || (curModuleInfo.thirdMenuId== data.id && node.level ==3)}]" slot-scope="{ node, data }" @click="selectedSubmenu('tree' ,node)" >
<span>{{ node.label }}</span>
<span class="son-operate-wrap">
<img class="operate-btn" @click.stop="showOperateDialog(node, data)" :src="require('@/assets/draggable.png')" />
<div class="son-operate-dialog" ref="menuOpRef" v-show="boxShow && menuForm.id == data.id">
<ul>
<li class="operate-item" v-for="oItem in node.level ==1 ? primaryLevelOpList : node.level ==2 ? secondLevelOpList : secondLevelOpList.slice(1, 4)" :key="oItem.name" @click.stop="addMenu(oItem)">{{ oItem.name }}</li>
</ul>
</div>
</span>
</span>
</el-tree>
<GLDialog :title="title" mode="small" :visible.sync="menuVisible" @onOk="commitMenu" :before-close="closeMenuDialog" @onCancel="closeMenuDialog">
<div class="menu-dialog-body">
<el-form ref="menuRef" label-width="154px" :rules="menuRules" :model="menuForm">
<el-form-item label="模块名称:" prop="name" class="m-t-20">
<el-input style="width: 284px;" :size="size" type="text" v-model="menuForm.name" placeholder="请输入" :maxlength="menuForm.level==1 && menuForm.type=='rename' ? 6 : 8" show-word-limit></el-input>
</el-form-item>
</el-form>
</div>
</GLDialog>
</div>
</template>
<script>
export default {
name: 'Menu',
props: {
name: {
type: String,
default: ''
}
},
computed: {
title() {
return this.menuForm.type == 'rename' ? '重命名' : this.menuForm.position == '1' ? '新增子级' : '新建菜单'
}
},
data() {
return {
menuVisible: false,
defaultProps: {
children: 'subList',
label: 'name'
},
menuForm: {
id: '',
name: '',
position: '',
sceneCode: '',
type: '',
level: ''
},
menuRules: {
name: [
{
required: true,
validator: (rule, value, callback) => {
if (!value || (value && !value.trim())) {
return callback(new Error('请输入菜单名称'))
} else {
return callback()
}
},
trigger: 'change'
}
]
},
primaryLevelOpList: [
{
name: '新增子级',
type: 'add',
position: 1
},
{
name: '重命名',
type: 'rename'
}
],
secondLevelOpList:[
{
name: '新增子级',
type: 'add',
position: 1
},
{
name: '下方新增同级',
type: 'add',
position: 3
},
{
name: '上方新增同级',
type: 'add',
position: 2
},
{
name: '重命名',
type: 'rename'
}
],
menuList: [],
curModuleInfo: {
menuName: '',
menuId: '',
secondaryMenuName: '',
secondaryMenuId: '',
thirdMenuName: '',
thirdMenuId: '',
},
boxShow: false
}
},
created(){
const menuInfo = window.localStorage.getItem('menuInfo') //判断是否是新增产品进来,不切换二级目录
if(menuInfo){
this.getMenuList('rename', JSON.parse(menuInfo))
}else{
this.getMenuList()
}
},
mounted() {
document.addEventListener("click", this.eventListener);
},
beforeDestroy(){
document.removeEventListener("click", this.eventListener);
},
methods: {
eventListener(e){
if (!this.$refs?.menuOpRef?.[0]?.contains(e.target)) this.boxShow = false;
},
allowDrop(draggingNode, dropNode, type) {
if (draggingNode.level === dropNode.level) {
return type === 'prev' || type === 'next'
} else if (draggingNode.level == 2 && dropNode.level==1) {
return type === 'inner'
} else {
return false
}
},
getMenuList(type, menuInfo) {
this.$apis.discover.getMenuListApi({}).then(res => {
if(res?.length){
this.menuList = res
let menuItem = res[0] || {}
let secondaryMenuItem = menuItem?.subList[0] || {}
let thirdMenuItem = secondaryMenuItem?.subList[0] || {}
if(type=='rename') {
let curItem = menuInfo ? menuInfo : this.curModuleInfo
const {menuId, secondaryMenuId, thirdMenuId} = curItem
menuItem = res.find(item => item.id == menuId)
secondaryMenuItem = menuItem?.subList?.find(item => item.id == secondaryMenuId)
thirdMenuItem = secondaryMenuItem?.subList?.find(item => item.id == thirdMenuId)
window.localStorage.removeItem('menuInfo')
}
// else{
// res.forEach(item => {
// item.subList.forEach(ele => {
// if(ele.subList?.length){
// menuItem = item
// secondaryMenuItem = ele
// thirdMenuItem = ele.subList[0]
// }
// })
// })
// }
this.selectedSubmenu('', menuItem, secondaryMenuItem, thirdMenuItem)
}
})
},
selectedSubmenu(type, menuItem={}, secondaryMenuItem={}, thirdMenuItem={}){
this.boxShow = false
let firstMenuItem = menuItem
if(type=='tree') {
if(menuItem.level==1) return
if(menuItem.level==2) {
if(menuItem.data.subList?.length) return;
firstMenuItem = menuItem?.parent?.data || {}
secondaryMenuItem = menuItem.data
}else{
firstMenuItem = menuItem?.parent?.parent?.data || {}
secondaryMenuItem = menuItem?.parent?.data || {}
thirdMenuItem = menuItem.data
}
}
this.curModuleInfo = {
menuName: firstMenuItem.name,
menuId: firstMenuItem.id,
secondaryMenuName: secondaryMenuItem.name,
secondaryMenuId: secondaryMenuItem.id,
thirdMenuName: thirdMenuItem.name || '',
thirdMenuId: thirdMenuItem.id || '',
}
this.$parent.handleSearch();
},
addMenu(item){
const { position, type } = item
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 => {
if(valid){
const { id, name, position , sceneCode , type } = this.menuForm
let params = {}
if(type=='add'){
params = { name, position, sceneCode }
if(position==1) params.parentMenuId = id
if(position==2 || position==3) params.menuId = id
}else{
params = { id, name }
}
const api = params.id ? 'updateMenuApi' : 'addMenuApi'
this.$apis.discover[api](params).then(res => {
if(res){
this.menuVisible = false
this.$message.success(`${params.id ? '修改成功' : '新增成功'}`)
this.getMenuList('rename')
}
})
}
})
},
showOperateDialog(node, item){
this.boxShow = true
const {id, sceneCode, name} = item
this.menuForm = {...this.menuForm, id, sceneCode, name, level: node.level}
},
closeMenuDialog(){
this.menuVisible = false
}
}
}
</script>
<style lang="scss" scoped>
.menu{
padding: 18px 4px 18px 16px;
width: 260px;
box-sizing: border-box;
.menu-tree{
color: #333333;
font-size: 14px;
/deep/ .el-tree-node__content{
height: 28px;
line-height: 28px;
.el-tree-node__expand-icon {
color: #333333;
}
.custom-tree-node{
width: 100%;
display: flex;
justify-content: space-between;
.son-operate-wrap{
position: relative;
.operate-btn{
height: 16px;
width: 16px;
vertical-align: middle;
color: #5850FF;
cursor: pointer;
}
.son-operate-dialog{
position: absolute;
background-color: #fff;
top: 80%;
right: 4px;
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px 0 #00000014, 0 9px 28px 8px #0000000d;
z-index: 999;
.operate-item{
height: 36px;
line-height: 36px;
padding: 0 20px;
font-size: 14px;
color: #666666;
list-style: none;
&:hover{
background: #F2F1FF;
}
}
}
}
}
.menu-active{
background: #F2F1FF;
}
}
/deep/ .el-tree-node__children{
overflow: unset;
.is-leaf::before {
// 隐藏或加透明都可以
// display: none;
opacity: 0;
}
.el-tree-node__content{
// padding-left: 0!important;
.custom-tree-node{
&:hover{
background-color: #F5F7FA;
}
}
}
.is-current{
background-color: #fff!important;
}
}
/deep/ .el-tree-node.is-current > .el-tree-node__content {
background-color: #fff !important;
}
/deep/ .el-tree-node__content:hover, .el-upload-list__item:hover{
background-color: #fff !important;
}
}
}
/deep/ .menu-tree>.el-tree-node>.el-tree-node__children>.el-tree-node>.el-tree-node__children>.el-tree-node{
// .el-tree-node__expand-icon {
// display: none;
// }
.custom-tree-node{
&:hover{
background-color: #F5F7FA;
}
}
}
</style>
\ No newline at end of file
<template>
<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>
</div>
</glsx-combi-form>
</GLDialog>
</template>
<script>
import Upload from '@/components/Upload'
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'AddVideo',
components: {
glsxCombiForm,
Upload
},
props: {
visible: {
type: Boolean,
default: false
},
formObj: {
type: Object,
default: ()=>{
return {
title: '',
url: ''
}
}
}
},
data(){
return {
detailFormObj: {
title: '',
url: ''
},
detailFormData: [
{
label: '产品名称',
name: 'title',
type: 'input',
maxlength: 12,
showLimit: true
},
{
label: '产品封面',
name: 'url',
addHtml: 'coverSlot'
}
],
detailRules: {
title: [{ required: true, message: '请输入产品名称', trigger: 'change' }],
url: [{ required: true, message: '请上传产品封面', trigger: 'change' }]
},
}
},
created(){
const {title, url } = this.formObj
this.detailFormObj = { title, url }
},
methods: {
onCancel(){
this.$emit('closeDialog')
},
onOk() {
this.$refs.detailRef.$refs.formRef.validate(valid => {
if(valid){
const { title, url} = this.detailFormObj
this.$emit('confirmDialog',{ title, url })
}
})
},
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<div class="menu-wrap">
<Menu ref="menuRef" class="menu"></Menu>
</div>
<div class="list">
<GLCombiForm class="search-wrap" ref="searchRef" labelWidth="154px" defaultWidth="432px" @handleOk="handleSearch" @handleRest="handleReset" :formObj="searchFormObj" :formData="searchFormData">
</GLCombiForm>
<div class="operate-wrap">
<span class="table-title">内容列表</span>
<div class="operate-btn">
<el-button :size="size" type="primary">新增<i class="el-icon-arrow-down arrow-icon"></i></el-button>
<div class="dropdown-wrap">
<ul>
<li class="dropdown-item" @click="addContent(item)" v-for="item in contentTypeList" :key="item.id">{{ item.name }}</li>
</ul>
</div>
</div>
</div>
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchObj" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="coverImageSlot" slot-scope="scope">
<el-image
class="cover-img"
:src="scope.scope.prodImg"
:preview-src-list="[scope.scope.prodImg]">
</el-image>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
<AddImage v-if="contentObj.imageDialogVisible" :contentObj="contentObj" :visible="contentObj.imageDialogVisible"></AddImage>
<AddVideo v-if="contentObj.videoDialogVisible" :contentObj="contentObj" :visible="contentObj.videoDialogVisible"></AddVideo>
</div>
</template>
<script>
const CONTENT_LIST = [
{
id: '1',
name: '特色方案'
},
{
id: '2',
name: '案例视频'
},
{
id: '3',
name: '营销海报'
},
{
id: '4',
name: '操作指引'
},
{
id: '5',
name: 'banner'
}
]
import Menu from './components/Menu'
import AddVideo from './components/AddVideo'
import AddImage from './components/AddImage'
export default {
name: 'discover',
components: {
Menu,
AddVideo,
AddImage
},
data() {
return {
contentObj: {
imageDialogVisible: false,
videoDialogVisible: false,
type: ''
},
contentTypeList: CONTENT_LIST.slice(0, 4),
operateList:[
{
name: '新增子集'
},
{
name: '重命名'
}
],
getListApi: this.$apis.discover.getListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchFormObj: {
type: '',
status: '',
subMenuId: '4'
},
searchObj: {},
searchFormData: [
{
label: '所属内容专区',
name: 'type',
type: 'select',
optionList: [{id: '',name: '全部'}, ...CONTENT_LIST],
optionId: 'id',
optionLabel: 'name',
isClear: true
},
{
label: '状态',
name: 'status',
type: 'select',
optionList: [
{
id: '',
name: '全部'
},
{
id: '1',
name: '已上架'
},
{
id: '2',
name: '已下架'
}
],
optionId: 'id',
optionLabel: 'name',
isClear: true
},
],
buttonList: [
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.addContent(row.scope, 1)
}
},
{
type: 'el-button',
name: '上架',
attrs: {
type: 'text',
fn: '上架'
},
condition: row => {
return row.scope.type != 5 && row.scope.status != 1
},
listeners: {
click: row => this.updateStatus(row.scope.id, 1)
}
},
{
type: 'el-button',
name: '下架',
attrs: {
type: 'text',
fn: '下架'
},
condition: row => {
return row.scope.type != 5 && row.scope.status == 1
},
listeners: {
click: row => this.updateStatus(row.scope.id, 2)
}
}
],
tableParams: {
listName: 'list',
tableOption: {
width: 150
},
tableColumns: [
{
label: '所属内容专区',
formatter: (cell) => {
return CONTENT_LIST.find(item => item.id == cell.type).name
}
},
{
label: '封面图片',
prop: 'coverImage',
addHtml: 'coverImageSlot'
},
{
label: '内容封面标题',
prop: 'proName',
},
{
label: '状态',
prop: 'status',
formatter: (cell) => {
return (cell.status == 1 || cell.type == 5) ? '已上架' : '已下架'
}
},
]
},
}
},
created() {
},
mounted() {
},
methods:{
addContent(item, isEdit){
let type = isEdit ? item.type : item.id
if(type != 1){
this.contentObj = {
imageDialogVisible: type==3 || type==5,
videoDialogVisible: type==2 || type==4,
...this.$refs.menuRef.curModuleInfo,
type,
}
if(isEdit) this.contentObj.id = item.id
}else{
let params = {
...this.$refs.menuRef.curModuleInfo,
}
if(isEdit) params.id = item.id
const queryStr = encodeURIComponent(JSON.stringify(params))
this.$router.push({ path: `/discoverManager/addProd/`+queryStr,query: { $title: isEdit ? '编辑特色方案' : '新增特色方案' }})
}
},
updateStatus(id, status) {
if(status==2){
this.$confirm('请确认是否下架', '提示', {
confirmButtonText: '下架',
cancelButtonText: '否',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.toShelfProd(id, status)
}
}
})
}else{
this.toShelfProd(id, status)
}
},
toShelfProd(id, status){
this.$apis.discover.updateStatusApi({id, status}).then(res => {
if(res){
this.$message.success(`${status == 2 ? '下架成功' : '上架成功'}`)
this.handleSearch()
}
})
},
handleSearch(){
this.$refs.tableRef.refreshTable()
},
handleReset(){
this.searchFormObj = {
type: '',
status: '',
subMenuId: ''
},
this.handleSearch()
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchFormObj))
const { secondaryMenuId, thirdMenuId } = this.$refs.menuRef.curModuleInfo
params.subMenuId = thirdMenuId || secondaryMenuId
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchObj = this.getParams()
resolve()
})
},
}
}
</script>
<style scoped lang="scss">
.ctnr{
position: relative;
.search-wrap{
/deep/ .el-form-item {
&, .search-item{
width: 312px;
}
}
}
.operate-btn{
position: relative;
&:hover{
.dropdown-wrap {
display: block;
}
}
.arrow-icon{
margin-left: 8px;
}
.dropdown-wrap{
display: none;
position: absolute;
background-color: #fff;
top: 100%;
width: 96px;
left: 0;
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px 0 #00000014, 0 9px 28px 8px #0000000d;
z-index: 50;
.dropdown-item{
height: 36px;
line-height: 36px;
padding: 0 20px;
font-size: 14px;
color: #666666;
list-style: none;
cursor: default;
&:hover{
background: #F2F1FF;
color: #5850FF;
}
}
}
}
.cover-img{
height: 36px;
width: 36px;
}
.list{
background-color: #fff;
padding: 20px;
margin-left: 276px;
}
.menu-wrap{
overflow-y: auto;
position: absolute;
height: -webkit-fill-available;
background-color: #fff;
min-height: calc(100vh - 125px);
&::-webkit-scrollbar{
width: 4px;
}
}
}
</style>
\ No newline at end of file
......@@ -3,7 +3,7 @@ const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://cdn.bootcdn.net/'
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!