框架升级

main
lj7788 2025-08-23 20:39:24 +08:00
parent 2e0c93ceb7
commit 302de3c0f0
18 changed files with 754 additions and 814 deletions

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<version>3.6.0</version> <version>3.8.6</version>
</parent> </parent>
<!-- <groupId>com.hig</groupId> --> <!-- <groupId>com.hig</groupId> -->
<artifactId>hig-application</artifactId> <artifactId>hig-application</artifactId>
@ -11,35 +11,29 @@
<description>应用扩展包</description> <description>应用扩展包</description>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<fastjson.version>1.2.47</fastjson.version> <fastjson.version>1.2.83</fastjson.version>
<lombok.version>1.18.30</lombok.version> <lombok.version>1.18.30</lombok.version>
<oracle.version>12.2.0.1.0</oracle.version> <oracle.version>12.2.0.1.0</oracle.version>
<druid.version>1.1.13</druid.version> <druid.version>1.2.20</druid.version>
<mybatis.version>2.1.1</mybatis.version> <mybatis.version>2.3.2</mybatis.version>
<gson.version>2.8.6</gson.version> <gson.version>2.10.1</gson.version>
<jasypt.version>3.0.2</jasypt.version> <jasypt.version>3.0.5</jasypt.version>
<quartz.version>2.3.2</quartz.version> <quartz.version>2.3.2</quartz.version>
<httpclient.version>4.5.10</httpclient.version> <httpclient.version>4.5.14</httpclient.version>
<httpmime.version>4.5.10</httpmime.version> <httpmime.version>4.5.14</httpmime.version>
<httpcore.version>4.4.12</httpcore.version> <httpcore.version>4.4.16</httpcore.version>
<commons-codec.version>1.9</commons-codec.version> <commons-codec.version>1.15</commons-codec.version>
<commons-logging.version>1.2</commons-logging.version> <commons-logging.version>1.2</commons-logging.version>
<commons-io.version>2.8.0</commons-io.version> <commons-io.version>2.11.0</commons-io.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.12.0</commons-lang3.version>
<commons-lang.version>3.4</commons-lang.version> <commons-lang.version>3.12.0</commons-lang.version>
<weixin-java-cp.version>4.1.0</weixin-java-cp.version> <weixin-java-cp.version>4.5.0</weixin-java-cp.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<artifactId>log4j-to-slf4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- 发war包的时侯排除tomcat --> <!-- 发war包的时侯排除tomcat -->
<dependency> <dependency>
@ -137,7 +131,7 @@
<dependency> <dependency>
<groupId>com.thoughtworks.xstream</groupId> <groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId> <artifactId>xstream</artifactId>
<version>1.4.14</version> <version>1.4.20</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io --> <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
@ -177,7 +171,7 @@
<dependency> <dependency>
<groupId>org.json</groupId> <groupId>org.json</groupId>
<artifactId>json</artifactId> <artifactId>json</artifactId>
<version>20210307</version> <version>20231013</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>

View File

@ -31,7 +31,7 @@ import com.hig.ueditor.define.State;
@RestController @RestController
@RequestMapping("/ueditor") @RequestMapping("/ueditor")
@CrossOrigin(allowCredentials = "true") @CrossOrigin(allowCredentials = "true", originPatterns = "*")
public class UEditorController { public class UEditorController {
@Autowired @Autowired
private UEditorUpload uEditorUpload; private UEditorUpload uEditorUpload;

View File

@ -3,36 +3,30 @@
<parent> <parent>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<version>3.6.0</version> <version>3.8.6</version>
</parent> </parent>
<artifactId>hig-common</artifactId> <artifactId>hig-common</artifactId>
<name>hig-common</name> <name>hig-common</name>
<description>应用框架公用部分</description> <description>应用框架公用部分</description>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<fastjson.version>1.2.47</fastjson.version> <fastjson.version>1.2.83</fastjson.version>
<lombok.version>1.18.4</lombok.version> <lombok.version>1.18.30</lombok.version>
<gson.version>2.8.6</gson.version> <gson.version>2.10.1</gson.version>
<jasypt.version>3.0.2</jasypt.version> <jasypt.version>3.0.5</jasypt.version>
<httpclient.version>4.5.10</httpclient.version> <httpclient.version>4.5.14</httpclient.version>
<httpmime.version>4.5.10</httpmime.version> <httpmime.version>4.5.14</httpmime.version>
<httpcore.version>4.4.12</httpcore.version> <httpcore.version>4.4.16</httpcore.version>
<commons-codec.version>1.9</commons-codec.version> <commons-codec.version>1.15</commons-codec.version>
<commons-logging.version>1.2</commons-logging.version> <commons-logging.version>1.2</commons-logging.version>
<commons-io.version>2.8.0</commons-io.version> <commons-io.version>2.11.0</commons-io.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.12.0</commons-lang3.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<artifactId>log4j-to-slf4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- 发war包的时侯排除tomcat --> <!-- 发war包的时侯排除tomcat -->
<dependency> <dependency>
@ -101,7 +95,7 @@
<dependency> <dependency>
<groupId>com.thoughtworks.xstream</groupId> <groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId> <artifactId>xstream</artifactId>
<version>1.4.14</version> <version>1.4.20</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io --> <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
@ -127,5 +121,9 @@
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version> <version>${commons-lang3.version}</version>
</dependency> </dependency>
</dependencies> <dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies>
</project> </project>

View File

@ -6,34 +6,35 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<version>3.6.0</version> <version>3.8.6</version>
<name>ruoyi</name> <name>ruoyi</name>
<url>http://www.ruoyi.vip</url> <url>http://www.ruoyi.vip</url>
<description>新框架扩展应用</description> <description>新框架扩展应用</description>
<properties> <properties>
<ruoyi.version>3.6.0</ruoyi.version> <ruoyi.version>3.8.6</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<druid.version>1.2.6</druid.version> <druid.version>1.2.16</druid.version>
<bitwalker.version>1.21</bitwalker.version> <bitwalker.version>1.21</bitwalker.version>
<swagger.version>3.0.0</swagger.version> <swagger.version>3.0.0</swagger.version>
<kaptcha.version>2.3.2</kaptcha.version> <kaptcha.version>2.3.2</kaptcha.version>
<mybatis-spring-boot.version>2.1.4</mybatis-spring-boot.version> <mybatis-spring-boot.version>2.3.2</mybatis-spring-boot.version>
<!-- <oracle.version>12.2.0.1.0</oracle.version> --> <!-- <oracle.version>12.2.0.1.0</oracle.version> -->
<pagehelper.boot.version>1.3.1</pagehelper.boot.version> <pagehelper.boot.version>1.4.7</pagehelper.boot.version>
<fastjson.version>1.2.76</fastjson.version> <fastjson.version>1.2.83</fastjson.version>
<oshi.version>5.7.5</oshi.version> <oshi.version>6.4.6</oshi.version>
<jna.version>5.8.0</jna.version> <jna.version>5.13.0</jna.version>
<commons.io.version>2.10.0</commons.io.version> <commons.io.version>2.11.0</commons.io.version>
<commons.fileupload.version>1.4</commons.fileupload.version> <commons.fileupload.version>1.5</commons.fileupload.version>
<commons.collections.version>3.2.2</commons.collections.version> <commons.collections.version>3.2.2</commons.collections.version>
<poi.version>4.1.2</poi.version> <poi.version>5.2.4</poi.version>
<velocity.version>1.7</velocity.version> <velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version> <jwt.version>0.9.1</jwt.version>
<mysql.version>8.0.33</mysql.version>
</properties> </properties>
<!-- 依赖声明 --> <!-- 依赖声明 -->
@ -44,7 +45,7 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId> <artifactId>spring-boot-dependencies</artifactId>
<version>2.2.13.RELEASE</version> <version>2.5.15</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@ -140,14 +141,8 @@
<!-- velocity代码生成使用模板 --> <!-- velocity代码生成使用模板 -->
<dependency> <dependency>
<groupId>org.apache.velocity</groupId> <groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId> <artifactId>velocity-engine-core</artifactId>
<version>${velocity.version}</version> <version>${velocity.version}</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- collections工具类 --> <!-- collections工具类 -->
@ -164,6 +159,13 @@
<version>${fastjson.version}</version> <version>${fastjson.version}</version>
</dependency> </dependency>
<!-- MySQL驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!-- Token生成与解析--> <!-- Token生成与解析-->
<dependency> <dependency>
<groupId>io.jsonwebtoken</groupId> <groupId>io.jsonwebtoken</groupId>
@ -256,7 +258,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version> <version>3.8.1</version>
<configuration> <configuration>
<source>${java.version}</source> <source>${java.version}</source>
<target>${java.version}</target> <target>${java.version}</target>
@ -270,7 +272,7 @@
<repository> <repository>
<id>public</id> <id>public</id>
<name>aliyun nexus</name> <name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url> <url>https://maven.aliyun.com/repository/public</url>
<releases> <releases>
<enabled>true</enabled> <enabled>true</enabled>
</releases> </releases>
@ -281,7 +283,7 @@
<pluginRepository> <pluginRepository>
<id>public</id> <id>public</id>
<name>aliyun nexus</name> <name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url> <url>https://maven.aliyun.com/repository/public</url>
<releases> <releases>
<enabled>true</enabled> <enabled>true</enabled>
</releases> </releases>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.6.0</version> <version>3.8.6</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging> <packaging>jar</packaging>
@ -80,7 +80,7 @@
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.1.RELEASE</version> <version>2.5.15</version>
<configuration> <configuration>
<fork>true</fork> <!-- 如果没有该配置devtools不会生效 --> <fork>true</fork> <!-- 如果没有该配置devtools不会生效 -->
</configuration> </configuration>
@ -95,7 +95,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version> <version>3.4.0</version>
<configuration> <configuration>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<warName>examapi</warName> <warName>examapi</warName>

View File

@ -4,7 +4,8 @@ import java.io.UnsupportedEncodingException;
import java.util.Base64; import java.util.Base64;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -29,6 +30,7 @@ import com.ruoyi.system.service.ISysMenuService;
@RestController @RestController
public class SysLoginController public class SysLoginController
{ {
private static final Logger log = LoggerFactory.getLogger(SysLoginController.class);
@Autowired @Autowired
private SysLoginService loginService; private SysLoginService loginService;
@ -87,7 +89,7 @@ public class SysLoginController
ajax.put("user", user); ajax.put("user", user);
ajax.put("roles", roles); ajax.put("roles", roles);
ajax.put("permissions", permissions); ajax.put("permissions", permissions);
System.out.println("ajax:" + ajax.toString()); log.debug("ajax:{}", ajax.toString());
return ajax; return ajax;
} }

View File

@ -57,7 +57,7 @@ spring:
# host: localhost # Redis服务器地址 # host: localhost # Redis服务器地址
host: 127.0.0.1 host: 127.0.0.1
port: 6379 # Redis服务器连接端口 port: 6379 # Redis服务器连接端口
password: # Redis服务器连接密码默认为空 password: 123456 # Redis服务器连接密码默认为空
timeout: 20000 # 连接超时时间(毫秒) timeout: 20000 # 连接超时时间(毫秒)
jedis: jedis:
pool: pool:

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.6.0</version> <version>3.8.6</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -99,7 +99,6 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId> <artifactId>spring-boot-starter-data-redis</artifactId>
<version>1.5.22.RELEASE</version>
</dependency> </dependency>
<!-- pool 对象池 --> <!-- pool 对象池 -->

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.6.0</version> <version>3.8.6</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -21,12 +21,6 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<artifactId>log4j-to-slf4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- SpringBoot 拦截器 --> <!-- SpringBoot 拦截器 -->

View File

@ -52,17 +52,20 @@ public class ResourcesConfig implements WebMvcConfigurer
@Bean @Bean
public CorsFilter corsFilter() public CorsFilter corsFilter()
{ {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration(); CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true); config.setAllowCredentials(true);
// 设置访问源地址 // 设置访问源地址
config.addAllowedOrigin("*"); config.addAllowedOriginPattern("*");
// 设置访问源请求头 // 设置访问源请求头
config.addAllowedHeader("*"); config.addAllowedHeader("*");
// 设置访问源请求方法 // 设置访问源请求方法
config.addAllowedMethod("*"); config.addAllowedMethod("*");
// 对接口配置跨域设置 // 有效期 1800秒
config.setMaxAge(1800L);
// 添加映射路径,拦截一切请求
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", config); source.registerCorsConfiguration("/**", config);
// 返回新的CorsFilter
return new CorsFilter(source); return new CorsFilter(source);
} }
} }

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.6.0</version> <version>3.8.6</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -20,7 +20,7 @@
<!--velocity代码生成使用模板 --> <!--velocity代码生成使用模板 -->
<dependency> <dependency>
<groupId>org.apache.velocity</groupId> <groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId> <artifactId>velocity-engine-core</artifactId>
</dependency> </dependency>
<!-- collections工具类 --> <!-- collections工具类 -->

View File

@ -2,6 +2,7 @@ package com.ruoyi.generator.util;
import java.util.Properties; import java.util.Properties;
import org.apache.velocity.app.Velocity; import org.apache.velocity.app.Velocity;
import org.apache.velocity.runtime.RuntimeConstants;
import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.Constants;
/** /**
@ -19,11 +20,10 @@ public class VelocityInitializer
Properties p = new Properties(); Properties p = new Properties();
try try
{ {
// 加载classpath目录下的vm文件
p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
// 定义字符集 // 定义字符集
p.setProperty(Velocity.INPUT_ENCODING, Constants.UTF8); p.setProperty(RuntimeConstants.INPUT_ENCODING, Constants.UTF8);
p.setProperty(Velocity.OUTPUT_ENCODING, Constants.UTF8); p.setProperty(RuntimeConstants.RESOURCE_LOADERS, "class");
p.setProperty("resource.loader.class.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
// 初始化Velocity引擎指定配置Properties // 初始化Velocity引擎指定配置Properties
Velocity.init(p); Velocity.init(p);
} }

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.6.0</version> <version>3.8.6</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -1,57 +1,57 @@
package com.ruoyi.quartz.config; //package com.ruoyi.quartz.config;
//
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.SchedulerFactoryBean; //import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import javax.sql.DataSource; //import javax.sql.DataSource;
import java.util.Properties; //import java.util.Properties;
//
/** ///**
* // * 定时任务配置单机部署建议删除此类和qrtz数据库表默认走内存会最高效
* // *
* @author ruoyi // * @author ruoyi
*/ // */
@Configuration //@Configuration
public class ScheduleConfig //public class ScheduleConfig
{ //{
@Bean // @Bean
public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) // public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
{ // {
SchedulerFactoryBean factory = new SchedulerFactoryBean(); // SchedulerFactoryBean factory = new SchedulerFactoryBean();
factory.setDataSource(dataSource); // factory.setDataSource(dataSource);
//
// quartz参数 // // quartz参数
Properties prop = new Properties(); // Properties prop = new Properties();
prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler"); // prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler");
prop.put("org.quartz.scheduler.instanceId", "AUTO"); // prop.put("org.quartz.scheduler.instanceId", "AUTO");
// 线程池配置 // // 线程池配置
prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool"); // prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
prop.put("org.quartz.threadPool.threadCount", "20"); // prop.put("org.quartz.threadPool.threadCount", "20");
prop.put("org.quartz.threadPool.threadPriority", "5"); // prop.put("org.quartz.threadPool.threadPriority", "5");
// JobStore配置 // // JobStore配置
prop.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX"); // prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore");
// 集群配置 // // 集群配置
prop.put("org.quartz.jobStore.isClustered", "true"); // prop.put("org.quartz.jobStore.isClustered", "true");
prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); // prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); // prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true"); // prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
//
// sqlserver 启用 // // sqlserver 启用
// prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?"); // // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
prop.put("org.quartz.jobStore.misfireThreshold", "12000"); // prop.put("org.quartz.jobStore.misfireThreshold", "12000");
prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_"); // prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
factory.setQuartzProperties(prop); //
// factory.setQuartzProperties(prop);
factory.setSchedulerName("RuoyiScheduler"); // factory.setSchedulerName("RuoyiScheduler");
// 延时启动 // // 延时启动
factory.setStartupDelay(1); // factory.setStartupDelay(1);
factory.setApplicationContextSchedulerContextKey("applicationContextKey"); // factory.setApplicationContextSchedulerContextKey("applicationContextKey");
// 可选QuartzScheduler // // 可选QuartzScheduler
// 启动时更新己存在的Job这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了 // // 启动时更新己存在的Job这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
factory.setOverwriteExistingJobs(true); // factory.setOverwriteExistingJobs(true);
// 设置自动启动默认为true // // 设置自动启动默认为true
factory.setAutoStartup(true); // factory.setAutoStartup(true);
//
return factory; // return factory;
} // }
} //}

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.6.0</version> <version>3.8.6</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -1,63 +1,46 @@
<template> <template>
<div> <div>
<div style ="margin-left: 15px"> <div style="margin-left: 15px">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button @click="onClose" plain icon="el-icon-s-home" size="mini">返回</el-button>
@click="onClose"
plain
icon="el-icon-s-home"
size="mini"
>返回</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="success" plain icon="el-icon-edit" size="mini" @click="handleSave"></el-button>
type="success"
plain
icon="el-icon-edit"
size="mini"
@click="handleSave"
>保存</el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div class="form-panel"> <div class="form-panel">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="试题类型" prop="questionsType"> <el-form-item label="试题类型" prop="questionsType">
<el-select v-model="form.questionsType" @change = "onChoice" placeholder="请选择试题类型"> <el-select v-model="form.questionsType" @change="onChoice" placeholder="请选择试题类型">
<el-option <el-option v-for="dict in questionsTypeOptions" :key="dict.dictValue" :label="dict.dictLabel"
v-for="dict in questionsTypeOptions" :value="parseInt(dict.dictValue)"></el-option>
:key="dict.dictValue" </el-select>
:label="dict.dictLabel" </el-form-item>
:value="parseInt(dict.dictValue)" <div class="ueditor-area">
></el-option> <span class="star-text">*</span>
</el-select> <span class="ueditor-title">试题题目</span>
</el-form-item> </div>
<div class = "ueditor-area"> <vue-ueditor-wrap v-model="textValue" :config="editConfig" @ready="onEditorReady"
<span class = "star-text">*</span> :destroy="true"></vue-ueditor-wrap>
<span class= "ueditor-title">试题题目</span> <br />
<el-form-item label="题目分数" prop="questionsScore">
<el-input-number v-model="form.questionsScore" :min="1" :max="20" label="请输入题目分数"></el-input-number>
</el-form-item>
<el-form-item label="复杂度 " prop="rateNumber">
<div class="rate-area">
<el-rate v-model="form.rateNumber" show-score text-color="#ff9900">
</el-rate>
</div> </div>
<vue-ueditor-wrap v-model="textValue" :config="editConfig" @ready="onEditorReady" :destroy="true"></vue-ueditor-wrap> </el-form-item>
<br> </el-form>
<el-form-item label="题目分数" prop="questionsScore"> <div class="table-panel">
<el-input-number v-model="form.questionsScore" :min="1" :max="20" label="请输入题目分数"></el-input-number> <div class="ueditor-area">
</el-form-item> <span class="star-text">*</span>
<el-form-item label="复杂度 " prop="rateNumber"> <span class="ueditor-title">{{ choiceText }}</span>
<div class = "rate-area"> </div>
<el-rate <el-table :data="answerList">
v-model="form.rateNumber"
show-score
text-color="#ff9900">
</el-rate>
</div>
</el-form-item>
</el-form>
<div class = "table-panel">
<div class = "ueditor-area">
<span class = "star-text">*</span>
<span class= "ueditor-title">{{choiceText}}</span>
</div>
<el-table :data="answerList" >
<el-table-column label="选项" width="50px" align="center" prop="optionCode" /> <el-table-column label="选项" width="50px" align="center" prop="optionCode" />
<el-table-column label="选项描述" align="center" prop="optionDescribe"> <el-table-column label="选项描述" align="center" prop="optionDescribe">
<template slot-scope="scope"> <template slot-scope="scope">
@ -66,73 +49,80 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100px" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" width="100px" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if = "choiceNumber > 1 && answerList.indexOf(scope.row) === answerList.length - 1" <el-button v-if="
size="mini" choiceNumber > 1 &&
type="text" answerList.indexOf(scope.row) === answerList.length - 1
icon="el-icon-plus" " size="mini" type="text" icon="el-icon-plus" @click="handleAdd()">增加</el-button>
@click="handleAdd()" <el-button v-if="answerList.indexOf(scope.row) > 1" size="mini" type="text" icon="el-icon-delete"
>增加</el-button> @click="handleDelete(scope.row)">删除</el-button>
<el-button v-if = "answerList.indexOf(scope.row) > 1"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<template v-if = "isRadio"> <template v-if="isRadio">
<el-form-item label="正确答案" prop="rightAnswer"> <el-form-item label="正确答案" prop="rightAnswer">
<el-radio-group v-model="radioValue"> <el-radio-group v-model="radioValue">
<el-radio <el-radio v-for="item in answerList" :key="item.orderId" :label="item.optionCode">{{ item.optionCode }}
v-for="item in answerList" 选项</el-radio>
:key="item.orderId"
:label="item.optionCode"
>{{item.optionCode}} 选项</el-radio>
</el-radio-group>
</el-form-item>
</template>
<template v-else>
<el-form-item label="正确答案" prop="rightAnswer">
<el-checkbox-group v-model="checkItem">
<el-checkbox
v-for="item in answerList"
:key="item.orderId"
:label="item.optionCode"
>{{item.optionCode}} 选项</el-checkbox>
</el-checkbox-group>
</el-form-item>
</template>
<el-form-item label="答案分析" prop="answerAnalyse">
<el-input v-model="form.answerAnalyse" type="textarea" placeholder="请输入答案分析" />
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="parseInt(dict.dictValue)"
>{{dict.dictLabel}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-form> </template>
<template v-else>
<el-form-item label="正确答案" prop="rightAnswer">
<el-checkbox-group v-model="checkItem">
<el-checkbox v-for="item in answerList" :key="item.orderId" :label="item.optionCode">{{ item.optionCode }}
选项</el-checkbox>
</el-checkbox-group>
</el-form-item>
</template>
<el-form-item label="答案分析" prop="answerAnalyse">
<el-input v-model="form.answerAnalyse" type="textarea" placeholder="请输入答案分析" />
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio v-for="dict in statusOptions" :key="dict.dictValue" :label="parseInt(dict.dictValue)">{{
dict.dictLabel
}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import VueUeditorWrap from 'vue-ueditor-wrap' import VueUeditorWrap from "vue-ueditor-wrap";
import { baseApiUrl, uiUrl } from '@/config/sysinfo' import { baseApiUrl, uiUrl } from "@/config/sysinfo";
import { newS4Guid, newGuid } from '@/utils/guidtool' import { newS4Guid, newGuid } from "@/utils/guidtool";
import { listExamquestions, getExamquestions, delExamquestions, addExamquestions, updateExamquestions, exportExamquestions } from "@/api/questions/examquestions"; import {
import { listQuestionscontent, getQuestionscontent, delQuestionscontent, addQuestionscontent, updateQuestionscontent, exportQuestionscontent } from "@/api/questions/questionscontent"; listExamquestions,
import { listAnswer, getAnswer, delAnswer, addAnswer, updateAnswer, exportAnswer } from "@/api/questions/answer"; getExamquestions,
delExamquestions,
addExamquestions,
updateExamquestions,
exportExamquestions,
} from "@/api/questions/examquestions";
import {
listQuestionscontent,
getQuestionscontent,
delQuestionscontent,
addQuestionscontent,
updateQuestionscontent,
exportQuestionscontent,
} from "@/api/questions/questionscontent";
import {
listAnswer,
getAnswer,
delAnswer,
addAnswer,
updateAnswer,
exportAnswer,
} from "@/api/questions/answer";
export default { export default {
name: "Examquestions", name: "Examquestions",
components: { VueUeditorWrap}, components: { VueUeditorWrap },
data() { data() {
return { return {
// //
@ -140,29 +130,29 @@ export default {
anylyseForm: {}, anylyseForm: {},
// //
questionsTypeOptions: [ questionsTypeOptions: [
{dictValue: 1, dictLabel: '判断题'}, { dictValue: 1, dictLabel: "判断题" },
{dictValue: 2, dictLabel: '单选题'}, { dictValue: 2, dictLabel: "单选题" },
{dictValue: 3, dictLabel: '多选题'} { dictValue: 3, dictLabel: "多选题" },
], ],
// //
statusOptions: [], statusOptions: [],
bankData: {}, bankData: {},
questionsData: {}, questionsData: {},
rules: { rules: {
questionsTitle: [ questionsTitle: [
{ required: true, message: "试题题目不能为空", trigger: "blur" } { required: true, message: "试题题目不能为空", trigger: "blur" },
], ],
questionsType: [ questionsType: [
{ required: true, message: "试题类型不能为空", trigger: "change" } { required: true, message: "试题类型不能为空", trigger: "change" },
], ],
questionsScore: [ questionsScore: [
{ required: true, message: "题目分数不能为空", trigger: "blur" } { required: true, message: "题目分数不能为空", trigger: "blur" },
], ],
rateNumber: [ rateNumber: [
{ required: true, message: "复杂度不能为空", trigger: "blur" } { required: true, message: "复杂度不能为空", trigger: "blur" },
], ],
rightAnswer: [ rightAnswer: [
{ required: true, message: "正确答案不能为空", trigger: "blur" } { required: true, message: "正确答案不能为空", trigger: "blur" },
], ],
}, },
// //
@ -173,8 +163,35 @@ export default {
single: true, single: true,
// //
multiple: true, multiple: true,
optionItem: ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'], optionItem: [
choiceText: '题目选项', "A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
],
choiceText: "题目选项",
choiceNumber: 0, choiceNumber: 0,
isRadio: true, isRadio: true,
radioValue: null, radioValue: null,
@ -186,11 +203,11 @@ export default {
// //
initialFrameHeight: 200, initialFrameHeight: 200,
// //
initialFrameWidth: '100%', initialFrameWidth: "100%",
// 便使 // 便使
serverUrl: baseApiUrl + '/ueditor/config', serverUrl: baseApiUrl + "/ueditor/config",
// UEditor 使 vue-cli vue-ueditor-wrap 2 // UEditor 使 vue-cli vue-ueditor-wrap 2
UEDITOR_HOME_URL: '/examui/UEditor/' UEDITOR_HOME_URL: "/examui/UEditor/",
}, },
Ueditor: null, Ueditor: null,
isNew: false, isNew: false,
@ -200,28 +217,28 @@ export default {
pageSize: 10, pageSize: 10,
questionsCode: null, questionsCode: null,
optionDescribe: null, optionDescribe: null,
}, },
} };
}, },
created() { created() {
this.getDicts("sys_normal_disable").then(response => { this.getDicts("sys_normal_disable").then((response) => {
this.statusOptions = response.data; this.statusOptions = response.data;
}); });
}, },
methods: { methods: {
/** 查询考试题目列表 */ /** 查询考试题目列表 */
init_data (bankrow, row) { init_data(bankrow, row) {
this.bankData = bankrow this.bankData = bankrow;
if (row === null) { if (row === null) {
this.form.status = 0 this.form.status = 0;
this.form.bankCode = bankrow.bankCode this.form.bankCode = bankrow.bankCode;
this.form.questionsCode = newGuid() this.form.questionsCode = newGuid();
this.isNew = true this.isNew = true;
} else { } else {
this.form = row this.form = row;
this.isNew = false this.isNew = false;
this.queryParams.questionsCode = this.form.questionsCode this.queryParams.questionsCode = this.form.questionsCode;
this.getList() this.getList();
} }
}, },
// //
@ -231,245 +248,262 @@ export default {
questionsId: null, questionsId: null,
questionsCode: newGuid(), questionsCode: newGuid(),
questionsTitle: null, questionsTitle: null,
questionsType:null, questionsType: null,
questionsScore:null, questionsScore: null,
rateNumber:null, rateNumber: null,
rightAnswer:null, rightAnswer: null,
answerAnalyse:null, answerAnalyse: null,
status: 0, status: 0,
createDept:null createDept: null,
} };
this.resetForm("form"); this.resetForm("form");
}, },
/** 查询考试题目答案列表 */ /** 查询考试题目答案列表 */
getList() { getList() {
listAnswer(this.queryParams).then(response => { listAnswer(this.queryParams).then((response) => {
this.answerList = response.rows; this.answerList = response.rows;
this.showData() this.showData();
this.getContent() this.getContent();
}); });
}, },
showData () { showData() {
if (this.form.questionsType === 1 || this.form.questionsType === 2) { if (this.form.questionsType === 1 || this.form.questionsType === 2) {
// //
this.isRadio = true this.isRadio = true;
this.radioValue = this.form.rightAnswer this.radioValue = this.form.rightAnswer;
} else if (this.form.questionsType === 3) { } else if (this.form.questionsType === 3) {
this.isRadio = false this.isRadio = false;
this.checkItem = this.form.rightAnswer.split(",") this.checkItem = this.form.rightAnswer.split(",");
} }
}, },
getContent() { getContent() {
getQuestionscontent(this.form.questionsCode).then(response => { getQuestionscontent(this.form.questionsCode).then((response) => {
this.textValue = response.data.questionsContent this.textValue = response.data.questionsContent;
}); });
},
onClose () {
this.$emit('refreshData')
}, },
checkData () { onClose() {
if (this.form.questionsType === undefined || this.form.questionsType === null) { this.$emit("refreshData");
this.$message.error('未选择题目类型') },
return false checkData() {
if (
this.form.questionsType === undefined ||
this.form.questionsType === null
) {
this.$message.error("未选择题目类型");
return false;
} }
if (this.Ueditor.getContentTxt() === null || this.Ueditor.getContentTxt() === '') { if (
this.$message.error('未输入试题题目') this.Ueditor.getContentTxt() === null ||
return false this.Ueditor.getContentTxt() === ""
) {
this.$message.error("未输入试题题目");
return false;
} }
this.form.questionsTitle = this.Ueditor.getContentTxt() this.form.questionsTitle = this.Ueditor.getContentTxt();
this.form.questionsContent = this.textValue this.form.questionsContent = this.textValue;
if (this.form.questionsScore === undefined || this.form.questionsScore === null || this.form.questionsScore <= 0) { if (
this.$message.error('题目分数不能为零') this.form.questionsScore === undefined ||
return false this.form.questionsScore === null ||
this.form.questionsScore <= 0
) {
this.$message.error("题目分数不能为零");
return false;
} }
if (this.form.rateNumber === 0) { if (this.form.rateNumber === 0) {
this.$message.error('复杂度需要维护') this.$message.error("复杂度需要维护");
return false return false;
} }
// //
for (let i = 0; i < this.answerList.length; i ++) { for (let i = 0; i < this.answerList.length; i++) {
if (this.answerList[i].optionDescribe === null) { if (this.answerList[i].optionDescribe === null) {
this.$message.error('题目选项描述不能为空') this.$message.error("题目选项描述不能为空");
return false return false;
} }
} }
// //
if (this.form.questionsType === 1 || this.form.questionsType === 2) { if (this.form.questionsType === 1 || this.form.questionsType === 2) {
// //
if (this.radioValue === null) { if (this.radioValue === null) {
this.$message.error('判断题或单选题答案必须选择') this.$message.error("判断题或单选题答案必须选择");
return false return false;
} }
} else if (this.form.questionsType === 3) { } else if (this.form.questionsType === 3) {
if (this.checkItem === [] || this.checkItem.length === 0) { if (this.checkItem === [] || this.checkItem.length === 0) {
this.$message.error('多选题答案必须选择') this.$message.error("多选题答案必须选择");
return false return false;
} }
} else { } else {
this.$message.error('系统不识别的题目类型') this.$message.error("系统不识别的题目类型");
return false return false;
} }
return true return true;
}, },
handleData () { handleData() {
if (this.form.questionsType === 1 || this.form.questionsType === 2) { if (this.form.questionsType === 1 || this.form.questionsType === 2) {
// //
this.form.rightAnswer = this.radioValue this.form.rightAnswer = this.radioValue;
for (let i = 0; i < this.answerList.length; i ++) { for (let i = 0; i < this.answerList.length; i++) {
if (this.answerList[i].optionCode === this.radioValue) { if (this.answerList[i].optionCode === this.radioValue) {
this.answerList[i].isRight = 0 this.answerList[i].isRight = 0;
break break;
} }
} }
} else if (this.form.questionsType === 3) { } else if (this.form.questionsType === 3) {
let count = 0 let count = 0;
for (let i = 0; i < this.checkItem.length; i ++) { for (let i = 0; i < this.checkItem.length; i++) {
for (let j = 0; j < this.answerList.length; j ++) { for (let j = 0; j < this.answerList.length; j++) {
if (this.checkItem[i] === this.answerList[j].optionCode) { if (this.checkItem[i] === this.answerList[j].optionCode) {
this.answerList[j].isRight = 0 this.answerList[j].isRight = 0;
count ++ count++;
} }
} }
} }
this.form.rightAnswer = '' this.form.rightAnswer = "";
for (let i = 0; i < this.answerList.length; i ++) { for (let i = 0; i < this.answerList.length; i++) {
if (this.answerList[i].isRight === 0) { if (this.answerList[i].isRight === 0) {
this.form.rightAnswer += this.answerList[i].optionCode this.form.rightAnswer += this.answerList[i].optionCode;
if (count > 1) { if (count > 1) {
this.form.rightAnswer += ',' this.form.rightAnswer += ",";
} }
count -- count--;
} }
} }
} }
}, },
handleSave () { handleSave() {
this.doSave(1) this.doSave(1);
}, },
handleSaveOrExit () { handleSaveOrExit() {
this.doSave(2) this.doSave(2);
}, },
doSave(type) { doSave(type) {
if (this.checkData()) { if (this.checkData()) {
this.handleData() this.handleData();
this.form.answerList = this.answerList this.form.answerList = this.answerList;
if (this.isNew) { if (this.isNew) {
addExamquestions(this.form).then(response => { addExamquestions(this.form).then((response) => {
this.msgSuccess("保存成功"); this.msgSuccess("保存成功");
}); });
console.log('清除数据') console.log("清除数据");
} else { } else {
updateExamquestions(this.form).then(response => { updateExamquestions(this.form).then((response) => {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
}); });
} }
} }
}, },
onChoice (choice) { onChoice(choice) {
if (choice === 1) {
if (choice === 1 ) { if (
if (this.bankData.judgeScore !== undefined && this.bankData.judgeScore !== null ) { this.bankData.judgeScore !== undefined &&
this.form.questionsScore = this.bankData.judgeScore this.bankData.judgeScore !== null
this.choiceText = '判断题选项' ) {
this.choiceNumber = 1 this.form.questionsScore = this.bankData.judgeScore;
this.init_Table() this.choiceText = "判断题选项";
this.isRadio = true this.choiceNumber = 1;
this.init_Table();
this.isRadio = true;
} }
} else if (choice === 2) { } else if (choice === 2) {
// //
if (this.bankData.radioScore !== undefined && this.bankData.radioScore !== null ) { if (
this.form.questionsScore = this.bankData.radioScore this.bankData.radioScore !== undefined &&
this.choiceText = '单选题选项' this.bankData.radioScore !== null
this.choiceNumber = 2 ) {
this.init_Table() this.form.questionsScore = this.bankData.radioScore;
this.isRadio = true this.choiceText = "单选题选项";
this.choiceNumber = 2;
this.init_Table();
this.isRadio = true;
} }
} else { } else {
// //
if (this.bankData.choiceScore !== undefined && this.bankData.choiceScore !== null ) { if (
this.form.questionsScore = this.bankData.choiceScore this.bankData.choiceScore !== undefined &&
this.choiceText = '多选题选项' this.bankData.choiceScore !== null
this.choiceNumber = 3 ) {
this.init_Table() this.form.questionsScore = this.bankData.choiceScore;
this.isRadio = false this.choiceText = "多选题选项";
} this.choiceNumber = 3;
} this.init_Table();
}, this.isRadio = false;
init_Table () { }
this.answerList = []
const answerData = {
questionsCode : this.form.questionsCode,
orderId: 1,
optionCode: 'A',
isRight: 1,
optionDescribe: null
} }
},
init_Table() {
this.answerList = [];
const answerData = {
questionsCode: this.form.questionsCode,
orderId: 1,
optionCode: "A",
isRight: 1,
optionDescribe: null,
};
this.answerList.push(answerData) this.answerList.push(answerData);
const answerData1 = { const answerData1 = {
questionsCode : this.form.questionsCode, questionsCode: this.form.questionsCode,
orderId: 2, orderId: 2,
optionCode: 'B', optionCode: "B",
isRight: 1, isRight: 1,
optionDescribe: null optionDescribe: null,
} };
this.answerList.push(answerData1) this.answerList.push(answerData1);
}, },
handleAdd () { handleAdd() {
if (this.answerList > 10) { if (this.answerList > 10) {
this.$message.error('题目选项不能超过10项') this.$message.error("题目选项不能超过10项");
return return;
} }
for (let i = 0; i < this.answerList.length; i ++) { for (let i = 0; i < this.answerList.length; i++) {
if (this.answerList[i].optionDescribe === null) { if (this.answerList[i].optionDescribe === null) {
this.$message.error('题目选项描述不能为空') this.$message.error("题目选项描述不能为空");
return return;
} }
} }
const answerData = { const answerData = {
questionsCode : this.form.questionsCode, questionsCode: this.form.questionsCode,
orderId: this.answerList.length + 1, orderId: this.answerList.length + 1,
optionCode: this.optionItem[this.answerList.length], optionCode: this.optionItem[this.answerList.length],
isRight: 1, isRight: 1,
optionDescribe: null optionDescribe: null,
} };
this.answerList.push(answerData) this.answerList.push(answerData);
}, },
handleDelete (row) { handleDelete(row) {
this.answerList.splice(this.answerList.indexOf(row), 1) this.answerList.splice(this.answerList.indexOf(row), 1);
this.resetOption() this.resetOption();
}, },
resetOption () { resetOption() {
for (let i = 0; i < this.answerList.length; i ++) { for (let i = 0; i < this.answerList.length; i++) {
this.answerList[i].orderId = i + 1 this.answerList[i].orderId = i + 1;
this.answerList[i].isRight = 1 this.answerList[i].isRight = 1;
this.answerList[i].optionCode = this.optionItem[i] this.answerList[i].optionCode = this.optionItem[i];
} }
}, },
onEditorReady (editor) { onEditorReady(editor) {
this.Ueditor = editor this.Ueditor = editor;
} },
} },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.form-panel { .form-panel {
margin: 20px 0px 20px 15px; margin: 20px 0px 20px 15px;
} }
.rate-area { .rate-area {
@ -477,37 +511,36 @@ export default {
} }
.table-panel { .table-panel {
margin: 0px 0px 20px 0px; margin: 0px 0px 20px 0px;
} }
.option-title { .option-title {
text-align: right; text-align: right;
vertical-align: middle; vertical-align: middle;
float: left; float: left;
font-size: 14px; font-size: 14px;
color: #606266; color: #606266;
font-weight:bold; font-weight: bold;
line-height: 18px; line-height: 18px;
padding: 0 0 10px 10px; padding: 0 0 10px 10px;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
} }
.ueditor-title { .ueditor-title {
font-size: 14px; font-size: 14px;
color: #606266; color: #606266;
font-weight:bold; font-weight: bold;
line-height: 18px; line-height: 18px;
padding: 0 0 10px 0px; padding: 0 0 10px 0px;
} }
.ueditor-area { .ueditor-area {
margin: 0px 0px 10px 0px; margin: 0px 0px 10px 0px;
} }
.star-text { .star-text {
color: #ff4949; color: #ff4949;
margin-right: 4px; margin-right: 4px;
} }
</style> </style>

View File

@ -1,126 +1,94 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div v-if="editVisible"> <div v-if="editVisible">
<el-row :gutter="20"> <el-row :gutter="20">
<!--部门数据--> <!--部门数据-->
<el-col :span="4" :xs="24"> <el-col :span="4" :xs="24">
<div class="head-container"> <div class="head-container">
<el-input <el-input v-model="typeName" placeholder="请输入类型名称" clearable size="small" prefix-icon="el-icon-search"
v-model="typeName" style="margin-bottom: 20px" />
placeholder="请输入类型名称" </div>
clearable <div class="head-container">
size="small" <el-tree :data="examtypeList" :props="defaultProps" :expand-on-click-node="false"
prefix-icon="el-icon-search" :filter-node-method="filterNode" ref="tree" default-expand-all @node-click="handleNodeClick" />
style="margin-bottom: 20px" </div>
/> </el-col>
</div> <!--用户数据-->
<div class="head-container"> <el-col :span="20" :xs="24">
<el-tree <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
:data="examtypeList" <el-form-item label="题库名称" prop="bankName">
:props="defaultProps" <el-input v-model="queryParams.bankName" placeholder="请输入题库名称" clearable size="small"
:expand-on-click-node="false" @keyup.enter.native="handleQuery" />
:filter-node-method="filterNode" </el-form-item>
ref="tree" <el-form-item>
default-expand-all <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
@node-click="handleNodeClick" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
/> </el-form-item>
</div> </el-form>
</el-col> <div class="banklist">
<!--用户数据--> <div>
<el-col :span="20" :xs="24"> <ul style="padding: 0">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <li style="list-style-type:none;" v-for="(item, index) in questionsbankList" :key="index"
<el-form-item label="题库名称" prop="bankName"> class="new border-1px">
<el-input <el-row :gutter="20" :key="index" v-if='index % 2 == 0'>
v-model="queryParams.bankName" <el-col :span="12">
placeholder="请输入题库名称" <div class="bank-panel">
clearable <div class="photo-area">
size="small" <img class="title-photo" :src="hosturl + item.pictureUrl" />
@keyup.enter.native="handleQuery" </div>
/> <div class="describe-area">
</el-form-item> <div class="title-area">
<el-form-item> <div class="name-text">{{ item.bankName }}</div>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <div class="type-text">{{ item.typeName }}</div>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <div class="nickname-text">{{ item.createBy }}</div>
</el-form-item> </div>
</el-form> <div class="data-area">
<div class="banklist"> <div class="memo-text">判断题:{{ item.judgeNumber }} 单选题:{{ item.radioNumber }}
<div > 多选题:{{ item.choiceNumber }}</div>
<ul style="padding: 0"> <div class="button-area">
<li style = "list-style-type:none;" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(item)"
v-for="(item,index) in questionsbankList" v-hasPermi="['questions:questionsbank:edit']">编辑</el-button>
:key="index" </div>
class="new border-1px" </div>
>
<el-row :gutter="20" :key="index" v-if='index % 2 == 0'>
<el-col :span="12" >
<div class="bank-panel">
<div class = "photo-area">
<img class ="title-photo" :src="hosturl + item.pictureUrl"/>
</div>
<div class = "describe-area">
<div class = "title-area">
<div class="name-text">{{item.bankName}}</div>
<div class="type-text">{{item.typeName}}</div>
<div class = "nickname-text">{{item.createBy}}</div>
</div>
<div class = "data-area">
<div class= "memo-text" >判断题:{{item.judgeNumber}} 单选题:{{item.radioNumber}} 多选题:{{item.choiceNumber}}</div>
<div class = "button-area">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleEdit(item)"
v-hasPermi="['questions:questionsbank:edit']"
>编辑</el-button>
</div>
</div>
</div>
</div>
</el-col>
<el-col :span="12" v-if="index + 1 < questionsbankList.length" >
<div class="bank-panel">
<div class = "photo-area">
<img class ="title-photo" :src="hosturl + questionsbankList[index + 1].pictureUrl"/>
</div>
<div class = "describe-area">
<div class = "title-area">
<div class="name-text">{{questionsbankList[index + 1].bankName}}</div>
<div class="type-text">{{questionsbankList[index + 1].typeName}}</div>
<div class = "nickname-text">{{questionsbankList[index + 1].createBy}}</div>
</div>
<div class = "data-area">
<div class= "memo-text" >判断题:{{questionsbankList[index + 1].judgeNumber}} 单选题:{{questionsbankList[index + 1].radioNumber}} 多选题:{{questionsbankList[index + 1].choiceNumber}}</div>
<div class = "button-area">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleEdit(questionsbankList[index + 1])"
v-hasPermi="['questions:questionsbank:edit']"
>编辑</el-button>
</div> </div>
</div> </div>
</div> </el-col>
</div> <el-col :span="12" v-if="index + 1 < questionsbankList.length">
</el-col> <div class="bank-panel">
</el-row> <div class="photo-area">
</li> <img class="title-photo" :src="hosturl + questionsbankList[index + 1].pictureUrl" />
</ul> </div>
<div class="describe-area">
<div class="title-area">
<div class="name-text">{{ questionsbankList[index + 1].bankName }}</div>
<div class="type-text">{{ questionsbankList[index + 1].typeName }}</div>
<div class="nickname-text">{{ questionsbankList[index + 1].createBy }}</div>
</div>
<div class="data-area">
<div class="memo-text">判断题:{{ questionsbankList[index + 1].judgeNumber }}
单选题:{{ questionsbankList[index + 1].radioNumber }} 多选题:{{ questionsbankList[index +
1].choiceNumber}}</div>
<div class="button-area">
<el-button size="mini" type="text" icon="el-icon-edit"
@click="handleEdit(questionsbankList[index + 1])"
v-hasPermi="['questions:questionsbank:edit']">编辑</el-button>
</div>
</div>
</div>
</div>
</el-col>
</el-row>
</li>
</ul>
</div>
</div> </div>
</div> <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
<pagination :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total>0" </el-col>
:total="total" </el-row>
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
</div> </div>
<div v-else > <div v-else>
<questions-list ref="listRef" @refreshDataList="listDoneHandle"></questions-list> <questions-list ref="listRef" @refreshDataList="listDoneHandle"></questions-list>
</div> </div>
@ -140,7 +108,7 @@ export default {
components: { components: {
Treeselect, Treeselect,
QuestionsList QuestionsList
}, },
data() { data() {
return { return {
// //
@ -246,7 +214,7 @@ export default {
handleNodeClick(data) { handleNodeClick(data) {
this.queryParams.examType = data.id; this.queryParams.examType = data.id;
this.getList(); this.getList();
}, },
/** 查询部门下拉树结构 */ /** 查询部门下拉树结构 */
getTypeTreeselect() { getTypeTreeselect() {
typeTreeSelect().then(response => { typeTreeSelect().then(response => {
@ -264,7 +232,7 @@ export default {
children: node.children children: node.children
}; };
}, },
/** 查询考试分类下拉树结构 */ /** 查询考试分类下拉树结构 */
getTreeselect() { getTreeselect() {
listExamtype().then(response => { listExamtype().then(response => {
this.examtypeOptions = []; this.examtypeOptions = [];
@ -272,7 +240,7 @@ export default {
data.children = this.handleTree(response.data, "typeId", "parentId"); data.children = this.handleTree(response.data, "typeId", "parentId");
this.examtypeOptions.push(data); this.examtypeOptions.push(data);
}); });
}, },
// //
statusFormat(row, column) { statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status); return this.selectDictLabel(this.statusOptions, row.status);
@ -316,16 +284,16 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.bankCode) this.ids = selection.map(item => item.bankCode)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
handleEdit (row) { handleEdit(row) {
this.editVisible = false this.editVisible = false
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.listRef.init_data(row) this.$refs.listRef.init_data(row)
}) })
}, },
listDoneHandle () { listDoneHandle() {
this.editVisible = true this.editVisible = true
this.getList(); this.getList();
}, },
@ -334,104 +302,103 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.el-form-item {
.el-form-item { margin-bottom: -1px;
margin-bottom: -1px;
}
.bank-panel {
margin: 0px 0px 12px 0px;
padding: 8px 0px 1px 0px;
display: -webkit-box;
display: flex;
-webkit-align-items: center;
align-items: center;
background-color: #f7f7f7;
}
.photo-area {
-webkit-box-align: left;
margin-left: 0 px;
}
.title-photo {
margin-left: 0.6rem;
width: 6.25rem;
height: 5rem;
}
.describe-area {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-align: justify;
-webkit-align-items: center;
align-items: center;
padding-left: 0.8rem;
}
.title-area {
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: left;
margin: 2px 0px 10px 0px;
padding: -5px 0px 0px 0px;
} }
.name-text { .bank-panel {
-webkit-box-flex: 5; margin: 0px 0px 12px 0px;
-webkit-box-align: left; padding: 8px 0px 1px 0px;
font-size: 1.2 rem; display: -webkit-box;
font-weight: bold; display: flex;
} -webkit-align-items: center;
align-items: center;
background-color: #f7f7f7;
}
.type-text{ .photo-area {
-webkit-box-flex: 1; -webkit-box-align: left;
-webkit-box-align: center; margin-left: 0 px;
font-size: 13px; }
align-items: center;
text-align: center;
margin: 0px 10px 0px 10px;
color: #fff;
border: 1px solid #7acc9b;
background-color: #7acc9b;
border-radius: 6px;
}
.nickname-text{ .title-photo {
-webkit-box-flex: 1; margin-left: 0.6rem;
-webkit-box-align: right; width: 6.25rem;
font-size: 13 px; height: 5rem;
color: #8c939d; }
}
.data-area { .describe-area {
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: horizontal; -webkit-box-orient: vertical;
-webkit-align-items: center; -webkit-box-align: justify;
align-items: center; -webkit-align-items: center;
margin-top: 0.6rem; align-items: center;
overflow: hidden; padding-left: 0.8rem;
white-space: nowrap; }
text-overflow: ellipsis;
}
.memo-text {
-webkit-box-flex: 6;
-webkit-box-align: center;
font-size: 12px;
color: #8c939d;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} .title-area {
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: left;
margin: 2px 0px 10px 0px;
padding: -5px 0px 0px 0px;
}
.button-area { .name-text {
overflow: hidden; -webkit-box-flex: 5;
text-align: right; -webkit-box-align: left;
vertical-align: middle; font-size: 1.2 rem;
/* align-items: right; */ font-weight: bold;
} }
.type-text {
-webkit-box-flex: 1;
-webkit-box-align: center;
font-size: 13px;
align-items: center;
text-align: center;
margin: 0px 10px 0px 10px;
color: #fff;
border: 1px solid #7acc9b;
background-color: #7acc9b;
border-radius: 6px;
}
.nickname-text {
-webkit-box-flex: 1;
-webkit-box-align: right;
font-size: 13 px;
color: #8c939d;
}
.data-area {
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-align-items: center;
align-items: center;
margin-top: 0.6rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.memo-text {
-webkit-box-flex: 6;
-webkit-box-align: center;
font-size: 12px;
color: #8c939d;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.button-area {
overflow: hidden;
text-align: right;
vertical-align: middle;
/* align-items: right; */
}
</style> </style>

View File

@ -1,126 +1,75 @@
<template> <template>
<div> <div>
<div v-if="editVisible"> <div v-if="editVisible">
<div style ="margin-left: 15px"> <div style="margin-left: 15px">
<el-button <el-button @click="onClose" plain icon="el-icon-s-home" size="mini">返回</el-button>
@click="onClose" </div>
plain
icon="el-icon-s-home" <div class="form-panel">
size="mini" <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
>返回</el-button> <el-form-item label="试题题目" prop="questionsTitle">
<el-input v-model="queryParams.questionsTitle" placeholder="请输入试题题目" clearable size="small"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="试题类型" prop="questionsType">
<el-select v-model="queryParams.questionsType" placeholder="请选择试题类型" clearable size="small">
<el-option v-for="dict in questionsTypeOptions" :key="dict.dictValue" :label="dict.dictLabel"
:value="dict.dictValue" />
</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>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['questions:examquestions:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['questions:examquestions:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" :loading="exportLoading"
@click="handleExport" v-hasPermi="['questions:examquestions:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="examquestionsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width="60" align="center" prop="rownum" />
<el-table-column label="试题题目" align="center" prop="questionsTitle" />
<el-table-column label="试题类型" width="80" align="center" prop="questionsType"
:formatter="questionsTypeFormat" />
<el-table-column label="分数" width="60" align="center" prop="questionsScore" />
<el-table-column label="复杂度" width="150" align="center">
<template slot-scope="scope">
<el-rate v-model="scope.row.rateNumber" disabled text-color="#ff9900">
</el-rate>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['questions:examquestions:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['questions:examquestions:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</div> </div>
<div v-else>
<div class="form-panel"> <exam-questions ref="editRef" @refreshData="editDoneHandle"></exam-questions>
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="试题题目" prop="questionsTitle">
<el-input
v-model="queryParams.questionsTitle"
placeholder="请输入试题题目"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="试题类型" prop="questionsType">
<el-select v-model="queryParams.questionsType" placeholder="请选择试题类型" clearable size="small">
<el-option
v-for="dict in questionsTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</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>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['questions:examquestions:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['questions:examquestions:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['questions:examquestions:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="examquestionsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width = "60" align="center" prop="rownum" />
<el-table-column label="试题题目" align="center" prop="questionsTitle" />
<el-table-column label="试题类型" width = "80" align="center" prop="questionsType" :formatter="questionsTypeFormat" />
<el-table-column label="分数" width = "60" align="center" prop="questionsScore" />
<el-table-column label="复杂度" width = "150" align="center" >
<template slot-scope="scope">
<el-rate
v-model="scope.row.rateNumber"
disabled
text-color="#ff9900">
</el-rate>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width = "100" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['questions:examquestions:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['questions:examquestions:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</div> </div>
<div v-else >
<exam-questions ref="editRef" @refreshData="editDoneHandle"></exam-questions>
</div>
</div>
</template> </template>
@ -133,7 +82,7 @@ export default {
name: "Questionslist", name: "Questionslist",
components: { components: {
ExamQuestions ExamQuestions
}, },
data() { data() {
return { return {
// //
@ -168,10 +117,10 @@ export default {
questionsContentOptions: [], questionsContentOptions: [],
// //
questionsTypeOptions: [ questionsTypeOptions: [
{dictValue: 1, dictLabel: '判断题'}, { dictValue: 1, dictLabel: '判断题' },
{dictValue: 2, dictLabel: '单选题'}, { dictValue: 2, dictLabel: '单选题' },
{dictValue: 3, dictLabel: '多选题'} { dictValue: 3, dictLabel: '多选题' }
], ],
// //
questionsScoreOptions: [], questionsScoreOptions: [],
// //
@ -213,11 +162,11 @@ export default {
}, },
methods: { methods: {
/** 查询考试题目列表 */ /** 查询考试题目列表 */
init_data (row) { init_data(row) {
this.bankData = row this.bankData = row
this.queryParams.bankCode = this.bankData.bankCode this.queryParams.bankCode = this.bankData.bankCode
this.getList() this.getList()
}, },
getList() { getList() {
this.loading = true; this.loading = true;
listQuestionsproperty(this.queryParams).then(response => { listQuestionsproperty(this.queryParams).then(response => {
@ -225,7 +174,7 @@ export default {
// console.log('this.examquestionsList:' + JSON.stringify(this.examquestionsList)) // console.log('this.examquestionsList:' + JSON.stringify(this.examquestionsList))
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, },
// id // id
questionsIdFormat(row, column) { questionsIdFormat(row, column) {
@ -316,10 +265,10 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.questionsCode) this.ids = selection.map(item => item.questionsCode)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
editDoneHandle () { editDoneHandle() {
this.editVisible = true this.editVisible = true
this.getList(); this.getList();
}, },
@ -327,15 +276,15 @@ export default {
handleAdd() { handleAdd() {
this.editVisible = false this.editVisible = false
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.editRef.init_data(this.bankData, null) this.$refs.editRef.init_data(this.bankData, null)
}) })
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.editVisible = false this.editVisible = false
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.editRef.init_data(this.bankData, row) this.$refs.editRef.init_data(this.bankData, row)
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
@ -361,34 +310,34 @@ export default {
handleDelete(row) { handleDelete(row) {
const questionsCodes = row.questionsCode || this.ids; const questionsCodes = row.questionsCode || this.ids;
this.$confirm('是否确认删除考试题目编号为"' + questionsCodes + '"的数据项?', "警告", { this.$confirm('是否确认删除考试题目编号为"' + questionsCodes + '"的数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(function() { }).then(function () {
return delExamquestions(questionsCodes); return delExamquestions(questionsCodes);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => { });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
this.$confirm('是否确认导出所有考试题目数据项?', "警告", { this.$confirm('是否确认导出所有考试题目数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportExamquestions(queryParams); return exportExamquestions(queryParams);
}).then(response => { }).then(response => {
this.download(response.msg); this.download(response.msg);
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => { });
}, },
onClose () { onClose() {
this.$emit('refreshDataList') this.$emit('refreshDataList')
} }
} }
}; };
</script> </script>
@ -396,7 +345,6 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.form-panel { .form-panel {
margin: 10px 0px 20px 15px; margin: 10px 0px 20px 15px;
} }
</style> </style>