浏览代码

Merge branch 'dev' of http://git.izouma.com/xiongzhu/jmrh into dev

panhui 2 年之前
父节点
当前提交
6e643f16d8
共有 52 个文件被更改,包括 1008 次插入301 次删除
  1. 1 0
      src/main/data-center-admin/package.json
  2. 二进制
      src/main/data-center-admin/src/assets/map1.jpg
  3. 二进制
      src/main/data-center-admin/src/assets/map2.jpg
  4. 二进制
      src/main/data-center-admin/src/assets/map3.jpg
  5. 二进制
      src/main/data-center-admin/src/assets/map4.jpg
  6. 12 4
      src/main/data-center-admin/src/router.js
  7. 10 1
      src/main/data-center-admin/src/views/Admin.vue
  8. 0 16
      src/main/data-center-admin/src/views/gis.vue
  9. 145 0
      src/main/data-center-admin/src/views/gis1.vue
  10. 145 0
      src/main/data-center-admin/src/views/gis2.vue
  11. 5 0
      src/main/data-center-admin/yarn.lock
  12. 6 0
      src/main/java/cn/licoy/encryptbody/advice/EncryptResponseBodyAdvice.java
  13. 1 0
      src/main/java/com/izouma/jmrh/domain/OrgInfo.java
  14. 8 0
      src/main/java/com/izouma/jmrh/domain/User.java
  15. 6 4
      src/main/java/com/izouma/jmrh/dto/ArtNeedVO.java
  16. 68 53
      src/main/java/com/izouma/jmrh/service/UserService.java
  17. 4 2
      src/main/java/com/izouma/jmrh/web/DataTypeController.java
  18. 14 14
      src/main/java/com/izouma/jmrh/web/UserController.java
  19. 二进制
      src/main/jmrh/src/assets/req_def.jpg
  20. 二进制
      src/main/jmrh/src/assets/sup_def.jpg
  21. 53 0
      src/main/jmrh/src/components/AutoInput.vue
  22. 2 3
      src/main/jmrh/src/components/footer.vue
  23. 2 2
      src/main/jmrh/src/components/message/msgPopups.vue
  24. 3 3
      src/main/jmrh/src/components/resource/financingRelease.vue
  25. 3 3
      src/main/jmrh/src/components/resource/financingRequire.vue
  26. 3 3
      src/main/jmrh/src/components/resource/productRelease.vue
  27. 3 3
      src/main/jmrh/src/components/resource/productRequire.vue
  28. 3 3
      src/main/jmrh/src/components/resource/recommendToU2.vue
  29. 3 3
      src/main/jmrh/src/components/resource/techRelease.vue
  30. 3 3
      src/main/jmrh/src/components/resource/techRequire.vue
  31. 2 0
      src/main/jmrh/src/main.js
  32. 6 0
      src/main/jmrh/src/plugins/http.js
  33. 1 1
      src/main/jmrh/src/router/index.js
  34. 0 1
      src/main/jmrh/src/views/Index.vue
  35. 20 4
      src/main/jmrh/src/views/home.vue
  36. 1 1
      src/main/jmrh/src/views/messageCenter/giveLike.vue
  37. 2 2
      src/main/jmrh/src/views/messageCenter/message.vue
  38. 9 1
      src/main/jmrh/src/views/mine/account.vue
  39. 127 62
      src/main/jmrh/src/views/mine/editInfo.vue
  40. 2 2
      src/main/jmrh/src/views/mine/mine.vue
  41. 146 81
      src/main/jmrh/src/views/mine/release.vue
  42. 83 3
      src/main/jmrh/src/views/mine/releaseRequirement.vue
  43. 46 2
      src/main/jmrh/src/views/mine/releaseSupply.vue
  44. 6 4
      src/main/jmrh/src/views/policy.vue
  45. 6 2
      src/main/jmrh/src/views/resourceDetail.vue
  46. 5 1
      src/main/jmrh/src/views/resourceFanceDetail.vue
  47. 5 1
      src/main/jmrh/src/views/resourceRelease.vue
  48. 13 4
      src/main/resources/application.yaml
  49. 6 0
      src/main/vue/src/plugins/http.js
  50. 16 2
      src/main/vue/src/views/DataTypeList.vue
  51. 1 1
      src/main/vue/src/views/OrgInfoAudit.vue
  52. 2 6
      src/test/java/com/izouma/jmrh/CommonTest.java

+ 1 - 0
src/main/data-center-admin/package.json

@@ -24,6 +24,7 @@
     "date-fns": "^2.14.0",
     "echarts": "^5.3.3",
     "element-ui": "^2.15.1",
+    "esri-loader": "^3.6.0",
     "faker": "^5.4.0",
     "jdenticon": "^3.1.0",
     "normalize.css": "^8.0.1",

二进制
src/main/data-center-admin/src/assets/map1.jpg


二进制
src/main/data-center-admin/src/assets/map2.jpg


二进制
src/main/data-center-admin/src/assets/map3.jpg


二进制
src/main/data-center-admin/src/assets/map4.jpg


+ 12 - 4
src/main/data-center-admin/src/router.js

@@ -270,11 +270,19 @@ const router = new Router({
                     }
                 },
                 {
-                    path: '/gis',
-                    name: 'gis',
-                    component: () => import(/* webpackChunkName: "gis" */ '@/views/gis.vue'),
+                    path: '/mapdata1',
+                    name: 'mapdata1',
+                    component: () => import(/* webpackChunkName: "mapdata1" */ '@/views/gis1.vue'),
                     meta: {
-                        title: 'gis'
+                        title: 'mapdata1'
+                    }
+                },
+                {
+                    path: '/mapdata2',
+                    name: 'mapdata2',
+                    component: () => import(/* webpackChunkName: "mapdata2" */ '@/views/gis2.vue'),
+                    meta: {
+                        title: 'mapdata2'
                     }
                 },
                 {

+ 10 - 1
src/main/data-center-admin/src/views/Admin.vue

@@ -237,7 +237,16 @@ export default {
         },
         getMenus() {
             let menus = [
-                { active: false, name: '数据可视化', path: '/chart1', icon: 'fas fa-globe-asia' },
+                {
+                    active: false,
+                    name: '数据可视化',
+                    icon: 'fas fa-globe-asia',
+                    children: [
+                        { active: false, name: '综合数据', path: '/chart1' },
+                        { active: false, name: '高程数据', path: '/mapdata1' },
+                        { active: false, name: '影像数据', path: '/mapdata2' }
+                    ]
+                },
                 {
                     active: false,
                     name: '数据统计',

+ 0 - 16
src/main/data-center-admin/src/views/gis.vue

@@ -1,16 +0,0 @@
-<template>
-    <div class="edit-view">
-        <iframe src=""></iframe>
-    </div>
-</template>
-<script>
-export default {
-    name: 'MetricEdit',
-    created() {},
-    data() {
-        return {};
-    },
-    methods: {}
-};
-</script>
-<style lang="less" scoped></style>

+ 145 - 0
src/main/data-center-admin/src/views/gis1.vue

@@ -0,0 +1,145 @@
+<template>
+    <div class="edit-view" ref="container">
+        <div class="edit-view__content-wrapper">
+            <div class="edit-view__content-section">
+                <el-radio-group v-model="map">
+                    <el-radio :label="require('../assets/map1.jpg')">地形渲染</el-radio>
+                    <el-radio :label="require('../assets/map2.jpg')">等值线</el-radio>
+                </el-radio-group>
+                <canvas
+                    id="mapview"
+                    type="2d"
+                    :width="width"
+                    :height="height"
+                    :style="{ width: width + 'px', height: height + 'px', marginTop: '20px' }"
+                    @mousedown="mousedown"
+                    @mousemove="mousemove"
+                    @mouseup="mouseup"
+                    @mouseenter="mouseenter"
+                    @mouseleave="mouseleave"
+                    @mousewheel="mousewheel"
+                    @contextmenu.stop.prevent="contextmenu"
+                />
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    name: 'gis1',
+    mounted() {
+        window.addEventListener('resize', this.init);
+        this.ctx = document.getElementById('mapview').getContext('2d');
+        this.init();
+    },
+    beforeDestroy() {
+        window.removeEventListener('resize', this.init);
+    },
+    data() {
+        return {
+            width: 0,
+            height: 0,
+            ctx: null,
+            map: require('../assets/map1.jpg'),
+            in: false,
+            down: false,
+            startX: 0,
+            startY: 0,
+            scale: 1,
+            img: null,
+            dx: 0,
+            dy: 0,
+            minScale: 1,
+            maxScale: 10
+        };
+    },
+    methods: {
+        init() {
+            let { width, height } = this.$refs.container.getBoundingClientRect();
+            this.width = width - 80;
+            this.height = height - 140;
+            this.loadImg();
+        },
+        loadImg() {
+            this.ctx.clearRect(0, 0, this.width, this.height);
+            let img = new Image();
+            img.src = this.map;
+            img.onload = () => {
+                const width = img.width;
+                const height = img.height;
+                if (width / height > this.width / this.height) {
+                    this.minScale = this.scale = this.width / width;
+                } else {
+                    this.minScale = this.scale = this.height / height;
+                }
+                this.img = img;
+                this.dx = (this.width - width * this.scale) / 2;
+                this.dy = (this.height - height * this.scale) / 2;
+                this.draw();
+            };
+        },
+        draw() {
+            this.ctx.clearRect(0, 0, this.width, this.height);
+            const width = this.img.width;
+            const height = this.img.height;
+            this.ctx.drawImage(
+                this.img,
+                0,
+                0,
+                width,
+                height,
+                this.dx,
+                this.dy,
+                width * this.scale,
+                height * this.scale
+            );
+        },
+        mousedown(e) {
+            if (e.button === 0) {
+                this.down = true;
+                this.startX = e.offsetX;
+                this.startY = e.offsetY;
+            }
+        },
+        mouseup(e) {
+            console.log('mouseup', e);
+            this.down = false;
+        },
+        mouseenter(e) {
+            console.log('mouseenter', e);
+            this.in = true;
+        },
+        mouseleave(e) {
+            console.log('mouseleave', e);
+            this.in = false;
+            this.down = false;
+        },
+        mousemove(e) {
+            if (this.down && this.in) {
+                this.dx += e.movementX;
+                this.dy += e.movementY;
+                this.draw();
+            }
+        },
+        mousewheel(e) {
+            console.log('mousewheel', e);
+            const px = (e.offsetX - this.dx) / (this.img.width * this.scale);
+            const py = (e.offsetY - this.dy) / (this.img.height * this.scale);
+            if (this.in && px >= 0 && px <= 1 && py >= 0 && py <= 1) {
+                const oldScale = this.scale;
+                this.scale = Math.max(this.minScale, Math.min(this.maxScale, this.scale - e.deltaY / 500));
+                this.dx -= (this.img.width * this.scale - this.img.width * oldScale) * px;
+                this.dy -= (this.img.height * this.scale - this.img.height * oldScale) * py;
+                this.draw();
+            }
+        },
+        contextmenu() {}
+    },
+    watch: {
+        map(val) {
+            this.loadImg();
+        }
+    }
+};
+</script>
+<style lang="less" scoped></style>

+ 145 - 0
src/main/data-center-admin/src/views/gis2.vue

@@ -0,0 +1,145 @@
+<template>
+    <div class="edit-view" ref="container">
+        <div class="edit-view__content-wrapper">
+            <div class="edit-view__content-section">
+                <el-radio-group v-model="map">
+                    <el-radio :label="require('../assets/map3.jpg')">影像1</el-radio>
+                    <el-radio :label="require('../assets/map4.jpg')">影像2</el-radio>
+                </el-radio-group>
+                <canvas
+                    id="mapview"
+                    type="2d"
+                    :width="width"
+                    :height="height"
+                    :style="{ width: width + 'px', height: height + 'px', marginTop: '20px' }"
+                    @mousedown="mousedown"
+                    @mousemove="mousemove"
+                    @mouseup="mouseup"
+                    @mouseenter="mouseenter"
+                    @mouseleave="mouseleave"
+                    @mousewheel="mousewheel"
+                    @contextmenu.stop.prevent="contextmenu"
+                />
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    name: 'gis1',
+    mounted() {
+        window.addEventListener('resize', this.init);
+        this.ctx = document.getElementById('mapview').getContext('2d');
+        this.init();
+    },
+    beforeDestroy() {
+        window.removeEventListener('resize', this.init);
+    },
+    data() {
+        return {
+            width: 0,
+            height: 0,
+            ctx: null,
+            map: require('../assets/map3.jpg'),
+            in: false,
+            down: false,
+            startX: 0,
+            startY: 0,
+            scale: 1,
+            img: null,
+            dx: 0,
+            dy: 0,
+            minScale: 1,
+            maxScale: 10
+        };
+    },
+    methods: {
+        init() {
+            let { width, height } = this.$refs.container.getBoundingClientRect();
+            this.width = width - 80;
+            this.height = height - 140;
+            this.loadImg();
+        },
+        loadImg() {
+            this.ctx.clearRect(0, 0, this.width, this.height);
+            let img = new Image();
+            img.src = this.map;
+            img.onload = () => {
+                const width = img.width;
+                const height = img.height;
+                if (width / height > this.width / this.height) {
+                    this.minScale = this.scale = this.width / width;
+                } else {
+                    this.minScale = this.scale = this.height / height;
+                }
+                this.img = img;
+                this.dx = (this.width - width * this.scale) / 2;
+                this.dy = (this.height - height * this.scale) / 2;
+                this.draw();
+            };
+        },
+        draw() {
+            this.ctx.clearRect(0, 0, this.width, this.height);
+            const width = this.img.width;
+            const height = this.img.height;
+            this.ctx.drawImage(
+                this.img,
+                0,
+                0,
+                width,
+                height,
+                this.dx,
+                this.dy,
+                width * this.scale,
+                height * this.scale
+            );
+        },
+        mousedown(e) {
+            if (e.button === 0) {
+                this.down = true;
+                this.startX = e.offsetX;
+                this.startY = e.offsetY;
+            }
+        },
+        mouseup(e) {
+            console.log('mouseup', e);
+            this.down = false;
+        },
+        mouseenter(e) {
+            console.log('mouseenter', e);
+            this.in = true;
+        },
+        mouseleave(e) {
+            console.log('mouseleave', e);
+            this.in = false;
+            this.down = false;
+        },
+        mousemove(e) {
+            if (this.down && this.in) {
+                this.dx += e.movementX;
+                this.dy += e.movementY;
+                this.draw();
+            }
+        },
+        mousewheel(e) {
+            console.log('mousewheel', e);
+            const px = (e.offsetX - this.dx) / (this.img.width * this.scale);
+            const py = (e.offsetY - this.dy) / (this.img.height * this.scale);
+            if (this.in && px >= 0 && px <= 1 && py >= 0 && py <= 1) {
+                const oldScale = this.scale;
+                this.scale = Math.max(this.minScale, Math.min(this.maxScale, this.scale - e.deltaY / 500));
+                this.dx -= (this.img.width * this.scale - this.img.width * oldScale) * px;
+                this.dy -= (this.img.height * this.scale - this.img.height * oldScale) * py;
+                this.draw();
+            }
+        },
+        contextmenu() {}
+    },
+    watch: {
+        map(val) {
+            this.loadImg();
+        }
+    }
+};
+</script>
+<style lang="less" scoped></style>

+ 5 - 0
src/main/data-center-admin/yarn.lock

@@ -3609,6 +3609,11 @@ esrecurse@^4.1.0:
   dependencies:
     estraverse "^4.1.0"
 
+esri-loader@^3.6.0:
+  version "3.6.0"
+  resolved "https://registry.npmmirror.com/esri-loader/-/esri-loader-3.6.0.tgz#5373a977fb43f5ab7a3171a3c7353fe932f33b41"
+  integrity sha512-hvFnBLcHDVcymOXTg2IxptPAxDKq1lOQjO1bFlaJTZxmruvGR+41HjW12BgemPhiEBrH782q2nFuUytwWPVAMg==
+
 estraverse@^4.1.0, estraverse@^4.1.1:
   version "4.3.0"
   resolved "https://registry.npm.taobao.org/estraverse/download/estraverse-4.3.0.tgz?cache=0&sync_timestamp=1586996117385&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Festraverse%2Fdownload%2Festraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"

+ 6 - 0
src/main/java/cn/licoy/encryptbody/advice/EncryptResponseBodyAdvice.java

@@ -14,6 +14,7 @@ import jodd.util.ReflectUtil;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.core.MethodParameter;
 import org.springframework.core.annotation.Order;
 import org.springframework.http.MediaType;
@@ -48,6 +49,10 @@ public class EncryptResponseBodyAdvice implements ResponseBodyAdvice {
 
     private final EncryptBodyConfig config;
 
+    @Value("${encrypt.enable}")
+    private boolean enableEncrypt;
+
+
     @Autowired
     public EncryptResponseBodyAdvice(ObjectMapper objectMapper, EncryptBodyConfig config) {
         this.objectMapper = objectMapper;
@@ -57,6 +62,7 @@ public class EncryptResponseBodyAdvice implements ResponseBodyAdvice {
 
     @Override
     public boolean supports(MethodParameter returnType, Class converterType) {
+        if (!enableEncrypt) return false;
         Annotation[] annotations = returnType.getDeclaringClass().getAnnotations();
         if (annotations != null && annotations.length > 0) {
             for (Annotation annotation : annotations) {

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

@@ -97,6 +97,7 @@ public class OrgInfo extends BaseEntity {
     private String attach;
 
     @ApiModelProperty("用户ID")
+    @Column(nullable = false)
     private Long userId;
 
     @ApiModelProperty("审核状态")

+ 8 - 0
src/main/java/com/izouma/jmrh/domain/User.java

@@ -1,6 +1,8 @@
 package com.izouma.jmrh.domain;
 
 import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.izouma.jmrh.annotations.Searchable;
 import com.izouma.jmrh.config.Constants;
@@ -30,17 +32,21 @@ import java.util.Set;
 @Builder
 @Where(clause = "enabled = 1")
 @ApiModel(value = "用户", description = "用户")
+@ExcelIgnoreUnannotated
 public class User extends BaseEntity implements Serializable {
 
     @Pattern(regexp = Constants.Regex.USERNAME)
     @Size(min = 1, max = 50)
     @Column(nullable = false, unique = true)
     @Searchable
+    @ExcelProperty("用户名")
     private String username;
 
     @Searchable
+    @ExcelProperty("昵称")
     private String nickname;
 
+    @ExcelProperty("头像")
     private String avatar;
 
     @JsonIgnore
@@ -81,9 +87,11 @@ public class User extends BaseEntity implements Serializable {
 
     @Searchable
     @Convert(converter = EncryptConverter.class)
+    @ExcelProperty("手机号")
     private String phone;
 
     @Column(unique = true)
+    @ExcelProperty("邮箱")
     private String email;
 
     @ManyToOne(fetch = FetchType.LAZY)

+ 6 - 4
src/main/java/com/izouma/jmrh/dto/ArtNeedVO.java

@@ -10,6 +10,7 @@ import org.springframework.data.annotation.CreatedDate;
 import javax.persistence.Entity;
 import java.io.Serializable;
 import java.time.LocalDateTime;
+
 @Data
 public class ArtNeedVO {
 
@@ -29,10 +30,11 @@ public class ArtNeedVO {
     @JsonProperty("count")
     private Long count;
 
-    public ArtNeedVO(LocalDateTime createdAt, Long count){
-        this.createdAt=createdAt;
-        this.count=count;
+    public ArtNeedVO(LocalDateTime createdAt, Long count) {
+        this.createdAt = createdAt;
+        this.count = count;
     }
-    public ArtNeedVO(){
+
+    public ArtNeedVO() {
     }
 }

+ 68 - 53
src/main/java/com/izouma/jmrh/service/UserService.java

@@ -50,14 +50,14 @@ public class UserService {
                 throw new BusinessException("该手机未注册");
             }
             user = userRepo.save(User.builder()
-                    .avatar(Constants.DEFAULT_AVATAR)
-                    .password(new BCryptPasswordEncoder().encode(password))
-                    .enabled(true)
-                    .phone(phone)
-                    .username(phone)
-                    .nickname(phone)
-                    .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
-                    .build());
+                                     .avatar(Constants.DEFAULT_AVATAR)
+                                     .password(new BCryptPasswordEncoder().encode(password))
+                                     .enabled(true)
+                                     .phone(phone)
+                                     .username(phone)
+                                     .nickname(phone)
+                                     .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
+                                     .build());
         }
         return user;
     }
@@ -68,18 +68,18 @@ public class UserService {
         User user = userRepo.findByOpenId(wxMpUser.getOpenId());
         if (user == null) {
             user = User.builder()
-                    .username(UUID.randomUUID().toString())
-                    .nickname(wxMpUser.getNickname())
-                    .avatar(wxMpUser.getHeadImgUrl())
-                    .sex(wxMpUser.getSexDesc())
-                    .country(wxMpUser.getCountry())
-                    .province(wxMpUser.getProvince())
-                    .city(wxMpUser.getCity())
-                    .openId(wxMpUser.getOpenId())
-                    .language(wxMpUser.getLanguage())
-                    .enabled(true)
-                    .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
-                    .build();
+                       .username(UUID.randomUUID().toString())
+                       .nickname(wxMpUser.getNickname())
+                       .avatar(wxMpUser.getHeadImgUrl())
+                       .sex(wxMpUser.getSexDesc())
+                       .country(wxMpUser.getCountry())
+                       .province(wxMpUser.getProvince())
+                       .city(wxMpUser.getCity())
+                       .openId(wxMpUser.getOpenId())
+                       .language(wxMpUser.getLanguage())
+                       .enabled(true)
+                       .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
+                       .build();
             userRepo.save(user);
         }
         return user;
@@ -95,13 +95,13 @@ public class UserService {
                 return userInfo;
             }
             userInfo = User.builder()
-                    .username(UUID.randomUUID().toString())
-                    .nickname("用户" + RandomStringUtils.randomAlphabetic(6))
-                    .openId(openId)
-                    .avatar(Constants.DEFAULT_AVATAR)
-                    .enabled(true)
-                    .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
-                    .build();
+                           .username(UUID.randomUUID().toString())
+                           .nickname("用户" + RandomStringUtils.randomAlphabetic(6))
+                           .openId(openId)
+                           .avatar(Constants.DEFAULT_AVATAR)
+                           .enabled(true)
+                           .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
+                           .build();
             userInfo = userRepo.save(userInfo);
             return userInfo;
         } catch (WxErrorException e) {
@@ -135,17 +135,17 @@ public class UserService {
         if (user == null) {
 
             user = User.builder()
-                    .username(UUID.randomUUID().toString())
-                    .nickname(wxUserInfo.getNickName())
-                    .openId(wxUserInfo.getOpenId())
-                    .avatar(avatarUrl)
-                    .sex(wxUserInfo.getGender())
-                    .country(wxUserInfo.getCountry())
-                    .province(wxUserInfo.getProvince())
-                    .city(wxUserInfo.getCity())
-                    .enabled(true)
-                    .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
-                    .build();
+                       .username(UUID.randomUUID().toString())
+                       .nickname(wxUserInfo.getNickName())
+                       .openId(wxUserInfo.getOpenId())
+                       .avatar(avatarUrl)
+                       .sex(wxUserInfo.getGender())
+                       .country(wxUserInfo.getCountry())
+                       .province(wxUserInfo.getProvince())
+                       .city(wxUserInfo.getCity())
+                       .enabled(true)
+                       .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
+                       .build();
             user = userRepo.save(user);
 
         } else {
@@ -170,14 +170,29 @@ public class UserService {
     }
 
     public void updateProfile(Long userId, String orgName, String occupation, String contactName,
-                              String contactPhone, String email, String idNo) {
+                              String contactPhone, String email, String idNo, String avatar) {
         User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
-        user.setOrgName(orgName);
-        user.setOccupation(occupation);
-        user.setContactName(contactName);
-        user.setContactPhone(contactPhone);
-        user.setEmail(email);
-        user.setIdNo(idNo);
+        if (StringUtils.isNotEmpty(orgName)) {
+            user.setOrgName(orgName);
+        }
+        if (StringUtils.isNotEmpty(occupation)) {
+            user.setOccupation(occupation);
+        }
+        if (StringUtils.isNotEmpty(contactName)) {
+            user.setContactName(contactName);
+        }
+        if (StringUtils.isNotEmpty(contactPhone)) {
+            user.setContactPhone(contactPhone);
+        }
+        if (StringUtils.isNotEmpty(email)) {
+            user.setEmail(email);
+        }
+        if (StringUtils.isNotEmpty(idNo)) {
+            user.setIdNo(idNo);
+        }
+        if (StringUtils.isNotEmpty(avatar)) {
+            user.setAvatar(avatar);
+        }
         userRepo.save(user);
     }
 
@@ -191,14 +206,14 @@ public class UserService {
             throw new BusinessException("此用户名已注册");
         }
         user = userRepo.save(User.builder()
-                .avatar(Constants.DEFAULT_AVATAR)
-                .password(new BCryptPasswordEncoder().encode(password))
-                .enabled(true)
-                .username(username)
-                .nickname(username)
-                .email(mail)
-                .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
-                .build());
+                                 .avatar(Constants.DEFAULT_AVATAR)
+                                 .password(new BCryptPasswordEncoder().encode(password))
+                                 .enabled(true)
+                                 .username(username)
+                                 .nickname(username)
+                                 .email(mail)
+                                 .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
+                                 .build());
         return user;
     }
 

+ 4 - 2
src/main/java/com/izouma/jmrh/web/DataTypeController.java

@@ -9,6 +9,7 @@ import com.izouma.jmrh.utils.ObjUtils;
 import com.izouma.jmrh.utils.excel.ExcelUtils;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
@@ -22,7 +23,7 @@ public class DataTypeController extends BaseController {
     private DataTypeService dataTypeService;
     private DataTypeRepo    dataTypeRepo;
 
-    //@PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
     public DataType save(@RequestBody DataType record) {
         if (record.getId() != null) {
@@ -45,7 +46,8 @@ public class DataTypeController extends BaseController {
         return dataTypeRepo.findById(id).orElseThrow(new BusinessException("无记录"));
     }
 
-    @GetMapping("/del/{id}")
+    @PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/del/{id}")
     public void del(@PathVariable Long id) {
         dataTypeRepo.deleteById(id);
     }

+ 14 - 14
src/main/java/com/izouma/jmrh/web/UserController.java

@@ -51,14 +51,14 @@ public class UserController extends BaseController {
                          @RequestParam String code*/) /*throws SmsService.SmsVerifyException */ {
         /*        smsService.verify(phone, code);*/
         User user = User.builder()
-                .username(username)
-                .nickname(username)
-                .avatar(Constants.DEFAULT_AVATAR)
-                .password(new BCryptPasswordEncoder().encode(password))
-                .enabled(true)
-                /*      .phone(phone)*/
-                .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
-                .build();
+                        .username(username)
+                        .nickname(username)
+                        .avatar(Constants.DEFAULT_AVATAR)
+                        .password(new BCryptPasswordEncoder().encode(password))
+                        .enabled(true)
+                        /*      .phone(phone)*/
+                        .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
+                        .build();
         return userRepo.save(user);
     }
 
@@ -140,7 +140,7 @@ public class UserController extends BaseController {
     @GetMapping("/my")
     public User my() {
         return userRepo.findById(SecurityUtils.getAuthenticatedUser().getId())
-                .orElseThrow(new BusinessException("用户不存在"));
+                       .orElseThrow(new BusinessException("用户不存在"));
     }
 
     @PreAuthorize("hasRole('ADMIN')")
@@ -183,15 +183,15 @@ public class UserController extends BaseController {
     @GetMapping("/getToken/{userId}")
     public String getToken(@PathVariable Long userId) {
         return jwtTokenUtil.generateToken(JwtUserFactory.create(userRepo.findById(userId)
-                .orElseThrow(new BusinessException("用户不存在"))));
+                                                                        .orElseThrow(new BusinessException("用户不存在"))));
     }
 
     @PostMapping("/updateProfile")
-    public void updateProfile(@RequestParam String orgName, @RequestParam String occupation,
-                              @RequestParam String contactName, @RequestParam String contactPhone,
-                              @RequestParam String email, @RequestParam String idNo) {
+    public void updateProfile(String orgName, String occupation,
+                              String contactName, String contactPhone,
+                              String email, String idNo, String avatar) {
         userService.updateProfile(SecurityUtils.getAuthenticatedUser().getId(), orgName, occupation, contactName,
-                contactPhone, email, idNo);
+                contactPhone, email, idNo, avatar);
     }
 
     @PostMapping("/changePassword")

二进制
src/main/jmrh/src/assets/req_def.jpg


二进制
src/main/jmrh/src/assets/sup_def.jpg


+ 53 - 0
src/main/jmrh/src/components/AutoInput.vue

@@ -0,0 +1,53 @@
+<template>
+    <el-autocomplete
+        v-model="inputValue"
+        :fetch-suggestions="fetchSuggestions"
+        :placeholder="placeholder"
+    ></el-autocomplete>
+</template>
+<script>
+export default {
+    props: {
+        suggestions: {
+            type: Array,
+            default: () => []
+        },
+        value: {},
+        placeholder: {
+            type: String,
+            default: '请输入'
+        }
+    },
+    data() {
+        return {
+            inputValue: ''
+        };
+    },
+    created() {
+        this.inputValue = this.value;
+    },
+    methods: {
+        fetchSuggestions(queryString, cb) {
+            if (this.suggestions.length === 0) {
+                cb([]);
+                return;
+            }
+            cb(
+                this.suggestions.map(item => {
+                    return {
+                        value: item
+                    };
+                })
+            );
+        }
+    },
+    watch: {
+        value(val) {
+            this.inputValue = val;
+        },
+        inputValue(val) {
+            this.$emit('input', val);
+        }
+    }
+};
+</script>

+ 2 - 3
src/main/jmrh/src/components/footer.vue

@@ -39,7 +39,7 @@
             </div>
             <div class="foot-item foot5">
                 <div>
-                    <qrcode class="vx-qrcode" :value="qrcode" :options="{ width: 100 }"></qrcode>
+                    <qrcode v-if="qrcode" class="vx-qrcode" :value="qrcode" :options="{ width: 100 }"></qrcode>
                 </div>
                 <div>官方微信公众号</div>
             </div>
@@ -65,11 +65,10 @@ export default {
     },
     created() {
         this.$http.get('/sysConfig/all', { size: 100 }).then(res => {
-            console.log(res.content);
             this.phone = res.content.find(i => i.name === 'contact_phone').value || this.phone;
             this.address = res.content.find(i => i.name === 'contact_address').value || this.address;
             this.email = res.content.find(i => i.name === 'contact_email').value || this.email;
-            this.qrcode = res.content.find(i => i.name === 'qrcode').value || this.qrcode;
+            this.qrcode = (res.content.find(i => i.name === 'qrcode') || {}).value;
         });
     }
 };

+ 2 - 2
src/main/jmrh/src/components/message/msgPopups.vue

@@ -38,11 +38,11 @@ export default {
         };
     },
     created() {
-        this.$http.get('notificationMessage/all', { query: { messageType: 'SYSTEM_MESSAGE' } }).then(res => {
+        this.$http.get('/message/all', { query: { messageType: 'SYSTEM_MESSAGE' } }).then(res => {
             // console.log(res);
             this.sysList = res.content;
         });
-        this.$http.get('notificationMessage/all', { query: { messageType: 'CONVERSATION_MESSAGE' } }).then(res => {
+        this.$http.get('/message/all', { query: { messageType: 'CONVERSATION_MESSAGE' } }).then(res => {
             // console.log(res);
             this.conversationList = res.content;
         });

+ 3 - 3
src/main/jmrh/src/components/resource/financingRelease.vue

@@ -43,7 +43,7 @@
                         :key="item.id"
                         @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 'RES_SUPPLY' } })"
                     >
-                        <img :src="item.images[0]" />
+                        <img :src="(item.images || [])[0] || require('../../assets/req_def.jpg')" />
                         <!-- <h5>{{ item.name }}</h5> -->
                         <div class="con_title">
                             <!-- <i>等待对接</i> -->
@@ -121,7 +121,7 @@ export default {
             if (this.$store.state.userInfo) {
                 this.$router.push({ name: 'releaseSupply' });
             } else {
-                this.$alert('用户未登录,请先进行登录?', '提示', {
+                this.$alert('用户未登录,请先进行登录', '提示', {
                     confirmButtonText: '确定',
                     type: 'warning'
                 });
@@ -132,7 +132,7 @@ export default {
                 .post(
                     '/resourceSupplyAndDemand/allDTO',
                     {
-                        query: { type: 'RES_SUPPLY', property: this.property }
+                        query: { type: 'RES_SUPPLY', property: this.property, status: 'PASS' }
                     },
                     { body: 'json' }
                 )

+ 3 - 3
src/main/jmrh/src/components/resource/financingRequire.vue

@@ -45,7 +45,7 @@
                             })
                         "
                     >
-                        <img :src="item.images" />
+                        <img :src="(item.images || [])[0] || require('../../assets/sup_def.jpg')" />
                         <div class="con_main_right">
                             <div class="con_main_tit">
                                 <!-- <i :class="item.state === 1 ? 'wait' : ''">{{
@@ -133,7 +133,7 @@ export default {
             if (this.$store.state.userInfo) {
                 this.$router.push({ name: 'releaseRequirement' });
             } else {
-                this.$alert('用户未登录,请先进行登录?', '提示', {
+                this.$alert('用户未登录,请先进行登录', '提示', {
                     confirmButtonText: '确定',
                     type: 'warning'
                 });
@@ -144,7 +144,7 @@ export default {
                 .post(
                     '/resourceSupplyAndDemand/allDTO',
                     {
-                        query: { type: 'FINANCING_DEMAND', property: this.property }
+                        query: { type: 'FINANCING_DEMAND', property: this.property, status: 'PASS' }
                     },
                     { body: 'json' }
                 )

+ 3 - 3
src/main/jmrh/src/components/resource/productRelease.vue

@@ -43,7 +43,7 @@
                             $router.push({ name: 'resourceRelease', query: { id: item.id, type: 'PRODUCT_SUPPLY' } })
                         "
                     >
-                        <img :src="item.images[0]" />
+                        <img :src="(item.images || [])[0] || require('../../assets/req_def.jpg')" />
                         <!-- <h5>{{ item.name }}</h5> -->
                         <div class="con_title">
                             <!-- <i>等待对接</i> -->
@@ -112,7 +112,7 @@ export default {
             if (this.$store.state.userInfo) {
                 this.$router.push({ name: 'releaseSupply' });
             } else {
-                this.$alert('用户未登录,请先进行登录?', '提示', {
+                this.$alert('用户未登录,请先进行登录', '提示', {
                     confirmButtonText: '确定',
                     type: 'warning'
                 });
@@ -123,7 +123,7 @@ export default {
                 .post(
                     '/resourceSupplyAndDemand/allDTO',
                     {
-                        query: { type: 'PRODUCT_SUPPLY', property: this.property }
+                        query: { type: 'PRODUCT_SUPPLY', property: this.property, status: 'PASS' }
                     },
                     { body: 'json' }
                 )

+ 3 - 3
src/main/jmrh/src/components/resource/productRequire.vue

@@ -42,7 +42,7 @@
                             $router.push({ name: 'resourceDetail', query: { id: item.id, type: 'PRODUCT_DEMAND' } })
                         "
                     >
-                        <img :src="item.images" />
+                        <img :src="(item.images || [])[0] || require('../../assets/sup_def.jpg')" />
                         <div class="con_main_right">
                             <div class="con_main_tit">
                                 <!-- <i :class="item.status === 'PENDING' ? 'wait' : ''">{{
@@ -117,7 +117,7 @@ export default {
             if (this.$store.state.userInfo) {
                 this.$router.push({ name: 'releaseRequirement' });
             } else {
-                this.$alert('用户未登录,请先进行登录?', '提示', {
+                this.$alert('用户未登录,请先进行登录', '提示', {
                     confirmButtonText: '确定',
                     type: 'warning'
                 });
@@ -128,7 +128,7 @@ export default {
                 .post(
                     '/resourceSupplyAndDemand/allDTO',
                     {
-                        query: { type: 'PRODUCT_DEMAND', property: this.property }
+                        query: { type: 'PRODUCT_DEMAND', property: this.property, status: 'PASS' }
                     },
                     { body: 'json' }
                 )

+ 3 - 3
src/main/jmrh/src/components/resource/recommendToU2.vue

@@ -15,7 +15,7 @@ export default {
     data() {
         return {
             query: { size: 1, page: 1, dataType: { id: 0 } },
-            url: '',
+            url: '/product/all',
             list: [{ picList: [{ url: '' }] }]
         };
     },
@@ -25,8 +25,7 @@ export default {
             this.$router.push({ name: 'resourceRelease', query: { id: list[0].id, type: this.type } });
         },
         getData() {
-            this.type;
-            this.dataType;
+            if (!this.type) return;
             if (this.type === 1) {
                 this.url = '/product/all';
             } else if (this.type === 2) {
@@ -34,6 +33,7 @@ export default {
             } else if (this.type === 3) {
                 this.url = '/tresource/all';
             }
+            if (!this.url) return;
             this.query.dataType.id = this.dataType;
             this.$http
                 .get(this.url, this.query)

+ 3 - 3
src/main/jmrh/src/components/resource/techRelease.vue

@@ -39,7 +39,7 @@
                         :key="item.id"
                         @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 'TECH_SUPPLY' } })"
                     >
-                        <img :src="item.images[0]" />
+                        <img :src="(item.images || [])[0] || require('../../assets/req_def.jpg')" />
                         <div class="con_main_right">
                             <div class="con_main_tit">
                                 <i :class="item.status === 'PENDING' ? 'wait' : ''">{{
@@ -112,7 +112,7 @@ export default {
             if (this.$store.state.userInfo) {
                 this.$router.push({ name: 'releaseSupply' });
             } else {
-                this.$alert('用户未登录,请先进行登录?', '提示', {
+                this.$alert('用户未登录,请先进行登录', '提示', {
                     confirmButtonText: '确定',
                     type: 'warning'
                 });
@@ -123,7 +123,7 @@ export default {
                 .post(
                     '/resourceSupplyAndDemand/allDTO',
                     {
-                        query: { type: 'TECH_SUPPLY', property: this.property }
+                        query: { type: 'TECH_SUPPLY', property: this.property, status: 'PASS' }
                     },
                     { body: 'json' }
                 )

+ 3 - 3
src/main/jmrh/src/components/resource/techRequire.vue

@@ -41,7 +41,7 @@
                         :key="item.id"
                         @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 'TECH_DEMAND' } })"
                     >
-                        <img :src="item.images" />
+                        <img :src="(item.images || [])[0] || require('../../assets/sup_def.jpg')" />
                         <div class="con_main_right">
                             <div class="con_main_tit">
                                 <!-- <i :class="item.status === 'PENDING' ? 'wait' : ''">{{
@@ -117,7 +117,7 @@ export default {
             if (this.$store.state.userInfo) {
                 this.$router.push({ name: 'releaseRequirement' });
             } else {
-                this.$alert('用户未登录,请先进行登录?', '提示', {
+                this.$alert('用户未登录,请先进行登录', '提示', {
                     confirmButtonText: '确定',
                     type: 'warning'
                 });
@@ -128,7 +128,7 @@ export default {
                 .post(
                     '/resourceSupplyAndDemand/allDTO',
                     {
-                        query: { type: 'TECH_DEMAND', property: this.property }
+                        query: { type: 'TECH_DEMAND', property: this.property, status: 'PASS' }
                     },
                     { body: 'json' }
                 )

+ 2 - 0
src/main/jmrh/src/main.js

@@ -13,6 +13,7 @@ import SingleUpload from '@/components/SingleUpload';
 import FileUpload from '@/components/FileUpload';
 import { mapState } from 'vuex';
 import Formatters from '@/mixins/formatters';
+import AutoInput from '@/components/AutoInput';
 Vue.config.productionTip = false;
 
 Vue.use(ElementUI, { size: 'small' });
@@ -23,6 +24,7 @@ Vue.component('multi-upload', MultiUpload);
 Vue.component('single-upload', SingleUpload);
 Vue.component('rich-text', RichText);
 Vue.component('file-upload', FileUpload);
+Vue.component('auto-input', AutoInput);
 Vue.mixin(Formatters);
 
 Vue.mixin({

+ 6 - 0
src/main/jmrh/src/plugins/http.js

@@ -131,6 +131,12 @@ export default {
                             reject(e);
                         });
                 });
+            },
+            encrypt(content) {
+                return encrypt(content);
+            },
+            decrypt(content) {
+                return decrypt(content);
             }
         };
     }

+ 1 - 1
src/main/jmrh/src/router/index.js

@@ -169,7 +169,7 @@ const routes = [
             },
             {
                 path: '/',
-                component: () => import('@/views/mine/base.vue'),
+                component: () => import('@/views/mine/mine.vue'),
                 children: [
                     // {
                     //     path: '/message',

+ 0 - 1
src/main/jmrh/src/views/Index.vue

@@ -173,7 +173,6 @@ export default {
         };
     },
     mounted() {
-        console.log(this.$route);
         this.activeMenu = this.$route.meta.menu || this.activeMenu;
         this.$http.get('/extLink/all', { size: 100 }).then(res => {
             this.links = res.content;

+ 20 - 4
src/main/jmrh/src/views/home.vue

@@ -453,25 +453,41 @@ export default {
         this.getNews();
         // 产品发布
         this.$http
-            .get('/resourceSupplyAndDemand/all', { size: 5, query: { type: 'PRODUCT_SUPPLY' }, sort: 'createdAt,desc' })
+            .get('/resourceSupplyAndDemand/all', {
+                size: 5,
+                query: { type: 'PRODUCT_SUPPLY', status: 'PASS' },
+                sort: 'createdAt,desc'
+            })
             .then(res => {
                 this.productList = res.content;
             });
         // 技术发布
         this.$http
-            .get('/resourceSupplyAndDemand/all', { size: 5, query: { type: 'TECH_SUPPLY' }, sort: 'createdAt,desc' })
+            .get('/resourceSupplyAndDemand/all', {
+                size: 5,
+                query: { type: 'TECH_SUPPLY', status: 'PASS' },
+                sort: 'createdAt,desc'
+            })
             .then(res => {
                 this.artProductList = res.content;
             });
         // 产品需求
         this.$http
-            .get('/resourceSupplyAndDemand/all', { size: 8, query: { type: 'PRODUCT_DEMAND' }, sort: 'createdAt,desc' })
+            .get('/resourceSupplyAndDemand/all', {
+                size: 8,
+                query: { type: 'PRODUCT_DEMAND', status: 'PASS' },
+                sort: 'createdAt,desc'
+            })
             .then(res => {
                 this.productNeedList = res.content;
             });
         // 技术需求
         this.$http
-            .get('/resourceSupplyAndDemand/all', { size: 8, query: { type: 'TECH_DEMAND' }, sort: 'createdAt,desc' })
+            .get('/resourceSupplyAndDemand/all', {
+                size: 8,
+                query: { type: 'TECH_DEMAND', status: 'PASS' },
+                sort: 'createdAt,desc'
+            })
             .then(res => {
                 this.list = res.content;
             });

+ 1 - 1
src/main/jmrh/src/views/messageCenter/giveLike.vue

@@ -41,7 +41,7 @@ export default {
         };
     },
     created() {
-        this.$http.get('notificationMessage/all', { query: { messageType: 'LIKE_RECORD_MESSAGE' } }).then(res => {
+        this.$http.get('/message/all', { query: { messageType: 'LIKE_RECORD_MESSAGE' } }).then(res => {
             console.log(res);
             this.list = res.content;
         });

+ 2 - 2
src/main/jmrh/src/views/messageCenter/message.vue

@@ -49,11 +49,11 @@ export default {
         };
     },
     created() {
-        this.$http.get('notificationMessage/all', { query: { messageType: 'SYSTEM_MESSAGE' } }).then(res => {
+        this.$http.get('/message/all', { query: { messageType: 'SYSTEM_MESSAGE' } }).then(res => {
             // console.log(res);
             this.sysList = res.content;
         });
-        this.$http.get('notificationMessage/all', { query: { messageType: 'CONVERSATION_MESSAGE' } }).then(res => {
+        this.$http.get('/message/all', { query: { messageType: 'CONVERSATION_MESSAGE' } }).then(res => {
             // console.log(res);
             this.conversationList = res.content;
         });

+ 9 - 1
src/main/jmrh/src/views/mine/account.vue

@@ -8,7 +8,7 @@
         <el-row style="margin-top:47px">
             <div class="row">
                 <div class="one">手机号</div>
-                <div class="two">已绑定手机号{{ userInfo.phone }}</div>
+                <div class="two">已绑定手机号{{ phone }}</div>
                 <div class="three" @click="$router.push({ name: 'editPhoneStep1' })">变更手机号</div>
             </div>
         </el-row>
@@ -29,6 +29,14 @@ export default {
     name: 'account',
     data() {
         return {};
+    },
+    computed: {
+        phone() {
+            if (this.userInfo && this.userInfo.phone) {
+                return this.$http.decrypt(this.userInfo.phone);
+            }
+            return '';
+        }
     }
 };
 </script>

+ 127 - 62
src/main/jmrh/src/views/mine/editInfo.vue

@@ -5,83 +5,92 @@
                 <span>编辑资料</span>
             </div>
         </el-row>
-        <div class="avatar">
+        <div class="avatar-wrapper">
             <!--  <img :src="avatar" /> -->
             <el-upload
-                class="avatar"
                 :action="uploadUrl"
                 :show-file-list="false"
                 :on-success="handleAvatarSuccess"
                 :before-upload="beforeAvatarUpload"
+                :on-error="handleAvatarError"
+                accept="image/*"
+                v-loading="avatarUploading"
             >
                 <img v-if="avatar" :src="avatar" />
                 <i v-else class="avatar"></i>
+                <div class="edit_avatar">点击头像修改</div>
             </el-upload>
-            <div class="edit_avatar">点击头像修改</div>
         </div>
-        <el-form ref="form" :model="form" label-width="150px" :rules="rules" style="max-width: 450px;" size="small">
-            <el-form-item label="id" v-show="false">
-                <el-input v-model="form.id"></el-input>
-            </el-form-item>
-            <el-form-item label="企业名称">
+        <el-form ref="form" :model="form" label-width="150px" :rules="rules" style="max-width: 600px;" size="small">
+            <el-form-item label="企业名称" prop="orgName">
                 <el-input v-model="form.orgName" placeholder="请输入单位名称"></el-input>
             </el-form-item>
-            <el-form-item label="单位性质">
-                <el-select v-model="form.orgType" placeholder="请选择">
-                    <el-option label="国家行政机构" value="1"></el-option>
-                    <el-option label="公私合作企业" value="2"></el-option>
-                    <el-option label="中外合资企业" value="3"></el-option>
-                </el-select>
+            <el-form-item label="单位性质" prop="orgType">
+                <auto-input
+                    v-model="form.orgType"
+                    placeholder="请输入单位性质"
+                    :suggestions="[
+                        '国家行政机构',
+                        '公私合作企业',
+                        '中外合资企业',
+                        '国有企业',
+                        '集体企业',
+                        '股份合作企业',
+                        '联营企业',
+                        '有限责任公司',
+                        '股份有限公司',
+                        '私营企业',
+                        '个体工商户',
+                        '其他'
+                    ]"
+                ></auto-input>
             </el-form-item>
             <el-form-item label="上市公司" prop="publicCompany">
                 <el-radio v-model="form.publicCompany" :label="true">是</el-radio>
                 <el-radio v-model="form.publicCompany" :label="false">否</el-radio>
             </el-form-item>
-            <el-form-item label="所属行业">
-                <el-select v-model="form.industry" placeholder="请选择">
-                    <el-option label="水利水电" value="1"></el-option>
-                    <el-option label="信息产业" value="2"></el-option>
-                </el-select>
+            <el-form-item label="所属行业" prop="industry">
+                <el-input v-model="form.industry" placeholder="请输入所属行业"> </el-input>
             </el-form-item>
-            <el-form-item label="所在地">
-                <el-select placeholder="省" style="width:120px;margin-right:10px" v-model="shen" @change="Toshen()">
+            <el-form-item label="所在地" prop="address">
+                <el-select placeholder="省" style="width:125px;margin-right:10px" v-model="shen" @change="Toshen()">
                     <el-option v-for="item in province" :label="item.name" :value="item.code" :key="item.code" />
                 </el-select>
-                <el-select placeholder="市" style="width:120px;margin-right:10px" v-model="shi" @change="Toshi()">
+                <el-select placeholder="市" style="width:125px;margin-right:10px" v-model="shi" @change="Toshi()">
                     <el-option v-for="item in cities" :label="item.name" :value="item.code" :key="item.code" />
                 </el-select>
-                <el-select placeholder="区" style="width:100px" v-model="qv">
+                <el-select placeholder="区" style="width:130px" v-model="qv">
                     <el-option v-for="item in areas" :label="item.name" :value="item.code" :key="item.code" />
                 </el-select>
             </el-form-item>
-            <el-form-item label="详细地址">
+            <el-form-item label="详细地址" prop="addressDetail">
                 <el-input v-model="form.addressDetail" placeholder="请选择"></el-input>
             </el-form-item>
             <el-form-item prop="description" label="企业简介">
                 <el-input type="textarea" v-model="form.intro" placeholder="请填写企业简介,不超过200字"></el-input>
             </el-form-item>
-            <el-form-item prop="logo" label="企业logo">
+            <el-form-item label="企业标志" prop="logo">
                 <single-upload v-model="form.logo"></single-upload>
-                <span class="remind">请上传企业logo图片,格式JPG或PNG,尺寸500x500px,大小不超过1M</span>
+                <span class="remind">请上传企业标志图片,格式JPG或PNG,尺寸500x500px,大小不超过1M</span>
             </el-form-item>
-            <el-form-item prop="license" label="营业执照">
+            <el-form-item label="营业执照" prop="license">
                 <single-upload v-model="form.license"></single-upload>
                 <span class="remind">请上传清晰图片,格式JPG或PNG,大小不超过1M</span>
             </el-form-item>
-            <el-form-item label="统一社会信用代码">
+            <el-form-item label="统一社会信用代码" prop="uscc">
                 <el-input v-model="form.uscc" placeholder="请输入18位统一社会信用代码"></el-input>
             </el-form-item>
-            <el-form-item label="姓名">
-                <el-input v-model="form.contactName" placeholder="请输入您的真实姓名"></el-input>
+            <el-form-item label="联系人姓名" prop="contactName">
+                <el-input v-model="form.contactName" placeholder="请输入联系人姓名"></el-input>
             </el-form-item>
-            <el-form-item label="身份证号">
-                <el-input v-model="form.contactIdNo" placeholder="请输入您的身份证号"></el-input>
+            <el-form-item label="联系人身份证号" prop="contactIdNo">
+                <el-input v-model="form.contactIdNo" placeholder="请输入联系人身份证号"></el-input>
             </el-form-item>
-            <el-form-item label="邮箱">
-                <el-input v-model="form.contactEmail" placeholder="请输入"></el-input>
+            <el-form-item label="联系邮箱" prop="contactEmail">
+                <el-input v-model="form.contactEmail" placeholder="请输入联系邮箱"></el-input>
             </el-form-item>
             <el-form-item>
-                <el-button @click="onSave" :loading="saving" type="primary" class="save">保存</el-button>
+                <el-button @click="submit" :loading="saving" type="primary" class="save">保存</el-button>
                 <el-button @click="$router.go(-1)" class="back">返回</el-button>
             </el-form-item>
         </el-form>
@@ -101,7 +110,45 @@ export default {
         return {
             uploadUrl: '',
             form: {},
-            rules: {},
+            rules: {
+                orgName: [
+                    { required: true, message: '请输入单位名称', trigger: 'blur' },
+                    { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' }
+                ],
+                orgType: [{ required: true, message: '请输入单位性质', trigger: 'blur' }],
+                publicCompany: [{ required: true, message: '请选择是否上市公司', trigger: 'blur' }],
+                industry: [{ required: true, message: '请输入所属行业', trigger: 'blur' }],
+                address: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (this.shen === '' || this.shi === '' || this.qv === '') {
+                                callback(new Error('请选择所在地'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                addressDetail: [{ required: true, message: '请输入详细地址', trigger: 'blur' }],
+                license: [{ required: true, message: '请上传营业执照', trigger: 'blur' }],
+                uscc: [
+                    { required: true, message: '请输入统一社会信用代码', trigger: 'blur' },
+                    { min: 18, max: 18, message: '长度为18个字符', trigger: 'blur' }
+                ],
+                contactName: [
+                    { required: true, message: '请输入姓名', trigger: 'blur' },
+                    { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' }
+                ],
+                contactIdNo: [
+                    { required: true, message: '请输入身份证号', trigger: 'blur' },
+                    { min: 18, max: 18, message: '长度为18个字符', trigger: 'blur' }
+                ],
+                contactEmail: [
+                    { required: true, message: '请输入邮箱', trigger: 'blur' },
+                    { type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' }
+                ]
+            },
             avatar: '',
             saving: false,
             province: [],
@@ -109,37 +156,57 @@ export default {
             areas: [],
             shen: '',
             shi: '',
-            qv: ''
+            qv: '',
+            avatarUploading: false
         };
     },
     methods: {
-        onSave() {
-            this.$refs.form.validate(valid => {
-                if (valid) {
-                    this.submit();
-                } else {
-                    return false;
-                }
-            });
-        },
         submit() {
-            this.form.address = this.shen + ',' + this.shi + ',' + this.qv;
-            this.form;
-            this.$http
-                .post('/orgInfo/save', this.form, { body: 'json' })
-                .then(res => {
-                    this.form = res;
-                    this.$message.success('修改成功');
+            this.$refs.form
+                .validate()
+                .then(() => {
+                    this.form.address = this.shen + ',' + this.shi + ',' + this.qv;
+                    this.saving = true;
+                    this.$http
+                        .post('/orgInfo/save', this.form, { body: 'json' })
+                        .then(res => {
+                            this.saving = false;
+                            this.form = res;
+                            this.$message.success('修改成功');
+                        })
+                        .catch(e => {
+                            this.saving = false;
+                            console.log(e);
+                            this.$message.error(e.error);
+                        });
                 })
                 .catch(e => {
-                    console.log(e);
-                    this.$message.error(e.error);
+                    this.$message.error('表单有误,请检查后重新提交');
                 });
         },
         handleAvatarSuccess(res, file) {
             this.avatar = URL.createObjectURL(file.raw);
+            this.avatarUploading = false;
+            this.$http.post('/user/updateProfile', { avatar: res }).then(res => {
+                this.$message.success('修改成功');
+                this.$http.get('/user/my').then(res => {
+                    this.$store.commit('updateUserInfo', res);
+                });
+            });
+        },
+        beforeAvatarUpload(file) {
+            if (file.size / 1024 / 1024 > 1) {
+                this.$message.error('图片大小不能超过1MB!');
+                this.avatarUploading = false;
+                return false;
+            }
+            this.avatarUploading = true;
+            return true;
+        },
+        handleAvatarError(err, file, fileList) {
+            this.avatarUploading = false;
+            this.$message.error('上传失败');
         },
-        beforeAvatarUpload(file) {},
         Toshen() {
             this.cities = [];
             this.areas = [];
@@ -167,6 +234,7 @@ export default {
         this.$http
             .get('orgInfo/my')
             .then(res => {
+                res.orgInfo = res.orgInfo || { userId: this.$store.state.userInfo.id, status: 'PENDING' };
                 this.form = res.orgInfo;
                 let list = res.orgInfo.address.split(',');
                 this.shen = list[0];
@@ -206,11 +274,11 @@ export default {
         font-weight: 700;
     }
 }
-.avatar {
+.avatar-wrapper {
     // width: auto;
     // height: auto;
     position: absolute;
-    top: 40px;
+    top: 80px;
     right: 80px;
     // display: flex;
     // flex-direction: column;
@@ -224,12 +292,9 @@ export default {
         }
     }
     .edit_avatar {
-        position: absolute;
-        top: 188px;
-        right: 105px;
-        margin-top: 20px;
         width: 96px;
         height: 36px;
+        margin: 20px auto 0 auto;
         line-height: 36px;
         text-align: center;
         cursor: pointer;

+ 2 - 2
src/main/jmrh/src/views/mine/base.vue → src/main/jmrh/src/views/mine/mine.vue

@@ -19,7 +19,7 @@
                             v-for="(item, index) in tabList"
                             :key="index"
                             :class="{ active: routerPath === item.path }"
-                            @click="$router.push(item.path)"
+                            @click="$router.replace(item.path).catch(() => {})"
                         >
                             {{ item.name }}
                         </div>
@@ -38,7 +38,7 @@
 // import SideBar from '../../components/SideBar';
 export default {
     // components: { SideBar },
-    name: 'base',
+    name: 'mineBase',
     data() {
         return {
             barTitle: '个人中心',

+ 146 - 81
src/main/jmrh/src/views/mine/release.vue

@@ -12,7 +12,7 @@
             </div>
         </el-row>
         <!-- 供应信息列表 -->
-        <div class="tab1" v-if="tab === 0">
+        <div class="tab1" v-if="tab === 0" key="tab1">
             <el-row>
                 <div class="classify">
                     <span
@@ -27,45 +27,63 @@
             </el-row>
             <!-- 产品 -->
             <el-row>
-                <div class="card_list" v-if="current == 0">
-                    <div class="card" v-for="n in tableData" :key="n.id">
-                        <img :src="n.images[0]" />
-                        <h5>{{ n.name }}</h5>
-                        <p>{{ n.description }}</p>
-                        <div class="btn">
-                            <div class="edit" @click="toShow(n)">
-                                编辑
+                <template v-if="current == 0">
+                    <div class="card_list">
+                        <div class="card" v-for="n in tableData" :key="n.id">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
+                                </div>
+                            </el-image>
+                            <h5>{{ n.name }}</h5>
+                            <p>{{ n.description }}</p>
+                            <div class="btn">
+                                <div class="edit" @click="toShow(n)">
+                                    编辑
+                                </div>
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                             </div>
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                         </div>
                     </div>
-                </div>
-                <div class="card_list" v-if="current == 1">
-                    <div class="card" v-for="n in tableData" :key="n.id">
-                        <img :src="n.images[0]" />
-                        <h5>{{ n.name }}</h5>
-                        <p>{{ n.description }}</p>
-                        <div class="btn">
-                            <div class="edit" @click="toShow(n)">
-                                编辑
+                </template>
+                <template v-if="current == 1">
+                    <div class="card_list" v-if="current == 1">
+                        <div class="card" v-for="n in tableData" :key="n.id">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
+                                </div>
+                            </el-image>
+                            <h5>{{ n.name }}</h5>
+                            <p>{{ n.description }}</p>
+                            <div class="btn">
+                                <div class="edit" @click="toShow(n)">
+                                    编辑
+                                </div>
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                             </div>
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                         </div>
                     </div>
-                </div>
-                <div class="card_list" v-if="current == 2">
-                    <div class="card" v-for="n in tableData" :key="n.id">
-                        <img :src="n.images[0]" />
-                        <h5>{{ n.name }}</h5>
-                        <p>{{ n.description }}</p>
-                        <div class="btn">
-                            <div class="edit" @click="toShow(n)">
-                                编辑
+                </template>
+                <template v-if="current == 2">
+                    <div class="card_list">
+                        <div class="card" v-for="n in tableData" :key="n.id">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
+                                </div>
+                            </el-image>
+                            <h5>{{ n.name }}</h5>
+                            <p>{{ n.description }}</p>
+                            <div class="btn">
+                                <div class="edit" @click="toShow(n)">
+                                    编辑
+                                </div>
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                             </div>
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                         </div>
                     </div>
-                </div>
+                </template>
             </el-row>
             <el-row>
                 <el-pagination
@@ -81,7 +99,7 @@
             </el-row>
         </div>
         <!--需求信息列表  -->
-        <div class="tab1" v-else>
+        <div class="tab1" v-else key="tab2">
             <el-row>
                 <div class="classify">
                     <span
@@ -97,62 +115,80 @@
             <!-- 产品需求,技术需求 -->
             <el-row>
                 <!-- <div v-for="n in tableData" :key="n.id" class="neens_div"> -->
-                <div v-for="n in tableData" :key="n.id" class="neens_div">
-                    <div class="needs_card" v-if="current == 0">
-                        <img :src="n.images[0]" />
-                        <div class="info">
-                            <div class="title">{{ n.name }}</div>
-                            <p>
-                                {{ n.description }}
-                            </p>
-                            <div class="time">{{ n.createdAt }}</div>
-                        </div>
-                        <div class="btn">
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
-                            <div class="edit" @click="toNeedShow(n)">编辑</div>
+                <template v-if="current == 0">
+                    <div v-for="n in tableData" :key="n.id" class="neens_div">
+                        <div class="needs_card">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
+                                </div>
+                            </el-image>
+                            <div class="info">
+                                <div class="title">{{ n.name }}</div>
+                                <p>
+                                    {{ n.description }}
+                                </p>
+                                <div class="time">{{ n.createdAt }}</div>
+                            </div>
+                            <div class="btn">
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
+                                <div class="edit" @click="toNeedShow(n)">编辑</div>
+                            </div>
                         </div>
                     </div>
-                </div>
-                <div v-for="n in tableData" :key="n.id" class="neens_div">
-                    <div class="needs_card" v-if="current == 1">
-                        <img :src="n.images[0]" />
-                        <div class="info">
-                            <div class="title">{{ n.name }}</div>
-                            <p>
-                                {{ n.description }}
-                            </p>
-                            <div class="time">{{ n.createdAt }}</div>
-                        </div>
-                        <div class="btn">
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
-                            <div class="edit" @click="toNeedShow(n)">编辑</div>
+                </template>
+                <template v-if="current == 1">
+                    <div v-for="n in tableData" :key="n.id" class="neens_div">
+                        <div class="needs_card">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
+                                </div>
+                            </el-image>
+                            <div class="info">
+                                <div class="title">{{ n.name }}</div>
+                                <p>
+                                    {{ n.description }}
+                                </p>
+                                <div class="time">{{ n.createdAt }}</div>
+                            </div>
+                            <div class="btn">
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
+                                <div class="edit" @click="toNeedShow(n)">编辑</div>
+                            </div>
                         </div>
                     </div>
-                </div>
-                <div v-for="n in tableData" :key="n.id" class="neens_div">
-                    <div class="needs_card" v-if="current == 2">
-                        <img :src="n.images[0]" />
-                        <div class="info">
-                            <div class="title">{{ n.name }}</div>
-                            <div class="con_info">
-                                <div class="con_info_item">
-                                    <i>计划融资</i><span>{{ n.resSnDPropertyList[0].value }}</span>
-                                </div>
-                                <div class="con_info_item">
-                                    <i>融资阶段</i><span>{{ n.resSnDPropertyList[1].value }}</span>
+                </template>
+                <template v-if="current == 2">
+                    <div v-for="n in tableData" :key="n.id" class="neens_div">
+                        <div class="needs_card">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
                                 </div>
-                                <div class="con_info_item">
-                                    <i>行业类型</i><span>{{ n.resSnDPropertyList[2].value }}</span>
+                            </el-image>
+                            <div class="info">
+                                <div class="title">{{ n.name }}</div>
+                                <div class="con_info">
+                                    <div class="con_info_item">
+                                        <i>计划融资</i><span>{{ n.resSnDPropertyList[0].value }}</span>
+                                    </div>
+                                    <div class="con_info_item">
+                                        <i>融资阶段</i><span>{{ n.resSnDPropertyList[1].value }}</span>
+                                    </div>
+                                    <div class="con_info_item">
+                                        <i>行业类型</i><span>{{ n.resSnDPropertyList[2].value }}</span>
+                                    </div>
                                 </div>
+                                <div class="time">{{ n.createdAt }}</div>
+                            </div>
+                            <div class="btn">
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
+                                <div class="edit" @click="toNeedShow(n)">编辑</div>
                             </div>
-                            <div class="time">{{ n.createdAt }}</div>
-                        </div>
-                        <div class="btn">
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
-                            <div class="edit" @click="toNeedShow(n)">编辑</div>
                         </div>
                     </div>
-                </div>
+                </template>
             </el-row>
             <el-row>
                 <el-pagination
@@ -197,6 +233,7 @@ export default {
     },
     methods: {
         getTabData(index) {
+            this.tableData = [];
             this.tab = index;
             if (this.tab === 1) {
                 this.getIndexNeed(this.current);
@@ -206,6 +243,7 @@ export default {
         },
         // 供应信息
         getIndex(index) {
+            this.tableData = [];
             this.current = index;
             if (this.current === 0) {
                 // this.query = { types:PRODUCT_SUPPLY' };
@@ -222,6 +260,7 @@ export default {
         },
         // 需求信息
         getIndexNeed(index) {
+            this.tableData = [];
             this.current = index;
             if (this.current === 0) {
                 this.types = 'TECH_DEMAND';
@@ -362,9 +401,22 @@ export default {
     margin-bottom: 30px;
     float: left;
 
-    img {
+    .cover {
         width: 223px;
         height: 223px;
+        ::v-deep .image-slot {
+            width: 100%;
+            height: 100%;
+            background: #f5f7fa;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            color: #909399;
+            font-size: 14px;
+            i {
+                font-size: 30px;
+            }
+        }
     }
     h5 {
         width: 223px;
@@ -426,10 +478,23 @@ export default {
     // + .needs_card {
 
     // }
-    img {
+    .cover {
         width: 100px;
         height: 100px;
         margin-right: 16px;
+        ::v-deep .image-slot {
+            width: 100%;
+            height: 100%;
+            background: #f5f7fa;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            color: #909399;
+            font-size: 14px;
+            i {
+                font-size: 30px;
+            }
+        }
     }
     .info {
         width: 600px;

+ 83 - 3
src/main/jmrh/src/views/mine/releaseRequirement.vue

@@ -173,7 +173,7 @@
             size="small"
             style="max-width: 500px;"
         >
-            <el-form-item prop="supplyId" label="供应类别">
+            <el-form-item prop="type" label="类型">
                 <el-select v-model="productFormData.type" clearable filterable placeholder="请选择">
                     <el-option v-for="item in supplyType" :key="item.id" :label="item.name" :value="item.id">
                     </el-option>
@@ -258,7 +258,7 @@
             <el-form-item prop="phone" label="联系方式">
                 <el-input v-model="productFormData.phone"></el-input>
             </el-form-item>
-            <el-form-item prop="address" label="联系地址">
+            <el-form-item prop="address" label="联系地址">
                 <el-input v-model="productFormData.address"></el-input>
             </el-form-item>
 
@@ -305,7 +305,86 @@ export default {
             rzhyDataTypeOptions: [],
             /* 产品需求form */
             productFormData: {},
-            productRules: {},
+            productRules: {
+                type: [{ required: true, message: '请选类型', trigger: 'change' }],
+                name: [{ required: true, message: '请输入标题', trigger: 'blur' }],
+                description: [{ required: true, message: '请输入简介', trigger: 'blur' }],
+                contact: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
+                phone: [{ required: true, message: '请输入联系方式', trigger: 'blur' }],
+                dataType: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.dataTypeId) {
+                                callback(new Error('请选择设备类型'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                techType: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.techTypeId) {
+                                callback(new Error('请选择技术类型'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                applicationField: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.applicationFieldId) {
+                                callback(new Error('请选择应用领域'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                money: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.planMoney) {
+                                callback(new Error('请输入融资金额'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                stageType: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.stageTypeId) {
+                                callback(new Error('请选择融资阶段'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                industryType: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.industryTypeId) {
+                                callback(new Error('请选择行业类型'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                expireTime: [{ required: true, message: '请选择有效时间', trigger: 'blur' }]
+            },
             applicationFieldOptions: [],
             // advancedTypeOptions: [],
             jslxDataTypeOptions: [],
@@ -323,6 +402,7 @@ export default {
                 if (valid) {
                     this.submit();
                 } else {
+                    this.$message.error('表单有误,请检查后重提交');
                     return false;
                 }
             });

+ 46 - 2
src/main/jmrh/src/views/mine/releaseSupply.vue

@@ -14,7 +14,7 @@
             size="small"
             style="max-width: 500px;"
         >
-            <el-form-item prop="supplyId" label="供应类别">
+            <el-form-item prop="type" label="供应类别">
                 <el-select v-model="productFormData.type" clearable filterable placeholder="请选择">
                     <el-option v-for="item in supplyType" :key="item.id" :label="item.name" :value="item.id">
                     </el-option>
@@ -111,7 +111,50 @@ export default {
             supplyId: '',
             saving: false,
             productFormData: {},
-            productRules: {},
+            productRules: {
+                type: [{ required: true, message: '请选择供应类别', trigger: 'change' }],
+                name: [{ required: true, message: '请输入标题', trigger: 'blur' }],
+                description: [{ required: true, message: '请输入简介', trigger: 'blur' }],
+                dataType: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.dataTypeId) {
+                                callback(new Error('请选择设备类型'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                techType: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.techTypeId) {
+                                callback(new Error('请选择技术类型'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                applicationField: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.applicationFieldId) {
+                                callback(new Error('请选择应用领域'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                expireTime: [{ required: true, message: '请选择有效时间', trigger: 'blur' }],
+                contact: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
+                phone: [{ required: true, message: '请输入联系方式', trigger: 'blur' }]
+            },
             applicationFieldOptions: [],
             // advancedTypeOptions: [],
             sblxDataTypeOptions: [],
@@ -145,6 +188,7 @@ export default {
                 if (valid) {
                     this.submit();
                 } else {
+                    this.$message.error('表单有误,请检查后重提交');
                     return false;
                 }
             });

+ 6 - 4
src/main/jmrh/src/views/policy.vue

@@ -84,10 +84,12 @@ export default {
         };
     },
     created() {
-        this.$http.get('/articleType/all', { size: 10000, query: { parent: '政策法规' } }).then(res => {
-            this.tabList = res.content;
-            this.getData();
-        });
+        this.$http
+            .get('/articleType/all', { size: 10000, query: { parent: '政策法规' }, sort: 'createdAt' })
+            .then(res => {
+                this.tabList = res.content;
+                this.getData();
+            });
     },
     methods: {
         getData() {

+ 6 - 2
src/main/jmrh/src/views/resourceDetail.vue

@@ -10,7 +10,7 @@
 
             <div class="detail">
                 <div class="top">
-                    <img :src="list.images[0]" />
+                    <img :src="(list.images || [])[0]" />
                     <div class="info">
                         <div class="title">
                             <span>{{ list.name }}</span>
@@ -101,7 +101,7 @@
                         </div>
                         <div class="desc_right">
                             <div class="desc_title">详情介绍</div>
-                            <div v-html="list.details">{{ list.details }}</div>
+                            <div v-html="list.details"></div>
                         </div>
                     </div>
                 </div>
@@ -485,6 +485,7 @@ export default {
             .logo {
                 width: 180px;
                 height: 180px;
+                object-fit: cover;
             }
             .companyname {
                 width: 180px;
@@ -493,6 +494,9 @@ export default {
                 font-size: 14px;
                 color: #000;
                 margin-bottom: 10px;
+                white-space: nowrap;
+                overflow: hidden;
+                text-overflow: ellipsis;
             }
             .companybtn {
                 width: 180px;

+ 5 - 1
src/main/jmrh/src/views/resourceFanceDetail.vue

@@ -103,7 +103,7 @@
                         </div>
                         <div class="desc_right">
                             <div class="desc_title">详情介绍</div>
-                            <div v-html="list.details">{{ list.details }}</div>
+                            <div v-html="list.details"></div>
                         </div>
                     </div>
                 </div>
@@ -437,6 +437,7 @@ export default {
             .logo {
                 width: 180px;
                 height: 180px;
+                object-fit: cover;
             }
             .companyname {
                 width: 180px;
@@ -445,6 +446,9 @@ export default {
                 font-size: 14px;
                 color: #000;
                 margin-bottom: 10px;
+                white-space: nowrap;
+                overflow: hidden;
+                text-overflow: ellipsis;
             }
             .companybtn {
                 width: 180px;

+ 5 - 1
src/main/jmrh/src/views/resourceRelease.vue

@@ -106,7 +106,7 @@
                         </div>
                         <div class="desc_right">
                             <div class="desc_title">详情介绍</div>
-                            <div v-html="list.details">{{ list.details }}</div>
+                            <div v-html="list.details"></div>
                         </div>
                     </div>
                 </div>
@@ -519,6 +519,7 @@ export default {
             .logo {
                 width: 180px;
                 height: 180px;
+                object-fit: cover;
             }
             .companyname {
                 width: 180px;
@@ -527,6 +528,9 @@ export default {
                 font-size: 14px;
                 color: #000;
                 margin-bottom: 10px;
+                white-space: nowrap;
+                overflow: hidden;
+                text-overflow: ellipsis;
             }
             .companybtn {
                 width: 180px;

+ 13 - 4
src/main/resources/application.yaml

@@ -65,7 +65,7 @@ wx:
     notifyUrl: http://zmj.izouma.com/wx/payNotify
     refundNotifyUrl: http://zmj.izouma.com/wx/refundNotify
 storage:
-  provider: local
+  provider: aliyun
   local_path: /Users/drew/Projects/Java/jmrh/upload/
   prefix: /
 aliyun:
@@ -99,7 +99,10 @@ spring:
 storage:
   provider: local
   local_path: /var/www/upload/
-
+encrypt:
+  body:
+    aes-key: gmMRQzojuaSVGg3weNe6J5BCjDyH5BML
+  enable: true
 ---
 
 spring:
@@ -111,7 +114,10 @@ spring:
 storage:
   provider: local
   local_path: /var/www/upload/
-
+encrypt:
+  body:
+    aes-key: gmMRQzojuaSVGg3weNe6J5BCjDyH5BML
+  enable: true
 ---
 
 spring:
@@ -123,7 +129,10 @@ spring:
 storage:
   provider: local
   local_path: /var/www/upload/
-
+encrypt:
+  body:
+    aes-key: gmMRQzojuaSVGg3weNe6J5BCjDyH5BML
+  enable: true
 ---
 
 spring:

+ 6 - 0
src/main/vue/src/plugins/http.js

@@ -131,6 +131,12 @@ export default {
                             reject(e);
                         });
                 });
+            },
+            encrypt(content) {
+                return encrypt(content);
+            },
+            decrypt(content) {
+                return decrypt(content);
             }
         };
     }

+ 16 - 2
src/main/vue/src/views/DataTypeList.vue

@@ -2,7 +2,7 @@
     <div class="list-view">
         <div class="filters-container">
             <el-input placeholder="输入关键字" v-model="search" clearable class="filter-item"></el-input>
-            <el-select v-model="query.keyType" @change="toTypeList">
+            <el-select v-model="query.keyType" @change="toTypeList" class="filter-item">
                 <el-option
                     v-for="item in dataTypeList"
                     :key="item.query.keyType"
@@ -91,6 +91,11 @@ export default {
             return this.$refs.table.selection.map(i => i.id);
         }
     },
+    created() {
+        if (this.$route.query.keyType) {
+            this.query.keyType = this.$route.query.keyType;
+        }
+    },
     methods: {
         toTypeList() {
             this.getData();
@@ -160,7 +165,7 @@ export default {
         deleteRow(row) {
             this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
                 .then(() => {
-                    return this.$http.post(`/articleType/del/${row.id}`);
+                    return this.$http.post(`/dataType/del/${row.id}`);
                 })
                 .then(() => {
                     this.$message.success('删除成功');
@@ -172,6 +177,15 @@ export default {
                     }
                 });
         }
+    },
+    watch: {
+        'query.keyType'(val) {
+            this.$router
+                .replace({
+                    query: { keyType: val }
+                })
+                .catch(() => {});
+        }
     }
 };
 </script>

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

@@ -7,7 +7,7 @@
                 </el-option>
             </el-select>
             <el-button @click="getData" type="primary" icon="el-icon-search" class="filter-item">搜索 </el-button>
-            <el-button @click="addRow" type="primary" icon="el-icon-plus" class="filter-item">添加 </el-button>
+            <!-- <el-button @click="addRow" type="primary" icon="el-icon-plus" class="filter-item">添加 </el-button> -->
             <el-button
                 @click="download"
                 type="primary"

+ 2 - 6
src/test/java/com/izouma/jmrh/CommonTest.java

@@ -157,7 +157,7 @@ public class CommonTest {
 
     @Test
     public void testSecureRandom() throws Exception {
-        String password = "gmMRQzojuaSVGg3weNe6J5BCjDyH5BML";
+        String password = "2wAtaTUoJMjSsJRsAzKFZ83ArFf4tV8P";
 
         KeyGenerator generator = KeyGenerator.getInstance("AES");
         SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
@@ -175,10 +175,6 @@ public class CommonTest {
 
     @Test
     public void testGoogleAuth() {
-        GoogleAuthenticator gAuth = new GoogleAuthenticator();
-        final GoogleAuthenticatorKey key = gAuth.createCredentials();
-        System.out.println(key.getKey());
-
-        System.out.println(gAuth.authorize("QBE5DWZ43TXFBKF3UVP5ON2LE4F4IVAH", 1906041));
+        System.out.println(new BCryptPasswordEncoder().encode("123456"));
     }
 }