|
@@ -135,17 +135,12 @@
|
|
|
isAdmin = res.body.isExcelAdmin;
|
|
|
emptyExcel = res.body.emptyExcel;
|
|
|
console.log(type);
|
|
|
- if (type == '2') {
|
|
|
- if (isAdmin) {
|
|
|
- toolBar += '<input id="imports" type="file" class="btn btn-primary" style="padding:3px 6px;font-size: 12px;margin-right: 10px;"></input>';
|
|
|
- }
|
|
|
- }
|
|
|
if (isAdmin) {
|
|
|
+ toolBar += '<input id="imports" type="file" class="btn btn-primary" style="padding:3px 6px;font-size: 12px;margin-right: 10px;"></input>';
|
|
|
toolBar += '<button id="exports" class="btn btn-primary btn-danger" style="padding:3px 6px;font-size: 12px;margin-right: 10px;">导出</button>';
|
|
|
}
|
|
|
toolBar += '<button id="saves" class="btn btn-primary btn-danger" style=" padding:3px 6px; font-size: 12px; margin-right: 10px;">保存</button>';
|
|
|
- toolBar += '<button id="closeExcel" class="btn btn-primary" style="padding:3px 6px;font-size: 12px;margin-right: 10px;">返回</button>' +
|
|
|
- '<button id="fullScreen" class="btn btn-primary" style="padding:3px 6px;font-size: 12px;margin-right: 10px;">全屏显示</button>' +
|
|
|
+ toolBar += '<button id="fullScreen" class="btn btn-primary" style="padding:3px 6px;font-size: 12px;margin-right: 10px;">全屏显示</button>' +
|
|
|
'<button id="exitFullScreen" class="btn btn-primary" style="padding:3px 6px;font-size: 12px;margin-right: 10px;display:none">退出全屏</button>';
|
|
|
var eJson = res.body.excelJson;
|
|
|
var cellData = luckysheet.transToCellData(eJson[0].data);
|
|
@@ -300,9 +295,6 @@
|
|
|
|
|
|
// 绑定按钮事件
|
|
|
function initHandel() {
|
|
|
- $("#closeExcel").on("click", function () {
|
|
|
- window.parent['backToExcelList']('true');
|
|
|
- })
|
|
|
$("#fullScreen").on("click", function () {
|
|
|
fullScreen();
|
|
|
})
|
|
@@ -312,54 +304,7 @@
|
|
|
})
|
|
|
//分享
|
|
|
$('#share').off("click").click(function () {
|
|
|
- // 当前工作表名
|
|
|
- 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("正在加载中", ctx + '/market/cOnlineExcel/checkExcelEmpty', {
|
|
|
- data: excelData,
|
|
|
- }, function (data) {
|
|
|
- if (data.result == 1) {
|
|
|
- window.top.$vm.$message({
|
|
|
- message: data.desc,
|
|
|
- type: 'error'
|
|
|
- });
|
|
|
- } else {
|
|
|
- window.parent['shareExcel'](excelData, editFrom, editTo, editStatus, excelName,excelId);
|
|
|
- }
|
|
|
- });
|
|
|
+ window.parent['showAuthDialog']('true');
|
|
|
});
|
|
|
// 保存
|
|
|
$('#saves').off("click").click(function () {
|