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/discussionManage.vue |   85 +++++++++++++++++++++++++++---------------
 1 files changed, 54 insertions(+), 31 deletions(-)

diff --git a/src/views/article/discussionManage.vue b/src/views/article/discussionManage.vue
index d7ded30..597f5a4 100644
--- a/src/views/article/discussionManage.vue
+++ b/src/views/article/discussionManage.vue
@@ -32,13 +32,13 @@
         </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="showStatus(row.publish, 1).type" v-text="showStatus(row.publish, 1).text">
         </el-tag>
       </template>
 
-      <template slot-scope="{ row }" slot="iscomment">
-        <el-tag>{{ row.iscomment == "1" ? "开启" : row.iscomment == "0" ? "关闭" : "关闭" }}
+      <template slot-scope="{ row, size }" slot="iscomment">
+        <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text">
         </el-tag>
       </template>
     </avue-crud>
@@ -117,13 +117,16 @@
         datetime: "",
         selectionList: [],
         option: {
+          labelWidth: 96,
+          searchLabelWidth: 96,
+          searchShow: true,
+          searchMenuSpan: 3,
+          menuWidth: 500,
+
           height: "auto",
           calcHeight: 54,
           dialogWidth: 950,
           tip: false,
-          searchShow: true,
-          searchMenuSpan: 3,
-          menuWidth: 500,
           border: false,
           //stripe:true,
           index: true,
@@ -132,6 +135,7 @@
           excelBtn: true,
           dialogClickModal: false,
           column: [{
+              overHidden: true,
               label: "议事标题",
               prop: "title",
               span: 24,
@@ -150,7 +154,7 @@
               span: 24,
               minRows: 2,
               tags: true,
-              type: "tree",
+              type: "cascader",
               multiple: true,
               dicData: [],
               rules: [{
@@ -165,29 +169,10 @@
               hide: true,
             },
             {
-              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",
-              }, ],
-            },
-            {
+              width: 110,
               label: "封面",
               prop: "url",
               // align:'center',
-              width: 80,
               type: "upload",
               listType: "picture-img",
               action: "/api/blade-resource/oss/endpoint/put-file",
@@ -199,12 +184,13 @@
               span: 24,
             },
             {
+              width: 110,
               label: "文章类型",
               prop: "articleType",
               addDisplay: true,
               editDisplay: true,
               viewDisplay: true,
-              searchSpan: 3,
+              searchSpan: 4,
               checkStrictly: true,
               dicUrl: "/api/blade-system/dict-biz/dictionary?code=investigateType",
               props: {
@@ -221,16 +207,36 @@
             },
             {
               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: 3,
-              width: 80,
+              searchSpan: 4,
               value: "0",
               slot: true,
               search: true,
@@ -450,6 +456,7 @@
           editBtn: this.vaildData(this.permission.article_edit, true),
         }
       },
+
       ids() {
         let ids = []
         this.selectionList.forEach((ele) => {
@@ -457,6 +464,22 @@
         })
         return ids.join(",")
       },
+
+      showStatus() {
+        return (data, type) => {
+          if (data == 0) {
+            return {
+              text: type == 1 ? '未发布' : '关闭',
+              type: 'info'
+            }
+          } else if (data == 1) {
+            return {
+              text: type == 1 ? '已发布' : '开启',
+              type: 'success'
+            }
+          }
+        }
+      }
     },
     methods: {
       openEditPopup(row) {

--
Gitblit v1.9.3