Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gk
Project
Project
Details
Activity
Releases
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
micro_app
gk
Commits
99d80d9c
Commit
99d80d9c
authored
Jun 15, 2025
by
daniel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(road): 轨迹上传代码恢复
parent
2541552b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
road-new.js
src/main/webapp/static/js/road-new.js
+13
-11
No files found.
src/main/webapp/static/js/road-new.js
View file @
99d80d9c
const
uploadUrl
=
'/api-common/v1/upload?folder='
+
'gk/cmptLogo'
+
'&cmptId='
+
getCId
()
var
layers
=
[];
$
(
document
).
ready
(
function
()
{
$
(
'body'
).
on
(
'click'
,
'.addTempalte'
,
function
()
{
...
...
@@ -204,7 +203,7 @@ $(document).ready(function () {
//文件上传处理
function
uploadFile
(
obj
)
{
var
reads
=
new
FileReader
();
f
ile
=
obj
.
files
[
0
];
logoF
ile
=
obj
.
files
[
0
];
var
dataId
=
$
(
obj
).
parent
().
parent
().
parent
().
attr
(
'data-id'
);
var
pathId
=
$
(
obj
).
parent
().
parent
().
parent
().
attr
(
'data-path-id'
);
var
pathName
=
$
(
'#pathName'
).
val
();
...
...
@@ -212,35 +211,38 @@ function uploadFile(obj) {
layer
.
msg
(
'请输入路线名称!'
);
return
false
;
}
var
suffix
=
file
.
name
.
substr
(
f
ile
.
name
.
lastIndexOf
(
"."
)
+
1
);
var
suffix
=
logoFile
.
name
.
substr
(
logoF
ile
.
name
.
lastIndexOf
(
"."
)
+
1
);
if
(
"gpx"
!=
suffix
&&
"kml"
!=
suffix
)
{
layer
.
msg
(
'文件格式不正确!'
);
return
false
;
}
reads
.
readAsDataURL
(
f
ile
);
reads
.
readAsDataURL
(
logoF
ile
);
reads
.
onload
=
function
(
e
)
{
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"
file"
,
f
ile
);
formData
.
append
(
"
uploadImg"
,
logoF
ile
);
$
.
ajax
({
url
:
uploadFile
,
/*接口域名地址*/
url
:
'https://event.geexek.com/upload/file.do'
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
processData
:
false
,
success
:
function
(
res
)
{
console
.
log
(
res
);
if
(
res
.
code
==
"1"
)
{
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
$
(
'.equip-item[data-id='
+
dataId
+
']'
).
attr
(
'data-file-name'
,
f
ile
.
name
);
$
(
'.equip-item[data-id='
+
dataId
+
']'
).
attr
(
'data-file-name'
,
logoF
ile
.
name
);
$
(
'.equip-item[data-id='
+
dataId
+
']'
).
attr
(
'data-file-url'
,
res
.
result
);
$
(
'.equip-item[data-id='
+
dataId
+
']'
).
attr
(
'data-file-size'
,
f
ile
.
size
/
1024
);
$
(
'#gpsName'
).
text
(
f
ile
.
name
);
saveRoad
(
dataId
,
pathId
,
pathName
,
file
.
name
,
res
.
content
,
f
ile
.
size
/
1024
);
$
(
'.equip-item[data-id='
+
dataId
+
']'
).
attr
(
'data-file-size'
,
logoF
ile
.
size
/
1024
);
$
(
'#gpsName'
).
text
(
logoF
ile
.
name
);
saveRoad
(
dataId
,
pathId
,
pathName
,
logoFile
.
name
,
res
.
result
,
logoF
ile
.
size
/
1024
);
clearLayers
()
loadGps
(
res
.
conten
t
);
loadGps
(
res
.
resul
t
);
// $('.equip-item[data-id='+dataId+']').find('.edit-new').trigger('click');
$
(
'#route-file'
).
val
(
''
);
}
else
{
console
.
log
(
res
);
}
}
})
...
...
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