| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <% layout('/layouts/default.html', {title: '设备历史属性', libs: ['dataGrid','laydate']}){ %>
- <style>
- /* 仅本页查询区样式,不影响其他模块 */
- .mah-search {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- gap: 12px 20px;
- padding: 14px 16px;
- margin-bottom: 12px;
- background: #f7f9fc;
- border: 1px solid #e6ebf2;
- border-radius: 6px;
- }
- .mah-search .mah-item {
- display: flex;
- align-items: center;
- margin: 0;
- }
- .mah-search .mah-item > label {
- margin: 0 8px 0 0;
- white-space: nowrap;
- color: #556070;
- font-weight: 500;
- }
- .mah-search .form-control {
- height: 34px;
- border-radius: 4px;
- border-color: #d0d7e2;
- box-shadow: none;
- }
- .mah-search .form-control:focus {
- border-color: #5b9bd5;
- box-shadow: 0 0 0 2px rgba(91, 155, 213, 0.15);
- }
- .mah-search #eqpId {
- width: 140px;
- }
- .mah-search #beginTime {
- width: 178px;
- cursor: pointer;
- background: #fff;
- }
- .mah-search .mah-actions {
- display: flex;
- gap: 8px;
- margin-left: auto;
- }
- .mah-search .mah-actions .btn {
- min-width: 72px;
- height: 34px;
- padding: 0 14px;
- border-radius: 4px;
- }
- </style>
- <div class="main-content">
- <div class="box box-main">
- <div class="box-header">
- <div class="box-title">
- <i class="fa icon-notebook"></i> ${text('设备历史属性')}
- </div>
- <div class="box-tools pull-right">
- <a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
- <a href="#" class="btn btn-default" id="btnRefresh" title="${text('刷新')}"><i class="fa fa-refresh"></i> ${text('刷新')}</a>
- <a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
- </div>
- </div>
- <div class="box-body">
- <#form:form id="searchForm" model="${machineAttrHistory}" action="${ctx}/tianHong/machineAttrHistory/listData" method="post" class="form-inline hide"
- data-page-no="${parameter.pageNo}" data-page-size="20" data-order-by="${parameter.orderBy}">
- <div class="mah-search">
- <div class="mah-item">
- <label>${text('设备号')}</label>
- <#form:input path="eqpId" maxlength="40" class="form-control" required="true" placeholder="如 D001"/>
- </div>
- <div class="mah-item">
- <label>${text('上传时间')}</label>
- <input type="text" id="beginTime" name="beginTime" readonly="readonly"
- maxlength="19" class="form-control laydate required"
- data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss"
- data-msg-required="请选择上传时间"
- placeholder="上传时间"
- value="${machineAttrHistory.beginTime!, 'yyyy-MM-dd HH:mm:ss'}"/>
- </div>
- <div class="mah-actions">
- <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> ${text('查询')}</button>
- <button type="reset" class="btn btn-default btn-sm"><i class="fa fa-undo"></i> ${text('重置')}</button>
- </div>
- </div>
- </#form:form>
- <table id="dataGrid"></table>
- <div id="dataGridPage"></div>
- </div>
- </div>
- </div>
- <% } %>
- <script>
- // 初始化DataGrid对象(须先填设备号;每页 20,时间正序由后端保证)
- $('#dataGrid').dataGrid({
- searchForm: $("#searchForm"),
- pageSize: 20,
- shrinkToFit: false,
- columnModel: [
- {header:'${text("设备号")}', name:'eqpId', index:'t.eqp_id', width:100, align:"center", frozen:true},
- {header:'${text("炉膛温度(℃)")}', name:'cruTemp', index:'c.Value', width:100, align:"center"},
- {header:'${text("铝水温度(℃)")}', name:'aluTemp', index:'a.Value', width:100, align:"center"},
- {header:'${text("模具温度(℃)")}', name:'mouldInfo', index:'mt.mould_info', width:160, align:"center"},
- {header:'${text("理论压力")}', name:'theoryPressure', index:'p.TheoryValue', width:90, align:"center"},
- {header:'${text("实际压力")}', name:'realPressure', index:'p.RealValue', width:90, align:"center"},
- {header:'${text("压力段位")}', name:'pressureLevel', index:'p.LevelID', width:80, align:"center"},
- {header:'${text("电量总计")}', name:'eleConsume', index:'e.Value', width:90, align:"center"},
- {header:'${text("剩余模次")}', name:'aluVal', width:80, align:"center"},
- {header:'${text("保压时间")}', name:'pressurizeTime', width:80, align:"center"},
- {header:'${text("冷却时间")}', name:'coolingTime', width:80, align:"center"},
- {header:'${text("预压压力设定")}', name:'prePres', width:100, align:"center"},
- {header:'${text("保压开始信号")}', name:'holdPressure', width:100, align:"center"},
- {header:'${text("充型压力")}', name:'moldFillingPre', width:90, align:"center"},
- {header:'${text("属性更新时间")}', name:'attrEventTime', width:170, align:"center",
- formatter: function(val){
- if (!val) return '';
- if (typeof val === 'string') {
- return val.length >= 19 ? val.substring(0, 19) : val;
- }
- return val;
- }},
- {header:'${text("操作")}', name:'actions', width:120, align:"center", formatter: function(val, obj, row, act){
- var actions = [];
- var eqpId = js.val(row,'eqpId');
- var rowId = js.val(row,'id') || '';
- var href = '${ctx}/tianHong/machineAttrHistory/form?id=' + encodeURIComponent(eqpId || '');
- if (rowId && /_\d{20}$/.test(rowId)) {
- href += '&eventTimeKey=' + encodeURIComponent(rowId.slice(-20));
- } else {
- var et = js.val(row,'attrEventTime');
- if (et) {
- href += '&eventTime=' + encodeURIComponent(et);
- }
- }
- actions.push('<a href="'+href+'" class="addTabPage" data-title="${text("设备属性明细")}"><i class="fa fa-list"></i> ${text("属性明细")}</a> ');
- return actions.join('');
- }}
- ]
- });
- $('#btnRefresh').click(function(){
- $('#dataGrid').dataGrid('refresh');
- });
- function pad(n){ return n < 10 ? '0' + n : '' + n; }
- function formatDate(d) {
- return d.getFullYear() + '-' + pad(d.getMonth()+1) + '-' + pad(d.getDate())
- + ' ' + pad(d.getHours()) + ':' + pad(d.getMinutes()) + ':' + pad(d.getSeconds());
- }
- function formatNow() { return formatDate(new Date()); }
- (function ensureDateTime(){
- var re = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
- var $b = $('#beginTime');
- if (!$b.val() || !re.test($b.val())) {
- $b.val(formatNow());
- }
- })();
- $('#searchForm').on('reset', function(){
- setTimeout(function(){
- $('#beginTime').val(formatNow());
- }, 0);
- });
- </script>
|