Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zhengyuan-danger-chemistry-manage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
zhengyuan-danger-chemistry-manage
Commits
cbc859c8
Commit
cbc859c8
authored
Jan 29, 2023
by
吴卿华
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
c96176e0
5e599d6e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
2546 additions
and
1089 deletions
+2546
-1089
pom.xml
danger-manage-admin/pom.xml
+7
-0
OutParkRecordsController.java
...eb/controller/entranceguard/OutParkRecordsController.java
+25
-0
Bx06Controller.java
...java/com/zehong/web/controller/system/Bx06Controller.java
+21
-6
SubscriptionEventController.java
.../controller/videomonitor/SubscriptionEventController.java
+12
-2
application-dev.yml
danger-manage-admin/src/main/resources/application-dev.yml
+15
-11
application-prd.yml
danger-manage-admin/src/main/resources/application-prd.yml
+13
-9
application-test.yml
danger-manage-admin/src/main/resources/application-test.yml
+23
-8
DataSourceType.java
...src/main/java/com/zehong/common/enums/DataSourceType.java
+2
-2
DruidConfig.java
...rc/main/java/com/zehong/framework/config/DruidConfig.java
+4
-4
SecurityConfig.java
...main/java/com/zehong/framework/config/SecurityConfig.java
+1
-1
TEntranceGuardPersonInfo.java
...va/com/zehong/system/domain/TEntranceGuardPersonInfo.java
+15
-1
Bx06Vo.java
...tem/src/main/java/com/zehong/system/domain/vo/Bx06Vo.java
+1
-1
OutParkRecordsMapper.java
...n/java/com/zehong/system/mapper/OutParkRecordsMapper.java
+39
-0
TEntranceGuardPersonInfoMapper.java
.../zehong/system/mapper/TEntranceGuardPersonInfoMapper.java
+5
-0
ITEntranceGuardPersonInfoService.java
...hong/system/service/ITEntranceGuardPersonInfoService.java
+2
-0
OutParkRecordsService.java
...java/com/zehong/system/service/OutParkRecordsService.java
+18
-0
OutParkRecordsServiceImpl.java
...zehong/system/service/impl/OutParkRecordsServiceImpl.java
+44
-0
TEntranceGuardPersonInfoServiceImpl.java
...tem/service/impl/TEntranceGuardPersonInfoServiceImpl.java
+140
-7
OutParkRecordsMapper.xml
.../main/resources/mapper/sqlserver/OutParkRecordsMapper.xml
+85
-0
TEntranceGuardPersonInfoMapper.xml
...esources/mapper/system/TEntranceGuardPersonInfoMapper.xml
+14
-1
lessonsProgram.js
...er-manage-web/src/api/educationPlanExam/lessonsProgram.js
+8
-1
entranceguardPerson.js
...r-manage-web/src/api/entranceguard/entranceguardPerson.js
+9
-0
permission.js
danger-manage-web/src/permission.js
+16
-1
AddQuestion.vue
...ucationPlanExam/lessonsProgram/components/AddQuestion.vue
+0
-1
ChangeQuestion.vue
...views/educationPlanExam/visitorProgram/ChangeQuestion.vue
+241
-0
index.vue
...-web/src/views/educationPlanExam/visitorProgram/index.vue
+160
-134
visitorAdd.vue
...src/views/educationPlanExam/visitorProgram/visitorAdd.vue
+307
-232
visitorQuestion.vue
...iews/educationPlanExam/visitorProgram/visitorQuestion.vue
+547
-336
index.vue
danger-manage-web/src/views/entrance/index.vue
+62
-57
index.vue
danger-manage-web/src/views/system/qRCode/index.vue
+17
-12
ExaminationQuestions.vue
...ws/visitorExam/Trainingmaterials/ExaminationQuestions.vue
+262
-235
AnswerLesson.vue
...visitorExam/Trainingmaterials/components/AnswerLesson.vue
+34
-5
GoodJob.vue
...iews/visitorExam/Trainingmaterials/components/GoodJob.vue
+10
-11
GoodJobOld.vue
...s/visitorExam/Trainingmaterials/components/GoodJobOld.vue
+74
-0
Question.vue
...ews/visitorExam/Trainingmaterials/components/Question.vue
+34
-8
QuestionChoice.vue
...sitorExam/Trainingmaterials/components/QuestionChoice.vue
+276
-0
index.vue
...age-web/src/views/visitorExam/Trainingmaterials/index.vue
+1
-1
vue.config.js
danger-manage-web/vue.config.js
+2
-2
No files found.
danger-manage-admin/pom.xml
View file @
cbc859c8
...
...
@@ -53,6 +53,13 @@
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<!--sqlserver驱动 -->
<dependency>
<groupId>
com.microsoft.sqlserver
</groupId>
<artifactId>
sqljdbc4
</artifactId>
<version>
4.0
</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>
com.zehong
</groupId>
...
...
danger-manage-admin/src/main/java/com/zehong/web/controller/entranceguard/OutParkRecordsController.java
0 → 100644
View file @
cbc859c8
package
com
.
zehong
.
web
.
controller
.
entranceguard
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.system.service.OutParkRecordsService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author geng
* 车辆统计信息
*/
@RestController
@RequestMapping
(
"/outParkRecords"
)
public
class
OutParkRecordsController
{
@Autowired
private
OutParkRecordsService
outParkRecordsService
;
@GetMapping
(
"/statisticsVehicles"
)
public
AjaxResult
statisticsVehicles
(){
return
AjaxResult
.
success
(
outParkRecordsService
.
statisticsVehicles
());
}
}
danger-manage-admin/src/main/java/com/zehong/web/controller/system/Bx06Controller.java
View file @
cbc859c8
...
...
@@ -2,23 +2,38 @@ package com.zehong.web.controller.system;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.system.domain.vo.Bx06Vo
;
import
com.zehong.system.service.ITEntranceGuardPersonInfoService
;
import
com.zehong.system.service.impl.LedserviceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@Api
(
"大屏推送"
)
@RestController
@RequestMapping
(
"bx"
)
public
class
Bx06Controller
{
@Autowired
private
ITEntranceGuardPersonInfoService
tEntranceGuardPersonInfoService
;
@ApiOperation
(
"测试推送"
)
@P
u
tMapping
(
"/send"
)
public
AjaxResult
send
(
Bx06Vo
bx06Vo
)
throws
Exception
@P
os
tMapping
(
"/send"
)
public
AjaxResult
send
(
@RequestBody
Bx06Vo
bx06Vo
)
throws
Exception
{
if
(
bx06Vo
.
getContents
()==
null
||
bx06Vo
.
getContents
().
length
<
1
){
return
AjaxResult
.
error
(
"请至少发送一行数据"
);
}
if
(
bx06Vo
.
getContents
().
length
>
6
){
return
AjaxResult
.
error
(
"最多一次发送6行数据"
);
}
LedserviceImpl
.
SendProgram
(
bx06Vo
);
return
AjaxResult
.
success
();
}
// @ApiOperation("测试推送2")
// @PostMapping("/testsend")
// public void testsend ()throws Exception
// {
// tEntranceGuardPersonInfoService.send2Led();
// }
}
danger-manage-admin/src/main/java/com/zehong/web/controller/videomonitor/SubscriptionEventController.java
View file @
cbc859c8
...
...
@@ -16,6 +16,7 @@ import com.zehong.web.uitls.ArtemisUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -110,6 +111,7 @@ public class SubscriptionEventController {
String
personNo
=
(
String
)
data
.
get
(
"ExtEventPersonNo"
);
//获取人员信息
String
extEventInOut
=
String
.
valueOf
(
data
.
get
(
"ExtEventInOut"
));
// System.out.println("====进出标志:"+extEventInOut);
ArtemisPerson
artemisPerson
=
new
ArtemisPerson
();
artemisPerson
.
setPageNo
(
1
);
artemisPerson
.
setPageSize
(
1000
);
...
...
@@ -138,12 +140,20 @@ public class SubscriptionEventController {
TEntranceGuardPersonInfo
tEntranceGuardPersonInfo
=
new
TEntranceGuardPersonInfo
();
tEntranceGuardPersonInfo
.
setPersonName
(
personName
);
tEntranceGuardPersonInfo
.
setPersonNum
((
String
)
list
.
get
(
0
).
get
(
"certificateNo"
));
if
(
"0"
.
equals
(
extEventInOut
)
||
"1"
.
equals
(
extEventInOut
)){
tEntranceGuardPersonInfo
.
setActionType
(
"0"
.
equals
(
extEventInOut
)
?
"1"
:
"0"
);
tEntranceGuardPersonInfo
.
setCatchPic
((
String
)
data
.
get
(
"ExtEventPictureURL"
));
// if("0".equals(extEventInOut) || "1".equals(extEventInOut)){
// tEntranceGuardPersonInfo.setActionType("0".equals(extEventInOut) ? "1" : "0");
// }
if
(
"1"
.
equals
(
extEventInOut
)){
tEntranceGuardPersonInfo
.
setActionType
(
"0"
);
}
else
if
(
"2"
.
equals
(
extEventInOut
)){
tEntranceGuardPersonInfo
.
setActionType
(
"1"
);
}
tEntranceGuardPersonInfo
.
setActionTime
(
happenTime
);
tEntranceGuardPersonInfoService
.
insertTEntranceGuardPersonInfo
(
tEntranceGuardPersonInfo
);
}
//发送到led屏
tEntranceGuardPersonInfoService
.
send2Led
();
}
/**
...
...
danger-manage-admin/src/main/resources/application-dev.yml
View file @
cbc859c8
...
...
@@ -17,20 +17,21 @@ server:
spring
:
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
driverClassName
:
com.mysql.cj.jdbc.Driver
druid
:
# 主库数据源
master
:
url
:
jdbc:mysql://36.138.181.113:33060/danger_manage_area_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
driverClassName
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://36.138.181.113:33060/danger_manage_area_a?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
root
password
:
zehong_/sjz!D
#
从库
数据源
s
lave
:
#
sqlserver
数据源
s
qlserver
:
# 从数据源开关/默认关闭
enabled
:
false
url
:
username
:
password
:
enabled
:
true
driver-class-name
:
com.microsoft.sqlserver.jdbc.SQLServerDriver
url
:
jdbc:sqlserver://218.207.92.101:1433;DatabaseName=Park_DB
username
:
sa
password
:
haosql
# 初始连接数
initialSize
:
5
# 最小连接池数量
...
...
@@ -46,7 +47,7 @@ spring:
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis
:
900000
# 配置检测连接是否有效
validationQuery
:
SELECT 1
FROM DUAL
validationQuery
:
SELECT 1
testWhileIdle
:
true
testOnBorrow
:
false
testOnReturn
:
false
...
...
@@ -75,11 +76,11 @@ spring:
# 地址
host
:
127.0.0.1
# 端口,默认为6379
port
:
637
9
port
:
637
8
# 数据库索引
database
:
1
# 密码
password
:
password
:
Redis@2021
# 连接超时时间
timeout
:
10s
lettuce
:
...
...
@@ -121,3 +122,6 @@ config:
detect-face-max-num
:
10
detect-face-scale-val
:
32
thread-pool-size
:
5
#门禁抓拍图片地址
entrance-guard-catch-pic-url
:
https://27.128.189.137:6113
\ No newline at end of file
danger-manage-admin/src/main/resources/application-prd.yml
View file @
cbc859c8
...
...
@@ -21,16 +21,17 @@ spring:
druid
:
# 主库数据源
master
:
url
:
jdbc:mysql://
localhost:3306/ry
?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://
36.138.181.113:33060/danger_manage_area_test
?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
root
password
:
root
#
从库
数据源
s
lave
:
password
:
zehong_/sjz!D
#
sqlserver
数据源
s
qlserver
:
# 从数据源开关/默认关闭
enabled
:
false
url
:
username
:
password
:
enabled
:
true
driver-class-name
:
com.microsoft.sqlserver.jdbc.SQLServerDriver
url
:
jdbc:sqlserver://218.207.92.101:1433;DatabaseName=Park_DB
username
:
sa
password
:
haosql
# 初始连接数
initialSize
:
5
# 最小连接池数量
...
...
@@ -46,7 +47,7 @@ spring:
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis
:
900000
# 配置检测连接是否有效
validationQuery
:
SELECT 1
FROM DUAL
validationQuery
:
SELECT 1
testWhileIdle
:
true
testOnBorrow
:
false
testOnReturn
:
false
...
...
@@ -122,3 +123,6 @@ config:
detect-face-max-num
:
10
detect-face-scale-val
:
32
thread-pool-size
:
5
#门禁抓拍图片地址
entrance-guard-catch-pic-url
:
https://27.128.189.137:6113
\ No newline at end of file
danger-manage-admin/src/main/resources/application-test.yml
View file @
cbc859c8
...
...
@@ -17,20 +17,21 @@ server:
spring
:
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
driverClassName
:
com.mysql.cj.jdbc.Driver
druid
:
# 主库数据源
master
:
driverClassName
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://36.138.181.113:3306/danger_manage_area_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
root
password
:
root@123
#
从库
数据源
s
lave
:
#
sqlserver
数据源
s
qlserver
:
# 从数据源开关/默认关闭
enabled
:
false
url
:
username
:
password
:
enabled
:
true
driver-class-name
:
com.microsoft.sqlserver.jdbc.SQLServerDriver
url
:
jdbc:sqlserver://218.207.92.101:1433;DatabaseName=Park_DB
username
:
sa
password
:
haosql
# 初始连接数
initialSize
:
5
# 最小连接池数量
...
...
@@ -46,7 +47,7 @@ spring:
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis
:
900000
# 配置检测连接是否有效
validationQuery
:
SELECT 1
FROM DUAL
validationQuery
:
SELECT 1
testWhileIdle
:
true
testOnBorrow
:
false
testOnReturn
:
false
...
...
@@ -110,3 +111,17 @@ zehong:
addressEnabled
:
false
# 验证码类型 math 数组计算 char 字符验证
captchaType
:
math
#虹软人脸识别配置(linux配置)
config
:
arcface-sdk
:
#算法引擎路径 示例(Windows配置\danger-manage-admin\arcsoft_lib\WIN64,Linux配置/arcsoft_lib/LINUX64)
sdk-lib-path
:
/arcsoft_lib/LINUX64
app-id
:
3ZM3ayaRriUPWzzy29QsqeynFcpmu9zMVXGjBrQ4rPkL
sdk-key
:
J1wqG4VVGJYLe5YYT2hQN3xHSqLEwrZJBBRQmuEXkZqc
detect-face-max-num
:
10
detect-face-scale-val
:
32
thread-pool-size
:
5
#门禁抓拍图片地址
entrance-guard-catch-pic-url
:
https://27.128.189.137:6113
\ No newline at end of file
danger-manage-common/src/main/java/com/zehong/common/enums/DataSourceType.java
View file @
cbc859c8
...
...
@@ -13,7 +13,7 @@ public enum DataSourceType
MASTER
,
/**
*
从
库
*
sqlserver数据
库
*/
S
LAVE
S
QL_SERVER
}
danger-manage-framework/src/main/java/com/zehong/framework/config/DruidConfig.java
View file @
cbc859c8
...
...
@@ -41,9 +41,9 @@ public class DruidConfig
}
@Bean
@ConfigurationProperties
(
"spring.datasource.druid.s
lave
"
)
@ConditionalOnProperty
(
prefix
=
"spring.datasource.druid.s
lave
"
,
name
=
"enabled"
,
havingValue
=
"true"
)
public
DataSource
s
lave
DataSource
(
DruidProperties
druidProperties
)
@ConfigurationProperties
(
"spring.datasource.druid.s
qlserver
"
)
@ConditionalOnProperty
(
prefix
=
"spring.datasource.druid.s
qlserver
"
,
name
=
"enabled"
,
havingValue
=
"true"
)
public
DataSource
s
qlServer
DataSource
(
DruidProperties
druidProperties
)
{
DruidDataSource
dataSource
=
DruidDataSourceBuilder
.
create
().
build
();
return
druidProperties
.
dataSource
(
dataSource
);
...
...
@@ -55,7 +55,7 @@ public class DruidConfig
{
Map
<
Object
,
Object
>
targetDataSources
=
new
HashMap
<>();
targetDataSources
.
put
(
DataSourceType
.
MASTER
.
name
(),
masterDataSource
);
setDataSource
(
targetDataSources
,
DataSourceType
.
S
LAVE
.
name
(),
"slave
DataSource"
);
setDataSource
(
targetDataSources
,
DataSourceType
.
S
QL_SERVER
.
name
(),
"sqlServer
DataSource"
);
return
new
DynamicDataSource
(
masterDataSource
,
targetDataSources
);
}
...
...
danger-manage-framework/src/main/java/com/zehong/framework/config/SecurityConfig.java
View file @
cbc859c8
...
...
@@ -98,7 +98,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.
authorizeRequests
()
// 对于登录login 验证码captchaImage 允许匿名访问
.
antMatchers
(
"/login"
,
"/captchaImage"
,
"/bx/send"
).
anonymous
()
.
antMatchers
(
"/login"
,
"/captchaImage"
,
"/bx/send"
,
"/bx/testsend"
).
anonymous
()
.
antMatchers
(
HttpMethod
.
GET
,
"/*.html"
,
...
...
danger-manage-system/src/main/java/com/zehong/system/domain/TEntranceGuardPersonInfo.java
View file @
cbc859c8
...
...
@@ -37,6 +37,10 @@ public class TEntranceGuardPersonInfo extends BaseEntity
@Excel
(
name
=
"进出场时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
actionTime
;
/** 抓拍图片 */
@Excel
(
name
=
"抓拍图片"
)
private
String
catchPic
;
/** 是否删除(0正常,1删除) */
@Excel
(
name
=
"是否删除(0正常,1删除)"
)
private
String
isDel
;
...
...
@@ -86,7 +90,16 @@ public class TEntranceGuardPersonInfo extends BaseEntity
{
return
actionTime
;
}
public
void
setIsDel
(
String
isDel
)
public
void
setCatchPic
(
String
catchPic
)
{
this
.
catchPic
=
catchPic
;
}
public
String
getCatchPic
()
{
return
catchPic
;
}
public
void
setIsDel
(
String
isDel
)
{
this
.
isDel
=
isDel
;
}
...
...
@@ -104,6 +117,7 @@ public class TEntranceGuardPersonInfo extends BaseEntity
.
append
(
"personNum"
,
getPersonNum
())
.
append
(
"actionType"
,
getActionType
())
.
append
(
"actionTime"
,
getActionTime
())
.
append
(
"catchPic"
,
getCatchPic
())
.
append
(
"createBy"
,
getCreateBy
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"updateBy"
,
getUpdateBy
())
...
...
danger-manage-system/src/main/java/com/zehong/system/domain/vo/Bx06Vo.java
View file @
cbc859c8
...
...
@@ -5,7 +5,7 @@ import lombok.Data;
@Data
public
class
Bx06Vo
{
private
String
[]
contents
;
private
String
content
=
"
柏坡正元欢迎您
"
;
private
String
content
=
""
;
private
Integer
width
=
192
;
private
Integer
height
=
96
;
private
Integer
colorType
=
1
;
...
...
danger-manage-system/src/main/java/com/zehong/system/mapper/OutParkRecordsMapper.java
0 → 100644
View file @
cbc859c8
package
com
.
zehong
.
system
.
mapper
;
import
com.zehong.common.annotation.DataSource
;
import
com.zehong.common.enums.DataSourceType
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author geng
* 车辆进出记录
*/
public
interface
OutParkRecordsMapper
{
/**
* 统计进出车辆数量
* @return 统计数
*/
List
<
Map
<
String
,
Object
>>
statisticsVehicleByActionType
();
/**
* 统计在场车辆数量
* @return 统计结果
*/
List
<
Map
<
String
,
Object
>>
statisticsStayInVehicles
();
/**
* 最新进场车辆记录
* @return 车辆信息
*/
Map
<
String
,
Object
>
lastImportData
();
/**
* 最新出场车辆记录
* @return 车辆信息
*/
Map
<
String
,
Object
>
lastExportData
();
}
danger-manage-system/src/main/java/com/zehong/system/mapper/TEntranceGuardPersonInfoMapper.java
View file @
cbc859c8
...
...
@@ -79,4 +79,9 @@ public interface TEntranceGuardPersonInfoMapper
*/
List
<
TEntranceGuardPersonInfo
>
lastImportAndExportData
();
/**
* 获取最近5条通过信息
* @return
*/
List
<
TEntranceGuardPersonInfo
>
lastImportOrExportData
();
}
danger-manage-system/src/main/java/com/zehong/system/service/ITEntranceGuardPersonInfoService.java
View file @
cbc859c8
...
...
@@ -65,4 +65,6 @@ public interface ITEntranceGuardPersonInfoService
* 二道门人员信息初始化
*/
Map
<
String
,
Object
>
getEntranceGuardPersonInfo
();
public
void
send2Led
();
}
danger-manage-system/src/main/java/com/zehong/system/service/OutParkRecordsService.java
0 → 100644
View file @
cbc859c8
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author geng
* 车辆进出记录
*/
public
interface
OutParkRecordsService
{
/**
* 统计进出及在场车辆数量
* @return 统计数
*/
Map
<
String
,
Object
>
statisticsVehicles
();
}
danger-manage-system/src/main/java/com/zehong/system/service/impl/OutParkRecordsServiceImpl.java
0 → 100644
View file @
cbc859c8
package
com
.
zehong
.
system
.
service
.
impl
;
import
com.zehong.common.annotation.DataSource
;
import
com.zehong.common.enums.DataSourceType
;
import
com.zehong.system.mapper.OutParkRecordsMapper
;
import
com.zehong.system.service.OutParkRecordsService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author geng
* 进出车辆统计
*/
@Service
public
class
OutParkRecordsServiceImpl
implements
OutParkRecordsService
{
@Resource
private
OutParkRecordsMapper
outParkRecordsMapper
;
@DataSource
(
DataSourceType
.
SQL_SERVER
)
@Override
public
Map
<
String
,
Object
>
statisticsVehicles
()
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
16
);
List
<
Map
<
String
,
Object
>>
exportAndImport
=
outParkRecordsMapper
.
statisticsVehicleByActionType
();
for
(
Map
info
:
exportAndImport
){
if
(
"0"
.
equals
(
info
.
get
(
"actionType"
))){
result
.
put
(
"importCount"
,
info
.
get
(
"counts"
));
}
if
(
"1"
.
equals
(
info
.
get
(
"actionType"
))){
result
.
put
(
"exportCount"
,
info
.
get
(
"counts"
));
}
}
List
<
Map
<
String
,
Object
>>
stayInCarsData
=
outParkRecordsMapper
.
statisticsStayInVehicles
();
result
.
put
(
"stayInCount"
,
stayInCarsData
.
size
());
result
.
put
(
"stayInCarsData"
,
stayInCarsData
);
result
.
put
(
"lastImportData"
,
outParkRecordsMapper
.
lastImportData
());
result
.
put
(
"lastExportData"
,
outParkRecordsMapper
.
lastExportData
());
return
result
;
}
}
danger-manage-system/src/main/java/com/zehong/system/service/impl/TEntranceGuardPersonInfoServiceImpl.java
View file @
cbc859c8
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zehong.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TEntranceGuardPersonInfoMapper
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.system.domain.TEntranceGuardPersonInfo
;
import
com.zehong.system.domain.vo.Bx06Vo
;
import
com.zehong.system.mapper.TEntranceGuardPersonInfoMapper
;
import
com.zehong.system.service.ITEntranceGuardPersonInfoService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.io.*
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 门禁人员信息Service业务层处理
...
...
@@ -23,6 +30,10 @@ public class TEntranceGuardPersonInfoServiceImpl implements ITEntranceGuardPerso
@Autowired
private
TEntranceGuardPersonInfoMapper
tEntranceGuardPersonInfoMapper
;
/**抓拍图片地址*/
@Value
(
"${entrance-guard-catch-pic-url}"
)
private
String
entranceGuardCatchPicUrl
;
/**
* 查询门禁人员信息
*
...
...
@@ -118,6 +129,9 @@ public class TEntranceGuardPersonInfoServiceImpl implements ITEntranceGuardPerso
//出入场最新数据
List
<
TEntranceGuardPersonInfo
>
lastImportAndExportData
=
tEntranceGuardPersonInfoMapper
.
lastImportAndExportData
();
for
(
TEntranceGuardPersonInfo
tEntranceGuardPersonInfo
:
lastImportAndExportData
){
if
(
StringUtils
.
isNotEmpty
(
tEntranceGuardPersonInfo
.
getCatchPic
())){
tEntranceGuardPersonInfo
.
setCatchPic
(
entranceGuardCatchPicUrl
+
tEntranceGuardPersonInfo
.
getCatchPic
());
}
if
(
"0"
.
equals
(
tEntranceGuardPersonInfo
.
getActionType
())){
result
.
put
(
"lastImportData"
,
tEntranceGuardPersonInfo
);
}
...
...
@@ -128,4 +142,123 @@ public class TEntranceGuardPersonInfoServiceImpl implements ITEntranceGuardPerso
return
result
;
}
/**
* 发送到Led大屏
*/
@Override
public
void
send2Led
()
{
String
[]
contents
=
new
String
[
6
];
contents
[
0
]=
" 石家庄柏坡正元化肥有限公司"
;
//查询场内人数
String
cnrs
=
tEntranceGuardPersonInfoMapper
.
statisticsStayInPersons
();
contents
[
1
]=
"企业人数:864人 厂内人数:"
+
cnrs
+
"人"
;
List
<
TEntranceGuardPersonInfo
>
lastImportOrExportData
=
tEntranceGuardPersonInfoMapper
.
lastImportOrExportData
();
int
i
=
0
;
String
crc
=
""
;
for
(
TEntranceGuardPersonInfo
tEntranceGuardPersonInfo
:
lastImportOrExportData
){
if
(
i
>
2
){
return
;
}
if
(
"0"
.
equals
(
tEntranceGuardPersonInfo
.
getActionType
())){
crc
=
"入"
;
}
else
if
(
"1"
.
equals
(
tEntranceGuardPersonInfo
.
getActionType
())){
crc
=
"出"
;
}
contents
[
i
+
2
]=
tEntranceGuardPersonInfo
.
getPersonName
()+
""
+
crc
+
""
+
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM_SS
,
tEntranceGuardPersonInfo
.
getActionTime
());
i
++;
}
contents
[
5
]=
" "
+
DateUtils
.
getDate
();
//展示当日日期
//执行发送
send
(
contents
);
}
private
void
send
(
String
[]
contents
){
System
.
out
.
println
(
"开始发送数据..."
);
String
pathUrl
=
"http://218.207.92.101:8908/dangerManage/bx/send"
;
// String pathUrl="http://127.0.0.1:8908/dangerManage/bx/send";
Bx06Vo
bv
=
new
Bx06Vo
();
bv
.
setContents
(
contents
);
//发送数据
doPostOrGet
(
pathUrl
,
JSONObject
.
toJSONString
(
bv
));
}
//发送数据
public
static
void
doPostOrGet
(
String
pathUrl
,
String
data
)
{
OutputStreamWriter
out
=
null
;
BufferedReader
br
=
null
;
String
result
=
""
;
try
{
URL
url
=
new
URL
(
pathUrl
);
//打开和url之间的连接
HttpURLConnection
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
//请求方式
conn
.
setRequestMethod
(
"POST"
);
//conn.setRequestMethod("GET");
//设置通用的请求属性
conn
.
setRequestProperty
(
"accept"
,
"*/*"
);
conn
.
setRequestProperty
(
"connection"
,
"Keep-Alive"
);
conn
.
setRequestProperty
(
"user-agent"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
);
conn
.
setRequestProperty
(
"Content-Type"
,
"application/json;charset=utf-8"
);
//DoOutput设置是否向httpUrlConnection输出,DoInput设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个
conn
.
setDoOutput
(
true
);
conn
.
setDoInput
(
true
);
/**
* 下面的三句代码,就是调用第三方http接口
*/
//获取URLConnection对象对应的输出流
out
=
new
OutputStreamWriter
(
conn
.
getOutputStream
(),
"UTF-8"
);
//发送请求参数即数据
out
.
write
(
data
);
//flush输出流的缓冲
out
.
flush
();
/**
* 下面的代码相当于,获取调用第三方http接口后返回的结果
*/
//获取URLConnection对象对应的输入流
InputStream
is
=
conn
.
getInputStream
();
//构造一个字符流缓存
br
=
new
BufferedReader
(
new
InputStreamReader
(
is
));
String
str
=
""
;
while
((
str
=
br
.
readLine
())
!=
null
)
{
result
+=
str
;
}
System
.
out
.
println
(
result
);
//关闭流
is
.
close
();
//断开连接,disconnect是在底层tcp socket链接空闲时才切断,如果正在被其他线程使用就不切断。
conn
.
disconnect
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
out
!=
null
)
{
out
.
close
();
}
if
(
br
!=
null
)
{
br
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
danger-manage-system/src/main/resources/mapper/sqlserver/OutParkRecordsMapper.xml
0 → 100644
View file @
cbc859c8
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.zehong.system.mapper.OutParkRecordsMapper"
>
<resultMap
id=
"statisticsVehicleByActionTypeResult"
type=
"HashMap"
>
<result
property=
"actionType"
column=
"action_type"
jdbcType=
"VARCHAR"
/>
<result
property=
"counts"
column=
"counts"
jdbcType=
"INTEGER"
/>
</resultMap>
<resultMap
id=
"statisticsImportVehicleResult"
type=
"HashMap"
>
<result
property=
"plateNumber"
column=
"plateNumber"
jdbcType=
"VARCHAR"
/>
<result
property=
"inParkTime"
column=
"InParkTime"
jdbcType=
"DATE"
/>
<result
property=
"cName"
column=
"cName"
jdbcType=
"VARCHAR"
/>
<result
property=
"inParkControlImageName"
column=
"InParkControlImageName"
jdbcType=
"VARCHAR"
/>
</resultMap>
<resultMap
id=
"statisticsExportVehicleResult"
type=
"HashMap"
>
<result
property=
"plateNumber"
column=
"plateNumber"
jdbcType=
"VARCHAR"
/>
<result
property=
"outParkTime"
column=
"OutParkTime"
jdbcType=
"DATE"
/>
<result
property=
"cName"
column=
"cName"
jdbcType=
"VARCHAR"
/>
<result
property=
"inParkControlImageName"
column=
"InParkControlImageName"
jdbcType=
"VARCHAR"
/>
</resultMap>
<select
id=
"statisticsVehicleByActionType"
resultMap=
"statisticsVehicleByActionTypeResult"
>
SELECT
'0' as action_type,
COUNT(id) as counts
FROM
Sys_Park_OutParkRecords
WHERE
InParkTime IS NOT NULL
UNION ALL
SELECT
'1' as action_type,
COUNT(id) as counts
FROM
Sys_Park_OutParkRecords
WHERE
OutParkTime IS NOT NULL
</select>
<select
id=
"statisticsStayInVehicles"
resultMap=
"statisticsImportVehicleResult"
>
SELECT
stay.plateNumber,
stay.InParkTime,
type.cName
FROM(
SELECT
plateNumber,
MAX(InParkTime) as InParkTime,
MAX(OutParkTime) as OutParkTime
FROM
Sys_Park_OutParkRecords
GROUP BY plateNumber
)stay
LEFT JOIN Sys_Park_OutParkRecords records ON stay.InParkTime = records.InParkTime AND stay.plateNumber = records.plateNumber
LEFT JOIN V_Park_PlateType type ON records.plateType = type.id
WHERE ISNULL(DATEDIFF(S, '1970-01-01 00:00:00', stay.InParkTime),0) - ISNULL(DATEDIFF(S, '1970-01-01 00:00:00', stay.OutParkTime),0) >0
</select>
<select
id=
"lastImportData"
resultMap=
"statisticsImportVehicleResult"
>
SELECT
TOP 1 records.plateNumber,records.InParkTime,type.cName,records.InParkControlImageName
FROM
Sys_Park_OutParkRecords records
LEFT JOIN V_Park_PlateType type ON records.plateType = type.id
WHERE
records.InParkTime IS NOT NULL
ORDER BY records.InParkTime DESC
</select>
<select
id=
"lastExportData"
resultMap=
"statisticsExportVehicleResult"
>
SELECT
TOP 1 records.plateNumber,records.OutParkTime,type.cName,records.InParkControlImageName
FROM
Sys_Park_OutParkRecords records
LEFT JOIN V_Park_PlateType type ON records.plateType = type.id
WHERE
records.OutParkTime IS NOT NULL
ORDER BY records.OutParkTime DESC
</select>
</mapper>
\ No newline at end of file
danger-manage-system/src/main/resources/mapper/system/TEntranceGuardPersonInfoMapper.xml
View file @
cbc859c8
...
...
@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"personNum"
column=
"person_num"
/>
<result
property=
"actionType"
column=
"action_type"
/>
<result
property=
"actionTime"
column=
"action_time"
/>
<result
property=
"catchPic"
column=
"catch_pic"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
...
...
@@ -24,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectTEntranceGuardPersonInfoVo"
>
select entrance_guard_person_id, person_name, person_num, action_type, action_time, create_by, create_time, update_by, update_time, is_del, remark from t_entrance_guard_person_info
select entrance_guard_person_id, person_name, person_num, action_type, action_time, c
atch_pic, c
reate_by, create_time, update_by, update_time, is_del, remark from t_entrance_guard_person_info
</sql>
<select
id=
"selectTEntranceGuardPersonInfoList"
parameterType=
"TEntranceGuardPersonInfo"
resultMap=
"TEntranceGuardPersonInfoResult"
>
...
...
@@ -34,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"personNum != null and personNum != ''"
>
and person_num = #{personNum}
</if>
<if
test=
"actionType != null and actionType != ''"
>
and action_type = #{actionType}
</if>
<if
test=
"actionTime != null "
>
and action_time = #{actionTime}
</if>
<if
test=
"catchPic != null and catchPic != ''"
>
and catch_pic = #{catchPic}
</if>
<if
test=
"isDel != null and isDel != ''"
>
and is_del = #{isDel}
</if>
</where>
</select>
...
...
@@ -50,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"personNum != null"
>
person_num,
</if>
<if
test=
"actionType != null"
>
action_type,
</if>
<if
test=
"actionTime != null"
>
action_time,
</if>
<if
test=
"catchPic != null"
>
catch_pic,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateBy != null"
>
update_by,
</if>
...
...
@@ -62,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"personNum != null"
>
#{personNum},
</if>
<if
test=
"actionType != null"
>
#{actionType},
</if>
<if
test=
"actionTime != null"
>
#{actionTime},
</if>
<if
test=
"catchPic != null"
>
#{catchPic},
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"updateBy != null"
>
#{updateBy},
</if>
...
...
@@ -78,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"personNum != null"
>
person_num = #{personNum},
</if>
<if
test=
"actionType != null"
>
action_type = #{actionType},
</if>
<if
test=
"actionTime != null"
>
action_time = #{actionTime},
</if>
<if
test=
"catchPic != null"
>
catch_pic = #{catchPic},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
...
...
@@ -162,4 +167,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY
present.action_type
</select>
<select
id=
"lastImportOrExportData"
resultMap=
"TEntranceGuardPersonInfoResult"
>
SELECT
DATE_FORMAT(action_time,'%Y-%m-%d %H:%i:%s') action_time,person_name,action_type
FROM
t_entrance_guard_person_info
ORDER BY action_time DESC LIMIT 3
</select>
</mapper>
\ No newline at end of file
danger-manage-web/src/api/educationPlanExam/lessonsProgram.js
View file @
cbc859c8
...
...
@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-23 11:02:24
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 202
2-12-28 09:57:4
7
* @LastEditTime: 202
3-01-29 14:53:0
7
* @FilePath: /danger-manage-web/src/api/educationPlanExam/trainingProgram.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -186,3 +186,10 @@ export function bachAddTopic(data) {
})
}
export
function
bachAddTopicGuest
(
data
)
{
return
request
({
url
:
'/contractTrainTopic/bachAddTopic'
,
method
:
'post'
,
data
:
data
})
}
danger-manage-web/src/api/entranceguard/entranceguardPerson.js
View file @
cbc859c8
...
...
@@ -59,3 +59,12 @@ export function exportInfo(query) {
params
:
query
})
}
//车辆统计信息
export
function
statisticsVehicles
(
query
)
{
return
request
({
url
:
'/outParkRecords/statisticsVehicles'
,
method
:
'get'
,
params
:
query
})
}
danger-manage-web/src/permission.js
View file @
cbc859c8
/*
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2023-01-03 15:13:41
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-16 09:19:38
* @FilePath: /danger-manage-web/src/permission.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
router
from
"./router"
;
import
store
from
"./store"
;
import
{
Message
}
from
"element-ui"
;
...
...
@@ -29,7 +37,14 @@ router.beforeEach((to, from, next) => {
console
.
log
(
accessRoutes
);
// 如果这个值是0,就不展示首页,展示最近的页面
if
(
store
.
getters
.
systemSetting
.
show_index
===
"0"
)
{
router
.
options
.
routes
[
4
].
children
[
0
].
hidden
=
true
;
// if(1){
// 过滤到首页的路由
const
origin
=
router
.
options
.
routes
.
find
(
item
=>
{
return
item
.
redirect
===
'index'
})
// 隐藏
origin
.
children
[
0
].
hidden
=
true
;
// 挑战
if
(
accessRoutes
[
0
].
children
)
{
next
({
...
accessRoutes
[
0
].
children
[
0
]
});
}
...
...
danger-manage-web/src/views/educationPlanExam/lessonsProgram/components/AddQuestion.vue
View file @
cbc859c8
...
...
@@ -276,7 +276,6 @@ export default {
// 新增选项
add
(
addValue
)
{
this
.
form
.
questions
.
push
({
value
:
addValue
});
console
.
log
();
},
save
(
num
=
2
)
{
return
new
Promise
((
resove
)
=>
{
...
...
danger-manage-web/src/views/educationPlanExam/visitorProgram/ChangeQuestion.vue
0 → 100644
View file @
cbc859c8
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-27 09:30:19
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-29 14:52:33
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangeQuestion.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<div
class=
"table-wrapper"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
>
<el-form-item
label=
"所属单位"
prop=
"deptId"
ref=
"treeItem"
>
<Treeselect
class=
"tree"
v-model=
"queryParams.deptId"
:options=
"deptOptions"
:show-count=
"true"
placeholder=
"请选择归属部门"
style=
"width: 200px"
/>
</el-form-item>
<el-form-item
label=
"题库名称"
prop=
"bankName"
>
<el-input
v-model=
"queryParams.bankName"
placeholder=
"考试时间"
clearable
size=
"small"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"search"
>
搜索
</el-button
>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetClick"
>
重置
</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading=
"loading"
:data=
"list"
height=
"435"
ref=
"multipleTable"
>
<!--
<el-table-column
type=
"selection"
></el-table-column>
-->
<el-table-column
label=
""
align=
"center"
prop=
"profession"
>
<template
v-slot=
"
{ row }">
<!--
<div>
-->
<el-checkbox
:disabled=
"row.numberQuestions == 0"
v-model=
"row.checked"
></el-checkbox>
<!--
</div>
-->
</
template
>
</el-table-column>
<el-table-column
label=
"题库名称"
align=
"center"
prop=
"bankName"
>
</el-table-column>
<el-table-column
label=
"所属单位"
align=
"center"
prop=
"courseType"
>
<
template
v-slot=
"scope"
>
<div>
{{
selectList
(
deptOptions
,
scope
.
row
.
deptId
)
||
"-"
}}
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"包含题目数量"
align=
"center"
prop=
"numberQuestions"
:formatter=
"formatter"
>
</el-table-column>
<el-table-column
label=
"选取题目数量"
align=
"center"
prop=
"profession"
>
<
template
v-slot=
"{ row }"
>
<div>
<!--
<el-input
:disabled=
"!row.checked|| row.numberQuestions==0 "
v-model=
"row.changeNum"
size=
"mini"
style=
"width: 100px"
></el-input>
-->
<el-input-number
v-model=
"row.changeNum"
:disabled=
"!row.checked || row.numberQuestions == 0"
size=
"mini"
:min=
"1"
:max=
"+row.numberQuestions ? +row.numberQuestions : 1000000"
label=
"描述文字"
></el-input-number>
</div>
</
template
>
</el-table-column>
</el-table>
<!-- <div> -->
<el-pagination
:layout=
"'prev, pager, next'"
v-show=
"total > 0"
:total=
"total"
:current-page=
"queryParams.pageNum"
:page-sizes=
"[queryParams.pageSize]"
@
current-change=
"currentChangeClick"
/>
</div>
</template>
<
script
>
import
{
listBank
,
delBank
}
from
"@/api/educationPlanExam/questionBank"
;
import
{
bachAddTopicGuest
}
from
"@/api/educationPlanExam/lessonsProgram.js"
;
// 部门列表
import
{
treeselect
}
from
"@/api/system/dept"
;
import
Treeselect
from
"@riophae/vue-treeselect"
;
import
"@riophae/vue-treeselect/dist/vue-treeselect.css"
;
export
default
{
name
:
""
,
components
:
{
Treeselect
,
},
props
:
{
courseId
:
{
type
:
Number
,
},
},
data
()
{
return
{
queryParams
:
{
deptId
:
null
,
courseName
:
""
,
pageNum
:
1
,
pageSize
:
10
,
},
list
:
[
{
checked
:
false
,
},
],
total
:
20
,
loading
:
false
,
// 题库id
deptId
:
null
,
// 归属部门列表
deptOptions
:
[],
};
},
created
()
{
this
.
getList
();
this
.
getTreeselect
();
},
methods
:
{
getTreeselect
()
{
treeselect
().
then
((
response
)
=>
{
this
.
deptOptions
=
response
.
data
;
// console.log("123", this.deptOptions);
// console.log(this.selectList(this.deptOptions, 175));
});
},
// 递归查值的方法
selectList
(
list
,
id
)
{
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
let
item
=
list
[
i
];
if
(
item
.
id
==
id
)
{
return
item
.
label
;
}
else
{
if
(
Array
.
isArray
(
item
.
children
))
{
let
a
=
this
.
selectList
(
item
.
children
,
id
);
if
(
a
)
{
return
a
;
}
}
}
}
},
getList
()
{
this
.
loading
=
true
;
listBank
(
this
.
queryParams
)
.
then
((
res
)
=>
{
console
.
log
(
res
);
this
.
list
=
res
.
rows
.
map
((
item
,
index
)
=>
{
return
{
bankNum
:
index
+
1
+
(
this
.
queryParams
.
pageNum
-
1
)
*
this
.
queryParams
.
pageSize
,
checked
:
false
,
changeNum
:
0
,
...
item
,
};
});
this
.
total
=
res
.
total
;
})
.
finally
(()
=>
{
this
.
loading
=
false
;
});
},
saveAndNext
()
{
const
topicInfos
=
this
.
list
.
filter
((
item
)
=>
item
.
checked
)
.
map
((
item
)
=>
{
return
{
bankId
:
item
.
bankId
,
quan
:
item
.
changeNum
,
};
});
console
.
log
(
this
.
courseId
,
topicInfos
);
const
data
=
{
courseId
:
this
.
courseId
,
topicInfos
};
console
.
log
(
data
);
bachAddTopicGuest
(
data
).
then
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
code
==
200
)
{
// this.$parent.$parent.componentsNumChange(2);
this
.
$parent
.
$parent
.
getContractTopicList
(
this
.
courseId
);
this
.
$parent
.
$parent
.
dialogVisible2
=
false
;
}
});
},
resetClick
()
{},
search
()
{
this
.
getList
();
},
currentChangeClick
()
{},
formatter
(
row
,
column
,
cellValue
,
index
)
{
// console.log(row, column, cellValue, index);
if
(
!
cellValue
)
return
"-"
;
else
return
cellValue
;
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.table-wrapper
{
padding-top
:
22px
;
width
:
100%
;
height
:
550px
;
overflow
:
hidden
;
// padding-bottom: 10px;
margin-bottom
:
20px
;
}
</
style
>
danger-manage-web/src/views/educationPlanExam/visitorProgram/index.vue
View file @
cbc859c8
<
template
>
<div
class=
"form-wrapper"
>
<div
style=
"width: 100%;height:100%;"
>
<el-form
:model=
"contractTrainForm"
:rules=
"rules"
ref=
"contractTrainForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"培训名称"
prop=
"courseName"
>
<el-input
v-model=
"contractTrainForm.courseName"
></el-input>
</el-form-item>
<el-form-item
label=
"培训内容"
prop=
"courseConent"
>
<el-input
type=
"textarea"
v-model=
"contractTrainForm.courseConent"
rows=
"5"
></el-input>
</el-form-item>
<div
class=
"flex"
>
<el-form-item
label=
"视频上传"
v-if=
"!readOnly"
prop=
"video"
>
<FileUpload
listType=
"picture"
@
resFun=
"getFileInfoVideo"
@
remove=
"listRemoveVideo"
:fileArr=
"fileListVideo"
:fileSize=
"500"
:fileType=
"['mp4']"
/>
<el-input
v-show=
"false"
disabled
v-model=
"contractTrainForm.video"
></el-input>
</el-form-item>
<el-form-item
label=
"附件上传"
v-if=
"!readOnly"
prop=
"enclosure"
>
<FileUpload
listType=
"picture"
@
resFun=
"getFileInfoFile"
@
remove=
"listRemoveFile"
:fileArr=
"fileListFile"
/>
<el-input
v-show=
"false"
disabled
v-model=
"contractTrainForm.enclosure"
></el-input>
</el-form-item>
</div>
</el-form>
<div
class=
"form-wrapper"
>
<div
style=
"width: 100%; height: 100%"
>
<el-form
:model=
"contractTrainForm"
:rules=
"rules"
ref=
"contractTrainForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"培训名称"
prop=
"courseName"
>
<el-input
v-model=
"contractTrainForm.courseName"
></el-input>
</el-form-item>
<el-form-item
label=
"培训内容"
prop=
"courseConent"
>
<el-input
type=
"textarea"
v-model=
"contractTrainForm.courseConent"
rows=
"5"
></el-input>
</el-form-item>
<div
class=
"flex"
>
<el-form-item
label=
"视频上传"
v-if=
"!readOnly"
prop=
"video"
>
<FileUpload
listType=
"picture"
@
resFun=
"getFileInfoVideo"
@
remove=
"listRemoveVideo"
:fileArr=
"fileListVideo"
:fileSize=
"500"
:fileType=
"['mp4']"
/>
<el-input
v-show=
"false"
disabled
v-model=
"contractTrainForm.video"
></el-input>
</el-form-item>
<el-form-item
label=
"附件上传"
v-if=
"!readOnly"
prop=
"enclosure"
>
<FileUpload
listType=
"picture"
@
resFun=
"getFileInfoFile"
@
remove=
"listRemoveFile"
:fileArr=
"fileListFile"
/>
<el-input
v-show=
"false"
disabled
v-model=
"contractTrainForm.enclosure"
></el-input>
</el-form-item>
</div>
<visitorQuestion
ref=
"visitorQuestion"
></visitorQuestion
>
</el-form
>
</div>
<visitorQuestion
ref=
"visitorQuestion"
></visitorQuestion>
</div>
</
template
>
<
script
>
import
FileUpload
from
"@/components/FileUpload"
;
import
uploadfile
from
"@/assets/uploadfile.png"
;
import
visitorQuestion
from
"@/views/educationPlanExam/visitorProgram/visitorQuestion"
;
import
{
listCourse
}
from
"@/api/contractTrain/contractTrain"
;
export
default
{
data
()
{
return
{
contractTrainForm
:
{
courseName
:
''
,
courseConent
:
''
,
video
:
""
,
enclosure
:
""
,
},
fileListVideo
:
[],
fileListFile
:
[],
readOnly
:
false
,
rules
:
{
name
:
[
{
required
:
true
,
message
:
'请输入培训名称'
,
trigger
:
'blur'
}
],
region
:
[
{
required
:
true
,
message
:
'请输入培训内容'
,
trigger
:
'change'
}
],
video
:
[
{
required
:
true
,
trigger
:
"blue"
,
message
:
"视频不能为空"
}
],
enclosure
:
[
{
required
:
true
,
trigger
:
"blur"
,
message
:
"附件不能为空"
},
],
import
FileUpload
from
"@/components/FileUpload"
;
import
uploadfile
from
"@/assets/uploadfile.png"
;
import
visitorQuestion
from
"@/views/educationPlanExam/visitorProgram/visitorQuestion"
;
import
{
listCourse
}
from
"@/api/contractTrain/contractTrain"
;
export
default
{
data
()
{
return
{
contractTrainForm
:
{
courseName
:
""
,
courseConent
:
""
,
video
:
""
,
enclosure
:
""
,
},
fileListVideo
:
[],
fileListFile
:
[],
readOnly
:
false
,
rules
:
{
name
:
[{
required
:
true
,
message
:
"请输入培训名称"
,
trigger
:
"blur"
}],
region
:
[
{
required
:
true
,
message
:
"请输入培训内容"
,
trigger
:
"change"
},
],
video
:
[{
required
:
true
,
trigger
:
"blue"
,
message
:
"视频不能为空"
}],
enclosure
:
[
{
required
:
true
,
trigger
:
"blur"
,
message
:
"附件不能为空"
},
],
},
};
},
components
:
{
FileUpload
,
visitorQuestion
,
},
created
()
{
this
.
getContractTrainList
();
},
methods
:
{
getContractTrainList
()
{
listCourse
().
then
((
res
)
=>
{
this
.
contractTrainForm
=
res
.
rows
[
0
];
console
.
log
(
"this.contractTrainForm"
,
this
.
contractTrainForm
);
if
(
this
.
contractTrainForm
.
video
)
{
this
.
fileListVideo
=
[
{
name
:
this
.
contractTrainForm
.
courseName
+
"视频"
,
url
:
uploadfile
,
},
];
}
if
(
this
.
contractTrainForm
.
enclosure
)
{
this
.
fileListFile
=
[
{
name
:
this
.
contractTrainForm
.
courseName
+
"附件"
,
url
:
uploadfile
,
},
];
}
// this.$refs.visitorQuestion.rightNum =
// this.contractTrainForm.qualifiedNum;
this
.
$refs
.
visitorQuestion
.
bottomFrom
=
{
judgmentScore
:
this
.
contractTrainForm
.
judgmentScore
||
0
,
multipleChoiceScore
:
this
.
contractTrainForm
.
multipleChoiceScore
||
0
,
qualifiedNum
:
this
.
contractTrainForm
.
qualifiedNum
||
0
,
singleChoiceScore
:
this
.
contractTrainForm
.
singleChoiceScore
||
0
,
};
this
.
$refs
.
visitorQuestion
.
getContractTopicList
(
this
.
contractTrainForm
.
contractorCourseId
);
});
},
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
alert
(
"submit!"
);
}
else
{
console
.
log
(
"error submit!!"
);
return
false
;
}
});
},
getFileInfoVideo
(
res
)
{
this
.
contractTrainForm
.
video
=
res
.
url
;
this
.
fileListVideo
=
[
{
name
:
res
.
fileName
,
url
:
uploadfile
,
},
}
;
]
;
},
components
:
{
FileUpload
,
visitorQuestion
,
listRemoveVideo
(
e
)
{
this
.
fileListVideo
=
[];
this
.
contractTrainForm
.
video
=
""
;
// this.form.videoName = null;
},
created
()
{
this
.
getContractTrainList
();
getFileInfoFile
(
res
)
{
this
.
contractTrainForm
.
enclosure
=
res
.
url
;
this
.
fileListFile
=
[
{
name
:
res
.
fileName
,
url
:
uploadfile
,
},
];
},
methods
:
{
getContractTrainList
(){
listCourse
().
then
(
res
=>
{
this
.
contractTrainForm
=
res
.
rows
[
0
];
if
(
this
.
contractTrainForm
.
video
){
this
.
fileListVideo
=
[
{
name
:
this
.
contractTrainForm
.
courseName
+
"视频"
,
url
:
uploadfile
,
},
];
}
if
(
this
.
contractTrainForm
.
enclosure
){
this
.
fileListFile
=
[
{
name
:
this
.
contractTrainForm
.
courseName
+
"附件"
,
url
:
uploadfile
,
},
];
}
this
.
$refs
.
visitorQuestion
.
rightNum
=
this
.
contractTrainForm
.
qualifiedNum
;
this
.
$refs
.
visitorQuestion
.
getContractTopicList
(
this
.
contractTrainForm
.
contractorCourseId
)
})
},
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
alert
(
'submit!'
);
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
getFileInfoVideo
(
res
)
{
this
.
contractTrainForm
.
video
=
res
.
url
;
this
.
fileListVideo
=
[
{
name
:
res
.
fileName
,
url
:
uploadfile
,
},
];
},
listRemoveVideo
(
e
)
{
this
.
fileListVideo
=
[];
this
.
contractTrainForm
.
video
=
""
;
// this.form.videoName = null;
},
getFileInfoFile
(
res
)
{
this
.
contractTrainForm
.
enclosure
=
res
.
url
;
this
.
fileListFile
=
[
{
name
:
res
.
fileName
,
url
:
uploadfile
,
},
];
},
listRemoveFile
(
e
)
{
this
.
fileListFild
=
[];
this
.
contractTrainForm
.
enclosure
=
""
;
// this.form.fileName = null;
},
}
}
listRemoveFile
(
e
)
{
this
.
fileListFild
=
[];
this
.
contractTrainForm
.
enclosure
=
""
;
// this.form.fileName = null;
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.form-wrapper
{
...
...
@@ -148,7 +174,7 @@
height
:
100%
;
margin-bottom
:
20px
;
}
.flex
{
.flex
{
width
:
100%
;
justify-content
:
space-around
;
padding
:
20px
30px
;
...
...
danger-manage-web/src/views/educationPlanExam/visitorProgram/visitorAdd.vue
View file @
cbc859c8
This diff is collapsed.
Click to expand it.
danger-manage-web/src/views/educationPlanExam/visitorProgram/visitorQuestion.vue
View file @
cbc859c8
This diff is collapsed.
Click to expand it.
danger-manage-web/src/views/entrance/index.vue
View file @
cbc859c8
This diff is collapsed.
Click to expand it.
danger-manage-web/src/views/system/qRCode/index.vue
View file @
cbc859c8
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2023-01-17 13:47:40
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-28 17:58:47
* @FilePath: /danger-manage-web/src/views/system/qRCode/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<img
:src=
"src"
style=
" position: relative;
left: 37%;
top: 10%;
width: 27%;"
>
<img
:src=
"src"
style=
"position: relative; left: 37%; top: 10%; width: 27%"
/>
</
template
>
<
script
>
const
src
=
require
(
'../qRCode/img/qrcode_1673250700723.png'
)
export
default
{
computed
:
{
src
()
{
return
src
}
}
}
const
src
=
require
(
"../qRCode/img/qrcode_1673250700723.png"
);
export
default
{
computed
:
{
src
()
{
return
src
;
},
},
};
</
script
>
danger-manage-web/src/views/visitorExam/Trainingmaterials/ExaminationQuestions.vue
View file @
cbc859c8
This diff is collapsed.
Click to expand it.
danger-manage-web/src/views/visitorExam/Trainingmaterials/components/AnswerLesson.vue
View file @
cbc859c8
...
...
@@ -13,11 +13,12 @@
<div
ref=
"myBody"
class=
"body"
v-loading=
"loading"
>
<div
class=
"text"
>
<div
class=
"float"
>
炼铁车间炉前工安全生产规范课程
</div>
</div>
<transition
name=
"fade"
mode=
"out-in"
>
<div
:key=
"goodJobShow"
>
<template
v-if=
"!goodJobShow"
>
<transition
name=
"fade"
mode=
"out-in"
>
<
!--
<
transition
name=
"fade"
mode=
"out-in"
>
<div
class=
"question-wrapper"
v-if=
"visible"
:key=
"nowQuestion"
>
<div
v-for=
"(item, index) in list"
:key=
"item.id"
>
<Question
...
...
@@ -30,6 +31,33 @@
/>
</div>
</div>
</transition>
-->
<transition
name=
"fade"
mode=
"out-in"
>
<div
class=
"question-wrapper"
v-if=
"visible"
:key=
"nowQuestion"
>
<div
v-for=
"(item, index) in list"
:key=
"item.id"
>
<template
v-if=
"item.topicType == 1 || item.topicType === 3"
>
<Question
v-if=
"index === nowQuestion"
:questionObj=
"item"
:index=
"index"
:nowQuestion=
"nowQuestion"
:selectLetter=
"selectLetter"
@
changeLetter=
"changeLetter"
/>
</
template
>
<
template
v-else
>
<QuestionChoice
v-if=
"index === nowQuestion"
:questionObj=
"item"
:index=
"index"
:nowQuestion=
"nowQuestion"
:selectLetter=
"selectLetter"
@
changeLetter=
"changeLetter"
/>
</
template
>
</div>
</div>
</transition>
<div
class=
"select flex"
>
...
...
@@ -77,7 +105,7 @@
<
script
>
import
Question
from
"./Question"
;
import
GoodJob
from
"./GoodJob.vue"
;
import
GoodJob
from
"./GoodJob
Old
.vue"
;
import
{
userQuestionList
,
setAnswer
,
...
...
@@ -148,7 +176,9 @@ export default {
// this.answerClear();
// this.$emit("update:visible", false);
this
.
saveBody
();
const
answers
=
this
.
answerArr
.
map
((
item
)
=>
item
.
answer
).
join
(
","
);
// const answers = this.answerArr.map((item) => item.answer).join(",");
const
json
=
JSON
.
stringify
(
this
.
answerArr
.
map
((
item
)
=>
item
.
answer
));
const
answers
=
json
.
slice
(
1
,
json
.
length
-
1
);
this
.
loading
=
true
;
setAnswer
({
userCourseId
:
this
.
userCourseId
,
...
...
@@ -158,13 +188,12 @@ export default {
if
(
res
.
code
==
200
)
{
this
.
goodJobData
=
res
.
data
;
this
.
goodJobShow
=
true
;
}
})
.
finally
(()
=>
{
this
.
loading
=
false
;
// 是否作对
this
.
$emit
(
'jj'
,
this
.
goodJobData
)
this
.
$emit
(
"jj"
,
this
.
goodJobData
);
});
},
dialogCancel
()
{
...
...
danger-manage-web/src/views/visitorExam/Trainingmaterials/components/GoodJob.vue
View file @
cbc859c8
...
...
@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-21 17:20:49
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 202
2-09-28 11:56:49
* @LastEditTime: 202
3-01-12 17:00:34
* @FilePath: /danger-manage-web/src/views/myLessons/components/GoodJob.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -13,17 +13,16 @@
<template
v-if=
"goodJobData.answer >= goodJobData.qualifiedNum"
>
<div
class=
"icon"
><i
class=
"iconfont icon-smiling"
/></div>
<div>
恭喜你,做对
{{
goodJobData
.
answer
}}
道题得分
{{
Math
.
floor
((
goodJobData
.
answer
/
goodJobData
.
topicNum
)
*
100
)
}}
,成绩合格!
<!-- 恭喜你,做对
{{
goodJobData
.
answer
}}
道题 -->
恭喜你,得分
{{
goodJobData
.
answer
}}
,成绩合格!
</div>
</
template
>
<
template
v-else
>
<div
class=
"icon"
><i
class=
"iconfont icon-nanguo"
/></div>
<div>
继续努力,
做对
{{
goodJobData
.
answer
}}
道题得分
{{
Math
.
floor
((
goodJobData
.
answer
/
goodJobData
.
topicNum
)
*
100
)
}}
,成绩不合格!
继续努力,
<!-- 做对
{{
goodJobData
.
answer
}}
道题 -->
得分
{{
goodJobData
.
answer
}}
,成绩不合格!
</div>
</
template
>
</div>
...
...
@@ -49,16 +48,16 @@ export default {
.goodjob-wrapper
{
justify-content
:
center
;
align-items
:
center
;
width
:
86
%
;
width
:
100
%
;
height
:
100%
;
border-bottom
:
1px
solid
#bbbbbb
;
.text
{
width
:
94
%
;
height
:
1
74
px
;
width
:
100
%
;
height
:
1
36
px
;
color
:
#1d84ff
;
background
:
#f9f9f9
100%
;
border-radius
:
15px
;
line-height
:
40
px
;
line-height
:
136
px
;
font-size
:
28px
;
justify-content
:
center
;
align-items
:
center
;
...
...
danger-manage-web/src/views/visitorExam/Trainingmaterials/components/GoodJobOld.vue
0 → 100644
View file @
cbc859c8
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-21 17:20:49
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 11:56:49
* @FilePath: /danger-manage-web/src/views/myLessons/components/GoodJob.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<div
class=
"goodjob-wrapper flex"
>
<div
class=
"text flex"
>
<div
class=
"text flex"
>
<template
v-if=
"goodJobData.answer >= goodJobData.qualifiedNum"
>
<div
class=
"icon"
><i
class=
"iconfont icon-smiling"
/></div>
<div>
恭喜你,做对
{{
goodJobData
.
answer
}}
道题得分
{{
Math
.
floor
((
goodJobData
.
answer
/
goodJobData
.
topicNum
)
*
100
)
}}
,成绩合格!
</div>
</
template
>
<
template
v-else
>
<div
class=
"icon"
><i
class=
"iconfont icon-nanguo"
/></div>
<div>
继续努力,做对
{{
goodJobData
.
answer
}}
道题得分
{{
Math
.
floor
((
goodJobData
.
answer
/
goodJobData
.
topicNum
)
*
100
)
}}
,成绩不合格!
</div>
</
template
>
</div>
</div>
</div>
</template>
<
script
>
export
default
{
name
:
""
,
props
:
{
goodJobData
:
{
type
:
Object
,
},
},
data
()
{
return
{};
},
methods
:
{},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.goodjob-wrapper
{
justify-content
:
center
;
align-items
:
center
;
width
:
86%
;
height
:
100%
;
border-bottom
:
1px
solid
#bbbbbb
;
.text
{
width
:
94%
;
height
:
174px
;
color
:
#1d84ff
;
background
:
#f9f9f9
100%
;
border-radius
:
15px
;
line-height
:
40px
;
font-size
:
28px
;
justify-content
:
center
;
align-items
:
center
;
.icon
{
margin-right
:
10px
;
.iconfont
{
color
:
#e2852a
;
font-size
:
40px
!
important
;
}
}
}
}
</
style
>
danger-manage-web/src/views/visitorExam/Trainingmaterials/components/Question.vue
View file @
cbc859c8
...
...
@@ -2,12 +2,13 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-21 11:00:14
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 202
2-09-28 11:15:27
* @LastEditTime: 202
3-01-29 09:29:14
* @FilePath: /danger-manage-web/src/views/myLessons/components/Question.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<div
class=
"question flex"
>
<div
class=
"tips"
>
{{
tipsArr
[
questionObj
.
topicType
]
}}
</div>
<div
class=
"top"
:class=
"
{ flex: alignItemsCenter }"
...
...
@@ -23,7 +24,7 @@
<div
class=
"item flex"
v-for=
"(item, index) in questionObj.question"
:key=
"item
+'aas'+
index"
:key=
"item
+ 'aas' +
index"
>
<div
class=
"letter"
>
{{
letters
[
index
]
}}
...
...
@@ -38,10 +39,10 @@
<div
class=
"change-wrapper flex"
>
<div
class=
"change"
:class=
"
{ active: letterActive
+'' === index+''
}"
:class=
"
{ active: letterActive
.indexOf(index) >= 0
}"
@click="changeLetter(index)"
v-for="(item, index) in questionObj.question"
:key="item
+'a'+
index"
:key="item
+ 'a' +
index"
>
{{
letters
[
index
]
}}
</div>
...
...
@@ -105,8 +106,8 @@ export default {
},
// 从外面传进来的选项,选择过的才有,没选择过的没有
selectLetter
:
{
type
:
[
String
,
Number
],
default
:
999
,
type
:
[
String
,
Number
,
Array
],
default
:
[]
,
},
},
data
()
{
...
...
@@ -115,6 +116,11 @@ export default {
// 如果传进来了,就是这个值,如果没有就是null,因为动画需要那个key的问题,会清空原始的盒子,所以要传一下值
letterActive
:
this
.
selectLetter
,
letters
,
tipsArr
:
{
1
:
"单选题"
,
2
:
"多选题"
,
3
:
"判断题"
,
},
};
},
mounted
()
{
...
...
@@ -143,8 +149,10 @@ export default {
}
},
changeLetter
(
index
)
{
this
.
letterActive
=
index
;
this
.
$emit
(
"changeLetter"
,
index
);
// this.letterActive = index;
// this.$emit("changeLetter", index);
this
.
letterActive
=
[
index
];
this
.
$emit
(
"changeLetter"
,
this
.
letterActive
);
// this.$emit("changeLetter", this.letters[index]);
},
},
...
...
@@ -161,6 +169,22 @@ export default {
border-bottom
:
1px
solid
#bbbbbb
;
// background: red;
flex-direction
:
column
;
position
:
relative
;
.tips
{
width
:
80px
;
height
:
24px
;
background
:
#1d84ff
;
font-size
:
14px
;
color
:
#fff
;
position
:
absolute
;
// top: -45px;
// left: 0px;
top
:
-25px
;
left
:
70px
;
text-align
:
center
;
line-height
:
24px
;
}
.top
{
background
:
#f9f9f9
;
height
:
54px
;
...
...
@@ -207,6 +231,7 @@ export default {
}
}
}
.bottom
{
max-height
:
70px
;
// background: black;
...
...
@@ -217,6 +242,7 @@ export default {
width
:
756px
;
flex-wrap
:
wrap
;
margin
:
0
auto
;
overflow
:
hidden
;
.change
{
width
:
90px
;
height
:
30px
;
...
...
danger-manage-web/src/views/visitorExam/Trainingmaterials/components/QuestionChoice.vue
0 → 100644
View file @
cbc859c8
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-21 11:00:14
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-29 09:34:10
* @FilePath: /danger-manage-web/src/views/myLessons/components/Question.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<div
class=
"question flex"
>
<div
class=
"tips"
>
{{
tipsArr
[
questionObj
.
topicType
]
}}
</div>
<div
class=
"top"
:class=
"
{ flex: alignItemsCenter }"
:style="{ alignItems: alignItemsCenter ? 'center' : '' }"
ref="top"
>
<div
class=
"text"
ref=
"text"
>
{{
questionObj
.
text
}}
</div>
<div
class=
"num"
>
{{
nowQuestion
+
1
}}
</div>
</div>
<div
class=
"middle"
>
<div
class=
"item flex"
v-for=
"(item, index) in questionObj.question"
:key=
"item + 'aas' + index"
>
<div
class=
"letter"
>
{{
letters
[
index
]
}}
</div>
<div
class=
""
>
{{
item
}}
</div>
</div>
</div>
<div
class=
"bottom flex"
>
<div
class=
"change-wrapper flex"
>
<div
class=
"change"
:class=
"
{ active: letterActive.indexOf(index) >= 0 }"
@click="changeLetter(index)"
v-for="(item, index) in questionObj.question"
:key="item + 'a' + index"
>
{{
letters
[
index
]
}}
</div>
</div>
</div>
</div>
</
template
>
<
script
>
const
letters
=
[
"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"
,
];
export
default
{
name
:
"question"
,
props
:
{
questionObj
:
{
type
:
Object
,
default
:
()
=>
{
return
{
text
:
"asdfasdf"
,
question
:
[
"沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师"
,
"沙发斯蒂芬大师"
,
"沙发斯蒂芬大师"
,
"沙发斯蒂芬大师"
,
"沙发斯蒂芬大师"
,
],
};
},
},
nowQuestion
:
{
type
:
Number
,
},
index
:
{
type
:
Number
,
},
// 从外面传进来的选项,选择过的才有,没选择过的没有
selectLetter
:
{
type
:
[
String
,
Number
,
Array
],
default
:
()
=>
{
return
[];
},
},
},
data
()
{
return
{
alignItemsCenter
:
false
,
// 如果传进来了,就是这个值,如果没有就是null,因为动画需要那个key的问题,会清空原始的盒子,所以要传一下值
letterActive
:
this
.
selectLetter
,
letters
,
tipsArr
:
{
1
:
"单选题"
,
2
:
"多选题"
,
3
:
"判断题"
,
},
};
},
mounted
()
{
// console.log('123')
// 每次都会更新,所以不需要watch 直接在这里面写 因为动画需要那个key的问题,会清空原始的盒子,所以要传一下值
this
.
textCenter
();
},
watch
:
{
// 监听一下当前题目,调整一下位置
// nowQuestion(value) {
// console.log('nowQuestion变化',value)
// this.$nextTick(() => {
// this.textCenter();
// });
// },
},
methods
:
{
textCenter
()
{
let
h1
=
this
.
$refs
.
text
?.
offsetHeight
;
let
h2
=
this
.
$refs
.
top
?.
offsetHeight
;
// 如果text大于或者等于top,就出不居中,如果不小于top,就上下居中
if
(
h2
<=
h1
)
{
this
.
alignItemsCenter
=
false
;
}
else
{
this
.
alignItemsCenter
=
true
;
}
},
changeLetter
(
index
)
{
// this.letterActive = index;
const
ind
=
this
.
letterActive
.
indexOf
(
index
);
console
.
log
(
this
.
letterActive
);
if
(
ind
<
0
)
{
this
.
letterActive
.
push
(
index
);
}
else
{
this
.
letterActive
.
splice
(
ind
,
1
);
}
this
.
$emit
(
"changeLetter"
,
this
.
letterActive
);
// this.$emit("changeLetter", this.letters[index]);
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.question
{
// position: absolute;
// top: 0px;
// display: inline-block;
width
:
100%
;
height
:
370px
;
padding-bottom
:
10px
;
border-bottom
:
1px
solid
#bbbbbb
;
// background: red;
flex-direction
:
column
;
position
:
relative
;
.tips
{
width
:
80px
;
height
:
24px
;
background
:
#1d84ff
;
font-size
:
14px
;
color
:
#fff
;
position
:
absolute
;
// top: -45px;
// left: 0px;
top
:
-25px
;
left
:
70px
;
text-align
:
center
;
line-height
:
24px
;
}
.top
{
background
:
#f9f9f9
;
height
:
54px
;
padding
:
0px
10px
0px
43px
;
overflow-wrap
:
anywhere
;
// align-items: center;
overflow-y
:
auto
;
position
:
relative
;
.text
{
font-size
:
14px
;
text-indent
:
2em
;
}
.num
{
position
:
absolute
;
left
:
0
;
width
:
48px
;
height
:
48px
;
top
:
4px
;
background
:
#1d84ff
;
border-radius
:
50%
;
text-align
:
center
;
line-height
:
48px
;
font-size
:
18px
;
color
:
#ffffff
;
}
}
.middle
{
flex
:
1
;
// background: blue;
overflow-y
:
auto
;
padding-left
:
43px
;
padding-right
:
10px
;
margin-bottom
:
15px
;
.item
{
padding-top
:
38px
;
width
:
100%
;
overflow-wrap
:
anywhere
;
font-size
:
14px
;
color
:
#101010
;
.letter
{
padding
:
2px
;
margin-right
:
10px
;
box-sizing
:
border-box
;
}
}
}
.bottom
{
max-height
:
70px
;
// background: black;
padding-left
:
43px
;
padding-right
:
10px
;
overflow-y
:
auto
;
.change-wrapper
{
width
:
756px
;
flex-wrap
:
wrap
;
margin
:
0
auto
;
.change
{
width
:
90px
;
height
:
30px
;
background
:
#e8f4ff
;
color
:
#101010
;
border
:
1px
solid
#a3d3ff
;
line-height
:
30px
;
text-align
:
center
;
margin
:
0
9px
5px
;
border-radius
:
4px
;
cursor
:
pointer
;
&
.active
{
background
:
#1d84ff
;
color
:
#ffffff
;
border
:
1px
solid
#a3d3ff
;
}
&
:hover
{
background
:
rgba
(
29
,
132
,
255
,
0
.5
);
color
:
#ffffff
;
}
}
}
}
}
</
style
>
danger-manage-web/src/views/visitorExam/Trainingmaterials/index.vue
View file @
cbc859c8
...
...
@@ -163,7 +163,7 @@
methods
:
{
getPlanList
()
{
//跳转页面的传值
console
.
log
(
JSON
.
parse
(
this
.
$route
.
query
.
params
).
beyondUnit
)
//
console.log(JSON.parse(this.$route.query.params).beyondUnit)
ITContractorTrainCourse
().
then
((
res
)
=>
{
this
.
data
=
res
.
data
;
this
.
changeVideo
(
this
.
data
.
video
);
...
...
danger-manage-web/vue.config.js
View file @
cbc859c8
...
...
@@ -34,8 +34,8 @@ module.exports = {
proxy
:
{
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
process
.
env
.
VUE_APP_BASE_API
]:
{
//
target: process.env.VUE_APP_TARGET,
target
:
`http://192.168.2.21:8908/dangerManage`
,
target
:
process
.
env
.
VUE_APP_TARGET
,
//
target: `http://192.168.2.21:8908/dangerManage`,
changeOrigin
:
true
,
pathRewrite
:
{
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment