Commit ac47a89c by swl

feat: gx

parent 960bd873
......@@ -157,3 +157,12 @@ export function enableKeyword(params) {
})
);
}
// 关键词-删除
export function delKeyword(params) {
return api(
Object.assign(formatParams("POST", params), {
url: "/admin-api/living-circle/delKeyword",
})
);
}
......@@ -84,7 +84,7 @@
>
<el-button
@click="delFlagHandle(scope.row)"
:type="scope.row.delFlag == 0 ? 'danger' : 'success'"
:type="scope.row.delFlag == 0 ? 'warning' : 'success'"
size="mini"
round
slot="reference"
......
......@@ -164,7 +164,7 @@
>
<el-button
@click="delFlagHandle(scope.row)"
:type="scope.row.delFlag == 0 ? 'danger' : 'success'"
:type="scope.row.delFlag == 0 ? 'warning' : 'success'"
size="mini"
round
slot="reference"
......
......@@ -112,7 +112,7 @@
>
<el-button
@click="delFlagHandle(scope.row)"
:type="scope.row.delFlag == 0 ? 'danger' : 'success'"
:type="scope.row.delFlag == 0 ? 'warning' : 'success'"
size="mini"
round
slot="reference"
......
......@@ -58,20 +58,32 @@
<el-button
type="primary"
size="mini"
class="btn"
round
:disabled="scope.row.delFlag == 0"
@click="view(scope.row)"
>编辑</el-button
>
<el-button
@click="delFlagHandle(scope.row)"
:type="scope.row.delFlag == 0 ? 'danger' : 'success'"
@click="enableHandle(scope.row)"
:type="scope.row.delFlag == 0 ? 'warning' : 'success'"
size="mini"
round
slot="reference"
>{{ scope.row.delFlag == 0 ? "禁用" : "启用" }}
</el-button>
<el-popconfirm
title="确定删除此数据吗?"
@confirm="delHandle(scope.row)"
>
<el-button
type="danger"
size="mini"
round
slot="reference"
style="margin-left: 10px"
>删除
</el-button>
</el-popconfirm>
</template>
</el-table-column>
</table-template>
......@@ -112,6 +124,7 @@ import {
enableKeyword,
editKeyword,
addKeyword,
delKeyword,
} from "@/api/livingCircle";
export default {
components: { TableTemplate },
......@@ -198,7 +211,7 @@ export default {
this.dataForm.id = row.id;
this.dialogVisible = true;
},
delFlagHandle(row) {
enableHandle(row) {
enableKeyword({
id: row.id,
}).then((res) => {
......@@ -212,6 +225,18 @@ export default {
this.type = "add";
this.dialogVisible = true;
},
delHandle(row) {
delKeyword({
id: row.id,
pageNum: 1,
pageSize: 10,
}).then((res) => {
if (res.code == 200) {
this.$message.success("删除成功");
this.init();
}
});
},
confirmHandle() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment