项目管理相关BUG处理
parent
23ea56e7a5
commit
6186598b52
|
@ -110,12 +110,12 @@ public class SysRole extends BaseEntity
|
|||
|
||||
public static boolean isGsAdmin(String roleKey)
|
||||
{
|
||||
return Objects.equals(roleKey,"gsAdmin");
|
||||
return roleKey!=null && roleKey.startsWith("gsAdmin");
|
||||
}
|
||||
|
||||
public static boolean isGsAdmin(List<String> roleKeys)
|
||||
{
|
||||
return roleKeys.contains("gsAdmin");
|
||||
return roleKeys.stream().filter(d->d!=null && d.startsWith("gsAdmin")).count()>0;
|
||||
}
|
||||
|
||||
@NotBlank(message = "角色名称不能为空")
|
||||
|
|
|
@ -989,6 +989,24 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
.check-in-module,.exception-alert {
|
||||
.elTable {
|
||||
|
||||
.el-table__empty-text {
|
||||
font-size: 14px;
|
||||
}
|
||||
th {
|
||||
.cell {
|
||||
font-size:16px;
|
||||
}
|
||||
}
|
||||
td {
|
||||
.cell {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.BMap_bubble_pop {
|
||||
width: 440px !important;
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.yanzhu.system.api.model.LoginUser;
|
|||
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 权限获取工具类
|
||||
|
@ -101,7 +102,7 @@ public class SecurityUtils
|
|||
*/
|
||||
public static boolean isGSAdmin()
|
||||
{
|
||||
Set<String> roles = getLoginUser().getRoles();
|
||||
Set<String> roles = getLoginUser().getSysUser().getRoles().stream().map(role -> role.getRoleKey()).collect(Collectors.toSet());
|
||||
if(Objects.nonNull(roles)){
|
||||
for(String role:roles){
|
||||
if(role.startsWith("gsAdmin")){
|
||||
|
|
|
@ -142,7 +142,7 @@ public class ProProjectInfoController extends BaseController
|
|||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if(!SecurityUtils.isAdmin(loginUser.getUserid())){
|
||||
if(SecurityUtils.isGSAdmin()){
|
||||
proProjectInfo.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId());
|
||||
proProjectInfo.setActiveComId(SecurityUtils.getLoginUser().getSysUser().getActiveComId());
|
||||
}else{
|
||||
proProjectInfo.setCurrentUserId(SecurityUtils.getUserId());
|
||||
}
|
||||
|
|
|
@ -1,170 +1,180 @@
|
|||
<template>
|
||||
<el-dialog :title="title" v-model="show" width="800px" append-to-body class="baidu-map-dialog"
|
||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<div class="div-info">
|
||||
<div>经度纬度:{{ point ? (point.lng.toFixed(5) + "," + point.lat.toFixed(5)) : '' }}</div>
|
||||
<div>详细地址:{{ getAddress() }}</div>
|
||||
<div style="margin-top: 10px;text-align: center;" v-if="getAddress()">
|
||||
<el-button size="small" type="primary" @click="doOk">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="index-map" style="width: 100%;height:600px;"></div>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="show" width="800px" append-to-body class="baidu-map-dialog" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<template #header>
|
||||
<span>{{ title }}</span>
|
||||
<span style="display: inline-flex; width: 60%; margin-left: calc(40% - 80px)">
|
||||
<el-input v-model="data.txtAarea" placeholder="请输入地址" @keyup.enter="search" />
|
||||
<el-button type="primary" @click="search" style="margin-left: 10px">查询</el-button>
|
||||
</span>
|
||||
</template>
|
||||
<div class="div-info">
|
||||
<div>经度纬度:{{ point ? point.lng.toFixed(5) + "," + point.lat.toFixed(5) : "" }}</div>
|
||||
<div>详细地址:{{ getAddress() }}</div>
|
||||
<div style="margin-top: 10px; text-align: center" v-if="getAddress()">
|
||||
<el-button size="small" type="primary" @click="doOk">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="index-map" style="width: 100%; height: 600px"></div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref } from "vue";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const show = ref(false);
|
||||
const title = ref("");
|
||||
const map = ref("");
|
||||
const point = ref("");
|
||||
const cityInfo = ref("");
|
||||
|
||||
const data = reactive({
|
||||
txtAarea: "",
|
||||
});
|
||||
const emit = defineEmits(["docom"]);
|
||||
|
||||
function getCity(data, cb) {
|
||||
let myPoint = new BMapGL.Point(+data.longitude, +data.latitude);
|
||||
let myGeo = new BMapGL.Geocoder({ extensions_town: true });
|
||||
myGeo.getLocation(myPoint, r => {
|
||||
let cityInfo = {
|
||||
address: r.content?.address || '',
|
||||
poi_desc: r.content?.poi_desc || '',
|
||||
district: r.content?.address_detail?.district || '',
|
||||
city: r.content?.address_detail?.city || '',
|
||||
province: r.content?.address_detail?.province || ''
|
||||
}
|
||||
cb && cb(myPoint, cityInfo);
|
||||
});
|
||||
}
|
||||
|
||||
function doOk() {
|
||||
emit("docom", point.value, cityInfo.value);
|
||||
show.value = false;
|
||||
emit("docom", point.value, cityInfo.value);
|
||||
show.value = false;
|
||||
}
|
||||
|
||||
function getAddress() {
|
||||
let addr = cityInfo.value?.address || '';
|
||||
return addr;
|
||||
let addr = cityInfo.value?.address || "";
|
||||
return addr;
|
||||
}
|
||||
|
||||
function showDlg(opt) {
|
||||
title.value = opt?.title || '选择地址';
|
||||
show.value = true;
|
||||
setTimeout(() => {
|
||||
initMap(opt);
|
||||
}, 400);
|
||||
title.value = opt?.title || "选择地址";
|
||||
show.value = true;
|
||||
setTimeout(() => {
|
||||
initMap(opt);
|
||||
}, 400);
|
||||
}
|
||||
|
||||
function currentPoint() {
|
||||
let geolocation = new BMapGL.Geolocation();
|
||||
geolocation.enableSDKLocation();
|
||||
geolocation.getCurrentPosition(e => {
|
||||
if (e.point) {
|
||||
let point = e.point
|
||||
let initMarker = new BMapGL.Marker(point);
|
||||
map.value.centerAndZoom(point, 18);
|
||||
map.value.addOverlay(initMarker);
|
||||
}
|
||||
})
|
||||
let geolocation = new BMapGL.Geolocation();
|
||||
geolocation.enableSDKLocation();
|
||||
geolocation.getCurrentPosition((e) => {
|
||||
if (e && e.point) {
|
||||
let pt = e.point;
|
||||
map.value.centerAndZoom(pt, 16);
|
||||
mapClick({ latlng: pt });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function mapClick(e) {
|
||||
point.value = e.latlng;
|
||||
let myGeo = new BMapGL.Geocoder({ extensions_town: true });
|
||||
myGeo.getLocation(e.latlng, r => {
|
||||
if (r) {
|
||||
cityInfo.value = {
|
||||
address: r.content?.address || '',
|
||||
poi_desc: r.content?.poi_desc || '',
|
||||
district: r.content?.address_detail?.district || '',
|
||||
city: r.content?.address_detail?.city || '',
|
||||
province: r.content?.address_detail?.province || ''
|
||||
}
|
||||
} else {
|
||||
cityInfo.value = {}
|
||||
}
|
||||
});
|
||||
point.value = e.latlng;
|
||||
let myGeo = new BMapGL.Geocoder({ extensions_town: true });
|
||||
myGeo.getLocation(e.latlng, (r) => {
|
||||
if (r) {
|
||||
cityInfo.value = {
|
||||
address: r.content?.address || "",
|
||||
poi_desc: r.content?.poi_desc || "",
|
||||
district: r.content?.address_detail?.district || "",
|
||||
city: r.content?.address_detail?.city || "",
|
||||
province: r.content?.address_detail?.province || "",
|
||||
};
|
||||
if (cityInfo.value.address) {
|
||||
map.value.clearOverlays();
|
||||
map.value.addOverlay(new BMapGL.Marker(e.latlng, { title: cityInfo.value.address }));
|
||||
}
|
||||
} else {
|
||||
cityInfo.value = {};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initMap(opt) {
|
||||
let imap = new BMapGL.Map("index-map");
|
||||
let imap = new BMapGL.Map("index-map");
|
||||
|
||||
map.value = imap;
|
||||
let point = new BMapGL.Point(116.404, 39.915);
|
||||
//初始化地图,设置中心点坐标和地图级别
|
||||
map.value.centerAndZoom(point, 15);
|
||||
map.value.setDefaultCursor("crosshair");//设置地图默认的鼠标指针样式
|
||||
map.value.enableScrollWheelZoom();//启用滚轮放大缩小,默认禁用。
|
||||
map.value = imap;
|
||||
let point = new BMapGL.Point(116.404, 39.915);
|
||||
//初始化地图,设置中心点坐标和地图级别
|
||||
map.value.centerAndZoom(point, 15);
|
||||
map.value.setDefaultCursor("crosshair"); //设置地图默认的鼠标指针样式
|
||||
map.value.enableScrollWheelZoom(); //启用滚轮放大缩小,默认禁用。
|
||||
|
||||
//创建点坐标
|
||||
//创建点坐标
|
||||
|
||||
//创建标注
|
||||
let initMarker = new BMapGL.Marker(point);
|
||||
//向地图中添加单个覆盖物时会触发此事件
|
||||
map.value.addOverlay(initMarker);
|
||||
//开启标注拖拽功能
|
||||
//initMarker.enableDragging();
|
||||
//将标注点移动到中心位置
|
||||
//创建标注
|
||||
let initMarker = new BMapGL.Marker(point);
|
||||
//向地图中添加单个覆盖物时会触发此事件
|
||||
map.value.addOverlay(initMarker);
|
||||
//将标注点移动到中心位置
|
||||
|
||||
|
||||
//添加地图默认控件
|
||||
map.value.addControl(new BMapGL.NavigationControl());
|
||||
//开启鼠标滚轮缩放
|
||||
map.value.addEventListener("click", mapClick);
|
||||
var myGeo = new BMapGL.Geocoder();
|
||||
// 将地址解析结果显示在地图上,并调整地图视野
|
||||
myGeo.getPoint('经河新城', function (point) {
|
||||
if (point) {
|
||||
map.value.centerAndZoom(point, 16);
|
||||
map.value.addOverlay(new BMapGL.Marker(point, { title: '经河新城' }))
|
||||
map.value.enableScrollWheelZoom(true);
|
||||
//map.value.setHeading(64.5); //设置地图旋转角度
|
||||
//map.value.setTilt(73); //设置地图的倾斜角度
|
||||
} else {
|
||||
alert('您选择的地址没有解析到结果!');
|
||||
}
|
||||
initMapData(opt)
|
||||
}, '陕西省')
|
||||
//添加地图默认控件
|
||||
map.value.addControl(new BMapGL.NavigationControl());
|
||||
//开启鼠标滚轮缩放
|
||||
map.value.addEventListener("click", mapClick);
|
||||
var myGeo = new BMapGL.Geocoder();
|
||||
if (opt && opt.address) {
|
||||
let myGeo = new BMapGL.Geocoder();
|
||||
myGeo.getPoint(opt.address, function (pt) {
|
||||
if (pt) {
|
||||
map.value.centerAndZoom(pt, 16);
|
||||
mapClick({ latlng: pt });
|
||||
} else {
|
||||
currentPoint();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
currentPoint();
|
||||
}
|
||||
}
|
||||
function initMapData(data) {
|
||||
if (data.latitude && data.longitude) {
|
||||
point.value = {}
|
||||
point.value.lng = data.longitude * 1.0;
|
||||
point.value.lat = data.latitude * 1.0;
|
||||
}
|
||||
cityInfo.value = {}
|
||||
cityInfo.value.address = data.projectAddress || ''
|
||||
cityInfo.value.district = data.district || ''
|
||||
cityInfo.value.city = data.city || ''
|
||||
cityInfo.value.province = data.province || ''
|
||||
function initMapData(opt) {
|
||||
if (opt.latitude && opt.longitude) {
|
||||
point.value = {};
|
||||
point.value.lng = opt.longitude * 1.0;
|
||||
point.value.lat = opt.latitude * 1.0;
|
||||
}
|
||||
cityInfo.value = {};
|
||||
cityInfo.value.address = opt.projectAddress || "";
|
||||
cityInfo.value.district = opt.district || "";
|
||||
cityInfo.value.city = opt.city || "";
|
||||
cityInfo.value.province = opt.province || "";
|
||||
}
|
||||
|
||||
/** 暴露组件 */
|
||||
defineExpose({
|
||||
showDlg,
|
||||
initMapData
|
||||
showDlg,
|
||||
initMapData,
|
||||
});
|
||||
function search() {
|
||||
if (!data.txtAarea) {
|
||||
proxy.$modal.msgError("请输入要搜索的地址");
|
||||
return;
|
||||
}
|
||||
let myGeo = new BMapGL.Geocoder();
|
||||
myGeo.getPoint(data.txtAarea, function (pt) {
|
||||
if (pt) {
|
||||
map.value.centerAndZoom(pt, 16);
|
||||
mapClick({ latlng: pt });
|
||||
} else {
|
||||
proxy.$modal.msgError("您输入的地址没有解析到结果!");
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.baidu-map-dialog {
|
||||
.el-dialog__body {
|
||||
position: relative;
|
||||
padding: 0px;
|
||||
.el-dialog__body {
|
||||
position: relative;
|
||||
padding: 0px;
|
||||
|
||||
.div-info {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 10px;
|
||||
width: 300px;
|
||||
font-size: 12px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
box-shadow: 6px 6px 6px rgba(0, 0, 0, 0.2);
|
||||
z-index: 99999;
|
||||
padding: 8px;
|
||||
border: solid 1px #ccc;
|
||||
color: #51b5ff;
|
||||
line-height: 24px;
|
||||
}
|
||||
.div-info {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 10px;
|
||||
width: 300px;
|
||||
font-size: 12px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
box-shadow: 6px 6px 6px rgba(0, 0, 0, 0.2);
|
||||
z-index: 99999;
|
||||
padding: 8px;
|
||||
border: solid 1px #ccc;
|
||||
color: #51b5ff;
|
||||
line-height: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -194,7 +194,7 @@
|
|||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="项目地址" prop="projectAddress" ref="fitemPrjAddr">
|
||||
<el-input v-model="addressInfos" placeholder="请选择项目地址信息" @focus="getMapInfo">
|
||||
<el-input v-model="addressInfos" placeholder="请选择项目地址信息" @click="getMapInfo">
|
||||
<template #prefix>
|
||||
<el-icon class="el-input__icon">
|
||||
<Location />
|
||||
|
@ -449,6 +449,7 @@ function mapDocom(pt, city) {
|
|||
form.value.latitude = pt.lat.toFixed(5);
|
||||
addressInfos.value = form.value.projectAddress + "," + form.value.longitude + "," + form.value.latitude;
|
||||
fitemPrjAddr.value.clearValidate();
|
||||
console.log("--1---")
|
||||
}
|
||||
|
||||
function menuCommand(e, row) {
|
||||
|
@ -765,6 +766,7 @@ function getDeptTree() {
|
|||
|
||||
/** 地图选择 */
|
||||
function getMapInfo() {
|
||||
console.log("----2----")
|
||||
mapRef.value.showDlg(form.value);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue