Commit 79ed7bcd authored by obt's avatar obt

代码更新

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