From d16d10d94fddff86bdfd87113e7fd2cebe8b7cd7 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 24 Jan 2024 18:15:06 +0800
Subject: [PATCH] 居民监管样式调整

---
 src/views/article/article.vue |  383 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 202 insertions(+), 181 deletions(-)

diff --git a/src/views/article/article.vue b/src/views/article/article.vue
index 9d0f4e3..60c704b 100644
--- a/src/views/article/article.vue
+++ b/src/views/article/article.vue
@@ -16,12 +16,12 @@
             </template>
 
             <template slot-scope="{type,size,row }" slot="menu">
-                <el-button icon="el-icon-circle-plus-outline" :size="size" :type="type" @click.stop="openDilog(row, 0)">
+                <!-- <el-button icon="el-icon-circle-plus-outline" :size="size" :type="type" @click.stop="openDilog(row, 0)">
                     公益报名
                 </el-button>
                 <el-button icon="el-icon-circle-plus-outline" :size="size" :type="type" @click.stop="openDilog(row, 1)">
                     创建议题
-                </el-button>
+                </el-button> -->
                 <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type"
                     @click.stop="updateFb(row)">
                     撤销
@@ -32,10 +32,8 @@
                 </el-button>
             </template>
 
-            <template slot-scope="{ row }" slot="publish">
-                <el-tag>{{
-                    row.publish == "1" ? "已发布" : row.publish == "0" ? "未发布" : "未发布"
-                }}
+            <template slot-scope="{ row, size }" slot="publish">
+                <el-tag :size="size" :type="showPublish(row.publish).type" v-text="showPublish(row.publish).text">
                 </el-tag>
             </template>
 
@@ -125,13 +123,16 @@
             datetime: "",
             selectionList: [],
             option: {
+                labelWidth: 96,
+                searchLabelWidth: 96,
+                searchShow: true,
+                searchMenuSpan: 3,
+                menuWidth: 280,
+
                 height: "auto",
                 calcHeight: 54,
                 dialogWidth: 950,
                 tip: false,
-                searchShow: true,
-                searchMenuSpan: 3,
-                menuWidth: 240,
                 border: false,
                 //stripe:true,
                 index: true,
@@ -139,181 +140,187 @@
                 selection: true,
                 excelBtn: true,
                 dialogClickModal: false,
-                column: [{
-                    label: "文章标题",
-                    prop: "title",
-                    span: 24,
-                    row: true,
-                    searchSpan: 4,
-                    search: true,
-                    rules: [{
-                        required: true,
-                        message: "请输入文章标题",
-                        trigger: "blur",
-                    },],
-                },
-                {
-                    label: "文章封面",
-                    prop: "url",
-                    // align:'center',
-                    width: 80,
-                    type: "upload",
-                    listType: "picture-img",
-                    action: "/api/blade-resource/oss/endpoint/put-file",
-                    propsHttp: {
-                        res: "data",
-                        url: "link",
-                    },
-                    // hide: true,
-                    span: 24,
-                },
-                {
-                    label: "文章来源",
-                    prop: "sourceName",
-                    search: true,
-                    searchSpan: 4,
-                    span: 24,
-                    rules: [{
-                        required: true,
-                        message: "请输入文章类型",
-                        trigger: "blur",
-                    },],
-                }, {
-                    label: "文章范围",
-                    prop: "articleList",
-                    span: 12,
-                    minRows: 2,
-                    type: "cascader",
-                    multiple: true,
-                    tags: true,
-                    dicData: [],
-                    props: {
-                        label: "name",
-                        value: 'id'
-                    },
-                    hide: true,
-                },
-                {
-                    label: "文章类型",
-                    prop: "articleType",
-                    addDisplay: true,
-                    editDisplay: true,
-                    viewDisplay: true,
-                    searchSpan: 3,
-                    checkStrictly: true,
-                    dicUrl: "/api/blade-system/dict-biz/dictionary?code=articleType",
-                    props: {
-                        label: "dictValue",
-                        value: "dictKey",
-                    },
-                    search: true,
-                    type: "tree",
-                    rules: [{
-                        required: true,
-                        message: "请选择文章类型",
-                        trigger: "blur",
-                    },],
-                },
-                {
-                    label: "发布时间",
-                    prop: "dateTime",
-                    type: "datetime",
-                    format: "yyyy-MM-dd",
-                    valueFormat: "yyyy-MM-dd",
-                    searchSpan: 5,
-                    searchRange: true,
-                    hide: true,
-                    addDisplay: false,
-                    editDisplay: false,
-                    viewDisplay: false,
-                    search: true,
-                    rules: [{
-                        required: true,
-                        message: "请选择发布时间",
-                        trigger: "blur",
-                    },],
-                },
-                {
-                    label: "发布时间",
-                    prop: "createTime",
-                    type: "date",
-                    format: "yyyy-MM-dd",
-                    valueFormat: "yyyy-MM-dd HH:mm:ss",
-                },
-                {
-                    label: "发布状态",
-                    prop: "publish",
-                    searchSpan: 3,
-                    width: 80,
-                    value: "0",
-                    slot: true,
-                    search: true,
-                    type: "select",
-                    rules: [{
-                        required: true,
-                        message: "请选择发布状态",
-                        trigger: "blur",
-                    },],
-                    dicData: [{
-                        label: "未发布",
-                        value: "0",
+                column: [
+                    {
+                        overHidden: true,
+                        label: "文章标题",
+                        prop: "title",
+                        span: 24,
+                        row: true,
+                        searchSpan: 4,
+                        search: true,
+                        rules: [{
+                            required: true,
+                            message: "请输入文章标题",
+                            trigger: "blur",
+                        },],
                     },
                     {
-                        label: "已发布",
-                        value: "1",
-                    }
-                    ],
-                },
-                {
-                    label: "评论区",
-                    prop: "iscomment",
-                    width: 80,
-                    slot: true,
-                    type: "switch",
-                    activeColor: "#13ce66",
-                    inactiveColor: "#ccc",
-                    dicData: [{
-                        label: "关闭",
-                        value: "0",
-                    },
-                    {
-                        label: "开启",
-                        value: "1",
-                    }
-                    ],
-                },
-                {
-                    label: "视频",
-                    prop: "videoUrl",
-                    type: "upload",
-                    accept: "video/mp4",
-                    display: false,
-                    hide: true,
-                    span: 24,
-                    listType: "picture-img",
-                    action: "/api/depl/put-depl",
-                    propsHttp: {
-                        url: "data",
-                    },
-                },
-                {
-                    label: "文章内容",
-                    prop: "content",
-                    component: "AvueUeditor",
-                    options: {
+                        width: 110,
+                        label: "文章封面",
+                        prop: "url",
+                        // align:'center',
+                        type: "upload",
+                        listType: "picture-img",
                         action: "/api/blade-resource/oss/endpoint/put-file",
-                        // customConfig: {
-                        //   lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3']
-                        // },//wangEditor编辑的配置
-                        props: {
+                        propsHttp: {
                             res: "data",
                             url: "link",
                         },
+                        // hide: true,
+                        span: 24,
                     },
-                    hide: true,
-                    minRows: 6,
-                    span: 24,
-                },
+                    {
+                        width: 100,
+                        label: "文章来源",
+                        prop: "sourceName",
+                        search: true,
+                        searchSpan: 4,
+                        span: 24,
+                        rules: [{
+                            required: true,
+                            message: "请输入文章类型",
+                            trigger: "blur",
+                        },],
+                    },
+                    {
+                        label: "文章范围",
+                        prop: "articleList",
+                        span: 12,
+                        minRows: 2,
+                        type: "cascader",
+                        multiple: true,
+                        tags: true,
+                        dicData: [],
+                        props: {
+                            label: "name",
+                            value: 'id'
+                        },
+                        hide: true,
+                    },
+                    {
+                        width: 100,
+                        label: "文章类型",
+                        prop: "articleType",
+                        addDisplay: true,
+                        editDisplay: true,
+                        viewDisplay: true,
+                        searchSpan: 4,
+                        checkStrictly: true,
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=articleType",
+                        props: {
+                            label: "dictValue",
+                            value: "dictKey",
+                        },
+                        search: true,
+                        type: "tree",
+                        rules: [{
+                            required: true,
+                            message: "请选择文章类型",
+                            trigger: "blur",
+                        },],
+                    },
+                    {
+                        label: "发布时间",
+                        prop: "dateTime",
+                        type: "daterange",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd",
+                        searchSpan: 6,
+                        searchRange: true,
+                        hide: true,
+                        addDisplay: false,
+                        editDisplay: false,
+                        viewDisplay: false,
+                        search: true,
+                        rules: [{
+                            required: true,
+                            message: "请选择发布时间",
+                            trigger: "blur",
+                        },],
+                    },
+                    {
+                        width: 100,
+                        label: "发布时间",
+                        prop: "createTime",
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd HH:mm:ss",
+                    },
+                    {
+                        width: 100,
+                        label: "发布状态",
+                        prop: "publish",
+                        searchSpan: 4,
+                        value: "0",
+                        slot: true,
+                        search: true,
+                        type: "select",
+                        rules: [{
+                            required: true,
+                            message: "请选择发布状态",
+                            trigger: "blur",
+                        },],
+                        dicData: [{
+                            label: "未发布",
+                            value: "0",
+                        },
+                        {
+                            label: "已发布",
+                            value: "1",
+                        }
+                        ],
+                    },
+                    {
+                        width: 100,
+                        label: "评论区",
+                        prop: "iscomment",
+                        slot: true,
+                        type: "switch",
+                        activeColor: "#13ce66",
+                        inactiveColor: "#ccc",
+                        dicData: [{
+                            label: "关闭",
+                            value: "0",
+                        },
+                        {
+                            label: "开启",
+                            value: "1",
+                        }
+                        ],
+                    },
+                    {
+                        label: "视频",
+                        prop: "videoUrl",
+                        type: "upload",
+                        accept: "video/mp4",
+                        display: false,
+                        hide: true,
+                        span: 24,
+                        listType: "picture-img",
+                        action: "/api/depl/put-depl",
+                        propsHttp: {
+                            url: "data",
+                        },
+                    },
+                    {
+                        label: "文章内容",
+                        prop: "content",
+                        component: "AvueUeditor",
+                        options: {
+                            action: "/api/blade-resource/oss/endpoint/put-file",
+                            // customConfig: {
+                            //   lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3']
+                            // },//wangEditor编辑的配置
+                            props: {
+                                res: "data",
+                                url: "link",
+                            },
+                        },
+                        hide: true,
+                        minRows: 6,
+                        span: 24,
+                    },
                 ],
             },
             data: [],
@@ -467,6 +474,22 @@
                 ids.push(ele.id)
             })
             return ids.join(",")
+        },
+
+        showPublish () {
+            return (data) => {
+                if (data == 0) {
+                    return {
+                        text: '未发布',
+                        type: 'info'
+                    }
+                } else if (data == 1) {
+                    return {
+                        text: '已发布',
+                        type: 'success'
+                    }
+                }
+            }
         }
     },
     methods: {
@@ -634,7 +657,6 @@
             if (["edit", "view"].includes(type)) {
                 getNotice(this.form.id).then((res) => {
                     let data = res.data.data
-                    // data.forEach(item=>{
                     if (data.url.length > 0) {
                         var urls = []
                         var names = data.url.split(",")
@@ -643,11 +665,10 @@
                         })
                         data.url = urls.join(",")
                     }
-                    // })
+                    data.articleList = JSON.parse(data.articleRange)
                     this.form = data
                 })
             }
-            // con
             done()
         },
         currentChange (currentPage) {
@@ -784,4 +805,4 @@
 .avue-upload__icon {
     line-height: 6;
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3