BUG 25975
This commit is contained in:
89
packages/2.0.5/AppGridBlock/components/add.vue
vendored
89
packages/2.0.5/AppGridBlock/components/add.vue
vendored
@@ -10,7 +10,7 @@
|
||||
></ai-title>
|
||||
</template>
|
||||
<template #content>
|
||||
<ai-card title="层级信息" >
|
||||
<ai-card title="层级信息">
|
||||
<template slot="content">
|
||||
<ai-wrapper label-width="120px" :columnsNumber="2" style="margin-top: 16px">
|
||||
<ai-info-item label="上级层级单位:"><span>{{ forms.parentGirdName }}</span></ai-info-item>
|
||||
@@ -26,7 +26,7 @@
|
||||
label-suffix=":"
|
||||
label-width="120px"
|
||||
>
|
||||
<ai-card title="基础信息" >
|
||||
<ai-card title="基础信息">
|
||||
<template slot="content">
|
||||
<div class="above">
|
||||
<div class="left">
|
||||
@@ -97,7 +97,7 @@
|
||||
</template>
|
||||
</ai-card>
|
||||
|
||||
<ai-card title="其他信息" >
|
||||
<ai-card title="其他信息">
|
||||
<template slot="content">
|
||||
<div class="above">
|
||||
<div class="left">
|
||||
@@ -186,10 +186,12 @@
|
||||
v-if="forms.plottingStatus == 1"
|
||||
>
|
||||
<el-button type="primary" size="mini" @click="polyEditor.open()"
|
||||
>开始编辑</el-button
|
||||
>开始编辑
|
||||
</el-button
|
||||
>
|
||||
<el-button size="mini" @click="polyEditor.close()"
|
||||
>结束编辑</el-button
|
||||
>结束编辑
|
||||
</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
<el-button-group
|
||||
@@ -197,7 +199,8 @@
|
||||
v-if="forms.plottingStatus == 0"
|
||||
>
|
||||
<el-button size="mini" @click="draw('polygon')"
|
||||
>开始绘制多边形</el-button
|
||||
>开始绘制多边形
|
||||
</el-button
|
||||
>
|
||||
<!-- <el-button size="mini" @click="close()">关闭绘制</el-button> -->
|
||||
<el-button size="mini" @click="clear()">清除绘制</el-button>
|
||||
@@ -206,7 +209,8 @@
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button size="medium" @click="showMap = false">取消</el-button>
|
||||
<el-button type="primary" size="medium" @click="surePotting()"
|
||||
>确认</el-button
|
||||
>确认
|
||||
</el-button
|
||||
>
|
||||
</div>
|
||||
</ai-dialog>
|
||||
@@ -215,7 +219,8 @@
|
||||
|
||||
<script>
|
||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
import { mapState } from "vuex";
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "addBlock",
|
||||
props: {
|
||||
@@ -262,22 +267,22 @@ export default {
|
||||
formRules() {
|
||||
return {
|
||||
girdName: [
|
||||
{ required: true, message: "请填写网格名称", trigger: "change" },
|
||||
{required: true, message: "请填写网格名称", trigger: "change"},
|
||||
],
|
||||
girdCode: [
|
||||
{ required: true, message: "请填写网格编码", trigger: "change" },
|
||||
{required: true, message: "请填写网格编码", trigger: "change"},
|
||||
],
|
||||
girdType: [
|
||||
{ required: true, message: "请选择网格类型", trigger: "change" },
|
||||
{required: true, message: "请选择网格类型", trigger: "change"},
|
||||
],
|
||||
isLastLevel: [
|
||||
{ required: true, message: "请选择是否最后一级", trigger: "change" },
|
||||
{required: true, message: "请选择是否最后一级", trigger: "change"},
|
||||
],
|
||||
girdLevel: [
|
||||
{ required: true, message: "请选择网格层级", trigger: "change" },
|
||||
{required: true, message: "请选择网格层级", trigger: "change"},
|
||||
],
|
||||
eventReportUnitId: [
|
||||
{ required: true, message: "请选择事件上报主体", trigger: "change" },
|
||||
{required: true, message: "请选择事件上报主体", trigger: "change"},
|
||||
],
|
||||
};
|
||||
},
|
||||
@@ -306,33 +311,30 @@ export default {
|
||||
// this.forms.isLastLevel = ['0','1'].includes(this.forms.girdLevel)?'0':'1';
|
||||
this.title = "添加网格区块";
|
||||
}
|
||||
this.getAllUnit(this.user.info.areaId);
|
||||
// this.getAllUnit(this.user.info.areaId);
|
||||
},
|
||||
methods: {
|
||||
cancel (isRefresh) {
|
||||
cancel(isRefresh) {
|
||||
this.$emit('change', {
|
||||
type: 'list',
|
||||
isRefresh: isRefresh ? true : false,
|
||||
isRefresh: !!isRefresh,
|
||||
})
|
||||
},
|
||||
// 获取所有单位
|
||||
getAllUnit(data) {
|
||||
this.options = [];
|
||||
this.instance
|
||||
.post("/admin/sysunit/getAll", null, {
|
||||
params: {
|
||||
areaId: data,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
this.instance.post("/admin/sysunit/getAll", null, {
|
||||
params: {areaId: data},
|
||||
}).then((res) => {
|
||||
if (res?.data) {
|
||||
res.data = res.data.map((a) => {
|
||||
return { ...a, label: a.name };
|
||||
return {...a, label: a.name}
|
||||
});
|
||||
this.options = res.data.filter((e) => !e.parentId);
|
||||
this.options.map((t) => this.addChild(t, res.data));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
beforeSelectMap() {
|
||||
AMapLoader.load({
|
||||
key: "b553334ba34f7ac3cd09df9bc8b539dc", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
@@ -392,17 +394,13 @@ export default {
|
||||
eventOn() {
|
||||
this.path = [];
|
||||
this.overlays = [];
|
||||
this.map.on("mousemove", this.showInfoMove, this);
|
||||
this.mouseTool.on("draw", ({ type, obj }) => {
|
||||
console.log(obj);
|
||||
this.map.on("mousemove", null, this);
|
||||
this.mouseTool.on("draw", ({obj}) => {
|
||||
obj.getPath().map((e) => {
|
||||
this.path.push({ lat: e.getLat(), lng: e.getLng() });
|
||||
this.path.push({lat: e.getLat(), lng: e.getLng()});
|
||||
});
|
||||
this.overlays.push(obj);
|
||||
});
|
||||
this.placeSearch.on("listElementClick", (e) => {
|
||||
console.log(e);
|
||||
});
|
||||
})
|
||||
},
|
||||
//map搜索
|
||||
addressChange(val) {
|
||||
@@ -467,7 +465,7 @@ export default {
|
||||
.getTarget()
|
||||
.getPath()
|
||||
.map((e) => {
|
||||
this.forms.points.push({ lng: e.lng, lat: e.lat });
|
||||
this.forms.points.push({lng: e.lng, lat: e.lat});
|
||||
});
|
||||
} else {
|
||||
this.forms.points = [...this.path];
|
||||
@@ -497,13 +495,11 @@ export default {
|
||||
});
|
||||
},
|
||||
searchDetail() {
|
||||
this.instance
|
||||
.post(`/app/appgirdinfo/queryDetailById`, null, {
|
||||
params: { id: this.params.id },
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.forms = { ...res.data };
|
||||
this.instance.post(`/app/appgirdinfo/queryDetailById`, null, {
|
||||
params: {id: this.params.id},
|
||||
}).then((res) => {
|
||||
if (res?.data) {
|
||||
this.forms = {...res.data};
|
||||
this.parentGirdInfo = this.forms.parentGirdInfo;
|
||||
this.forms.parentGirdName = this.parentGirdInfo.girdName;
|
||||
// this.forms.isLastLevel =this.forms.girdLevel;
|
||||
@@ -518,41 +514,48 @@ export default {
|
||||
.add-block {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.above {
|
||||
overflow: hidden;
|
||||
padding: 8px 0;
|
||||
|
||||
.left {
|
||||
width: 380px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 380px;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
overflow-x: auto;
|
||||
top: 20px;
|
||||
width: 280px;
|
||||
overflow: hidden;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.tipinput {
|
||||
position: absolute;
|
||||
width: 200px;
|
||||
|
||||
Reference in New Issue
Block a user