Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zh-baseversion-project
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
王浩
zh-baseversion-project
Commits
151f2366
Commit
151f2366
authored
Jul 31, 2024
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 阀井/调压箱 修改时之前图片重复显示, 有的不显示问题修复。
parent
1be08101
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
23 deletions
+60
-23
TDeviceInfoController.java
...ehong/web/controller/supervise/TDeviceInfoController.java
+12
-12
index.vue
zh-baseversion-web/src/views/regulation/device/index.vue
+48
-11
No files found.
zh-baseversion-admin/src/main/java/com/zehong/web/controller/supervise/TDeviceInfoController.java
View file @
151f2366
...
...
@@ -146,18 +146,18 @@ public class TDeviceInfoController extends BaseController
public
AjaxResult
edit
(
@RequestBody
TDeviceInfo
tDeviceInfo
)
{
TDeviceInfo
tDeviceInfos
=
tDeviceInfoService
.
selectTDeviceInfoById
(
tDeviceInfo
.
getDeviceId
());
//文件删除
if
(
tDeviceInfos
.
getIconUrl
()!=
null
){
// 上传文件路径
String
filePath
=
GassafetyProgressConfig
.
getUploadPath
();
String
[]
strs
=
tDeviceInfos
.
getIconUrl
().
split
(
"upload"
);
//删除图片
File
file
=
new
File
(
filePath
+
strs
[
1
].
toString
());
// 上传文件路径
if
(
file
.
isFile
()){
file
.
delete
();
}
}
//文件删除
20240731 wh 调整去掉删除
//
if (tDeviceInfos.getIconUrl()!=null){
//
// 上传文件路径
//
String filePath = GassafetyProgressConfig.getUploadPath();
//
String[] strs = tDeviceInfos.getIconUrl().split("upload");
//
//删除图片
//
File file = new File(filePath+strs[1].toString());
//
// 上传文件路径
//
if(file.isFile()){
//
file.delete();
//
}
//
}
//根据企业id查询企业名称
String
EnterpriseName
=
tEmployedPeopleInfoService
.
selectEnterpriseName
(
tDeviceInfo
.
getBeyondEnterpriseId
());
tDeviceInfo
.
setBeyondEnterpriseName
(
EnterpriseName
);
...
...
zh-baseversion-web/src/views/regulation/device/index.vue
View file @
151f2366
...
...
@@ -115,7 +115,7 @@
<
span
v
-
else
>-<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"照片"
align
=
"center"
>
<
!--
<
el
-
table
-
column
label
=
"照片"
align
=
"center"
>
<
template
slot
-
scope
=
"List"
>
<
img
:
src
=
"List.row.iconUrl"
width
=
"100px"
>
<
/template
>
...
...
@@ -131,7 +131,7 @@
<
/span
>
<
span
v
-
else
>-<
/span
>
<
/template
>
<
/el-table-column
>
<
/el-table-column>
--
>
<
el
-
table
-
column
label
=
"操作"
align
=
"center"
class
-
name
=
"small-padding fixed-width"
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
button
...
...
@@ -519,6 +519,7 @@ export default {
relationImg
:
require
(
'@/assets/project/relation.png'
),
//头像
fileList
:
[],
pictureUrlList
:[],
/**弹出层*/
//下级设备数据数组
tableData
:
[],
...
...
@@ -656,9 +657,10 @@ export default {
}
,
methods
:
{
/**上传头像*/
getFileInfo
(
res
){
this
.
form
.
dealPlan
=
res
.
fileName
;
this
.
form
.
iconUrl
=
res
.
url
;
getFileInfo
(
res
){
this
.
pictureUrlList
.
push
(
res
.
url
)
// this.form.iconUrl = res.url;
this
.
form
.
iconUrl
=
this
.
pictureUrlList
.
join
(
","
);
this
.
form
.
burl
=
res
.
burl
;
this
.
fileList
.
push
({
name
:
res
.
fileName
,
...
...
@@ -670,8 +672,31 @@ export default {
window
.
open
(
url
,
'_blank'
);
}
,
listRemove
(
e
)
{
this
.
form
.
dealPlan
=
""
;
this
.
fileList
=
[];
this
.
form
.
dealPlan
=
""
;
let
deleteIndex
=
-
1
;
for
(
var
i
=
0
;
i
<
this
.
fileList
.
length
;
i
++
){
const
item
=
this
.
fileList
[
i
];
if
(
item
.
uid
==
e
.
uid
)
{
deleteIndex
=
i
;
}
}
if
(
deleteIndex
>
-
1
)
{
this
.
form
.
iconUrl
=
""
;
this
.
fileList
.
splice
(
deleteIndex
,
1
);
this
.
pictureUrlList
=
[];
if
(
this
.
fileList
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
this
.
fileList
.
length
;
i
++
){
const
item
=
this
.
fileList
[
i
]
;
console
.
log
(
"item.url"
+
item
.
url
);
this
.
pictureUrlList
.
push
(
item
.
url
);
this
.
form
.
iconUrl
=
this
.
pictureUrlList
.
join
(
","
);
}
}
}
console
.
log
(
"this.form.iconUrl = "
+
this
.
form
.
iconUrl
);
// this.fileList = [];
}
,
/** 查询设备信息列表 */
getList
()
{
...
...
@@ -784,12 +809,20 @@ export default {
this
.
loadings
=
false
;
}
);
// 隐患信息 上传照片清空
this
.
fileList
=
[];
this
.
pictureUrlList
=
[];
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加设备信息"
;
}
,
/** 修改按钮操作 */
handleUpdate
(
row
)
{
// 隐患信息 上传照片清空
this
.
fileList
=
[];
this
.
pictureUrlList
=
[];
//查询企业名称下拉框数据
selectTEnterprise
().
then
(
response
=>
{
this
.
test
=
response
.
data
;
...
...
@@ -811,10 +844,14 @@ export default {
this
.
form
=
response
.
data
;
//图片回显
if
(
this
.
form
.
iconUrl
)
{
this
.
fileList
.
push
({
name
:
'照片'
,
url
:
this
.
form
.
iconUrl
,
}
);
for
(
var
i
=
0
;
i
<
this
.
form
.
iconUrl
.
split
(
','
).
length
;
i
++
){
console
.
log
(
"this.form.iconUrl.split(',')"
+
i
+
"=== "
+
this
.
form
.
iconUrl
.
split
(
','
)[
i
]);
this
.
pictureUrlList
.
push
(
this
.
form
.
iconUrl
.
split
(
','
)[
i
])
this
.
fileList
.
push
({
name
:
'照片'
,
url
:
this
.
form
.
iconUrl
.
split
(
','
)[
i
],
}
);
}
}
this
.
open
=
true
;
this
.
title
=
"修改设备信息"
;
...
...
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