Commit db4ca2ce by 前端

Merge branch 'v3.13.1' into 'master'

V3.13.1

See merge request !3
2 parents f22f3cb1 94cced33
import { http } from '@/main'
const url = 'rop-scrm-shopmall/router'
// 分页查询频道列表
const getCaseListApi = params => {
params.method = `scrm.api.shopmall.discover.case.page`
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const getVideoListApi = params => {
params.method = `scrm.api.shopmall.tencentcloudmedia.page`
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const delCaseApi = params => {
params.method = `scrm.api.shopmall.discover.case.delete`
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const addCaseApi = params => {
params.method = `scrm.api.shopmall.discover.case.insert.or.update`
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const getCarSeriesApi= params => {
params.method = 'scrm.api.carlife.common.getCarBrandList'
return http({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCaseDetailApi = params => {
params.method = 'scrm.api.shopmall.discover.case.detail'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default {
getCaseListApi,
getVideoListApi,
delCaseApi,
addCaseApi,
getCarSeriesApi,
getCaseDetailApi
}
\ No newline at end of file
import { http } from '@/main'
const url = 'rop-scrm-shopmall/router'
const addCategoryApi = params => {
params.method = 'scrm.api.shopmall.discover.category.insert.or.update'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const getCategoryListApi = params => {
if(params.categoryLevel == 2 && !params.parentCategoryId){
return new Promise((resolve, reject)=>{
reject()
})
}
console.log(params, '8888')
params.method = 'scrm.api.shopmall.discover.category.page'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const delCategoryApi = params => {
params.method = 'scrm.api.shopmall.discover.category.delete'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const batchAddCategoryApi = params => {
params.method = 'scrm.api.shopmall.discover.category.insert.batch'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default {
addCategoryApi,
getCategoryListApi,
delCategoryApi,
batchAddCategoryApi
}
\ No newline at end of file
import { http } from '@/main'
const url = 'rop-scrm-shopmall/router'
const getGoodsListApi = params => {
params.method = 'scrm.api.shopmall.goods.configuration.page'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const updateGoodsStatusApi = params => {
params.method = 'scrm.api.shopmall.goods.configuration.upgrade.update.status'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const delGoodsApi = params => {
params.method = 'scrm.api.shopmall.goods.configuration.upgrade.delete'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const getCarlifeGoodsApi = params => {
params.method = 'scrm.api.shopmall.goods.smartcarlife.page'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const addGoodsApi = params => {
params.method = 'scrm.api.shopmall.goods.configuration.upgrade.add.or.update'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const getGoodsDetail = params => {
params.method = 'scrm.api.shopmall.goods.configuration.detail'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const getMerchantListApi = params => {
params.method = 'scrm.api.shopmall.goods.smartcarlife.detail'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default {
getGoodsListApi,
updateGoodsStatusApi,
delGoodsApi,
getCarlifeGoodsApi,
addGoodsApi,
getGoodsDetail,
getMerchantListApi
}
\ No newline at end of file
......@@ -66,7 +66,8 @@ const getconfigMerchant = params => {
}
// 分页查询频道主题(内容)列表
const getChannelTopicList = params => {
params.method = `scrm.api.shopmall.discover.channel.topic.page`
params.method = params.apiType == 5 ? `scrm.api.shopmall.goods.configuration.page` : `scrm.api.shopmall.discover.channel.topic.page`
if(params.apiType == 5) params.pageNum = params.currentPage
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
......@@ -206,4 +207,19 @@ const getCouponconfig = params => {
returnAll: true
})
}
export default { getCouponconfig, configCoupons, getDirectionalGiftListApi, deleteChannel, updownshelvesChannel, topshelvesChannel, goodsActivity, crowdfundingActivity, bulgeActivity, getTencentcloudmedialist, addChannelTopic, getTopicDetail, getChannelTopicList, getMerchantListApi, openSubscribe, selStoreConfig, getMerchantShare, configMerchant, getconfigMerchant }
// 获取车系详情
const getCategoryByMerchant = params => {
params.method = 'scrm.api.shopmall.discover.channel.merchant.config.detail'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getCouponconfig, configCoupons, getDirectionalGiftListApi, deleteChannel, updownshelvesChannel, topshelvesChannel, goodsActivity, crowdfundingActivity, bulgeActivity, getTencentcloudmedialist, addChannelTopic, getTopicDetail, getChannelTopicList, getMerchantListApi, openSubscribe, selStoreConfig, getMerchantShare, configMerchant, getconfigMerchant, getCategoryByMerchant }
......@@ -20,28 +20,35 @@ html {
.p-t-20 {
padding-top: 20px;
}
.container {
background: #ffffff;
padding: 20px;
}
.word-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.flex {
display: flex;
align-items: center;
}
.mgt15 {
margin-top: 15px;
}
.mgt16 {
margin-top: 16px;
}
.mrt5 {
margin-top: 5px;
}
.text-tip {
font-weight: 400;
font-size: 14px;
......@@ -49,18 +56,22 @@ html {
margin-left: 154px;
margin-bottom: 10px;
}
.text-tip-line {
font-weight: 400;
font-size: 14px;
color: #999999;
}
.img-36 {
width: 36px;
height: 36px;
}
.pointer {
cursor: pointer;
}
.activity-box {
width: 248px;
height: auto;
......@@ -70,6 +81,7 @@ html {
box-sizing: border-box;
margin-top: 10px;
position: relative;
.activity-box-title {
font-weight: 600;
font-size: 14px;
......@@ -77,6 +89,7 @@ html {
margin-bottom: 10px;
line-height: 20px;
}
.time {
font-weight: 400;
font-size: 12px;
......@@ -84,17 +97,20 @@ html {
margin-bottom: 4px;
line-height: 17px;
}
.gift {
position: absolute;
bottom: 0;
width: 24px;
height: 24px;
right: 0;
img {
width: 100%;
}
}
}
.goodss-box {
width: 248px !important;
padding: 16px;
......@@ -105,27 +121,33 @@ html {
align-items: center;
margin-top: 10px;
}
.theme-color {
color: #5850ff;
}
.flex-default {
display: flex;
}
.goods-img {
width: 60px;
height: 60px;
border-radius: 2px;
margin-right: 8px;
img {
width: 100%;
height: 100%;
}
}
.goods-title {
font-size: 14px;
color: #333333;
line-height: 21px;
}
.goods-price {
color: #999999;
font-size: 12px;
......@@ -133,9 +155,46 @@ html {
line-height: 17px;
margin-top: 4px;
}
.table-popover-img {
width: 120px;
}
.mrb20{
margin-bottom :20px !important;;
.mrb20 {
margin-bottom: 20px !important;
;
}
.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 {
.export-btn {
margin-left: 8px;
}
}
}
.global-title {
height: 56px;
line-height: 56px;
border-bottom: 1px solid #e5e5e5;
padding-left: 20px;
box-sizing: border-box;
font-size: 16px;
color: #333333;
font-weight: 600;
background-color: #fff;
}
\ No newline at end of file
<template>
<el-input :value="value" v-bind="$attrs" v-on="{...$listeners}" @blur="blurFn"></el-input>
</template>
<script>
export default {
name: 'FormatInput',
props: ['value','precise','intDigit','maxVal','minVal'],
data() {
return {
}
},
watch:{
value:{
handler(nVal, oVal){
this.inputFn(nVal)
},
deep: true
}
},
mounted(){
},
methods:{
inputFn(e){
e = e ? String(e) : ''
this.intDigit = this.intDigit || 6
this.precise = this.precise || 2
let value = e
if(this.maxVal){
if(+this.maxVal<= +e) value = this.maxVal //加等号是因为 '500' == '500.' 导致多了点
}else{
const intDigitReg = this.intDigit == -1 ? `(^\\d+)(\\.\\d+)?` : `(^\\d{${this.intDigit}})\\d+(\\.\\d+)?`
value = e.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(new RegExp(intDigitReg,'g'), '$1').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(new RegExp(`^(-)*(\\d+)\\.(\\d{${this.precise}}).*$`), this.intDigit == -1 ? '$1$2' : '$1$2.$3')
}
this.$emit('input', value)
},
blurFn(e){
let value = e.target.value
if(this.minVal && +this.minVal>=value) value = this.minVal
this.$emit('input', value)
}
}
}
</script>
<style lang="scss" scoped>
</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 @submit.native.prevent :ref="formRef" :inline="isInline" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '154px' : labelWidth" :class="[{ 'no-label': !item.label, isBlock: isBlock }, { textBox: item.type == 'textBox' }]" :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">
......@@ -134,6 +134,10 @@ export default {
}
},
props: {
isInline :{
type: Boolean,
default: true
},
isBlock: {
type: Boolean,
default: false
......
......@@ -13,9 +13,11 @@ import glsxPreview from '@/components/preview/index.vue'
import glsxCombiForm from '@/components/glsx-combi-form/index.vue'
import bigView from '@/components/big-view/index.vue'
import activityModel from '@/components/activity-model/index.vue'
import FormatInput from '@/components/FormatInput/index.vue'
Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog)
Vue.component('glsx-preview', glsxPreview)
Vue.component('big-view', bigView)
Vue.component('activity-model', activityModel)
\ No newline at end of file
Vue.component('activity-model', activityModel)
Vue.component('format-input', FormatInput)
\ No newline at end of file
......@@ -164,10 +164,13 @@ export default {
height: 104px;
z-index: 999;
.pic-pane-close {
width: 14px;
height: 14px;
width: 16px;
height: 16px;
cursor: pointer;
margin-right: 8px;
margin-left: 24px;
&:first-child{
margin-left: 0;
}
img{
width:100%;
display: block;
......
<template>
<div class="case-ctnr">
<div class="main-wrap">
<div class="global-title">{{formObj.id ? '编辑案例': '新增案例'}}</div>
<glsx-combi-form :isInline="false" class="glsx-combi-form" ref="baseInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="formObj" :formData="formData" :formRules="myRule">
<div slot="videoCoverSlot">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.videoCoverArr" @change="changeChannelImg"></glsx-preview>
<div class="text-tip" style="margin: 0;">建议尺寸:272*364</div>
</div>
<div slot="selectBrandSlot">
<el-radio-group v-model="formObj.applyBrandType">
<el-radio :label="0">全部品牌</el-radio>
<el-radio :label="1">部分品牌</el-radio>
</el-radio-group>
<div v-if="formObj.applyBrandType == 1">
<el-button class="el-icon-plus" size="small" @click="openBrandDialog">选择品牌</el-button>
<div class="brand-wrap" v-if="brandList && brandList.length">
<div class="brand-item" v-for="item in brandList" :key="item.id">{{ item.name }}</div>
</div>
</div>
</div>
</glsx-combi-form>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button>
</GLFooter>
<selectCarSeriesDialog v-if="dialogVisible" :listData="brandList" @confirmDialog="confirmDialog" @closeDialog="openBrandDialog" :dialogVisible="dialogVisible"></selectCarSeriesDialog>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
import selectCarSeriesDialog from './components/selectCarSeriesDialog'
export default {
name: 'add',
components: {
glsxCombiForm,
selectCarSeriesDialog
},
data() {
return {
dialogVisible: false,
formObj:{
id: '',
mediaId: '',
caseName: '',
coverUrl: '',
introduction: '',
applyBrandType: 0,
videoCoverArr: []
},
brandList: [],
posterOptions: {
width: '104px',
height: '138px',
key: 'posterImg',
isClose: true
},
myRule:{
caseName: [{ required: true, message: '请输入案例名称', trigger: 'change' }],
mediaId: [{ required: true, message: '请选择视频', trigger: 'change' }],
coverUrl: [{ required: true, validator: (rule, value, callback) => {
if(this.formObj.videoCoverArr?.length!=1) {
callback(new Error(`请上传视频封面图`))
}else{
callback()
}
}, trigger: 'change' }],
introduction: [{ required: true, message: '请输入宣传文案', trigger: 'change' }],
brand: [{ required: true, validator: (rule, value, callback) => {
if(this.formObj.applyBrandType==1 && !this.brandList?.length) {
callback(new Error(`请选择品牌`))
}else{
callback()
}
}, trigger: 'blur' }],
},
formData:[
{
label: '案例名称',
name: 'caseName',
maxlength: 20,
showLimit: true,
type: 'input',
isDisabled: false
},
{
label: '选择视频',
name: 'mediaId',
type: 'select',
optionList:[],
optionId: 'id',
optionLabel: 'fileName',
isDisabled: false,
changeAttr:(id, row)=> {
const _target = row.optionList.find(item => item.id == id)
if(_target){
this.formObj.videoCoverArr = [_target.coverUrl]
this.formObj.introduction = _target.introduction
}
this.$refs.baseInfoRef.$refs.formRef.validateField('coverUrl')
}
},
{
label: '视频封面图',
name: 'coverUrl',
addHtml: 'videoCoverSlot'
},
{
label: '宣传文案',
placeholder: '发现频道视频宣传语',
name: 'introduction',
maxlength: 100,
type: 'input',
showLimit: true,
inputType: 'textarea',
isDisabled: false
},
{
label: '适用品牌',
name: 'brand',
addHtml: 'selectBrandSlot'
}
],
}
},
created(){
this.formObj.id = this.$route.query.id || ''
this.getVideoList()
if(this.formObj.id){
this.getCaseDetailApi()
}
},
methods:{
openBrandDialog(){
this.dialogVisible = !this.dialogVisible
},
getVideoList(){
this.$apis.case.getVideoListApi({pageSize: 10000, currentPage: 1}).then(res => {
if(res?.list?.length) {
const _target = this.formData.find(item => item.name == 'mediaId')
_target.optionList = res.list
}
})
},
changeChannelImg(val){
this.$refs.baseInfoRef.$refs.formRef.validateField('coverUrl')
},
handleSave(){
this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
if(valid){
let params = JSON.parse(JSON.stringify(this.formObj))
params.coverUrl = this.formObj.videoCoverArr[0]
if(params.applyBrandType == 1){
params.brandList = this.brandList.map(item => {
return { brandId: item.id , brandName: item.name}
})
}
delete params.videoCoverArr
if(!params.id) delete params.id
this.$apis.case.addCaseApi(params).then(res => {
console.log(res)
if(res){
this.$message.success('操作成功')
this.handleCancel()
}
})
}
})
},
handleCancel(){
this.$router.back()
},
confirmDialog(e){
this.brandList = e
this.$refs.baseInfoRef.$refs.formRef.validateField('brand')
this.openBrandDialog()
},
getCaseDetailApi(){
this.$apis.case.getCaseDetailApi({id: this.$route.query.id}).then(res => {
console.log(res)
if(res){
const attrList = ['id', 'mediaId', 'caseName', 'introduction', 'applyBrandType']
attrList.forEach(key =>{
this.formObj[key] = res[key]
})
this.formObj.videoCoverArr = [res.coverUrl]
this.brandList = res.brandList.map(item => ({id: item.brandId, name: item.brandName})) || []
}
})
}
}
}
</script>
<style scoped lang="scss">
.case-ctnr{
.glsx-combi-form{
padding: 20px;
background-color: #fff;
margin-bottom: 16px;
.brand-wrap{
margin-top: 8px;
width: 580px;
height: 80px;
background: #FFFFFF;
border: 1px solid #E8E8EA;
border-radius: 4px;
padding: 6px 8px;
overflow-y: auto;
.brand-item{
display: inline-block;
padding: 0 8px;
height: 24px;
color: #666666;
line-height: 24px;
background: #FAFBFE;
border: 1px solid #E5E5E5;
border-radius: 4px;
margin-right: 4px;
}
}
}
}
</style>
\ No newline at end of file
<template>
<GLDialog title="选择品牌"
mode="mid"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose">
<div class="search-wrap">
<el-input size="small" placeholder="请输入搜索关键字" v-model="curbrandName">
<i slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
</div>
<el-checkbox-group v-model="checkedList">
<el-checkbox v-for="item in filterBrandList" :key="item.id" :label="item.id">{{item.name}}</el-checkbox>
</el-checkbox-group>
</GLDialog>
</template>
<script>
export default {
name: 'selectCarSeriesDialog',
data() {
return {
curbrandName: '',
checkedList:[],
carSeriesList: [],
filterBrandList: []
}
},
props: {
dialogVisible:{
type: Boolean,
default: false
},
listData:{
type: Array
}
},
watch:{
curbrandName:{
handler(nVal, oVal){
this.filterBrandList = this.carSeriesList.filter(item => item.name.indexOf(nVal)>-1)
},
deep: true
}
},
created(){
this.checkedList = this?.listData.map(item => item.id)
this.getCarSeriesList()
},
mounted() {
},
methods: {
getCarSeriesList(){
this.$apis.case.getCarSeriesApi({}).then(res => {
if(res?.length){
this.filterBrandList= res
this.carSeriesList = res
}
})
},
handleClose(){
this.$emit('closeDialog')
},
handleConfirm(){
let list = []
this.carSeriesList.forEach(item =>{
if(this.checkedList.includes(item.id)) list.push(item)
})
this.$emit('confirmDialog', list)
}
}
}
</script>
<style lang="scss" scoped>
.el-checkbox{
display: block;
height: 32px;
line-height: 32px;
}
.search-wrap{
margin-bottom: 12px;
/deep/ .el-input {
&, .el-input__inner{
height: 36px;
width: 432px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="case-ctnr">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="operate-wrap">
<span class="table-title">频道管理列表</span>
<el-button class="operate-btn" type="primary" size="small" @click="addCase()">新增案例</el-button>
</div>
<GLTable ref="caseRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="imageSlot" class="table-image" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.coverUrl" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.coverUrl" />
</el-popover>
</div>
<div slot="brandSlot" slot-scope="scope">
<template v-if="scope.scope.brandList && scope.scope.brandList.length > 3">
<span>{{ filterBrand(scope.scope).slice(0, 3).join('、') }}</span>
<el-popover
placement="top"
width="400"
trigger="hover">
<span>
{{filterBrand(scope.scope).join('、')}}
</span>
<span class="more-brand" slot="reference">...[{{ scope.scope.brandList.length }}]</span>
</el-popover>
</template>
<template v-else>
<span v-if="!scope.scope.brandList || !scope.scope.brandList.length">{{ scope.scope.applyBrandType==1? '--' : '全部' }}</span>
<span v-else>{{ filterBrand(scope.scope).join('、') }}</span>
</template>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<el-dialog class="image-dialog" :visible.sync="previewVideoVisible" width="30%">
<big-View ref="viewForm" v-if="previewVideoVisible" :dialogSrc="previewVideoUrl" dialogType="video"></big-View>
</el-dialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import bigView from '@/components/big-view'
export default {
name: 'App',
components: {
bigView
},
data() {
return {
tableSearchForm: {
caseName: '',
brandName: '',
createDate: []
},
previewVideoUrl: '',
previewVideoVisible: false,
buttonList: [
{
type: 'el-button',
name: '预览',
attrs: {
type: 'text',
fn: '预览'
},
listeners: {
click: row => this.previewFn(row.scope)
}
},
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.addCase(row.scope, 1)
}
},
{
type: 'el-button',
name: '删除',
attrs: {
type: 'text',
fn: '删除'
},
listeners: {
click: row => this.delCase(row.scope)
}
}
],
searchForm: {},
url: url,
searchFormData: [
{
label: '案例名称',
name: 'caseName',
type: 'input'
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
},
{
label: '适用品牌',
name: 'brandName',
type: 'input'
},
],
getListApi: this.$apis.case.getCaseListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '案例名称',
prop: 'caseName'
},
{
label: '缩略图',
addHtml: 'imageSlot',
width: 150
},
{
label: '适用品牌',
addHtml: 'brandSlot'
},
{
label: '创建日期',
prop: 'createdDate'
},
{
label: '更新时间',
prop: 'updatedDate'
},
{
label: '操作人',
prop: 'updatedBy'
},
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
created() {},
mounted() {},
methods: {
filterBrand({brandList}){
return brandList?.map(item => item.brandName) || []
},
previewFn(row){
console.log(this.previewVideoUrl)
this.previewVideoUrl = row?.mediaInfo?.mediaUrl
this.previewVideoVisible = true
},
getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm))
if (this.tableSearchForm.createDate.length) {
params.beginCreateTime = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endCreateTime = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
delete this.searchForm.createDate
resolve()
})
},
handleSearch() {
this.$refs.caseRef.refreshTable()
},
handleReset() {
this.tableSearchForm = {
caseName: '',
brandName: '',
createDate: []
}
this.searchForm = {}
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.caseRef.data.length ? (this.$refs.caseRef.tableHeightValues = '') : this.$refs.caseRef.setTableHeightFun()
},
addCase(row={}, type) {
this.$router.push({
path: `/case/add?id=${row.id || ''}&$title=${type ? '编辑': '新增'}案例`
})
},
delCase({id, caseName}){
this.$confirm(`确定删除${caseName}吗`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis.case.delCaseApi({id}).then(res => {
if(res){
this.$message.success('删除成功')
this.handleSearch()
}
})
}
}
})
}
}
}
</script>
<style scoped lang="scss">
.case-ctnr{
background-color: #fff;
padding: 20px;
.more-brand{
white-space: nowrap;
color: #5850FF;
cursor: pointer;
}
}
</style>
\ No newline at end of file
<template>
<div class="category-ctnr">
<div class="main-wrap">
<div class="global-title">新增二级分类</div>
<glsx-combi-form :isInline="false" class="glsx-combi-form" ref="baseInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="formObj" :formData="formData" :formRules="myRule">
<div slot="mainCategorySlot">
{{routeInfo.parentCategoryName}}
</div>
<div slot="secondCategorySlot" class="category-slot">
<div class="category-item" v-for="(item,index) in categoryList" :key="index">
<el-input placeholder="请输入" v-model="item.name" class="input" maxlength="20" show-word-limit></el-input>
<i v-if="categoryList.length>1" class="el-icon-delete del-icon" @click="delSecondCategory(index)"></i>
</div>
<div v-if="!routeInfo.id" class="add-btn" @click="addCategory()">
<i class="el-icon-circle-plus-outline"></i>
新增二级分类
</div>
</div>
</glsx-combi-form>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button>
</GLFooter>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'add',
components: {
glsxCombiForm
},
data() {
return {
formObj:{
brandType: 1,
videoCoverArr: []
},
myRule:{
mainCategory: [{ required: true,validator: (rule, value, callback) => {
if(!this.routeInfo.parentCategoryId) {
callback(new Error(`缺失一级分类ID`))
}else if(!this.routeInfo.categoryType){
callback(new Error(`缺失频道ID`))
}else{
callback()
}
}, trigger: 'change' }],
secondCategory: [{ required: true, validator: (rule, value, callback) => {
const _target = this.categoryList.find(item => !item.name)
if(_target) {
callback(new Error(`请输入二级分类`))
}else{
callback()
}
}, trigger: 'change' }],
},
formData:[
{
label: '一级分类',
name: 'mainCategory',
addHtml: 'mainCategorySlot'
},
{
label: '二级分类名称',
name: 'secondCategory',
addHtml: 'secondCategorySlot'
}
],
categoryList: []
}
},
created(){
const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
const { id, name } = this.routeInfo
this.categoryList = [{id: id || '', name: name || ''}]
},
methods:{
addCategory(){
const _target = this.categoryList.find(item => !item.name)
if(_target) return this.$message.error('请输入二级分类')
this.categoryList.push({id: '', name: ''})
},
delSecondCategory(index){
this.categoryList.splice(index, 1)
},
handleSave(){
this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
if(valid){
if(this.routeInfo.id){
this.editCategory()
}else{
this.batchAddCategory()
}
}
})
},
batchAddCategory(){
const { categoryType, parentCategoryId } = this.routeInfo
const params = {
categoryType,
parentCategoryId,
categoryNameList: this.categoryList.map(item => item.name)
}
this.$apis.category.batchAddCategoryApi(params).then(res => {
if(res) {
this.$message.success('操作成功')
this.handleCancel()
}
})
},
editCategory(){
const { categoryType, parentCategoryId, id } = this.routeInfo
const params = {
id,
categoryType,
parentCategoryId,
categoryLevel: 2,
categoryName: this.categoryList[0]?.name
}
this.$apis.category.addCategoryApi(params).then(res => {
if(res){
this.$message.success('编辑成功')
this.handleCancel()
}
})
},
handleCancel(){
this.$router.back()
},
}
}
</script>
<style scoped lang="scss">
.category-ctnr{
min-height: 500px;
height: calc(100vh - 140px);
.main-wrap{
height: 100%;
background-color: #fff;
margin-bottom: 16px;
.glsx-combi-form{
padding: 20px;
background-color: #fff;
margin-bottom: 16px;
.category-slot{
.category-item{
margin-top: 10px;
&:first-child{
margin-top: 0;
}
.el-input{
width: 432px;
}
.del-icon{
font-size: 16px;
color: #999999;
margin-left: 8px;
vertical-align: middle;
}
}
.add-btn{
display: inline-block;
color: #5850FF;
cursor: pointer;
i{
font-size: 20px;
vertical-align: middle;
}
}
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="nav" ref="navCntrRef">
<div style="display: inline-block;">
<div class="nav-item" :ref="'navRef'+index" v-for="(item,index) in rowList" :key="item[defaultProps.id]" @click="selectNav(item)" @contextmenu.prevent="editNav(item)" :class="{'cur-nav':value==item[defaultProps.id]}">
{{ item[defaultProps.name] }}
<i class="el-icon-close del-icon" @click.stop="delNav(item)"></i>
</div>
</div>
<div v-if="showInput" class="input-area"><el-input maxlength="20" show-word-limit ref="addInput" @blur="inputBlur" v-model="addValue" class="input"></el-input></div>
<div v-else class="nav-item add-icon" style="cursor: pointer;" @click="addNav"><i class="el-icon-plus border"></i></div>
<div v-if="colList && colList.length" class="nav-item pull-btn" style="cursor: pointer;">
<i class="el-icon-arrow-down border"></i>
<div class="pull-down-wrap">
<div class="pull-down-item" @contextmenu.prevent="editNav(item)" @click="selectNav(item, 'sort')" :class="{'cur-nav':value==item[defaultProps.id]}" v-for="item in colList" :key="item[defaultProps.id]">
{{ item[defaultProps.name] }}
<i class="el-icon-close del-icon" @click.stop="delNav(item)"></i>
</div>
</div>
</div>
<GLDialog title="重命名" mode="small" :visible.sync="navVisible" @onOk="commitDialog" :before-close="closeDialog" @onCancel="closeDialog">
<div class="menu-dialog-body">
<el-form ref="menuRef" label-width="154px" :rules="navRules" :model="navForm">
<el-form-item label="名称:" prop="name" class="m-t-20">
<el-input maxlength="20" show-word-limit style="width: 284px;" :size="size" type="text" v-model="navForm.name" placeholder="请输入"></el-input>
</el-form-item>
</el-form>
</div>
</GLDialog>
</div>
</template>
<script>
export default{
name: 'nav',
model: {
prop: 'value', // 默认是value
event: 'changeValue', // 默认是input
},
props: {
value: {
type: String
},
tabList:{
type: Array,
default: () => {
return []
}
},
defaultProps: {
type: Object,
default: ()=>{
return {
id: 'id',
name: 'name'
}
}
}
},
data(){
return {
navRules: {
name: [
{
required: true,
validator: (rule, value, callback) => {
if (!value || (value && !value.trim())) {
return callback(new Error('请输入名称'))
} else {
return callback()
}
},
trigger: 'change'
}
]
},
navForm: {
name: '',
id: ''
},
navVisible: false,
curNavId: '',
addValue: '',
showInput: false,
rowList: [],
colList: []
}
},
watch:{
tabList:{
handler(val, oldVal) {
this.calcWidth()
},
deep: true
}
},
mounted(){
window.addEventListener('resize', this.resizeDom);
},
beforeDestroy(){
window.removeEventListener('resize', this.resizeDom)
},
methods:{
resizeDom(){
this.calcWidth()
},
calcWidth(){
this.rowList = this.tabList
let calculated = false
let mainW = this.$refs?.navCntrRef?.offsetWidth || 0
let curIdx = -1
this.$nextTick(()=>{
this.rowList.reduce((pre, cur,index) => {
let curW = this.$refs?.['navRef'+index]?.[0]?.offsetWidth
if((pre + curW) > mainW-500 && !calculated) {
curIdx = index
calculated = true
}
return pre + curW
},0);
console.log(curIdx)
this.colList = curIdx >-1 ? this.tabList.slice(curIdx) : []
this.rowList = curIdx >-1 ? this.tabList.slice(0, curIdx) : this.tabList
console.log(this.rowList)
})
},
selectNav(item){
this.$emit('changeValue', item[this.defaultProps.id])
},
editNav(item){
console.log(item)
this.navForm = {
id: item[this.defaultProps.id],
name: item[this.defaultProps.name]
}
this.navVisible = true
},
commitDialog(){
const params = {
[this.defaultProps.id] : this.navForm.id,
[this.defaultProps.name]: this.navForm.name
}
this.$emit('confirmDialog', params)
this.closeDialog()
},
closeDialog(){
this.navVisible = false
},
delNav(item){
this.$emit('delete', item)
},
inputBlur(){
if(this.addValue) {
this.$emit('inputBlur', {value: this.addValue})
}else{
this.$message.error('请输入内容')
}
this.clearData()
},
clearData(){
this.showInput = false
this.addValue = ''
},
addNav(){
this.showInput = true
this.$nextTick(()=>{
this.$refs.addInput.focus()
})
}
}
}
</script>
<style scoped lang="scss">
.nav{
.input-area{
display: inline-block;
height: 40px;
line-height: 40px;
border-radius: 4px 4px 0 0;
margin-right: 1px;
.input{
width: 245px;
/deep/ .el-input__inner{
vertical-align: baseline;
box-sizing: border-box;
border: none;
}
}
}
.nav-item{
display: inline-block;
padding: 0 20px;
height: 40px;
line-height: 40px;
background-color: #F8F8F8;
border-radius: 4px 4px 0 0;
margin-right: 1px;
color: #666666;
letter-spacing: 0;
text-align: center;
cursor: pointer;
.del-icon{
font-size: 12px;
color: #666;
margin-left: 12px;
}
}
.cur-nav{
background-color: #fff;
color: #5850FF;
font-weight: 500;
}
.add-icon, .pull-btn{
width: 50px;
box-sizing: border-box;
padding: 0;
position: relative;
.border{
border: 1px dashed #999;
color: #999;
}
}
.pull-btn{
&:hover{
.pull-down-wrap{
display: block;
}
}
.pull-down-wrap{
display: none;
position: absolute;
width: 200px;
max-height: 200px;
overflow-y: auto;
right: 0;
background-color: #fff;
z-index: 2;
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px 0 #00000014, 0 9px 28px 8px #0000000d;
border-radius: 4px;
.pull-down-item{
height: 36px;
display: flex;
justify-content: space-between;
align-items: center;
font-weight: 400;
padding: 0 15px;
font-size: 14px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #666666;
background-color: #F8F8F8;
&:hover{
background-color: #f5f7fa;
}
}
.cur-nav{
background-color: #fff;
color: #5850FF;
font-weight: 500;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="category-list-ctnr">
<GLTabs class="tabs" v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
<pullDownNav @confirmDialog="handleEdit" @inputBlur="inputBlur" @delete="delCategory" v-model="curMainCategoryId" :tabList="mainCategoryList" :defaultProps="{id: 'id', name: 'categoryName'}"></pullDownNav>
<div class="main-wrap">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="operate-wrap">
<span class="table-title">二级分类列表</span>
<el-button class="operate-btn" type="primary" size="small" @click="editCategory">新增二级分类</el-button>
</div>
<GLTable ref="categoryRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="brandSlot">
<span>{{ brandList.slice(0, 3).join('、') }}</span>
<el-popover
placement="top"
width="400"
trigger="hover">
<span>
{{brandList.join('、')}}
</span>
<span class="more-brand" slot="reference">...[{{ brandList.length }}]</span>
</el-popover>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
import pullDownNav from './components/pullDownNav'
export default {
name: 'App',
components:{
pullDownNav
},
data() {
return {
activeName: '',
curMainCategoryId: '',
tabPaneList: [],
mainCategoryList: [],
brandList:['丰田','本田','一汽大众','奔驰','宝马','奥迪','比亚迪'],
buttonList: [
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.editCategory(row.scope)
}
},
{
type: 'el-button',
name: '删除',
attrs: {
type: 'text',
fn: '删除'
},
listeners: {
click: row => this.delCategory(row.scope, 1)
}
}
],
tableSearchForm: {
categoryName: '',
createDate: []
},
searchForm: {},
url: url,
searchFormData: [
{
label: '分类名称',
name: 'categoryName',
type: 'input'
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
}
],
getListApi: this.$apis.category.getCategoryListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '二级分类名称',
prop: 'categoryName'
},
{
label: '创建日期',
prop: 'createdDate'
},
{
label: '更新时间',
prop: 'updatedDate'
},
{
label: '操作人',
prop: 'updatedBy'
},
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
created() {
this.getChannelList()
},
watch:{
curMainCategoryId:{
handler(){
this.handleSearch()
},
deep: true
},
activeName:{
handler(){
this.getMainCategory()
},
deep: true
},
},
mounted() {},
methods: {
//获取频道名称
getChannelList() {
this.$apis.channel
.getChannelListApi({
pageSize: 100,
pageNum: 1
})
.then(res => {
if(res?.list?.length){
let tabPaneList = []
res.list.forEach(item => {
if(item.channelType == 5 || item.channelType == 5){
tabPaneList.push({label: item.channelName,name: item.channelType==5 ? 1 : 2 ,merchantChannelId: item.id})
}
})
this.tabPaneList = tabPaneList
this.activeName = tabPaneList[0].name
}
})
},
getMainCategory(){
const params = {
pageSize: 1000,
pageNum: 1,
categoryLevel: 1,
categoryType: this.activeName
}
this.$apis.category.getCategoryListApi(params).then(res => {
if(res?.list?.length){
this.mainCategoryList = res.list
this.curMainCategoryId = res.list[0].id
}else{
this.curMainCategoryId = ''
}
})
},
inputBlur(e){
this.addCategory(e.value)
},
handleEdit(e){
this.addCategory(e.categoryName, e.id)
},
delCategory(e, type){
this.$confirm(`删除后数据将无法恢复,是否确认删除${e.categoryName}?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis.category.delCategoryApi({id: e.id}).then(res => {
if(res){
this.$message.success('删除成功')
this.getMainCategory()
if(type) {
this.handleSearch()
}
}
})
}
}
})
},
addCategory(val, id){
let params = {
categoryType: this.activeName,
categoryLevel: 1,
categoryName: val
}
if(id) params.id = id
this.$apis.category.addCategoryApi(params).then(res => {
if(res){
this.$message.success('新增成功')
this.getMainCategory()
}
})
},
getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm))
if (this.tableSearchForm.createDate.length) {
params.beginCreateTime = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endCreateTime = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
params.categoryType = 1
params.categoryLevel = 2
params.parentCategoryId = this.curMainCategoryId
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
delete this.searchForm.createDate
resolve()
})
},
handleSearch() {
this.$refs.categoryRef.refreshTable()
},
handleReset() {
this.tableSearchForm = {
channelName: '',
createDate: []
}
this.searchForm = {}
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.categoryRef.data.length ? (this.$refs.categoryRef.tableHeightValues = '') : this.$refs.categoryRef.setTableHeightFun()
},
editCategory(row={}) {
if(!this.activeName) return this.$message.error('暂无频道')
const target = this.mainCategoryList.find(item => item.id == this.curMainCategoryId)
if(!target) return this.$message.error('请选择一级分类')
const params = {
categoryType: this.activeName,
parentCategoryId: target.id,
parentCategoryName: target.categoryName
}
if(row.id) {
params.id = row.id
params.name = row.categoryName
}
const queryStr = encodeURIComponent(JSON.stringify(params))
this.$router.push({ path: `/category/add/`+queryStr,query: { $title: row.id ? '编辑二级分类' : '新增二级分类' }})
}
}
}
</script>
<style scoped lang="scss">
.category-list-ctnr{
.tabs{
margin-bottom: 16px;
}
.main-wrap{
background-color: #fff;
padding: 20px;
}
.more-brand{
color: #5850FF;
cursor: pointer;
}
}
</style>
\ No newline at end of file
......@@ -3,9 +3,12 @@
<div class="add-container">
<div class="title">{{ this.channelForm.channelName }}编辑</div>
<div class="channel-content gl-form-page">
<el-form ref="ruleForm" :model="channelForm" label-width="154px" size="small" :rules="rules">
<el-form ref="ruleForm1" :model="channelForm" label-width="154px" size="small" :rules="rules">
<el-form-item label="频道名称:" prop="channelName">
<el-input v-model="channelForm.channelName"></el-input>
<el-input v-model="channelForm.channelName" maxlength="6" show-word-limit></el-input>
</el-form-item>
<el-form-item label="频道子名称:" prop="channelChildName">
<el-input v-model="channelForm.channelChildName" maxlength="12" show-word-limit></el-input>
</el-form-item>
<span v-if="channelForm.channelType == 1">
<el-form-item label="频道主题:" prop="channelStyle">
......@@ -27,7 +30,7 @@
<glsx-preview :picOptions="picOptions" :imageUrlArr="channelForm.channelImgArr" @change="changeChannelImg"></glsx-preview>
<div class="el-form-item__error" v-if="channelImgFlag">请上传频道banner</div>
</el-form-item>
<div class="text-tip">建议尺寸:750*750</div>
<div class="text-tip">建议尺寸:750*448</div>
</el-form>
</div>
</div>
......@@ -67,13 +70,14 @@ export default {
publicityImgArr: [],
publicityImg: '',
channelImg: '',
channelChildName: '',
channelImgArr: []
},
channelImgbgArr: ['banner1', 'banner2'],
channelOtherImgbgArr: ['membrane', 'crowd', 'activity'],
channelImgFlag: false,
picOptions: {
width: '104px',
width: '174px',
height: '104px',
key: 'channelImg',
isClose: true
......@@ -91,11 +95,12 @@ export default {
isClose: true
},
rules: {
channelName: [{ required: true, message: '请输入频道名称', trigger: 'blur' }],
channelName: [{ required: true, message: '请输入频道名称', trigger: 'change' }],
channelStyle: [{ required: true, message: '请选择频道主题', trigger: 'change' }],
publicityImg: [{ required: true, message: '请上传频道分享预览图', trigger: 'change' }],
channelImg: [{ required: true, message: '请上传频道banner', trigger: 'change' }],
promotion: [{ required: true, message: '请输入频道分享文案', trigger: 'blur' }]
promotion: [{ required: true, message: '请输入频道分享文案', trigger: 'blur' }],
channelChildName: [{ required: true, message: '请输入频道子名称', trigger: 'change' }],
}
}
},
......@@ -141,40 +146,40 @@ export default {
this.$refs.ruleForm.clearValidate(val.key)
},
handleSave() {
this.$refs.ruleForm.validate(valid => {
if (!this.channelForm.channelImg) {
this.channelImgFlag = true
return
}
// if (!this.channelForm.publicityImg) {
// this.publicityImgFlag = true
// return
// }
if (valid) {
let params = {
channelName: this.channelForm.channelName,
channelType: this.channelForm.channelType,
channelStyle: this.channelForm.channelStyle,
channelImg: this.channelForm.channelImg,
promotion: this.channelForm.promotion,
publicityImg: this.channelForm.publicityImg,
posterImg: this.channelForm.posterImg
}
if (this.channelForm.channelType == 1) params.channelStyle = this.channelForm.channelStyle
let apis = this.id ? 'updateChannel' : this.merchantChannelId ? 'updateMerchantChannel' : ''
this.id ? (params.id = this.id) : this.merchantChannelId ? (params.merchantChannelId = this.merchantChannelId) : ''
this.loading = true
this.$apis.channel[apis](params).then(res => {
if (res.code == 0) {
this.loading = false
this.$router.go(-1)
this.$refs.ruleForm1.validate(valid1 =>{
if(valid1){
this.$refs.ruleForm.validate(valid => {
if (!this.channelForm.channelImg) {
this.channelImgFlag = true
return
}
if (valid) {
let params = {
channelName: this.channelForm.channelName,
channelChildName: this.channelForm.channelChildName,
channelType: this.channelForm.channelType,
channelStyle: this.channelForm.channelStyle,
channelImg: this.channelForm.channelImg,
promotion: this.channelForm.promotion,
publicityImg: this.channelForm.publicityImg,
posterImg: this.channelForm.posterImg
}
if (this.channelForm.channelType == 1) params.channelStyle = this.channelForm.channelStyle
let apis = this.id ? 'updateChannel' : this.merchantChannelId ? 'updateMerchantChannel' : ''
this.id ? (params.id = this.id) : this.merchantChannelId ? (params.merchantChannelId = this.merchantChannelId) : ''
this.loading = true
this.$apis.channel[apis](params).then(res => {
if (res.code == 0) {
this.loading = false
this.$router.go(-1)
}
this.$message({
message: res.code == '0' ? '编辑成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
this.$message({
message: res.code == '0' ? '编辑成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
}
})
}
})
......@@ -250,8 +255,8 @@ export default {
font-size: 14px;
color: #999999;
margin-left: 154px;
margin-bottom: 35px;
margin-top: 15px;
margin-bottom: 32px;
margin-top: -10px;
}
}
</style>
......@@ -74,6 +74,11 @@ export default {
}
},
{
label: '频道子名称',
width: 180,
prop: 'channelChildName'
},
{
label: '频道宣传语',
prop: 'promotion',
width: 300,
......@@ -89,6 +94,7 @@ export default {
},
{
label: '关联门店',
width: 100,
prop: 'linkMerchantCnt',
formatter: cellValue => {
return cellValue.linkMerchantCnt || '--'
......@@ -96,6 +102,7 @@ export default {
},
{
label: '创建日期',
width: 220,
prop: 'createdDate',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
......@@ -105,7 +112,7 @@ export default {
label: '操作',
addHtml: 'auth-button',
fixed: 'right',
width: 300
width: 100
}
]
},
......
<template>
<div>
<div :class="['select-input-box',{'disabled-calss': disabled}]" ref="cascaderRef" @click="switchBrand">
<div class="selectd-name">
<span v-if="curBrand[defaultProps.label]">{{curBrand[defaultProps.label]}}</span>
<span v-else :class="['default-tip',{'disabled-calss': disabled}]">请选择</span>
</div>
<div>
<i v-show="!brandTree" class="el-icon-arrow-up" style="color:#909399"></i>
<i v-show="brandTree" class="el-icon-arrow-down" style="color:#909399"></i>
</div>
<div :class="['tree-box', {'arrowUp': arrowUp}]" v-show="brandTree">
<el-tree :default-expanded-keys="expandedList" accordion empty-text="暂无数据" class="filter-tree" :data="categoryData" :props="defaultProps" node-key="id" ref="tree">
<div :class="['custom-tree-node',{'active': data.id == curBrand.id && node.level==2}]" slot-scope="{ node, data }" @click="selectBrand(node)" >
<span>{{ node.label }}</span>
</div>
</el-tree>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'selectBrand',
data() {
return {
brandTree: false,
arrowUp: false,
curBrand: {},
expandedList:[],
categoryData: [],
}
},
model: {
prop: 'value', // 默认是value
event: 'changeItem', // 默认是input
},
props: {
defaultProps: {
type: Object,
default: ()=> {
return {
children: 'childs',
label: 'categoryName'
}
}
},
disabled:{
type: Boolean,
default: false
},
value: {
type: String
},
listTree: {
type: Array,
default: ()=>{
return []
}
},
curInfo: {
type: Object,
default: ()=>{
return {}
}
}
},
watch: {
// value:{
// handler(nVal, oVal){
// const arr = this.listTree.flat(Infinity);
// console.log(arr,456)
// },
// deep: true
// },
'curInfo.id':{
handler(nVal, oVal){
if(this.curBrand.id==nVal) return
this.curBrand = this.curInfo
},
deep: true
},
},
created(){
this.getCategory()
},
mounted() {
document.addEventListener("click", this.eventListener);
},
beforeDestroy(){
document.removeEventListener("click", this.eventListener);
},
methods: {
getCategory(){
const params = {
pageSize: 1000,
pageNum: 1,
categoryType: 1
}
this.$apis.category.getCategoryListApi(params).then(res => {
if(res?.list?.length){
let list = res.list.filter(item => item.categoryLevel == 1).map(item => ({...item, childs: []}))
let level2List = res.list.filter(item => item.categoryLevel == 2)
level2List.forEach(item => {
const target = list.find(row => row.id == item.parentCategoryId)
if(target){
target['childs'].push(item)
}
})
this.categoryData = list
}
})
},
eventListener(e){
if (!this.$refs?.cascaderRef?.contains(e.target)) this.brandTree = false;
},
// 显示隐藏
switchBrand() {
if(this.disabled) return
let distance = 0
try {
distance = window.innerHeight - this.$refs.cascaderRef.getBoundingClientRect().y -this.$refs.cascaderRef.getBoundingClientRect().height
} catch (error) {
console.log(error)
}
this.arrowUp = distance < 100 //判断是否向上展示
this.brandTree = !this.brandTree
},
selectBrand(e){
if(e.level==2) {
this.curBrand = e.data
this.brandTree = !this.brandTree
this.$emit('changeItem', this.curBrand.id)
this.$emit('clickItem', {data: e.data, parent: e.parent?.data || {}})
}
}
}
}
</script>
<style lang="scss" scoped>
.select-input-box {
width: 100%;
height: 32px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e5e5e5;
box-sizing: border-box;
padding: 8px;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
.selectd-name{
font-weight: 400;
font-size: 14px;
color: #666666;
}
}
.disabled-calss{
background-color: #f5f7fa;
border-color: #e4e7ed;
color: #c0c4cc!important;
cursor: not-allowed;
}
.default-tip{
color: #c0c4cc!important;
}
.tree-box {
margin-top: 10px;
padding: 10px;
box-shadow: 0 6px 20px 0 #7a7a7a33;
border-radius: 4px;
background: #ffffff;
position: absolute;
width: 100%;
top: 100%;
box-sizing: border-box;
left: 0;
z-index: 20;
max-height: 300px;
overflow-y: auto;
overflow-x: hidden;
.filter-tree {
.custom-tree-node{
width: 100%;
&:hover{
background-color: #F5F7FA;
}
}
.active{
color: #5850FF;
background: #5850ff1f!important;
}
/deep/ .el-tree-node:focus > .el-tree-node__content {
background-color: transparent !important;
}
/deep/ .el-tree-node__children .el-tree-node:hover > .el-tree-node__content {
background-color: transparent !important;
}
}
}
.arrowUp{
top: unset;
bottom: calc(100% + 8px);
box-shadow: 0 -6px 20px 0 #7a7a7a33;
}
</style>
\ No newline at end of file
<template>
<div class="select-store">
<GLDialog bigTitle="选择商品"
mode="big"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose">
<glsx-combi-form ref="showSearch"
labelWidth="105px"
:formObj="searchForm"
:formData="searchFormData">
<span slot="footer">
<el-button :size="size"
type="primary"
@click="resetTable">查询</el-button>
</span>
</glsx-combi-form>
<GLTable ref="goodsRef"
:noDataImg="url"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
@refreshTable="getList"
:getListApi="getListApi"
:hasNum="false"
:setTableFinishFun="setTableFinishFun">
<div slot="radioHtml"
class="store-table"
slot-scope="scope">
<el-radio v-model="curInfo.id"
:label="scope.scope.id"
@click.native="handleClick(scope.scope)"></el-radio>
</div>
<div slot="imageSlot" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.goodsImage" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.goodsImage" />
</el-popover>
</div>
</GLTable>
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'selectStore',
data() {
return {
url: url,
searchForm: {
goodsName: '',
configurationUpgradeGoodsId: ''
},
total: 0,
storeList: [],
heightBox: 200,
curInfo: {},
// 搜索
searchFormData: [
{
label: '商品名称',
name: 'goodsName',
type: 'input',
placeholder: '请输入商品名称',
width: '300px',
labelWidth: '10px',
isClear: true
}
],
pageConfig: {
pageSize: 10,
pageNum: 1
},
getListApi: this.$apis.goods.getCarlifeGoodsApi,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '缩略图',
addHtml: 'imageSlot'
},
{
label: '价格(元)',
formatter: cellValue => {
return cellValue.retailPrice ? Number(Number(cellValue.retailPrice/100).toFixed(2)) : '--'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {}
}
},
props: {
dialogVisible: {
type: Boolean,
default: false
},
routeInfo: {
type: Object,
default: ()=> {}
},
storeSearchForm: {
type: Object
},
goodsInfo: {
required: true,
default: ()=> {}
}
},
created() {
// let { smartcarlifeInfoId, goodsName, coverList, goodsImage, minSellPrice, retailPrice } = this.goodsInfo || {}
// this.curInfo = {
// id: smartcarlifeInfoId,
// goodsName,
// goodsImage: coverList?.[0] || '',
// minSellPrice: minSellPrice ? Number(Number(minSellPrice*10*10).toFixed(0)) : 0,
// retailPrice: retailPrice ? Number(Number(retailPrice*10*10).toFixed(0)) : 0,
// }
this.searchForm.configurationUpgradeGoodsId = this.routeInfo.type == 2 ? this.routeInfo.id : ''
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425
},
methods: {
resetTable() {
this.$refs.goodsRef.refreshTable()
},
setTableFinishFun() {
this.$refs.goodsRef.tableHeightValues = '460px'
},
handleClick(item) {
console.log(item)
this.curInfo = item
},
handleClose() {
this.$emit('handleGoodsClose')
},
handleConfirm() {
this.$emit('handleGoodsConfirm', this.curInfo)
}
}
}
</script>
<style lang="scss" scoped>
/deep/.glsx-combi-form .el-form{
.el-form-item{
margin-right: 12px!important;
}
.el-button {
margin-top: 1px;
}
}
.select-store {
.storeDailog {
width: 500px;
}
.title {
margin-bottom: 12px;
}
.customer-tag-box {
display: flex;
margin: 20px 16px;
.tag-label {
display: inline-block;
height: 30px;
line-height: 30px;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 648px;
display: flex;
align-items: center;
cursor: pointer;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
}
// .customer-list {
// width: calc(100% - 280px);
// margin-right: 10px;
// }
.p-16 {
padding: 16px;
}
.store-table .el-radio__label {
display: none;
}
}
</style>
<template>
<GLDialog bigTitle="选择门店" mode="big" :visible.sync="isVisible" :show-close="true" :before-close="handleClose" :close-on-click-modal="false" @onOk="onOk" @onCancel="handleClose">
<div class="dialog_body">
<!-- <GLCombiForm :rowNumber="1" class="dialog_search" ref="searchRef" :formObj="dialogSearchForm" :formData="dialogFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm> -->
<div class="dialog_table">
<GLTable v-if="showTable" :hasPage="false" :pageSizes="pageSizes" ref="tableRef" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" :searchForm="dialogSearchForm" :tableParams="tableParams" :getListApi="getListApi">
<div slot="spreadPrice" slot-scope="scope">
<span :style="{ color: Number(scope.scope.lineationPrice - scope.scope.costPrice) <= 0 ? '#eb4e4e' : '#666666' }">{{ Number(Number(scope.scope.lineationPrice - scope.scope.costPrice).toFixed(1)) }}</span>
</div>
</GLTable>
</div>
</div>
</GLDialog>
</template>
<script>
export default {
name: 'index',
props: {
isVisible: {
type: Boolean,
default: false
},
selectedList: {
type: Array,
default: ()=> []
},
goodsId:{
type: String,
default: ''
}
},
data() {
return {
showTable: true,
copyList: [],
couponList: [],
directChargeList: [],
pageSizes: [5, 10, 20, 30, 40],
dialogSearchForm: {
merchantName: '',
merchantId: ''
},
dialogFormData: [
{
label: '商户名称',
name: 'merchantName',
type: 'input',
isClear: true
},
{
label: '商户ID',
name: 'merchantId',
type: 'input',
isClear: true
}
],
getListApi: this.$apis.goods.getMerchantListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: {
listName: 'merchantList',
mutiSelectName: 'goodsIndex',
mutiSelectUniqueKey: 'id',
tableOption: false,
tableColumns: [
{
label: '商户名称',
prop: 'merchantName'
},
{
label: '商户id',
prop: 'merchantId'
},
]
}
}
},
created() {
this.copyList = JSON.parse(JSON.stringify(this.selectedList))
console.log(this.copyList)
},
methods: {
handleOk() {
this.$refs.tableRef.refreshTable()
},
handleRest() {
this.dialogSearchForm = {
merchantName: '',
merchantId: ''
}
this.handleOk()
},
beforeSearchFn(){
return new Promise(resolve => {
this.dialogSearchForm = {
id: this.goodsId
}
resolve()
})
},
onOk() {
let list = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName] || []
// for (let i = 0; i < this.selectedList.length; i++) {
// let idx = list.findIndex(item => item.id == this.selectedList[i].id)
// if (idx > -1) {
// list.splice(idx, 1)
// }
// }
list.map(item => this.$set(item, 'activityPrice', ''))
this.$emit('confirmDialog', [...list, ...this.copyList])
},
handleClose() {
this.$emit('closeDialog')
},
setTableFinishFun() {
this.copyList.forEach(row => {
this.$nextTick(() => {
let idx = this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.id == row.id)
if (idx > -1) {
try {
this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data[idx], true)
let id = this.copyList.findIndex(item => item.id == row.id)
if (id > -1) this.copyList.splice(id, 1)
console.log(this.copyList)
} catch (err) {
console.log(err)
}
}
})
})
}
}
}
</script>
<style lang="scss" scoped>
.container {
/deep/ .table-header {
display: inline-flex !important;
align-items: center;
justify-content: center;
padding: 0 !important;
.el-button {
min-width: 0;
}
}
.good_name {
img {
width: 40px;
height: 20px;
vertical-align: text-bottom;
}
}
.dialog_body {
border: 1px solid #e5e5e5;
.dialog_search {
padding: 20px 20px 0;
/deep/ .el-form-item {
width: 312px;
}
}
.coupon_type {
width: 100%;
display: inline-block;
border-bottom: 1px solid #eee;
.type {
display: inline-block;
height: 40px;
width: 70px;
line-height: 40px;
font-weight: 500;
text-align: center;
font-size: 16px;
cursor: pointer;
}
.active_type {
color: #5850ff;
border-bottom: 2px solid #5850ff;
}
}
.dialog_table {
padding: 20px;
}
}
}
</style>
......@@ -9,16 +9,23 @@
<p>所属门店</p>
<div class="merchantName ellipsis-1">{{ editForm.merchantName }}</div>
</div>
<div class="el-form-item__error mrt5" v-if="merchantFlag">请选择门店</div>
<!-- <div class="el-form-item__error mrt5" v-if="merchantFlag">请选择门店</div> -->
</div>
<div slot="channelHtml">
<el-checkbox-group v-model="editForm.channelIds" @change="handleCheckedChannelChange">
<el-checkbox v-for="channel in channelList" :label="channel.channelType" :key="channel.channelType">{{ channel.channelName }}</el-checkbox>
</el-checkbox-group>
</div>
<div slot="carSeriesHtml">
<el-button type="default" class="el-icon-plus" v-if="!isDisabled" @click="handleCarSeriesClose">选择车系</el-button>
<div class="car-series-wrap" v-if="editForm.vehicleSeriesRequests && editForm.vehicleSeriesRequests.length">
<div class="car-series-item" v-for="item in editForm.vehicleSeriesRequests" :key="item.vehicleSeriesId">{{ item.vehicleSeriesName }}</div>
</div>
</div>
</glsx-combi-form>
</div>
<select-store v-if="relateStoreVisible" ref="relateStore" :dialogVisible="relateStoreVisible" :storeSelected="selectedList" :merchantInfo="editForm.merchantId" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose"></select-store>
<selectCarDialog v-if="carDialogVisible" singleChoice @handleClose="handleClose" @handleConfirm="handleConfirm" :dialogVisible="carDialogVisible"></selectCarDialog>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button>
......@@ -27,9 +34,11 @@
</template>
<script>
import selectStore from './components/selectStore'
import selectCarDialog from './components/selectCarDialog'
export default {
components: {
selectStore
selectStore,
selectCarDialog
},
data() {
return {
......@@ -38,6 +47,7 @@ export default {
merchantId: this.$route.query.merchantId ? this.$route.query.merchantId : '',
editForm: {
channelIds: [],
vehicleSeriesRequests: [],
merchantId: '',
merchantName: ''
},
......@@ -52,14 +62,41 @@ export default {
label: '频道名称',
name: 'channel',
addHtml: 'channelHtml'
}
},
{
label: '主营品牌车系',
name: 'carId',
addHtml: 'carSeriesHtml',
isHide: true
},
],
selectedList: [],
channelList: [],
relateStoreVisible: false, // 选择门店
carDialogVisible: false, //选择车系
editRule: {
channelIds: [{ required: true, message: '请选择频道名称', trigger: 'change' }]
}
merchantId: [{ required: true,validator: (rule, value, callback) => {
if(this.editForm.merchantId){
callback()
}else{
callback(new Error(`请选择门店`))
}
}, trigger: 'change' }],
channel: [{ required: true,validator: (rule, value, callback) => {
if(this.editForm.channelIds && this.editForm.channelIds.length ){
callback()
}else{
callback(new Error(`请选择频道`))
}
}, trigger: 'change' }],
carId: [{ required: true, validator: (rule, value, callback) => {
if(this.editForm.vehicleSeriesRequests && this.editForm.vehicleSeriesRequests.length){
callback()
}else{
callback(new Error(`请选择主营品牌车系`))
}
}, trigger: 'change' }]
}
}
},
mounted() {
......@@ -68,6 +105,7 @@ export default {
if (this.merchantId) {
this.getconfigMerchant()
this.getMerchantData()
this.getCategoryDetail()
}
},
methods: {
......@@ -82,6 +120,13 @@ export default {
this.channelList = res.list
})
},
getCategoryDetail(){
this.$apis.store.getCategoryByMerchant({merchantId: this.merchantId}).then(res => {
if(res?.vehicleSeriesList?.length){
this.editForm.vehicleSeriesRequests = res.vehicleSeriesList
}
})
},
getMerchantData() {
var params = {
merchantId: this.merchantId,
......@@ -102,6 +147,10 @@ export default {
this.editForm.channelIds = []
res.forEach(item => {
this.editForm.channelIds.push(item.channelId)
if(item.channelId==5) {
const _target = this.editFormData.find(item => item.name == 'carId')
_target.isHide = false
}
})
})
},
......@@ -118,7 +167,8 @@ export default {
let params = {
merchantId: this.editForm.merchantId,
merchantName: this.editForm.merchantName,
channelIds: this.editForm.channelIds
channelIds: this.editForm.channelIds,
vehicleSeriesRequests: this.editForm?.channelIds?.includes(5) ? this.editForm.vehicleSeriesRequests : []
}
this.loading = true
this.$apis.store.configMerchant(params).then(res => {
......@@ -136,7 +186,17 @@ export default {
})
},
handleCheckedChannelChange(val) {
// console.log(this.editForm.channelIds)
const _target = this.editFormData.find(item => item.name == 'carId')
if(val?.includes(5)){
_target.isHide = false
}else{
_target.isHide = true
this.editForm.vehicleSeriesRequests = []
}
},
//选择车系
handleCarSeriesClose(){
this.carDialogVisible = !this.carDialogVisible
},
// 选择门店
handleRelateStoreClose() {
......@@ -147,6 +207,30 @@ export default {
selectedData.merchantId && (this.editForm.merchantId = selectedData.merchantId)
selectedData.merchantName && ((this.editForm.merchantName = selectedData.merchantName), (this.merchantFlag = false))
this.handleRelateStoreClose()
},
handleClose(){
this.carDialogVisible = false
},
handleConfirm(e={}){
let carList = []
for(const key in e){
for(const sonKey in e[key]){
carList = [...carList, ...e[key][sonKey]]
}
}
this.editForm.vehicleSeriesRequests = carList.map(item =>{
const {id, name, parentId, parentName, rootId, rootName} = item
return {
brandId: rootId,
brandName: rootName,
childBrandId: parentId,
childBrandName: parentName,
vehicleSeriesId: id,
vehicleSeriesName: name
}
})
this.handleClose()
this.$refs.editFormRef.$refs[this.editChildRef].validateField('carId')
}
}
}
......@@ -197,5 +281,27 @@ export default {
padding: 0 8px;
}
}
.car-series-wrap{
margin-top: 8px;
width: 580px;
height: 80px;
background: #FFFFFF;
border: 1px solid #E8E8EA;
border-radius: 4px;
padding: 6px 8px;
overflow-y: auto;
.car-series-item{
display: inline-block;
padding: 0 8px;
height: 24px;
color: #666666;
line-height: 24px;
background: #FAFBFE;
border: 1px solid #E5E5E5;
border-radius: 4px;
margin-right: 4px;
}
}
}
</style>
......@@ -9,11 +9,12 @@
@onOk="handleConfirm"
@onCancel="handleClose">
<glsx-combi-form ref="showSearch"
class="single-merchant"
labelWidth="105px"
:formObj="searchForm"
:formData="searchFormData">
<span slot="footer">
<el-button :size="size"
<el-button class="btn" :size="size"
type="primary"
@click="resetTable">查询</el-button>
</span>
......@@ -241,6 +242,16 @@ export default {
.storeDailog {
width: 500px;
}
.single-merchant{
.el-form {
.el-form-item:nth-child(2){
margin-right: 12px!important;
}
.btn{
margin-top: 1px;
}
}
}
.title {
margin-bottom: 12px;
}
......
......@@ -4,7 +4,7 @@
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="store-head">
<div class="info">门店管理列表</div>
<el-button type="primary" plain size="small" @click="handleAdd">新建</el-button>
<el-button type="primary" size="small" @click="handleAdd">新建</el-button>
</div>
<GLTable ref="storeRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="activityImg" class="table-image" slot-scope="scope">
......@@ -71,7 +71,8 @@
</div>
</GLDialog>
<!-- 分享 -->
<GLDialog :mode="mode" title="分享" :visible.sync="shareVisible" :hasFooter="hasFooter">
<GLDialog class="share-dialog" :mode="mode" title="分享" :visible.sync="shareVisible" :hasFooter="hasFooter">
<GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
<div class="preview-wrap">
<div class="share-content">
<div>
......@@ -113,6 +114,9 @@ export default {
merchantName: '',
createDate: []
},
shareMerchantId: '',
tabPaneList: [],
activeName: '',
searchForm: {},
url: url,
mode: 'mid',
......@@ -185,14 +189,15 @@ export default {
label: '操作',
addHtml: 'auth-button',
fixed: 'right',
width: 300
width: 150
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
created() {},
created() {
},
mounted() {},
methods: {
...mapMutations({
......@@ -223,12 +228,38 @@ export default {
alink.click()
alink.remove()
},
getChannelList() {
this.$apis.store
.getconfigMerchant({
pageSize: 100,
pageNum: 1,
merchantId: this.shareMerchantId
})
.then(res => {
if(res?.length){
let tabPaneList = []
res.forEach(item => {
tabPaneList.push({label: item.channelName,name: item.channelType,merchantChannelId: item.id})
})
this.tabPaneList = tabPaneList
this.activeName = tabPaneList[0].name
this.getShareData()
}
})
},
handleClick(){
this.getShareData()
},
//分享
handleShare(val) {
this.$apis.store.getMerchantShare({ merchantId: val.merchantId }).then(res => {
this.shareMerchantId = val.merchantId
this.getChannelList()
this.shareVisible = true
},
getShareData(){
this.$apis.store.getMerchantShare({ merchantId: this.shareMerchantId, channelType: this.activeName }).then(res => {
this.shareData = res
})
this.shareVisible = true
},
//预览
handlePreview() {
......@@ -411,6 +442,15 @@ export default {
}
}
}
.share-dialog{
.preview-wrap{
margin-top: 10px;
}
/deep/ .el-dialog__body{
padding-top: 0;
}
}
.share-content {
width: 335px;
height: 328px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!