2023-4-26
@ -0,0 +1,273 @@
|
||||
package com.ruoyi.web.controller.nanjing;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.config.Global;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.config.Global;
|
||||
import com.ruoyi.nanjing.domain.BaseFileInfo;
|
||||
import com.ruoyi.nanjing.domain.BaseFileType;
|
||||
import com.ruoyi.nanjing.domain.BaseScadaDeviceInfo;
|
||||
import com.ruoyi.nanjing.service.IBaseFileTypeService;
|
||||
import com.ruoyi.nanjing.service.IBaseScadaDeviceInfoService;
|
||||
import com.ruoyi.nanjing.service.ISysFileInfoService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 上传文档Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-03-17
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/nanjing/fileinfo")
|
||||
public class BaseFileInfoController extends BaseController {
|
||||
private static final Logger log = LoggerFactory.getLogger(BaseFileInfoController.class);
|
||||
|
||||
private String prefix = "nanjing/base_fileinfo";
|
||||
|
||||
@Autowired
|
||||
private ISysFileInfoService sysFileInfoService;
|
||||
|
||||
@Autowired
|
||||
private IBaseFileTypeService baseFileTypeService;
|
||||
|
||||
@Autowired
|
||||
private IBaseScadaDeviceInfoService baseScadaDeviceInfoService;
|
||||
private List<BaseFileType> fileTypeList;
|
||||
|
||||
@RequiresPermissions("device:info:view")
|
||||
@GetMapping()
|
||||
public String info(ModelMap mmap) {
|
||||
if (fileTypeList == null) {
|
||||
fileTypeList = baseFileTypeService.selectBaseFileTypeList(null);
|
||||
}
|
||||
mmap.put("fileTypeList", fileTypeList);
|
||||
System.out.println("=============================================================");
|
||||
System.out.println("=======================filetypelist==========================");
|
||||
System.out.println("=============================================================");
|
||||
/* mmap.put("fileTypeId", typeId);*/
|
||||
System.out.println(fileTypeList);
|
||||
return prefix + "/info";
|
||||
}
|
||||
|
||||
@GetMapping("/{typeId}")
|
||||
public String info(@PathVariable(value = "typeId") Long typeId, ModelMap mmap) {
|
||||
if (fileTypeList == null) {
|
||||
fileTypeList = baseFileTypeService.selectBaseFileTypeList(null);
|
||||
}
|
||||
|
||||
mmap.put("fileTypeList", fileTypeList);
|
||||
mmap.put("fileTypeId", typeId);
|
||||
return prefix + "/info";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询上传文档列表
|
||||
*/
|
||||
@RequiresPermissions("device:info:list")
|
||||
@PostMapping({"/list","/list/{deviceId}"})
|
||||
@ResponseBody
|
||||
public TableDataInfo list(@PathVariable(value = "deviceId",required = false) String deviceId, BaseFileInfo baseFileInfo) {
|
||||
startPage();
|
||||
if (deviceId !=null){
|
||||
baseFileInfo.setDeviceId(deviceId);
|
||||
}
|
||||
List<BaseFileInfo> list = sysFileInfoService.selectSysFileInfoList(baseFileInfo);
|
||||
System.out.println(list);
|
||||
// for (int i=0;i<list.size();i++){
|
||||
// String s = baseScadaDeviceInfoService.selectDeviceName(deviceId);
|
||||
// list.get(i)
|
||||
// }
|
||||
|
||||
|
||||
return getDataTable(list);
|
||||
}
|
||||
// @PostMapping("/list222")
|
||||
// @ResponseBody
|
||||
// public TableDataInfo list2(Long test,ModelMap mmap){
|
||||
// startPage();
|
||||
// System.out.println("========================================");
|
||||
// System.out.println(test);
|
||||
// List<BaseFileInfo> list = sysFileInfoService.selectSysFileInfoListByfileType(test);
|
||||
// mmap.put("fileTypeList2", list);
|
||||
// return getDataTable(list);
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* 导出上传文档列表
|
||||
*/
|
||||
@RequiresPermissions("device:info:export")
|
||||
@Log(title = "上传文档", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BaseFileInfo baseFileInfo) {
|
||||
List<BaseFileInfo> list = sysFileInfoService.selectSysFileInfoList(baseFileInfo);
|
||||
ExcelUtil<BaseFileInfo> util = new ExcelUtil<BaseFileInfo>(BaseFileInfo.class);
|
||||
return util.exportExcel(list, "上传文档数据");
|
||||
}
|
||||
|
||||
private List<BaseScadaDeviceInfo> baseScadaDeviceInfos;
|
||||
|
||||
/**
|
||||
* 新增上传文档
|
||||
*/
|
||||
@GetMapping("/add2/{typeId}")
|
||||
public String add(@PathVariable("typeId") Long typeId, ModelMap mmap) {
|
||||
if (baseScadaDeviceInfos == null || baseScadaDeviceInfos.isEmpty()) {
|
||||
baseScadaDeviceInfos = baseScadaDeviceInfoService.selectAllBaseScadaDeviceInfoList();
|
||||
}
|
||||
mmap.put("baseScadaDeviceInfos", baseScadaDeviceInfos);
|
||||
|
||||
if (fileTypeList == null) {
|
||||
fileTypeList = baseFileTypeService.selectBaseFileTypeList(null);
|
||||
}
|
||||
mmap.put("fileTypeList", fileTypeList);
|
||||
mmap.put("fileTypeId", typeId);
|
||||
|
||||
return prefix + "/add";
|
||||
}
|
||||
@GetMapping("/adddevice/{deviceId}")
|
||||
public String add1(@PathVariable("deviceId") String deviceId, ModelMap mmap) {
|
||||
if (fileTypeList == null) {
|
||||
fileTypeList = baseFileTypeService.selectBaseFileTypeList(null);
|
||||
}
|
||||
mmap.put("fileTypeList", fileTypeList);
|
||||
mmap.put("deviceId", deviceId);
|
||||
return prefix + "/add_device";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存上传文档
|
||||
*/
|
||||
@RequiresPermissions("device:info:add")
|
||||
@Log(title = "上传文档", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BaseFileInfo baseFileInfo, ModelMap mmap) {
|
||||
// List<BaseScadaDeviceInfo> baseScadaDeviceInfos = baseScadaDeviceInfoService.selectAllBaseScadaDeviceInfoList();
|
||||
// mmap.put("baseScadaDeviceInfos", baseScadaDeviceInfos);
|
||||
return toAjax(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改上传文档
|
||||
*/
|
||||
@RequiresPermissions("device:info:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
|
||||
if (fileTypeList == null) {
|
||||
fileTypeList = baseFileTypeService.selectBaseFileTypeList(null);
|
||||
}
|
||||
mmap.put("fileTypeList", fileTypeList);
|
||||
BaseFileInfo baseFileInfo = sysFileInfoService.selectSysFileInfoById(id);
|
||||
mmap.put("sysFileInfo", baseFileInfo);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存上传文档
|
||||
*/
|
||||
@RequiresPermissions("device:info:edit")
|
||||
@Log(title = "上传文档", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BaseFileInfo baseFileInfo) {
|
||||
return toAjax(sysFileInfoService.updateSysFileInfo(baseFileInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除上传文档
|
||||
*/
|
||||
@RequiresPermissions("device:info:remove")
|
||||
@Log(title = "上传文档", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids) {
|
||||
return toAjax(sysFileInfoService.deleteSysFileInfoByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 多文件上传
|
||||
*/
|
||||
@RequestMapping(value = "/uploadDocs", produces = "application/json;charset=utf-8")
|
||||
@ResponseBody
|
||||
public AjaxResult uploadDocs(String deviceCode, Long fileTypeId, String typeName, MultipartFile file) {
|
||||
|
||||
String uploadFileName = file.getOriginalFilename();
|
||||
int index = uploadFileName.lastIndexOf('.');
|
||||
if (index == -1 || index == uploadFileName.length()) {
|
||||
return error();
|
||||
}
|
||||
int tagIndex = uploadFileName.indexOf("-");
|
||||
if (tagIndex == -1) {
|
||||
return error("文件格式不规范");
|
||||
}
|
||||
BaseFileInfo baseFileInfo = new BaseFileInfo();
|
||||
baseFileInfo.setDeviceId(deviceCode);
|
||||
baseFileInfo.setFileTypeId(fileTypeId);
|
||||
baseFileInfo.setFileNum(uploadFileName.substring(0, tagIndex)); //文档编号
|
||||
baseFileInfo.setFileName(uploadFileName.substring(tagIndex+1, index));//文档名称
|
||||
String filePath = Global.getUploadPath() + "/devicefile";
|
||||
baseFileInfo.setFilePath(filePath);
|
||||
try {
|
||||
// 上传并返回新文件地址
|
||||
String pathName = FileUploadUtils.upload(filePath, file);
|
||||
System.out.println("上传并返回新文件地址:" + pathName);
|
||||
String str = Global.getUploadPathRecorrect() + pathName.replace("/profile/", "");
|
||||
baseFileInfo.setFilePath(str);
|
||||
sysFileInfoService.insertSysFileInfo(baseFileInfo);
|
||||
return success();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return error();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 本地资源通用下载
|
||||
*/
|
||||
@GetMapping("/download/{id}")
|
||||
public void resourceDownload(@PathVariable Long id, HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception {
|
||||
|
||||
BaseFileInfo fileInfo = sysFileInfoService.selectSysFileInfoById(id);
|
||||
String path=fileInfo.getFilePath();
|
||||
System.out.println(path);
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("multipart/form-data");
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request,
|
||||
fileInfo.getFileNum()+"-"+fileInfo.getFileName()+
|
||||
path.substring(path.lastIndexOf("."),path.length())
|
||||
)
|
||||
);
|
||||
FileUtils.writeBytes(path, response.getOutputStream());
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,160 @@
|
||||
package com.ruoyi.web.controller.nanjing;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
|
||||
import com.ruoyi.nanjing.domain.BaseFileType;
|
||||
import com.ruoyi.nanjing.service.IBaseFileTypeService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件类型管理Controller
|
||||
*
|
||||
* @author wangh
|
||||
* @date 2022-03-30
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/nanjing/base_filetype")
|
||||
public class BaseFileTypeController extends BaseController
|
||||
{
|
||||
private String prefix = "nanjing/base_filetype";
|
||||
|
||||
@Autowired
|
||||
private IBaseFileTypeService baseFileTypeService;
|
||||
|
||||
@RequiresPermissions("device:base_filetype:view")
|
||||
@GetMapping()
|
||||
public String base_filetype()
|
||||
{
|
||||
return prefix + "/base_filetype";
|
||||
}
|
||||
@GetMapping("/base_filetype1")
|
||||
public String base_filetype1()
|
||||
{
|
||||
return prefix + "/base_filetype1";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文件类型管理列表
|
||||
*/
|
||||
@RequiresPermissions("device:base_filetype:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BaseFileType baseFileType)
|
||||
{
|
||||
startPage();
|
||||
baseFileType.setFileTypeTag(0L);
|
||||
List<BaseFileType> list = baseFileTypeService.selectBaseFileTypeList(baseFileType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/list1")
|
||||
@ResponseBody
|
||||
public TableDataInfo list1(BaseFileType baseFileType)
|
||||
{
|
||||
startPage();
|
||||
baseFileType.setFileTypeTag(1L);
|
||||
List<BaseFileType> list = baseFileTypeService.selectBaseFileTypeList(baseFileType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文件类型管理列表
|
||||
*/
|
||||
@RequiresPermissions("device:base_filetype:export")
|
||||
@Log(title = "文件类型管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BaseFileType baseFileType)
|
||||
{
|
||||
List<BaseFileType> list = baseFileTypeService.selectBaseFileTypeList(baseFileType);
|
||||
ExcelUtil<BaseFileType> util = new ExcelUtil<BaseFileType>(BaseFileType.class);
|
||||
return util.exportExcel(list, "文件类型管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件类型管理
|
||||
*/
|
||||
@GetMapping("/add/{id}")
|
||||
public String add(@PathVariable("id")Long id,ModelMap mmap)
|
||||
{
|
||||
mmap.put("FileTypeTag",id);
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存文件类型管理
|
||||
*/
|
||||
@RequiresPermissions("device:base_filetype:add")
|
||||
@Log(title = "文件类型管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BaseFileType baseFileType)
|
||||
{
|
||||
BaseFileType baseFileType1=new BaseFileType();
|
||||
String name=baseFileType.getFileName();
|
||||
baseFileType1.setFileName(name);
|
||||
List<BaseFileType> list = baseFileTypeService.selectBaseFileTypeList(baseFileType1);
|
||||
if (list==null||list.isEmpty()){
|
||||
baseFileType.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(baseFileTypeService.insertBaseFileType(baseFileType));
|
||||
}
|
||||
return error("名称 '"+name+"' 重复");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文件类型管理
|
||||
*/
|
||||
@RequiresPermissions("device:base_filetype:edit")
|
||||
@GetMapping("/edit/{objid}")
|
||||
public String edit(@PathVariable("objid") Long objid, ModelMap mmap)
|
||||
{
|
||||
BaseFileType baseFileType = baseFileTypeService.selectBaseFileTypeByObjid(objid);
|
||||
mmap.put("baseFileType", baseFileType);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存文件类型管理
|
||||
*/
|
||||
@RequiresPermissions("device:base_filetype:edit")
|
||||
@Log(title = "文件类型管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BaseFileType baseFileType)
|
||||
{
|
||||
BaseFileType baseFileType1=new BaseFileType();
|
||||
String name=baseFileType.getFileName();
|
||||
baseFileType1.setFileName(name);
|
||||
List<BaseFileType> list = baseFileTypeService.selectBaseFileTypeList(baseFileType1);
|
||||
if (list==null||list.isEmpty()||list.get(0).getObjid().equals(baseFileType.getObjid())){
|
||||
baseFileType.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(baseFileTypeService.updateBaseFileType(baseFileType));
|
||||
}
|
||||
return error("名称 '"+name+"' 重复");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件类型管理
|
||||
*/
|
||||
@RequiresPermissions("device:base_filetype:remove")
|
||||
@Log(title = "文件类型管理", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(baseFileTypeService.deleteBaseFileTypeByObjids(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,174 @@
|
||||
package com.ruoyi.web.controller.nanjing;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.nanjing.domain.QsProduct;
|
||||
import com.ruoyi.nanjing.domain.QtProduct;
|
||||
import com.ruoyi.nanjing.service.ITBdProductinfoService;
|
||||
import com.ruoyi.nanjing.service.ITBdProducttypeService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.schema.Model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 看板管理
|
||||
* */
|
||||
@Controller
|
||||
@RequestMapping("/nanjing/Kanban")
|
||||
public class KanbanController {
|
||||
private String prefix = "nanjing/broad";
|
||||
@Autowired
|
||||
private ITBdProducttypeService producttypeService;
|
||||
|
||||
@Autowired
|
||||
private ITBdProductinfoService productinfoService;
|
||||
|
||||
//2023-03-01T00:00:00.000+0800
|
||||
@GetMapping()
|
||||
public String kanBan(){
|
||||
return prefix + "/index";
|
||||
}
|
||||
//qtController
|
||||
@PostMapping("/listKanBan")
|
||||
@ResponseBody
|
||||
public AjaxResult listKanBan(QtProduct qtProduct){
|
||||
Date beginTime = qtProduct.getBeginTime();
|
||||
// System.out.println(beginTime);
|
||||
Date date = new Date();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
System.out.println(formatter.format(date));
|
||||
|
||||
Calendar calendar1 = Calendar.getInstance();
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
||||
calendar1.add(Calendar.DATE, -7);
|
||||
String three_days_ago = sdf1.format(calendar1.getTime());
|
||||
System.out.println(three_days_ago);
|
||||
|
||||
Map map = new HashMap<String,Object>();
|
||||
map.put("beginTime",three_days_ago);
|
||||
// map.put("beginTime",null);
|
||||
map.put("endTime",date);
|
||||
// map.put("endTime",null);
|
||||
map.put("productType","");
|
||||
// map.put("productType",qtProduct.getProductType());
|
||||
map.put("productId","");
|
||||
map.put("shiftId","");
|
||||
map.put("groupId","");
|
||||
List<QtProduct> list = producttypeService.selectQtProductList(map);
|
||||
// System.out.println("==================================================21321321321312");
|
||||
return AjaxResult.success(list);
|
||||
//查詢存儲過程,从中拿出所需参数
|
||||
//domain qt查看参数
|
||||
|
||||
}
|
||||
|
||||
@RequiresPermissions("nanjing:QsProduct:export")
|
||||
@Log(title = "时段统计", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(QsProduct qsProduct)
|
||||
{
|
||||
Map map = new HashMap<String,Object>();
|
||||
map.put("beginTime",qsProduct.getBeginTime());
|
||||
map.put("endTime",qsProduct.getEndTime());
|
||||
map.put("productType",qsProduct.getProductType());
|
||||
map.put("productId","");
|
||||
List<QsProduct> list = producttypeService.selectQsProductList(map);
|
||||
return AjaxResult.success(list);
|
||||
/**
|
||||
* domain qs 查看参数
|
||||
* */
|
||||
}
|
||||
|
||||
@PostMapping("/listDay")
|
||||
@ResponseBody
|
||||
public AjaxResult listDay(String endTime,String beginTime){
|
||||
Map map = new HashMap<String,Object>();
|
||||
map.put("beginTime",beginTime);
|
||||
map.put("endTime",endTime);
|
||||
// System.out.println(beginTime);
|
||||
// System.out.println(endTime);
|
||||
// producttypeService.selectQtListDay(map);
|
||||
Integer integer = producttypeService.selectQtListDay(map);
|
||||
// System.out.println(integer);
|
||||
|
||||
return AjaxResult.success(integer);
|
||||
}
|
||||
@PostMapping("/tongji")
|
||||
@ResponseBody
|
||||
public AjaxResult tongJi(String arr){
|
||||
Map map = new HashMap<String,Object>();
|
||||
//查询一周内的生产数据
|
||||
Date date = new Date();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// System.out.println(formatter.format(date));
|
||||
Calendar calendar1 = Calendar.getInstance();
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
||||
calendar1.add(Calendar.DATE, -7);
|
||||
String three_days_ago = sdf1.format(calendar1.getTime());
|
||||
// System.out.println(three_days_ago);
|
||||
map.put("beginTime",three_days_ago);
|
||||
// map.put("beginTime",null);
|
||||
// map.put("endTime",date);
|
||||
|
||||
map.put("ProductID",arr);
|
||||
// map.put("ProductId",5);
|
||||
List<Map<String, Integer>> map1 = producttypeService.selecttongji(map);
|
||||
|
||||
|
||||
return AjaxResult.success(map1);
|
||||
}
|
||||
@PostMapping("/hege")
|
||||
@ResponseBody
|
||||
public AjaxResult hege(){
|
||||
Map map = new HashMap<String,Object>();
|
||||
//查询一周内的生产数据
|
||||
Date date = new Date();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// System.out.println(formatter.format(date));
|
||||
Calendar calendar1 = Calendar.getInstance();
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
||||
calendar1.add(Calendar.DATE, -1);
|
||||
String three_days_ago = sdf1.format(calendar1.getTime());
|
||||
map.put("beginTime",three_days_ago);
|
||||
Integer hege = producttypeService.selecthege(map);
|
||||
Integer all = producttypeService.selectAllstate(map);
|
||||
double all2 = all;
|
||||
double hegelv = hege/all2;
|
||||
BigDecimal b1 = new BigDecimal(hegelv);
|
||||
double b2 = b1.setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
// System.out.println(b2+"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
||||
return AjaxResult.success(b2);
|
||||
}
|
||||
|
||||
@PostMapping("/zhanshi")
|
||||
@ResponseBody
|
||||
public AjaxResult zhanshi(){
|
||||
Map map = new HashMap<String,Object>();
|
||||
//查询一周内的生产数据
|
||||
Date date = new Date();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// System.out.println(formatter.format(date));
|
||||
Calendar calendar1 = Calendar.getInstance();
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
||||
calendar1.add(Calendar.DATE, -1);
|
||||
String three_days_ago = sdf1.format(calendar1.getTime());
|
||||
map.put("beginTime",three_days_ago);
|
||||
Integer hege = producttypeService.selecthege(map);
|
||||
Integer all = producttypeService.selectAllstate(map);
|
||||
Map map1 = new HashMap<String,Integer>();
|
||||
map1.put("shiji",hege);
|
||||
map1.put("yuji",all);
|
||||
return AjaxResult.success(map1);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package com.ruoyi.web.controller.nanjing;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.nanjing.domain.MainTenance;
|
||||
import com.ruoyi.nanjing.domain.uphold;
|
||||
import com.ruoyi.nanjing.service.ItimeOEEService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/nanjing/maint")
|
||||
public class MainTenanceController extends BaseController {
|
||||
@Autowired
|
||||
private ItimeOEEService itimeOEEService;
|
||||
private String prefix = "nanjing/uphold";
|
||||
@GetMapping
|
||||
public String uphold(){
|
||||
return prefix+"/index";
|
||||
}
|
||||
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo selectlist(String field){
|
||||
startPage();
|
||||
List<MainTenance> list;
|
||||
System.out.println(field);
|
||||
if (field!=""){
|
||||
|
||||
System.out.println(field+"isnotnull");
|
||||
list = itimeOEEService.selectMainTListByfield(field);
|
||||
}else
|
||||
{
|
||||
System.out.println(field+"==============null");
|
||||
list=itimeOEEService.selectMainTList();
|
||||
}
|
||||
|
||||
return getDataTable(list);
|
||||
}
|
||||
@GetMapping("/add")
|
||||
public String add(){
|
||||
return prefix+"/add";
|
||||
}
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(MainTenance maint){
|
||||
|
||||
int i = itimeOEEService.insertmaint(maint);
|
||||
return AjaxResult.success(i);
|
||||
}
|
||||
/**
|
||||
* 修改工位管理
|
||||
*/
|
||||
@GetMapping("/edit/{objid}")
|
||||
public String edit(@PathVariable("objid") Integer objid, ModelMap mmap )
|
||||
{
|
||||
MainTenance mainTenance =itimeOEEService.selectMainTListById(objid);
|
||||
mmap.put("maintenance",mainTenance);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(MainTenance mainTenance)
|
||||
{
|
||||
int i = itimeOEEService.updatemaint(mainTenance);
|
||||
return AjaxResult.success(i);
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(Integer ids) {
|
||||
|
||||
System.out.println(ids);
|
||||
return toAjax(itimeOEEService.deletemaintById(ids));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.web.controller.nanjing;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.nanjing.domain.TRpShiftInfo;
|
||||
import com.ruoyi.nanjing.service.TRpShiftInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/nanjing/TRpShiftInfo")
|
||||
public class TRpShiftInfoController extends BaseController {
|
||||
@Autowired
|
||||
private TRpShiftInfoService tRpShiftInfoService;
|
||||
|
||||
|
||||
@PostMapping("/nodeClick2")
|
||||
@ResponseBody
|
||||
public AjaxResult nodeClick2(String begin, String end)
|
||||
{
|
||||
|
||||
Map map = new HashMap<String,Object>();
|
||||
|
||||
List<TRpShiftInfo> selectplan = tRpShiftInfoService.selectplan();
|
||||
return AjaxResult.success(selectplan);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,140 @@
|
||||
package com.ruoyi.web.controller.nanjing;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.nanjing.domain.timeOEE;
|
||||
import com.ruoyi.nanjing.service.ItimeOEEService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/nanjing/timeOEE")
|
||||
public class timeOEEController extends BaseController {
|
||||
@Autowired
|
||||
private ItimeOEEService itimeOEEService;
|
||||
private String prefix = "nanjing/timeOEE";
|
||||
@GetMapping
|
||||
public String timeOEE(Model model){
|
||||
// int curr = 1;
|
||||
// int pageSize = 10;
|
||||
// PageHelper.startPage(curr,pageSize);
|
||||
List<timeOEE> list = itimeOEEService.selectTimeOEEList();
|
||||
List<BigDecimal> list2 =new ArrayList<>();
|
||||
BigDecimal a;
|
||||
BigDecimal b;
|
||||
BigDecimal c = BigDecimal.valueOf(0.00);
|
||||
System.out.println(list);
|
||||
model.addAttribute("timeOEE",list);
|
||||
for (int i=0;i<list.size();i++){
|
||||
a = list.get(i).getTimeValueRun();
|
||||
// System.out.println(a);
|
||||
b = list.get(i).getTimeLoad();
|
||||
// System.out.println(b);
|
||||
if (a.compareTo(BigDecimal.ZERO)!=0 && b.compareTo(BigDecimal.ZERO)!=0){
|
||||
list2.add(a.divide(b,2));
|
||||
System.out.println(c);}
|
||||
else {list2.add(c);}
|
||||
}
|
||||
System.out.println(list2);
|
||||
model.addAttribute("bd",list2);
|
||||
return prefix+"/test";
|
||||
}
|
||||
// @GetMapping("/page")
|
||||
// public String page(Model model,int curr){
|
||||
//
|
||||
// int pageSize = 10;
|
||||
// PageHelper.startPage(curr,pageSize);
|
||||
// List<timeOEE> list = itimeOEEService.selectTimeOEEList();
|
||||
// System.out.println(list);
|
||||
// model.addAttribute("timeOEE",list);
|
||||
// return prefix+"/test";
|
||||
// }
|
||||
@GetMapping("/biaoge")
|
||||
public String biaoge(Model model,String begintime,String endtime){
|
||||
|
||||
System.out.println("========================");
|
||||
System.out.println(begintime);
|
||||
System.out.println(endtime);
|
||||
Map<String,Object> map = new HashMap();
|
||||
map.put("begintime",begintime);
|
||||
map.put("endtime",endtime);
|
||||
List<timeOEE> list = itimeOEEService.selectbiaoge(map);
|
||||
List<BigDecimal> list2 =new ArrayList<>();
|
||||
// System.out.println("========================================================");
|
||||
// System.out.println("========================================================");
|
||||
// System.out.println("========================================================");
|
||||
System.out.println(list);
|
||||
BigDecimal a;
|
||||
BigDecimal b;
|
||||
BigDecimal c = BigDecimal.valueOf(0.00);
|
||||
for (int i=0;i<list.size();i++){
|
||||
a = list.get(i).getTimeValueRun();
|
||||
// System.out.println(a);
|
||||
b = list.get(i).getTimeLoad();
|
||||
// System.out.println(b);
|
||||
if (a.compareTo(BigDecimal.ZERO)!=0 && b.compareTo(BigDecimal.ZERO)!=0){
|
||||
list2.add(a.divide(b,2));
|
||||
System.out.println(c);}
|
||||
else {list2.add(c);}
|
||||
}
|
||||
model.addAttribute("bd",list2);
|
||||
model.addAttribute("timeOEE2",list);
|
||||
return prefix+"/test2";
|
||||
// return prefix+"/test3";
|
||||
}
|
||||
@PostMapping("/biaoge")
|
||||
@ResponseBody
|
||||
public AjaxResult biaoge2(Model model, @RequestParam String begintime, @RequestParam String endtime){
|
||||
|
||||
System.out.println("========================");
|
||||
System.out.println(begintime);
|
||||
System.out.println(endtime);
|
||||
Map<String,Object> map = new HashMap();
|
||||
map.put("begintime",begintime);
|
||||
map.put("endtime",endtime);
|
||||
List<timeOEE> list = itimeOEEService.selectbiaoge(map);
|
||||
List<BigDecimal> list2 =new ArrayList<>();
|
||||
// System.out.println("========================================================");
|
||||
// System.out.println("========================================================");
|
||||
// System.out.println("========================================================");
|
||||
System.out.println(list);
|
||||
BigDecimal a;
|
||||
BigDecimal b;
|
||||
BigDecimal c = BigDecimal.valueOf(0.00);
|
||||
for (int i=0;i<list.size();i++){
|
||||
a = list.get(i).getTimeValueRun();
|
||||
// System.out.println(a);
|
||||
b = list.get(i).getTimeLoad();
|
||||
// System.out.println(b);
|
||||
if (a.compareTo(BigDecimal.ZERO)!=0 && b.compareTo(BigDecimal.ZERO)!=0){
|
||||
list2.add(a.divide(b,2));
|
||||
System.out.println(c);}
|
||||
else {list2.add(c);}
|
||||
}
|
||||
model.addAttribute("bd",list2);
|
||||
model.addAttribute("timeOEE",list);
|
||||
// return prefix+"/test2";
|
||||
// return prefix+"/test3";
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@GetMapping("/lists")
|
||||
@ResponseBody
|
||||
public AjaxResult selectList(ModelMap model){
|
||||
List<timeOEE> list = itimeOEEService.selectTimeOEEList();
|
||||
// System.out.println("=====");
|
||||
// System.out.println(list);
|
||||
// model.add("timeOEE",list);
|
||||
model.put("timeOEE",list);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.ruoyi.web.controller.nanjing;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.nanjing.domain.*;
|
||||
import com.ruoyi.nanjing.service.ItimeOEEService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/nanjing/uphold")
|
||||
public class upholdController extends BaseController {
|
||||
private static double jiepai = 0.45;
|
||||
@Autowired
|
||||
private ItimeOEEService itimeOEEService;
|
||||
private String prefix = "nanjing/uphold";
|
||||
@GetMapping
|
||||
public String uphold(){
|
||||
return prefix+"/index";
|
||||
}
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo selectlist(Integer StationID){
|
||||
startPage();
|
||||
if (StationID!=null){
|
||||
List<uphold> list = itimeOEEService.selectupholdListById(StationID);
|
||||
return getDataTable(list);
|
||||
}
|
||||
else {
|
||||
List<uphold> list = itimeOEEService.selectupholdList();
|
||||
// System.out.println("====================================================");
|
||||
// System.out.println("====================================================");
|
||||
// System.out.println(list);
|
||||
// System.out.println("====================================================");
|
||||
// System.out.println("====================================================");
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
@GetMapping("/add")
|
||||
public String add(){
|
||||
return prefix+"/add";
|
||||
}
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(uphold uphold){
|
||||
|
||||
itimeOEEService.insertuphold(uphold);
|
||||
String s = JSON.toJSONString(uphold);
|
||||
Map map2 = itimeOEEService.time(uphold);
|
||||
Map map1 = JSON.parseObject(s,Map.class);
|
||||
map1.putAll(map2);
|
||||
System.out.println("=========================================================================================");
|
||||
System.out.println(map1);
|
||||
itimeOEEService.insertTimeOEE(map1);
|
||||
return AjaxResult.success("ok");
|
||||
}
|
||||
/**
|
||||
* 修改工位管理
|
||||
*/
|
||||
@GetMapping("/edit/{objid}")
|
||||
public String edit(@PathVariable("objid") Long objid,ModelMap mmap )
|
||||
{
|
||||
uphold uphold = itimeOEEService.selectUpholdById(objid);
|
||||
mmap.put("upload",uphold);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(uphold uphold)
|
||||
{
|
||||
int i = itimeOEEService.updateUphold(uphold);
|
||||
return AjaxResult.success(i);
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(Integer ids) {
|
||||
|
||||
System.out.println(ids);
|
||||
return toAjax(itimeOEEService.deleteUpholdById(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
customView: false,
|
||||
showCustomView: false,
|
||||
showCustomViewButton: false
|
||||
})
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults.icons, {
|
||||
customView: {
|
||||
bootstrap3: 'glyphicon glyphicon-eye-open',
|
||||
bootstrap5: 'bi-eye',
|
||||
bootstrap4: 'fa fa-eye',
|
||||
semantic: 'fa fa-eye',
|
||||
foundation: 'fa fa-eye',
|
||||
bulma: 'fa fa-eye',
|
||||
materialize: 'remove_red_eye'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-eye'
|
||||
})
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
onCustomViewPostBody () {
|
||||
return false
|
||||
},
|
||||
onCustomViewPreBody () {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
$.extend($.fn.bootstrapTable.locales, {
|
||||
formatToggleCustomView () {
|
||||
return 'Toggle custom view'
|
||||
}
|
||||
})
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales)
|
||||
|
||||
$.fn.bootstrapTable.methods.push('toggleCustomView')
|
||||
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'custom-view-post-body.bs.table': 'onCustomViewPostBody',
|
||||
'custom-view-pre-body.bs.table': 'onCustomViewPreBody'
|
||||
})
|
||||
|
||||
$.BootstrapTable = class extends $.BootstrapTable {
|
||||
|
||||
init () {
|
||||
this.showCustomView = this.options.showCustomView
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
initToolbar (...args) {
|
||||
if (this.options.customView && this.options.showCustomViewButton) {
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
customView: {
|
||||
text: this.options.formatToggleCustomView(),
|
||||
icon: this.options.icons.customView,
|
||||
event: this.toggleCustomView,
|
||||
attributes: {
|
||||
'aria-label': this.options.formatToggleCustomView(),
|
||||
title: this.options.formatToggleCustomView()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
super.initToolbar(...args)
|
||||
}
|
||||
|
||||
initBody () {
|
||||
super.initBody()
|
||||
|
||||
if (!this.options.customView) {
|
||||
return
|
||||
}
|
||||
|
||||
const $table = this.$el
|
||||
const $customViewContainer = this.$container.find('.fixed-table-custom-view')
|
||||
|
||||
$table.hide()
|
||||
$customViewContainer.hide()
|
||||
if (!this.options.customView || !this.showCustomView) {
|
||||
$table.show()
|
||||
return
|
||||
}
|
||||
|
||||
const data = this.getData().slice(this.pageFrom - 1, this.pageTo)
|
||||
const value = Utils.calculateObjectValue(this, this.options.customView, [data], '')
|
||||
|
||||
this.trigger('custom-view-pre-body', data, value)
|
||||
if ($customViewContainer.length === 1) {
|
||||
$customViewContainer.show().html(value)
|
||||
} else {
|
||||
this.$tableBody.after(`<div class="fixed-table-custom-view">${value}</div>`)
|
||||
}
|
||||
|
||||
this.trigger('custom-view-post-body', data, value)
|
||||
}
|
||||
|
||||
toggleCustomView () {
|
||||
this.showCustomView = !this.showCustomView
|
||||
this.initBody()
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
customView: false,
|
||||
showCustomView: false,
|
||||
showCustomViewButton: false
|
||||
})
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults.icons, {
|
||||
customView: {
|
||||
bootstrap3: 'glyphicon glyphicon-eye-open',
|
||||
bootstrap5: 'bi-eye',
|
||||
bootstrap4: 'fa fa-eye',
|
||||
semantic: 'fa fa-eye',
|
||||
foundation: 'fa fa-eye',
|
||||
bulma: 'fa fa-eye',
|
||||
materialize: 'remove_red_eye'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-eye'
|
||||
})
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
onCustomViewPostBody () {
|
||||
return false
|
||||
},
|
||||
onCustomViewPreBody () {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
$.extend($.fn.bootstrapTable.locales, {
|
||||
formatToggleCustomView () {
|
||||
return 'Toggle custom view'
|
||||
}
|
||||
})
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales)
|
||||
|
||||
$.fn.bootstrapTable.methods.push('toggleCustomView')
|
||||
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'custom-view-post-body.bs.table': 'onCustomViewPostBody',
|
||||
'custom-view-pre-body.bs.table': 'onCustomViewPreBody'
|
||||
})
|
||||
|
||||
$.BootstrapTable = class extends $.BootstrapTable {
|
||||
|
||||
init () {
|
||||
this.showCustomView = this.options.showCustomView
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
initToolbar (...args) {
|
||||
if (this.options.customView && this.options.showCustomViewButton) {
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
customView: {
|
||||
text: this.options.formatToggleCustomView(),
|
||||
icon: this.options.icons.customView,
|
||||
event: this.toggleCustomView,
|
||||
attributes: {
|
||||
'aria-label': this.options.formatToggleCustomView(),
|
||||
title: this.options.formatToggleCustomView()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
super.initToolbar(...args)
|
||||
}
|
||||
|
||||
initBody () {
|
||||
super.initBody()
|
||||
|
||||
if (!this.options.customView) {
|
||||
return
|
||||
}
|
||||
|
||||
const $table = this.$el
|
||||
const $customViewContainer = this.$container.find('.fixed-table-custom-view')
|
||||
|
||||
$table.hide()
|
||||
$customViewContainer.hide()
|
||||
if (!this.options.customView || !this.showCustomView) {
|
||||
$table.show()
|
||||
return
|
||||
}
|
||||
|
||||
const data = this.getData().slice(this.pageFrom - 1, this.pageTo)
|
||||
const value = Utils.calculateObjectValue(this, this.options.customView, [data], '')
|
||||
|
||||
this.trigger('custom-view-pre-body', data, value)
|
||||
if ($customViewContainer.length === 1) {
|
||||
$customViewContainer.show().html(value)
|
||||
} else {
|
||||
this.$tableBody.after(`<div class="fixed-table-custom-view">${value}</div>`)
|
||||
}
|
||||
|
||||
this.trigger('custom-view-post-body', data, value)
|
||||
}
|
||||
|
||||
toggleCustomView () {
|
||||
this.showCustomView = !this.showCustomView
|
||||
this.initBody()
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,242 @@
|
||||
/** layui-v2.5.7 MIT License */
|
||||
;layui.define("layer", function (e) {
|
||||
"use strict";
|
||||
var t = layui.$, i = layui.layer, n = layui.hint(), o = layui.device(), a = {
|
||||
config: {}, set: function (e) {
|
||||
var i = this;
|
||||
return i.config = t.extend({}, i.config, e), i
|
||||
}, on: function (e, t) {
|
||||
return layui.onevent.call(this, r, e, t)
|
||||
}
|
||||
}, l = function () {
|
||||
var e = this;
|
||||
return {
|
||||
upload: function (t) {
|
||||
e.upload.call(e, t)
|
||||
}, reload: function (t) {
|
||||
e.reload.call(e, t)
|
||||
}, config: e.config
|
||||
}
|
||||
}, r = "upload", u = "layui-upload-file", c = "layui-upload-form", f = "layui-upload-iframe",
|
||||
s = "layui-upload-choose", p = function (e) {
|
||||
var i = this;
|
||||
i.config = t.extend({}, i.config, a.config, e), i.render()
|
||||
};
|
||||
p.prototype.config = {
|
||||
accept: "images",
|
||||
exts: "",
|
||||
auto: !0,
|
||||
bindAction: "",
|
||||
url: "",
|
||||
field: "file",
|
||||
acceptMime: "",
|
||||
method: "post",
|
||||
data: {},
|
||||
drag: !0,
|
||||
size: 0,
|
||||
number: 0,
|
||||
multiple: !1
|
||||
}, p.prototype.render = function (e) {
|
||||
var i = this, e = i.config;
|
||||
e.elem = t(e.elem), e.bindAction = t(e.bindAction), i.file(), i.events()
|
||||
}, p.prototype.file = function () {
|
||||
var e = this, i = e.config,
|
||||
n = e.elemFile = t(['<input class="' + u + '" type="file" accept="' + i.acceptMime + '" name="' + i.field + '"', i.multiple ? " multiple" : "", ">"].join("")),
|
||||
a = i.elem.next();
|
||||
(a.hasClass(u) || a.hasClass(c)) && a.remove(), o.ie && o.ie < 10 && i.elem.wrap('<div class="layui-upload-wrap"></div>'), e.isFile() ? (e.elemFile = i.elem, i.field = i.elem[0].name) : i.elem.after(n), o.ie && o.ie < 10 && e.initIE()
|
||||
}, p.prototype.initIE = function () {
|
||||
var e = this, i = e.config,
|
||||
n = t('<iframe id="' + f + '" class="' + f + '" name="' + f + '" frameborder="0"></iframe>'),
|
||||
o = t(['<form target="' + f + '" class="' + c + '" method="post" key="set-mine" enctype="multipart/form-data" action="' + i.url + '">', "</form>"].join(""));
|
||||
t("#" + f)[0] || t("body").append(n), i.elem.next().hasClass(c) || (e.elemFile.wrap(o), i.elem.next("." + c).append(function () {
|
||||
var e = [];
|
||||
return layui.each(i.data, function (t, i) {
|
||||
i = "function" == typeof i ? i() : i, e.push('<input type="hidden" name="' + t + '" value="' + i + '">')
|
||||
}), e.join("")
|
||||
}()))
|
||||
}, p.prototype.msg = function (e) {
|
||||
return i.msg(e, {icon: 2, shift: 6})
|
||||
}, p.prototype.isFile = function () {
|
||||
var e = this.config.elem[0];
|
||||
if (e) return "input" === e.tagName.toLocaleLowerCase() && "file" === e.type
|
||||
}, p.prototype.preview = function (e) {
|
||||
var t = this;
|
||||
window.FileReader && layui.each(t.chooseFiles, function (t, i) {
|
||||
var n = new FileReader;
|
||||
n.readAsDataURL(i), n.onload = function () {
|
||||
e && e(t, i, this.result)
|
||||
}
|
||||
})
|
||||
}, p.prototype.upload = function (e, i) {
|
||||
var n, a = this, l = a.config, r = a.elemFile[0], u = function () {
|
||||
var i = 0, n = 0, o = e || a.files || a.chooseFiles || r.files, u = function () {
|
||||
l.multiple && i + n === a.fileLength && "function" == typeof l.allDone && l.allDone({
|
||||
total: a.fileLength,
|
||||
successful: i,
|
||||
aborted: n
|
||||
})
|
||||
};
|
||||
layui.each(o, function (e, o) {
|
||||
var r = new FormData;
|
||||
r.append(l.field, o), layui.each(l.data, function (e, t) {
|
||||
t = "function" == typeof t ? t() : t, r.append(e, t)
|
||||
});
|
||||
var c = {
|
||||
url: l.url,
|
||||
type: "post",
|
||||
data: r,
|
||||
contentType: !1,
|
||||
processData: !1,
|
||||
dataType: "json",
|
||||
headers: l.headers || {},
|
||||
success: function (t) {
|
||||
i++, d(e, t), u()
|
||||
},
|
||||
error: function () {
|
||||
n++, a.msg("请求上传接口出现异常"), m(e), u()
|
||||
}
|
||||
};
|
||||
"function" == typeof l.progress && (c.xhr = function () {
|
||||
var e = t.ajaxSettings.xhr();
|
||||
return e.upload.addEventListener("progress", function (e) {
|
||||
if (e.lengthComputable) {
|
||||
var t = Math.floor(e.loaded / e.total * 100);
|
||||
l.progress(t, l.item[0], e)
|
||||
}
|
||||
}), e
|
||||
}), t.ajax(c)
|
||||
})
|
||||
}, c = function () {
|
||||
var e = t("#" + f);
|
||||
a.elemFile.parent().submit(), clearInterval(p.timer), p.timer = setInterval(function () {
|
||||
var t, i = e.contents().find("body");
|
||||
try {
|
||||
t = i.text()
|
||||
} catch (n) {
|
||||
a.msg("获取上传后的响应信息出现异常"), clearInterval(p.timer), m()
|
||||
}
|
||||
t && (clearInterval(p.timer), i.html(""), d(0, t))
|
||||
}, 30)
|
||||
}, d = function (e, t) {
|
||||
if (a.elemFile.next("." + s).remove(), r.value = "", "object" != typeof t) try {
|
||||
t = JSON.parse(t)
|
||||
} catch (i) {
|
||||
return t = {}, a.msg("请对上传接口返回有效JSON")
|
||||
}
|
||||
"function" == typeof l.done && l.done(t, e || 0, function (e) {
|
||||
a.upload(e)
|
||||
})
|
||||
}, m = function (e) {
|
||||
l.auto && (r.value = ""), "function" == typeof l.error && l.error(e || 0, function (e) {
|
||||
a.upload(e)
|
||||
})
|
||||
}, h = l.exts, v = function () {
|
||||
var t = [];
|
||||
return layui.each(e || a.chooseFiles, function (e, i) {
|
||||
t.push(i.name)
|
||||
}), t
|
||||
}(), g = {
|
||||
preview: function (e) {
|
||||
a.preview(e)
|
||||
}, upload: function (e, t) {
|
||||
var i = {};
|
||||
i[e] = t, a.upload(i)
|
||||
}, pushFile: function () {
|
||||
return a.files = a.files || {}, layui.each(a.chooseFiles, function (e, t) {
|
||||
a.files[e] = t
|
||||
}), a.files
|
||||
}, resetFile: function (e, t, i) {
|
||||
var n = new File([t], i);
|
||||
a.files = a.files || {}, a.files[e] = n
|
||||
}
|
||||
}, y = function () {
|
||||
if ("choose" !== i && !l.auto || (l.choose && l.choose(g), "choose" !== i)) return l.before && l.before(g), o.ie ? o.ie > 9 ? u() : c() : void u()
|
||||
};
|
||||
if (v = 0 === v.length ? r.value.match(/[^\/\\]+\..+/g) || [] || "" : v, 0 !== v.length) {
|
||||
switch (l.accept) {
|
||||
case"file":
|
||||
if (h && !RegExp("\\w\\.(" + h + ")$", "i").test(escape(v))) return a.msg("选择的文件中包含不支持的格式"), r.value = "";
|
||||
break;
|
||||
case"video":
|
||||
if (!RegExp("\\w\\.(" + (h || "avi|mp4|wma|rmvb|rm|flash|3gp|flv") + ")$", "i").test(escape(v))) return a.msg("选择的视频中包含不支持的格式"), r.value = "";
|
||||
break;
|
||||
case"audio":
|
||||
if (!RegExp("\\w\\.(" + (h || "mp3|wav|mid") + ")$", "i").test(escape(v))) return a.msg("选择的音频中包含不支持的格式"), r.value = "";
|
||||
break;
|
||||
default:
|
||||
if (layui.each(v, function (e, t) {
|
||||
RegExp("\\w\\.(" + (h || "jpg|png|gif|bmp|jpeg$") + ")", "i").test(escape(t)) || (n = !0)
|
||||
}), n) return a.msg("选择的图片中包含不支持的格式"), r.value = ""
|
||||
}
|
||||
if (a.fileLength = function () {
|
||||
var t = 0, i = e || a.files || a.chooseFiles || r.files;
|
||||
return layui.each(i, function () {
|
||||
t++
|
||||
}), t
|
||||
}(), l.number && a.fileLength > l.number) return a.msg("同时最多只能上传的数量为:" + l.number);
|
||||
if (l.size > 0 && !(o.ie && o.ie < 10)) {
|
||||
var F;
|
||||
if (layui.each(a.chooseFiles, function (e, t) {
|
||||
if (t.size > 1024 * l.size) {
|
||||
var i = l.size / 1024;
|
||||
i = i >= 1 ? i.toFixed(2) + "MB" : l.size + "KB", r.value = "", F = i
|
||||
}
|
||||
}), F) return a.msg("文件不能超过" + F)
|
||||
}
|
||||
y()
|
||||
}
|
||||
}, p.prototype.reload = function (e) {
|
||||
e = e || {}, delete e.elem, delete e.bindAction;
|
||||
var i = this, e = i.config = t.extend({}, i.config, a.config, e), n = e.elem.next();
|
||||
n.attr({name: e.name, accept: e.acceptMime, multiple: e.multiple})
|
||||
}, p.prototype.events = function () {
|
||||
var e = this, i = e.config, a = function (t) {
|
||||
e.chooseFiles = {}, layui.each(t, function (t, i) {
|
||||
var n = (new Date).getTime();
|
||||
e.chooseFiles[n + "-" + t] = i
|
||||
})
|
||||
}, l = function (t, n) {
|
||||
var o = e.elemFile,
|
||||
a = t.length > 1 ? t.length + "个文件" : (t[0] || {}).name || o[0].value.match(/[^\/\\]+\..+/g) || [] || "";
|
||||
o.next().hasClass(s) && o.next().remove(), e.upload(null, "choose"), e.isFile() || i.choose || o.after('<span class="layui-inline ' + s + '">' + a + "</span>")
|
||||
};
|
||||
i.elem.off("upload.start").on("upload.start", function () {
|
||||
var o = t(this), a = o.attr("lay-data");
|
||||
if (a) try {
|
||||
a = new Function("return " + a)(), e.config = t.extend({}, i, a)
|
||||
} catch (l) {
|
||||
n.error("Upload element property lay-data configuration item has a syntax error: " + a)
|
||||
}
|
||||
e.config.item = o, e.elemFile[0].click()
|
||||
}), o.ie && o.ie < 10 || i.elem.off("upload.over").on("upload.over", function () {
|
||||
var e = t(this);
|
||||
e.attr("lay-over", "")
|
||||
}).off("upload.leave").on("upload.leave", function () {
|
||||
var e = t(this);
|
||||
e.removeAttr("lay-over")
|
||||
}).off("upload.drop").on("upload.drop", function (n, o) {
|
||||
var r = t(this), u = o.originalEvent.dataTransfer.files || [];
|
||||
r.removeAttr("lay-over"), a(u), i.auto ? e.upload(u) : l(u)
|
||||
}), e.elemFile.off("upload.change").on("upload.change", function () {
|
||||
var t = this.files || [];
|
||||
a(t), i.auto ? e.upload() : l(t)
|
||||
}), i.bindAction.off("upload.action").on("upload.action", function () {
|
||||
e.upload()
|
||||
}), i.elem.data("haveEvents") || (e.elemFile.on("change", function () {
|
||||
t(this).trigger("upload.change")
|
||||
}), i.elem.on("click", function () {
|
||||
e.isFile() || t(this).trigger("upload.start")
|
||||
}), i.drag && i.elem.on("dragover", function (e) {
|
||||
e.preventDefault(), t(this).trigger("upload.over")
|
||||
}).on("dragleave", function (e) {
|
||||
t(this).trigger("upload.leave")
|
||||
}).on("drop", function (e) {
|
||||
e.preventDefault(), t(this).trigger("upload.drop", e)
|
||||
}), i.bindAction.on("click", function () {
|
||||
t(this).trigger("upload.action")
|
||||
}), i.elem.data("haveEvents", !0))
|
||||
}, a.render = function (e) {
|
||||
var t = new p(e);
|
||||
return l.call(t)
|
||||
}, e(r, a)
|
||||
});
|
||||
@ -0,0 +1,242 @@
|
||||
/** layui-v2.5.7 MIT License */
|
||||
;layui.define("layer", function (e) {
|
||||
"use strict";
|
||||
var t = layui.$, i = layui.layer, n = layui.hint(), o = layui.device(), a = {
|
||||
config: {}, set: function (e) {
|
||||
var i = this;
|
||||
return i.config = t.extend({}, i.config, e), i
|
||||
}, on: function (e, t) {
|
||||
return layui.onevent.call(this, r, e, t)
|
||||
}
|
||||
}, l = function () {
|
||||
var e = this;
|
||||
return {
|
||||
upload: function (t) {
|
||||
e.upload.call(e, t)
|
||||
}, reload: function (t) {
|
||||
e.reload.call(e, t)
|
||||
}, config: e.config
|
||||
}
|
||||
}, r = "upload", u = "layui-upload-file", c = "layui-upload-form", f = "layui-upload-iframe",
|
||||
s = "layui-upload-choose", p = function (e) {
|
||||
var i = this;
|
||||
i.config = t.extend({}, i.config, a.config, e), i.render()
|
||||
};
|
||||
p.prototype.config = {
|
||||
accept: "images",
|
||||
exts: "",
|
||||
auto: !0,
|
||||
bindAction: "",
|
||||
url: "",
|
||||
field: "file",
|
||||
acceptMime: "",
|
||||
method: "post",
|
||||
data: {},
|
||||
drag: !0,
|
||||
size: 0,
|
||||
number: 0,
|
||||
multiple: !1
|
||||
}, p.prototype.render = function (e) {
|
||||
var i = this, e = i.config;
|
||||
e.elem = t(e.elem), e.bindAction = t(e.bindAction), i.file(), i.events()
|
||||
}, p.prototype.file = function () {
|
||||
var e = this, i = e.config,
|
||||
n = e.elemFile = t(['<input class="' + u + '" type="file" accept="' + i.acceptMime + '" name="' + i.field + '"', i.multiple ? " multiple" : "", ">"].join("")),
|
||||
a = i.elem.next();
|
||||
(a.hasClass(u) || a.hasClass(c)) && a.remove(), o.ie && o.ie < 10 && i.elem.wrap('<div class="layui-upload-wrap"></div>'), e.isFile() ? (e.elemFile = i.elem, i.field = i.elem[0].name) : i.elem.after(n), o.ie && o.ie < 10 && e.initIE()
|
||||
}, p.prototype.initIE = function () {
|
||||
var e = this, i = e.config,
|
||||
n = t('<iframe id="' + f + '" class="' + f + '" name="' + f + '" frameborder="0"></iframe>'),
|
||||
o = t(['<form target="' + f + '" class="' + c + '" method="post" key="set-mine" enctype="multipart/form-data" action="' + i.url + '">', "</form>"].join(""));
|
||||
t("#" + f)[0] || t("body").append(n), i.elem.next().hasClass(c) || (e.elemFile.wrap(o), i.elem.next("." + c).append(function () {
|
||||
var e = [];
|
||||
return layui.each(i.data, function (t, i) {
|
||||
i = "function" == typeof i ? i() : i, e.push('<input type="hidden" name="' + t + '" value="' + i + '">')
|
||||
}), e.join("")
|
||||
}()))
|
||||
}, p.prototype.msg = function (e) {
|
||||
return i.msg(e, {icon: 2, shift: 6})
|
||||
}, p.prototype.isFile = function () {
|
||||
var e = this.config.elem[0];
|
||||
if (e) return "input" === e.tagName.toLocaleLowerCase() && "file" === e.type
|
||||
}, p.prototype.preview = function (e) {
|
||||
var t = this;
|
||||
window.FileReader && layui.each(t.chooseFiles, function (t, i) {
|
||||
var n = new FileReader;
|
||||
n.readAsDataURL(i), n.onload = function () {
|
||||
e && e(t, i, this.result)
|
||||
}
|
||||
})
|
||||
}, p.prototype.upload = function (e, i) {
|
||||
var n, a = this, l = a.config, r = a.elemFile[0], u = function () {
|
||||
var i = 0, n = 0, o = e || a.files || a.chooseFiles || r.files, u = function () {
|
||||
l.multiple && i + n === a.fileLength && "function" == typeof l.allDone && l.allDone({
|
||||
total: a.fileLength,
|
||||
successful: i,
|
||||
aborted: n
|
||||
})
|
||||
};
|
||||
layui.each(o, function (e, o) {
|
||||
var r = new FormData;
|
||||
r.append(l.field, o), layui.each(l.data, function (e, t) {
|
||||
t = "function" == typeof t ? t() : t, r.append(e, t)
|
||||
});
|
||||
var c = {
|
||||
url: l.url,
|
||||
type: "post",
|
||||
data: r,
|
||||
contentType: !1,
|
||||
processData: !1,
|
||||
dataType: "json",
|
||||
headers: l.headers || {},
|
||||
success: function (t) {
|
||||
i++, d(e, t), u()
|
||||
},
|
||||
error: function () {
|
||||
n++, a.msg("请求上传接口出现异常"), m(e), u()
|
||||
}
|
||||
};
|
||||
"function" == typeof l.progress && (c.xhr = function () {
|
||||
var e = t.ajaxSettings.xhr();
|
||||
return e.upload.addEventListener("progress", function (e) {
|
||||
if (e.lengthComputable) {
|
||||
var t = Math.floor(e.loaded / e.total * 100);
|
||||
l.progress(t, l.item[0], e)
|
||||
}
|
||||
}), e
|
||||
}), t.ajax(c)
|
||||
})
|
||||
}, c = function () {
|
||||
var e = t("#" + f);
|
||||
a.elemFile.parent().submit(), clearInterval(p.timer), p.timer = setInterval(function () {
|
||||
var t, i = e.contents().find("body");
|
||||
try {
|
||||
t = i.text()
|
||||
} catch (n) {
|
||||
a.msg("获取上传后的响应信息出现异常"), clearInterval(p.timer), m()
|
||||
}
|
||||
t && (clearInterval(p.timer), i.html(""), d(0, t))
|
||||
}, 30)
|
||||
}, d = function (e, t) {
|
||||
if (a.elemFile.next("." + s).remove(), r.value = "", "object" != typeof t) try {
|
||||
t = JSON.parse(t)
|
||||
} catch (i) {
|
||||
return t = {}, a.msg("请对上传接口返回有效JSON")
|
||||
}
|
||||
"function" == typeof l.done && l.done(t, e || 0, function (e) {
|
||||
a.upload(e)
|
||||
})
|
||||
}, m = function (e) {
|
||||
l.auto && (r.value = ""), "function" == typeof l.error && l.error(e || 0, function (e) {
|
||||
a.upload(e)
|
||||
})
|
||||
}, h = l.exts, v = function () {
|
||||
var t = [];
|
||||
return layui.each(e || a.chooseFiles, function (e, i) {
|
||||
t.push(i.name)
|
||||
}), t
|
||||
}(), g = {
|
||||
preview: function (e) {
|
||||
a.preview(e)
|
||||
}, upload: function (e, t) {
|
||||
var i = {};
|
||||
i[e] = t, a.upload(i)
|
||||
}, pushFile: function () {
|
||||
return a.files = a.files || {}, layui.each(a.chooseFiles, function (e, t) {
|
||||
a.files[e] = t
|
||||
}), a.files
|
||||
}, resetFile: function (e, t, i) {
|
||||
var n = new File([t], i);
|
||||
a.files = a.files || {}, a.files[e] = n
|
||||
}
|
||||
}, y = function () {
|
||||
if ("choose" !== i && !l.auto || (l.choose && l.choose(g), "choose" !== i)) return l.before && l.before(g), o.ie ? o.ie > 9 ? u() : c() : void u()
|
||||
};
|
||||
if (v = 0 === v.length ? r.value.match(/[^\/\\]+\..+/g) || [] || "" : v, 0 !== v.length) {
|
||||
switch (l.accept) {
|
||||
case"file":
|
||||
if (h && !RegExp("\\w\\.(" + h + ")$", "i").test(escape(v))) return a.msg("选择的文件中包含不支持的格式"), r.value = "";
|
||||
break;
|
||||
case"video":
|
||||
if (!RegExp("\\w\\.(" + (h || "avi|mp4|wma|rmvb|rm|flash|3gp|flv") + ")$", "i").test(escape(v))) return a.msg("选择的视频中包含不支持的格式"), r.value = "";
|
||||
break;
|
||||
case"audio":
|
||||
if (!RegExp("\\w\\.(" + (h || "mp3|wav|mid") + ")$", "i").test(escape(v))) return a.msg("选择的音频中包含不支持的格式"), r.value = "";
|
||||
break;
|
||||
default:
|
||||
if (layui.each(v, function (e, t) {
|
||||
RegExp("\\w\\.(" + (h || "jpg|png|gif|bmp|jpeg$") + ")", "i").test(escape(t)) || (n = !0)
|
||||
}), n) return a.msg("选择的图片中包含不支持的格式"), r.value = ""
|
||||
}
|
||||
if (a.fileLength = function () {
|
||||
var t = 0, i = e || a.files || a.chooseFiles || r.files;
|
||||
return layui.each(i, function () {
|
||||
t++
|
||||
}), t
|
||||
}(), l.number && a.fileLength > l.number) return a.msg("同时最多只能上传的数量为:" + l.number);
|
||||
if (l.size > 0 && !(o.ie && o.ie < 10)) {
|
||||
var F;
|
||||
if (layui.each(a.chooseFiles, function (e, t) {
|
||||
if (t.size > 1024 * l.size) {
|
||||
var i = l.size / 1024;
|
||||
i = i >= 1 ? i.toFixed(2) + "MB" : l.size + "KB", r.value = "", F = i
|
||||
}
|
||||
}), F) return a.msg("文件不能超过" + F)
|
||||
}
|
||||
y()
|
||||
}
|
||||
}, p.prototype.reload = function (e) {
|
||||
e = e || {}, delete e.elem, delete e.bindAction;
|
||||
var i = this, e = i.config = t.extend({}, i.config, a.config, e), n = e.elem.next();
|
||||
n.attr({name: e.name, accept: e.acceptMime, multiple: e.multiple})
|
||||
}, p.prototype.events = function () {
|
||||
var e = this, i = e.config, a = function (t) {
|
||||
e.chooseFiles = {}, layui.each(t, function (t, i) {
|
||||
var n = (new Date).getTime();
|
||||
e.chooseFiles[n + "-" + t] = i
|
||||
})
|
||||
}, l = function (t, n) {
|
||||
var o = e.elemFile,
|
||||
a = t.length > 1 ? t.length + "个文件" : (t[0] || {}).name || o[0].value.match(/[^\/\\]+\..+/g) || [] || "";
|
||||
o.next().hasClass(s) && o.next().remove(), e.upload(null, "choose"), e.isFile() || i.choose || o.after('<span class="layui-inline ' + s + '">' + a + "</span>")
|
||||
};
|
||||
i.elem.off("upload.start").on("upload.start", function () {
|
||||
var o = t(this), a = o.attr("lay-data");
|
||||
if (a) try {
|
||||
a = new Function("return " + a)(), e.config = t.extend({}, i, a)
|
||||
} catch (l) {
|
||||
n.error("Upload element property lay-data configuration item has a syntax error: " + a)
|
||||
}
|
||||
e.config.item = o, e.elemFile[0].click()
|
||||
}), o.ie && o.ie < 10 || i.elem.off("upload.over").on("upload.over", function () {
|
||||
var e = t(this);
|
||||
e.attr("lay-over", "")
|
||||
}).off("upload.leave").on("upload.leave", function () {
|
||||
var e = t(this);
|
||||
e.removeAttr("lay-over")
|
||||
}).off("upload.drop").on("upload.drop", function (n, o) {
|
||||
var r = t(this), u = o.originalEvent.dataTransfer.files || [];
|
||||
r.removeAttr("lay-over"), a(u), i.auto ? e.upload(u) : l(u)
|
||||
}), e.elemFile.off("upload.change").on("upload.change", function () {
|
||||
var t = this.files || [];
|
||||
a(t), i.auto ? e.upload() : l(t)
|
||||
}), i.bindAction.off("upload.action").on("upload.action", function () {
|
||||
e.upload()
|
||||
}), i.elem.data("haveEvents") || (e.elemFile.on("change", function () {
|
||||
t(this).trigger("upload.change")
|
||||
}), i.elem.on("click", function () {
|
||||
e.isFile() || t(this).trigger("upload.start")
|
||||
}), i.drag && i.elem.on("dragover", function (e) {
|
||||
e.preventDefault(), t(this).trigger("upload.over")
|
||||
}).on("dragleave", function (e) {
|
||||
t(this).trigger("upload.leave")
|
||||
}).on("drop", function (e) {
|
||||
e.preventDefault(), t(this).trigger("upload.drop", e)
|
||||
}), i.bindAction.on("click", function () {
|
||||
t(this).trigger("upload.action")
|
||||
}), i.elem.data("haveEvents", !0))
|
||||
}, a.render = function (e) {
|
||||
var t = new p(e);
|
||||
return l.call(t)
|
||||
}, e(r, a)
|
||||
});
|
||||
@ -0,0 +1,97 @@
|
||||
*{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
body {
|
||||
background: url(../img/backgroundImg.jpg) no-repeat fixed center center;
|
||||
background-size: 100% 100%;
|
||||
font-weight: 400;
|
||||
letter-spacing: 1px
|
||||
}
|
||||
|
||||
.th {
|
||||
font-size: 0.8vw;
|
||||
}
|
||||
|
||||
.td {
|
||||
font-size: 0.6vw;
|
||||
}
|
||||
|
||||
.scrollTable {
|
||||
position: absolute;
|
||||
top: 14.9%;
|
||||
left: 3.8%;
|
||||
width: 22.8%;
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.gauge {
|
||||
position: absolute;
|
||||
top: 43.9%;
|
||||
left: 84.8%;
|
||||
width: 23.2%;
|
||||
aspect-ratio: 2;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.bar {
|
||||
position: absolute;
|
||||
/*top: 14.5%;*/
|
||||
/*left: 72.9%;*/
|
||||
/*width: 23.2%;*/
|
||||
/*height: 21%;*/
|
||||
top: 14.5%;
|
||||
left: 72.9%;
|
||||
width: 23.2%;
|
||||
height: 21%;
|
||||
}
|
||||
|
||||
.line {
|
||||
position: absolute;
|
||||
top: 73.5%;
|
||||
left: 3.5%;
|
||||
width: 93%;
|
||||
height: 21%;
|
||||
}
|
||||
|
||||
.num {
|
||||
position: absolute;
|
||||
top: 16.8%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 2vw;
|
||||
}
|
||||
|
||||
.aState{
|
||||
position: absolute;
|
||||
top: 29.7%;
|
||||
left: 41%;
|
||||
width: 1.5vw;
|
||||
height: 1.5vw;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: #17e137;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.bState{
|
||||
position: absolute;
|
||||
top: 29.7%;
|
||||
left: 51%;
|
||||
width: 1.5vw;
|
||||
height: 1.5vw;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: #17e137;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.cState{
|
||||
position: absolute;
|
||||
top: 29.7%;
|
||||
left: 62%;
|
||||
width: 1.5vw;
|
||||
height: 1.5vw;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: #17e137;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 252 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 701 B |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 302 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,117 @@
|
||||
/**
|
||||
* Minified by jsDelivr using Terser v5.3.5.
|
||||
* Original file: /npm/js-base64@3.6.0/base64.min.js
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
!function (e, t) {
|
||||
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : function () {
|
||||
const r = e.Base64, o = t();
|
||||
o.noConflict = () => (e.Base64 = r, o), e.Meteor && (Base64 = o), e.Base64 = o
|
||||
}()
|
||||
}("undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : this, (function () {
|
||||
"use strict";
|
||||
const e = "3.6.0", t = "function" == typeof atob, r = "function" == typeof btoa, o = "function" == typeof Buffer,
|
||||
n = "function" == typeof TextDecoder ? new TextDecoder : void 0,
|
||||
a = "function" == typeof TextEncoder ? new TextEncoder : void 0,
|
||||
f = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="], i = (e => {
|
||||
let t = {};
|
||||
return e.forEach(((e, r) => t[e] = r)), t
|
||||
})(f), c = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,
|
||||
u = String.fromCharCode.bind(String),
|
||||
s = "function" == typeof Uint8Array.from ? Uint8Array.from.bind(Uint8Array) : (e, t = (e => e)) => new Uint8Array(Array.prototype.slice.call(e, 0).map(t)),
|
||||
d = e => e.replace(/[+\/]/g, (e => "+" == e ? "-" : "_")).replace(/=+$/m, ""),
|
||||
l = e => e.replace(/[^A-Za-z0-9\+\/]/g, ""), h = e => {
|
||||
let t, r, o, n, a = "";
|
||||
const i = e.length % 3;
|
||||
for (let i = 0; i < e.length;) {
|
||||
if ((r = e.charCodeAt(i++)) > 255 || (o = e.charCodeAt(i++)) > 255 || (n = e.charCodeAt(i++)) > 255) throw new TypeError("invalid character found");
|
||||
t = r << 16 | o << 8 | n, a += f[t >> 18 & 63] + f[t >> 12 & 63] + f[t >> 6 & 63] + f[63 & t]
|
||||
}
|
||||
return i ? a.slice(0, i - 3) + "===".substring(i) : a
|
||||
}, p = r ? e => btoa(e) : o ? e => Buffer.from(e, "binary").toString("base64") : h,
|
||||
y = o ? e => Buffer.from(e).toString("base64") : e => {
|
||||
let t = [];
|
||||
for (let r = 0, o = e.length; r < o; r += 4096) t.push(u.apply(null, e.subarray(r, r + 4096)));
|
||||
return p(t.join(""))
|
||||
}, A = (e, t = !1) => t ? d(y(e)) : y(e), b = e => {
|
||||
if (e.length < 2) return (t = e.charCodeAt(0)) < 128 ? e : t < 2048 ? u(192 | t >>> 6) + u(128 | 63 & t) : u(224 | t >>> 12 & 15) + u(128 | t >>> 6 & 63) + u(128 | 63 & t);
|
||||
var t = 65536 + 1024 * (e.charCodeAt(0) - 55296) + (e.charCodeAt(1) - 56320);
|
||||
return u(240 | t >>> 18 & 7) + u(128 | t >>> 12 & 63) + u(128 | t >>> 6 & 63) + u(128 | 63 & t)
|
||||
}, g = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, B = e => e.replace(g, b),
|
||||
x = o ? e => Buffer.from(e, "utf8").toString("base64") : a ? e => y(a.encode(e)) : e => p(B(e)),
|
||||
C = (e, t = !1) => t ? d(x(e)) : x(e), m = e => C(e, !0),
|
||||
U = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g, F = e => {
|
||||
switch (e.length) {
|
||||
case 4:
|
||||
var t = ((7 & e.charCodeAt(0)) << 18 | (63 & e.charCodeAt(1)) << 12 | (63 & e.charCodeAt(2)) << 6 | 63 & e.charCodeAt(3)) - 65536;
|
||||
return u(55296 + (t >>> 10)) + u(56320 + (1023 & t));
|
||||
case 3:
|
||||
return u((15 & e.charCodeAt(0)) << 12 | (63 & e.charCodeAt(1)) << 6 | 63 & e.charCodeAt(2));
|
||||
default:
|
||||
return u((31 & e.charCodeAt(0)) << 6 | 63 & e.charCodeAt(1))
|
||||
}
|
||||
}, w = e => e.replace(U, F), S = e => {
|
||||
if (e = e.replace(/\s+/g, ""), !c.test(e)) throw new TypeError("malformed base64.");
|
||||
e += "==".slice(2 - (3 & e.length));
|
||||
let t, r, o, n = "";
|
||||
for (let a = 0; a < e.length;) t = i[e.charAt(a++)] << 18 | i[e.charAt(a++)] << 12 | (r = i[e.charAt(a++)]) << 6 | (o = i[e.charAt(a++)]), n += 64 === r ? u(t >> 16 & 255) : 64 === o ? u(t >> 16 & 255, t >> 8 & 255) : u(t >> 16 & 255, t >> 8 & 255, 255 & t);
|
||||
return n
|
||||
}, E = t ? e => atob(l(e)) : o ? e => Buffer.from(e, "base64").toString("binary") : S,
|
||||
v = o ? e => s(Buffer.from(e, "base64")) : e => s(E(e), (e => e.charCodeAt(0))), D = e => v(z(e)),
|
||||
R = o ? e => Buffer.from(e, "base64").toString("utf8") : n ? e => n.decode(v(e)) : e => w(E(e)),
|
||||
z = e => l(e.replace(/[-_]/g, (e => "-" == e ? "+" : "/"))), T = e => R(z(e)),
|
||||
Z = e => ({value: e, enumerable: !1, writable: !0, configurable: !0}), j = function () {
|
||||
const e = (e, t) => Object.defineProperty(String.prototype, e, Z(t));
|
||||
e("fromBase64", (function () {
|
||||
return T(this)
|
||||
})), e("toBase64", (function (e) {
|
||||
return C(this, e)
|
||||
})), e("toBase64URI", (function () {
|
||||
return C(this, !0)
|
||||
})), e("toBase64URL", (function () {
|
||||
return C(this, !0)
|
||||
})), e("toUint8Array", (function () {
|
||||
return D(this)
|
||||
}))
|
||||
}, I = function () {
|
||||
const e = (e, t) => Object.defineProperty(Uint8Array.prototype, e, Z(t));
|
||||
e("toBase64", (function (e) {
|
||||
return A(this, e)
|
||||
})), e("toBase64URI", (function () {
|
||||
return A(this, !0)
|
||||
})), e("toBase64URL", (function () {
|
||||
return A(this, !0)
|
||||
}))
|
||||
}, O = {
|
||||
version: e,
|
||||
VERSION: "3.6.0",
|
||||
atob: E,
|
||||
atobPolyfill: S,
|
||||
btoa: p,
|
||||
btoaPolyfill: h,
|
||||
fromBase64: T,
|
||||
toBase64: C,
|
||||
encode: C,
|
||||
encodeURI: m,
|
||||
encodeURL: m,
|
||||
utob: B,
|
||||
btou: w,
|
||||
decode: T,
|
||||
isValid: e => {
|
||||
if ("string" != typeof e) return !1;
|
||||
const t = e.replace(/\s+/g, "").replace(/=+$/, "");
|
||||
return !/[^\s0-9a-zA-Z\+/]/.test(t) || !/[^\s0-9a-zA-Z\-_]/.test(t)
|
||||
},
|
||||
fromUint8Array: A,
|
||||
toUint8Array: D,
|
||||
extendString: j,
|
||||
extendUint8Array: I,
|
||||
extendBuiltins: () => {
|
||||
j(), I()
|
||||
},
|
||||
Base64: {}
|
||||
};
|
||||
return Object.keys(O).forEach((e => O.Base64[e] = O[e])), O
|
||||
}));
|
||||
//# sourceMappingURL=/sm/8bca8602e2256d240cef904e1c1df432ccfdd2a2a73f6911c60be79e526e3e1e.map
|
||||
@ -0,0 +1,345 @@
|
||||
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
|
||||
const gauge = (data, id) => {
|
||||
let charts = echarts.init(id)
|
||||
let option = {
|
||||
title: [
|
||||
{
|
||||
text: "合格",
|
||||
y: "70%",
|
||||
x: "center",
|
||||
textStyle: {
|
||||
fontWeight: "bold",
|
||||
fontSize: vw*0.7,
|
||||
color: "#ffffff",
|
||||
},
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "",
|
||||
type: "gauge",
|
||||
splitNumber: 1, //刻度数量
|
||||
min: 0,
|
||||
max: 100,
|
||||
radius: "140%", //图表尺寸
|
||||
center: ["50%", "80%"],
|
||||
startAngle: 180,
|
||||
endAngle: 0,
|
||||
axisTick: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#042653",
|
||||
width: 3,
|
||||
},
|
||||
length: vw,
|
||||
splitNumber: 50,
|
||||
distance:10,
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
show: false,
|
||||
},
|
||||
pointer: {
|
||||
show: false,
|
||||
},
|
||||
detail: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "gauge",
|
||||
radius: "140%",
|
||||
startAngle: 180,
|
||||
endAngle: 0,
|
||||
center: ["50%", "80%"],
|
||||
min: 0,
|
||||
max: 100,
|
||||
title: {
|
||||
show: false,
|
||||
},
|
||||
detail: {
|
||||
formatter: function (params) {
|
||||
return data + "%";
|
||||
},
|
||||
color: "#2755F7",
|
||||
fontSize: 2*vw,
|
||||
offsetCenter: [0, -2*vw],
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
width: vw*0.7,
|
||||
color: [
|
||||
[data / 100, new echarts.graphic.LinearGradient(0, 0, 1, 0, [
|
||||
{
|
||||
offset: 0,
|
||||
color: "#08f38a",
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: "#09ecdb",
|
||||
},
|
||||
])],
|
||||
[1, "rgba(225,225,225,0.4)"],
|
||||
],
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
show: false,
|
||||
},
|
||||
pointer: {
|
||||
show: false,
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#54F200",
|
||||
},
|
||||
},
|
||||
data: [data],
|
||||
},
|
||||
{
|
||||
type: "pie",
|
||||
startAngle: 180,
|
||||
center: ["50%", "80%"],
|
||||
radius: ["131%", "133%"],
|
||||
labelLine: {
|
||||
show: false,
|
||||
},
|
||||
data: [
|
||||
{
|
||||
name: "",
|
||||
value: data,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
show: true,
|
||||
color: 'rgba(0,0,0,0)',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
//画中间的图标
|
||||
name: "",
|
||||
value: 0,
|
||||
label: {
|
||||
position: "inside",
|
||||
backgroundColor: "#fff",
|
||||
borderRadius: 12,
|
||||
padding: vw*0.5, // 可以控制圆的大小
|
||||
borderWidth: 3,
|
||||
borderColor: "#43f0d2",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
value: 100 - data,
|
||||
itemStyle: {
|
||||
color: "rgba(0,0,0,0)",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
value: 100,
|
||||
itemStyle: {
|
||||
color: "rgba(0,0,0,0)",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
charts.setOption(option)
|
||||
$(window).resize(charts.resize);
|
||||
}
|
||||
const bar = (data,id) =>{
|
||||
let charts = echarts.init(id)
|
||||
let option ={
|
||||
tooltip: {},
|
||||
grid: {
|
||||
top:'10%',
|
||||
bottom:'10%',
|
||||
left:'10%',
|
||||
right:'5%',
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
data: data.x,
|
||||
axisTick: {
|
||||
alignWithLabel: true,
|
||||
},
|
||||
nameTextStyle: {
|
||||
color: "#82b0ec",
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#82b0ec",
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: "#82b0ec",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: "#82b0ec",
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: "#0c2c5a",
|
||||
},
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "",
|
||||
type: "pictorialBar",
|
||||
symbolSize: [20, 5],
|
||||
symbolOffset: [0, '-50%'],
|
||||
symbolPosition: "end",
|
||||
z: 12,
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
color:'#63ccfe',
|
||||
position: "top",
|
||||
},
|
||||
},
|
||||
data: data.y,
|
||||
},
|
||||
{
|
||||
type: "bar",
|
||||
itemStyle: {
|
||||
normal: {
|
||||
opacity: 0.7,
|
||||
borderWidth:1,
|
||||
borderColor:'#3babf3',
|
||||
color:new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: "#0e8bd6",
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: "#0b2bd8",
|
||||
},
|
||||
])
|
||||
},
|
||||
},
|
||||
barWidth: "20",
|
||||
data: data.y,
|
||||
},
|
||||
],
|
||||
}
|
||||
charts.setOption(option)
|
||||
$(window).resize(charts.resize);
|
||||
}
|
||||
const line = (data,id) =>{
|
||||
let charts = echarts.init(id)
|
||||
let option = {
|
||||
grid: {
|
||||
left: "1%",
|
||||
right: "1%",
|
||||
top: "10%",
|
||||
bottom: "5%",
|
||||
containLabel: true,
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: "axis",
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
boundaryGap: false,
|
||||
axisLabel: {
|
||||
color: '#30eee9',
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#397cbc",
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#195384",
|
||||
type :'dashed'
|
||||
},
|
||||
},
|
||||
data: data.x,
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
axisLabel: {
|
||||
color: '#30eee9',
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#186afe",
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#11366e",
|
||||
type :'dashed'
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "产量",
|
||||
type: "line",
|
||||
stack: "总量",
|
||||
symbol: "circle",
|
||||
symbolSize: 8,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#aecb56",
|
||||
borderWidth:2,
|
||||
borderColor:'#fff',
|
||||
lineStyle: {
|
||||
color: "#aecb56",
|
||||
width: 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
data: data.y,
|
||||
},
|
||||
],
|
||||
};
|
||||
charts.setOption(option)
|
||||
$(window).resize(charts.resize);
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
!function(t){"use strict";t.fn.countUp=function(e){var a=t.extend({time:2e3,delay:10},e);return this.each(function(){var e=t(this),n=a,u=function(){e.data("counterupTo")||e.data("counterupTo",e.text());var t=parseInt(e.data("counter-time"))>0?parseInt(e.data("counter-time")):n.time,a=parseInt(e.data("counter-delay"))>0?parseInt(e.data("counter-delay")):n.delay,u=t/a,r=e.data("counterupTo"),o=[r],c=/[0-9]+,[0-9]+/.test(r);r=r.replace(/,/g,"");for(var d=(/^[0-9]+$/.test(r),/^[0-9]+\.[0-9]+$/.test(r)),s=d?(r.split(".")[1]||[]).length:0,i=u;i>=1;i--){var p=parseInt(Math.round(r/u*i));if(d&&(p=parseFloat(r/u*i).toFixed(s)),c)for(;/(\d+)(\d{3})/.test(p.toString());)p=p.toString().replace(/(\d+)(\d{3})/,"$1,$2");o.unshift(p)}e.data("counterup-nums",o),e.text("0");var f=function(){e.text(e.data("counterup-nums").shift()),e.data("counterup-nums").length?setTimeout(e.data("counterup-func"),a):(delete e.data("counterup-nums"),e.data("counterup-nums",null),e.data("counterup-func",null))};e.data("counterup-func",f),setTimeout(e.data("counterup-func"),a)};e.waypoint(u,{offset:"100%",triggerOnce:!0})})}}(jQuery);
|
||||
@ -0,0 +1,58 @@
|
||||
$(() => {
|
||||
(function(){
|
||||
timeOne ? clearInterval(timeOne) : null
|
||||
dynamicTable({
|
||||
el: '#scrollTable',
|
||||
rowNum: 9,
|
||||
timeout: 0,
|
||||
theadHeight: 9,
|
||||
header: ['序号', '型号', '计划数', '完成数', '进度'],
|
||||
data: [[1, 'a12345', 6666, 5555, '100%'], [2, 'a12345', 6666, 5555, '100%'], [2, 'a12345', 6666, 5555, '100%'], [2, 'a12345', 6666, 5555, '100%'], [2, 'a12345', 6666, 5555, '100%'], [2, 'a12345', 6666, 5555, '100%'], [2, 'a12345', 6666, 5555, '100%'], [2, 'a12345', 6666, 5555, '100%'], [2, 'a12345', 6666, 5555, '100%'], [2, 'a12345', 6666, 5555, 6]],
|
||||
index: false,
|
||||
fontColor: '#60afe2',
|
||||
indexBGC: '#86F3FF',
|
||||
headerBGC: 'rgba(255,255,255,0.05)',
|
||||
oddRowBGC: 'rgba(255,255,255,0.01)',
|
||||
evenRowBGC: 'rgba(255,255,255,0.05)',
|
||||
});
|
||||
[1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9].length < 9 ? clearInterval(timeOne) : timeOne = tableAnimation('#scrollTable')
|
||||
})()
|
||||
gauge(80, document.getElementById('gauge'))
|
||||
bar({
|
||||
x: [111, 222, 333, 444],
|
||||
y: [111, 222, 333, 444]
|
||||
}, document.getElementById('bar'))
|
||||
line({
|
||||
x: ['1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7'],
|
||||
y: [123, 345, 1, 78, 34, 69, 23],
|
||||
}, document.getElementById('line'))
|
||||
setNum([1234, 2345, 3456])
|
||||
setState({
|
||||
aState: true,
|
||||
bState: false,
|
||||
cState: true,
|
||||
})
|
||||
})
|
||||
let timeOne = null
|
||||
let setNum = (data) => {
|
||||
let data1 = [data?.[0].toString().split('').at(-4) || '0', data?.[0].toString().split('').at(-3) || '0', data?.[0].toString().split('').at(-2) || '0', data?.[0].toString().split('').at(-1) || '0'] || Array(4).fill('0')
|
||||
let data2 = [data?.[1].toString().split('').at(-4) || '0', data?.[1].toString().split('').at(-3) || '0', data?.[1].toString().split('').at(-2) || '0', data?.[1].toString().split('').at(-1) || '0'] || Array(4).fill('0')
|
||||
let data3 = [data?.[2].toString().split('').at(-4) || '0', data?.[2].toString().split('').at(-3) || '0', data?.[2].toString().split('').at(-2) || '0', data?.[2].toString().split('').at(-1) || '0'] || Array(4).fill('0')
|
||||
data1.forEach((e, index) => {
|
||||
$('#statistics .num' + (index + 1)).html(e)
|
||||
})
|
||||
data2.forEach((e, index) => {
|
||||
$('#actualOutput .num' + (index + 1)).html(e)
|
||||
})
|
||||
data3.forEach((e, index) => {
|
||||
$('#NumberOfDownLines .num' + (index + 1)).html(e)
|
||||
})
|
||||
}
|
||||
let setState = (data) => {
|
||||
let data1 = data?.aState || false
|
||||
let data2 = data?.bState || false
|
||||
let data3 = data?.cState || false
|
||||
$("#aState").css({backgroundColor: data1 ? '#17e137' : '#ff0000'})
|
||||
$("#bState").css({backgroundColor: data2 ? '#17e137' : '#ff0000'})
|
||||
$("#cState").css({backgroundColor: data3 ? '#17e137' : '#ff0000'})
|
||||
}
|
||||
|
After Width: | Height: | Size: 72 KiB |
@ -0,0 +1 @@
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-view{display:block;position:relative;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#fafafa;color:#333;font-family:Courier New;font-size:13px}.layui-code-title{position:relative;padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee;font-size:12px}.layui-code-title>.layui-code-about{position:absolute;right:10px;top:0;color:#b7b7b7}.layui-code-about>a{padding-left:10px}.layui-code-view>.layui-code-ol,.layui-code-view>.layui-code-ul{position:relative;overflow:auto}.layui-code-view>.layui-code-ol>li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view>.layui-code-ol>li:first-child,.layui-code-view>.layui-code-ul>li:first-child{padding-top:10px}.layui-code-view>.layui-code-ol>li:last-child,.layui-code-view>.layui-code-ul>li:last-child{padding-bottom:10px}.layui-code-view>.layui-code-ul>li{position:relative;line-height:20px;padding:0 10px;list-style-type:none;*list-style-type:none;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-dark{border:1px solid #0c0c0c;border-left-color:#3f3f3f;background-color:#0c0c0c;color:#c2be9e}.layui-code-dark>.layui-code-title{border-bottom:none}.layui-code-dark>.layui-code-ol>li,.layui-code-dark>.layui-code-ul>li{background-color:#3f3f3f;border-left:none}.layui-code-dark>.layui-code-ul>li{margin-left:6px}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}
|
||||
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 701 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 299 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 701 B |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 302 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,135 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
$(function () {
|
||||
var options = {
|
||||
code: "deviceId",
|
||||
parentCode: "deviceParentId",
|
||||
expandColumn: "2",
|
||||
uniqueId: "deviceId",
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add/{id}",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove/{id}",
|
||||
exportUrl: prefix + "/export",
|
||||
addPartsurl:prefix + "/addweixiu/{id}",
|
||||
modalName: "scada设备信息",
|
||||
detailView: true,
|
||||
onExpandRow: function (index, row, $detail) {
|
||||
initChildTable(index, row, $detail);
|
||||
},
|
||||
columns: [
|
||||
|
||||
{
|
||||
field: 'selectItem',
|
||||
radio: true
|
||||
},
|
||||
{
|
||||
field: 'deviceId',
|
||||
title: '设备编号',
|
||||
align: 'left',
|
||||
|
||||
},
|
||||
{
|
||||
field: 'deviceName',
|
||||
title: '设备名称',
|
||||
align: 'left',
|
||||
width: '265',
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
field: 'deviceSpe',
|
||||
title: '规格',
|
||||
align: 'left',
|
||||
width: '230'
|
||||
},
|
||||
{
|
||||
field: 'deviceType',
|
||||
title: '设备类型',
|
||||
align: 'left'
|
||||
// formatter: function (value, row, index) {
|
||||
// return $.table.selectDictLabel(deviceType, value);
|
||||
// }
|
||||
|
||||
},
|
||||
|
||||
// {
|
||||
// field: 'manufacturerId',
|
||||
// title: '生产ID',
|
||||
// visible: false,
|
||||
// align: 'left'
|
||||
// },
|
||||
// {
|
||||
// field: 'baseManufacturer.manufacturerName',
|
||||
// title: '生产厂家',
|
||||
// align: 'left'
|
||||
// },
|
||||
|
||||
{
|
||||
field: 'fristDate',
|
||||
title: '出厂日期',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'deviceParentId',
|
||||
title: '看板位置',
|
||||
|
||||
},
|
||||
{
|
||||
field: 'deviceIp',
|
||||
title: '设备IP',
|
||||
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '创建人',
|
||||
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
align: 'left'
|
||||
},
|
||||
// {
|
||||
// field: 'updateBy',
|
||||
// title: '更新人',
|
||||
//
|
||||
// },
|
||||
// {
|
||||
// field: 'updateTime',
|
||||
// title: '更新时间',
|
||||
//
|
||||
// },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
align: 'left',
|
||||
formatter: function (value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-primary btn-xs " href="javascript:void(0)" onclick="authUsers(\'' + row.deviceId + '\')"><i class="fa fa-upload"></i>上传文档</a> ');
|
||||
// actions.push('<a class="btn btn-paeameter btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="selectUsersToParent(\'' + row.deviceId + '\')"><i class="fa fa-plus"></i>参数</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="addParts(\'' + row.uuid + '\')"><i class="fa fa-edit"></i>新增保养部位</a> ');
|
||||
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="selectPart(\'' + row.uuid + '\')"><i class="fa fa-eye"></i>查看保养部位</a>\t');
|
||||
|
||||
// actions.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authUser(\'' + row.deviceId + '\')'><i class='fa fa-user'></i>上传文档</a>");
|
||||
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.deviceId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
// actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="addParts(\'' + row.uuid + '\')"><i class="fa fa-plus"></i>保养部位</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.deviceId + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.treeTable.init(options);
|
||||
});
|
||||