7 changed files with 953 additions and 617 deletions
@ -0,0 +1,458 @@
|
||||
<template> |
||||
<div> |
||||
<span class="tipsMy">带*数据为必填项</span> |
||||
<el-form |
||||
:model="editForm" |
||||
style="flex: 1; overflow: auto; margin: 20px;width: calc(100% - 40px);margin-top: 0;" |
||||
:disabled="readOnly"> |
||||
<el-row> |
||||
<el-col :span="8"> |
||||
<el-form-item label="年份:"> |
||||
<el-input v-model="editForm.year"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-form-item label="城市:"> |
||||
<el-input v-model="editForm.city"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-form-item label="GDP(亿元):"> |
||||
<el-input v-model="editForm.gdp"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="8"> |
||||
<el-form-item label="GDP增速(%):"> |
||||
<el-input v-model="editForm.gdpGrowth"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-form-item label="第一产业(亿元):"> |
||||
<el-input v-model="editForm.primaryIndustry"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-form-item label="第二产业(亿元):"> |
||||
<el-input v-model="editForm.secondIndustry"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="8"> |
||||
<el-form-item label="第三产业(亿元):"> |
||||
<el-input v-model="editForm.thirdIndustry"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-form-item label="城镇常住人口(万人):"> |
||||
<el-input v-model="editForm.urbanResidents"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-form-item label="常住人口(万人):"> |
||||
<el-input v-model="editForm.resident"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="8"> |
||||
<el-form-item label="城镇化率:"> |
||||
<el-input v-model="editForm.urbanRate"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-form-item label="主城九区常住人口(万人):"> |
||||
<el-input v-model="editForm.mainUrbanResidents"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-form-item label="城镇居民人均收入(元):"> |
||||
<el-input v-model="editForm.urbanPerIncome"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="8"> |
||||
<el-form-item label="城镇居民收入增速(%):"> |
||||
<el-input v-model="editForm.urbanIncomeIncrease"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-form-item label="房地产投资额(亿元):"> |
||||
<el-input v-model="editForm.realEstateInvest"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-form-item label="固定资产投资额(亿元):"> |
||||
<el-input v-model="editForm.fixedInvestments"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row style="margin-bottom: 40px;"> |
||||
<el-col :span="8"> |
||||
<el-form-item label="房地产占比:"> |
||||
<el-input v-model="editForm.perRealestate"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> </el-col> |
||||
<!-- <el-col :span="8">--> |
||||
<!-- <el-button v-show="!readOnly" @click="save">保存</el-button>--> |
||||
<!-- </el-col>--> |
||||
</el-row> |
||||
</el-form> |
||||
<div class="dialog_op"> |
||||
<el-button type="primary" @click="goBack" |
||||
>返回</el-button |
||||
> |
||||
<el-button type="primary" @click="save" v-show="!readOnly" |
||||
>保存</el-button |
||||
> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
queryList, |
||||
addData, |
||||
updateData, |
||||
delData, |
||||
exportHandLandToListExcel, |
||||
downloadHandLandTemplate, |
||||
} from "@/views/bigdata/api/city"; |
||||
export default { |
||||
name: "newCity", |
||||
data() { |
||||
return { |
||||
searchForm: { |
||||
// 公告序号 |
||||
annoId: "", |
||||
// 地块编号 |
||||
landCode: "", |
||||
// 土地用途 |
||||
landUsage: "", |
||||
// 公告日期 |
||||
annoDate: "", |
||||
}, |
||||
tableData: [], |
||||
// 列 |
||||
cols: [ |
||||
{ |
||||
label: "年份", |
||||
prop: "year", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "城市", |
||||
prop: "city", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "GDP(亿元)", |
||||
prop: "gdp", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "GDP增速(%)", |
||||
prop: "gdpGrowth", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "第一产业(亿元)", |
||||
prop: "primaryIndustry", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "第二产业(亿元)", |
||||
prop: "secondIndustry", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "第三产业(亿元)", |
||||
prop: "thirdIndustry", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "城镇常住人口(万人)", |
||||
prop: "urbanResidents", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "常住人口(万人)", |
||||
prop: "resident", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "城镇化率", |
||||
prop: "urbanRate", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "主城九区常住人口(万人)", |
||||
prop: "mainUrbanResidents", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "城镇居民人均收入(元)", |
||||
prop: "urbanPerIncome", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "城镇居民收入增速(%)", |
||||
prop: "urbanIncomeIncrease", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "房地产投资额(亿元)", |
||||
prop: "realEstateInvest", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "固定资产投资额(亿元)", |
||||
prop: "fixedInvestments", |
||||
width: 150, |
||||
}, |
||||
{ |
||||
label: "房地产占比(%)", |
||||
prop: "perRealestate", |
||||
width: 150, |
||||
}, |
||||
], |
||||
// 表格加载 |
||||
loading: false, |
||||
// 选中的数据 |
||||
selectedData: [], |
||||
page: { |
||||
total: 0, // 总页数 |
||||
currentPage: 1, // 当前页数 |
||||
pageSize: 10, // 每页显示多少条 |
||||
}, |
||||
// 只读 |
||||
readOnly: true, |
||||
// 有选中数据 |
||||
hasSelectData: false, |
||||
// 编辑或新增窗口 |
||||
dialogFormVisible: false, |
||||
dialogTitle: "新增数据", |
||||
// 编辑Form |
||||
editForm: {}, |
||||
}; |
||||
}, |
||||
created() { |
||||
let newObj = {}; |
||||
for (let col of this.cols) { |
||||
newObj[col.prop] = ""; |
||||
} |
||||
this.editForm = newObj; |
||||
if (this.$route.query.readOnly==='true'){ |
||||
this.readOnly = true; |
||||
let row=JSON.parse(this.$route.query.data) |
||||
this.editForm = row; |
||||
}else { |
||||
this.readOnly = false; |
||||
} |
||||
if (this.$route.query.isEditOr==='true'){ |
||||
let row=JSON.parse(this.$route.query.data) |
||||
this.editForm = row; |
||||
} |
||||
}, |
||||
methods: { |
||||
goBack(){ |
||||
window.history.back() |
||||
}, |
||||
// 清空选中 |
||||
clearSelection() { |
||||
this.$refs.multipleTable.clearSelection(); |
||||
}, |
||||
|
||||
// 查询 |
||||
onSubmit() { |
||||
this.tableLoading = true; |
||||
let param = Object.assign( |
||||
{ |
||||
current: this.page.currentPage, |
||||
size: this.page.pageSize, |
||||
}, |
||||
this.searchForm |
||||
); |
||||
queryList(param).then((response) => { |
||||
this.tableData = response.data.data.records; |
||||
this.page.total = response.data.data.total; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
|
||||
// 重置 |
||||
onReset() { |
||||
for (let item in this.searchForm) { |
||||
this.searchForm[item] = ""; |
||||
} |
||||
}, |
||||
|
||||
handleSizeChange(val) { |
||||
this.page.pageSize = val; |
||||
}, |
||||
|
||||
handleCurrentChange(val) { |
||||
this.page.currentPage = val; |
||||
}, |
||||
|
||||
// 选中更改 |
||||
handleSelectionChange(val) { |
||||
this.selectedData = val; |
||||
}, |
||||
|
||||
// 新建 |
||||
newItem() { |
||||
// 从cols里面拷贝字段 |
||||
let newObj = {}; |
||||
for (let col of this.cols) { |
||||
newObj[col.prop] = ""; |
||||
} |
||||
this.editForm = newObj; |
||||
this.readOnly = false; |
||||
this.dialogFormVisible = true; |
||||
}, |
||||
|
||||
// 编辑 |
||||
editItem(row) { |
||||
this.dialogTitle = "编辑数据"; |
||||
this.readOnly = false; |
||||
this.dialogFormVisible = true; |
||||
this.editForm = row; |
||||
}, |
||||
|
||||
// 删除单个 |
||||
delItem(row) { |
||||
delData(row.data_id).then((res) => { |
||||
console.debug(res); |
||||
}); |
||||
}, |
||||
|
||||
// 查看 |
||||
viewItem(row) { |
||||
this.dialogTitle = "查看数据"; |
||||
this.readOnly = true; |
||||
this.dialogFormVisible = true; |
||||
this.editForm = row; |
||||
}, |
||||
|
||||
// 保存 |
||||
save() { |
||||
if (!this.$route.query.isEditOr) { |
||||
addData(this.editForm).then((res) => { |
||||
this.dialogFormVisible = false; |
||||
if (res.data.success) { |
||||
this.$message("保存成功"); |
||||
window.history.back() |
||||
} else { |
||||
console.debug(res); |
||||
this.$message.error("保存失败"); |
||||
} |
||||
}); |
||||
} else{ |
||||
updateData(this.editForm).then((res) => { |
||||
if (res.data.success) { |
||||
this.$message("保存成功"); |
||||
window.history.back() |
||||
} else { |
||||
console.debug(res); |
||||
this.$message.error("保存失败"); |
||||
} |
||||
}); |
||||
} |
||||
}, |
||||
|
||||
// 下载模板 |
||||
downloadTemplate() { |
||||
downloadHandLandTemplate().then((res) => { |
||||
let url = res.data.data; |
||||
downUrlFile(url); |
||||
}); |
||||
}, |
||||
|
||||
// 导出数据 |
||||
exportData() { |
||||
if (this.selectedData.length < 1) { |
||||
this.$message({ |
||||
message: "未选中数据", |
||||
type: "warning", |
||||
}); |
||||
return; |
||||
} |
||||
//proposedseriaId |
||||
let ids = []; |
||||
for (let item of this.selectedData) { |
||||
ids.push(item["proposedseriaId"]); |
||||
} |
||||
console.debug(ids); |
||||
exportHandLandToListExcel(ids.toString()).then((res) => { |
||||
console.debug(res); |
||||
}); |
||||
}, |
||||
}, |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="less"> |
||||
/deep/ .el-collapse-item__header{ |
||||
padding: 0 20px; |
||||
} |
||||
/deep/ .el-input { |
||||
width: 90%; |
||||
} |
||||
/deep/ .el-collapse-item { |
||||
margin-bottom: 10px; |
||||
padding-left: 10px; |
||||
background-color: white; |
||||
} |
||||
|
||||
/deep/ .el-collapse-item__wrap { |
||||
border-top: 1px solid #e8eaec; |
||||
} |
||||
/deep/ .upload-demo { |
||||
text-align: center; |
||||
} |
||||
/deep/ .el-upload__tip { |
||||
text-align: right; |
||||
} |
||||
.ti-box { |
||||
span { |
||||
font-size: 1rem; |
||||
} |
||||
} |
||||
|
||||
.dialog_op { |
||||
position: absolute; |
||||
left: 0; |
||||
bottom: 0; |
||||
width: 100%; |
||||
text-align: right; |
||||
background-color: white; |
||||
border-top: 1px solid #e8eaec; |
||||
padding: 5px; |
||||
z-index: 99999; |
||||
} |
||||
.tipsMy{ |
||||
font-size: 11px; |
||||
margin-left: 20px; |
||||
margin-top: 20px; |
||||
display: inline-block; |
||||
} |
||||
/deep/ .el-row{ |
||||
padding: 0 20px; |
||||
margin-top: 20px; |
||||
padding-top: 10px; |
||||
background-color: white; |
||||
box-shadow: 0px 5px 20px 0px rgba(208, 208, 208, 0.18); |
||||
} |
||||
/deep/ .el-form-item{ |
||||
display: flex; |
||||
padding-top: 20px; |
||||
} |
||||
/deep/ .el-form-item__label{ |
||||
width: 180px; |
||||
} |
||||
</style> |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue