This commit is contained in:
yanran200730
2022-03-16 15:31:40 +08:00

View File

@@ -66,7 +66,8 @@
fileName="网格区块"
>
<el-button icon="iconfont iconExported" size="small"
>导出全部</el-button
>导出全部
</el-button
>
</ai-download>
<ai-import
@@ -85,7 +86,8 @@
</p>
</template>
<el-button size="small" icon="iconfont iconImport"
>导入</el-button
>导入
</el-button
>
</ai-import>
</template>
@@ -117,7 +119,8 @@
<template slot-scope="{ row }">
<div class="flex-box">
<div v-for="(item, index) in row.girdMemberNames" v-show="index < 3" :key="index">
<AiOpenData type="userName" :openid="item"></AiOpenData><span v-if="index < 2 && index < row.girdMemberNames.length - 1">、</span>
<AiOpenData type="userName" :openid="item"></AiOpenData>
<span v-if="index < 2 && index < row.girdMemberNames.length - 1">、</span>
</div>
</div>
</template>
@@ -167,7 +170,8 @@
v-if="editRow.plottingStatus == 1"
>
<el-button type="primary" size="mini" @click="beginPoltting()"
>开始编辑</el-button
>开始编辑
</el-button
>
<el-button size="mini" @click="finishPoltting()">结束编辑</el-button>
</el-button-group>
@@ -176,7 +180,8 @@
v-if="editRow.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>
@@ -185,7 +190,8 @@
<div class="dialog-footer" slot="footer">
<el-button size="medium" @click="showMap = false">取消</el-button>
<el-button type="primary" size="medium" @click="confirm()"
>确认</el-button
>确认
</el-button
>
</div>
</ai-dialog>
@@ -197,7 +203,7 @@ import AMapLoader from "@amap/amap-jsapi-loader";
import Template from '../../../../../packages/wechat/AppAskForm/components/Template.vue';
export default {
components: { Template },
components: {Template},
name: "List",
label: "网格区块",
props: {
@@ -253,7 +259,7 @@ export default {
colConfigs() {
let _ = this;
return [
{ type: 'selection'},
{type: 'selection'},
{
prop: "girdName",
align: "left",
@@ -268,7 +274,7 @@ export default {
prop: "girdType",
align: "center",
label: "网格类型",
render(h, { row }) {
render(h, {row}) {
return h("span", {}, _.dict.getLabel("girdType", row.girdType) || '-');
},
},
@@ -276,7 +282,7 @@ export default {
prop: "girdLevel",
align: "center",
label: "网格层级",
render(h, { row }) {
render(h, {row}) {
return h("span", {}, _.dict.getLabel("girdLevel", row.girdLevel) || '-');
},
},
@@ -284,7 +290,7 @@ export default {
prop: "plottingStatus",
align: "center",
label: "标绘状态",
render(h, { row }) {
render(h, {row}) {
return h(
"span",
{
@@ -300,7 +306,7 @@ export default {
prop: "createTime",
align: "center",
label: "创建时间",
render(h, { row }) {
render(h, {row}) {
return h("span", {}, row.createTime.substring(0, 11));
},
},
@@ -315,15 +321,15 @@ export default {
},
},
methods: {
getCorpLocation(){
this.instance.post("/app/appdvcpconfig/getCorpLocation").then(res=>{
if(res.code==0){
getCorpLocation() {
this.instance.post("/app/appdvcpconfig/getCorpLocation").then(res => {
if (res.code == 0) {
this.location = res.data
}
})
},
handleNodeClick(val) {
this.info = { ...val };
this.info = {...val};
this.searchId = val.id;
this.getList();
},
@@ -337,7 +343,7 @@ export default {
this.$nextTick(() => {
if (this.treeObj.treeList.length && !this.info.girdLevel) {
this.$refs.tree.setCurrentKey(this.treeObj.treeList[0].id)
this.info = { ...this.treeObj.treeList[0] };
this.info = {...this.treeObj.treeList[0]};
} else {
this.$refs.tree.setCurrentKey(this.info.id)
}
@@ -357,7 +363,7 @@ export default {
.then(() => {
this.instance
.post("/app/appgirdinfo/delete", null, {
params: { ids },
params: {ids},
})
.then((res) => {
if (res?.code == 0) {
@@ -367,7 +373,8 @@ export default {
}
});
})
.catch(() => {});
.catch(() => {
});
},
deleteTree(ids) {
ids &&
@@ -377,7 +384,7 @@ export default {
.then(() => {
this.instance
.post("/app/appgirdinfo/delete", null, {
params: { ids },
params: {ids},
})
.then((res) => {
if (res?.code == 0) {
@@ -387,7 +394,8 @@ export default {
}
});
})
.catch(() => {});
.catch(() => {
});
},
getList() {
this.instance
@@ -418,7 +426,7 @@ export default {
},
//添加二级网格
addTwoLevel() {
this.info = { ...this.treeObj.treeList[0] };
this.info = {...this.treeObj.treeList[0]};
this.toAdd()
},
toAdd() {
@@ -437,7 +445,7 @@ export default {
},
poltting(row) {
this.showMap = true;
this.editRow = { ...row };
this.editRow = {...row};
AMapLoader.load({
key: "b553334ba34f7ac3cd09df9bc8b539dc", // 申请好的Web端开发者Key首次调用 load 时必填
version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
@@ -491,7 +499,7 @@ export default {
});
},
see(row) {
this.info = { ...row };
this.info = {...row};
this.isEdit = true;
this.toAdd()
},
@@ -563,22 +571,18 @@ export default {
.getTarget()
.getPath()
.map((e) => {
path.push({ lng: e.lng, lat: e.lat });
path.push({lng: e.lng, lat: e.lat});
});
} else {
path = [...this.path];
}
delete this.editRow.points;
this.instance
.post(
`/app/appgirdinfo/addOrUpdate`,
{
let {girdMemberNames} = this.editRow
this.instance.post(`/app/appgirdinfo/addOrUpdate`, {
...this.editRow,
points: path,
},
null
)
.then((res) => {
girdMemberNames: girdMemberNames?.toString()
}).then((res) => {
if (res.code == 0) {
this.getList();
this.showMap = false;
@@ -589,10 +593,10 @@ export default {
this.path = [];
this.overlays = [];
this.map.on("mousemove", this.showInfoMove, this);
this.mouseTool.on("draw", ({ type, obj }) => {
this.mouseTool.on("draw", ({type, obj}) => {
obj.getPath().map((e) => {
console.log(e)
this.path.push({ lat: e.getLat(), lng: e.getLng() });
this.path.push({lat: e.getLat(), lng: e.getLng()});
});
this.overlays.push(obj);
});
@@ -611,11 +615,12 @@ export default {
.app-grid-block {
width: 100%;
height: 100%;
::v-deep .el-tree {
background: transparent;
.el-tree-node__expand-icon.is-leaf {
color: transparent!important;
color: transparent !important;
}
.el-tree-node__content > .el-tree-node__expand-icon {