|
|
@ -86,7 +86,7 @@ func main() { |
|
|
|
// Icon: "src/data_office/get_db_excel/only_balance_gui/main.ico",
|
|
|
|
// 这样实现将页面加载到主界面上
|
|
|
|
AssignTo: &mw.MainWindow, |
|
|
|
Size: Size{600, 400}, |
|
|
|
Size: Size{Width: 600, Height: 400}, |
|
|
|
Layout: VBox{}, |
|
|
|
MenuItems: []MenuItem{ |
|
|
|
Menu{ |
|
|
@ -95,7 +95,7 @@ func main() { |
|
|
|
Separator{}, |
|
|
|
Action{ |
|
|
|
Text: "退出", |
|
|
|
OnTriggered: func() { mw.Close() }, |
|
|
|
OnTriggered: func() { _ = mw.Close() }, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -104,7 +104,7 @@ func main() { |
|
|
|
Items: []MenuItem{ |
|
|
|
Action{ |
|
|
|
Text: "关于", |
|
|
|
OnTriggered: mw.aboutAction_Triggered, |
|
|
|
OnTriggered: mw.aboutactionTriggered, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -131,7 +131,7 @@ func main() { |
|
|
|
Enabled: isEnd, |
|
|
|
Text: "关闭", |
|
|
|
OnClicked: func() { |
|
|
|
mw.Close() |
|
|
|
_ = mw.Close() |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -181,10 +181,10 @@ func wirteExcel(outTE *walk.TextEdit, outPB *walk.ProgressBar) { |
|
|
|
outTE.AppendText("文件名称为:【当前目录下】" + strings.Replace(path, "./", "", -1) + "\r\n") |
|
|
|
outTE.AppendText("请关闭当前窗口,重新打开\r\n") |
|
|
|
|
|
|
|
fromDB.Close() |
|
|
|
_ = fromDB.Close() |
|
|
|
} |
|
|
|
|
|
|
|
func (mw *MyMainWindow) aboutAction_Triggered() { |
|
|
|
func (mw *MyMainWindow) aboutactionTriggered() { |
|
|
|
walk.MsgBox(mw, "数据库对比工具"+version, |
|
|
|
" 该工具为公务员系统2020版与公务员系统2021版部分信息比对,\n产生结果会生成Excel供使用。\n"+ |
|
|
|
"作者:Viviman张 完成时间:2021-12-21 日", walk.MsgBoxIconQuestion) |
|
|
@ -210,17 +210,6 @@ func doBalance(toMap map[string]map[string]string) map[string]Row4 { |
|
|
|
return rows |
|
|
|
} |
|
|
|
|
|
|
|
// 获取表数据
|
|
|
|
func QueryMap(db *sql.DB, sqlStr string, m map[string]string) { |
|
|
|
rows, _ := db.Query(sqlStr) |
|
|
|
defer rows.Close() |
|
|
|
columns, _ := rows.Columns() |
|
|
|
for rows.Next() { |
|
|
|
_ = rows.Scan(&columns[0], &columns[1]) |
|
|
|
m[columns[0]] = columns[1] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 获取表数据
|
|
|
|
func QuerySQL(db *sql.DB, sqlStr string) map[string]map[string]string { |
|
|
|
mapObj := make(map[string]map[string]string) |
|
|
|