Commit 14b953dc by 王志慧

commit

1 parent 33666dde
......@@ -32,7 +32,9 @@
<ticket :choseItemList="scope.scope.list"></ticket>
</div>
</span>
<span slot="topFlag" slot-scope="scope">
<el-switch v-model="scope.scope.isOpen" active-text="开" inactive-text="关" @change="updateState(scope.scope)"></el-switch>
</span>
<span class="table-btns" slot="optionsFun" slot-scope="scope" :data="scope.scope">
<template v-if="!(accountLevel == 4 && activetab == 1)">
<!-- <template v-if="scope.scope.state === 0">
......@@ -80,7 +82,7 @@
<script>
import glsxDialog from '@/components/glsx-dialog'
import url from '@/assets/empty.png'
import { getghSetMealListApi, getSetMealstoreListApi, deleteSetMeal, upDownPackage, updateToTop,cancelTopMD ,updateToTopMD} from '@/api/modules/setmeal'
import { getghSetMealListApi, getSetMealstoreListApi, deleteSetMeal, upDownPackage, updateToTop, cancelTopMD, updateToTopMD } from '@/api/modules/setmeal'
import { getLoginCount } from '@/api/modules/service'
import { stateList } from '@/common/constant'
......@@ -187,32 +189,32 @@ export default {
click: this.handleUpdateToTop
}
},
{
type: 'el-button',
name: '置顶推荐',
attrs: {
type: 'text'
},
condition: row => {
return row.topFlag == 2 && this.accountLevel == 4 && this.showGh
},
listeners: {
click: this.handleUpdateToTop
}
},
{
type: 'el-button',
name: '取消置顶',
attrs: {
type: 'text'
},
condition: row => {
return row.topFlag == 1 && this.accountLevel == 4 && this.showGh
},
listeners: {
click: this.cancelTopMD
}
},
// {
// type: 'el-button',
// name: '置顶推荐',
// attrs: {
// type: 'text'
// },
// condition: row => {
// return row.topFlag == 2 && this.accountLevel == 4 && this.showGh
// },
// listeners: {
// click: this.handleUpdateToTop
// }
// },
// {
// type: 'el-button',
// name: '取消置顶',
// attrs: {
// type: 'text'
// },
// condition: row => {
// return row.topFlag == 1 && this.accountLevel == 4 && this.showGh
// },
// listeners: {
// click: this.cancelTopMD
// }
// },
{
type: 'el-button',
name: '已置顶推荐',
......@@ -266,6 +268,12 @@ export default {
}
},
{
label: '首页置顶展示',
prop: 'topFlag',
addHtml: 'topFlag',
width: 150,
},
{
label: '操作',
prop: 'optionsFun',
addHtml: 'optionsFun',
......@@ -361,6 +369,9 @@ export default {
this.$refs.memberSetMealRef.refreshTable()
},
setTableFinishFun() {
this.$refs.memberSetMealRef.data.forEach((item, index) => {
item.isOpen = item.topFlag == 2 ? false : true
})
//接收到的数据为空
if (!this.$refs.memberSetMealRef.data.length) {
this.$refs.memberSetMealRef.setTableHeightFun()
......@@ -422,7 +433,7 @@ export default {
},
//置顶推荐
handleUpdateToTop(row) {
let params = this.showGh&&this.accountLevel == 4?updateToTopMD:updateToTop
let params = this.showGh && this.accountLevel == 4 ? updateToTopMD : updateToTop
params({ id: row.id }).then(res => {
console.log(res)
this.$message({
......@@ -445,6 +456,13 @@ export default {
}
})
},
updateState(val) {
if (val.topFlag == 2) {
this.handleUpdateToTop(val)
} else {
this.cancelTopMD(val)
}
},
// 查看示例效果
handleLook(row) {},
handleDelete(row) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!