@ -8,13 +8,15 @@ import menuButton from './menuButton';
import { createFilterOptions } from './filter' ;
import { createFilterOptions } from './filter' ;
import luckysheetFreezen from './freezen' ;
import luckysheetFreezen from './freezen' ;
import luckysheetPostil from './postil' ;
import luckysheetPostil from './postil' ;
import imageCtrl from './imageCtrl' ;
import dataVerificationCtrl from './dataVerificationCtrl' ;
import hyperlinkCtrl from './hyperlinkCtrl' ;
import { getObjType , replaceHtml , getByteLen } from '../utils/util' ;
import { getObjType , replaceHtml , getByteLen } from '../utils/util' ;
import { getSheetIndex } from '../methods/get' ;
import { getSheetIndex } from '../methods/get' ;
import Store from '../store' ;
import Store from '../store' ;
import { collaborativeEditBox } from './select'
import { collaborativeEditBox } from './select'
import locale from '../locale/locale' ;
import locale from '../locale/locale' ;
import dayjs from "dayjs" ;
import dayjs from "dayjs" ;
import imageCtrl from './imageCtrl' ;
import json from '../global/json' ;
import json from '../global/json' ;
const server = {
const server = {
@ -169,7 +171,7 @@ const server = {
//客户端接收服务端数据时触发
//客户端接收服务端数据时触发
_ this . websocket . onmessage = function ( result ) {
_ this . websocket . onmessage = function ( result ) {
Store . result = result
Store . result = result
let data = eval ( '(' + result . data + ')' ) ;
let data = new Function ( "return " + result . data ) ( ) ;
console . info ( data ) ;
console . info ( data ) ;
let type = data . type ;
let type = data . type ;
let { message , id } = data ;
let { message , id } = data ;
@ -517,12 +519,31 @@ const server = {
} , 1 ) ;
} , 1 ) ;
}
}
}
}
else if ( k == "images" ) { //图片
if ( index == Store . currentSheetIndex ) {
imageCtrl . images = value ;
imageCtrl . allImagesShow ( ) ;
imageCtrl . init ( ) ;
}
}
else if ( k == "dataVerification" ) { //数据验证
if ( index == Store . currentSheetIndex ) {
dataVerificationCtrl . dataVerification = value ;
dataVerificationCtrl . init ( ) ;
}
}
else if ( k == "hyperlink" ) { //链接
if ( index == Store . currentSheetIndex ) {
hyperlinkCtrl . hyperlink = value ;
hyperlinkCtrl . init ( ) ;
}
}
}
}
else if ( type == "fc" ) { //函数链calc
else if ( type == "fc" ) { //函数链calc
let op = item . op , pos = item . pos ;
let op = item . op , pos = item . pos ;
if ( getObjType ( value ) != "object" ) {
if ( getObjType ( value ) != "object" ) {
value = eval ( '(' + value + ')' ) ;
value = new Function ( "return " + value ) ( ) ;
}
}
let r = value . r , c = value . c ;
let r = value . r , c = value . c ;
@ -995,7 +1016,7 @@ const server = {
// console.log("request");
// console.log("request");
if ( _ this . updateUrl != "" ) {
if ( _ this . updateUrl != "" ) {
$ . post ( _ this . updateUrl , { compress : iscommpress , gridKey : _ this . gridKey , data : params } , function ( data ) {
$ . post ( _ this . updateUrl , { compress : iscommpress , gridKey : _ this . gridKey , data : params } , function ( data ) {
let re = eval ( '(' + data + ')' )
let re = new Function ( "return " + data ) ( ) ;
if ( re . status ) {
if ( re . status ) {
$ ( "#luckysheet_info_detail_update" ) . html ( "最近存档时间:" + dayjs ( ) . format ( "M-D H:m:s" ) ) ;
$ ( "#luckysheet_info_detail_update" ) . html ( "最近存档时间:" + dayjs ( ) . format ( "M-D H:m:s" ) ) ;
$ ( "#luckysheet_info_detail_save" ) . html ( "同步成功" ) ;
$ ( "#luckysheet_info_detail_save" ) . html ( "同步成功" ) ;
@ -1055,7 +1076,7 @@ const server = {
if ( _ this . updateImageUrl != "" ) {
if ( _ this . updateImageUrl != "" ) {
// $.post(_this.updateImageUrl, { compress: true, gridKey: _this.gridKey, data:data1 }, function (data) {
// $.post(_this.updateImageUrl, { compress: true, gridKey: _this.gridKey, data:data1 }, function (data) {
$ . post ( _ this . updateImageUrl , { compress : false , gridKey : _ this . gridKey , data : data1 } , function ( data ) {
$ . post ( _ this . updateImageUrl , { compress : false , gridKey : _ this . gridKey , data : data1 } , function ( data ) {
let re = eval ( '(' + data + ')' )
let re = new Function ( "return " + data ) ( ) ;
if ( re . status ) {
if ( re . status ) {
imageRequestLast = dayjs ( ) ;
imageRequestLast = dayjs ( ) ;
}
}