Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
f05a4f4b
Commit
f05a4f4b
authored
Aug 10, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 文件和图片选择
parent
b2484d4f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
94 additions
and
83 deletions
+94
-83
YHPrincipleUploadListVC.swift
...rvice/PrincipleBatch(原则批)/C/YHPrincipleUploadListVC.swift
+59
-13
YHPrincleViewModel.swift
...erService/PrincipleBatch(原则批)/VM/YHPrincleViewModel.swift
+0
-46
YHCertificateUploadContentListVC.swift
...rtificates(我的证书)/C/YHCertificateUploadContentListVC.swift
+1
-1
YHCertificateUploadSheetView.swift
...MyCertificates(我的证书)/V/YHCertificateUploadSheetView.swift
+20
-20
YHCertificateViewModel.swift
...务中心)/MyCertificates(我的证书)/VM/YHCertificateViewModel.swift
+1
-1
YHWorkExperienceViewController.swift
...rkExperience(工作经验)/C/YHWorkExperienceViewController.swift
+2
-2
Info.plist
galaxy/galaxy/Res/Info.plist
+11
-0
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/CustomerService/PrincipleBatch(原则批)/C/YHPrincipleUploadListVC.swift
View file @
f05a4f4b
...
...
@@ -302,7 +302,7 @@ extension YHPrincipleUploadListVC {
func
showUploadSheetView
(
supplementId
:
Int
,
completion
:(()
->
())?)
{
let
sheetView
=
YHCertificateUploadSheetView
.
sheetView
()
sheetView
.
maxSelectCount
=
9
sheetView
.
maxSelect
Image
Count
=
9
sheetView
.
uploadImageBlock
=
{
[
weak
self
]
targetImgArr
in
guard
let
self
=
self
else
{
return
}
...
...
@@ -380,18 +380,7 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
cell
.
uploadBtnClick
=
{
[
weak
self
]
selectModel
in
guard
let
self
=
self
else
{
return
}
YHImagePickerView
.
show
()
{[
weak
self
]
image
in
guard
let
self
=
self
else
{
return
}
let
item
=
YHSelectImageItem
()
item
.
name
=
self
.
randomAlphaNumericString
(
10
)
+
".png"
item
.
data
=
image
let
arr
=
[
item
]
self
.
viewModel
.
uploadImageArr
(
arr
)
{
resultArr
in
model
.
content_url
.
append
(
contentsOf
:
resultArr
)
self
.
tableView
.
reloadData
()
}
}
self
.
showSelectImageAndFileView
(
model
)
}
// 点击模版
cell
.
templateBtnClick
=
{
...
...
@@ -512,4 +501,61 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
}
}
.
show
()
}
func
showSelectImageAndFileView
(
_
model
:
YHPrincipleAgreementModel
)
{
let
sheetView
=
YHCertificateUploadSheetView
.
sheetView
()
sheetView
.
maxSelectImageCount
=
9
sheetView
.
fileTypes
=
[
"public.image"
,
"com.adobe.pdf"
,
"com.microsoft.word.doc"
,
"org.openxmlformats.wordprocessingml.document"
,
"com.microsoft.powerpoint.ppt"
,
"org.openxmlformats.presentationml.presentation"
,
"org.openxmlformats.spreadsheetml.sheet"
,
"com.microsoft.excel.xls"
,]
// 上传文件
sheetView
.
uploadFilesBlock
=
{
[
weak
self
]
fileUrl
in
guard
let
self
=
self
else
{
return
}
print
(
fileUrl
)
YHHUD
.
show
(
.
progress
(
message
:
"上传中..."
))
self
.
viewModel
.
uploadFile
(
fileUrl
.
absoluteString
)
{
[
weak
self
]
successUrl
,
error
in
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
// 再调用业务接口
if
let
successUrl
=
successUrl
,
!
successUrl
.
isEmpty
{
let
fileName
=
successUrl
.
lastPathComponent
let
suffixName
=
successUrl
.
pathExtension
.
lowercased
()
let
urlModel
=
YHPrincipleContentUrlModel
()
urlModel
.
name
=
fileName
urlModel
.
url
=
successUrl
urlModel
.
fileUrl
=
successUrl
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"YYYY:MM:dd"
let
dateString
=
dateFormatter
.
string
(
from
:
Date
())
urlModel
.
updated_at
=
dateString
model
.
content_url
.
insert
(
urlModel
,
at
:
0
)
self
.
tableView
.
reloadData
()
}
}
}
// 上传图片
sheetView
.
uploadImageBlock
=
{
[
weak
self
]
targetImgArr
in
guard
let
self
=
self
else
{
return
}
self
.
viewModel
.
uploadImageArr
(
targetImgArr
)
{
[
weak
self
]
resultArr
in
guard
let
self
=
self
else
{
return
}
model
.
content_url
.
insert
(
contentsOf
:
resultArr
,
at
:
0
)
self
.
tableView
.
reloadData
()
}
}
sheetView
.
show
()
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/CustomerService/PrincipleBatch(原则批)/VM/YHPrincleViewModel.swift
View file @
f05a4f4b
...
...
@@ -358,50 +358,4 @@ extension YHPrincleViewModel {
}
}
}
// func getEnvelopModel() -> YHPrincipleEnvelopeModel {
// let model = YHPrincipleEnvelopeModel()
// model.name = "黄金龙"
// model.sex = 1
// model.date = "2024-12-12"
// return model
// }
//
// func getTestModel() -> YHPrincipleWaitResultModel {
//
// var files: [YHFileNumberList] = []
// let m = YHFileNumberList()
// m.applicationName = "杜宇"
// m.fileNumber = "23412-AVAVS-SADFAS"
// let m2 = YHFileNumberList()
// m2.applicationName = "宇"
// m2.fileNumber = "23412-AVAVS-SADFAS"
// files.append(m)
// files.append(m2)
//
// var imgs: [YHResultImageList] = []
// let n = YHResultImageList()
// n.applicationName = "嘟嘟"
// let n1 = YHResultImageList()
// n1.applicationName = "嘟嘟"
// let n2 = YHResultImageList()
// n2.applicationName = "嘟嘟"
// imgs.append(n)
// imgs.append(n1)
// imgs.append(n2)
//
// let applicant = YHApplicant()
// applicant.userName = "哈哈哈"
//
// let model = YHPrincipleWaitResultModel(lastQueryAt: "2024-12-01 23:34:12",
// queryCount: 40,
// fileNumberList: files,
// resultImageList: imgs,
// applicant: applicant,
// applicationFileNumberAttachment: "你要死啊")
// return model
// }
//
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MyCertificates(我的证书)/C/YHCertificateUploadContentListVC.swift
View file @
f05a4f4b
...
...
@@ -146,7 +146,7 @@ class YHCertificateUploadContentListVC: YHBaseViewController {
}
let
sheetView
=
YHCertificateUploadSheetView
.
sheetView
()
sheetView
.
maxSelectCount
=
99
-
items
.
count
sheetView
.
maxSelect
Image
Count
=
99
-
items
.
count
sheetView
.
uploadFilesBlock
=
{
[
weak
self
]
fileUrl
in
guard
let
self
=
self
else
{
return
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MyCertificates(我的证书)/V/YHCertificateUploadSheetView.swift
View file @
f05a4f4b
...
...
@@ -42,16 +42,16 @@ enum YHCertificateUploadType: Int {
class
YHCertificateUploadSheetView
:
UIView
{
private
var
_maxSelectCount
:
Int
=
9
let
tips
=
"支持的文件格式为jpg/jpeg、png、doc/docx、pptx、pdf,最多可上传99张图片或文件"
var
maxSelectCount
=
9
{
private
var
_maxSelect
Image
Count
:
Int
=
9
var
tips
=
"支持的文件格式为jpg/jpeg、png、doc/docx、pptx、pdf,最多可上传99张图片或文件"
var
maxSelect
Image
Count
=
9
{
didSet
{
if
maxSelectCount
>=
9
{
_maxSelectCount
=
9
}
else
if
0
<
maxSelect
Count
&&
maxSelect
Count
<
9
{
_maxSelect
Count
=
maxSelect
Count
if
maxSelect
Image
Count
>=
9
{
_maxSelect
Image
Count
=
9
}
else
if
0
<
maxSelect
ImageCount
&&
maxSelectImage
Count
<
9
{
_maxSelect
ImageCount
=
maxSelectImage
Count
}
else
{
_maxSelectCount
=
0
_maxSelect
Image
Count
=
0
}
}
}
...
...
@@ -145,28 +145,28 @@ class YHCertificateUploadSheetView: UIView {
return
tableView
}()
var
fileTypes
:
[
String
]
=
[
"public.image"
,
"com.adobe.pdf"
,
"com.microsoft.word.doc"
,
"org.openxmlformats.wordprocessingml.document"
,
"com.microsoft.powerpoint.ppt"
,
"org.openxmlformats.presentationml.presentation"
,
]
lazy
var
documentPickerVC
:
UIDocumentPickerViewController
=
{
let
docTypes
=
[
"public.image"
,
"com.adobe.pdf"
,
"com.microsoft.word.doc"
,
"org.openxmlformats.wordprocessingml.document"
,
"com.microsoft.powerpoint.ppt"
,
"org.openxmlformats.presentationml.presentation"
,]
if
#available(iOS 14.0, *)
{
var
arr
:[
UTType
]
=
[]
for
docStr
in
doc
Types
{
if
let
type
=
UTType
(
docStr
)
{
for
fileType
in
self
.
file
Types
{
if
let
type
=
UTType
(
fileType
)
{
arr
.
append
(
type
)
}
}
let
docPickerVC
=
UIDocumentPickerViewController
(
forOpeningContentTypes
:
arr
)
docPickerVC
.
delegate
=
self
return
docPickerVC
}
let
docPickerVC
=
UIDocumentPickerViewController
(
documentTypes
:
doc
Types
,
in
:
.
open
)
let
docPickerVC
=
UIDocumentPickerViewController
(
documentTypes
:
self
.
file
Types
,
in
:
.
open
)
docPickerVC
.
delegate
=
self
return
docPickerVC
}()
...
...
@@ -407,7 +407,7 @@ extension YHCertificateUploadSheetView: (UIImagePickerControllerDelegate & UINav
var
configuration
=
PHPickerConfiguration
()
// 设置最大选择数量
configuration
.
selectionLimit
=
_maxSelectCount
configuration
.
selectionLimit
=
_maxSelect
Image
Count
// 设置选择器的过滤条件 只显示图片
configuration
.
filter
=
.
images
let
picker
=
PHPickerViewController
(
configuration
:
configuration
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MyCertificates(我的证书)/VM/YHCertificateViewModel.swift
View file @
f05a4f4b
...
...
@@ -226,7 +226,7 @@ extension YHCertificateViewModel {
func
showUploadSheetView
(
supplementId
:
Int
,
completion
:(()
->
())?)
{
let
sheetView
=
YHCertificateUploadSheetView
.
sheetView
()
sheetView
.
maxSelectCount
=
9
sheetView
.
maxSelect
Image
Count
=
9
sheetView
.
uploadFilesBlock
=
{
[
weak
self
]
fileUrl
in
guard
let
self
=
self
else
{
return
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/C/YHWorkExperienceViewController.swift
View file @
f05a4f4b
...
...
@@ -571,7 +571,7 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
maxCount
=
9
}
let
sheetView
=
YHCertificateUploadSheetView
.
sheetView
()
sheetView
.
maxSelectCount
=
maxCount
sheetView
.
maxSelect
Image
Count
=
maxCount
sheetView
.
uploadFilesBlock
=
{
[
weak
self
]
fileUrl
in
guard
let
self
=
self
else
{
return
}
...
...
@@ -703,7 +703,7 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
maxCount
=
9
}
let
sheetView
=
YHCertificateUploadSheetView
.
sheetView
()
sheetView
.
maxSelectCount
=
maxCount
sheetView
.
maxSelect
Image
Count
=
maxCount
sheetView
.
uploadFilesBlock
=
{
[
weak
self
]
fileUrl
in
guard
let
self
=
self
else
{
return
}
...
...
galaxy/galaxy/Res/Info.plist
View file @
f05a4f4b
...
...
@@ -56,6 +56,17 @@
<
string
>
com.microsoft.powerpoint.ppt
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleTypeName
<
/k
e
y
>
<
string
>
Microsoft
Excel
Document
<
/string
>
<
k
e
y
>
LSHandlerRank
<
/k
e
y
>
<
string
>
Default
<
/string
>
<
k
e
y
>
LSItemContentTypes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
org.openxmlformats.spreadsheetml.sheet
<
/string
>
<
string
>
com.microsoft.excel.xls
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleURLTypes
<
/k
e
y
>
<
a
rr
a
y
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment