custom_analysis_edb.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. package excel
  2. import (
  3. "encoding/json"
  4. "errors"
  5. "eta/eta_api/models/data_manage/excel"
  6. "eta/eta_api/services/data"
  7. excelServices "eta/eta_api/services/excel"
  8. "eta/eta_api/utils"
  9. "fmt"
  10. "github.com/araddon/dateparse"
  11. "github.com/shopspring/decimal"
  12. "github.com/tealeg/xlsx"
  13. "github.com/xuri/excelize/v2"
  14. "strings"
  15. )
  16. // GetCustomAnalysisExcelData 获取自定义分析的表格data数据
  17. func GetCustomAnalysisExcelData(excelInfo *excel.ExcelInfo) (luckySheet excelServices.LuckySheet, err error, errMsg string) {
  18. // 查找当前excel的sheet列表
  19. sheetList, err := excel.GetAllSheetList(excelInfo.ExcelInfoId)
  20. if err != nil {
  21. errMsg = "保存失败"
  22. err = errors.New("查找当前excel的sheet列表失败,Err:" + err.Error())
  23. return
  24. }
  25. currSheetMap := make(map[string]string)
  26. for _, sheet := range sheetList {
  27. currSheetMap[sheet.SheetName] = sheet.SheetName
  28. }
  29. sheetCellDataMapList := make(map[int][]excelServices.LuckySheetCellData)
  30. // 通过excel的id获取各个sheet的单元格数据map
  31. {
  32. dataList, tmpErr := excel.GetAllSheetDataListByExcelInfoId(excelInfo.ExcelInfoId)
  33. if tmpErr != nil {
  34. err = tmpErr
  35. return
  36. }
  37. for _, cellData := range dataList {
  38. sheetDataList, ok := sheetCellDataMapList[cellData.ExcelSheetId]
  39. if !ok {
  40. sheetDataList = make([]excelServices.LuckySheetCellData, 0)
  41. }
  42. tmpSheetDataList := make([]excelServices.LuckySheetCellData, 0)
  43. err = json.Unmarshal([]byte(cellData.Data), &tmpSheetDataList)
  44. if err != nil {
  45. err = errors.New(fmt.Sprintf("解析data的配置失败,sheetId:%d,Err:%s", cellData.ExcelDataId, err.Error()))
  46. return
  47. }
  48. sheetCellDataMapList[cellData.ExcelSheetId] = append(sheetDataList, tmpSheetDataList...)
  49. }
  50. }
  51. // 转成luckySheet的数据格式
  52. luckySheet = excelServices.LuckySheet{
  53. SheetList: make([]excelServices.LuckySheetData, 0),
  54. }
  55. for _, sheet := range sheetList {
  56. var luckySheetDataConfig excelServices.LuckySheetDataConfig
  57. err = json.Unmarshal([]byte(sheet.Config), &luckySheetDataConfig)
  58. if err != nil {
  59. err = errors.New(fmt.Sprintf("解析sheet的配置失败,sheetId:%d,Err:%s", sheet.ExcelSheetId, err.Error()))
  60. return
  61. }
  62. tmpLuckySheetDataInfo := excelServices.LuckySheetData{
  63. Name: sheet.SheetName,
  64. Index: sheet.Sort,
  65. CellData: sheetCellDataMapList[sheet.ExcelSheetId],
  66. Config: luckySheetDataConfig,
  67. }
  68. luckySheet.SheetList = append(luckySheet.SheetList, tmpLuckySheetDataInfo)
  69. }
  70. return
  71. }
  72. // GenerateExcelCustomAnalysisExcel 根据自定义分析的表格data数据生成excel
  73. func GenerateExcelCustomAnalysisExcel(excelInfo *excel.ExcelInfo) (downloadFilePath string, err error, errMsg string) {
  74. luckySheet, err, errMsg := GetCustomAnalysisExcelData(excelInfo)
  75. if err != nil {
  76. return
  77. }
  78. downloadFilePath, err = luckySheet.ToExcel(false)
  79. return
  80. }
  81. // 数据集
  82. type dataStruct struct {
  83. Value float64
  84. Ok bool
  85. }
  86. // HandleEdbSequenceVal 处理日期集和数据集(获取可用的日期、数据集)
  87. func HandleEdbSequenceVal(dateSequenceVal, dataSequenceVal []string) (newDateList []string, newDataList []float64, err error, errMsg string) {
  88. newDateList = make([]string, 0)
  89. newDataList = make([]float64, 0)
  90. dataList := make([]dataStruct, 0)
  91. {
  92. for _, v := range dataSequenceVal {
  93. // 如果没有数据集,那么就过滤
  94. if v == `` {
  95. // 如果开始插入数据了,那么就需要插入不存在值
  96. dataList = append(dataList, dataStruct{
  97. Value: 0,
  98. Ok: false,
  99. })
  100. continue
  101. }
  102. v = strings.Replace(v, ",", "", -1)
  103. v = strings.Replace(v, ",", "", -1)
  104. // 过滤空格
  105. v = strings.Replace(v, " ", "", -1)
  106. v = strings.TrimSpace(v)
  107. var tmpVal float64
  108. if strings.Contains(v, "%") {
  109. // 百分比的数
  110. isPercentage, percentageValue := utils.IsPercentage(v)
  111. if !isPercentage {
  112. dataList = append(dataList, dataStruct{
  113. Value: 0,
  114. Ok: false,
  115. })
  116. continue
  117. }
  118. tmpValDec, tmpErr := decimal.NewFromString(percentageValue)
  119. if tmpErr != nil {
  120. dataList = append(dataList, dataStruct{
  121. Value: 0,
  122. Ok: false,
  123. })
  124. continue
  125. }
  126. tmpVal, _ = tmpValDec.Div(decimal.NewFromFloat(100)).Float64()
  127. } else {
  128. tmpValDec, tmpErr := decimal.NewFromString(v)
  129. if tmpErr != nil {
  130. dataList = append(dataList, dataStruct{
  131. Value: 0,
  132. Ok: false,
  133. })
  134. continue
  135. }
  136. tmpVal, _ = tmpValDec.Float64()
  137. }
  138. dataList = append(dataList, dataStruct{
  139. Value: tmpVal,
  140. Ok: true,
  141. })
  142. }
  143. }
  144. // 日期集
  145. dateList := make([]string, 0)
  146. {
  147. for _, v := range dateSequenceVal {
  148. // 如果没有数据集,那么就过滤
  149. if v == `` {
  150. // 如果开始插入数据了,那么就需要插入不存在值
  151. dateList = append(dateList, "")
  152. continue
  153. }
  154. // 过滤空格
  155. v = strings.Replace(v, " ", "", -1)
  156. v = strings.TrimSpace(v)
  157. t1, tmpErr := dateparse.ParseAny(v)
  158. if tmpErr != nil {
  159. dateList = append(dateList, "")
  160. continue
  161. }
  162. dateList = append(dateList, t1.Format(utils.FormatDate))
  163. }
  164. }
  165. lenData := len(dataList)
  166. lenDate := len(dateList)
  167. // 最小个数
  168. num := lenDate
  169. if num > lenData {
  170. num = lenData
  171. }
  172. for i := 0; i < num; i++ {
  173. date := dateList[i]
  174. tmpData := dataList[i]
  175. // 日期为空、数据为空
  176. if !tmpData.Ok || date == `` {
  177. continue
  178. }
  179. newDateList = append(newDateList, date)
  180. newDataList = append(newDataList, tmpData.Value)
  181. }
  182. return
  183. }
  184. // ResetCustomAnalysisData 数据重置的结构体
  185. type ResetCustomAnalysisData struct {
  186. EdbInfoId int
  187. DateList []string
  188. DataList []float64
  189. }
  190. // Refresh 刷新表格关联的指标信息
  191. func Refresh(excelInfo *excel.ExcelInfo, lang string) (err error, errMsg string, isSendEmail bool) {
  192. isSendEmail = true
  193. list, err := excel.GetAllExcelEdbMappingItemByExcelInfoId(excelInfo.ExcelInfoId)
  194. if err != nil {
  195. errMsg = "获取失败"
  196. err = errors.New("查找所有的mapping失败" + err.Error())
  197. return
  198. }
  199. // 没有关联指标,那么就退出吧
  200. if len(list) <= 0 {
  201. return
  202. }
  203. for k, v := range list {
  204. var tmpCalculateFormula excel.CalculateFormula
  205. err = json.Unmarshal([]byte(v.CalculateFormula), &tmpCalculateFormula)
  206. if err != nil {
  207. errMsg = "获取失败"
  208. err = errors.New(fmt.Sprintf("指标id:%d,公式转换失败,Err:%s", v.EdbInfoId, err.Error()))
  209. return
  210. }
  211. v.DateSequenceStr = tmpCalculateFormula.DateSequenceStr
  212. v.DataSequenceStr = tmpCalculateFormula.DataSequenceStr
  213. list[k] = v
  214. }
  215. luckySheet, err, errMsg := GetCustomAnalysisExcelData(excelInfo)
  216. if err != nil {
  217. err = errors.New(fmt.Sprintf("获取自定义分析Excel数据失败,Err:%s", err.Error()))
  218. return
  219. }
  220. // 获取excel表格数据
  221. xlsxFile, err := luckySheet.GetExcelData(false)
  222. if err != nil {
  223. err = errors.New(fmt.Sprintf("获取excel表格数据,Err:%s", err.Error()))
  224. return
  225. }
  226. //fmt.Println(xlsxFile)
  227. edbInfoIdList := make([]int, 0)
  228. for _, v := range list {
  229. edbInfoIdList = append(edbInfoIdList, v.EdbInfoId)
  230. // 获取对应的日期和数据列表
  231. relDateList, relDataList, tmpErr, tmpErrMsg := getDateAndDataList(v, xlsxFile)
  232. if tmpErr != nil {
  233. err = errors.New(fmt.Sprintf("《%s》获取对应的日期和数据列表,Err:%s", v.EdbName, tmpErr.Error()))
  234. errMsg = fmt.Sprintf("《%s》%s", v.EdbName, tmpErrMsg)
  235. return
  236. }
  237. if len(relDateList) <= 0 {
  238. errMsg = fmt.Sprintf("《%s》的日期序列为空", v.EdbName)
  239. err = errors.New(errMsg)
  240. return
  241. }
  242. if len(relDataList) <= 0 {
  243. errMsg = fmt.Sprintf("《%s》的数据序列为空", v.EdbName)
  244. err = errors.New(errMsg)
  245. return
  246. }
  247. //fmt.Println(v)
  248. req2 := &ResetCustomAnalysisData{
  249. EdbInfoId: v.EdbInfoId,
  250. DateList: relDateList,
  251. DataList: relDataList,
  252. }
  253. // 调用指标库去更新
  254. reqJson, tmpErr := json.Marshal(req2)
  255. if tmpErr != nil {
  256. err = errors.New(fmt.Sprintf("结构体转对象失败,Err:%s", tmpErr.Error()))
  257. return
  258. }
  259. respItem, tmpErr := data.ResetCustomAnalysisData(string(reqJson), lang)
  260. if tmpErr != nil {
  261. err = errors.New(fmt.Sprintf("调用指标库去更新,Err:%s", tmpErr.Error()))
  262. return
  263. }
  264. if respItem.Ret != 200 {
  265. errMsg = respItem.Msg
  266. err = errors.New(respItem.ErrMsg)
  267. return
  268. }
  269. }
  270. if len(edbInfoIdList) > 0 {
  271. err, _ = data.EdbInfoRefreshAllFromBaseV3(edbInfoIdList, false, true, true)
  272. }
  273. //xlsxFile.Sheet[]
  274. return
  275. }
  276. // getDateAndDataList
  277. // @Description: 获取待刷新的日期和数据
  278. // @author: Roc
  279. // @datetime 2023-12-21 15:21:14
  280. // @param excelEdbMappingItem *excel.ExcelEdbMappingItem
  281. // @param xlsxFile *xlsx.File
  282. // @return newDateList []string
  283. // @return newDataList []float64
  284. // @return err error
  285. // @return errMsg string
  286. func getDateAndDataList(excelEdbMappingItem *excel.ExcelEdbMappingItem, xlsxFile *xlsx.File) (newDateList []string, newDataList []float64, err error, errMsg string) {
  287. var dateList, dataList []string
  288. // 日期序列
  289. {
  290. sheetName, startColumnName, endColumnName, startNum, endNum, isAll, isRow, isColumn, tmpErr, tmpErrMsg := GetSheetStr(excelEdbMappingItem.DateSequenceStr)
  291. if tmpErr != nil {
  292. errMsg = tmpErrMsg
  293. err = tmpErr
  294. return
  295. }
  296. // 查找sheet页
  297. sheetInfo, ok := xlsxFile.Sheet[sheetName]
  298. if !ok {
  299. errMsg = "找不到" + sheetName
  300. err = errors.New(errMsg)
  301. return
  302. }
  303. startNum = startNum - 1
  304. endNum = endNum - 1
  305. // 选择行的数据
  306. if isRow {
  307. // 因为是选择一行的数据,所以开始行和结束行时一样的
  308. //endNum = startNum - 1
  309. // 开始列名、结束列
  310. var startColumn, endColumn int
  311. if isAll {
  312. // 结束列(其实也就是整列的个数)
  313. endColumn = len(sheetInfo.Cols) - 1
  314. } else {
  315. tmpStartColumn, tmpErr := excelize.ColumnNameToNumber(startColumnName)
  316. if tmpErr != nil {
  317. errMsg = "列名异常:" + startColumnName
  318. err = errors.New(errMsg)
  319. return
  320. }
  321. tmpEndColumn, tmpErr := excelize.ColumnNameToNumber(endColumnName)
  322. if tmpErr != nil {
  323. errMsg = "列名异常:" + endColumnName
  324. err = errors.New(errMsg)
  325. return
  326. }
  327. startColumn = tmpStartColumn - 1
  328. endColumn = tmpEndColumn - 1
  329. }
  330. // 最大列数,如果设置的超过了最大列数,那么结束列就是最大列数
  331. maxCol := len(sheetInfo.Cols)
  332. if endColumn > maxCol {
  333. endColumn = maxCol - 1
  334. }
  335. // 长度固定,避免一直申请内存空间
  336. dateList = make([]string, endColumn-startColumn+1)
  337. i := 0
  338. for currColumn := startColumn; currColumn <= endColumn; currColumn++ {
  339. currCell := sheetInfo.Cell(startNum, currColumn)
  340. if currCell == nil {
  341. errMsg = fmt.Sprintf("第%d列,第%d行数据异常", startColumn, startNum)
  342. err = errors.New(errMsg)
  343. return
  344. }
  345. //dateList = append(dateList, currCell.Value)
  346. dateList[i] = currCell.Value
  347. i++
  348. }
  349. } else if isColumn { // 选择列的数据
  350. if isAll {
  351. // 选择一整列的话,结束行得根据实际情况调整(其实也就是整个sheet有多少行)
  352. endNum = len(sheetInfo.Rows) - 1
  353. }
  354. startColumn, tmpErr := excelize.ColumnNameToNumber(startColumnName)
  355. if tmpErr != nil {
  356. errMsg = "列名异常:" + startColumnName
  357. err = errors.New(errMsg)
  358. return
  359. }
  360. startColumn = startColumn - 1
  361. // 最大行数,如果设置的超过了最大行数,那么结束行就是最大行数
  362. maxRow := len(sheetInfo.Rows)
  363. if endNum > maxRow {
  364. endNum = maxRow - 1
  365. }
  366. // 长度固定,避免一直申请内存空间
  367. dateList = make([]string, endNum-startNum+1)
  368. i := 0
  369. for currRow := startNum; currRow <= endNum; currRow++ {
  370. currCell := sheetInfo.Cell(currRow, startColumn)
  371. if currCell == nil {
  372. errMsg = fmt.Sprintf("第%d列,第%d行数据异常", startColumn, startNum)
  373. err = errors.New(errMsg)
  374. return
  375. }
  376. //dateList = append(dateList, currCell.Value)
  377. dateList[i] = currCell.Value
  378. i++
  379. }
  380. }
  381. }
  382. // 数据序列
  383. {
  384. sheetName, startColumnName, endColumnName, startNum, endNum, isAll, isRow, isColumn, tmpErr, tmpErrMsg := GetSheetStr(excelEdbMappingItem.DataSequenceStr)
  385. if tmpErr != nil {
  386. errMsg = tmpErrMsg
  387. err = tmpErr
  388. return
  389. }
  390. // 查找sheet页
  391. sheetInfo, ok := xlsxFile.Sheet[sheetName]
  392. if !ok {
  393. errMsg = "找不到" + sheetName
  394. err = errors.New(errMsg)
  395. return
  396. }
  397. startNum = startNum - 1
  398. endNum = endNum - 1
  399. // 选择行的数据
  400. if isRow {
  401. // 开始列名、结束列
  402. var startColumn, endColumn int
  403. if isAll {
  404. // 结束列(其实也就是整列的个数)
  405. endColumn = len(sheetInfo.Cols) - 1
  406. } else {
  407. tmpStartColumn, tmpErr := excelize.ColumnNameToNumber(startColumnName)
  408. if tmpErr != nil {
  409. errMsg = "列名异常:" + startColumnName
  410. err = errors.New(errMsg)
  411. return
  412. }
  413. tmpEndColumn, tmpErr := excelize.ColumnNameToNumber(endColumnName)
  414. if tmpErr != nil {
  415. errMsg = "列名异常:" + endColumnName
  416. err = errors.New(errMsg)
  417. return
  418. }
  419. startColumn = tmpStartColumn - 1
  420. endColumn = tmpEndColumn - 1
  421. }
  422. // 最大列数,如果设置的超过了最大列数,那么结束列就是最大列数
  423. maxCol := len(sheetInfo.Cols)
  424. if endColumn > maxCol {
  425. endColumn = maxCol - 1
  426. }
  427. // 长度固定,避免一直申请内存空间
  428. dataList = make([]string, endColumn-startColumn+1)
  429. i := 0
  430. for currColumn := startColumn; currColumn <= endColumn; currColumn++ {
  431. currCell := sheetInfo.Cell(startNum, currColumn)
  432. if currCell == nil {
  433. errMsg = fmt.Sprintf("第%d列,第%d行数据异常", startColumn, startNum)
  434. err = errors.New(errMsg)
  435. return
  436. }
  437. //dataList = append(dataList, currCell.Value)
  438. dataList[i] = currCell.Value
  439. i++
  440. }
  441. } else if isColumn { // 选择列的数据
  442. if isAll {
  443. // 选择一整列的话,结束行得根据实际情况调整(其实也就是整个sheet有多少行)
  444. endNum = len(sheetInfo.Rows) - 1
  445. }
  446. startColumn, tmpErr := excelize.ColumnNameToNumber(startColumnName)
  447. if tmpErr != nil {
  448. errMsg = "列名异常:" + startColumnName
  449. err = errors.New(errMsg)
  450. return
  451. }
  452. startColumn = startColumn - 1
  453. // 最大行数,如果设置的超过了最大行数,那么结束行就是最大行数
  454. maxRow := len(sheetInfo.Rows)
  455. if endNum > maxRow {
  456. endNum = maxRow - 1
  457. }
  458. // 长度固定,避免一直申请内存空间
  459. dataList = make([]string, endNum-startNum+1)
  460. i := 0
  461. for currRow := startNum; currRow <= endNum; currRow++ {
  462. currCell := sheetInfo.Cell(currRow, startColumn)
  463. if currCell == nil {
  464. errMsg = fmt.Sprintf("第%d列,第%d行数据异常", startColumn, startNum)
  465. err = errors.New(errMsg)
  466. return
  467. }
  468. //dataList = append(dataList, currCell.Value)
  469. dataList[i] = currCell.Value
  470. i++
  471. }
  472. }
  473. }
  474. //fmt.Println(dateList, dataList)
  475. //fmt.Println("日期序列结束")
  476. // 将excel中的日期、数据系列处理
  477. newDateList, newDataList, err, errMsg = HandleEdbSequenceVal(dateList, dataList)
  478. return
  479. }
  480. // GetSheetStr
  481. // @return sheetName string 用户选择的sheet名称
  482. // @return startColumnName string 用户选择的开始列名称
  483. // @return endColumnName string 用户选择的结束列名称
  484. // @return startNum int 用户选择的开始列单元格位置
  485. // @return endNum int 用户选择的结束列单元格位置
  486. // @return isAll bool 是否选择整行/列数据
  487. // @return isRow bool 是否选择行数据
  488. // @return isColumn bool 是否选择列数据
  489. // @return err error 错误信息
  490. // @return errMsg string 错误信息
  491. func GetSheetStr(sequenceStr string) (sheetName, startColumnName, endColumnName string, startNum, endNum int, isAll, isRow, isColumn bool, err error, errMsg string) {
  492. // 找出sheetName
  493. tmpList := strings.Split(sequenceStr, "!")
  494. if len(tmpList) != 2 {
  495. errMsg = "错误的公式,查找sheet异常:" + sequenceStr
  496. err = errors.New(errMsg)
  497. return
  498. }
  499. sheetName = tmpList[0]
  500. // 分离开始/结束单元格
  501. tmpList = strings.Split(tmpList[1], ":")
  502. if len(tmpList) != 2 {
  503. errMsg = "错误的公式,查找开始/结束单元格异常:" + sequenceStr
  504. err = errors.New(errMsg)
  505. return
  506. }
  507. startList := strings.Split(tmpList[0], "$")
  508. endList := strings.Split(tmpList[1], "$")
  509. lenList := len(startList)
  510. if lenList != len(endList) {
  511. errMsg = "错误的公式,开始与结束单元格异常:" + sequenceStr
  512. err = errors.New(errMsg)
  513. return
  514. }
  515. if lenList != 3 && lenList != 2 {
  516. errMsg = "错误的公式:" + sequenceStr
  517. err = errors.New(errMsg)
  518. return
  519. }
  520. startColumnName = startList[1]
  521. endColumnName = endList[1]
  522. // 长度为2的话,那说明是整行或整列
  523. if lenList == 2 {
  524. isAll = true
  525. startDeci, tmpErr1 := decimal.NewFromString(startList[1])
  526. endDeci, tmpErr2 := decimal.NewFromString(endList[1])
  527. if tmpErr1 == nil && tmpErr2 == nil {
  528. isRow = true // 正常转换的话,那么就是整行
  529. startNum = int(startDeci.IntPart())
  530. endNum = int(endDeci.IntPart())
  531. startColumnName = ``
  532. endColumnName = ``
  533. return
  534. }
  535. if tmpErr1 == nil || tmpErr2 == nil {
  536. err = errors.New("错误的公式2:" + sequenceStr)
  537. return
  538. }
  539. // 如果不能转成数字,那么就是整列
  540. isColumn = true
  541. return
  542. }
  543. // 确定行
  544. startDeci, tmpErr1 := decimal.NewFromString(startList[2])
  545. endDeci, tmpErr2 := decimal.NewFromString(endList[2])
  546. if tmpErr1 != nil && errors.Is(tmpErr1, tmpErr2) {
  547. err = errors.New("错误的公式3:" + sequenceStr)
  548. return
  549. }
  550. startNum = int(startDeci.IntPart())
  551. endNum = int(endDeci.IntPart())
  552. if startColumnName != endColumnName && startNum != endNum {
  553. errMsg = `选区不允许跨行或者跨列`
  554. err = errors.New(errMsg)
  555. }
  556. if startColumnName == endColumnName {
  557. isColumn = true // 列数据
  558. } else {
  559. isRow = true // 行数据
  560. }
  561. return
  562. }