Commit 14b953dc by 王志慧

commit

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