当前位置: 首页 > news >正文

网站作品集厦门百城建设有限公司网站

网站作品集,厦门百城建设有限公司网站,wordpress中怎么去掉默认页面模板中的评论框,wordpress 漂浮公告因为原先平台绑定设备是通过一个界面进行人工选择绑定或一个人一个人绑定设备。如下#xff1a; 但有时候需要在几千个里选择出几百个#xff0c;那这种方式就不大现实了#xff0c;需要另外一种方法。 目前相到可以通过导入批量数据进行绑定的方式。 一、前端 主要是显示…        因为原先平台绑定设备是通过一个界面进行人工选择绑定或一个人一个人绑定设备。如下 但有时候需要在几千个里选择出几百个那这种方式就不大现实了需要另外一种方法。 目前相到可以通过导入批量数据进行绑定的方式。 一、前端 主要是显示选择文件与设备 templatediv classimport-bind v-loadingfullscreenLoading element-loading-text文件上传中div classdetail导入说明本功能为批量导入用户绑定设备用每次导入名单建议100名左右要求导入的用户已经存在了。/divdiv classform-rowdiv classname资料导入/divinput idfile styledisplay:none typefile changefileChosen /el-input v-modelfileName :disabledtrue stylewidth:260px;margin-left:20px/el-inputel-button typeprimary clickgetFile() stylewidth:130px;margin-left:20px选择文件/el-buttonahrefhttp://face.oss-cn-qingdao.aliyuncs.com/FRS/data_template/201709/fabc5813-e589-4e99-9bd7-22b3c09a54.xlsxel-button typeprimary stylewidth:150px;margin-left:15px资料模版下载/el-button/a/divspan v-showfileTip1 stylecolor:red;margin-left:30px;文件格式错误,请提交xls或xlsx格式文件/spandiv classform-rowdiv classname识别设备/divselect-devices-popup v-modeldevId/select-devices-popup/divel-button typeprimary clickuploadFirstFile()stylewidth:120px;margin-left:137px;margin-top:50px;确定/el-buttonel-dialog title提示 :visible.syncdialogVisible :before-closehandleClosediv v-ifportReadyspan导入成功/span/divdiv v-elsespan导入失败/spanspan导入数据存在问题请修改后重新上传。查看/spanspan stylecolor:#00A1E9;cursor:pointerclickgotoErrorDetail错误明细/span/divel-button typeprimary clickdialogVisible false stylewidth:120px;margin-top:50px;确 定/el-buttonel-button typecancel clickdialogVisible false stylewidth:120px;margin-top:50px;取 消/el-button/el-dialog/div /template script import appApi from /common/js/allApi.js import $ from jquery import selectDevicesPopup from /components/select-devices-popup.vueexport default {components: {selectDevicesPopup,},data() {return {fileList: [],fileName: ,largeFile: ,singleFile: 1024 * 1024, //单次上传大小tempPath: ,counter: 0,missTimeMax: 0, //单次上传最大丢包次数devId: ,excelPath: ,fileTip1: false,dialogVisible: false,portReady: false,fullscreenLoading: false}},mounted() {},methods: {getFile: function() {document.getElementById(file).click()},fileChosen: function() {var fname document.getElementById(file).files[0].namethis.fileName fnamevar type fname.split(.)var filetype type[type.length - 1]if (filetype ! xls filetype ! xlsx) {this.fileTip1 true} else {this.fileTip1 false}},//先传小文件uploadFirstFile: function() {var vm thisif (this.fileName ! ) {if (this.fileTip1 true) {} else {var file document.getElementById(file).files[0]var size file.sizevar data new FormData()data.append(file, file)data.append(fileName, file.name)data.append(filePath, )data.append(isFirst, true)data.append(start, 0)data.append(fileSplitSize, size)// data.append(loginId, sessionStorage.getItem(birdloginid));vm.fullscreenLoading true$.ajax({processData: false, // 告诉jquery不要处理发送的数据contentType: false, // 告诉jquery不要设置content-Type请求头url: appApi.importStaff, //员工管理里更改的从大文件上传-》上传文件type: POST,headers: { token: sessionStorage.token },data: data,success: function(msg) {console.log(uploadFirstFile msg,msg);if (msg.code 1) {vm.excelPath msg.data.filePathif (msg.data.currentSize size) {vm.tempPath vm.counter 0vm.importBind()} else {vm.tempPath msg.data.filePathvm.missTimeMax 0vm.countervm.uploadFirstFile()}} else {if (vm.missTimeMax 10) {vm.missTimeMaxvm.uploadFirstFile()} else {vm.fullscreenLoading falsevm.$message({type: warning,message: 当前网络不稳定请重试!})}}},error: function(error) {vm.fullscreenLoading false}})}} else {vm.$message({type: error,message: 请同时上传基础资料和头像!})}},//后台输入绑定解析文件importBind: function() {var vm thisvar data {companyId: sessionStorage.companyId,excelPath: this.excelPath,devId: this.devId,}$.ajax({url: appApi.importBind,type: POST,data: data,headers: { token: sessionStorage.token },success: function(msg) {vm.fullscreenLoading falseif (msg.code 0) {//文件内容错误vm.$message({type: error,message: msg.message})} else if (msg.code 1) {//成功vm.dialogVisible truevm.portReady true} else if (msg.code 2) {if(!msg.data) {vm.$message({type: error,message: msg.message})} else {//有错误数据vm.dialogVisible truevm.portReady falsewindow.dataList msg.data.dataListwindow.imgList msg.data.imgMap}}},error: function(xhr, type, errorThrown) {}})},gotoErrorDetail() {this.$router.push({path: /error-log})},handleClose() {}} } /scriptstyle scoped langstylus .import-bindpadding-left 15px.detailpadding-top 15px.form-rowmargin-left 30pxmargin-top 50px.namedisplay inline-blockwidth 90pxtext-align right.select-devices-popupdisplay inline-blockmargin-left 20px.list {list-style: none; }ul li {margin-bottom: 10px; }.head-submit {cursor: pointer;height: 140px;width: 140px;border: 2px dashed #ccc;border-radius: 3px;margin-left: 110px;margin-top: -70px;text-align: center;line-height: 140px; }.el-dialog__body .el-button--primary {margin-left: calc(50% - 130px); } /style 界面如下 二、后端代码 接口代码 PostMapping(/importBind)ApiOperation(批量导入员工数据绑定设备)public ResultBean? importBind(ApiParam(name excelPath, value 基础信息文件存储URL, required true) RequestParam String excelPath,ApiParam(name companyId, value 企业ID, required true) RequestParam Integer companyId,ApiParam(name devId, value 设备ID(,分隔)) RequestParam(required false) String devId) {// 错误信息存储列表ListUserErrorInfo userErrorList new ArrayList();ListString imgErrorList new ArrayList();Assert.notNull(companyId, ReturnCode.Params_Error);userService.importBind(companyId, getLoginId(), excelPath, userErrorList, imgErrorList, devId);// 返回结果if (userErrorList.size() 0 imgErrorList.size() 0) {return Results.success();} else {MapString, Object errorLists new HashMap();errorLists.put(dataList, userErrorList);errorLists.put(imgMap, imgErrorList);return new ResultBean(2, ReturnCode.File_Exist_Error_Data.getDetail(), errorLists);}} 绑定的主要逻辑如下 Overridepublic void importBind(Integer companyId, Integer loginId, String excelPath, ListUserErrorInfo userErrorList,ListString imgErrorList, String devId) {// 1. 解析EXCEL数据映射成原始数据信息列表ListMapString, Object dataList parseExcelToRawdata(excelPath);// 2. 过滤原始数据信息, 并转换成员工信息列表ListUser users filterToUsersForBind(companyId, loginId, dataList, userErrorList);// 3. 批量绑定设备if(users.size()0){batchBind(users,devId);}}TransactionalOperLogInject(批量绑定员工信息)public void batchBind(ListUser users, String devId) {if (!devId.isEmpty() !users.isEmpty()) {String userId String.join(,, users.stream().map(u - u.getId().toString()).collect(Collectors.toList()));try {ResultBean? bindResult devService.bindUser(devId,null, userId, true,1);Assert.isTrue(bindResult.getCode() 1, ReturnCode.User_Bind_Error);} catch (Exception e) {throw new CustomException(ReturnCode.User_Bind_Error);}}}
http://wiki.neutronadmin.com/news/355611/

相关文章:

  • 网站seo方法网站建设接单
  • 3合1网站建设哪家好哪个公司网站做的最好
  • 关于网站建设的介绍电商平台怎么做
  • 网站做三个月收录100设计网站公司价格
  • 企业手机端网站模板下载海南网站建设报价方案
  • 做爰网站视屏建设企业网站的意义
  • 紫搜做网站wordpress 4.5 漏洞
  • wix做的网站能扒下来网站开发需求报告
  • 网站设计 职业阿里巴巴运营技巧和方法
  • 自己做网站 需要服务器吗百度怎么做广告推广
  • 公司网站建设包括哪些东西网站制作软件图标
  • 中英文的网站怎么建设wordpress号码
  • 建站模板网站wordpress软件
  • 网站开发要什么软件有哪些彩票网站怎么建设
  • 做网站协议书游戏推广代理平台
  • 网站样版风格排版h5制作软件下载
  • 太原网站建设详细策划资讯类网站怎么做
  • 宁波企业网站开发公司成都软件开发网站建设
  • 东莞网站建设营销平台的淘客招商网站选品库建设
  • 网站后台上传内容前台首页不显示国家信用信息公示系统广东
  • 行政单位网站建设立项依据互联网创业平台有哪些
  • 建购物网站 教程哈尔滨优惠的网站建设
  • 国外网站seo东莞自助建站平台
  • 商城网站做推广方案傻瓜式网站制作
  • 公司网站在哪里做网站建设 福步
  • qq做兼职给网站给你怎么下载河北人社app
  • 上海市城乡建设部网站首页南京招投标中心官网
  • 格尔木城乡建设规划局网站wordpress域名文件夹
  • 南昌网站建设志博长春网站建设小程
  • wordpress php允许上传文件大小深圳市seo上词多少钱