Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
huaxin-rq
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
耿迪迪
huaxin-rq
Commits
236a20c0
Commit
236a20c0
authored
Mar 28, 2026
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
安全管理功能
parent
26ebbfa6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
543 additions
and
200 deletions
+543
-200
TSafeInspectLedger.java
...ain/java/com/zehong/system/domain/TSafeInspectLedger.java
+4
-4
TSafeMeetingLedger.java
...ain/java/com/zehong/system/domain/TSafeMeetingLedger.java
+4
-4
TSafeTrainLedger.java
.../main/java/com/zehong/system/domain/TSafeTrainLedger.java
+5
-5
TSafeInspectLedgerServiceImpl.java
...ng/system/service/impl/TSafeInspectLedgerServiceImpl.java
+9
-5
TSafeMeetingLedgerServiceImpl.java
...ng/system/service/impl/TSafeMeetingLedgerServiceImpl.java
+9
-5
TSafeTrainLedgerServiceImpl.java
...hong/system/service/impl/TSafeTrainLedgerServiceImpl.java
+9
-5
TSafeInspectLedgerMapper.xml
...main/resources/mapper/system/TSafeInspectLedgerMapper.xml
+1
-1
TSafeMeetingLedgerMapper.xml
...main/resources/mapper/system/TSafeMeetingLedgerMapper.xml
+1
-1
TSafeTrainLedgerMapper.xml
...c/main/resources/mapper/system/TSafeTrainLedgerMapper.xml
+1
-1
index.vue
huaxin-web/src/components/MultipleFileUpload/index.vue
+172
-0
index.vue
huaxin-web/src/components/MultipleImageUpload/index.vue
+1
-1
index.vue
huaxin-web/src/views/safe/inspect/index.vue
+107
-54
index.vue
huaxin-web/src/views/safe/meeting/index.vue
+109
-56
index.vue
huaxin-web/src/views/safe/train/index.vue
+111
-58
No files found.
huaxin-system/src/main/java/com/zehong/system/domain/TSafeInspectLedger.java
View file @
236a20c0
...
@@ -27,8 +27,8 @@ public class TSafeInspectLedger extends BaseEntity
...
@@ -27,8 +27,8 @@ public class TSafeInspectLedger extends BaseEntity
private
String
content
;
private
String
content
;
/** 设备状态 */
/** 设备状态 */
@Excel
(
name
=
"
设备状态
"
)
@Excel
(
name
=
"
地点
"
)
private
Integer
address
;
private
String
address
;
/** 照片 */
/** 照片 */
@Excel
(
name
=
"照片"
)
@Excel
(
name
=
"照片"
)
...
@@ -73,12 +73,12 @@ public class TSafeInspectLedger extends BaseEntity
...
@@ -73,12 +73,12 @@ public class TSafeInspectLedger extends BaseEntity
{
{
return
content
;
return
content
;
}
}
public
void
setAddress
(
Integer
address
)
public
void
setAddress
(
String
address
)
{
{
this
.
address
=
address
;
this
.
address
=
address
;
}
}
public
Integer
getAddress
()
public
String
getAddress
()
{
{
return
address
;
return
address
;
}
}
...
...
huaxin-system/src/main/java/com/zehong/system/domain/TSafeMeetingLedger.java
View file @
236a20c0
...
@@ -27,8 +27,8 @@ public class TSafeMeetingLedger extends BaseEntity
...
@@ -27,8 +27,8 @@ public class TSafeMeetingLedger extends BaseEntity
private
String
content
;
private
String
content
;
/** 设备状态 */
/** 设备状态 */
@Excel
(
name
=
"
设备状态
"
)
@Excel
(
name
=
"
地点
"
)
private
Integer
address
;
private
String
address
;
/** 照片 */
/** 照片 */
@Excel
(
name
=
"照片"
)
@Excel
(
name
=
"照片"
)
...
@@ -73,12 +73,12 @@ public class TSafeMeetingLedger extends BaseEntity
...
@@ -73,12 +73,12 @@ public class TSafeMeetingLedger extends BaseEntity
{
{
return
content
;
return
content
;
}
}
public
void
setAddress
(
Integer
address
)
public
void
setAddress
(
String
address
)
{
{
this
.
address
=
address
;
this
.
address
=
address
;
}
}
public
Integer
getAddress
()
public
String
getAddress
()
{
{
return
address
;
return
address
;
}
}
...
...
huaxin-system/src/main/java/com/zehong/system/domain/TSafeTrainLedger.java
View file @
236a20c0
...
@@ -19,7 +19,7 @@ public class TSafeTrainLedger extends BaseEntity
...
@@ -19,7 +19,7 @@ public class TSafeTrainLedger extends BaseEntity
private
Long
trainId
;
private
Long
trainId
;
/** 检查标题 */
/** 检查标题 */
@Excel
(
name
=
"
检查
标题"
)
@Excel
(
name
=
"
培训
标题"
)
private
String
title
;
private
String
title
;
/** 内容 */
/** 内容 */
...
@@ -27,8 +27,8 @@ public class TSafeTrainLedger extends BaseEntity
...
@@ -27,8 +27,8 @@ public class TSafeTrainLedger extends BaseEntity
private
String
content
;
private
String
content
;
/** 设备状态 */
/** 设备状态 */
@Excel
(
name
=
"
设备状态
"
)
@Excel
(
name
=
"
地点
"
)
private
Integer
address
;
private
String
address
;
/** 照片 */
/** 照片 */
@Excel
(
name
=
"照片"
)
@Excel
(
name
=
"照片"
)
...
@@ -73,12 +73,12 @@ public class TSafeTrainLedger extends BaseEntity
...
@@ -73,12 +73,12 @@ public class TSafeTrainLedger extends BaseEntity
{
{
return
content
;
return
content
;
}
}
public
void
setAddress
(
Integer
address
)
public
void
setAddress
(
String
address
)
{
{
this
.
address
=
address
;
this
.
address
=
address
;
}
}
public
Integer
getAddress
()
public
String
getAddress
()
{
{
return
address
;
return
address
;
}
}
...
...
huaxin-system/src/main/java/com/zehong/system/service/impl/TSafeInspectLedgerServiceImpl.java
View file @
236a20c0
package
com
.
zehong
.
system
.
service
.
impl
;
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.List
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.zehong.common.utils.SecurityUtils
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TSafeInspectLedgerMapper
;
import
com.zehong.system.domain.TSafeInspectLedger
;
import
com.zehong.system.domain.TSafeInspectLedger
;
import
com.zehong.system.mapper.TSafeInspectLedgerMapper
;
import
com.zehong.system.service.ITSafeInspectLedgerService
;
import
com.zehong.system.service.ITSafeInspectLedgerService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
/**
* 安全检查台账Service业务层处理
* 安全检查台账Service业务层处理
...
@@ -17,7 +19,7 @@ import com.zehong.system.service.ITSafeInspectLedgerService;
...
@@ -17,7 +19,7 @@ import com.zehong.system.service.ITSafeInspectLedgerService;
@Service
@Service
public
class
TSafeInspectLedgerServiceImpl
implements
ITSafeInspectLedgerService
public
class
TSafeInspectLedgerServiceImpl
implements
ITSafeInspectLedgerService
{
{
@
Autowired
@
Resource
private
TSafeInspectLedgerMapper
tSafeInspectLedgerMapper
;
private
TSafeInspectLedgerMapper
tSafeInspectLedgerMapper
;
/**
/**
...
@@ -54,6 +56,7 @@ public class TSafeInspectLedgerServiceImpl implements ITSafeInspectLedgerService
...
@@ -54,6 +56,7 @@ public class TSafeInspectLedgerServiceImpl implements ITSafeInspectLedgerService
public
int
insertTSafeInspectLedger
(
TSafeInspectLedger
tSafeInspectLedger
)
public
int
insertTSafeInspectLedger
(
TSafeInspectLedger
tSafeInspectLedger
)
{
{
tSafeInspectLedger
.
setCreateTime
(
DateUtils
.
getNowDate
());
tSafeInspectLedger
.
setCreateTime
(
DateUtils
.
getNowDate
());
tSafeInspectLedger
.
setCreateBy
(
SecurityUtils
.
getLoginUser
().
getUser
().
getNickName
());
return
tSafeInspectLedgerMapper
.
insertTSafeInspectLedger
(
tSafeInspectLedger
);
return
tSafeInspectLedgerMapper
.
insertTSafeInspectLedger
(
tSafeInspectLedger
);
}
}
...
@@ -67,6 +70,7 @@ public class TSafeInspectLedgerServiceImpl implements ITSafeInspectLedgerService
...
@@ -67,6 +70,7 @@ public class TSafeInspectLedgerServiceImpl implements ITSafeInspectLedgerService
public
int
updateTSafeInspectLedger
(
TSafeInspectLedger
tSafeInspectLedger
)
public
int
updateTSafeInspectLedger
(
TSafeInspectLedger
tSafeInspectLedger
)
{
{
tSafeInspectLedger
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tSafeInspectLedger
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tSafeInspectLedger
.
setUpdateBy
(
SecurityUtils
.
getLoginUser
().
getUser
().
getNickName
());
return
tSafeInspectLedgerMapper
.
updateTSafeInspectLedger
(
tSafeInspectLedger
);
return
tSafeInspectLedgerMapper
.
updateTSafeInspectLedger
(
tSafeInspectLedger
);
}
}
...
...
huaxin-system/src/main/java/com/zehong/system/service/impl/TSafeMeetingLedgerServiceImpl.java
View file @
236a20c0
package
com
.
zehong
.
system
.
service
.
impl
;
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.List
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.zehong.common.utils.SecurityUtils
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TSafeMeetingLedgerMapper
;
import
com.zehong.system.domain.TSafeMeetingLedger
;
import
com.zehong.system.domain.TSafeMeetingLedger
;
import
com.zehong.system.mapper.TSafeMeetingLedgerMapper
;
import
com.zehong.system.service.ITSafeMeetingLedgerService
;
import
com.zehong.system.service.ITSafeMeetingLedgerService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
/**
* 安全例会台账Service业务层处理
* 安全例会台账Service业务层处理
...
@@ -17,7 +19,7 @@ import com.zehong.system.service.ITSafeMeetingLedgerService;
...
@@ -17,7 +19,7 @@ import com.zehong.system.service.ITSafeMeetingLedgerService;
@Service
@Service
public
class
TSafeMeetingLedgerServiceImpl
implements
ITSafeMeetingLedgerService
public
class
TSafeMeetingLedgerServiceImpl
implements
ITSafeMeetingLedgerService
{
{
@
Autowired
@
Resource
private
TSafeMeetingLedgerMapper
tSafeMeetingLedgerMapper
;
private
TSafeMeetingLedgerMapper
tSafeMeetingLedgerMapper
;
/**
/**
...
@@ -54,6 +56,7 @@ public class TSafeMeetingLedgerServiceImpl implements ITSafeMeetingLedgerService
...
@@ -54,6 +56,7 @@ public class TSafeMeetingLedgerServiceImpl implements ITSafeMeetingLedgerService
public
int
insertTSafeMeetingLedger
(
TSafeMeetingLedger
tSafeMeetingLedger
)
public
int
insertTSafeMeetingLedger
(
TSafeMeetingLedger
tSafeMeetingLedger
)
{
{
tSafeMeetingLedger
.
setCreateTime
(
DateUtils
.
getNowDate
());
tSafeMeetingLedger
.
setCreateTime
(
DateUtils
.
getNowDate
());
tSafeMeetingLedger
.
setCreateBy
(
SecurityUtils
.
getLoginUser
().
getUser
().
getNickName
());
return
tSafeMeetingLedgerMapper
.
insertTSafeMeetingLedger
(
tSafeMeetingLedger
);
return
tSafeMeetingLedgerMapper
.
insertTSafeMeetingLedger
(
tSafeMeetingLedger
);
}
}
...
@@ -67,6 +70,7 @@ public class TSafeMeetingLedgerServiceImpl implements ITSafeMeetingLedgerService
...
@@ -67,6 +70,7 @@ public class TSafeMeetingLedgerServiceImpl implements ITSafeMeetingLedgerService
public
int
updateTSafeMeetingLedger
(
TSafeMeetingLedger
tSafeMeetingLedger
)
public
int
updateTSafeMeetingLedger
(
TSafeMeetingLedger
tSafeMeetingLedger
)
{
{
tSafeMeetingLedger
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tSafeMeetingLedger
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tSafeMeetingLedger
.
setUpdateBy
(
SecurityUtils
.
getLoginUser
().
getUser
().
getNickName
());
return
tSafeMeetingLedgerMapper
.
updateTSafeMeetingLedger
(
tSafeMeetingLedger
);
return
tSafeMeetingLedgerMapper
.
updateTSafeMeetingLedger
(
tSafeMeetingLedger
);
}
}
...
...
huaxin-system/src/main/java/com/zehong/system/service/impl/TSafeTrainLedgerServiceImpl.java
View file @
236a20c0
package
com
.
zehong
.
system
.
service
.
impl
;
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.List
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.zehong.common.utils.SecurityUtils
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TSafeTrainLedgerMapper
;
import
com.zehong.system.domain.TSafeTrainLedger
;
import
com.zehong.system.domain.TSafeTrainLedger
;
import
com.zehong.system.mapper.TSafeTrainLedgerMapper
;
import
com.zehong.system.service.ITSafeTrainLedgerService
;
import
com.zehong.system.service.ITSafeTrainLedgerService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
/**
* 安全培训台账Service业务层处理
* 安全培训台账Service业务层处理
...
@@ -17,7 +19,7 @@ import com.zehong.system.service.ITSafeTrainLedgerService;
...
@@ -17,7 +19,7 @@ import com.zehong.system.service.ITSafeTrainLedgerService;
@Service
@Service
public
class
TSafeTrainLedgerServiceImpl
implements
ITSafeTrainLedgerService
public
class
TSafeTrainLedgerServiceImpl
implements
ITSafeTrainLedgerService
{
{
@
Autowired
@
Resource
private
TSafeTrainLedgerMapper
tSafeTrainLedgerMapper
;
private
TSafeTrainLedgerMapper
tSafeTrainLedgerMapper
;
/**
/**
...
@@ -54,6 +56,7 @@ public class TSafeTrainLedgerServiceImpl implements ITSafeTrainLedgerService
...
@@ -54,6 +56,7 @@ public class TSafeTrainLedgerServiceImpl implements ITSafeTrainLedgerService
public
int
insertTSafeTrainLedger
(
TSafeTrainLedger
tSafeTrainLedger
)
public
int
insertTSafeTrainLedger
(
TSafeTrainLedger
tSafeTrainLedger
)
{
{
tSafeTrainLedger
.
setCreateTime
(
DateUtils
.
getNowDate
());
tSafeTrainLedger
.
setCreateTime
(
DateUtils
.
getNowDate
());
tSafeTrainLedger
.
setCreateBy
(
SecurityUtils
.
getLoginUser
().
getUser
().
getNickName
());
return
tSafeTrainLedgerMapper
.
insertTSafeTrainLedger
(
tSafeTrainLedger
);
return
tSafeTrainLedgerMapper
.
insertTSafeTrainLedger
(
tSafeTrainLedger
);
}
}
...
@@ -67,6 +70,7 @@ public class TSafeTrainLedgerServiceImpl implements ITSafeTrainLedgerService
...
@@ -67,6 +70,7 @@ public class TSafeTrainLedgerServiceImpl implements ITSafeTrainLedgerService
public
int
updateTSafeTrainLedger
(
TSafeTrainLedger
tSafeTrainLedger
)
public
int
updateTSafeTrainLedger
(
TSafeTrainLedger
tSafeTrainLedger
)
{
{
tSafeTrainLedger
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tSafeTrainLedger
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tSafeTrainLedger
.
setUpdateBy
(
SecurityUtils
.
getLoginUser
().
getUser
().
getNickName
());
return
tSafeTrainLedgerMapper
.
updateTSafeTrainLedger
(
tSafeTrainLedger
);
return
tSafeTrainLedgerMapper
.
updateTSafeTrainLedger
(
tSafeTrainLedger
);
}
}
...
...
huaxin-system/src/main/resources/mapper/system/TSafeInspectLedgerMapper.xml
View file @
236a20c0
...
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectTSafeInspectLedgerList"
parameterType=
"TSafeInspectLedger"
resultMap=
"TSafeInspectLedgerResult"
>
<select
id=
"selectTSafeInspectLedgerList"
parameterType=
"TSafeInspectLedger"
resultMap=
"TSafeInspectLedgerResult"
>
<include
refid=
"selectTSafeInspectLedgerVo"
/>
<include
refid=
"selectTSafeInspectLedgerVo"
/>
<where>
<where>
<if
test=
"title != null and title != ''"
>
and title
= #{title}
</if>
<if
test=
"title != null and title != ''"
>
and title
like concat('%', #{title}, '%')
</if>
<if
test=
"content != null and content != ''"
>
and content = #{content}
</if>
<if
test=
"content != null and content != ''"
>
and content = #{content}
</if>
<if
test=
"address != null "
>
and address = #{address}
</if>
<if
test=
"address != null "
>
and address = #{address}
</if>
<if
test=
"photo != null and photo != ''"
>
and photo = #{photo}
</if>
<if
test=
"photo != null and photo != ''"
>
and photo = #{photo}
</if>
...
...
huaxin-system/src/main/resources/mapper/system/TSafeMeetingLedgerMapper.xml
View file @
236a20c0
...
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectTSafeMeetingLedgerList"
parameterType=
"TSafeMeetingLedger"
resultMap=
"TSafeMeetingLedgerResult"
>
<select
id=
"selectTSafeMeetingLedgerList"
parameterType=
"TSafeMeetingLedger"
resultMap=
"TSafeMeetingLedgerResult"
>
<include
refid=
"selectTSafeMeetingLedgerVo"
/>
<include
refid=
"selectTSafeMeetingLedgerVo"
/>
<where>
<where>
<if
test=
"title != null and title != ''"
>
and title
= #{title}
</if>
<if
test=
"title != null and title != ''"
>
and title
like concat('%', #{title}, '%')
</if>
<if
test=
"content != null and content != ''"
>
and content = #{content}
</if>
<if
test=
"content != null and content != ''"
>
and content = #{content}
</if>
<if
test=
"address != null "
>
and address = #{address}
</if>
<if
test=
"address != null "
>
and address = #{address}
</if>
<if
test=
"photo != null and photo != ''"
>
and photo = #{photo}
</if>
<if
test=
"photo != null and photo != ''"
>
and photo = #{photo}
</if>
...
...
huaxin-system/src/main/resources/mapper/system/TSafeTrainLedgerMapper.xml
View file @
236a20c0
...
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectTSafeTrainLedgerList"
parameterType=
"TSafeTrainLedger"
resultMap=
"TSafeTrainLedgerResult"
>
<select
id=
"selectTSafeTrainLedgerList"
parameterType=
"TSafeTrainLedger"
resultMap=
"TSafeTrainLedgerResult"
>
<include
refid=
"selectTSafeTrainLedgerVo"
/>
<include
refid=
"selectTSafeTrainLedgerVo"
/>
<where>
<where>
<if
test=
"title != null and title != ''"
>
and title
= #{title}
</if>
<if
test=
"title != null and title != ''"
>
and title
like concat('%', #{title}, '%')
</if>
<if
test=
"content != null and content != ''"
>
and content = #{content}
</if>
<if
test=
"content != null and content != ''"
>
and content = #{content}
</if>
<if
test=
"address != null "
>
and address = #{address}
</if>
<if
test=
"address != null "
>
and address = #{address}
</if>
<if
test=
"photo != null and photo != ''"
>
and photo = #{photo}
</if>
<if
test=
"photo != null and photo != ''"
>
and photo = #{photo}
</if>
...
...
huaxin-web/src/components/MultipleFileUpload/index.vue
0 → 100644
View file @
236a20c0
<
template
>
<div
class=
"upload-file"
>
<el-upload
:action=
"uploadImgUrl"
:headers=
"headers"
multiple
list-type=
"text"
:fileType=
"fileType"
:file-list=
"fileList"
:limit=
"limit"
:before-upload=
"handleBeforeUpload"
:on-exceed=
"handleExceed"
:on-success=
"handleUploadSuccess"
:on-error=
"handleUploadError"
:on-preview=
"handlePictureCardPreview"
:on-remove=
"handleRemove"
:class=
"
{hide: isHide}"
>
<!-- 上传按钮 -->
<el-button
size=
"mini"
type=
"primary"
>
选取文件
</el-button>
</el-upload>
<!-- 上传提示 -->
<div
class=
"el-upload__tip"
slot=
"tip"
v-if=
"showTip"
>
请上传
<template
v-if=
"fileSize"
>
大小不超过
<b
style=
"color: #f56c6c"
>
{{
fileSize
}}
MB
</b>
</
template
>
<
template
v-if=
"fileType"
>
格式为
<b
style=
"color: #f56c6c"
>
{{
fileType
.
join
(
"/"
)
}}
</b>
</
template
>
的文件,且不超过{{limit}}个
</div>
</div>
</template>
<
script
>
import
{
getToken
}
from
"@/utils/auth"
;
export
default
{
name
:
"multiple-image-upload"
,
props
:
{
// 值
value
:
[
String
,
Object
,
Array
],
// 大小限制(MB)
fileSize
:
{
type
:
Number
,
default
:
5
,
},
//回显数组
/*fileList: {
type: Array,
default: () => [],
},*/
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType
:
{
type
:
Array
,
default
:
()
=>
[
"doc"
,
"xls"
,
"ppt"
,
"txt"
,
"pdf"
],
},
limit
:
{
type
:
Number
,
default
:
5
},
// 是否显示提示
isShowTip
:
{
type
:
Boolean
,
default
:
true
,
},
},
data
(){
return
{
uploadImgUrl
:
process
.
env
.
VUE_APP_BASE_API
+
"/common/upload"
,
// 上传的图片服务器地址
headers
:
{
Authorization
:
"Bearer "
+
getToken
(),
},
previewImg
:
null
,
dialogImageUrl
:
null
,
fileList
:
[],
isHide
:
false
}
},
computed
:
{
// 是否显示提示
showTip
()
{
return
this
.
isShowTip
&&
(
this
.
fileType
||
this
.
fileSize
);
},
},
methods
:
{
// 上传前校检格式和大小
handleBeforeUpload
(
file
)
{
// 校检文件类型
if
(
this
.
fileType
)
{
let
fileExtension
=
""
;
if
(
file
.
name
.
lastIndexOf
(
"."
)
>
-
1
)
{
fileExtension
=
file
.
name
.
slice
(
file
.
name
.
lastIndexOf
(
"."
)
+
1
);
}
const
isTypeOk
=
this
.
fileType
.
some
((
type
)
=>
{
if
(
file
.
type
.
indexOf
(
type
)
>
-
1
)
return
true
;
if
(
fileExtension
&&
fileExtension
.
indexOf
(
type
)
>
-
1
)
return
true
;
return
false
;
});
if
(
!
isTypeOk
)
{
this
.
$message
.
error
(
`文件格式不正确, 请上传
${
this
.
fileType
.
join
(
"/"
)}
格式文件!`
);
return
false
;
}
}
// 校检文件大小
if
(
this
.
fileSize
)
{
const
isLt
=
file
.
size
/
1024
/
1024
<
this
.
fileSize
;
if
(
!
isLt
)
{
this
.
$message
.
error
(
`上传文件大小不能超过
${
this
.
fileSize
}
MB!`
);
return
false
;
}
}
return
true
;
},
// 文件个数超出
handleExceed
()
{
this
.
$message
.
error
(
`只允许上传单`
+
this
.
limit
+
`文件`
);
},
handleUploadSuccess
(
res
,
file
,
fileList
)
{
if
(
res
.
code
==
200
)
{
let
files
=
this
.
getFile
(
fileList
);
this
.
$message
.
success
(
"上传成功"
);
this
.
$emit
(
"input"
,
JSON
.
stringify
(
files
));
this
.
hideUpload
(
fileList
);
}
},
handleUploadError
()
{
this
.
$message
.
error
(
"上传失败, 请重试"
);
},
handlePictureCardPreview
(
file
)
{
this
.
dialogImageUrl
=
file
.
url
;
this
.
$refs
.
previewImg
.
showViewer
=
true
;
},
handleRemove
(
file
,
fileList
)
{
let
files
=
this
.
getFile
(
fileList
);
this
.
$emit
(
"input"
,
JSON
.
stringify
(
files
));
this
.
hideUpload
(
fileList
);
},
getFile
(
fileList
){
if
(
fileList
.
every
(
item
=>
item
.
status
==
"success"
))
{
//由于fileList是所有的文件包含之前已上传过的,这里需要做区分(带response的即为新上传的)
return
fileList
.
map
(
item
=>
{
const
files
=
{
name
:
item
.
name
};
if
(
item
.
response
){
files
.
url
=
item
.
response
.
url
;
}
else
{
files
.
url
=
item
.
url
;
}
return
files
;
})
}
else
{
return
[];
}
},
hideUpload
(
fileList
){
if
(
fileList
.
length
>
4
){
this
.
isHide
=
true
;
}
else
{
this
.
isHide
=
false
;
}
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.
hide
:
:
v-deep
.
el-upload--picture-card
{
display
:
none
;
}
</
style
>
huaxin-web/src/components/MultipleImageUpload/index.vue
View file @
236a20c0
...
@@ -163,7 +163,7 @@
...
@@ -163,7 +163,7 @@
}
}
},
},
hideUpload
(
fileList
){
hideUpload
(
fileList
){
if
(
fileList
.
length
>
4
){
if
(
fileList
.
length
>
this
.
limit
){
this
.
isHide
=
true
;
this
.
isHide
=
true
;
}
else
{
}
else
{
this
.
isHide
=
false
;
this
.
isHide
=
false
;
...
...
huaxin-web/src/views/safe/inspect/index.vue
View file @
236a20c0
This diff is collapsed.
Click to expand it.
huaxin-web/src/views/safe/meeting/index.vue
View file @
236a20c0
This diff is collapsed.
Click to expand it.
huaxin-web/src/views/safe/train/index.vue
View file @
236a20c0
This diff is collapsed.
Click to expand it.
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