Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
Jz-Php
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
Jz-Php
Commits
39d8a098
提交
39d8a098
authored
3月 18, 2020
作者:
chengye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加地图功能
上级
14ad895f
全部展开
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
312 行增加
和
0 行删除
+312
-0
Region.php
application/em/controller/Region.php
+158
-0
form.html
application/em/view/public/form.html
+132
-0
head.html
application/em/view/public/head.html
+22
-0
region_list.html
application/em/view/region/region_list.html
+0
-0
没有找到文件。
application/em/controller/Region.php
0 → 100644
浏览文件 @
39d8a098
<?php
/**
* v2 地图模块
*/
namespace
app\em\controller
;
use
app\admin\controller\Base
;
use
app\admin\model\DepartmentModel
;
use
app\admin\model\ElectricMeter
;
use
app\admin\model\ElectricMeterType
;
use
app\admin\model\OperatorModel
;
use
app\admin\model\StaffModel
;
use
app\admin\model\BaseStationModel
;
use
think\Exception
;
use
think\facade\Request
;
use
think\facade\Session
;
class
Region
extends
Base
{
public
function
region_list
(){
if
(
!
Request
::
instance
()
->
isAjax
()){
$this
->
assign
(
'search_type'
,
''
);
$this
->
assign
(
'search_text'
,
''
);
$this
->
assign
(
'operator'
,
''
);
$this
->
assign
(
'area_id'
,
''
);
$region
=
new
ElectricMeter
();
$operator
=
new
OperatorModel
();
$operators
=
OperatorModel
::
field
(
'operator_id,operator_name'
)
->
where
(
'operator_state'
,
'='
,
1
)
->
select
()
->
toArray
();
$this
->
assign
(
'regions'
,
getTree
(
$region
->
regions
()));
$this
->
assign
(
'operators'
,
$operators
);
return
$this
->
fetch
();
}
else
{
$map
=
[];
$aa
=
Request
::
param
(
'type'
);
if
(
$aa
==
1
){
$data
=
Request
::
param
(
'data'
);
$search_text
=
$data
[
'search_text'
];
$search_type
=
$data
[
'search_type'
];
if
(
$search_text
){
switch
(
$search_type
)
{
case
'1'
:
$this
->
assign
(
'search_text'
,
$search_text
);
$map
[]
=
[
'station_info.station_name'
,
'like'
,
"%
$search_text
%"
];
$this
->
assign
(
'search_type'
,
$search_type
);
break
;
case
'2'
:
$this
->
assign
(
'search_text'
,
$search_text
);
$map
[]
=
[
'station_info.station_sp_code'
,
'like'
,
"%
$search_text
%"
];
$this
->
assign
(
'search_type'
,
$search_type
);
break
;
case
'3'
:
$this
->
assign
(
'search_text'
,
$search_text
);
$map
[]
=
[
'station_info.proj_number'
,
'like'
,
"%
$search_text
%"
];
$this
->
assign
(
'search_type'
,
$search_type
);
break
;
}
}
else
{
$this
->
assign
(
'search_type'
,
''
);
$this
->
assign
(
'search_text'
,
''
);
}
$operator
=
$data
[
'operator'
];
if
(
$operator
){
$map
[]
=
[
'station_info.original_sp_id'
,
'='
,
$operator
];
$this
->
assign
(
'operator'
,
$operator
);
}
else
{
$this
->
assign
(
'operator'
,
''
);
}
$area_id
=
$data
[
'area_id'
];
if
(
$area_id
){
$map
[]
=
[
'station_info.area_id'
,
'='
,
$area_id
];
$this
->
assign
(
'area_id'
,
$area_id
);
}
else
{
$this
->
assign
(
'area_id'
,
''
);
}
if
(
!
$map
){
echo
0
;
die
;
}
//权限检测
$user
=
Session
::
get
(
'user'
);
if
(
!
$user
[
'is_admin'
]){
$permissionData
=
check_data
();
if
(
$permissionData
){
$map
[]
=
$permissionData
;
}
}
$map
[]
=
[
'd.longitude'
,
'neq'
,
""
];
$map
[]
=
[
'd.latitude'
,
'neq'
,
""
];
$datalist
=
BaseStationModel
::
field
(
'station_id,station_name,proj_number,longitude,latitude'
)
->
leftJoin
([
'station_info_detai'
=>
'd'
],
'station_info.station_id = d.stationid'
)
->
where
(
$map
)
->
limit
(
200
)
->
select
()
->
toArray
();
}
else
{
$map1
=
[];
//权限检测
$user
=
Session
::
get
(
'user'
);
if
(
!
$user
[
'is_admin'
]){
$permissionData
=
check_data
();
if
(
$permissionData
){
$map1
[]
=
$permissionData
;
}
}
$position
=
Request
::
param
(
'data'
);
$ff
=
$position
[
'lng'
];
$ee
=
$position
[
'lat'
];
$fff
=
$ff
+
"0.200000"
;
$eee
=
$ee
+
"0.200000"
;
$map1
[]
=
[
'd.longitude'
,
'between'
,
"
$ff
,
$fff
"
];
$map1
[]
=
[
'd.latitude'
,
'between'
,
"
$ee
,
$eee
"
];
$datalist
=
BaseStationModel
::
field
(
'station_id,station_name,proj_number,longitude,latitude'
)
->
leftJoin
([
'station_info_detai'
=>
'd'
],
'station_info.station_id = d.stationid'
)
->
where
(
$map1
)
->
select
()
->
toArray
();
}
if
(
!
$datalist
){
echo
0
;
die
;
}
$lats
=
$lons
=
array
();
foreach
(
$datalist
as
$key
=>
$value
)
{
array_push
(
$lats
,
$value
[
'latitude'
]);
array_push
(
$lons
,
$value
[
'longitude'
]);
}
$minlat
=
min
(
$lats
);
$maxlat
=
max
(
$lats
);
$minlon
=
min
(
$lons
);
$maxlon
=
max
(
$lons
);
$zpoint
=
[
'minLat'
=>
$minlat
,
'maxLat'
=>
$maxlat
,
'minLng'
=>
$minlon
,
'maxLng'
=>
$maxlon
];
$lat
=
$maxlat
-
((
$maxlat
-
$minlat
)
/
2
);
$lng
=
$maxlon
-
((
$maxlon
-
$minlon
)
/
2
);
$oPoint
=
array
(
"latitude"
=>
$lat
,
"longitude"
=>
$lng
);
$datalist
[
'datacount'
]
=
5000
;
$datalist
[
'counts'
]
=
200
;
$datalist
[
'oPoint'
]
=
$oPoint
;
$datalist
[
'zPoint'
]
=
$zpoint
;
if
(
$datalist
){
echo
json_encode
(
$datalist
);
}
}
}
}
\ No newline at end of file
application/em/view/public/form.html
0 → 100644
浏览文件 @
39d8a098
<!DOCTYPE html>
<html
class=
"x-admin-sm"
>
{include file="public/head" /}
{block name="head"}
{/block}
<body>
<div
class=
"layui-fluid"
>
{block name="body"}
<div
class=
"layui-row"
>
<form
class=
"layui-form"
>
<div
class=
"layui-form-item"
>
<label
for=
"username"
class=
"layui-form-label"
>
<span
class=
"x-red"
>
*
</span>
登录名
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"username"
name=
"username"
required=
""
lay-verify=
"required"
autocomplete=
"off"
class=
"layui-input"
>
</div>
<div
class=
"layui-form-mid layui-word-aux"
>
<span
class=
"x-red"
>
*
</span>
将会成为您唯一的登入名
</div>
</div>
<div
class=
"layui-form-item"
>
<label
for=
"phone"
class=
"layui-form-label"
>
<span
class=
"x-red"
>
*
</span>
手机
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"phone"
name=
"phone"
required=
""
lay-verify=
"phone"
autocomplete=
"off"
class=
"layui-input"
>
</div>
<div
class=
"layui-form-mid layui-word-aux"
>
<span
class=
"x-red"
>
*
</span>
将会成为您唯一的登入名
</div>
</div>
<div
class=
"layui-form-item"
>
<label
for=
"L_email"
class=
"layui-form-label"
>
<span
class=
"x-red"
>
*
</span>
邮箱
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"L_email"
name=
"email"
required=
""
lay-verify=
"email"
autocomplete=
"off"
class=
"layui-input"
>
</div>
<div
class=
"layui-form-mid layui-word-aux"
>
<span
class=
"x-red"
>
*
</span>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
class=
"x-red"
>
*
</span>
角色
</label>
<div
class=
"layui-input-block"
>
<input
type=
"checkbox"
name=
"like1[write]"
lay-skin=
"primary"
title=
"超级管理员"
checked=
""
>
<input
type=
"checkbox"
name=
"like1[read]"
lay-skin=
"primary"
title=
"编辑人员"
>
<input
type=
"checkbox"
name=
"like1[write]"
lay-skin=
"primary"
title=
"宣传人员"
checked=
""
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
for=
"L_pass"
class=
"layui-form-label"
>
<span
class=
"x-red"
>
*
</span>
密码
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"password"
id=
"L_pass"
name=
"pass"
required=
""
lay-verify=
"pass"
autocomplete=
"off"
class=
"layui-input"
>
</div>
<div
class=
"layui-form-mid layui-word-aux"
>
6到16个字符
</div>
</div>
<div
class=
"layui-form-item"
>
<label
for=
"L_repass"
class=
"layui-form-label"
>
<span
class=
"x-red"
>
*
</span>
确认密码
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"password"
id=
"L_repass"
name=
"repass"
required=
""
lay-verify=
"repass"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
for=
"L_repass"
class=
"layui-form-label"
>
</label>
<button
class=
"layui-btn"
lay-filter=
"add"
lay-submit=
""
>
增加
</button>
</div>
</form></div>
{/block}
</div>
{block name="js"}
<script>
layui
.
use
([
'form'
,
'layer'
],
function
()
{
$
=
layui
.
jquery
;
var
form
=
layui
.
form
,
layer
=
layui
.
layer
;
//自定义验证规则
form
.
verify
({
nikename
:
function
(
value
)
{
if
(
value
.
length
<
5
)
{
return
'昵称至少得5个字符啊'
;
}
},
pass
:
[
/
(
.+
){6,12}
$/
,
'密码必须6到12位'
],
repass
:
function
(
value
)
{
if
(
$
(
'#L_pass'
).
val
()
!=
$
(
'#L_repass'
).
val
())
{
return
'两次密码不一致'
;
}
}
});
//监听提交
form
.
on
(
'submit(add)'
,
function
(
data
)
{
console
.
log
(
data
);
//发异步,把数据提交给php
layer
.
alert
(
"增加成功"
,
{
icon
:
6
},
function
()
{
//关闭当前frame
xadmin
.
close
();
// 可以对父窗口进行刷新
xadmin
.
father_reload
();
});
return
false
;
});
});
</script>
{/block}
</body>
{block name="modal"}
{/block}
</html>
application/em/view/public/head.html
0 → 100644
浏览文件 @
39d8a098
<head>
<meta
charset=
"UTF-8"
>
<title>
广厦网络基站综合支撑平台
</title>
<meta
name=
"renderer"
content=
"webkit|ie-comp|ie-stand"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<meta
name=
"viewport"
content=
"width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8"
/>
<meta
http-equiv=
"Cache-Control"
content=
"no-siteapp"
/>
<link
rel=
"stylesheet"
href=
"__STATIC__/xadmin/css/font.css"
>
<link
rel=
"stylesheet"
href=
"__STATIC__/xadmin/css/xadmin.css"
>
<link
rel=
"stylesheet"
href=
"__STATIC__/xadmin/css/theme10.css"
>
<link
rel=
"stylesheet"
href=
"__STATIC__/font_1220417_290/iconfont.css"
>
<link
rel=
"stylesheet"
href=
"__STATIC__/admin/css/style.css"
>
<script
src=
"__STATIC__/xadmin/lib/layui/layui.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
src=
"__STATIC__/xadmin/js/xadmin.js"
></script>
<script>
// 是否开启刷新记忆tab功能
var
is_remember
=
false
;
</script>
</head>
application/em/view/region/region_list.html
0 → 100644
浏览文件 @
39d8a098
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论