380 lines
19 KiB
Python
380 lines
19 KiB
Python
from get_imformation import contentfill_window
|
||
|
||
# 文档处理工具
|
||
from tools.document_tools import (
|
||
create_document, add_documents,
|
||
add_table_to_document,right_align_last_three_para
|
||
)
|
||
|
||
# 内容处理工具
|
||
from tools.content_tools import (
|
||
add_picture,
|
||
search_and_replace,add_picture_to_table
|
||
)
|
||
|
||
from get_pictures import make_Thumbnail,resize_and_reduce_quality
|
||
from core.tables import fill_tables
|
||
from ui.外部报告生成_内容填写_ui import Ui_MainWindow
|
||
|
||
async def generate_report(ui : Ui_MainWindow, self : contentfill_window):
|
||
#获取模板编号、模板名称
|
||
cover_encode = "encode"
|
||
cover_project = "project"
|
||
baogao_name1 = "baogaoname1"
|
||
baogao_name2 = "baogaoname2"
|
||
company_name_yi = "company_name_yi"
|
||
cover_date = "time"
|
||
TITLE_OF_REPORT = "companyencode"
|
||
|
||
jituan_name = ui.jituan_jianxie.text()
|
||
project_number = ui.jizu_type_2.text()
|
||
fengchang_name = ui.fengchang_name_2.text()
|
||
date = ui.date.text()
|
||
|
||
work_dir = ui.lineEdit.text()
|
||
|
||
###封面创建###
|
||
#封面目录
|
||
cover_dirs = [rf"{work_dir}\封面\外部封面1.docx",rf"{work_dir}\封面\封面图片.jpg",rf"{work_dir}\封面\外部封面2.docx"]
|
||
|
||
#输出目录
|
||
output_dir = fr"{work_dir}\{ui.jituan_jianxie.text()}{ui.fengchang_name_2.text()}项目{ui.baogao_name.text()}{ui.jizu_type.text()}.docx"
|
||
#创建文档、添加封面
|
||
print(await create_document(output_dir))
|
||
print(await add_documents(output_dir, cover_dirs[0]))
|
||
print(await add_picture(output_dir, cover_dirs[1]))
|
||
print(await add_documents(output_dir, cover_dirs[2]))
|
||
print("封面创建成功")
|
||
#更改文档信息
|
||
print(await search_and_replace(output_dir, TITLE_OF_REPORT, jituan_name + project_number))
|
||
print(await search_and_replace(output_dir, baogao_name1, ui.baogao_name.text()))
|
||
print(await search_and_replace(output_dir, baogao_name2, ui.baogao_name.text()))
|
||
print(await search_and_replace(output_dir, company_name_yi, ui.Yi_Company.text()))
|
||
print(await search_and_replace(output_dir, cover_project, jituan_name + fengchang_name))
|
||
print(await search_and_replace(output_dir, cover_encode, jituan_name + project_number))
|
||
print(await search_and_replace(output_dir, cover_date, date))
|
||
i = 0
|
||
output_doc = None
|
||
|
||
|
||
if not ui.checkBox.isChecked():
|
||
XIANG_MU_GAI_KUANG = rf"{work_dir}\外部报告表格\项目概括表.docx"
|
||
project_location = ui.fengchang_location.text()
|
||
company_name_jia = ui.Jia_Company.text()
|
||
fuzeren = ui.fuzeren.text()
|
||
phone_fuzeren = ui.phone_fuzeren.text()
|
||
jizu_type = ui.jizu_type.text()
|
||
xiangmuguige = ui.project_num.text()
|
||
Yi_company = ui.Yi_Company.text()
|
||
XIANGMU_GAIKUO = list(list("" for i in range(5)) for j in range(5))
|
||
XIANGMU_GAIKUO[0][1] = fengchang_name
|
||
#XIANGMU_GAIKUO[0][3]=XIANGMU_GAIKUO[0][4] = "盐城市滨海县"
|
||
XIANGMU_GAIKUO[0][3] = project_location
|
||
#XIANGMU_GAIKUO[1][1]=XIANGMU_GAIKUO[2,1]=XIANGMU_GAIKUO[3,1] = "国家电投集团滨海风力发电有限公司"
|
||
XIANGMU_GAIKUO[1][1] = company_name_jia
|
||
XIANGMU_GAIKUO[1][3] = Yi_company
|
||
XIANGMU_GAIKUO[2][3] = fuzeren
|
||
XIANGMU_GAIKUO[3][4] = phone_fuzeren
|
||
XIANGMU_GAIKUO[4][1] = jizu_type
|
||
XIANGMU_GAIKUO[4][4] = xiangmuguige
|
||
|
||
#添加项目概况表
|
||
output_doc, message = await add_table_to_document(output_dir, XIANG_MU_GAI_KUANG,5,5,i,XIANGMU_GAIKUO)
|
||
print(message)
|
||
i += 1
|
||
|
||
if not ui.checkBox_8.isChecked():
|
||
jiancha21 = []
|
||
if ui.checkBox_3.isChecked():
|
||
jiancha21.append(ui.checkBox_3.text())
|
||
if ui.checkBox_2.isChecked():
|
||
jiancha21.append(ui.checkBox_2.text())
|
||
|
||
JIANCHA_XINGXI_DIR = rf"{work_dir}\外部报告表格\检查信息表.docx"
|
||
JIANCHA_XINGXI = list(list("" for i in range(4)) for j in range(9))
|
||
JIANCHA_XINGXI[0][1] = ui.jiancha_renyuan.text()
|
||
JIANCHA_XINGXI[1][1] = ui.jiancha_date.text()
|
||
JIANCHA_XINGXI[1][3] = ui.jizu_bianhao2.text()
|
||
JIANCHA_XINGXI[2][1] = (','.join(jiancha21))
|
||
JIANCHA_XINGXI[2][3] = ui.jiancha_fangshi.text()
|
||
JIANCHA_XINGXI[3][2] = ui.changjia.text()
|
||
JIANCHA_XINGXI[4][1] = '机组编号:' + ui.jizu_bianhao.text() + '机组'
|
||
JIANCHA_XINGXI[5][1] = ui.Y1.text()
|
||
JIANCHA_XINGXI[6][1] = ui.Y2.text()
|
||
JIANCHA_XINGXI[7][1] = ui.Y3.text()
|
||
JIANCHA_XINGXI[8][0] = ui.jiancha_xiangqing.toPlainText()
|
||
JIANCHA_XINGXI42 = ui.label_46.text()
|
||
print(JIANCHA_XINGXI42)
|
||
#新建检查信息表
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_XINGXI_DIR,9,4,i,JIANCHA_XINGXI,False)
|
||
print(message)
|
||
Thumbnail_Picture = await make_Thumbnail(ui.label_45.text()[5:], ui.label_45.text()[5:])#添加图片
|
||
print(await add_picture_to_table(output_doc, output_dir, 4, 2, JIANCHA_XINGXI42, i, 1.18))
|
||
#添加略缩图片
|
||
print(await add_picture_to_table(output_doc, output_dir, 8, 0, Thumbnail_Picture, i))
|
||
i += 1
|
||
|
||
if not ui.checkBox_9.isChecked():
|
||
CHENGGUO_DIJIAO_DIR = rf"{work_dir}\外部报告表格\成果递交表.docx"
|
||
CHENGGUO_DIJIAO = list(list("" for i in range(4)) for j in range(6))
|
||
CHENGGUO_DIJIAO[0][1] = ui.jiancha_renyuan2.text()
|
||
CHENGGUO_DIJIAO[1][1] = ui.yezhu_renyuan.text()
|
||
CHENGGUO_DIJIAO[2][1] = ui.jiancha_riqi.text()
|
||
CHENGGUO_DIJIAO[3][1] = ui.shujuchuli.text()
|
||
CHENGGUO_DIJIAO[4][1] = ui.baogao_bianzhi.text()
|
||
CHENGGUO_DIJIAO[5][1] = ui.baogao_shenghe.text()
|
||
CHENGGUO_DIJIAO[1][3] = ui.changjia_renyuan.text()
|
||
CHENGGUO_DIJIAO[2][3] = ui.jiancha_shijian.text()
|
||
CHENGGUO_DIJIAO[3][3] = ui.chulishijian.text()
|
||
CHENGGUO_DIJIAO[4][3] = ui.bianzhishijian.text()
|
||
CHENGGUO_DIJIAO[5][3] = ui.shenghe_shijian.text()
|
||
|
||
#添加成果递交表
|
||
output_doc, message = await add_table_to_document(output_dir, CHENGGUO_DIJIAO_DIR,5,5,i,CHENGGUO_DIJIAO,True,0.04)
|
||
print(message)
|
||
i += 1
|
||
|
||
if not ui.checkBox_10.isChecked():
|
||
def get_jiancha(Y, box):
|
||
if box.isChecked():
|
||
Y.append(box.text())
|
||
return Y
|
||
JIANCHA_HUIZONG_DIR = rf"{work_dir}\外部报告表格\检查情况汇总表.docx"
|
||
JIANCHA_HUIZONG = list(list("" for i in range(3)) for j in range(4))
|
||
Y1_jiancha = []
|
||
Y1_jiancha = get_jiancha(Y1_jiancha, ui.checkBox_4)
|
||
Y1_jiancha = get_jiancha(Y1_jiancha, ui.checkBox_7)
|
||
Y1_jiancha = get_jiancha(Y1_jiancha, ui.checkBox_5)
|
||
Y1_jiancha = get_jiancha(Y1_jiancha, ui.checkBox_6)
|
||
Y2_jiancha = []
|
||
Y2_jiancha = get_jiancha(Y2_jiancha, ui.checkBox_16)
|
||
Y2_jiancha = get_jiancha(Y2_jiancha, ui.checkBox_17)
|
||
Y2_jiancha = get_jiancha(Y2_jiancha, ui.checkBox_18)
|
||
Y2_jiancha = get_jiancha(Y2_jiancha, ui.checkBox_19)
|
||
Y3_jiancha = []
|
||
Y3_jiancha = get_jiancha(Y3_jiancha, ui.checkBox_20)
|
||
Y3_jiancha = get_jiancha(Y3_jiancha, ui.checkBox_21)
|
||
Y3_jiancha = get_jiancha(Y3_jiancha, ui.checkBox_22)
|
||
Y3_jiancha = get_jiancha(Y3_jiancha, ui.checkBox_23)
|
||
JIANCHA_HUIZONG[1][0] = ui.weak_num_Y1.text()
|
||
JIANCHA_HUIZONG[2][0] = ui.weak_num_Y2.text()
|
||
JIANCHA_HUIZONG[3][0] = ui.weak_num_Y3.text()
|
||
JIANCHA_HUIZONG[1][1] = '叶片' + '、'.join(Y1_jiancha)
|
||
JIANCHA_HUIZONG[2][1] = '叶片' + '、'.join(Y2_jiancha)
|
||
JIANCHA_HUIZONG[3][1] = '叶片' + '、'.join(Y3_jiancha)
|
||
JIANCHA_HUIZONG[1][2] = ui.textEdit.toPlainText()
|
||
JIANCHA_HUIZONG[2][2] = ui.textEdit_2.toPlainText()
|
||
JIANCHA_HUIZONG[3][2] = ui.textEdit_3.toPlainText()
|
||
#添加检查情况汇总表
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_HUIZONG_DIR,4,3,i,JIANCHA_HUIZONG,False)
|
||
print(message)
|
||
i += 1
|
||
|
||
if not ui.checkBox_11.isChecked():
|
||
picture_label1_num = len(self.picture_labels[0])
|
||
picture_label2_num = len(self.picture_labels[1])
|
||
picture_label3_num = len(self.picture_labels[2])
|
||
print(f"图片、文字数量:{picture_label1_num} {picture_label2_num} {picture_label3_num}")
|
||
JIANCHA_NEIRONG_TOTAL_NUM = picture_label1_num+ picture_label2_num + picture_label3_num
|
||
col = 3
|
||
row = 0
|
||
JIANCHA_NEIRONG_PICTURES_TABLE = rf"{work_dir}\外部报告表格\check2.docx"
|
||
JIANCHA_NEIRONG_Y1_DIR = rf"{work_dir}\外部报告表格\检查内容表.docx"
|
||
JIANCHA_NEIRONG_Y1 = list(list("" for _ in range(3)) for j in range(1))
|
||
JIANCHA_NEIRONG_Y1[0][0] = f"{ui.tabWidget_2.tabText(0)}"
|
||
print(f"Y1标题内容:{JIANCHA_NEIRONG_Y1}")
|
||
JIANCHA_NEIRONG_Y2_DIR = rf"{work_dir}\外部报告表格\check3.docx"
|
||
JIANCHA_NEIRONG_Y2 = list(list("" for _ in range(3)) for j in range(1))
|
||
JIANCHA_NEIRONG_Y2[0][0] = f"{ui.tabWidget_2.tabText(1)}"
|
||
print(f"Y2标题内容:{JIANCHA_NEIRONG_Y2}")
|
||
JIANCHA_NEIRONG_Y3_DIR = rf"{work_dir}\外部报告表格\check3.docx"
|
||
JIANCHA_NEIRONG_Y3 = list(list("" for _ in range(3)) for j in range(1))
|
||
JIANCHA_NEIRONG_Y3[0][0] = f"{ui.tabWidget_2.tabText(2)}"
|
||
print(f"Y3标题内容:{JIANCHA_NEIRONG_Y3}")
|
||
print(f"当前表格序号为 {i}")
|
||
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_NEIRONG_Y1_DIR,1,3,i,JIANCHA_NEIRONG_Y1,False)
|
||
i += 1
|
||
Line_index = 0
|
||
picture_index = 0
|
||
print(f"编辑Y1表格内容中,图片数量为{picture_label1_num},描述数量为{len(self.picture_line[0])},行数为{((picture_label1_num+2)//3)*2}")
|
||
for Y1_CONTENT_ROW in range(((picture_label1_num+2)//3)*2):
|
||
if Y1_CONTENT_ROW % 2 == 1:
|
||
JIANCHA_NEIRONG_TEXT = list(list("" for _ in range(3)) for j in range(1))
|
||
for k, text_row in enumerate(JIANCHA_NEIRONG_TEXT):
|
||
for l, text in enumerate(text_row):
|
||
if Line_index >= picture_label1_num:
|
||
break
|
||
JIANCHA_NEIRONG_TEXT[k][l] = self.picture_line[0][Line_index].text()
|
||
print(f'当前为文字表格,在({k},{l})位置 插入文字中...')
|
||
Line_index += 1
|
||
print(f"当前待插入表格{JIANCHA_NEIRONG_TEXT}")
|
||
print(f"当前表格序号为 {i}")
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_NEIRONG_PICTURES_TABLE, 1, 3, i, JIANCHA_NEIRONG_TEXT, False)
|
||
i += 1
|
||
else:
|
||
print(f"当前表格序号为 {i}")
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_NEIRONG_PICTURES_TABLE, 1, 3, i, None, False)
|
||
for k in range(3):
|
||
if picture_index < picture_label1_num:
|
||
print(f"当前为图片表格,在(0,{k})位置 插入图片中...")
|
||
print(await add_picture_to_table(output_doc, output_dir, 0, k, self.picture_labels[0][picture_index].current_path, i, 1.8898))
|
||
picture_index += 1
|
||
i += 1
|
||
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_NEIRONG_Y2_DIR,1,3,i,JIANCHA_NEIRONG_Y2,False)
|
||
i += 1
|
||
Line_index = 0
|
||
picture_index = 0
|
||
|
||
print(f"编辑Y2表格内容中,图片数量为{picture_label2_num},描述数量为{len(self.picture_line[1])},行数为{((picture_label2_num+2)//3)*2}")
|
||
for Y2_CONTENT_ROW in range(((picture_label2_num+2)//3)*2):
|
||
if Y2_CONTENT_ROW % 2 == 1:
|
||
JIANCHA_NEIRONG_TEXT = list(list("" for _ in range(3)) for j in range(1))
|
||
for k, text_row in enumerate(JIANCHA_NEIRONG_TEXT):
|
||
for l, text in enumerate(text_row):
|
||
if Line_index >= picture_label2_num:
|
||
break
|
||
JIANCHA_NEIRONG_TEXT[k][l] = self.picture_line[1][Line_index].text()
|
||
print(f'当前为文字表格,在({k},{l})位置 插入文字中...')
|
||
Line_index += 1
|
||
print(f"当前待插入表格{JIANCHA_NEIRONG_TEXT}")
|
||
print(f"当前表格序号为 {i}")
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_NEIRONG_PICTURES_TABLE, 1, 3, i, JIANCHA_NEIRONG_TEXT, False)
|
||
i += 1
|
||
else:
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_NEIRONG_PICTURES_TABLE, 1, 3, i, None, False)
|
||
for k in range(3):
|
||
if picture_index < picture_label2_num:
|
||
print(f"当前为图片表格,在(0,{k})位置 插入图片中...")
|
||
print(await add_picture_to_table(output_doc, output_dir, 0, k, self.picture_labels[1][picture_index].current_path, i, 1.8898))
|
||
picture_index += 1
|
||
i += 1
|
||
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_NEIRONG_Y3_DIR,1,3,i,JIANCHA_NEIRONG_Y3,False)
|
||
i += 1
|
||
Line_index = 0
|
||
picture_index = 0
|
||
|
||
print(f"编辑Y3表格内容中,图片数量为{picture_label3_num},描述数量为{len(self.picture_line[2])},行数为{((picture_label2_num+2)//3)*2}")
|
||
for Y3_CONTENT_ROW in range(((picture_label3_num+2)//3)*2):
|
||
if Y3_CONTENT_ROW % 2 == 1:
|
||
JIANCHA_NEIRONG_TEXT = list(list("" for _ in range(3)) for j in range(1))
|
||
for k, text_row in enumerate(JIANCHA_NEIRONG_TEXT):
|
||
for l, text in enumerate(text_row):
|
||
if Line_index >= picture_label3_num:
|
||
break
|
||
JIANCHA_NEIRONG_TEXT[k][l] = self.picture_line[2][Line_index].text()
|
||
print(f'当前为文字表格,在({k},{l})位置 插入文字中...')
|
||
Line_index += 1
|
||
print(f"当前待插入表格{JIANCHA_NEIRONG_TEXT}")
|
||
print(f"当前表格序号为 {i}")
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_NEIRONG_PICTURES_TABLE, 1, 3, i, JIANCHA_NEIRONG_TEXT, False)
|
||
i += 1
|
||
else:
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_NEIRONG_PICTURES_TABLE, 1, 3, i, None, False)
|
||
for k in range(3):
|
||
if picture_index < picture_label3_num:
|
||
print(f"当前为图片表格,在(0,{k})位置 插入图片中...")
|
||
print(await add_picture_to_table(output_doc, output_dir, 0, k, self.picture_labels[2][picture_index].current_path, i, 1.8898))
|
||
picture_index += 1
|
||
i += 1
|
||
|
||
if not ui.checkBox_13.isChecked():
|
||
#缺陷详情表
|
||
"""
|
||
image_info = {
|
||
'image_path': image_path,
|
||
'path_label': path_label,
|
||
'image_label': image_label,
|
||
'visibility_combo': visibility_combo,
|
||
'severity_combo': severity_combo,
|
||
'urgency_combo': urgency_combo,
|
||
'defect_type_edit': defect_type_edit,
|
||
'defect_location_edit': defect_location_edit,
|
||
'defect_size_edit': defect_size_edit,
|
||
'repair_suggestion_edit': repair_suggestion_edit
|
||
}
|
||
"""
|
||
QUEXIAN_XIANGQING_DIR = rf"{work_dir}\外部报告表格\检查详情表.docx"
|
||
QUEXIAN_XIANGQING_TITLE_DIR = rf"{work_dir}\外部报告表格\检查详情标题.docx"
|
||
Y1_table_list = []
|
||
Y2_table_list = []
|
||
Y3_table_list = []
|
||
table_lists = [Y1_table_list,Y2_table_list,Y3_table_list]
|
||
page_num = 0
|
||
for table_list in table_lists:
|
||
for j, Y in enumerate(self.table_infos_modules):
|
||
for k, image_info in enumerate(Y):
|
||
print(f"获取第{j+1}个叶片的第{k+1}张缺陷图{image_info['image_path']}")
|
||
table_list.append(
|
||
{
|
||
"QueXianLeiXing" : image_info['defect_type_edit'].text(),
|
||
"QueXianWeiZhi" : image_info['defect_location_edit'].text(),
|
||
"QueXianChiCun" : image_info['defect_size_edit'].text(),
|
||
"WeiZongDengJi" : image_info['severity_combo'].currentText(),
|
||
"Tupian_Dir" : image_info['image_path'],
|
||
"visibility" : image_info['visibility_combo'].currentText(),
|
||
"urgency" : image_info['urgency_combo'].currentText(),
|
||
}
|
||
)
|
||
Xu_Hao = 0
|
||
Y1_TABLES, Y1_TABLES_PICTURES, Xu_Hao = fill_tables(table_lists[0],4,5,len(table_lists[0]),Xu_Hao,self.Y1)
|
||
Y2_TABLES, Y2_TABLES_PICTURES, Xu_Hao = fill_tables(table_lists[1],4,5,len(table_lists[1]),Xu_Hao,self.Y2)
|
||
Y3_TABLES, Y3_TABLES_PICTURES, Xu_Hao = fill_tables(table_lists[2],4,5,len(table_lists[2]),Xu_Hao,self.Y3)
|
||
print(await add_documents(output_dir, QUEXIAN_XIANGQING_TITLE_DIR))
|
||
table_num = 0
|
||
|
||
i,table_num = await add_dynamic_table(output_doc,output_dir,table_num,Y1_TABLES,QUEXIAN_XIANGQING_DIR,Y1_TABLES_PICTURES,4,5,i,False)
|
||
i,table_num = await add_dynamic_table(output_doc,output_dir,table_num,Y2_TABLES,QUEXIAN_XIANGQING_DIR,Y2_TABLES_PICTURES,4,5,i,False)
|
||
i,table_num = await add_dynamic_table(output_doc,output_dir,table_num,Y3_TABLES,QUEXIAN_XIANGQING_DIR,Y3_TABLES_PICTURES,4,5,i,False)
|
||
|
||
#添加总结
|
||
ZONG_JIE_DIR = rf"{work_dir}\外部报告表格\总结.docx"
|
||
ZONG_JIE_BEFORE = "result"
|
||
ZONG_JIE = self.ui.conclusion.toPlainText()
|
||
print(await add_documents(output_dir, ZONG_JIE_DIR))
|
||
print(await search_and_replace(output_dir, ZONG_JIE_BEFORE, ZONG_JIE))
|
||
print(await right_align_last_three_para(output_dir))
|
||
|
||
|
||
|
||
async def add_dynamic_table(output_doc, output_dir, table_num, TABLES, JIANCHA_XIANGQING_DIR, PICTURES, row, col, i, FLAG):
|
||
"""创建动态表
|
||
|
||
Args:
|
||
output_doc (Document): 文档对象
|
||
output_dir (str): 输出目录
|
||
table_num (int): 表格序号
|
||
TABLES (list): 表格数据
|
||
JIANCHA_XIANGQING_DIR (str): 检查详情表目录
|
||
PICTURES (dict): 图片数据字典,键为表索引,值为图片路径列表
|
||
row (int): 行数
|
||
col (int): 列数
|
||
i (int): 表格序号
|
||
FLAG: 其他标志
|
||
|
||
Returns:
|
||
tuple: (i, table_num) 更新后的表格序号和表格数量
|
||
"""
|
||
for table_idx, Table in enumerate(TABLES):
|
||
print(Table)
|
||
output_doc, message = await add_table_to_document(output_dir, JIANCHA_XIANGQING_DIR, row, col, i, Table, FLAG)
|
||
print(message)
|
||
|
||
# 获取当前表格对应的图片
|
||
current_table_pictures = PICTURES.get(table_idx, [])
|
||
print(f"开始处理图片列表: {current_table_pictures}")
|
||
|
||
for picturedir in current_table_pictures:
|
||
try:
|
||
print(f"添加 {picturedir} {type(picturedir)}到表格{table_idx}")
|
||
resize_and_reduce_quality(picturedir, picturedir)
|
||
await add_picture_to_table(output_doc, output_dir, 4, 0, picturedir, i, 4.7232)
|
||
except Exception as e:
|
||
print(f"添加图片失败:{e}")
|
||
|
||
table_num += 1
|
||
i += 1
|
||
return i, table_num
|