From 2fc9ed9bc0c195b27c5cf593bd7d91ce85cd294f Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Fri, 29 Oct 2021 09:24:54 +0800
Subject: [PATCH] 拦截其他用户查看页面
---
src/views/article/article.vue | 91 ++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 88 insertions(+), 3 deletions(-)
diff --git a/src/views/article/article.vue b/src/views/article/article.vue
index c0300be..4669f32 100644
--- a/src/views/article/article.vue
+++ b/src/views/article/article.vue
@@ -30,6 +30,24 @@
@click="handleDelete"
>删 除
</el-button>
+ <el-button
+ type="danger"
+ size="small"
+ icon="el-icon-s-order"
+ plain
+ @click="kqcomment"
+ >开启评论
+ </el-button>
+ <el-button
+ type="danger"
+ size="small"
+ icon="el-icon-s-release"
+ plain
+ @click="gbcomment"
+ >关闭评论
+ </el-button>
+
+
</template>
<template slot-scope="{type,size,row }" slot="menu">
@@ -49,12 +67,20 @@
</el-tag>
</template>
+ <template slot-scope="{ row }" slot="iscomment">
+ <el-tag
+ >{{
+ row.iscomment == "1" ? "开启" : row.iscomment == "0" ? "关闭" : "关闭"
+ }}
+ </el-tag>
+ </template>
+
</avue-crud>
</basic-container>
</template>
<script>
- import {getList, remove, update, add, getNotice} from "@/api/article/article";
+ import {getList, remove, update, add, getNotice, upcomment} from "@/api/article/article";
import {mapGetters} from "vuex";
export default {
@@ -202,6 +228,23 @@
],
},
{
+ label: "评论区",
+ prop: "iscomment",
+ width: 80,
+ slot: true,
+ type: "select",
+ dicData: [
+ {
+ label: "关闭",
+ value: "0",
+ },
+ {
+ label: "开启",
+ value: "1",
+ }
+ ],
+ },
+ {
label: "视频",
prop: "videoUrl",
type: "upload",
@@ -284,7 +327,7 @@
},
methods: {
rowSave(row, done, loading) {
- if ( row.videoUrl.length == 0){
+ if (row.videoUrl.length == 0) {
row.videoUrl = "";
}
add(row).then(
@@ -404,7 +447,7 @@
endTime: dateTime[1],
...this.query,
};
- values.datetime = null;
+ values.dateTime = null;
}
this.loading = true;
getList(page.currentPage, page.pageSize, values).then((res) => {
@@ -435,6 +478,48 @@
loading();
}
);
+ },
+ kqcomment() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据开启评论?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }).then(() => {
+ return upcomment(this.ids, "1");
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ gbcomment() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据开启评论?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }).then(() => {
+ return upcomment(this.ids, "0");
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crud.toggleSelection();
+ });
}
},
};
--
Gitblit v1.9.3