Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform-ui
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
2
Merge Requests
2
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
周健威
rs-cloud-platform-ui
Commits
6b0fcb52
Commit
6b0fcb52
authored
Dec 07, 2020
by
Xiaxuxia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增影像图库
parent
cf0c03e4
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
250 additions
and
80 deletions
+250
-80
index.js
src/api/website/imageLibrary/index.js
+18
-2
shrimp.png
src/assets/images/shrimp.png
+0
-0
singleImageX.vue
src/components/Upload/singleImageX.vue
+26
-19
edit.vue
src/views/webSiteManagement/imageLibrary/edit.vue
+203
-56
index.vue
src/views/webSiteManagement/imageLibrary/index.vue
+1
-1
list.vue
src/views/webSiteManagement/imageLibrary/list.vue
+2
-2
No files found.
src/api/website/imageLibrary/index.js
View file @
6b0fcb52
import
fetch
from
'utils/fetch'
;
//获取影像图库列表
export
function
page
(
query
)
{
return
fetch
({
url
:
'/api/website/imageImgStorage/getList'
,
...
...
@@ -7,7 +7,7 @@ export function page(query) {
params
:
query
});
}
//新增或修改影像图库
export
function
update
(
query
)
{
return
fetch
({
url
:
'/api/website/imageImgStorage/addUpdate'
,
...
...
@@ -15,3 +15,19 @@ export function update(query) {
data
:
query
});
}
//获取所有相似图像
export
function
getAll
(
query
)
{
return
fetch
({
url
:
'/api/website/imageInfoRelation/getAll'
,
method
:
'get'
,
params
:
query
});
}
///api/website/imageImgStorage/getDetail/{id}
export
function
getDetail
(
query
)
{
return
fetch
({
url
:
`/api/website/imageImgStorage/getDetail/
${
query
}
`
,
method
:
'get'
});
}
src/assets/images/shrimp.png
0 → 100644
View file @
6b0fcb52
10 KB
src/components/Upload/singleImageX.vue
View file @
6b0fcb52
<
template
>
<div
class=
"upload-container"
>
<el-upload
v-show=
"!imageUrl
"
ref=
"upload
"
v-show=
"!value
"
:ref=
"refName
"
drag
v-loading=
"uploading"
action=
"#"
...
...
@@ -14,9 +14,9 @@
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__text"
>
只能上传1个文件
</div>
</el-upload>
<div
class=
"image-preview"
v-show=
"
imageUrl
"
>
<div
class=
"image-preview"
v-show=
"
value
"
>
<div
class=
"image-preview-wrapper"
>
<img
:src=
"
imageUrl
"
/>
<img
:src=
"
value
"
/>
<div
class=
"image-preview-action"
>
<i
@
click=
"rmImage"
class=
"el-icon-delete"
></i>
</div>
...
...
@@ -29,12 +29,16 @@
// 预览效果见专题
import
{
uploadFile
}
from
"@/api/website/newsCategory/index"
;
export
default
{
name
:
"singleImage
Upload2
"
,
name
:
"singleImage
X
"
,
props
:
{
refName
:
{
type
:
String
,
default
:
'upload'
},
//图片地址
value
:
{
type
:
String
,
default
:
""
,
default
:
()
=>
""
,
},
},
data
()
{
...
...
@@ -42,26 +46,29 @@ export default {
uploading
:
false
};
},
computed
:
{
imageUrl
()
{
return
(
!!
this
.
value
)
?
this
.
value
:
""
}
},
methods
:
{
//删除图片
rmImage
()
{
this
.
$refs
.
upload
.
clearFiles
()
this
.
emitFunc
(
""
);
this
.
$refs
[
this
.
refName
]
.
clearFiles
()
this
.
emitFunc
(
""
,
null
);
},
//上传请求
onUploadRequest
(
data
)
{
this
.
uploading
=
true
;
let
fileObj
=
data
.
file
;
console
.
log
(
data
)
//获取图片详情信息
let
imgInfo
=
{};
let
temp
=
URL
.
createObjectURL
(
fileObj
)
let
img
=
new
Image
();
img
.
src
=
temp
;
console
.
log
(
img
.
width
,
img
.
height
)
img
.
onload
=
function
()
{
imgInfo
.
width
=
img
.
width
;
imgInfo
.
height
=
img
.
height
;
}
imgInfo
.
size
=
fileObj
.
size
;
imgInfo
.
type
=
fileObj
.
type
;
// FormData 对象
let
form
=
new
FormData
();
...
...
@@ -72,16 +79,16 @@ export default {
this
.
uploading
=
false
;
if
(
res
.
status
==
200
)
{
this
.
emitFunc
(
res
.
data
)
this
.
emitFunc
(
res
.
data
,
imgInfo
)
}
else
{
this
.
emitFunc
(
""
);
this
.
emitFunc
(
""
,
null
);
this
.
$message
.
error
(
res
.
message
)
}
})
},
//组件通信
emitFunc
(
val
)
{
this
.
$emit
(
'input'
,
val
)
emitFunc
(
val
,
info
=
null
)
{
this
.
$emit
(
'input'
,
val
,
info
)
}
},
};
...
...
src/views/webSiteManagement/imageLibrary/edit.vue
View file @
6b0fcb52
This diff is collapsed.
Click to expand it.
src/views/webSiteManagement/imageLibrary/index.vue
View file @
6b0fcb52
...
...
@@ -33,7 +33,7 @@ export default {
this
.
$nextTick
(()
=>
{
if
(
!!
val
)
{
this
.
$bus
.
$emit
(
'
satelliteIntroduction
-edit-renderData'
,
val
)
this
.
$bus
.
$emit
(
'
imageLibrary
-edit-renderData'
,
val
)
}
})
...
...
src/views/webSiteManagement/imageLibrary/list.vue
View file @
6b0fcb52
...
...
@@ -25,8 +25,8 @@
<el-table-column
align=
"center"
type=
"index"
label=
"序号"
width=
"65"
></el-table-column>
<el-table-column
align=
"center"
label=
"产品名称"
prop=
"name"
></el-table-column>
<el-table-column
align=
"center"
label=
"产品类型"
prop=
"type"
></el-table-column>
<el-table-column
align=
"center"
label=
"尺寸"
prop=
"imageInfoRelationList
.
ileWidth"
></el-table-column>
<el-table-column
align=
"center"
label=
"价格"
prop=
"
nam
e"
></el-table-column>
<el-table-column
align=
"center"
label=
"尺寸"
prop=
"imageInfoRelationList
[0].f
ileWidth"
></el-table-column>
<el-table-column
align=
"center"
label=
"价格"
prop=
"
imageInfoRelationList[0].pric
e"
></el-table-column>
<el-table-column
align=
"center"
label=
"状态"
>
<template
slot-scope=
"scope"
>
{{
getStatus
(
scope
.
row
.
status
)
}}
...
...
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