项目列表和分包单位以及迁移人员

This commit is contained in:
Teo
2025-03-31 18:00:54 +08:00
parent f1ca0b6040
commit c4125585ce
30 changed files with 1780 additions and 81 deletions

13
node_modules/.package-lock.json generated vendored Normal file
View File

@ -0,0 +1,13 @@
{
"name": "xinnengy",
"lockfileVersion": 3,
"requires": true,
"packages": {
"node_modules/@amap/amap-jsapi-loader": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
"integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw==",
"license": "MIT"
}
}
}

View File

@ -0,0 +1,4 @@
{
"editor.tabSize": 4,
"prettier.tabWidth": 4
}

111
node_modules/@amap/amap-jsapi-loader/README.md generated vendored Normal file
View File

@ -0,0 +1,111 @@
# amap-jsapi-loader
amap-jsapi-loader 是高德开放平台官网提供的地图 JSAPI 的加载器,可帮助开发者快速定位、有效避免加载引用地图 JSAPI 各种错误用法。
该加载器具有以下特性:
* 支持以 普通JS 和 npm包 两种方式使用;
* 有效避免错误异步加载导致的 JSAPI 资源加载不完整问题;
* 对于加载混用多个版本 JSAPI 的错误用法给予报错处理;
* 对于不合法加载引用 JSAPI 给予报错处理;
* 支持指定 JSAPI 版本;
* 支持插件加载;
* 允许多次执行加载操作,网络资源不会重复请求,便于大型工程模块管理;
# USAGE
## AMapLoader.load方法参数说明
```js
AMapLoader.load({
"key": "", // 申请好的Web端开发者Key首次调用 load 时必填
"version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
"plugins": [] // 需要使用的的插件列表,如比例尺'AMap.Scale'等
"AMapUI": { // 是否加载 AMapUI缺省不加载
"version": '1.1', // AMapUI 缺省 1.1
"plugins":[], // 需要加载的 AMapUI ui插件
},
"Loca":{ // 是否加载 Loca 缺省不加载
"version": '1.3.2' // Loca 版本,缺省 1.3.2
},
}).then(()=>{
window.AMap.xx;
window.AMapUI.xx;
window.Loca.xx
});
```
## AMapUI
AMapUI 用法和官网有一点点区别。通过 AMapUI.xx 来获取组件
```js
AMapLoader.load({
key: '',//首次load必填
version: '2.0',
AMapUI: {
version: '1.1',
plugins: ['overlay/SimpleMarker'],
}
}).then((AMap) => {
map = new AMap.Map('container');
// !!! 通过 AMap.SimpleMarker 获取组件
new AMapUI.SimpleMarker({
//前景文字
iconLabel: 'A',
//图标主题
iconTheme: 'default',
//背景图标样式
iconStyle: 'red',
map: map,
position: map.getCenter()
});
}).catch((e) => {
console.error(e);
});
```
# 使用
#### 以普通 JS 方式使用 Loader
尚未发布在线Loader可将 dist/index.js 复制到项目下
```
<script src="../dist/index.js"></script>
<script>
AMapLoader.load({
key:'',//首次load必填
version:'2.0',
plugins:['AMap.Scale']
}).then((AMap)=>{
map = new AMap.Map('container');
map.addControl(new AMap.Scale())
}).catch((e)=>{
console.error(e);
});
</script>
```
#### 以 NPM 包方式使用 Loader
安装
```
tnpm i @alife/amap-jsapi-loader --save-dev
```
使用
```
import AMapLoader from '@alife/amap-jsapi-loader';
AMapLoader.load().then((AMap)=>{
map = new AMap.Map('container');
}).catch(e=>{
console.log(e);
})
```
# 相关链接:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;图 JSAPI &nbsp;&nbsp;[示例中心](https://lbs.amap.com/demo-center/js-api)&nbsp;&nbsp;&nbsp;&nbsp;[教程](https://lbs.amap.com/api/javascript-api/summary)&nbsp;&nbsp;&nbsp;&nbsp;[参考手册](https://lbs.amap.com/api/javascript-api/reference/map)
数据可视化 JSAPI &nbsp;&nbsp;[示例中心](https://lbs.amap.com/demo-center/loca-api)&nbsp;&nbsp;&nbsp;&nbsp;[教程](https://lbs.amap.com/api/loca-api/prod_intro)&nbsp;&nbsp;&nbsp;&nbsp;[参考手册](https://lbs.amap.com/api/loca-api/guide/baselayer)

11
node_modules/@amap/amap-jsapi-loader/dist/index.js generated vendored Normal file
View File

@ -0,0 +1,11 @@
'use strict';(function(m,p){"object"===typeof exports&&"undefined"!==typeof module?module.exports=p():"function"===typeof define&&define.amd?define(p):(m=m||self,m.AMapLoader=p())})(this,function(){function m(a){var b=[];a.AMapUI&&b.push(p(a.AMapUI));a.Loca&&b.push(r(a.Loca));return Promise.all(b)}function p(a){return new Promise(function(h,c){var f=[];if(a.plugins)for(var e=0;e<a.plugins.length;e+=1)-1==d.AMapUI.plugins.indexOf(a.plugins[e])&&f.push(a.plugins[e]);if(g.AMapUI===b.failed)c("\u524d\u6b21\u8bf7\u6c42 AMapUI \u5931\u8d25");
else if(g.AMapUI===b.notload){g.AMapUI=b.loading;d.AMapUI.version=a.version||d.AMapUI.version;e=d.AMapUI.version;var l=document.body||document.head,k=document.createElement("script");k.type="text/javascript";k.src="https://webapi.amap.com/ui/"+e+"/main.js";k.onerror=function(a){g.AMapUI=b.failed;c("\u8bf7\u6c42 AMapUI \u5931\u8d25")};k.onload=function(){g.AMapUI=b.loaded;if(f.length)window.AMapUI.loadUI(f,function(){for(var a=0,b=f.length;a<b;a++){var c=f[a].split("/").slice(-1)[0];window.AMapUI[c]=
arguments[a]}for(h();n.AMapUI.length;)n.AMapUI.splice(0,1)[0]()});else for(h();n.AMapUI.length;)n.AMapUI.splice(0,1)[0]()};l.appendChild(k)}else g.AMapUI===b.loaded?a.version&&a.version!==d.AMapUI.version?c("\u4e0d\u5141\u8bb8\u591a\u4e2a\u7248\u672c AMapUI \u6df7\u7528"):f.length?window.AMapUI.loadUI(f,function(){for(var a=0,b=f.length;a<b;a++){var c=f[a].split("/").slice(-1)[0];window.AMapUI[c]=arguments[a]}h()}):h():a.version&&a.version!==d.AMapUI.version?c("\u4e0d\u5141\u8bb8\u591a\u4e2a\u7248\u672c AMapUI \u6df7\u7528"):
n.AMapUI.push(function(a){a?c(a):f.length?window.AMapUI.loadUI(f,function(){for(var a=0,b=f.length;a<b;a++){var c=f[a].split("/").slice(-1)[0];window.AMapUI[c]=arguments[a]}h()}):h()})})}function r(a){return new Promise(function(h,c){if(g.Loca===b.failed)c("\u524d\u6b21\u8bf7\u6c42 Loca \u5931\u8d25");else if(g.Loca===b.notload){g.Loca=b.loading;d.Loca.version=a.version||d.Loca.version;var f=d.Loca.version,e=d.AMap.version.startsWith("2"),l=f.startsWith("2");if(e&&!l||!e&&l)c("JSAPI \u4e0e Loca \u7248\u672c\u4e0d\u5bf9\u5e94\uff01\uff01");
else{e=d.key;l=document.body||document.head;var k=document.createElement("script");k.type="text/javascript";k.src="https://webapi.amap.com/loca?v="+f+"&key="+e;k.onerror=function(a){g.Loca=b.failed;c("\u8bf7\u6c42 AMapUI \u5931\u8d25")};k.onload=function(){g.Loca=b.loaded;for(h();n.Loca.length;)n.Loca.splice(0,1)[0]()};l.appendChild(k)}}else g.Loca===b.loaded?a.version&&a.version!==d.Loca.version?c("\u4e0d\u5141\u8bb8\u591a\u4e2a\u7248\u672c Loca \u6df7\u7528"):h():a.version&&a.version!==d.Loca.version?
c("\u4e0d\u5141\u8bb8\u591a\u4e2a\u7248\u672c Loca \u6df7\u7528"):n.Loca.push(function(a){a?c(a):c()})})}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var b;(function(a){a.notload="notload";a.loading="loading";a.loaded="loaded";a.failed="failed"})(b||(b={}));var d={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},g={AMap:b.notload,AMapUI:b.notload,Loca:b.notload},n={AMap:[],AMapUI:[],Loca:[]},q=[],t=function(a){"function"==typeof a&&
(g.AMap===b.loaded?a(window.AMap):q.push(a))};return{load:function(a){return new Promise(function(h,c){if(g.AMap==b.failed)c("");else if(g.AMap==b.notload){var f=a.key,e=a.version,l=a.plugins;f?(window.AMap&&"lbs.amap.com"!==location.host&&c("\u7981\u6b62\u591a\u79cdAPI\u52a0\u8f7d\u65b9\u5f0f\u6df7\u7528"),d.key=f,d.AMap.version=e||d.AMap.version,d.AMap.plugins=l||d.AMap.plugins,g.AMap=b.loading,e=document.body||document.head,window.___onAPILoaded=function(d){delete window.___onAPILoaded;if(d)g.AMap=
b.failed,c(d);else for(g.AMap=b.loaded,m(a).then(function(){h(window.AMap)})["catch"](c);q.length;)q.splice(0,1)[0]()},l=document.createElement("script"),l.type="text/javascript",l.src="https://webapi.amap.com/maps?callback=___onAPILoaded&v="+d.AMap.version+"&key="+f+"&plugin="+d.AMap.plugins.join(","),l.onerror=function(a){g.AMap=b.failed;c(a)},e.appendChild(l)):c("\u8bf7\u586b\u5199key")}else if(g.AMap==b.loaded)if(a.key&&a.key!==d.key)c("\u591a\u4e2a\u4e0d\u4e00\u81f4\u7684 key");else if(a.version&&
a.version!==d.AMap.version)c("\u4e0d\u5141\u8bb8\u591a\u4e2a\u7248\u672c JSAPI \u6df7\u7528");else{f=[];if(a.plugins)for(e=0;e<a.plugins.length;e+=1)-1==d.AMap.plugins.indexOf(a.plugins[e])&&f.push(a.plugins[e]);if(f.length)window.AMap.plugin(f,function(){m(a).then(function(){h(window.AMap)})["catch"](c)});else m(a).then(function(){h(window.AMap)})["catch"](c)}else if(a.key&&a.key!==d.key)c("\u591a\u4e2a\u4e0d\u4e00\u81f4\u7684 key");else if(a.version&&a.version!==d.AMap.version)c("\u4e0d\u5141\u8bb8\u591a\u4e2a\u7248\u672c JSAPI \u6df7\u7528");
else{var k=[];if(a.plugins)for(e=0;e<a.plugins.length;e+=1)-1==d.AMap.plugins.indexOf(a.plugins[e])&&k.push(a.plugins[e]);t(function(){if(k.length)window.AMap.plugin(k,function(){m(a).then(function(){h(window.AMap)})["catch"](c)});else m(a).then(function(){h(window.AMap)})["catch"](c)})}})},reset:function(){delete window.AMap;delete window.AMapUI;delete window.Loca;d={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}};g={AMap:b.notload,AMapUI:b.notload,
Loca:b.notload};n={AMap:[],AMapUI:[],Loca:[]}}}})

View File

@ -0,0 +1,69 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>JSAPI Loader</title>
<style>
html,
body,
#container {
height: 100%;
width: 100%;
margin: 0;
}
</style>
</head>
<body>
<div id="container" tabindex="0"></div>
<script src="../dist/index.js"></script>
<script>
AMapLoader.load({
key: '',//首次load必填
version: '2.0Beta',
plugins: ['AMap.Scale'],
AMapUI: {
plugins: ['overlay/SimpleMarker'],
}
}).then((AMap) => {
map = new AMap.Map('container');
map.addControl(new AMap.Scale());
new AMapUI.SimpleMarker({
//前景文字
iconLabel: 'A',
//图标主题
iconTheme: 'default',
//背景图标样式
iconStyle: 'red',
//...其他Marker选项...不包括content
map: map,
position: map.getCenter()
});
}).catch((e) => {
console.error(e);
});
setTimeout(function () {
AMapLoader.load({
plugins: ['AMap.MapType']
}).then((AMap) => {
map.addControl(new AMap.MapType())
}).catch((e) => {
console.error(e);
});
}, 5000);
</script>
</script>
</body>
</html>

76
node_modules/@amap/amap-jsapi-loader/example/Loca.html generated vendored Normal file
View File

@ -0,0 +1,76 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>JSAPI Loader</title>
<style>
html,
body,
#container {
height: 100%;
width: 100%;
margin: 0;
}
</style>
</head>
<body>
<div id="container" tabindex="0"></div>
<script src="https://a.amap.com/Loca/static/mock/districts.js"></script>
<script src="../dist/index.js"></script>
<script>
AMapLoader.load({
key: 'd3c5511c8a102496b1fdb985e6ca1cd7',//首次load必填
// version: '2.0',
Loca: {
version: '2.0.0beta'
}
}).then((AMap) => {
var map = new AMap.Map('container', {
zoom: 4,
center: [107.4976, 32.1697],
features: ['bg', 'road'],
// Loca 自 1.2.0 起 viewMode 模式默认为 3D如需 2D 模式,请显示配置。
// viewMode: '3D'
});
var layer = new Loca.PointLayer({
map: map
});
layer.setData(districts, {
// 指定经纬度所在字段
lnglat: 'center'
});
layer.setOptions({
style: {
// 圆形半径,单位像素
radius: 5,
// 填充颜色
color: '#07E8E4',
// 描边颜色
borderColor: '#5DFBF9',
// 描边宽度,单位像素
borderWidth: 1,
// 透明度 [0-1]
opacity: 0.9,
}
});
layer.render();
}).catch((e) => {
console.error(e);
});
</script>
</script>
</body>
</html>

View File

@ -0,0 +1,94 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>JSAPI Loader</title>
<style>
html,
body,
#container {
height: 100%;
width: 100%;
margin: 0;
}
</style>
</head>
<body>
<div id="container" tabindex="0"></div>
<script src="https://a.amap.com/Loca/static/mock/districts.js"></script>
<script src="../dist/index.js"></script>
<script>
AMapLoader.load({
key: '',//首次load必填
version: '1.4.15',
AMapUI: {
plugins: ['overlay/SimpleMarker'],
},
Loca: {
version: '1.3.2'
}
}).then((AMap) => {
var map = new AMap.Map('container', {
zoom: 4,
center: [107.4976, 32.1697],
features: ['bg', 'road'],
// Loca 自 1.2.0 起 viewMode 模式默认为 3D如需 2D 模式,请显示配置。
// viewMode: '3D'
});
new AMapUI.SimpleMarker({
//前景文字
iconLabel: 'A',
//图标主题
iconTheme: 'default',
//背景图标样式
iconStyle: 'red',
//...其他Marker选项...不包括content
map: map,
position: map.getCenter()
});
var layer = new Loca.PointLayer({
map: map
});
layer.setData(districts, {
// 指定经纬度所在字段
lnglat: 'center'
});
layer.setOptions({
style: {
// 圆形半径,单位像素
radius: 5,
// 填充颜色
color: '#07E8E4',
// 描边颜色
borderColor: '#5DFBF9',
// 描边宽度,单位像素
borderWidth: 1,
// 透明度 [0-1]
opacity: 0.9,
}
});
layer.render();
}).catch((e) => {
console.error(e);
});
</script>
</script>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>JSAPI Loader - ES6</title>
<style>
html, body, #container {
height: 100%;
width: 100%;
margin: 0;
}
</style>
</head>
<body>
<div id="container" tabindex="0"></div>
<script type="module">
import AMapLoader from '../src/index.js';
AMapLoader.load({
key:'',//必填
version:'2.0',
plugins:['AMap.Scale']
}).then((AMap)=>{
debugger
var map = new AMap.Map('container');
map.addControl(new AMap.Scale())
}).catch((e)=>{
console.error(e);
});
</script>
</script>
</body>
</html>

View File

@ -0,0 +1,46 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>AMap JSAPI Loader</title>
<style>
html, body, #container {
height: 100%;
width: 100%;
margin: 0;
}
</style>
</head>
<body>
<div id="container" tabindex="0"></div>
<script src="https://webapi.amap.com/loader.js"></script>
<script>
AMapLoader.load({ //首次调用 load
key:'你申请的高德开放平台 Web 端 key',//首次load key为必填
version:'2.0',
plugins:['AMap.Scale','AMap.ToolBar']
}).then((AMap)=>{
map = new AMap.Map('container');
map.addControl(new AMap.Scale())
map.addControl(new AMap.ToolBar())
map.add(new AMap.Marker({
position:map.getCenter()
}));
}).catch((e)=>{
console.error(e);
});
AMapLoader.load({ //可多次调用load
plugins:['AMap.MapType']
}).then((AMap)=>{
map.addControl(new AMap.MapType())
}).catch((e)=>{
console.error(e);
});
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}}

File diff suppressed because one or more lines are too long

287
node_modules/@amap/amap-jsapi-loader/example/test.html generated vendored Normal file
View File

@ -0,0 +1,287 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>JSAPI Loader</title>
<style>
html,
body,
#container {
height: 100%;
width: 100%;
margin: 0;
}
</style>
</head>
<body>
<div id="mocha"></div>
<link rel="stylesheet" href="./libs/mocha.min.css" />
<script src="./libs/chai.min.js"></script>
<script src="./libs/mocha.min.js"></script>
<script>
mocha.setup('bdd');
mocha.traceIgnores = ['mocha.min.js', 'chai.min.js'];
expect = chai.expect;
</script>
<div id="container" tabindex="0"></div>
<script src="../dist/index.js"></script>
<script>
// 请把 key 写在这里
const JSAPIKey = '';
const chai = window.chai;
const mocha = window.mocha;
mocha.setup({
timeout: '5000',
ui: 'bdd',
});
const expect = chai.expect;
describe('JSAPI', () => {
beforeEach(function () {
AMapLoader.reset()
});
it('Simple', (done) => {
AMapLoader.load({
key: JSAPIKey,//首次load必填
version: '2.0',
plugins: ['AMap.Scale'],
AMapUI: {
plugins: ['overlay/SimpleMarker']
}
}).then(() => {
expect(Boolean(window.AMap)).eq(true)
expect(Boolean(window.AMapUI)).eq(true)
expect(Boolean(window.AMapUI.SimpleMarker)).eq(true)
expect(Boolean(window.Loca)).eq(false)
done();
});
});
it('Request with AMapUI Loca', (done) => {
AMapLoader.load({
key: JSAPIKey,//首次load必填
version: '1.4.15',
plugins: ['AMap.Scale'],
AMapUI: {
plugins: ['overlay/SimpleMarker']
},
Loca: {
version: '1.3.2'
}
}).then(() => {
expect(Boolean(window.AMap)).eq(true)
expect(Boolean(window.AMapUI)).eq(true)
expect(Boolean(window.AMapUI.SimpleMarker)).eq(true)
expect(Boolean(window.Loca)).eq(true)
done();
});
});
it('fail with multi version', (done) => {
AMapLoader.load({
key: JSAPIKey,//首次load必填
version: '2.0',
}).then(() => {
done()
});
AMapLoader.load({
key: JSAPIKey,//首次load必填
version: '1.4.15',
}).then(() => {
done(Error('should not here'))
})
.catch(err => {
try {
expect(err).eq('不允许多个版本 JSAPI 混用')
} catch (error) {
done(error)
}
})
});
it('fail with multi key', (done) => {
AMapLoader.load({
key: JSAPIKey,//首次load必填
version: '2.0',
}).then(() => {
done()
});
AMapLoader.load({
key: 'asdfas',//首次load必填
}).then(() => {
done(Error('should not here'))
})
.catch(err => {
try {
expect(err).eq('多个不一致的 key')
} catch (error) {
done(error)
}
})
});
})
describe('AMapUI', () => {
beforeEach(function () {
AMapLoader.reset()
});
it('version', (done) => {
AMapLoader.load({
key: JSAPIKey,//首次load必填
version: '1.4.15',
AMapUI: {
version: '1.1',
plugins: ['misc/PathSimplifier']
}
}).then(() => {
expect(Boolean(window.AMap)).eq(true)
expect(Boolean(window.AMapUI)).eq(true)
expect(Boolean(window.AMapUI.PathSimplifier)).eq(true)
expect(Boolean(window.AMapUI.version.startsWith('1.1'))).eq(true)
done();
}).catch(done);
});
it('async', (done) => {
console.log(window.AMap);
AMapLoader.load({
key: JSAPIKey,//首次load必填
version: '1.4.15',
AMapUI: {
version: '1.0',
plugins: ['overlay/SimpleMarker']
}
}).then(() => {
AMapLoader.load({
AMapUI: {
plugins: ['overlay/SimpleInfoWindow']
}
}).then(() => {
expect(Boolean(window.AMap)).eq(true)
expect(Boolean(window.AMapUI.version.startsWith('1.0'))).eq(true)
expect(Boolean(window.AMapUI.SimpleMarker)).eq(true)
expect(Boolean(window.AMapUI.SimpleInfoWindow)).eq(true)
done()
});
}).catch(done);
})
});
describe('Loca', () => {
beforeEach(function () {
AMapLoader.reset()
});
it('version', (done) => {
AMapLoader.load({
key: JSAPIKey,//首次load必填
version: '1.4.15',
Loca: {
version: '1.3.1'
}
}).then(() => {
expect(Boolean(window.AMap)).eq(true)
expect(Boolean(window.Loca)).eq(true)
expect(window.Loca.version).eq('1.3.1')
done()
}).catch(done);
});
it('fail with jsapi2.0', (done) => {
AMapLoader.load({
key: JSAPIKey,//首次load必填
version: '2.0',
Loca: {
version: '1.3.1'
}
}).then(() => {
done(Error('should not here'))
}).catch(err => {
try {
expect(err).eq("Loca 暂不适配 JSAPI 2.0,请使用 1.4.15")
done()
} catch (error) {
done(error)
}
});
});
it('async', (done) => {
AMapLoader.load({
key: JSAPIKey,//首次load必填
version: '1.4.15',
Loca: {
version: '1.2.1'
}
}).then(() => {
expect(Boolean(window.AMap)).eq(true)
expect(Boolean(window.Loca)).eq(true)
expect(window.Loca.version).eq('1.2.1')
AMapLoader.load({
Loca: {
version: '1.2.1'
}
}).then(() => {
expect(Boolean(window.AMap)).eq(true)
expect(Boolean(window.Loca)).eq(true)
expect(window.Loca.version).eq('1.2.1')
done()
}).catch(done);
});
})
});
describe('Advance', () => {
beforeEach(function () {
AMapLoader.reset()
});
it('Multi', (done) => {
AMapLoader.load({ key: JSAPIKey, version: '1.4.15' }).then(() => {
expect(Boolean(window.AMap)).eq(true);
expect(window.AMap.v).eq('1.4.15');
expect(Boolean(window.AMapUI)).eq(false);
expect(Boolean(window.Loca)).eq(false);
AMapLoader.load({ AMapUI: {} }).then(() => {
expect(Boolean(window.AMap)).eq(true);
expect(window.AMap.v).eq('1.4.15');
expect(Boolean(window.AMapUI)).eq(true);
expect(window.AMapUI.version.startsWith('1.1')).eq(true);
expect(Boolean(window.Loca)).eq(false);
AMapLoader.load({ Loca: {} }).then(() => {
expect(Boolean(window.AMap)).eq(true);
expect(window.AMap.v).eq('1.4.15');
expect(Boolean(window.AMapUI)).eq(true);
expect(window.AMapUI.version.startsWith('1.1')).eq(true);
expect(Boolean(window.Loca)).eq(true);
expect(window.Loca.version).eq('1.3.2');
done()
})
})
}).catch(done)
})
})
mocha.run()
</script>
</script>
</body>
</html>

15
node_modules/@amap/amap-jsapi-loader/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,15 @@
declare var load: (options: {
key: string; // 申请好的Web端开发者Key首次调用 load 时必填
version: string; // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins?: string[]; //插件列表
// 是否加载 AMapUI缺省不加载
AMapUI?: {
version?: string; // AMapUI 缺省 1.1
plugins?: string[]; // 需要加载的 AMapUI ui插件
};
// 是否加载 Loca 缺省不加载
Loca?: {
version?: string; // Loca 版本,缺省 1.3.2
};
}) => Promise<any>;
export { load };

37
node_modules/@amap/amap-jsapi-loader/package.json generated vendored Normal file
View File

@ -0,0 +1,37 @@
{
"name": "@amap/amap-jsapi-loader",
"version": "1.0.1",
"description": "高德官网提供的地图JSAPI加载器可以避免多种异步加载API的错误用法",
"main": "dist/index.js",
"types": "index.d.ts",
"directories": {
"test": "test"
},
"scripts": {
"build": "rollup -c rollup.config.js"
},
"repository": {
"type": "git",
"url": "git@gitlab.alibaba-inc.com:amap-web/amap-jsapi-loader.git"
},
"keywords": [
"amap",
"jsapi",
"sdk",
"loader",
"地图",
"高德"
],
"author": "mengmeng.du@alibaba-inc.com",
"license": "MIT",
"devDependencies": {
"@ampproject/rollup-plugin-closure-compiler": "^0.23.0",
"@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7",
"rollup": "^1.32.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-server": "^0.7.0",
"rollup-plugin-typescript2": "^0.27.1",
"typescript": "^3.9.7"
}
}

25
node_modules/@amap/amap-jsapi-loader/rollup.config.js generated vendored Normal file
View File

@ -0,0 +1,25 @@
import server from "rollup-plugin-server";
import babel from "rollup-plugin-babel";
import compiler from "@ampproject/rollup-plugin-closure-compiler";
import rollupTypescript from 'rollup-plugin-typescript2';
export default {
input: "src/index.ts",
output: {
file: "dist/index.js",
format: "umd",
name: "AMapLoader",
},
plugins: [
rollupTypescript(),
babel({
presets: [["@babel/env", { targets: { ie: 9 } }]],
}),
compiler(),
server({
contentBase: "./",
host: "127.0.0.1",
port: 3601,
}),
],
};

5
node_modules/@amap/amap-jsapi-loader/src/global.d.ts generated vendored Normal file
View File

@ -0,0 +1,5 @@
declare var AMap: any;
declare var AMapUI: any;
declare var Loca: any;
declare var ___onAPILoaded: any;

367
node_modules/@amap/amap-jsapi-loader/src/index.ts generated vendored Normal file
View File

@ -0,0 +1,367 @@
if (!window) {
throw Error("AMap JSAPI can only be used in Browser.");
}
enum LoadStatus {
notload = "notload",
loading = "loading",
loaded = "loaded",
failed = "failed",
}
let config = {
key: "",
AMap: {
version: "1.4.15",
plugins: [],
},
AMapUI: {
version: "1.1",
plugins: [],
},
Loca: {
version: "1.3.2",
},
};
let Status = {
AMap: LoadStatus.notload,
AMapUI: LoadStatus.notload,
Loca: LoadStatus.notload,
};
let Callback = {
AMap: [],
AMapUI: [],
Loca: [],
};
let onloadCBKs = [];
const onload = function (callback) {
if (typeof callback == "function") {
if (Status.AMap === LoadStatus.loaded) {
callback(window.AMap);
return;
}
onloadCBKs.push(callback);
}
};
interface LoadOption {
key: string;
version?: string;
plugins?: string[];
AMapUI?: {
version?: string;
plugins?: string[];
};
Loca?: {
version?: string;
};
}
function appendOther(option: LoadOption): Promise<any> {
let pros: Promise<void>[] = [];
if (option.AMapUI) {
pros.push(loadAMapUI(option.AMapUI));
}
if (option.Loca) {
pros.push(loadLoca(option.Loca));
}
return Promise.all(pros);
}
function loadAMapUI(params: { version?: string; plugins?: string[] }): Promise<void> {
return new Promise((res, rej) => {
const newPlugins: string[] = [];
if (params.plugins) {
for (var i = 0; i < params.plugins.length; i += 1) {
if (config.AMapUI.plugins.indexOf(params.plugins[i]) == -1) {
newPlugins.push(params.plugins[i]);
}
}
}
if (Status.AMapUI === LoadStatus.failed) {
rej("前次请求 AMapUI 失败");
} else if (Status.AMapUI === LoadStatus.notload) {
Status.AMapUI = LoadStatus.loading;
config.AMapUI.version = params.version || config.AMapUI.version;
const version = config.AMapUI.version;
const parentNode = document.body || document.head;
const script = document.createElement("script");
script.type = "text/javascript";
script.src = `https://webapi.amap.com/ui/${version}/main.js`;
script.onerror = (e) => {
Status.AMapUI = LoadStatus.failed;
rej("请求 AMapUI 失败");
};
script.onload = () => {
Status.AMapUI = LoadStatus.loaded;
if (newPlugins.length) {
window.AMapUI.loadUI(newPlugins, function () {
for (let i = 0, len = newPlugins.length; i < len; i++) {
const path = newPlugins[i];
const name = path.split("/").slice(-1)[0];
window.AMapUI[name] = arguments[i];
}
res();
while (Callback.AMapUI.length) {
Callback.AMapUI.splice(0, 1)[0]();
}
});
} else {
res();
while (Callback.AMapUI.length) {
Callback.AMapUI.splice(0, 1)[0]();
}
}
};
parentNode.appendChild(script);
} else if (Status.AMapUI === LoadStatus.loaded) {
if (params.version && params.version !== config.AMapUI.version) {
rej("不允许多个版本 AMapUI 混用");
} else {
if (newPlugins.length) {
window.AMapUI.loadUI(newPlugins, function () {
for (let i = 0, len = newPlugins.length; i < len; i++) {
const path = newPlugins[i];
const name = path.split("/").slice(-1)[0];
window.AMapUI[name] = arguments[i];
}
res();
});
} else {
res();
}
}
} else {
if (params.version && params.version !== config.AMapUI.version) {
rej("不允许多个版本 AMapUI 混用");
} else {
Callback.AMapUI.push((err) => {
if (err) {
rej(err);
} else {
if (newPlugins.length) {
window.AMapUI.loadUI(newPlugins, function () {
for (let i = 0, len = newPlugins.length; i < len; i++) {
const path = newPlugins[i];
const name = path.split("/").slice(-1)[0];
window.AMapUI[name] = arguments[i];
}
res();
});
} else {
res();
}
}
});
}
}
});
}
function loadLoca(params: { version?: string }): Promise<void> {
return new Promise((res, rej) => {
if (Status.Loca === LoadStatus.failed) {
rej("前次请求 Loca 失败");
} else if (Status.Loca === LoadStatus.notload) {
Status.Loca = LoadStatus.loading;
config.Loca.version = params.version || config.Loca.version;
const version = config.Loca.version;
const isApiV2 = config.AMap.version.startsWith("2");
const isLocaV2 = version.startsWith("2");
if ((isApiV2 && !isLocaV2) || (!isApiV2 && isLocaV2)) {
rej("JSAPI 与 Loca 版本不对应!!");
return;
}
const key = config.key;
const parentNode = document.body || document.head;
const script = document.createElement("script");
script.type = "text/javascript";
script.src = `https://webapi.amap.com/loca?v=${version}&key=${key}`;
script.onerror = (e) => {
Status.Loca = LoadStatus.failed;
rej("请求 AMapUI 失败");
};
script.onload = () => {
Status.Loca = LoadStatus.loaded;
res();
while (Callback.Loca.length) {
Callback.Loca.splice(0, 1)[0]();
}
};
parentNode.appendChild(script);
} else if (Status.Loca === LoadStatus.loaded) {
if (params.version && params.version !== config.Loca.version) {
rej("不允许多个版本 Loca 混用");
} else {
res();
}
} else {
if (params.version && params.version !== config.Loca.version) {
rej("不允许多个版本 Loca 混用");
} else {
Callback.Loca.push((err) => {
if (err) {
rej(err);
} else {
rej();
}
});
}
}
});
}
const load = function (options: LoadOption) {
return new Promise((resolve, reject) => {
if (Status.AMap == LoadStatus.failed) {
reject("");
} else if (Status.AMap == LoadStatus.notload) {
//初次加载
let { key, version, plugins } = options;
if (!key) {
reject("请填写key");
return;
}
if (window.AMap && location.host !== "lbs.amap.com") {
reject("禁止多种API加载方式混用");
}
config.key = key;
config.AMap.version = version || config.AMap.version;
config.AMap.plugins = plugins || config.AMap.plugins;
Status.AMap = LoadStatus.loading;
const parentNode = document.body || document.head;
window.___onAPILoaded = function (err) {
delete window.___onAPILoaded;
if (err) {
Status.AMap = LoadStatus.failed;
reject(err);
} else {
Status.AMap = LoadStatus.loaded;
appendOther(options)
.then(() => {
resolve(window.AMap);
})
.catch(reject);
while (onloadCBKs.length) {
onloadCBKs.splice(0, 1)[0]();
}
}
};
const script = document.createElement("script");
script.type = "text/javascript";
script.src =
"https://webapi.amap.com/maps?callback=___onAPILoaded&v=" +
config.AMap.version +
"&key=" +
key +
"&plugin=" +
config.AMap.plugins.join(",");
script.onerror = (e) => {
Status.AMap = LoadStatus.failed;
reject(e);
};
parentNode.appendChild(script);
} else if (Status.AMap == LoadStatus.loaded) {
//deal multi load
if (options.key && options.key !== config.key) {
reject("多个不一致的 key");
return;
}
if (options.version && options.version !== config.AMap.version) {
reject("不允许多个版本 JSAPI 混用");
return;
}
const newPlugins = [];
if (options.plugins) {
for (var i = 0; i < options.plugins.length; i += 1) {
if (config.AMap.plugins.indexOf(options.plugins[i]) == -1) {
newPlugins.push(options.plugins[i]);
}
}
}
if (newPlugins.length) {
window.AMap.plugin(newPlugins, () => {
appendOther(options)
.then(() => {
resolve(window.AMap);
})
.catch(reject);
});
} else {
appendOther(options)
.then(() => {
resolve(window.AMap);
})
.catch(reject);
}
} else {
// loading
if (options.key && options.key !== config.key) {
reject("多个不一致的 key");
return;
}
if (options.version && options.version !== config.AMap.version) {
reject("不允许多个版本 JSAPI 混用");
return;
}
const newPlugins = [];
if (options.plugins) {
for (var i = 0; i < options.plugins.length; i += 1) {
if (config.AMap.plugins.indexOf(options.plugins[i]) == -1) {
newPlugins.push(options.plugins[i]);
}
}
}
onload(() => {
if (newPlugins.length) {
window.AMap.plugin(newPlugins, () => {
appendOther(options)
.then(() => {
resolve(window.AMap);
})
.catch(reject);
});
} else {
appendOther(options)
.then(() => {
resolve(window.AMap);
})
.catch(reject);
}
});
}
});
};
function reset() {
delete window.AMap;
delete window.AMapUI;
delete window.Loca;
config = {
key: "",
AMap: {
version: "1.4.15",
plugins: [],
},
AMapUI: {
version: "1.1",
plugins: [],
},
Loca: {
version: "1.3.2",
},
};
Status = {
AMap: LoadStatus.notload,
AMapUI: LoadStatus.notload,
Loca: LoadStatus.notload,
};
Callback = {
AMap: [],
AMapUI: [],
Loca: [],
};
}
export default { load, reset };

17
node_modules/@amap/amap-jsapi-loader/test/demo.ts generated vendored Normal file
View File

@ -0,0 +1,17 @@
import AMapLoader from "../";
// import { } from "@ali/test-amap-jsapi";
AMapLoader.load({
key: "test",
version: "2.0"
}).then(() => {
new AMap.Circle({})
const map = new AMap.Map("div");
map.on("complete", () => {
const circle = new AMap.Circle({
center: [135, 45],
radius: 40
});
map.add(circle);
});
});

7
node_modules/@amap/amap-jsapi-loader/test/test.ts generated vendored Normal file
View File

@ -0,0 +1,7 @@
import AMapLoader from "../";
import "@amap/amap-jsapi-loader";
AMapLoader.load({
key: "test",
version: "2.0"
}).then(() => {});

18
package-lock.json generated Normal file
View File

@ -0,0 +1,18 @@
{
"name": "xinnengy",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1"
}
},
"node_modules/@amap/amap-jsapi-loader": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
"integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw==",
"license": "MIT"
}
}
}

5
package.json Normal file
View File

@ -0,0 +1,5 @@
{
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1"
}
}

View File

@ -1,6 +1,6 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO } from '@/api/project/constructionUser/types';
import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO, skipType } from '@/api/project/constructionUser/types';
/**
* 查询施工人员列表
@ -27,6 +27,28 @@ export const getConstructionUser = (id: string | number): AxiosPromise<Construct
});
};
/**
* 人员迁移
* @param data
*/
export const transferConstructionUser = (data: skipType) => {
return request({
url: '/project/constructionUser/change/project',
method: 'put',
data: data
});
};
/**
* 查询项目以及项目下的分包公司列表
*/
export const getProjectContractorList = () => {
return request({
url: '/project/project/list/project/contractorList',
method: 'get'
});
};
/**
* 新增施工人员
* @param data

View File

@ -183,6 +183,46 @@ export interface ConstructionUserVO {
createTime: string;
}
export interface skipType {
/**
* 项目id
*/
projectId: string | number;
/**
* 分包id
*/
contractorId: string | number;
id: string | number;
}
export interface skipOptionType {
/**
* 名称
*/
projectName: string | number;
/**
* id
*/
id: string | number;
/**
* 子项
*/
contractorList: Array<skipTeamType>;
}
export interface skipTeamType {
/**
* 名称
*/
name: string | number;
/**
* id
*/
id: string | number;
}
export interface ConstructionUserForm extends BaseEntity {
/**
* 主键id

View File

@ -51,6 +51,11 @@ export interface ContractorForm extends BaseEntity {
*/
id?: string | number;
/**
* 主键id
*/
projectId?: string | number;
/**
* 公司名称
*/

View File

@ -37,12 +37,12 @@ export interface ProjectVO {
/**
* 项目类型
*/
type: string;
projectType: string;
/**
* 项目类型1光伏 2风电
*/
isType: number;
projectCategory: number;
/**
* 删除时间
@ -115,6 +115,18 @@ export interface ProjectVO {
createTime: string;
}
export interface locationType {
/**
* 经度
*/
lng: string;
// 纬度
lat: string;
// 逆地理编码地址
projectSite: string;
}
export interface ProjectForm extends BaseEntity {
/**
*
@ -146,6 +158,16 @@ export interface ProjectForm extends BaseEntity {
*/
picUrl?: string;
/**
* 经度
*/
lng?: string;
/**
* 纬度
*/
lat?: string;
/**
* 备注
*/
@ -154,12 +176,12 @@ export interface ProjectForm extends BaseEntity {
/**
* 项目类型
*/
type?: string;
projectType?: string;
/**
* 项目类型1光伏 2风电
*/
isType?: number;
projectCategory?: number;
/**
* 删除时间
@ -197,9 +219,14 @@ export interface ProjectForm extends BaseEntity {
onStreamTime?: string;
/**
* 打卡范围09:00,18:00
* 打卡开始时间09:00,18:00
*/
punchRange?: string;
playCardStart?: string;
/**
* 打卡结束时间09:00,18:00
*/
playCardEnd?: string;
/**
* 设计总量
@ -256,12 +283,12 @@ export interface ProjectQuery extends PageQuery {
/**
* 项目类型
*/
type?: string;
projectType?: string;
/**
* 项目类型1光伏 2风电
*/
isType?: number;
projectCategory?: number;
/**
* 删除时间
@ -273,6 +300,16 @@ export interface ProjectQuery extends PageQuery {
*/
projectSite?: string;
/**
* 经度
*/
lng?: string;
/**
* 纬度
*/
lat?: string;
/**
* 负责人
*/
@ -299,9 +336,14 @@ export interface ProjectQuery extends PageQuery {
onStreamTime?: string;
/**
* 打卡范围09:00,18:00
* 打卡开始时间09:00,18:00
*/
punchRange?: string;
playCardStart?: string;
/**
* 打卡结束时间09:00,18:00
*/
playCardEnd?: string;
/**
* 设计总量

View File

@ -0,0 +1,136 @@
<template>
<div class="map">
<input type="text" placeholder="请输入地址" v-model="searchValue" />
<button @click="onSearch">搜索</button>
<div id="container" :style="{ 'height': mapProps.height }"></div>
<div id="my-panel" @listElementClick="selectPostion"></div>
<div class="flex justify-end">
<el-button type="primary" @click="submit"> 确定 </el-button>
<el-button @click="emit('setLocation')">取消</el-button>
</div>
</div>
</template>
<script setup>
import { onMounted, onUnmounted } from 'vue';
import AMapLoader from '@amap/amap-jsapi-loader';
const { proxy } = getCurrentInstance();
//props参数
const mapProps = defineProps({
height: {
type: String,
default: '800px'
}
});
const emit = defineEmits(['setLocation']);
const center = ref([116.397428, 39.90923]);
const map = ref(null);
const placeSearch = ref(null);
const geocoder = ref(null);
const searchValue = ref('');
const lnglat = ref([]);
onMounted(() => {
window._AMapSecurityConfig = {
securityJsCode: '3f418182f27c907265f69a708c5fa41c'
};
AMapLoader.load({
key: 'ed8d05ca57affee582e2be654bac5baf', // 申请好的Web端开发者Key首次调用 load 时必填
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins: ['AMap.Scale', 'AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'] //需要使用的的插件列表,如比例尺'AMap.Scale',支持添加多个如:['...','...']
})
.then((AMap) => {
map.value = new AMap.Map('container', {
// 设置地图容器id
viewMode: '3D', // 是否为3D地图模式
zoom: 8, // 初始化地图级别
center: center.value // 初始化地图中心点位置
});
//初始化搜索
placeSearch.value = new AMap.PlaceSearch({
pageSize: 5, //单页显示结果条数
// pageIndex: 1, //页码
// city: '010', //兴趣点城市
// citylimit: true, //是否强制限制在设置的城市内搜索
panel: 'my-panel',
map: map.value, //展现结果的地图实例
autoFitView: true //是否自动调整地图视野使绘制的 Marker 点都处于视口的可见范围
});
// 初始化Geocoder
geocoder.value = new AMap.Geocoder({
radius: 1000 //范围默认500
});
// 定位
const geolocation = new AMap.Geolocation({
enableHighAccuracy: true, //是否使用高精度定位,默认:true
timeout: 10000, //超过10秒后停止定位默认无穷大
maximumAge: 0, //定位结果缓存0毫秒默认0
convert: true, //自动偏移坐标偏移后的坐标为高德坐标默认true
showButton: true, //显示定位按钮默认true
buttonPosition: 'LB', //定位按钮停靠位置,默认:'LB',左下角
buttonOffset: new AMap.Pixel(10, 20), //定位按钮与设置的停靠位置的偏移量默认Pixel(10, 20)
showMarker: true, //定位成功后在定位到的位置显示点标记默认true
showCircle: true, //定位成功后用圆圈表示定位精度范围默认true
panToLocation: true, //定位成功后将定位到的位置作为地图中心点默认true
zoomToAccuracy: true //定位成功后调整地图视野范围使定位位置及精度范围视野内可见默认false
});
map.value.addControl(geolocation);
//定位到当前位置
geolocation.getCurrentPosition((status, result) => {
console.log(status, result);
});
placeSearch.value.on('selectChanged', (e) => {
let { lng, lat } = e.selected.data.location;
lnglat.value = [lng, lat];
});
})
.catch((e) => {
console.log(e);
});
});
const onSearch = () => {
//搜索地址
placeSearch.value.search(searchValue.value, (status, result) => {
if (result.info !== 'OK') return;
let { lng, lat } = result.poiList.pois[0].location;
lnglat.value = [lng, lat];
});
};
const submit = () => {
if (!lnglat.value.length) {
proxy?.$modal.msgWarning('请选择正确地址');
return;
}
geocoder.value.getAddress(lnglat.value, function (status, result) {
if (status === 'complete' && result.info === 'OK') {
// result为对应的地理位置详细信息
const position = {
lng: lnglat.value[0],
lat: lnglat.value[1],
projectSite: result.regeocode.formattedAddress
};
emit('setLocation', position);
}
});
};
onUnmounted(() => {
map.value?.destroy();
});
</script>
<style scoped lang="scss">
#container {
width: 100%;
position: relative;
margin-bottom: 15px;
}
#my-panel {
position: absolute;
top: 103px;
z-index: 1;
left: 10px;
}
</style>

View File

@ -115,6 +115,9 @@
<el-button link type="danger" icon="Avatar" @click="handleJoinBlacklist(scope.row)" v-hasPermi="['project:constructionBlacklist:add']">
黑名单
</el-button>
<el-button link type="primary" icon="Switch" @click="handleChange(scope.row)" v-hasPermi="['project:constructionBlacklist:add']">
人员迁移
</el-button>
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['project:constructionUser:remove']">
删除
</el-button>
@ -265,6 +268,24 @@
<el-dialog title="施工人员详情" v-model="showDetailDrawer">
<construction-user-detail :user-id="currentUserId" />
</el-dialog>
<el-dialog :title="skipName + '-人员迁移'" v-model="skip" width="500px">
<el-form-item label="所属项目" label-width="130px">
<el-select v-model="skipObject.projectId" @change="selectProject" placeholder="请选择所属项目" style="width: 240px">
<el-option v-for="item in skipOptions" :key="item.id" :label="item.projectName" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="分包单位" label-width="130px">
<el-select v-model="skipObject.contractorId" :disabled="!skipObject.projectId" placeholder="请选择分包单位" style="width: 240px">
<el-option v-for="item in contractorList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="setUnits">确认</el-button>
<el-button @click="skip = false"> 取消 </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
@ -274,9 +295,18 @@ import {
delConstructionUser,
getConstructionUser,
listConstructionUser,
updateConstructionUser
updateConstructionUser,
getProjectContractorList,
transferConstructionUser
} from '@/api/project/constructionUser';
import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO } from '@/api/project/constructionUser/types';
import {
ConstructionUserForm,
ConstructionUserQuery,
ConstructionUserVO,
skipType,
skipOptionType,
skipTeamType
} from '@/api/project/constructionUser/types';
import { useUserStoreHook } from '@/store/modules/user';
import { listContractor } from '@/api/project/contractor';
import { listProjectTeam } from '@/api/project/projectTeam';
@ -300,15 +330,25 @@ const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const skip = ref(false);
const queryFormRef = ref<ElFormInstance>();
const constructionUserFormRef = ref<ElFormInstance>();
const skipName = ref('');
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//人员迁移条件
const skipObject: skipType = reactive({
id: '',
projectId: '',
contractorId: ''
});
const contractorList = ref<Array<skipTeamType>>([]);
//项目列表
const skipOptions = ref<Array<skipOptionType>>([]);
const initFormData: ConstructionUserForm = {
id: undefined,
openid: undefined,
@ -392,6 +432,21 @@ const getList = async () => {
loading.value = false;
};
const selectProject = (e: any) => {
//选中项目筛选出项目下的分包单位
contractorList.value = skipOptions.value.filter((item) => item.id == e)[0].contractorList;
};
const setUnits = async () => {
//人员迁移
console.log('🚀 ~ setUnits ~ skipObject:', skipObject);
let res = await transferConstructionUser(skipObject);
if (res.code == 200) {
ElMessage.success(res.msg);
skip.value = false;
getList();
}
};
const contractorOpt = ref();
/** 查询当前项目下的分包公司列表 */
@ -489,6 +544,16 @@ const handleShowDrawer = (row?: ConstructionUserVO) => {
showDetailDrawer.value = true;
};
/** 人员迁移 */
const handleChange = async (row: ConstructionUserVO) => {
const _id = row?.id || ids.value[0];
skipName.value = row?.userName;
skipObject.id = _id;
const res = await getProjectContractorList();
skipOptions.value = res.data;
skip.value = true;
};
/** 提交按钮 */
const submitForm = () => {
constructionUserFormRef.value?.validate(async (valid: boolean) => {

View File

@ -122,16 +122,6 @@ const contractorFormRef = ref<ElFormInstance>();
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
//监听项目改变
// watch(
// () => currentProject.value,
// (newId, oldId) => {
// /* ... */
// queryParams.value.projectId=newId.id
// // getList()
// }
// )
const dialog = reactive<DialogOption>({
visible: false,
title: ''
@ -145,7 +135,8 @@ const initFormData: ContractorForm = {
custodian: undefined,
custodianPhone: undefined,
fileMap: undefined,
remark: undefined
remark: undefined,
projectId: currentProject.value.id
};
const data = reactive<PageData<ContractorForm, ContractorQuery>>({
form: { ...initFormData },
@ -172,7 +163,7 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询分包单位列表 */
const getList = async () => {
loading.value = true;
const res = await listContractor(queryParams.value);
contractorList.value = res.rows;
total.value = res.total;

View File

@ -52,10 +52,14 @@
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="项目类型" align="center" prop="type" />
<el-table-column label="项目类别" align="center" prop="isType">
<el-table-column label="项目类型" align="center" prop="projectType">
<template #default="scope">
<dict-tag :options="project_category_type" :value="scope.row.isType" />
<dict-tag :options="project_type" :value="scope.row.projectType" />
</template>
</el-table-column>
<el-table-column label="项目类别" align="center" prop="projectCategory">
<template #default="scope">
<dict-tag :options="project_category_type" :value="scope.row.projectCategory" />
</template>
</el-table-column>
<el-table-column label="项目地址" align="center" prop="projectSite" />
@ -82,44 +86,136 @@
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改项目对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-dialog :title="dialog.title" v-model="dialog.visible" width="770px" append-to-body>
<el-form ref="projectFormRef" :model="form" :rules="rules" label-width="100px">
<el-form-item label="项目名称" prop="projectName">
<el-input v-model="form.projectName" placeholder="请输入项目名称" />
</el-form-item>
<el-form-item label="项目简称" prop="shortName">
<el-input v-model="form.shortName" placeholder="请输入项目简称" />
</el-form-item>
<el-form-item label="项目地址" prop="projectSite">
<el-input v-model="form.projectSite" placeholder="请输入项目地址" />
</el-form-item>
<el-form-item label="负责人" prop="principal">
<el-input v-model="form.principal" placeholder="请输入负责人" />
</el-form-item>
<el-form-item label="负责人电话" prop="principalPhone">
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" />
</el-form-item>
<el-form-item label="实际容量" prop="actual">
<el-input v-model="form.actual" placeholder="请输入实际容量" />
</el-form-item>
<el-form-item label="计划容量" prop="plan">
<el-input v-model="form.plan" placeholder="请输入计划容量" />
</el-form-item>
<el-form-item label="开工时间" prop="onStreamTime">
<el-date-picker clearable v-model="form.onStreamTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择开工时间" />
</el-form-item>
<el-form-item label="打卡范围" prop="punchRange">
<el-input v-model="form.punchRange" placeholder="请输入打卡范围" />
</el-form-item>
<el-form-item label="设计总量" prop="designTotal">
<el-input v-model="form.designTotal" placeholder="请输入设计总量" />
</el-form-item>
<el-form-item label="安全协议书" prop="securityAgreement">
<file-upload v-model="form.securityAgreement" :limit="1" :file-type="['pdf']" :file-size="50" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
<div class="block-box">
<div class="">基础信息</div>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="项目名称" prop="projectName">
<el-input v-model="form.projectName" placeholder="请输入项目名称" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="项目简称" prop="shortName">
<el-input v-model="form.shortName" placeholder="请输入项目简称" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="负责人" prop="principal">
<el-input v-model="form.principal" placeholder="请输入负责人" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="负责人电话" prop="principalPhone">
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="项目类型" prop="projectType" label-width="100px">
<el-select v-model="form.projectType" placeholder="请选择项目类型" clearable>
<el-option v-for="dict in project_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="项目类别" prop="projectCategory" label-width="100px">
<el-select v-model="form.projectCategory" placeholder="请选择项目类别" clearable>
<el-option v-for="dict in project_category_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="开工时间" prop="onStreamTime">
<el-date-picker clearable v-model="form.onStreamTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择开工时间" />
</el-form-item>
</el-col>
<el-col :span="12" :push="3">
<el-button type="primary" size="default" @click="amapStatus = true">获取经纬度</el-button>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="经度" prop="lng">
<el-input v-model="form.lng" disabled placeholder="请输入经度" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="纬度" prop="lat">
<el-input v-model="form.lat" disabled placeholder="请输入纬度" />
</el-form-item>
</el-col>
<el-col :span="24" :offset="0">
<el-form-item label="项目地址" prop="projectSite">
<el-input v-model="form.projectSite" disabled placeholder="请输入项目地址" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="计划容量" prop="plan">
<el-input v-model="form.plan" placeholder="请输入计划容量" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="实际容量" prop="actual">
<el-input v-model="form.actual" placeholder="请输入实际容量" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="设计总量" prop="designTotal">
<el-input v-model="form.designTotal" placeholder="请输入设计总量" />
</el-form-item>
</el-col>
<el-col :span="24" :offset="0">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入内容" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="项目排序" prop="remark">
<el-input-number v-model="form.sort" :min="0" :max="10000" />
</el-form-item>
</el-col>
</el-row>
</div>
<div class="block-box">
<div class="">打卡设置</div>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="打卡开始时间" prop="playCardStart" label-width="110px">
<!-- <el-time-picker value-format="HH:mm" v-model="form.playCardStart" placeholder="请输入打卡开始时间" /> -->
<el-time-select
v-model="form.playCardStart"
style="width: 100%"
class="mr-4"
placeholder="请输入打卡开始时间"
value-format="HH:mm"
start="00:00"
step="00:15"
end="23:59"
/>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="打卡结束时间" prop="playCardEnd" label-width="110px">
<!-- <el-time-picker value-format="HH:mm" v-model="form.playCardEnd" placeholder="请输入打卡结束时间" /> -->
<el-time-select
v-model="form.playCardEnd"
style="width: 100%"
:min-time="form.playCardStart"
class="mr-4"
placeholder="请输入打卡结束时间"
value-format="HH:mm"
start="00:00"
step="00:15"
end="23:59"
/>
</el-form-item>
</el-col>
<el-col :span="24" :offset="0">
<el-form-item label="安全协议书" prop="securityAgreement">
<file-upload v-model="form.securityAgreement" :limit="1" :file-type="['pdf']" :file-size="50" />
</el-form-item>
</el-col>
</el-row>
</div>
</el-form>
<template #footer>
<div class="dialog-footer">
@ -137,16 +233,29 @@
</div>
</template>
</el-dialog>
<el-dialog v-model="amapStatus" title="获取经纬度" width="80%">
<amap height="620px" @setLocation="setPoi"></amap>
<!-- <template #footer>
<div class="dialog-footer">
<el-button v-loading="buttonLoading" type="primary" @click="amapStatus = false"> 确定</el-button>
<el-button @click="amapStatus = false">取消</el-button>
</div>
</template> -->
</el-dialog>
</div>
</template>
<script setup name="Project" lang="ts">
import { addProject, delProject, getProject, listProject, updateProject } from '@/api/project/project';
import { ProjectForm, ProjectQuery, ProjectVO } from '@/api/project/project/types';
import { ProjectForm, ProjectQuery, ProjectVO, locationType } from '@/api/project/project/types';
import amap from '@/components/amap/index.vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_normal_disable, project_category_type } = toRefs<any>(proxy?.useDict('sys_normal_disable', 'project_category_type'));
const { sys_normal_disable, project_category_type, project_type } = toRefs<any>(
proxy?.useDict('sys_normal_disable', 'project_category_type', 'project_type')
);
const change = (val: any) => {
console.log(val, 1212, form.value.playCardStart);
};
const projectList = ref<ProjectVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
@ -155,7 +264,7 @@ const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const amapStatus = ref(false);
const queryFormRef = ref<ElFormInstance>();
const projectFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
@ -171,19 +280,22 @@ const initFormData: ProjectForm = {
status: undefined,
picUrl: undefined,
remark: undefined,
type: undefined,
isType: undefined,
projectType: undefined,
projectCategory: undefined,
deletedAt: undefined,
projectSite: undefined,
principal: undefined,
principalPhone: undefined,
actual: undefined,
lng: undefined,
lat: undefined,
plan: undefined,
onStreamTime: undefined,
punchRange: undefined,
playCardStart: undefined,
playCardEnd: undefined,
designTotal: undefined,
securityAgreement: undefined,
sort: undefined,
sort: 0,
showHidden: undefined,
isDelete: undefined
};
@ -197,16 +309,19 @@ const data = reactive<PageData<ProjectForm, ProjectQuery>>({
pId: undefined,
status: undefined,
picUrl: undefined,
type: undefined,
isType: undefined,
projectType: undefined,
projectCategory: undefined,
deletedAt: undefined,
projectSite: undefined,
principal: undefined,
principalPhone: undefined,
actual: undefined,
lng: undefined,
lat: undefined,
plan: undefined,
onStreamTime: undefined,
punchRange: undefined,
playCardStart: undefined,
playCardEnd: undefined,
designTotal: undefined,
securityAgreement: undefined,
sort: undefined,
@ -215,10 +330,19 @@ const data = reactive<PageData<ProjectForm, ProjectQuery>>({
params: {}
},
rules: {
punchRange: [{ required: true, message: '打卡范围不能为空', trigger: 'blur' }],
playCardStart: [{ required: true, message: '打卡开始时间不能为空', trigger: 'blur' }],
playCardEnd: [{ required: true, message: '打卡结束时间不能为空', trigger: 'blur' }],
projectName: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }],
shortName: [{ required: true, message: '项目简称不能为空', trigger: 'blur' }],
projectSite: [{ required: true, message: '项目地址不能为空', trigger: 'blur' }]
principalPhone: [{ required: true, message: '负责人电话不能为空', trigger: 'blur' }],
principal: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
projectType: [{ required: true, message: '项目类型不能为空', trigger: 'blur' }],
projectCategory: [{ required: true, message: '项目类别不能为空', trigger: 'blur' }],
projectSite: [{ required: true, message: '项目地址不能为空', trigger: 'blur' }],
actual: [{ required: true, message: '实际容量不能为空', trigger: 'blur' }],
lng: [{ required: true, message: '经度不能为空', trigger: 'blur' }],
lat: [{ required: true, message: '纬度不能为空', trigger: 'blur' }],
plan: [{ required: true, message: '计划容量不能为空', trigger: 'blur' }]
}
});
@ -243,6 +367,18 @@ const reset = () => {
projectFormRef.value?.resetFields();
};
// 设置位置信息
const setPoi = (location: locationType) => {
if (location) {
console.log('🚀 ~ setPoi ~ poi:', location);
form.value.lng = location.lng;
form.value.lat = location.lat;
form.value.projectSite = location.projectSite;
}
amapStatus.value = false;
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
@ -341,3 +477,17 @@ onMounted(() => {
getList();
});
</script>
<style scoped>
.block-box {
border: 1px solid #9eccfa;
border-radius: 6px;
padding: 10px 20px 0 10px;
margin-bottom: 20px;
}
.block-box > div {
color: #409eff;
font-weight: 700;
font-size: 14px;
margin-bottom: 10px;
}
</style>