diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 243d35f..27aa56c 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 65BF7C2526AFDDCD000FEC82 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2426AFDDCD000FEC82 /* Assets.xcassets */; }; 65BF7C2826AFDDCD000FEC82 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2626AFDDCD000FEC82 /* LaunchScreen.storyboard */; }; 65BF7DD526BB8F880097B132 /* InspectDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */; }; + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65D95F2B26C653FF00D61ADC /* Array.swift */; }; 65EB076626BCCA6E00F9C0EC /* TransferIdDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */; }; 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */; }; 65EB076E26BCD76F00F9C0EC /* EventTaskViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */; }; @@ -532,6 +533,7 @@ 65BF7C2926AFDDCD000FEC82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65BF7DBD26BA25C50097B132 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectDetailModel.swift; sourceTree = ""; }; + 65D95F2B26C653FF00D61ADC /* Array.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransferIdDelegate.swift; sourceTree = ""; }; 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventTaskViewController.swift; sourceTree = ""; }; 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventTaskViewController.xib; sourceTree = ""; }; @@ -604,6 +606,7 @@ children = ( 6518222626AFE9EB00FCC275 /* String.swift */, 656EEBCE26C529130054E00E /* Int.swift */, + 65D95F2B26C653FF00D61ADC /* Array.swift */, ); path = Extension; sourceTree = ""; @@ -1426,6 +1429,7 @@ 6518222726AFE9EB00FCC275 /* String.swift in Sources */, 656EEBC826C4C7C20054E00E /* ImageCollectionViewDelCell.swift in Sources */, 65F2E02D26B1341300179EBD /* SwitchTableViewCell.swift in Sources */, + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */, 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */, 65F2E01126B0E6D700179EBD /* MainMenuViewController.swift in Sources */, 65F2E05326B2812700179EBD /* ImageCollectionViewCell.swift in Sources */, diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 243d35f..27aa56c 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 65BF7C2526AFDDCD000FEC82 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2426AFDDCD000FEC82 /* Assets.xcassets */; }; 65BF7C2826AFDDCD000FEC82 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2626AFDDCD000FEC82 /* LaunchScreen.storyboard */; }; 65BF7DD526BB8F880097B132 /* InspectDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */; }; + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65D95F2B26C653FF00D61ADC /* Array.swift */; }; 65EB076626BCCA6E00F9C0EC /* TransferIdDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */; }; 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */; }; 65EB076E26BCD76F00F9C0EC /* EventTaskViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */; }; @@ -532,6 +533,7 @@ 65BF7C2926AFDDCD000FEC82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65BF7DBD26BA25C50097B132 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectDetailModel.swift; sourceTree = ""; }; + 65D95F2B26C653FF00D61ADC /* Array.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransferIdDelegate.swift; sourceTree = ""; }; 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventTaskViewController.swift; sourceTree = ""; }; 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventTaskViewController.xib; sourceTree = ""; }; @@ -604,6 +606,7 @@ children = ( 6518222626AFE9EB00FCC275 /* String.swift */, 656EEBCE26C529130054E00E /* Int.swift */, + 65D95F2B26C653FF00D61ADC /* Array.swift */, ); path = Extension; sourceTree = ""; @@ -1426,6 +1429,7 @@ 6518222726AFE9EB00FCC275 /* String.swift in Sources */, 656EEBC826C4C7C20054E00E /* ImageCollectionViewDelCell.swift in Sources */, 65F2E02D26B1341300179EBD /* SwitchTableViewCell.swift in Sources */, + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */, 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */, 65F2E01126B0E6D700179EBD /* MainMenuViewController.swift in Sources */, 65F2E05326B2812700179EBD /* ImageCollectionViewCell.swift in Sources */, diff --git a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate index dded841..8e4a49f 100644 --- a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate +++ b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 243d35f..27aa56c 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 65BF7C2526AFDDCD000FEC82 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2426AFDDCD000FEC82 /* Assets.xcassets */; }; 65BF7C2826AFDDCD000FEC82 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2626AFDDCD000FEC82 /* LaunchScreen.storyboard */; }; 65BF7DD526BB8F880097B132 /* InspectDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */; }; + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65D95F2B26C653FF00D61ADC /* Array.swift */; }; 65EB076626BCCA6E00F9C0EC /* TransferIdDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */; }; 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */; }; 65EB076E26BCD76F00F9C0EC /* EventTaskViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */; }; @@ -532,6 +533,7 @@ 65BF7C2926AFDDCD000FEC82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65BF7DBD26BA25C50097B132 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectDetailModel.swift; sourceTree = ""; }; + 65D95F2B26C653FF00D61ADC /* Array.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransferIdDelegate.swift; sourceTree = ""; }; 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventTaskViewController.swift; sourceTree = ""; }; 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventTaskViewController.xib; sourceTree = ""; }; @@ -604,6 +606,7 @@ children = ( 6518222626AFE9EB00FCC275 /* String.swift */, 656EEBCE26C529130054E00E /* Int.swift */, + 65D95F2B26C653FF00D61ADC /* Array.swift */, ); path = Extension; sourceTree = ""; @@ -1426,6 +1429,7 @@ 6518222726AFE9EB00FCC275 /* String.swift in Sources */, 656EEBC826C4C7C20054E00E /* ImageCollectionViewDelCell.swift in Sources */, 65F2E02D26B1341300179EBD /* SwitchTableViewCell.swift in Sources */, + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */, 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */, 65F2E01126B0E6D700179EBD /* MainMenuViewController.swift in Sources */, 65F2E05326B2812700179EBD /* ImageCollectionViewCell.swift in Sources */, diff --git a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate index dded841..8e4a49f 100644 --- a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate +++ b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ diff --git a/LaserMethane/Base/BaseViewController.swift b/LaserMethane/Base/BaseViewController.swift deleted file mode 100644 index c07babc..0000000 --- a/LaserMethane/Base/BaseViewController.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// BaseViewController.swift -// birmm-inspect-ios-app -// -// Created by 203 on 2021/7/27. -// - -import UIKit - -class BaseViewController: UIViewController { - override func viewDidLoad() { - } -} diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 243d35f..27aa56c 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 65BF7C2526AFDDCD000FEC82 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2426AFDDCD000FEC82 /* Assets.xcassets */; }; 65BF7C2826AFDDCD000FEC82 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2626AFDDCD000FEC82 /* LaunchScreen.storyboard */; }; 65BF7DD526BB8F880097B132 /* InspectDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */; }; + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65D95F2B26C653FF00D61ADC /* Array.swift */; }; 65EB076626BCCA6E00F9C0EC /* TransferIdDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */; }; 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */; }; 65EB076E26BCD76F00F9C0EC /* EventTaskViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */; }; @@ -532,6 +533,7 @@ 65BF7C2926AFDDCD000FEC82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65BF7DBD26BA25C50097B132 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectDetailModel.swift; sourceTree = ""; }; + 65D95F2B26C653FF00D61ADC /* Array.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransferIdDelegate.swift; sourceTree = ""; }; 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventTaskViewController.swift; sourceTree = ""; }; 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventTaskViewController.xib; sourceTree = ""; }; @@ -604,6 +606,7 @@ children = ( 6518222626AFE9EB00FCC275 /* String.swift */, 656EEBCE26C529130054E00E /* Int.swift */, + 65D95F2B26C653FF00D61ADC /* Array.swift */, ); path = Extension; sourceTree = ""; @@ -1426,6 +1429,7 @@ 6518222726AFE9EB00FCC275 /* String.swift in Sources */, 656EEBC826C4C7C20054E00E /* ImageCollectionViewDelCell.swift in Sources */, 65F2E02D26B1341300179EBD /* SwitchTableViewCell.swift in Sources */, + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */, 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */, 65F2E01126B0E6D700179EBD /* MainMenuViewController.swift in Sources */, 65F2E05326B2812700179EBD /* ImageCollectionViewCell.swift in Sources */, diff --git a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate index dded841..8e4a49f 100644 --- a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate +++ b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ diff --git a/LaserMethane/Base/BaseViewController.swift b/LaserMethane/Base/BaseViewController.swift deleted file mode 100644 index c07babc..0000000 --- a/LaserMethane/Base/BaseViewController.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// BaseViewController.swift -// birmm-inspect-ios-app -// -// Created by 203 on 2021/7/27. -// - -import UIKit - -class BaseViewController: UIViewController { - override func viewDidLoad() { - } -} diff --git a/LaserMethane/Extension/Array.swift b/LaserMethane/Extension/Array.swift new file mode 100644 index 0000000..3a7a9f2 --- /dev/null +++ b/LaserMethane/Extension/Array.swift @@ -0,0 +1,26 @@ +// +// Array.swift +// LaserMethane +// +// Created by 203 on 2021/8/13. +// + +import Foundation + +extension Array { + // 将图片集合格式化成满足上传格式的数据 + func reformat() -> String { + if isEmpty { + return "" + } + var builder: String = "" + for i in 0 ... count - 1 { + let value = self[i] as! String + builder.append(value) + if i != count - 1 { + builder.append(",") + } + } + return builder + } +} diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 243d35f..27aa56c 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 65BF7C2526AFDDCD000FEC82 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2426AFDDCD000FEC82 /* Assets.xcassets */; }; 65BF7C2826AFDDCD000FEC82 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2626AFDDCD000FEC82 /* LaunchScreen.storyboard */; }; 65BF7DD526BB8F880097B132 /* InspectDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */; }; + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65D95F2B26C653FF00D61ADC /* Array.swift */; }; 65EB076626BCCA6E00F9C0EC /* TransferIdDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */; }; 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */; }; 65EB076E26BCD76F00F9C0EC /* EventTaskViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */; }; @@ -532,6 +533,7 @@ 65BF7C2926AFDDCD000FEC82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65BF7DBD26BA25C50097B132 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectDetailModel.swift; sourceTree = ""; }; + 65D95F2B26C653FF00D61ADC /* Array.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransferIdDelegate.swift; sourceTree = ""; }; 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventTaskViewController.swift; sourceTree = ""; }; 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventTaskViewController.xib; sourceTree = ""; }; @@ -604,6 +606,7 @@ children = ( 6518222626AFE9EB00FCC275 /* String.swift */, 656EEBCE26C529130054E00E /* Int.swift */, + 65D95F2B26C653FF00D61ADC /* Array.swift */, ); path = Extension; sourceTree = ""; @@ -1426,6 +1429,7 @@ 6518222726AFE9EB00FCC275 /* String.swift in Sources */, 656EEBC826C4C7C20054E00E /* ImageCollectionViewDelCell.swift in Sources */, 65F2E02D26B1341300179EBD /* SwitchTableViewCell.swift in Sources */, + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */, 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */, 65F2E01126B0E6D700179EBD /* MainMenuViewController.swift in Sources */, 65F2E05326B2812700179EBD /* ImageCollectionViewCell.swift in Sources */, diff --git a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate index dded841..8e4a49f 100644 --- a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate +++ b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ diff --git a/LaserMethane/Base/BaseViewController.swift b/LaserMethane/Base/BaseViewController.swift deleted file mode 100644 index c07babc..0000000 --- a/LaserMethane/Base/BaseViewController.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// BaseViewController.swift -// birmm-inspect-ios-app -// -// Created by 203 on 2021/7/27. -// - -import UIKit - -class BaseViewController: UIViewController { - override func viewDidLoad() { - } -} diff --git a/LaserMethane/Extension/Array.swift b/LaserMethane/Extension/Array.swift new file mode 100644 index 0000000..3a7a9f2 --- /dev/null +++ b/LaserMethane/Extension/Array.swift @@ -0,0 +1,26 @@ +// +// Array.swift +// LaserMethane +// +// Created by 203 on 2021/8/13. +// + +import Foundation + +extension Array { + // 将图片集合格式化成满足上传格式的数据 + func reformat() -> String { + if isEmpty { + return "" + } + var builder: String = "" + for i in 0 ... count - 1 { + let value = self[i] as! String + builder.append(value) + if i != count - 1 { + builder.append(",") + } + } + return builder + } +} diff --git a/LaserMethane/Protocol/TransferImageDelegate.swift b/LaserMethane/Protocol/TransferImageDelegate.swift deleted file mode 100644 index ccc883e..0000000 --- a/LaserMethane/Protocol/TransferImageDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// TransferImageDelegate.swift -// LaserMethane -// -// Created by 203 on 2021/7/30. -// - -import Foundation -import UIKit - -protocol TransferImageDelegate: NSObjectProtocol { - func transfer(controller: UIViewController, dic: NSDictionary) -} diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 243d35f..27aa56c 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 65BF7C2526AFDDCD000FEC82 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2426AFDDCD000FEC82 /* Assets.xcassets */; }; 65BF7C2826AFDDCD000FEC82 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65BF7C2626AFDDCD000FEC82 /* LaunchScreen.storyboard */; }; 65BF7DD526BB8F880097B132 /* InspectDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */; }; + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65D95F2B26C653FF00D61ADC /* Array.swift */; }; 65EB076626BCCA6E00F9C0EC /* TransferIdDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */; }; 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */; }; 65EB076E26BCD76F00F9C0EC /* EventTaskViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */; }; @@ -532,6 +533,7 @@ 65BF7C2926AFDDCD000FEC82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65BF7DBD26BA25C50097B132 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65BF7DD426BB8F880097B132 /* InspectDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectDetailModel.swift; sourceTree = ""; }; + 65D95F2B26C653FF00D61ADC /* Array.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; 65EB076526BCCA6E00F9C0EC /* TransferIdDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransferIdDelegate.swift; sourceTree = ""; }; 65EB076B26BCD76F00F9C0EC /* EventTaskViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventTaskViewController.swift; sourceTree = ""; }; 65EB076C26BCD76F00F9C0EC /* EventTaskViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventTaskViewController.xib; sourceTree = ""; }; @@ -604,6 +606,7 @@ children = ( 6518222626AFE9EB00FCC275 /* String.swift */, 656EEBCE26C529130054E00E /* Int.swift */, + 65D95F2B26C653FF00D61ADC /* Array.swift */, ); path = Extension; sourceTree = ""; @@ -1426,6 +1429,7 @@ 6518222726AFE9EB00FCC275 /* String.swift in Sources */, 656EEBC826C4C7C20054E00E /* ImageCollectionViewDelCell.swift in Sources */, 65F2E02D26B1341300179EBD /* SwitchTableViewCell.swift in Sources */, + 65D95F2C26C653FF00D61ADC /* Array.swift in Sources */, 65EB076D26BCD76F00F9C0EC /* EventTaskViewController.swift in Sources */, 65F2E01126B0E6D700179EBD /* MainMenuViewController.swift in Sources */, 65F2E05326B2812700179EBD /* ImageCollectionViewCell.swift in Sources */, diff --git a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate index dded841..8e4a49f 100644 --- a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate +++ b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ diff --git a/LaserMethane/Base/BaseViewController.swift b/LaserMethane/Base/BaseViewController.swift deleted file mode 100644 index c07babc..0000000 --- a/LaserMethane/Base/BaseViewController.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// BaseViewController.swift -// birmm-inspect-ios-app -// -// Created by 203 on 2021/7/27. -// - -import UIKit - -class BaseViewController: UIViewController { - override func viewDidLoad() { - } -} diff --git a/LaserMethane/Extension/Array.swift b/LaserMethane/Extension/Array.swift new file mode 100644 index 0000000..3a7a9f2 --- /dev/null +++ b/LaserMethane/Extension/Array.swift @@ -0,0 +1,26 @@ +// +// Array.swift +// LaserMethane +// +// Created by 203 on 2021/8/13. +// + +import Foundation + +extension Array { + // 将图片集合格式化成满足上传格式的数据 + func reformat() -> String { + if isEmpty { + return "" + } + var builder: String = "" + for i in 0 ... count - 1 { + let value = self[i] as! String + builder.append(value) + if i != count - 1 { + builder.append(",") + } + } + return builder + } +} diff --git a/LaserMethane/Protocol/TransferImageDelegate.swift b/LaserMethane/Protocol/TransferImageDelegate.swift deleted file mode 100644 index ccc883e..0000000 --- a/LaserMethane/Protocol/TransferImageDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// TransferImageDelegate.swift -// LaserMethane -// -// Created by 203 on 2021/7/30. -// - -import Foundation -import UIKit - -protocol TransferImageDelegate: NSObjectProtocol { - func transfer(controller: UIViewController, dic: NSDictionary) -} diff --git a/LaserMethane/ViewController/Map/NewEventViewController.swift b/LaserMethane/ViewController/Map/NewEventViewController.swift index 473c53a..273421b 100644 --- a/LaserMethane/ViewController/Map/NewEventViewController.swift +++ b/LaserMethane/ViewController/Map/NewEventViewController.swift @@ -32,10 +32,10 @@ @IBOutlet var imageCollectionView: UICollectionView! @IBOutlet var saveEventButton: UIButton! + private let keychain = Keychain() private var imageUrlArray = [URL]() // 完整的图片url private var imageArray = [String]() // 上传图片成功后服务器返回的图片数组 private var userModel: UserInfoModel! - private var keychain: Keychain! private var baseURL: String! private var index: Int = 0 @@ -45,7 +45,6 @@ override func viewDidLoad() { super.viewDidLoad() // 设置导航栏背景和标题 - title = "报警事件记录" navigationController?.navigationBar.isTranslucent = false navigationController?.navigationBar.barTintColor = .systemBlue let dict: [NSAttributedString.Key: Any] = [NSAttributedString.Key.foregroundColor: UIColor.white] @@ -55,8 +54,6 @@ let userJson = keychain[Constant.UserJson.rawValue]! let data = userJson.data(using: String.Encoding.utf8, allowLossyConversion: false) ?? Data() userModel = UserInfoModel(respJson: JSON(data)) - // - keychain = Keychain() baseURL = keychain[Constant.ServerConfig.rawValue] // setupLayerView() @@ -74,9 +71,11 @@ LayerShadowHub.shared.setShadow(view: firstView, sColor: UIColor(red: 211 / 255, green: 211 / 255, blue: 211 / 255, alpha: 1.0), offset: CGSize(width: 0, height: 0), alpha: 1.0, radius: CGFloat(5.0)) LayerShadowHub.shared.setShadow(view: thirdView, sColor: UIColor(red: 211 / 255, green: 211 / 255, blue: 211 / 255, alpha: 1.0), offset: CGSize(width: 0, height: 0), alpha: 1.0, radius: CGFloat(5.0)) if isWarning! { + title = "报警事件记录" secondView.isHidden = false LayerShadowHub.shared.setShadow(view: secondView, sColor: UIColor(red: 211 / 255, green: 211 / 255, blue: 211 / 255, alpha: 1.0), offset: CGSize(width: 0, height: 0), alpha: 1.0, radius: CGFloat(5.0)) } else { + title = "自定义事件记录" secondView.isHidden = true secondView.removeFromSuperview() // 光隐藏没用,需要完全从它父布局移除,不然会占位,类似Android的GONE和VISIABLE thirdView.snp.makeConstraints { (make) -> Void in @@ -166,19 +165,24 @@ } // 提交事件 let addEventURL = baseURL! + Constant.addEvent.rawValue - Alamofire.request(addEventURL, - method: .post, - parameters: ["id": "t".id(), "inspectionId": inspectionId!, "name": inspectionName!, - "createTime": eventTimeLabel.text!, "type": eventType, "lng": longitude!, - "lat": latitude!, "data": eventValueData, "images": imageArray, - "description": eventDesc!, "user": (userModel.data?.name)!], + let param: [String: Any] = ["id": "t".id(), "inspectionId": inspectionId!, "name": inspectionName!, + "createTime": eventTimeLabel.text!, "type": eventType, "lng": longitude!, + "lat": latitude!, "data": eventValueData, "images": imageArray.reformat(), + "description": eventDesc!, "user": (userModel.data?.name)!] + print("提交参数: \(param)") + Alamofire.request(addEventURL, method: .post, parameters: param, headers: ["token": keychain[Constant.Token.rawValue]!]) .responseJSON(completionHandler: { response in switch response.result { case let .success(value): let actionModel = ActionResultModel(respJson: JSON(value)) if actionModel.code == 200 { - self.dismiss(animated: true, completion: nil) + let alertController = UIAlertController(title: "提示", message: "提交成功", preferredStyle: .alert) + let okAction = UIAlertAction(title: "知道了", style: .default, handler: { _ in + self.navigationController?.popViewController(animated: true) + }) + alertController.addAction(okAction) + self.present(alertController, animated: true, completion: nil) } else { AlertHub.shared.showWaringAlert(controller: self, messge: "服务器异常") }