d078f4cd by weimo934

feat(fxdr):属性导入

1 parent aa47701f
...@@ -208,3 +208,4 @@ export function registerCall(data) { ...@@ -208,3 +208,4 @@ export function registerCall(data) {
208 data:data 208 data:data
209 }) 209 })
210 } 210 }
211
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
67 <li @click="exportToShp">ESRI Shape</li> 67 <li @click="exportToShp">ESRI Shape</li>
68 </ul> 68 </ul>
69 </li> 69 </li>
70 <li v-show="isZD">导入属性</li> 70 <li v-show="isZD" @click="drsx">导入属性</li>
71 <li v-show="!isZD">导入楼盘</li> 71 <li v-show="!isZD">导入楼盘</li>
72 <li>重叠分析</li> 72 <li>重叠分析</li>
73 <li v-show="isZD && (zdQszt == '1' || zdQszt == '2')" @click="openCreateDialog">添加定着物</li> 73 <li v-show="isZD && (zdQszt == '1' || zdQszt == '2')" @click="openCreateDialog">添加定着物</li>
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
108 <el-dialog title="新建" :visible.sync="dialogVisible" width="48%"> 108 <el-dialog title="新建" :visible.sync="dialogVisible" width="48%">
109 <Create @closeDialog="closeDialog" :auth="true"></Create> 109 <Create @closeDialog="closeDialog" :auth="true"></Create>
110 </el-dialog> 110 </el-dialog>
111 <sxdr :sxdr-visible="sxdrVisible" @close="sxdrClose" :dylx="zdData.type" :bsm="zdData.bsm"></sxdr>
111 </div> 112 </div>
112 </template> 113 </template>
113 <script> 114 <script>
...@@ -119,6 +120,7 @@ import geoUtils from "@components/lineTree/tx/js/geoUtils"; ...@@ -119,6 +120,7 @@ import geoUtils from "@components/lineTree/tx/js/geoUtils";
119 import featureUpdate from "@libs/map/featureUpdate"; 120 import featureUpdate from "@libs/map/featureUpdate";
120 import {deleteLjz,deleteZdy} from "./../../api/lpb" 121 import {deleteLjz,deleteZdy} from "./../../api/lpb"
121 import exportTemJson from '@/assets/json/exportTemplate.json' 122 import exportTemJson from '@/assets/json/exportTemplate.json'
123 import sxdr from './../../components/sxdr/sxdr'
122 export default { 124 export default {
123 inheritAttrs: false, 125 inheritAttrs: false,
124 props: { 126 props: {
...@@ -132,10 +134,11 @@ export default { ...@@ -132,10 +134,11 @@ export default {
132 default: false, 134 default: false,
133 } 135 }
134 }, 136 },
135 components: { lineItem,Create,ImportGeo }, 137 components: { lineItem,Create,ImportGeo,sxdr },
136 mixins:[geoUtils,featureUpdate], 138 mixins:[geoUtils,featureUpdate],
137 data() { 139 data() {
138 return { 140 return {
141 sxdrVisible:false,
139 selectedDetail: {}, 142 selectedDetail: {},
140 timer: {}, 143 timer: {},
141 formatData: [], 144 formatData: [],
...@@ -195,6 +198,12 @@ export default { ...@@ -195,6 +198,12 @@ export default {
195 }, 198 },
196 199
197 methods: { 200 methods: {
201 drsx(){
202 this.sxdrVisible=true;
203 },
204 sxdrClose(){
205 this.sxdrVisible=false;
206 },
198 loading(){ 207 loading(){
199 this.$emit("loading") 208 this.$emit("loading")
200 }, 209 },
......
1 <template>
2 <div>
3 <el-dialog
4 title="属性导入"
5 :visible.sync="isVisible"
6 width="30%"
7 :before-close="close">
8 <div class="main-button">
9 <el-upload
10 class="upload-demo"
11 :action="uploadUrl"
12 :data="sxdrData"
13 :on-success="uploadSuccess"
14 :show-file-list="false"
15 multiple
16 >
17 <el-button type="primary">上传</el-button>
18 <el-button type="primary" @click="downloadTemplate">下载模板</el-button>
19 </el-upload>
20 </div>
21 <ul>
22 <li v-for="(item,index) in errorData" :key="index">{{item}}</li>
23 </ul>
24 <span slot="footer" class="dialog-footer">
25 <el-button @click="dialogVisible = false">取 消</el-button>
26 <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
27 </span>
28 </el-dialog>
29 </div>
30 </template>
31
32 <script>
33
34 export default {
35 name: "sxdr",
36 props: {
37 sxdrVisible: {
38 type: Boolean,
39 default: false
40 },
41 dylx: {
42 type: String,
43 },
44 bsm: {
45 type: String
46 }
47 },
48 data() {
49 return {
50 uploadUrl: '',
51 isVisible: false,
52 sxdrData: {
53 bsm: ''
54 },
55 errorData:[]
56 }
57 },
58 mounted(){
59 this.$store.state.sxdrType='';
60 },
61 methods: {
62 loading(){
63 debugger
64 switch (this.dylx) {
65 case "zd":
66 this.$store.state.sxdrType='zd';
67 break;
68 case "dz":
69 this.$store.state.sxdrType='dz';
70 break;
71 case "zrz":
72 this.$store.state.sxdrType='zrz';
73 break;
74 case "h":
75 this.$store.state.sxdrType="h";
76 break;
77 default:
78 break;
79 }
80 },
81 reset(){
82 this.errorData=[];
83 this.uploadUrl='';
84 this.sxdrData={bsm:''};
85 this.$store.state.sxdrType='';
86 },
87 close() {
88 this.$emit('close')
89 this.reset();
90 },
91 downloadTemplate() {
92 window.open(`/api/tx/excelGeo/zdTemplate?type=`+this.dylx);
93 },
94 uploadSuccess(res, file, fileList) {
95 if (res.success) {
96 this.$message.success("上传成功")
97 this.loading();
98 this.close()
99 } else {
100 this.$message.error("上传失败")
101 this.errorData=res.result
102 }
103 }
104 },
105 watch: {
106 sxdrVisible(val) {
107 this.isVisible = val;
108 },
109 dylx(val) {
110 switch (val) {
111 case "zd":
112 this.uploadUrl = "/api/tx/excelGeo/Zdimport";
113 break;
114 default:
115 break;
116 }
117 },
118 bsm(val) {
119 this.sxdrData.bsm = val;
120 }
121 }
122 }
123 </script>
124
125 <style scoped lang="less">
126 .main-button{
127 display: -webkit-flex;
128 display: flex;
129 flex-direction: column-reverse;
130 flex-wrap:nowrap;
131 }
132 ul{
133 margin-top: 20px;
134 li{
135 line-height: 15px;
136 color: red;
137 }
138 }
139 </style>
...@@ -15,6 +15,7 @@ const store = new Vuex.Store({ ...@@ -15,6 +15,7 @@ const store = new Vuex.Store({
15 zdmj: '', // 宗地面积 15 zdmj: '', // 宗地面积
16 zdzl: '', // 宗地坐落 16 zdzl: '', // 宗地坐落
17 rightClickZdbsm:'', //右键菜单传入的zdbsm 17 rightClickZdbsm:'', //右键菜单传入的zdbsm
18 sxdrType:'', // zd/zrz/dz/h 导入属性刷新数据
18 tdytList:[], 19 tdytList:[],
19 tddjList:[], 20 tddjList:[],
20 qlxzList:[], 21 qlxzList:[],
......
...@@ -766,7 +766,7 @@ export default { ...@@ -766,7 +766,7 @@ export default {
766 }); 766 });
767 } 767 }
768 }) 768 })
769 769
770 770
771 } 771 }
772 772
...@@ -885,7 +885,14 @@ export default { ...@@ -885,7 +885,14 @@ export default {
885 zdbsm:function (val) { 885 zdbsm:function (val) {
886 this.getZdjbxxData(val) 886 this.getZdjbxxData(val)
887 this.curZdbsm = val; 887 this.curZdbsm = val;
888 } 888 },
889 "$store.state.sxdrType": function (val) {
890 debugger
891 this.$message.success(val);
892 if (val==='zd'){
893 this.getZdjbxxData(this.$store.state.zdbsm)
894 }
895 },
889 }, 896 },
890 }; 897 };
891 </script> 898 </script>
......