框架升级
parent
2e0c93ceb7
commit
302de3c0f0
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.8.6</version>
|
||||
</parent>
|
||||
<!-- <groupId>com.hig</groupId> -->
|
||||
<artifactId>hig-application</artifactId>
|
||||
|
|
@ -11,35 +11,29 @@
|
|||
<description>应用扩展包</description>
|
||||
<properties>
|
||||
<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>
|
||||
<oracle.version>12.2.0.1.0</oracle.version>
|
||||
<druid.version>1.1.13</druid.version>
|
||||
<mybatis.version>2.1.1</mybatis.version>
|
||||
<gson.version>2.8.6</gson.version>
|
||||
<jasypt.version>3.0.2</jasypt.version>
|
||||
<druid.version>1.2.20</druid.version>
|
||||
<mybatis.version>2.3.2</mybatis.version>
|
||||
<gson.version>2.10.1</gson.version>
|
||||
<jasypt.version>3.0.5</jasypt.version>
|
||||
<quartz.version>2.3.2</quartz.version>
|
||||
<httpclient.version>4.5.10</httpclient.version>
|
||||
<httpmime.version>4.5.10</httpmime.version>
|
||||
<httpcore.version>4.4.12</httpcore.version>
|
||||
<commons-codec.version>1.9</commons-codec.version>
|
||||
<httpclient.version>4.5.14</httpclient.version>
|
||||
<httpmime.version>4.5.14</httpmime.version>
|
||||
<httpcore.version>4.4.16</httpcore.version>
|
||||
<commons-codec.version>1.15</commons-codec.version>
|
||||
<commons-logging.version>1.2</commons-logging.version>
|
||||
<commons-io.version>2.8.0</commons-io.version>
|
||||
<commons-lang3.version>3.4</commons-lang3.version>
|
||||
<commons-lang.version>3.4</commons-lang.version>
|
||||
<weixin-java-cp.version>4.1.0</weixin-java-cp.version>
|
||||
<commons-io.version>2.11.0</commons-io.version>
|
||||
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||
<commons-lang.version>3.12.0</commons-lang.version>
|
||||
<weixin-java-cp.version>4.5.0</weixin-java-cp.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>log4j-to-slf4j</artifactId>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- 发war包的时侯排除tomcat -->
|
||||
<dependency>
|
||||
|
|
@ -137,7 +131,7 @@
|
|||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.4.14</version>
|
||||
<version>1.4.20</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
|
||||
|
|
@ -177,7 +171,7 @@
|
|||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20210307</version>
|
||||
<version>20231013</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import com.hig.ueditor.define.State;
|
|||
|
||||
@RestController
|
||||
@RequestMapping("/ueditor")
|
||||
@CrossOrigin(allowCredentials = "true")
|
||||
@CrossOrigin(allowCredentials = "true", originPatterns = "*")
|
||||
public class UEditorController {
|
||||
@Autowired
|
||||
private UEditorUpload uEditorUpload;
|
||||
|
|
|
|||
|
|
@ -3,36 +3,30 @@
|
|||
<parent>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.8.6</version>
|
||||
</parent>
|
||||
<artifactId>hig-common</artifactId>
|
||||
<name>hig-common</name>
|
||||
<description>应用框架公用部分</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<fastjson.version>1.2.47</fastjson.version>
|
||||
<lombok.version>1.18.4</lombok.version>
|
||||
<gson.version>2.8.6</gson.version>
|
||||
<jasypt.version>3.0.2</jasypt.version>
|
||||
<httpclient.version>4.5.10</httpclient.version>
|
||||
<httpmime.version>4.5.10</httpmime.version>
|
||||
<httpcore.version>4.4.12</httpcore.version>
|
||||
<commons-codec.version>1.9</commons-codec.version>
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<lombok.version>1.18.30</lombok.version>
|
||||
<gson.version>2.10.1</gson.version>
|
||||
<jasypt.version>3.0.5</jasypt.version>
|
||||
<httpclient.version>4.5.14</httpclient.version>
|
||||
<httpmime.version>4.5.14</httpmime.version>
|
||||
<httpcore.version>4.4.16</httpcore.version>
|
||||
<commons-codec.version>1.15</commons-codec.version>
|
||||
<commons-logging.version>1.2</commons-logging.version>
|
||||
<commons-io.version>2.8.0</commons-io.version>
|
||||
<commons-lang3.version>3.4</commons-lang3.version>
|
||||
<commons-io.version>2.11.0</commons-io.version>
|
||||
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>log4j-to-slf4j</artifactId>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- 发war包的时侯排除tomcat -->
|
||||
<dependency>
|
||||
|
|
@ -101,7 +95,7 @@
|
|||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.4.14</version>
|
||||
<version>1.4.20</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
|
||||
|
|
@ -127,5 +121,9 @@
|
|||
<artifactId>commons-lang3</artifactId>
|
||||
<version>${commons-lang3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -6,34 +6,35 @@
|
|||
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.8.6</version>
|
||||
|
||||
<name>ruoyi</name>
|
||||
<url>http://www.ruoyi.vip</url>
|
||||
<description>新框架扩展应用</description>
|
||||
|
||||
<properties>
|
||||
<ruoyi.version>3.6.0</ruoyi.version>
|
||||
<ruoyi.version>3.8.6</ruoyi.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.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>
|
||||
<swagger.version>3.0.0</swagger.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> -->
|
||||
<pagehelper.boot.version>1.3.1</pagehelper.boot.version>
|
||||
<fastjson.version>1.2.76</fastjson.version>
|
||||
<oshi.version>5.7.5</oshi.version>
|
||||
<jna.version>5.8.0</jna.version>
|
||||
<commons.io.version>2.10.0</commons.io.version>
|
||||
<commons.fileupload.version>1.4</commons.fileupload.version>
|
||||
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<oshi.version>6.4.6</oshi.version>
|
||||
<jna.version>5.13.0</jna.version>
|
||||
<commons.io.version>2.11.0</commons.io.version>
|
||||
<commons.fileupload.version>1.5</commons.fileupload.version>
|
||||
<commons.collections.version>3.2.2</commons.collections.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<velocity.version>1.7</velocity.version>
|
||||
<poi.version>5.2.4</poi.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<jwt.version>0.9.1</jwt.version>
|
||||
<mysql.version>8.0.33</mysql.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
|
|
@ -44,7 +45,7 @@
|
|||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.2.13.RELEASE</version>
|
||||
<version>2.5.15</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
|
@ -140,14 +141,8 @@
|
|||
<!-- velocity代码生成使用模板 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>${velocity.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- collections工具类 -->
|
||||
|
|
@ -164,6 +159,13 @@
|
|||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- MySQL驱动 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Token生成与解析-->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
|
|
@ -256,7 +258,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
|
|
@ -270,7 +272,7 @@
|
|||
<repository>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
|
|
@ -281,7 +283,7 @@
|
|||
<pluginRepository>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.8.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.1.1.RELEASE</version>
|
||||
<version>2.5.15</version>
|
||||
<configuration>
|
||||
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
||||
</configuration>
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.4.0</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>examapi</warName>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ import java.io.UnsupportedEncodingException;
|
|||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
|
@ -29,6 +30,7 @@ import com.ruoyi.system.service.ISysMenuService;
|
|||
@RestController
|
||||
public class SysLoginController
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(SysLoginController.class);
|
||||
@Autowired
|
||||
private SysLoginService loginService;
|
||||
|
||||
|
|
@ -87,7 +89,7 @@ public class SysLoginController
|
|||
ajax.put("user", user);
|
||||
ajax.put("roles", roles);
|
||||
ajax.put("permissions", permissions);
|
||||
System.out.println("ajax:" + ajax.toString());
|
||||
log.debug("ajax:{}", ajax.toString());
|
||||
return ajax;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ spring:
|
|||
# host: localhost # Redis服务器地址
|
||||
host: 127.0.0.1
|
||||
port: 6379 # Redis服务器连接端口
|
||||
password: # Redis服务器连接密码(默认为空)
|
||||
password: 123456 # Redis服务器连接密码(默认为空)
|
||||
timeout: 20000 # 连接超时时间(毫秒)
|
||||
jedis:
|
||||
pool:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.8.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
@ -99,7 +99,6 @@
|
|||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
<version>1.5.22.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!-- pool 对象池 -->
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.8.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
@ -21,12 +21,6 @@
|
|||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>log4j-to-slf4j</artifactId>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot 拦截器 -->
|
||||
|
|
|
|||
|
|
@ -52,17 +52,20 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|||
@Bean
|
||||
public CorsFilter corsFilter()
|
||||
{
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
config.setAllowCredentials(true);
|
||||
// 设置访问源地址
|
||||
config.addAllowedOrigin("*");
|
||||
config.addAllowedOriginPattern("*");
|
||||
// 设置访问源请求头
|
||||
config.addAllowedHeader("*");
|
||||
// 设置访问源请求方法
|
||||
config.addAllowedMethod("*");
|
||||
// 对接口配置跨域设置
|
||||
// 有效期 1800秒
|
||||
config.setMaxAge(1800L);
|
||||
// 添加映射路径,拦截一切请求
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
source.registerCorsConfiguration("/**", config);
|
||||
// 返回新的CorsFilter
|
||||
return new CorsFilter(source);
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.8.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
<!--velocity代码生成使用模板 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- collections工具类 -->
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.generator.util;
|
|||
|
||||
import java.util.Properties;
|
||||
import org.apache.velocity.app.Velocity;
|
||||
import org.apache.velocity.runtime.RuntimeConstants;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
|
||||
/**
|
||||
|
|
@ -19,11 +20,10 @@ public class VelocityInitializer
|
|||
Properties p = new Properties();
|
||||
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(Velocity.OUTPUT_ENCODING, Constants.UTF8);
|
||||
p.setProperty(RuntimeConstants.INPUT_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.init(p);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.8.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,57 +1,57 @@
|
|||
package com.ruoyi.quartz.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||
import javax.sql.DataSource;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* 定时任务配置
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class ScheduleConfig
|
||||
{
|
||||
@Bean
|
||||
public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
|
||||
{
|
||||
SchedulerFactoryBean factory = new SchedulerFactoryBean();
|
||||
factory.setDataSource(dataSource);
|
||||
|
||||
// quartz参数
|
||||
Properties prop = new Properties();
|
||||
prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler");
|
||||
prop.put("org.quartz.scheduler.instanceId", "AUTO");
|
||||
// 线程池配置
|
||||
prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
|
||||
prop.put("org.quartz.threadPool.threadCount", "20");
|
||||
prop.put("org.quartz.threadPool.threadPriority", "5");
|
||||
// JobStore配置
|
||||
prop.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX");
|
||||
// 集群配置
|
||||
prop.put("org.quartz.jobStore.isClustered", "true");
|
||||
prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
|
||||
prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
|
||||
prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
|
||||
|
||||
// sqlserver 启用
|
||||
// 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.tablePrefix", "QRTZ_");
|
||||
factory.setQuartzProperties(prop);
|
||||
|
||||
factory.setSchedulerName("RuoyiScheduler");
|
||||
// 延时启动
|
||||
factory.setStartupDelay(1);
|
||||
factory.setApplicationContextSchedulerContextKey("applicationContextKey");
|
||||
// 可选,QuartzScheduler
|
||||
// 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
|
||||
factory.setOverwriteExistingJobs(true);
|
||||
// 设置自动启动,默认为true
|
||||
factory.setAutoStartup(true);
|
||||
|
||||
return factory;
|
||||
}
|
||||
}
|
||||
//package com.ruoyi.quartz.config;
|
||||
//
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||
//import javax.sql.DataSource;
|
||||
//import java.util.Properties;
|
||||
//
|
||||
///**
|
||||
// * 定时任务配置(单机部署建议删除此类和qrtz数据库表,默认走内存会最高效)
|
||||
// *
|
||||
// * @author ruoyi
|
||||
// */
|
||||
//@Configuration
|
||||
//public class ScheduleConfig
|
||||
//{
|
||||
// @Bean
|
||||
// public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
|
||||
// {
|
||||
// SchedulerFactoryBean factory = new SchedulerFactoryBean();
|
||||
// factory.setDataSource(dataSource);
|
||||
//
|
||||
// // quartz参数
|
||||
// Properties prop = new Properties();
|
||||
// prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler");
|
||||
// prop.put("org.quartz.scheduler.instanceId", "AUTO");
|
||||
// // 线程池配置
|
||||
// prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
|
||||
// prop.put("org.quartz.threadPool.threadCount", "20");
|
||||
// prop.put("org.quartz.threadPool.threadPriority", "5");
|
||||
// // JobStore配置
|
||||
// prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore");
|
||||
// // 集群配置
|
||||
// prop.put("org.quartz.jobStore.isClustered", "true");
|
||||
// prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
|
||||
// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
|
||||
// prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
|
||||
//
|
||||
// // sqlserver 启用
|
||||
// // 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.tablePrefix", "QRTZ_");
|
||||
//
|
||||
// factory.setQuartzProperties(prop);
|
||||
// factory.setSchedulerName("RuoyiScheduler");
|
||||
// // 延时启动
|
||||
// factory.setStartupDelay(1);
|
||||
// factory.setApplicationContextSchedulerContextKey("applicationContextKey");
|
||||
// // 可选,QuartzScheduler
|
||||
// // 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
|
||||
// factory.setOverwriteExistingJobs(true);
|
||||
// // 设置自动启动,默认为true
|
||||
// factory.setAutoStartup(true);
|
||||
//
|
||||
// return factory;
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.8.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,63 +1,46 @@
|
|||
<template>
|
||||
<div>
|
||||
<div style ="margin-left: 15px">
|
||||
<div style="margin-left: 15px">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@click="onClose"
|
||||
plain
|
||||
icon="el-icon-s-home"
|
||||
size="mini"
|
||||
>返回</el-button>
|
||||
<el-button @click="onClose" plain icon="el-icon-s-home" size="mini">返回</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleSave"
|
||||
>保存</el-button>
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" @click="handleSave">保存</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="form-panel">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="试题类型" prop="questionsType">
|
||||
<el-select v-model="form.questionsType" @change = "onChoice" placeholder="请选择试题类型">
|
||||
<el-option
|
||||
v-for="dict in questionsTypeOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
></el-option>
|
||||
<el-select v-model="form.questionsType" @change="onChoice" placeholder="请选择试题类型">
|
||||
<el-option v-for="dict in questionsTypeOptions" :key="dict.dictValue" :label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div class = "ueditor-area">
|
||||
<span class = "star-text">*</span>
|
||||
<span class= "ueditor-title">试题题目</span>
|
||||
<div class="ueditor-area">
|
||||
<span class="star-text">*</span>
|
||||
<span class="ueditor-title">试题题目</span>
|
||||
</div>
|
||||
<vue-ueditor-wrap v-model="textValue" :config="editConfig" @ready="onEditorReady" :destroy="true"></vue-ueditor-wrap>
|
||||
<br>
|
||||
<vue-ueditor-wrap v-model="textValue" :config="editConfig" @ready="onEditorReady"
|
||||
:destroy="true"></vue-ueditor-wrap>
|
||||
<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">
|
||||
<div class="rate-area">
|
||||
<el-rate 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 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 :data="answerList">
|
||||
<el-table-column label="选项" width="50px" align="center" prop="optionCode" />
|
||||
<el-table-column label="选项描述" align="center" prop="optionDescribe">
|
||||
<template slot-scope="scope">
|
||||
|
|
@ -66,42 +49,30 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if = "choiceNumber > 1 && answerList.indexOf(scope.row) === answerList.length - 1"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd()"
|
||||
>增加</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>
|
||||
<el-button v-if="
|
||||
choiceNumber > 1 &&
|
||||
answerList.indexOf(scope.row) === answerList.length - 1
|
||||
" size="mini" type="text" icon="el-icon-plus" @click="handleAdd()">增加</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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<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-radio-group v-model="radioValue">
|
||||
<el-radio
|
||||
v-for="item in answerList"
|
||||
:key="item.orderId"
|
||||
:label="item.optionCode"
|
||||
>{{item.optionCode}} 选项</el-radio>
|
||||
<el-radio v-for="item in answerList" :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 v-for="item in answerList" :key="item.orderId" :label="item.optionCode">{{ item.optionCode }}
|
||||
选项</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
|
@ -110,11 +81,9 @@
|
|||
</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 v-for="dict in statusOptions" :key="dict.dictValue" :label="parseInt(dict.dictValue)">{{
|
||||
dict.dictLabel
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
|
@ -123,16 +92,37 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import VueUeditorWrap from 'vue-ueditor-wrap'
|
||||
import { baseApiUrl, uiUrl } from '@/config/sysinfo'
|
||||
import { newS4Guid, newGuid } from '@/utils/guidtool'
|
||||
import { listExamquestions, 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";
|
||||
import VueUeditorWrap from "vue-ueditor-wrap";
|
||||
import { baseApiUrl, uiUrl } from "@/config/sysinfo";
|
||||
import { newS4Guid, newGuid } from "@/utils/guidtool";
|
||||
import {
|
||||
listExamquestions,
|
||||
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 {
|
||||
name: "Examquestions",
|
||||
components: { VueUeditorWrap},
|
||||
components: { VueUeditorWrap },
|
||||
data() {
|
||||
return {
|
||||
// 表单参数
|
||||
|
|
@ -140,9 +130,9 @@ export default {
|
|||
anylyseForm: {},
|
||||
// 试题类型字典
|
||||
questionsTypeOptions: [
|
||||
{dictValue: 1, dictLabel: '判断题'},
|
||||
{dictValue: 2, dictLabel: '单选题'},
|
||||
{dictValue: 3, dictLabel: '多选题'}
|
||||
{ dictValue: 1, dictLabel: "判断题" },
|
||||
{ dictValue: 2, dictLabel: "单选题" },
|
||||
{ dictValue: 3, dictLabel: "多选题" },
|
||||
],
|
||||
// 状态字典
|
||||
statusOptions: [],
|
||||
|
|
@ -150,19 +140,19 @@ export default {
|
|||
questionsData: {},
|
||||
rules: {
|
||||
questionsTitle: [
|
||||
{ required: true, message: "试题题目不能为空", trigger: "blur" }
|
||||
{ required: true, message: "试题题目不能为空", trigger: "blur" },
|
||||
],
|
||||
questionsType: [
|
||||
{ required: true, message: "试题类型不能为空", trigger: "change" }
|
||||
{ required: true, message: "试题类型不能为空", trigger: "change" },
|
||||
],
|
||||
questionsScore: [
|
||||
{ required: true, message: "题目分数不能为空", trigger: "blur" }
|
||||
{ required: true, message: "题目分数不能为空", trigger: "blur" },
|
||||
],
|
||||
rateNumber: [
|
||||
{ required: true, message: "复杂度不能为空", trigger: "blur" }
|
||||
{ required: true, message: "复杂度不能为空", trigger: "blur" },
|
||||
],
|
||||
rightAnswer: [
|
||||
{ required: true, message: "正确答案不能为空", trigger: "blur" }
|
||||
{ required: true, message: "正确答案不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
// 考试题目答案表格数据
|
||||
|
|
@ -173,8 +163,35 @@ export default {
|
|||
single: 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'],
|
||||
choiceText: '题目选项',
|
||||
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",
|
||||
],
|
||||
choiceText: "题目选项",
|
||||
choiceNumber: 0,
|
||||
isRadio: true,
|
||||
radioValue: null,
|
||||
|
|
@ -186,11 +203,11 @@ export default {
|
|||
// 初始容器高度
|
||||
initialFrameHeight: 200,
|
||||
// 初始容器宽度
|
||||
initialFrameWidth: '100%',
|
||||
initialFrameWidth: "100%",
|
||||
// 上传文件接口(这个地址是我为了方便各位体验文件上传功能搭建的临时接口,请勿在生产环境使用!!!)
|
||||
serverUrl: baseApiUrl + '/ueditor/config',
|
||||
serverUrl: baseApiUrl + "/ueditor/config",
|
||||
// UEditor 资源文件的存放路径,如果你使用的是 vue-cli 生成的项目,通常不需要设置该选项,vue-ueditor-wrap 会自动处理常见的情况,如果需要特殊配置,参考下方的常见问题2
|
||||
UEDITOR_HOME_URL: '/examui/UEditor/'
|
||||
UEDITOR_HOME_URL: "/examui/UEditor/",
|
||||
},
|
||||
Ueditor: null,
|
||||
isNew: false,
|
||||
|
|
@ -201,27 +218,27 @@ export default {
|
|||
questionsCode: null,
|
||||
optionDescribe: null,
|
||||
},
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getDicts("sys_normal_disable").then(response => {
|
||||
this.getDicts("sys_normal_disable").then((response) => {
|
||||
this.statusOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询考试题目列表 */
|
||||
init_data (bankrow, row) {
|
||||
this.bankData = bankrow
|
||||
init_data(bankrow, row) {
|
||||
this.bankData = bankrow;
|
||||
if (row === null) {
|
||||
this.form.status = 0
|
||||
this.form.bankCode = bankrow.bankCode
|
||||
this.form.questionsCode = newGuid()
|
||||
this.isNew = true
|
||||
this.form.status = 0;
|
||||
this.form.bankCode = bankrow.bankCode;
|
||||
this.form.questionsCode = newGuid();
|
||||
this.isNew = true;
|
||||
} else {
|
||||
this.form = row
|
||||
this.isNew = false
|
||||
this.queryParams.questionsCode = this.form.questionsCode
|
||||
this.getList()
|
||||
this.form = row;
|
||||
this.isNew = false;
|
||||
this.queryParams.questionsCode = this.form.questionsCode;
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
// 表单重置
|
||||
|
|
@ -231,69 +248,79 @@ export default {
|
|||
questionsId: null,
|
||||
questionsCode: newGuid(),
|
||||
questionsTitle: null,
|
||||
questionsType:null,
|
||||
questionsScore:null,
|
||||
rateNumber:null,
|
||||
rightAnswer:null,
|
||||
answerAnalyse:null,
|
||||
questionsType: null,
|
||||
questionsScore: null,
|
||||
rateNumber: null,
|
||||
rightAnswer: null,
|
||||
answerAnalyse: null,
|
||||
status: 0,
|
||||
createDept:null
|
||||
}
|
||||
createDept: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 查询考试题目答案列表 */
|
||||
getList() {
|
||||
listAnswer(this.queryParams).then(response => {
|
||||
listAnswer(this.queryParams).then((response) => {
|
||||
this.answerList = response.rows;
|
||||
this.showData()
|
||||
this.getContent()
|
||||
this.showData();
|
||||
this.getContent();
|
||||
});
|
||||
},
|
||||
showData () {
|
||||
showData() {
|
||||
if (this.form.questionsType === 1 || this.form.questionsType === 2) {
|
||||
// 是判断题或者说是选择题
|
||||
this.isRadio = true
|
||||
this.radioValue = this.form.rightAnswer
|
||||
this.isRadio = true;
|
||||
this.radioValue = this.form.rightAnswer;
|
||||
} else if (this.form.questionsType === 3) {
|
||||
this.isRadio = false
|
||||
this.checkItem = this.form.rightAnswer.split(",")
|
||||
this.isRadio = false;
|
||||
this.checkItem = this.form.rightAnswer.split(",");
|
||||
}
|
||||
},
|
||||
getContent() {
|
||||
getQuestionscontent(this.form.questionsCode).then(response => {
|
||||
this.textValue = response.data.questionsContent
|
||||
getQuestionscontent(this.form.questionsCode).then((response) => {
|
||||
this.textValue = response.data.questionsContent;
|
||||
});
|
||||
},
|
||||
onClose () {
|
||||
this.$emit('refreshData')
|
||||
onClose() {
|
||||
this.$emit("refreshData");
|
||||
},
|
||||
checkData () {
|
||||
if (this.form.questionsType === undefined || this.form.questionsType === null) {
|
||||
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() === '') {
|
||||
this.$message.error('未输入试题题目')
|
||||
return false
|
||||
if (
|
||||
this.Ueditor.getContentTxt() === null ||
|
||||
this.Ueditor.getContentTxt() === ""
|
||||
) {
|
||||
this.$message.error("未输入试题题目");
|
||||
return false;
|
||||
}
|
||||
this.form.questionsTitle = this.Ueditor.getContentTxt()
|
||||
this.form.questionsContent = this.textValue
|
||||
if (this.form.questionsScore === undefined || this.form.questionsScore === null || this.form.questionsScore <= 0) {
|
||||
this.$message.error('题目分数不能为零')
|
||||
return false
|
||||
this.form.questionsTitle = this.Ueditor.getContentTxt();
|
||||
this.form.questionsContent = this.textValue;
|
||||
if (
|
||||
this.form.questionsScore === undefined ||
|
||||
this.form.questionsScore === null ||
|
||||
this.form.questionsScore <= 0
|
||||
) {
|
||||
this.$message.error("题目分数不能为零");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.form.rateNumber === 0) {
|
||||
this.$message.error('复杂度需要维护')
|
||||
return false
|
||||
this.$message.error("复杂度需要维护");
|
||||
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) {
|
||||
this.$message.error('题目选项描述不能为空')
|
||||
return false
|
||||
this.$message.error("题目选项描述不能为空");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -301,169 +328,176 @@ export default {
|
|||
if (this.form.questionsType === 1 || this.form.questionsType === 2) {
|
||||
// 是判断题或者说是选择题
|
||||
if (this.radioValue === null) {
|
||||
this.$message.error('判断题或单选题答案必须选择')
|
||||
return false
|
||||
this.$message.error("判断题或单选题答案必须选择");
|
||||
return false;
|
||||
}
|
||||
} else if (this.form.questionsType === 3) {
|
||||
if (this.checkItem === [] || this.checkItem.length === 0) {
|
||||
this.$message.error('多选题答案必须选择')
|
||||
return false
|
||||
this.$message.error("多选题答案必须选择");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
this.$message.error('系统不识别的题目类型')
|
||||
return false
|
||||
this.$message.error("系统不识别的题目类型");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true
|
||||
return true;
|
||||
},
|
||||
handleData () {
|
||||
handleData() {
|
||||
if (this.form.questionsType === 1 || this.form.questionsType === 2) {
|
||||
// 是判断题或者说是选择题
|
||||
|
||||
this.form.rightAnswer = this.radioValue
|
||||
for (let i = 0; i < this.answerList.length; i ++) {
|
||||
this.form.rightAnswer = this.radioValue;
|
||||
for (let i = 0; i < this.answerList.length; i++) {
|
||||
if (this.answerList[i].optionCode === this.radioValue) {
|
||||
this.answerList[i].isRight = 0
|
||||
break
|
||||
this.answerList[i].isRight = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (this.form.questionsType === 3) {
|
||||
let count = 0
|
||||
for (let i = 0; i < this.checkItem.length; i ++) {
|
||||
for (let j = 0; j < this.answerList.length; j ++) {
|
||||
let count = 0;
|
||||
for (let i = 0; i < this.checkItem.length; i++) {
|
||||
for (let j = 0; j < this.answerList.length; j++) {
|
||||
if (this.checkItem[i] === this.answerList[j].optionCode) {
|
||||
this.answerList[j].isRight = 0
|
||||
count ++
|
||||
this.answerList[j].isRight = 0;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.form.rightAnswer = ''
|
||||
for (let i = 0; i < this.answerList.length; i ++) {
|
||||
this.form.rightAnswer = "";
|
||||
for (let i = 0; i < this.answerList.length; i++) {
|
||||
if (this.answerList[i].isRight === 0) {
|
||||
this.form.rightAnswer += this.answerList[i].optionCode
|
||||
this.form.rightAnswer += this.answerList[i].optionCode;
|
||||
|
||||
if (count > 1) {
|
||||
this.form.rightAnswer += ','
|
||||
this.form.rightAnswer += ",";
|
||||
}
|
||||
count --
|
||||
count--;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleSave () {
|
||||
this.doSave(1)
|
||||
handleSave() {
|
||||
this.doSave(1);
|
||||
},
|
||||
handleSaveOrExit () {
|
||||
this.doSave(2)
|
||||
handleSaveOrExit() {
|
||||
this.doSave(2);
|
||||
},
|
||||
doSave(type) {
|
||||
if (this.checkData()) {
|
||||
this.handleData()
|
||||
this.form.answerList = this.answerList
|
||||
this.handleData();
|
||||
this.form.answerList = this.answerList;
|
||||
if (this.isNew) {
|
||||
addExamquestions(this.form).then(response => {
|
||||
addExamquestions(this.form).then((response) => {
|
||||
this.msgSuccess("保存成功");
|
||||
});
|
||||
console.log('清除数据')
|
||||
console.log("清除数据");
|
||||
} else {
|
||||
updateExamquestions(this.form).then(response => {
|
||||
updateExamquestions(this.form).then((response) => {
|
||||
this.msgSuccess("修改成功");
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onChoice (choice) {
|
||||
|
||||
if (choice === 1 ) {
|
||||
if (this.bankData.judgeScore !== undefined && this.bankData.judgeScore !== null ) {
|
||||
this.form.questionsScore = this.bankData.judgeScore
|
||||
this.choiceText = '判断题选项'
|
||||
this.choiceNumber = 1
|
||||
this.init_Table()
|
||||
this.isRadio = true
|
||||
onChoice(choice) {
|
||||
if (choice === 1) {
|
||||
if (
|
||||
this.bankData.judgeScore !== undefined &&
|
||||
this.bankData.judgeScore !== null
|
||||
) {
|
||||
this.form.questionsScore = this.bankData.judgeScore;
|
||||
this.choiceText = "判断题选项";
|
||||
this.choiceNumber = 1;
|
||||
this.init_Table();
|
||||
this.isRadio = true;
|
||||
}
|
||||
} else if (choice === 2) {
|
||||
// 是单选题
|
||||
if (this.bankData.radioScore !== undefined && this.bankData.radioScore !== null ) {
|
||||
this.form.questionsScore = this.bankData.radioScore
|
||||
this.choiceText = '单选题选项'
|
||||
this.choiceNumber = 2
|
||||
this.init_Table()
|
||||
this.isRadio = true
|
||||
if (
|
||||
this.bankData.radioScore !== undefined &&
|
||||
this.bankData.radioScore !== null
|
||||
) {
|
||||
this.form.questionsScore = this.bankData.radioScore;
|
||||
this.choiceText = "单选题选项";
|
||||
this.choiceNumber = 2;
|
||||
this.init_Table();
|
||||
this.isRadio = true;
|
||||
}
|
||||
} else {
|
||||
// 是多选题
|
||||
if (this.bankData.choiceScore !== undefined && this.bankData.choiceScore !== null ) {
|
||||
this.form.questionsScore = this.bankData.choiceScore
|
||||
this.choiceText = '多选题选项'
|
||||
this.choiceNumber = 3
|
||||
this.init_Table()
|
||||
this.isRadio = false
|
||||
if (
|
||||
this.bankData.choiceScore !== undefined &&
|
||||
this.bankData.choiceScore !== null
|
||||
) {
|
||||
this.form.questionsScore = this.bankData.choiceScore;
|
||||
this.choiceText = "多选题选项";
|
||||
this.choiceNumber = 3;
|
||||
this.init_Table();
|
||||
this.isRadio = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
init_Table () {
|
||||
this.answerList = []
|
||||
init_Table() {
|
||||
this.answerList = [];
|
||||
const answerData = {
|
||||
questionsCode : this.form.questionsCode,
|
||||
questionsCode: this.form.questionsCode,
|
||||
orderId: 1,
|
||||
optionCode: 'A',
|
||||
optionCode: "A",
|
||||
isRight: 1,
|
||||
optionDescribe: null
|
||||
}
|
||||
optionDescribe: null,
|
||||
};
|
||||
|
||||
this.answerList.push(answerData)
|
||||
this.answerList.push(answerData);
|
||||
|
||||
const answerData1 = {
|
||||
questionsCode : this.form.questionsCode,
|
||||
questionsCode: this.form.questionsCode,
|
||||
orderId: 2,
|
||||
optionCode: 'B',
|
||||
optionCode: "B",
|
||||
isRight: 1,
|
||||
optionDescribe: null
|
||||
}
|
||||
optionDescribe: null,
|
||||
};
|
||||
|
||||
this.answerList.push(answerData1)
|
||||
this.answerList.push(answerData1);
|
||||
},
|
||||
handleAdd () {
|
||||
handleAdd() {
|
||||
if (this.answerList > 10) {
|
||||
this.$message.error('题目选项不能超过10项')
|
||||
return
|
||||
this.$message.error("题目选项不能超过10项");
|
||||
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) {
|
||||
this.$message.error('题目选项描述不能为空')
|
||||
return
|
||||
this.$message.error("题目选项描述不能为空");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const answerData = {
|
||||
questionsCode : this.form.questionsCode,
|
||||
questionsCode: this.form.questionsCode,
|
||||
orderId: this.answerList.length + 1,
|
||||
optionCode: this.optionItem[this.answerList.length],
|
||||
isRight: 1,
|
||||
optionDescribe: null
|
||||
}
|
||||
|
||||
this.answerList.push(answerData)
|
||||
optionDescribe: null,
|
||||
};
|
||||
|
||||
this.answerList.push(answerData);
|
||||
},
|
||||
handleDelete (row) {
|
||||
this.answerList.splice(this.answerList.indexOf(row), 1)
|
||||
this.resetOption()
|
||||
handleDelete(row) {
|
||||
this.answerList.splice(this.answerList.indexOf(row), 1);
|
||||
this.resetOption();
|
||||
},
|
||||
resetOption () {
|
||||
for (let i = 0; i < this.answerList.length; i ++) {
|
||||
this.answerList[i].orderId = i + 1
|
||||
this.answerList[i].isRight = 1
|
||||
this.answerList[i].optionCode = this.optionItem[i]
|
||||
resetOption() {
|
||||
for (let i = 0; i < this.answerList.length; i++) {
|
||||
this.answerList[i].orderId = i + 1;
|
||||
this.answerList[i].isRight = 1;
|
||||
this.answerList[i].optionCode = this.optionItem[i];
|
||||
}
|
||||
},
|
||||
onEditorReady (editor) {
|
||||
this.Ueditor = editor
|
||||
}
|
||||
}
|
||||
onEditorReady(editor) {
|
||||
this.Ueditor = editor;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
@ -486,18 +520,17 @@ export default {
|
|||
float: left;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
font-weight:bold;
|
||||
font-weight: bold;
|
||||
line-height: 18px;
|
||||
padding: 0 0 10px 10px;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
.ueditor-title {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
font-weight:bold;
|
||||
font-weight: bold;
|
||||
line-height: 18px;
|
||||
padding: 0 0 10px 0px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,38 +5,20 @@
|
|||
<!--部门数据-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="typeName"
|
||||
placeholder="请输入类型名称"
|
||||
clearable
|
||||
size="small"
|
||||
prefix-icon="el-icon-search"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
<el-input v-model="typeName" placeholder="请输入类型名称" clearable size="small" prefix-icon="el-icon-search"
|
||||
style="margin-bottom: 20px" />
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="examtypeList"
|
||||
:props="defaultProps"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree"
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
<el-tree :data="examtypeList" :props="defaultProps" :expand-on-click-node="false"
|
||||
:filter-node-method="filterNode" ref="tree" default-expand-all @node-click="handleNodeClick" />
|
||||
</div>
|
||||
</el-col>
|
||||
<!--用户数据-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="题库名称" prop="bankName">
|
||||
<el-input
|
||||
v-model="queryParams.bankName"
|
||||
placeholder="请输入题库名称"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.bankName" placeholder="请输入题库名称" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
|
@ -44,61 +26,52 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="banklist">
|
||||
<div >
|
||||
<div>
|
||||
<ul style="padding: 0">
|
||||
<li style = "list-style-type:none;"
|
||||
v-for="(item,index) in questionsbankList"
|
||||
:key="index"
|
||||
class="new border-1px"
|
||||
>
|
||||
<li style="list-style-type:none;" v-for="(item, index) in questionsbankList" :key="index"
|
||||
class="new border-1px">
|
||||
<el-row :gutter="20" :key="index" v-if='index % 2 == 0'>
|
||||
<el-col :span="12" >
|
||||
<el-col :span="12">
|
||||
<div class="bank-panel">
|
||||
<div class = "photo-area">
|
||||
<img class ="title-photo" :src="hosturl + item.pictureUrl"/>
|
||||
<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 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 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" >
|
||||
<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 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 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"
|
||||
<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>
|
||||
v-hasPermi="['questions:questionsbank:edit']">编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -109,17 +82,12 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div v-else >
|
||||
<div v-else>
|
||||
<questions-list ref="listRef" @refreshDataList="listDoneHandle"></questions-list>
|
||||
</div>
|
||||
|
||||
|
|
@ -316,16 +284,16 @@ export default {
|
|||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.bankCode)
|
||||
this.single = selection.length!==1
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleEdit (row) {
|
||||
handleEdit(row) {
|
||||
this.editVisible = false
|
||||
this.$nextTick(() => {
|
||||
this.$refs.listRef.init_data(row)
|
||||
})
|
||||
},
|
||||
listDoneHandle () {
|
||||
listDoneHandle() {
|
||||
this.editVisible = true
|
||||
this.getList();
|
||||
},
|
||||
|
|
@ -334,12 +302,11 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
.el-form-item {
|
||||
.el-form-item {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
}
|
||||
|
||||
.bank-panel {
|
||||
.bank-panel {
|
||||
margin: 0px 0px 12px 0px;
|
||||
padding: 8px 0px 1px 0px;
|
||||
display: -webkit-box;
|
||||
|
|
@ -347,27 +314,27 @@ export default {
|
|||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
}
|
||||
|
||||
.photo-area {
|
||||
.photo-area {
|
||||
-webkit-box-align: left;
|
||||
margin-left: 0 px;
|
||||
}
|
||||
}
|
||||
|
||||
.title-photo {
|
||||
.title-photo {
|
||||
margin-left: 0.6rem;
|
||||
width: 6.25rem;
|
||||
height: 5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.describe-area {
|
||||
.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;
|
||||
|
|
@ -379,14 +346,14 @@ export default {
|
|||
padding: -5px 0px 0px 0px;
|
||||
}
|
||||
|
||||
.name-text {
|
||||
.name-text {
|
||||
-webkit-box-flex: 5;
|
||||
-webkit-box-align: left;
|
||||
font-size: 1.2 rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.type-text{
|
||||
.type-text {
|
||||
-webkit-box-flex: 1;
|
||||
-webkit-box-align: center;
|
||||
font-size: 13px;
|
||||
|
|
@ -397,16 +364,16 @@ export default {
|
|||
border: 1px solid #7acc9b;
|
||||
background-color: #7acc9b;
|
||||
border-radius: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.nickname-text{
|
||||
.nickname-text {
|
||||
-webkit-box-flex: 1;
|
||||
-webkit-box-align: right;
|
||||
font-size: 13 px;
|
||||
color: #8c939d;
|
||||
}
|
||||
}
|
||||
|
||||
.data-area {
|
||||
.data-area {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: horizontal;
|
||||
-webkit-align-items: center;
|
||||
|
|
@ -415,9 +382,9 @@ export default {
|
|||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
.memo-text {
|
||||
.memo-text {
|
||||
-webkit-box-flex: 6;
|
||||
-webkit-box-align: center;
|
||||
font-size: 12px;
|
||||
|
|
@ -426,12 +393,12 @@ export default {
|
|||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.button-area {
|
||||
.button-area {
|
||||
overflow: hidden;
|
||||
text-align: right;
|
||||
vertical-align: middle;
|
||||
/* align-items: right; */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,34 +1,20 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<div v-if="editVisible">
|
||||
<div style ="margin-left: 15px">
|
||||
<el-button
|
||||
@click="onClose"
|
||||
plain
|
||||
icon="el-icon-s-home"
|
||||
size="mini"
|
||||
>返回</el-button>
|
||||
<div style="margin-left: 15px">
|
||||
<el-button @click="onClose" plain icon="el-icon-s-home" size="mini">返回</el-button>
|
||||
</div>
|
||||
|
||||
<div class="form-panel">
|
||||
<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-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-option v-for="dict in questionsTypeOptions" :key="dict.dictValue" :label="dict.dictLabel"
|
||||
:value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
|
@ -39,88 +25,51 @@
|
|||
|
||||
<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-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-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-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="序号" 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" >
|
||||
<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 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">
|
||||
<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>
|
||||
<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"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-else >
|
||||
<div v-else>
|
||||
<exam-questions ref="editRef" @refreshData="editDoneHandle"></exam-questions>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
|
|
@ -168,9 +117,9 @@ export default {
|
|||
questionsContentOptions: [],
|
||||
// 试题类型字典
|
||||
questionsTypeOptions: [
|
||||
{dictValue: 1, dictLabel: '判断题'},
|
||||
{dictValue: 2, dictLabel: '单选题'},
|
||||
{dictValue: 3, dictLabel: '多选题'}
|
||||
{ dictValue: 1, dictLabel: '判断题' },
|
||||
{ dictValue: 2, dictLabel: '单选题' },
|
||||
{ dictValue: 3, dictLabel: '多选题' }
|
||||
],
|
||||
// 题目分数字典
|
||||
questionsScoreOptions: [],
|
||||
|
|
@ -213,7 +162,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
/** 查询考试题目列表 */
|
||||
init_data (row) {
|
||||
init_data(row) {
|
||||
this.bankData = row
|
||||
this.queryParams.bankCode = this.bankData.bankCode
|
||||
this.getList()
|
||||
|
|
@ -316,10 +265,10 @@ export default {
|
|||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.questionsCode)
|
||||
this.single = selection.length!==1
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
editDoneHandle () {
|
||||
editDoneHandle() {
|
||||
this.editVisible = true
|
||||
this.getList();
|
||||
},
|
||||
|
|
@ -364,12 +313,12 @@ export default {
|
|||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
}).then(function () {
|
||||
return delExamquestions(questionsCodes);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
|
@ -384,9 +333,9 @@ export default {
|
|||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
}).catch(() => { });
|
||||
},
|
||||
onClose () {
|
||||
onClose() {
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
}
|
||||
|
|
@ -399,4 +348,3 @@ export default {
|
|||
margin: 10px 0px 20px 15px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue