Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-web-back-soil
Overview
Overview
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
wangweidong
patzn-cloud-web-back-soil
Commits
41492672
Commit
41492672
authored
Nov 12, 2020
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了开土制备上传图片
parent
3fff0d1f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
223 additions
and
18 deletions
+223
-18
PhotoList.vue
components/file/photo-manage/PhotoList.vue
+6
-0
BatchFileManage.vue
components/import/BatchFileManage.vue
+0
-0
BatchUploadFile.vue
components/import/BatchUploadFile.vue
+170
-0
EntrustRegisterEdit.vue
pages/meter-entrust/entrust-register/EntrustRegisterEdit.vue
+36
-13
SampleItemEdit.vue
pages/meter-entrust/entrust-register/SampleItemEdit.vue
+6
-2
SamplePreparation.vue
...il-sample-manage/sample-preparation/SamplePreparation.vue
+3
-3
global.js
plugins/global.js
+2
-0
No files found.
components/file/photo-manage/PhotoList.vue
View file @
41492672
...
...
@@ -22,6 +22,7 @@
<Button>
上传
</Button>
</Upload>
</label>
<Button
@
click=
"batchUpload"
>
批量上传
</Button>
<!--一系列操作-->
<!--非表格-->
<!--
<Button
v-if=
"viewStyle === 2 || viewStyle === 3"
v-for=
"item in menusListA"
:key=
"item.name"
@
click=
"_radioChange(item.value)"
--
>
...
...
@@ -115,6 +116,7 @@
<!--/-->
</Col>
</Row>
<BatchPhotoManage
ref=
"batchUpload"
@
on-result-change=
"_page"
></BatchPhotoManage>
<!--上传loading-->
<div
v-show=
"isLoad"
>
<Spin
fix
>
...
...
@@ -202,11 +204,15 @@ export default {
}
},
methods
:
{
batchUpload
()
{
this
.
$refs
.
batchUpload
.
_open
(
this
.
id
)
},
_setUploadData
(
data
,
idsObj
,
idKey
)
{
this
.
selectIds
=
[]
this
.
imgViewIndex
=
null
this
.
isLoad
=
false
this
.
id
=
data
.
id
console
.
log
(
'委托id'
,
this
.
id
)
const
pageKey
=
idKey
console
.
log
(
pageKey
)
this
.
$set
(
this
.
formObj
,
pageKey
,
data
.
id
)
...
...
components/import/BatchFileManage.vue
0 → 100644
View file @
41492672
This diff is collapsed.
Click to expand it.
components/import/BatchUploadFile.vue
0 → 100644
View file @
41492672
<
template
>
<div>
<Modal
v-model=
"showEditModal"
:mask-closable=
"false"
width=
"600"
>
<p
slot=
"header"
>
{{
modalTitle
}}
</p>
<div>
<Upload
:action=
"action"
:show-upload-list=
"false"
:before-upload=
"_beupload"
multiple
>
<Button
type=
"dashed"
icon=
"ios-cloud-upload-outline"
>
上传文件(小于50MB)
</Button>
</Upload>
<div>
<Card
:dis-hover=
"true"
style=
"width: 100%;height: 400px;overflow: auto;"
>
<p
slot=
"title"
>
已上传文件列表
</p>
<div
v-for=
"(item,index) in fileList"
:key=
"index"
class=
"file-upload-list"
>
<div>
<div
class=
"file-upload-list-cover"
>
<Icon
@
click
.
native
.
stop=
"_handleRemove(item)"
type=
"md-trash"
style=
"color: white;font-size: 20px;"
></Icon>
</div>
</div>
{{
item
.
fileName
}}
</div>
</Card>
</div>
</div>
<div
slot=
"footer"
class=
"btn-width"
>
<Button
@
click=
"showEditModal = false"
>
取消
</Button>
<Button
@
click=
"_mutipleUpload"
:loading=
"isLoading"
type=
"primary"
>
{{
btnName
}}
</Button>
</div>
</Modal>
</div>
</
template
>
<
script
>
/**
* 上传文件,在文件夹下
*/
import
axios
from
'axios'
import
global
from
'../../api/config'
import
loading
from
'../../api/loading'
export
default
{
data
()
{
return
{
id
:
''
,
ID
:
''
,
action
:
''
,
modalTitle
:
''
,
showEditModal
:
false
,
name
:
''
,
isLoading
:
false
,
btnName
:
'上传'
,
fileList
:
[]
}
},
methods
:
{
_open
(
obj
)
{
this
.
fileList
=
[]
this
.
showEditModal
=
true
this
.
ID
=
obj
this
.
modalTitle
=
'上传文件'
},
_beupload
(
file
)
{
// 单个文件上传超过50M时,取消上传
const
isLt50M
=
file
.
size
/
1024
/
1024
<
50
const
fileName
=
file
.
name
.
split
(
'.'
)[
0
]
if
(
!
isLt50M
)
{
this
.
$Message
.
warning
({
content
:
'文件 '
+
fileName
+
' 大小超多50M,请重新上传!'
,
duration
:
3
})
this
.
isLoading
=
false
}
else
{
// 动态循环给文件命名
const
temObj
=
{
file
:
file
,
fileName
:
fileName
}
this
.
fileList
.
push
(
temObj
)
}
return
false
},
_mutipleUpload
()
{
if
(
this
.
fileList
.
length
>
0
&&
this
.
btnName
===
'上传'
)
{
this
.
isLoading
=
true
this
.
btnName
=
'上传中...'
// 创建formula对象
const
formData
=
new
FormData
()
formData
.
append
(
'entrustId'
,
this
.
ID
)
// 多个文件
for
(
let
i
=
0
;
i
<
this
.
fileList
.
length
;
i
++
)
{
formData
.
append
(
'file'
+
i
,
this
.
fileList
[
i
].
file
)
}
const
config
=
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
}
const
instanceFile
=
axios
.
create
()
instanceFile
.
defaults
.
withCredentials
=
true
// 发起请求
instanceFile
.
post
(
global
.
baseURL
+
'/soil/v1/sample_photo/upload_bath/'
+
this
.
ID
,
formData
,
{
headers
:
config
}
)
.
then
(
res
=>
{
if
(
res
.
data
.
code
===
'1'
)
{
this
.
$Message
.
success
(
'上传成功!'
)
this
.
showEditModal
=
false
this
.
$emit
(
'on-result-change'
)
}
else
if
(
res
.
data
.
code
===
'0'
)
{
loading
.
toast
.
show
(
res
.
data
.
code
,
res
.
data
.
msg
)
this
.
$Message
.
error
(
'操作失败'
)
}
this
.
_resetLoading
()
})
.
catch
(
err
=>
{
console
.
log
(
err
)
this
.
_resetLoading
()
})
}
else
{
this
.
$Message
.
warning
(
'请至少上传一个文件'
)
this
.
_resetLoading
()
}
},
_resetLoading
()
{
this
.
isLoading
=
false
this
.
btnName
=
'上传'
},
// 删除对应的上传的文件
_handleRemove
(
data
)
{
const
index
=
this
.
fileList
.
findIndex
(
item
=>
item
===
data
)
this
.
fileList
.
splice
(
index
,
1
)
}
}
}
</
script
>
<
style
>
.file-upload-list
{
display
:
inline-block
;
width
:
100px
;
height
:
100px
;
text-align
:
center
;
line-height
:
100px
;
border
:
1px
solid
transparent
;
border-radius
:
4px
;
overflow
:
hidden
;
background
:
#fff
;
position
:
relative
;
box-shadow
:
0
1px
1px
rgba
(
0
,
0
,
0
,
0.2
);
margin-right
:
4px
;
}
.file-upload-list
:hover
.file-upload-list-cover
{
display
:
block
;
}
.file-upload-list-cover
{
display
:
none
;
position
:
absolute
;
top
:
0
;
bottom
:
0
;
left
:
0
;
right
:
0
;
background
:
rgba
(
0
,
0
,
0
,
0.6
);
}
</
style
>
pages/meter-entrust/entrust-register/EntrustRegisterEdit.vue
View file @
41492672
...
...
@@ -215,6 +215,7 @@ export default {
edit
:
false
,
cityData
:
[],
selectData
:
[],
sampleItemList
:
[],
searchOpen
:
true
,
testedCityData
:
[],
judgeType
:
[{
value
:
1
,
name
:
'是'
},
{
value
:
0
,
name
:
'否'
}],
...
...
@@ -386,11 +387,11 @@ export default {
},
_removeItem
(
itemInfo
)
{
console
.
log
(
'试验项目'
,
itemInfo
)
this
.
i
temList
=
itemInfo
.
experimentList
if
(
this
.
edit
)
{
this
.
sampleI
temList
=
itemInfo
.
experimentList
if
(
itemInfo
.
sampleCode
!==
''
)
{
this
.
$refs
.
sampleItemEdit
.
_open
(
itemInfo
.
id
)
}
else
{
this
.
$refs
.
sampleItemRemove
.
_open
(
this
.
i
temList
)
this
.
$refs
.
sampleItemRemove
.
_open
(
this
.
sampleI
temList
)
}
},
_removeItemBack
(
data
)
{
...
...
@@ -415,17 +416,25 @@ export default {
console
.
log
(
'去掉id后的data'
,
info
)
for
(
let
i
=
0
;
i
<
this
.
indexList
.
length
;
i
++
)
{
const
index
=
this
.
indexList
[
i
]
if
(
this
.
getPage
.
records
[
index
].
experiment
List
!==
undefined
)
{
if
(
this
.
getPage
.
records
[
index
].
experiment
s
!==
undefined
)
{
const
name
=
[]
this
.
itemList
=
this
.
getPage
.
records
[
index
].
experimentList
name
.
push
(
this
.
getPage
.
records
[
index
].
experiments
)
for
(
let
i
=
0
;
i
<
info
.
length
;
i
++
)
{
console
.
log
(
this
.
getPage
.
records
[
index
].
experiments
[
i
])
this
.
itemList
.
push
(
info
[
i
])
name
.
push
(
info
[
i
].
name
)
if
(
this
.
getPage
.
records
[
index
].
experimentList
)
{
this
.
itemList
=
this
.
getPage
.
records
[
index
].
experimentList
name
.
push
(
this
.
getPage
.
records
[
index
].
experiments
)
for
(
let
i
=
0
;
i
<
info
.
length
;
i
++
)
{
console
.
log
(
this
.
getPage
.
records
[
index
].
experiments
[
i
])
this
.
itemList
.
push
(
info
[
i
])
name
.
push
(
info
[
i
].
name
)
}
this
.
getPage
.
records
[
index
].
experiments
=
name
.
join
(
'、'
)
this
.
getPage
.
records
[
index
].
experimentList
=
this
.
itemList
}
else
{
name
.
push
(
this
.
getPage
.
records
[
index
].
experiments
)
for
(
let
i
=
0
;
i
<
info
.
length
;
i
++
)
{
name
.
push
(
info
[
i
].
name
)
}
this
.
getPage
.
records
[
index
].
experiments
=
name
.
join
(
'、'
)
}
this
.
getPage
.
records
[
index
].
experiments
=
name
.
join
(
'、'
)
this
.
getPage
.
records
[
index
].
experimentList
=
this
.
itemList
this
.
$set
(
this
.
getPage
.
records
,
index
,
this
.
getPage
.
records
[
index
])
}
else
{
const
name
=
[]
...
...
@@ -439,6 +448,12 @@ export default {
this
.
$set
(
this
.
getPage
.
records
,
index
,
this
.
getPage
.
records
[
index
])
}
}
if
(
this
.
edit
)
{
const
sampleData
=
{}
sampleData
.
id
=
this
.
id
sampleData
.
sampleList
=
this
.
getPage
.
records
this
.
_sampleEdit
(
sampleData
)
}
console
.
log
(
this
.
getPage
.
records
)
},
_selectPerson
()
{
...
...
@@ -633,7 +648,8 @@ export default {
samplePack
:
''
,
sampleDescribe
:
''
,
siteNo
:
''
,
experiments
:
''
experiments
:
''
,
experimentList
:
[]
}
this
.
getPage
.
records
.
unshift
(
data
)
},
...
...
@@ -958,6 +974,13 @@ export default {
this
.
_resultChange
(
'编辑成功!'
)
}
},
_sampleEdit
:
async
function
(
data
)
{
this
.
_hideLoading
()
const
result
=
await
soilEntrust
.
editDTO
(
data
)
if
(
result
)
{
this
.
$Message
.
success
(
'编辑成功'
)
}
},
_visibleChange
(
data
)
{
this
.
$forceUpdate
()
console
.
log
(
'清空'
)
...
...
pages/meter-entrust/entrust-register/SampleItemEdit.vue
View file @
41492672
...
...
@@ -193,7 +193,7 @@ export default {
})
},
_deleteOk
:
async
function
(
id
)
{
const
result
=
await
soilEntrust
.
d
eleteById
(
id
)
const
result
=
await
soilEntrust
.
experimentD
eleteById
(
id
)
if
(
result
)
{
this
.
$Message
.
success
(
'删除成功'
)
this
.
_page
()
...
...
@@ -213,7 +213,11 @@ export default {
}
},
_ok
()
{
const
data
=
this
.
itemList
.
records
const
expNames
=
[]
for
(
let
i
=
0
;
i
<
this
.
getPage
.
records
.
length
;
i
++
)
{
expNames
.
push
(
this
.
getPage
.
records
[
i
].
name
)
}
const
data
=
expNames
this
.
_saveCatalogueItem
(
data
)
},
_saveCatalogueItem
(
data
)
{
...
...
pages/soil-sample-manage/sample-preparation/SamplePreparation.vue
View file @
41492672
...
...
@@ -210,7 +210,7 @@ export default {
this
.
_sampleManage
(
data
.
id
)
break
case
'试样照片'
:
this
.
_uploadPhoto
(
data
.
id
)
this
.
_uploadPhoto
(
data
)
break
case
'附件'
:
this
.
_upload
(
data
.
id
)
...
...
@@ -370,11 +370,11 @@ export default {
// this.$refs.itemManageModal._openByEntrustId(data)
},
_uploadPhoto
(
id
)
{
_uploadPhoto
(
data
)
{
// 上传照片文件
this
.
currentComponent
=
'PhotoManage'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
id
,
'entrustId'
)
this
.
$refs
.
refModal
.
_open
(
data
.
id
,
'entrustId'
)
})
// this.$refs.PhotoManage._open(id, 'entrustId')
},
...
...
plugins/global.js
View file @
41492672
...
...
@@ -18,6 +18,7 @@ import VXESettingCol from '../components/base/VXESettingCol'
import
ElTableNoPage
from
'../components/table/ElTableNoPage'
import
PhotoManage
from
'../components/file/photo-manage/PhotoManage'
import
elementTableHeight
from
'../components/table/elementTableHeight'
import
BatchPhotoManage
from
'../components/import/BatchUploadFile'
Vue
.
use
(
VXETable
)
Vue
.
component
(
'btn-list'
,
btnList
)
...
...
@@ -33,4 +34,5 @@ Vue.component('VXEIconList', VXEIconList)
Vue
.
component
(
'VXESettingCol'
,
VXESettingCol
)
Vue
.
component
(
'FileManage'
,
FileManage
)
Vue
.
component
(
'PhotoManage'
,
PhotoManage
)
Vue
.
component
(
'BatchPhotoManage'
,
BatchPhotoManage
)
Vue
.
component
(
'ElTableNoPage'
,
ElTableNoPage
)
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