Explorar o código

+ 与会企业行程

chen.cheng hai 11 meses
pai
achega
ca7f22f786

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/cp/CpsFileReviewInfoController.java

@@ -2,8 +2,11 @@ package com.ruoyi.web.controller.cp;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.annotation.Anonymous;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -28,6 +31,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
  * @date 2024-08-14
  */
 @RestController
+@CrossOrigin
+@Anonymous
 @RequestMapping("/cp/fileInfo")
 public class CpsFileReviewInfoController extends BaseController
 {

+ 5 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/cp/CpsGlbMsgController.java

@@ -2,8 +2,10 @@ package com.ruoyi.web.controller.cp;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
-import org.springframework.security.access.prepost.PreAuthorize;
+
+import com.ruoyi.common.annotation.Anonymous;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -28,6 +30,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
  * @date 2024-08-14
  */
 @RestController
+@CrossOrigin
+@Anonymous
 @RequestMapping("/cp/msg")
 public class CpsGlbMsgController extends BaseController
 {

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/cp/CpsGlbViewCfgController.java

@@ -2,8 +2,11 @@ package com.ruoyi.web.controller.cp;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.annotation.Anonymous;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -28,6 +31,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
  * @date 2024-08-14
  */
 @RestController
+@CrossOrigin
+@Anonymous
 @RequestMapping("/cp/viewcfg")
 public class CpsGlbViewCfgController extends BaseController
 {

+ 22 - 0
ruoyi-admin/src/main/resources/application-druid.yml

@@ -1,5 +1,27 @@
 # 数据源配置
 spring:
+  # redis 配置
+  redis:
+    # 地址
+    host: 172.192.10.105
+    # 端口,默认为6379
+    port: 30013
+    # 数据库索引
+    database: 1
+    # 密码
+    password:
+    # 连接超时时间
+    timeout: 10s
+    lettuce:
+      pool:
+        # 连接池中的最小空闲连接
+        min-idle: 0
+        # 连接池中的最大空闲连接
+        max-idle: 8
+        # 连接池的最大数据库连接数
+        max-active: 8
+        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: 3s
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
     driverClassName: com.mysql.cj.jdbc.Driver

+ 83 - 0
ruoyi-admin/src/main/resources/application-hm.yml

@@ -0,0 +1,83 @@
+# 数据源配置
+spring:
+  # redis 配置
+  redis:
+    # 地址
+    host: 192.168.0.100
+    # 端口,默认为6379
+    port: 6379
+    # 数据库索引
+    database: 1
+    # 密码
+    password:
+    # 连接超时时间
+    timeout: 10s
+    lettuce:
+      pool:
+        # 连接池中的最小空闲连接
+        min-idle: 0
+        # 连接池中的最大空闲连接
+        max-idle: 8
+        # 连接池的最大数据库连接数
+        max-active: 8
+        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: 3s
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 主库数据源
+      master:
+        url: jdbc:mysql://192.168.0.100:13306/hs_cps?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: ct!QAZ
+      # 从库数据源
+      slave:
+        # 从数据源开关/默认关闭
+        enabled: false
+        url:
+        username:
+        password:
+      # 初始连接数
+      initialSize: 5
+      # 最小连接池数量
+      minIdle: 10
+      # 最大连接池数量
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置连接超时时间
+      connectTimeout: 30000
+      # 配置网络超时时间
+      socketTimeout: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      # 配置一个连接在池中最大生存的时间,单位是毫秒
+      maxEvictableIdleTimeMillis: 900000
+      # 配置检测连接是否有效
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: true
+        # 设置白名单,不填则允许所有访问
+        allow:
+        url-pattern: /druid/*
+        # 控制台管理用户名和密码
+        login-username: ruoyi
+        login-password: 123456
+      filter:
+        stat:
+          enabled: true
+          # 慢SQL记录
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true

+ 2 - 23
ruoyi-admin/src/main/resources/application.yml

@@ -52,7 +52,7 @@ spring:
     # 国际化资源文件路径
     basename: i18n/messages
   profiles:
-    active: druid
+    active: hm
   # 文件上传
   servlet:
     multipart:
@@ -65,28 +65,7 @@ spring:
     restart:
       # 热部署开关
       enabled: true
-  # redis 配置
-  redis:
-    # 地址
-    host: 172.192.10.105
-    # 端口,默认为6379
-    port: 30013
-    # 数据库索引
-    database: 1
-    # 密码
-    password:
-    # 连接超时时间
-    timeout: 10s
-    lettuce:
-      pool:
-        # 连接池中的最小空闲连接
-        min-idle: 0
-        # 连接池中的最大空闲连接
-        max-idle: 8
-        # 连接池的最大数据库连接数
-        max-active: 8
-        # #连接池最大阻塞等待时间(使用负值表示没有限制)
-        max-wait: 3s
+
 
 # token配置
 token:

+ 49 - 15
ruoyi-system/src/main/java/com/ruoyi/system/domain/CpsGlbViewCfg.java

@@ -1,13 +1,13 @@
 package com.ruoyi.system.domain;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 
 /**
  * cps_glb_view_cfg 展示配置对象 cps_glb_view_cfg
- * 
+ *
  * @author ruoyi
  * @date 2024-08-14
  */
@@ -38,61 +38,95 @@ public class CpsGlbViewCfg extends BaseEntity
     @Excel(name = "组件编码")
     private String compCode;
 
-    public void setId(Long id) 
+    /**
+     * 排序
+     */
+    @Excel(name = "排序")
+    private Integer sort;
+
+    /**
+     * 是否显示
+     */
+    @Excel(name = "是否显示")
+    private String showFlag;
+
+    public void setId(Long id)
     {
         this.id = id;
     }
 
-    public Long getId() 
+    public Long getId()
     {
         return id;
     }
-    public void setIconUri(String iconUri) 
+
+    public void setIconUri(String iconUri)
     {
         this.iconUri = iconUri;
     }
 
-    public String getIconUri() 
+    public String getIconUri()
     {
         return iconUri;
     }
-    public void setLabelTxt(String labelTxt) 
+
+    public void setLabelTxt(String labelTxt)
     {
         this.labelTxt = labelTxt;
     }
 
-    public String getLabelTxt() 
+    public String getLabelTxt()
     {
         return labelTxt;
     }
-    public void setStyle(String style) 
+
+    public void setStyle(String style)
     {
         this.style = style;
     }
 
-    public String getStyle() 
+    public String getStyle()
     {
         return style;
     }
-    public void setUrl(String url) 
+
+    public void setUrl(String url)
     {
         this.url = url;
     }
 
-    public String getUrl() 
+    public String getUrl()
     {
         return url;
     }
-    public void setCompCode(String compCode) 
+
+    public void setCompCode(String compCode)
     {
         this.compCode = compCode;
     }
 
-    public String getCompCode() 
+    public String getCompCode()
     {
         return compCode;
     }
 
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+
+    public String getShowFlag() {
+        return showFlag;
+    }
+
+    public void setShowFlag(String showFlag) {
+        this.showFlag = showFlag;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 2 - 1
ruoyi-system/src/main/resources/mapper/cp/CpsFileReviewInfoMapper.xml

@@ -22,8 +22,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectCpsFileReviewInfoList" parameterType="com.ruoyi.system.domain.CpsFileReviewInfo" resultMap="CpsFileReviewInfoResult">
         <include refid="selectCpsFileReviewInfoVo"/>
         <where>
-            <if test="fileType != null "> and file_type = #{fileType}</if>
+            <if test="fileType != null ">and file_type = #{fileType}</if>
         </where>
+        order by create_time desc
     </select>
 
     <select id="selectCpsFileReviewInfoById" parameterType="Long" resultMap="CpsFileReviewInfoResult">

+ 1 - 0
ruoyi-system/src/main/resources/mapper/cp/CpsGlbMsgMapper.xml

@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="msg != null  and msg != ''"> and msg like concat('%', #{msg}, '%')</if>
         </where>
+        order by create_time desc
     </select>
 
     <select id="selectCpsGlbMsgById" parameterType="Long" resultMap="CpsGlbMsgResult">

+ 12 - 1
ruoyi-system/src/main/resources/mapper/cp/CpsGlbViewCfgMapper.xml

@@ -11,6 +11,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="style"    column="style"    />
         <result property="url"    column="url"    />
         <result property="compCode"    column="comp_code"    />
+        <result property="sort"    column="sort"    />
+        <result property="showFlag"    column="show_flag"    />
         <result property="updateTime"    column="update_time"    />
         <result property="createTime"    column="create_time"    />
         <result property="createBy"    column="create_by"    />
@@ -18,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectCpsGlbViewCfgVo">
-        select id, icon_uri, label_txt, style, url, comp_code, update_time, create_time, create_by, update_by from cps_glb_view_cfg
+        select id, icon_uri, label_txt, style, url, comp_code,sort, show_flag, update_time, create_time, create_by, update_by from cps_glb_view_cfg
     </sql>
 
     <select id="selectCpsGlbViewCfgList" parameterType="com.ruoyi.system.domain.CpsGlbViewCfg" resultMap="CpsGlbViewCfgResult">
@@ -29,9 +31,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="style != null  and style != ''"> and style = #{style}</if>
             <if test="url != null  and url != ''"> and url = #{url}</if>
             <if test="compCode != null  and compCode != ''"> and comp_code = #{compCode}</if>
+             <if test="sort != null "> and sort = #{sort}</if>
+            <if test="showFlag != null  and showFlag != ''"> and show_flag = #{showFlag}</if>
             <if test="updateTime != null "> and update_time = #{updateTime}</if>
             <if test="createTime != null "> and create_time = #{createTime}</if>
         </where>
+        order by comp_code desc,sort asc,show_flag desc
     </select>
 
     <select id="selectCpsGlbViewCfgById" parameterType="Long" resultMap="CpsGlbViewCfgResult">
@@ -47,6 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="style != null">style,</if>
             <if test="url != null">url,</if>
             <if test="compCode != null">comp_code,</if>
+            <if test="sort != null">sort,</if>
+            <if test="showFlag != null">show_flag,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
@@ -58,6 +65,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="style != null">#{style},</if>
             <if test="url != null">#{url},</if>
             <if test="compCode != null">#{compCode},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="showFlag != null">#{showFlag},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
@@ -73,6 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="style != null">style = #{style},</if>
             <if test="url != null">url = #{url},</if>
             <if test="compCode != null">comp_code = #{compCode},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="showFlag != null">show_flag = #{showFlag},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>

+ 1 - 0
ruoyi-ui/package.json

@@ -38,6 +38,7 @@
   "dependencies": {
     "@riophae/vue-treeselect": "0.4.0",
     "axios": "0.28.1",
+    "bin-code-editor": "^0.9.0",
     "clipboard": "2.0.8",
     "core-js": "3.37.1",
     "echarts": "5.4.0",

+ 1 - 1
ruoyi-ui/src/views/cp/fileInfo/index.vue

@@ -114,7 +114,7 @@
           <file-upload v-model="form.uri"
                        :limit="1"
                        :file-size="50"
-                       :file-type='[ "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt","pdf", "mp4"]'
+                       :file-type='[ "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt","pdf", "mp4","svg"]'
                        @input="fileInputCall" />
         </el-form-item>
         <el-form-item label="文件名称" prop="fileName">

+ 47 - 3
ruoyi-ui/src/views/cp/viewcfg/index.vue

@@ -35,6 +35,16 @@
           placeholder="请选择修改时间">
         </el-date-picker>
       </el-form-item>
+      <el-form-item label="是否显示" prop="showFlag">
+        <el-select v-model="queryParams.showFlag" placeholder="请选择是否显示" clearable>
+          <el-option
+              v-for="dict in dict.type.sys_yes_no"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -103,6 +113,12 @@
           <dict-tag :options="dict.type.comp_code" :value="scope.row.compCode"/>
         </template>
       </el-table-column>
+      <el-table-column label="排序" align="center" prop="sort" />
+      <el-table-column label="是否显示" align="center" prop="showFlag">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.showFlag"/>
+        </template>
+      </el-table-column>
       <el-table-column label="创建时间" align="center" prop="updateTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
@@ -153,7 +169,13 @@
           <el-input v-model="form.labelTxt" placeholder="请输入名称" />
         </el-form-item>
         <el-form-item label="style" prop="style">
-          <el-input v-model="form.style" type="textarea" placeholder="请输入内容" />
+          <CodeEditor v-model="form.style"
+                      :auto-format="true"
+                      :smart-indent="true"
+                      theme="dracula"
+                      :indent-unit="4"
+                      :line-wrap="false"
+                      ref="editor"></CodeEditor>
         </el-form-item>
         <el-form-item label="跳转页面路由" prop="url">
           <el-input v-model="form.url" type="textarea" placeholder="请输入内容" />
@@ -168,6 +190,18 @@
             ></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="排序" prop="sort">
+          <el-input v-model="form.sort" placeholder="请输入排序" />
+        </el-form-item>
+        <el-form-item label="是否显示" prop="showFlag">
+          <el-radio-group v-model="form.showFlag">
+            <el-radio
+                v-for="dict in dict.type.sys_yes_no"
+                :key="dict.value"
+                :label="dict.value"
+            >{{dict.label}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -179,10 +213,11 @@
 
 <script>
 import { listViewcfg, getViewcfg, delViewcfg, addViewcfg, updateViewcfg } from "@/api/cp/viewcfg";
-
+import { CodeEditor } from 'bin-code-editor'
 export default {
+  components: { CodeEditor },
   name: "Viewcfg",
-  dicts: ['comp_code'],
+  dicts: ['comp_code', 'sys_yes_no'],
   data() {
     return {
       // 遮罩层
@@ -212,6 +247,7 @@ export default {
         style: null,
         url: null,
         compCode: null,
+        showFlag: 'Y',
         updateTime: null,
         createTime: null,
       },
@@ -228,6 +264,12 @@ export default {
         compCode: [
           { required: true, message: "组件编码不能为空", trigger: "change" }
         ],
+        sort: [
+          { required: true, message: "排序不能为空", trigger: "blur" }
+        ],
+        showFlag: [
+          { required: true, message: "是否显示不能为空", trigger: "blur" }
+        ],
       }
     };
   },
@@ -258,6 +300,8 @@ export default {
         style: null,
         url: null,
         compCode: null,
+        sort: null,
+        showFlag: null,
         updateTime: null,
         createTime: null,
         createBy: null,