Commit 73badf61 by zzrdark

1.增加数据库版本控制

2.增加h2 的 数据库表支持
3.修改权限
parent 86d2bd54
......@@ -200,6 +200,90 @@ public class DeviceController {
}
/**
* 查询设备渠道号管理
* @param page
* @param pageSize
* @param sort
* @param seriesId
* @param imei
* @return
*/
@PreAuthorize("hasRole('deviceManagement:deviceChannel:list') or hasRole('admin')")
@PostMapping("/deviceChannel/list")
public R deviceChannelList(@RequestParam(required = false) Integer page,
@RequestParam(required = false) Integer pageSize,
@RequestParam(required = false) String sort,
@RequestParam(required = false) Long seriesId,
@RequestParam(required = false) String imei){
String orderField = null;
String order = null;
if (page==null || page==0){
page = new Integer(1);
}
if (pageSize==null || pageSize==0){
pageSize = new Integer(10);
}
if (StringUtils.isNotEmpty(sort) && StringUtils.isNotBlank(sort.trim())){
if (sort.contains("+")){
order = new String("asc");
}
if (sort.contains("-")){
order = new String("desc");
}
orderField = sort.substring(1);
orderField = RequestParamterConverter.toLine(orderField);
}
PageDto pageDto = deviceClient.deviceList(page,pageSize,orderField,order,seriesId,imei);
return new R().put("data",pageDto);
}
/**
*
* @param page
* @param pageSize
* @param sort
* @param seriesId
* @param imei
* @return
*/
@PreAuthorize("hasRole('deviceStatistical:deviceInfo:list') or hasRole('admin')")
@PostMapping("/deviceInfo/list")
public R deviceInfoList(@RequestParam(required = false) Integer page,
@RequestParam(required = false) Integer pageSize,
@RequestParam(required = false) String sort,
@RequestParam(required = false) Long seriesId,
@RequestParam(required = false) String imei){
String orderField = null;
String order = null;
if (page==null || page==0){
page = new Integer(1);
}
if (pageSize==null || pageSize==0){
pageSize = new Integer(10);
}
if (StringUtils.isNotEmpty(sort) && StringUtils.isNotBlank(sort.trim())){
if (sort.contains("+")){
order = new String("asc");
}
if (sort.contains("-")){
order = new String("desc");
}
orderField = sort.substring(1);
orderField = RequestParamterConverter.toLine(orderField);
}
PageDto pageDto = deviceClient.deviceList(page,pageSize,orderField,order,seriesId,imei);
return new R().put("data",pageDto);
}
/**
* 导入设备
* @param devicesVo
* @return
......@@ -215,6 +299,11 @@ public class DeviceController {
}
/**
* 适配配置
* @param devicesVo
* @return
*/
@PreAuthorize("hasRole('deviceManagement:device:edit') or hasRole('admin')")
@PostMapping("/device/updateDeviceSeriesBatch")
public R updateDeviceSeriesBatch(DevicesVo devicesVo){
......@@ -234,6 +323,11 @@ public class DeviceController {
}
/**
* 通过imei查询设备信息
* @param dto
* @return
*/
@PreAuthorize("hasRole('deviceManagement:device:list') or hasRole('admin')")
@PostMapping("/device/queryDeviceByImei")
public R queryDeviceByImei(@RequestBody DeviceInfoDto dto){
......@@ -247,8 +341,8 @@ public class DeviceController {
@PreAuthorize("hasRole('configManagement:deviceChannel:list') or hasRole('admin')")
@PostMapping("/deviceChannel/list")
public R deivceChannelList(@RequestParam(required = false) Integer page,
@PostMapping("/channel/list")
public R channelList(@RequestParam(required = false) Integer page,
@RequestParam(required = false) Integer pageSize,
@RequestParam(required = false) String sort,
@RequestParam(required = false) String channelNum){
......@@ -296,6 +390,11 @@ public class DeviceController {
}
/**
* 修改渠道号
* @param vo
* @return
*/
@PreAuthorize("hasRole('configManagement:deviceChannel:edit') or hasRole('admin')")
@PostMapping("/deviceChannel/edit")
public R editSeries(ChannelVo vo){
......@@ -305,6 +404,11 @@ public class DeviceController {
return R.ok();
}
/**
* 删除渠道号
* @param ids
* @return
*/
@PreAuthorize("hasRole('configManagement:deviceChannel:delete') or hasRole('admin')")
@PostMapping("/deviceChannel/delete")
public R deleteDeviceChannel(@RequestParam(value = "ids",required = false) List<Long> ids){
......@@ -324,7 +428,7 @@ public class DeviceController {
* @param deviceId
* @return
*/
@PreAuthorize("hasRole('configManagement:deviceChannel:delete') or hasRole('admin')")
@PreAuthorize("hasRole('deviceManagement:deviceChannel:delete') or hasRole('admin')")
@PostMapping("/deviceChannel/deleteSettingDeviceChannel")
public R deleteSettingDeviceChannel(Long deviceId){
deviceClient.deleteSettingDeviceChannel(deviceId);
......@@ -345,7 +449,26 @@ public class DeviceController {
return R.ok();
}
@PreAuthorize("hasRole('configManagement:deviceChannel:list') or hasRole('admin')")
/**
* 修改设备的渠道号
* @param vo
* @return
*/
@PreAuthorize("hasRole('deviceManagement:deviceChannel:edit') or hasRole('admin')")
@PostMapping("/deviceChannel/updateSettingDeviceChannel1")
public R updateSettingDeviceChannel1(DeviceInfoVo vo){
DeviceInfoDto dto = new DeviceInfoDto();
BeanUtils.copyProperties(vo,dto);
deviceClient.updateSettingDeviceChannel(dto);
return R.ok();
}
/**
* 查询设备渠道号统计
* @param channelIds
* @return
*/
@PreAuthorize("hasRole('deviceManagement:deviceChannel:list') or hasRole('admin')")
@PostMapping("/deviceChannel/queryTotalStatisticsDeviceChannel")
public R queryTotalStatisticsDeviceChannel(@RequestParam(value="channelIds", required = false) List<Long> channelIds){
......@@ -425,7 +548,7 @@ public class DeviceController {
}
/**
*
* 筛选 该集合里的imei 是否设置过渠道号
* @param imeis
* @return
*/
......@@ -446,7 +569,7 @@ public class DeviceController {
* @param vo
* @return
*/
@PreAuthorize("hasRole('configManagement:deviceChannel:delete') or hasRole('admin')")
@PreAuthorize("hasRole('deviceManagement:deviceChannel:delete') or hasRole('admin')")
@RequestMapping("/deviceChannel/deleteStatisticsDeviceChannel")
public R deleteStatisticsDeviceChannel(StatisticsDeviceChannelVo vo){
if (vo == null){
......@@ -509,7 +632,7 @@ public class DeviceController {
* @param seriesId
* @return
*/
@PreAuthorize("hasRole('deviceManagement:device:list') or hasRole('admin')")
@PreAuthorize("hasRole('deviceStatistical:deviceInfoExport:list') or hasRole('admin')")
@PostMapping("/deviceInfoExport/list")
public R deviceInfoExportList(@RequestParam(required = false) Integer page,
@RequestParam(required = false) Integer pageSize,
......@@ -541,7 +664,7 @@ public class DeviceController {
return new R().put("data",pageDto);
}
@PreAuthorize("hasRole('deviceManagement:device:list') or hasRole('admin')")
@PreAuthorize("hasRole('deviceStatistical:deviceInfoExport:list') or hasRole('admin')")
@PostMapping("/deviceInfoExport/uploadDeviceInfoExport")
public R uploadDeviceInfoExport(@RequestBody UploadDeviceChannelExcelVo vo) throws IOException {
......
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-22e5f704"],{3304: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("el-container",[n("el-main",[n("el-form",{ref:"addChannel",attrs:{model:e.channel,rules:e.rules,"label-width":"80px"}},[n("el-form-item",{attrs:{prop:"seriesNum",label:"渠道号"}},[n("el-input",{model:{value:e.channel.channelNum,callback:function(t){e.$set(e.channel,"channelNum",t)},expression:"channel.channelNum"}})],1),e._v(" "),n("el-form-item",{attrs:{prop:"remark",label:"品牌车型:"}},[n("el-input",{attrs:{placeholder:"奥迪-车系"},model:{value:e.channel.brand,callback:function(t){e.$set(e.channel,"brand",t)},expression:"channel.brand"}})],1),e._v(" "),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("添加")]),e._v(" "),n("el-button",{on:{click:e.toSeriesList}},[e._v("取消")])],1)],1)],1)],1)},i=[],r=(n("ac6a"),n("456d"),n("aa98")),c={channelNum:"渠道号",brand:"品牌车型"},o={data:function(){var e=function(e,t,n){0===t.length?n(new Error(c[e.field]+"必须填写")):n()};return{loading:!1,channel:{channelNum:"",brand:""},rules:{channelNum:[{validator:e}],brand:[{validator:e}]}}},mounted:function(){},methods:{setDefault:function(){this.$refs.addSeries.resetFields()},onSubmit:function(){var e=this;this.loading||(this.loading=!0,this.$refs.addChannel.validate((function(t,n){if(t)Object(r["a"])(e.channel).then((function(t){var n=t.msg;e.$notify({title:"操作成功",message:n,type:"success",duration:2e3}),e.loading=!1,e.setDefault(),e.toSeriesList()})).catch((function(){e.loading=!1}));else{var a=n[Object.keys(n)[0]][0].message;e.$message({message:a,type:"error"}),e.loading=!1}})))},toSeriesList:function(){this.$router.push({path:"/configManagement/deviceChannel"})}}},d=o,u=n("2877"),l=Object(u["a"])(d,a,i,!1,null,"5398e163",null);t["default"]=l.exports},aa98:function(e,t,n){"use strict";n.d(t,"h",(function(){return i})),n.d(t,"g",(function(){return r})),n.d(t,"i",(function(){return c})),n.d(t,"o",(function(){return o})),n.d(t,"b",(function(){return d})),n.d(t,"q",(function(){return u})),n.d(t,"r",(function(){return l})),n.d(t,"s",(function(){return s})),n.d(t,"m",(function(){return h})),n.d(t,"k",(function(){return p})),n.d(t,"f",(function(){return f})),n.d(t,"a",(function(){return v})),n.d(t,"n",(function(){return m})),n.d(t,"j",(function(){return b})),n.d(t,"c",(function(){return g})),n.d(t,"d",(function(){return j})),n.d(t,"p",(function(){return C})),n.d(t,"l",(function(){return O})),n.d(t,"e",(function(){return S}));n("55dd");var a=n("b775");function i(e){return Object(a["a"])({url:"/device/device/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,seriesId:e.seriesId,imei:e.imei}})}function r(e){return Object(a["a"])({url:"/device/deviceInfoExport/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function c(e){return Object(a["a"])({url:"/device/device/importDevice",method:"post",data:e})}function o(e){return Object(a["a"])({url:"/device/device/updateDeviceSeriesBatch",method:"post",data:e})}function d(e){return Object(a["a"])({url:"/device/device/delete",method:"post",data:{ids:e}})}function u(e){return Object(a["a"])({url:"/device/device/uploadDeivceChannelExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function l(e){return Object(a["a"])({url:"/device/device/uploadDeivceExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function s(e){return Object(a["a"])({url:"/device/deviceInfoExport/uploadDeviceInfoExport",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function h(e){return Object(a["a"])({url:"/device/device/saveChannel",method:"post",data:e})}function p(e){return Object(a["a"])({url:"/device/device/queryDeviceChannelSetting",method:"post",data:e})}function f(e){return Object(a["a"])({url:"/device/deviceChannel/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,channelNum:e.channelNum}})}function v(e){return Object(a["a"])({url:"/device/deviceChannel/add",method:"post",data:e})}function m(e){return Object(a["a"])({url:"/device/deviceChannel/edit",method:"post",data:e})}function b(){return Object(a["a"])({url:"/device/deviceChannel/queryDeviceChannelAll",method:"post"})}function g(e){return Object(a["a"])({url:"/device/deviceChannel/delete",method:"post",data:{ids:e}})}function j(e){return Object(a["a"])({url:"/device/deviceChannel/deleteSettingDeviceChannel",method:"post",data:{deviceId:e}})}function C(e){return Object(a["a"])({url:"/device/deviceChannel/updateSettingDeviceChannel",method:"post",data:e})}function O(e){return Object(a["a"])({url:"/device/deviceChannel/queryTotalStatisticsDeviceChannel",method:"post",data:{channelIds:e}})}function S(e){return Object(a["a"])({url:"/device/deviceChannel/deleteStatisticsDeviceChannel",method:"post",data:e})}}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-22e5f704"],{3304: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("el-container",[n("el-main",[n("el-form",{ref:"addChannel",attrs:{model:e.channel,rules:e.rules,"label-width":"80px"}},[n("el-form-item",{attrs:{prop:"seriesNum",label:"渠道号"}},[n("el-input",{model:{value:e.channel.channelNum,callback:function(t){e.$set(e.channel,"channelNum",t)},expression:"channel.channelNum"}})],1),e._v(" "),n("el-form-item",{attrs:{prop:"remark",label:"品牌车型:"}},[n("el-input",{attrs:{placeholder:"奥迪-车系"},model:{value:e.channel.brand,callback:function(t){e.$set(e.channel,"brand",t)},expression:"channel.brand"}})],1),e._v(" "),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("添加")]),e._v(" "),n("el-button",{on:{click:e.toSeriesList}},[e._v("取消")])],1)],1)],1)],1)},i=[],r=(n("ac6a"),n("456d"),n("aa98")),c={channelNum:"渠道号",brand:"品牌车型"},o={data:function(){var e=function(e,t,n){0===t.length?n(new Error(c[e.field]+"必须填写")):n()};return{loading:!1,channel:{channelNum:"",brand:""},rules:{channelNum:[{validator:e}],brand:[{validator:e}]}}},mounted:function(){},methods:{setDefault:function(){this.$refs.addSeries.resetFields()},onSubmit:function(){var e=this;this.loading||(this.loading=!0,this.$refs.addChannel.validate((function(t,n){if(t)Object(r["a"])(e.channel).then((function(t){var n=t.msg;e.$notify({title:"操作成功",message:n,type:"success",duration:2e3}),e.loading=!1,e.setDefault(),e.toSeriesList()})).catch((function(){e.loading=!1}));else{var a=n[Object.keys(n)[0]][0].message;e.$message({message:a,type:"error"}),e.loading=!1}})))},toSeriesList:function(){this.$router.push({path:"/configManagement/deviceChannel"})}}},u=o,d=n("2877"),l=Object(d["a"])(u,a,i,!1,null,"5398e163",null);t["default"]=l.exports},aa98:function(e,t,n){"use strict";n.d(t,"h",(function(){return i})),n.d(t,"g",(function(){return r})),n.d(t,"i",(function(){return c})),n.d(t,"o",(function(){return o})),n.d(t,"b",(function(){return u})),n.d(t,"q",(function(){return d})),n.d(t,"r",(function(){return l})),n.d(t,"s",(function(){return s})),n.d(t,"m",(function(){return h})),n.d(t,"k",(function(){return p})),n.d(t,"f",(function(){return f})),n.d(t,"a",(function(){return v})),n.d(t,"n",(function(){return m})),n.d(t,"j",(function(){return b})),n.d(t,"c",(function(){return g})),n.d(t,"d",(function(){return j})),n.d(t,"p",(function(){return C})),n.d(t,"l",(function(){return O})),n.d(t,"e",(function(){return S}));n("55dd");var a=n("b775");function i(e){return Object(a["a"])({url:"/device/device/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,seriesId:e.seriesId,imei:e.imei}})}function r(e){return Object(a["a"])({url:"/device/deviceInfoExport/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function c(e){return Object(a["a"])({url:"/device/device/importDevice",method:"post",data:e})}function o(e){return Object(a["a"])({url:"/device/device/updateDeviceSeriesBatch",method:"post",data:e})}function u(e){return Object(a["a"])({url:"/device/device/delete",method:"post",data:{ids:e}})}function d(e){return Object(a["a"])({url:"/device/device/uploadDeivceChannelExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function l(e){return Object(a["a"])({url:"/device/device/uploadDeivceExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function s(e){return Object(a["a"])({url:"/device/deviceInfoExport/uploadDeviceInfoExport",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function h(e){return Object(a["a"])({url:"/device/device/saveChannel",method:"post",data:e})}function p(e){return Object(a["a"])({url:"/device/device/queryDeviceChannelSetting",method:"post",data:e})}function f(e){return Object(a["a"])({url:"/device/channel/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,channelNum:e.channelNum}})}function v(e){return Object(a["a"])({url:"/device/deviceChannel/add",method:"post",data:e})}function m(e){return Object(a["a"])({url:"/device/deviceChannel/edit",method:"post",data:e})}function b(){return Object(a["a"])({url:"/device/deviceChannel/queryDeviceChannelAll",method:"post"})}function g(e){return Object(a["a"])({url:"/device/deviceChannel/delete",method:"post",data:{ids:e}})}function j(e){return Object(a["a"])({url:"/device/deviceChannel/deleteSettingDeviceChannel",method:"post",data:{deviceId:e}})}function C(e){return Object(a["a"])({url:"/device/deviceChannel/updateSettingDeviceChannel",method:"post",data:e})}function O(e){return Object(a["a"])({url:"/device/deviceChannel/queryTotalStatisticsDeviceChannel",method:"post",data:{channelIds:e}})}function S(e){return Object(a["a"])({url:"/device/deviceChannel/deleteStatisticsDeviceChannel",method:"post",data:e})}}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7395e3e5"],{aa98:function(e,n,t){"use strict";t.d(n,"h",(function(){return c})),t.d(n,"g",(function(){return i})),t.d(n,"i",(function(){return r})),t.d(n,"o",(function(){return s})),t.d(n,"b",(function(){return u})),t.d(n,"q",(function(){return l})),t.d(n,"r",(function(){return d})),t.d(n,"s",(function(){return o})),t.d(n,"m",(function(){return h})),t.d(n,"k",(function(){return v})),t.d(n,"f",(function(){return p})),t.d(n,"a",(function(){return f})),t.d(n,"n",(function(){return m})),t.d(n,"j",(function(){return b})),t.d(n,"c",(function(){return g})),t.d(n,"d",(function(){return j})),t.d(n,"p",(function(){return O})),t.d(n,"l",(function(){return C})),t.d(n,"e",(function(){return D}));t("55dd");var a=t("b775");function c(e){return Object(a["a"])({url:"/device/device/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,seriesId:e.seriesId,imei:e.imei}})}function i(e){return Object(a["a"])({url:"/device/deviceInfoExport/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function r(e){return Object(a["a"])({url:"/device/device/importDevice",method:"post",data:e})}function s(e){return Object(a["a"])({url:"/device/device/updateDeviceSeriesBatch",method:"post",data:e})}function u(e){return Object(a["a"])({url:"/device/device/delete",method:"post",data:{ids:e}})}function l(e){return Object(a["a"])({url:"/device/device/uploadDeivceChannelExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function d(e){return Object(a["a"])({url:"/device/device/uploadDeivceExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function o(e){return Object(a["a"])({url:"/device/deviceInfoExport/uploadDeviceInfoExport",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function h(e){return Object(a["a"])({url:"/device/device/saveChannel",method:"post",data:e})}function v(e){return Object(a["a"])({url:"/device/device/queryDeviceChannelSetting",method:"post",data:e})}function p(e){return Object(a["a"])({url:"/device/channel/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,channelNum:e.channelNum}})}function f(e){return Object(a["a"])({url:"/device/deviceChannel/add",method:"post",data:e})}function m(e){return Object(a["a"])({url:"/device/deviceChannel/edit",method:"post",data:e})}function b(){return Object(a["a"])({url:"/device/deviceChannel/queryDeviceChannelAll",method:"post"})}function g(e){return Object(a["a"])({url:"/device/deviceChannel/delete",method:"post",data:{ids:e}})}function j(e){return Object(a["a"])({url:"/device/deviceChannel/deleteSettingDeviceChannel",method:"post",data:{deviceId:e}})}function O(e){return Object(a["a"])({url:"/device/deviceChannel/updateSettingDeviceChannel",method:"post",data:e})}function C(e){return Object(a["a"])({url:"/device/deviceChannel/queryTotalStatisticsDeviceChannel",method:"post",data:{channelIds:e}})}function D(e){return Object(a["a"])({url:"/device/deviceChannel/deleteStatisticsDeviceChannel",method:"post",data:e})}},c10e:function(e,n,t){"use strict";t.r(n);var a=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("el-container",[t("el-main",[t("el-form",{ref:"update",attrs:{model:e.device,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{prop:"channelNumsMessage",label:"终端提示文字"}},[t("el-input",{model:{value:e.device.channelNumsMessage,callback:function(n){e.$set(e.device,"channelNumsMessage",n)},expression:"device.channelNumsMessage"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"channelRules",label:"规则"}},[t("el-select",{attrs:{placeholder:"选择"},model:{value:e.device.channelRules,callback:function(n){e.$set(e.device,"channelRules",n)},expression:"device.channelRules"}},[t("el-option",{attrs:{label:"白名单",value:"0"}}),e._v(" "),t("el-option",{attrs:{label:"黑名单",value:"1"}})],1)],1),e._v(" "),t("el-transfer",{attrs:{data:e.selectChannelNumsData,titles:e.transferTitle},model:{value:e.device.channelIds,callback:function(n){e.$set(e.device,"channelIds",n)},expression:"device.channelIds"}}),e._v(" "),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("修改")]),e._v(" "),t("el-button",{on:{click:e.toDeviceList}},[e._v("取消")])],1)],1)],1)],1)},c=[],i=(t("456d"),t("6762"),t("2fdb"),t("ac6a"),t("28a5"),t("96cf"),t("3b8d")),r=t("aa98"),s={channelNumsMessage:"终端提示文字",channelRules:"规则"},u={data:function(){var e=function(e,n,t){void 0===n||null===n||0===n.length?t(new Error(s[e.field]+"必须填写")):t()};return{loading:!1,device:{channelIds:[],channelNumsMessage:"",channelRules:"",imeis:[]},rules:{channelNumsMessage:[{validator:e}],channelRules:[{validator:e}]},selectSeriesOptions:[],transferTitle:["渠道号列表","已选择"],selectChannelNumsData:[]}},mounted:function(){this.deviceT=this.$route.query.device,this.getTransfer()},methods:{selectChannelNums:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(n){var t,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:1===this.deviceT.channelRules?this.device.channelRules="黑名单":0===this.deviceT.channelRules&&(this.device.channelRules="白名单"),this.device.channelNumsMessage=this.deviceT.channelNumsMessage,this.device.deviceId=this.deviceT.deviceId,t=this.deviceT.channelNums.split(","),t.forEach((function(e){n.channelNum.includes(e)&&a.device.channelIds.push(n.channelId)}));case 5:case"end":return e.stop()}}),e,this)})));function n(n){return e.apply(this,arguments)}return n}(),setDefault:function(){this.$refs.device=[]},getTransfer:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:Object(r["j"])().then((function(e){var t=e.data;t.forEach((function(e){n.selectChannelNumsData.push({key:e.channelId,label:e.channelNum+"_"+e.brand}),n.selectChannelNums(e)}))}));case 1:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}(),onSubmit:function(){var e=this;this.loading||(this.loading=!0,this.$refs.update.validate((function(n,t){if(n)"黑名单"===e.device.channelRules?e.device.channelRules=1:"白名单"===e.device.channelRules&&(e.device.channelRules=0),Object(r["p"])(e.device).then((function(n){var t=n.msg;e.$notify({title:"操作成功",message:t,type:"success",duration:2e3}),e.setDefault(),e.toDeviceList(),e.loading=!1})).catch((function(){e.loading=!1}));else{var a=t[Object.keys(t)[0]][0].message;e.$message({message:a,type:"error"}),e.loading=!1}})))},toDeviceList:function(){this.$router.push({path:"/deviceManagement/deviceChannel"})}}},l=u,d=t("2877"),o=Object(d["a"])(l,a,c,!1,null,"1999b0f0",null);n["default"]=o.exports}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7395e3e5"],{aa98:function(e,n,t){"use strict";t.d(n,"h",(function(){return c})),t.d(n,"g",(function(){return i})),t.d(n,"i",(function(){return r})),t.d(n,"o",(function(){return s})),t.d(n,"b",(function(){return u})),t.d(n,"q",(function(){return l})),t.d(n,"r",(function(){return d})),t.d(n,"s",(function(){return o})),t.d(n,"m",(function(){return h})),t.d(n,"k",(function(){return v})),t.d(n,"f",(function(){return p})),t.d(n,"a",(function(){return f})),t.d(n,"n",(function(){return m})),t.d(n,"j",(function(){return b})),t.d(n,"c",(function(){return g})),t.d(n,"d",(function(){return j})),t.d(n,"p",(function(){return C})),t.d(n,"l",(function(){return O})),t.d(n,"e",(function(){return D}));t("55dd");var a=t("b775");function c(e){return Object(a["a"])({url:"/device/device/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,seriesId:e.seriesId,imei:e.imei}})}function i(e){return Object(a["a"])({url:"/device/deviceInfoExport/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function r(e){return Object(a["a"])({url:"/device/device/importDevice",method:"post",data:e})}function s(e){return Object(a["a"])({url:"/device/device/updateDeviceSeriesBatch",method:"post",data:e})}function u(e){return Object(a["a"])({url:"/device/device/delete",method:"post",data:{ids:e}})}function l(e){return Object(a["a"])({url:"/device/device/uploadDeivceChannelExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function d(e){return Object(a["a"])({url:"/device/device/uploadDeivceExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function o(e){return Object(a["a"])({url:"/device/deviceInfoExport/uploadDeviceInfoExport",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function h(e){return Object(a["a"])({url:"/device/device/saveChannel",method:"post",data:e})}function v(e){return Object(a["a"])({url:"/device/device/queryDeviceChannelSetting",method:"post",data:e})}function p(e){return Object(a["a"])({url:"/device/deviceChannel/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,channelNum:e.channelNum}})}function f(e){return Object(a["a"])({url:"/device/deviceChannel/add",method:"post",data:e})}function m(e){return Object(a["a"])({url:"/device/deviceChannel/edit",method:"post",data:e})}function b(){return Object(a["a"])({url:"/device/deviceChannel/queryDeviceChannelAll",method:"post"})}function g(e){return Object(a["a"])({url:"/device/deviceChannel/delete",method:"post",data:{ids:e}})}function j(e){return Object(a["a"])({url:"/device/deviceChannel/deleteSettingDeviceChannel",method:"post",data:{deviceId:e}})}function C(e){return Object(a["a"])({url:"/device/deviceChannel/updateSettingDeviceChannel",method:"post",data:e})}function O(e){return Object(a["a"])({url:"/device/deviceChannel/queryTotalStatisticsDeviceChannel",method:"post",data:{channelIds:e}})}function D(e){return Object(a["a"])({url:"/device/deviceChannel/deleteStatisticsDeviceChannel",method:"post",data:e})}},c10e:function(e,n,t){"use strict";t.r(n);var a=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("el-container",[t("el-main",[t("el-form",{ref:"update",attrs:{model:e.device,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{prop:"channelNumsMessage",label:"终端提示文字"}},[t("el-input",{model:{value:e.device.channelNumsMessage,callback:function(n){e.$set(e.device,"channelNumsMessage",n)},expression:"device.channelNumsMessage"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"channelRules",label:"规则"}},[t("el-select",{attrs:{placeholder:"选择"},model:{value:e.device.channelRules,callback:function(n){e.$set(e.device,"channelRules",n)},expression:"device.channelRules"}},[t("el-option",{attrs:{label:"白名单",value:"0"}}),e._v(" "),t("el-option",{attrs:{label:"黑名单",value:"1"}})],1)],1),e._v(" "),t("el-transfer",{attrs:{data:e.selectChannelNumsData,titles:e.transferTitle},model:{value:e.device.channelIds,callback:function(n){e.$set(e.device,"channelIds",n)},expression:"device.channelIds"}}),e._v(" "),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("修改")]),e._v(" "),t("el-button",{on:{click:e.toDeviceList}},[e._v("取消")])],1)],1)],1)],1)},c=[],i=(t("456d"),t("6762"),t("2fdb"),t("ac6a"),t("28a5"),t("96cf"),t("3b8d")),r=t("aa98"),s={channelNumsMessage:"终端提示文字",channelRules:"规则"},u={data:function(){var e=function(e,n,t){void 0===n||null===n||0===n.length?t(new Error(s[e.field]+"必须填写")):t()};return{loading:!1,device:{channelIds:[],channelNumsMessage:"",channelRules:"",imeis:[]},rules:{channelNumsMessage:[{validator:e}],channelRules:[{validator:e}]},selectSeriesOptions:[],transferTitle:["渠道号列表","已选择"],selectChannelNumsData:[]}},mounted:function(){this.deviceT=this.$route.query.device,this.getTransfer()},methods:{selectChannelNums:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(n){var t,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:1===this.deviceT.channelRules?this.device.channelRules="黑名单":0===this.deviceT.channelRules&&(this.device.channelRules="白名单"),this.device.channelNumsMessage=this.deviceT.channelNumsMessage,this.device.deviceId=this.deviceT.deviceId,t=this.deviceT.channelNums.split(","),t.forEach((function(e){n.channelNum.includes(e)&&a.device.channelIds.push(n.channelId)}));case 5:case"end":return e.stop()}}),e,this)})));function n(n){return e.apply(this,arguments)}return n}(),setDefault:function(){this.$refs.device=[]},getTransfer:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:Object(r["j"])().then((function(e){var t=e.data;t.forEach((function(e){n.selectChannelNumsData.push({key:e.channelId,label:e.channelNum+"_"+e.brand}),n.selectChannelNums(e)}))}));case 1:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}(),onSubmit:function(){var e=this;this.loading||(this.loading=!0,this.$refs.update.validate((function(n,t){if(n)"黑名单"===e.device.channelRules?e.device.channelRules=1:"白名单"===e.device.channelRules&&(e.device.channelRules=0),Object(r["p"])(e.device).then((function(n){var t=n.msg;e.$notify({title:"操作成功",message:t,type:"success",duration:2e3}),e.setDefault(),e.toDeviceList(),e.loading=!1})).catch((function(){e.loading=!1}));else{var a=t[Object.keys(t)[0]][0].message;e.$message({message:a,type:"error"}),e.loading=!1}})))},toDeviceList:function(){this.$router.push({path:"/deviceManagement/deviceChannel"})}}},l=u,d=t("2877"),o=Object(d["a"])(l,a,c,!1,null,"1999b0f0",null);n["default"]=o.exports}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-77a4bbf0"],{"7d09":function(e,t,n){"use strict";n.d(t,"e",(function(){return r})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return s}));n("55dd");var i=n("b775");function r(e){return Object(i["a"])({url:"/device/series/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,seriesNum:e.seriesNum}})}function a(e){return Object(i["a"])({url:"/device/series/add",method:"post",data:e})}function c(e){return Object(i["a"])({url:"/device/series/edit",method:"post",data:e})}function o(e){return Object(i["a"])({url:"/device/series/delete",method:"post",data:{ids:e}})}function s(){return Object(i["a"])({url:"/device/series/listAll",method:"post"})}},aa98:function(e,t,n){"use strict";n.d(t,"h",(function(){return r})),n.d(t,"g",(function(){return a})),n.d(t,"i",(function(){return c})),n.d(t,"o",(function(){return o})),n.d(t,"b",(function(){return s})),n.d(t,"q",(function(){return u})),n.d(t,"r",(function(){return d})),n.d(t,"s",(function(){return l})),n.d(t,"m",(function(){return p})),n.d(t,"k",(function(){return f})),n.d(t,"f",(function(){return v})),n.d(t,"a",(function(){return h})),n.d(t,"n",(function(){return m})),n.d(t,"j",(function(){return b})),n.d(t,"c",(function(){return g})),n.d(t,"d",(function(){return j})),n.d(t,"p",(function(){return O})),n.d(t,"l",(function(){return D})),n.d(t,"e",(function(){return I}));n("55dd");var i=n("b775");function r(e){return Object(i["a"])({url:"/device/device/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,seriesId:e.seriesId,imei:e.imei}})}function a(e){return Object(i["a"])({url:"/device/deviceInfoExport/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function c(e){return Object(i["a"])({url:"/device/device/importDevice",method:"post",data:e})}function o(e){return Object(i["a"])({url:"/device/device/updateDeviceSeriesBatch",method:"post",data:e})}function s(e){return Object(i["a"])({url:"/device/device/delete",method:"post",data:{ids:e}})}function u(e){return Object(i["a"])({url:"/device/device/uploadDeivceChannelExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function d(e){return Object(i["a"])({url:"/device/device/uploadDeivceExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function l(e){return Object(i["a"])({url:"/device/deviceInfoExport/uploadDeviceInfoExport",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function p(e){return Object(i["a"])({url:"/device/device/saveChannel",method:"post",data:e})}function f(e){return Object(i["a"])({url:"/device/device/queryDeviceChannelSetting",method:"post",data:e})}function v(e){return Object(i["a"])({url:"/device/channel/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,channelNum:e.channelNum}})}function h(e){return Object(i["a"])({url:"/device/deviceChannel/add",method:"post",data:e})}function m(e){return Object(i["a"])({url:"/device/deviceChannel/edit",method:"post",data:e})}function b(){return Object(i["a"])({url:"/device/deviceChannel/queryDeviceChannelAll",method:"post"})}function g(e){return Object(i["a"])({url:"/device/deviceChannel/delete",method:"post",data:{ids:e}})}function j(e){return Object(i["a"])({url:"/device/deviceChannel/deleteSettingDeviceChannel",method:"post",data:{deviceId:e}})}function O(e){return Object(i["a"])({url:"/device/deviceChannel/updateSettingDeviceChannel",method:"post",data:e})}function D(e){return Object(i["a"])({url:"/device/deviceChannel/queryTotalStatisticsDeviceChannel",method:"post",data:{channelIds:e}})}function I(e){return Object(i["a"])({url:"/device/deviceChannel/deleteStatisticsDeviceChannel",method:"post",data:e})}},f24d:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-container",[n("el-main",[n("el-form",{ref:"importDevice",attrs:{model:e.device,rules:e.rules,"label-width":"80px"}},[n("el-form-item",{attrs:{prop:"deptId",label:"所属客户"}},[n("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),e._v(" "),n("el-form-item",{attrs:{prop:"seriesId",label:"所属系列"}},[n("el-select",{attrs:{placeholder:"请选择"},model:{value:e.device.seriesId,callback:function(t){e.$set(e.device,"seriesId",t)},expression:"device.seriesId"}},e._l(e.selectSeriesOptions,(function(e){return n("el-option",{key:e.seriesId,attrs:{label:e.seriesNum,value:e.seriesId}})})),1)],1),e._v(" "),e._l(e.device.imeis,(function(t,i){return n("el-form-item",{key:i,attrs:{label:"第"+(i+1)+"个imei: ",prop:"imeis."+i+".value","label-width":"20"}},[n("el-row",[n("el-col",{attrs:{span:14}},[n("el-input",{model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"imei.value"}})],1),e._v(" "),n("el-col",{attrs:{span:5}},[n("el-button",{on:{click:function(n){return n.preventDefault(),e.removeImeis(t)}}},[e._v("\n 删除\n ")])],1)],1)],1)})),e._v(" "),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("添加")]),e._v(" "),n("el-button",{on:{click:e.addImeis}},[e._v("新增imei")]),e._v(" "),n("el-button",{on:{click:e.toDeviceList}},[e._v("取消")])],1)],2)],1)],1)},r=[],a=(n("456d"),n("ac6a"),n("96cf"),n("3b8d")),c=n("fe05"),o=n("7d09"),s=n("aa98"),u={deptId:"客户Id",seriesId:"系列号",imeis:"imeis"},d={data:function(){var e=function(e,t,n){void 0===t||null===t||0===t.length?n(new Error(u[e.field]+"必须填写")):n()};return{loading:!1,device:{deptIdList:[],seriesIdList:[],imeis:[{value:""}]},rules:{deptId:[{validator:e}],seriesId:[{validator:e}]},options:[],selectSeriesOptions:[],selectDeptParents:[],defaultProps:{children:"children",label:"label"}}},mounted:function(){this.getFormData()},methods:{getFormData:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.selectDeptParent();case 2:return e.next=4,this.selectSeries();case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),setDefault:function(){this.$refs.device=[]},onSubmit:function(){var e=this;this.loading||(this.loading=!0,this.$refs.importDevice.validate((function(t,n){if(t){var i=e.device.imeis;e.device.imeis=[],i.forEach((function(t){e.device.imeis.push(t.value)})),Object(s["i"])(e.device).then((function(t){var n=t.msg;e.$notify({title:"操作成功",message:n,type:"success",duration:2e3}),e.setDefault(),e.toDeviceList(),e.loading=!1})).catch((function(t){console.log(t),e.loading=!1}))}else{var r=n[Object.keys(n)[0]][0].message;e.$message({message:r,type:"error"}),e.loading=!1}})))},toDeviceList:function(){this.$router.push({path:"/deviceManagement/device"})},selectSeries:function(){var e=Object(a["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["d"])().then((function(e){var n=e.data;t.selectSeriesOptions=n}));case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),selectDeptParent:function(){var e=Object(a["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(c["e"])().then((function(e){var n=e.data;t.options=n}));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.device.deptId=e[t]},addImeis:function(){this.device.imeis.push({value:""})},removeImeis:function(e){var t=this.device.imeis.indexOf(e);-1!==t&&this.device.imeis.splice(t,1)}}},l=d,p=n("2877"),f=Object(p["a"])(l,i,r,!1,null,"97bccd40",null);t["default"]=f.exports},fe05:function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return c})),n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return u}));n("7f7f"),n("55dd");var i=n("b775");function r(e){return Object(i["a"])({url:"/sys/dept/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,name:e.name}})}function a(){return Object(i["a"])({url:"/sys/dept/listAll",method:"post"})}function c(){return Object(i["a"])({url:"/sys/dept/listAllTree",method:"post"})}function o(e){return Object(i["a"])({url:"/sys/dept/add",method:"post",data:e})}function s(e){return Object(i["a"])({url:"/sys/dept/edit",method:"post",data:e})}function u(e){return Object(i["a"])({url:"/sys/dept/delete",method:"post",data:{ids:e}})}}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-77a4bbf0"],{"7d09":function(e,t,n){"use strict";n.d(t,"e",(function(){return r})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return s}));n("55dd");var i=n("b775");function r(e){return Object(i["a"])({url:"/device/series/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,seriesNum:e.seriesNum}})}function a(e){return Object(i["a"])({url:"/device/series/add",method:"post",data:e})}function c(e){return Object(i["a"])({url:"/device/series/edit",method:"post",data:e})}function o(e){return Object(i["a"])({url:"/device/series/delete",method:"post",data:{ids:e}})}function s(){return Object(i["a"])({url:"/device/series/listAll",method:"post"})}},aa98:function(e,t,n){"use strict";n.d(t,"h",(function(){return r})),n.d(t,"g",(function(){return a})),n.d(t,"i",(function(){return c})),n.d(t,"o",(function(){return o})),n.d(t,"b",(function(){return s})),n.d(t,"q",(function(){return u})),n.d(t,"r",(function(){return d})),n.d(t,"s",(function(){return l})),n.d(t,"m",(function(){return p})),n.d(t,"k",(function(){return v})),n.d(t,"f",(function(){return f})),n.d(t,"a",(function(){return h})),n.d(t,"n",(function(){return m})),n.d(t,"j",(function(){return b})),n.d(t,"c",(function(){return g})),n.d(t,"d",(function(){return j})),n.d(t,"p",(function(){return O})),n.d(t,"l",(function(){return D})),n.d(t,"e",(function(){return I}));n("55dd");var i=n("b775");function r(e){return Object(i["a"])({url:"/device/device/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,seriesId:e.seriesId,imei:e.imei}})}function a(e){return Object(i["a"])({url:"/device/deviceInfoExport/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function c(e){return Object(i["a"])({url:"/device/device/importDevice",method:"post",data:e})}function o(e){return Object(i["a"])({url:"/device/device/updateDeviceSeriesBatch",method:"post",data:e})}function s(e){return Object(i["a"])({url:"/device/device/delete",method:"post",data:{ids:e}})}function u(e){return Object(i["a"])({url:"/device/device/uploadDeivceChannelExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function d(e){return Object(i["a"])({url:"/device/device/uploadDeivceExcel",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function l(e){return Object(i["a"])({url:"/device/deviceInfoExport/uploadDeviceInfoExport",method:"post",data:e,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function p(e){return Object(i["a"])({url:"/device/device/saveChannel",method:"post",data:e})}function v(e){return Object(i["a"])({url:"/device/device/queryDeviceChannelSetting",method:"post",data:e})}function f(e){return Object(i["a"])({url:"/device/deviceChannel/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,channelNum:e.channelNum}})}function h(e){return Object(i["a"])({url:"/device/deviceChannel/add",method:"post",data:e})}function m(e){return Object(i["a"])({url:"/device/deviceChannel/edit",method:"post",data:e})}function b(){return Object(i["a"])({url:"/device/deviceChannel/queryDeviceChannelAll",method:"post"})}function g(e){return Object(i["a"])({url:"/device/deviceChannel/delete",method:"post",data:{ids:e}})}function j(e){return Object(i["a"])({url:"/device/deviceChannel/deleteSettingDeviceChannel",method:"post",data:{deviceId:e}})}function O(e){return Object(i["a"])({url:"/device/deviceChannel/updateSettingDeviceChannel",method:"post",data:e})}function D(e){return Object(i["a"])({url:"/device/deviceChannel/queryTotalStatisticsDeviceChannel",method:"post",data:{channelIds:e}})}function I(e){return Object(i["a"])({url:"/device/deviceChannel/deleteStatisticsDeviceChannel",method:"post",data:e})}},f24d:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-container",[n("el-main",[n("el-form",{ref:"importDevice",attrs:{model:e.device,rules:e.rules,"label-width":"80px"}},[n("el-form-item",{attrs:{prop:"deptId",label:"所属客户"}},[n("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),e._v(" "),n("el-form-item",{attrs:{prop:"seriesId",label:"所属系列"}},[n("el-select",{attrs:{placeholder:"请选择"},model:{value:e.device.seriesId,callback:function(t){e.$set(e.device,"seriesId",t)},expression:"device.seriesId"}},e._l(e.selectSeriesOptions,(function(e){return n("el-option",{key:e.seriesId,attrs:{label:e.seriesNum,value:e.seriesId}})})),1)],1),e._v(" "),e._l(e.device.imeis,(function(t,i){return n("el-form-item",{key:i,attrs:{label:"第"+(i+1)+"个imei: ",prop:"imeis."+i+".value","label-width":"20"}},[n("el-row",[n("el-col",{attrs:{span:14}},[n("el-input",{model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"imei.value"}})],1),e._v(" "),n("el-col",{attrs:{span:5}},[n("el-button",{on:{click:function(n){return n.preventDefault(),e.removeImeis(t)}}},[e._v("\n 删除\n ")])],1)],1)],1)})),e._v(" "),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("添加")]),e._v(" "),n("el-button",{on:{click:e.addImeis}},[e._v("新增imei")]),e._v(" "),n("el-button",{on:{click:e.toDeviceList}},[e._v("取消")])],1)],2)],1)],1)},r=[],a=(n("456d"),n("ac6a"),n("96cf"),n("3b8d")),c=n("fe05"),o=n("7d09"),s=n("aa98"),u={deptId:"客户Id",seriesId:"系列号",imeis:"imeis"},d={data:function(){var e=function(e,t,n){void 0===t||null===t||0===t.length?n(new Error(u[e.field]+"必须填写")):n()};return{loading:!1,device:{deptIdList:[],seriesIdList:[],imeis:[{value:""}]},rules:{deptId:[{validator:e}],seriesId:[{validator:e}]},options:[],selectSeriesOptions:[],selectDeptParents:[],defaultProps:{children:"children",label:"label"}}},mounted:function(){this.getFormData()},methods:{getFormData:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.selectDeptParent();case 2:return e.next=4,this.selectSeries();case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),setDefault:function(){this.$refs.device=[]},onSubmit:function(){var e=this;this.loading||(this.loading=!0,this.$refs.importDevice.validate((function(t,n){if(t){var i=e.device.imeis;e.device.imeis=[],i.forEach((function(t){e.device.imeis.push(t.value)})),Object(s["i"])(e.device).then((function(t){var n=t.msg;e.$notify({title:"操作成功",message:n,type:"success",duration:2e3}),e.setDefault(),e.toDeviceList(),e.loading=!1})).catch((function(t){console.log(t),e.loading=!1}))}else{var r=n[Object.keys(n)[0]][0].message;e.$message({message:r,type:"error"}),e.loading=!1}})))},toDeviceList:function(){this.$router.push({path:"/deviceManagement/device"})},selectSeries:function(){var e=Object(a["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["d"])().then((function(e){var n=e.data;t.selectSeriesOptions=n}));case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),selectDeptParent:function(){var e=Object(a["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(c["e"])().then((function(e){var n=e.data;t.options=n}));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.device.deptId=e[t]},addImeis:function(){this.device.imeis.push({value:""})},removeImeis:function(e){var t=this.device.imeis.indexOf(e);-1!==t&&this.device.imeis.splice(t,1)}}},l=d,p=n("2877"),v=Object(p["a"])(l,i,r,!1,null,"97bccd40",null);t["default"]=v.exports},fe05:function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return c})),n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return u}));n("7f7f"),n("55dd");var i=n("b775");function r(e){return Object(i["a"])({url:"/sys/dept/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort,name:e.name}})}function a(){return Object(i["a"])({url:"/sys/dept/listAll",method:"post"})}function c(){return Object(i["a"])({url:"/sys/dept/listAllTree",method:"post"})}function o(e){return Object(i["a"])({url:"/sys/dept/add",method:"post",data:e})}function s(e){return Object(i["a"])({url:"/sys/dept/edit",method:"post",data:e})}function u(e){return Object(i["a"])({url:"/sys/dept/delete",method:"post",data:{ids:e}})}}}]);
\ No newline at end of file
......@@ -46,20 +46,27 @@
<version>${mysql.version}</version>
</dependency>
<!-- 方便等会写单元测试 -->
<!-- 单元测试 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- 单元测试,我们采用 H2 作为数据库 -->
<dependency>
<groupId>com.h2database</groupId> <!-- 单元测试,我们采用 H2 作为数据库 -->
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<!-- 数据库版本 Liquibase 依赖 -->
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</dependency>
<!-- mqtt integration -->
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-mqtt</artifactId>
......
......@@ -42,6 +42,12 @@ spring:
# wall:
# config:
# multi-statement-allow: true
liquibase:
enabled: true # 开启 Liquibase 功能。默认为 true 。
change-log: classpath:/db/changelog/db_changelog_master.yaml # Liquibase 配置文件地址
url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false # 数据库地址
user: root # 数据库账号
password: cneeds!QAZ1qaz # 数据库密码
mqtt:
username: admin
password: public
......
......@@ -4,6 +4,12 @@ spring:
url: jdbc:mysql://127.0.0.1:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
password: cneeds!QAZ1qaz
username: root
liquibase:
enabled: true # 开启 Liquibase 功能。默认为 true 。
change-log: classpath:db/changelog/db_changelog_master.yaml # Liquibase 配置文件地址
url: jdbc:mysql://127.0.0.1:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false # 数据库地址
user: root # 数据库账号
password: cneeds!QAZ1qaz # 数据库密码
mqtt:
username: admin
password: public
......
databaseChangeLog:
- changeSet: # 对应一个 ChangeSet 对象
id: 0 # ChangeSet 编号
author: zzr # 作者
comments: frist init # 备注
- changeSet:
id: 1
author: zzr
comments: 修改权限表信息
changes:
- sqlFile:
encoding: utf8
path: classpath:/db/sql/changeSet_1.sql
- changeSet:
id: 2
author: zzr
comments: 修改权限表信息
changes:
- sqlFile:
encoding: utf8
path: classpath:/db/sql/changeSet_2.sql
\ No newline at end of file
delete from `sys_func`;
delete from `sys_role_func`;
delete from `sys_user_func`;
INSERT INTO `sys_func` VALUES (1, 0, '系统管理', NULL, 'sys', 0, 0);
INSERT INTO `sys_func` VALUES (2, 1, '用户管理', 'modules/sys/user.html', 'sys:module:list', 1, 1);
INSERT INTO `sys_func` VALUES (3, 1, '角色管理', 'modules/sys/role.html', 'sys:role:list', 1, 2);
INSERT INTO `sys_func` VALUES (4, 1, '菜单管理', 'modules/sys/menu.html', 'sys:module:list', 1, 3);
INSERT INTO `sys_func` VALUES (15, 2, '查看', NULL, 'sys:user:list', 2, 0);
INSERT INTO `sys_func` VALUES (16, 2, '新增', NULL, 'sys:user:add', 2, 0);
INSERT INTO `sys_func` VALUES (17, 2, '修改', NULL, 'sys:user:edit', 2, 0);
INSERT INTO `sys_func` VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, 0);
INSERT INTO `sys_func` VALUES (19, 3, '查看', NULL, 'sys:role:list', 2, 0);
INSERT INTO `sys_func` VALUES (20, 3, '新增', NULL, 'sys:role:add', 2, 0);
INSERT INTO `sys_func` VALUES (21, 3, '修改', NULL, 'sys:role:edit', 2, 0);
INSERT INTO `sys_func` VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, 0);
INSERT INTO `sys_func` VALUES (23, 4, '查看', NULL, 'sys:module:list', 2, 0);
INSERT INTO `sys_func` VALUES (31, 1, '部门管理', 'modules/sys/dept.html', 'sys:dept:list', 1, 1);
INSERT INTO `sys_func` VALUES (32, 31, '查看', NULL, 'sys:dept:list', 2, 0);
INSERT INTO `sys_func` VALUES (33, 31, '新增', NULL, 'sys:dept:add', 2, 0);
INSERT INTO `sys_func` VALUES (34, 31, '修改', NULL, 'sys:dept:edit', 2, 0);
INSERT INTO `sys_func` VALUES (35, 31, '删除', NULL, 'sys:dept:delete', 2, 0);
INSERT INTO `sys_func` VALUES (36, 0, '配置管理', NULL, 'configManagement', 1, 1);
INSERT INTO `sys_func` VALUES (37, 36, '产品系列管理', NULL, 'configManagement:productSeries', 1, 1);
INSERT INTO `sys_func` VALUES (38, 37, '查询产品系列', NULL, 'configManagement:productSeries:list', 2, 0);
INSERT INTO `sys_func` VALUES (39, 37, '添加产品系列', NULL, 'configManagement:productSeries:add', 2, 0);
INSERT INTO `sys_func` VALUES (40, 37, '修改产品系列', NULL, 'configManagement:productSeries:edit', 2, 0);
INSERT INTO `sys_func` VALUES (41, 37, '删除产品系列', NULL, 'configManagement:productSeries:delete', 2, 0);
INSERT INTO `sys_func` VALUES (42, 36, '渠道号管理', NULL, 'configManagement:deviceChannel', 1, 1);
INSERT INTO `sys_func` VALUES (43, 42, '查询渠道号', NULL, 'configManagement:deviceChannel:list', 2, 0);
INSERT INTO `sys_func` VALUES (44, 42, '添加渠道号', NULL, 'configManagement:deviceChannel:add', 2, 0);
INSERT INTO `sys_func` VALUES (45, 42, '修改渠道号', NULL, 'configManagement:deviceChannel:edit', 2, 0);
INSERT INTO `sys_func` VALUES (46, 42, '删除渠道号', NULL, 'configManagement:deviceChannel:delete', 2, 0);
INSERT INTO `sys_func` VALUES (47, 0, '设备管理', NULL, 'deviceManagement', 2, 0);
INSERT INTO `sys_func` VALUES (48, 47, '设备控制', NULL, 'deviceManagement:device', 1, 1);
INSERT INTO `sys_func` VALUES (49, 48, '查询设备', NULL, 'deviceManagement:device:list', 1, 1);
INSERT INTO `sys_func` VALUES (50, 48, '导入设备,批量导入,批量配置', NULL, 'deviceManagement:device:add', 2, 0);
INSERT INTO `sys_func` VALUES (51, 48, '适配配置', NULL, 'deviceManagement:device:edit', 2, 0);
INSERT INTO `sys_func` VALUES (52, 48, '删除设备', NULL, 'deviceManagement:device:delete', 2, 0);
INSERT INTO `sys_func` VALUES (53, 47, '设备渠道号统计,设备渠道号管理', NULL, 'deviceManagement:deviceChannel', 1, 1);
INSERT INTO `sys_func` VALUES (54, 53, '查询设备渠道号统计,设备渠道号管理', NULL, 'deviceManagement:deviceChannel:list', 2, 0);
INSERT INTO `sys_func` VALUES (55, 0, '远程日志', NULL, 'remotelog', 1, 1);
INSERT INTO `sys_func` VALUES (56, 0, '日志列表', NULL, 'remotelog:logfile', 1, 1);
INSERT INTO `sys_func` VALUES (57, 0, '查询日志', NULL, 'remotelog:logfile:list', 2, 0);
INSERT INTO `sys_func` VALUES (58, 46, '修改日志', NULL, 'remotelog:logfile:edit', 2, 0);
INSERT INTO `sys_func` VALUES (59, 46, '删除日志', NULL, 'remotelog:logfile:delete', 2, 0);
INSERT INTO `sys_func` VALUES (60, 46, '设备控制', NULL, 'remotelog:controlDevice', 1, 1);
INSERT INTO `sys_func` VALUES (61, 46, '查询状态', NULL, 'remotelog:controlDevice:list', 2, 0);
delete from `sys_func` where func_id = 38;
INSERT INTO `sys_func` VALUES (62, 0, '设备统计', NULL, 'deviceStatistical', 1, 1);
INSERT INTO `sys_func` VALUES (63, 62, '设备信息', NULL, 'deviceStatistical:deviceInfo', 1, 1);
INSERT INTO `sys_func` VALUES (64, 63, '查询设备信息', NULL, 'deviceStatistical:deviceInfo:list', 2, 0);
INSERT INTO `sys_func` VALUES (65, 62, '设备信息导出', NULL, 'deviceStatistical:deviceInfoExport', 1, 1);
INSERT INTO `sys_func` VALUES (66, 62, '查询设备信息导出(默认拥有下载导出权限)', NULL, 'deviceStatistical:deviceInfoExport:list', 1, 1);
INSERT INTO `sys_func` VALUES (67, 53, '修改设备渠道号管理', NULL, 'deviceManagement:deviceChannel:edit', 2, 0);
INSERT INTO `sys_func` VALUES (68, 53, '删除设备渠道号管理、设备渠道号统计', NULL, 'deviceManagement:deviceChannel:delete', 2, 0);
INSERT INTO `sys_func` VALUES (38, 37, '查询产品系列', NULL, 'configManagement:productSeries:list', 2, 0);
......@@ -5,6 +5,13 @@ spring:
driver-class-name: org.h2.Driver
username: sa
password:
liquibase:
enabled: true # 开启 Liquibase 功能。默认为 true 。
change-log: classpath:/db/changelog/db_changelog_master.yaml # Liquibase 配置文件地址
url: jdbc:h2:mem:testdb # 数据库地址
user: sa # 数据库账号
password: # 数据库密码
mqtt:
username: admin
......
databaseChangeLog:
- changeSet: # 对应一个 ChangeSet 对象
id: 0 # ChangeSet 编号
author: zzr # 作者
comments: frist init # 备注
changes:
- sqlFile:
encoding: utf8
path: classpath:/db/sql/cneeds_server.sql
- changeSet:
id: 1
author: zzr
comments: 修改权限表信息
changes:
- sqlFile:
encoding: utf8
path: classpath:/db/sql/changeSet_1.sql
- changeSet:
id: 2
author: zzr
comments: 修改权限表信息
changes:
- sqlFile:
encoding: utf8
path: classpath:/db/sql/changeSet_2.sql
\ No newline at end of file
delete from `sys_func`;
delete from `sys_role_func`;
delete from `sys_user_func`;
INSERT INTO `sys_func` VALUES (1, 0, '系统管理', NULL, 'sys', 0, 0);
INSERT INTO `sys_func` VALUES (2, 1, '用户管理', 'modules/sys/user.html', 'sys:module:list', 1, 1);
INSERT INTO `sys_func` VALUES (3, 1, '角色管理', 'modules/sys/role.html', 'sys:role:list', 1, 2);
INSERT INTO `sys_func` VALUES (4, 1, '菜单管理', 'modules/sys/menu.html', 'sys:module:list', 1, 3);
INSERT INTO `sys_func` VALUES (15, 2, '查看', NULL, 'sys:user:list', 2, 0);
INSERT INTO `sys_func` VALUES (16, 2, '新增', NULL, 'sys:user:add', 2, 0);
INSERT INTO `sys_func` VALUES (17, 2, '修改', NULL, 'sys:user:edit', 2, 0);
INSERT INTO `sys_func` VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, 0);
INSERT INTO `sys_func` VALUES (19, 3, '查看', NULL, 'sys:role:list', 2, 0);
INSERT INTO `sys_func` VALUES (20, 3, '新增', NULL, 'sys:role:add', 2, 0);
INSERT INTO `sys_func` VALUES (21, 3, '修改', NULL, 'sys:role:edit', 2, 0);
INSERT INTO `sys_func` VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, 0);
INSERT INTO `sys_func` VALUES (23, 4, '查看', NULL, 'sys:module:list', 2, 0);
INSERT INTO `sys_func` VALUES (31, 1, '部门管理', 'modules/sys/dept.html', 'sys:dept:list', 1, 1);
INSERT INTO `sys_func` VALUES (32, 31, '查看', NULL, 'sys:dept:list', 2, 0);
INSERT INTO `sys_func` VALUES (33, 31, '新增', NULL, 'sys:dept:add', 2, 0);
INSERT INTO `sys_func` VALUES (34, 31, '修改', NULL, 'sys:dept:edit', 2, 0);
INSERT INTO `sys_func` VALUES (35, 31, '删除', NULL, 'sys:dept:delete', 2, 0);
INSERT INTO `sys_func` VALUES (36, 0, '配置管理', NULL, 'configManagement', 1, 1);
INSERT INTO `sys_func` VALUES (37, 36, '产品系列管理', NULL, 'configManagement:productSeries', 1, 1);
INSERT INTO `sys_func` VALUES (38, 37, '查询产品系列', NULL, 'configManagement:productSeries:list', 2, 0);
INSERT INTO `sys_func` VALUES (39, 37, '添加产品系列', NULL, 'configManagement:productSeries:add', 2, 0);
INSERT INTO `sys_func` VALUES (40, 37, '修改产品系列', NULL, 'configManagement:productSeries:edit', 2, 0);
INSERT INTO `sys_func` VALUES (41, 37, '删除产品系列', NULL, 'configManagement:productSeries:delete', 2, 0);
INSERT INTO `sys_func` VALUES (42, 36, '渠道号管理', NULL, 'configManagement:deviceChannel', 1, 1);
INSERT INTO `sys_func` VALUES (43, 42, '查询渠道号', NULL, 'configManagement:deviceChannel:list', 2, 0);
INSERT INTO `sys_func` VALUES (44, 42, '添加渠道号', NULL, 'configManagement:deviceChannel:add', 2, 0);
INSERT INTO `sys_func` VALUES (45, 42, '修改渠道号', NULL, 'configManagement:deviceChannel:edit', 2, 0);
INSERT INTO `sys_func` VALUES (46, 42, '删除渠道号', NULL, 'configManagement:deviceChannel:delete', 2, 0);
INSERT INTO `sys_func` VALUES (47, 0, '设备管理', NULL, 'deviceManagement', 2, 0);
INSERT INTO `sys_func` VALUES (48, 47, '设备控制', NULL, 'deviceManagement:device', 1, 1);
INSERT INTO `sys_func` VALUES (49, 48, '查询设备', NULL, 'deviceManagement:device:list', 1, 1);
INSERT INTO `sys_func` VALUES (50, 48, '导入设备,批量导入,批量配置', NULL, 'deviceManagement:device:add', 2, 0);
INSERT INTO `sys_func` VALUES (51, 48, '适配配置', NULL, 'deviceManagement:device:edit', 2, 0);
INSERT INTO `sys_func` VALUES (52, 48, '删除设备', NULL, 'deviceManagement:device:delete', 2, 0);
INSERT INTO `sys_func` VALUES (53, 47, '设备渠道号统计,设备渠道号管理', NULL, 'deviceManagement:deviceChannel', 1, 1);
INSERT INTO `sys_func` VALUES (54, 53, '查询设备渠道号统计,设备渠道号管理', NULL, 'deviceManagement:deviceChannel:list', 2, 0);
INSERT INTO `sys_func` VALUES (55, 0, '远程日志', NULL, 'remotelog', 1, 1);
INSERT INTO `sys_func` VALUES (56, 0, '日志列表', NULL, 'remotelog:logfile', 1, 1);
INSERT INTO `sys_func` VALUES (57, 0, '查询日志', NULL, 'remotelog:logfile:list', 2, 0);
INSERT INTO `sys_func` VALUES (58, 46, '修改日志', NULL, 'remotelog:logfile:edit', 2, 0);
INSERT INTO `sys_func` VALUES (59, 46, '删除日志', NULL, 'remotelog:logfile:delete', 2, 0);
INSERT INTO `sys_func` VALUES (60, 46, '设备控制', NULL, 'remotelog:controlDevice', 1, 1);
INSERT INTO `sys_func` VALUES (61, 46, '查询状态', NULL, 'remotelog:controlDevice:list', 2, 0);
delete from `sys_func` where func_id = 38;
INSERT INTO `sys_func` VALUES (62, 0, '设备统计', NULL, 'deviceStatistical', 1, 1);
INSERT INTO `sys_func` VALUES (63, 62, '设备信息', NULL, 'deviceStatistical:deviceInfo', 1, 1);
INSERT INTO `sys_func` VALUES (64, 63, '查询设备信息', NULL, 'deviceStatistical:deviceInfo:list', 2, 0);
INSERT INTO `sys_func` VALUES (65, 62, '设备信息导出', NULL, 'deviceStatistical:deviceInfoExport', 1, 1);
INSERT INTO `sys_func` VALUES (66, 62, '查询设备信息导出(默认拥有下载导出权限)', NULL, 'deviceStatistical:deviceInfoExport:list', 1, 1);
INSERT INTO `sys_func` VALUES (67, 53, '修改设备渠道号管理', NULL, 'deviceManagement:deviceChannel:edit', 2, 0);
INSERT INTO `sys_func` VALUES (68, 53, '删除设备渠道号管理、设备渠道号统计', NULL, 'deviceManagement:deviceChannel:delete', 2, 0);
INSERT INTO `sys_func` VALUES (38, 37, '查询产品系列', NULL, 'configManagement:productSeries:list', 2, 0);
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE sys_dept (
dept_id int AUTO_INCREMENT PRIMARY KEY,
parent_id int DEFAULT NULL COMMENT '上级部门ID,一级部门为0',
......
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