讲义结构与内容录入加工中
This commit is contained in:
parent
2409413cf5
commit
da99fcb6e3
|
|
@ -39,7 +39,7 @@ class MyWindow_jglr(QWidget,Ui_Form):
|
||||||
if AddNew[0].upper() == "A":
|
if AddNew[0].upper() == "A":
|
||||||
descr = input("类型描述:")
|
descr = input("类型描述:")
|
||||||
cn = input("编号是否连续(T/[F]):")
|
cn = input("编号是否连续(T/[F]):")
|
||||||
if cn[0].upper() == "T":
|
if len(cn) > 0 and cn[0].upper() == "T":
|
||||||
cn = True
|
cn = True
|
||||||
else:
|
else:
|
||||||
cn = False
|
cn = False
|
||||||
|
|
@ -53,7 +53,7 @@ class MyWindow_jglr(QWidget,Ui_Form):
|
||||||
partid = input(f"第 {i+1} 部分的代号:")
|
partid = input(f"第 {i+1} 部分的代号:")
|
||||||
partname = input(f"部分 {partid} 的名称:")
|
partname = input(f"部分 {partid} 的名称:")
|
||||||
spaceflag = input(f"部分 {partid}: {partname} 中是否要在题目后留空格(T/[F]):")
|
spaceflag = input(f"部分 {partid}: {partname} 中是否要在题目后留空格(T/[F]):")
|
||||||
if spaceflag[0].upper() == "T":
|
if len(spaceflag) > 0 and spaceflag[0].upper() == "T":
|
||||||
spaceflag = True
|
spaceflag = True
|
||||||
else:
|
else:
|
||||||
spaceflag = False
|
spaceflag = False
|
||||||
|
|
@ -61,6 +61,13 @@ class MyWindow_jglr(QWidget,Ui_Form):
|
||||||
"name": partname,
|
"name": partname,
|
||||||
"spaceflag": spaceflag
|
"spaceflag": spaceflag
|
||||||
}
|
}
|
||||||
|
sql = "INSERT INTO notestructures (initial,description,consecutivenumbering,structure) VALUES (%s,%s,%s,%s);"
|
||||||
|
val = (self.prefix[0:5],descr,cn,json.dumps(new_struct_dict["structure"],ensure_ascii = False))
|
||||||
|
mycursor.execute(sql,val)
|
||||||
|
sql = "INSERT INTO logs (DATE,TIME,username,action,db_content) VALUE (%s,%s,%s,%s,%s);"
|
||||||
|
val = (GetDate(),GetTime(),get_git_username(),"添加新讲义结构",self.prefix[0:5])
|
||||||
|
mycursor.execute(sql,val)
|
||||||
|
mydb.commit()
|
||||||
####20240616到这里
|
####20240616到这里
|
||||||
# notes_dict["structures"][self.prefix[0]] = new_struct_dict.copy()
|
# notes_dict["structures"][self.prefix[0]] = new_struct_dict.copy()
|
||||||
# save_dict(notes_dict,jsonfile)
|
# save_dict(notes_dict,jsonfile)
|
||||||
|
|
|
||||||
Reference in New Issue