New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.common.utils.News; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * Created by vincent on 2022/12/28 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/news") |
| | | public class NewsController { |
| | | |
| | | @RequestMapping("/print") |
| | | public synchronized R print(){ |
| | | return R.ok().add(News.print()); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.CollectionUtils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.utils.News; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | |
| | | String barcode = barcodeThread.getBarcode(); |
| | | // barcode="ILY0127 0001"; |
| | | if(!Cools.isEmpty(barcode)) { |
| | | log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | News.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | continue; |
| | | } |
| | |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode.substring(0,6)); |
| | | if (wrkMast != null) { |
| | | log.error("工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo()); |
| | | News.error("工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo()); |
| | | continue; |
| | | } |
| | | // // 获取入库通知档 |
| | |
| | | if(barcode.length()>6){ |
| | | pack=barcode.substring(6); |
| | | if(pack.equals("00000000000000000000")){ |
| | | log.error("没有获得Pack码",pack); |
| | | News.error("没有获得Pack码",pack); |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | //String pack="MJY0136 0400"; |
| | | barcode=barcode.substring(0,6);//托盘码 |
| | | if(barcode.equals("000000")){ |
| | | log.error("没有获得条码",barcode); |
| | | News.error("没有获得条码",barcode); |
| | | continue; |
| | | } |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | News.error("更新plc站点信息失败"); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else if (jsonObject.getInteger("code").equals(700) && (!barcodeThread.getBarcode().equals("NG"))){ |
| | |
| | | staProtocol.setStaNo((short)201); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), true); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("url:{};request:{};response:{}", wmsUrl+"/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | News.error("url:{};request:{};response:{}", wmsUrl+"/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | }else { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | barcodeThread.setBarcode(""); |
| | |
| | | staProtocol.setStaNo((short)201); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), true); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl+"/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | News.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl+"/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | } |
| | | |
| | | |
| | |
| | | log.error("更新工作档失败!!! [工作号:{}]", wrkMast.getWrkNo()); |
| | | } |
| | | } else { |
| | | log.error("发布命令至输送线队列失败!!! [plc编号:{}]", devp.getId()); |
| | | News.error("发布命令至输送线队列失败!!! [plc编号:{}]", devp.getId()); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | // 判断工作档条件 |
| | | if (wrkMast.getIoType() < 100 || wrkMast.getStaNo() == null || wrkMast.getSourceStaNo() == null) { |
| | | News.error("工作档案条件不满足:工作档案:"+wrkMast+";条件iotype<100或者staNo为空或者sourceStaNo为空"); |
| | | continue; |
| | | } |
| | | // 判断吊车是否实际已完成,且电脑状态在move中,以备电脑进行更新工作档 |
| | |
| | | // 复位堆垛机 |
| | | crnThread.setResetFlag(true); |
| | | } else { |
| | | log.error("更新工作档的工作状态为14失败!!! [工作号:{}]", wrkMast.getWrkNo()); |
| | | News.error("更新工作档的工作状态为14失败!!! [工作号:{}]", wrkMast.getWrkNo()); |
| | | } |
| | | |
| | | } |
| | |
| | | if (crnProtocol == null) { continue; } |
| | | BasCrnp basCrnp = basCrnpService.selectById(crn.getId()); |
| | | if (basCrnp == null) { |
| | | log.error("{}号堆垛机尚未在数据库进行维护!", crn.getId()); |
| | | News.error("{}号堆垛机尚未在数据库进行维护!", crn.getId()); |
| | | continue; |
| | | } |
| | | |
| | |
| | | // 查询站点详细信息 |
| | | BasDevp staDetl = basDevpService.selectById(crnStn.getStaNo()); |
| | | if (staDetl == null) { |
| | | log.error("入库 ===>> 堆垛机站点在数据库不存在, 站点编号={}", crnStn.getStaNo()); |
| | | News.error("入库 ===>> 堆垛机站点在数据库不存在, 站点编号={}", crnStn.getStaNo()); |
| | | continue; |
| | | } |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0 && staProtocol.isInEnable() |
| | |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | if (locMast == null) { |
| | | log.error("查询库存无数据--库位号{}", wrkMast.getLocNo()); |
| | | News.error("查询库存无数据--库位号{}", wrkMast.getLocNo()); |
| | | continue; |
| | | } |
| | | if (!locMast.getLocSts().equals("S") && !locMast.getLocSts().equals("Q")) { |
| | | log.error("入库操作库位状态不符合--状态, 库位号={},库位状态={}", wrkMast.getLocNo(), locMast.getLocSts()); |
| | | News.error("入库操作库位状态不符合--状态, 库位号={},库位状态={}", wrkMast.getLocNo(), locMast.getLocSts()); |
| | | continue; |
| | | } |
| | | |
| | |
| | | if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) { |
| | | WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); |
| | | if (null == waitWrkMast) { |
| | | log.error("{}库位异常,未检索到相应工作档!", shallowLocNo); |
| | | News.error("{}库位异常,未检索到相应工作档!", shallowLocNo); |
| | | } else { |
| | | waitWrkMast.setIoPri(15D); |
| | | waitWrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(waitWrkMast) == 0) { |
| | | log.error("调整工作档优先级失败!工作号={}", waitWrkMast.getWrkNo()); |
| | | News.error("调整工作档优先级失败!工作号={}", waitWrkMast.getWrkNo()); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | crnCommand.setBarcode(wrkMast.getBarcode());//托盘码 |
| | | log.error("768 堆垛机命令下发"+crnCommand); |
| | | if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | News.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |
| | | log.error("772 堆垛机命令下发成功"+crnCommand); |
| | | News.info("772 堆垛机命令下发成功"+crnCommand); |
| | | |
| | | // long startTime = System.currentTimeMillis(); |
| | | // while ((System.currentTimeMillis() - startTime) < COMMAND_TIMEOUT) { |
| | |
| | | |
| | | // 修改工作档状态 2.设备上走 => 3.吊车入库中 |
| | | log.error("787 修改工作档状态2.设备上走 => 3.吊车入库中 "+wrkMast); |
| | | News.info("787 修改工作档状态2.设备上走 => 3.吊车入库中 "+wrkMast); |
| | | Date now = new Date(); |
| | | wrkMast.setWrkSts(3L); |
| | | wrkMast.setCrnStrTime(now); |
| | | wrkMast.setModiTime(now); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("修改工作档状态 2.设备上走 => 3.吊车入库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | News.error("修改工作档状态 2.设备上走 => 3.吊车入库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | | log.error("795 修改工作档状态成功2.设备上走 => 3.吊车入库中"+wrkMast); |
| | | News.info("795 修改工作档状态成功2.设备上走 => 3.吊车入库中"+wrkMast); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | // 工作档状态判断 |
| | | if (wrkMast.getIoType() < 100 || wrkMast.getSourceStaNo() == null){ |
| | | log.error("查询工作档数据不符合条件--入出类型/站点, 工作号={},源库位={},入出类型={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getIoType()); |
| | | News.error("查询工作档数据不符合条件--入出类型/站点, 工作号={},源库位={},入出类型={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getIoType()); |
| | | continue; |
| | | } |
| | | // 获取源库位信息 |
| | | LocMast sourceSta = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (!sourceSta.getLocSts().equals("R") &&!sourceSta.getLocSts().equals("P")) { |
| | | log.error("出库操作库位状态不符合--状态, 库位号={},库位状态={}", wrkMast.getLocNo(), sourceSta.getLocSts()); |
| | | News.error("出库操作库位状态不符合--状态, 库位号={},库位状态={}", wrkMast.getLocNo(), sourceSta.getLocSts()); |
| | | continue; |
| | | } |
| | | // 获取堆垛机出库站信息 |
| | |
| | | // 查询站点详细信息 |
| | | BasDevp staDetl = basDevpService.selectById(crnStn.getStaNo()); |
| | | if (staDetl == null) { |
| | | log.error("出库 ===>> 堆垛机站点在数据库不存在, 站点编号={}", crnStn.getStaNo()); |
| | | News.error("出库 ===>> 堆垛机站点在数据库不存在, 站点编号={}", crnStn.getStaNo()); |
| | | break; |
| | | // continue; |
| | | } |
| | |
| | | .eq("loc_sts","R") |
| | | .eq("loc_no",wrkMast.getSourceLocNo())); |
| | | if(Cools.isEmpty(locMast)){ |
| | | log.error("出库 ===>> 库位中没有这笔资料",wrkMast.getSourceLocNo()); |
| | | News.error("出库 ===>> 库位中没有这笔资料",wrkMast.getSourceLocNo()); |
| | | continue; |
| | | } |
| | | |
| | |
| | | && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { |
| | | //测试库位出库必须要按启动按钮才能出库 |
| | | if((wrkMast.getStaNo()==206 || wrkMast.getStaNo()==1000)&& locMast.getCtnKind()==0){ |
| | | log.error("出库 ===>> 等待启动出库按钮",wrkMast); |
| | | News.error("出库 ===>> 等待启动出库按钮",wrkMast); |
| | | continue; |
| | | } |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | |
| | | if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) { |
| | | WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); |
| | | if (null == waitWrkMast) { |
| | | log.error("{}库位异常,未检索到相应工作档!", shallowLocNo); |
| | | News.error("{}库位异常,未检索到相应工作档!", shallowLocNo); |
| | | } else { |
| | | if(waitWrkMast.getWrkSts() == 11) { |
| | | waitWrkMast.setIoPri(15D); |
| | | waitWrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(waitWrkMast) == 0) { |
| | | log.error("调整工作档优先级失败!工作号={}", waitWrkMast.getWrkNo()); |
| | | News.error("调整工作档优先级失败!工作号={}", waitWrkMast.getWrkNo()); |
| | | } |
| | | continue; |
| | | } else { |
| | |
| | | // 生成工作档,将浅库位移转到新的库位中 |
| | | moveLocForDeepLoc(slave, shallowLoc); |
| | | } |
| | | log.error("{}任务出库失败,浅库位堵塞!", wrkMast.getWrkNo()); |
| | | News.error("{}任务出库失败,浅库位堵塞!", wrkMast.getWrkNo()); |
| | | continue; |
| | | } else if (shallowLoc.getLocSts().equals("Q") || shallowLoc.getLocSts().equals("S")){ |
| | | WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); |
| | |
| | | crnCommand.setDestinationPosZ(crnStn.getLev().shortValue()); // 目标库位层 |
| | | crnCommand.setBarcode(wrkMast.getBarcode()); |
| | | if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | News.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |
| | | // 修改工作档状态 11.生成出库ID => 12.吊车出库中 |
| | | Date now = new Date(); |
| | |
| | | wrkMast.setCrnStrTime(now); |
| | | wrkMast.setModiTime(now); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | News.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | | break; |
| | | } |
| | |
| | | // 获取源库位信息 |
| | | LocMast sourceSta = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (null == sourceSta) { |
| | | log.error("工作档库位移转失败,原因:检索源库位失败!工作号={},源库位={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); |
| | | News.error("工作档库位移转失败,原因:检索源库位失败!工作号={},源库位={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); |
| | | return; |
| | | } |
| | | // 源库位 库位状态判断 |
| | |
| | | // 获取目标库位信息 |
| | | LocMast sta = locMastService.selectById(wrkMast.getLocNo()); |
| | | if (null == sta) { |
| | | log.error("工作档库位移转失败,原因:检索目标库位失败!工作号={},源库位={}", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | News.error("工作档库位移转失败,原因:检索目标库位失败!工作号={},源库位={}", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | return; |
| | | } |
| | | // 获取堆垛机信息 并 判断是否可入出 |
| | |
| | | |
| | | //测试库位出库必须要按启动按钮才能出库 |
| | | if(sourceSta.getLocType1()==1 && sourceSta.getCtnKind()==0){ |
| | | log.error("出库 ===>> 等待启动按钮",wrkMast); |
| | | News.error("出库 ===>> 等待启动按钮",wrkMast); |
| | | return; |
| | | } |
| | | |
| | |
| | | crnCommand.setFireStaut((short) 1); |
| | | } |
| | | if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | News.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |
| | | // 修改工作档状态 11.生成出库ID => 12.吊车出库中 |
| | | Date now = new Date(); |
| | |
| | | wrkMast.setCrnStrTime(now); |
| | | wrkMast.setModiTime(now); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("【库位移转】 修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | News.error("【库位移转】 修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | | } |
| | | log.info("结束移库任务程序"); |
| | |
| | | // 获取入库待确认工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep3(crnProtocol.getTaskNo().intValue()); |
| | | if (wrkMast == null) { |
| | | log.error("堆垛机处于等待确认且任务完成状态,但未找到工作档。堆垛机号={},工作号={}", crn.getId(), crnProtocol.getTaskNo()); |
| | | News.error("堆垛机处于等待确认且任务完成状态,但未找到工作档。堆垛机号={},工作号={}", crn.getId(), crnProtocol.getTaskNo()); |
| | | continue; |
| | | } |
| | | // 入库 + 库位转移 ==> 4.入库完成 |
| | |
| | | if (wrkMast == null) { continue; } |
| | | // 入库 |
| | | if (wrkMast.getWrkSts() == 1 || wrkMast.getWrkSts() == 2) { |
| | | log.warn("堆垛机非空闲情况下,开始修改工作档状态。[id:{},时间:{}] >>>>> 堆垛机当前状态为:{}。任务号:{}", crn.getId(), DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), crnProtocol.getStatusType().desc, crnProtocol.getTaskNo()); |
| | | News.warn("堆垛机非空闲情况下,开始修改工作档状态。[id:{},时间:{}] >>>>> 堆垛机当前状态为:{}。任务号:{}", crn.getId(), DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), crnProtocol.getStatusType().desc, crnProtocol.getTaskNo()); |
| | | // 修改工作档状态 2.设备上走 => 3.吊车入库中 |
| | | wrkMast.setWrkSts(3L); |
| | | wrkMast.setCrnStrTime(now); |
| | | wrkMast.setModiTime(now); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("修改工作档状态 2.设备上走 => 3.吊车入库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | News.error("修改工作档状态 2.设备上走 => 3.吊车入库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | | log.warn("修改工作档状态成功。[时间:{}] >>>>> 任务号:{}", DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), wrkMast.getWrkNo()); |
| | | News.warn("修改工作档状态成功。[时间:{}] >>>>> 任务号:{}", DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), wrkMast.getWrkNo()); |
| | | } |
| | | // 出库、移库 |
| | | if (wrkMast.getWrkSts() == 11) { |
| | |
| | | wrkMast.setCrnStrTime(now); |
| | | wrkMast.setModiTime(now); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | News.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | | log.warn("修改工作档状态成功。[时间:{}] >>>>> 任务号:{}", DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), wrkMast.getWrkNo()); |
| | | News.warn("修改工作档状态成功。[时间:{}] >>>>> 任务号:{}", DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), wrkMast.getWrkNo()); |
| | | } |
| | | |
| | | |
| | |
| | | // 查询站点详细信息 |
| | | BasDevp staDetl = basDevpService.selectById(crnStn.getStaNo()); |
| | | if (staDetl == null) { |
| | | log.error("入库 ===>> 堆垛机站点在数据库不存在, 站点编号={}", crnStn.getStaNo()); |
| | | News.error("入库 ===>> 堆垛机站点在数据库不存在, 站点编号={}", crnStn.getStaNo()); |
| | | continue; |
| | | } |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0 && staProtocol.isInEnable() |
| | |
| | | crnCommand.setDestinationPosY((short)19); // 目标库位列 |
| | | crnCommand.setDestinationPosZ((short)1); // 目标库位层 |
| | | if (!MessageQueue.offer(SlaveType.Crn, 1, new Task(2, crnCommand))) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", 1, JSON.toJSON(crnCommand)); |
| | | News.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", 1, JSON.toJSON(crnCommand)); |
| | | } else { |
| | | } |
| | | } |
| | |
| | | if (!Cools.isEmpty(locMast)){ |
| | | //报警信号写入1 |
| | | if (!MessageQueue.offer(SlaveType.Crn, 1, new Task(4, 1))) { |
| | | log.error("火警 ===>> 给堆垛机发送报警信号失败"); |
| | | News.error("火警 ===>> 给堆垛机发送报警信号失败"); |
| | | } |
| | | News.error("火警!!!!!!! ===>> 给堆垛机发送报警信号成功"); |
| | | } else { |
| | | //报警信号没有后,复位地址 |
| | | if (!MessageQueue.offer(SlaveType.Crn, 1, new Task(4, 0))) { |
| | | log.error("火警 ===>> 给堆垛机清零复位报警信号失败"); |
| | | News.error("火警 ===>> 给堆垛机清零复位报警信号失败"); |
| | | } |
| | | News.warn("火警 ===>> 给堆垛机发送报警信号成功"); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("火警 ===>> 给堆垛机发送警报失败", e); |
| | | News.error("火警 ===>> 给堆垛机发送警报失败", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no",103)); |
| | | if (Cools.isEmpty(basDevp)){ |
| | | log.error("103站点查询失败-MainServiceImpl.java-2255行"); |
| | | News.error("103站点查询失败-MainServiceImpl.java-2255行"); |
| | | } |
| | | if (basDevp.getAutoing().equals("Y") && basDevp.getWrkNo()>0 && basDevp.getLoading().equals("Y") ){ |
| | | WrkDetl wrkDetl = wrkDetlService.devpPackNo(basDevp.getWrkNo()); |
| | | if (Cools.isEmpty(wrkDetl)){ |
| | | log.error("103站点查询失败-MainServiceImpl.java-2255行"); |
| | | News.error("103站点查询失败-MainServiceImpl.java-2255行"); |
| | | } |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(4,wrkDetl.getMatnr())); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("103 ===>> 给输送线发送Pack码失败", e); |
| | | News.error("103 ===>> 给输送线发送Pack码失败", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | |
| | | //testMast.setStatus |
| | | //"状态 0: 待申请 1: 申请中 2: 已复核 3:测试中 4:完成 5:移库 6:火警" |
| | | if(devpThread.startSignal[i][0]==8){ |
| | | log.info("2390行程序开始运行,修改测试档状态为 1、申请中,开始修改前:"+testMast); |
| | | News.info("2390行程序开始运行,修改测试档状态为 1、申请中,开始修改前:"+testMast); |
| | | testMast.setStatus(1); |
| | | locMast.setPackStatus(1); |
| | | testMast.setModiTime(new Date()); |
| | | log.info("2394行程序开始运行,修改测试档状态为 1、申请中,修改数据后、未更新"+testMast); |
| | | }else if(devpThread.startSignal[i][0]==2 && locMast.getPackStatus()!=2){ |
| | | log.info("2396行程序开始运行,修改测试档状态为 3、测试中,开始修改前:"+testMast); |
| | | News.info("2396行程序开始运行,修改测试档状态为 3、测试中,开始修改前:"+testMast); |
| | | testMast.setStatus(3); |
| | | locMast.setPackStatus(2); |
| | | testMast.setModiTime(new Date()); |
| | |
| | | WrkMast wrkMast=wrkMastService.selectOne(new EntityWrapper<WrkMast>() |
| | | .eq("source_loc_no",locMast.getLocNo()) |
| | | .eq("wrk_sts",11)); |
| | | log.info("2405,查询状态为生成出库id的测试完成(NG或OK)任务档,"+wrkMast); |
| | | News.info("2405,查询状态为生成出库id的测试完成(NG或OK)任务档,"+wrkMast); |
| | | if(!Cools.isEmpty(wrkMast)){ |
| | | if(wrkMast.getWrkSts()==11){ |
| | | if(wrkMast.getIoType()==11){ |
| | |
| | | if(!locMastService.update(locMast,new EntityWrapper<LocMast>() |
| | | .eq("loc_sts","R") |
| | | .eq("channel",i+1))){ |
| | | log.error("修改启动按钮状态,测试库位状态失败"+locMast.getLocNo(),locMast); |
| | | News.error("修改启动按钮状态,测试库位状态失败"+locMast.getLocNo(),locMast); |
| | | } |
| | | }else if(!locMast.getLocSts().equals("R")){ |
| | | if(!fig){ |
| | | if(!locMastService.update(locMast,new EntityWrapper<LocMast>() |
| | | .eq("loc_sts","F") |
| | | .eq("channel",i+1))){ |
| | | log.error("修改测试库位状态失败"+locMast.getLocNo(),locMast); |
| | | News.error("修改测试库位状态失败"+locMast.getLocNo(),locMast); |
| | | } |
| | | } |
| | | if(!testMastService.update(testMast,new EntityWrapper<TestMast>() |
| | | .eq("loc_no",locMast.getLocNo()) |
| | | .eq("user_id",locMast.getBarcode()))) { |
| | | log.error("修改测试档状态失败" + locMast.getLocNo(), locMast); |
| | | News.error("修改测试档状态失败" + locMast.getLocNo(), locMast); |
| | | } |
| | | } |
| | | } |
| | |
| | | if(!testMastService.update(testMast,new EntityWrapper<TestMast>() |
| | | .eq("loc_no",locMast.getLocNo()) |
| | | .eq("user_id",locMast.getBarcode()))) { |
| | | log.error("修改测试档状态失败" + locMast.getLocNo(), locMast); |
| | | News.error("修改测试档状态失败" + locMast.getLocNo(), locMast); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("火警 ===>> 给输送线发送警报失败,通道号:", i+1); |
| | | News.error("火警 ===>> 给输送线发送警报失败,通道号:", i+1); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("获得测试库位状态失败", e); |
| | | News.error("获得测试库位状态失败", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
New file |
| | |
| | | package com.zy.common.utils; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * news stories for zoneyung |
| | | * Created by vincent on 2022/12/22 |
| | | */ |
| | | @Slf4j |
| | | public class News { |
| | | |
| | | public static void main(String[] args) { |
| | | News.info("info{}", 1); |
| | | News.warn("warn{}", 2); |
| | | News.error("error{}", 3); |
| | | System.out.println(News.print()); |
| | | } |
| | | |
| | | interface NewsSupport<T> { boolean execute(T t); } |
| | | |
| | | private static final NewsQueue<NewsDomain> NEWS_QUEUE = new NewsQueue<>(NewsDomain.class, 1024); |
| | | |
| | | @SuppressWarnings({"unchecked"}) |
| | | static class NewsQueue<T> { |
| | | |
| | | private final transient Class<T> cls; |
| | | private final T[] arr; |
| | | private final int capacity; |
| | | private int head; |
| | | private int tail; |
| | | |
| | | { this.head = 0; this.tail = 0; } |
| | | |
| | | public NewsQueue(Class<T> cls, int capacity) { |
| | | this.cls = cls; |
| | | this.arr = (T[]) Array.newInstance(cls, capacity); |
| | | this.capacity = capacity; |
| | | } |
| | | |
| | | public synchronized boolean offer(T t) { |
| | | if (this.tail == this.capacity) { |
| | | this.peek(); |
| | | } |
| | | this.reform(); |
| | | this.arr[this.tail] = t; |
| | | this.tail ++; |
| | | return true; |
| | | } |
| | | |
| | | public synchronized boolean put(T t) { |
| | | if (this.tail == this.capacity) { |
| | | return false; |
| | | } else { |
| | | this.reform(); |
| | | } |
| | | this.arr[this.tail] = t; |
| | | this.tail ++; |
| | | return true; |
| | | } |
| | | |
| | | public synchronized T peek() { |
| | | if (this.head == this.tail) { |
| | | return null; |
| | | } |
| | | T t = this.arr[this.head]; |
| | | this.head ++; |
| | | this.reform(); |
| | | return t; |
| | | } |
| | | |
| | | private void reform() { |
| | | for (int i = this.head; i < this.tail; i++) { |
| | | this.arr[i-this.head] = this.arr[i]; |
| | | } |
| | | this.tail -= this.head; |
| | | this.head = 0; |
| | | } |
| | | |
| | | public synchronized int size() { |
| | | return this.tail - this.head; |
| | | } |
| | | |
| | | public synchronized List<T> data() { |
| | | T[] ts = (T[]) Array.newInstance(this.cls, size()); |
| | | if (this.tail - this.head >= 0) { |
| | | System.arraycopy(this.arr, this.head, ts, 0, this.tail - this.head); |
| | | } |
| | | return Arrays.asList(ts); |
| | | } |
| | | |
| | | } |
| | | |
| | | public static void info(String format, Object... arguments) { |
| | | log.info(format, arguments); |
| | | offer(NewsLevel.INFO, format, arguments); |
| | | } |
| | | |
| | | public static void warn(String format, Object... arguments) { |
| | | log.warn(format, arguments); |
| | | offer(NewsLevel.WARN, format, arguments); |
| | | } |
| | | |
| | | public static void error(String format, Object... arguments) { |
| | | log.error(format, arguments); |
| | | offer(NewsLevel.ERROR, format, arguments); |
| | | } |
| | | |
| | | public static String printStr() { |
| | | StringBuilder sb = new StringBuilder("["); |
| | | List<NewsDomain> domains = NEWS_QUEUE.data(); |
| | | for (int i = 0; i < domains.size(); i++) { |
| | | NewsDomain domain = domains.get(i); |
| | | sb.append("{"); |
| | | sb.append("\"l\":").append(domain.level.idx).append(","); |
| | | sb.append("\"v\":\"").append(domain.content).append("\"").append(","); |
| | | sb.append("\"t\":\"").append(domain.date).append("\""); |
| | | sb.append("}"); |
| | | if (i < domains.size() - 1) { |
| | | sb.append(","); |
| | | } |
| | | } |
| | | sb.append("]"); |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static List<Map<String, Object>> print() { |
| | | List<Map<String, Object>> res = new ArrayList<>(); |
| | | for (NewsDomain datum : NEWS_QUEUE.data()) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("l", datum.level.idx); |
| | | map.put("v", datum.content); |
| | | map.put("t", datum.date); |
| | | res.add(map); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | private static boolean offer(NewsLevel level, String msg, Object[] args) { |
| | | return NEWS_QUEUE.offer(new NewsDomain(level, replace(msg, args), (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date()))); |
| | | } |
| | | |
| | | private static String replace(String str, Object[] objs){ |
| | | if (null == objs || objs.length == 0 || null == str || "".equals(str.trim())) { |
| | | return str; |
| | | } else { |
| | | StringBuilder sb = new StringBuilder(str); |
| | | for (Object obj : objs) { |
| | | int idx = sb.indexOf("{}"); |
| | | if (idx == -1) { break; } |
| | | sb.replace(idx, idx + 2, String.valueOf(obj)); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | } |
| | | |
| | | static class NewsDomain { |
| | | public NewsLevel level; |
| | | public String content; |
| | | public String date; |
| | | |
| | | public NewsDomain(NewsLevel level, String content, String date) { |
| | | this.level = level; |
| | | this.content = content; |
| | | this.date = date; |
| | | } |
| | | } |
| | | |
| | | enum NewsLevel { |
| | | INFO(1), |
| | | WARN(2), |
| | | ERROR(3), |
| | | ; |
| | | public int idx; |
| | | NewsLevel(int idx) { |
| | | this.idx = idx; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.service.BasCrnOptService; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.common.utils.News; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
New file |
| | |
| | | /*! |
| | | * file : layx.css |
| | | * gitee : https://gitee.com/monksoul/LayX |
| | | * github : https://github.com/MonkSoul/Layx/ |
| | | * author : 百小僧/MonkSoul |
| | | * version : v2.5.4 |
| | | * create time : 2018.05.11 |
| | | * update time : 2018.11.03 |
| | | */ |
| | | *[class^="layx-"]{box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;margin:0;padding:0;outline:none;border:none;background-color:transparent}.layx-flexbox{display:-webkit-box;display:-ms-flexbox;display:flex;display:-webkit-flex}.layx-flex-vertical{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-items:center;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-justify-content:flex-start}.layx-flex-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-justify-content:center}.layx-flexauto{flex:1;-webkit-box-flex:1;-moz-box-flex:1;-webkit-flex:1;-ms-flex:1}.layx-shade,#layx-window-move{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:transparent}body.ilayx-body{overflow:hidden !important}.layx-window{position:fixed;overflow:visible !important;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;color:#000;-webkit-tap-highlight-color:rgba(0,0,0,0);visibility:visible;border:none}.layx-window.layx-flicker{animation-name:layx-flicker;-webkit-animation-name:layx-flicker;-moz-animation-name:layx-flicker;animation-duration:.12s;-webkit-animation-duration:.12s;-moz-animation-duration:.12s;animation-iteration-count:8;-webkit-animation-iteration-count:8;-moz-animation-iteration-count:8}.layx-window.layx-max-statu,.layx-window.layx-max-statu .layx-control-bar,.layx-window.layx-max-statu .layx-main,.layx-window.layx-max-statu .layx-statu-bar{border-radius:0 !important;-webkit-border-radius:0 !important;-moz-border-radius:0 !important}.layx-window.layx-min-statu{min-height:0 !important;overflow:hidden !important;min-width:0 !important}.layx-window.layx-min-statu .layx-title{overflow:hidden !important}.layx-window.layx-min-statu .layx-inlay-menus .layx-stick-menu,.layx-window.layx-min-statu .layx-inlay-menus .layx-debug-menu{display:none}.layx-window.layx-bubble-type{overflow:visible !important;position:absolute !important}.layx-window.layx-hide-statu{display:none !important}.layx-control-bar{min-height:30px;overflow:hidden;width:100%;padding-left:5px}.layx-iconfont{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden;font-size:14px;line-height:normal;display:block;line-height:normal}.layx-icon{text-align:center}.layx-icon *{pointer-events:none}.layx-left-bar{margin-right:5px}.layx-window-icon{-webkit-tap-highlight-color:rgba(0,0,0,0)}.layx-window-icon .layx-iconfont{font-size:16px}.layx-title,.layx-group-tab{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:5px;min-width:0;-ms-touch-action:none;touch-action:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.layx-title{-webkit-app-region:drag}.layx-group-tab{-webkit-app-region:no-drag}.layx-title .layx-label,.layx-group-title .layx-label{line-height:normal;font-size:14px;max-width:100%;-webkit-line-clamp:1;-webkit-box-orient:vertical;word-wrap:break-word;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;display:inline-block;pointer-events:none;visibility:visible;position:relative;top:-1px;top:0px\0}.layx-group-tab .layx-label{line-height:28px}.layx-group-tab.layx-type-group{overflow:visible;margin-right:0;border-bottom:1px solid #ddd}.layx-control-bar.layx-type-group{overflow:visible;border-bottom:1px solid #ddd}.layx-group-title{height:27px;line-height:25px;max-width:150px;width:150px;padding:0 8px;background-color:#f5f5f5;border:1px solid #ddd;border-width:1px 1px 0 0;position:relative;color:#666;white-space:nowrap;min-width:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.layx-title.layx-type-group .layx-group-title{height:30px;line-height:34px}.layx-title.layx-type-group{overflow:visible}.layx-title.layx-type-group .layx-group-title:first-child{border-left:1px solid #ddd}.layx-group-title[data-enable="1"]{background-color:#fff;color:#000}.layx-group-title[data-enable="1"]::after{position:absolute;top:0;right:0;bottom:0;left:0;height:100%;width:100%;content:'';border-bottom:1px solid #fff}.layx-inlay-menus{height:100%;height:30px;line-height:30px;position:relative;max-height:30px;z-index:2}.layx-inlay-menus .layx-icon{width:45px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.layx-inlay-menus .layx-icon:hover{background-color:#e5e5e5}.layx-inlay-menus .layx-icon.layx-destroy-menu:hover{background-color:#e81123 !important;color:#fff !important}.layx-inlay-menus .layx-icon.layx-stick-menu[data-enable='1']{color:#f00}.layx-main{overflow:auto;position:relative;clear:both;-webkit-overflow-scrolling:touch;-webkit-transform:translate3d(0,0,0);-webkit-app-region:no-drag}.layx-readonly{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background:transparent;z-index:199205270356}.layx-group-main{position:absolute;top:0;right:0;bottom:0;left:0;height:100%;width:100%;z-index:0;visibility:hidden;overflow:auto;-webkit-overflow-scrolling:touch;-webkit-transform:translate3d(0,0,0)}.layx-group-main[data-enable="1"]{z-index:1;visibility:visible}.layx-mouse-preventDefault{position:absolute;z-index:3;height:100%;width:100%;left:0;top:0;right:0;bottom:0;overflow:hidden;background-color:transparent}.layx-content-shade{position:absolute;z-index:2;width:100%;height:100%;left:0;right:0;bottom:0;top:0;overflow:hidden;background-color:#fff}.layx-html{width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;-webkit-overflow-scrolling:touch;-webkit-transform:translate3d(0,0,0);overflow:auto}.layx-dialog-icon{margin-right:10px;position:relative;top:-5px}.layx-dialog-icon .layx-iconfont{font-size:40px !important}.layx-dialog-msg .layx-dialog-icon .layx-iconfont,.layx-dialog-tip .layx-dialog-icon .layx-iconfont{font-size:25px !important}.layx-dialog-msg .layx-dialog-icon,.layx-dialog-tip .layx-dialog-icon{top:0}.layx-dialog-icon-success{color:#01aaed}.layx-dialog-icon-warn{color:#ffb800}.layx-dialog-icon-error{color:#f00}.layx-dialog-icon-help{color:#009688}.layx-dialog-msg,.layx-dialog-tip,.layx-dialog-load{color:#000;padding:10px}.layx-dialog-alert,.layx-dialog-confirm,.layx-dialog-prompt{padding:10px;color:#039}.layx-dialog-prompt{width:100%}.layx-dialog-msg,.layx-dialog-tip{height:100%}.layx-dialog-content{font-size:14px}.layx-textarea{display:block;border:1px solid #ddd;width:100%;resize:none;height:60px;margin-top:8px;padding:8px;font-size:15px;color:#000;line-height:1.5}.layx-textarea:focus{border:1px solid #3baced}.layx-buttons{padding:8px 10px;text-align:right}.layx-button-item{padding:0 16px;height:24px;line-height:normal;color:#000;font-size:14px;border:1px solid #adadad;outline:none;margin-left:8px;display:inline-block;background-color:#e1e1e1;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.layx-buttons .layx-button-item:hover{background-color:#e5f1fb;border:1px solid #0078d7}.layx-buttons .layx-button-item[disabled]{color:#999;cursor:not-allowed}.layx-buttons .layx-button-item[disabled]:hover{background-color:#e1e1e1;border:1px solid #adadad}.layx-iframe{width:1px;min-width:100%;*width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}.layx-statu-bar{border-top:1px solid #ddd;min-height:25px;background-color:#eeeef2}.layx-resizes[data-enable='0']{visibility:hidden}.layx-resizes>div{position:absolute;z-index:3;-ms-touch-action:none;touch-action:none}.layx-resize-top,.layx-resize-bottom{height:3px;left:3px;right:3px}.layx-resize-top{top:0;cursor:n-resize}.layx-resize-bottom{bottom:0;cursor:s-resize}.layx-resize-left,.layx-resize-right{width:3px;top:3px;bottom:3px}.layx-resize-left{left:0;cursor:w-resize}.layx-resize-right{right:0;cursor:e-resize}.layx-resize-left-top,.layx-resize-right-top,.layx-resize-left-bottom,.layx-resize-right-bottom{width:3px;height:3px}.layx-resize-left-top{left:0;top:0;cursor:nw-resize}.layx-resize-right-top{right:0;top:0;cursor:ne-resize}.layx-resize-left-bottom{left:0;bottom:0;cursor:sw-resize}.layx-resize-right-bottom{right:0;bottom:0;cursor:se-resize}.layx-resize-top.layx-reisize-touch,.layx-resize-bottom.layx-reisize-touch{height:16px;left:16px;right:16px}.layx-resize-left.layx-reisize-touch,.layx-resize-right.layx-reisize-touch{width:16px;top:16px;bottom:16px}.layx-resize-left-top.layx-reisize-touch,.layx-resize-right-top.layx-reisize-touch,.layx-resize-left-bottom.layx-reisize-touch,.layx-resize-right-bottom.layx-reisize-touch{width:16px;height:16px}.layx-resize-top.layx-reisize-touch{top:-8px}.layx-resize-bottom.layx-reisize-touch{bottom:-8px}.layx-resize-left.layx-reisize-touch{left:-8px}.layx-resize-right.layx-reisize-touch{right:-8px}.layx-resize-left-top.layx-reisize-touch{left:-8px;top:-8px}.layx-resize-right-top.layx-reisize-touch{right:-8px;top:-8px}.layx-resize-left-bottom.layx-reisize-touch{left:-8px;bottom:-8px}.layx-resize-right-bottom.layx-reisize-touch{right:-8px;bottom:-8px}.layx-resize-left[data-enable='0'],.layx-resize-top[data-enable='0'],.layx-resize-right[data-enable='0'],.layx-resize-bottom[data-enable='0'],.layx-resize-left-top[data-enable='0'],.layx-resize-left-bottom[data-enable='0'],.layx-resize-right-top[data-enable='0'],.layx-resize-right-bottom[data-enable='0']{visibility:hidden}.layx-auto-destroy-tip{position:absolute;bottom:3px;right:3px;height:25px;line-height:25px;z-index:5;color:#444;background-color:#f1f1f1;padding:0 8px;font-size:13px}.layx-code{border:1px solid #dedede;border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;padding:10px;width:100%;height:100%;-webkit-overflow-scrolling:touch;-webkit-transform:translate3d(0,0,0);background:#f5f5f5;overflow:auto}.layx-bubble,.layx-bubble-inlay{position:absolute;width:0;height:0}.layx-bubble-bottom{top:-11px;left:2px;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:11px solid transparent}.layx-bubble-inlay-bottom{top:2px;left:-9px;border-left:9px solid transparent;border-right:9px solid transparent;border-bottom:9px solid transparent}.layx-bubble-top{bottom:-11px;left:2px;border-left:10px solid transparent;border-right:10px solid transparent;border-top:11px solid transparent}.layx-bubble-inlay-top{bottom:2px;left:-9px;border-left:9px solid transparent;border-right:9px solid transparent;border-top:9px solid transparent}.layx-bubble-right{top:2px;left:-11px;border-top:10px solid transparent;border-bottom:10px solid transparent;border-right:11px solid transparent}.layx-bubble-inlay-right{top:-9px;left:2px;border-top:9px solid transparent;border-bottom:9px solid transparent;border-right:9px solid transparent}.layx-bubble-left{top:2px;right:-11px;border-top:10px solid transparent;border-bottom:10px solid transparent;border-left:11px solid transparent}.layx-bubble-inlay-left{top:-9px;right:2px;border-top:9px solid transparent;border-bottom:9px solid transparent;border-left:9px solid transparent}.layx-pre{height:auto;width:100%;font-size:14px;font-family:Arial;border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;display:block;font-family:Arial}.layx-dot{display:inline-block;width:25px}.layx-load-animate{width:32px;height:32px;position:relative;margin-right:10px}.layx-load-inner,.layx-load-inner2{position:absolute;width:100%;height:100%;border-radius:40px;-webkit-border-radius:40px;-moz-border-radius:40px;overflow:hidden;left:0;top:0}.layx-load-inner{opacity:1;background-color:#89abdd;-webkit-animation:layx-second-half-hide 1.6s steps(1,end) infinite;animation:layx-second-half-hide 1.6s steps(1,end) infinite;-moz-animation:layx-second-half-hide 1.6s steps(1,end) infinite}.layx-load-inner2{opacity:0;background-color:#4b86db;-webkit-animation:layx-second-half-show 1.6s steps(1,end) infinite;animation:layx-second-half-show 1.6s steps(1,end) infinite;-moz-animation:layx-second-half-show 1.6s steps(1,end) infinite}.layx-load-spiner,.layx-load-filler,.layx-load-masker{position:absolute;width:50%;height:100%}.layx-load-spiner{border-radius:40px 0 0 40px;-webkit-border-radius:40px 0 0 40px;-moz-border-radius:40px 0 0 40px;background-color:#4b86db;-webkit-transform-origin:right center;-ms-transform-origin:right center;transform-origin:right center;-moz-transform-origin:right center;-webkit-animation:layx-spin 800ms infinite linear;animation:layx-spin 800ms infinite linear;-moz-animation:layx-spin 800ms infinite linear;left:0;top:0}.layx-load-filler{border-radius:0 40px 40px 0;-webkit-border-radius:0 40px 40px 0;-moz-border-radius:0 40px 40px 0;background-color:#4b86db;-webkit-animation:layx-second-half-hide 800ms steps(1,end) infinite;animation:layx-second-half-hide 800ms steps(1,end) infinite;-moz-animation:layx-second-half-hide 800ms steps(1,end) infinite;left:50%;top:0;opacity:1}.layx-load-masker{border-radius:40px 0 0 40px;-moz-border-radius:40px 0 0 40px;-webkit-border-radius:40px 0 0 40px;background-color:#89abdd;-webkit-animation:layx-second-half-show 800ms steps(1,end) infinite;animation:layx-second-half-show 800ms steps(1,end) infinite;-moz-animation:layx-second-half-show 800ms steps(1,end) infinite;left:0;top:0;opacity:0}.layx-load-inner2 .layx-load-spiner,.layx-load-inner2 .layx-load-filler{background-color:#89abdd}.layx-load-inner2 .layx-load-masker{background-color:#4b86db}.layx-window.layx-skin-default{border:1px solid #3baced}.layx-window.layx-skin-default .layx-control-bar{background-color:#fff}.layx-window.layx-skin-cloud .layx-control-bar{background-color:#ecf0f1}.layx-window.layx-skin-cloud .layx-inlay-menus .layx-icon:hover{background-color:#bdc3c7}.layx-window.layx-skin-cloud .layx-button-item{background-color:#ecf0f1;border:1px solid #ccc}.layx-window.layx-skin-cloud .layx-button-item:hover{background-color:#bdc3c7;color:#fff;border:1px solid #ecf0f1}.layx-window.layx-skin-turquoise .layx-control-bar{background-color:#1abc9c;color:#fff}.layx-window.layx-skin-turquoise .layx-inlay-menus .layx-icon:hover{background-color:#16a085}.layx-window.layx-skin-turquoise .layx-button-item{background-color:#1abc9c;color:#fff;border:1px solid #1abc9c}.layx-window.layx-skin-turquoise .layx-button-item:hover{background-color:#16a085;border:1px solid #1abc9c}.layx-window.layx-skin-river .layx-control-bar{background-color:#3498db;color:#fff}.layx-window.layx-skin-river .layx-inlay-menus .layx-icon:hover{background-color:#2980b9}.layx-window.layx-skin-river .layx-button-item{background-color:#3498db;color:#fff;border:1px solid #3498db}.layx-window.layx-skin-river .layx-button-item:hover{background-color:#2980b9;border:1px solid #3498db}.layx-window.layx-skin-asphalt .layx-control-bar{background-color:#34495e;color:#fff}.layx-window.layx-skin-asphalt .layx-inlay-menus .layx-icon:hover{background-color:#2c3e50}.layx-window.layx-skin-asphalt .layx-button-item{background-color:#34495e;color:#fff;border:1px solid #34495e}.layx-window.layx-skin-asphalt .layx-button-item:hover{background-color:#2c3e50;border:1px solid #34495e}@keyframes layx-flicker{from{-webkit-box-shadow:1px 1px 24px rgba(0,0,0,.3);box-shadow:1px 1px 24px rgba(0,0,0,.3);-moz-box-shadow:1px 1px 24px rgba(0,0,0,.3)}to{-webkit-box-shadow:1px 1px 12px rgba(0,0,0,.3);box-shadow:1px 1px 12px rgba(0,0,0,.3);-moz-box-shadow:1px 1px 12px rgba(0,0,0,.3)}}@-webkit-keyframes layx-flicker{from{-webkit-box-shadow:1px 1px 24px rgba(0,0,0,.3);box-shadow:1px 1px 24px rgba(0,0,0,.3);-moz-box-shadow:1px 1px 24px rgba(0,0,0,.3)}to{-webkit-box-shadow:1px 1px 12px rgba(0,0,0,.3);box-shadow:1px 1px 12px rgba(0,0,0,.3);-moz-box-shadow:1px 1px 12px rgba(0,0,0,.3)}}@-webkit-keyframes layx-spin{0%{-webkit-transform:rotate(360deg);transform:rotate(360deg);-moz-transform:rotate(360deg)}100%{-webkit-transform:rotate(0deg);transform:rotate(0deg);-moz-transform:rotate(0deg)}}@keyframes layx-spin{0%{-webkit-transform:rotate(360deg);transform:rotate(360deg);-moz-transform:rotate(360deg)}100%{-webkit-transform:rotate(0deg);transform:rotate(0deg);-moz-transform:rotate(0deg)}}@-webkit-keyframes layx-second-half-hide{0%{opacity:1}50%,100%{opacity:0}}@keyframes layx-second-half-hide{0%{opacity:1}50%,100%{opacity:0}}@-webkit-keyframes layx-second-half-show{0%{opacity:0}50%,100%{opacity:1}}@keyframes layx-second-half-show{0%{opacity:0}50%,100%{opacity:1}} |
New file |
| | |
| | | /*! |
| | | * file : layx.js |
| | | * gitee : https://gitee.com/monksoul/LayX |
| | | * github : https://github.com/MonkSoul/Layx/ |
| | | * author : 百小僧/MonkSoul |
| | | * version : v2.5.4 |
| | | * create time : 2018.05.11 |
| | | * update time : 2018.11.03 |
| | | */ |
| | | !function(n,t){var r={version:"2.5.4",defaults:{id:"",icon:!0,title:"",width:800,height:600,minWidth:200,minHeight:200,position:"ct",storeStatus:!0,control:!0,style:"",controlStyle:"",existFlicker:!0,bgColor:"#fff",shadow:!0,border:!0,borderRadius:"3px",skin:"default",type:"html",focusToReveal:!0,enableDomainFocus:!0,dialogType:"",frames:[],frameIndex:0,preload:1,mergeTitle:!0,content:"",dialogIcon:!1,cloneElementContent:!0,url:"",useFrameTitle:!1,opacity:1,escKey:!0,floatTarget:!1,floatDirection:"bottom",shadable:!1,shadeDestroy:!1,readonly:!1,loadingText:"内容正在加载中,请稍后",dragInTopToMax:!0,isOverToMax:!0,stickMenu:!1,stickable:!0,minMenu:!0,minable:!0,maxMenu:!0,maxable:!0,closeMenu:!0,closable:!0,debugMenu:!1,restorable:!0,resizable:!0,autodestroy:!1,autodestroyText:"此窗口将在 <strong>{second}<\/strong> 秒内自动关闭.",resizeLimit:{t:!1,r:!1,b:!1,l:!1,lt:!1,rt:!1,lb:!1,rb:!1},buttonKey:"enter",buttons:[],movable:!0,moveLimit:{vertical:!1,horizontal:!1,leftOut:!0,rightOut:!0,topOut:!0,bottomOut:!0},focusable:!0,alwaysOnTop:!1,allowControlDbclick:!0,statusBar:!1,statusBarStyle:"",event:{onload:{before:function(){},after:function(){}},onmin:{before:function(){},after:function(){}},onmax:{before:function(){},after:function(){}},onrestore:{before:function(){},after:function(){}},ondestroy:{before:function(){},after:function(){}},onvisual:{before:function(){},after:function(){}},onmove:{before:function(){},progress:function(){},after:function(){}},onresize:{before:function(){},progress:function(){},after:function(){}},onfocus:function(){},onexist:function(){},onswitch:{before:function(){},after:function(){}},onstick:{before:function(){},after:function(){}}}},defaultButtons:{label:"确定",callback:function(){},id:"",classes:[],style:""},defaultFrames:{id:"",title:"",type:"html",url:"",content:"",useFrameTitle:!1,cloneElementContent:!0,bgColor:"#fff"},zIndex:1e7,windows:{},stickZIndex:2e7,prevFocusId:null,focusId:null,create:function(n){var s=this,e=layxDeepClone({},s.defaults,n||{}),o={},ct,lt,at,h,vi,yi,d,rt,ut,ft,ki,yt,oi,pi,l,p,pt,wt,v,bt,g,y,si,kt,wi,et,ot,k,nt,tt,st,a,hi,dt,vt,gi,c,b,ht,bi,ci,li,w,gt,ni,ti,ii,ri,ui,fi,ei,it,di,ai;if(!e.id){console.error("窗口id不能为空且唯一");return}if(r.prevFocusId=r.focusId,r.focusId=e.id,ct=s.windows[e.id],ct){if(ct.status==="min"&&s.restore(ct.id),ct.existFlicker===!0&&s.flicker(e.id),i.isFunction(e.event.onexist))e.event.onexist(ct.layxWindow,ct);return ai=setInterval(function(){e.id!==r.focusId?s.updateZIndex(e.id):clearInterval(ai)},0),ct}if(i.isArray(e.frames))for(c=0;c<e.frames.length;c++)if(e.frames[c]=layxDeepClone({},s.defaultFrames,e.frames[c]),!e.frames[c].id){console.error("窗口组窗口id不能为空且窗口组内唯一");return}if(i.isArray(e.buttons))for(c=0;c<e.buttons.length;c++)e.buttons[c]=layxDeepClone({},s.defaultButtons,e.buttons[c]);if((e.shadable===!0||/^(0(\.[0-9])?$)|(1)$/.test(e.shadable))&&(lt=document.createElement("div"),lt.setAttribute("id","layx-"+e.id+"-shade"),lt.classList.add("layx-shade"),lt.style.zIndex=e.alwaysOnTop===!0?++s.stickZIndex:++s.zIndex,/^(0(\.[0-9])?$)|(1)$/.test(e.shadable)&&(lt.style.backgroundColor="rgba(0,0,0,"+e.shadable+")"),lt.oncontextmenu=function(n){return n=n||window.event,n.returnValue=!1,!1},lt.onclick=function(n){n=n||window.event;e.shadeDestroy===!0?s.destroy(e.id,null,!0):e.existFlicker===!0&&s.flicker(e.id);n.stopPropagation()},document.body.appendChild(lt)),e.style&&(at=document.getElementById("layx-style"),at?at.innerHTML+=e.style:(at=document.createElement("style"),at.setAttribute("id","layx-style"),at.type="text/css",at.innerHTML=e.style,document.getElementsByTagName("HEAD").item(0).appendChild(at))),h=document.createElement("div"),h.setAttribute("id","layx-"+e.id),h.classList.add("layx-window"),h.classList.add("layx-flexbox"),h.classList.add("layx-skin-"+e.skin),e.shadow===!0&&(h.style.setProperty("box-shadow","1px 1px 24px rgba(0, 0, 0, .3)"),h.style.setProperty("-moz-box-shadow","1px 1px 24px rgba(0, 0, 0, .3)"),h.style.setProperty("-webkit-box-shadow","1px 1px 24px rgba(0, 0, 0, .3)")),vi=i.compileLayxWidthOrHeight("width",e.minWidth,s.defaults.minWidth),yi=i.compileLayxWidthOrHeight("height",e.minHeight,s.defaults.minHeight),d=i.compileLayxWidthOrHeight("width",e.width,s.defaults.width),rt=i.compileLayxWidthOrHeight("height",e.height,s.defaults.height),d=Math.max(d,vi),rt=Math.max(rt,yi),ki=i.compileLayxPosition(d,rt,e.position),ut=ki.top,ft=ki.left,ut=Math.max(ut,0),ut=Math.min(t.innerHeight-15,ut),ft=Math.max(ft,-(d-15)),ft=Math.min(ft,t.innerWidth-15),e.storeStatus===!0&&e.floatTarget===!1?(yt=s.getStoreWindowAreaInfo(e.id),yt?(d=yt.width,rt=yt.height,ut=yt.top,ft=yt.left):s.storeWindowAreaInfo(e.id,{width:d,height:rt,top:ut,left:ft})):s.removeStoreWindowAreaInfo(e.id),i.isDom(e.floatTarget)&&(h.classList.add("layx-bubble-type"),oi=document.createElement("div"),oi.classList.add("layx-bubble"),oi.classList.add("layx-bubble-"+e.floatDirection),h.appendChild(oi),pi=document.createElement("div"),pi.classList.add("layx-bubble-inlay"),pi.classList.add("layx-bubble-inlay-"+e.floatDirection),oi.appendChild(pi)),h.style.zIndex=e.alwaysOnTop===!0?++s.stickZIndex:++s.zIndex,h.style.width=d+"px",h.style.height=rt+"px",h.style.minWidth=vi+"px",h.style.minHeight=yi+"px",h.style.top=ut+"px",h.style.left=ft+"px",h.style.setProperty("border",i.isBoolean(e.border)?e.skin==="default"&&e.border===!0?"":"none":e.border),h.style.backgroundColor=e.bgColor,h.style.setProperty("border-radius",e.borderRadius),h.style.setProperty("-moz-border-radius",e.borderRadius),h.style.setProperty("-webkit-border-radius",e.borderRadius),h.style.opacity=/^(0(\.[0-9])?$)|(1)$/.test(e.opacity)?e.opacity:1,e.focusable===!0&&(h.onclick=function(n){if(n=n||window.event,i.isFunction(e.event.onfocus)){var t=i.isFunction(e.event.onfocus);if(t===!1)return;e.event.onfocus(h,o)}s.updateZIndex(e.id)}),document.body.appendChild(h),l=h.currentStyle?h.currentStyle:t.getComputedStyle(h,null),o.id=e.id,o.title=e.title,o.layxWindowId=h.getAttribute("id"),o.layxWindow=h,o.createDate=new Date,o.status="normal",o.type=e.type,o.buttons=e.buttons,o.frames=e.frames,o.useFrameTitle=e.useFrameTitle,o.cloneElementContent=e.cloneElementContent,o.storeStatus=e.storeStatus,o.url=e.url,o.content=e.content,o.escKey=e.escKey,o.focusToReveal=e.focusToReveal,o.dialogType=e.dialogType,o.enableDomainFocus=e.enableDomainFocus,o.buttonKey=e.buttonKey,o.existFlicker=e.existFlicker,o.groupCurrentId=i.isArray(e.frames)&&e.frames.length>0&&e.frames[e.frameIndex]?e.frames[e.frameIndex].id:null,o.area={width:d,height:rt,minWidth:vi,minHeight:yi,top:ut,left:ft},o.border=e.border,o.control=e.control,o.isFloatTarget=i.isDom(e.floatTarget),o.floatTarget=e.floatTarget,o.floatDirection=e.floatDirection,o.loadingText=e.loadingText,o.focusable=e.focusable,o.isStick=e.alwaysOnTop===!0,o.zIndex=e.alwaysOnTop===!0?s.stickZIndex:s.zIndex,o.movable=e.movable,o.moveLimit=e.moveLimit,o.resizable=e.resizable,o.resizeLimit=e.resizeLimit,o.stickable=e.stickable,o.minable=e.minable,o.maxable=e.maxable,o.restorable=e.restorable,o.closable=e.closable,o.skin=e.skin,o.event=e.event,o.dragInTopToMax=e.dragInTopToMax,s.windows[e.id]=o,e.control===!0){if(p=document.createElement("div"),p.classList.add("layx-control-bar"),p.classList.add("layx-flexbox"),p.style.setProperty("border-radius",l.borderRadius+" "+l.borderRadius+" 0 0"),p.style.setProperty("-moz-border-radius",l.borderRadius+" "+l.borderRadius+" 0 0"),p.style.setProperty("-webkit-border-radius",l.borderRadius+" "+l.borderRadius+" 0 0"),e.controlStyle&&p.setAttribute("style",e.controlStyle),e.type==="group"&&e.mergeTitle===!0&&p.classList.add("layx-type-group"),h.appendChild(p),e.icon!==!1&&(pt=document.createElement("div"),pt.classList.add("layx-left-bar"),pt.classList.add("layx-flexbox"),pt.classList.add("layx-flex-vertical"),p.appendChild(pt),wt=document.createElement("div"),wt.classList.add("layx-icon"),wt.classList.add("layx-window-icon"),wt.innerHTML=e.icon===!0?'<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-default-icon"><\/use><\/svg>':e.icon,e.icon===!0&&(wt.ondblclick=function(n){n=n||window.event;s.destroy(e.id,null,!0);n.stopPropagation()}),pt.appendChild(wt)),v=document.createElement("div"),v.classList.add("layx-title"),v.classList.add("layx-flexauto"),v.classList.add("layx-flexbox"),v.classList.add("layx-flex-vertical"),e.type==="group"&&e.mergeTitle===!0&&v.classList.add("layx-type-group"),e.allowControlDbclick===!0&&(v.ondblclick=function(n){n=n||window.event;e.restorable===!0&&s.restore(e.id);n.stopPropagation()}),e.movable===!0&&i.isDom(e.floatTarget)==!1&&new f(v),p.appendChild(v),e.type!=="group")g=document.createElement("label"),g.classList.add("layx-label"),g.innerHTML=e.useFrameTitle===!0?"":e.title,v.setAttribute("title",g.innerText),v.appendChild(g);else if(i.isArray(e.frames))for(e.mergeTitle===!1&&(bt=document.createElement("div"),bt.classList.add("layx-group-tab"),bt.classList.add("layx-flexbox"),bt.classList.add("layx-type-group"),h.appendChild(bt),g=document.createElement("label"),g.classList.add("layx-label"),g.innerHTML=e.useFrameTitle===!0?"":e.title,v.setAttribute("title",g.innerText),v.appendChild(g)),c=0;c<e.frames.length;c++)b=layxDeepClone({},s.defaultFrames,e.frames[c]),y=document.createElement("div"),y.setAttribute("data-frameId",b.id),y.classList.add("layx-group-title"),y.classList.add("layx-flexauto"),y.classList.add("layx-flex-vertical"),c===e.frameIndex&&y.setAttribute("data-enable","1"),i.isSupportTouch?(y.ontouchstart=function(n){n=n||window.event;s._setGroupIndex(e.id,this)},i.IsPC()&&(y.onclick=function(n){n=n||window.event;s._setGroupIndex(e.id,this);n.stopPropagation()})):y.onclick=function(n){n=n||window.event;s._setGroupIndex(e.id,this);n.stopPropagation()},e.mergeTitle===!1?bt.appendChild(y):v.appendChild(y),si=document.createElement("label"),si.classList.add("layx-label"),si.innerHTML=b.title,y.setAttribute("title",si.innerText),y.appendChild(si);kt=document.createElement("div");kt.classList.add("layx-right-bar");kt.classList.add("layx-flexbox");p.appendChild(kt);wi=document.createElement("div");wi.classList.add("layx-custom-menus");wi.classList.add("layx-flexbox");kt.appendChild(wi);(e.stickMenu===!0||e.minMenu===!0||e.maxMenu===!0||e.closeMenu===!0||e.debugMenu===!0)&&(et=document.createElement("div"),et.classList.add("layx-inlay-menus"),et.classList.add("layx-flexbox"),kt.appendChild(et),i.isDom(e.floatTarget)||(e.debugMenu===!0&&(ot=document.createElement("div"),ot.classList.add("layx-icon"),ot.classList.add("layx-flexbox"),ot.classList.add("layx-flex-center"),ot.classList.add("layx-debug-menu"),ot.setAttribute("title","调试信息"),ot.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-debug"><\/use><\/svg>',ot.onclick=function(n){n=n||window.event;var t=JSON.stringify(o,null,4).replace(/</g,"<").replace(/>/g,">");s.create({id:"layx-"+e.id+"-debug",title:"窗口调试信息",width:300,height:300,content:'<div class="layx-padding" style="padding:10px;height:100%;overflow:hidden;"><div class="layx-code"><pre class="layx-pre">'+t+"<\/pre><\/div><\/div>",shadable:!0,debugMenu:!1,minMenu:!1,minable:!1,position:[h.offsetTop+10,h.offsetLeft+10],storeStatus:!1})},et.appendChild(ot)),(e.stickMenu===!0||e.alwaysOnTop===!0&&e.stickMenu)&&(k=document.createElement("div"),k.classList.add("layx-icon"),k.classList.add("layx-flexbox"),k.classList.add("layx-flex-center"),k.classList.add("layx-stick-menu"),e.alwaysOnTop===!0?k.setAttribute("title","取消置顶"):k.setAttribute("title","置顶"),e.alwaysOnTop===!0&&k.setAttribute("data-enable","1"),k.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-stick"><\/use><\/svg>',e.stickable===!0&&(k.onclick=function(n){n=n||window.event;s.stickToggle(e.id)}),et.appendChild(k)),e.minMenu===!0&&(nt=document.createElement("div"),nt.classList.add("layx-icon"),nt.classList.add("layx-flexbox"),nt.classList.add("layx-flex-center"),nt.classList.add("layx-min-menu"),nt.setAttribute("title","最小化"),nt.setAttribute("data-menu","min"),nt.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-min"><\/use><\/svg>',nt.onclick=function(n){n=n||window.event;this.classList.contains("layx-restore-menu")?e.restorable===!0&&s.restore(e.id):e.minable===!0&&s.min(e.id)},et.appendChild(nt)),e.maxMenu===!0&&(tt=document.createElement("div"),tt.classList.add("layx-icon"),tt.classList.add("layx-flexbox"),tt.classList.add("layx-flex-center"),tt.classList.add("layx-max-menu"),tt.setAttribute("title","最大化"),tt.setAttribute("data-menu","max"),tt.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-max"><\/use><\/svg>',tt.onclick=function(n){n=n||window.event;this.classList.contains("layx-restore-menu")?e.restorable===!0&&s.restore(e.id):e.maxable===!0&&s.max(e.id)},et.appendChild(tt))),e.closeMenu===!0&&(st=document.createElement("div"),st.classList.add("layx-icon"),st.classList.add("layx-flexbox"),st.classList.add("layx-flex-center"),st.classList.add("layx-destroy-menu"),st.setAttribute("title","关闭"),st.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-destroy"><\/use><\/svg>',st.onclick=function(n){n=n||window.event;e.closable===!0&&s.destroy(e.id,null,!0)},et.appendChild(st)))}a=document.createElement("div");a.classList.add("layx-main");a.classList.add("layx-flexauto");e.statusBar||(a.style.setProperty("border-radius","0 0 "+l.borderRadius+" "+l.borderRadius),a.style.setProperty("-moz-border-radius","0 0 "+l.borderRadius+" "+l.borderRadius),a.style.setProperty("-webkit-border-radius","0 0 "+l.borderRadius+" "+l.borderRadius));h.appendChild(a);e.readonly===!0&&(hi=document.createElement("div"),hi.classList.add("layx-readonly"),hi.oncontextmenu=function(n){return n=n||window.event,n.returnValue=!1,!1},e.focusable===!0&&(hi.onclick=function(n){if(n=n||window.event,i.isFunction(e.event.onfocus)){var t=i.isFunction(e.event.onfocus);if(t===!1)return;e.event.onfocus(h,o)}s.updateZIndex(e.id);n.stopPropagation()}),a.appendChild(hi));switch(e.type){case"html":default:if(i.isFunction(e.event.onload.before)&&(dt=e.event.onload.before(h,o),dt===!1))return;vt=s.createContenLoadAnimate(a,e.loadingText,o);s.createHtmlBody(a,e,e.content);vt&&a.removeChild(vt);o.loadingTextTimer&&(clearInterval(o.loadingTextTimer),delete o.loadingTextTimer);i.isFunction(e.event.onload.after)&&e.event.onload.after(h,o);break;case"url":if(i.isFunction(e.event.onload.before)&&(dt=e.event.onload.before(h,o),dt===!1))return;vt=s.createContenLoadAnimate(a,e.loadingText,o);s.createFrameBody(a,e,h,o);break;case"group":if(i.isArray(e.frames)){if(i.isFunction(e.event.onload.before)&&(dt=e.event.onload.before(h,o),dt===!1))return;for(vt=s.createContenLoadAnimate(a,e.loadingText,o),e.preload=/(^[1-9]\d*$)/.test(e.preload)===!1?!0:Math.min(e.preload,e.frames.length),gi=setInterval(function(){var n=h.querySelectorAll(".layx-group-main[data-complete='1']");(n.length===i.isBoolean(e.preload)?e.frames.length:e.preload)&&(clearInterval(gi),o.loadingTextTimer&&(clearInterval(o.loadingTextTimer),delete o.loadingTextTimer),h.setAttribute("data-group-init","1"),vt&&a.removeChild(vt),i.isFunction(e.event.onload.after)&&e.event.onload.after(h,o))},100),c=0;c<e.frames.length;c++)b=layxDeepClone({},s.defaultFrames,e.frames[c]),ht=document.createElement("div"),ht.classList.add("layx-group-main"),ht.style.backgroundColor=b.bgColor,ht.setAttribute("data-frameId",b.id),c===e.frameIndex&&ht.setAttribute("data-enable","1"),a.appendChild(ht),bi=c===e.frameIndex?!0:i.isBoolean(e.preload)?!0:c+1<=e.preload,b.type==="html"?(s.createHtmlBody(ht,e,b.content,"group",b,bi),bi&&ht.setAttribute("data-complete","1")):b.type==="url"&&s.createFrameBody(ht,e,h,o,"group",b,bi)}}return/(^[1-9]\d*$)/.test(e.autodestroy)&&(ci=e.autodestroy/1e3,e.autodestroyText!==!1&&(li=document.createElement("div"),li.classList.add("layx-auto-destroy-tip"),li.innerHTML=e.autodestroyText.replace("{second}",ci),h.appendChild(li)),o.destroyTimer=setInterval(function(){--ci;e.autodestroyText!==!1&&(li.innerHTML=e.autodestroyText.replace("{second}",ci));ci<=0&&(clearInterval(o.destroyTimer),s.destroy(e.id,null,!0))},1e3)),w=document.createElement("div"),w.classList.add("layx-resizes"),e.resizable===!1&&w.setAttribute("data-enable","0"),h.appendChild(w),gt=document.createElement("div"),gt.classList.add("layx-resize-top"),i.isSupportTouch&>.classList.add("layx-reisize-touch"),e.resizeLimit.t===!0&>.setAttribute("data-enable","0"),new u(gt,!0,!1,!0,!1),w.appendChild(gt),ni=document.createElement("div"),ni.classList.add("layx-resize-left"),i.isSupportTouch&&ni.classList.add("layx-reisize-touch"),e.resizeLimit.l===!0&&ni.setAttribute("data-enable","0"),new u(ni,!1,!0,!1,!0),w.appendChild(ni),ti=document.createElement("div"),ti.classList.add("layx-resize-left-top"),i.isSupportTouch&&ti.classList.add("layx-reisize-touch"),e.resizeLimit.lt===!0&&ti.setAttribute("data-enable","0"),new u(ti,!0,!0,!1,!1),w.appendChild(ti),ii=document.createElement("div"),ii.classList.add("layx-resize-right-top"),i.isSupportTouch&&ii.classList.add("layx-reisize-touch"),e.resizeLimit.rt===!0&&ii.setAttribute("data-enable","0"),new u(ii,!0,!1,!1,!1),w.appendChild(ii),ri=document.createElement("div"),ri.classList.add("layx-resize-left-bottom"),i.isSupportTouch&&ri.classList.add("layx-reisize-touch"),e.resizeLimit.lb===!0&&ri.setAttribute("data-enable","0"),new u(ri,!1,!0,!1,!1),w.appendChild(ri),ui=document.createElement("div"),ui.classList.add("layx-resize-right"),i.isSupportTouch&&ui.classList.add("layx-reisize-touch"),e.resizeLimit.r===!0&&ui.setAttribute("data-enable","0"),new u(ui,!1,!1,!1,!0),w.appendChild(ui),fi=document.createElement("div"),fi.classList.add("layx-resize-bottom"),i.isSupportTouch&&fi.classList.add("layx-reisize-touch"),e.resizeLimit.b===!0&&fi.setAttribute("data-enable","0"),new u(fi,!1,!1,!0,!1),w.appendChild(fi),ei=document.createElement("div"),ei.classList.add("layx-resize-right-bottom"),i.isSupportTouch&&ei.classList.add("layx-reisize-touch"),e.resizeLimit.rb===!0&&ei.setAttribute("data-enable","0"),new u(ei,!1,!1,!1,!1),w.appendChild(ei),e.statusBar&&(it=document.createElement("div"),it.classList.add("layx-statu-bar"),it.style.setProperty("border-radius","0 0 "+l.borderRadius+" "+l.borderRadius),it.style.setProperty("-moz-border-radius","0 0 "+l.borderRadius+" "+l.borderRadius),it.style.setProperty("-webkit-border-radius","0 0 "+l.borderRadius+" "+l.borderRadius),e.statusBarStyle&&it.setAttribute("style",e.statusBarStyle),e.statusBar===!0&&i.isArray(e.buttons)?(di=s.createLayxButtons(e.buttons,e.id,e.dialogType==="prompt"?!0:!1),di&&it.appendChild(di)):i.isDom(e.statusBar)?it.appendChild(e.statusBar):it.innerHTML=e.statusBar,h.appendChild(it)),i.isDom(e.floatTarget)&&s.updateFloatWinPosition(e.id,e.floatDirection),e.isOverToMax===!0&&i.isDom(e.floatTarget)===!1&&(d>window.innerWidth||rt>window.innerHeight)&&s.max(e.id),ai=setInterval(function(){e.id!==r.focusId?s.updateZIndex(e.id):clearInterval(ai)},0),o},updateFloatWinPosition:function(n,r){var l=this,y="layx-"+n,s=document.getElementById(y),u=l.windows[n],e,o,a,v;if(s&&u&&u.isFloatTarget===!0&&(r=["top","bottom","left","right"].indexOf(r)>-1?r:u.floatDirection,e=s.querySelector(".layx-bubble"),o=s.querySelector(".layx-bubble-inlay"),e&&o)){e.classList.remove("layx-bubble-"+u.floatDirection);e.style["border"+u.floatDirection.toFirstUpperCase()+"Color"]="transparent";o.classList.remove("layx-bubble-inlay-"+u.floatDirection);o.style["border"+u.floatDirection.toFirstUpperCase()+"Color"]="transparent";e.classList.add("layx-bubble-"+r);o.classList.add("layx-bubble-inlay-"+r);var f=s.currentStyle?s.currentStyle:t.getComputedStyle(s,null),h=s.querySelector(".layx-control-bar"),c=h&&(h.currentStyle?h.currentStyle:t.getComputedStyle(h,null));u.control===!0&&h&&c?(e.style["border"+r.toFirstUpperCase()+"Color"]=f.borderColor==="rgba(0, 0, 0, 0)"||f.borderColor==="transparent"||!f.borderColor||i.isBoolean(u.border)?u.skin==="default"?"#3baced":c.backgroundColor:f.borderColor,o.style["border"+r.toFirstUpperCase()+"Color"]=c.backgroundColor):(e.style["border"+r.toFirstUpperCase()+"Color"]=f.borderColor==="rgba(0, 0, 0, 0)"||f.borderColor==="transparent"||!f.borderColor||i.isBoolean(u.border)?u.skin==="default"?"#3baced":"#fff":f.borderColor,o.style["border"+r.toFirstUpperCase()+"Color"]=f.backgroundColor);a=i.compilebubbleDirection(r,u.floatTarget,u.area.width,u.area.height);l.setPosition(n,{top:a.top,left:a.left},!0);v=i.getElementPos(u.floatTarget);(r==="top"||r==="bottom")&&(e.style.left=Math.abs(v.x+u.floatTarget.offsetWidth/2-u.layxWindow.offsetLeft-9)+"px");(r==="left"||r==="right")&&(e.style.top=Math.abs(v.y+u.floatTarget.offsetHeight/2-u.layxWindow.offsetTop-9)+"px");(r==="top"||(r==="right"||r==="left")&&u.control===!0&&h&&c&&e.offsetTop>h.offsetHeight)&&(e.style["border"+r.toFirstUpperCase()+"Color"]=f.borderColor==="rgba(0, 0, 0, 0)"||f.borderColor==="transparent"||!f.borderColor||i.isBoolean(u.border)?u.skin==="default"?"#3baced":"#fff":f.borderColor,o.style["border"+r.toFirstUpperCase()+"Color"]=f.backgroundColor);u.floatDirection=r;l.updateFloatWinResize(n,r)}},updateFloatWinResize:function(n,t){var u=this,f="layx-"+n,i=document.getElementById(f),r=u.windows[n];if(i&&r&&r.isFloatTarget===!0){t=["top","bottom","left","right"].indexOf(t)>-1?t:r.floatDirection;switch(t){case"bottom":i.querySelector(".layx-resize-left").setAttribute("data-enable","0");i.querySelector(".layx-resize-top").setAttribute("data-enable","0");i.querySelector(".layx-resize-left-top").setAttribute("data-enable","0");i.querySelector(".layx-resize-left-bottom").setAttribute("data-enable","0");i.querySelector(".layx-resize-right-top").setAttribute("data-enable","0");r.resizeLimit.r===!1&&i.querySelector(".layx-resize-right").removeAttribute("data-enable");r.resizeLimit.b===!1&&i.querySelector(".layx-resize-bottom").removeAttribute("data-enable");r.resizeLimit.rb===!1&&i.querySelector(".layx-resize-right-bottom").removeAttribute("data-enable");break;case"top":i.querySelector(".layx-resize-left").setAttribute("data-enable","0");i.querySelector(".layx-resize-left-top").setAttribute("data-enable","0");i.querySelector(".layx-resize-bottom").setAttribute("data-enable","0");i.querySelector(".layx-resize-left-bottom").setAttribute("data-enable","0");i.querySelector(".layx-resize-right-bottom").setAttribute("data-enable","0");r.resizeLimit.r===!1&&i.querySelector(".layx-resize-right").removeAttribute("data-enable");r.resizeLimit.t===!1&&i.querySelector(".layx-resize-top").removeAttribute("data-enable");r.resizeLimit.rt===!1&&i.querySelector(".layx-resize-right-top").removeAttribute("data-enable");break;case"right":i.querySelector(".layx-resize-left").setAttribute("data-enable","0");i.querySelector(".layx-resize-top").setAttribute("data-enable","0");i.querySelector(".layx-resize-left-top").setAttribute("data-enable","0");i.querySelector(".layx-resize-left-bottom").setAttribute("data-enable","0");i.querySelector(".layx-resize-right-top").setAttribute("data-enable","0");r.resizeLimit.r===!1&&i.querySelector(".layx-resize-right").removeAttribute("data-enable");r.resizeLimit.b===!1&&i.querySelector(".layx-resize-bottom").removeAttribute("data-enable");r.resizeLimit.rb===!1&&i.querySelector(".layx-resize-right-bottom").removeAttribute("data-enable");break;case"left":i.querySelector(".layx-resize-top").setAttribute("data-enable","0");i.querySelector(".layx-resize-right").setAttribute("data-enable","0");i.querySelector(".layx-resize-left-top").setAttribute("data-enable","0");i.querySelector(".layx-resize-right-top").setAttribute("data-enable","0");i.querySelector(".layx-resize-right-bottom").setAttribute("data-enable","0");r.resizeLimit.l===!1&&i.querySelector(".layx-resize-left").removeAttribute("data-enable");r.resizeLimit.b===!1&&i.querySelector(".layx-resize-bottom").removeAttribute("data-enable");r.resizeLimit.lb===!1&&i.querySelector(".layx-resize-left-bottom").removeAttribute("data-enable")}}},removeStoreWindowAreaInfo:function(n){var u=this,i="layx-"+n,r=typeof Storage!="undefined"&&!(t.location.protocol.indexOf("file:")>-1)&&localStorage.getItem(i);r&&localStorage.removeItem(i)},storeWindowAreaInfo:function(n,i){var u=this,r="layx-"+n;typeof Storage=="undefined"||t.location.protocol.indexOf("file:")>-1||localStorage.setItem(r,JSON.stringify(i))},getStoreWindowAreaInfo:function(n){var u=this,r="layx-"+n,i=typeof Storage!="undefined"&&!(t.location.protocol.indexOf("file:")>-1)&&localStorage.getItem(r);return i?JSON.parse(i):null},_setGroupIndex:function(n,t){var s=this,a="layx-"+n,u=document.getElementById(a),r=s.windows[n],h,c,f;if(u&&r&&r.type==="group"&&(h=u.querySelector(".layx-group-title[data-enable='1']"),h!==t)){if(i.isFunction(r.event.onswitch.before)&&(c=r.event.onswitch.before(u,r,h.getAttribute("data-frameId")),c===!1))return;h.removeAttribute("data-enable");t.setAttribute("data-enable","1");var e=t.getAttribute("data-frameId"),l=u.querySelector(".layx-group-main[data-enable='1']"),o=u.querySelector(".layx-group-main[data-frameId='"+e+"']");o!==l&&(l.removeAttribute("data-enable"),o.setAttribute("data-enable","1"),r.groupCurrentId=e,o.getAttribute("data-preload")==="1"&&(f=s.getGroupFrame(r.frames,e),f.type==="url"&&(s.setGroupUrl(n,e,f.url),o.removeAttribute("data-preload")),f.type==="html"&&(s.setGroupContent(n,e,f.content,f.cloneElementContent),o.removeAttribute("data-preload"))));i.isFunction(r.event.onswitch.after)&&r.event.onswitch.after(u,r,t.getAttribute("data-frameId"))}},setGroupIndex:function(n,t){var u=this,f="layx-"+n,i=document.getElementById(f),e=u.windows[n],r;i&&e&&(r=i.querySelector(".layx-group-title[data-frameId='"+t+"']"),r.click())},cloneStore:{},createHtmlBody:function(n,u,f,e,o,s){var v=this,c=document.createElement("div"),h,l,a;c.classList.add("layx-html");c.setAttribute("id","layx-"+u.id+(e==="group"?"-"+o.id+"-":"-")+"html");s!==!1?i.isDom(f)?(l=f.currentStyle?f.currentStyle:t.getComputedStyle(f,null),e!=="group"&&u.cloneElementContent===!1&&(r.cloneStore[u.id]={prev:f.previousSibling,parent:f.parentNode,next:f.nextSibling,display:l.display}),e==="group"&&o.cloneElementContent===!1&&(r.cloneStore[u.id]||(r.cloneStore[u.id]={frames:{}}),r.cloneStore[u.id].frames[o.id]={prev:f.previousSibling,parent:f.parentNode,next:f.nextSibling,display:l.display}),h=c.appendChild((e==="group"?o:u).cloneElementContent===!0?f.cloneNode(!0):f)):c.innerHTML=f:n.setAttribute("data-preload","1");n.appendChild(c);i.isDom(h)&&(a=h.currentStyle?h.currentStyle:t.getComputedStyle(h,null),a.display==="none"&&(h.style.display=""))},frameLoadHandle:function(n,t,u,f,o,s,h,c){var v=this,l=(s==="group"?n.parentNode.parentNode:n.parentNode).querySelector(".layx-content-shade"),a;try{u.focusable===!0&&u.enableDomainFocus===!0&&(n.getAttribute("data-focus")||(e.track(n,function(){if(i.isFunction(u.event.onfocus)){var n=i.isFunction(u.event.onfocus);if(n===!1)return;u.event.onfocus(f,o)}v.updateZIndex(u.id)}),n.setAttribute("data-focus","true")));a=u.title;s==="group"?h.useFrameTitle===!0&&(a=n.contentWindow.document.querySelector("title").innerText,v.setGroupTitle(u.id,h.id,a)):u.useFrameTitle===!0&&(a=n.contentWindow.document.querySelector("title").innerText,v.setTitle(u.id,a));n.contentWindow.document.addEventListener("click",function(n){var r=n||window.event||arguments.callee.caller.arguments[0],t;if(u.focusable===!0){if(i.isFunction(u.event.onfocus)){if(t=i.isFunction(u.event.onfocus),t===!1)return;u.event.onfocus(f,o)}v.updateZIndex(u.id)}},!1);n.contentWindow.document.addEventListener("keydown",function(n){var i=n||window.event||arguments.callee.caller.arguments[0],t=r.windows[r.focusId],u;i&&i.keyCode==27&&t&&r.destroy(r.focusId,{},!1,!0);i&&i.keyCode===13&&t&&t.buttons.length>0&&(t.buttonKey.toLowerCase()!=="enter"||i.ctrlKey?t.buttonKey.toLowerCase()==="ctrl+enter"&&i.ctrlKey&&(t.dialogType!=="prompt"?t.buttons[0].callback(t.id,r.getButton(t.id,t.buttons[0].id,i)):(u=r.getPromptTextArea(t.id),t.buttons[0].callback(t.id,(u?u.value:"").replace(/(^\s*)|(\s*$)/g,""),u,r.getButton(t.id,t.buttons[0].id,i)))):t.dialogType!=="prompt"?t.buttons[0].callback(t.id,r.getButton(t.id,t.buttons[0].id,i)):(u=r.getPromptTextArea(t.id),t.buttons[0].callback(t.id,(u?u.value:"").replace(/(^\s*)|(\s*$)/g,""),u,r.getButton(t.id,t.buttons[0].id,i))))},!1)}catch(y){s==="group"&&l&&l.parentNode.removeChild(l);console.warn(y)}finally{s==="group"?(c&&t.setAttribute("data-complete","1"),f.getAttribute("data-group-init")==="1"&&(o.loadingTextTimer&&(clearInterval(o.loadingTextTimer),delete o.loadingTextTimer),l&&l.parentNode.removeChild(l),i.isFunction(u.event.onload.after)&&u.event.onload.after(f,o))):(l&&l.parentNode.removeChild(l),o.loadingTextTimer&&(clearInterval(o.loadingTextTimer),delete o.loadingTextTimer),i.isFunction(u.event.onload.after)&&u.event.onload.after(f,o))}},createFrameBody:function(n,i,r,u,f,e,o){var h=this,s=document.createElement("iframe");s.setAttribute("id","layx-"+i.id+(f==="group"?"-"+e.id+"-":"-")+"iframe");s.classList.add("layx-iframe");s.classList.add("layx-flexbox");s.setAttribute("allowtransparency","true");s.setAttribute("frameborder","0");t.navigator.userAgent.toLowerCase().indexOf("iphone")>-1||!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?s.setAttribute("scrolling","no"):s.setAttribute("scrolling","auto");s.setAttribute("allowfullscreen","");s.setAttribute("mozallowfullscreen","");s.setAttribute("webkitallowfullscreen","");s.src=o!==!1?(f==="group"?e.url:i.url)||"about:blank":"about:blank";s.attachEvent?s.attachEvent("onreadystatechange",function(){(s.readyState==="complete"||s.readyState=="loaded")&&(s.detachEvent("onreadystatechange",arguments.callee),h.frameLoadHandle(s,n,i,r,u,f,e,o))}):s.addEventListener("load",function(){this.removeEventListener("load",arguments.call,!1);h.frameLoadHandle(s,n,i,r,u,f,e,o)},!1);o===!1&&n.setAttribute("data-preload","1");n.appendChild(s)},setContent:function(n,u,f){var l=this,p="layx-"+n,h=document.getElementById(p),e=l.windows[n],o,a,c,s,v,y;if(h&&e&&e.type==="html"&&(o=h.querySelector("#layx-"+n+"-html"),o)){if(i.isFunction(e.event.onload.before)&&(a=e.event.onload.before(h,e),a===!1))return;try{c=l.createContenLoadAnimate(o.parentNode,e.loadingText,e);f=i.isBoolean(f)?f:e.cloneElementContent;i.isDom(u)?(v=u.currentStyle?u.currentStyle:t.getComputedStyle(u,null),f===!1&&(r.cloneStore[n]={prev:u.previousSibling,parent:u.parentNode,next:u.nextSibling,display:v.display}),o.innerHTML="",s=o.appendChild(f===!0?u.cloneNode(!0):u)):o.innerHTML=u;i.isDom(s)&&(y=s.currentStyle?s.currentStyle:window.getComputedStyle(s,null),y.display==="none"&&(s.style.display=""));e.content=u}finally{c&&o.parentNode.removeChild(c);e.loadingTextTimer&&(clearInterval(e.loadingTextTimer),delete e.loadingTextTimer);i.isFunction(e.event.onload.after)&&e.event.onload.after(h,e)}}},getGroupFrame:function(n,t){for(var r={},i=0;i<n.length;i++)if(n[i].id===t){r=n[i];break}return r},reloadGroupFrame:function(n,t){var i=this,s="layx-"+n,f=document.getElementById(s),r=i.windows[n],e,u,o;f&&r&&r.type==="group"&&(e=i.getGroupFrame(r.frames,t),e.type==="url"&&(u=f.querySelector("#layx-"+n+"-"+t+"-iframe"),u&&(o=u.getAttribute("src"),i.setGroupUrl(n,t,o))))},setGroupContent:function(n,u,f,e){var a=this,b="layx-"+n,c=document.getElementById(b),o=a.windows[n],l,s,y,v,h,p,w;if(c&&o&&o.type==="group"&&(l=a.getGroupFrame(o.frames,u),l.type==="html"&&(s=c.querySelector("#layx-"+n+"-"+u+"-html"),s))){if(i.isFunction(o.event.onload.before)&&(y=o.event.onload.before(c,o),y===!1))return;try{v=a.createContenLoadAnimate(s.parentNode.parentNode,o.loadingText,o);e=i.isBoolean(e)?e:l.cloneElementContent;i.isDom(f)?(p=f.currentStyle?f.currentStyle:t.getComputedStyle(f,null),e===!1&&(r.cloneStore[n]||(r.cloneStore[n]={frames:{}}),r.cloneStore[n].frames[u]={prev:f.previousSibling,parent:f.parentNode,next:f.nextSibling,display:p.display}),s.innerHTML="",h=s.appendChild(e===!0?f.cloneNode(!0):f)):s.innerHTML=f;i.isDom(h)&&(w=h.currentStyle?h.currentStyle:window.getComputedStyle(h,null),w.display==="none"&&(h.style.display=""));l.content=f}finally{v&&s.parentNode.parentNode.removeChild(v);o.loadingTextTimer&&(clearInterval(o.loadingTextTimer),delete o.loadingTextTimer);i.isFunction(o.event.onload.after)&&o.event.onload.after(c,o)}}},createContenLoadAnimate:function(n,t,r,u){var h=this,f,e,s,o;if(t!==!1)return i.isArray(t)&&t.length===2&&t[0]===!0?h.createContenLoadAnimate(n,t[1],r,!1):(f=document.createElement("div"),f.classList.add("layx-content-shade"),f.classList.add("layx-flexbox"),f.classList.add("layx-flex-center"),i.isDom(t)?f.appendChild(t):(u!==!1&&f.appendChild(h.createLoadAnimate()),e=document.createElement("div"),e.classList.add("layx-load-content-msg"),e.innerHTML=t,f.appendChild(e),s=document.createElement("span"),s.classList.add("layx-dot"),e.appendChild(s),o=0,r.loadingTextTimer=setInterval(function(){var n,t;for(o===5&&(o=0),++o,n="",t=0;t<o;t++)n+=".";s.innerHTML=n},200)),n.appendChild(f))},setUrl:function(n,t){var u,o,h;t=t||"about:blank";var e=this,s="layx-"+n,f=document.getElementById(s),r=e.windows[n];if(f&&r&&r.type==="url"&&(u=f.querySelector("#layx-"+n+"-iframe"),u)){if(i.isFunction(r.event.onload.before)&&(o=r.event.onload.before(f,r),o===!1))return;h=e.createContenLoadAnimate(u.parentNode,r.loadingText,r);u.setAttribute("src",t)}},setGroupUrl:function(n,t,r){var s,f,h,l;r=r||"about:blank";var e=this,c="layx-"+n,o=document.getElementById(c),u=e.windows[n];if(o&&u&&u.type==="group"&&(s=e.getGroupFrame(u.frames,t),s.type==="url"&&(f=o.querySelector("#layx-"+n+"-"+t+"-iframe"),f))){if(i.isFunction(u.event.onload.before)&&(h=u.event.onload.before(o,u),h===!1))return;f.parentNode.removeAttribute("data-complete");l=e.createContenLoadAnimate(f.parentNode.parentNode,u.loadingText,u);f.setAttribute("src",r)}},setGroupTitle:function(n,t,i,r){var h=this,l="layx-"+n,e=document.getElementById(l),o=h.windows[n],u,s,c,f;if(e&&o&&o.type==="group"&&(u=e.querySelector(".layx-group-title[data-frameId='"+t+"']"),u)){if(s=h.getGroupFrame(o.frames,t),r===!0&&s.type==="url"){c=e.querySelector("#layx-"+n+"-"+t+"-iframe");try{i=c.contentDocument.querySelector("title").innerText}catch(a){}}f=u.querySelector(".layx-label");f&&(f.innerHTML=i,u.setAttribute("title",f.innerHTML),s.title=i)}},setTitle:function(n,t,i){var s=this,h="layx-"+n,f=document.getElementById(h),e=s.windows[n],r,o,u;if(f&&e&&(r=f.querySelector(".layx-title"),r)){if(i===!0&&e.type==="url"){o=f.querySelector("#layx-"+n+"-iframe");try{t=o.contentDocument.querySelector("title").innerText}catch(c){}}u=r.querySelector(".layx-label");u&&(u.innerHTML=t,r.setAttribute("title",u.innerHTML),e.title=t)}},stickToggle:function(n){var f=this,o="layx-"+n,u=document.getElementById(o),t=f.windows[n],e,r;if(u&&t){if(f.updateZIndex(n),i.isFunction(t.event.onstick.before)&&(e=t.event.onstick.before(u,t),e===!1))return;t.isStick=!t.isStick;r=u.querySelector(".layx-stick-menu");r&&(r.setAttribute("data-enable",t.isStick?"1":"0"),t.isStick?r.setAttribute("title","取消置顶"):r.setAttribute("title","置顶"));f.updateZIndex(n);i.isFunction(t.event.onstick.after)&&t.event.onstick.after(u,t)}},reloadFrame:function(n){var i=this,e="layx-"+n,r=document.getElementById(e),u=i.windows[n],t,f;r&&u&&u.type==="url"&&(t=r.querySelector("#layx-"+n+"-iframe"),t&&(f=t.getAttribute("src"),i.setUrl(n,f)))},restore:function(n){var e=this,c="layx-"+n,t=document.getElementById(c),r=e.windows[n],h,f,u,o,s;if(t&&r){if(r.restorable!==!0)return;if(e.updateZIndex(n),i.isFunction(r.event.onrestore.before)&&(h=r.event.onrestore.before(t,r),h===!1))return;f=r.area;r.status==="normal"?e.max(n):r.status==="max"&&(document.body.classList.contains("ilayx-body")&&document.body.classList.remove("ilayx-body"),t.style.top=f.top+"px",t.style.left=f.left+"px",t.style.width=f.width+"px",t.style.height=f.height+"px",t.classList.remove("layx-max-statu"),r.status="normal",u=t.querySelector(".layx-restore-menu[data-menu='max']"),u&&(u.classList.remove("layx-restore-menu"),u.classList.add("layx-max-menu"),u.setAttribute("title","最大化"),u.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-max"><\/use><\/svg>'),o=t.querySelector(".layx-resizes"),o&&o.removeAttribute("data-enable"));r.status==="min"&&(r.minBefore==="normal"?(t.style.top=f.top+"px",t.style.left=f.left+"px",t.style.width=f.width+"px",t.style.height=f.height+"px",r.status="normal",u=t.querySelector(".layx-restore-menu[data-menu='min']"),u&&(u.classList.remove("layx-restore-menu"),u.classList.add("layx-min-menu"),u.setAttribute("title","最小化"),u.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-min"><\/use><\/svg>'),o=t.querySelector(".layx-resizes"),o&&o.removeAttribute("data-enable")):r.minBefore==="max"&&e.max(n),e.updateMinLayout());s=layxDeepClone({},{},r);delete e.windows[n];e.windows[n]=s;e.updateMinLayout();t.classList.contains("layx-min-statu")&&t.classList.remove("layx-min-statu");i.isFunction(s.event.onrestore.after)&&s.event.onrestore.after(t,s)}},min:function(n){var e=this,c="layx-"+n,r=document.getElementById(c),t=e.windows[n],s,l,u,o,f,h;if(r&&t&&t.isFloatTarget===!1){if(t.minable!==!0||t.status==="min")return;if(e.updateZIndex(n),i.isFunction(t.event.onmin.before)&&(s=t.event.onmin.before(r,t),s===!1))return;l=i.innerArea();t.minBefore=t.status;t.status="min";u=r.querySelector(".layx-min-menu");u&&(u.classList.remove("layx-max-menu"),u.classList.add("layx-restore-menu"),u.setAttribute("title","还原"),u.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-restore"><\/use><\/svg>');o=r.querySelector(".layx-resizes");o&&o.setAttribute("data-enable","0");f=r.querySelector(".layx-restore-menu[data-menu='max']");f&&(f.classList.remove("layx-restore-menu"),f.classList.add("layx-max-menu"),f.setAttribute("title","最大化"),f.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-max"><\/use><\/svg>');r.classList.contains("layx-max-statu")&&r.classList.remove("layx-max-statu");h=layxDeepClone({},t);delete e.windows[n];e.windows[n]=h;e.updateMinLayout();document.body.classList.contains("ilayx-body")&&document.body.classList.remove("ilayx-body");i.isFunction(t.event.onmin.after)&&t.event.onmin.after(r,t)}},updateZIndex:function(n){var i=this,e="layx-"+n,f=document.getElementById(e),t=i.windows[n],u;f&&t&&(t.dialogType!=="load"&&t.dialogType!=="msg"&&(r.focusId=n),t.focusToReveal===!0&&(u=document.getElementById("layx-"+n+"-shade"),u&&(u.style.zIndex=t.isStick===!0?++i.stickZIndex:++i.zIndex),t.zIndex=t.isStick===!0?++i.stickZIndex+1:++i.zIndex+1,f.style.zIndex=t.zIndex))},updateMinLayout:function(){var a=this,s=a.windows,h=i.innerArea(),t=10,r=240,u=0,c=Math.floor(h.width/(r+t)),f,l,n,e,o;for(f in s)l=s[f],n=document.getElementById("layx-"+f),n&&l.status==="min"&&(e=n.querySelector(".layx-control-bar"),e&&(o=e.offsetHeight,n.classList.add("layx-min-statu"),n.style.width=r+"px",n.style.height=o+"px",n.style.top=h.height-(Math.floor(u/c)+1)*(o+10)+"px",n.style.left=u%c*(r+t)+t+"px",u++))},max:function(n){var e=this,l="layx-"+n,t=document.getElementById(l),r=e.windows[n],o=i.innerArea(),h,u,s,f,c;if(t&&r&&r.isFloatTarget===!1){if(r.maxable!==!0)return;if(r.status==="max")t.style.top=0,t.style.left=0,t.style.width=o.width+"px",t.style.height=o.height+"px";else{if(e.updateZIndex(n),i.isFunction(r.event.onmax.before)&&(h=r.event.onmax.before(t,r),h===!1))return;document.body.classList.add("ilayx-body");t.style.top=0;t.style.left=0;t.style.width=o.width+"px";t.style.height=o.height+"px";t.classList.add("layx-max-statu");r.status="max";u=t.querySelector(".layx-max-menu");u&&(u.classList.remove("layx-max-menu"),u.classList.add("layx-restore-menu"),u.setAttribute("title","还原"),u.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-restore"><\/use><\/svg>');s=t.querySelector(".layx-resizes");s&&s.setAttribute("data-enable","0");f=t.querySelector(".layx-restore-menu[data-menu='min']");f&&(f.classList.remove("layx-restore-menu"),f.classList.add("layx-min-menu"),f.setAttribute("title","最小化"),f.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-min"><\/use><\/svg>');c=layxDeepClone({},r);delete e.windows[n];e.windows[n]=c;e.updateMinLayout();t.classList.contains("layx-min-statu")&&t.classList.remove("layx-min-statu");i.isFunction(r.event.onmax.after)&&r.event.onmax.after(t,r)}}},visual:function(n,t,r,u){var o=this,s="layx-"+n,e=document.getElementById(s),c=document.getElementById(s+"-shade"),f=o.windows[n],h;if(e&&f){if(i.isFunction(f.event.onvisual.before)&&(h=f.event.onvisual.before(e,f,r||{},u===!0,t!==!1),h===!1))return;t!==!1?e.classList.remove("layx-hide-statu"):e.classList.add("layx-hide-statu");o.updateMinLayout();i.isFunction(f.event.onvisual.after)&&f.event.onvisual.after(e,f,t!==!1)}},destroyInlay:function(n){var t=this;t.destroy(n,null,!0)},destroy:function(n,t,u,f,e){var l=this,w="layx-"+n,a=document.getElementById(w),y=document.getElementById(w+"-shade"),o=l.windows[n],b,s,p,c,v,h,k;if(a&&o){if(o.escKey===!1&&f===!0)return;if(l.updateZIndex(n),i.isFunction(o.event.ondestroy.before)&&(b=o.event.ondestroy.before(a,o,t||{},u===!0,f===!0),e!==!0&&b===!1))return;if(o.closable!==!0)return;if(s=l.cloneStore[n],o.type==="html"&&s&&(v=a.querySelector("#layx-"+n+"-html"),v&&(h=v.children[0],h&&h.style&&(h.style.display=s.display),s.prev?setTimeout(function(){i.insertAfter(h,s.prev)},0):setTimeout(function(){s.parent&&s.parent.insertBefore(h,s.next)},0))),o.type==="group"&&s&&s&&s.frames)for(p in s.frames)c=s.frames[p],v=a.querySelector("#layx-"+n+"-"+p+"-html"),v&&(h=v.children[0],h&&h.style&&(h.style.display=c.display),c.prev?setTimeout(function(){i.insertAfter(h,c.prev)},0):setTimeout(function(){c.parent&&c.parent.insertBefore(h,c.next)},0));r.focusId=r.prevFocusId;delete l.cloneStore[n];delete l.windows[n];document.body.classList.contains("ilayx-body")&&document.body.classList.remove("ilayx-body");a.parentNode.removeChild(a);y&&y.parentNode.removeChild(y);l.updateMinLayout();i.isFunction(o.event.ondestroy.after)&&o.event.ondestroy.after();o.destroyTimer&&clearInterval(o.destroyTimer);o.loadTimer&&clearInterval(o.loadTimer);o.loadingTextTimer&&clearInterval(o.loadingTextTimer);for(k in o)delete o[k];o=undefined}},destroyAll:function(){var n=this;for(var t in r.windows)n.destroy(t)},flicker:function(n){var i=this,r,u="layx-"+n,t=document.getElementById(u),f=i.windows[n];t&&f&&(i.updateZIndex(n),t.classList.contains("layx-flicker")&&t.classList.remove("layx-flicker"),t.classList.add("layx-flicker"),r=setTimeout(function(){t.classList.remove("layx-flicker");clearTimeout(r)},960))},setPosition:function(n,t,r){var o=this,s="layx-"+n,e=document.getElementById(s),u=o.windows[n],f;e&&u&&(f=r===!0?t:i.compileLayxPosition(u.area.width,u.area.height,t),u.area.left=f.left,u.area.top=f.top,u.storeStatus===!0&&o.storeWindowAreaInfo(n,u.area),e.style.left=f.left+"px",e.style.top=f.top+"px")},setSize:function(n,t){var u=this,s="layx-"+n,f=document.getElementById(s),r=u.windows[n],e,o;f&&r&&t&&(t.width&&(e=i.compileLayxWidthOrHeight("width",t.width,u.defaults.width),r.area.width=e,f.style.width=e+"px"),t.height&&(o=i.compileLayxWidthOrHeight("height",t.height,u.defaults.height),r.area.height=o,f.style.height=o+"px"),r.storeStatus===!0&&u.storeWindowAreaInfo(n,r.area))},getFrameContext:function(n){var f=this,e="layx-"+n,i=document.getElementById(e),r=f.windows[n],u=null,t;if(i&&r&&r.type==="url"&&(t=i.querySelector(".layx-iframe"),t))try{u=t.contentWindow}catch(o){}return u},getParentContext:function(n){var i=this,t=i.getFrameContext(n);return t?t.parent:null},getGroupFrameContext:function(n,t){var u=this,s="layx-"+n,f=document.getElementById(s),i=u.windows[n],e=null,o,r;if(f&&i&&i.type==="group"&&(o=u.getGroupFrame(i.frames,t),o.type==="url"&&(r=f.querySelector("#layx-"+n+"-"+t+"-iframe"),r)))try{e=r.contentWindow}catch(h){}return e},createLayxButtons:function(n,t,r){var o=this,h=document.createElement("div"),e,f,u,s;for(h.classList.add("layx-buttons"),e=0;e<n.length;e++){if(f=document.createElement("button"),u=layxDeepClone({},o.defaultButtons,n[e]),f.classList.add("layx-button-item"),f.setAttribute("title",u.label),f.innerText=u.label,u.id&&f.setAttribute("id","layx-"+t+"-button-"+u.id),i.isArray(u.classes))for(s=0;s<u.classes.length;s++)f.classList.add(u.classes[s]);else u.classes&&f.classList.add(u.classes.toString());u.style&&f.setAttribute("style",u.style);f.callback=n[e].callback;f.onclick=function(n){if(n=n||window.event||arguments.callee.caller.arguments[0],i.isFunction(this.callback))if(r===!0){var u=o.getPromptTextArea(t);o.updateZIndex(t);this.callback(t,(u?u.value:"").replace(/(^\s*)|(\s*$)/g,""),u,this,n)}else o.updateZIndex(t),this.callback(t,this,n)};h.appendChild(f)}return h},setButtonStatus:function(n,t,i){var f=this,e="layx-"+n,u=document.getElementById(e),o=f.windows[n],r;u&&o&&(r=u.querySelector("#layx-"+n+"-button-"+t),r&&(i===!1?r.setAttribute("disabled","disabled"):r.removeAttribute("disabled")))},getStrSizeRange:function(n,t,i,r,u,f){var o=0,s=0,e=document.createElement("span");return e.innerHTML=n,e.classList.add("layx-calc-text"),e.style.visibility="hidden",e.style.display="inline-block",e.style.minWidth=t+"px",e.style.minHeight=i+"px",e.style.maxWidth=r+"px",e.style.maxHeight=u+"px",e.style.paddingLeft="10px",e.style.paddingRight="10px",e.style.paddingTop="10px",e.style.paddingBottom="10px",e.style.margin="0",e.style.border="none",e.style.lineHeight=1.5,document.body.appendChild(e),o=e.offsetWidth,s=e.offsetHeight+1,document.body.removeChild(e),{width:o+(f===!0?45:0),height:s}},getButton:function(n,t){var r=this,u="layx-"+n,i=document.getElementById(u),f=r.windows[n];return i&&f?i.querySelector("#layx-"+n+"-button"+(t?"-"+t:"")):null},tip:function(n,t,r,u){var f=this,e;i.isDom(t)&&(e=u&&u.id?u.id:"layx-dialog-tip-"+i.rndNum(8),t.addEventListener("mouseover",function(){var i=f.getStrSizeRange(n,20,20,320,90,u&&u.dialogIcon?!0:!1);f.create(layxDeepClone({},{id:e,type:"html",control:!1,content:f.createDialogContent("tip",n,u&&u.dialogIcon?u.dialogIcon:!1),width:i.width,height:i.height,minHeight:i.height,minWidth:i.width,stickMenu:!1,minMenu:!1,floatTarget:t,floatDirection:r||"bottom",maxMenu:!1,closeMenu:!1,alwaysOnTop:!0,resizable:!1,movable:!1,allowControlDbclick:!1,autodestroyText:!1,loadingText:!1,storeStatus:!1},u))},!1),t.addEventListener("mouseout",function(){f.destroy(e,null,!0)},!1))},msg:function(n,t){var r=this,u=r.getStrSizeRange(n,120,20,320,90,t&&t.dialogIcon?!0:!1),f=r.create(layxDeepClone({},{id:t&&t.id?t.id:"layx-dialog-msg-"+i.rndNum(8),type:"html",control:!1,content:r.createDialogContent("msg",n,t&&t.dialogIcon?t.dialogIcon:!1),autodestroy:5e3,width:u.width,height:u.height,minHeight:u.height,stickMenu:!1,minMenu:!1,maxMenu:!1,closeMenu:!1,alwaysOnTop:!0,resizable:!1,movable:!1,allowControlDbclick:!1,position:[10,"tc"],autodestroyText:!1,loadingText:!1,storeStatus:!1,dialogType:"msg"},t));return r.flicker(f.id),f},createDialogContent:function(n,t,i){var o=this,u=document.createElement("div"),e,r,f;if(u.classList.add("layx-dialog-"+n),u.classList.add("layx-flexbox"),i){e=document.createElement("div");e.classList.add("layx-dialog-icon");r=document.createElement("div");r.classList.add("layx-icon");r.classList.add("layx-dialog-icon-"+i);switch(i){case"success":r.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-right"><\/use><\/svg>';break;case"warn":r.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-warn"><\/use><\/svg>';break;case"error":r.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-error"><\/use><\/svg>';break;case"help":r.innerHTML='<svg class="layx-iconfont" aria-hidden="true"><use xlink:href="#layx-icon-help"><\/use><\/svg>'}e.appendChild(r);u.appendChild(e)}return f=document.createElement("div"),f.classList.add("layx-dialog-content"),f.classList.add("layx-flexauto"),f.innerHTML=t,u.appendChild(f),u},alert:function(n,t,u,f){var e=this,o=e.getStrSizeRange(t,137,66,352,157,f&&f.dialogIcon?!0:!1);return e.create(layxDeepClone({},{id:f&&f.id?f.id:"layx-dialog-alert-"+i.rndNum(8),title:n||"提示消息",icon:!1,type:"html",content:e.createDialogContent("alert",t,f&&f.dialogIcon?f.dialogIcon:!1),width:o.width+20,height:o.height+73,minHeight:o.height+73,stickMenu:!1,dialogType:"alert",minMenu:!1,minable:!1,maxMenu:!1,maxable:!1,alwaysOnTop:!0,resizable:!1,allowControlDbclick:!1,shadable:!0,statusBar:!0,buttons:[{label:"确定",callback:function(n,t,f){if(f=f||window.event||arguments.callee.caller.arguments[0],f.stopPropagation(),i.isFunction(u)){var e=u(n,t,f);e!==!1&&r.destroy(n)}else r.destroy(n)}}],position:"ct",loadingText:!1,storeStatus:!1},f))},confirm:function(n,t,u,f){var e=this,o=e.getStrSizeRange(t,180,137,352,180,f&&f.dialogIcon?!0:!1);return e.create(layxDeepClone({},{id:f&&f.id?f.id:"layx-dialog-confirm-"+i.rndNum(8),title:n||"询问消息",icon:!1,type:"html",content:e.createDialogContent("confirm",t,f&&f.dialogIcon?f.dialogIcon:!1),width:o.width+20,height:o.height,minHeight:o.height,stickMenu:!1,dialogType:"confirm",minMenu:!1,minable:!1,maxMenu:!1,maxable:!1,alwaysOnTop:!0,resizable:!1,allowControlDbclick:!1,shadable:!0,buttons:[{label:"确定",callback:function(n,t,f){if(f=f||window.event||arguments.callee.caller.arguments[0],f.stopPropagation(),i.isFunction(u)){var e=u(n,t);e!==!1&&r.destroy(n)}}},{label:"取消",callback:function(n,t,i){i=i||window.event;i.stopPropagation();r.destroy(n)}}],statusBar:!0,position:"ct",loadingText:!1,storeStatus:!1},f))},getPromptTextArea:function(n){var f=this,e="layx-"+n,r=document.getElementById(e),u=f.windows[n],t,i;return r&&u&&u.type==="html"&&(t=r.querySelector(".layx-dialog-prompt"),t&&(i=t.querySelector(".layx-textarea"),i))?i:null},prompt:function(n,t,u,f,e){var o=this,s=o.getStrSizeRange(t,200,184,352,200);return o.create(layxDeepClone({},{id:e&&e.id?e.id:"layx-dialog-prompt-"+i.rndNum(8),title:n||"请输入信息",icon:!1,type:"html",content:o.createDialogContent("prompt","<label>"+t+"<\/label><textarea class='layx-textarea'>"+(f?f.toString():"")+"<\/textarea>"),width:s.width+20,height:s.height,minHeight:s.height,stickMenu:!1,dialogType:"prompt",minMenu:!1,minable:!1,maxMenu:!1,maxable:!1,alwaysOnTop:!0,resizable:!1,allowControlDbclick:!1,shadable:!0,statusBar:!0,buttonKey:"ctrl+enter",buttons:[{label:"确定",callback:function(n,t,f,e,o){if(o=o||window.event||arguments.callee.caller.arguments[0],o.stopPropagation(),f&&t.length===0)f.focus();else if(i.isFunction(u)){var s=u(n,t,f,e,o);s!==!1&&r.destroy(n)}}},{label:"取消",callback:function(n,t,i,u,f){f=f||window.event;f.stopPropagation();r.destroy(n)}}],position:"ct",loadingText:!1,storeStatus:!1},e))},createLoadAnimate:function(){var t=document.createElement("div"),n,r,u,f,i;return t.classList.add("layx-load-animate"),n=document.createElement("div"),n.classList.add("layx-load-inner"),r=document.createElement("div"),r.classList.add("layx-load-spiner"),n.appendChild(r),u=document.createElement("div"),u.classList.add("layx-load-filler"),n.appendChild(u),f=document.createElement("div"),f.classList.add("layx-load-masker"),n.appendChild(f),t.appendChild(n),i=n.cloneNode(!0),i.classList.remove("layx-load-inner"),i.classList.add("layx-load-inner2"),t.appendChild(i),t},load:function(n,t,r){var s=this,h=s.getStrSizeRange(t,120,53,320,90),u=document.createElement("div"),f,e;u.classList.add("layx-dialog-load");u.classList.add("layx-flexbox");u.classList.add("layx-flex-center");u.appendChild(s.createLoadAnimate());f=document.createElement("div");f.classList.add("layx-load-msg");f.innerHTML=t;u.appendChild(f);e=document.createElement("span");e.classList.add("layx-dot");f.appendChild(e);var o=0,l=setInterval(function(){var n,t;for(o===5&&(o=0),++o,n="",t=0;t<o;t++)n+=".";e.innerHTML=n},200),c=s.create(layxDeepClone({},{id:n?n:"layx-dialog-load-"+i.rndNum(8),type:"html",control:!1,shadable:!0,content:u,cloneElementContent:!1,width:h.width+70,height:h.height,minHeight:h.height,stickMenu:!1,minMenu:!1,maxMenu:!1,closeMenu:!1,escKey:!1,alwaysOnTop:!0,resizable:!1,movable:!1,allowControlDbclick:!1,position:"ct",loadingText:!1,storeStatus:!1,dialogType:"load"},r));return c.loadTimer=l,c}};String.prototype.toFirstUpperCase=function(){return this.replace(/^\S/,function(n){return n.toUpperCase()})};"classList"in document.documentElement||Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){function t(t){return function(i){var r=n.className.split(/\s+/g),u=r.indexOf(i);t(r,u,i);n.className=r.join(" ")}}var n=this;return{add:t(function(n,t,i){~t||n.push(i)}),remove:t(function(n,t){~t&&n.splice(t,1)}),toggle:t(function(n,t,i){~t?n.splice(t,1):n.push(i)}),contains:function(t){return!!~n.className.split(/\s+/g).indexOf(t)},item:function(t){return n.className.split(/\s+/g)[t]||null}}}});var e={resolution:0,iframes:[],interval:null,Iframe:function(){this.element=arguments[0];this.cb=arguments[1];this.hasTracked=!1},track:function(n,t){if(this.iframes.push(new this.Iframe(n,t)),!this.interval){var i=this;this.interval=setInterval(function(){i.checkClick()},this.resolution)}},checkClick:function(){var i,n;if(document.activeElement){i=document.activeElement;for(n in this.iframes)i===this.iframes[n].element?this.iframes[n].hasTracked==!1&&(this.iframes[n].cb.apply(t,[]),this.iframes[n].hasTracked=!0):this.iframes[n].hasTracked=!1}}},i={isSupportTouch:"ontouchstart"in document?!0:!1,isSupportMouse:"onmouseup"in document?!0:!1,IsPC:function(){for(var r=navigator.userAgent,t=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],i=!0,n=0;n<t.length;n++)if(r.indexOf(t[n])>0){i=!1;break}return i},isBoolean:function(n){return typeof n=="boolean"},isString:function(n){return typeof n=="string"},isNumber:function(n){return typeof n=="number"},isArray:function(n){return Object.prototype.toString.call(n)=="[object Array]"},isFunction:function(n){return n&&Object.prototype.toString.call(n)==="[object Function]"},isDom:function(n){return!!(n&&typeof window!="undefined"&&(n===window||n.nodeType))},insertAfter:function(n,t){var i=t.parentNode;n&&(i.lastChild==t?i.appendChild(n):i.insertBefore(n,t.nextSibling))},innerArea:function(){return{width:t.innerWidth,height:t.innerHeight}},getCross:function(n,t,i){return(t.x-n.x)*(i.y-n.y)-(i.x-n.x)*(t.y-n.y)},IsPointInMatrix:function(n,t){var i=this,r=n.p1,u=n.p2,f=n.p3,e=n.p4;return i.getCross(r,u,t)*i.getCross(f,e,t)>=0&&i.getCross(u,f,t)*i.getCross(e,r,t)>=0},checkElementIsVisual:function(n,t,i){var f=this,o=f.innerArea(),e=f.getElementPos(n),s={x:e.x+n.offsetWidth,y:e.y+n.offsetHeight},r=f.getElementPos(t),u={x:r.x+t.offsetWidth,y:r.y+t.offsetHeight};if(i===!1){var h={p1:{x:e.x,y:s.y},p2:{x:e.x,y:e.y},p3:{x:s.x,y:e.y},p4:{x:s.x,y:s.y}},c={p1:{x:0,y:o.height},p2:{x:0,y:0},p3:{x:o.width,y:0},p4:{x:o.width,y:o.height}},l=f.IsPointInMatrix(h,{x:r.x,y:r.y}),a=f.IsPointInMatrix(h,{x:u.x,y:r.y}),v=f.IsPointInMatrix(h,{x:r.x,y:u.y}),y=f.IsPointInMatrix(h,{x:u.x,y:u.y}),p=f.IsPointInMatrix(c,{x:r.x,y:r.y}),w=f.IsPointInMatrix(c,{x:u.x,y:r.y}),b=f.IsPointInMatrix(c,{x:r.x,y:u.y}),k=f.IsPointInMatrix(c,{x:u.x,y:u.y});return(l||a||v||y)&&(p||w||b||k)}return r.x>=e.x&&u.x<=s.x&&r.y>=e.y&&u.y<=s.y&&r.x>=0&&u.x<=o.width&&r.y>=0&&u.y<=o.height},compilebubbleDirection:function(n,t,i,r){var s=this,f=s.getElementPos(t),e=s.innerArea(),o=11,u={top:0,left:0};n=["top","bottom","left","right"].indexOf(n)>-1?n:"bottom";switch(n){case"bottom":u.top=f.y+t.offsetHeight+o;u.left=f.x;f.x+i>=e.width&&(u.left=e.width-i);break;case"top":u.top=f.y-(r+o);u.left=f.x;f.x+i>=e.width&&(u.left=e.width-i);break;case"right":u.top=f.y;u.left=f.x+t.offsetWidth+o;f.y+r>=e.height&&(u.top=e.height-r);break;case"left":u.top=f.y;u.left=f.x-(i+o);f.y+r>=e.height&&(u.top=e.height-r)}return u},compileLayxPosition:function(n,t,i){var f=this,u=f.innerArea(),r={top:0,left:0};if(f.isArray(i)&&i.length===2)r.top=f.isNumber(i[0])?i[0]:f.compileLayxPosition(n,t,i[0]).top,r.left=f.isNumber(i[1])?i[1]:f.compileLayxPosition(n,t,i[1]).left;else{i=["ct","lt","rt","lb","rb","lc","tc","rc","bc"].indexOf(i.toString())>-1?i.toString():"ct";switch(i){case"ct":r.top=(u.height-t)/2;r.left=(u.width-n)/2;break;case"lt":r.top=0;r.left=0;break;case"rt":r.top=0;r.left=u.width-n;break;case"lb":r.top=u.height-t;r.left=0;break;case"rb":r.top=u.height-t;r.left=u.width-n;break;case"lc":r.left=0;r.top=(u.height-t)/2;break;case"tc":r.top=0;r.left=(u.width-n)/2;break;case"rc":r.left=u.width-n;r.top=(u.height-t)/2;break;case"bc":r.top=u.height-t;r.left=(u.width-n)/2}}return r},rndNum:function(n){for(var t="",i=0;i<n;i++)t+=Math.floor(Math.random()*10);return t},compileLayxWidthOrHeight:function(n,t,i){var f=this,r=f.innerArea(),u;if(/(^[1-9]\d*$)/.test(t))return Number(t);if(/^(100|[1-9]?\d(\.\d\d?)?)%$/.test(t)){if(u=Number(t.toString().replace("%","")),n==="width")return r.width*(u/100);if(n==="height")return r.height*(u/100)}if(/^[1-9]\d*v[hw]$/.test(t)){if(n==="width")return r.width*parseFloat(t)/100;if(n==="height")return r.height*parseFloat(t)/100}return i},getNodeByClassName:function(n,i,r){var u,f;return(r=r||t,u=this,n===r.document.body)?null:(f=n.classList,f.contains(i)?n:u.getNodeByClassName(n.parentNode,i))},getMousePosition:function(n){var t;if(n=n||window.event,n.touches){if(i.IsPC()&&(t=n.button||n.which,t==1&&n.shiftKey==!1)){var r=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,f=n.pageX||n.clientX+r,e=n.pageY||n.clientY+u;return{x:f,y:e}}return{x:n.touches[0].clientX,y:n.touches[0].clientY}}var r=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,f=n.pageX||n.clientX+r,e=n.pageY||n.clientY+u;return{x:f,y:e}},getElementPos:function(n){var u=navigator.userAgent.toLowerCase(),h=u.indexOf("opera")!=-1,c=u.indexOf("msie")!=-1&&!h,t,i,r,f,e,o,s;if(n.parentNode===null||n.style.display=="none")return!1;if(t=null,i=[],n.getBoundingClientRect)return r=n.getBoundingClientRect(),f=Math.max(document.documentElement.scrollTop,document.body.scrollTop),e=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),{x:r.left+e,y:r.top+f};if(document.getBoxObjectFor)r=document.getBoxObjectFor(n),o=n.style.borderLeftWidth?parseInt(n.style.borderLeftWidth):0,s=n.style.borderTopWidth?parseInt(n.style.borderTopWidth):0,i=[r.x-o,r.y-s];else{if(i=[n.offsetLeft,n.offsetTop],t=n.offsetParent,t!=n)while(t)i[0]+=t.offsetLeft,i[1]+=t.offsetTop,t=t.offsetParent;(u.indexOf("opera")!=-1||u.indexOf("safari")!=-1&&n.style.position=="absolute")&&(i[0]-=document.body.offsetLeft,i[1]-=document.body.offsetTop)}for(t=n.parentNode?n.parentNode:null;t&&t.tagName!="BODY"&&t.tagName!="HTML";)i[0]-=t.scrollLeft,i[1]-=t.scrollTop,t=t.parentNode?t.parentNode:null;return{x:i[0],y:i[1]}}},u=function(n,f,e,o,s){u.isResizing=!1;u.isFirstResizing=!0;var h=function(t){var y,w;t=t||window.event;var p=i.getMousePosition(t),a=p.x-n.mouseStartCoord.x,v=p.y-n.mouseStartCoord.y;if(i.isSupportTouch){if(t.cancelable&&(t.defaultPrevented||t.preventDefault()),((a!==0||v!==0)&&new Date-n.touchDate>100)==!1)return;if(i.IsPC()){if(y=t.button||t.which,(y==1&&t.shiftKey==!1)==!1)return;if(t.defaultPrevented||t.preventDefault(),(a!==0||v!==0)==!1)return}}else{if(y=t.button||t.which,(y==1&&t.shiftKey==!1)==!1)return;if(t.defaultPrevented||t.preventDefault(),(a!==0||v!==0)==!1)return}var r=n.winform.area.top+v,h=n.winform.area.left+a,c=f?n.winform.area.height-v:n.winform.area.height+v,l=e?n.winform.area.width-a:n.winform.area.width+a;if(u.isResizing=!0,u.isFirstResizing===!0&&(u.isFirstResizing=!1,i.isFunction(n.winform.event.onresize.before)&&(w=n.winform.event.onresize.before(n.layxWindow,n.winform),w===!1))){u.isResizing=!1;u.isFirstResizing=!0;i.isSupportTouch?(document.ontouchend=null,document.ontouchmove=null,i.IsPC()&&(document.onmouseup=null,document.onmousemove=null)):(document.onmouseup=null,document.onmousemove=null);return}l=Math.max(l,n.winform.area.minWidth);e?(h=Math.min(h,n.winform.area.left+n.winform.area.width-n.winform.area.minWidth),h=Math.max(0,h),l=Math.min(l,n.winform.area.left+n.winform.area.width)):(h=Math.min(h,n.winform.area.left),h=Math.max(n.winform.area.left,h),l=Math.min(l,n.innerArea.width-n.winform.area.left));c=Math.max(c,n.winform.area.minHeight);f?(r=Math.min(r,n.winform.area.top+n.winform.area.height-n.winform.area.minHeight),r=Math.max(0,r),c=Math.min(c,n.winform.area.top+n.winform.area.height)):(r=Math.min(r,n.winform.area.top),r=Math.max(n.winform.area.top,r),c=Math.min(c,n.innerArea.height-n.winform.area.top));s&&(n.layxWindow.style.width=l+"px",n.layxWindow.style.left=h+"px");o&&(n.layxWindow.style.top=r+"px",n.layxWindow.style.height=c+"px");s===!1&&o===!1&&(n.layxWindow.style.width=l+"px",n.layxWindow.style.left=h+"px",n.layxWindow.style.top=r+"px",n.layxWindow.style.height=c+"px");i.isFunction(n.winform.event.onresize.progress)&&n.winform.event.onresize.progress(n.layxWindow,n.winform)},c=function(t){var h,s,f,e,o;if(t=t||window.event,i.isSupportTouch){if(document.ontouchend=null,document.ontouchmove=null,i.IsPC()){if(h=t.button||t.which,h==1&&t.shiftKey==!1)for(s=n.layxWindow.querySelectorAll(".layx-resizes > div"),f=0;f<s.length;f++)s[f].classList.add("layx-reisize-touch");document.onmouseup=null;document.onmousemove=null}}else document.onmouseup=null,document.onmousemove=null;e=n.layxWindow.querySelector(".layx-mouse-preventDefault");e&&e.parentNode.removeChild(e);o=document.getElementById("layx-window-move");o&&o.parentNode.removeChild(o);u.isResizing===!0&&(u.isResizing=!1,u.isFirstResizing=!0,n.winform.area.top=n.layxWindow.offsetTop,n.winform.area.left=n.layxWindow.offsetLeft,n.winform.area.width=n.layxWindow.offsetWidth,n.winform.area.height=n.layxWindow.offsetHeight,n.winform.storeStatus===!0&&r.storeWindowAreaInfo(n.winform.id,{top:n.winform.area.top,left:n.winform.area.left,width:n.winform.area.width,height:n.winform.area.height}),i.isFunction(n.winform.event.onresize.after)&&n.winform.event.onresize.after(n.layxWindow,n.winform))},l=function(u){var f,l,e,o,p,s,v,w,y,a;if(u=u||window.event,f=i.getNodeByClassName(n,"layx-window",t),f&&(l=f.getAttribute("id").substr(5),e=r.windows[l],e))if(e.status!=="min"&&e.resizable===!0)if(o=document.getElementById("layx-window-move"),o||(o=document.createElement("div"),o.setAttribute("id","layx-window-move"),document.body.appendChild(o)),r.updateZIndex(l),o.style.zIndex=e.zIndex-1,p=i.getMousePosition(u),n.mouseStartCoord=p,n.layxWindow=f,n.winform=e,n.innerArea=i.innerArea(),n.touchDate=new Date,s=f.querySelector(".layx-mouse-preventDefault"),s||(s=document.createElement("div"),s.classList.add("layx-mouse-preventDefault"),v=f.querySelector(".layx-main"),v&&v.appendChild(s)),i.isSupportTouch){if(document.ontouchend=c,document.ontouchmove=h,i.IsPC()){if(w=u.button||u.which,w==1&&u.shiftKey==!1)for(y=f.querySelectorAll(".layx-resizes > div"),a=0;a<y.length;a++)y[a].classList.remove("layx-reisize-touch");document.onmouseup=c;document.onmousemove=h}}else document.onmouseup=c,document.onmousemove=h;else r.restore(l);return!1};i.isSupportTouch?(n.ontouchstart=l,i.IsPC()&&(n.onmousedown=l)):n.onmousedown=l},f=function(n){f.isMoveing=!1;f.isFirstMoveing=!0;var u=function(t){var c,l,u,o;t=t||window.event;var e=i.getMousePosition(t),s=e.x-n.mouseStartCoord.x,h=e.y-n.mouseStartCoord.y;if(i.isSupportTouch){if(t.cancelable&&(t.defaultPrevented||t.preventDefault()),((s!==0||h!==0)&&new Date-n.touchDate>100)==!1)return;if(i.IsPC()){if(c=t.button||t.which,(c==1&&t.shiftKey==!1)==!1)return;if(t.defaultPrevented||t.preventDefault(),(s!==0||h!==0)==!1)return}}else{if(c=t.button||t.which,(c==1&&t.shiftKey==!1)==!1)return;if(t.defaultPrevented||t.preventDefault(),(s!==0||h!==0)==!1)return}if(f.isMoveing=!0,f.isFirstMoveing===!0&&(f.isFirstMoveing=!1,i.isFunction(n.winform.event.onmove.before)&&(l=n.winform.event.onmove.before(n.layxWindow,n.winform),l===!1))){f.isMoveing=!1;f.isFirstMoveing=!0;i.isSupportTouch?(document.ontouchend=null,document.ontouchmove=null):(document.onmouseup=null,document.onmousemove=null);return}u=n.winform.area.left+s;o=n.winform.area.top+h;n.winform.status==="max"&&n.winform.resizable===!0&&(e.x<n.winform.area.width/2?u=0:e.x>n.winform.area.width/2&&e.x<n.innerArea.width-n.winform.area.width?u=e.x-n.winform.area.width/2:n.innerArea.width-e.x<n.winform.area.width/2?u=n.innerArea.width-n.winform.area.width:n.innerArea.width-e.x>n.winform.area.width/2&&e.x>=n.innerArea.width-n.winform.area.width&&(u=e.x-n.winform.area.width/2),o=0,n.winform.area.top=0,n.winform.area.left=u,r.restore(n.winform.id));n.winform.moveLimit.horizontal===!0&&(u=n.winform.area.left);n.winform.moveLimit.vertical===!0&&(o=n.winform.area.top);n.winform.moveLimit.leftOut===!1&&(u=Math.max(u,0));n.winform.moveLimit.rightOut===!1&&(u=Math.min(u,n.innerArea.width-n.winform.area.width));n.winform.moveLimit.bottomOut===!1&&(o=Math.min(o,n.innerArea.height-n.winform.area.height));o=Math.max(o,0);o=Math.min(n.innerArea.height-15,o);u=Math.max(u,-(n.winform.area.width-15));u=Math.min(u,n.innerArea.width-15);n.layxWindow.style.left=u+"px";n.layxWindow.style.top=o+"px";i.isFunction(n.winform.event.onmove.progress)&&n.winform.event.onmove.progress(n.layxWindow,n.winform)},e=function(t){var h,s,u,e,o;if(t=t||window.event,i.isSupportTouch){if(document.ontouchend=null,document.ontouchmove=null,i.IsPC()){if(h=t.button||t.which,h==1&&t.shiftKey==!1)for(s=n.layxWindow.querySelectorAll(".layx-resizes > div"),u=0;u<s.length;u++)s[u].classList.add("layx-reisize-touch");document.onmouseup=null;document.onmousemove=null}}else document.onmouseup=null,document.onmousemove=null;e=n.layxWindow.querySelector(".layx-mouse-preventDefault");e&&e.parentNode.removeChild(e);o=document.getElementById("layx-window-move");o&&o.parentNode.removeChild(o);f.isMoveing===!0&&(f.isMoveing=!1,f.isFirstMoveing=!0,n.winform.area.top=n.layxWindow.offsetTop,n.winform.area.left=n.layxWindow.offsetLeft,n.winform.storeStatus===!0&&r.storeWindowAreaInfo(n.winform.id,{top:n.winform.area.top,left:n.winform.area.left,width:n.winform.area.width,height:n.winform.area.height}),n.winform.area.top===0&&n.winform.status==="normal"&&n.winform.maxable===!0&&n.winform.resizable===!0&&n.winform.dragInTopToMax===!0&&(n.winform.area.top=n.defaultArea.top,n.winform.area.left=n.defaultArea.left,n.winform.storeStatus===!0&&r.storeWindowAreaInfo(n.winform.id,{top:n.winform.area.top,left:n.winform.area.left,width:n.winform.area.width,height:n.winform.area.height}),r.max(n.winform.id)),i.isFunction(n.winform.event.onmove.after)&&n.winform.event.onmove.after(n.layxWindow,n.winform))},o=function(f){var o,l,s,h,p,c,v,w,y,a;if(f=f||window.event,o=i.getNodeByClassName(n,"layx-window",t),o&&(l=o.getAttribute("id").substr(5),s=r.windows[l],s))if(s.status!=="min"&&s.movable===!0)if(h=document.getElementById("layx-window-move"),h||(h=document.createElement("div"),h.setAttribute("id","layx-window-move"),document.body.appendChild(h)),r.updateZIndex(l),h.style.zIndex=s.zIndex-1,p=i.getMousePosition(f),n.mouseStartCoord=p,n.layxWindow=o,n.winform=s,n.innerArea=i.innerArea(),n.defaultArea=layxDeepClone({},s.area),n.touchDate=new Date,c=o.querySelector(".layx-mouse-preventDefault"),c||(c=document.createElement("div"),c.classList.add("layx-mouse-preventDefault"),v=o.querySelector(".layx-main"),v&&v.appendChild(c)),i.isSupportTouch){if(document.ontouchend=e,document.ontouchmove=u,i.IsPC()){if(w=f.button||f.which,w==1&&f.shiftKey==!1)for(y=o.querySelectorAll(".layx-resizes > div"),a=0;a<y.length;a++)y[a].classList.remove("layx-reisize-touch");document.onmouseup=e;document.onmousemove=u}}else document.onmouseup=e,document.onmousemove=u;else r.restore(l);return!1};i.isSupportTouch?(n.ontouchstart=o,i.IsPC()&&(n.onmousedown=o)):n.onmousedown=o};t.layx={v:function(){return r.version}(),open:function(n){return r.create(n)},html:function(n,t,i,u){return r.create(layxDeepClone({},{id:n,title:t,type:"html",content:i},u||{}))},iframe:function(n,t,i,u){return r.create(layxDeepClone({},{id:n,title:t,type:"url",url:i,useFrameTitle:t===!0?!0:!1},u||{}))},group:function(n,t,i,u){return r.create(layxDeepClone({},{id:n,type:"group",frames:t,frameIndex:typeof i=="number"?i>t.length?0:i:0},u||{}))},windows:function(){return r.windows},getWindow:function(n){return r.windows[n]},destroy:function(n,t,i){r.destroy(n,t,!1,!1,i)},visual:function(n,t,i){r.visual(n,t,i)},min:function(n){r.min(n)},max:function(n){r.max(n)},setTitle:function(n,t,i){r.setTitle(n,t,i)},flicker:function(n){r.flicker(n)},restore:function(n){r.restore(n)},updateZIndex:function(n){r.updateZIndex(n)},updateMinLayout:function(){r.updateMinLayout()},stickToggle:function(n){r.stickToggle(n)},setPosition:function(n,t){r.setPosition(n,t)},getFrameContext:function(n){return r.getFrameContext(n)},getParentContext:function(n){return r.getParentContext(n)},setContent:function(n,t,i){r.setContent(n,t,i)},setUrl:function(n,t){r.setUrl(n,t)},setGroupContent:function(n,t,i,u){r.setGroupContent(n,t,i,u)},setGroupTitle:function(n,t,i,u){r.setGroupTitle(n,t,i,u)},setGroupUrl:function(n,t,i){r.setGroupUrl(n,t,i)},setGroupIndex:function(n,t){r.setGroupIndex(n,t)},getGroupFrameContext:function(n,t){return r.getGroupFrameContext(n,t)},destroyAll:function(){r.destroyAll()},tip:function(n,t,i,u){r.tip(n,t,i,u)},msg:function(n,t){return r.msg(n,t)},alert:function(n,t,i,u){return r.alert(n,t,i,u)},confirm:function(n,t,i,u){return r.confirm(n,t,i,u)},getPromptTextArea:function(n){return r.getPromptTextArea(n)},prompt:function(n,t,i,u,f){return r.prompt(n,t,i,u,f)},load:function(n,t,i){return r.load(n,t,i)},multiLine:function(n){return n.toString().replace(/^[^\/]+\/\*!?\s?/,"").replace(/\*\/[^\/]+$/,"")},reloadFrame:function(n){r.reloadFrame(n)},reloadGroupFrame:function(n,t){r.reloadGroupFrame(n,t)},setButtonStatus:function(n,t,i){r.setButtonStatus(n,t,i)},updateFloatWinPosition:function(n,t){r.updateFloatWinPosition(n,t)},getElementPos:function(n){return i.getElementPos(n)},destroyInlay:function(n){r.destroyInlay(n)},checkVisual:function(n,t,r){return i.checkElementIsVisual(n,t,r)},getButton:function(n,t){return r.getButton(n,t)},setSize:function(n,t){r.setSize(n,t)}};t.document.addEventListener("keydown",function(n){var i=n||window.event||arguments.callee.caller.arguments[0],t=r.windows[r.focusId],u;i&&i.keyCode==27&&t&&r.destroy(r.focusId,{},!1,!0);i&&i.keyCode===13&&t&&t.buttons.length>0&&(t.buttonKey.toLowerCase()!=="enter"||i.ctrlKey?t.buttonKey.toLowerCase()==="ctrl+enter"&&i.ctrlKey&&(t.dialogType!=="prompt"?t.buttons[0].callback(t.id,r.getButton(t.id,t.buttons[0].id,i)):(u=r.getPromptTextArea(t.id),t.buttons[0].callback(t.id,(u?u.value:"").replace(/(^\s*)|(\s*$)/g,""),u,r.getButton(t.id,t.buttons[0].id,i)))):t.dialogType!=="prompt"?t.buttons[0].callback(t.id,r.getButton(t.id,t.buttons[0].id,i)):(u=r.getPromptTextArea(t.id),t.buttons[0].callback(t.id,(u?u.value:"").replace(/(^\s*)|(\s*$)/g,""),u,r.getButton(t.id,t.buttons[0].id,i))))},!1)}(top,window,self);!function(n){var i,r,t;t=function(n){return Object.prototype.toString.call(n)==="[object Object]"};r=function u(n,i){for(var r in n)if(n.hasOwnProperty(r))if(t(n[r])&&t(i[r])&&u(n[r],i[r]),i.hasOwnProperty(r))continue;else i[r]=n[r]};i=function(){var n=arguments,u={},i;if(!n.length)return{};for(i=n.length-1;i>=0;i--)t(n[i])&&r(n[i],u);return n[0]=u,u};n.layxDeepClone=i}(window);!function(n){function o(){var i,n;i=document.createElement("div");i.innerHTML=t;t=null;n=i.getElementsByTagName("svg")[0];n&&(n.setAttribute("aria-hidden","true"),n.style.position="absolute",n.style.width=0,n.style.height=0,n.style.overflow="hidden",e(n,document.body))}var t='<svg><symbol id="layx-icon-warn" viewBox="0 0 1044 1024"><path d="M589.8368 120.10666667q2.88 4.8 19.68 33.12t42.24 71.52 57.12 97.92 65.28 111.84 66.72 113.28 60.48 103.2 47.04 80.64 27.36 46.08q14.4 24 17.76 48t-2.88 43.2-22.08 31.2-38.88 11.04q-11.52 0-48.96-0.48t-90.24-0.48l-120 0-135.36 0q-69.12 0-137.28 0.48t-126.72 0.48l-102.72 0-65.28 0q-36.48 0-56.16-12.48t-26.4-32.16-1.44-42.72 18.72-43.2q6.72-10.56 26.4-43.2t47.52-79.2 61.44-102.72 68.16-114.24 67.2-112.8 58.56-98.88 43.2-72.96l20.16-33.6q13.44-21.12 35.04-32.16t44.64-11.04 44.64 10.08 35.04 30.24zM565.8368 308.26666667q0-11.52-5.28-21.6t-13.92-18.24-19.68-12.96-22.56-4.8q-22.08 0-40.8 17.28t-18.72 39.36l0 251.52q0 22.08 18.72 39.84t40.8 17.76q23.04 0 42.24-16.8t19.2-38.88l0-252.48zM504.3968 673.06666667q-24.96 0-42.72 17.28t-17.76 42.24 17.76 42.72 42.72 17.76 42.24-17.76 17.28-42.72-17.28-42.24-42.24-17.28z" ><\/path><\/symbol><symbol id="layx-icon-help" viewBox="0 0 1024 1024"><path d="M512.697383 63.444984c-247.538793 0-448.208115 200.649879-448.208115 448.208115 0 247.520373 200.66932199 448.208115 448.208115 448.20811499s448.208115-200.68774199 448.20811499-448.20811499C960.90549801 264.094864 760.236176 63.444984 512.697383 63.444984zM510.98846199 735.138056c-25.550932 0-46.25958-21.30114199-46.25958-47.563272s20.708648-47.563272 46.25958-47.563272c25.56116599 0 46.269813 21.30114199 46.26981301 47.563272S536.548604 735.138056 510.98846199 735.138056zM640.211569 436.222129c-6.383384 12.29195401-13.970176 22.86986999-22.75116701 31.769564-8.78098999 8.936533-24.55730201 23.927969-47.29925899 45.046962-6.291287 5.945409-11.334139 11.161201-15.11934899 15.684214-3.792373 4.48719799-6.619768 8.608052-8.46274201 12.365632-1.868557 3.71971799-3.291976 7.47729799-4.303003 11.197016-1.013073 3.756557-2.543939 10.32208999-4.57929499 19.73343699-3.518127 19.95037801-14.524808 29.910217-33.02720802 29.91021701-9.611915 0-17.70831401-3.24797401-24.26565998-9.775644-6.573719-6.529717-9.848299-16.194844-9.84829901-29.071106 0-16.086373 2.39862999-30.05552601 7.204076-41.83685101 4.814656-11.818163 11.18882999-22.177092 19.150152-31.07678599 7.960299-8.89969399 18.684548-19.514449 32.17991-31.806403 11.835559-10.724249 20.39858601-18.821671 25.660426-24.293289 5.287423-5.470595 9.72038601-11.562337 13.32344701-18.273179 3.610224-6.711865 5.415336-14.007015 5.415336-21.84861101 0-15.355733-5.508457-28.305673-16.50388201-38.84572699-11.016915-10.541077-25.205055-15.830547-42.594097-15.830547-20.354584 0-35.33578599 5.325285-44.94770099 15.975856-9.62010199 10.650571-17.754363 26.29794599-24.42017901 47.05264199-6.291287 21.66646199-18.219967 32.49918199-35.791158 32.49918201-10.349719 0-19.10308-3.793396-26.217105-11.380188-7.121188-7.586792-10.6782-15.793708-10.6782-24.583908 0-18.237363 5.635347-36.694737 16.915251-55.405891 11.279904-18.67533799 27.757181-34.17638 49.396014-46.43251901 21.63064599-12.292977 46.888913-18.420535 75.742055-18.42053499 26.825972 0 50.489928 5.143137 71.025637 15.392572 20.534685 10.249435 36.39286199 24.219611 47.580668 41.83685099 11.189853 17.654079 16.788361 36.839023 16.78836099 57.557904C649.785621 409.668357 646.593929 423.96701401 640.211569 436.222129z" ><\/path><\/symbol><symbol id="layx-icon-right" viewBox="0 0 1024 1024"><path d="M511.59752247 82.09957256c-237.19528125 0-429.47861308 192.28333184-429.4786131 429.47771397 0 237.19528125 192.28333184 429.47771396 429.47861309 429.47771396 237.19438213 0 429.47681484-192.28153271 429.47681485-429.47771396C941.07343818 274.38380352 748.79100547 82.09957256 511.59752247 82.09957256zM416.15603193 750.07218711L225.32791396 559.24676651l47.61641602-47.61641602L416.15603193 654.84205332l334.09018653-334.09198564 47.6155169 47.61461689L416.15603193 750.07218711z" ><\/path><\/symbol><symbol id="layx-icon-restore" viewBox="0 0 1157 1024"><path d="M1016.52185234 724.44050175L833.87364805 724.44050175 833.87364805 898.52098643 833.87364805 960.05279112 833.87364805 961.2211168 772.34184336 961.2211168 772.34184336 960.05279112 124.31068789 960.05279112 124.31068789 961.2211168 62.7788832 961.2211168 62.7788832 960.05279112 62.7788832 898.52098643 62.7788832 360.31241885 62.7788832 298.78061416 124.31068789 298.78061416 298.78061416 298.78061416 298.78061416 62.7788832 303.06447442 62.7788832 360.31241885 62.7788832 1016.52185234 62.7788832 1074.15923838 62.7788832 1078.05365615 62.7788832 1078.05365615 662.90869795 1078.05365615 724.44050175 1016.52185234 724.44050175ZM124.31068789 898.52098643L772.34184336 898.52098643 772.34184336 724.44050175 772.34184336 662.90869795 772.34184336 360.31241885 124.31068789 360.31241885 124.31068789 898.52098643ZM1016.52185234 124.31068789L360.31241885 124.31068789 360.31241885 298.78061416 772.34184336 298.78061416 833.87364805 298.78061416 833.87364805 360.31241885 833.87364805 662.90869795 1016.52185234 662.90869795 1016.52185234 124.31068789Z" ><\/path><\/symbol><symbol id="layx-icon-reload" viewBox="0 0 1024 1024"><path d="M919.8125 399.5L751.0625 399.5c-23.203125 0-42.1875-18.984375-42.1875-42.1875 0-23.203125 18.984375-42.1875 42.1875-42.1875l68.90625 0C755.28125 213.875 641.375 146.375 512 146.375c-201.796875 0-365.625 163.828125-365.625 365.625 0 201.796875 163.828125 365.625 365.625 365.625 196.875 0 357.890625-156.09375 364.921875-351.5625l0.703125 0c0-23.203125 18.984375-42.1875 42.1875-42.1875 23.203125 0 42.1875 18.984375 42.1875 42.1875 0 2.8125 0 5.625-0.703125 7.734375C950.046875 772.15625 753.171875 962 512 962 263.796875 962 62 760.203125 62 512 62 263.796875 263.796875 62 512 62c150.46875 0 284.0625 73.828125 365.625 187.734375L877.625 188.5625c0-23.203125 18.984375-42.1875 42.1875-42.1875 23.203125 0 42.1875 18.984375 42.1875 42.1875l0 168.75C962 380.515625 943.015625 399.5 919.8125 399.5z" ><\/path><\/symbol><symbol id="layx-icon-default-icon" viewBox="0 0 1024 1024"><path d="M891.88743395 61.93952995L132.11256605 61.93952995c-38.92547129 0-70.60411733 31.65534435-70.60411734 70.5924665L61.50844871 891.46800355c0 38.91382045 31.67864605 70.59246649 70.60411734 70.5924665l759.7748679 0c38.92547129 0 70.60411733-31.67864605 70.60411734-70.5924665L962.49155129 132.53199645C962.49155129 93.59487431 930.81290525 61.93952995 891.88743395 61.93952995zM844.02576498 142.29540409c16.71896178 0 30.25724302 13.54993209 30.25724302 30.26889386 0 16.70731093-13.53828125 30.25724302-30.25724302 30.25724303s-30.25724302-13.54993209-30.25724303-30.25724303C813.76852195 155.84533618 827.3068032 142.29540409 844.02576498 142.29540409zM735.60300658 142.29540409c16.71896178 0 30.25724302 13.54993209 30.25724302 30.26889386 0 16.70731093-13.53828125 30.25724302-30.25724302 30.25724303s-30.25724302-13.54993209-30.25724303-30.25724303C705.34576355 155.84533618 718.8840448 142.29540409 735.60300658 142.29540409zM881.80945351 881.37837227L142.19054649 881.37837227 142.19054649 277.92288427l739.60725618 0L881.79780267 881.37837227zM758.85809209 638.26020125l-0.01165084-180.19196018 90.09598008 90.09598008L758.85809209 638.26020125zM265.15355875 638.26020125l-90.09598008-90.0959801 90.08432924-90.08432924L265.15355875 638.26020125z" ><\/path><\/symbol><symbol id="layx-icon-min" viewBox="0 0 1024 1024"><path d="M65.23884 456.152041 958.760137 456.152041l0 111.695918L65.23884 567.847959 65.23884 456.152041z" ><\/path><\/symbol><symbol id="layx-icon-max" viewBox="0 0 1024 1024"><path d="M75.74912227 948.24738475L75.74912227 75.75145131l872.50059037 0 0 872.49593344L75.74912227 948.24738475zM839.18786674 184.81446115L184.81213326 184.81446115l0 654.37573462 654.37573461 0L839.18786674 184.81446115z" ><\/path><\/symbol><symbol id="layx-icon-debug" viewBox="0 0 1024 1024"><path d="M990.18635001 578.93861562c0 10.3648125-3.782715 19.33089375-11.35486126 26.90304001-7.57310531 7.57310531-16.5372675 11.3606175-26.89728375 11.3606175L818.04354219 617.20227312c0 68.14739625-13.34551219 125.92518281-40.04900719 173.34295313l124.32690656 124.934175c7.57214625 7.56159281 11.3606175 16.53247125 11.3606175 26.89728375 0 10.36001625-3.782715 19.32609657-11.3606175 26.89824281-7.17497531 7.56159281-16.13434125 11.350065-26.89728375 11.350065-10.75814625 0-19.72518656-3.78847125-26.89728375-11.350065L730.17287844 851.51860625c-1.99161001 1.98585375-4.97710594 4.578975-8.96128407 7.765935-3.9928125 3.186-12.3564225 8.872065-25.11097499 17.03612906-12.74879625 8.17078031-25.70193375 15.44360906-38.84982 21.82136531-13.1526825 6.37295906-29.49616125 12.15591844-49.02180283 17.33736563-19.52564156 5.17281281-38.85653531 7.76785313-57.97733155 7.76785312L550.251665 387.6750125l-76.51100531 0 0 535.57224188c-20.31422719 0-40.54690875-2.69481281-60.66351-8.07676407-20.13099094-5.376195-37.46260031-11.95253625-52.00921781-19.72422656-14.54853562-7.77169125-27.69546281-15.53666625-39.44749501-23.31315376-11.75778844-7.77265031-20.419755-14.24346281-26.0060475-19.4201128l-8.96128406-8.3741625L177.26614999 968.07478156c-7.96931719 8.36360906-17.53115344 12.55021125-28.69318593 12.55021125-9.56375531 0-18.12691031-3.19175625-25.69617844-9.56471531-7.57406437-7.17401625-11.659935-16.040325-12.26336531-26.59892625-0.59383781-10.55956031 2.49334969-19.82208094 9.27499125-27.79427531l120.73797938-135.68176782c-23.10977156-45.43575469-34.66897406-100.03041937-34.66897407-163.79071031L72.06771406 617.19459781c-10.36673156 0-19.32801562-3.78847125-26.89728375-11.35486124-7.57406437-7.5769425-11.36253657-16.5382275-11.36253656-26.90304 0-10.36001625 3.78847125-19.33089375 11.36253656-26.89632469 7.56926812-7.56830906 16.53055219-11.35102406 26.89728375-11.35102407l133.88874375 0L205.95645781 364.95953375l-103.40828906-103.40828906c-7.57022719-7.57310531-11.35678031-16.5382275-11.35678031-26.89824281 0-10.35905625 3.79134938-19.33089375 11.35678031-26.89728376 7.56734906-7.57214625 16.53630844-11.36541469 26.89824281-11.36541469 10.36577156 0 19.32417844 3.79902469 26.89920188 11.3654147l103.40828906 103.40828906 504.49507219 0 103.40924812-103.40828907c7.56639001-7.57214625 16.53055219-11.36541469 26.89728375-11.36541469 10.36001625 0 19.32897469 3.79902469 26.89632469 11.36541469 7.57310531 7.56639001 11.36157655 16.5382275 11.36157656 26.89728375 0 10.36001625-3.78847125 19.32609657-11.36157656 26.89824282l-103.40828906 103.40828906 0 175.73269312 133.88970281 0c10.3648125 0 19.32993469 3.782715 26.89728375 11.35678032 7.57214625 7.56543094 11.3606175 16.53630844 11.3606175 26.89056843l0 0L990.18635001 578.93861562 990.18635001 578.93861562zM703.26983938 234.64820469L320.72056719 234.64820469c0-52.99351031 18.62960906-98.12611031 55.89074625-135.38820656 37.25058375-37.26209625 82.3899-55.88594906 135.38532843-55.88594907 52.99638844 0 98.13570375 18.62385281 135.38724751 55.88594907C684.64694563 136.52113438 703.26983938 181.65469437 703.26983938 234.64820469L703.26983938 234.64820469 703.26983938 234.64820469 703.26983938 234.64820469z" ><\/path><\/symbol><symbol id="layx-icon-destroy" viewBox="0 0 1024 1024"><path d="M933.89254819 139.71606348L884.23129279 90.08990363 511.96490363 462.39138834 140.40044113 90.82692583 90.84447403 140.34779656 462.40893653 511.91225907 90.10745181 884.2137446 139.73361166 933.875 512.03509637 561.53841892 883.59955887 933.10288141 933.15552597 883.58201068 561.59106347 512.01754819Z" ><\/path><\/symbol><symbol id="layx-icon-error" viewBox="0 0 1024 1024"><path d="M482 50.66666667C235.99999999 50.66666667 32 254.66666667 32 500.66666667s204.00000001 450 450 450 450-204.00000001 450-450S728 50.66666667 482 50.66666667z m192 576c18 18 18 42 0 60-18 18-42 18-60 0L488 560.66666667 356 692.66666667c-18 18-48 18-66 0-18-18-18-48 0-66L422 494.66666667 296 368.66666667c-18-18-18-42 0-60 18-18 42-18 60 0L482 434.66666667l132-132c18-18 48-18 66 0 18 18 18 48-1e-8 66L548 500.66666667l126 126z" fill="" ><\/path><\/symbol><symbol id="layx-icon-stick" viewBox="0 0 1024 1024"><path d="M863.92416068 184.3484319H160.07583932a50.27488011 50.27488011 0 0 1 0-100.5497602h703.84832136a50.27488011 50.27488011 0 0 1 0 100.5497602z m-50.27488007 804.39808157a50.22460522 50.22460522 0 0 1-35.69516489-14.57971521L512 708.21268254l-265.95411572 265.95411572A50.27488011 50.27488011 0 0 1 160.07583932 938.47163339V335.1730722a50.27488011 50.27488011 0 0 1 50.27488007-50.27488013h603.29856122a50.27488011 50.27488011 0 0 1 50.27488007 50.27488013v603.29856119a50.27488011 50.27488011 0 0 1-50.27488007 50.27488008z m-301.64928061-402.19904078a50.22460522 50.22460522 0 0 1 35.69516487 14.57971522L763.37440051 816.80642355V385.44795228H260.62559949v431.86122007l215.67923564-215.67923564A50.27488011 50.27488011 0 0 1 512 586.54747269z" ><\/path><\/symbol><\/svg>',i=function(){var n=document.getElementsByTagName("script");return n[n.length-1]}(),r=i.getAttribute("data-injectcss"),u=function(t){function r(n,t){var i=n.document,r=!1,u=function(){r||(r=!0,t())},f=function(){try{i.documentElement.doScroll("left")}catch(n){setTimeout(f,50);return}u()};f();i.onreadystatechange=function(){i.readyState=="complete"&&(i.onreadystatechange=null,u())}}if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(t,0);else{var i=function(){document.removeEventListener("DOMContentLoaded",i,!1);t()};document.addEventListener("DOMContentLoaded",i,!1)}else document.attachEvent&&r(n,t)},f=function(n,t){t.parentNode.insertBefore(n,t)},e=function(n,t){t.firstChild?f(n,t.firstChild):t.appendChild(n)};if(r&&!n.__iconfont__svg__cssinject__){n.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}<\/style>")}catch(s){console&&console.log(s)}}u(o)}(window); |
| | |
| | | <meta charset="utf-8"> |
| | | <title>自动仓库WCS系统</title> |
| | | <link rel="stylesheet" href="../static/css/index.css"> |
| | | <link rel="stylesheet" href="../static/css/layx.min.css" type="text/css" /> |
| | | <script src="../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script src="../static/js/tools/layx.min.js"></script> |
| | | <style> |
| | | |
| | | .layx-window.layx-skin-news .layx-control-bar { |
| | | background-color: #333333; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | |
| | | |
| | | // 系统运行状态 |
| | | var systemRunning = true; |
| | | |
| | | news();layx.min('wcs-news'); |
| | | function news() { |
| | | layx.iframe( |
| | | 'wcs-news' // id |
| | | , '系统分析报告' |
| | | , "news.html" |
| | | , { |
| | | shadow:false |
| | | , storeStatus:false |
| | | // , skin: 'news' |
| | | , width:800 |
| | | , height:600 |
| | | , position:'rb' |
| | | // , control:false |
| | | , opacity:0.9 |
| | | , border:false |
| | | , icon:'<img src="../static/images/favicon.ico" style="height:22px;display:block;" alt=""/>' |
| | | , stickMenu:true |
| | | , maxMenu:false |
| | | , closeMenu:false |
| | | , moveLimit:{ |
| | | leftOut: false, |
| | | rightOut: false, |
| | | topOut: false, |
| | | bottomOut: false, |
| | | } |
| | | , minWidth:300 |
| | | , minHeight:300 |
| | | , borderRadius: '8px' |
| | | , shadeDestroy:true |
| | | , escKey: false |
| | | , event:{ |
| | | onmin: { |
| | | after: function () { |
| | | $('.layx-min-statu').css("left", "inherit").css("right", "10px") |
| | | } |
| | | } |
| | | , onrestore:{ |
| | | after: function () { |
| | | let win = layx.getFrameContext('wcs-news'); |
| | | win.autoScroll = true |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>NEWS</title> |
| | | <style> |
| | | /** {*/ |
| | | /* padding: 0;*/ |
| | | /* margin: 0;*/ |
| | | /*}*/ |
| | | .container { |
| | | height: 100%; |
| | | width: 100%; |
| | | } |
| | | /*=============== SCROLL UP ===============*/ |
| | | .scrollup { |
| | | text-decoration: none; |
| | | text-align: center; |
| | | width: 25px; |
| | | height: 18px; |
| | | position: fixed; |
| | | right: 1rem; |
| | | bottom: -55%; |
| | | background-color: rgb(108,167,168); |
| | | box-shadow: 0 8px 12px hsla(228, 66%, 45%, .1); |
| | | display: inline-flex; |
| | | padding: .35rem; |
| | | border-radius: .25rem; |
| | | color: #ffffff; |
| | | z-index: 10; |
| | | transition: .3s; |
| | | font-size: 8px; |
| | | } |
| | | .scrollup:hover { |
| | | transform: translateY(-.25rem); |
| | | } |
| | | /* Show Scroll Up*/ |
| | | .show-scroll { |
| | | bottom: 5%; |
| | | } |
| | | |
| | | .news-desc { |
| | | font-size: 14px; |
| | | } |
| | | .level-1 { |
| | | color: #333333; |
| | | } |
| | | .level-2 { |
| | | color: #0087ec; |
| | | } |
| | | .level-3 { |
| | | color: red; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div class="container"> |
| | | |
| | | </div> |
| | | <a class="scrollup" id="scroll-up"> |
| | | <span>顶部</span> |
| | | </a> |
| | | </body> |
| | | <script src="../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script src="../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script src="../static/js/common.js"></script> |
| | | <script> |
| | | var autoScroll = true; |
| | | |
| | | function scrollUp(){ |
| | | const scrollUp = document.getElementById('scroll-up'); |
| | | if(this.scrollY >= 100) scrollUp.classList.add('show-scroll'); else scrollUp.classList.remove('show-scroll') |
| | | } |
| | | window.addEventListener('scroll', scrollUp) |
| | | |
| | | $(document).on('click ','#scroll-up', function () { |
| | | window.scrollTo(0, 0); |
| | | autoScroll = false; |
| | | }) |
| | | |
| | | $(document).on('click ','body', function () { |
| | | autoScroll = false; |
| | | }) |
| | | |
| | | setInterval(()=>{ |
| | | $.ajax({ |
| | | url: baseUrl + "/news/print", |
| | | // headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | let template = Handlebars.compile($('#newsTpl').html()); |
| | | $('.container').html(template({list: res.data})); |
| | | if (autoScroll) { |
| | | window.scrollTo(0, document.body.scrollHeight) |
| | | } |
| | | } else if (res.code === 403) { |
| | | window.location.href = baseUrl + "/login"; |
| | | } else { |
| | | console.error(res.msg); |
| | | } |
| | | } |
| | | }) |
| | | }, 1000) |
| | | |
| | | </script> |
| | | <script type="text/template" id="newsTpl"> |
| | | {{#each list}} |
| | | <div class="news-desc level-{{l}}"> |
| | | <span>{{t}}</span> - <span>{{v}}</span> |
| | | </div> |
| | | {{/each}} |
| | | </script> |
| | | </html> |