Commit a24df6e0 authored by n22's avatar n22

Merge branch 'DEV_20150805_001' of http://121.42.32.57/root/xffruit into DEV_20150805_001

Conflicts:
	XFFruit/Macro/ICRNotificationMacro.h
	XFFruit/XFFruit-Prefix.pch
parents d9568f12 b94eefca
......@@ -6,5 +6,5 @@ pod 'SSKeychain', '~> 1.2.3'
pod 'FMDB', '~> 2.5'
pod 'Base64nl', '~> 1.2'
pod 'Reveal-iOS-SDK', '~> 1.5.1'
pod 'BaiduMapAPI', '~> 2.8.0'
pod 'BaiduMapAPI', '~> 2.7.0'
pod 'MJRefresh', '~> 2.2.0'
......@@ -20,14 +20,7 @@ PODS:
- AFNetworking/UIKit (2.5.4):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- BaiduMapAPI (2.8.0):
- BaiduMapAPI/All (= 2.8.0)
- BaiduMapAPI/All (2.8.0):
- BaiduMapAPI/Core
- BaiduMapAPI/Extend
- BaiduMapAPI/Core (2.8.0)
- BaiduMapAPI/Extend (2.8.0):
- BaiduMapAPI/Core
- BaiduMapAPI (2.7.0)
- Base64nl (1.2)
- FMDB (2.5):
- FMDB/standard (= 2.5)
......@@ -44,7 +37,7 @@ PODS:
DEPENDENCIES:
- AFNetworking (~> 2.5.4)
- BaiduMapAPI (~> 2.8.0)
- BaiduMapAPI (~> 2.7.0)
- Base64nl (~> 1.2)
- FMDB (~> 2.5)
- MBProgressHUD (~> 0.9.1)
......@@ -55,7 +48,7 @@ DEPENDENCIES:
SPEC CHECKSUMS:
AFNetworking: 05edc0ac4c4c8cf57bcf4b84be5b0744b6d8e71e
BaiduMapAPI: e066aa1e85f9fee77a1bc071afb67552852bb0fb
BaiduMapAPI: d6433624b0b4dd156f2d842f394a5011b02a6401
Base64nl: a497bdcd1c01ea793d36b399016195a8713c0e95
FMDB: 96e8f1bcc1329e269330f99770ad4285d9003e52
MBProgressHUD: c47f2c166c126cf2ce36498d80f33e754d4e93ad
......@@ -64,4 +57,4 @@ SPEC CHECKSUMS:
SDWebImage: 71b7cdc1d1721d6a82ed62889030225f2c249e29
SSKeychain: 3f42991739c6c60a9cf1bbd4dff6c0d3694bcf3d
COCOAPODS: 0.38.2
COCOAPODS: 0.37.1
......@@ -41,6 +41,15 @@
30ECD6251B00948A0088C57A /* ICRPatrolPlanCellContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30ECD6231B00948A0088C57A /* ICRPatrolPlanCellContentView.m */; };
30F7F5711ADE723100A9B24E /* ICRAttachmentCellContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F7F5701ADE723100A9B24E /* ICRAttachmentCellContentView.m */; };
30F7F5721ADE723100A9B24E /* ICRAttachmentCellContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F7F5701ADE723100A9B24E /* ICRAttachmentCellContentView.m */; };
351CFF591B90633700F30866 /* GXFFunctionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 351CFF4C1B90633700F30866 /* GXFFunctionsViewController.m */; };
351CFF5A1B90633700F30866 /* ICRHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 351CFF4E1B90633700F30866 /* ICRHomeViewController.m */; };
351CFF5B1B90633700F30866 /* GXFDisplayFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = 351CFF511B90633700F30866 /* GXFDisplayFunction.m */; };
351CFF5C1B90633700F30866 /* GXFFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = 351CFF531B90633700F30866 /* GXFFunction.m */; };
351CFF5D1B90633700F30866 /* GXFFunctionCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 351CFF561B90633700F30866 /* GXFFunctionCollectionViewCell.m */; };
351CFF5E1B90633700F30866 /* GXFNoticeFunctionTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 351CFF581B90633700F30866 /* GXFNoticeFunctionTableViewCell.m */; };
35A1C3551B8EFBBF004AC9F7 /* PermissionJson in Resources */ = {isa = PBXBuildFile; fileRef = 35A1C3541B8EFBBF004AC9F7 /* PermissionJson */; };
35A1C3581B8F09D2004AC9F7 /* GXFFunctionDB.m in Sources */ = {isa = PBXBuildFile; fileRef = 35A1C3571B8F09D2004AC9F7 /* GXFFunctionDB.m */; };
35B9B40E1B8FFB59009851CC /* GXFFunctionDBHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 35B9B40D1B8FFB59009851CC /* GXFFunctionDBHelper.m */; };
35C3C0AC1AE956040035AC8A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35C3C0AB1AE956040035AC8A /* Security.framework */; };
35C3C0AE1AE9560E0035AC8A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35C3C0AD1AE9560E0035AC8A /* CoreGraphics.framework */; };
35C3C0B01AE9561E0035AC8A /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35C3C0AF1AE9561E0035AC8A /* SystemConfiguration.framework */; };
......@@ -238,8 +247,6 @@
C15918541AC062460013B391 /* IBTUINavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = C159183A1AC062460013B391 /* IBTUINavigationController.m */; };
C15918551AC062460013B391 /* IBTUIViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C159183C1AC062460013B391 /* IBTUIViewController.m */; };
C15918561AC062460013B391 /* IBTUIViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C159183C1AC062460013B391 /* IBTUIViewController.m */; };
C15918631AC19FB30013B391 /* ICRHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C15918621AC19FB30013B391 /* ICRHomeViewController.m */; };
C15918641AC19FB30013B391 /* ICRHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C15918621AC19FB30013B391 /* ICRHomeViewController.m */; };
C15918671AC19FCF0013B391 /* ICRStoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C15918661AC19FCF0013B391 /* ICRStoreViewController.m */; };
C15918681AC19FCF0013B391 /* ICRStoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C15918661AC19FCF0013B391 /* ICRStoreViewController.m */; };
C159186B1AC1A03B0013B391 /* ICRSyncViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C159186A1AC1A03B0013B391 /* ICRSyncViewController.m */; };
......@@ -433,6 +440,23 @@
30ECD6231B00948A0088C57A /* ICRPatrolPlanCellContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRPatrolPlanCellContentView.m; sourceTree = "<group>"; };
30F7F56F1ADE723100A9B24E /* ICRAttachmentCellContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRAttachmentCellContentView.h; sourceTree = "<group>"; };
30F7F5701ADE723100A9B24E /* ICRAttachmentCellContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRAttachmentCellContentView.m; sourceTree = "<group>"; };
351CFF4B1B90633700F30866 /* GXFFunctionsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFFunctionsViewController.h; sourceTree = "<group>"; };
351CFF4C1B90633700F30866 /* GXFFunctionsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFFunctionsViewController.m; sourceTree = "<group>"; };
351CFF4D1B90633700F30866 /* ICRHomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRHomeViewController.h; sourceTree = "<group>"; };
351CFF4E1B90633700F30866 /* ICRHomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRHomeViewController.m; sourceTree = "<group>"; };
351CFF501B90633700F30866 /* GXFDisplayFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFDisplayFunction.h; sourceTree = "<group>"; };
351CFF511B90633700F30866 /* GXFDisplayFunction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFDisplayFunction.m; sourceTree = "<group>"; };
351CFF521B90633700F30866 /* GXFFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFFunction.h; sourceTree = "<group>"; };
351CFF531B90633700F30866 /* GXFFunction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFFunction.m; sourceTree = "<group>"; };
351CFF551B90633700F30866 /* GXFFunctionCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFFunctionCollectionViewCell.h; sourceTree = "<group>"; };
351CFF561B90633700F30866 /* GXFFunctionCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFFunctionCollectionViewCell.m; sourceTree = "<group>"; };
351CFF571B90633700F30866 /* GXFNoticeFunctionTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFNoticeFunctionTableViewCell.h; sourceTree = "<group>"; };
351CFF581B90633700F30866 /* GXFNoticeFunctionTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFNoticeFunctionTableViewCell.m; sourceTree = "<group>"; };
35A1C3541B8EFBBF004AC9F7 /* PermissionJson */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PermissionJson; sourceTree = "<group>"; };
35A1C3561B8F09D2004AC9F7 /* GXFFunctionDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFFunctionDB.h; sourceTree = "<group>"; };
35A1C3571B8F09D2004AC9F7 /* GXFFunctionDB.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFFunctionDB.m; sourceTree = "<group>"; };
35B9B40C1B8FFB59009851CC /* GXFFunctionDBHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFFunctionDBHelper.h; sourceTree = "<group>"; };
35B9B40D1B8FFB59009851CC /* GXFFunctionDBHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFFunctionDBHelper.m; sourceTree = "<group>"; };
35C3C0AB1AE956040035AC8A /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
35C3C0AD1AE9560E0035AC8A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
35C3C0AF1AE9561E0035AC8A /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
......@@ -664,8 +688,6 @@
C159183B1AC062460013B391 /* IBTUIViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IBTUIViewController.h; sourceTree = "<group>"; };
C159183C1AC062460013B391 /* IBTUIViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IBTUIViewController.m; sourceTree = "<group>"; };
C15918571AC068110013B391 /* XFFruit-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "XFFruit-Prefix.pch"; sourceTree = "<group>"; };
C15918611AC19FB30013B391 /* ICRHomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRHomeViewController.h; sourceTree = "<group>"; };
C15918621AC19FB30013B391 /* ICRHomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRHomeViewController.m; sourceTree = "<group>"; };
C15918651AC19FCF0013B391 /* ICRStoreViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRStoreViewController.h; sourceTree = "<group>"; };
C15918661AC19FCF0013B391 /* ICRStoreViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRStoreViewController.m; sourceTree = "<group>"; };
C15918691AC1A03B0013B391 /* ICRSyncViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRSyncViewController.h; sourceTree = "<group>"; };
......@@ -879,6 +901,39 @@
name = Business;
sourceTree = "<group>";
};
351CFF4A1B90633700F30866 /* Controllers */ = {
isa = PBXGroup;
children = (
351CFF4B1B90633700F30866 /* GXFFunctionsViewController.h */,
351CFF4C1B90633700F30866 /* GXFFunctionsViewController.m */,
351CFF4D1B90633700F30866 /* ICRHomeViewController.h */,
351CFF4E1B90633700F30866 /* ICRHomeViewController.m */,
);
path = Controllers;
sourceTree = "<group>";
};
351CFF4F1B90633700F30866 /* Models */ = {
isa = PBXGroup;
children = (
351CFF501B90633700F30866 /* GXFDisplayFunction.h */,
351CFF511B90633700F30866 /* GXFDisplayFunction.m */,
351CFF521B90633700F30866 /* GXFFunction.h */,
351CFF531B90633700F30866 /* GXFFunction.m */,
);
path = Models;
sourceTree = "<group>";
};
351CFF541B90633700F30866 /* Views */ = {
isa = PBXGroup;
children = (
351CFF551B90633700F30866 /* GXFFunctionCollectionViewCell.h */,
351CFF561B90633700F30866 /* GXFFunctionCollectionViewCell.m */,
351CFF571B90633700F30866 /* GXFNoticeFunctionTableViewCell.h */,
351CFF581B90633700F30866 /* GXFNoticeFunctionTableViewCell.m */,
);
path = Views;
sourceTree = "<group>";
};
35C3C0BA1AE9587F0035AC8A /* Navigation */ = {
isa = PBXGroup;
children = (
......@@ -1566,8 +1621,9 @@
C159185D1AC078020013B391 /* Home */ = {
isa = PBXGroup;
children = (
C15918611AC19FB30013B391 /* ICRHomeViewController.h */,
C15918621AC19FB30013B391 /* ICRHomeViewController.m */,
351CFF4A1B90633700F30866 /* Controllers */,
351CFF4F1B90633700F30866 /* Models */,
351CFF541B90633700F30866 /* Views */,
C10214E11AD9140C0024637E /* Announcement */,
);
path = Home;
......@@ -1683,6 +1739,10 @@
children = (
C18AEA941AD1425D00A1DB7B /* ICRDataBaseController.h */,
C18AEA951AD1425D00A1DB7B /* ICRDataBaseController.m */,
35A1C3561B8F09D2004AC9F7 /* GXFFunctionDB.h */,
35A1C3571B8F09D2004AC9F7 /* GXFFunctionDB.m */,
35B9B40C1B8FFB59009851CC /* GXFFunctionDBHelper.h */,
35B9B40D1B8FFB59009851CC /* GXFFunctionDBHelper.m */,
);
path = DataBaseController;
sourceTree = "<group>";
......@@ -1825,6 +1885,7 @@
C1F696061AB870B400F9F5DD /* Supporting Files */ = {
isa = PBXGroup;
children = (
35A1C3541B8EFBBF004AC9F7 /* PermissionJson */,
C1F696071AB870B400F9F5DD /* Info.plist */,
C1F696081AB870B400F9F5DD /* main.m */,
C15918571AC068110013B391 /* XFFruit-Prefix.pch */,
......@@ -2012,7 +2073,7 @@
TargetAttributes = {
C1F696021AB870B400F9F5DD = {
CreatedOnToolsVersion = 6.2;
DevelopmentTeam = 3YNA7CJZEF;
DevelopmentTeam = 2G3393EZPN;
};
C1F6961B1AB870B400F9F5DD = {
CreatedOnToolsVersion = 6.2;
......@@ -2045,6 +2106,7 @@
buildActionMask = 2147483647;
files = (
35C3C0BC1AE959B80035AC8A /* ICRNavigationViewController.xib in Resources */,
35A1C3551B8EFBBF004AC9F7 /* PermissionJson in Resources */,
C123A90F1B25CBAD003C0C36 /* half_selected_star.png in Resources */,
C123A9111B25CBAD003C0C36 /* half_selected_star@2x.png in Resources */,
C1F696141AB870B400F9F5DD /* Images.xcassets in Resources */,
......@@ -2112,6 +2174,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
35A1C3581B8F09D2004AC9F7 /* GXFFunctionDB.m in Sources */,
C15918411AC062460013B391 /* IBTTableViewSectionInfo.m in Sources */,
C15918851AC460BC0013B391 /* ICRAppViewControllerManager.m in Sources */,
C10C909B1AE56E8700B911CD /* JTOptionsEntity.m in Sources */,
......@@ -2120,7 +2183,6 @@
C10214DB1AD90A3F0024637E /* ICRFunctionBaseView.m in Sources */,
FE4F17251B72FAAB00924DED /* ChosePersonViewController.m in Sources */,
30D7495F1ACE8F4400C63BA1 /* ICRConfigurationViewController.m in Sources */,
C15918631AC19FB30013B391 /* ICRHomeViewController.m in Sources */,
FE17F6841B85CA5B0078CE96 /* PurchaseNoticeCell.m in Sources */,
FE2FCC821B745E1A00BBC6FB /* SurveyDetailViewController.m in Sources */,
FE2FCC8B1B74A9EE00BBC6FB /* SurveyResultCell.m in Sources */,
......@@ -2148,6 +2210,7 @@
C1B810AF1ADF4D6A00BBC75A /* ICRAttachTitleView.m in Sources */,
C159186F1AC1A0510013B391 /* ICRSystemViewController.m in Sources */,
C142D2C51AC3A16C000109A7 /* ICRBaseViewController.m in Sources */,
351CFF5B1B90633700F30866 /* GXFDisplayFunction.m in Sources */,
FEA2F3001B842A1C00D64735 /* MaterialVIewController.m in Sources */,
C123A91D1B25E3F1003C0C36 /* ICRPatrolResultViewController.m in Sources */,
C1E108651ADAD2F200620375 /* IBTUIScrollView.m in Sources */,
......@@ -2188,6 +2251,7 @@
C1D017281AD8F46700CD9CB8 /* IBTScrollLoadMoreView.m in Sources */,
C18AEA841AC8D2EA00A1DB7B /* IBTUIButton.m in Sources */,
C1FE50521AE024FA00C18080 /* UIAlertView+Blocks.m in Sources */,
351CFF5C1B90633700F30866 /* GXFFunction.m in Sources */,
C1E108691ADADB5500620375 /* IBTCustomButtom.m in Sources */,
C15918131ABE89270013B391 /* ICRLoginViewController.m in Sources */,
C159184F1AC062460013B391 /* IBTTableViewCell.m in Sources */,
......@@ -2205,6 +2269,8 @@
C167F9C11AC8615B00D2A098 /* ICRLoginContentView.m in Sources */,
C142D2BA1AC3A155000109A7 /* UITabBarItem+Universal.m in Sources */,
C1374F561B33C40D00594D19 /* IBTWebProgressBar.m in Sources */,
351CFF5A1B90633700F30866 /* ICRHomeViewController.m in Sources */,
35B9B40E1B8FFB59009851CC /* GXFFunctionDBHelper.m in Sources */,
C1FE50391AE0218100C18080 /* IBTAudioRecorder.m in Sources */,
C1B810AD1ADF4D6A00BBC75A /* ICRAttachmentView.m in Sources */,
C15295C71B2451E900DF60D1 /* ICRQStarViewController.m in Sources */,
......@@ -2294,6 +2360,7 @@
C1E108591ADA53C700620375 /* ICRTaskResultViewController.m in Sources */,
FEAE16EF1B79CAE3009D9E01 /* SingleScrollView.m in Sources */,
C10C909D1AE56E8700B911CD /* JTOptionsViewController.m in Sources */,
351CFF5D1B90633700F30866 /* GXFFunctionCollectionViewCell.m in Sources */,
7281A0B91B897BB20052B1AC /* PurchaseViewController.m in Sources */,
C1C5644F1AD6719B006A1050 /* ICRTaskDetailViewController.m in Sources */,
C1E1085D1ADA577500620375 /* ICRTaskDetailContentView.m in Sources */,
......@@ -2303,11 +2370,13 @@
C1E093041AC8E8E0003B7126 /* ICRCheckBox.m in Sources */,
C1864A561B0B0D9D00D11C4E /* ICRPostTask.m in Sources */,
FE2FCC7F1B74511000BBC6FB /* ChooseProductViewController.m in Sources */,
351CFF5E1B90633700F30866 /* GXFNoticeFunctionTableViewCell.m in Sources */,
FE2FCC881B7492C500BBC6FB /* ResultDetailViewController.m in Sources */,
7281A0B41B8974120052B1AC /* ProductViewController.m in Sources */,
C159183D1AC062460013B391 /* IBTTableViewCellInfo.m in Sources */,
C1FE504E1AE024FA00C18080 /* RIButtonItem.m in Sources */,
C18AEA9A1AD2749200A1DB7B /* ICRStoreListViewController.m in Sources */,
351CFF591B90633700F30866 /* GXFFunctionsViewController.m in Sources */,
7217E9F11B72364300FE5C1D /* SortMaskView.m in Sources */,
7217E9E71B72364300FE5C1D /* Attachment.m in Sources */,
30ECD6241B00948A0088C57A /* ICRPatrolPlanCellContentView.m in Sources */,
......@@ -2333,7 +2402,6 @@
C1374F571B33C40D00594D19 /* IBTWebProgressBar.m in Sources */,
C182E40F1AD4CE0B009BB9DB /* IBTModel.m in Sources */,
C15918861AC460BC0013B391 /* ICRAppViewControllerManager.m in Sources */,
C15918641AC19FB30013B391 /* ICRHomeViewController.m in Sources */,
C1FE50421AE0240300C18080 /* IBTAVAudioPlayWrapper.m in Sources */,
C159184C1AC062460013B391 /* IBTTabBarController.m in Sources */,
C142D2BF1AC3A155000109A7 /* UIView+FindUIViewController.m in Sources */,
......@@ -2585,8 +2653,8 @@
baseConfigurationReference = 1B0B22845F5CD40B5CF655F2 /* Pods.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer: Minglong Hu (TR9LJDJBFT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Minglong Hu (TR9LJDJBFT)";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_PREFIX_HEADER = "XFFruit/XFFruit-Prefix.pch";
INFOPLIST_FILE = XFFruit/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
......@@ -2596,7 +2664,7 @@
"$(PROJECT_DIR)",
);
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "251ce065-a08f-44fd-bd52-f79372f4e47e";
PROVISIONING_PROFILE = "";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Debug;
......@@ -2606,8 +2674,8 @@
baseConfigurationReference = 7DDFB1D460448C3B45118195 /* Pods.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer: Minglong Hu (TR9LJDJBFT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Minglong Hu (TR9LJDJBFT)";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_PREFIX_HEADER = "XFFruit/XFFruit-Prefix.pch";
INFOPLIST_FILE = XFFruit/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
......@@ -2617,7 +2685,7 @@
"$(PROJECT_DIR)",
);
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "251ce065-a08f-44fd-bd52-f79372f4e47e";
PROVISIONING_PROFILE = "";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Release;
......
//
// GXFFunctionDB.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
#import "GXFFunction.h"
#import "GXFDisplayFunction.h"
@interface GXFFunctionDB : IBTObject
+ (GXFFunctionDB *)sharedInstance;
- (void)createTables;
//- (BOOL)functionTableCreate;
- (BOOL)displayFunctionTableCreate;
- (BOOL)insertFunction: (GXFFunction *)function ;
- (GXFFunction *)functionSelectWithId: (NSInteger)Id;
- (BOOL)updateFunctionHasPermissionWithId: (GXFFunction *)function;
- (BOOL)updateFunctionIsSelectedWithId: (GXFFunction *)function;
- (NSArray *)originFunctions;
//返回全部有权限的function
- (NSArray *)functionsHasPermission;
//既有权限又被选择的
- (NSArray *)functionsHasPermissionAndIsSelected;
#pragma displayFunction
- (BOOL)insertDisplayFunction: (GXFDisplayFunction *)displayFunction;
- (BOOL)updateDisplayFunctionIsSelectedWithId: (GXFDisplayFunction *)displayFunction;
-(NSArray *)displayFunctionsHasPermission;
//默认配置显示功能 初始配置为
- (NSArray *)defaultdisplayFunctions;
- (NSArray *)originDisplayFunctions;
- (NSArray *)isSelectedDisplayFunctions;
@end
//
// GXFFunctionDB.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#define DATABASE_PATH [[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject]stringByAppendingString:@"function.db"]
//#define DATABASE_PATH [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]stringByAppendingString:@"/weChat.db"]
//FMDB
//#define FMDBQuickCheck(SomeBool) { if (!(SomeBool)) { NSLog(@"Failure on line %d", __LINE__); abort(); } }
#import "GXFFunctionDB.h"
@interface GXFFunctionDB ()
@property (nonatomic, strong) FMDatabase *dataBase;
@end
@implementation GXFFunctionDB
+ (GXFFunctionDB *)sharedInstance {
static GXFFunctionDB *functionDb = nil;
static dispatch_once_t once;
dispatch_once(&once, ^{
functionDb = [[GXFFunctionDB alloc]init];
});
return functionDb;
}
- (BOOL)openDb {
// NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
NSString *path = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject];
NSString *dbPath = [path stringByAppendingString:@"function.db"];
self.dataBase = [FMDatabase databaseWithPath:dbPath];
CLog(@"dbPath = %@",dbPath);
BOOL isOpen = [_dataBase open];
if (!isOpen) {
NSLog(@"数据库打开失败");
}
return isOpen;
}
- (void)createTables {
if ([self openDb]) {
[self functionTableCreate];
[self displayFunctionTableCreate];
}
}
- (BOOL)functionTableCreate {
// if (![_dataBase open]) {
// [self openDb];
// }
//Id INTEGER NOT NULL PRIMARY KEY UNIQUE CONFLICT REPLACE
NSString *createTableSql = @"CREATE TABLE IF NOT EXISTS function (Id INTEGER PRIMARY KEY NOT NULL UNIQUE ,name VARCHAR,caption VARCHAR,hasPermission INTEGER,isSelected INTEGER) ";//CONFLICT REPLACE
BOOL work = [_dataBase executeUpdate:createTableSql];
return work;
}
- (BOOL)displayFunctionTableCreate {
if (![_dataBase open]) {
[self openDb];
}
NSString *createTableSql = @"CREATE TABLE IF NOT EXISTS displayFunction (Id INTEGER PRIMARY KEY AUTOINCREMENT,functionId INTEGER,functionName VARCHAR ,functionImgName VARCHAR,functionSmallImgName VARCHAR, isSelected INTEGER,functionItemTag INTEGER )";
BOOL work = [_dataBase executeUpdate:createTableSql];
return work;
}
//+(BOOL)checkTableCreatedInDb:(FMDatabase *)db
//{
// NSString *createTableSql = @"CREATE TABLE IF NOT EXISTS function (Id INTEGER PRIMARY KEY NOT NULL UNIQUE ,name VARCHAR,caption VARCHAR,hasPermission INTEGER,isSelected INTEGER) ";//CONFLICT REPLACE
// BOOL worked = [db executeUpdate:createTableSql];
// FMDBQuickCheck(worked);
// return worked;
//}
//插入数据:从最初的json文件读入时 没有任何权限跟所有的功能都没有选中
- (BOOL)insertFunction: (GXFFunction *)function {
// FMDatabase *db = [FMDatabase databaseWithPath:DATABASE_PATH];
// if (![db open]) {
// NSLog(@"数据库打开失败");
// return YES;
// };
// [GXFFunctionDB checkTableCreatedInDb:db];
NSString *inserSql = @"INSERT INTO function (Id,name,caption,hasPermission,isSelected) VALUES(?,?,?,?,?)";
BOOL work = [_dataBase executeUpdate:inserSql,@(function.Id),function.name,function.caption,@(function.hasPermission) ,@(function.isSelected)];//@(120),@"gg",@"fff",@(1),@(1)];
// [db close];
return work;
}
//查找一条数据
- (GXFFunction *)functionSelectWithId: (NSInteger)Id{
GXFFunction *function = [[GXFFunction alloc]init];
FMResultSet *rs = [_dataBase executeQuery:@"SELECT * FROM function WHERE Id = ? ",@(Id)];
while ([rs next]) {
function.Id = [rs intForColumnIndex:0];
function.name = [rs stringForColumnIndex:1];
function.caption = [rs stringForColumnIndex:2];
function.hasPermission = [rs intForColumnIndex:3];
function.isSelected = [rs intForColumnIndex:4];
break;
}
return function;
}
//更新权限
- (BOOL)updateFunctionHasPermissionWithId: (GXFFunction *)function{
//GXFFunction *function = [self functionSelectWithId:Id];
BOOL work = [_dataBase executeUpdate:@"UPDATE function SET hasPermission = ? where Id = ?",@(function.hasPermission),@(function.Id)];
return work;
}
//更新是否选中
- (BOOL)updateFunctionIsSelectedWithId: (GXFFunction *)function{
BOOL work = [_dataBase executeUpdate:@"UPDATE function SET isSelected = ? where Id = ?",function.isSelected,function.Id];
return work;
}
//返回全部原始数据的function
- (NSArray *)originFunctions {
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM function"];
while ([rs next]) {
GXFFunction *function = [[GXFFunction alloc]init];
function.Id = [rs intForColumn:@"Id"];
[muArr addObject:function];
}
return muArr;
}
//返回全部有权限的function
- (NSArray *)functionsHasPermission {
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM function WHERE hasPermission = ?",[NSNumber numberWithBool:1]];
while ([rs next]) {
GXFFunction *function = [[GXFFunction alloc]init];
function.Id = [rs intForColumn:@"Id"];
[muArr addObject:function];
}
return muArr;
}
- (NSArray *)p_functionsIdPermission {
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT Id FROM function WHERE hasPermission = ?",[NSNumber numberWithBool:1]];
while ([rs next]) {
NSInteger Id = [rs intForColumn:@"Id"];
[muArr addObject:@(Id)];
}
return muArr;
}
//既有权限又被选择的
- (NSArray *)functionsHasPermissionAndIsSelected{
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM function WHERE hasPermission = ?,isSelected = ?",[NSNumber numberWithBool:1],[NSNumber numberWithBool:1]];
while ([rs next]) {
GXFFunction *function = [[GXFFunction alloc]init];
function.Id = [rs intForColumn:@"Id"];
[muArr addObject:function];
}
return muArr;
}
- (NSArray *)p_functionsHasPermissionAndIsSelected{
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT Id FROM function WHERE hasPermission = ?,isSelected = ?",[NSNumber numberWithBool:1],[NSNumber numberWithBool:1]];
while ([rs next]) {
NSInteger Id = [rs intForColumn:@"Id"];
[muArr addObject:@(Id)];
}
return muArr;
}
#pragma displayFunction
- (BOOL)insertDisplayFunction: (GXFDisplayFunction *)displayFunction {
NSString *inserSql = @"INSERT INTO displayFunction(functionId,functionName,functionImgName,functionSmallImgName,functionItemTag) VALUES(?,?,?,?,?)";
BOOL work = [_dataBase executeUpdate:inserSql,@(displayFunction.functionId),displayFunction.functionName,displayFunction.functionImgName,displayFunction.functionSmallImgName,@(displayFunction.functionItemTag)];
return work;
}
- (GXFDisplayFunction *)selectDisplayFunctionByFunctionId: (NSInteger)functionId{
GXFDisplayFunction *displayFunction = [[GXFDisplayFunction alloc]init];
FMResultSet *rs = [_dataBase executeQuery:@"SELET * FROM displayFunction WHERE functionId = ? ",@(functionId)];
while ([rs next]) {
displayFunction.functionId = [rs intForColumn:@"functionId"];
displayFunction.functionName = [rs stringForColumn:@"functionName"];
displayFunction.functionImgName = [rs stringForColumn:@"functionImgName"];
displayFunction.functionSmallImgName = [rs stringForColumn:@"functionSmallImgName"];
displayFunction.functionItemTag = [rs intForColumn:@"functionItemTag"];
break;
}
return displayFunction;
}
//更新是否选中
- (BOOL)updateDisplayFunctionIsSelectedWithId: (GXFDisplayFunction *)displayFunction{
BOOL work = [_dataBase executeUpdate:@"UPDATE displayFunction SET isSelected = ? where functionId = ?",@(displayFunction.isSelected),@(displayFunction.functionId)];
return work;
}
#pragma 有权限的displayfunctions
//待改正,最好的办法是两张表关联起来查找但是我还没做到
-(NSArray *)displayFunctionsHasPermission{
NSMutableArray *muArr = [NSMutableArray array];
NSArray *hasPermission = [self p_functionsIdPermission];
for (int count = 0; count < hasPermission.count; count ++) {
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction WHERE functionId = ?",hasPermission[count] ];
while ([rs next]) {
GXFDisplayFunction *displayFunction = [self p_resultSetDisplayFunction:rs];
[muArr addObject:displayFunction];
}
}
return muArr;
}
//默认配置显示功能 初始配置为
- (NSArray *)defaultdisplayFunctions {
NSMutableArray *arr = [NSMutableArray arrayWithArray:[self displayFunctionsHasPermission]];
for (int count = 0; count < arr.count; count ++) {
if ((count % 2) || (count == 0)) {
GXFDisplayFunction *displayFunction = (GXFDisplayFunction *)arr[count];
displayFunction.isSelected = YES;
[self updateDisplayFunctionIsSelectedWithId:displayFunction];
[arr replaceObjectAtIndex:count withObject:displayFunction];
}
}
return arr;
}
//返回全部原始数据的function
- (NSArray *)originDisplayFunctions {
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction"];
while ([rs next]) {
GXFDisplayFunction *displayFunction = [self p_resultSetDisplayFunction:rs];
[muArr addObject:displayFunction];
}
return muArr;
}
- (GXFDisplayFunction *)p_resultSetDisplayFunction: (FMResultSet *)rs {
GXFDisplayFunction *displayFunction = [[GXFDisplayFunction alloc]init];
displayFunction.functionId = [rs intForColumn:@"functionId"];
displayFunction.functionName = [rs stringForColumn:@"functionName"];
displayFunction.functionImgName = [rs stringForColumn:@"functionImgName"];
displayFunction.functionSmallImgName = [rs stringForColumn:@"functionSmallImgName"];
displayFunction.isSelected = [rs intForColumn:@"isSelected"];
displayFunction.functionItemTag = [rs intForColumn:@"functionItemTag"];
return displayFunction;
}
//返回被选中的
- (NSArray *)isSelectedDisplayFunctions {
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction WHERE isSelected = ?",@(1)];
while ([rs next]) {
GXFDisplayFunction *displayFunction = [self p_resultSetDisplayFunction:rs];
[muArr addObject:displayFunction];
}
return muArr;
}
@end
//
// GXFFunctionDBHelper.h
// XFFruit
//
// Created by freecui on 15/8/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFFunctionDBHelper : IBTObject
+ (instancetype)sharedInstance;
- (void)insertAllOriginFunctions;
- (BOOL)successInsertOriginFunctions;
- (void)insertAllOriginDisplayFunctions;
- (BOOL)sucessInsertOriginDisplayFunctions;
@end
//
// GXFFunctionDBHelper.m
// XFFruit
//
// Created by freecui on 15/8/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunctionDBHelper.h"
#import "GXFFunctionDB.h"
@interface GXFFunctionDBHelper ()
//@property (nonatomic, strong)GXFFunctionDB *functionDb;
@end
@implementation GXFFunctionDBHelper
+ (instancetype)sharedInstance{
static GXFFunctionDBHelper *dbHelper = nil;
static dispatch_once_t once;
dispatch_once(&once, ^{
dbHelper = [[GXFFunctionDBHelper alloc]init];
});
return dbHelper;
}
////开启一次就可以了
//- (void)openDb {
// self.functionDb = [GXFFunctionDB sharedInstance];
// [_functionDb functionTableCreate];
// [_functionDb displayFunctionTableCreate];
//}
- (void)insertAllOriginFunctions{
NSArray *functionsArr = [NSArray arrayWithArray:[self p_readJsonFile]];
for (int count = 0; count < functionsArr.count; count ++) {
GXFFunction *function = (GXFFunction *)functionsArr[count];
[[GXFFunctionDB sharedInstance] insertFunction:function];
}
}
//从读出的json文件返回GXFFunction数组
- (NSArray *)p_readJsonFile {
NSMutableArray *muArr = [NSMutableArray array];
//添加公告
GXFFunction *function = [[GXFFunction alloc]init];
function.Id = 000000;
function.name = @"announcement";
function.caption = @"公告";
function.hasPermission = YES;
function.isSelected = NO;
[muArr addObject:function];
NSString *path = [[NSBundle mainBundle] pathForResource:@"PermissionJson" ofType:nil];
NSData *jsonData = [NSData dataWithContentsOfFile:path options:NSDataReadingMappedIfSafe error:nil];
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:jsonData options: NSJSONReadingMutableContainers error:nil];
NSArray *childrenArr = dict[@"children"];
for (int i = 0; i < childrenArr.count; i ++) {
NSArray *permissionsArr = [childrenArr[i] objectForKey:@"permissions"];
for (int j = 0; j < permissionsArr.count; j++) {
NSMutableDictionary *muDict = [NSMutableDictionary dictionaryWithObjects:@[@(0),@(0)] forKeys:@[@"hasPermission",@"isSelected"]];
[muDict addEntriesFromDictionary:permissionsArr[j]];
GXFFunction *function = [[GXFFunction alloc]initWithDictionary:muDict];
[muArr addObject:function];
}
}
return muArr;
}
- (void)insertAllOriginDisplayFunctions{
NSArray *arr = [self p_createAllDisplayFunctions];
for (int count = 0; count < arr.count; count ++) {
GXFDisplayFunction *displayFunction = (GXFDisplayFunction *)arr[count];
[[GXFFunctionDB sharedInstance] insertDisplayFunction:displayFunction];
}
}
- (NSArray *)p_createAllDisplayFunctions{
NSArray *functionsId = @[@(000000),
@(500101),@(500102),@(500103),
@(500201),
@(500301),@(500302),@(500303),//"采购通知",
@(500401),@(500402),@(500403),@(500406),//"采购单"
@(500501),@(500502),@(500503),//"发运单"
@(500601),@(500602),@(500603),//"转运单"
@(500701),@(500702),@(500703),];//加工单
NSArray *functionsName = @[@"公告",
@"新建行情调研",@"查看行情调研", @"查看行情调研",
@"填写行情反馈",
@"新建采购通知",@"查看采购通知", @"查看采购通知",
@"新建采购单",@"查看采购单", @"查看采购单", @"审核采购单【供应商】",
@"新建发运单",@"查看发运单", @"查看发运单",
@"新增加工单",@"查看加工单", @"查看加工单",
@"新建转运单", @"查看转运单", @"查看转运单"];
NSArray *functionsImageName = @[@"notice",
@"create_surver",@"watch_surver", @"watch_surver",
@"create_surver_result",
@"create_needs",@"watch_needs", @"watch_needs",
@"create_purchase",@"watch_purchase", @"watch_purchase", @"review_purchase",
@"create_transport",@"watch_transort", @"watch_transort",
@"create_process",@"watch_process", @"watch_process",
@"新建转运单", @"查看转运单", @"查看转运单"];
//NSArray *functionsSmallImgName = @[];
NSArray *functionItemTag = @[@(0),
@(1),@(2),@(2),
@(3),
@(4),@(5),@(5),//"采购通知",
@(6),@(7),@(7),@(8),//"采购单"
@(9),@(10),@(10),//"发运单"
@(11),@(12),@(12),//"转运单"
@(13),@(14),@(14),];//加工单
if ((functionsId.count != functionsName.count) ||(functionsId.count != functionsImageName.count)||(functionsName.count != functionsImageName.count)) {
NSLog(@"展现功能界面:插入的数据不是一一对应的");
return nil;
}
NSMutableArray *muarr = [NSMutableArray array];
for (int count = 0; count < functionsId.count; count ++) {
GXFDisplayFunction *displayFunction = [[GXFDisplayFunction alloc]init];
displayFunction.functionId = [functionsId[count] integerValue];
displayFunction.functionName = functionsName[count];
displayFunction.functionImgName = functionsImageName[count];
//displayFunction.functionSmallImgName = fu
displayFunction.functionItemTag = [functionItemTag[count] integerValue];
[muarr addObject:displayFunction];
}
return muarr;
}
- (BOOL)successInsertOriginFunctions{
return [[GXFFunctionDB sharedInstance] originFunctions].count > 0 ? YES : NO;
}
- (BOOL)sucessInsertOriginDisplayFunctions {
return [[GXFFunctionDB sharedInstance] originDisplayFunctions].count > 0 ? YES : NO;
}
@end
......@@ -408,6 +408,7 @@ acceptTypeJson:(BOOL)bAcceptJson
userUtil.orgName = dictResult[ @"enterprise_name" ];
userUtil.orgId = dictResult[ @"enterprise_uuid" ];
userUtil.authenticode = dictResult[@"authenticode"];
userUtil.permissions = dictResult[@"permissions"];
[userUtil saveArchive];
if (succ) {
succ( dictResult );
......
......@@ -71,6 +71,7 @@
[baseView addSubview:fControl];
}
}
baseView.height = MODULE_VIEW_HEIGHT * baseView.m_rows;
return baseView;
}
......
......@@ -11,28 +11,32 @@
//@protocol ICRFuctionItemControlDelegate;
typedef NS_ENUM (NSUInteger, ICRFunctionID) {
kFunctionAnnouncement = 0,
kFunctionTaskManagement,
kFunctionPatrolPlan,
kFunctionMyShop,
kFunctionNavigation,
kFunctionComeShopReg,
kFunctionLeaveShopReg,
kFunctionCreatTask,
kFunctionHandleTask,
kFunctionNotice = 0, //公告
kFunctionNewSurvey, //新建行情调研
kFunctionSeeSurvey, //查看行情调研
kFunctionFeeBackSurvey, //填写行情反馈
kFunctionNewPurchaseNotice, //新建采购通知
kFunctionSeePurchaseNotice, //查看采购通知
kFunctionNewPurchase, // 新建采购单
kFunctionSeePurchase, // 查看采购单
kFunctionExaminePurchase, // 审核采购单【供应商】
kFunctionNewShipment, // 新建发运单
kFunctionSeeShipment, // 查看发运单
kFunctionNewProcessing, // 新增加工单
kFunctionSeeProcessing, // 查看加工单
kFunctionNotice,
kFunctionNewSurvey,
kFunctionSeeSurvey,
kFunctionFeeBackSurvey,
kFunctionNewPurchaseNotice,
kFunctionSeePurchaseNotice,
kFunctionNewPurchase,
kFunctionSeePurchase,
kFunctionExaminePurchas,
kFunctionNewShipment,
kFunctionSeeShipment,
kFunctionNewProcessing,
kFunctionAnnouncement ,
kFunctionTaskManagement,
kFunctionPatrolPlan,
kFunctionMyShop,
kFunctionNavigation,
kFunctionComeShopReg,
kFunctionLeaveShopReg,
kFunctionCreatTask,
kFunctionHandleTask
};
@interface ICRFunctionItemControl : UIControl
......
......@@ -11,4 +11,6 @@
#define SetProductTotalPrice @"setProductTotalPrice"
#define KNOTIFICATION_changeIsSelectedFunctions @"KNOTIFICATION_changeIsSelectedFunctions"
#endif
{
"id" : "50",
"name": "前台",
"type" : "mobileModule",
"children": [
{
"id" : "5001",
"name": "行情调研",
"type" : "mobileModule",
"permissions": [
{
"id" : "500101",
"name": "create",
"caption": "新建权"
},
{
"id" : "500102",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500103",
"name": "viewself",
"caption": "本人查看权"
}
]
},
{
"id" : "5002",
"name": "行情反馈",
"type" : "mobileModule",
"permissions": [
{
"id" : "500201",
"name": "create",
"caption": "新建权"
},
{
"id" : "500202",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500203",
"name": "viewself",
"caption": "本人查看权"
}
]
},
{
"id" : "5003",
"name": "采购通知",
"type" : "mobileModule",
"permissions": [
{
"id" : "500301",
"name": "create",
"caption": "新建权"
},
{
"id" : "500302",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500303",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500304",
"name": "accepttask",
"caption": "接受任务权"
},
{
"id" : "500305",
"name": "createpurchasebill",
"caption": "新建采购单权"
},
{
"id" : "500306",
"name": "finish",
"caption": "结束权"
}
]
},
{
"id" : "5004",
"name": "采购单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500401",
"name": "create",
"caption": "新建权"
},
{
"id" : "500402",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500403",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500404",
"name": "viewvendor",
"caption": "供应商查看权"
},
{
"id" : "500405",
"name": "managerapprove",
"caption": "经理审批权"
},
{
"id" : "500406",
"name": "vendorapprove",
"caption": "供应商审批权"
},
{
"id" : "500407",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500408",
"name": "abort",
"caption": "作废权"
}
]
},
{
"id" : "5005",
"name": "发运单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500501",
"name": "create",
"caption": "新建权"
},
{
"id" : "500502",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500503",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500404",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500505",
"name": "abort",
"caption": "作废权"
}
]
},
{
"id" : "5006",
"name": "转运单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500601",
"name": "create",
"caption": "新建权"
},
{
"id" : "500602",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500603",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500604",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500605",
"name": "abort",
"caption": "作废权"
}
]
},
{
"id" : "5007",
"name": "加工单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500701",
"name": "create",
"caption": "新建权"
},
{
"id" : "500702",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500703",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500704",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500705",
"name": "abort",
"caption": "作废权"
}
]
}
]
}
......@@ -13,21 +13,28 @@
// Login Data
@property (copy, nonatomic) NSString *userName;
@property (copy, nonatomic) NSString *password;
@property (copy, nonatomic) NSString *registerCode;
@property (copy, nonatomic) NSString *registerCode; //企业认证码
@property (copy, nonatomic) NSString *token;
@property (copy, nonatomic) NSNumber *bAutoLogin;
@property (copy, nonatomic) NSString *authenticode;
@property (copy, nonatomic) NSString *authenticode;//企业认证码
@property (assign,nonatomic)BOOL needFresh;
// User Data
@property (copy, nonatomic) NSString *displayName;
@property (copy, nonatomic) NSString *userCode;
@property (copy, nonatomic) NSString *orgCode;
@property (copy, nonatomic) NSString *orgName;
@property (copy, nonatomic) NSString *userId;
@property (copy, nonatomic) NSString *orgId;
@property (copy, nonatomic) NSString *currentStoreID;
@property (copy, nonatomic) NSString *uniqueID;
@property (copy, nonatomic) NSString *userId; // 唯一标识
@property (copy, nonatomic) NSString *displayName; //用户名称
@property (copy, nonatomic) NSString *userCode; // 用户代码
@property (copy, nonatomic) NSString *orgCode; // 企业代码
@property (copy, nonatomic) NSString *orgName; // 企业名称
@property (copy, nonatomic) NSString *orgId; // 唯一标识
@property (strong, nonatomic) NSArray *permissions; //权限列表
@property (copy, nonatomic) NSString *currentStoreID; //
@property (copy, nonatomic) NSString *uniqueID; //
+ (instancetype)sharedInstance;
......
......@@ -78,7 +78,7 @@
//新建采购单
@(kFunctionSeePurchase),
//查看采购单
@(kFunctionExaminePurchas),
@(kFunctionExaminePurchase),
//审核采购单
@(kFunctionNewShipment),
//新建发运单
......@@ -172,28 +172,28 @@
break;
case kFunctionTaskManagement://任务管理
{
ICRTaskListViewController *tVC = [[ICRTaskListViewController alloc] init];
[self PushViewController:tVC animated:YES];
}
break;
case kFunctionPatrolPlan://巡店计划
{
ICRPatrolPlanViewController *pVC = [[ICRPatrolPlanViewController alloc] initWithStore:nil isHomeShow:YES];
[self PushViewController:pVC animated:YES];
}
break;
case kFunctionMyShop://我的店铺
{
// ICRStoreListViewController *sVC = [[ICRStoreListViewController alloc] initWithBHaveToChooseOne:NO];
// sVC.title = [IBTCommon localizableString:@"MyStore"];
// sVC.m_delegate = self;
// [self PushViewController:sVC animated:YES];
AddWorkSheetViewController *sVC = [[AddWorkSheetViewController alloc] init];
[self PushViewController:sVC animated:YES];
}
break;
// case kFunctionTaskManagement://任务管理
// {
// ICRTaskListViewController *tVC = [[ICRTaskListViewController alloc] init];
// [self PushViewController:tVC animated:YES];
// }
// break;
// case kFunctionPatrolPlan://巡店计划
// {
// ICRPatrolPlanViewController *pVC = [[ICRPatrolPlanViewController alloc] initWithStore:nil isHomeShow:YES];
// [self PushViewController:pVC animated:YES];
// }
// break;
// case kFunctionMyShop://我的店铺
// {
// // ICRStoreListViewController *sVC = [[ICRStoreListViewController alloc] initWithBHaveToChooseOne:NO];
// // sVC.title = [IBTCommon localizableString:@"MyStore"];
// // sVC.m_delegate = self;
// // [self PushViewController:sVC animated:YES];
// AddWorkSheetViewController *sVC = [[AddWorkSheetViewController alloc] init];
// [self PushViewController:sVC animated:YES];
// }
// break;
default:
return;
......
//
// GXFFunctionsViewController.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTUIViewController.h"
@interface GXFFunctionsViewController : IBTUIViewController
@end
//
// GXFFunctionsViewController.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunctionsViewController.h"
#import "GXFDisplayFunction.h"
#import "GXFFunction.h"
#import "GXFFunctionDBHelper.h"
#import "GXFFunctionDB.h"
@interface GXFFunctionsViewController ()<UITableViewDataSource,UITableViewDelegate>
//@property (nonatomic, strong) NSArray *
@property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) NSArray *firstSectionArr;
@property (nonatomic, strong) NSArray *secondSectionArr;
@end
@implementation GXFFunctionsViewController
static NSString *cellID = @"cell";
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initData];
[self setupSubViews];
}
- (void)initData {
NSUserDefaults *f_default = [NSUserDefaults standardUserDefaults];
BOOL noDefault = [[f_default objectForKey:@"noDefault"] integerValue] > 0 ? YES : NO;
if (!noDefault) {
self.secondSectionArr = [[GXFFunctionDB sharedInstance]defaultdisplayFunctions];
} else {
self.secondSectionArr = [[GXFFunctionDB sharedInstance]originDisplayFunctions];
}
NSDictionary *dictOne = @{@"Id":@(1),@"functionName":@"新建行情反馈",@"imgName":@"RefreshBtn",@"isSelected":@(0)};
NSDictionary *dictTwo = @{@"Id":@(2),@"functionName":@"查询行情反馈",@"imgName":@"RefreshBtn",@"isSelected":@(1)};
GXFDisplayFunction *dFuntionOne = [[GXFDisplayFunction alloc]initWithDictionary:dictOne];
GXFDisplayFunction *dFuntionTwo =[[GXFDisplayFunction alloc]initWithDictionary:dictTwo];
self.firstSectionArr = @[dFuntionOne,dFuntionTwo];
//@[dFuntionOne,dFuntionTwo];
}
- (void)setupSubViews {
[self setupRightBarBtn];
[self setupTableView];
}
- (void)setupRightBarBtn {
UIBarButtonItem *rightBarBtn = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(selectedFunctions)];
self.navigationItem.rightBarButtonItem = rightBarBtn;
}
- (void)setupTableView {
self.f_tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped];
self.f_tableView.dataSource = self;
self.f_tableView.delegate = self;
//[self.f_tableView dequeueReusableCellWithIdentifier ]
[self.view addSubview:_f_tableView];
[_f_tableView reloadData];
}
#pragma BarButton Action
- (void)selectedFunctions {
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_changeIsSelectedFunctions object:nil];
//配置功能 不是默认配置
NSUserDefaults *f_default = [NSUserDefaults standardUserDefaults];
BOOL noDefault = [[f_default objectForKey:@"noDefault"] integerValue] > 0 ? YES : NO;
if (!noDefault) {
[f_default setObject:@(1) forKey:@"noDefault"];
}
[self PopViewControllerAnimated:YES];
}
#pragma UITablewViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return _firstSectionArr.count;
} else {
return _secondSectionArr.count;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//TableViewCell重用机制避免重复显示问题 它的子视图全部删除
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
} else {
while ([cell.contentView.subviews lastObject] != nil) {
[(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview];
}
}
[self p_contentToTableViewCell:cell ForRowAtIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *sectionTitle = [NSString string];
switch (indexPath.section) {
case 0:
{
sectionTitle = @"提示选择";
}
break;
case 1:
{
sectionTitle = @"功能选择";
}
break;
}
return sectionTitle;
}
#pragma UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
switch (indexPath.section) {
case 0:
{
}
break;
case 1:
{
GXFDisplayFunction *displayFunction = (GXFDisplayFunction *)_secondSectionArr[indexPath.row];
UITableViewCell *cell = [_f_tableView cellForRowAtIndexPath:indexPath];
if (cell.accessoryType == UITableViewCellAccessoryNone) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
displayFunction.isSelected = YES;
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
displayFunction.isSelected = NO;
}
[[GXFFunctionDB sharedInstance] updateDisplayFunctionIsSelectedWithId:displayFunction];
}
break;
}
}
#pragma 给cell的内容赋值
- (void)p_contentToTableViewCell: (UITableViewCell *)cell ForRowAtIndexPath:(NSIndexPath *)indexPath {
switch (indexPath.section) {
case 0:
{
GXFDisplayFunction *dFunction = (GXFDisplayFunction *)_firstSectionArr[indexPath.row];
cell.imageView.image = [UIImage imageNamed:@"RefreshBtn"];//dFunction.functionImgName];
cell.textLabel.text = dFunction.functionName;
}
break;
case 1:
{
GXFDisplayFunction *dFunction = (GXFDisplayFunction *)_secondSectionArr[indexPath.row];
cell.imageView.image = [UIImage imageNamed:@"RefreshBtn"];//dFunction.functionImgName];
cell.textLabel.text = dFunction.functionName;
if (dFunction.isSelected) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
}
}
break;
default:
break;
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
//
// ICRHomeViewController.m
// XFFruit
//
// Created by Xummer on 3/24/15.
// Copyright (c) 2015 Xummer. All rights reserved.
//
#define M_HEAD_IMG_VIEW_HEIGHT (190)
#define M_HEAD_VIEW_TITLE_LABEL_HEIGHT (30)
#define M_HEAD_IMG_HEIGHT_WIDTH_PROPORTION 190.0f/320.0f
#import "ICRHomeViewController.h"
#import "ICRFunctionBaseView.h"
#import "ICRFunctionEntity.h"
#import "NewSurveyViewController.h"
#import "SurveyViewController.h"
#import "AddWorkSheetViewController.h"
#import "NewPurchaseViewController.h"
#import "NewPurchaseNoticeViewController.h"
#import "SeePurchaseNoticeViewController.h"
#import "NewPurchaseViewController.h"
#import "PurchaseViewController.h"
#import "GXFFunctionsViewController.h"
#import "GXFDisplayFunction.h"
#import "GXFFunction.h"
#import "GXFNoticeFunctionTableViewCell.h"
#import "GXFFunctionCollectionViewCell.h"
#import "GXFFunctionDB.h"
#define ICRFUNCTION_IMG_TOP_PADDING (25)
#define ICRFUNCTION_IMG_WIDTH (65)
#define ICRFUNCTION_LABEL_HEIGHT (15)
#define ICRFUNCTION_INNER_GAP (5)
#define RIGHT_LINE_WIDTH (0.5)
@interface ICRHomeViewController ()
<UITableViewDataSource,UITableViewDelegate,UICollectionViewDataSource,UICollectionViewDelegate,ICRFunctionBaseViewDelegate>//,UICollectionViewDelegateFlowLayout>
@property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) NSArray *firstSectionArr;
@property (nonatomic, strong) NSMutableArray *secondSectionArr;
@property (nonatomic, strong) ICRFunctionBaseView *f_functionBaseView;
@property (nonatomic, strong) UICollectionView *f_collectionView;
@end
@implementation ICRHomeViewController
static NSString *cellID = @"cell";
static NSString *collectionCellID = @"collectionCell";
//static CGFloat colletionCellHeight [UIScreen mainScreen].bounds.size.width / 3.0
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initData];
[self setupSubviews];
}
- (void)viewWillAppear:(BOOL)animated {
}
- (void)setupSubviews {
[self setupRightBarBtn];
[self setupTableView];
// [self setupColletionView];
[self setupFunctionBaseView];
}
- (void)initData {
NSDictionary *dictOne = @{@"Id":@(1),@"functionName":@"新建行情反馈",@"imgName":@"RefreshBtn",@"isSelected":@(0)};
NSDictionary *dictTwo = @{@"Id":@(2),@"functionName":@"查询行情反馈",@"imgName":@"RefreshBtn",@"isSelected":@(1)};
GXFDisplayFunction *dFuntionOne = [[GXFDisplayFunction alloc]initWithDictionary:dictOne];
GXFDisplayFunction *dFuntionTwo = [[GXFDisplayFunction alloc]initWithDictionary:dictTwo];
self.firstSectionArr = @[dFuntionOne,dFuntionTwo];
self.secondSectionArr = [NSMutableArray array];
[self.secondSectionArr addObjectsFromArray:[[GXFFunctionDB sharedInstance]isSelectedDisplayFunctions]];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeSecondSectionArr) name:KNOTIFICATION_changeIsSelectedFunctions object:nil];
}
- (void) setupRightBarBtn {
UIBarButtonItem *rightBarBtn = [[UIBarButtonItem alloc]initWithTitle:@"自定义功能" style:UIBarButtonItemStylePlain target:self action:@selector(defineFunctions)];
self.navigationItem.rightBarButtonItem = rightBarBtn;
}
- (void)setupTableView {
self.f_tableView = [[UITableView alloc]initWithFrame:(CGRect){
.origin.x = 0,
.origin.y =0,
.size.width = self.view.width,
.size.height = self.view.height - 80}
style:UITableViewStyleGrouped];
self.f_tableView.dataSource = self;
self.f_tableView.delegate = self;
[self.view addSubview:_f_tableView];
}
- (void)setupColletionView {
UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc]init];
[flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
// [flowLayout setItemSize:CGSizeMake(MODULE_VIEW_WIDTH, MODULE_VIEW_WIDTH)];
self.f_collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, 600) collectionViewLayout:flowLayout];
//self.f_collectionView.collectionViewLayout = flowLayout;
[self.f_collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:collectionCellID];
_f_collectionView.backgroundColor = [UIColor whiteColor];
self.f_collectionView.dataSource = self;
self.f_collectionView.delegate = self;
}
- (void)setupFunctionBaseView {
NSMutableArray *funtionEntitlesArr = [NSMutableArray array];
for (GXFDisplayFunction *displayFunction in _secondSectionArr) {
ICRFunctionEntity *functionEntity = [[ICRFunctionEntity alloc]init];
functionEntity.functionName = displayFunction.functionName;
functionEntity.iconName = displayFunction.functionImgName;
functionEntity.functionItemTag = displayFunction.functionItemTag;
[funtionEntitlesArr addObject:functionEntity];
}
self.f_functionBaseView = [ICRFunctionBaseView initWithFunctionData:funtionEntitlesArr];
_f_functionBaseView.frame = (CGRect){
.origin.x = 0,
.origin.y =0,
.size.width = CGRectGetWidth(self.view.frame),
.size.height = _f_functionBaseView.height};//CGRectGetHeight(self.view.frame),};
_f_functionBaseView.backgroundColor = [UIColor clearColor];
_f_functionBaseView.m_delegate = self;
}
#pragma Notification
- (void)changeSecondSectionArr {
if (_secondSectionArr.count ) {
[_secondSectionArr removeAllObjects];
[self.secondSectionArr addObjectsFromArray:[[GXFFunctionDB sharedInstance]isSelectedDisplayFunctions]];
}
if (_f_functionBaseView) {
[_f_functionBaseView removeFromSuperview];
_f_functionBaseView = nil;
[self setupFunctionBaseView];
}
[_f_tableView reloadData];
}
#pragma rightBarButton Action
- (void)defineFunctions {
GXFFunctionsViewController *functionsVc = [[GXFFunctionsViewController alloc]init];
[self PushViewController:functionsVc animated:YES];
}
#pragma UITablewViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return _firstSectionArr.count;
} else {
return 1;
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 1) {
return _f_functionBaseView.height ;
} else {
return 44;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
if (indexPath.section == 0) {
cell = [[GXFNoticeFunctionTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.text = @"查看行情反馈-进行中";
} else {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"secondCell"];
[cell.contentView addSubview:_f_functionBaseView];
NSLog(@"%@",NSStringFromCGRect(cell.frame));
}
}
return cell;
}
#pragma UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
}
#pragma ICRFunctionBaseViewDelegate
- (void)ICRFunctionBaseView:(ICRFunctionItemControl *)imageView {
switch (imageView.tag) {
case kFunctionNotice://公告
{
// ICRAnnouncementViewController *aVC = [[ICRAnnouncementViewController alloc] init];
// [self PushViewController:aVC animated:YES];
}
break;
case kFunctionNewSurvey://新建行情
{
NewSurveyViewController *svc = [[NewSurveyViewController alloc] init];
svc.title = [IBTCommon localizableString:@"AddSurvey"];
[self PushViewController:svc animated:YES];
}
break;
case kFunctionSeeSurvey://查看行情
{
SurveyViewController *svc = [[SurveyViewController alloc] init];
svc.title = [IBTCommon localizableString:@"Survey"];
svc.navigationItem.hidesBackButton = YES;
[self PushViewController:svc animated:YES];
}
break;
case kFunctionNewPurchaseNotice://新建采购通知单
{
NewPurchaseNoticeViewController *svc = [[NewPurchaseNoticeViewController alloc] init];
svc.title = [IBTCommon localizableString:@"Survey2"];
[self PushViewController:svc animated:YES];
}
break;
case kFunctionSeePurchaseNotice://查看采购通知单
{
SeePurchaseNoticeViewController *svc =
[[SeePurchaseNoticeViewController alloc] init];
svc.title = [IBTCommon localizableString:@"Survey3"];
[self PushViewController:svc animated:YES];
}
break;
case kFunctionNewPurchase://新建采购单
{
NewPurchaseViewController *nvc = [[NewPurchaseViewController alloc]init];
nvc.title = @"新建采购单";
[self PushViewController:nvc animated:YES];
}
break;
case kFunctionSeePurchase:{
PurchaseViewController *pvc = [[PurchaseViewController alloc]init];
pvc.title = @"采购单";
[self PushViewController:pvc animated:YES];
}
break;
default:
return;
break;
}
}
//UICollectionView
//#pragma 给cell的内容赋值
//- (void)p_contentToTableViewCell: (UITableViewCell *)cell andArray: (NSArray *)array {
// for (int count = 0; count < array.count; count ++) {
// GXFDisplayFunction *dFunction = (GXFDisplayFunction *)array[count];
// cell.imageView.image = [UIImage imageNamed:dFunction.functionSmallImgName];
// cell.textLabel.text = dFunction.functionName;
// }
//}
#pragma UICollectionViewDataSource,UICollectionViewDelegate
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return 6;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *collectionCell = [collectionView dequeueReusableCellWithReuseIdentifier:collectionCellID forIndexPath:indexPath];
UIImageView *functionImg =[[UIImageView alloc]initWithFrame:(CGRect){
.origin.x = (CGRectGetWidth(collectionCell.frame) - ICRFUNCTION_IMG_WIDTH)/2,
.origin.y = ICRFUNCTION_IMG_TOP_PADDING,
.size.width = ICRFUNCTION_IMG_WIDTH,
.size.height = ICRFUNCTION_IMG_WIDTH
}];
functionImg.image = [UIImage imageNamed:@"create_purchase"];
[collectionCell.contentView addSubview:functionImg];
UILabel *lbl = [[UILabel alloc]initWithFrame:(CGRect){
.origin.x = 0,
.origin.y = CGRectGetMaxY(functionImg.frame) + ICRFUNCTION_INNER_GAP,
.size.width = collectionCell.width,
.size.height = ICRFUNCTION_LABEL_HEIGHT
}];
lbl.textAlignment = NSTextAlignmentCenter;
lbl.tintColor = [UIColor blackColor];
lbl.text = @"kkk";
[collectionCell.contentView addSubview:lbl];
//collectionCell.backgroundColor = [UIColor yellowColor];
return collectionCell;
}
//UICollectionViewDelegateFlowLayout是UICollectionViewDelegate的子协议
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
CGFloat width = self.view.width / 3.0;
return CGSizeMake((self.view.width - 30) / 3.0,width);
}
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{
//top, CGFloat left, CGFloat bottom, CGFloat right
return UIEdgeInsetsMake(0, 5, 0, 5);
}
@end
//
// ICRHomeViewController.m
// XFFruit
//
// Created by Xummer on 3/24/15.
// Copyright (c) 2015 Xummer. All rights reserved.
//
#define M_HEAD_IMG_VIEW_HEIGHT (190)
#define M_HEAD_VIEW_TITLE_LABEL_HEIGHT (30)
#define M_HEAD_IMG_HEIGHT_WIDTH_PROPORTION 190.0f/320.0f
#import "ICRHomeViewController.h"
#import "ICRTaskListViewController.h"
#import "ICRPatrolPlanViewController.h"
#import "ICRStoreListViewController.h"
#import "ICRStoreDetailViewController.h"
#import "ICRAnnouncementViewController.h"
#import "ICRFunctionBaseView.h"
#import "ICRFunctionEntity.h"
#import "ICRFunctionBaseView.h"
#import "NewSurveyViewController.h"
#import "SurveyViewController.h"
#import "AddWorkSheetViewController.h"
#import "NewPurchaseViewController.h"
@interface ICRHomeViewController ()
<
ICRFunctionBaseViewDelegate,
ICRStoreListViewDelegate
>
@property (strong, nonatomic) UIImageView *m_headImageView;
@property (strong, nonatomic) UILabel *m_headViewTextLabel;
@end
@implementation ICRHomeViewController
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self setupSubviews];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Private Method
- (void)setupSubviews {
self.m_headImageView = [[UIImageView alloc] initWithFrame:(CGRect){
.origin.x = 0,
.origin.y = 0,
.size.width = self.view.width,
.size.height = self.view.width * M_HEAD_IMG_HEIGHT_WIDTH_PROPORTION
}];
_m_headImageView.image = [UIImage imageNamed:@"HomeDisplayImage"];
self.m_headViewTextLabel = [[UILabel alloc] initWithFrame:(CGRect){
.origin.x = 0,
.origin.y = CGRectGetHeight(self.m_headImageView.frame) - M_HEAD_VIEW_TITLE_LABEL_HEIGHT,
.size.width = CGRectGetWidth(self.m_headImageView.frame),
.size.height = M_HEAD_VIEW_TITLE_LABEL_HEIGHT
}];
_m_headViewTextLabel.backgroundColor = [UIColor colorWithRed:0.310f green:0.345f blue:0.392f alpha:0.5f];
_m_headViewTextLabel.textColor = [UIColor whiteColor];
_m_headViewTextLabel.font = [UIFont systemFontOfSize:13];
_m_headViewTextLabel.textAlignment = NSTextAlignmentCenter;
// _m_headViewTextLabel.text = @"我是文字我是文字我是文字我是文字";
[_m_headImageView addSubview:_m_headViewTextLabel];
[self.view addSubview:_m_headImageView];
NSMutableArray *arrFunctionEntities = [NSMutableArray array];
NSArray *functionImageNames = @[ @"AnnouncementIcon",@"TaskManageIcon",@"PatrolPlanIcon",@"MyStoreIcon",@"MyStoreIcon",@"MyStoreIcon"];
NSArray *fuctionNames = @[ [IBTCommon localizableString:@"Announcement"],
[IBTCommon localizableString:@"TaskManage"],
[IBTCommon localizableString:@"PatrolPlan"],
[IBTCommon localizableString:@"MyStore"],
[IBTCommon localizableString:@"Survey"],[IBTCommon localizableString:@"AddSurvey"]];
NSArray *functionTags = @[ @(kFunctionAnnouncement),
@(kFunctionTaskManagement),
@(kFunctionPatrolPlan),
@(kFunctionMyShop),
@(kFunctionNavigation),
@(kFunctionComeShopReg)];
int i = 0;
for (NSString *functionName in fuctionNames) {
ICRFunctionEntity *funtionEntity = [[ICRFunctionEntity alloc] init];
funtionEntity.functionName = functionName;
funtionEntity.iconName = [functionImageNames objectAtIndex:i];
funtionEntity.functionItemTag = [[functionTags objectAtIndex:i] integerValue];
[arrFunctionEntities addObject:funtionEntity];
i ++;
}
ICRFunctionBaseView *baseView = [ICRFunctionBaseView initWithFunctionData:arrFunctionEntities];
baseView.frame = (CGRect){
.origin.x = 0,
.origin.y = CGRectGetMaxY(_m_headImageView.frame),
.size.width = CGRectGetWidth(self.view.frame),
.size.height = CGRectGetHeight(self.view.frame) - CGRectGetHeight(_m_headImageView.frame)
};
baseView.backgroundColor = [UIColor clearColor];
baseView.m_delegate = self;
[self.view addSubview:baseView];
}
#pragma mark - ICRFunctionBaseViewDelegate
- (void)ICRFunctionBaseView:(ICRFunctionItemControl *)imageView {
/*
kFunctionAnnouncement = 0,
kFunctionTaskManagement,
kFunctionPatrolPlan,
kFunctionMyShop,
*/
switch (imageView.tag) {
case kFunctionAnnouncement:
{
ICRAnnouncementViewController *aVC = [[ICRAnnouncementViewController alloc] init];
[self PushViewController:aVC animated:YES];
}
break;
case kFunctionTaskManagement:
{
ICRTaskListViewController *tVC = [[ICRTaskListViewController alloc] init];
[self PushViewController:tVC animated:YES];
}
break;
case kFunctionPatrolPlan:
{
ICRPatrolPlanViewController *pVC = [[ICRPatrolPlanViewController alloc] initWithStore:nil isHomeShow:YES];
[self PushViewController:pVC animated:YES];
}
break;
case kFunctionMyShop:
{
// ICRStoreListViewController *sVC = [[ICRStoreListViewController alloc] initWithBHaveToChooseOne:NO];
// sVC.title = [IBTCommon localizableString:@"MyStore"];
// sVC.m_delegate = self;
// [self PushViewController:sVC animated:YES];
// AddWorkSheetViewController *sVC = [[AddWorkSheetViewController alloc] init];
NewPurchaseViewController *sVC = [[NewPurchaseViewController alloc] init];
[self PushViewController:sVC animated:YES];
}
break;
case kFunctionNavigation:
{
SurveyViewController *svc = [[SurveyViewController alloc] init];
svc.title = [IBTCommon localizableString:@"Survey"];
[self PushViewController:svc animated:YES];
}
break;
case kFunctionComeShopReg:
{
NewSurveyViewController *svc = [[NewSurveyViewController alloc] init];
svc.title = [IBTCommon localizableString:@"AddSurvey"];
[self PushViewController:svc animated:YES];
}
break;
default:
break;
}
}
#pragma mark - ICRStoreListViewDelegate
- (void)storeListViewCtrl:(ICRStoreListViewController *)vCtrl didSelectedStore:(ICRStore *)store {
ICRStoreDetailViewController *dVC = [[ICRStoreDetailViewController alloc] initWithStoreData:store];
[vCtrl PushViewController:dVC animated:YES];
}
@end
//
// GXFDisplayActions.h
// XFFruit
// 显示有已有权限功能的信息
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFDisplayFunction : IBTObject
@property (nonatomic, assign) NSInteger Id; //
@property (nonatomic, assign) NSInteger functionId;
@property (nonatomic, copy) NSString *functionName; //
@property (nonatomic, copy) NSString *functionImgName; //
@property (nonatomic, copy) NSString *functionSmallImgName;
@property (nonatomic, assign) BOOL isSelected; //选中
@property (nonatomic, assign) NSInteger functionItemTag;
+ (instancetype)initClassWithDictionary: (NSDictionary *)dict;
- (instancetype)initWithDictionary: (NSDictionary *)dict;
@end
//
// GXFDisplayActions.m
// XFFruit
// 显示有已有权限功能的信息
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFDisplayFunction.h"
@implementation GXFDisplayFunction
+ (instancetype)initClassWithDictionary:(NSDictionary *)dict {
return [self initClassWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (!self) {
return nil;
} else {
self.Id = [dict[@"id"] integerValue];
self.functionName = dict[@"functionName"];
self.functionImgName = dict[@"imgName"];
self.isSelected = [dict[@"isSelected"] integerValue];
// [self setValuesForKeysWithDictionary:dict];
}
return self;
}
@end
//
// GXFActions.h
// XFFruit
// 后台返回的json权限文件的内容:选择权限和是否选择
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFFunction : IBTObject
@property (nonatomic, assign) NSInteger Id;
@property (nonatomic, copy) NSString *name; //权限
@property (nonatomic, copy) NSString *caption; //权限的名称
@property (nonatomic, assign) BOOL hasPermission;
@property (nonatomic, assign) BOOL isSelected;
//@property (nonatomic, assign) BOOL isPublic; 是否公共部分功能
+ (instancetype)initClassWithDictionary: (NSDictionary *)dict;
- (instancetype)initWithDictionary: (NSDictionary *)dict;
@end
//
// GXFActions.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunction.h"
@implementation GXFFunction
+ (instancetype)initClassWithDictionary:(NSDictionary *)dict {
return [self initClassWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (!self) {
return nil;
} else {
self.Id = [dict[@"id"] integerValue];
self.name = dict[@"name"];
self.caption = dict[@"caption"];
self.hasPermission = [dict[@"hasPermission"] integerValue];
self.isSelected = [dict[@"isSelected"] integerValue];
// [self setValuesForKeysWithDictionary:dict];
return self;
}
}
@end
//
// GXFNoticeCollectionViewCell.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#define ICRFUNCTION_IMG_TOP_PADDING (25)
#define ICRFUNCTION_IMG_WIDTH (65)
#define ICRFUNCTION_LABEL_HEIGHT (15)
#define ICRFUNCTION_INNER_GAP (7)
#define RIGHT_LINE_WIDTH (0.5)
@interface GXFFunctionCollectionViewCell : UICollectionViewCell
@property (nonatomic, strong, readonly) UIImageView *functionImage;
@property (nonatomic, strong, readonly) UILabel *functionNameLabel;
@end
//
// GXFNoticeCollectionViewCell.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunctionCollectionViewCell.h"
@implementation GXFFunctionCollectionViewCell
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
_functionImage = [[UIImageView alloc]initWithFrame:CGRectMake((CGRectGetWidth(self.frame) - ICRFUNCTION_IMG_WIDTH)/2, ICRFUNCTION_IMG_TOP_PADDING, ICRFUNCTION_IMG_WIDTH, ICRFUNCTION_IMG_WIDTH)];
_functionImage.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:_functionImage];
_functionNameLabel = [[UILabel alloc] init];
CGSize labelSize = CGSizeMake(CGRectGetWidth(self.frame), ICRFUNCTION_LABEL_HEIGHT);
labelSize = [_functionNameLabel sizeThatFits:labelSize];
_functionNameLabel.frame = (CGRect){
.origin.x = (CGRectGetWidth(self.frame) - labelSize.width)/2,
.origin.y = CGRectGetMaxY(_functionImage.frame) + ICRFUNCTION_INNER_GAP,
.size.width = labelSize.width,
.size.height = ICRFUNCTION_LABEL_HEIGHT
};
_functionNameLabel.textColor = [UIColor colorWithRed:0.596f green:0.596f blue:0.596f alpha:1.00f];
_functionNameLabel.textAlignment = NSTextAlignmentCenter;
_functionNameLabel.font = [UIFont systemFontOfSize:13];
[self.contentView addSubview:_functionNameLabel];
self.backgroundColor = [UIColor whiteColor];
return self;
}
@end
//
// GXFNoticeFunctionTableViewCell.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFNoticeFunctionTableViewCell : UITableViewCell
@property (nonatomic, strong, readonly) UIImageView *functionImg;
@property (nonatomic, strong, readonly) UILabel *noticeLabel;
@property (nonatomic, strong, readonly) UILabel *unReadLabel;
@end
//
// GXFNoticeFunctionTableViewCell.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFNoticeFunctionTableViewCell.h"
@implementation GXFNoticeFunctionTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
_functionImg = [[UIImageView alloc]initWithFrame:CGRectMake(20.f, 10.f, 45.f, 45.f)];
_functionImg.image = [UIImage imageNamed:@""];
[self.contentView addSubview:_functionImg];
_unReadLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.width - 60.f,(self.height - 20.0f)/2.0 , 25.0f, 20.0f)];
_unReadLabel.backgroundColor = [UIColor redColor];
_unReadLabel.textColor = [UIColor whiteColor];
_unReadLabel.font = [UIFont systemFontOfSize:13];
_unReadLabel.layer.cornerRadius =10;
_unReadLabel.layer.masksToBounds = YES;
[self.contentView addSubview:_unReadLabel];
_noticeLabel = [[UILabel alloc] initWithFrame:CGRectMake(_functionImg.right ,_functionImg.x,self.width - _functionImg.right - 40,self.height)];
_noticeLabel.font = [UIFont systemFontOfSize:13.0f];
[_noticeLabel setTextAlignment:NSTextAlignmentRight];
_noticeLabel.textColor = [UIColor blackColor];
[self.contentView addSubview:_noticeLabel];
}
return self;
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -9,6 +9,9 @@
#import "ICRLoginViewController.h"
#import "ICRLoginContentView.h"
#import "GXFFunctionDB.h"
#import "GXFFunctionDBHelper.h"
#define LOGIN_CONTAINER_LEFT_MARGIN (20)
#define LOGIN_CONTAINER_HEIGHT (450)
......@@ -134,8 +137,38 @@
ICRAppViewControllerManager *mgr =
[ICRAppViewControllerManager getAppViewControllerManager];
[mgr openMainFrame];
#pragma 可以开新线程 ,待优化
//当登陆成功时就建立功能数据表
[[GXFFunctionDB sharedInstance]createTables];
//完成对初始化数据书库的操作
if (![[GXFFunctionDBHelper sharedInstance] successInsertOriginFunctions]) {
[[GXFFunctionDBHelper sharedInstance] insertAllOriginFunctions];
}
if (![[GXFFunctionDBHelper sharedInstance] sucessInsertOriginDisplayFunctions]) {
[[GXFFunctionDBHelper sharedInstance] insertAllOriginDisplayFunctions];
}
//更改功能权限
for (int count = 0; count < userUtil.permissions.count; count ++) {
GXFFunction *function = [[GXFFunctionDB sharedInstance]functionSelectWithId:[userUtil.permissions[count] integerValue]];
if (function.Id) {
function.hasPermission = 1;
[[GXFFunctionDB sharedInstance] updateFunctionHasPermissionWithId:function];
}
}
if (![[GXFFunctionDB sharedInstance]defaultdisplayFunctions]) {
[[GXFFunctionDB sharedInstance]defaultdisplayFunctions];
}
};
void(^fail)(id) = ^(id data) {
......
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