xiongzhu 4 năm trước cách đây
mục cha
commit
4b591d4839
32 tập tin đã thay đổi với 569 bổ sung121 xóa
  1. 4 0
      src/main/java/com/izouma/jmrh/domain/Article.java
  2. 5 0
      src/main/java/com/izouma/jmrh/domain/OrgInfo.java
  3. 6 1
      src/main/java/com/izouma/jmrh/domain/Post.java
  4. 3 0
      src/main/java/com/izouma/jmrh/domain/ResourceSupplyAndDemand.java
  5. 4 3
      src/main/java/com/izouma/jmrh/service/PostService.java
  6. 2 0
      src/main/java/com/izouma/jmrh/web/ApprovalController.java
  7. 3 1
      src/main/java/com/izouma/jmrh/web/ApprovalProcessController.java
  8. 12 0
      src/main/java/com/izouma/jmrh/web/ArticleController.java
  9. 2 0
      src/main/java/com/izouma/jmrh/web/ArticleTypeController.java
  10. 13 0
      src/main/java/com/izouma/jmrh/web/OrgInfoController.java
  11. 16 1
      src/main/java/com/izouma/jmrh/web/PostController.java
  12. 13 0
      src/main/java/com/izouma/jmrh/web/ResourceSupplyAndDemandController.java
  13. 26 7
      src/main/vue/src/router.js
  14. 5 1
      src/main/vue/src/store.js
  15. 1 1
      src/main/vue/src/views/Admin.vue
  16. 1 1
      src/main/vue/src/views/ApprovalList.vue
  17. 51 50
      src/main/vue/src/views/ArticleAudit.vue
  18. 7 0
      src/main/vue/src/views/ArticleEdit.vue
  19. 1 0
      src/main/vue/src/views/ArticleList.vue
  20. 8 2
      src/main/vue/src/views/Login.vue
  21. 2 2
      src/main/vue/src/views/OrgInfoAudit.vue
  22. 4 3
      src/main/vue/src/views/OrgInfoList.vue
  23. 2 2
      src/main/vue/src/views/PolicyAudit.vue
  24. 7 0
      src/main/vue/src/views/PolicyEdit.vue
  25. 1 1
      src/main/vue/src/views/PolicyList.vue
  26. 54 29
      src/main/vue/src/views/PostAudit.vue
  27. 2 1
      src/main/vue/src/views/PostList.vue
  28. 2 10
      src/main/vue/src/views/ResourceSupplyAndDemandAudit.vue
  29. 7 0
      src/main/vue/src/views/ResourceSupplyAndDemandEdit.vue
  30. 1 0
      src/main/vue/src/views/ResourceSupplyAndDemandList.vue
  31. 302 4
      src/main/vue/src/views/audit.vue
  32. 2 1
      src/test/java/com/izouma/jmrh/repo/PostRepoTest.java

+ 4 - 0
src/main/java/com/izouma/jmrh/domain/Article.java

@@ -10,6 +10,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import javax.persistence.*;
+import java.time.LocalDateTime;
 
 @Data
 @Entity
@@ -49,4 +50,7 @@ public class Article extends BaseEntity {
     @ApiModelProperty("审核状态")
     @Enumerated(EnumType.STRING)
     private AuditStatus status;
+
+    @ApiModelProperty("审核时间")
+    private LocalDateTime auditTime;
 }

+ 5 - 0
src/main/java/com/izouma/jmrh/domain/OrgInfo.java

@@ -12,6 +12,7 @@ import javax.persistence.Entity;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
 import javax.persistence.Transient;
+import java.time.LocalDateTime;
 
 @Data
 @Entity
@@ -80,4 +81,8 @@ public class OrgInfo extends BaseEntity {
 
     @Transient
     private String nickname;
+
+    @ApiModelProperty("审核时间")
+    private LocalDateTime auditTime;
+
 }

+ 6 - 1
src/main/java/com/izouma/jmrh/domain/Post.java

@@ -1,6 +1,7 @@
 package com.izouma.jmrh.domain;
 
 import com.izouma.jmrh.converter.StringArrayConverter;
+import com.izouma.jmrh.enums.AuditStatus;
 import com.izouma.jmrh.enums.OrgStatus;
 import com.izouma.jmrh.enums.PapersType;
 import com.izouma.jmrh.enums.PostType;
@@ -12,6 +13,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import javax.persistence.*;
+import java.time.LocalDateTime;
 import java.util.List;
 
 @Data
@@ -64,9 +66,12 @@ public class Post extends BaseEntity {
     private int dislikeNum;
 
     @Enumerated(EnumType.STRING)
-    private OrgStatus status;
+    private AuditStatus status;
 
     private boolean publicPost;
 
     private boolean del;
+
+    @ApiModelProperty("审核时间")
+    private LocalDateTime auditTime;
 }

+ 3 - 0
src/main/java/com/izouma/jmrh/domain/ResourceSupplyAndDemand.java

@@ -76,4 +76,7 @@ public class ResourceSupplyAndDemand extends BaseEntity {
     @ApiModelProperty("对接状态")
     @Transient
     private ConversationStatus conversationStatus;
+
+    @ApiModelProperty("审核时间")
+    private LocalDateTime auditTime;
 }

+ 4 - 3
src/main/java/com/izouma/jmrh/service/PostService.java

@@ -5,6 +5,7 @@ import com.izouma.jmrh.dto.CommentDTO;
 import com.izouma.jmrh.dto.MyPostAndComment;
 import com.izouma.jmrh.dto.PageQuery;
 import com.izouma.jmrh.dto.PostDTO;
+import com.izouma.jmrh.enums.AuditStatus;
 import com.izouma.jmrh.enums.OrgStatus;
 import com.izouma.jmrh.enums.PostType;
 import com.izouma.jmrh.exception.BusinessException;
@@ -55,12 +56,12 @@ public class PostService {
             if (!SecurityUtils.hasRole(Authority.NAMES.ROLE_ADMIN)) {
                 throw new BusinessException("无权限");
             }
-            record.setStatus(OrgStatus.PASS);
+            record.setStatus(AuditStatus.PASS);
         } else {
-            record.setStatus(OrgStatus.PENDING);
+            record.setStatus(AuditStatus.PENDING);
         }
         if (SecurityUtils.hasRole(Authority.NAMES.ROLE_ADMIN)) {
-            record.setStatus(OrgStatus.PASS);
+            record.setStatus(AuditStatus.PASS);
         }
         return postRepo.save(record);
     }

+ 2 - 0
src/main/java/com/izouma/jmrh/web/ApprovalController.java

@@ -1,5 +1,6 @@
 package com.izouma.jmrh.web;
 
+import com.izouma.jmrh.annotations.OperLog;
 import com.izouma.jmrh.domain.Approval;
 import com.izouma.jmrh.domain.ApprovalProcess;
 import com.izouma.jmrh.service.ApprovalService;
@@ -36,6 +37,7 @@ public class ApprovalController extends BaseController {
     }
 
     @PostMapping("/create")
+    @OperLog(value = "审批流程-创建", type = "创建")
     public ApprovalProcess create(@RequestBody Approval record) {
         return approvalService.create(record);
     }

+ 3 - 1
src/main/java/com/izouma/jmrh/web/ApprovalProcessController.java

@@ -1,5 +1,6 @@
 package com.izouma.jmrh.web;
 
+import com.izouma.jmrh.annotations.OperLog;
 import com.izouma.jmrh.domain.ApprovalProcess;
 import com.izouma.jmrh.service.ApprovalProcessService;
 import com.izouma.jmrh.dto.PageQuery;
@@ -72,7 +73,8 @@ public class ApprovalProcessController extends BaseController {
     }
 
     @PostMapping("/next")
-    public void next(@RequestParam Long id, @RequestParam boolean pass, @RequestParam String remark, @RequestParam List<Long> nextApprovers) {
+    @OperLog(value = "审批流程-审批", type = "审批")
+    public void next(@RequestParam Long id, @RequestParam boolean pass, @RequestParam String remark, @RequestParam(defaultValue = "") List<Long> nextApprovers) {
         approvalProcessService.next(id, pass, remark, nextApprovers);
     }
 }

+ 12 - 0
src/main/java/com/izouma/jmrh/web/ArticleController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -59,12 +60,14 @@ public class ArticleController extends BaseController {
     }
 
     @PostMapping("/del/{id}")
+    @OperLog(value = "发布管理-删除", type = "删除")
     public void del(@PathVariable Long id) {
         articleRepo.deleteById(id);
     }
 
     @GetMapping("/excel")
     @ResponseBody
+    @OperLog(value = "发布管理-导出", type = "导出")
     public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
         List<ArticleDTO> data = all(pageQuery).getContent().stream().map(article -> {
             ArticleDTO dto = new ArticleDTO();
@@ -75,5 +78,14 @@ public class ArticleController extends BaseController {
         }).collect(Collectors.toList());
         ExcelUtils.export(response, data);
     }
+
+    @PostMapping("/audit")
+    @OperLog(value = "发布管理-审核", type = "审核")
+    public void audit(@RequestParam Long id, @RequestParam boolean pass) {
+        Article article = articleRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        article.setStatus(pass ? AuditStatus.PASS : AuditStatus.DENY);
+        article.setAuditTime(LocalDateTime.now());
+        articleRepo.save(article);
+    }
 }
 

+ 2 - 0
src/main/java/com/izouma/jmrh/web/ArticleTypeController.java

@@ -1,5 +1,6 @@
 package com.izouma.jmrh.web;
 
+import com.izouma.jmrh.annotations.OperLog;
 import com.izouma.jmrh.domain.ArticleType;
 import com.izouma.jmrh.service.ArticleTypeService;
 import com.izouma.jmrh.dto.PageQuery;
@@ -25,6 +26,7 @@ public class ArticleTypeController extends BaseController {
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
+    @OperLog(value = "类型管理-编辑", type = "编辑")
     public ArticleType save(@RequestBody ArticleType record) {
         if (record.getName() != null) {
             ArticleType orig = articleTypeRepo.findById(record.getName()).orElse(null);

+ 13 - 0
src/main/java/com/izouma/jmrh/web/OrgInfoController.java

@@ -1,8 +1,10 @@
 package com.izouma.jmrh.web;
 
+import com.izouma.jmrh.annotations.OperLog;
 import com.izouma.jmrh.domain.OrgInfo;
 import com.izouma.jmrh.domain.User;
 import com.izouma.jmrh.dto.OrgInfoDTO;
+import com.izouma.jmrh.enums.AuditStatus;
 import com.izouma.jmrh.repo.UserRepo;
 import com.izouma.jmrh.service.OrgInfoService;
 import com.izouma.jmrh.dto.PageQuery;
@@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -35,6 +38,7 @@ public class OrgInfoController extends BaseController {
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
+    @OperLog(value = "企业管理-编辑", type = "编辑")
     public OrgInfo save(@RequestBody OrgInfo record) {
         if (record.getId() != null) {
             OrgInfo orig = orgInfoRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
@@ -87,6 +91,7 @@ public class OrgInfoController extends BaseController {
     }
 
     @PostMapping("/del/{id}")
+    @OperLog(value = "企业管理-删除", type = "删除")
     public void del(@PathVariable Long id) {
         orgInfoRepo.deleteById(id);
     }
@@ -102,5 +107,13 @@ public class OrgInfoController extends BaseController {
         ExcelUtils.export(response, data);
     }
 
+    @PostMapping("/audit")
+    @OperLog(value = "企业管理-审核", type = "审核")
+    public void audit(@RequestParam Long id, @RequestParam boolean pass) {
+        OrgInfo orgInfo = orgInfoRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        orgInfo.setStatus(pass ? AuditStatus.PASS : AuditStatus.DENY);
+        orgInfo.setAuditTime(LocalDateTime.now());
+        orgInfoRepo.save(orgInfo);
+    }
 }
 

+ 16 - 1
src/main/java/com/izouma/jmrh/web/PostController.java

@@ -1,10 +1,13 @@
 package com.izouma.jmrh.web;
 
+import com.izouma.jmrh.annotations.OperLog;
+import com.izouma.jmrh.domain.Article;
 import com.izouma.jmrh.domain.BaseEntity;
 import com.izouma.jmrh.domain.Post;
 import com.izouma.jmrh.dto.MyPostAndComment;
 import com.izouma.jmrh.dto.PageQuery;
 import com.izouma.jmrh.dto.PostDTO;
+import com.izouma.jmrh.enums.AuditStatus;
 import com.izouma.jmrh.enums.PostType;
 import com.izouma.jmrh.exception.BusinessException;
 import com.izouma.jmrh.repo.PostRepo;
@@ -17,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Optional;
 
@@ -25,15 +29,17 @@ import java.util.Optional;
 @AllArgsConstructor
 public class PostController extends BaseController {
     private PostService postService;
-    private PostRepo postRepo;
+    private PostRepo    postRepo;
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
+    @OperLog(value = "互动管理-编辑", type = "编辑")
     public Post save(@RequestBody Post record) {
         return postService.save(record);
     }
 
     @PostMapping("/create")
+    @OperLog(value = "互动管理-创建", type = "创建")
     public Post create(@RequestBody Post record) {
         return postService.create(SecurityUtils.getAuthenticatedUser().getId(), record);
     }
@@ -55,6 +61,7 @@ public class PostController extends BaseController {
     }
 
     @PostMapping("/del/{id}")
+    @OperLog(value = "互动管理-删除", type = "删除")
     public void del(@PathVariable Long id) {
         postService.del(id);
     }
@@ -93,5 +100,13 @@ public class PostController extends BaseController {
                 .orElse(null), id);
     }
 
+    @PostMapping("/audit")
+    @OperLog(value = "互动管理-审核", type = "审核")
+    public void audit(@RequestParam Long id, @RequestParam boolean pass) {
+        Post post = postRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        post.setStatus(pass ? AuditStatus.PASS : AuditStatus.DENY);
+        post.setAuditTime(LocalDateTime.now());
+        postRepo.save(post);
+    }
 }
 

+ 13 - 0
src/main/java/com/izouma/jmrh/web/ResourceSupplyAndDemandController.java

@@ -1,6 +1,7 @@
 package com.izouma.jmrh.web;
 
 import com.izouma.jmrh.SndExcelDTO;
+import com.izouma.jmrh.annotations.OperLog;
 import com.izouma.jmrh.domain.*;
 import com.izouma.jmrh.dto.PageQuery;
 import com.izouma.jmrh.dto.ResSnDAndPropertyDTO;
@@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -36,6 +38,7 @@ public class ResourceSupplyAndDemandController extends BaseController {
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
+    @OperLog(value = "供需管理-编辑", type = "编辑")
     public ResSnDAndPropertyDTO save(@RequestBody ResSnDAndPropertyDTO record) {
         return resourceSupplyAndDemandService.save(record);
     }
@@ -63,6 +66,7 @@ public class ResourceSupplyAndDemandController extends BaseController {
     }
 
     @PostMapping("/del/{id}")
+    @OperLog(value = "供需管理-删除", type = "删除")
     public void del(@PathVariable Long id) {
         resourceSupplyAndDemandRepo.deleteById(id);
     }
@@ -102,5 +106,14 @@ public class ResourceSupplyAndDemandController extends BaseController {
         return resourceSupplyAndDemandService
                 .myDocking(SecurityUtils.getAuthenticatedUser().getId(), role, types, pageable);
     }
+
+    @PostMapping("/audit")
+    @OperLog(value = "供需管理-审核", type = "审核")
+    public void audit(@RequestParam Long id, @RequestParam boolean pass) {
+        ResourceSupplyAndDemand snd = resourceSupplyAndDemandRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        snd.setStatus(pass ? AuditStatus.PASS : AuditStatus.DENY);
+        snd.setAuditTime(LocalDateTime.now());
+        resourceSupplyAndDemandRepo.save(snd);
+    }
 }
 

+ 26 - 7
src/main/vue/src/router.js

@@ -16,7 +16,7 @@ const router = new Router({
             children: [
                 {
                     path: '/',
-                    redirect: 'agency'
+                    redirect: 'audit'
                 },
                 {
                     path: '/404',
@@ -203,7 +203,10 @@ const router = new Router({
                 {
                     path: '/resourceSupplyAndDemandList',
                     name: 'resourceSupplyAndDemandList',
-                    component: () => import(/* webpackChunkName: "agency" */ './views/ResourceSupplyAndDemandList.vue'),
+                    component: () =>
+                        import(
+                            /* webpackChunkName: "resourceSupplyAndDemandList" */ './views/ResourceSupplyAndDemandList.vue'
+                        ),
                     meta: {
                         title: '资源供需列表'
                     }
@@ -212,7 +215,9 @@ const router = new Router({
                     path: '/resourceSupplyAndDemandAudit',
                     name: 'resourceSupplyAndDemandAudit',
                     component: () =>
-                        import(/* webpackChunkName: "agency" */ './views/ResourceSupplyAndDemandAudit.vue'),
+                        import(
+                            /* webpackChunkName: "resourceSupplyAndDemandAudit" */ './views/ResourceSupplyAndDemandAudit.vue'
+                        ),
                     meta: {
                         title: '资源供需审核'
                     }
@@ -220,7 +225,10 @@ const router = new Router({
                 {
                     path: '/resourceSupplyAndDemandEdit',
                     name: 'resourceSupplyAndDemandEdit',
-                    component: () => import(/* webpackChunkName: "agency" */ './views/ResourceSupplyAndDemandEdit.vue'),
+                    component: () =>
+                        import(
+                            /* webpackChunkName: "resourceSupplyAndDemandEdit" */ './views/ResourceSupplyAndDemandEdit.vue'
+                        ),
                     meta: {
                         title: '资源供需编辑'
                     }
@@ -228,7 +236,7 @@ const router = new Router({
                 {
                     path: '/postList',
                     name: 'postList',
-                    component: () => import(/* webpackChunkName: "agency" */ './views/PostList.vue'),
+                    component: () => import(/* webpackChunkName: "postList" */ './views/PostList.vue'),
                     meta: {
                         title: '民政互动列表'
                     }
@@ -236,7 +244,7 @@ const router = new Router({
                 {
                     path: '/postAudit',
                     name: 'postAudit',
-                    component: () => import(/* webpackChunkName: "agency" */ './views/PostAudit.vue'),
+                    component: () => import(/* webpackChunkName: "postAudit" */ './views/PostAudit.vue'),
                     meta: {
                         title: '民政互动审核'
                     }
@@ -244,7 +252,7 @@ const router = new Router({
                 {
                     path: '/postEdit',
                     name: 'postEdit',
-                    component: () => import(/* webpackChunkName: "agency" */ './views/PostEdit.vue'),
+                    component: () => import(/* webpackChunkName: "postEdit" */ './views/PostEdit.vue'),
                     meta: {
                         title: '民政互动编辑'
                     }
@@ -482,6 +490,14 @@ const router = new Router({
                     meta: {
                         title: '审批人员配置'
                     }
+                },
+                {
+                    path: '/audit',
+                    name: 'audit',
+                    component: () => import(/* webpackChunkName: "audit" */ '@/views/audit.vue'),
+                    meta: {
+                        title: '待办列表'
+                    }
                 }
                 /**INSERT_LOCATION**/
             ]
@@ -519,6 +535,9 @@ router.beforeEach((to, from, next) => {
         http.axios
             .get('/user/my')
             .then(res => {
+                if (res.authorities.find(i => i.name === 'ROLE_ADMIN')) {
+                    store.commit('updateIsAdmin', true);
+                }
                 store.commit('updateUserInfo', res.data);
                 next();
                 return;

+ 5 - 1
src/main/vue/src/store.js

@@ -8,7 +8,8 @@ export default new Vuex.Store({
         tableHeight: 0,
         fetchingData: false,
         userInfo: null,
-        homePage: 'agency'
+        homePage: 'audit',
+        isAdmin: false
     },
     mutations: {
         updateTableHeight(state, height) {
@@ -19,6 +20,9 @@ export default new Vuex.Store({
         },
         updateUserInfo(state, userInfo) {
             state.userInfo = userInfo;
+        },
+        updateIsAdmin(state, isAdmin) {
+            state.isAdmin = isAdmin;
         }
     },
     actions: {}

+ 1 - 1
src/main/vue/src/views/Admin.vue

@@ -166,7 +166,7 @@ export default {
         this.tabs = [
             {
                 name: this.homePage,
-                title: this.homePage == 'agency' ? '待办列表' : '企业认证'
+                title: this.homePage == 'audit' ? '待办列表' : '企业认证'
             }
         ];
 

+ 1 - 1
src/main/vue/src/views/ApprovalList.vue

@@ -294,7 +294,7 @@ export default {
             loadingHistory: false,
             status: 0,
             attaches: [],
-            showAttachDialog: true
+            showAttachDialog: false
         };
     },
     created() {

+ 51 - 50
src/main/vue/src/views/ArticleAudit.vue

@@ -70,15 +70,10 @@
             <el-table-column prop="status" label="状态" :formatter="statusFormatter"> </el-table-column>
             <el-table-column label="操作" align="center" fixed="right" min-width="150">
                 <template slot-scope="{ row }">
-                    <el-button type="primary" @click="pass({ article: { id: row.id } })" plain size="mini">
+                    <el-button type="primary" @click="pass(row)" plain size="mini">
                         通过
                     </el-button>
-                    <el-button
-                        type="warning"
-                        @click="deny({ article: { id: row.id }, refuseDesc: '' })"
-                        plain
-                        size="mini"
-                    >
+                    <el-button type="warning" @click="deny(row)" plain size="mini">
                         拒绝
                     </el-button>
                 </template>
@@ -228,51 +223,57 @@ export default {
                     }
                 });
         },
-        pass(data) {
-            this.$confirm('确认通过?', '提示')
-                .then(_ => {
-                    this.$http
-                        .post('/auditHistory/save', data, { body: 'json' })
-                        .then(res => {
-                            this.$message.success('成功');
-                            this.getData();
-                        })
-                        .catch(e => {
-                            console.log(e);
-                            this.saving = false;
-                            this.$message.error(e.error);
-                        });
-                })
-                .catch(_ => {});
+        pass(row) {
+            this.$msgbox({
+                message: '确认通过吗?',
+                showCancelButton: true,
+                beforeClose: (action, instance, done) => {
+                    if (action === 'confirm') {
+                        instance.confirmButtonLoading = true;
+                        this.$http
+                            .post('/article/audit', { id: row.id, pass: true })
+                            .then(res => {
+                                done();
+                                this.getData();
+                            })
+                            .catch(e => {
+                                console.log(e);
+                                this.$message.error(e.error || '操作失败');
+                                done();
+                            });
+                    } else {
+                        done();
+                    }
+                }
+            })
+                .then(res => {})
+                .catch(e => {});
         },
-        deny(data) {
-            /*  { requirement: { id: row.id, state: 2 }, refuseDesc: value, state: 2 } */
-            this.$prompt('请输入拒绝原因', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                inputPattern: /.+/,
-                inputErrorMessage: '请输入拒绝原因'
+        deny(row) {
+            this.$msgbox({
+                message: '确认拒绝吗?',
+                showCancelButton: true,
+                beforeClose: (action, instance, done) => {
+                    if (action === 'confirm') {
+                        instance.confirmButtonLoading = true;
+                        this.$http
+                            .post('/article/audit', { id: row.id, pass: false })
+                            .then(res => {
+                                done();
+                                this.getData();
+                            })
+                            .catch(e => {
+                                console.log(e);
+                                this.$message.error(e.error || '操作失败');
+                                done();
+                            });
+                    } else {
+                        done();
+                    }
+                }
             })
-                .then(({ value }) => {
-                    data.refuseDesc = value;
-                    this.$http
-                        .post('/auditHistory/save', data, { body: 'json' })
-                        .then(res => {
-                            this.$message.success('成功');
-                            this.getData();
-                        })
-                        .catch(e => {
-                            console.log(e);
-                            this.saving = false;
-                            this.$message.error(e.error);
-                        });
-                })
-                .catch(() => {
-                    /*      this.$message({
-                    type: 'info',
-                    message: '取消输入'
-                }); */
-                });
+                .then(res => {})
+                .catch(e => {});
         }
     }
 };

+ 7 - 0
src/main/vue/src/views/ArticleEdit.vue

@@ -22,6 +22,13 @@
                 <el-radio v-model="formData.publish" :label="true">是</el-radio>
                 <el-radio v-model="formData.publish" :label="false">否</el-radio>
             </el-form-item>
+            <el-form-item prop="createdAt" label="发布日期" v-if="$store.state.isAdmin">
+                <el-date-picker
+                    v-model="formData.createdAt"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    type="datetime"
+                ></el-date-picker>
+            </el-form-item>
             <el-form-item prop="mainType" label="主类型">
                 <el-select v-model="formData.mainType" clearable filterable placeholder="请选择">
                     <el-option v-for="item in mainTypeOptions" :key="item.name" :label="item.name" :value="item.name">

+ 1 - 0
src/main/vue/src/views/ArticleList.vue

@@ -51,6 +51,7 @@
             <el-table-column prop="mainType" label="类型"> </el-table-column>
             <el-table-column prop="createdAt" label="发布日期" width="150"> </el-table-column>
             <el-table-column prop="status" label="状态" :formatter="statusFormatter"> </el-table-column>
+            <el-table-column prop="auditTime" label="审核时间" width="150"></el-table-column>
             <el-table-column label="操作" align="center" fixed="right" width="150">
                 <template slot-scope="{ row }">
                     <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>

+ 8 - 2
src/main/vue/src/views/Login.vue

@@ -139,9 +139,12 @@ export default {
                         })
                         .then(res => {
                             this.loading = false;
+                            if (res.authorities.find(i => i.name === 'ROLE_ADMIN')) {
+                                this.$store.commit('updateIsAdmin', true);
+                            }
                             this.$store.commit('updateUserInfo', res);
                             this.$router.replace({
-                                name: this.$route.params.name || 'agency'
+                                name: this.$route.params.name || 'audit'
                             });
                         })
                         .catch(e => {
@@ -166,9 +169,12 @@ export default {
                         })
                         .then(res => {
                             this.loading = false;
+                            if (res.authorities.find(i => i.name === 'ROLE_ADMIN')) {
+                                this.$store.commit('updateIsAdmin', true);
+                            }
                             this.$store.commit('updateUserInfo', res);
                             this.$router.replace({
-                                name: this.$route.params.name || 'agency'
+                                name: this.$route.params.name || 'audit'
                             });
                         })
                         .catch(e => {

+ 2 - 2
src/main/vue/src/views/OrgInfoAudit.vue

@@ -219,7 +219,7 @@ export default {
                     if (action === 'confirm') {
                         instance.confirmButtonLoading = true;
                         this.$http
-                            .post('/orgInfo/save', { ...row, status: 'PASS' }, { body: 'json' })
+                            .post('/orgInfo/audit', { id: row.id, pass: true })
                             .then(res => {
                                 done();
                                 this.getData();
@@ -245,7 +245,7 @@ export default {
                     if (action === 'confirm') {
                         instance.confirmButtonLoading = true;
                         this.$http
-                            .post('/orgInfo/save', { ...row, status: 'DENY' }, { body: 'json' })
+                            .post('/orgInfo/audit', { id: row.id, pass: false })
                             .then(res => {
                                 done();
                                 this.getData();

+ 4 - 3
src/main/vue/src/views/OrgInfoList.vue

@@ -61,6 +61,7 @@
             </el-table-column>
             <el-table-column prop="nickname" label="用户名" min-width="100" show-overflow-tooltip> </el-table-column>
             <el-table-column prop="status" label="状态" :formatter="statusFormatter" width="80"> </el-table-column>
+            <el-table-column prop="auditTime" label="审核时间" width="150"></el-table-column>
             <el-table-column label="操作" align="center" fixed="right" min-width="150">
                 <template slot-scope="{ row }">
                     <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
@@ -106,9 +107,9 @@ export default {
             downloading: false,
             sortStr: 'createdAt,desc',
             statusOptions: [
-                { label: '未审核', value: 0 },
-                { label: '审核通过', value: 1 },
-                { label: '驳回', value: 2 }
+                { label: '未审核', value: 'PENDING' },
+                { label: '审核通过', value: 'PASS' },
+                { label: '驳回', value: 'DENY' }
             ]
         };
     },

+ 2 - 2
src/main/vue/src/views/PolicyAudit.vue

@@ -215,7 +215,7 @@ export default {
                     if (action === 'confirm') {
                         instance.confirmButtonLoading = true;
                         this.$http
-                            .post('/article/save', { ...row, status: 'PASS' }, { body: 'json' })
+                            .post('/article/audit', { id: row.id, pass: true })
                             .then(res => {
                                 done();
                                 this.getData();
@@ -241,7 +241,7 @@ export default {
                     if (action === 'confirm') {
                         instance.confirmButtonLoading = true;
                         this.$http
-                            .post('/article/save', { ...row, status: 'DENY' }, { body: 'json' })
+                            .post('/article/audit', { id: row.id, pass: false })
                             .then(res => {
                                 done();
                                 this.getData();

+ 7 - 0
src/main/vue/src/views/PolicyEdit.vue

@@ -22,6 +22,13 @@
                 <el-radio v-model="formData.publish" :label="true">是</el-radio>
                 <el-radio v-model="formData.publish" :label="false">否</el-radio>
             </el-form-item>
+            <el-form-item prop="createdAt" label="发布日期" v-if="$store.state.isAdmin">
+                <el-date-picker
+                    v-model="formData.createdAt"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    type="datetime"
+                ></el-date-picker>
+            </el-form-item>
             <el-form-item prop="mainType" label="主类型">
                 <el-select v-model="formData.mainType" clearable filterable placeholder="请选择">
                     <el-option v-for="item in mainTypeOptions" :key="item.name" :label="item.name" :value="item.name">

+ 1 - 1
src/main/vue/src/views/PolicyList.vue

@@ -58,7 +58,7 @@
             <el-table-column prop="createdAt" label="发布日期" width="150"> </el-table-column>
 
             <el-table-column prop="status" label="状态" :formatter="statusFormatter"> </el-table-column>
-
+            <el-table-column prop="auditTime" label="审核日期" width="150"> </el-table-column>
             <el-table-column label="操作" align="center" fixed="right" width="150">
                 <template slot-scope="{ row }">
                     <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>

+ 54 - 29
src/main/vue/src/views/PostAudit.vue

@@ -41,37 +41,10 @@
             </el-table-column>
             <el-table-column label="操作" align="center" fixed="right" min-width="150">
                 <template slot-scope="{ row }">
-                    <el-button
-                        type="primary"
-                        v-if="row.status === 'PENDING'"
-                        @click="
-                            pass({
-                                title: row.name,
-                                recordType: row.type,
-                                post: { id: row.id, status: 'PASS' },
-                                status: 'PASS'
-                            })
-                        "
-                        plain
-                        size="mini"
-                    >
+                    <el-button type="primary" @click="pass(row)" plain size="mini">
                         通过
                     </el-button>
-                    <el-button
-                        type="warning"
-                        v-if="row.status === 'PENDING'"
-                        @click="
-                            deny({
-                                title: row.name,
-                                recordType: row.type,
-                                post: { id: row.id, status: 'DENY' },
-                                refuseDesc: '',
-                                status: 'DENY'
-                            })
-                        "
-                        plain
-                        size="mini"
-                    >
+                    <el-button type="warning" @click="deny(row)" plain size="mini">
                         拒绝
                     </el-button>
                 </template>
@@ -216,6 +189,58 @@ export default {
                         this.$message.error(e.error);
                     }
                 });
+        },
+        pass(row) {
+            this.$msgbox({
+                message: '确认通过吗?',
+                showCancelButton: true,
+                beforeClose: (action, instance, done) => {
+                    if (action === 'confirm') {
+                        instance.confirmButtonLoading = true;
+                        this.$http
+                            .post('/post/audit', { id: row.id, pass: true })
+                            .then(res => {
+                                done();
+                                this.getData();
+                            })
+                            .catch(e => {
+                                console.log(e);
+                                this.$message.error(e.error || '操作失败');
+                                done();
+                            });
+                    } else {
+                        done();
+                    }
+                }
+            })
+                .then(res => {})
+                .catch(e => {});
+        },
+        deny(row) {
+            this.$msgbox({
+                message: '确认拒绝吗?',
+                showCancelButton: true,
+                beforeClose: (action, instance, done) => {
+                    if (action === 'confirm') {
+                        instance.confirmButtonLoading = true;
+                        this.$http
+                            .post('/post/audit', { id: row.id, pass: false })
+                            .then(res => {
+                                done();
+                                this.getData();
+                            })
+                            .catch(e => {
+                                console.log(e);
+                                this.$message.error(e.error || '操作失败');
+                                done();
+                            });
+                    } else {
+                        done();
+                    }
+                }
+            })
+                .then(res => {})
+                .catch(e => {});
         }
     }
 };

+ 2 - 1
src/main/vue/src/views/PostList.vue

@@ -35,9 +35,10 @@
             <el-table-column prop="likeNum" label="赞数"> </el-table-column>
             <el-table-column prop="dislikeNum" label="踩数"> </el-table-column>
             <el-table-column prop="status" label="状态" :formatter="statusFormatter"> </el-table-column>
+            <el-table-column prop="auditTime" label="审核时间" width="150"></el-table-column>
             <el-table-column prop="publicPost" label="公开">
                 <template slot-scope="{ row }">
-                    <el-tag :type="row.publicPost ? '' : 'info'">{{ row.publicPost }}</el-tag>
+                    <el-tag :type="row.publicPost ? '' : 'info'">{{ row.publicPost ? '是' : '否' }}</el-tag>
                 </template>
             </el-table-column>
             <el-table-column label="操作" align="center" fixed="right" min-width="150">

+ 2 - 10
src/main/vue/src/views/ResourceSupplyAndDemandAudit.vue

@@ -216,11 +216,7 @@ export default {
                     if (action === 'confirm') {
                         instance.confirmButtonLoading = true;
                         this.$http
-                            .post(
-                                '/resourceSupplyAndDemand/save',
-                                { resSnD: { ...row, status: 'PASS' }, propertyList: row.resSnDPropertyList },
-                                { body: 'json' }
-                            )
+                            .post('/resourceSupplyAndDemand/audit', { id: row.id, pass: true })
                             .then(res => {
                                 done();
                                 this.getData();
@@ -246,11 +242,7 @@ export default {
                     if (action === 'confirm') {
                         instance.confirmButtonLoading = true;
                         this.$http
-                            .post(
-                                '/resourceSupplyAndDemand/save',
-                                { resSnD: { ...row, status: 'DENY' }, propertyList: row.resSnDPropertyList },
-                                { body: 'json' }
-                            )
+                            .post('/resourceSupplyAndDemand/audit', { id: row.id, pass: false })
                             .then(res => {
                                 done();
                                 this.getData();

+ 7 - 0
src/main/vue/src/views/ResourceSupplyAndDemandEdit.vue

@@ -53,6 +53,13 @@
             <el-form-item prop="details" label="详细介绍">
                 <el-input v-model="formData.details"></el-input>
             </el-form-item>
+            <el-form-item prop="createdAt" label="发布日期" v-if="$store.state.isAdmin">
+                <el-date-picker
+                    v-model="formData.createdAt"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    type="datetime"
+                ></el-date-picker>
+            </el-form-item>
             <el-form-item>
                 <el-button @click="onSave" :loading="saving" type="primary">保存</el-button>
                 <el-button @click="onDelete" :loading="saving" type="danger" v-if="formData.id">删除 </el-button>

+ 1 - 0
src/main/vue/src/views/ResourceSupplyAndDemandList.vue

@@ -37,6 +37,7 @@
             <el-table-column prop="phone" label="联系方式"> </el-table-column>
             <el-table-column prop="address" label="联系地址"> </el-table-column>
             <el-table-column prop="status" label="审核状态" :formatter="statusFormatter"> </el-table-column>
+            <el-table-column prop="auditTime" label="审核时间" width="150"></el-table-column>
             <el-table-column prop="images" label="图片">
                 <template slot-scope="{ row }">
                     <el-image

+ 302 - 4
src/main/vue/src/views/audit.vue

@@ -1,28 +1,326 @@
 <template>
-    <div class="list-view"></div>
+    <div class="list-view" v-loading="loading">
+        <div class="filters-container">
+            <el-radio-group v-model="type" class="filter-item">
+                <el-radio-button :label="index" v-for="(item, index) in types" :key="index">
+                    {{ item.name }}({{ item.count || 0 }})
+                </el-radio-button>
+            </el-radio-group>
+        </div>
+        <el-table
+            :data="tableData"
+            row-key="id"
+            ref="table"
+            header-row-class-name="table-header-row"
+            header-cell-class-name="table-header-cell"
+            row-class-name="table-row"
+            cell-class-name="table-cell"
+            :height="tableHeight"
+            v-if="type === 0"
+            key="0"
+        >
+            <el-table-column prop="id" label="ID" width="100"> </el-table-column>
+            <el-table-column prop="title" label="标题" :show-overflow-tooltip="true"> </el-table-column>
+            <el-table-column prop="cover" label="封面">
+                <template slot-scope="{ row }">
+                    <el-image
+                        v-if="row.cover"
+                        style="width: 30px; height: 30px"
+                        :src="row.cover"
+                        fit="cover"
+                        :preview-src-list="[row.cover]"
+                    ></el-image>
+                    <p v-else>无</p>
+                </template></el-table-column
+            >
+            <el-table-column prop="content" label="内容" :show-overflow-tooltip="true">
+                <template slot-scope="scope">
+                    <div style="height: 30px" scope>
+                        <p>{{ scope.row.content | lable }}</p>
+                    </div>
+                </template>
+            </el-table-column>
+            <el-table-column prop="publish" label="发布" width="60" align="center">
+                <template v-slot="{ row }">
+                    <el-tag type="success" v-if="row.publish">是</el-tag>
+                    <el-tag type="info" v-else>否</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="type.name" label="类型"> </el-table-column>
+            <el-table-column prop="createdAt" label="发布日期" width="150"> </el-table-column>
+            <el-table-column prop="status" label="状态" :formatter="statusFormatter"> </el-table-column>
+            <el-table-column label="操作" align="center" width="150" fixed="right">
+                <template v-slot="{ row }">
+                    <el-button type="primary" @click="audit(row, true)" plain size="mini">
+                        通过
+                    </el-button>
+                    <el-button type="warning" @click="audit(row, false)" plain size="mini">
+                        拒绝
+                    </el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <el-table
+            :data="tableData"
+            row-key="id"
+            ref="table"
+            header-row-class-name="table-header-row"
+            header-cell-class-name="table-header-cell"
+            row-class-name="table-row"
+            cell-class-name="table-cell"
+            :height="tableHeight"
+            v-if="type === 1"
+            key="1"
+        >
+            <el-table-column prop="id" label="ID" width="100"> </el-table-column>
+            <el-table-column prop="orgName" label="单位名称" min-width="100" show-overflow-tooltip> </el-table-column>
+            <el-table-column prop="orgType" label="单位性质" min-width="100" show-overflow-tooltip> </el-table-column>
+            <el-table-column prop="publicCompany" label="上市公司" width="70">
+                <template v-slot="{ row }">{{ row.publicCompany ? '是' : '否' }}</template>
+            </el-table-column>
+            <el-table-column prop="parentOrg" label="隶属单位" min-width="100" show-overflow-tooltip> </el-table-column>
+            <el-table-column prop="address" label="所在地" min-width="100" show-overflow-tooltip> </el-table-column>
+            <el-table-column prop="addressDetail" label="详细地址" min-width="100" show-overflow-tooltip>
+            </el-table-column>
+            <el-table-column prop="createdAt" label="提交日期" width="150"> </el-table-column>
+            <el-table-column prop="intro" label="企业介绍" min-width="100" show-overflow-tooltip> </el-table-column>
+            <el-table-column prop="license" label="营业执照" width="80" align="center">
+                <template v-slot="{ row }">
+                    <el-image
+                        style="width: 50px; height: 30px"
+                        fit="contain"
+                        :src="row.license"
+                        :preview-src-list="[row.license]"
+                    >
+                    </el-image>
+                </template>
+            </el-table-column>
+            <el-table-column prop="contactName" label="联系人" min-width="100" show-overflow-tooltip> </el-table-column>
+            <el-table-column prop="contactIdNo" label="身份证号" min-width="100" show-overflow-tooltip>
+            </el-table-column>
+            <el-table-column prop="contactPhone" label="手机号" min-width="100" show-overflow-tooltip>
+            </el-table-column>
+            <el-table-column prop="contactEmail" label="电子邮箱" min-width="100" show-overflow-tooltip>
+            </el-table-column>
+            <el-table-column prop="attach" label="信息报送承诺书" min-width="110" show-overflow-tooltip>
+                <template v-slot="{ row }">
+                    <el-link type="primary" v-if="row.attach" :href="row.attach" target="_blank">下载</el-link>
+                </template>
+            </el-table-column>
+            <el-table-column prop="nickname" label="用户名" min-width="100" show-overflow-tooltip> </el-table-column>
+            <el-table-column prop="status" label="状态" :formatter="statusFormatter" width="80"> </el-table-column>
+            <el-table-column label="操作" align="center" width="150" fixed="right">
+                <template v-slot="{ row }">
+                    <el-button type="primary" @click="audit(row, true)" plain size="mini">
+                        通过
+                    </el-button>
+                    <el-button type="warning" @click="audit(row, false)" plain size="mini">
+                        拒绝
+                    </el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <el-table
+            :data="tableData"
+            row-key="id"
+            ref="table"
+            header-row-class-name="table-header-row"
+            header-cell-class-name="table-header-cell"
+            row-class-name="table-row"
+            cell-class-name="table-cell"
+            :height="tableHeight"
+            v-if="type === 2"
+            :key="2"
+        >
+            <el-table-column prop="id" label="ID" width="100"> </el-table-column>
+            <el-table-column prop="name" label="名称"> </el-table-column>
+            <el-table-column prop="expireTime" label="有效期"> </el-table-column>
+            <el-table-column prop="contact" label="联系人"> </el-table-column>
+            <el-table-column prop="phone" label="联系方式"> </el-table-column>
+            <el-table-column prop="address" label="联系地址"> </el-table-column>
+            <el-table-column prop="status" label="审核状态" :formatter="statusFormatter"> </el-table-column>
+            <el-table-column prop="images" label="图片">
+                <template slot-scope="{ row }">
+                    <el-image
+                        v-if="row.images"
+                        style="width: 30px; height: 30px"
+                        :src="row.images[0]"
+                        fit="cover"
+                        :preview-src-list="row.images"
+                    ></el-image>
+                </template>
+            </el-table-column>
+            <el-table-column prop="type" label="资源供需类型" :formatter="typeFormatter"> </el-table-column>
+            <el-table-column prop="createdAt" label="发布日期" width="150"> </el-table-column>
+            <el-table-column prop="description" label="功能简介"> </el-table-column>
+            <el-table-column prop="details" label="详细介绍"> </el-table-column>
+            <el-table-column label="操作" align="center" width="150" fixed="right">
+                <template v-slot="{ row }">
+                    <el-button type="primary" @click="audit(row, true)" plain size="mini">
+                        通过
+                    </el-button>
+                    <el-button type="warning" @click="audit(row, false)" plain size="mini">
+                        拒绝
+                    </el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <el-table
+            :data="tableData"
+            row-key="id"
+            ref="table"
+            header-row-class-name="table-header-row"
+            header-cell-class-name="table-header-cell"
+            row-class-name="table-row"
+            cell-class-name="table-cell"
+            :height="tableHeight"
+            v-if="type === 3"
+            :key="3"
+        >
+            <el-table-column prop="id" label="ID" width="100"> </el-table-column>
+            <el-table-column prop="title" label="标题"> </el-table-column>
+            <el-table-column prop="content" label="内容"> </el-table-column>
+            <el-table-column prop="pics" label="图片"> </el-table-column>
+            <el-table-column prop="type" label="类型" :formatter="typeFormatter"> </el-table-column>
+            <el-table-column prop="createdAt" label="发布日期" width="150"> </el-table-column>
+            <el-table-column prop="commentNum" label="评论数"> </el-table-column>
+            <el-table-column prop="viewNum" label="热度"> </el-table-column>
+            <el-table-column prop="likeNum" label="赞数"> </el-table-column>
+            <el-table-column prop="dislikeNum" label="踩数"> </el-table-column>
+            <el-table-column prop="status" label="状态" :formatter="statusFormatter"> </el-table-column>
+            <el-table-column prop="publicPost" label="公开">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.publicPost ? '' : 'info'">{{ row.publicPost }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center" width="150" fixed="right">
+                <template v-slot="{ row }">
+                    <el-button type="primary" @click="audit(row, true)" plain size="mini">
+                        通过
+                    </el-button>
+                    <el-button type="warning" @click="audit(row, false)" plain size="mini">
+                        拒绝
+                    </el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+    </div>
 </template>
 <script>
+import pageableTable from '../mixins/pageableTable';
 export default {
+    name: 'audit',
+    mixins: [pageableTable],
     data() {
         return {
+            loading: false,
+            type: 0,
             types: [
                 {
                     name: '公告审核',
                     listUrl: '/article/all',
-                    auditUrl: '/article/audit'
+                    auditUrl: '/article/audit',
+                    count: 0
                 },
                 {
                     name: '企业审核',
                     listUrl: '/orgInfo/all',
-                    auditUrl: '/orgInfo/audit'
+                    auditUrl: '/orgInfo/audit',
+                    count: 0
+                },
+                {
+                    name: '资源供需审核',
+                    listUrl: '/resourceSupplyAndDemand/all',
+                    auditUrl: '/resourceSupplyAndDemand/audit',
+                    count: 0
                 },
                 {
                     name: '互动审核',
                     listUrl: '/post/all',
-                    auditUrl: '/post/audit'
+                    auditUrl: '/post/audit',
+                    count: 0
                 }
+            ],
+            tableData: [],
+            statusOptions: [
+                { label: '待审核', value: 'PENDING' },
+                { label: '审核通过', value: 'PASS' },
+                { label: '审核失败', value: 'DENY' }
+            ],
+            typeOptions: [
+                { label: '技术需求', value: 'TECH_DEMAND' },
+                { label: '产品需求', value: 'PRODUCT_DEMAND' },
+                { label: '融资需求', value: 'FINANCING_DEMAND' },
+                { label: '技术发布', value: 'TECH_SUPPLY' },
+                { label: '产品发布', value: 'PRODUCT_SUPPLY' },
+                { label: '共享资源', value: 'RES_SUPPLY' }
             ]
         };
+    },
+    methods: {
+        getData() {
+            let c = 0;
+            this.types.forEach((item, index) => {
+                this.loading = true;
+                this.$http.get(item.listUrl, { size: 10000, query: { status: 'PENDING' } }).then(res => {
+                    this.$set(item, 'count', res.totalElements);
+                    if (this.type === index) {
+                        this.tableData = res.content;
+                    }
+                    c++;
+                    if (c === this.types.length) {
+                        this.loading = false;
+                    }
+                });
+            });
+        },
+        statusFormatter(row, column, cellValue, index) {
+            let selectedOption = this.statusOptions.find(i => i.value === cellValue);
+            if (selectedOption) {
+                return selectedOption.label;
+            }
+            return '';
+        },
+        typeFormatter(row, column, cellValue, index) {
+            let selectedOption = this.typeOptions.find(i => i.value === cellValue);
+            if (selectedOption) {
+                return selectedOption.label;
+            }
+            return '';
+        },
+        audit(row, pass) {
+            this.$confirm(`确认${pass ? '通过' : '拒绝'}?`, {
+                beforeClose: (action, instance, done) => {
+                    if (action === 'confirm') {
+                        instance.confirmButtonLoading = true;
+                        this.$http
+                            .post(this.types[this.type].auditUrl, {
+                                id: row.id,
+                                pass: pass
+                            })
+                            .then(res => {
+                                done();
+                                instance.confirmButtonLoading = false;
+                                this.$message.success('审核成功');
+                                this.getData();
+                            })
+                            .catch(e => {
+                                done();
+                                instance.confirmButtonLoading = false;
+                                this.$message.error(e.error || '操作失败,请稍后再试');
+                            });
+                    } else {
+                        done();
+                    }
+                }
+            }).then(res => {});
+        }
+    },
+    watch: {
+        type() {
+            this.tableData = [];
+            this.getData();
+        }
     }
 };
 </script>

+ 2 - 1
src/test/java/com/izouma/jmrh/repo/PostRepoTest.java

@@ -3,6 +3,7 @@ package com.izouma.jmrh.repo;
 import com.izouma.jmrh.ApplicationTests;
 import com.izouma.jmrh.domain.Post;
 import com.izouma.jmrh.dto.MyPostAndComment;
+import com.izouma.jmrh.enums.AuditStatus;
 import com.izouma.jmrh.enums.OrgStatus;
 import com.izouma.jmrh.enums.PostType;
 import org.junit.Test;
@@ -24,7 +25,7 @@ public class PostRepoTest extends ApplicationTests {
                 .title("#普及急救知识,避免错过黄金抢救时间#")
                 .content("有些急症只有几分钟的黄金抢救时间,若等120专业急救人员来到现场处置,就可能错过生机。我所居住城市的急救中心每年也会为市民无偿进行几期…")
                 .type(PostType.TOPIC)
-                .status(OrgStatus.PASS)
+                .status(AuditStatus.PASS)
                 .build());
     }