1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- //
- // AutoTestCellInfo.swift
- // KdanAuto
- //
- // Created by 朱东勇 on 2022/12/19.
- //
- import Foundation
- class AutoTestCellInfo : NSObject {
- var _isFileType : Bool! = false
- var _fileType:String = ""
-
- var _isType : Bool! = false
- var _typeInfo: NSDictionary = NSDictionary()
-
- var _row : Int! = 0
-
- class func initWithRow(_ row:Int) -> AutoTestCellInfo {
- let cellInfo = AutoTestCellInfo()
- cellInfo._row = row
- var index = 0
- for fileType in testFileTypes {
- // 当前行是否为 文件类型行
- if ((row - index) == 0) {
- cellInfo.setFileType(fileType)
- cellInfo.setIsFileType(true)
- return cellInfo
- }
- index = index + 1;
-
- //当前文件类型是否为展开
- if (DataModel.shared.isExpand(fileType)) {
- let testTypes = testTypeInfo[fileType] as! NSArray
- if (row - index < testTypes.count) {
- let typeInfo = testTypes[row - index] as! NSDictionary
-
- cellInfo.setFileType(fileType)
- cellInfo.setTypeInfo(typeInfo)
- cellInfo.setIsType(true)
- return cellInfo
- }
- index = index + testTypes.count
- }
- }
-
- return cellInfo
- }
-
- /// Setter & Getter
- func isFileType() -> Bool {
- return _isFileType
- }
-
- private func setIsFileType(_ isFileType:Bool) {
- _isFileType = isFileType
- }
-
- func fileType() -> String {
- return _fileType
- }
-
- private func setFileType(_ fileType:String) {
- _fileType = fileType
- }
-
- func isType() -> Bool {
- return _isType
- }
-
- private func setIsType(_ isType:Bool) {
- _isType = isType
- }
-
- func typeInfo() -> NSDictionary {
- return _typeInfo
- }
-
- private func setTypeInfo(_ typeInfo:NSDictionary) {
- _typeInfo = typeInfo
- }
-
- }
|