Commit 5175d0ca authored by Alex朱枝文's avatar Alex朱枝文

续签文书管理优化测试bug修复

parent 76659233
...@@ -254,6 +254,18 @@ extension YHResignDocumentDetailViewController { ...@@ -254,6 +254,18 @@ extension YHResignDocumentDetailViewController {
safariViewController.modalPresentationStyle = .fullScreen safariViewController.modalPresentationStyle = .fullScreen
present(safariViewController, animated: true, completion: nil) present(safariViewController, animated: true, completion: nil)
} }
private func previewUploadedFiles(_ urlStr: String, title: String) {
guard URL(string: urlStr) != nil else {
return
}
YHHUD.show(.progress(message: ""))
viewModel.getRealUsefulUrl(urlStr) { [weak self] resultUrl in
guard let self = self else { return }
YHHUD.hide()
self.previewFileTool.openXLSXRemoteFile(urlString: resultUrl, fileName: title)
}
}
} }
extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableViewDataSource { extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableViewDataSource {
...@@ -327,17 +339,7 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView ...@@ -327,17 +339,7 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView
self.updateUploadFilesSection() self.updateUploadFilesSection()
} }
} else if editType == .preview { // 预览 } else if editType == .preview { // 预览
guard URL(string: urlStr) != nil else { self.previewUploadedFiles(urlStr, title: title)
return
}
YHHUD.show(.progress(message: ""))
self.viewModel.getPublicImageUrl(urlStr) { [weak self] success, error in
guard let self = self else { return }
YHHUD.hide()
if let success = success {
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName: "")
}
}
} }
}.show() }.show()
} }
...@@ -390,6 +392,21 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView ...@@ -390,6 +392,21 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView() return UIView()
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
guard datas.count > indexPath.section else {
return
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return
}
let item = sectionArr[indexPath.row]
if case let .uploadFile(title, urlStr, editTypes) = item {
previewUploadedFiles(urlStr, title: title)
}
}
} }
extension YHResignDocumentDetailViewController { extension YHResignDocumentDetailViewController {
...@@ -826,7 +843,7 @@ extension YHResignDocumentDetailViewController { ...@@ -826,7 +843,7 @@ extension YHResignDocumentDetailViewController {
return uploadModel return uploadModel
} }
self.viewModel.uploadSignedDoc(self.docId, type: .upload, docs) { [weak self] success, error in self.viewModel.uploadSignedDoc(self.docId, type: .submit, docs) { [weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
if success { if success {
YHHUD.flash(message: "提交成功") YHHUD.flash(message: "提交成功")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment