Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Skyeye云
Skyeye
提交
a5ae7b7c
S
Skyeye
项目概览
Skyeye云
/
Skyeye
通知
1436
Star
162
Fork
130
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a5ae7b7c
编写于
8月 25, 2023
作者:
Skyeye云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 写入学校数据管理托管到表单布局
上级
17913f88
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
394 deletion
+0
-394
school/src/main/resources/template/js/school/writeSchool.js
school/src/main/resources/template/js/school/writeSchool.js
+0
-294
school/src/main/resources/template/tpl/school/writeSchool.html
...l/src/main/resources/template/tpl/school/writeSchool.html
+0
-100
未找到文件。
school/src/main/resources/template/js/school/writeSchool.js
已删除
100644 → 0
浏览文件 @
17913f88
var
map
,
district
,
polygons
=
[];
var
citySelect
;
var
districtSelect
;
var
marker
=
null
;
var
longitude
=
""
;
//经度
var
latitude
=
""
;
//纬度
layui
.
config
({
base
:
basePath
,
version
:
skyeyeVersion
}).
extend
({
window
:
'
js/winui.window
'
}).
define
([
'
window
'
,
'
jquery
'
,
'
winui
'
,
'
form
'
,
'
fullscreen
'
],
function
(
exports
)
{
winui
.
renderColor
();
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
var
$
=
layui
.
$
,
form
=
layui
.
form
;
var
id
=
GetUrlParam
(
"
id
"
);
if
(
!
isNull
(
id
))
{
AjaxPostUtil
.
request
({
url
:
sysMainMation
.
schoolBasePath
+
"
querySchoolById
"
,
params
:
{
id
:
id
},
type
:
'
json
'
,
method
:
'
GET
'
,
callback
:
function
(
json
)
{
$
(
"
#name
"
).
val
(
json
.
bean
.
name
);
$
(
"
#remark
"
).
val
(
json
.
bean
.
remark
);
skyeyeClassEnumUtil
.
showEnumDataListByClassName
(
"
schoolPower
"
,
'
radio
'
,
"
power
"
,
json
.
bean
.
power
,
form
);
longitude
=
json
.
bean
.
longitude
;
latitude
=
json
.
bean
.
latitude
;
initMap
();
$
(
"
#longitude
"
).
val
(
longitude
);
$
(
"
#latitude
"
).
val
(
latitude
);
$
(
"
#absoluteAddress
"
).
val
(
json
.
bean
.
absoluteAddress
);
}});
}
else
{
skyeyeClassEnumUtil
.
showEnumDataListByClassName
(
"
schoolPower
"
,
'
radio
'
,
"
power
"
,
null
,
form
);
}
matchingLanguage
();
form
.
render
();
form
.
on
(
'
submit(formAddBean)
'
,
function
(
data
)
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
var
pId
=
'
0
'
;
if
(
$
(
"
input[name='schoolType']:checked
"
).
val
()
==
'
2
'
){
if
(
isNull
(
$
(
"
#OverAllSchool
"
).
val
()))
{
winui
.
window
.
msg
(
'
请选择父学校
'
,
{
icon
:
2
,
time
:
2000
});
return
false
;
}
else
{
pId
=
$
(
"
#OverAllSchool
"
).
val
();
}
}
var
lnglatXY
=
[
$
(
"
#longitude
"
).
val
(),
$
(
"
#latitude
"
).
val
()];
//地图上所标点的坐标
geocoder
.
getAddress
(
lnglatXY
,
function
(
status
,
result
)
{
if
(
status
===
'
complete
'
&&
result
.
info
===
'
OK
'
)
{
var
params
=
{
id
:
isNull
(
id
)
?
''
:
id
,
name
:
$
(
"
#name
"
).
val
(),
remark
:
$
(
"
#remark
"
).
val
(),
provinceId
:
result
.
regeocode
.
addressComponent
.
province
,
cityId
:
result
.
regeocode
.
addressComponent
.
city
,
areaId
:
result
.
regeocode
.
addressComponent
.
district
,
townshipId
:
''
,
longitude
:
$
(
"
#longitude
"
).
val
(),
latitude
:
$
(
"
#latitude
"
).
val
(),
power
:
dataShowType
.
getData
(
'
power
'
),
absoluteAddress
:
$
(
"
#absoluteAddress
"
).
val
()
};
AjaxPostUtil
.
request
({
url
:
sysMainMation
.
schoolBasePath
+
"
writeSchool
"
,
params
:
params
,
type
:
'
json
'
,
method
:
'
POST
'
,
callback
:
function
(
json
)
{
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
0
'
;
}});
}
else
{
winui
.
window
.
msg
(
'
地图信息获取失败.
'
,
{
icon
:
2
,
time
:
2000
});
}
});
}
return
false
;
});
//加载地图
initMap
();
function
initMap
(){
if
(
!
isNull
(
latitude
)
&&
!
isNull
(
longitude
)){
map
=
new
AMap
.
Map
(
'
container
'
,
{
resizeEnable
:
true
,
zoom
:
11
,
center
:
[
longitude
,
latitude
]
});
}
else
{
map
=
new
AMap
.
Map
(
'
container
'
,
{
resizeEnable
:
true
,
zoom
:
5
,
center
:
[
113.65
,
34.76
]
});
}
//加载插件
AMap
.
service
(
'
AMap.Geocoder
'
,
function
(){
//回调函数
//实例化Geocoder
geocoder
=
new
AMap
.
Geocoder
({});
});
//在地图上进行标记
marker
=
new
AMap
.
Marker
({
map
:
map
,
bubble
:
true
});
//通过地址获取经纬度
var
input
=
document
.
getElementById
(
'
absoluteAddress
'
);
map
.
on
(
'
click
'
,
function
(
e
)
{
geocoder
.
getAddress
(
e
.
lnglat
,
function
(
status
,
result
){
if
(
status
==
'
complete
'
)
{
input
.
value
=
result
.
regeocode
.
formattedAddress
;
var
address
=
input
.
value
;
geocoder
.
getLocation
(
address
,
function
(
status
,
result
)
{
if
(
status
==
'
complete
'
&&
result
.
geocodes
.
length
)
{
marker
.
setPosition
(
result
.
geocodes
[
0
].
location
);
map
.
setCenter
(
marker
.
getPosition
());
$
(
"
#longitude
"
).
val
(
result
.
geocodes
[
0
].
location
.
lng
);
$
(
"
#latitude
"
).
val
(
result
.
geocodes
[
0
].
location
.
lat
);
}
})
}
});
});
input
.
onchange
=
function
(
e
)
{
var
address
=
input
.
value
;
geocoder
.
getLocation
(
address
,
function
(
status
,
result
){
if
(
status
==
'
complete
'
&&
result
.
geocodes
.
length
){
marker
.
setPosition
(
result
.
geocodes
[
0
].
location
);
map
.
setCenter
(
marker
.
getPosition
());
$
(
"
#longitude
"
).
val
(
result
.
geocodes
[
0
].
location
.
lng
);
$
(
"
#latitude
"
).
val
(
result
.
geocodes
[
0
].
location
.
lat
);
}
})
};
citySelect
=
document
.
getElementById
(
'
city
'
);
districtSelect
=
document
.
getElementById
(
'
district
'
);
//行政区划查询
var
opts
=
{
subdistrict
:
1
,
//返回下一级行政区
showbiz
:
false
//最后一级返回街道信息
};
district
=
new
AMap
.
DistrictSearch
(
opts
);
//注意:需要使用插件同步下发功能才能这样直接使用
district
.
search
(
'
中国
'
,
function
(
status
,
result
)
{
if
(
status
==
'
complete
'
)
{
getData
(
result
.
districtList
[
0
]);
}
});
$
(
"
#qp
"
).
click
(
function
(
e
)
{
$
(
"
#qpDiv
"
).
fullScreen
();
});
}
function
getData
(
data
,
level
)
{
var
bounds
=
data
.
boundaries
;
if
(
level
===
'
district
'
)
{
for
(
var
i
=
0
,
l
=
bounds
.
length
;
i
<
l
;
i
++
)
{
var
polygon
=
new
AMap
.
Polygon
({
map
:
map
,
fillColor
:
'
#CCF3FF
'
,
fillOpacity
:
0.5
,
path
:
bounds
[
i
],
strokeColor
:
"
#FF33FF
"
,
//线颜色
strokeOpacity
:
1
,
//线透明度
strokeWeight
:
3
,
//线宽
strokeStyle
:
"
solid
"
//线样式
});
var
input
=
document
.
getElementById
(
'
absoluteAddress
'
);
polygon
.
on
(
'
click
'
,
function
(
e
)
{
geocoder
.
getAddress
(
e
.
lnglat
,
function
(
status
,
result
){
if
(
status
==
'
complete
'
){
input
.
value
=
result
.
regeocode
.
formattedAddress
;
var
address
=
input
.
value
;
geocoder
.
getLocation
(
address
,
function
(
status
,
result
){
if
(
status
==
'
complete
'
&&
result
.
geocodes
.
length
){
marker
.
setPosition
(
result
.
geocodes
[
0
].
location
);
map
.
setCenter
(
marker
.
getPosition
());
$
(
"
#longitude
"
).
val
(
result
.
geocodes
[
0
].
location
.
lng
);
$
(
"
#latitude
"
).
val
(
result
.
geocodes
[
0
].
location
.
lat
);
}
})
}
});
});
polygons
.
push
(
polygon
);
}
map
.
setFitView
();
//地图自适应
}
var
subList
=
data
.
districtList
;
if
(
subList
)
{
var
contentSub
=
new
Option
(
'
--请选择--
'
);
var
curlevel
=
subList
[
0
].
level
;
var
curList
=
document
.
querySelector
(
'
#
'
+
curlevel
);
if
(
!
isNull
(
curList
))
{
curList
.
add
(
contentSub
);
}
for
(
var
i
=
0
,
l
=
subList
.
length
;
i
<
l
;
i
++
)
{
var
name
=
subList
[
i
].
name
;
var
levelSub
=
subList
[
i
].
level
;
var
cityCode
=
subList
[
i
].
citycode
;
contentSub
=
new
Option
(
name
);
contentSub
.
setAttribute
(
"
value
"
,
levelSub
+
i
);
contentSub
.
center
=
subList
[
i
].
center
;
contentSub
.
adcode
=
subList
[
i
].
adcode
;
if
(
!
isNull
(
curList
)){
curList
.
add
(
contentSub
);
}
if
(
level
!=
'
district
'
){
district
.
search
(
subList
[
i
].
adcode
,
function
(
status
,
result
)
{
if
(
status
===
'
complete
'
){
var
bounds
=
result
.
districtList
[
0
].
boundaries
;
if
(
bounds
)
{
for
(
var
i
=
0
,
l
=
bounds
.
length
;
i
<
l
;
i
++
)
{
var
polygon
=
new
AMap
.
Polygon
({
map
:
map
,
fillColor
:
'
#CCF3FF
'
,
fillOpacity
:
0.5
,
path
:
bounds
[
i
],
strokeColor
:
"
#FF33FF
"
,
//线颜色
strokeOpacity
:
1
,
//线透明度
strokeWeight
:
3
,
//线宽
strokeStyle
:
"
solid
"
//线样式
});
var
input
=
document
.
getElementById
(
'
absoluteAddress
'
);
polygon
.
on
(
'
click
'
,
function
(
e
)
{
geocoder
.
getAddress
(
e
.
lnglat
,
function
(
status
,
result
){
if
(
status
==
'
complete
'
){
input
.
value
=
result
.
regeocode
.
formattedAddress
;
var
address
=
input
.
value
;
geocoder
.
getLocation
(
address
,
function
(
status
,
result
){
if
(
status
==
'
complete
'
&&
result
.
geocodes
.
length
){
marker
.
setPosition
(
result
.
geocodes
[
0
].
location
);
map
.
setCenter
(
marker
.
getPosition
());
$
(
"
#longitude
"
).
val
(
result
.
geocodes
[
0
].
location
.
lng
);
$
(
"
#latitude
"
).
val
(
result
.
geocodes
[
0
].
location
.
lat
);
}
})
}
});
});
polygons
.
push
(
polygon
);
}
map
.
setFitView
();
//地图自适应
}
}
});
}
}
}
form
.
render
(
"
select
"
);
}
form
.
on
(
'
select(province)
'
,
function
(
data
)
{
citySelect
.
innerHTML
=
''
;
districtSelect
.
innerHTML
=
''
;
form
.
render
(
"
select
"
);
search
(
document
.
getElementById
(
'
province
'
));
});
form
.
on
(
'
select(city)
'
,
function
(
data
)
{
districtSelect
.
innerHTML
=
''
;
form
.
render
(
"
select
"
);
search
(
document
.
getElementById
(
'
city
'
));
});
form
.
on
(
'
select(district)
'
,
function
(
data
)
{
search
(
document
.
getElementById
(
'
district
'
));
});
function
search
(
obj
)
{
//清除地图上所有覆盖物
for
(
var
i
=
0
,
l
=
polygons
.
length
;
i
<
l
;
i
++
)
{
polygons
[
i
].
setMap
(
null
);
}
var
option
=
obj
[
obj
.
options
.
selectedIndex
];
var
keyword
=
option
.
text
;
//关键字
var
adcode
=
option
.
adcode
;
district
.
setLevel
(
option
.
value
);
//行政区级别
district
.
setExtensions
(
'
all
'
);
//行政区查询
//按照adcode进行查询可以保证数据返回的唯一性
district
.
search
(
adcode
,
function
(
status
,
result
)
{
if
(
status
===
'
complete
'
)
{
getData
(
result
.
districtList
[
0
],
obj
.
id
);
}
});
}
// 取消
$
(
"
body
"
).
on
(
"
click
"
,
"
#cancle
"
,
function
()
{
parent
.
layer
.
close
(
index
);
});
});
\ No newline at end of file
school/src/main/resources/template/tpl/school/writeSchool.html
已删除
100644 → 0
浏览文件 @
17913f88
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
/>
<title></title>
<link
href=
"../../assets/lib/layui/css/layui.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/winui/css/winui.css"
rel=
"stylesheet"
/>
<link
rel=
"stylesheet"
href=
"http://cache.amap.com/lbs/static/main.css?v=1.0?v=1.0"
/>
<style
type=
"text/css"
>
#tip
.layui-form-select
{
width
:
100px
;
float
:
left
;
height
:
28px
;
padding-left
:
0px
;
padding-right
:
0px
;
}
</style>
</head>
<body>
<div
style=
"margin:0 auto; padding: 20px;"
>
<form
class=
"layui-form"
action=
""
id=
"showForm"
autocomplete=
"off"
>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
学校名称
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
id=
"name"
name=
"name"
win-verify=
"required"
placeholder=
"请输入学校名称"
class=
"layui-input"
maxlength=
"50"
/>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
经度
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
id=
"longitude"
win-verify=
"required"
placeholder=
"请进行地图定位"
disabled
class=
"layui-input"
/>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
纬度
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
id=
"latitude"
win-verify=
"required"
placeholder=
"请进行地图定位"
disabled
class=
"layui-input"
/>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
地址
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
id=
"absoluteAddress"
win-verify=
"required"
placeholder=
"请进行地图定位"
disabled
class=
"layui-input"
/>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
地图定位
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block ver-center"
>
<div
class=
"layui-col-xs12"
style=
"height:400px;"
>
<div
class=
"col-sm-12"
style=
"height:100%;"
id=
"qpDiv"
>
<div
id=
"container"
class=
"form-group"
style=
"height:100%;"
>
</div>
<div
id=
"tip"
>
<font
style=
"float: left;"
>
省:
</font><select
id=
'province'
win-verify=
"required"
lay-filter=
"province"
lay-search=
""
></select>
<font
style=
"float: left;"
>
市:
</font><select
id=
'city'
win-verify=
"required"
lay-filter=
"city"
lay-search=
""
></select>
<font
style=
"float: left;"
>
区:
</font><select
id=
'district'
win-verify=
"required"
lay-filter=
"district"
lay-search=
""
></select>
<font
style=
"float: left;"
id=
"qp"
>
全屏
</font>
</div>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
数据权限
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block winui-radio"
id=
"power"
win-verify=
"required"
>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
学校简介
</label>
<div
class=
"layui-input-block"
>
<textarea
id=
"remark"
name=
"remark"
placeholder=
"请输入简介"
class=
"layui-textarea"
></textarea>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<div
class=
"layui-input-block"
>
<button
class=
"winui-btn"
id=
"cancle"
><language
showName=
"com.skyeye.cancel"
></language></button>
<button
class=
"winui-btn"
lay-submit
lay-filter=
"formAddBean"
><language
showName=
"com.skyeye.save"
></language></button>
</div>
</div>
</form>
</div>
<script
src=
"../../assets/lib/layui/lay/modules/ace/ace.js"
></script>
<script
src=
"../../assets/lib/layui/layui.js"
></script>
<script
src=
"../../assets/lib/layui/custom.js"
></script>
<script
type=
"text/javascript"
>
window
.
_AMapSecurityConfig
=
{
securityJsCode
:
sysMainMation
.
skyeyeMapKey
}
</script>
<script
type=
"text/javascript"
src=
"http://webapi.amap.com/maps?v=1.4.6&key=7e3eb4aa298949346daf89edeeb3dec8&plugin=AMap.DistrictSearch"
></script>
<script
type=
"text/javascript"
src=
"https://webapi.amap.com/demos/js/liteToolbar.js"
></script>
<script
type=
"text/javascript"
>
layui
.
config
({
base
:
'
../../js/school/
'
}).
use
(
'
writeSchool
'
);
</script>
</body>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录