lucky_sheet.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. package excel
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "hongze/hongze_chart_lib/utils"
  6. )
  7. type LuckySheetDataBak struct {
  8. CalcChain []interface{} `json:"calcChain" description:"公式链"`
  9. CellData []LuckySheetCellData `json:"celldata" description:"单元格数据"`
  10. ChWidth int64 `json:"ch_width" description:"工作表区域的宽度"`
  11. Config struct {
  12. BorderInfo []struct {
  13. BorderType string `json:"borderType" description:""`
  14. Color string `json:"color" description:""`
  15. Range []struct {
  16. Column []int64 `json:"column" description:""`
  17. Row []int64 `json:"row" description:""`
  18. } `json:"range" description:""`
  19. RangeType string `json:"rangeType" description:""`
  20. Style string `json:"style" description:""`
  21. Value struct {
  22. B struct {
  23. Color string `json:"color" description:""`
  24. Style string `json:"style" description:""`
  25. } `json:"b" description:""`
  26. ColIndex int64 `json:"col_index" description:""`
  27. L struct {
  28. Color string `json:"color" description:""`
  29. Style string `json:"style" description:""`
  30. } `json:"l" description:""`
  31. R struct {
  32. Color string `json:"color" description:""`
  33. Style string `json:"style" description:""`
  34. } `json:"r" description:""`
  35. RowIndex int64 `json:"row_index" description:""`
  36. T struct {
  37. Color string `json:"color" description:""`
  38. Style string `json:"style" description:""`
  39. } `json:"t" description:""`
  40. } `json:"value" description:"" description:""`
  41. } `json:"borderInfo" description:""`
  42. Colhidden struct{} `json:"colhidden" description:""`
  43. Columnlen map[string]float64 `json:"columnlen" description:""`
  44. CustomHeight struct {
  45. Zero int64 `json:"0"`
  46. } `json:"customHeight" description:""`
  47. CustomWidth struct {
  48. Two int64 `json:"2" description:""`
  49. } `json:"customWidth" description:""`
  50. Merge struct{} `json:"merge" description:""`
  51. Rowlen map[string]float64 `json:"rowlen" description:""`
  52. } `json:"config" description:""`
  53. Data [][]struct {
  54. Ct struct {
  55. Fa string `json:"fa"`
  56. T string `json:"t"`
  57. } `json:"ct"`
  58. M string `json:"m"`
  59. V interface{} `json:"v"`
  60. } `json:"data" description:""`
  61. DataVerification struct{} `json:"dataVerification" description:""`
  62. Filter interface{} `json:"filter" description:""`
  63. FilterSelect interface{} `json:"filter_select" description:""`
  64. Hyperlink struct{} `json:"hyperlink" description:""`
  65. Images struct{} `json:"images" description:""`
  66. Index string `json:"index" description:""`
  67. JfgirdSelectSave []interface{} `json:"jfgird_select_save" description:""`
  68. LuckysheetAlternateformatSave []interface{} `json:"luckysheet_alternateformat_save" description:""`
  69. LuckysheetConditionformatSave []interface{} `json:"luckysheet_conditionformat_save" description:""`
  70. LuckysheetSelectSave []struct {
  71. Column []int64 `json:"column" description:""`
  72. ColumnFocus int64 `json:"column_focus" description:""`
  73. Height int64 `json:"height" description:""`
  74. HeightMove int64 `json:"height_move" description:""`
  75. Left int64 `json:"left" description:""`
  76. LeftMove int64 `json:"left_move" description:""`
  77. Row []int64 `json:"row" description:""`
  78. RowFocus int64 `json:"row_focus" description:""`
  79. Top int64 `json:"top" description:""`
  80. TopMove int64 `json:"top_move" description:""`
  81. Width int64 `json:"width" description:""`
  82. WidthMove int64 `json:"width_move" description:""`
  83. } `json:"luckysheet_select_save" description:"" description:""`
  84. LuckysheetSelectionRange []struct {
  85. Column []int64 `json:"column" description:""`
  86. Row []int64 `json:"row" description:""`
  87. } `json:"luckysheet_selection_range" description:""`
  88. RhHeight int64 `json:"rh_height" description:""`
  89. ScrollLeft int64 `json:"scrollLeft" description:""`
  90. ScrollTop int64 `json:"scrollTop" description:""`
  91. Status int64 `json:"status" description:""`
  92. Visibledatacolumn []int64 `json:"visibledatacolumn" description:""`
  93. Visibledatarow []int64 `json:"visibledatarow" description:""`
  94. ZoomRatio int64 `json:"zoomRatio" description:""`
  95. }
  96. // LuckySheetData sheet表格数据
  97. type LuckySheetData struct {
  98. CellData []LuckySheetCellData `json:"celldata" description:"单元格数据"`
  99. ChWidth int64 `json:"ch_width" description:"工作表区域的宽度"`
  100. Config LuckySheetDataConfig `json:"config" description:""`
  101. //Index int `json:"index" description:"工作表索引"`
  102. RhHeight int64 `json:"rh_height" description:"工作表区域的高度"`
  103. ScrollLeft int64 `json:"scrollLeft" description:"左右滚动条位置"`
  104. ScrollTop int64 `json:"scrollTop" description:"上下滚动条位置"`
  105. Status int64 `json:"status" description:"激活状态"`
  106. VisibleDataColumn []int64 `json:"visibledatacolumn" description:"所有列的位置信息,递增的列位置数据,初始化无需设置"`
  107. VisibleDataRow []int64 `json:"visibledatarow" description:"所有行的位置信息,递增的行位置数据,初始化无需设置"`
  108. ZoomRatio int64 `json:"zoomRatio" description:"缩放比例"`
  109. }
  110. // LuckySheetDataConfig sheet表单的配置
  111. type LuckySheetDataConfig struct {
  112. BorderInfo []LuckySheetDataConfigBorderInfo `json:"borderInfo" description:"边框"`
  113. Colhidden map[string]int64 `json:"colhidden" description:"隐藏列,示例值:\"colhidden\":{\"30\":0,\"31\":0}"`
  114. Columnlen map[string]float64 `json:"columnlen" description:"每个单元格的列宽"`
  115. //CustomHeight struct {
  116. // Zero int64 `json:"0"`
  117. //} `json:"customHeight" description:""`
  118. //CustomWidth struct {
  119. // Two int64 `json:"2" description:""`
  120. //} `json:"customWidth" description:""`
  121. Merge map[string]LuckySheetDataConfigMerge `json:"merge" description:"合并单元格"`
  122. Rowlen map[string]float64 `json:"rowlen" description:"每个单元格的行高"`
  123. }
  124. // LuckySheetDataConfigMerge 合并单元格设置
  125. type LuckySheetDataConfigMerge struct {
  126. Row int `json:"r" description:"行数"`
  127. Column int `json:"c" description:"列数"`
  128. Rs int `json:"rs" description:"合并的行数"`
  129. Cs int `json:"cs" description:"合并的列数"`
  130. }
  131. // LuckySheetDataConfigBorderInfo 单元格边框信息
  132. type LuckySheetDataConfigBorderInfo struct {
  133. BorderType string `json:"borderType" description:"边框类型 border-left | border-right | border-top | border-bottom | border-all | border-outside | border-inside | border-horizontal | border-vertical | border-none"`
  134. Color string `json:"color" description:"边框颜色 color: 16进制颜色值"`
  135. Range []struct {
  136. Column []int64 `json:"column" description:"行"`
  137. Row []int64 `json:"row" description:"列"`
  138. } `json:"range" description:"选区范围 range: 行列信息数组"`
  139. RangeType string `json:"rangeType" description:"选区 rangeType: range | cell "`
  140. Style string `json:"style" description:"边框粗细 style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick ,和aspose.cells的getLineStyle()的值对应的话,需要自己做个转换,参考 aspose.cells"`
  141. Value LuckySheetDataConfigBorderInfoCellValue `json:"value" description:"" description:"范围类型分单个单元格的数据"`
  142. }
  143. // LuckySheetDataConfigBorderInfoCellValue 单元格边框信息(范围类型为:单个单元格)
  144. type LuckySheetDataConfigBorderInfoCellValue struct {
  145. B LuckySheetDataConfigBorderInfoCell `json:"b" description:"下边框"`
  146. L LuckySheetDataConfigBorderInfoCell `json:"l" description:"左边框"`
  147. R LuckySheetDataConfigBorderInfoCell `json:"r" description:"右边框"`
  148. T LuckySheetDataConfigBorderInfoCell `json:"t" description:"上边框"`
  149. ColIndex int64 `json:"col_index" description:"第几行"`
  150. RowIndex int64 `json:"row_index" description:"第几列"`
  151. }
  152. // LuckySheetDataConfigBorderInfoCell 单元格边框信息(cell类型)
  153. type LuckySheetDataConfigBorderInfoCell struct {
  154. Color string `json:"color" description:"边框颜色 color: 16进制颜色值"`
  155. Style string `json:"style" description:"边框粗细 style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick ,和aspose.cells的getLineStyle()的值对应的话,需要自己做个转换,参考 aspose.cells"`
  156. }
  157. // LuckySheetCellData 单个单元格数据
  158. type LuckySheetCellData struct {
  159. Col int64 `json:"c" description:"列"`
  160. Row int64 `json:"r" description:"行"`
  161. Value LuckySheetDataValue `json:"v" description:"单元格内值的数据"`
  162. }
  163. // LuckySheetDataValue 单元格内值的数据
  164. type LuckySheetDataValue struct {
  165. CellType LuckySheetDataCellType `json:"ct" description:"单元格值格式:文本、时间等 "`
  166. Value interface{} `json:"v" description:"原始值"`
  167. Monitor string `json:"m" description:"显示值"`
  168. Background string `json:"bg" description:"背景色,实例值:#fff000"`
  169. FontFamily int `json:"ff" description:"字体,0 Times New Roman、 1 Arial、2 Tahoma 、3 Verdana、4 微软雅黑、5 宋体(Song)、6 黑体(ST Heiti)、7 楷体(ST Kaiti)、 8 仿宋(ST FangSong)、9 新宋体(ST Song)、10 华文新魏、11 华文行楷、12 华文隶书 "`
  170. FontColor string `json:"fc" description:"字体颜色,示例值:#fff000" `
  171. Bold int `json:"bl" description:"粗体,0 常规 、 1加粗 "`
  172. Italic int `json:"it" description:"斜体,0 常规 、 1 斜体"`
  173. Fontsize string `json:"fs" description:"字体大小,14"`
  174. CancelLine int `json:"cl" description:"删除线, 0 常规 、 1 删除线"`
  175. HorizontalType string `json:"ht" description:"水平对齐, 0 居中、1 左、2右"`
  176. VerticalType string `json:"vt" description:"垂直对齐, 0 中间、1 上、2下"`
  177. TextRotate string `json:"tr" description:"竖排文字, 3"`
  178. RotateText string `json:"rt" description:"文字旋转角度, 介于0~180之间的整数,包含0和180"`
  179. TextBeak int `json:"tb" description:"文本换行, 0 截断、1溢出、2 自动换行"`
  180. Ps LuckySheetDataCellComment `json:"ps" description:"批注"`
  181. Function string `json:"f" description:"公式"`
  182. Mc LuckySheetDataConfigMerge `json:"mc" description:"合并单元格信息"`
  183. }
  184. // LuckySheetDataCellType 单元格值格式:文本、时间等
  185. type LuckySheetDataCellType struct {
  186. Fa string `json:"fa" description:"格式名称,例如:“General”为自动格式"`
  187. T string `json:"t" description:"格式类型,例如:“n”为数字类型"`
  188. S []struct {
  189. FontFamily string `json:"ff" description:"字体,0 Times New Roman、 1 Arial、2 Tahoma 、3 Verdana、4 微软雅黑、5 宋体(Song)、6 黑体(ST Heiti)、7 楷体(ST Kaiti)、 8 仿宋(ST FangSong)、9 新宋体(ST Song)、10 华文新魏、11 华文行楷、12 华文隶书 "`
  190. FontColor string `json:"fc" description:"字体颜色,示例值:#fff000" `
  191. Fontsize int `json:"fs" description:"字体大小,14"`
  192. CancelLine int `json:"cl" description:"删除线, 0 常规 、 1 删除线"`
  193. HorizontalType string `json:"ht" description:"水平对齐, 0 居中、1 左、2右"`
  194. VerticalType string `json:"vt" description:"垂直对齐, 0 中间、1 上、2下"`
  195. Un int `json:"un" description:""`
  196. Bold int `json:"bl" description:"粗体,0 常规 、 1加粗 "`
  197. Italic int `json:"it" description:"斜体,0 常规 、 1 斜体"`
  198. Value interface{} `json:"v" description:"原始值"`
  199. } `json:"s"`
  200. }
  201. // LuckySheetDataCellComment 批注
  202. type LuckySheetDataCellComment struct {
  203. Left int `json:"left" description:"批注框距离左边工作表边缘位置"`
  204. Top int `json:"top" description:"批注框距离上边工作表边缘位置"`
  205. Width int `json:"width" description:"批注框宽度"`
  206. Height int `json:"height" description:"批注框高度"`
  207. Value string `json:"value" description:"批注内容"`
  208. IsShow bool `json:"isshow" description:"是否显示批注"`
  209. }
  210. // GetLuckySheetData 获取LuckySheetData的结构体
  211. func GetLuckySheetData(jsonStr string) (item *LuckySheetData, err error) {
  212. err = json.Unmarshal([]byte(jsonStr), &item)
  213. return
  214. }
  215. // TableData 表格数据
  216. type TableData struct {
  217. TableDataList [][]LuckySheetDataValue
  218. RowWidthList []float64
  219. RowHeightList []float64
  220. RemoveTopRow int `description:"移除表格上方的行数"`
  221. RemoveBottomRow int `description:"移除表格下方的行数"`
  222. RemoveLeftColumn int `description:"移除表格左侧的列数"`
  223. RemoveRightColumn int `description:"移除表格右侧的列数"`
  224. MergeList []TableDataMerge `description:"合并数据列"`
  225. }
  226. // TableDataMerge 表格数据合并单元格配置
  227. type TableDataMerge struct {
  228. StartRowIndex int `json:"start_row_index" description:"开始的行下标"`
  229. StartColumnIndex int `json:"start_column" description:"开始的列下标"`
  230. MergeRowNum int `json:"merge_row_num" description:"合并的行数"`
  231. MergeColumnNum int `json:"merge_column_num" description:"合并的列数"`
  232. }
  233. // GetTableDataByLuckySheetDataStr 通过LuckySheet的string数据获取表格数据
  234. func (item *LuckySheetData) GetTableDataByLuckySheetDataStr() (selfTableData TableData, err error) {
  235. luckySheetCellDataList := item.CellData
  236. // 表格数据
  237. tableDataMap := make(map[int64]map[int64]LuckySheetDataValue)
  238. // 最大行,最大列
  239. var maxRow, maxCol int64
  240. for _, v := range luckySheetCellDataList {
  241. //fmt.Println("row:", v.Row, "=====col:", v.Col)
  242. if v.Row > maxRow { //最大行
  243. maxRow = v.Row
  244. }
  245. if v.Col > maxCol { //最大列
  246. maxCol = v.Col
  247. }
  248. var tmpRow map[int64]LuckySheetDataValue
  249. tmpRow, ok := tableDataMap[v.Row]
  250. if ok {
  251. tmpRow[v.Col] = v.Value
  252. } else {
  253. tmpRow = make(map[int64]LuckySheetDataValue)
  254. tmpRow[v.Col] = v.Value
  255. }
  256. tableDataMap[v.Row] = tmpRow
  257. }
  258. tableDataList := make([][]LuckySheetDataValue, 0)
  259. var i int64
  260. // 单元格宽度
  261. configColumnConf := item.Config.Columnlen
  262. rowWidthMap := make(map[int]float64)
  263. rowWidthList := make([]float64, 0) //
  264. // 单元格高度
  265. configRowConf := item.Config.Rowlen
  266. rowHeightList := make([]float64, 0) //
  267. for i = 0; i <= maxRow; i++ {
  268. //列
  269. tmpTableColDataList := make([]LuckySheetDataValue, 0)
  270. // 每个单元格的高度
  271. tmpHeight, ok := configRowConf[fmt.Sprint(i)]
  272. if !ok {
  273. tmpHeight = 0
  274. }
  275. rowHeightList = append(rowHeightList, tmpHeight)
  276. tmpRowData, ok := tableDataMap[i]
  277. if !ok {
  278. tableDataList = append(tableDataList, tmpTableColDataList)
  279. continue
  280. }
  281. var j int64
  282. for j = 0; j <= maxCol; j++ {
  283. tmpTableColData, ok := tmpRowData[j]
  284. if !ok {
  285. tmpTableColData = LuckySheetDataValue{}
  286. }
  287. //单元格显示的数据处理
  288. tmpTableColData.Monitor = handleCellVal(tmpTableColData)
  289. tmpTableColDataList = append(tmpTableColDataList, tmpTableColData)
  290. // 每个单元格的宽度
  291. tmpWidth, ok := configColumnConf[fmt.Sprint(j)]
  292. if !ok {
  293. tmpWidth = 0
  294. }
  295. rowIndex := len(tmpTableColDataList) - 1
  296. if _, ok2 := rowWidthMap[rowIndex]; !ok2 {
  297. rowWidthList = append(rowWidthList, tmpWidth)
  298. }
  299. rowWidthMap[rowIndex] = tmpWidth
  300. }
  301. tableDataList = append(tableDataList, tmpTableColDataList)
  302. }
  303. //总共多少行
  304. lenRow := len(tableDataList)
  305. //移除上下空行
  306. deleteRowIndexList := make([]int, 0)
  307. if lenRow > 0 {
  308. var flag = false
  309. // 移除上方空列
  310. for rowIndex := 0; rowIndex < lenRow; rowIndex++ {
  311. isDelete := true
  312. for _, v := range tableDataList[rowIndex] {
  313. if v.Monitor != `` {
  314. isDelete = false
  315. flag = true
  316. break
  317. }
  318. }
  319. if flag {
  320. break
  321. }
  322. if isDelete {
  323. selfTableData.RemoveTopRow++
  324. deleteRowIndexList = append(deleteRowIndexList, rowIndex)
  325. }
  326. }
  327. // 移除下方空行
  328. flag = false
  329. //尾部
  330. deleteBottomRowIndexList := make([]int, 0)
  331. for rowIndex := lenRow - 1; rowIndex >= 0; rowIndex-- {
  332. isDelete := true
  333. for _, v := range tableDataList[rowIndex] {
  334. if v.Monitor != `` {
  335. isDelete = false
  336. flag = true
  337. break
  338. }
  339. }
  340. if flag {
  341. break
  342. }
  343. if isDelete {
  344. deleteBottomRowIndexList = append(deleteBottomRowIndexList, rowIndex)
  345. selfTableData.RemoveBottomRow++
  346. }
  347. }
  348. if len(deleteBottomRowIndexList) > 0 {
  349. deleteRowIndexList = append(deleteRowIndexList, utils.RevSlice(deleteBottomRowIndexList)...)
  350. }
  351. lenDeleteRow := len(deleteRowIndexList)
  352. if lenDeleteRow > 0 {
  353. for rowIndex := lenDeleteRow - 1; rowIndex >= 0; rowIndex-- {
  354. //表格数据
  355. tableDataList = append(tableDataList[:deleteRowIndexList[rowIndex]], tableDataList[deleteRowIndexList[rowIndex]+1:]...) // 删除开头N个元素
  356. //表格高度
  357. rowHeightList = append(rowHeightList[:deleteRowIndexList[rowIndex]], rowHeightList[deleteRowIndexList[rowIndex]+1:]...) // 删除开头N个元素
  358. }
  359. }
  360. }
  361. //移除前后空列
  362. deleteColumnIndexList := make([]int, 0)
  363. if len(tableDataList) > 0 {
  364. var flag = false
  365. lenColumn := len(tableDataList[0])
  366. // 移除前方空列
  367. for columnIndex := 0; columnIndex < lenColumn; columnIndex++ {
  368. isDelete := true
  369. for _, v := range tableDataList {
  370. if v[columnIndex].Monitor != `` {
  371. isDelete = false
  372. flag = true
  373. break
  374. }
  375. }
  376. if flag {
  377. break
  378. }
  379. if isDelete {
  380. selfTableData.RemoveLeftColumn++
  381. deleteColumnIndexList = append(deleteColumnIndexList, columnIndex)
  382. }
  383. }
  384. // 移除后方空列
  385. flag = false
  386. //尾部
  387. deleteTailColumnIndexList := make([]int, 0)
  388. for columnIndex := lenColumn - 1; columnIndex >= 0; columnIndex-- {
  389. isDelete := true
  390. for _, v := range tableDataList {
  391. if v[columnIndex].Monitor != `` {
  392. isDelete = false
  393. flag = true
  394. break
  395. }
  396. }
  397. if flag {
  398. break
  399. }
  400. if isDelete {
  401. deleteTailColumnIndexList = append(deleteTailColumnIndexList, columnIndex)
  402. selfTableData.RemoveRightColumn++
  403. }
  404. }
  405. if len(deleteTailColumnIndexList) > 0 {
  406. deleteColumnIndexList = append(deleteColumnIndexList, utils.RevSlice(deleteTailColumnIndexList)...)
  407. }
  408. lenDeleteColumn := len(deleteColumnIndexList)
  409. if lenDeleteColumn > 0 {
  410. for columnIndex := lenDeleteColumn - 1; columnIndex >= 0; columnIndex-- {
  411. //表格数据
  412. for k, v := range tableDataList {
  413. tableDataList[k] = append(v[:deleteColumnIndexList[columnIndex]], v[deleteColumnIndexList[columnIndex]+1:]...) // 删除开头N个元素
  414. }
  415. //表格宽度
  416. rowWidthList = append(rowWidthList[:deleteColumnIndexList[columnIndex]], rowWidthList[deleteColumnIndexList[columnIndex]+1:]...) // 删除开头N个元素
  417. }
  418. }
  419. }
  420. //处理合并单元格
  421. tableDataMergeList := make([]TableDataMerge, 0)
  422. for _, v := range item.Config.Merge {
  423. indexRow := v.Row - selfTableData.RemoveTopRow
  424. indexColumn := v.Column - selfTableData.RemoveLeftColumn
  425. tableDataMerge := TableDataMerge{
  426. StartRowIndex: indexRow,
  427. StartColumnIndex: indexColumn,
  428. MergeRowNum: v.Rs - 1,
  429. MergeColumnNum: v.Cs - 1,
  430. }
  431. tableDataMergeList = append(tableDataMergeList, tableDataMerge)
  432. }
  433. // 表格数据
  434. selfTableData.TableDataList = tableDataList
  435. selfTableData.RowWidthList = rowWidthList
  436. selfTableData.RowHeightList = rowHeightList
  437. selfTableData.MergeList = tableDataMergeList
  438. return
  439. }
  440. // handleCellVal 处理单元格数据
  441. func handleCellVal(tmpTableColData LuckySheetDataValue) (valueStr string) {
  442. valueStr = tmpTableColData.Monitor
  443. if valueStr == `` {
  444. //valueStr = fmt.Sprint(cellInfo.Value)
  445. if valueStr == `` && tmpTableColData.CellType.S != nil {
  446. //不是设置在单元格上面,而是设置在文本上
  447. for _, cellS := range tmpTableColData.CellType.S {
  448. valueStr += fmt.Sprint(cellS.Value)
  449. }
  450. }
  451. }
  452. return
  453. }