Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
map-property-mobile
Project
Project
Details
Activity
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
zhangzhaohui
map-property-mobile
Commits
a884876e
Commit
a884876e
authored
Jan 26, 2024
by
leidahong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
附件
parent
7f0cdc6a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
23 deletions
+64
-23
EventDetail.vue
src/views/EventDetail.vue
+4
-4
addEvent.vue
src/views/addEvent.vue
+58
-17
vue.config.js
vue.config.js
+2
-2
No files found.
src/views/EventDetail.vue
View file @
a884876e
...
...
@@ -92,17 +92,17 @@
</div>
</div>
</div>
<
!--
<
div
class=
"detail-item"
>
<div
class=
"detail-item"
>
<div
class=
"label"
>
附件
</div>
<div
class=
"val"
>
<div
class=
"file-list"
>
<div
class=
"file-item"
v-for=
"item in
1
"
>
<div
class=
"file-name"
>
附件名称.doc
</div>
<div
class=
"file-item"
v-for=
"item in
info.fileUrlList
"
>
<div
class=
"file-name"
>
{{
item
}}
</div>
<div
class=
"check-btn"
>
查看附件
</div>
</div>
</div>
</div>
</div>
-->
</div>
</div>
<div
class=
"handle-btn-box"
...
...
src/views/addEvent.vue
View file @
a884876e
...
...
@@ -38,14 +38,16 @@
:border=
"false"
show-word-limit
class=
"textarea"
/><van-uploader
class=
"uploader"
v-model=
"fileList"
multiple
:after-read=
"afterRead"
:before-delete=
"beforeDelete"
@
click-preview=
"clickPreview"
/>
<van-cell
@
click=
"changeUploadType('img')"
:border=
"false"
>
<van-uploader
class=
"uploader"
v-model=
"imgList"
multiple
:after-read=
"afterRead"
:before-delete=
"beforeDelete"
@
click-preview=
"clickPreview"
/></van-cell>
</div>
<van-field
v-model=
"form.involvedNumber"
...
...
@@ -71,6 +73,21 @@
@
click=
"popupChange('rankNo')"
/>
<van-field
v-model=
"form.expectedDays"
v-bind=
"field('expectedDays')"
/>
<van-cell
readonly
title=
"上传附件"
@
click=
"changeUploadType('file')"
:border=
"false"
>
<van-uploader
v-model=
"fileList"
:after-read=
"afterRead"
:before-delete=
"beforeDelete"
upload-icon=
"description"
>
</van-uploader
></van-cell>
<van-field
readonly
/>
</van-cell-group>
<div
class=
"btn"
>
...
...
@@ -125,6 +142,7 @@ export default {
reportDate
:
""
,
expectedDays
:
"1"
,
imgUrlList
:
[],
fileUrlList
:
[],
status
:
"待处理"
,
},
fieldMap
:
{
...
...
@@ -142,6 +160,7 @@ export default {
rankNo
:
"事件等级"
,
expectedDays
:
"处理天数"
,
},
imgList
:
[],
fileList
:
[],
popupShow
:
false
,
popupType
:
""
,
...
...
@@ -161,6 +180,7 @@ export default {
community
:
[],
},
isPreview
:
false
,
uploadType
:
"img"
,
};
},
created
()
{
...
...
@@ -174,9 +194,14 @@ export default {
},
methods
:
{
async
onSubmit
()
{
console
.
log
(
this
.
form
);
this
.
form
.
imgUrlList
=
this
.
form
.
imgUrlList
.
join
(
","
);
this
.
form
.
imgUrlList
=
this
.
form
.
imgUrlList
instanceof
Array
?
this
.
form
.
imgUrlList
.
join
(
","
)
:
""
;
this
.
form
.
fileUrlList
=
this
.
form
.
fileUrlList
instanceof
Array
?
this
.
form
.
fileUrlList
.
join
(
","
)
:
""
;
if
(
this
.
isDisabled
)
return
;
this
.
isDisabled
=
true
;
const
res
=
await
addEvent
(
this
.
form
);
...
...
@@ -247,7 +272,10 @@ export default {
let
formData
=
new
FormData
();
formData
.
append
(
"file"
,
file
.
file
);
const
res
=
await
uploadImg
(
formData
);
this
.
form
.
imgUrlList
.
push
(
res
.
data
.
url
);
if
(
this
.
uploadType
==
"img"
)
this
.
form
.
imgUrlList
.
push
(
res
.
data
.
url
);
if
(
this
.
uploadType
==
"file"
)
this
.
form
.
fileUrlList
.
push
(
res
.
data
.
url
);
if
(
res
.
code
==
200
)
{
file
.
status
=
"done"
;
file
.
message
=
"上传成功"
;
...
...
@@ -258,14 +286,22 @@ export default {
});
},
beforeDelete
(
file
,
detail
)
{
this
.
form
.
photo
.
splice
(
detail
.
index
,
1
);
const
handle
=
{
file
:
()
=>
this
.
form
.
fileUrlList
.
splice
(
detail
.
index
,
1
),
img
:
()
=>
this
.
form
.
imgUrlList
.
splice
(
detail
.
index
,
1
),
};
handle
[
this
.
uploadType
]();
return
true
;
},
changeUploadType
(
e
)
{
this
.
uploadType
=
e
;
},
field
(
key
,
required
)
{
const
data
=
{
label
:
this
.
fieldMap
[
key
],
placeholder
:
`请填写
${
this
.
fieldMap
[
key
]}
`
,
required
:
required
,
required
:
required
?
true
:
false
,
};
if
(
required
)
data
.
rules
=
[{
required
:
true
}];
...
...
@@ -311,13 +347,18 @@ export default {
border-radius
:
8px
;
border
:
1px
solid
#ebedf0
;
overflow
:
hidden
;
.uploader
{
margin
:
0
16px
;
}
}
}
.btn
{
margin
:
0px
30px
;
}
::v-deep
.van-cell__title
{
flex
:
none
;
width
:
110px
;
color
:
#646566
;
}
::v-deep
.van-cell__value
{
text-align
:
left
;
}
</
style
>
vue.config.js
View file @
a884876e
...
...
@@ -29,8 +29,8 @@ module.exports = {
proxy
:
{
"/proxyApi"
:
{
// target: 'http://192.168.10.12:18001/hmit-api',
target
:
"http://192.168.10.4:10024/"
,
//
target: "https://xcsq.zjhmit.com/api",
//
target: "http://192.168.10.4:10024/",
target
:
"https://xcsq.zjhmit.com/api"
,
changeOrigin
:
true
,
pathRewrite
:
{
"^/proxyApi"
:
""
,
...
...
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