|
@@ -1802,8 +1802,16 @@ const SpreadJsObj = {
|
|
|
注释部分以进入鼠标进入图片,点击图片为基准更新图片,鼠标快速移动时,可能失效
|
|
|
*/
|
|
|
proto.processMouseDown = function (hitinfo) {
|
|
|
- const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
- const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
+ const col = options.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+
|
|
|
+ const sortData = SpreadJsObj.getSortData(hitinfo.sheet);
|
|
|
+ const data = sortData ? sortData[hitinfo.row] : null;
|
|
|
+ let showImage = true;
|
|
|
+ if (col.showImage && Object.prototype.toString.apply(col.showImage) === "[object Function]") {
|
|
|
+ showImage = col.showImage(data);
|
|
|
+ }
|
|
|
+ const img = showImage ? this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col) : null;
|
|
|
+
|
|
|
const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
const indent = col.indent ? col.indent : 10;
|
|
|
const centerX = hitinfo.cellStyle.hAlign === spreadNS.HorizontalAlign.right
|
|
@@ -1818,8 +1826,16 @@ const SpreadJsObj = {
|
|
|
}
|
|
|
};
|
|
|
proto.processMouseUp = function (hitinfo) {
|
|
|
- const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
- const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
+ const col = options.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+
|
|
|
+ const sortData = SpreadJsObj.getSortData(hitinfo.sheet);
|
|
|
+ const data = sortData ? sortData[hitinfo.row] : null;
|
|
|
+ let showImage = true;
|
|
|
+ if (col.showImage && Object.prototype.toString.apply(col.showImage) === "[object Function]") {
|
|
|
+ showImage = col.showImage(data);
|
|
|
+ }
|
|
|
+ const img = showImage ? this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col) : null;
|
|
|
+
|
|
|
const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
const indent = col.indent ? col.indent : 10;
|
|
|
const centerX = hitinfo.cellStyle.hAlign === spreadNS.HorizontalAlign.right
|
|
@@ -1840,8 +1856,16 @@ const SpreadJsObj = {
|
|
|
}
|
|
|
};
|
|
|
proto.processMouseMove = function (hitinfo) {
|
|
|
- const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
- const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
+ const col = options.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+
|
|
|
+ const sortData = SpreadJsObj.getSortData(hitinfo.sheet);
|
|
|
+ const data = sortData ? sortData[hitinfo.row] : null;
|
|
|
+ let showImage = true;
|
|
|
+ if (col.showImage && Object.prototype.toString.apply(col.showImage) === "[object Function]") {
|
|
|
+ showImage = col.showImage(data);
|
|
|
+ }
|
|
|
+ const img = showImage ? this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col) : null;
|
|
|
+
|
|
|
const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
const indent = col.indent ? col.indent : 10;
|
|
|
const centerX = hitinfo.cellStyle.hAlign === spreadNS.HorizontalAlign.right
|