浏览代码

始宁农业后台:内容管理-通知发布

panyong 2 年之前
父节点
当前提交
377a129123
共有 2 个文件被更改,包括 14 次插入5 次删除
  1. 0 4
      htmldev/shiningManage/README.md
  2. 14 1
      htmldev/shiningManage/src/views/contentManage/notify/index.vue

+ 0 - 4
htmldev/shiningManage/README.md

@@ -235,10 +235,6 @@ yarn build
 
 ### TODO List
 
-* 内容管理-通知管理
-  * 列表
-    - 状态(隐藏/显示)是怎么控制的
-
 * 内容管理-VR看菜园
   * 缺列表、新增、编辑、删除接口
 

+ 14 - 1
htmldev/shiningManage/src/views/contentManage/notify/index.vue

@@ -69,10 +69,11 @@
         <template slot-scope="scope">{{ scope.row.msg_top === 1 ? '是' : '否' }}</template>
       </el-table-column>
       <el-table-column label="创建时间" prop="created_at" min-width="160"></el-table-column>
-      <el-table-column label="操作" width="150">
+      <el-table-column label="操作" width="180">
         <template slot-scope="scope">
           <el-button type="text" @click="edit(scope.row)">编辑</el-button>
           <el-button type="text" @click="msgTop(scope.row)" v-if="scope.row.msg_top === 0">置顶</el-button>
+          <el-button type="text" @click="msgRelease(scope.row)" v-if="scope.row.msg_status === 0">发布</el-button>
           <el-button type="text" @click="del(scope.row)">删除</el-button>
         </template>
       </el-table-column>
@@ -142,6 +143,18 @@ export default {
       }).catch(() => {
       })
     },
+    msgRelease(row) {
+      this.$confirm('确定要发布吗', '确认', {
+        type: 'warning'
+      }).then(async () => {
+        const data = await this.$fetch('/api/admin/msg/publish', { id: row.id })
+        if (data.code === 200) {
+          this.$message.success('发布成功')
+          this.init()
+        }
+      }).catch(() => {
+      })
+    },
     del(row) {
       this.$confirm('确定要删除吗', '确认', {
         type: 'warning'