Commit 4f90a0d6 by zzrdark

1.日志更改

2.修改前端代码
3.更改黑白名单编码
4.增加logMedia 的fileSize
parent e6c43358
......@@ -11,12 +11,12 @@
<module name="cneeds-common-utils" />
<module name="cneeds-common-data" />
<module name="cneeds-server-eureka" />
<module name="cneeds-common-hadoop-dfs" />
<module name="cneeds-common-pojo" />
<module name="cneeds-server-device_activate" />
<module name="cneeds-server-logupload" />
<module name="cneeds-server-authorization" />
<module name="cneeds-server-user" />
<module name="cneeds-common-hadoop-dfs" />
<module name="cneeds-server-logupload" />
<module name="cneeds-server-device" />
</profile>
</annotationProcessing>
......
......@@ -34,7 +34,7 @@ CREATE TABLE `device_info` (
`active_time` datetime(0) DEFAULT NULL COMMENT '激活时间',
`channel_nums` varchar(10000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '渠道号',
`channel_nums_message` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '渠道号提示信息',
`channel_rules` int(255) DEFAULT NULL COMMENT '0:黑名单,1:白名单',
`channel_rules` int(255) DEFAULT NULL COMMENT '0:白名单,1:黑名单',
PRIMARY KEY (`device_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设备信息' ROW_FORMAT = Dynamic;
......@@ -52,7 +52,7 @@ CREATE TABLE `device_log` (
`create_username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人名字',
`user_id` bigint(20) DEFAULT NULL,
`repetition_steps` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '复现步骤',
`logfile_url` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '日志文件存放路径',
`logfile_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '日志文件存放路径',
`logfile_size` bigint(20) DEFAULT NULL COMMENT '日志文件大小',
`logfile_status` int(11) DEFAULT NULL COMMENT '日志文件上传状态,-1,失败,0上传中,1完成',
`log_accept_id` varchar (255) DEFAULT NULL COMMENT '移动端日志标识符',
......@@ -69,6 +69,7 @@ CREATE TABLE `device_logmedia` (
`location_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '音频路径',
`log_id` bigint(20) DEFAULT NULL,
`type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '格式',
`file_size` bigint(20) DEFAULT NULL COMMENT '文件大小',
PRIMARY KEY (`logmedia_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '日志音频表' ROW_FORMAT = Dynamic;
......
......@@ -77,7 +77,7 @@ public class DeviceInfoEntity implements Serializable {
private String channelNumsMessage;
/**
* 0:黑名单,1:白名单
* 0:白名单,1:黑名单
*/
private Integer channelRules;
......
......@@ -40,4 +40,6 @@ public class DeviceLogmediaEntity implements Serializable {
*/
private String type;
private Long fileSize;
}
......@@ -9,6 +9,7 @@
<result property="locationUrl" column="location_url"/>
<result property="logId" column="log_id"/>
<result property="type" column="type"/>
<result property="fileSize" column="file_size"/>
</resultMap>
......
......@@ -69,7 +69,7 @@ public class DeviceInfoDto {
private String channelNumsMessage;
/**
* 0:黑名单,1:白名单
* 0:白名单,1:黑名单
*/
private Integer channelRules;
......
......@@ -4,6 +4,7 @@ import lombok.Data;
import java.io.File;
import java.util.List;
import java.util.Map;
/**
* @ClassName WechatDeviceLogVo
......@@ -26,7 +27,7 @@ public class WechatDeviceLogDto {
/**
* 视频 图片文件路径
*/
List<String> locationUrls;
List<Map<String,String>> fileMap;
/**
* bug名字
......
package com.mx.cneeds.common.dto;
import lombok.Builder;
import lombok.Data;
import lombok.ToString;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @ClassName WechatFileDto
* @Author zzrdark
* @Date 2020-04-29 18:34
* @Description TODO
**/
@Data
@Builder
@ToString
public class WechatFileDto {
private String logAcceptId;
private Long fileSize;
private String locationUrl;
}
package com.mx.cneeds.common.vo;
import lombok.Data;
import lombok.ToString;
import java.io.File;
......@@ -11,6 +12,7 @@ import java.io.File;
* @Description TODO
**/
@Data
@ToString
public class DeviceLogFileVo {
String imei;
......
package com.mx.cneeds.common.vo;
import lombok.Data;
import lombok.ToString;
import java.io.File;
import java.util.List;
......@@ -12,6 +13,7 @@ import java.util.List;
* @Description TODO
**/
@Data
@ToString
public class WechatDeviceLogVo {
......
......@@ -92,31 +92,27 @@ public class Constant {
}
}
/**
* 云服务商
*/
public enum CloudService {
/**
* 七牛云
*/
QINIU(1),
public enum WechatFileDtoProp{
/**
* 阿里云
* 路径的属性
*/
ALIYUN(2),
Url("localtionUrl"),
/**
* 腾讯云
* 文件大小的属性
*/
QCLOUD(3);
Size("fileSize");
private int value;
private String key;
CloudService(int value) {
this.value = value;
WechatFileDtoProp(String key) {
this.key = key;
}
public int getValue() {
return value;
public String getKey() {
return key;
}
}
......
......@@ -11,6 +11,8 @@ public class ResultCode {
public static Integer NOTFOUND_IMEI = 1;
//没有设置渠道商
public static Integer NOTSET_CHANNEL = 2;
// 参数有误
public static Integer PARAMERROR = 3;
}
......@@ -47,7 +47,7 @@ public interface DeviceClient {
@RequestParam("order") String order);
@PostMapping("/device/info/infoByImei")
DeviceInfoDto queryDeviceByImei(@RequestParam String imei);
DeviceInfoDto queryDeviceByImei(@RequestBody String imei);
@PostMapping("/device/info/infoByIds")
List<DeviceInfoDto> queryDeviceByIds(@RequestBody Set<Long> ids);
......
package com.mx.cneeds.server.datashow.client;
import com.mx.cneeds.common.dto.DeviceLogFileDto;
import com.mx.cneeds.common.dto.PageDto;
import com.mx.cneeds.common.dto.WechatDeviceLogDto;
import com.mx.cneeds.common.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -38,4 +37,10 @@ public interface LogFileClient {
@PostMapping(value = "/log/upload/uploadLogFile")
void uploadLogFile(@RequestBody DeviceLogFileDto dto);
@PostMapping(value = "/log/upload/queryLogFileByLogid")
DeviceLogDto queryLogFileByLogid(@RequestBody Long logId);
@PostMapping(value = "/log/upload/wechatUploadAloneFile")
void wechatUploadAloneFile(@RequestBody WechatFileDto wechatFileDto);
}
......@@ -10,6 +10,8 @@ import com.mx.cneeds.common.vo.SeriesVo;
import com.mx.cneeds.server.datashow.client.DeviceClient;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -31,7 +33,6 @@ public class DeviceController {
@Autowired
private DeviceClient deviceClient;
@GetMapping("/device/getChannel_nums")
public R getChannel_nums(String imei){
......@@ -40,6 +41,7 @@ public class DeviceController {
try {
deviceInfoDto = deviceClient.queryDeviceByImei(imei);
if (deviceInfoDto == null){
log.debug("ResultCode:"+ResultCode.NOTFOUND_IMEI);
return R.error(ResultCode.NOTFOUND_IMEI,"没有该imei的设备");
}
}catch (Exception e) {
......@@ -192,8 +194,9 @@ public class DeviceController {
}
@PostMapping("/device/queryDeviceByImei")
public R queryDeviceByImei(@RequestParam(value = "imei") String imei){
DeviceInfoDto deviceInfoDto = deviceClient.queryDeviceByImei(imei);
public R queryDeviceByImei(@RequestBody DeviceInfoDto dto){
log.debug("queryDeviceByImei: imei:" + dto.getImei());
DeviceInfoDto deviceInfoDto = deviceClient.queryDeviceByImei(dto.getImei());
return R.ok().put("data",deviceInfoDto);
}
......
......@@ -6,6 +6,7 @@ import com.mx.cneeds.common.constant.FilePath;
import com.mx.cneeds.common.constant.ResultCode;
import com.mx.cneeds.common.converter.RequestParamterConverter;
import com.mx.cneeds.common.dto.*;
import com.mx.cneeds.common.pager.Constant;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.vo.DeviceLogFileVo;
import com.mx.cneeds.common.vo.WechatDeviceLogVo;
......@@ -21,9 +22,12 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -50,22 +54,35 @@ public class LogFlieController {
@Autowired
private UserClient userClient;
/**
*
* @param vo
* @return
* @throws IOException
*/
@PostMapping("/logfile/wechatDeviceLogUpload")
@ResponseBody
public R wechatUploadLog(WechatDeviceLogVo vo, MultipartFile[] file) throws IOException {
public R wechatUploadLog(@RequestBody WechatDeviceLogVo vo) throws IOException {
log.debug(vo.toString());
WechatDeviceLogDto dto = new WechatDeviceLogDto();
BeanUtils.copyProperties(vo, dto);
List<String> listUrl = new ArrayList<>();
for (MultipartFile f : file){
List<Map<String,String>> listUrl = new ArrayList<>();
/*for (MultipartFile f : file){
Map<String,String> map = new HashMap<>();
// 把图片存入 oos 返回路径
StringBuffer dir = new StringBuffer(FilePath.LogFilePath);
dir.append(vo.getLogAcceptId());
hdfsTemplate.saveFile(dir.toString(),f.getOriginalFilename(),f.getInputStream(),f.getSize(), (short) 2);
listUrl.add(dir.toString()+"/"+f.getOriginalFilename());
}
dto.setLocationUrls(listUrl);
map.put(Constant.WechatFileDtoProp.Url.getKey(),dir.toString()+"/"+f.getOriginalFilename());
map.put(Constant.WechatFileDtoProp.Size.getKey(),String.valueOf(f.getSize()));
listUrl.add(map);
}*/
dto.setFileMap(listUrl);
DeviceInfoDto deviceInfoDto = deviceClient.queryDeviceByImei(dto.getImei());
if (deviceInfoDto == null){
return R.error(ResultCode.NOTFOUND_IMEI,"没有该imei");
}
dto.setDeviceId(deviceInfoDto.getDeviceId());
UserDto userDto = userClient.userInfo(UserUtils.getUserName());
......@@ -76,15 +93,39 @@ public class LogFlieController {
return R.ok();
}
@PostMapping("/logfile/wechatUploadLogFile")
@ResponseBody
public R wechatUploadLogFile(String logAcceptId, MultipartFile file) throws IOException {
log.debug("wechatUploadLogFile: "+logAcceptId+" file : "+ (file==null ? "空":"不为空"));
StringBuffer dir = new StringBuffer(FilePath.LogFilePath);
dir.append(logAcceptId);
if (logAcceptId == null || file == null ) {
return R.error(ResultCode.PARAMERROR,"参数有误");
}
hdfsTemplate.saveFile(dir.toString(),file.getOriginalFilename(),file.getInputStream(),file.getSize(), (short) 2);
String locationUrl = dir.toString()+"/"+file.getOriginalFilename();
WechatFileDto dto = WechatFileDto.builder()
.fileSize(file.getSize())
.locationUrl(locationUrl)
.logAcceptId(logAcceptId).build();
log.debug(dto.toString());
logFileClient.wechatUploadAloneFile(dto);
return R.ok();
}
@PostMapping("/logfile/DeviceLogFileUpload")
@ResponseBody
public R uploadLogFile(DeviceLogFileVo vo, MultipartFile file) throws IOException {
DeviceLogFileDto dto = new DeviceLogFileDto();
BeanUtils.copyProperties(vo, dto);
log.debug(vo.toString());
DeviceInfoDto deviceInfoDto = deviceClient.queryDeviceByImei(dto.getImei());
if (deviceInfoDto == null){
log.debug("ResultCode: "+ResultCode.NOTFOUND_IMEI);
return R.error(ResultCode.NOTFOUND_IMEI,"没有该imei");
}
// 把图片存入oos 返回路径
......@@ -97,6 +138,46 @@ public class LogFlieController {
dto.setDeviceId(deviceInfoDto.getDeviceId());
logFileClient.uploadLogFile(dto);
log.debug("logAcceptId:"+vo.getLogAcceptId() + " ResultCode: 0");
return R.ok();
}
@RequestMapping("/logfile/downloadFile/{logId}/{isLogFile}/{fileName}")
public void downloadFile( HttpServletResponse response,
@PathVariable("logId") Long logId,
@PathVariable("fileName") String fileName,
@PathVariable("isLogFile") boolean isLogFile) throws IOException {
DeviceLogDto deviceLogDto = logFileClient.queryLogFileByLogid(logId);
/**
* log文件日志
*/
if (isLogFile){
ServletOutputStream outputStream = response.getOutputStream();
response.setContentType(deviceLogDto.getLogfileUrl().substring(deviceLogDto.getLogfileUrl().lastIndexOf(".")+1));
response.addHeader("Content-Disposition", "attachment; filename" + "testfilename");
byte[] bytes = new byte[1024];
InputStream inputStream = hdfsTemplate.openFile(deviceLogDto.getLogfileUrl().
substring(0,deviceLogDto.getLogfileUrl().lastIndexOf("/")), fileName);
long total = deviceLogDto.getLogfileSize();
while (total>0) {
inputStream.read(bytes);
outputStream.write(bytes,0, total>1024?1024: (int) total);
outputStream.flush();
total-=1024;
}
outputStream.close();
}else {
/**
* 微信上传的 图片 视频文件
*/
}
}
}
......@@ -20,4 +20,4 @@ spring:
max-request-size: 100000MB
logging:
config: classpath:logback-spring-dev.xml
\ No newline at end of file
config: classpath:logback-spring-dev.xml
......@@ -113,7 +113,6 @@
</appender>
<root level="debug">
<appender-ref ref="CONSOLE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="ERROR_FILE" />
......@@ -127,7 +126,7 @@
<!--<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="TRACE" />-->
<!-- 开发、测试环境 -->
<springProfile name="dev,test,pro">
<springProfile name="dev,test,prod">
<logger name="org.springframework" level="debug"/>
<logger name="org.springboot" level="debug" />
<logger name="com.mx" level="debug" />
......
......@@ -5,7 +5,7 @@
<contextName>logback</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<!-- <property name="log.path" value="E:/cneedsLog/log" />-->
<!-- <property name="log.path" value="E:/cneedsLog/log/datashow" />-->
<property name="log.path" value="/root/cneeds-server/cneedsLog/datashow" />
<!-- 彩色日志 -->
......@@ -53,7 +53,7 @@
</rollingPolicy>
<!-- 此日志文件只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<level>DEBUG</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
......@@ -127,7 +127,7 @@
<!--<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="TRACE" />-->
<!-- 开发、测试环境 -->
<springProfile name="dev,test,pro">
<springProfile name="dev,test,prod">
<logger name="org.springframework" level="debug"/>
<logger name="org.springboot" level="debug" />
<logger name="com.mx" level="debug" />
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}ul li[data-v-0c7971ae]{list-style:none}
\ No newline at end of file
.material-input__component .material-input-bar[data-v-d9b004ee]:after,.material-input__component .material-input-bar[data-v-d9b004ee]:before{content:"";height:1px;width:0;bottom:0;position:absolute;-webkit-transition:all .2s ease;transition:all .2s ease}.material-input__component[data-v-d9b004ee]{margin-top:36px;position:relative}.material-input__component [data-v-d9b004ee]{-webkit-box-sizing:border-box;box-sizing:border-box}.material-input__component .iconClass .material-input__icon[data-v-d9b004ee]{position:absolute;left:0;line-height:16px;color:#2196f3;top:12px;width:30px;height:16px;font-size:16px;font-weight:400;pointer-events:none}.material-input__component .iconClass .material-label[data-v-d9b004ee]{left:30px}.material-input__component .iconClass .material-input[data-v-d9b004ee]{text-indent:30px}.material-input__component .material-input[data-v-d9b004ee]{font-size:16px;padding:12px 12px 2px 6px;display:block;width:100%;border:none;line-height:1;border-radius:0}.material-input__component .material-input[data-v-d9b004ee]:focus{outline:none;border:none;border-bottom:1px solid transparent}.material-input__component .material-label[data-v-d9b004ee]{font-weight:400;position:absolute;pointer-events:none;left:0;top:0;-webkit-transition:all .2s ease;transition:all .2s ease;font-size:18px}.material-input__component .material-input-bar[data-v-d9b004ee]{position:relative;display:block;width:100%}.material-input__component .material-input-bar[data-v-d9b004ee]:before{left:50%}.material-input__component .material-input-bar[data-v-d9b004ee]:after{right:50%}.material-input__component.material--disabled .material-input[data-v-d9b004ee]{border-bottom-style:dashed}.material-input__component.material--raised .material-label[data-v-d9b004ee]{top:-28px;left:0;font-size:16px;font-weight:700}.material-input__component.material--active .material-input-bar[data-v-d9b004ee]:after,.material-input__component.material--active .material-input-bar[data-v-d9b004ee]:before{width:50%}.material-input__component[data-v-d9b004ee]{background:#fff}.material-input__component .material-input[data-v-d9b004ee]{background:none;color:#000;text-indent:0;border-bottom:1px solid #e0e0e0}.material-input__component .material-label[data-v-d9b004ee]{color:#9e9e9e}.material-input__component .material-input-bar[data-v-d9b004ee]:after,.material-input__component .material-input-bar[data-v-d9b004ee]:before{background:#2196f3}.material-input__component.material--active .material-label[data-v-d9b004ee]{color:#2196f3}.material-input__component.material--has-errors.material--active .material-label[data-v-d9b004ee]{color:#f44336}.material-input__component.material--has-errors .material-input-bar[data-v-d9b004ee]:after,.material-input__component.material--has-errors .material-input-bar[data-v-d9b004ee]:before{background:transparent}.detail-container[data-v-96296cca]{padding:40px 50px 20px}.detail-container .preview-img[data-v-96296cca]{width:200px;height:270px}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-67ae84aa"],{2017:function(e,t,o){"use strict";var s=o("b12d"),n=o.n(s);n.a},"29eb":function(e,t,o){"use strict";var s=o("e04a"),n=o.n(s);n.a},"9ed6":function(e,t,o){"use strict";o.r(t);var s=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"login-container"},[o("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,autocomplete:"on","label-position":"left"}},[o("div",{staticClass:"title-container"},[o("h3",{staticClass:"title"},[e._v("美行科技")])]),e._v(" "),o("el-form-item",{attrs:{prop:"username"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"user"}})],1),e._v(" "),o("el-input",{ref:"username",attrs:{placeholder:"用户名",name:"username",type:"text",tabindex:"1",autocomplete:"on"},model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}})],1),e._v(" "),o("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[o("el-form-item",{attrs:{prop:"password"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"password"}})],1),e._v(" "),o("el-input",{key:e.passwordType,ref:"password",attrs:{type:e.passwordType,placeholder:"密码",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(t){e.capsTooltip=!1}},nativeOn:{keyup:[function(t){return e.checkCapslock(t)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}]},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}}),e._v(" "),o("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[o("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1)],1),e._v(" "),o("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e._v("登录\n ")])],1)],1)},n=[],r=(o("ac6a"),o("456d"),{name:"Login",data:function(){var e=function(e,t,o){t&&0!==t.length?o():o(new Error("请输入用户名"))},t=function(e,t,o){t.length<4?o(new Error("密码不能少于4位")):o()};return{loginForm:{username:"admin",password:"admin"},loginRules:{username:[{required:!0,trigger:"change",validator:e}],password:[{required:!0,trigger:"blur",validator:t}]},passwordType:"password",capsTooltip:!1,loading:!1,showDialog:!1,redirect:void 0,otherQuery:{}}},watch:{$route:{handler:function(e){var t=e.query;t&&(this.redirect=t.redirect,this.otherQuery=this.getOtherQuery(t))},immediate:!0}},mounted:function(){""===this.loginForm.username?this.$refs.username.focus():""===this.loginForm.password&&this.$refs.password.focus()},methods:{checkCapslock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.shiftKey,o=e.key;console.log(t,o),o&&1===o.length?this.capsTooltip=!!(t&&o>="A"&&o<="Z"||!t&&o>="A"&&o<="Z"):this.capsTooltip=!1,"CapsLock"===o&&!0===this.capsTooltip&&(this.capsTooltip=!1)},showPwd:function(){var e=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){e.$refs.password.focus()}))},handleLogin:function(){var e=this;this.$refs.loginForm.validate((function(t){if(!t)return console.log("error submit!!"),!1;e.loading=!0,e.$store.dispatch("user/login",e.loginForm).then((function(){e.$router.push({path:e.redirect||"/",query:e.otherQuery}),e.loading=!1})).catch((function(){e.loading=!1}))}))},getOtherQuery:function(e){return Object.keys(e).reduce((function(t,o){return"redirect"!==o&&(t[o]=e[o]),t}),{})}}}),a=r,i=(o("2017"),o("29eb"),o("2877")),l=Object(i["a"])(a,s,n,!1,null,"0ba579f9",null);t["default"]=l.exports},b12d:function(e,t,o){},e04a:function(e,t,o){}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-116c2bab"],{2017:function(e,t,o){"use strict";var s=o("b12d"),n=o.n(s);n.a},"29eb":function(e,t,o){"use strict";var s=o("e04a"),n=o.n(s);n.a},"9ed6":function(e,t,o){"use strict";o.r(t);var s=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"login-container"},[o("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,autocomplete:"on","label-position":"left"}},[o("div",{staticClass:"title-container"},[o("h3",{staticClass:"title"},[e._v("美行科技")])]),e._v(" "),o("el-form-item",{attrs:{prop:"username"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"user"}})],1),e._v(" "),o("el-input",{ref:"username",attrs:{placeholder:"用户名",name:"username",type:"text",tabindex:"1",autocomplete:"on"},model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}})],1),e._v(" "),o("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[o("el-form-item",{attrs:{prop:"password"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"password"}})],1),e._v(" "),o("el-input",{key:e.passwordType,ref:"password",attrs:{type:e.passwordType,placeholder:"密码",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(t){e.capsTooltip=!1}},nativeOn:{keyup:[function(t){return e.checkCapslock(t)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}]},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}}),e._v(" "),o("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[o("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1)],1),e._v(" "),o("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e._v("登录\n ")])],1)],1)},n=[],r=(o("ac6a"),o("456d"),{name:"Login",data:function(){var e=function(e,t,o){t&&0!==t.length?o():o(new Error("请输入用户名"))},t=function(e,t,o){t.length<4?o(new Error("密码不能少于4位")):o()};return{loginForm:{username:"admin",password:"admin"},loginRules:{username:[{required:!0,trigger:"change",validator:e}],password:[{required:!0,trigger:"blur",validator:t}]},passwordType:"password",capsTooltip:!1,loading:!1,showDialog:!1,redirect:void 0,otherQuery:{}}},watch:{$route:{handler:function(e){var t=e.query;t&&(this.redirect=t.redirect,this.otherQuery=this.getOtherQuery(t))},immediate:!0}},mounted:function(){""===this.loginForm.username?this.$refs.username.focus():""===this.loginForm.password&&this.$refs.password.focus()},methods:{checkCapslock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.shiftKey,o=e.key;console.log(t,o),o&&1===o.length?this.capsTooltip=!!(t&&o>="A"&&o<="Z"||!t&&o>="A"&&o<="Z"):this.capsTooltip=!1,"CapsLock"===o&&!0===this.capsTooltip&&(this.capsTooltip=!1)},showPwd:function(){var e=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){e.$refs.password.focus()}))},handleLogin:function(){var e=this;this.$refs.loginForm.validate((function(t){if(!t)return console.log("error submit!!"),!1;e.loading=!0,e.$store.dispatch("user/login",e.loginForm).then((function(){e.$router.push({path:e.redirect||"/",query:e.otherQuery}),e.loading=!1})).catch((function(){e.loading=!1}))}))},getOtherQuery:function(e){return Object.keys(e).reduce((function(t,o){return"redirect"!==o&&(t[o]=e[o]),t}),{})}}}),a=r,i=(o("2017"),o("29eb"),o("2877")),l=Object(i["a"])(a,s,n,!1,null,"0ba579f9",null);t["default"]=l.exports},b12d:function(e,t,o){},e04a:function(e,t,o){}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1a07b08b"],{"07ea":function(e,t,l){"use strict";l.r(t);var n=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("el-container",[l("el-header",[l("div",{staticStyle:{margin:"20px 0"}},[l("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"imei",clearable:""},on:{clear:e.handleFilter,blur:e.handleFilter},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter(t)}},model:{value:e.listQuery.title,callback:function(t){e.$set(e.listQuery,"title",t)},expression:"listQuery.title"}}),e._v(" "),l("el-button",{directives:[{name:"waves",rawName:"v-waves"}],staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.handleFilter}},[e._v("\n 查询\n ")])],1)]),e._v(" "),l("el-main",[l("el-tabs",{attrs:{"tab-position":e.top}},[l("el-tab-pane",{attrs:{label:"设备信息"}},[l("ul",[l("li",[e._v("\n 产品系列:\n ")]),e._v(" "),l("el-divider"),e._v(" "),l("li",[e._v("\n ICCID:\n ")]),e._v(" "),l("el-divider"),e._v(" "),l("li",[e._v("\n 版本号:\n ")]),e._v(" "),l("el-divider"),e._v(" "),l("li",[e._v("\n 激活状态:\n ")]),e._v(" "),l("el-divider"),e._v(" "),l("li",[e._v("\n IMEI:\n ")]),e._v(" "),l("el-divider"),e._v(" "),l("li",[e._v("\n 激活时间\n ")]),e._v(" "),l("el-divider")],1)]),e._v(" "),l("el-tab-pane",{attrs:{label:"移动网络"}},[l("ul",[l("li",[e._v("\n 开关:\n "),l("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#ff4949"},on:{change:e.change},model:{value:e.value2,callback:function(t){e.value2=t},expression:"value2"}})],1)])]),e._v(" "),l("el-tab-pane",{attrs:{label:"WLAN"}},[e._v("配置管理")]),e._v(" "),l("el-tab-pane",{attrs:{label:"GPS"}},[e._v("角色管理")]),e._v(" "),l("el-tab-pane",{attrs:{label:"蓝牙"}},[e._v("定时任务补偿")]),e._v(" "),l("el-tab-pane",{attrs:{label:"其他"}},[e._v("配置管理")]),e._v(" "),l("el-tab-pane",{attrs:{label:"CPU"}},[e._v("角色管理")]),e._v(" "),l("el-tab-pane",{attrs:{label:"远程指令"}},[e._v("定时任务补偿")])],1)],1)],1)},i=[],a=l("c7a7"),r=l("c24f"),s=l("ed08"),c={directives:{waves:a["a"]},filters:{statusValueFilter:function(e){return 0===e?e="禁用":1===e&&(e="正常"),e},valueFilter:function(e){return e||"无"},timeFilter:function(e){return e?Object(s["d"])(e,"{y}-{m}-{d} {h}:{i}"):"无"}},data:function(){return{tableKey:0,listLoading:!0,listQuery:{},list:[],total:0,defaultSort:{},multipleSelection:[],user:{},userIds:[],gridData:{},value2:!0}},created:function(){},mounted:function(){this.getList()},beforeRouteUpdate:function(e,t,l){if(e.path===t.path){var n=Object.assign({},e.query),i=Object.assign({},t.query);JSON.stringify(n)!==JSON.stringify(i)&&this.getList()}l()},methods:{change:function(e){return e},handleSelectionChange:function(e){this.multipleSelection=e},sortChange:function(e){console.log("sortChange",e);var t=e.prop,l=e.order;this.sortBy(t,l)},sortBy:function(e,t){this.listQuery.sort="ascending"===t?"+".concat(e):"-".concat(e),this.handleFilter()},getList:function(){var e=this;this.listLoading=!0,Object(r["g"])(this.listQuery).then((function(t){var l=t.data,n=l.list,i=l.totalCount;e.list=n,e.total=i,e.listLoading=!1}))},handleFilter:function(){console.log("handleFilter",this.listQuery),this.listQuery.page=1,this.refresh()}}},o=c,u=(l("27c1"),l("2877")),v=Object(u["a"])(o,n,i,!1,null,"0c7971ae",null);t["default"]=v.exports},"27c1":function(e,t,l){"use strict";var n=l("c22c"),i=l.n(n);i.a},"8d41":function(e,t,l){},c22c:function(e,t,l){},c7a7:function(e,t,l){"use strict";l("8d41");var n="@@wavesContext";function i(e,t){function l(l){var n=Object.assign({},t.value),i=Object.assign({ele:e,type:"hit",color:"rgba(0, 0, 0, 0.15)"},n),a=i.ele;if(a){a.style.position="relative",a.style.overflow="hidden";var r=a.getBoundingClientRect(),s=a.querySelector(".waves-ripple");switch(s?s.className="waves-ripple":(s=document.createElement("span"),s.className="waves-ripple",s.style.height=s.style.width=Math.max(r.width,r.height)+"px",a.appendChild(s)),i.type){case"center":s.style.top=r.height/2-s.offsetHeight/2+"px",s.style.left=r.width/2-s.offsetWidth/2+"px";break;default:s.style.top=(l.pageY-r.top-s.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",s.style.left=(l.pageX-r.left-s.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return s.style.backgroundColor=i.color,s.className="waves-ripple z-active",!1}}return e[n]?e[n].removeHandle=l:e[n]={removeHandle:l},l}t["a"]={bind:function(e,t){e.addEventListener("click",i(e,t),!1)},update:function(e,t){e.removeEventListener("click",e[n].removeHandle,!1),e.addEventListener("click",i(e,t),!1)},unbind:function(e){e.removeEventListener("click",e[n].removeHandle,!1),e[n]=null,delete e[n]}}}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0cfe15"],{6632:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("detail",{attrs:{"is-edit":!1}})},c=[],l=n("9a8b"),s={components:{Detail:l["a"]}},i=s,u=n("2877"),o=Object(u["a"])(i,a,c,!1,null,null,null);t["default"]=o.exports}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d213927"],{acf5:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("detail",{attrs:{"is-edit":""}})},c=[],s=n("9a8b"),i={components:{Detail:s["a"]}},l=i,o=n("2877"),r=Object(o["a"])(l,a,c,!1,null,"20dbc3ba",null);e["default"]=r.exports}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d230a36"],{ecac:function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"app-container"},[e.user?s("div",[s("el-row",{attrs:{gutter:20}},[s("el-col",{attrs:{span:18,xs:24}},[s("el-card",[s("el-tabs",{model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[s("el-tab-pane",{attrs:{label:"Account",name:"account"}},[s("account",{attrs:{user:e.user}})],1)],1)],1)],1)],1)],1):e._e()])},r=[],n=(s("96cf"),s("3b8d")),l=(s("7f7f"),s("db72")),o=s("2f62"),i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-form",{ref:"editUser",attrs:{model:e.user,rules:e.rules,"label-width":"80px"}},[s("el-row",[s("el-col",{attrs:{span:12}},[s("el-form-item",{attrs:{prop:"username",label:"账户名"}},[s("el-input",{attrs:{disabled:!0},model:{value:e.user.username,callback:function(t){e.$set(e.user,"username",t)},expression:"user.username"}})],1)],1),e._v(" "),s("el-col",{attrs:{span:12}},[s("el-form-item",{attrs:{prop:"password",label:"初始密码"}},[s("el-input",{model:{value:e.user.password,callback:function(t){e.$set(e.user,"password",t)},expression:"user.password"}})],1)],1)],1),e._v(" "),s("el-row",[s("el-col",{attrs:{span:10}},[s("el-form-item",{attrs:{prop:"mobile",label:"手机号"}},[s("el-input",{model:{value:e.user.mobile,callback:function(t){e.$set(e.user,"mobile",t)},expression:"user.mobile"}})],1)],1),e._v(" "),s("el-col",{attrs:{span:10}},[s("el-form-item",{attrs:{prop:"email",label:"邮箱"}},[s("el-input",{model:{value:e.user.email,callback:function(t){e.$set(e.user,"email",t)},expression:"user.email"}})],1)],1)],1),e._v(" "),s("el-form-item",[s("el-button",{attrs:{type:"primary"},on:{click:e.submit}},[e._v("修改")])],1)],1)},u=[],c=(s("ac6a"),s("456d"),s("c24f")),m=s("ed08"),p={props:{user:{type:Object,default:function(){return{name:"",email:"",mobile:"",password:""}}}},data:function(){return{loading:!1}},mounted:function(){this.getUserInfo()},methods:{submit:function(){var e=this;this.loading||(this.loading=!0,this.$refs.editUser.validate((function(t,s){if(t)e.user.createTime=Object(m["d"])(e.user.createTime,"{y}-{m}-{d} {h}:{i}:{s}"),Object(c["f"])(e.user).then((function(t){var s=t.msg;e.$notify({title:"操作成功",message:s,type:"success",duration:2e3}),e.setDefault(),e.loading=!1})).catch((function(){e.loading=!1}));else{var a=s[Object.keys(s)[0]][0].message;e.$message({message:a,type:"error"}),e.loading=!1}})))}}},d=p,f=s("2877"),b=Object(f["a"])(d,i,u,!1,null,null,null),v=b.exports,h={name:"Profile",components:{Account:v},data:function(){return{user:{},activeTab:"account"}},computed:Object(l["a"])({},Object(o["b"])(["name","avatar","roles"])),created:function(){console.log(this.name),this.getUser(),this.getUserInfo()},methods:{getUser:function(){this.user={username:this.name}},getUserInfo:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:Object(c["d"])(this.user.username).then((function(e){var s=e.data;t.user=s}));case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}},g=h,w=Object(f["a"])(g,a,r,!1,null,null,null);t["default"]=w.exports}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-73bfcbf0"],{"0be0":function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-container",[r("el-main",[r("el-form",{ref:"addUser",attrs:{model:e.user,rules:e.rules,"label-width":"80px"}},[r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"deptId",label:"所属部门"}},[r("el-cascader",{attrs:{"expand-trigger":"hover",options:e.options,"show-all-levels":!1,"change-on-select":""},on:{change:e.handleChange},model:{value:e.selectDeptParents,callback:function(t){e.selectDeptParents=t},expression:"selectDeptParents"}})],1)],1),e._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"roleId",label:"所属角色"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.user.roleId,callback:function(t){e.$set(e.user,"roleId",t)},expression:"user.roleId"}},e._l(e.selectoptions,(function(e){return r("el-option",{key:e.roleId,attrs:{label:e.roleName,value:e.roleId}})})),1)],1)],1)],1),e._v(" "),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"username",label:"账户名"}},[r("el-input",{model:{value:e.user.username,callback:function(t){e.$set(e.user,"username",t)},expression:"user.username"}})],1)],1),e._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"password",label:"初始密码"}},[r("el-input",{model:{value:e.user.password,callback:function(t){e.$set(e.user,"password",t)},expression:"user.password"}})],1)],1)],1),e._v(" "),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"mobile",label:"手机号"}},[r("el-input",{model:{value:e.user.mobile,callback:function(t){e.$set(e.user,"mobile",t)},expression:"user.mobile"}})],1)],1),e._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"email",label:"邮箱"}},[r("el-input",{model:{value:e.user.email,callback:function(t){e.$set(e.user,"email",t)},expression:"user.email"}})],1)],1)],1),e._v(" "),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"remark",label:"介绍"}},[r("el-input",{model:{value:e.user.remark,callback:function(t){e.$set(e.user,"remark",t)},expression:"user.remark"}})],1)],1),e._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"status",label:"账户状态"}},[r("el-select",{attrs:{placeholder:"选择"},model:{value:e.user.status,callback:function(t){e.$set(e.user,"status",t)},expression:"user.status"}},[r("el-option",{attrs:{label:"可用",value:"0"}}),e._v(" "),r("el-option",{attrs:{label:"不可用",value:"1"}})],1)],1)],1)],1),e._v(" "),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"权限设置"}},[r("el-tree",{ref:"funcTree",attrs:{data:e.funcTreeData,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps}})],1)],1),e._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"数据权限"}},[r("el-tree",{ref:"deptTree",attrs:{data:e.deptTreeData,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps}})],1)],1)],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("添加")]),e._v(" "),r("el-button",{on:{click:e.toUserList}},[e._v("取消")])],1)],1)],1)],1)},a=[],s=(r("ac6a"),r("456d"),r("96cf"),r("3b8d")),o=r("fe05"),l=r("c24f"),u=r("2c98"),i=r("cc5e"),c={roleId:"选择角色",remark:"描述",deptId:"选择部门",username:"用户名",mobile:"手机",email:"邮箱",status:"状态",deptIdList:"数据权限",funcIdList:"模块权限"},d={data:function(){var e=function(e,t,r){void 0===t||null===t||0===t.length?r(new Error(c[e.field]+"必须填写")):r()};return{loading:!1,user:{deptIdList:[],funcIdList:[]},rules:{roleId:[{validator:e}],remark:[{validator:e}],deptId:[{validator:e}],username:[{validator:e}],mobile:[{validator:e}],email:[{validator:e}],status:[{validator:e}],deptIdList:[{validator:e}]},options:[],selectoptions:[],selectDeptParents:[],funcTreeData:[],deptTreeData:[],defaultProps:{children:"children",label:"label"}}},mounted:function(){this.getFormData()},methods:{getFormData:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.selectRole();case 2:return e.next=4,this.selectDeptParent();case 4:return e.next=6,this.selectDeptParentTree();case 6:return e.next=8,this.selectFuncTree();case 8:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),setDefault:function(){this.$refs.addUser.resetFields()},onSubmit:function(){var e=this;this.loading||(this.loading=!0,this.$refs.addUser.validate((function(t,r){if(t)e.handleDeptChange(),e.handleFuncChange(),Object(l["a"])(e.user).then((function(t){var r=t.msg;e.$notify({title:"操作成功",message:r,type:"success",duration:2e3}),e.setDefault(),e.toUserList(),e.loading=!1})).catch((function(){e.loading=!1}));else{var n=r[Object.keys(r)[0]][0].message;e.$message({message:n,type:"error"}),e.loading=!1}})))},toUserList:function(){this.$router.push({path:"/system/user"})},selectRole:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(i["e"])().then((function(e){var r=e.data;t.selectoptions=r}));case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),selectDeptParent:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(o["e"])().then((function(e){var r=e.data;t.options=r}));case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),selectDeptParentTree:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(o["f"])().then((function(e){var r=e.data;t.deptTreeData=r}));case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),selectFuncTree:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(u["b"])().then((function(e){var r=e.data;t.funcTreeData=r}));case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),handleChange:function(e){var t=e.length;t-=1,this.user.deptId=e[t]},handleFuncChange:function(){var e=[];this.$refs.funcTree.getCheckedNodes().forEach((function(t){e.push(t.id)})),this.user.funcIdList=e},handleDeptChange:function(){var e=[];this.$refs.deptTree.getCheckedNodes().forEach((function(t){e.push(t.id)})),this.user.deptIdList=e}}},p=d,f=r("2877"),m=Object(f["a"])(p,n,a,!1,null,"15eb5fda",null);t["default"]=m.exports},"2c98":function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return s}));r("55dd");var n=r("b775");function a(e){return Object(n["a"])({url:"/sys/module/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function s(){return Object(n["a"])({url:"/sys/func/listAll",method:"post"})}},cc5e:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return s})),r.d(t,"f",(function(){return o})),r.d(t,"b",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"e",(function(){return i}));r("55dd");var n=r("b775");function a(e){return Object(n["a"])({url:"/sys/role/info",method:"post",data:{roleId:e}})}function s(e){return Object(n["a"])({url:"/sys/role/add",method:"post",data:e})}function o(e){return Object(n["a"])({url:"/sys/role/edit",method:"post",data:e})}function l(e){return Object(n["a"])({url:"/sys/role/delete",method:"post",data:{ids:e}})}function u(e){return Object(n["a"])({url:"/sys/role/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function i(){return Object(n["a"])({url:"/sys/role/listAll",method:"post"})}},fe05:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return o})),r.d(t,"a",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"b",(function(){return i}));r("55dd");var n=r("b775");function a(e){return Object(n["a"])({url:"/sys/dept/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function s(){return Object(n["a"])({url:"/sys/dept/listAll",method:"post"})}function o(){return Object(n["a"])({url:"/sys/dept/listAllTree",method:"post"})}function l(e){return Object(n["a"])({url:"/sys/dept/add",method:"post",data:e})}function u(e){return Object(n["a"])({url:"/sys/dept/edit",method:"post",data:e})}function i(e){return Object(n["a"])({url:"/sys/dept/delete",method:"post",data:{ids:e}})}}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-73bfcbf0"],{"0be0":function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-container",[r("el-main",[r("el-form",{ref:"addUser",attrs:{model:e.user,rules:e.rules,"label-width":"80px"}},[r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"deptId",label:"所属部门"}},[r("el-cascader",{attrs:{"expand-trigger":"hover",options:e.options,"show-all-levels":!1,"change-on-select":""},on:{change:e.handleChange},model:{value:e.selectDeptParents,callback:function(t){e.selectDeptParents=t},expression:"selectDeptParents"}})],1)],1),e._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"roleId",label:"所属角色"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.user.roleId,callback:function(t){e.$set(e.user,"roleId",t)},expression:"user.roleId"}},e._l(e.selectoptions,(function(e){return r("el-option",{key:e.roleId,attrs:{label:e.roleName,value:e.roleId}})})),1)],1)],1)],1),e._v(" "),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"username",label:"账户名"}},[r("el-input",{model:{value:e.user.username,callback:function(t){e.$set(e.user,"username",t)},expression:"user.username"}})],1)],1),e._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"password",label:"初始密码"}},[r("el-input",{model:{value:e.user.password,callback:function(t){e.$set(e.user,"password",t)},expression:"user.password"}})],1)],1)],1),e._v(" "),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"mobile",label:"手机号"}},[r("el-input",{model:{value:e.user.mobile,callback:function(t){e.$set(e.user,"mobile",t)},expression:"user.mobile"}})],1)],1),e._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"email",label:"邮箱"}},[r("el-input",{model:{value:e.user.email,callback:function(t){e.$set(e.user,"email",t)},expression:"user.email"}})],1)],1)],1),e._v(" "),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"remark",label:"介绍"}},[r("el-input",{model:{value:e.user.remark,callback:function(t){e.$set(e.user,"remark",t)},expression:"user.remark"}})],1)],1),e._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{prop:"status",label:"账户状态"}},[r("el-select",{attrs:{placeholder:"选择"},model:{value:e.user.status,callback:function(t){e.$set(e.user,"status",t)},expression:"user.status"}},[r("el-option",{attrs:{label:"禁用",value:"0"}}),e._v(" "),r("el-option",{attrs:{label:"可用",value:"1"}})],1)],1)],1)],1),e._v(" "),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"权限设置"}},[r("el-tree",{ref:"funcTree",attrs:{data:e.funcTreeData,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps}})],1)],1),e._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"数据权限"}},[r("el-tree",{ref:"deptTree",attrs:{data:e.deptTreeData,"show-checkbox":"","default-expand-all":"","node-key":"id","highlight-current":"",props:e.defaultProps}})],1)],1)],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("添加")]),e._v(" "),r("el-button",{on:{click:e.toUserList}},[e._v("取消")])],1)],1)],1)],1)},a=[],s=(r("ac6a"),r("456d"),r("96cf"),r("3b8d")),o=r("fe05"),l=r("c24f"),u=r("2c98"),i=r("cc5e"),c={roleId:"选择角色",remark:"描述",deptId:"选择部门",username:"用户名",mobile:"手机",email:"邮箱",status:"状态",userDeptIdList:"数据权限",userFuncIdList:"模块权限"},d={data:function(){var e=function(e,t,r){void 0===t||null===t||0===t.length?r(new Error(c[e.field]+"必须填写")):r()};return{loading:!1,user:{userDeptIdList:[],userFuncIdList:[]},rules:{roleId:[{validator:e}],remark:[{validator:e}],deptId:[{validator:e}],username:[{validator:e}],mobile:[{validator:e}],email:[{validator:e}],status:[{validator:e}],userDeptIdList:[{validator:e}]},options:[],selectoptions:[],selectDeptParents:[],funcTreeData:[],deptTreeData:[],defaultProps:{children:"children",label:"label"}}},mounted:function(){this.getFormData()},methods:{getFormData:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.selectRole();case 2:return e.next=4,this.selectDeptParent();case 4:return e.next=6,this.selectDeptParentTree();case 6:return e.next=8,this.selectFuncTree();case 8:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),setDefault:function(){this.$refs.addUser.resetFields()},onSubmit:function(){var e=this;this.loading||(this.loading=!0,this.$refs.addUser.validate((function(t,r){if(t)e.handleDeptChange(),e.handleFuncChange(),Object(l["a"])(e.user).then((function(t){var r=t.msg;e.$notify({title:"操作成功",message:r,type:"success",duration:2e3}),e.setDefault(),e.toUserList(),e.loading=!1})).catch((function(){e.loading=!1}));else{var n=r[Object.keys(r)[0]][0].message;e.$message({message:n,type:"error"}),e.loading=!1}})))},toUserList:function(){this.$router.push({path:"/system/user"})},selectRole:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(i["e"])().then((function(e){var r=e.data;t.selectoptions=r}));case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),selectDeptParent:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(o["e"])().then((function(e){var r=e.data;t.options=r}));case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),selectDeptParentTree:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(o["f"])().then((function(e){var r=e.data;t.deptTreeData=r}));case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),selectFuncTree:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(u["b"])().then((function(e){var r=e.data;t.funcTreeData=r}));case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),handleChange:function(e){var t=e.length;t-=1,this.user.deptId=e[t]},handleFuncChange:function(){var e=[];this.$refs.funcTree.getCheckedNodes().forEach((function(t){e.push(t.id)})),this.user.userFuncIdList=e},handleDeptChange:function(){var e=[];this.$refs.deptTree.getCheckedNodes().forEach((function(t){e.push(t.id)})),this.user.userDeptIdList=e}}},p=d,f=r("2877"),m=Object(f["a"])(p,n,a,!1,null,"36917084",null);t["default"]=m.exports},"2c98":function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return s}));r("55dd");var n=r("b775");function a(e){return Object(n["a"])({url:"/sys/module/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function s(){return Object(n["a"])({url:"/sys/func/listAll",method:"post"})}},cc5e:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return s})),r.d(t,"f",(function(){return o})),r.d(t,"b",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"e",(function(){return i}));r("55dd");var n=r("b775");function a(e){return Object(n["a"])({url:"/sys/role/info",method:"post",data:{roleId:e}})}function s(e){return Object(n["a"])({url:"/sys/role/add",method:"post",data:e})}function o(e){return Object(n["a"])({url:"/sys/role/edit",method:"post",data:e})}function l(e){return Object(n["a"])({url:"/sys/role/delete",method:"post",data:{ids:e}})}function u(e){return Object(n["a"])({url:"/sys/role/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function i(){return Object(n["a"])({url:"/sys/role/listAll",method:"post"})}},fe05:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return o})),r.d(t,"a",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"b",(function(){return i}));r("55dd");var n=r("b775");function a(e){return Object(n["a"])({url:"/sys/dept/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function s(){return Object(n["a"])({url:"/sys/dept/listAll",method:"post"})}function o(){return Object(n["a"])({url:"/sys/dept/listAllTree",method:"post"})}function l(e){return Object(n["a"])({url:"/sys/dept/add",method:"post",data:e})}function u(e){return Object(n["a"])({url:"/sys/dept/edit",method:"post",data:e})}function i(e){return Object(n["a"])({url:"/sys/dept/delete",method:"post",data:{ids:e}})}}}]);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -62,7 +62,7 @@ public class DeviceInfoController {
* 信息
*/
@RequestMapping("/infoByImei")
public DeviceInfoDto infoByimei(String imei){
public DeviceInfoDto infoByimei(@RequestBody String imei){
DeviceInfoEntity deviceInfoEntity = deviceInfoService.queryDeviceByImei(imei);
DeviceInfoDto deviceInfoDto = new DeviceInfoDto();
if (deviceInfoEntity != null){
......
#FROM hub.c.163.com/library/java:8-alpine
#FROM hub.c.163.com/library/java:8-jre
FROM openjdk:8
MAINTAINER XXX XXX@imooc.com
ADD target/*.jar app.jar
# ADD *.jar app.jar
EXPOSE 8761
ENTRYPOINT ["java", "-jar", "/app.jar"]
\ No newline at end of file
#!/usr/bin/env bash
mvn clean package -Dmaven.test.skip=true -U
#docker build -t hub.c.163.com/springcloud/eureka .
#docker push hub.c.163.com/springcloud/eureka
#docker build -t zzrdark/eureka .
#docker push zzrdark/eureka
docker build -t 192.168.2.244:5000/springcloud_user .
docker push 192.168.2.244:5000/springcloud_user
\ No newline at end of file
......@@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.server.entity.DeviceLogmediaEntity;
import java.util.List;
import java.util.Map;
public interface DeviceLogMediaService extends IService<DeviceLogmediaEntity> {
void savewechatMedia(Long logId, List<String> urls);
void savewechatMedias(Long logId, List<Map<String,String>> urls);
void savewechatMedia(Long logId, Long fileSize, String locationUrl);
}
package com.mx.cneeds.server.logupload.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mx.cneeds.common.pager.Constant;
import com.mx.cneeds.server.dao.DeviceLogmediaDao;
import com.mx.cneeds.server.entity.DeviceLogEntity;
import com.mx.cneeds.server.entity.DeviceLogmediaEntity;
......@@ -9,6 +10,7 @@ import org.springframework.stereotype.Service;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* @ClassName DeviceLogMediaServiceImpl
......@@ -20,16 +22,27 @@ import java.util.List;
public class DeviceLogMediaServiceImpl extends ServiceImpl<DeviceLogmediaDao, DeviceLogmediaEntity> implements DeviceLogMediaService {
@Override
public void savewechatMedia(Long logId, List<String> urls){
public void savewechatMedias(Long logId, List<Map<String,String>> fileMaps){
List<DeviceLogmediaEntity> deviceLogmediaEntities = new LinkedList<DeviceLogmediaEntity>();
for (String url:urls){
for (Map<String,String> fileMap:fileMaps){
DeviceLogmediaEntity deviceLogmediaEntity = new DeviceLogmediaEntity();
deviceLogmediaEntity.setLocationUrl(url);
deviceLogmediaEntity.setLocationUrl(fileMap.get(Constant.WechatFileDtoProp.Url.getKey()));
deviceLogmediaEntity.setLogId(logId);
deviceLogmediaEntity.setType(url.substring(url.indexOf(".")));
deviceLogmediaEntity.setType(fileMap.get(Constant.WechatFileDtoProp.Url.getKey()).substring(fileMap.get(Constant.WechatFileDtoProp.Url.getKey()).indexOf(".")+1));
deviceLogmediaEntity.setFileSize(Long.valueOf(fileMap.get(Constant.WechatFileDtoProp.Size.getKey())));
deviceLogmediaEntities.add(deviceLogmediaEntity);
}
saveBatch(deviceLogmediaEntities);
}
@Override
public void savewechatMedia(Long logId, Long fileSize, String locationUrl){
DeviceLogmediaEntity deviceLogmediaEntity = new DeviceLogmediaEntity();
deviceLogmediaEntity.setLocationUrl(locationUrl);
deviceLogmediaEntity.setLogId(logId);
deviceLogmediaEntity.setType(locationUrl.substring(locationUrl.lastIndexOf(".")+1));
deviceLogmediaEntity.setFileSize(fileSize);
save(deviceLogmediaEntity);
}
}
......@@ -66,6 +66,7 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogDao, DeviceLogEnt
}else {
deviceLogEntity.setCreateTime(new Date());
deviceLogEntity.setStatus(-1);
// deviceLogEntity.setLogfileStatus();
getBaseMapper().insert(deviceLogEntity);
logEntity = queryOneBylogAcceptId(deviceLogEntity.getLogAcceptId());
}
......
......@@ -3,6 +3,7 @@ package com.mx.cneeds.server.logupload.web;
import com.mx.cneeds.common.dto.DeviceLogDto;
import com.mx.cneeds.common.dto.DeviceLogFileDto;
import com.mx.cneeds.common.dto.WechatDeviceLogDto;
import com.mx.cneeds.common.dto.WechatFileDto;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.server.entity.DeviceLogEntity;
......@@ -11,10 +12,7 @@ import com.mx.cneeds.server.logupload.service.DeviceLogService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.io.File;
import java.util.*;
......@@ -48,9 +46,29 @@ public class LogUploadController {
deviceLogEntity.setRepetitionSteps(dto.getSteps());
Long logId = deviceLogService.wechatUploadLog(deviceLogEntity);
if (dto.getLocationUrls()!=null && dto.getLocationUrls().size() != 0){
deviceLogMediaService.savewechatMedia(logId, dto.getLocationUrls());
/*if (dto.getFileMap()!=null && dto.getFileMap().size() != 0){
deviceLogMediaService.savewechatMedias(logId, dto.getFileMap());
}*/
}
@RequestMapping("/wechatUploadAloneFile")
public void wechatUploadAloneFile(@RequestBody WechatFileDto dto){
DeviceLogEntity deviceLogEntity = null;
if (dto.getLogAcceptId()!=null){
deviceLogEntity = deviceLogService.queryOneBylogAcceptId(dto.getLogAcceptId());
}
if (deviceLogEntity != null){
deviceLogMediaService.savewechatMedia(deviceLogEntity.getLogId(), dto.getFileSize(), dto.getLocationUrl());
}
}
@RequestMapping("/queryLogFileByLogid")
public DeviceLogDto queryLogFileByLogid(@RequestBody long logId){
DeviceLogEntity deviceLogEntity = deviceLogService.getById(logId);
DeviceLogDto dto = new DeviceLogDto();
BeanUtils.copyProperties(deviceLogEntity, dto);
return dto;
}
......@@ -87,13 +105,6 @@ public class LogUploadController {
return R.ok();
}
/**
* 下载日志文件
*/
@RequestMapping("/downloadfile")
public void downFile(){
}
@RequestMapping("/finishLog")
public R finishLog(@RequestBody Long logId){
......@@ -101,4 +112,6 @@ public class LogUploadController {
return R.ok();
}
}
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
password: cneeds!QAZ1qaz
username: root
eureka:
client:
service-url:
defaultZone: http://192.168.2.244:8761/eureka/
instance:
prefer-ip-address: true
ip-address: 192.168.2.244
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