Ver Fonte

留言板管理新增删除更新

yuan há 5 meses atrás
pai
commit
588fcb7ad7
1 ficheiros alterados com 94 adições e 0 exclusões
  1. 94 0
      src/views/messageBoard/messageBoard.vue

+ 94 - 0
src/views/messageBoard/messageBoard.vue

@@ -34,11 +34,27 @@
                             <span v-if="scope.row.isDelete == 0">否</span>
                             <span v-if="scope.row.isDelete == 1" style="color: #f56c6c;">是</span>
                         </template>
+                    </el-table-column>
+					<el-table-column prop="isDelete" label="是否采纳">
+                        <template slot-scope="scope">
+                            <span v-if="scope.row.status == 0">否</span>
+                            <span v-if="scope.row.status == 1" style="color: #f56c6c;">是</span>
+                        </template>
                     </el-table-column>
                     <el-table-column prop="createTime" label="创建时间" width="200">
 					</el-table-column>
                     <el-table-column prop="updateTime" label="更新时间" width="200">
 					</el-table-column>
+					<el-table-column label="操作" prop="id" width="200" fixed='right' align="center">
+						<template slot-scope="scope">
+							<el-button size="mini" type="primary" style="margin: 5px;"
+								@click="messageUpdate(scope.row)">采纳
+							</el-button>
+							<el-button size="mini" type="danger" style="margin: 5px;"
+								@click="messageDelete(scope.row)">删除
+							</el-button>
+						</template>
+					</el-table-column>
 				</el-table>
 				<div style="text-align: center;margin-top: 10px;">
 					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
@@ -112,6 +128,84 @@
                 this.contentS = ''
                 this.classSelect()
             },
+			// 删除留言
+			messageDelete(row) {
+				this.$confirm(`确定删除此条留言?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					this.$http({
+						url: this.$http.adornUrl('messageBoard/deleteMessageBoard'),
+						method: 'get',
+						params: this.$http.adornParams({
+							'messageBoardId': row.messageId
+						})
+					}).then(({
+						data
+					}) => {
+						if(data.code==0){
+							this.$message({
+								message: '删除成功',
+								type: 'success',
+								duration: 1500,
+								onClose: () => {
+										this.classSelect()
+									// this.dialogVisibleS = false
+								}
+							})
+						}else{
+							this.$message({
+								message: data.msg,
+								type: 'warning',
+								duration: 1500,
+								onClose: () => {
+								}
+							})
+						}
+
+					})
+				}).catch(() => {})
+			},
+			// 更新留言
+			messageUpdate(row) {
+				this.$confirm(`确定采纳此条留言?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					this.$http({
+						url: this.$http.adornUrl('messageBoard/updateMessageBoardStatus'),
+						method: 'get',
+						params: this.$http.adornParams({
+							'messageBoardId': row.messageId
+						})
+					}).then(({
+						data
+					}) => {
+						if(data.code==0){
+							this.$message({
+								message: '采纳成功',
+								type: 'success',
+								duration: 1500,
+								onClose: () => {
+										this.classSelect()
+									// this.dialogVisibleS = false
+								}
+							})
+						}else{
+							this.$message({
+								message: data.msg,
+								type: 'warning',
+								duration: 1500,
+								onClose: () => {
+								}
+							})
+						}
+
+					})
+				}).catch(() => {})
+			},
 
 		},
 		mounted() {