找回密码
 立即注册

QQ登录

只需一步,快速开始

Typing.

注册会员

2

主题

5

帖子

15

积分

注册会员

积分
15
  • 67

    金币

  • 2

    主题

  • 5

    帖子

最新发帖
Typing.
注册会员   /  发表于:2025-1-4 16:49  /   查看:43  /  回复:3
1金币
本帖最后由 Wilson.Zhang 于 2025-1-6 10:14 编辑
  1. <div class="blockcode"><blockquote>var soucre= {

  2. "style": "{"version":"17.1.7","name":"","docProps":{"docPropsCore":{"created":"2025-01-04T00:23:17Z"}},"sheetCount":1,"customList":[],"defaultSheetTabStyles":{},"builtInFileIcons":{},"sheets":{"Sheet1":{"name":"Sheet1","isSelected":true,"rowCount":1,"columnCount":90,"visible":1,"theme":"Office","data":{"defaultDataNode":{"style":{"themeFont":"Body"}}},"rowHeaderData":{"defaultDataNode":{"style":{"themeFont":"Body"}}},"colHeaderData":{"defaultDataNode":{"style":{"themeFont":"Body"}}},"columns":[{"name":"_a","displayName":"月份","format":"string"},{"name":"_b","displayName":"装炉日期","size":125},{"name":"_c","displayName":"出炉日期"},{"name":"_d","displayName":"喷砂日期","width":200,"size":200},{"name":"_e","displayName":"报检日期","width":200,"size":200},{"name":"_f","displayName":"全部出完日期","width":250,"size":250},{"name":"_g","displayName":"炉号1","width":150,"size":150},{"name":"_h","displayName":"炉号","width":150,"size":150},{"name":"_i","displayName":"炉次","width":150,"size":150},{"name":"_j","displayName":"行业","width":150,"size":150},{"name":"_k","displayName":"名称类","width":150,"size":150},{"name":"_l","displayName":"名称","width":150,"size":150},{"name":"_m","displayName":"规格型号","width":250,"size":250},{"name":"_n","displayName":"型号","width":150,"size":150},{"name":"_o","displayName":"厂家","width":150,"size":150},{"name":"_p","displayName":"泥料编号","width":250,"size":250},{"name":"_q","displayName":"泥料编号1","width":250,"size":250},{"name":"_r","displayName":"类型","width":150,"size":150},{"name":"_s","displayName":"类型1","width":150,"size":150},{"name":"_t","displayName":"金属硅比例","width":200,"size":200},{"name":"_u","displayName":"层次","width":150,"size":150},{"name":"_v","displayName":"位置","width":150,"size":150},{"name":"_w","displayName":"毛坯1","width":150,"size":150},{"name":"_x","displayName":"毛坯2","width":150,"size":150},{"name":"_y","displayName":"复烧次数","width":150,"size":150},{"name":"_z","displayName":"直线度范围","width":200,"size":200},{"name":"_aa","displayName":"工艺","width":150,"size":150},{"name":"_ab","displayName":"装炉数量","width":150,"size":150},{"name":"_ac","displayName":"核算1","width":150,"size":150},{"name":"_ad","displayName":"A类","width":150,"size":150},{"name":"_ae","displayName":"B类","width":150,"size":150},{"name":"_af","displayName":"C类","width":150,"size":150},{"name":"_ag","displayName":"D类","width":150,"size":150},{"name":"_a","displayName":"核算3","width":150,"size":150},{"name":"_du","displayName":"A级","width":150,"size":150},{"name":"_dv","displayName":"B级","width":150,"size":150},{"name":"_dw","displayName":"C级","width":150,"size":150},{"name":"_dx","displayName":"D级","width":150,"size":150},{"name":"_dy","displayName":"E级","width":150,"size":150},{"name":"_dz","displayName":"核算2","width":150,"size":150},{"name":"_ai","displayName":"研磨断","width":150,"size":150},{"name":"_aj","displayName":"喷砂断","width":150,"size":150},{"name":"_ak","displayName":"出炉断","width":150,"size":150},{"name":"_al","displayName":"承受力断裂","width":150,"size":150},{"name":"_am","displayName":"暗裂纹","width":150,"size":150},{"name":"_an","displayName":"尺寸","width":150,"size":150},{"name":"_ao","displayName":"凹坑","width":150,"size":150},{"name":"_ap","displayName":"直线度","width":150,"size":150},{"name":"_aq","displayName":"发绿","width":150,"size":150},{"name":"_ar","displayName":"不熟","width":150,"size":150},{"name":"_as","displayName":"磕碰","width":150,"size":150},{"name":"_at","displayName":"出炉掉块","width":150,"size":150},{"name":"_au","displayName":"变形","width":150,"size":150},{"name":"_av","displayName":"内硅","width":150,"size":150},{"name":"_aw","displayName":"凹陷","width":150,"size":150},{"name":"_ax","displayName":"分层","width":150,"size":150},{"name":"_ay","displayName":"表面烧糠","width":150,"size":150},{"name":"_az","displayName":"表面不平","width":150,"size":150},{"name":"_ba","displayName":"让发绿","width":150,"size":150},{"name":"_bb","displayName":"让尺寸","width":150,"size":150},{"name":"_bc","displayName":"让表面","width":150,"size":150},{"name":"_bd","displayName":"让掉块","width":150,"size":150},{"name":"_be","displayName":"让内硅","width":150,"size":150},{"name":"_bf","displayName":"让裂纹","width":150,"size":150},{"name":"_bg","displayName":"让直线度","width":150,"size":150},{"name":"_bh","displayName":"实验1","width":150,"size":150},{"name":"_db","displayName":"研磨质量","width":200,"size":200},{"name":"_dc","displayName":"备注1","width":200,"size":200},{"name":"_dd","displayName":"备注2","width":200,"size":200},{"name":"_de","displayName":"挤出人员","width":200,"size":200},{"name":"_df","displayName":"石墨实验","width":200,"size":200},{"name":"_dg","displayName":"综合实验","width":200,"size":200},{"name":"_eg","displayName":"产品分类","width":150,"size":150},{"name":"_di","displayName":"板材分类","width":200,"size":200},{"name":"_dj","displayName":"是否打表","width":200,"size":200},{"name":"_dk","displayName":"标识/金属硅","width":200,"size":200},{"name":"_dl","displayName":"金属硅批号","width":200,"size":200},{"name":"_dm","displayName":"直线度要求","width":200,"size":200},{"name":"_dn","displayName":"炭黑","width":200,"size":200},{"name":"_en","displayName":"烧结曲线","width":150,"size":150},{"name":"_do","displayName":"自定义1","width":200,"size":200},{"name":"_dp","displayName":"自定义2","width":200,"size":200},{"name":"_dq","displayName":"自定义3","width":200,"size":200},{"name":"_dr","displayName":"自定义4","width":200,"size":200},{"name":"_ds","displayName":"自定义4","width":200,"size":200},{"name":"_dt","displayName":"自定义4","width":200,"size":200},{"name":"bill_code","displayName":"报工单号","width":200,"size":200},{"name":"work_ordert","displayName":"派工单号","width":200,"size":200},{"name":"production_code","displayName":"派工单号","width":200,"size":200},{"name":"sale_order_code","displayName":"销售单号","width":200,"size":200}],"defaultData":{},"leftCellIndex":0,"topCellIndex":0,"selections":{"0":{"row":0,"col":0,"rowCount":1,"colCount":1},"length":1},"rowOutlines":{"items":[]},"columnOutlines":{"items":[]},"cellStates":{},"states":{},"outlineColumnOptions":{},"autoMergeRangeInfos":[],"shapeCollectionOption":{"snapMode":0},"printInfo":{"paperSize":{"width":850,"height":1100,"kind":1}},"index":0,"order":0}},"sheetTabCount":0,"namedPatterns":{}}",

  3. "data": [

  4. {

  5. "banchengpin_status": "0",

  6. "erjipin_status": "1",

  7. "notice_sub_id": "7917424141119933372",

  8. "dispatch_sub_id": "0194107ab8907320ad3445d12eaa0bbe",

  9. "sale_son_id": "",

  10. "bill_code": "W202412310061",

  11. "work_ordert": "D202412290005",

  12. "production_code": "MO_ST2024121809",

  13. "sale_order_code": null,

  14. "rowNo": null,

  15. "_a": "",

  16. "_b": "2024-12-31",

  17. "_c": "",

  18. "_d": "",

  19. "_e": "",

  20. "_f": "",

  21. "_g": "0",

  22. "_h": null,

  23. "_i": "0",

  24. "_j": "",

  25. "_k": "辊棒",

  26. "_l": "辊棒",

  27. "_m": "φ46*φ34*6*3120",

  28. "_n": "",

  29. "_o": null,

  30. "_p": "D20241231-09",

  31. "_q": "",

  32. "_r": null,

  33. "_s": "",

  34. "_t": "",

  35. "_u": "2",

  36. "_v": "南中",

  37. "_w": "",

  38. "_x": "",

  39. "_y": "",

  40. "_z": "",

  41. "_aa": "",

  42. "_ab": "20",

  43. "_ac": "",

  44. "_ad": "",

  45. "_ae": "",

  46. "_af": "",

  47. "_ag": "",

  48. "_ah": "",

  49. "_ai": "",

  50. "_aj": "",

  51. "_ak": "",

  52. "_al": "",

  53. "_am": "",

  54. "_an": "",

  55. "_ao": "1",

  56. "_ap": "2",

  57. "_aq": "",

  58. "_ar": "",

  59. "_as": "",

  60. "_at": "",

  61. "_au": "",

  62. "_av": "",

  63. "_aw": "",

  64. "_ax": "",

  65. "_ay": "",

  66. "_az": "",

  67. "_ba": "",

  68. "_bb": "",

  69. "_bc": "",

  70. "_bd": "",

  71. "_be": "",

  72. "_bf": "",

  73. "_bg": "",

  74. "_bh": "",

  75. "_bi": "",

  76. "_bj": "",

  77. "_bk": "",

  78. "_bl": "",

  79. "_bm": "",

  80. "_bn": "",

  81. "_bo": "",

  82. "_bp": "",

  83. "_bq": "",

  84. "_br": "",

  85. "_bs": "",

  86. "_bt": "",

  87. "_bu": "",

  88. "_bv": "",

  89. "_bw": "",

  90. "_bx": "",

  91. "_by": "",

  92. "_bz": "",

  93. "_ca": "",

  94. "_cb": "",

  95. "_cc": "",

  96. "_cd": "",

  97. "_ce": "",

  98. "_cf": "",

  99. "_cg": "",

  100. "_ch": "",

  101. "_ci": "",

  102. "_cj": "",

  103. "_ck": "",

  104. "_cl": "",

  105. "_cm": "",

  106. "_cn": "",

  107. "_co": "",

  108. "_cp": "",

  109. "_cq": "",

  110. "_cr": "",

  111. "_cs": "",

  112. "_ct": "",

  113. "_cu": "",

  114. "_cv": "",

  115. "_cw": "",

  116. "_cx": "",

  117. "_cy": "",

  118. "_cz": "",

  119. "_da": "",

  120. "_db": "",

  121. "_dc": "",

  122. "_dd": "",

  123. "_de": "",

  124. "_df": "",

  125. "_dg": "",

  126. "_dh": "",

  127. "_di": "",

  128. "_dj": "",

  129. "_dk": "",

  130. "_dl": "",

  131. "_dm": "",

  132. "_dn": "",

  133. "_do": "",

  134. "_dp": "",

  135. "_dq": "",

  136. "_dr": "",

  137. "_ds": "",

  138. "_dt": "",

  139. "_du": "1",

  140. "_dv": "2",

  141. "_dw": "3",

  142. "_dx": "4",

  143. "_dy": "",

  144. "_dz": "",

  145. "id": "01941b59890f72889ad38c4340a2db57",

  146. "createTime": "2024-12-31 02:30:54",

  147. "createId": "",

  148. "modifyTime": "2024-12-31 02:30:54",

  149. "modifyId": ""

  150. }

  151. ]

  152. }
  153. var sheet = spread.getActiveSheet();
  154. spread.fromJSON(JSON.parse(soucre.style))

  155. sheet.setDataSource(soucre.data);
  156. 数据不显示,标题也不显示
复制代码


3 个回复

倒序浏览
Wilson.Zhang
超级版主   /  发表于:昨天 10:20
沙发
您好!您提供的json数据格式不太正确,请教下您的json数据来源。

我分析过您提供的json数据,理解您需要反序列化的是source.style,之后再对Worksheet设置数据源source.data。我将您的json数据拆解后可以正常设置,在此不讨论您数据中的属性列名称,如下图所示:
1736129838078.png454696349.png

将拆解后的json数据同步给您测试,分别为style.json和data.json:

json.zip

1.05 KB, 下载次数: 1

回复 使用道具 举报
Typing.
注册会员   /  发表于:昨天 10:53
板凳
Wilson.Zhang 发表于 2025-1-6 10:20
您好!您提供的json数据格式不太正确,请教下您的json数据来源。

我分析过您提供的json数据,理解您需要 ...

表头需要显示名称,需要使用缓存数据
image.png739055480.png
回复 使用道具 举报
Wilson.Zhang
超级版主   /  发表于:昨天 16:48
地板
Typing. 发表于 2025-1-6 10:53
表头需要显示名称,需要使用缓存数据

您的source.style中没有列头数据的定义,如下图左侧为您提供的json,右侧为正常包含列头数据的json。
列头.png752258300.png

这才导致绑定数据后没有对应的表头数据,建议您在SpreadJS中重新制作设置表头后导出为json数据使用。

回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部