找回密码
 立即注册

QQ登录

只需一步,快速开始

谢朵

注册会员

11

主题

56

帖子

139

积分

注册会员

积分
139
谢朵
注册会员   /  发表于:2023-5-25 10:32  /   查看:2456  /  回复:12
我想实现的效果是:在一个合并的单元格中。可以放入多张图片,图片大小适配,位置均匀分配单元格。代码在demo中

图片1

图片1

demo-sjs-15.zip

5.99 KB, 下载次数: 53

12 个回复

倒序浏览
JoestarXu
超级版主   /  发表于:2023-5-25 12:11:22
沙发
本帖最后由 JoestarXu 于 2023-5-25 12:12 编辑

您好,我看您之前提的帖子和这个帖子的需求几乎一致。

https://gcdn.grapecity.com.cn/showtopic-168392-1-1.html

您可以参考以下代码看能否解决您的问题:

  1. window.onload = function () {
  2.   let designerConfig = JSON.parse(
  3.     JSON.stringify(GC.Spread.Sheets.Designer.DefaultConfig)
  4.   );

  5.   let designer = new GC.Spread.Sheets.Designer.Designer(
  6.     "gc-designer-container",
  7.     designerConfig
  8.   );

  9.   let spread = designer.getWorkbook();

  10.   let sheet = spread.getActiveSheet();

  11.   sheet.addSpan(16, 5, 1, 2);
  12.   let arr = [
  13.     "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALgAAAA9CAYAAAAeTqOsAAAAAXNSR0IArs4c6QAADppJREFUeF7tnQm0TWUbxx+ZImPmeSzjQplCZIhoUWYSCk1EqGQmM5kqZJawzLPIMjWYF1moUCkZi0JmGb/1e761v+9+97vu2eecfc7e233ftVr3uuecfd79PP/3ef/P/3neXaK7d+/eFTOMBXxugR9//FF69OghX331lYwbN05atmypd5TIANznnk2g0ycunz9/XtatWyeLFi2Sr7/+Wv7++2957LHHpFWrVvLmm29K4sSJDcATKD58fdvXr19XUPfr109+++03vZdHHnlEI3e1atUkWbJk/7k/E8F97eqENflDhw7JlClTZOPGjfLdd99JpkyZpH79+tK4cWMpW7aspE2bVhIlSvQ/RjEAT1gY8d3d3rp1S86cOSODBw+WiRMnKoDTp0+vHLtXr16SJUuWeO/JANx3Lk8YEwbYO3fulE8//VSW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3PQ8G7iGYgHPADyUyZvPGAsEsoABeCALmdd9bQEDcF+7z0w+kAUMwANZyLzuawsYgPvafWbygSxgAB7IQuZ1X1vAANzX7jOTD2QBA/BAFjKv+9oCBuC+dp+ZfCALGIAHspB53dcWMAD3tfvM5ANZ4F+W2jTCzSfRKwAAAABJRU5ErkJggg==",
  14.     "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALgAAAA9CAYAAAAeTqOsAAAAAXNSR0IArs4c6QAADppJREFUeF7tnQm0TWUbxx+ZImPmeSzjQplCZIhoUWYSCk1EqGQmM5kqZJawzLPIMjWYF1moUCkZi0JmGb/1e761v+9+97vu2eecfc7e233ftVr3uuecfd79PP/3ef/P/3neXaK7d+/eFTOMBXxugR9//FF69OghX331lYwbN05atmypd5TIANznnk2g0ycunz9/XtatWyeLFi2Sr7/+Wv7++2957LHHpFWrVvLmm29K4sSJDcATKD58fdvXr19XUPfr109+++03vZdHHnlEI3e1atUkWbJk/7k/E8F97eqENflDhw7JlClTZOPGjfLdd99JpkyZpH79+tK4cWMpW7aspE2bVhIlSvQ/RjEAT1gY8d3d3rp1S86cOSODBw+WiRMnKoDTp0+vHLtXr16SJUuWeO/JANx3Lk8YEwbYO3fulE8//VSWLl2qfLtAgQLSsWNHqVWrlhQpUuT/onVcljEATxh48cVdkjjeuHFDfv75Z+nbt6+sWbNG+FuuXLnk3Xfflddff10eeOCBoO7FADwoc5k3R8oCN2/elG3btsmkSZNUEYGWVKhQQV555RWpV6+e0pLY/NrOXAzA7VjJvCdiFiBiHzx4UKZNm6YcO2nSpFK4cGGN4M8++6w8+OCDYX237wF+9epV+fPPPwXOljVrVkmZMmVIKz0sK5oPh2SBkydPSqdOnTRy//XXX1KuXDnVr6tXr66+DCVix56ILwEOL7ty5YqsWrVKRo8eLd9++63eV+nSpWXChAkqGQXL1ULykPlQ0Ba4c+eOatezZs2SgQMHqp8KFSokbdu21QQyefLkQV8zvg/4DuCAm9U+atQo5Wtwt5o1a8off/whu3btkuHD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rwEzjmZnILmifE/0JpL7TfOOy05IfnT2EcGhd7TEUonlIDV9JH6lX5HChJPXdR3gSIwkkLSr8pM2UU68ENXpy/Zz9HbSUeZaoVnAdYDDP5HCeOoTMiP9ykiGRHPADTXipwF6aA5O6J9yHeAAmONTJJtwfMr8lO/h+JTpaWOlDYD2TwPyhA7X4O/fdYAzZTgqhw7QfAE1UR0wc9qFwghau3n2d/DONZ8Q8QTAcQSlfyI4PRscQCC5RFrj8WaA3PQ8G7iGYgHPADyUyZvPGAsEsoABeCALmdd9bQEDcF+7z0w+kAUMwANZyLzuawsYgPvafWbygSxgAB7IQuZ1X1vAANzX7jOTD2QBA/BAFjKv+9oCBuC+dp+ZfCALGIAHspB53dcWMAD3tfvM5ANZ4F+W2jTCzSfRKwAAAABJRU5ErkJggg==",
  16.   ];

  17.   let { x, y, width, height } = sheet.getCellRect(16, 5);

  18.   for (let i = 0; i < arr.length; i++) {
  19.     var picture = sheet.pictures.add("f" + i, arr[i], 0, 0, 10, 10);
  20.     var point = new GC.Spread.Sheets.Point(310 + (width / 3) * i, 320);
  21.     picture.position(point);
  22.     picture.width(width / arr.length);
  23.     picture.height(height);
  24.   }
  25. };
复制代码
回复 使用道具 举报
谢朵
注册会员   /  发表于:2023-5-25 13:04:31
板凳
JoestarXu 发表于 2023-5-25 12:11
您好,我看您之前提的帖子和这个帖子的需求几乎一致。

https://gcdn.grapecity.com.cn/showtopic-168392 ...

是的,这是我联系了您们这边得技术支持后,他说让我新开一个帖子,方便跟一下。
回复 使用道具 举报
谢朵
注册会员   /  发表于:2023-5-25 13:06:06
地板
JoestarXu 发表于 2023-5-25 12:11
您好,我看您之前提的帖子和这个帖子的需求几乎一致。

https://gcdn.grapecity.com.cn/showtopic-168392 ...

我比较疑惑得是 Point(x,y)为什么计算里面得x是固定得310,而不是动态得x。我更改为动态得x后,我发现x得数字比310大
回复 使用道具 举报
JoestarXu
超级版主   /  发表于:2023-5-25 14:07:46
5#
谢朵 发表于 2023-5-25 13:06
我比较疑惑得是 Point(x,y)为什么计算里面得x是固定得310,而不是动态得x。我更改为动态得x后,我发现x ...

您好,请问您是如何获取这个动态的x的呢?
回复 使用道具 举报
谢朵
注册会员   /  发表于:2023-5-25 18:44:33
6#
JoestarXu 发表于 2023-5-25 14:07
您好,请问您是如何获取这个动态的x的呢?

let { x, y, width, height } = sheet.getCellRect(16, 5); 这个方法
回复 使用道具 举报
谢朵
注册会员   /  发表于:2023-5-25 19:00:30
7#
我图里  一个单元格的宽度为62。 我的图片插入在F列,那应该是 5*62=310。 但是我通过getCellRect获取到的x却是350.这是为什么
1685012286616.png
回复 使用道具 举报
谢朵
注册会员   /  发表于:2023-5-25 19:21:33
8#
谢朵 发表于 2023-5-25 19:00
我图里  一个单元格的宽度为62。 我的图片插入在F列,那应该是 5*62=310。 但是我通过getCellRect获取到的x ...

为什么我通过getCellRect获取到的x总是跟我目标单元格差40
回复 使用道具 举报
Clark.Pan讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2023-5-26 11:35:04
9#
你看一下spread dom是不是跟window存在offset
参考一下这篇文章:
https://gcdn.grapecity.com.cn/showtopic-161998-1-1.html
getCellRact和hittest同理。
回复 使用道具 举报
谢朵
注册会员   /  发表于:2023-6-19 15:50:16
10#
Clark.Pan 发表于 2023-5-26 11:35
你看一下spread dom是不是跟window存在offset
参考一下这篇文章:
https://gcdn.grapecity.com.cn/showto ...

我在使用 pictures.add(图片, id,x=401,y=799,width=56,height=56); 为什么到实际中他的xy没有在我设定的位置,我看了我的页面没有别的元素,spreadjs是定格的
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部