Commit 50361874 authored by 冯超鹏's avatar 冯超鹏

应用

parent 68275847
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
.rnd 100644 → 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -57,18 +57,13 @@ class alarm extends Command
{
$url = config('public.swoolwebsocketurl');
$por = config('public.swoolwebsocketurlpor');
$this->ws = new \swoole_websocket_server('0.0.0.0', 9601,SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL); //创建一个端口
$this->ws = new \swoole_websocket_server('0.0.0.0', 9601,SWOOLE_PROCESS); //创建一个端口
$this->ws->set(array(
'reactor_num' => 2, //reactor线程数
'worker_num' => 4, //worker进程数
'backlog' => 128, //Listen队列长度
'max_request' => 10,//最大连接
'daemonize'=>0,//守护进程
'ssl_cert_file' => base_path() . '/tests/textcert/ssl.pem',
'ssl_key_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com.key',
// 'ssl_verify_peer' => true,
// 'ssl_allow_self_signed' => true,
// 'ssl_client_cert_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com_chain',
));
$this->ws->on('open', function ($ws, $request) {
// //链接成功
......
......@@ -57,18 +57,13 @@ class chemicalswb extends Command
{
$url = config('public.swoolwebsocketurl');
$por = config('public.swoolwebsocketurlpor');
$this->ws = new \swoole_websocket_server('0.0.0.0', 9507,SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL); //创建一个端口
$this->ws = new \swoole_websocket_server('0.0.0.0', 9507,SWOOLE_PROCESS); //创建一个端口
$this->ws->set(array(
'reactor_num' => 2, //reactor线程数
'worker_num' => 4, //worker进程数
'backlog' => 128, //Listen队列长度
'max_request' => 10,//最大连接
'daemonize'=>0,//守护进程
'ssl_cert_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com_public.crt',
'ssl_key_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com.key',
// 'ssl_verify_peer' => true,
// 'ssl_allow_self_signed' => true,
// 'ssl_client_cert_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com_chain',
));
$this->ws->on('open', function ($ws, $request) {
// //链接成功
......
......@@ -57,18 +57,13 @@ class firewb extends Command
{
$url = config('public.swoolwebsocketurl');
$por = config('public.swoolwebsocketurlpor');
$this->ws = new \swoole_websocket_server('0.0.0.0', 9508,SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL); //创建一个端口
$this->ws = new \swoole_websocket_server('0.0.0.0', 9508,SWOOLE_PROCESS); //创建一个端口
$this->ws->set(array(
'reactor_num' => 2, //reactor线程数
'worker_num' => 4, //worker进程数
'backlog' => 128, //Listen队列长度
'max_request' => 10,//最大连接
'daemonize'=>0,//守护进程
'ssl_cert_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com_public.crt',
'ssl_key_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com.key',
'ssl_verify_peer' => true,
'ssl_allow_self_signed' => true,
'ssl_client_cert_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com_chain',
));
$this->ws->on('open', function ($ws, $request) {
// //链接成功
......
......@@ -57,18 +57,13 @@ class swoole extends Command
{
$url = config('public.swoolwebsocketurl');
$por = config('public.swoolwebsocketurlpor');
$this->ws = new \swoole_websocket_server('0.0.0.0', 9502,SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL); //创建一个端口
$this->ws = new \swoole_websocket_server('0.0.0.0', 9502); //创建一个端口
$this->ws->set(array(
'reactor_num' => 2, //reactor线程数
'worker_num' => 4, //worker进程数
'backlog' => 128, //Listen队列长度
'max_request' => 10,//最大连接
'daemonize'=>0,//守护进程
'ssl_cert_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com_public.crt',
'ssl_key_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com.key',
'ssl_verify_peer' => true,
'ssl_allow_self_signed' => true,
'ssl_client_cert_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com_chain',
));
$this->ws->on('open', function ($ws, $request) {
// //链接成功
......@@ -92,7 +87,6 @@ class swoole extends Command
echo "client:{$fd} is closed\n";
swoole_timer_clear($this->time);
});
$this->ws->start();
}
}
......@@ -55,10 +55,10 @@ class swooleMeTcp extends Command
public function start()
{
$url = config('public.swooletcpurl');
$this->tcp = new \swoole_server('0.0.0.0', 9503, SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL);
$this->tcp->addlistener('0.0.0.0', 9504, SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
$this->tcp->addlistener('0.0.0.0', 9505, SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
$this->tcp->addlistener('0.0.0.0', 9506, SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
$this->tcp = new \swoole_server('0.0.0.0', 9504,SWOOLE_PROCESS);
$this->tcp->addlistener('0.0.0.0', 9504,SWOOLE_SOCK_TCP); // 添加 TCP端口监听
$this->tcp->addlistener('0.0.0.0', 9505,SWOOLE_SOCK_TCP); // 添加 TCP端口监听
// $this->tcp->addlistener('0.0.0.0', 9506,SWOOLE_SOCK_TCP); // 添加 TCP端口监听
$this->tcp->set([
'worker_num' => 2,//设置启动的 Worker 进程数
'max_request' =>30,//最大任务数
......@@ -67,11 +67,6 @@ class swooleMeTcp extends Command
'backlog' => 128,
'heartbeat_check_interval' => 30,
'heartbeat_idle_time' => 65,
'ssl_cert_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com_public.crt',
'ssl_key_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com.key',
'ssl_verify_peer' => true,
'ssl_allow_self_signed' => true,
'ssl_client_cert_file' => base_path() . '/tests/textcert/4544322_iot.zhkjgf.com_chain',
]);
//监听连接进入事件
$this->tcp->on('Connect', function ($serv, $fd) {
......@@ -86,6 +81,7 @@ class swooleMeTcp extends Command
//监听数据接收事件
$this->tcp->on('Receive', function ($serv, $fd, $from_id, $data) {
//验证数据格式
$serv->send($fd,$data);
if($this->formatData($data)){
$swooletcp = new SwooleCommandMeTcpController();
$swooletcp->swooletcplist($data);
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -30,10 +30,11 @@ class DevicesController extends Controller
$type = $request->input('type');//设备类型id
$limit = $request->input('limit');
$pagenNum = $limit * ($request->input('page') - 1);//页数
$isuser = $request->input('isuser');
if ($pagenNum === '' || $limit == '') {
return $this->jsonErrorData(105, '页数或limit不能为空');
}
return $this->jsonSuccessData($this->whertype($type == '' ? '1' : $type, $pagenNum, $limit));
return $this->jsonSuccessData($this->whertype($type == '' ? '1' : $type, $pagenNum, $limit, $isuser));
}
//用户设备列表
......@@ -178,14 +179,14 @@ class DevicesController extends Controller
->leftjoin('gas', 'de.status', '=', 'gas.id')
->leftjoin('danwei as da', 'de.devicemonad', '=', 'da.id')
->leftjoin('users as ud', 'de.uid', '=', 'ud.id')
->select('dt.tid','ud.name', 'de.username','de.deviceremark','de.devicelinkman','de.devicephone','de.deviceinfo','de.devicecoord','de.uid','de.devicenum','de.devicemonad','de.status')
->select('dt.tid', 'ud.name', 'de.username', 'de.deviceremark', 'de.devicelinkman', 'de.devicephone', 'de.deviceinfo', 'de.devicecoord', 'de.uid', 'de.devicenum', 'de.devicemonad', 'de.status')
->first();
return $this->jsonSuccessData($devi);
}
}
//返回设备类型和单位和介质
public function devicetype()
public function devicetype(Request $request)
{
$gas = DB::table('gas')->get();
$danwei = DB::table('danwei')->get();
......@@ -198,8 +199,26 @@ class DevicesController extends Controller
}
//返回设备列表
private function whertype($type, $pagenNum, $limit): array
private function whertype($type, $pagenNum, $limit, $isuser): array
{
if ($isuser == 'user') {
$devicelist = DB::table('device')
->where('dtype', '=', $type)
->where('uid', '=', Auth::id())
->leftjoin('device_type as dy', "device.dtype", '=', 'dy.tid')
->leftjoin('gas as g', "device.status", '=', 'g.id')
->leftjoin('users as u', "device.uid", '=', 'u.id')
->leftjoin('status as p', "device.devicepolice", '=', 'p.id')
->select('dy.tname', 'g.gas', 'device.*', 'p.status_name', 'u.name as usernickname')
->orderBy('device.id', 'desc')
->offset($pagenNum)
->limit($limit)
->get()->toArray();
$count = DB::table('device')
->where('dtype', '=', $type)
->where('uid', '=', Auth::id())
->count();
} else {
$devicelist = DB::table('device')
->where('dtype', '=', $type)
->leftjoin('device_type as dy', "device.dtype", '=', 'dy.tid')
......@@ -214,6 +233,7 @@ class DevicesController extends Controller
$count = DB::table('device')
->where('dtype', '=', $type)
->count();
}
return ['devicelist' => $devicelist, 'count' => $count];
}
......@@ -352,7 +372,7 @@ class DevicesController extends Controller
{
$request = $request->input();
$time_start = $time_stop = false;
if(!is_null($request['timeRange'])) {
if (!is_null($request['timeRange'])) {
$time_start = strtotime($request['timeRange'][0]);
$time_stop = strtotime($request['timeRange'][1]);
}
......@@ -378,15 +398,15 @@ class DevicesController extends Controller
if (!is_null($this->isadmin())) {
$data = DB::table('reportpolice as r')
->join('status as s', 'r.policestatus', '=', 's.id')
->join('device as d' , 'r.devicenumber','=','d.devicenum')
->select('r.*', 's.status_name','d.id as deid')
->join('device as d', 'r.devicenumber', '=', 'd.devicenum')
->select('r.*', 's.status_name', 'd.id as deid')
->get();
}else{
} else {
$data = DB::table('reportpolice as r')
->join('status as s', 'r.policestatus', '=', 's.id')
->join('device as d' , 'r.devicenumber','=','d.devicenum')
->where('d.uid','=',Auth::id())
->select('r.*', 's.status_name','d.id as deid')
->join('device as d', 'r.devicenumber', '=', 'd.devicenum')
->where('d.uid', '=', Auth::id())
->select('r.*', 's.status_name', 'd.id as deid')
->get();
}
return $this->jsonSuccessData($data);
......@@ -407,6 +427,12 @@ class DevicesController extends Controller
{
return $this->jsonSuccessData(DB::table('users')->where('state', '=', '2')->select('name', 'id')->get());
}
//获取用户自定义用户标题
public function companyuser()
{
$data = DB::table('users')->where('id','=',Auth::id())->value('company');
return $this->jsonSuccessData($data);
}
//返回设备废纸篓和禁用设备
public function deviceBasketList()
......@@ -460,6 +486,7 @@ class DevicesController extends Controller
return $status ? $this->jsonSuccessData($status) : $this->jsonErrorData(202, 'error');
}
public function delteClassify($id)
{
//删除分类
......@@ -476,15 +503,15 @@ class DevicesController extends Controller
$where['device.uid'] = $user_id;
}
$data = DB::table('device')
->join('status as s','device.devicepolice','=','s.id')
->select('device.id', 'device.uid', 'device.nd', 'device.deviceinfo', 'device.devicenum', 'device.devicecoord', 'device.devicepolice', 'device.deviceremark', 'device.devicelinkman','s.status_name')
->join('status as s', 'device.devicepolice', '=', 's.id')
->select('device.id', 'device.uid', 'device.nd', 'device.deviceinfo', 'device.devicenum', 'device.devicecoord', 'device.devicepolice', 'device.deviceremark', 'device.devicelinkman', 's.status_name')
->where($where)
->get();
} else {
$data = DB::table('device')
->join('status as s','device.devicepolice','=','s.id')
->select('device.id', 'device.uid', 'device.nd', 'device.deviceinfo', 'device.devicenum', 'device.devicecoord', 'device.devicepolice', 'device.deviceremark', 'device.devicelinkman','s.status_name')
->where('device.uid','=',Auth::id())
->join('status as s', 'device.devicepolice', '=', 's.id')
->select('device.id', 'device.uid', 'device.nd', 'device.deviceinfo', 'device.devicenum', 'device.devicecoord', 'device.devicepolice', 'device.deviceremark', 'device.devicelinkman', 's.status_name')
->where('device.uid', '=', Auth::id())
->get();
}
......@@ -510,16 +537,16 @@ class DevicesController extends Controller
}
$search = json_decode($request->input('search'), true);
$where = [];
if(!empty($search['deviceNum'])) {
if (!empty($search['deviceNum'])) {
$where[] = ['devicenum', 'like', "%{$search['deviceNum']}%"];
}
if(!empty($search['deviceName'])) {
if (!empty($search['deviceName'])) {
$where[] = ['username', 'like', "%{$search['deviceName']}%"];
}
if($search['deviceType'] != 0) {
if ($search['deviceType'] != 0) {
$wherein = [$search['deviceType']];
}
if($search['deviceStatus'] != 0) {
if ($search['deviceStatus'] != 0) {
$where[] = ['device.devicepolice', '=', $search['deviceStatus']];
}
......@@ -540,14 +567,14 @@ class DevicesController extends Controller
->whereIn('dtype', $wherein)
->where($where)
->count();
}else{
} else {
$devicelist = DB::table('device')
->whereIn('dtype', $wherein)
->leftjoin('device_type as dy', "device.dtype", '=', 'dy.tid')
->leftjoin('gas as g', "device.status", '=', 'g.id')
->leftjoin('status as p', "device.devicepolice", '=', 'p.id')
->leftjoin('danwei as dw', 'device.devicemonad', '=', 'dw.id')
->where('device.uid','=',Auth::id())
->where('device.uid', '=', Auth::id())
->select('dy.tname', 'g.gas', 'device.*', 'p.status_name', 'dw.danwei')
->where($where)
->orderBy('device.id', 'desc')
......@@ -556,40 +583,55 @@ class DevicesController extends Controller
->get()->toArray();
$count = DB::table('device')
->whereIn('dtype', $wherein)
->where('uid','=',Auth::id())
->where('uid', '=', Auth::id())
->where($where)
->count();
}
return $this->jsonSuccessData(['devicelist' => $devicelist, 'count' => $count]);
}
public function devicepolice(Request $request)
{
$devicenum = $request->input('devicenum');
if ($devicenum) {
$police = DB::table('reportpolice')->where('devicenumber','=',$devicenum)->update(['police'=>2]);
$police = DB::table('reportpolice')->where('devicenumber', '=', $devicenum)->update(['police' => 2]);
$this->jsonSuccessData($police);
}else{
return $this->jsonErrorData(105,'设备编号不能为空');
} else {
return $this->jsonErrorData(105, '设备编号不能为空');
}
}
//返回报警记录中的报类型和区域
public function history_device_type()
{
$device_type = DB::table('status')->get();
$device_quyu = DB::table('device')
->select('deviceinfo', 'id as deviceid')
->groupBy('deviceinfo')
->get();
return $this->jsonSuccessData(['device_type' => $device_type, 'device_quyu' => $device_quyu]);
}
public function devicepoliceinfo(Request $request){
public function devicepoliceinfo(Request $request)
{
$devicenum = $request->input('devicenum');
if ($devicenum) {
$data = DB::table('device as d')
->join('device_type as t','d.dtype','=','t.tid')
->join('gas as g','d.status','=','g.id')
->join('status as s','d.devicepolice','=','s.id')
->join('danwei as w','d.devicemonad','=','w.id')
->join('users as u','d.uid','=','u.id')
->join('reportpolice as r','d.devicenum','=','r.devicenumber')
->where('d.devicenum','=',$devicenum)
->select('d.devicenum','d.username','d.nd','d.deviceremark','d.devicecoord','d.deviceaddtime','d.devicestatus','t.tname','g.gas','s.status_name','w.danwei','u.name','u.email','r.location','r.concentration','r.starttime')
->join('device_type as t', 'd.dtype', '=', 't.tid')
->join('gas as g', 'd.status', '=', 'g.id')
->join('status as s', 'd.devicepolice', '=', 's.id')
->join('danwei as w', 'd.devicemonad', '=', 'w.id')
->join('users as u', 'd.uid', '=', 'u.id')
->join('reportpolice as r', 'd.devicenum', '=', 'r.devicenumber')
->where('d.devicenum', '=', $devicenum)
->select('d.devicenum', 'd.username', 'd.nd', 'd.deviceremark', 'd.devicecoord', 'd.deviceaddtime', 'd.devicestatus', 't.tname', 'g.gas', 's.status_name', 'w.danwei', 'u.name', 'u.email', 'r.location', 'r.concentration', 'r.starttime')
->first();
return $this->jsonSuccessData($data);
}else{
return $this->jsonErrorData(105,'设备编号不能为空');
} else {
return $this->jsonErrorData(105, '设备编号不能为空');
}
}
/**
* @param bool $isNew
* @return array
......@@ -687,7 +729,7 @@ class DevicesController extends Controller
* @return array
* @throws \Exception
*/
private function getDeviceData($time_start = false, $time_stop = false, $device_num = '', $device_status = 0, $size=0, $page=0)
private function getDeviceData($time_start = false, $time_stop = false, $device_num = '', $device_status = 0, $size = 0, $page = 0)
{
$influxDb = Config::get('database.influxdb');
$host = $influxDb['default']['host'];
......@@ -702,10 +744,10 @@ class DevicesController extends Controller
$tbuilde = $tdatabase->getQueryBuilder();
$result = [];
if($time_start === false) {
if ($time_start === false) {
$time_start = 0;
}
if($time_stop === false) {
if ($time_stop === false) {
$time_stop = time();
}
$time_start -= 8 * 3600;
......@@ -716,17 +758,17 @@ class DevicesController extends Controller
$tresult = $tbuilde->select('*')
->from('devices')
->setTimeRange($time_start, $time_stop);
if(!empty($device_num)) {
if (!empty($device_num)) {
$where = ["device_num='{$device_num}'"];
$result = $result->where($where);
$tresult = $tresult->where($where);
}
if($device_status != 0 && $device_status != null) {
if ($device_status != 0 && $device_status != null) {
$where = ["device_status='{$device_status}'"];
$result = $result->where($where);
$tresult = $tresult->where($where);
}
if($this->isadmin() != 1) {
if ($this->isadmin() != 1) {
$user_id = Auth::id();
$where = ["user_id='{$user_id}'"];
$result = $result->where($where);
......@@ -734,9 +776,9 @@ class DevicesController extends Controller
}
$total = $tresult->count('value')->getResultSet()->getPoints();
if(count($total) > 0) {
$result = $result->orderBy('time','DESC')
->limit($size)->offset(($page-1)*$size)
if (count($total) > 0) {
$result = $result->orderBy('time', 'DESC')
->limit($size)->offset(($page - 1) * $size)
->getResultSet()->getPoints();
} else {
$result = [];
......
......@@ -21,8 +21,21 @@ use Validator;
class HomepageController extends Controller
{
//返回用户数量 设备数量, 报警数量 ,
public function homepagecount()
public function homepagecount(Request $request)
{
$type = $request->input('isuser');
if ($type == 'user') {
$usercount = Users::count();
$devicecount = Device::where('uid','=',Auth::id())->count();
$devicepolice = Device::where('devicepolice', '>', '1')->where('uid','=',Auth::id())->count();
$t = time();//当前时间
$start = mktime(0, 0, 0, date("m", $t), date("d", $t), date("Y", $t));//今天的开始
$end = mktime(23, 59, 59, date("m", $t), date("d", $t), date("Y", $t));//今天的结束
$timedevicepolice = DB::table('reportpolice')->where('status', '=', '1')->whereBetween('starttime', [$start, $end])->count();
$offdevice = Device::where('devicepolice', '=', '1')->where('uid','=',Auth::id())->count();
//计算设备在线
$deviceurt = $devicecount / $offdevice;
} else {
$usercount = Users::count();
$devicecount = Device::count();
$devicepolice = Device::where('devicepolice', '>', '1')->count();
......@@ -30,7 +43,11 @@ class HomepageController extends Controller
$start = mktime(0, 0, 0, date("m", $t), date("d", $t), date("Y", $t));//今天的开始
$end = mktime(23, 59, 59, date("m", $t), date("d", $t), date("Y", $t));//今天的结束
$timedevicepolice = DB::table('reportpolice')->where('status', '=', '1')->whereBetween('starttime', [$start, $end])->count();
return $this->jsonSuccessData(['usercount' => $usercount, 'devicecount' => $devicecount, 'devicepolice' => $devicepolice, 'timedevicepolice' => $timedevicepolice]);
$offdevice = Device::where('devicepolice', '=', '1')->count();
//计算设备在线
$deviceurt = $devicecount / $offdevice;
}
return $this->jsonSuccessData(['usercount' => $usercount, 'devicecount' => $devicecount, 'devicepolice' => $devicepolice, 'timedevicepolice' => $timedevicepolice, 'offdevice' => $offdevice, 'deviceurt' => round($deviceurt)]);
}
public function gettimeline()
......@@ -39,8 +56,29 @@ class HomepageController extends Controller
}
//返回一年当前月份
public function devicemonthcount()
public function devicemonthcount(Request $request)
{
$type = $request->input('isuser');
if ($type == 'user') {
$year_start = strtotime(date("Y") . "-01-01"); // 获取当前的1月份的时间戳
$endThismonth = mktime(23, 59, 59, date('m'), date('t'), date('Y')); //获取当月的时间戳
$devicedata = Device::where('uid','=',Auth::id())->whereBetween('deviceaddtime', [$year_start, $endThismonth])
->selectRaw('from_unixtime(deviceaddtime,"%Y-%m") as date,COUNT(id) as value')
->groupBy('date')
->get()
->toArray();
$policedata = Users::whereBetween('created_at', [date('Y-m-d H:i:s', $year_start), date('Y-m-d H:i:s', $endThismonth)])
->selectRaw('from_unixtime(unix_timestamp(created_at),"%Y-%m") as date,COUNT(id) as value')
->groupBy('date')
->get()
->toArray();
$devicepolice = Device::where('uid','=',Auth::id())->whereBetween('deviceaddtime', [$year_start, $endThismonth])
->where('devicepolice', '>', 1)
->selectRaw('from_unixtime(deviceaddtime,"%Y-%m") as date,COUNT(id) as value')
->groupBy('date')
->get()
->toArray();
}else{
$year_start = strtotime(date("Y") . "-01-01"); // 获取当前的1月份的时间戳
$endThismonth = mktime(23, 59, 59, date('m'), date('t'), date('Y')); //获取当月的时间戳
$devicedata = Device::whereBetween('deviceaddtime', [$year_start, $endThismonth])
......@@ -48,7 +86,7 @@ class HomepageController extends Controller
->groupBy('date')
->get()
->toArray();
$policedata = Users::whereBetween('created_at', [date('Y-m-d H:i:s',$year_start), date('Y-m-d H:i:s',$endThismonth)])
$policedata = Users::whereBetween('created_at', [date('Y-m-d H:i:s', $year_start), date('Y-m-d H:i:s', $endThismonth)])
->selectRaw('from_unixtime(unix_timestamp(created_at),"%Y-%m") as date,COUNT(id) as value')
->groupBy('date')
->get()
......@@ -59,19 +97,21 @@ class HomepageController extends Controller
->groupBy('date')
->get()
->toArray();
}
return $this->jsonSuccessData(['devicedata' => $this->datamonth($devicedata), 'policedata' => $this->datamonth($policedata), 'devicepolice' => $this->datamonth($devicepolice)]);
}
//用户统计
public function UserStatistics (){
$devicecount = Device::where('uid','=',Auth::id())->count();
$devicepolice = Device::where('devicepolice', '>', '1')->where('uid','=',Auth::id())->count();
public function UserStatistics()
{
$devicecount = Device::where('uid', '=', Auth::id())->count();
$devicepolice = Device::where('devicepolice', '>', '1')->where('uid', '=', Auth::id())->count();
$t = time();//当前时间
$start = mktime(0, 0, 0, date("m", $t), date("d", $t), date("Y", $t));//今天的开始
$end = mktime(23, 59, 59, date("m", $t), date("d", $t), date("Y", $t));//今天的结束
$timedevicepolice = DB::table('reportpolice as r')
->join('device as d','d.devicenum','=','r.devicenumber')
->where('d.uid','=',Auth::id())
->join('device as d', 'd.devicenum', '=', 'r.devicenumber')
->where('d.uid', '=', Auth::id())
->where('r.status', '=', '1')
->whereBetween('r.starttime', [$start, $end])
->count();
......@@ -84,12 +124,12 @@ class HomepageController extends Controller
\Session::put(['loginuid' => Auth::id()]);
$year_start = strtotime(date("Y") . "-01-01"); // 获取当前的1月份的时间戳
$endThismonth = mktime(23, 59, 59, date('m'), date('t'), date('Y')); //获取当月的时间戳
$devicedata = Device::where('uid','=',Auth::id())->whereBetween('deviceaddtime', [$year_start, $endThismonth])
$devicedata = Device::where('uid', '=', Auth::id())->whereBetween('deviceaddtime', [$year_start, $endThismonth])
->selectRaw('from_unixtime(deviceaddtime,"%Y-%m") as date,COUNT(id) as value')
->groupBy('date')
->get()
->toArray();
$devicepolice = Device::where('uid','=',Auth::id())->whereBetween('deviceaddtime', [$year_start, $endThismonth])
$devicepolice = Device::where('uid', '=', Auth::id())->whereBetween('deviceaddtime', [$year_start, $endThismonth])
->where('devicepolice', '>', 1)
->selectRaw('from_unixtime(deviceaddtime,"%Y-%m") as date,COUNT(id) as value')
->groupBy('date')
......@@ -109,7 +149,7 @@ class HomepageController extends Controller
$size = $this->getDirSize($phay);
$base_path = @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2);
$end_time = microtime(true);
return $this->jsonSuccessData(['memory' => round($memory), 'base_path' => round($base_path) / 10, 'end_time' => round($end_time - $start_time), 'dabatime' => ceil($this->dabadas()),'rand'=>rand(1,100)]);
return $this->jsonSuccessData(['memory' => round($memory), 'base_path' => round($base_path) / 10, 'end_time' => round($end_time - $start_time), 'dabatime' => ceil($this->dabadas()), 'rand' => rand(1, 100)]);
}
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -40,9 +40,10 @@ class UinappHomeController extends Controller
public function imitation(Request $request)
{
$imitationdata = $request->input('imitationdata');
$type = $request->input('isuser');
if ($imitationdata != '') {
if ($this->isKanji($imitationdata)) {
if ($type == 'user') {
$data = DB::table('device as d')
->join('device_type as t', 'd.dtype', '=', 't.tid')
->join('gas as g', 'd.status', '=', 'g.id')
......@@ -50,9 +51,34 @@ class UinappHomeController extends Controller
->join('status as s', 'd.devicepolice', '=', 's.id')
->join('users as u', 'd.uid', '=', 'u.id')
->where('d.username', 'like', '%' . $imitationdata . '%')
->where('u.id', '=', Auth::id())
->select('d.*', 't.tname', 'g.gas', 'w.danwei', 's.status_name', 'u.username as nameh', 'u.isadmin')
->get();
} else {
$data = DB::table('device as d')
->join('device_type as t', 'd.dtype', '=', 't.tid')
->join('gas as g', 'd.status', '=', 'g.id')
->join('danwei as w', 'd.devicemonad', '=', 'w.id')
->join('status as s', 'd.devicepolice', '=', 's.id')
->join('users as u', 'd.uid', '=', 'u.id')
->where('d.username', 'like', '%' . $imitationdata . '%')
->select('d.*', 't.tname', 'g.gas', 'w.danwei', 's.status_name', 'u.username as nameh', 'u.isadmin')
->get();
}
} else {
if ($type == 'user') {
$data = DB::table('device as d')
->join('device_type as t', 'd.dtype', '=', 't.tid')
->join('gas as g', 'd.status', '=', 'g.id')
->join('danwei as w', 'd.devicemonad', '=', 'w.id')
->join('status as s', 'd.devicepolice', '=', 's.id')
->join('users as u', 'd.uid', '=', 'u.id')
->where('d.devicenum', 'like', '%' . $imitationdata . '%')
->where('u.id','=',Auth::id())
->select('d.*', 't.tname', 'g.gas', 'w.danwei', 's.status_name', 'u.username as nameh', 'u.isadmin')
->get();
}else{
$data = DB::table('device as d')
->join('device_type as t', 'd.dtype', '=', 't.tid')
->join('gas as g', 'd.status', '=', 'g.id')
......@@ -63,6 +89,8 @@ class UinappHomeController extends Controller
->select('d.*', 't.tname', 'g.gas', 'w.danwei', 's.status_name', 'u.username as nameh', 'u.isadmin')
->get();
}
}
return $this->jsonSuccessData($data);
} else {
return $this->jsonSuccessData('');
......@@ -74,7 +102,9 @@ class UinappHomeController extends Controller
public function setseachdata(Request $request)
{
$setdata = $request->input('setseachdata');
$type = $request->input('isuser');
if ($this->isKanji($setdata)) {
if($type == 'user'){
$data = DB::table('device as d')
->join('device_type as t', 'd.dtype', '=', 't.tid')
->join('gas as g', 'd.status', '=', 'g.id')
......@@ -82,9 +112,33 @@ class UinappHomeController extends Controller
->join('status as s', 'd.devicepolice', '=', 's.id')
->join('users as u', 'd.uid', '=', 'u.id')
->where('d.username', '=', $setdata)
->where('u.id','=',Auth::id())
->select('d.*', 't.tname', 'g.gas', 'w.danwei', 's.status_name', 'u.username as nameh', 'u.isadmin')
->get();
}else{
$data = DB::table('device as d')
->join('device_type as t', 'd.dtype', '=', 't.tid')
->join('gas as g', 'd.status', '=', 'g.id')
->join('danwei as w', 'd.devicemonad', '=', 'w.id')
->join('status as s', 'd.devicepolice', '=', 's.id')
->join('users as u', 'd.uid', '=', 'u.id')
->where('d.username', '=', $setdata)
->select('d.*', 't.tname', 'g.gas', 'w.danwei', 's.status_name', 'u.username as nameh', 'u.isadmin')
->get();
}
} else {
if($type == 'user'){
$data = DB::table('device as d')
->join('device_type as t', 'd.dtype', '=', 't.tid')
->join('gas as g', 'd.status', '=', 'g.id')
->join('danwei as w', 'd.devicemonad', '=', 'w.id')
->join('status as s', 'd.devicepolice', '=', 's.id')
->join('users as u', 'd.uid', '=', 'u.id')
->where('d.devicenum', '=', $setdata)
->where('u.id','=',Auth::id())
->select('d.*', 't.tname', 'g.gas', 'w.danwei', 's.status_name', 'u.username as nameh', 'u.isadmin')
->get();
}else{
$data = DB::table('device as d')
->join('device_type as t', 'd.dtype', '=', 't.tid')
->join('gas as g', 'd.status', '=', 'g.id')
......@@ -95,6 +149,7 @@ class UinappHomeController extends Controller
->select('d.*', 't.tname', 'g.gas', 'w.danwei', 's.status_name', 'u.username as nameh', 'u.isadmin')
->get();
}
}
return $this->jsonSuccessData($data);
}
......@@ -141,9 +196,9 @@ class UinappHomeController extends Controller
// die();
$isemail = $request->input('email');
$num = str_pad(mt_rand(0, 999999), 6, "0", STR_PAD_BOTH);
if ($isemail != ''){
$send = $this->PHPMailer($isemail,$num);
if($send == 200){
if ($isemail != '') {
$send = $this->PHPMailer($isemail, $num);
if ($send == 200) {
return $this->jsonSuccessData($num);
}
}
......@@ -158,11 +213,12 @@ class UinappHomeController extends Controller
return false;
}
}
/*
* $name 发件人
* $num 随机字符串 验证码
* */
private function PHPMailer($name,$num)
private function PHPMailer($name, $num)
{
include_once app_path() . '/Http/Controllers/src/PHPMailer.php';
include_once app_path() . '/Http/Controllers/src/SMTP.php';
......
......@@ -16,7 +16,7 @@ class UploadimgController extends Controller
// 上传图片接口
public function uploadingimg(Request $request)
{
if ($request->isMethod('POST')) { //判断文件是否是 POST的方式上传
if ($request->isMethod('post')) { //判断文件是否是 POST的方式上传
$tmp = $request->file('file');
if (is_null($tmp)){
return $this->jsonErrorData(105,'上传图片不能为空');
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
const baseURL = 'ws://127.0.0.:9502';
const chemicalsUrl = 'ws://127.0.0.1:9507';
const fireUrl = 'ws://127.0.0.1:9508';
const alarmUrl = 'ws://127.0.0.1:9601';
const baseURL = 'wss://127.0.0.:9502';
const chemicalsUrl = 'wss://127.0.0.1:9507';
const fireUrl = 'wss://127.0.0.1:9508';
const alarmUrl = 'wss://127.0.0.1:9601';
const mapkey = '2719fe261fee06a08dcb4980990879da';
const mapurl = 'https://webapi.amap.com/maps?v=1.4.15&key=';
export default {
......
......@@ -174,3 +174,11 @@ export function devicepoliceinfo(devicenum) {
method: 'get',
});
}
export function history_device_type() {
return request({
url: '/devices/history_device_type',
method: 'get',
});
}
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -11,6 +11,10 @@
<el-col :span="6"><el-card shadow="always">报警数量<span style="margin-left: 12px;color: #E6A23C;">{{ synthesizecount.devicepolice }}</span></el-card></el-col>
<el-col :span="6"><el-card shadow="always">今天报警次数<span style="margin-left: 12px;color: #F56C6C;">{{ synthesizecount.timedevicepolice }}</span></el-card></el-col>
</el-row>
<el-row :gutter="50">
<el-col :span="8" style="margin-left:20px ;"><el-card shadow="always">未报警总数<span style="margin-left: 12px;color: #409EFF;">{{ synthesizecount.offdevice }}</span></el-card></el-col>
<el-col :span="8" style="float: right; margin-right: 25px;"><el-card shadow="always">设备在线率<span style="margin-left: 12px;color: #23E610;">{{ synthesizecount.deviceurt == 0 ? '1' : synthesizecount.deviceurt }}</span>%</el-card></el-col>
</el-row>
</div>
<!-- 混合统计 -->
<el-card class="box-card" style="margin-top:12px;padding-bottom:24px">
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
<template>
<div class="app-container">
<el-table :key="tableKey" :data="reportpolice" border fit highlight-current-rows>
<el-date-picker v-model="devicehtime" type="date" placeholder="选择日期" style="width: 15%;"></el-date-picker>--<el-time-picker v-model="devicetime" placeholder="选择时间" style="width: 15%;"></el-time-picker>
<el-select v-model="data_device_type" placeholder="报警类型">
<el-option v-for="item in device_type" :key="item.id" :label="item.status_name" :value="item.id"></el-option>
</el-select>
<el-select v-model="data_device_quyu" placeholder="区域">
<el-option v-for="item in device_quyu" :key="item.deviceid" :label="item.deviceinfo" :value="item.deviceid"></el-option>
</el-select>
<el-button type="primary" icon="el-icon-search" style="margin-left: 12px;" @click="deviceonut()">搜索</el-button>
<el-table :key="tableKey" :data="reportpolice" border fit highlight-current-rows style="margin-top: 20px;">
<el-table-column label="设备编号" width="150">
<template slot-scope="scope">
<span @click="handleCopy(scope.row.devicenumber,$event)">{{ scope.row.devicenumber }}</span>
......@@ -49,7 +57,7 @@
</template>
<script>
import { police } from '@/api/device';
import { police, history_device_type } from '@/api/device';
import clip from '@/utils/clipboard';
import BackToTop from '@/components/BackToTop';
export default {
......@@ -67,10 +75,17 @@ export default {
'line-height': '45px', // Please keep consistent with height to center vertically
background: '#e7eaf1', // The background color of the button
},
devicetime: '', // 时间
devicehtime: '', // 年月
device_type: '', // 搜索数据设备报警类型
device_quyu: '', // 设备区域
data_device_type: '', // 设备数据
data_device_quyu: '', // 设备区域
};
},
created() {
this.police(); // 列表
this.historydevicetype(); // 设备搜索所需数据
},
methods: {
police() {
......@@ -89,9 +104,26 @@ export default {
console.log(err);
});
},
historydevicetype(){
history_device_type()
.then(response => {
if (response.code === 200) {
this.device_type = response.data.device_type;
this.device_quyu = response.data.device_quyu;
}
})
.catch(err => {
console.log(err);
});
},
handleCopy(text, event) {
clip(text, event);
},
deviceonut() {
console.log(this.devicetime);
console.log(this.devicehtime);
console.log(this.device_type);
},
},
};
</script>
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -78,6 +78,22 @@
<pagination v-show="total>0" :total="total" :page.sync="userdata.page" :limit.sync="userdata.limit" @pagination="getUserList" />
<el-dialog :visible.sync="dialogPvVisible" title="编辑用户" width="85%" style="margin-top: auto;">
<el-form :model="upUserData" class="demo-ruleForm" status-icon>
<el-form-item label="头像上传" prop="userfile">
<el-upload action="#" list-type="picture-card" :drag="true" :auto-upload="false" :disabled="userimgdisabled" :limit="1" style="float:right;margin-right: 12rpx;">
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" :on-success="onfile(file)">
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
<i class="el-icon-zoom-in"></i>
</span>
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
<i class="el-icon-delete"></i>
</span>
</span>
</div>
</el-upload>
</el-form-item>
<el-form-item label="账号名称" prop="username">
<el-input v-model.number="upUserData.username"></el-input>
</el-form-item>
......@@ -97,6 +113,9 @@
<el-button type="primary" @click="submitForm()">提交</el-button>
<el-button @click="resetForm()">重置</el-button>
</el-form-item>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</el-form>
</el-dialog>
</div>
......@@ -135,6 +154,10 @@ export default {
userid: undefined,
},
paper: undefined,
dialogImageUrl: '', // 图片地址
dialogVisible: false,
disabled: false,
userimgdisabled: false, // 用户上传图片
};
},
created() {
......@@ -328,6 +351,18 @@ export default {
});
});
},
// 删除文件
handleRemove(file) {
console.log(file);
},
// 放大文件
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
onfile(file){
console.log(file);
},
},
};
</script>
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -51,7 +51,7 @@ Route::group(['middleware' => 'auth:api'], function () {
//上传图片路由
Route::group(['middleware'=>'auth:api'],function (){
Route::post('upload_img/uploadingimg','UploadimgController@uploadingimg')->middleware('permission:' . \App\Laravue\Acl::PERMISSION_PERMISSION_MANAGE);//添加图片
Route::post('upload_img/uploadingimg','UploadimgController@uploadingimg');//添加图片
Route::get('userimglist/userimglist','UploadimgController@userlist');//图片列表
Route::get('userimgdetele/userimgdetele','UploadimgController@userimgdetele');//删除图片
Route::match(['get','post'],'updateimg/updateimg','UploadimgController@updateimg');//更新图片信息,返回逻辑图片列表
......@@ -106,6 +106,8 @@ Route::group(['middleware'=>'auth:api'],function (){
Route::get('devices/device_info/{id}','DevicesController@device_info');//返回设备地图详情信息
Route::get('devices/devicepolice','DevicesController@devicepolice');//设备消警
Route::get('devices/devicepoliceinfo','DevicesController@devicepoliceinfo');//设备报警弹窗详情
Route::get('login/history_device_type','DevicesController@history_device_type');//报警数据搜索所需数据
Route::get('devices/companyuser','DevicesController@companyuser');//用户获取自定义公司名称
// 设备型号
Route::get('device/models', 'ModelNumberController@index');
Route::post('device/models', 'ModelNumberController@store');
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment