Pārlūkot izejas kodu

优化暴力提分的word,没有内容时出现序号的问题

notepad 4 nedēļas atpakaļ
vecāks
revīzija
952d7aa2ea
2 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. 4 1
      make_docx_demo/main_word_applet.py
  2. 1 1
      mock/mock_request.py

+ 4 - 1
make_docx_demo/main_word_applet.py

@@ -1045,10 +1045,13 @@ def old_two_check_page(docx: Word, json_data, **kwargs):
             spell1, meaning1 = word_data_list2[row]
             spell2, meaning2 = word_data_list2[total_row + row]
 
+            cell1 = f"{row + 1}. {spell1}" if spell1 else ""
+            cell2 = f"□ {meaning1}" if meaning1 else ""
+
             cell3 = f"{total_row + row + 1}. {spell2}" if spell2 else ""
             cell4 = f"□ {meaning2}" if meaning2 else ""
 
-            data = [f"{row + 1}. {spell1}", f"□ {meaning1}", cell3, cell4] 
+            data = [cell1,cell2, cell3, cell4] 
             tb.add_table_row_data_xml_fastly(data, font_size=[10.5, 9, 10.5, 9])
 
         tb.set_all_border_fastly(xml=True, outside_side_border=True, outside_side_border_size=5)

+ 1 - 1
mock/mock_request.py

@@ -10,7 +10,7 @@ test_address = "http://111.231.167.191:8004"
 test_address2 = "http://111.231.167.191:8003" 
 local_adress = "http://127.0.0.1:9000" 
 
-use_address = local_adress 
+use_address = product_adress 
 
 
 def time_use(fn):