修改专题模块

This commit is contained in:
lcc
2024-08-12 23:24:46 +08:00
parent 111efc1b40
commit 1f263ae30b
3 changed files with 39 additions and 1 deletions
+8
View File
@@ -104,3 +104,11 @@ export async function removeTopicModuleOption(id) {
}
return Promise.reject(new Error(res.data.message));
}
export async function updateTopicModuleStatus(data) {
const res = await request.put('/sytopic/module/status', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
@@ -139,6 +139,12 @@
</template>
</template>
<template v-if="moduleType === 6">
<el-form-item label="显示时间标题:" prop="showBtn">
<el-radio-group v-model="form.showBtn">
<el-radio label="0" key="0"></el-radio>
<el-radio label="1" key="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="文章内容:">
<tinymce-editor
:init="editoption"
+25 -1
View File
@@ -74,6 +74,14 @@
</el-link>
</template>
</el-popconfirm>
<el-link
type="primary"
:underline="false"
icon="el-icon-edit"
@click="updateStatus(row)"
>
{{ row.status === '1' ? '显示' : '隐藏' }}
</el-link>
</template>
</ele-pro-table>
</el-card>
@@ -100,7 +108,8 @@
import {
pageSyTopicModule,
pageTopicModuleTypes,
removeTopicModule
removeTopicModule,
updateTopicModuleStatus
} from '@/api/sytopic/module';
import ModuleEdit from './components/module-edit.vue';
import ModuleOptionEdit from './components/module-option-edit.vue';
@@ -258,6 +267,21 @@
},
showQrCode() {
this.showQr = true;
},
updateStatus(row) {
console.log(row);
let status = 1;
if (row.status === '1') {
status = 0;
}
updateTopicModuleStatus({ id: row.id, status: status })
.then((msg) => {
this.$message.success(msg);
this.reload();
})
.catch((e) => {
this.$message.error(e.message);
});
}
},
watch: {