物业主开发
This commit is contained in:
@@ -65,6 +65,7 @@ import { addPoint, getPoint, listPoint, updatePoint } from '@/api/system/Inspect
|
||||
import { onMounted, onUnmounted } from 'vue';
|
||||
import AMapLoader from '@amap/amap-jsapi-loader';
|
||||
import { addRoute, getRoute, updateRoute } from '@/api/system/InspectionRoute';
|
||||
import { getVillageByIdAPI } from '@/api/system/community';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_inspection_route_status } = toRefs<any>(proxy?.useDict('com_inspection_route_status'));
|
||||
@@ -201,7 +202,7 @@ const markers = ref<Record<string, any>>({});
|
||||
|
||||
const mouseTool = ref(null);
|
||||
const drawnPolylines = ref([]); // 存所有线条
|
||||
|
||||
const villageid = localStorage.getItem('villageid');
|
||||
onMounted(async () => {
|
||||
// 获取巡检点列表
|
||||
if (!routeid.value) {
|
||||
@@ -225,7 +226,26 @@ onMounted(async () => {
|
||||
zoom: 11,
|
||||
center: [116.397428, 39.90923]
|
||||
});
|
||||
|
||||
const villageinfo = await getVillageByIdAPI(villageid);
|
||||
AMap.plugin('AMap.Geocoder', function () {
|
||||
const city = villageinfo.data.city.replaceAll('/', '');
|
||||
const geocoder = new AMap.Geocoder({
|
||||
city: city // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
|
||||
});
|
||||
|
||||
const address = villageinfo.data.address;
|
||||
|
||||
geocoder.getLocation(address, function (status, result) {
|
||||
if (status === 'complete' && result.info === 'OK') {
|
||||
// result中对应详细地理坐标信息
|
||||
map.value.setCenter(result.geocodes[0].location.toArray());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
mapReady.value = true;
|
||||
|
||||
// 初始化绘图插件 MouseTool
|
||||
AMap.plugin(['AMap.MouseTool'], () => {
|
||||
mouseTool.value = new AMap.MouseTool(map.value);
|
||||
@@ -419,7 +439,7 @@ onUnmounted(() => {
|
||||
.item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 20px;
|
||||
margin-right: 15px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" label-width="120px" :model="queryParams" :inline="true">
|
||||
<el-form ref="queryFormRef" label-width="120px" @submit.prevent="handleQuery" :model="queryParams" :inline="true">
|
||||
<el-form-item label="巡检路线名称" prop="routeName">
|
||||
<el-input v-model="queryParams.routeName" placeholder="请输入巡检路线名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -20,20 +20,27 @@
|
||||
<el-card class="flex-1" shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['inspection:add:route']">新增</el-button>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:route:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['inspection:edit:route']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:route:edit']">编辑</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:route:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-col> -->
|
||||
<right-toolbar
|
||||
:disable-delete="multiple"
|
||||
:disable-edit="single"
|
||||
:show-add="checkPermi(['system:route:add'])"
|
||||
:show-edit="checkPermi(['system:route:edit'])"
|
||||
:show-delete="checkPermi(['system:route:remove'])"
|
||||
@update:add="handleAdd"
|
||||
@update:edit="handleUpdate()"
|
||||
@update:delete="handleDelete()"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
@@ -56,7 +63,7 @@
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['inspection:edit:route']"></el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:route:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:route:remove']"></el-button>
|
||||
@@ -111,6 +118,7 @@
|
||||
<script setup name="Route" lang="ts">
|
||||
import { listRoute, getRoute, delRoute, addRoute, updateRoute } from '@/api/system/InspectionRoute/index';
|
||||
import { RouteVO, RouteQuery, RouteForm } from '@/api/system/InspectionRoute/type';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_inspection_route_status } = toRefs<any>(proxy?.useDict('com_inspection_route_status'));
|
||||
|
||||
Reference in New Issue
Block a user