|
|
@ -108,7 +108,8 @@
|
|
|
|
<th:block th:include="include :: element-js" />
|
|
|
|
<th:block th:include="include :: element-js" />
|
|
|
|
<th:block th:include="include :: echarts-js" />
|
|
|
|
<th:block th:include="include :: echarts-js" />
|
|
|
|
<script th:inline="javascript">
|
|
|
|
<script th:inline="javascript">
|
|
|
|
var detailFlag = [[${@permission.hasPermi('system:check:detail')}]]
|
|
|
|
var detailFlag = [[${@permission.hasPermi('system:check:detail')}]];
|
|
|
|
|
|
|
|
var exportDetailFlag = [[${@permission.hasPermi('system:check:exportDetail')}]];
|
|
|
|
var prefix = ctx + "system/checknum";
|
|
|
|
var prefix = ctx + "system/checknum";
|
|
|
|
var app = new Vue({
|
|
|
|
var app = new Vue({
|
|
|
|
el: '#app',
|
|
|
|
el: '#app',
|
|
|
@ -308,6 +309,7 @@
|
|
|
|
align: 'center',
|
|
|
|
align: 'center',
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
var actions = [];
|
|
|
|
var actions = [];
|
|
|
|
|
|
|
|
actions.push('<a class="btn btn-info btn-xs ' + exportDetailFlag + '" href="javascript:void(0)" onclick="exportDetail(\'' + row.checkId + '\')"><i class="fa fa-download"></i>导出</a> ');
|
|
|
|
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.checkId + '\')"><i class="fa fa-edit"></i>详情</a> ');
|
|
|
|
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.checkId + '\')"><i class="fa fa-edit"></i>详情</a> ');
|
|
|
|
return actions.join('');
|
|
|
|
return actions.join('');
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -315,6 +317,57 @@
|
|
|
|
};
|
|
|
|
};
|
|
|
|
$.table.init(options);
|
|
|
|
$.table.init(options);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 导出明细
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function exportDetail(checkId) {
|
|
|
|
|
|
|
|
// 显示加载中提示
|
|
|
|
|
|
|
|
$.modal.loading("正在生成导出文件,请稍候...");
|
|
|
|
|
|
|
|
// 创建iframe
|
|
|
|
|
|
|
|
var iframe = document.createElement('iframe');
|
|
|
|
|
|
|
|
iframe.style.display = 'none';
|
|
|
|
|
|
|
|
iframe.src = prefixTable + '/exportDetail?checkId=' + checkId;
|
|
|
|
|
|
|
|
// 记录开始时间
|
|
|
|
|
|
|
|
var startTime = new Date().getTime();
|
|
|
|
|
|
|
|
// 定时检查iframe状态
|
|
|
|
|
|
|
|
var checkInterval = setInterval(function() {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
|
|
|
|
|
|
|
|
// 如果iframe内容加载完成
|
|
|
|
|
|
|
|
if (iframeDoc.readyState === 'complete') {
|
|
|
|
|
|
|
|
clearInterval(checkInterval);
|
|
|
|
|
|
|
|
$.modal.closeLoading();
|
|
|
|
|
|
|
|
// 检查是否是错误响应
|
|
|
|
|
|
|
|
var responseText = iframeDoc.body.textContent || iframeDoc.body.innerText;
|
|
|
|
|
|
|
|
if (responseText && responseText.startsWith('{"code":500')) {
|
|
|
|
|
|
|
|
var result = JSON.parse(responseText);
|
|
|
|
|
|
|
|
$.modal.alertError(result.msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 移除iframe
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
|
|
|
document.body.removeChild(iframe);
|
|
|
|
|
|
|
|
}, 100);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 超时处理(10秒超时)
|
|
|
|
|
|
|
|
if (new Date().getTime() - startTime > 10000) {
|
|
|
|
|
|
|
|
clearInterval(checkInterval);
|
|
|
|
|
|
|
|
$.modal.closeLoading();
|
|
|
|
|
|
|
|
document.body.removeChild(iframe);
|
|
|
|
|
|
|
|
$.modal.alertError("导出超时,请重试");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch(e) {
|
|
|
|
|
|
|
|
// 跨域异常通常表示文件下载成功
|
|
|
|
|
|
|
|
clearInterval(checkInterval);
|
|
|
|
|
|
|
|
$.modal.closeLoading();
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
|
|
|
document.body.removeChild(iframe);
|
|
|
|
|
|
|
|
}, 100);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, 200);
|
|
|
|
|
|
|
|
document.body.appendChild(iframe);
|
|
|
|
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
</html>
|
|
|
|