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

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

parent 76659233
......@@ -254,6 +254,18 @@ extension YHResignDocumentDetailViewController {
safariViewController.modalPresentationStyle = .fullScreen
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 {
......@@ -327,17 +339,7 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView
self.updateUploadFilesSection()
}
} else if editType == .preview { // 预览
guard URL(string: urlStr) != nil else {
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: "")
}
}
self.previewUploadedFiles(urlStr, title: title)
}
}.show()
}
......@@ -390,6 +392,21 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> 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 {
......@@ -826,7 +843,7 @@ extension YHResignDocumentDetailViewController {
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 }
if success {
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