d078f4cd by weimo934

feat(fxdr):属性导入

1 parent aa47701f
......@@ -208,3 +208,4 @@ export function registerCall(data) {
data:data
})
}
......
......@@ -67,7 +67,7 @@
<li @click="exportToShp">ESRI Shape</li>
</ul>
</li>
<li v-show="isZD">导入属性</li>
<li v-show="isZD" @click="drsx">导入属性</li>
<li v-show="!isZD">导入楼盘</li>
<li>重叠分析</li>
<li v-show="isZD && (zdQszt == '1' || zdQszt == '2')" @click="openCreateDialog">添加定着物</li>
......@@ -108,6 +108,7 @@
<el-dialog title="新建" :visible.sync="dialogVisible" width="48%">
<Create @closeDialog="closeDialog" :auth="true"></Create>
</el-dialog>
<sxdr :sxdr-visible="sxdrVisible" @close="sxdrClose" :dylx="zdData.type" :bsm="zdData.bsm"></sxdr>
</div>
</template>
<script>
......@@ -119,6 +120,7 @@ import geoUtils from "@components/lineTree/tx/js/geoUtils";
import featureUpdate from "@libs/map/featureUpdate";
import {deleteLjz,deleteZdy} from "./../../api/lpb"
import exportTemJson from '@/assets/json/exportTemplate.json'
import sxdr from './../../components/sxdr/sxdr'
export default {
inheritAttrs: false,
props: {
......@@ -132,10 +134,11 @@ export default {
default: false,
}
},
components: { lineItem,Create,ImportGeo },
components: { lineItem,Create,ImportGeo,sxdr },
mixins:[geoUtils,featureUpdate],
data() {
return {
sxdrVisible:false,
selectedDetail: {},
timer: {},
formatData: [],
......@@ -195,6 +198,12 @@ export default {
},
methods: {
drsx(){
this.sxdrVisible=true;
},
sxdrClose(){
this.sxdrVisible=false;
},
loading(){
this.$emit("loading")
},
......
<template>
<div>
<el-dialog
title="属性导入"
:visible.sync="isVisible"
width="30%"
:before-close="close">
<div class="main-button">
<el-upload
class="upload-demo"
:action="uploadUrl"
:data="sxdrData"
:on-success="uploadSuccess"
:show-file-list="false"
multiple
>
<el-button type="primary">上传</el-button>
<el-button type="primary" @click="downloadTemplate">下载模板</el-button>
</el-upload>
</div>
<ul>
<li v-for="(item,index) in errorData" :key="index">{{item}}</li>
</ul>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: "sxdr",
props: {
sxdrVisible: {
type: Boolean,
default: false
},
dylx: {
type: String,
},
bsm: {
type: String
}
},
data() {
return {
uploadUrl: '',
isVisible: false,
sxdrData: {
bsm: ''
},
errorData:[]
}
},
mounted(){
this.$store.state.sxdrType='';
},
methods: {
loading(){
debugger
switch (this.dylx) {
case "zd":
this.$store.state.sxdrType='zd';
break;
case "dz":
this.$store.state.sxdrType='dz';
break;
case "zrz":
this.$store.state.sxdrType='zrz';
break;
case "h":
this.$store.state.sxdrType="h";
break;
default:
break;
}
},
reset(){
this.errorData=[];
this.uploadUrl='';
this.sxdrData={bsm:''};
this.$store.state.sxdrType='';
},
close() {
this.$emit('close')
this.reset();
},
downloadTemplate() {
window.open(`/api/tx/excelGeo/zdTemplate?type=`+this.dylx);
},
uploadSuccess(res, file, fileList) {
if (res.success) {
this.$message.success("上传成功")
this.loading();
this.close()
} else {
this.$message.error("上传失败")
this.errorData=res.result
}
}
},
watch: {
sxdrVisible(val) {
this.isVisible = val;
},
dylx(val) {
switch (val) {
case "zd":
this.uploadUrl = "/api/tx/excelGeo/Zdimport";
break;
default:
break;
}
},
bsm(val) {
this.sxdrData.bsm = val;
}
}
}
</script>
<style scoped lang="less">
.main-button{
display: -webkit-flex;
display: flex;
flex-direction: column-reverse;
flex-wrap:nowrap;
}
ul{
margin-top: 20px;
li{
line-height: 15px;
color: red;
}
}
</style>
......@@ -15,6 +15,7 @@ const store = new Vuex.Store({
zdmj: '', // 宗地面积
zdzl: '', // 宗地坐落
rightClickZdbsm:'', //右键菜单传入的zdbsm
sxdrType:'', // zd/zrz/dz/h 导入属性刷新数据
tdytList:[],
tddjList:[],
qlxzList:[],
......
......@@ -766,7 +766,7 @@ export default {
});
}
})
}
......@@ -885,7 +885,14 @@ export default {
zdbsm:function (val) {
this.getZdjbxxData(val)
this.curZdbsm = val;
}
},
"$store.state.sxdrType": function (val) {
debugger
this.$message.success(val);
if (val==='zd'){
this.getZdjbxxData(this.$store.state.zdbsm)
}
},
},
};
</script>
......