Commit 79ed7bcd authored by obt's avatar obt

代码更新

parents 30f42908 26d5f833
......@@ -161,7 +161,7 @@ export default {
status: this.searchForm.status || null,
title: this.searchForm.title,
page: 1,
limit: 20
limit: 10
}
this.getList();
},
......@@ -176,7 +176,7 @@ export default {
status: this.searchForm.status || null,
title: this.searchForm.title,
page: 1,
limit: 20
limit: 10
}
this.getList()
},
......
......@@ -281,12 +281,11 @@ export default {
this.ruleForm[key] = val;
}
// console.log(key, this.ruleForm[key])
},
//点击编辑的时候,获取表格行数据,渲染edit页面
renderData(val) {
renderData(params) {
//获取详情
let val = params;
let afterFormat = this.filterParams(val);
let data = JSON.parse(JSON.stringify(afterFormat));
......
<template>
<div class="container">
<component :is="componentVal" @change="changePage"></component>
<component :is="componentVal" @change="changePage" @recordPageInfo="recordPageInfo"></component>
</div>
</template>
......@@ -20,26 +20,36 @@ export default {
data() {
return {
componentVal: 'List',
datas: null
pageInfo: {
status: null,
type: null,
title: '',
page: 1,
limit: 10
},
datas: null,
}
},
mounted() {
},
methods: {
changePage(name, val) {
recordPageInfo(page) {
this.pageInfo.status = page.status || null;
this.pageInfo.type = page.type || null;
this.pageInfo.title = page.title || '';
this.pageInfo.page = page.page;
this.pageInfo.limit = page.limit;
},
changePage(name, val = null) {
this.componentVal = name
this.$nextTick(() => {
if (!!val) {
if (name == 'Edit' && val) {
this.$bus.$emit('imageLibrary-edit-renderData', val)
}
})
}
}
}
......
......@@ -8,12 +8,12 @@
<div class="filter-container">
<el-form :inline="true" :model="searchForm" class="demo-form-inline">
<el-form-item label="所有状态">
<el-select v-model="searchForm.status">
<el-select v-model="searchForm.status" clearable>
<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="影像分类">
<el-select v-model="searchForm.type">
<el-select v-model="searchForm.type" clearable>
<el-option v-for="(item, index) in imageTypes" :key="index" :label="item" :value="~~index"></el-option>
</el-select>
</el-form-item>
......@@ -50,8 +50,9 @@
<el-pagination
background
layout="prev, pager, next"
:page-size="listQuery.limit"
:total="total" @current-change="currentChange">
:total="~~total"
:current-page="listQuery.page"
@current-change="currentChange">
</el-pagination>
</div>
......@@ -69,19 +70,16 @@ export default {
data() {
return {
data: null,//原数据
list: null,//赋值数据 | 过滤数据
total: null,
list: [],//赋值数据 | 过滤数据
total: 100,
listLoading: true,//请求加载状态
//请求参数。页码页数等
listQuery: {
page: 1,
limit: 10
},
listQuery: this.$parent.pageInfo,
//搜索表单
searchForm: {
status: 0,
type: 0,
title: ""
status: this.$parent.pageInfo.status,
type: this.$parent.pageInfo.type,
title: this.$parent.pageInfo.title
},
//添加banner与修改banner的form对象
editForm: satelliteIntroduction.init(),//提交的表单参数
......@@ -89,25 +87,29 @@ export default {
editFormRules: satelliteIntroduction.rules,//表单规则
//是否启用,1、启用,2、禁用
bannerStatus: {
0: '全部',
// 0: '全部',
1: '启用',
2: '禁用',
},
imageTypes: {
//1--影像美图 2--专题图 3--遥感成果图
0: '全部',
// 0: '全部',
1: '影像美图',
2: '专题图',
3: '遥感成果图',
},
dialogVisible: false,
dialogTitle: "新增卫星",
dialogTitle: "新增卫星"
}
},
mounted() {
this.getList()
},
methods: {
changePageInfo(page) {
// this.listQuery = page;
this.$emit('recordPageInfo', page)
},
//搜索按钮
search() {
this.listQuery = {
......@@ -117,6 +119,7 @@ export default {
page: 1,
limit: 10
}
this.changePageInfo(this.listQuery)
this.getList();
},
//清除搜索
......@@ -133,11 +136,15 @@ export default {
page: 1,
limit: 10
}
this.changePageInfo(this.listQuery)
this.getList()
},
//切换页码
currentChange(val) {
this.listQuery.page = val;
this.changePageInfo(this.listQuery)
this.getList();
},
//编辑
......@@ -202,16 +209,18 @@ export default {
getList() {
this.listLoading = true;
page(this.listQuery).then(res => {
this.data = res.data.data;
this.total = res.data.totalCount;
this.listLoading = false;
this.list = res.data.data;
this.list = this.list.map(v => {
v.paramJson = JSON.parse(v.paramJson)
return v
})
console.log(222222, this.list)
this.data = res.data.data;
this.total = res.data.totalCount;
this.listLoading = false;
}).catch(err => {
console.log("error",err)
this.listLoading = false;
})
}
......
......@@ -38,13 +38,15 @@ export default {
this.$bus.$on('satelliteIntroduction-edit-renderData', this.renderData)
},
methods: {
//渲染数据
renderData(val) {
this.formObject.formVal = val
// console.log('bus end', this.formObject.formVal)
},
//返回上一页
goBack() {
this.$emit('change', 'List')
},
//将后端参数过滤掉不需要传给后端的参数
filterParams(obj) {
let p = {}
let b = ['isDel', 'status', 'updTime', 'crtTime']
......
<template>
<div class="container">
<component :is="componentVal" @change="changePage"></component>
<component :is="componentVal" @change="changePage" @recordPageInfo="recordPageInfo"></component>
</div>
</template>
......@@ -20,24 +20,32 @@ export default {
data() {
return {
componentVal: 'List',
datas: null
datas: null,
pageInfo: {
status: null,
name: null,
page: 1,
limit: 10
}
}
},
mounted() {
},
methods: {
changePage(name, val) {
recordPageInfo(page) {
this.pageInfo.status = page.status || null;
this.pageInfo.name = page.name || null;
this.pageInfo.page = page.page;
this.pageInfo.limit = page.limit;
},
changePage(name, val = null) {
this.componentVal = name
this.$nextTick(() => {
if (!!val) {
if (name == 'Edit' && val) {
this.$bus.$emit('satelliteIntroduction-edit-renderData', val)
}
})
}
}
}
......
......@@ -8,7 +8,7 @@
<div class="filter-container">
<el-form :inline="true" :model="searchForm" class="demo-form-inline">
<el-form-item label="所有状态">
<el-select v-model="searchForm.status">
<el-select v-model="searchForm.status" clearable>
<el-option v-for="(item, index) in bannerStatus" :key="index" :label="item" :value="~~index"></el-option>
</el-select>
</el-form-item>
......@@ -59,6 +59,7 @@
background
layout="prev, pager, next"
:page-size="listQuery.limit"
:current-page="listQuery.page"
:total="total" @current-change="currentChange">
</el-pagination>
</div>
......@@ -88,14 +89,11 @@ export default {
total: null,
listLoading: true,//请求加载状态
//请求参数。页码页数等
listQuery: {
page: 1,
limit: 10
},
listQuery: this.$parent.pageInfo,
//搜索表单
searchForm: {
status: 0,
name: ""
status: this.$parent.pageInfo.status,
name: this.$parent.pageInfo.name
},
//添加banner与修改banner的form对象
editForm: satelliteIntroduction.init(),//提交的表单参数
......@@ -103,7 +101,7 @@ export default {
editFormRules: satelliteIntroduction.rules,//表单规则
//是否启用,1、启用,2、禁用
bannerStatus: {
0: '全部',
// 0: '全部',
1: '启用',
2: '禁用',
},
......@@ -115,20 +113,18 @@ export default {
this.getList()
},
methods: {
closePreview() {
this.currentIcon.showPreview = false;
},
showPreview(url){
this.currentIcon.showPreview = true
this.currentIcon.url = url
changePageInfo(page) {
this.$emit('recordPageInfo', page)
},
search() {
this.listQuery = {
status: this.searchForm.status || null,
name: this.searchForm.name,
name: this.searchForm.name || null,
page: 1,
limit: 10
}
this.changePageInfo(this.listQuery)
this.getList();
},
//清除搜索
......@@ -140,15 +136,18 @@ export default {
this.listQuery = {
status: this.searchForm.status || null,
name: this.searchForm.name,
name: this.searchForm.name || null,
page: 1,
limit: 10
}
this.changePageInfo(this.listQuery)
this.getList()
},
//切换页码
currentChange(val) {
this.listQuery.page = val;
this.changePageInfo(this.listQuery)
this.getList();
},
//编辑
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment