Commit b145bad8 by 胡悦

提交

1 parent dbc8e236
......@@ -298,4 +298,16 @@ export function getCarBrandIds(data) {
export function getSonCarBrandIds(data) {
data.method = 'dj.api.car.series.list.by.son.car.brandIds'
return request(data, "post")
}
/** 删除平板首页配置 */
export function deleteConfig(data) {
data.method = 'dj.api.mindworkplate.pad.home.page.config.delete'
return request(data, "post")
}
/** 接待首页素材详情 */
export function getMateralDetail(data) {
data.method = 'dj.api.smartcarlife.reception.home.page.material.detail'
return request(data, "post")
}
\ No newline at end of file
......@@ -5,8 +5,8 @@
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="'100px'"
:form-data="showFormData">
<template slot="brand">
<el-cascader ref="cascader" v-model="searchForm.brandId" filterable :options="options" :value-key="'id'" :props="cascaderProps"
clearable></el-cascader>
<el-cascader ref="cascader" v-model="searchForm.brandId" filterable :options="options" :value-key="'id'"
:props="cascaderProps" clearable></el-cascader>
</template>
</d2-search>
<div class="up-btns">
......@@ -24,11 +24,56 @@
</d2-table-header>
<d2-table ref="table" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams"
:before-search-fn="beforeSearchFn">
<div slot="brandName" slot-scope="scope">
<template v-if="scope.scope.brandName">
{{ scope.scope.brandName.split(",").length > 1 ? scope.scope.brandName.split(",")[0] + '...' :
scope.scope.brandName.split(",")[0]}}
<el-popover placement="top-start" width="200" trigger="hover">
<p v-for="(item, index) in scope.scope.brandName.split(',')" :key="index">
{{ item }}
</p>
<span class="trick-no" slot="reference" v-show="scope.scope.brandName.split(',').length > 1">({{
scope.scope.brandName.split(",").length - 1 }})</span>
<!-- <el-button slot="reference">hover 激活</el-button> -->
</el-popover>
</template>
<template v-else>-</template>
</div>
<div slot="subBrandName" slot-scope="scope">
<template v-if="scope.scope.subBrandName">
{{ scope.scope.subBrandName.split(",").length > 1 ? scope.scope.subBrandName.split(",")[0] + '...' :
scope.scope.subBrandName.split(",")[0]}}
<el-popover placement="top-start" width="200" trigger="hover">
<p v-for="(item, index) in scope.scope.subBrandName.split(',')" :key="index">
{{ item }}
</p>
<span class="trick-no" slot="reference" v-show="scope.scope.subBrandName.split(',').length > 1">({{
scope.scope.subBrandName.split(",").length - 1 }})</span>
<!-- <el-button slot="reference">hover 激活</el-button> -->
</el-popover>
</template>
<template v-else>-</template>
</div>
<div slot="merchantName" slot-scope="scope">
<template v-if="scope.scope.merchantName">
{{ scope.scope.merchantName.split(",").length > 1 ? scope.scope.merchantName.split(",")[0] + '...' :
scope.scope.merchantName.split(",")[0]}}
<el-popover placement="top-start" width="200" trigger="hover">
<p v-for="(item, index) in scope.scope.merchantName.split(',')" :key="index">
{{ item }}
</p>
<span class="trick-no" slot="reference" v-show="scope.scope.merchantName.split(',').length > 1">({{
scope.scope.merchantName.split(",").length - 1 }})</span>
<!-- <el-button slot="reference">hover 激活</el-button> -->
</el-popover>
</template>
<template v-else>-</template>
</div>
<div slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleEdit(scope.scope)">
编辑
</el-button>
<el-button type="text" @click="handleClone(scope.scope)">
<el-button type="text" @click="handleDelete(scope.scope)">
删除
</el-button>
</div>
......@@ -39,7 +84,7 @@
</template>
<script>
import { deepClone } from "@/common/util"
import { getConfigList, getCarbrandTree, getListShop4sByRef } from "@api/contentManager"
import { getConfigList, getCarbrandTree, getListShop4sByRef, deleteConfig, getMateralDetail } from "@api/contentManager"
export default {
data() {
return {
......@@ -71,11 +116,13 @@ export default {
tableColumns: [
{
label: "品牌",
prop: "brandName"
prop: "brandName",
addHtml: "brandName"
},
{
label: "子品牌",
prop: "subBrandName"
prop: "subBrandName",
addHtml: "subBrandName"
},
{
label: "关联门店",
......@@ -91,42 +138,7 @@ export default {
baseData: {
shopList: [],
},
options: [{
value: 'zhinan',
label: '指南',
children: [{
value: 'shejiyuanze',
label: '设计原则',
}, {
value: 'daohang',
label: '导航'
}]
}, {
value: 'zujian',
label: '组件',
children: [{
value: 'basic',
label: 'Basic',
}, {
value: 'form',
label: 'Form',
}, {
value: 'data',
label: 'Data',
}, {
value: 'notice',
label: 'Notice',
}, {
value: 'navigation',
label: 'Navigation',
}, {
value: 'others',
label: 'Others',
}]
}, {
value: 'ziyuan',
label: '资源',
}],
options: [],
cascaderProps: { checkStrictly: true, value: 'id' }
}
},
......@@ -138,7 +150,7 @@ export default {
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
const {brandId} = this.searchFormSearch
const { brandId } = this.searchFormSearch
if (brandId) {
this.searchFormSearch.brandId = brandId[brandId.length - 1]
}
......@@ -217,6 +229,37 @@ export default {
},
handleDialog() {
this.$router.push({ name: "addEquity" })
},
async handleEdit(row) {
const res = await getMateralDetail({id: row.id})
console.log(res)
this.$router.push({ name: "addEquity", query: {
id: row.id,
isRelMerchant: res.isRelMerchant,
materialInfoList: res.materialInfoList,
brandData: res.relBrandList,
storeData: res.relMerchantList
} })
},
handleDelete(row) {
this.$confirm("删除后相关品牌素材将从展业助手中移除", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
closeOnClickModal: false
})
.then(async() => {
const res = await deleteConfig({id: row.id})
if (res) {
this.$message.success('删除成功')
this.$refs.table.refreshTable(true, true)
}
else this.$message.error('删除失败')
})
.catch((err) => {
console.log(err)
})
}
}
}
......@@ -225,4 +268,11 @@ export default {
.m-t-40 {
margin-top: 40px;
}
.trick-no {
cursor: pointer;
font-size: 13px;
color: #2a58ad;
line-height: 20px;
}
</style>
......@@ -70,7 +70,8 @@ export default {
props: {
dialogVisible: Boolean,
formInfo: Object,
brandData: Array
brandData: Array,
levelId: Number
},
watch: {
formInfo(val) {
......@@ -99,7 +100,8 @@ export default {
seriesId: carSeries.id,
seriesName: carSeries.name,
contentPicUrl,
index
index,
levelId: this.levelId
}
this.$emit("dialogConfirm", obj)
this.formData = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!