Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
白杨
/
shrae-app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit aced5637
authored
Mar 07, 2018
by
lixiaofeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/HEAD' into share-app/lxf
2 parents
031bc3c5
eb22d5b0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
19 deletions
dataPage.html
src/js/imgUp.js
src/js/main.js
src/js/saasService.js
dataPage.html
View file @
aced563
...
@@ -163,7 +163,7 @@
...
@@ -163,7 +163,7 @@
"\t\t\t<hr class=\"layui-bg-gray\">"
"\t\t\t<hr class=\"layui-bg-gray\">"
}
}
for
(
var
i
=
0
;
i
<
photo
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
photo
.
length
;
i
++
){
photo
[
i
].
photoPath
=
"http://114.55.43.0:16907
/v1/point/getFile?ak=30bdc45ee00940cda7917d134fdb1523&filePath="
+
photo
[
i
].
photoPath
photo
[
i
].
photoPath
=
saas
.
url
+
"
/v1/point/getFile?ak=30bdc45ee00940cda7917d134fdb1523&filePath="
+
photo
[
i
].
photoPath
strImg
+=
"<img src="
+
photo
[
i
].
photoPath
+
" class=\"item\"/>"
strImg
+=
"<img src="
+
photo
[
i
].
photoPath
+
" class=\"item\"/>"
Imgarr
.
push
(
photo
[
i
].
photoPath
)
Imgarr
.
push
(
photo
[
i
].
photoPath
)
}
}
...
...
src/js/imgUp.js
View file @
aced563
//网点id
var
pointId
=
localStorage
.
getItem
(
'pointId'
);
$
(
function
(){
$
(
function
(){
var
delParent
;
var
delParent
;
var
defaults
=
{
var
defaults
=
{
fileType
:
[
"jpg"
,
"png"
,
"bmp"
,
"jpeg"
],
// 上传文件的类垿
fileType
:
[
"jpg"
,
"png"
,
"bmp"
,
"jpeg"
],
// 上传文件的类垿
fileSize
:
1024
*
1024
*
10
// 上传文件的大尿 10M
fileSize
:
1024
*
1024
*
10
// 上传文件的大尿 10M
...
@@ -124,19 +128,25 @@ function saveReturn(){
...
@@ -124,19 +128,25 @@ function saveReturn(){
console
.
log
(
"file数据"
+
file
);
console
.
log
(
"file数据"
+
file
);
var
formData
=
new
FormData
();
var
formData
=
new
FormData
();
formData
.
append
(
'file'
,
file
);
formData
.
append
(
'file'
,
file
);
$
.
ajax
({
// $.ajax({
url
:
"/home/about"
,
// url: "/home/about",
type
:
"post"
,
// type: "post",
data
:
formData
,
// data: formData,
contentType
:
false
,
// contentType: false,
processData
:
false
,
// processData: false,
mimeType
:
"multipart/form-data"
,
// mimeType: "multipart/form-data",
success
:
function
(
data
)
{
// success: function (data) {
//
// console.log("返回正确数据"+data);
// },
// error: function (data) {
// console.log("错误返回数据"+data);
// }
// });
var
url
=
"/v1/point/uploadPhoto?ak="
+
saas
.
url
+
"&pointId="
+
pointId
;
saas
.
upLoadHttpRequest
(
url
,
formData
,
function
(
data
)
{
console
.
log
(
"返回正确数据"
+
data
);
console
.
log
(
"返回正确数据"
+
data
);
},
},
function
(
error
)
{
error
:
function
(
data
)
{
console
.
log
(
"错误返回数据"
+
error
);
console
.
log
(
"错误返回数据"
+
data
);
}
});
});
}
}
\ No newline at end of file
src/js/main.js
View file @
aced563
...
@@ -129,8 +129,10 @@ var main = {
...
@@ -129,8 +129,10 @@ var main = {
//注销控件
//注销控件
// main.dragFeature.deactivate();
// main.dragFeature.deactivate();
main
.
drawPoint
.
deactivate
();
main
.
drawPoint
.
deactivate
();
// var point = this.pointFeature.geometry.getCentroid();
//获取当前feature坐标
// console.log(point.x+","+point.y);
var
geometry
=
main
.
currentPoint
.
geometry
.
getCentroid
();
//修改网点坐标
main
.
updatePoint
(
geometry
.
x
,
geometry
.
y
);
}
}
},
},
addMarker
:
function
(
pointX
,
pointY
,
code
,
iconPath
)
{
addMarker
:
function
(
pointX
,
pointY
,
code
,
iconPath
)
{
...
@@ -163,14 +165,14 @@ var main = {
...
@@ -163,14 +165,14 @@ var main = {
main
.
currentPoint
=
eventArgs
.
feature
;
main
.
currentPoint
=
eventArgs
.
feature
;
main
.
vectorLayer
.
removeAllFeatures
();
main
.
vectorLayer
.
removeAllFeatures
();
main
.
vectorLayer
.
addFeatures
(
main
.
currentPoint
);
main
.
vectorLayer
.
addFeatures
(
main
.
currentPoint
);
var
geometry
=
eventArgs
.
feature
.
geometry
.
getCentroid
();
//
var geometry = eventArgs.feature.geometry.getCentroid();
main
.
updatePoint
(
geometry
.
x
,
geometry
.
y
);
//
main.updatePoint(geometry.x,geometry.y);
},
},
updatePoint
:
function
(
x
,
y
)
{
updatePoint
:
function
(
x
,
y
)
{
var
method
=
"/point/updatePoint"
;
var
method
=
"/point/updatePoint"
;
var
parameter
=
{
var
parameter
=
{
custom_id
:
"{\"fieldName\":\"名称\",\"fieldValue\":\"网点1\"}"
,
custom_id
:
"{\"fieldName\":\"名称\",\"fieldValue\":\"网点1\"}"
,
infos
:
"
{\"fieldName\":\"名称\",\"fieldValue\":\"网点1\"}
"
,
infos
:
"
[{\"fieldName\":\"名称\",\"fieldValue\":\"网点1\"}]
"
,
x
:
x
,
x
:
x
,
y
:
y
,
y
:
y
,
coord_type
:
"gcj02mc"
coord_type
:
"gcj02mc"
...
...
src/js/saasService.js
View file @
aced563
...
@@ -37,5 +37,18 @@ var saas = {
...
@@ -37,5 +37,18 @@ var saas = {
error
:
errorComplate
,
error
:
errorComplate
,
};
};
$
.
ajax
(
config
);
$
.
ajax
(
config
);
},
upLoadHttpRequest
:
function
(
method
,
formData
,
successComplate
,
errorComplate
)
{
var
config
=
{
url
:
saas
.
url
+
method
,
type
:
"post"
,
data
:
formData
,
contentType
:
false
,
processData
:
false
,
mimeType
:
"multipart/form-data"
,
success
:
successComplate
,
error
:
errorComplate
,
};
$
.
ajax
(
config
);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment