const $ = require('jquery'); require("../css/quality.less"); require('./../resource/jquery-ui/jquery-ui.min.js'); require('./modal.js'); const { api } = require('./api.js') const { post, getCookie, getUrlArgObjectNew, emptyBox, setDatePicker, getPickerDate, listenScroll } = require('./utils.js') const iconCalenBlue = require("./../images/icon_calen_blue.png") const iconCalenGrey = require("./../images/icon_calen_grey.png") const arrowLeft = require("./../images/arrow_left.png") const arrowRight = require("./../images/arrow_right.png") let size = 15, operationName = "" $(function() { listenScroll('.mukuai') dateChange() $(".abnormalClear").click(function() { // window.location.reload() operationName = "" setDatePicker($("#datepicker"), $("#datepicker2"), 1) $(".operationName ").val("") getTabData(1) }) setDatePicker($("#datepicker"), $("#datepicker2"), 1) getTabData(1) //条目缺陷 }) $('.operationName').on("input", function(e) { let val = $(this).val().trim() operationName = val }) $(".menu .page", parent.document).removeClass("active") $(parent.document).find(".menu .page[code=YH-RZGL-CZRZ]").addClass("active") //所有数据切换日期筛选 function dateChange() { $(".monthYear .mon").click(function() { $(this).css({ backgroundColor: '#00A1FF', color: '#fff' }).siblings().css({ color: '#00A1FF', backgroundColor: '#fff' }) setDatePicker($("#datepicker"), $("#datepicker2"), 1) getTabData(1) }) $(".monthYear .year").click(function() { $(this).css({ backgroundColor: '#00A1FF', color: '#fff' }).siblings().css({ color: '#00A1FF', backgroundColor: '#fff' }) setDatePicker($("#datepicker"), $("#datepicker2"), 2) getTabData(1) }) } //获取表格数据 function getTabData(activePage) { const dateStatrt = getPickerDate($("#datepicker"), 1) const dateEnd = getPickerDate($("#datepicker2"), 2) const start = new Date(dateStatrt).getTime() const end = new Date(dateEnd).getTime() if (start > end) { $.alerModal({ "message": '开始时间不能大于结束时间~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) }); return } const param = { operationName: operationName, "startDate": dateStatrt, "endDate": dateEnd, size: size, current: activePage, } $('.pagination').html("") $('.tbody').html(emptyBox('努力加载中...', '', 1)) post(api.operationLogPage, param).then(res => { if (res.data.code == '0') { const data = res.data.data.records const totalPage = res.data.data.pages const totalNum = res.data.data.total renderTab(data, activePage) if (totalPage > 1) { renderPagination(totalPage, Number(activePage), totalNum) } else { $('.pagination').html("") } } else { $('.tbody').html(emptyBox()) } }).catch((e) => { }) } $(".filter").on("click", function(e) { getTabData(1) }) function renderTab(data, activePage) { let str = ``; for (let i = 0; i < data.length; i++) { const item = data[i] if (item.operationRecord.length > 50) { str += `