mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 19:06:43 +08:00
管理案例页面增加取消推荐案例和推荐案例
This commit is contained in:
@@ -127,7 +127,7 @@ const ids=function (data){
|
||||
* }
|
||||
* */
|
||||
const excellent=function(data){
|
||||
return ajax.post('/xboe/m/boe/cases/excellent')
|
||||
return ajax.post('/xboe/m/boe/cases/excellent',data)
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
@@ -38,9 +38,8 @@
|
||||
<!-- <el-button type="text" @click="shareItem(scope.row)" icon="el-icon-share" style="margin:0 5px">推荐</el-button> -->
|
||||
<el-button style="margin:0 5px" v-if="!scope.row.isTop" type="text" @click="setTop(scope.row)" icon="el-icon-top">置顶</el-button>
|
||||
<el-button style="margin:0 5px" v-if="scope.row.isTop" type="text" @click="setTop(scope.row)" icon="el-icon-bottom">取消置顶</el-button>
|
||||
<el-button type="text" icon="el-icon-medal" ><span @click="cancal(scope.row)" v-if="scope.row.excellent">取消案例</span><span @click="open(scope.row)" v-else>优秀案例</span></el-button>
|
||||
<el-button style="margin:0 5px" type="text" @click="delItem(scope.row)" icon="el-icon-delete">删除</el-button>
|
||||
<el-button type="text" icon="el-icon-finished">推荐优秀案例</el-button>
|
||||
|
||||
</el-button-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -118,6 +117,7 @@ export default {
|
||||
name: 'articleItems',
|
||||
data() {
|
||||
return {
|
||||
excellent:false,
|
||||
queryObj: {
|
||||
pageIndex:1,
|
||||
pageSize:10,
|
||||
@@ -138,7 +138,6 @@ export default {
|
||||
shareShow: false,
|
||||
shareUsers:[],
|
||||
shareItemData:{},
|
||||
|
||||
timeout: null,
|
||||
params: { name: '', type: '' },
|
||||
typeList: [],
|
||||
@@ -160,6 +159,62 @@ export default {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
cancal(item){
|
||||
this.$confirm('是否取消该案例为优秀案例?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.excellent = false;
|
||||
let data = {
|
||||
id:item.id,
|
||||
excellent:this.excellent
|
||||
}
|
||||
console.log(data)
|
||||
apiCase.excellent(data).then(res => {
|
||||
if(res.status == 200){
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '取消成功!'
|
||||
});
|
||||
this.getData()
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已撤回取消推荐'
|
||||
});
|
||||
});
|
||||
},
|
||||
open(item) {
|
||||
this.$confirm('是否推荐该案例为优秀案例?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.excellent = true;
|
||||
let data = {
|
||||
id:item.id,
|
||||
excellent:this.excellent
|
||||
}
|
||||
console.log(data)
|
||||
apiCase.excellent(data).then(res => {
|
||||
if(res.status == 200){
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '推荐成功!'
|
||||
});
|
||||
this.getData()
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消推荐'
|
||||
});
|
||||
});
|
||||
},
|
||||
inputOn() {
|
||||
this.$forceUpdate();
|
||||
},
|
||||
|
||||
@@ -61,6 +61,8 @@
|
||||
<span class="quyer-tag">
|
||||
<el-button type="text" class="order-class" @click="searchData('views')" :class="{ actice: queryCondition.orderField == 'views' }">最热</el-button>
|
||||
<el-button type="text" class="order-class" @click="searchData('')" :class="{ actice: queryCondition.orderField == '' }">最新</el-button>
|
||||
<el-button type="text" class="order-class" @click="searchData('')" :class="{ actice: queryCondition.orderField == '' }">优秀案例</el-button>
|
||||
|
||||
<!-- <el-button type="text" class="order-class" @click="queryCondition.breCommend = queryCondition.breCommend == ture ? true : null" :class="{ actice: queryCondition.breCommend == true }">组织推荐</el-button> -->
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user