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
5109062d
Commit
5109062d
authored
Dec 08, 2020
by
obt
Browse files
Options
Browse Files
Download
Plain Diff
行业应用页面代码更新
parents
e33c8909
7d53af86
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
472 additions
and
484 deletions
+472
-484
index.js
src/api/website/imageLibrary/index.js
+18
-2
index.js
src/api/website/industryApplication/index.js
+7
-7
shrimp.png
src/assets/images/shrimp.png
+0
-0
index.vue
src/components/CustomForm/index.vue
+25
-3
index.vue
src/components/CustomInput/index.vue
+105
-76
singleImageX.vue
src/components/Upload/singleImageX.vue
+35
-18
formDatas.js
src/utils/formDatas.js
+44
-45
bannerSetting.vue
src/views/webSiteManagement/bannerSetting.vue
+0
-267
index.vue
src/views/webSiteManagement/bannerSetting/index.vue
+31
-4
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
edit.vue
src/views/webSiteManagement/satelliteIntroduction/edit.vue
+1
-1
index.vue
src/views/webSiteManagement/satelliteIntroduction/index.vue
+0
-2
No files found.
src/api/website/imageLibrary/index.js
View file @
5109062d
import
fetch
from
'utils/fetch'
;
import
fetch
from
'utils/fetch'
;
//获取影像图库列表
export
function
page
(
query
)
{
export
function
page
(
query
)
{
return
fetch
({
return
fetch
({
url
:
'/api/website/imageImgStorage/getList'
,
url
:
'/api/website/imageImgStorage/getList'
,
...
@@ -7,7 +7,7 @@ export function page(query) {
...
@@ -7,7 +7,7 @@ export function page(query) {
params
:
query
params
:
query
});
});
}
}
//新增或修改影像图库
export
function
update
(
query
)
{
export
function
update
(
query
)
{
return
fetch
({
return
fetch
({
url
:
'/api/website/imageImgStorage/addUpdate'
,
url
:
'/api/website/imageImgStorage/addUpdate'
,
...
@@ -15,3 +15,19 @@ export function update(query) {
...
@@ -15,3 +15,19 @@ export function update(query) {
data
:
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/api/website/industryApplication/index.js
View file @
5109062d
/*
/*
* @Author: Jenkins
* @Author: Jenkins
* @Date: 2020-12-02 09:20:18
* @Date: 2020-12-02 09:20:18
* @LastEditTime: 2020-12-08 1
4:59:18
* @LastEditTime: 2020-12-08 1
7:59:51
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
* @Description: 行业应用页请求接口
* @Description: 行业应用页请求接口
* @FilePath: \rs-cloud-platform-ui\src\api\wsmanagement\industryApplication\index.js
* @FilePath: \rs-cloud-platform-ui\src\api\wsmanagement\industryApplication\index.js
...
@@ -11,7 +11,7 @@ import fetch from 'utils/fetch';
...
@@ -11,7 +11,7 @@ import fetch from 'utils/fetch';
/**
/**
* 获取所有行业应用类型
* 获取所有行业应用类型
* @param {Object} indexShow
* @param {Object} indexShow
*/
*/
export
function
getAllApplicationType
(
obj
){
export
function
getAllApplicationType
(
obj
){
return
fetch
({
return
fetch
({
...
@@ -29,13 +29,13 @@ export function getListApplicationType(obj){
...
@@ -29,13 +29,13 @@ export function getListApplicationType(obj){
return
fetch
({
return
fetch
({
url
:
'/api/website/industryApplicationType/getList'
,
url
:
'/api/website/industryApplicationType/getList'
,
method
:
'get'
,
method
:
'get'
,
param
:
obj
param
s
:
obj
});
});
}
}
/**
/**
* 新增或更新行业应用类型
* 新增或更新行业应用类型
* @param {Object} obj
* @param {Object} obj
*/
*/
export
function
addUpdateApplicationType
(
obj
){
export
function
addUpdateApplicationType
(
obj
){
return
fetch
({
return
fetch
({
...
@@ -47,19 +47,19 @@ export function addUpdateApplicationType(obj){
...
@@ -47,19 +47,19 @@ export function addUpdateApplicationType(obj){
/**
/**
* 分页获取行业应用信息
* 分页获取行业应用信息
* @param {Object} obj
* @param {Object} obj
*/
*/
export
function
getListApplicationInfo
(
obj
){
export
function
getListApplicationInfo
(
obj
){
return
fetch
({
return
fetch
({
url
:
'/api/website/industryApplicationInfo/getList'
,
url
:
'/api/website/industryApplicationInfo/getList'
,
method
:
'get'
,
method
:
'get'
,
param
:
obj
param
s
:
obj
});
});
}
}
/**
/**
* 新增或更新行业应用信息
* 新增或更新行业应用信息
* @param {Object} obj
* @param {Object} obj
*/
*/
export
function
addUpdateApplicationInfo
(
obj
){
export
function
addUpdateApplicationInfo
(
obj
){
return
fetch
({
return
fetch
({
...
...
src/assets/images/shrimp.png
0 → 100644
View file @
5109062d
10 KB
src/components/CustomForm/index.vue
View file @
5109062d
<!--
* @Author: your name
* @Description: 该组件,为表单组件。
* 关联js:@/utils/formDatas.js
* 使用到该组件的地方:
* 在@/views/webSiteManagement/bannerSetting/index.vue中使用 轮播图设置
* 在@/views/webSiteManagement/satelliteIntroduction/index.vue中使用 卫星介绍
* 在@/views/webSiteManagement/imageLibrary/index.vue中使用 影像图库
-->
<
template
>
<
template
>
<el-form
<el-form
ref=
"ruleForm"
ref=
"ruleForm"
...
@@ -20,7 +29,7 @@
...
@@ -20,7 +29,7 @@
</div>
</div>
<!-- 自定义 -->
<!-- 自定义 -->
<div
v-else-if=
"item.type && item.type == 'custom'"
>
<div
v-else-if=
"item.type && item.type == 'custom'"
>
<custom-input
ref=
"customInput"
:value=
"getForm.formVal"
@
input=
"getCustomInput"
@
reset=
"resetParams"
></custom-input
>
<custom-input
ref=
"customInput"
:value=
"getForm.formVal"
@
input=
"getCustomInput"
></custom-input>
<!-- @input="getCustomInput" @reset="resetParams"--
>
</div>
</div>
<div
v-else-if=
"item.type && item.type == 'kindEditor'"
>
<div
v-else-if=
"item.type && item.type == 'kindEditor'"
>
...
@@ -62,6 +71,16 @@ export default {
...
@@ -62,6 +71,16 @@ export default {
content
:
""
content
:
""
}
}
},
},
// watch: {
// formData: {
// handler(newVal, oldVal) {
// console.log(22, newVal, oldVal)
// this.getForm = newVal
// // this.$set(this, 'getForm', newVal)
// }
// },
// deep: true
// },
computed
:
{
computed
:
{
getForm
()
{
getForm
()
{
this
.
$nextTick
(()
=>
this
.
$refs
.
ruleForm
.
resetFields
())
this
.
$nextTick
(()
=>
this
.
$refs
.
ruleForm
.
resetFields
())
...
@@ -70,7 +89,6 @@ export default {
...
@@ -70,7 +89,6 @@ export default {
},
},
methods
:
{
methods
:
{
onContentChange
(
val
)
{
onContentChange
(
val
)
{
console
.
log
(
val
)
this
.
getForm
.
formVal
.
content
=
val
;
this
.
getForm
.
formVal
.
content
=
val
;
},
},
afterChange
()
{
afterChange
()
{
...
@@ -84,11 +102,15 @@ export default {
...
@@ -84,11 +102,15 @@ export default {
//获取图片链接
//获取图片链接
getSrc
(
index
,
val
)
{
getSrc
(
index
,
val
)
{
let
formVal
=
this
.
getForm
.
formVal
let
formVal
=
this
.
getForm
.
formVal
// console.log(index, val)
formVal
[
index
]
=
val
formVal
[
index
]
=
val
// this.$set(this.getForm.formVal, index, val)
},
},
//获取自定义组件值
//获取自定义组件值
getCustomInput
(
val
)
{
getCustomInput
(
val
)
{
let
formVal
=
this
.
getForm
.
formVal
let
formVal
=
this
.
getForm
.
formVal
formVal
.
jumpType
=
val
.
jumpType
;
if
(
val
.
jumpType
==
1
)
{
if
(
val
.
jumpType
==
1
)
{
formVal
.
url
=
val
.
value
formVal
.
url
=
val
.
value
}
else
{
}
else
{
...
@@ -112,7 +134,7 @@ export default {
...
@@ -112,7 +134,7 @@ export default {
//校验自定义input
//校验自定义input
checkCustom
()
{
checkCustom
()
{
let
form
=
this
.
getForm
.
formVal
;
let
form
=
this
.
getForm
.
formVal
;
// console.log('自定义input', this.getForm.formVal)
if
(
form
.
jumpType
===
1
&&
form
.
url
==
''
)
{
if
(
form
.
jumpType
===
1
&&
form
.
url
==
''
)
{
this
.
$refs
.
customInput
[
0
].
showErr
(
'请输入链接地址'
)
this
.
$refs
.
customInput
[
0
].
showErr
(
'请输入链接地址'
)
return
false
return
false
...
...
src/components/CustomInput/index.vue
View file @
5109062d
<
template
>
<
template
>
<div
class=
"custom-input"
>
<div
class=
"custom-input"
>
<el-select
v-model=
"select.jumpType"
placeholder=
"请选择"
@
change=
"
selectTyp
e"
>
<el-select
v-model=
"select.jumpType"
placeholder=
"请选择"
@
change=
"
jumpTypeChang
e"
>
<el-option
<el-option
v-for=
"(item, index) in linkTypes"
v-for=
"(item, index) in linkTypes"
:key=
"~~index"
:key=
"~~index"
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<!-- 外部链接 -->
<!-- 外部链接 -->
<div
class=
"link-type-input"
v-if=
"select.jumpType === 1"
>
<div
class=
"link-type-input"
v-if=
"select.jumpType === 1"
>
<el-input
v-model=
"select.value"
placeholder=
"请输入外部链接"
@
input=
"blurFunc"
></el-input>
<el-input
v-model=
"select.value"
placeholder=
"请输入外部链接"
></el-input>
</div>
</div>
<!-- 卫星影像 -->
<!-- 卫星影像 -->
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
<el-select
v-model=
"select.value"
placeholder=
"请选择"
>
<el-select
v-model=
"select.value"
placeholder=
"请选择"
>
<el-option
<el-option
v-for=
"item in satelliteList"
v-for=
"item in satelliteList"
:key=
"item.
value
"
:key=
"item.
id
"
:label=
"item.
label
"
:label=
"item.
name
"
:value=
"item.
value
"
>
:value=
"item.
id + ''
"
>
</el-option>
</el-option>
</el-select>
</el-select>
</div>
</div>
...
@@ -38,9 +38,9 @@
...
@@ -38,9 +38,9 @@
<el-select
v-model=
"select.value"
placeholder=
"请选择"
>
<el-select
v-model=
"select.value"
placeholder=
"请选择"
>
<el-option
<el-option
v-for=
"item in applicationList"
v-for=
"item in applicationList"
:key=
"item.
value
"
:key=
"item.
id
"
:label=
"item.
label
"
:label=
"item.
title
"
:value=
"item.
value
"
>
:value=
"item.
id + ''
"
>
</el-option>
</el-option>
</el-select>
</el-select>
</div>
</div>
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
<!-- 行业应用详情 -->
<!-- 行业应用详情 -->
<div
class=
"link-type-input"
v-if=
"select.jumpType === 5"
>
<div
class=
"link-type-input"
v-if=
"select.jumpType === 5"
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
v-if=
"!select.value"
@
click=
"details.visible = true"
>
选择应用详情
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-plus"
v-if=
"!select.value"
@
click=
"details.visible = true"
>
选择应用详情
</el-button>
<el-tag
type=
"success"
v-if=
"select.value"
@
click=
"details.visible = true"
>
{{
getName
(
'details'
,
select
.
value
)
}}
</el-tag>
<el-tag
type=
"success"
v-if=
"select.value"
@
click=
"details.visible = true"
>
{{
getName
(
'details'
,
select
.
value
,
'title'
)
}}
</el-tag>
</div>
</div>
<div
class=
"el-form-item__error"
v-if=
"select.jumpType !== 0 && !!hasErr"
>
{{
hasErr
}}
</div>
<div
class=
"el-form-item__error"
v-if=
"select.jumpType !== 0 && !!hasErr"
>
{{
hasErr
}}
</div>
...
@@ -70,23 +70,23 @@
...
@@ -70,23 +70,23 @@
<el-table-column
label=
"缩略图"
width=
"150"
align=
"center"
>
<el-table-column
label=
"缩略图"
width=
"150"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
<span>
<img
class=
"icon"
:src=
"scope.row.
icon.url
"
/>
<img
class=
"icon"
:src=
"scope.row.
coverImg
"
/>
</span>
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"简介"
align=
"center"
>
<el-table-column
label=
"简介"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
class=
"introduce"
>
{{
scope
.
row
.
introduce
}}
</span>
<span
class=
"introduce"
>
{{
scope
.
row
.
detail
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"类型"
width=
"150"
align=
"center"
>
<el-table-column
label=
"类型"
width=
"150"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
type
}}
</span>
<span>
{{
scope
.
row
.
type
Name
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"状态"
align=
"center"
>
<el-table-column
label=
"状态"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
status
}}
</span>
<span>
{{
getStatus
(
scope
.
row
.
status
)
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
width=
"80"
align=
"center"
>
<el-table-column
label=
"操作"
width=
"80"
align=
"center"
>
...
@@ -110,8 +110,8 @@
...
@@ -110,8 +110,8 @@
<!-- 应用详情弹窗 -->
<!-- 应用详情弹窗 -->
<el-dialog
title=
"选择资讯"
:visible
.
sync=
"details.visible"
append-to-body
width=
"80%"
style=
"height: 100%"
>
<el-dialog
title=
"选择资讯"
:visible
.
sync=
"details.visible"
append-to-body
width=
"80%"
style=
"height: 100%"
>
<el-table
size=
"mini"
:data=
"
new
s.datas"
border
fit
highlight-current-row
current-row-key=
"id"
<el-table
size=
"mini"
:data=
"
detail
s.datas"
border
fit
highlight-current-row
current-row-key=
"id"
@
current-change=
"(val) => handleCurrentChange('
new
s', val)"
style=
"width: 100%"
height=
"500px"
>
@
current-change=
"(val) => handleCurrentChange('
detail
s', val)"
style=
"width: 100%"
height=
"500px"
>
<el-table-column
label=
"序号"
width=
"100"
align=
"center"
>
<el-table-column
label=
"序号"
width=
"100"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
id
}}
</span>
<span>
{{
scope
.
row
.
id
}}
</span>
...
@@ -124,27 +124,27 @@
...
@@ -124,27 +124,27 @@
</el-table-column>
</el-table-column>
<el-table-column
label=
"应用名称"
align=
"center"
>
<el-table-column
label=
"应用名称"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
class=
"introduce"
>
{{
scope
.
row
.
nam
e
}}
</span>
<span
class=
"introduce"
>
{{
scope
.
row
.
titl
e
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"详情图"
align=
"center"
>
<
!-- <
el-table-column label="详情图" align="center">
<template slot-scope="scope">
<template slot-scope="scope">
<span>
<span>
<img
<img
class="icon"
class="icon"
:src=
"scope.row.
icon.url
"
:src="scope.row.
coverImg
"
/>
/>
</span>
</span>
</template>
</template>
</el-table-column>
</el-table-column>
-->
<el-table-column
label=
"发布时间"
width=
"150"
align=
"center"
>
<el-table-column
label=
"发布时间"
width=
"150"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
dat
e
}}
</span>
<span>
{{
scope
.
row
.
crtTim
e
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"状态"
width=
"150"
align=
"center"
>
<el-table-column
label=
"状态"
width=
"150"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
status
}}
</span>
<span>
{{
getStatus
(
scope
.
row
.
status
)
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
width=
"150"
align=
"center"
>
<el-table-column
label=
"操作"
width=
"150"
align=
"center"
>
...
@@ -170,6 +170,9 @@
...
@@ -170,6 +170,9 @@
</template>
</template>
<
script
>
<
script
>
import
{
getListApplicationType
,
getListApplicationInfo
}
from
"@/api/website/industryApplication"
//获取行业类别、行业应用详情
import
{
page
}
from
"@/api/website/satelliteIntroduction"
//获取卫星介绍
import
{
getListNewsInfo
}
from
"@/api/website/newsCategory"
//星云动态
export
default
{
export
default
{
name
:
"index"
,
name
:
"index"
,
...
@@ -193,13 +196,33 @@ export default {
...
@@ -193,13 +196,33 @@ export default {
}
}
},
},
deep
:
true
deep
:
true
},
select
:
{
handler
(
newVal
)
{
// console.dir(JSON.stringify(newVal))
this
.
$emit
(
'input'
,
newVal
)
},
deep
:
true
}
}
},
},
computed
:
{
computed
:
{
getName
(
key
,
id
,
name
=
'name'
)
{
getStatus
(
status
)
{
return
(
key
,
id
)
=>
{
return
(
status
)
=>
{
let
a
=
""
switch
(
status
)
{
case
1
:
a
=
'启用'
;
break
;
case
2
:
a
=
'禁用'
;
break
;
default
:
a
=
'未知'
;
break
}
return
a
}
},
getName
(
key
,
id
,
name
)
{
return
(
key
,
id
,
name
)
=>
{
console
.
log
(
this
[
key
])
let
target
=
this
[
key
].
datas
.
find
(
v
=>
v
.
id
==
id
);
let
target
=
this
[
key
].
datas
.
find
(
v
=>
v
.
id
==
id
);
return
target
?
target
[
name
]
:
null
console
.
log
(
111
,
target
)
return
(
target
&&
target
[
name
])
||
null
}
}
}
}
},
},
...
@@ -209,10 +232,10 @@ export default {
...
@@ -209,10 +232,10 @@ export default {
linkTypes
:
{
linkTypes
:
{
0
:
"不跳转"
,
0
:
"不跳转"
,
1
:
'外部链接'
,
1
:
'外部链接'
,
//
2: '卫星影像',
2
:
'卫星影像'
,
//
3: '星云动态',
3
:
'星云动态'
,
//
4: '行业应用类别',
4
:
'行业应用类别'
,
//
5: '行业应用详情',
5
:
'行业应用详情'
,
},
},
satelliteList
:
[],
//卫星影像
satelliteList
:
[],
//卫星影像
applicationList
:
[],
//行业应用
applicationList
:
[],
//行业应用
...
@@ -223,31 +246,7 @@ export default {
...
@@ -223,31 +246,7 @@ export default {
},
},
//星云动态
//星云动态
news
:
{
news
:
{
datas
:
[{
datas
:
[],
id
:
'1'
,
title
:
'王小虎'
,
icon
:
{
url
:
'https://onemap.obtdata.com/wx/download/world.png'
,
showPreview
:
false
},
introduce
:
'介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍'
,
type
:
'类型'
,
sort
:
'排序'
,
status
:
'状态'
,
operator
:
'操作'
,
},{
id
:
'2'
,
title
:
'王小虎2'
,
icon
:
{
url
:
'https://onemap.obtdata.com/wx/download/world.png'
,
showPreview
:
false
},
introduce
:
'2介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍'
,
type
:
'类型'
,
sort
:
'排序'
,
status
:
'状态'
,
operator
:
'操作'
,
}],
visible
:
false
,
visible
:
false
,
currRow
:
null
,
currRow
:
null
,
total
:
100
,
total
:
100
,
...
@@ -258,17 +257,7 @@ export default {
...
@@ -258,17 +257,7 @@ export default {
},
},
//应用详情
//应用详情
details
:
{
details
:
{
datas
:
[{
datas
:
[],
id
:
"1"
,
type
:
"类别"
,
name
:
"名称"
,
icon
:
{
url
:
"https://onemap.obtdata.com/wx/download/world.png"
,
showPreview
:
false
,
},
date
:
"发布时间"
,
status
:
"状态"
,
}],
visible
:
false
,
visible
:
false
,
currRow
:
null
,
currRow
:
null
,
total
:
100
,
total
:
100
,
...
@@ -277,35 +266,75 @@ export default {
...
@@ -277,35 +266,75 @@ export default {
limit
:
20
limit
:
20
}
}
},
},
detailsList
:
[],
hasErr
:
''
,
hasErr
:
''
,
};
};
},
},
mounted
()
{
this
.
init
()
},
methods
:
{
methods
:
{
//初始化
init
()
{
this
.
getSatelliteListFunc
();
//获取卫星影像介绍
this
.
getListApplicationTypeFunc
();
//获取行业应用类型
this
.
getDialogDatas
(
'news'
,
getListNewsInfo
)
//星云动态
this
.
getDialogDatas
(
'details'
,
getListApplicationInfo
)
//行业应用详情
},
getDialogDatas
(
key
,
fn
)
{
console
.
log
(
this
[
key
].
pageParams
,
'星云和详情'
)
fn
(
this
[
key
].
pageParams
).
then
(
res
=>
{
this
[
key
].
datas
=
res
.
data
.
data
this
[
key
].
total
=
res
.
data
.
totalCount
})
},
// //星云动态
// getListNewsInfoFunc() {
// getListNewsInfo(this.news.pageParams).then(res => {
// this.news.datas = res.data.data
// this.news.total = res.data.totalCount
// })
// },
// //行业应用详情
// getListApplicationInfoFunc() {
// getListApplicationInfo(this.details.pageParams).then(res => {
// this.details.datas = res.data.data
// this.details.total = res.data.totalCount
// })
// },
//行业应用类别
getListApplicationTypeFunc
()
{
let
params
=
{
page
:
1
,
limit
:
20
}
getListApplicationType
(
params
).
then
(
res
=>
{
this
.
applicationList
=
res
.
data
.
data
})
},
//获取卫星影像介绍
getSatelliteListFunc
()
{
page
().
then
(
res
=>
{
this
.
satelliteList
=
res
.
data
.
data
})
},
//动态。详情翻页
handleCurrentChange
(
key
,
val
)
{
handleCurrentChange
(
key
,
val
)
{
this
[
key
].
currRow
=
val
;
this
[
key
].
currRow
=
val
;
},
},
//动态。详情选择按钮
selectFunc
(
key
,
val
)
{
selectFunc
(
key
,
val
)
{
this
[
key
].
visible
=
false
;
this
[
key
].
visible
=
false
;
this
.
select
.
value
=
val
.
id
;
this
.
select
.
value
=
val
.
id
;
this
[
key
].
currRow
=
val
.
id
;
//高亮选中项
this
[
key
].
currRow
=
val
.
id
;
//高亮选中项
console
.
log
(
this
.
select
)
this
.
emitInput
(
this
.
select
.
value
)
},
},
showErr
(
err
)
{
showErr
(
err
)
{
this
.
hasErr
=
err
this
.
hasErr
=
err
},
},
selectType
()
{
//跳转类型改变方法
this
.
$emit
(
'reset'
,
this
.
select
.
jumpType
)
jumpTypeChange
()
{
this
.
select
.
value
=
""
;
this
.
showErr
(
''
)
this
.
showErr
(
''
)
},
blurFunc
(
val
)
{
console
.
log
(
val
)
this
.
emitInput
(
this
.
select
)
},
emitInput
(
val
)
{
this
.
$emit
(
'input'
,
val
)
}
}
}
}
};
};
...
...
src/components/Upload/singleImageX.vue
View file @
5109062d
<
template
>
<
template
>
<div
class=
"upload-container"
>
<div
class=
"upload-container"
>
<el-upload
<el-upload
v-show=
"!imageUrl
"
v-show=
"!value
"
ref=
"upload
"
:ref=
"refName
"
drag
drag
v-loading=
"uploading"
v-loading=
"uploading"
action=
"#"
action=
"#"
...
@@ -14,9 +14,9 @@
...
@@ -14,9 +14,9 @@
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__text"
>
只能上传1个文件
</div>
<div
class=
"el-upload__text"
>
只能上传1个文件
</div>
</el-upload>
</el-upload>
<div
class=
"image-preview"
v-show=
"
imageUrl
"
>
<div
class=
"image-preview"
v-show=
"
value
"
>
<div
class=
"image-preview-wrapper"
>
<div
class=
"image-preview-wrapper"
>
<img
:src=
"
imageUrl
"
/>
<img
:src=
"
value
"
/>
<div
class=
"image-preview-action"
>
<div
class=
"image-preview-action"
>
<i
@
click=
"rmImage"
class=
"el-icon-delete"
></i>
<i
@
click=
"rmImage"
class=
"el-icon-delete"
></i>
</div>
</div>
...
@@ -29,12 +29,16 @@
...
@@ -29,12 +29,16 @@
// 预览效果见专题
// 预览效果见专题
import
{
uploadFile
}
from
"@/api/website/newsCategory/index"
;
import
{
uploadFile
}
from
"@/api/website/newsCategory/index"
;
export
default
{
export
default
{
name
:
"singleImage
Upload2
"
,
name
:
"singleImage
X
"
,
props
:
{
props
:
{
refName
:
{
type
:
String
,
default
:
'upload'
},
//图片地址
//图片地址
value
:
{
value
:
{
type
:
String
,
type
:
String
,
default
:
""
,
default
:
()
=>
""
,
},
},
},
},
data
()
{
data
()
{
...
@@ -42,26 +46,39 @@ export default {
...
@@ -42,26 +46,39 @@ export default {
uploading
:
false
uploading
:
false
};
};
},
},
computed
:
{
mounted
()
{
imageUrl
()
{
this
.
$bus
.
$on
(
'upload-clearFiles'
,
this
.
clearFiles
)
return
(
!!
this
.
value
)
?
this
.
value
:
""
},
}
beforeDestroy
()
{
this
.
$bus
.
$off
(
'upload-clearFiles'
)
},
},
methods
:
{
methods
:
{
//清空上传过的图片
clearFiles
()
{
this
.
$refs
[
this
.
refName
].
clearFiles
()
},
//删除图片
//删除图片
rmImage
()
{
rmImage
()
{
this
.
$refs
.
upload
.
clearFiles
()
this
.
clearFiles
();
this
.
emitFunc
(
""
);
this
.
emitFunc
(
""
,
null
);
},
},
//上传请求
//上传请求
onUploadRequest
(
data
)
{
onUploadRequest
(
data
)
{
this
.
uploading
=
true
;
this
.
uploading
=
true
;
let
fileObj
=
data
.
file
;
let
fileObj
=
data
.
file
;
console
.
log
(
data
)
//获取图片详情信息
let
imgInfo
=
{};
let
temp
=
URL
.
createObjectURL
(
fileObj
)
let
temp
=
URL
.
createObjectURL
(
fileObj
)
let
img
=
new
Image
();
let
img
=
new
Image
();
img
.
src
=
temp
;
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 对象
// FormData 对象
let
form
=
new
FormData
();
let
form
=
new
FormData
();
...
@@ -72,16 +89,16 @@ export default {
...
@@ -72,16 +89,16 @@ export default {
this
.
uploading
=
false
;
this
.
uploading
=
false
;
if
(
res
.
status
==
200
)
{
if
(
res
.
status
==
200
)
{
this
.
emitFunc
(
res
.
data
)
this
.
emitFunc
(
res
.
data
,
imgInfo
)
}
else
{
}
else
{
this
.
emitFunc
(
""
);
this
.
emitFunc
(
""
,
null
);
this
.
$message
.
error
(
res
.
message
)
this
.
$message
.
error
(
res
.
message
)
}
}
})
})
},
},
//组件通信
//组件通信
emitFunc
(
val
)
{
emitFunc
(
val
,
info
=
null
)
{
this
.
$emit
(
'input'
,
val
)
this
.
$emit
(
'input'
,
val
,
info
)
}
}
},
},
};
};
...
...
src/utils/formDatas.js
View file @
5109062d
...
@@ -19,7 +19,6 @@ let radioGroup = {
...
@@ -19,7 +19,6 @@ let radioGroup = {
}
}
}
}
//banner表单项
//banner表单项
export
const
banner
=
{
export
const
banner
=
{
init
:
()
=>
({
init
:
()
=>
({
...
@@ -98,48 +97,48 @@ export const satelliteIntroduction = {
...
@@ -98,48 +97,48 @@ export const satelliteIntroduction = {
//影像图库
//
//
影像图库
export
const
imageLibrary
=
{
//
export const imageLibrary = {
init
:
()
=>
({
//
init: () => ({
name
:
""
,
//标题名称
//
name: "",//标题名称
coverImg
:
""
,
//封面图
//
coverImg: "",//封面图
detailImg
:
""
,
//详情图
//
detailImg: "",//详情图
//产品分类
//
//产品分类
//影像分类
//
//影像分类
//文件格式
//
//文件格式
//分辨率
//
//分辨率
//拍摄地点
//
//拍摄地点
//拍摄时间
//
//拍摄时间
//可否商用
//
//可否商用
//是否水印
//
//是否水印
}),
//
}),
rules
:
{
//
rules: {
name
:
[
//
name: [
{
required
:
true
,
message
:
'请输入卫星名称'
,
trigger
:
'blur'
}
//
{ required: true, message: '请输入卫星名称', trigger: 'blur' }
],
//
],
resolution
:
[
//
resolution: [
{
required
:
true
,
message
:
'请输入分辨率'
,
trigger
:
'blur'
}
//
{ required: true, message: '请输入分辨率', trigger: 'blur' }
],
//
],
rank
:
[
//
rank: [
{
required
:
true
,
message
:
'请设置0-10000,数值越大排序越靠前'
,
trigger
:
'blur'
}
//
{ required: true, message: '请设置0-10000,数值越大排序越靠前', trigger: 'blur' }
],
//
],
coverImg
:
[
//
coverImg: [
{
required
:
true
,
message
:
'请输入封面图链接'
,
trigger
:
'blur'
}
//
{ required: true, message: '请输入封面图链接', trigger: 'blur' }
],
//
],
iconImg
:
[
//
iconImg: [
{
required
:
true
,
message
:
'请输入图标链接'
,
trigger
:
'blur'
}
//
{ required: true, message: '请输入图标链接', trigger: 'blur' }
],
//
],
content
:
[
//
content: [
{
required
:
true
,
message
:
'请输入详细内容'
,
trigger
:
'blur'
}
//
{ required: true, message: '请输入详细内容', trigger: 'blur' }
]
//
]
},
//
},
formInfo
:
{
//
formInfo: {
name
:
{
label
:
"卫星名称"
},
//
name: { label: "卫星名称" },
resolution
:
{
label
:
"分辨率"
},
//
resolution: { label: "分辨率" },
coverImg
:
{
label
:
"封面图"
,
type
:
'file'
},
//
coverImg: { label: "封面图", type: 'file'},
iconImg
:
{
label
:
"图标"
,
type
:
'file'
},
//
iconImg: { label: "图标", type: 'file'},
rank
:
{
label
:
"排序"
},
//
rank: { label: "排序" },
content
:
{
label
:
"详细内容"
,
type
:
'kindEditor'
},
//
content: { label: "详细内容", type: 'kindEditor'},
}
//
}
}
//
}
src/views/webSiteManagement/bannerSetting.vue
deleted
100644 → 0
View file @
e33c8909
<
template
>
<div
class=
"container"
>
<!-- 头部 -->
<div
class=
"head"
>
<div>
banner列表
</div>
<el-button
type=
"primary"
@
click=
"addItem"
>
添加banner
</el-button>
</div>
<!-- 主体 -->
<div
class=
"app-container calendar-list-container"
>
<!-- 条件搜索 -->
<div
class=
"filter-container"
>
<el-form
:inline=
"true"
:model=
"listQuery"
class=
"demo-form-inline"
>
<el-form-item
label=
"所有状态"
>
<el-select
v-model=
"listQuery.status"
>
<el-option
v-for=
"(item, index) in bannerStatus"
:key=
"index"
:label=
"item"
:value=
"~~index"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"banner标题"
>
<el-input
v-model=
"listQuery.title"
placeholder=
"请输入banner标题"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
plain
@
click=
"search"
>
搜索
</el-button>
<el-button
type=
"primary"
plain
@
click=
"clearFilterData"
>
清除搜索
</el-button>
</el-form-item>
</el-form>
</div>
<!-- 数据列表 -->
<el-table
:data=
"list"
v-loading
.
body=
"listLoading"
border
fit
highlight-current-row
style=
"width: 100%"
>
<el-table-column
align=
"center"
type=
"index"
label=
"序号"
width=
"65"
></el-table-column>
<el-table-column
align=
"center"
label=
"banner标题"
prop=
"title"
></el-table-column>
<el-table-column
align=
"center"
label=
"banner图"
>
<template
slot-scope=
"scope"
>
<img
class=
"cover"
:src=
"scope.row.cover"
/>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"状态"
>
<
template
slot-scope=
"scope"
>
<!-- 根据状态获取对应中文 -->
{{
getStatus
(
scope
.
row
.
status
)
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
width=
"250"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"edit(scope.row)"
>
编辑
</el-button>
<el-button
:type=
"scope.row.status === 1 ? 'info': 'warning'"
size=
"mini"
@
click=
"changeParams(scope.row, 'status')"
>
{{
scope
.
row
.
status
===
1
?
'下架'
:
'上架'
}}
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"changeParams(scope.row, 'isDel')"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<!-- 分页 -->
<div
class=
"page-foot"
>
<el-pagination
background
layout=
"prev, pager, next"
:page-size=
"listQuery.limit"
:total=
"total"
@
current-change=
"currentChange"
>
</el-pagination>
</div>
<!-- 添加、编辑弹窗 -->
<el-dialog
top=
"10%"
:close-on-click-modal=
"false"
:title=
"dialogTitle"
:visible
.
sync=
"dialogVisible"
>
<custom-form
:formData=
"formObject"
@
submitFunc=
"updateFunc"
@
reset=
"resetForm"
></custom-form>
</el-dialog>
</div>
</div>
</template>
<
script
>
import
{
banner
}
from
"@/utils/formDatas.js"
//表单数据
import
{
page
,
update
}
from
"@/api/website/banner"
//接口
import
CustomForm
from
"@/components/CustomForm"
export
default
{
name
:
"bannerSetting"
,
components
:
{
CustomForm
},
data
()
{
return
{
data
:
null
,
//原数据
list
:
null
,
//赋值数据 | 过滤数据
total
:
null
,
//总个数
listLoading
:
true
,
//请求加载状态
//请求参数。页码页数等
listQuery
:
{
status
:
0
,
title
:
""
,
page
:
1
,
limit
:
20
},
//搜索表单
searchForm
:
{
status
:
0
,
title
:
""
},
formObject
:
{
formVal
:
banner
.
init
(),
//提交的表单参数
rules
:
banner
.
rules
,
//表单规则
formItem
:
banner
.
formInfo
,
//表单项。
},
//是否启用,1、启用,2、禁用
bannerStatus
:
{
0
:
'全部'
,
1
:
'启用'
,
2
:
'禁用'
,
},
dialogVisible
:
false
,
//弹窗显示控制
dialogTitle
:
"新增banner"
//弹窗标题
}
},
mounted
()
{
this
.
getList
()
//获取数据
},
methods
:
{
//获取图片链接
getSrc
(
val
)
{
this
.
editForm
.
cover
=
val
},
//获取自定义组件值
getCustomInput
(
val
)
{
this
.
editForm
.
url
=
val
},
search
()
{
this
.
listQuery
.
page
=
1
;
this
.
getList
()
},
//清除搜索
filterData
()
{
if
(
this
.
searchForm
.
status
===
0
&&
this
.
searchForm
.
title
===
''
)
{
this
.
list
=
this
.
data
;
return
;
}
let
temp
=
this
.
data
.
filter
(
v
=>
this
.
searchForm
.
status
===
0
?
true
:
!!
(
this
.
searchForm
.
status
===
v
.
status
))
if
(
!!
this
.
searchForm
.
title
)
{
temp
=
temp
.
filter
(
v
=>
v
.
title
.
includes
(
this
.
searchForm
.
title
))
}
this
.
list
=
temp
},
//清除搜索
clearFilterData
()
{
this
.
searchForm
=
{
status
:
0
,
title
:
""
}
this
.
list
=
this
.
data
;
},
//切换页码
currentChange
(
val
)
{
this
.
listQuery
.
page
=
val
;
this
.
getList
();
},
//编辑
edit
(
row
)
{
this
.
dialogTitle
=
"编辑banner"
;
this
.
formObject
.
formVal
=
this
.
filterParams
(
row
)
this
.
dialogVisible
=
true
;
console
.
log
(
this
.
formObject
.
formVal
)
},
//更新方法
updateFunc
(
params
)
{
params
.
rank
=
~~
params
.
rank
;
update
(
params
).
then
(
res
=>
{
if
(
res
.
status
==
200
)
{
this
.
dialogVisible
=
false
;
this
.
getList
();
}
else
{
this
.
$message
.
error
(
res
.
message
);
}
})
},
//取消表单
resetForm
()
{
this
.
dialogVisible
=
false
;
},
//新增banner
addItem
()
{
this
.
dialogTitle
=
"新增banner"
;
this
.
dialogVisible
=
true
;
this
.
formObject
.
formVal
=
banner
.
init
();
},
filterParams
(
obj
)
{
let
p
=
{}
let
b
=
[
'isDel'
,
'updTime'
,
'crtTime'
]
for
(
let
key
in
obj
)
{
if
(
!
b
.
includes
(
key
))
{
p
[
key
]
=
obj
[
key
]
}
}
return
p
;
},
//获取状态
getStatus
(
val
)
{
return
this
.
bannerStatus
[
val
]
},
//上下架、删除更新
changeParams
(
row
,
key
)
{
this
.
$confirm
(
'确定继续执行该操作吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
formObject
.
formVal
=
this
.
filterParams
(
row
)
console
.
log
(
'过滤参数'
,
this
.
formObject
.
formVal
)
if
(
key
==
'isDel'
)
{
this
.
formObject
.
formVal
[
key
]
=
row
[
key
]
==
0
?
1
:
0
;
}
else
{
this
.
formObject
.
formVal
[
key
]
=
row
[
key
]
==
1
?
2
:
1
;
}
//更新专题
this
.
updateFunc
(
this
.
formObject
.
formVal
);
})
},
//获取banner列表
getList
()
{
this
.
listLoading
=
true
;
page
(
this
.
listQuery
).
then
(
res
=>
{
this
.
list
=
res
.
data
.
data
this
.
data
=
res
.
data
.
data
this
.
total
=
res
.
data
.
totalCount
;
this
.
listLoading
=
false
;
}).
catch
(
err
=>
{
this
.
listLoading
=
false
;
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.head
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
padding
:
8px
20px
;
width
:
100%
;
border-bottom
:
1px
solid
#e6e6e6
;
}
.cover
{
max-width
:
200px
;
height
:
auto
;
}
.page-foot
{
display
:
flex
;
justify-content
:
center
;
margin-top
:
20px
;
}
</
style
>
src/views/webSiteManagement/bannerSetting/index.vue
View file @
5109062d
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
top=
"10%"
top=
"10%"
:close-on-click-modal=
"false"
:close-on-click-modal=
"false"
:title=
"dialogTitle"
:title=
"dialogTitle"
:visible
.
sync=
"dialogVisible"
>
:visible
.
sync=
"dialogVisible"
@
closed=
"closeDialog"
>
<!-- @open="onOpen" @closed="closeDialog">--
>
<custom-form
<custom-form
:formData=
"formObject"
:formData=
"formObject"
@
submitFunc=
"updateFunc"
@
submitFunc=
"updateFunc"
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
import
{
banner
}
from
"@/utils/formDatas.js"
//表单数据
import
{
banner
}
from
"@/utils/formDatas.js"
//表单数据
import
{
page
,
update
}
from
"@/api/website/banner"
//接口
import
{
page
,
update
}
from
"@/api/website/banner"
//接口
import
CustomForm
from
"@/components/CustomForm"
import
CustomForm
from
"@/components/CustomForm"
//自定义表单组件
export
default
{
export
default
{
name
:
"bannerSetting"
,
name
:
"bannerSetting"
,
...
@@ -132,6 +132,7 @@ export default {
...
@@ -132,6 +132,7 @@ export default {
getCustomInput
(
val
)
{
getCustomInput
(
val
)
{
this
.
editForm
.
url
=
val
this
.
editForm
.
url
=
val
},
},
//搜索按钮
search
()
{
search
()
{
this
.
listQuery
=
{
this
.
listQuery
=
{
status
:
this
.
searchForm
.
status
||
null
,
status
:
this
.
searchForm
.
status
||
null
,
...
@@ -185,11 +186,18 @@ export default {
...
@@ -185,11 +186,18 @@ export default {
//编辑
//编辑
edit
(
row
)
{
edit
(
row
)
{
this
.
dialogTitle
=
"编辑banner"
;
this
.
dialogTitle
=
"编辑banner"
;
this
.
formObject
.
formVal
=
this
.
filterParams
(
row
)
this
.
formObject
.
formVal
=
this
.
filterParams
(
row
)
// this.formObject = {
// formVal: this.filterParams(row),
// rules: this.formObject.rules,//表单规则
// formItem: banner.formInfo,//表单项。
// }
this
.
dialogVisible
=
true
;
this
.
dialogVisible
=
true
;
console
.
log
(
this
.
formObject
.
formVal
)
// console.log(this.formObject.formVal)
},
closeDialog
()
{
this
.
$bus
.
$emit
(
'upload-clearFiles'
)
},
},
//更新方法
//更新方法
updateFunc
(
params
)
{
updateFunc
(
params
)
{
...
@@ -212,7 +220,26 @@ export default {
...
@@ -212,7 +220,26 @@ export default {
this
.
dialogTitle
=
"新增banner"
;
this
.
dialogTitle
=
"新增banner"
;
this
.
dialogVisible
=
true
;
this
.
dialogVisible
=
true
;
this
.
formObject
.
formVal
=
banner
.
init
();
this
.
formObject
.
formVal
=
banner
.
init
();
},
},
// //打开弹窗
// onOpen() {
// this.$nextTick(() => {
// this.formObject = {
// formVal: {
// title: "",
// cover: "",
// rank: "",
// url: "",
// status: 1,
// jumpType: 0,
// jumpId: '',
// },
// rules: this.formObject.rules,//表单规则
// formItem: banner.formInfo,//表单项。
// }
// })
// },
filterParams
(
row
)
{
filterParams
(
row
)
{
let
a
=
{};
let
a
=
{};
for
(
let
i
in
this
.
formObject
.
formVal
)
{
for
(
let
i
in
this
.
formObject
.
formVal
)
{
...
...
src/views/webSiteManagement/imageLibrary/edit.vue
View file @
5109062d
...
@@ -6,23 +6,25 @@
...
@@ -6,23 +6,25 @@
<div
class=
"body"
>
<div
class=
"body"
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-alert
title=
"基础信息"
type=
"info"
:closable=
"false"
></el-alert>
<el-alert
title=
"基础信息"
type=
"info"
:closable=
"false"
style=
"margin-bottom: 10px"
></el-alert>
<el-form-item
label=
"产品名称"
prop=
"name"
>
<el-form-item
label=
"产品名称"
prop=
"name"
>
<el-input
v-model=
"ruleForm.name"
placeholder=
"请输入产品名称"
></el-input>
<el-input
v-model=
"ruleForm.name"
placeholder=
"请输入产品名称"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"产品缩略图"
prop=
"coverIm
age
"
>
<el-form-item
label=
"产品缩略图"
prop=
"coverIm
g
"
>
<!-- 上传 -->
<!-- 上传 -->
<my-upload
:value=
"ruleForm.coverImage"
@
input=
"(val) => getSrc('coverImage', val)"
></my-upload>
<my-upload
:value=
"ruleForm.coverImg"
@
input=
"(val, info) => getSrc('coverImg', val)"
></my-upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"上传源文件"
:prop=
"'imageInfoRelationList.url' && 'imageInfoRelationList.price'"
>
<el-form-item
label=
"上传源文件"
:prop=
"'imageInfoRelationList.url' && 'imageInfoRelationList.price'"
>
<!-- 上传 -->
<!-- 上传 -->
<my-upload
:value=
"ruleForm.imageInfoRelationList.url"
@
input=
"(val) => getSrc('imageInfoRelationList', val)"
></my-upload>
<my-upload
refName=
"upload2"
:value=
"ruleForm.imageInfoRelationList.url"
@
input=
"(val, info) => getSrc('imageInfoRelationList', val, info)"
></my-upload>
<div
v-if=
"ruleForm.imageInfoRelationList.fileWidth"
>
尺寸大小:
{{
ruleForm
.
imageInfoRelationList
.
fileWidth
}}
</div>
<div
v-if=
"ruleForm.imageInfoRelationList.fileWidth"
>
尺寸大小:
{{
ruleForm
.
imageInfoRelationList
.
fileWidth
}}
</div>
<el-input
size=
"mini"
v-model=
"ruleForm.imageInfoRelationList.price"
placeholder=
"请输入价格"
></el-input>
<el-input
size=
"mini"
v-model=
"ruleForm.imageInfoRelationList.price"
placeholder=
"请输入价格"
></el-input>
</el-form-item>
</el-form-item>
<el-alert
title=
"产品参数"
type=
"info"
:closable=
"false"
></el-alert>
<el-alert
title=
"产品参数"
type=
"info"
:closable=
"false"
style=
"margin-bottom: 10px"
></el-alert>
<el-form-item
label=
"影像分类"
prop=
"type"
>
<el-form-item
label=
"影像分类"
prop=
"type"
>
<el-select
v-model=
"ruleForm.type"
placeholder=
"请选择"
>
<el-select
v-model=
"ruleForm.type"
placeholder=
"请选择"
>
...
@@ -34,10 +36,10 @@
...
@@ -34,10 +36,10 @@
</el-option>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<
!--
<el-form-item
label=
"产品类型"
prop=
"
"
>
<
el-form-item
label=
"产品类型"
prop=
"paramJson.productType
"
>
<el-input
v-model=
"ruleForm.
t
ype"
placeholder=
"请输入产品类型"
></el-input>
<el-input
v-model=
"ruleForm.
paramJson.productT
ype"
placeholder=
"请输入产品类型"
></el-input>
</el-form-item>
-->
</el-form-item>
<el-form-item
label=
"文件格式"
prop=
"paramJson.
file
Type"
>
<el-form-item
label=
"文件格式"
prop=
"paramJson.
product
Type"
>
<el-input
v-model=
"ruleForm.paramJson.fileType"
placeholder=
"请输入文件格式"
></el-input>
<el-input
v-model=
"ruleForm.paramJson.fileType"
placeholder=
"请输入文件格式"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"卫星"
prop=
"paramJson.satellite"
>
<el-form-item
label=
"卫星"
prop=
"paramJson.satellite"
>
...
@@ -51,6 +53,7 @@
...
@@ -51,6 +53,7 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"拍摄时间"
prop=
"paramJson.shotTime"
>
<el-form-item
label=
"拍摄时间"
prop=
"paramJson.shotTime"
>
<el-date-picker
<el-date-picker
value-format=
"yyyy-MM-dd HH:mm:ss"
v-model=
"ruleForm.paramJson.shotTime"
v-model=
"ruleForm.paramJson.shotTime"
type=
"datetime"
type=
"datetime"
placeholder=
"选择日期时间"
>
placeholder=
"选择日期时间"
>
...
@@ -68,29 +71,65 @@
...
@@ -68,29 +71,65 @@
<el-radio
:label=
"2"
>
否
</el-radio>
<el-radio
:label=
"2"
>
否
</el-radio>
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
<!--
<el-form-item
label=
"相似图片"
prop=
"type"
>
<el-form-item
label=
"相似图片"
prop=
"relatedIds"
>
<el-input
v-model=
"ruleForm.type"
></el-input>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"showImagesDialog"
>
相似图片
</el-button>
</el-form-item>
-->
<el-tag
type=
"success"
>
已选
{{
images
.
selects
.
length
}}
个
</el-tag>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"onSubmit"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"onSubmit"
>
确定
</el-button>
<el-button>
取消
</el-button>
<el-button>
取消
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
<!-- 相似图片弹窗 -->
<el-dialog
title=
"相似图片"
:visible
.
sync=
"images.visible"
width=
"80%"
:close-on-click-modal=
"false"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"6"
v-for=
"item in images.datas"
:key=
"item.id"
>
<div
:class=
"`grid-content$
{selectsArr.includes('' + item.id) ? ' active' : ''}`" @click="select(item)">
<el-image
:src=
"item.url"
lazy
></el-image>
</div>
</el-col>
</el-row>
<div
style=
"margin-top: 10px; display: flex; align-item: center; justify-content: center;"
>
<el-pagination
small
layout=
"prev, pager, next"
:page-size=
"images.pageInfo.limit"
:total=
"images.total"
@
current-change=
"currentChange"
>
</el-pagination>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"confirm"
>
确 定
</el-button>
<el-button
@
click=
"images.visible = false"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
MyUpload
from
"@/components/Upload/singleImageX"
//上传组件
import
MyUpload
from
"@/components/Upload/singleImageX"
//上传组件
// import { satelliteIntroduction } from "@/utils/formDatas.js"//表单数据
import
{
update
,
getAll
,
getDetail
}
from
"@/api/website/imageLibrary"
import
{
update
}
from
"@/api/website/imageLibrary"
export
default
{
export
default
{
components
:
{
components
:
{
MyUpload
MyUpload
},
},
data
()
{
data
()
{
let
checkNumber
=
function
(
rule
,
value
,
callback
)
{
if
(
value
===
''
)
{
callback
(
new
Error
(
'请输入价格'
));
}
else
{
if
(
isNaN
(
value
))
{
callback
(
new
Error
(
'请输入数字'
));
}
else
{
callback
();
}
}
}
return
{
return
{
//1--影像美图 2--专题图 3--遥感成果图
//1--影像美图 2--专题图 3--遥感成果图
imageTypes
:
{
imageTypes
:
{
...
@@ -100,15 +139,18 @@ export default {
...
@@ -100,15 +139,18 @@ export default {
},
},
ruleForm
:
{
ruleForm
:
{
name
:
''
,
name
:
''
,
coverIm
age
:
''
,
coverIm
g
:
''
,
imageInfoRelationList
:
{
imageInfoRelationList
:
{
url
:
''
,
url
:
''
,
price
:
''
price
:
null
,
fileWidth
:
''
,
fileSize
:
''
,
},
},
type
:
''
,
type
:
''
,
relatedIds
:
""
,
paramJson
:
{
paramJson
:
{
productType
:
''
,
fileType
:
''
,
fileType
:
''
,
fileWidth
:
''
,
satellite
:
''
,
satellite
:
''
,
resolution
:
''
,
resolution
:
''
,
address
:
''
,
address
:
''
,
...
@@ -121,20 +163,24 @@ export default {
...
@@ -121,20 +163,24 @@ export default {
name
:
[
name
:
[
{
required
:
true
,
message
:
'请输入产品名称'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入产品名称'
,
trigger
:
'blur'
}
],
],
coverIm
age
:
[
coverIm
g
:
[
{
required
:
true
,
message
:
'请上传缩略图'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请上传缩略图'
,
trigger
:
'change'
}
],
],
'imageInfoRelationList.url'
:
[
'imageInfoRelationList.url'
:
[
{
required
:
true
,
message
:
'请上传源文件'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请上传源文件'
,
trigger
:
'change'
}
],
],
'imageInfoRelationList.price'
:
[
'imageInfoRelationList.price'
:
[
{
required
:
true
,
message
:
'请输入价格'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入价格'
,
trigger
:
'blur'
},
{
validator
:
checkNumber
,
trigger
:
'blur'
}
//校验是否是数字
],
],
type
:
[
type
:
[
{
required
:
true
,
message
:
'请选择影像类型'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请选择影像类型'
,
trigger
:
'change'
}
],
],
'paramJson.productType'
:
[
{
required
:
true
,
message
:
'请输入产品类型'
,
trigger
:
'blur'
}
],
'paramJson.fileType'
:
[
'paramJson.fileType'
:
[
{
required
:
true
,
message
:
'请输入文件
类型'
,
trigger
:
'blur
'
}
{
required
:
true
,
message
:
'请输入文件
格式
'
}
],
],
'paramJson.satellite'
:
[
'paramJson.satellite'
:
[
{
required
:
true
,
message
:
'请输入卫星型号'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入卫星型号'
,
trigger
:
'blur'
}
...
@@ -146,42 +192,142 @@ export default {
...
@@ -146,42 +192,142 @@ export default {
{
required
:
true
,
message
:
'请输入拍摄地点'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入拍摄地点'
,
trigger
:
'blur'
}
],
],
'paramJson.shotTime'
:
[
'paramJson.shotTime'
:
[
{
type
:
'date'
,
required
:
true
,
message
:
'请选择拍摄时间'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请选择拍摄时间'
,
trigger
:
'change'
}
],
],
'paramJson.commercial'
:
[
'paramJson.commercial'
:
[
{
required
:
true
,
message
:
'请选择'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请选择'
,
trigger
:
'change'
}
],
],
'paramJson.watermark'
:
[
'paramJson.watermark'
:
[
{
required
:
true
,
message
:
'请选择'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请选择'
,
trigger
:
'change'
}
],
relatedIds
:
[
{
required
:
true
,
message
:
'请选择'
}
]
]
}
},
images
:
{
pageInfo
:
{
page
:
1
,
limit
:
20
,
},
total
:
100
,
datas
:
[],
visible
:
false
,
selects
:
[]
},
selectsArr
:
[]
}
}
},
},
mounted
()
{
mounted
()
{
this
.
$bus
.
$on
(
'satelliteIntroduction-edit-renderData'
,
this
.
renderData
)
//获取所有相似图像
this
.
getAllImages
()
this
.
$bus
.
$on
(
'imageLibrary-edit-renderData'
,
this
.
renderData
)
},
beforeDestroy
()
{
this
.
$bus
.
$off
(
'imageLibrary-edit-renderData'
)
},
},
methods
:
{
methods
:
{
getSrc
(
key
,
val
)
{
//打开相似图片dialog弹窗
showImagesDialog
()
{
// console.log(this.images.selects)
this
.
selectsArr
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
images
.
selects
))
this
.
images
.
visible
=
true
;
},
//相似图片弹窗图片列表切换页面方法
currentChange
(
val
)
{
this
.
images
.
pageInfo
.
page
=
val
;
this
.
getAllImages
();
},
//选择相似图片确定按钮
confirm
()
{
if
(
this
.
selectsArr
.
length
<=
0
)
{
this
.
$message
.
info
(
'至少选出一个'
)
return
;
}
this
.
images
.
visible
=
false
;
this
.
ruleForm
.
relatedIds
=
this
.
selectsArr
.
toString
();
this
.
images
.
selects
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
selectsArr
));
},
//选择相似图片
select
(
item
)
{
let
selects
=
this
.
selectsArr
;
let
index
=
selects
.
indexOf
(
item
.
id
+
''
)
if
(
index
>
-
1
)
{
selects
.
splice
(
index
,
1
)
}
else
{
selects
.
push
(
item
.
id
+
''
)
}
this
.
selectsArr
=
selects
},
//获取所有相似图像
getAllImages
()
{
getAll
(
this
.
images
.
pageInfo
).
then
(
res
=>
{
this
.
images
.
datas
=
res
.
data
.
data
this
.
images
.
total
=
res
.
data
.
totalCount
})
},
//上传图片,获取图片地址
getSrc
(
key
,
val
,
info
)
{
let
rule
=
[
'imageInfoRelationList'
];
let
rule
=
[
'imageInfoRelationList'
];
if
(
rule
.
includes
(
key
))
{
this
.
ruleForm
[
key
].
url
=
val
;
if
(
rule
.
includes
(
key
)
&&
info
)
{
this
.
ruleForm
[
key
]
=
{
url
:
val
,
price
:
this
.
ruleForm
[
key
].
price
,
fileWidth
:
info
.
width
+
'*'
+
info
.
height
,
fileSize
:
info
.
size
}
this
.
$set
(
this
.
ruleForm
.
paramJson
,
'fileType'
,
info
.
type
)
}
else
{
}
else
{
this
.
ruleForm
[
key
]
=
val
;
this
.
ruleForm
[
key
]
=
val
;
}
}
// console.log(key, this.ruleForm[key])
},
},
//点击编辑的时候,获取表格行数据,渲染edit页面
renderData
(
val
)
{
renderData
(
val
)
{
this
.
ruleForm
=
val
//获取详情
console
.
log
(
'bus end'
,
this
.
ruleForm
)
// getDetail(val.id).then(res => {
// let val = res.data;
let
afterFormat
=
this
.
filterParams
(
val
);
let
data
=
JSON
.
parse
(
JSON
.
stringify
(
afterFormat
));
data
.
paramJson
=
JSON
.
parse
(
data
.
paramJson
);
data
.
imageInfoRelationList
=
data
.
imageInfoRelationList
[
0
];
data
.
coverImg
=
data
.
coverImg
||
''
;
this
.
ruleForm
=
data
;
this
.
images
.
selects
=
this
.
ruleForm
.
relatedIds
.
split
(
','
)
//相似图片转为数组格式
// console.log('bus end', this.ruleForm);
// })
},
},
//返回上一页
goBack
()
{
goBack
()
{
this
.
$emit
(
'change'
,
'
l
ist'
)
this
.
$emit
(
'change'
,
'
L
ist'
)
},
},
//过滤多余属性
filterParams
(
obj
)
{
let
p
=
{}
let
b
=
[
'isDel'
,
'status'
,
'updTime'
,
'crtTime'
,
'allowCustom'
,
'rank'
,
'relationId'
,
'similarImageList'
]
for
(
let
key
in
obj
)
{
if
(
!
b
.
includes
(
key
))
{
if
(
key
===
'imageInfoRelationList'
)
{
let
temp
=
this
.
filterParams
(
obj
[
key
][
0
])
obj
[
key
]
=
[
temp
];
}
p
[
key
]
=
obj
[
key
]
}
}
return
p
;
},
//提交
onSubmit
()
{
onSubmit
()
{
console
.
log
(
this
.
ruleForm
)
this
.
$refs
.
ruleForm
.
validate
((
valid
)
=>
{
this
.
$refs
.
ruleForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
alert
(
'submit!'
);
console
.
log
(
'submit'
)
this
.
updateFunc
();
//上传数据
}
else
{
}
else
{
console
.
log
(
'error submit!!'
);
console
.
log
(
'error submit!!'
);
return
false
;
return
false
;
...
@@ -189,31 +335,25 @@ export default {
...
@@ -189,31 +335,25 @@ export default {
});
});
},
},
// filterParams(obj) {
//添加/修改方法
// let p = {}
updateFunc
()
{
// let b = ['isDel', 'status', 'updTime', 'crtTime']
//转换数据格式
// for (let key in obj) {
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
ruleForm
));
// if (!b.includes(key)) {
// p[key] = obj[key]
params
.
paramJson
=
JSON
.
stringify
(
params
.
paramJson
);
// }
params
.
imageInfoRelationList
=
[
params
.
imageInfoRelationList
]
// }
// console.log(params)
// return p;
//执行方法
// },
update
(
params
).
then
(
res
=>
{
// //更新方法
if
(
res
.
status
==
200
)
{
// updateFunc(params) {
//返回上一页,更新列表
// params.rank = ~~params.rank;
this
.
goBack
();
// let datas = this.filterParams(params);
}
else
{
// update(datas).then(res => {
this
.
$message
.
error
(
res
.
message
);
// if (res.status == 200) {
}
// //返回上一页,更新列表
})
// this.goBack();
}
// } else {
// this.$message.error(res.message);
// }
// })
// }
}
}
}
}
</
script
>
</
script
>
...
@@ -240,4 +380,11 @@ export default {
...
@@ -240,4 +380,11 @@ export default {
.body
{
.body
{
padding
:
20px
50px
40px
padding
:
20px
50px
40px
}
}
.grid-content
{
border
:
1px
solid
transparent
;
}
.grid-content
:hover
,
.grid-content.active
{
border
:
1px
solid
#409eff
;
box-sizing
:
border-box
}
</
style
>
</
style
>
src/views/webSiteManagement/imageLibrary/index.vue
View file @
5109062d
...
@@ -33,7 +33,7 @@ export default {
...
@@ -33,7 +33,7 @@ export default {
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
if
(
!!
val
)
{
if
(
!!
val
)
{
this
.
$bus
.
$emit
(
'
satelliteIntroduction
-edit-renderData'
,
val
)
this
.
$bus
.
$emit
(
'
imageLibrary
-edit-renderData'
,
val
)
}
}
})
})
...
...
src/views/webSiteManagement/imageLibrary/list.vue
View file @
5109062d
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
<el-table-column
align=
"center"
type=
"index"
label=
"序号"
width=
"65"
></el-table-column>
<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=
"name"
></el-table-column>
<el-table-column
align=
"center"
label=
"产品类型"
prop=
"type"
></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=
"imageInfoRelationList
[0].f
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].pric
e"
></el-table-column>
<el-table-column
align=
"center"
label=
"状态"
>
<el-table-column
align=
"center"
label=
"状态"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
{{
getStatus
(
scope
.
row
.
status
)
}}
{{
getStatus
(
scope
.
row
.
status
)
}}
...
...
src/views/webSiteManagement/satelliteIntroduction/edit.vue
View file @
5109062d
...
@@ -39,7 +39,7 @@ export default {
...
@@ -39,7 +39,7 @@ export default {
methods
:
{
methods
:
{
renderData
(
val
)
{
renderData
(
val
)
{
this
.
formObject
.
formVal
=
val
this
.
formObject
.
formVal
=
val
console
.
log
(
'bus end'
,
this
.
formObject
.
formVal
)
//
console.log('bus end', this.formObject.formVal)
},
},
goBack
()
{
goBack
()
{
this
.
$emit
(
'change'
,
'List'
)
this
.
$emit
(
'change'
,
'List'
)
...
...
src/views/webSiteManagement/satelliteIntroduction/index.vue
View file @
5109062d
...
@@ -28,9 +28,7 @@ export default {
...
@@ -28,9 +28,7 @@ export default {
},
},
methods
:
{
methods
:
{
changePage
(
name
,
val
)
{
changePage
(
name
,
val
)
{
this
.
componentVal
=
name
this
.
componentVal
=
name
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
if
(
!!
val
)
{
if
(
!!
val
)
{
this
.
$bus
.
$emit
(
'satelliteIntroduction-edit-renderData'
,
val
)
this
.
$bus
.
$emit
(
'satelliteIntroduction-edit-renderData'
,
val
)
...
...
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