-
+
@@ -61,6 +62,7 @@
v-else-if="item.type == 'select'"
v-model="form[item.prop]"
:placeholder="'请选择' + item.label"
+ style="width: 100%"
>
@@ -99,7 +107,12 @@
import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin"
import ElUploadSelf from "@/components/Upload"
-
+import {
+ articleList,
+ articleEnable,
+ deleteArticle,
+ addArticle,
+} from "@/api/operation-management"
export default {
components: {
CustomsTable,
@@ -134,7 +147,7 @@ export default {
{
label: "标题",
minWidth: 120,
- value: "title",
+ value: "articleTitle",
},
{
label: "图片",
@@ -218,58 +231,89 @@ export default {
{
type: "select",
label: "类型",
- prop: "type",
+ prop: "articleType",
selectGroup: [
{
label: "筛查",
- value: 0,
+ value: 1,
},
{
label: "生活",
- value: 1,
+ value: 2,
},
{
label: "医学知识",
- value: 2,
+ value: 3,
},
{
label: "其他",
- value: 3,
+ value: 4,
},
],
},
{
type: "input",
label: "标题",
- prop: "title",
+ prop: "articleTitle",
},
{
type: "upload",
label: "图片",
- prop: "img",
+ prop: "imgPath",
+ listType: "picture-card",
},
{
type: "upload",
label: "PDF",
- prop: "aaa",
+ prop: "filePath",
+ accept: "application/pdf",
},
{
type: "switch",
label: "启用状态",
- prop: "ssd",
+ prop: "status",
},
],
rules: {
title: [{ required: true, message: "请输入标题", trigger: "blur" }],
},
- form: {},
+ form: {
+ status: 1,
+ },
}
},
watch: {},
- mounted() {},
+ mounted() {
+ this.getArticleList()
+ },
methods: {
- // 添加医联体
+ fileSuccess(val) {
+ console.log(this.form)
+ },
+ // 获取健康科普
+ getArticleList() {
+ this.listLoading = true
+ let params = {
+ size: this.pageSize,
+ current: this.pageIndex,
+ moduleType: "4",
+ articleType: this.selectType + 1,
+ }
+ articleList(params)
+ .then((res) => {
+ if (res.code == 1) {
+ this.tableData = [...res.data.records]
+ this.total = res.data.total
+ this.listLoading = false
+ }
+ })
+ .catch((e) => {
+ this.listLoading = false
+ })
+ },
+ // 添加文章
addMedical() {
+ this.readOnly = false
this.addVisible = true
},
// 查看
@@ -295,15 +339,38 @@ export default {
// 启用状态
openChage(data, index) {
console.log(data, index)
+ let params = {
+ id: data.id,
+ status: data.status ? 1 : 0,
+ }
+ articleEnable(params).then((res) => {
+ if (res.code == 1) {
+ // this.$message.success("保存成功")
+ this.getArticleList()
+ }
+ })
},
resetForm() {
this.$refs["form"].resetFields()
+ this.form = {
+ status: 1,
+ }
},
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
- alert("submit!")
- this.addVisible = false
+ addArticle({
+ ...this.form,
+ moduleType: "4",
+ }).then((res) => {
+ if (res.code == 1) {
+ this.addVisible = false
+ this.$refs["form"].resetFields()
+ this.form = {
+ status: 1,
+ }
+ }
+ })
} else {
console.log("error submit!!")
return false
diff --git a/src/views/systems/operation-management/components/NewsMeeting.vue b/src/views/systems/operation-management/components/NewsMeeting.vue
index 70a896429a42f7cdf01c7fdfda6c89920e0efc43..5f3f29ae2248e691bfd6d9f5481c13dc3b7da793 100644
--- a/src/views/systems/operation-management/components/NewsMeeting.vue
+++ b/src/views/systems/operation-management/components/NewsMeeting.vue
@@ -18,7 +18,15 @@
@currentPageChange="handleCurrentChange"
/>
-
+
+
+ 确定删除吗?
+
+
+