From 409fcd6f448f4526e860dfd9706098087a5efed5 Mon Sep 17 00:00:00 2001 From: aixianling Date: Sat, 7 May 2022 18:14:37 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=A0=87=E7=BB=98=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/grid/AppGridBlock/components/add.vue | 256 +++--------------- .../grid/AppGridBlock/components/list.vue | 244 ++--------------- .../AppGridBlock/components/mapPlotting.vue | 173 ++++++++++++ 3 files changed, 234 insertions(+), 439 deletions(-) create mode 100644 project/sass/apps/grid/AppGridBlock/components/mapPlotting.vue diff --git a/project/sass/apps/grid/AppGridBlock/components/add.vue b/project/sass/apps/grid/AppGridBlock/components/add.vue index 6bddb6cb..dc768f6b 100644 --- a/project/sass/apps/grid/AppGridBlock/components/add.vue +++ b/project/sass/apps/grid/AppGridBlock/components/add.vue @@ -50,7 +50,7 @@ - 地图标绘 + 地图标绘 @@ -65,56 +65,19 @@ - -
-
- -
-
-
- - 开始编辑 - 结束编辑 - - - 开始绘制多边形 - - 清除绘制 - -
- + +
@@ -412,40 +233,31 @@ export default { display: none !important; } + ::v-deep.fullscreenMap { + .el-dialog { + display: flex; + flex-direction: column; + + .el-dialog__body { + padding: 0; + flex: 1; + min-height: 0; + + .ai-dialog__content { + max-height: unset !important; + padding-bottom: 0; + height: 100%; + + .ai-dialog__content--wrapper { + padding-right: 0 !important; + } + } + } + } + } + .footer-btn { width: 92px; } - - .map { - width: 780px; - position: relative; - overflow: hidden; - - .container { - width: 760px; - height: 420px; - border-radius: 2px; - border: 1px solid #d0d4dc; - } - - #panel { - position: absolute; - height: 400px; - right: 30px; - top: 20px; - width: 280px; - overflow: hidden; - z-index: 10000; - } - - .tipinput { - position: absolute; - width: 200px; - height: 38px; - left: 20px; - top: 20px; - z-index: 10000; - } - } } diff --git a/project/sass/apps/grid/AppGridBlock/components/list.vue b/project/sass/apps/grid/AppGridBlock/components/list.vue index 4a5b4cc4..f34c728a 100644 --- a/project/sass/apps/grid/AppGridBlock/components/list.vue +++ b/project/sass/apps/grid/AppGridBlock/components/list.vue @@ -129,56 +129,17 @@ -
-
- -
-
-
- - 开始编辑 - - 结束编辑 - - - 开始绘制多边形 - - - 清除绘制 - -
+
import AMapLoader from "@amap/amap-jsapi-loader"; +import MapPlotting from "./mapPlotting"; export default { name: "List", + components: {MapPlotting}, label: "网格区块", props: { instance: Function, @@ -244,7 +207,6 @@ export default { isEdit: false, searchId: "", fileList: [], - location: {}, dialog: false, gridInfo: {}, gridMemberColConfigs: [ @@ -257,7 +219,6 @@ export default { created() { this.getTreeList(); this.getList(); - this.getCorpLocation() this.dict.load("girdLevel", "girdType", "isLastLevel", "plottingStatus", "girdMemberType"); }, computed: { @@ -273,13 +234,6 @@ export default { }, }, methods: { - getCorpLocation() { - this.instance.post("/app/appdvcpconfig/getCorpLocation").then(res => { - if (res.code == 0) { - this.location = res.data - } - }) - }, handleNodeClick(val) { this.info = {...val}; this.searchId = val.id; @@ -392,140 +346,18 @@ export default { }, poltting(row) { this.showMap = true; + if (this.editRow.points?.length > 0) this.path = JSON.parse(JSON.stringify(this.editRow.points)) this.editRow = {...row}; - AMapLoader.load({ - key: "b553334ba34f7ac3cd09df9bc8b539dc", // 申请好的Web端开发者Key,首次调用 load 时必填 - version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - plugins: ["AMap.PolygonEditor", "AMap.MouseTool", "AMap.PlaceSearch"], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 - AMapUI: { - // 是否加载 AMapUI,缺省不加载 - version: "1.1", // AMapUI 缺省 1.1 - plugins: [], // 需要加载的 AMapUI ui插件 - }, - }) - .then((AMap) => { - this.map = new AMap.Map("container", { - resizeEnable: true, - zoom: 14, - }); - if (this.editRow.plottingStatus == 1) { - let path = []; - this.editRow.points.map((e, index) => { - path[index] = [e.lng, e.lat]; - }); - let polygon = new AMap.Polygon({ - path: path, - strokeColor: "#FF33FF", - strokeWeight: 6, - strokeOpacity: 0.2, - fillOpacity: 0.4, - fillColor: "#1791fc", - zIndex: 50, - bubble: true, - }); - this.map.add([polygon]); - this.map.setFitView(); - this.polyEditor = new AMap.PolygonEditor(this.map, polygon); - } else { - this.mouseTool = new AMap.MouseTool(this.map); - this.placeSearch = new AMap.PlaceSearch({ - pageSize: 3, // 单页显示结果条数 - pageIndex: 1, // 页码 - city: "", // 兴趣点城市 - citylimit: false, //是否强制限制在设置的城市内搜索 - map: this.map, // 展现结果的地图实例 - panel: "panel", // 结果列表将在此容器中进行展示。 - autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围 - }); - // this.map.setZoomAndCenter(14, [this.location.lng, this.location.lat], false, 600); - this.eventOn(); - } - }) - .catch((e) => { - console.log(e); - }); }, showEdit(id) { this.$router.push({hash: "#add", query: {id}}) }, - draw(type) { - switch (type) { - case "marker": { - this.mouseTool.marker({ - //同Marker的Option设置 - }); - break; - } - case "polyline": { - this.mouseTool.polyline({ - strokeColor: "#80d8ff", - //同Polyline的Option设置 - }); - break; - } - case "polygon": { - this.mouseTool.polygon({ - fillColor: "#00b0ff", - strokeColor: "#80d8ff", - borderWeight: 2, - strokeWeight: 4, - //同Polygon的Option设置 - }); - break; - } - case "rectangle": { - this.mouseTool.rectangle({ - fillColor: "#00b0ff", - strokeColor: "#80d8ff", - //同Polygon的Option设置 - }); - break; - } - case "circle": { - this.mouseTool.circle({ - fillColor: "#00b0ff", - strokeColor: "#80d8ff", - //同Circle的Option设置 - }); - break; - } - } - }, //map搜索 - addressChange(val) { - this.placeSearch.search(val); - }, - close() { - this.mouseTool.close(true); - }, - clear() { - this.map.remove(this.overlays); - this.overlays = []; - this.path = []; - }, - beginPoltting() { - this.polyEditor.open(); - }, - finishPoltting() { - this.polyEditor.close(); - }, confirm() { - let path = []; - if (this.editRow.plottingStatus == 1) { - this.polyEditor - .getTarget() - .getPath() - .map((e) => { - path.push({lng: e.lng, lat: e.lat}); - }); - } else { - path = [...this.path]; - } - delete this.editRow.points; + this.editRow.points = JSON.parse(JSON.stringify(this.path)); let {girdMemberNames} = this.editRow this.instance.post(`/app/appgirdinfo/addOrUpdate`, { ...this.editRow, - points: path, girdMemberNames: girdMemberNames?.toString() }).then((res) => { if (res.code == 0) { @@ -534,18 +366,6 @@ export default { } }); }, - eventOn() { - this.path = []; - this.overlays = []; - this.map.on("mousemove", this.showInfoMove, this); - this.mouseTool.on("draw", ({type, obj}) => { - obj.getPath().map((e) => { - console.log(e) - this.path.push({lat: e.getLat(), lng: e.getLng()}); - }); - this.overlays.push(obj); - }); - }, resetSearch() { Object.keys(this.searchObj).map((e) => { this.searchObj[e] = ""; @@ -638,38 +458,28 @@ export default { padding: 8px 0; } - .map { - width: 780px; - position: relative; - overflow: hidden; + ::v-deep.fullscreenMap { + .el-dialog { + display: flex; + flex-direction: column; - .container { - width: 760px; - height: 420px; - border-radius: 2px; - border: 1px solid #d0d4dc; - } + .el-dialog__body { + padding: 0; + flex: 1; + min-height: 0; - #panel { - position: absolute; - height: 400px; - right: 30px; - top: 20px; - width: 280px; - overflow: hidden; - z-index: 10000; - } + .ai-dialog__content { + max-height: unset !important; + padding-bottom: 0; + height: 100%; - .tipinput { - position: absolute; - width: 200px; - height: 38px; - left: 20px; - top: 20px; - z-index: 10000; + .ai-dialog__content--wrapper { + padding-right: 0 !important; + } + } + } } } - ::v-deep .treePanel { display: flex; flex-direction: column; diff --git a/project/sass/apps/grid/AppGridBlock/components/mapPlotting.vue b/project/sass/apps/grid/AppGridBlock/components/mapPlotting.vue new file mode 100644 index 00000000..4e26acaa --- /dev/null +++ b/project/sass/apps/grid/AppGridBlock/components/mapPlotting.vue @@ -0,0 +1,173 @@ + + + + + From 70557adefde30ed53ef7f7b9aa723d33f38bcbc7 Mon Sep 17 00:00:00 2001 From: aixianling Date: Sat, 7 May 2022 19:31:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E6=A0=87=E7=BB=98?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/grid/AppGridBlock/components/add.vue | 48 +-- .../grid/AppGridBlock/components/list.vue | 52 +--- .../AppGridBlock/components/mapPlotting.vue | 280 +++++++++++------- 3 files changed, 186 insertions(+), 194 deletions(-) diff --git a/project/sass/apps/grid/AppGridBlock/components/add.vue b/project/sass/apps/grid/AppGridBlock/components/add.vue index 6edd2760..0f56b13d 100644 --- a/project/sass/apps/grid/AppGridBlock/components/add.vue +++ b/project/sass/apps/grid/AppGridBlock/components/add.vue @@ -50,7 +50,9 @@ - 地图标绘 + + 地图标绘 + @@ -65,9 +67,6 @@ - - - @@ -89,9 +88,7 @@ export default { girdMemberManageList: [], girdMemberList: [] }, - showMap: false, options: [], - path: [], parentGirdInfo: {}, }; }, @@ -160,10 +157,6 @@ export default { } }); }, - surePotting() { - this.forms.points = JSON.parse(JSON.stringify(this.path)); - this.showMap = false; - }, save() { this.$refs["rules"].validate((valid) => { if (valid) { @@ -222,10 +215,6 @@ export default { } }); }, - handlePlotting() { - if (this.forms.points?.length > 0) this.path = JSON.parse(JSON.stringify(this.forms.points)) - this.showMap = true - } }, }; @@ -235,37 +224,6 @@ export default { width: 100%; height: 100%; - ::v-deep .amap-copyright { - display: none !important; - } - - ::v-deep .amap-logo { - display: none !important; - } - - ::v-deep.fullscreenMap { - .el-dialog { - display: flex; - flex-direction: column; - - .el-dialog__body { - padding: 0; - flex: 1; - min-height: 0; - - .ai-dialog__content { - max-height: unset !important; - padding-bottom: 0; - height: 100%; - - .ai-dialog__content--wrapper { - padding-right: 0 !important; - } - } - } - } - } - .footer-btn { width: 92px; } diff --git a/project/sass/apps/grid/AppGridBlock/components/list.vue b/project/sass/apps/grid/AppGridBlock/components/list.vue index f34c728a..b3b9b1ae 100644 --- a/project/sass/apps/grid/AppGridBlock/components/list.vue +++ b/project/sass/apps/grid/AppGridBlock/components/list.vue @@ -7,14 +7,14 @@ - - - - 0) this.path = JSON.parse(JSON.stringify(this.editRow.points)) - this.editRow = {...row}; - }, showEdit(id) { this.$router.push({hash: "#add", query: {id}}) }, //map搜索 - confirm() { - this.editRow.points = JSON.parse(JSON.stringify(this.path)); - let {girdMemberNames} = this.editRow - this.instance.post(`/app/appgirdinfo/addOrUpdate`, { - ...this.editRow, - girdMemberNames: girdMemberNames?.toString() - }).then((res) => { + confirm(row, points) { + this.instance.post(`/app/appgirdinfo/addOrUpdate`, {...row, points}).then((res) => { if (res.code == 0) { + this.$message.success("提交成功!") this.getList(); - this.showMap = false; } }); }, @@ -425,7 +401,8 @@ export default { } .is-current > .el-tree-node__content { - color: #fff!important; + color: #fff !important; + &:hover { background: #2266FF; color: #fff; @@ -480,6 +457,7 @@ export default { } } } + ::v-deep .treePanel { display: flex; flex-direction: column; diff --git a/project/sass/apps/grid/AppGridBlock/components/mapPlotting.vue b/project/sass/apps/grid/AppGridBlock/components/mapPlotting.vue index 4e26acaa..2b7e57fb 100644 --- a/project/sass/apps/grid/AppGridBlock/components/mapPlotting.vue +++ b/project/sass/apps/grid/AppGridBlock/components/mapPlotting.vue @@ -1,34 +1,49 @@ From 61de1da32d372991aa6d9bcb20e8d4b7d481bfb6 Mon Sep 17 00:00:00 2001 From: liuye Date: Mon, 9 May 2022 08:43:37 +0800 Subject: [PATCH 3/4] 29553 --- packages/jianping/AppPublicizeInformation/Add.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/jianping/AppPublicizeInformation/Add.vue b/packages/jianping/AppPublicizeInformation/Add.vue index 2a2c9fcb..ae73f62e 100644 --- a/packages/jianping/AppPublicizeInformation/Add.vue +++ b/packages/jianping/AppPublicizeInformation/Add.vue @@ -148,7 +148,7 @@ export default { submit() { this.$refs.ruleForm.validate(v => { if (v) { - if(this.form.pictureUrlList.length) { + if(this.form.pictureUrlList && this.form.pictureUrlList.length) { this.form.pictureUrl = this.form.pictureUrlList[0].url } this.instance.post(`/app/apppublicityinfo/addOrUpdate`, this.form).then(res => { @@ -166,6 +166,7 @@ export default { params: {id} }).then(res => { if (res?.data) { + res.data.pictureUrlList = [] if(res.data.pictureUrl) { res.data.pictureUrlList = [{url: res.data.pictureUrl}] } From ae24b4d6b447d9e105dbc36873f3c1528f723413 Mon Sep 17 00:00:00 2001 From: aixianling Date: Mon, 9 May 2022 14:32:42 +0800 Subject: [PATCH 4/4] BUG 29559 --- project/sass/apps/grid/AppGridBlock/components/list.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/project/sass/apps/grid/AppGridBlock/components/list.vue b/project/sass/apps/grid/AppGridBlock/components/list.vue index b3b9b1ae..62378d11 100644 --- a/project/sass/apps/grid/AppGridBlock/components/list.vue +++ b/project/sass/apps/grid/AppGridBlock/components/list.vue @@ -118,11 +118,9 @@ fixed="right" width="160"> @@ -146,7 +144,6 @@