|
@@ -160,11 +160,13 @@ func NewTD(Goquery *goquery.Selection, tr *TR, table *Table) *TD {
|
|
|
ckv := GetKVAll(proCode, "", nil, 1)
|
|
|
for k, v := range ckv.Kv {
|
|
|
td.SortKV.AddKey(k, v)
|
|
|
+ td.SortKVWeight[k] = -99
|
|
|
}
|
|
|
} else if proCode = projectcodeReg2.FindString(text); proCode != "" {
|
|
|
ckv := GetKVAll(proCode, "", nil, 1)
|
|
|
for k, v := range ckv.Kv {
|
|
|
td.SortKV.AddKey(k, v)
|
|
|
+ td.SortKVWeight[k] = -99
|
|
|
}
|
|
|
}
|
|
|
if proCode = jsonReg.FindString(text); proCode != "" {
|
|
@@ -172,6 +174,7 @@ func NewTD(Goquery *goquery.Selection, tr *TR, table *Table) *TD {
|
|
|
json.Unmarshal([]byte(proCode), &jsonMap)
|
|
|
for k, v := range jsonMap {
|
|
|
td.SortKV.AddKey(k, v)
|
|
|
+ td.SortKVWeight[k] = -99
|
|
|
}
|
|
|
}
|
|
|
//对td单元格值判断是否是表头和根据td内容长度进行分块处理
|
|
@@ -232,8 +235,13 @@ func (td *TD) tdHasTable(bsontable *bool, tr *TR) {
|
|
|
if td.TR.Table.TableResult == nil {
|
|
|
td.TR.Table.TableResult = NewTableResult(sonts.Id, sonts.Toptype, sonts.BlockTag, sonts.Html, sonts.Itype, sonts.RuleBlock)
|
|
|
}
|
|
|
- td.TR.Table.TableResult.SortKV.AddKey(k, v)
|
|
|
- td.TR.Table.TableResult.SortKVWeight[k] = sonts.SortKVWeight[k]
|
|
|
+ if td.TR.Table.TableResult.SortKVWeight[k] < sonts.SortKVWeight[k]{
|
|
|
+ td.TR.Table.TableResult.SortKV.AddKey(k, v)
|
|
|
+ td.TR.Table.TableResult.SortKVWeight[k] = sonts.SortKVWeight[k]
|
|
|
+ }else {
|
|
|
+ td.SortKV.AddKey(k,v)
|
|
|
+ td.SortKVWeight[k]=sonts.SortKVWeight[k]
|
|
|
+ }
|
|
|
}
|
|
|
td.SonTableResult = sonts
|
|
|
//for _, k := range sonts.SortKV.Keys {
|