|
@@ -32,13 +32,17 @@
|
|
|
<el-table-column prop="created_at" label="创建时间">
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column fixed="right" label="操作" width="110">
|
|
|
+ <el-table-column fixed="right" header-align="center" label="操作" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="listBtnBox">
|
|
|
<div class="listDeleteBtn" @click="deleteRow(scope.row.name, scope.row)">
|
|
|
<i class="el-icon-delete"></i>删除
|
|
|
</div>
|
|
|
+ <div class="listEditBtn" @click="goEdit(scope.row.id, scope.row)">
|
|
|
+ <i class="el-icon-edit-outline"></i>编辑
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -85,7 +89,7 @@ import tableTitle from './components/blogroll/tableTitle.vue';
|
|
|
//引入公用样式
|
|
|
import '@/styles/global.less';
|
|
|
// 引入api
|
|
|
-import { getBlackWordList, addBlackWord, delBlackWord } from '@/api/blackWord.js'
|
|
|
+import { getBlackWordList, addBlackWord, delBlackWord, upBlackWord } from '@/api/blackWord.js'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -117,6 +121,7 @@ export default {
|
|
|
// 图片相关
|
|
|
formLabelWidth: '120px',//表单的长度
|
|
|
|
|
|
+ id:'',
|
|
|
//表单相关
|
|
|
ruleForm: {
|
|
|
name: '', //违禁词名称
|
|
@@ -225,12 +230,37 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ if (this.dialogName == "编辑") {
|
|
|
+ upBlackWord({
|
|
|
+ id: this.id,
|
|
|
+ name: this.ruleForm.name,
|
|
|
+ }).then(data => {
|
|
|
+ console.log(data);
|
|
|
+ if (data.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: "添加成功",
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.dialogTableVisible = false
|
|
|
+ this.getData()
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
//取消添加或编辑
|
|
|
cancelForm() {
|
|
|
this.dialogTableVisible = false
|
|
|
},
|
|
|
+ goEdit(id, val) {
|
|
|
+ this.dialogTableVisible = true //弹框显示
|
|
|
+ this.dialogName = "编辑" //弹框名字
|
|
|
+ this.id = id //活动id
|
|
|
+ this.ruleForm.name = val.name //违规词名称
|
|
|
+ },
|
|
|
},
|
|
|
+
|
|
|
mounted() {
|
|
|
//获取网站列表数据
|
|
|
this.getData()
|