|
@@ -176,7 +176,7 @@
|
|
|
initExcel(res.body.excelJson);
|
|
|
}
|
|
|
});
|
|
|
- initExcel()
|
|
|
+ //initExcel()
|
|
|
}
|
|
|
|
|
|
// 表格初始化
|
|
@@ -324,6 +324,77 @@
|
|
|
if (isAdmin) {
|
|
|
$("#newShareBtn").show();
|
|
|
}
|
|
|
+ console.log("执行自动保存定时器")
|
|
|
+ var t1 = window.setInterval(function autoSave() {
|
|
|
+ console.log("执行自动保存")
|
|
|
+ var excelId = $(window.parent.document).find("#excelId").attr("value");
|
|
|
+ var sheetName = luckysheet.getSheet().name;
|
|
|
+ var excelData = luckysheet.getSheet(sheetName);
|
|
|
+ var urlsave = '/market/cOnlineExcel/saveExcel';
|
|
|
+ var editFrom = $("#editFrom").val();
|
|
|
+ var editTo = $("#editTo").val();
|
|
|
+ var editStatus = $("#editStatus").val();
|
|
|
+ var excelName = luckysheet.toJson().title;
|
|
|
+ if ($.trim(editFrom) == '' && $.trim(editTo) == '') {
|
|
|
+
|
|
|
+ } else if (/^\d*$/.test(editFrom) && /^\d*$/.test(editTo)) {
|
|
|
+ if (editFrom == 0) {
|
|
|
+ window.top.$vm.$message({
|
|
|
+ message: '自动保存出错:可编辑列开始不能为0',
|
|
|
+ type: 'info'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (editFrom > editTo) {
|
|
|
+ window.top.$vm.$message({
|
|
|
+ message: '自动保存出错:可编辑列的起始列不能大于结束列',
|
|
|
+ type: 'info'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else if (/^[a-zA-Z]+$/.test(editFrom) && /^[a-zA-Z]+$/.test(editTo)) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ window.top.$vm.$message({
|
|
|
+ message: '自动保存出错:可编辑列必须全部为字母或数字',
|
|
|
+ type: 'info'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ util.ajaxJson(null, ctx + '/market/cOnlineExcel/checkExcelEmpty', {
|
|
|
+ data: excelData,
|
|
|
+ }, function (data) {
|
|
|
+ if (data.result == 1) {
|
|
|
+ window.top.$vm.$message({
|
|
|
+ message: data.desc,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ util.ajaxJson(null, ctx + urlsave, {
|
|
|
+ data: excelData,
|
|
|
+ id: excelId,
|
|
|
+ editConStart: editFrom,
|
|
|
+ editConEnd: editTo,
|
|
|
+ excelName: excelName,
|
|
|
+ editStatus: editStatus
|
|
|
+ }, function (data) {
|
|
|
+ if (data.result == 1) {
|
|
|
+ window.top.$vm.$message({
|
|
|
+ message: data.desc,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // window.top.$vm.$message({
|
|
|
+ // message: '自动保存成功',
|
|
|
+ // type: 'info'
|
|
|
+ // });
|
|
|
+ //console.log(data);
|
|
|
+ //getData()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }, 15000)
|
|
|
}
|
|
|
if (excelInfo.shareStatus == '1') {
|
|
|
$("#editTo").attr('disabled', true);
|
|
@@ -404,7 +475,7 @@
|
|
|
window.parent['backToExcelList']('true');
|
|
|
})
|
|
|
$("#fullScreen").on("click", function () {
|
|
|
- if (fullScreenState){
|
|
|
+ if (fullScreenState) {
|
|
|
fullScreenState = false;
|
|
|
$("#fullScreen").html('全屏显示');
|
|
|
} else {
|
|
@@ -420,7 +491,7 @@
|
|
|
})
|
|
|
//分享
|
|
|
$('#share').off("click").click(function () {
|
|
|
- if (fullScreenState){
|
|
|
+ if (fullScreenState) {
|
|
|
fullScreenState = false;
|
|
|
$("#fullScreen").html('全屏显示');
|
|
|
window.parent['fullScreen']('true');
|
|
@@ -429,7 +500,7 @@
|
|
|
});
|
|
|
//新增分享
|
|
|
$('#newShare').off("click").click(function () {
|
|
|
- if (fullScreenState){
|
|
|
+ if (fullScreenState) {
|
|
|
fullScreenState = false;
|
|
|
$("#fullScreen").html('全屏显示');
|
|
|
window.parent['fullScreen']('true');
|