3D地图提交一下
This commit is contained in:
@@ -3,8 +3,44 @@ import axios from 'axios'
|
||||
import Vue from 'vue'
|
||||
|
||||
window.axios = axios
|
||||
const KENGEE_CDN_BASE = "http://10.0.97.209/presource/datascreen/"
|
||||
const libs = [`${KENGEE_CDN_BASE}/js/pinyin.min.js`, `${KENGEE_CDN_BASE}/js/dayjs.min.js`]
|
||||
const KENGEE_CDN_BASE = "http://10.0.97.209/presource/datascreen"
|
||||
const libs = [
|
||||
`${KENGEE_CDN_BASE}/js/pinyin.min.js`,
|
||||
`${KENGEE_CDN_BASE}/js/dayjs.min.js`,
|
||||
`${KENGEE_CDN_BASE}/js/Tween.js`,
|
||||
`${KENGEE_CDN_BASE}/js/three/three.js`,
|
||||
`${KENGEE_CDN_BASE}/js/three/js/controls/OrbitControls.js`,
|
||||
`${KENGEE_CDN_BASE}/js/d3-geo.min.js`,
|
||||
]
|
||||
window.$loadScript = (type = 'js', url, dom = "body") => {
|
||||
let flag = false;
|
||||
return new Promise((resolve) => {
|
||||
const head = dom == 'head' ? document.getElementsByTagName('head')[0] : document.body;
|
||||
for (let i = 0; i < head.children.length; i++) {
|
||||
let ele = head.children[i]
|
||||
if ((ele.src || '').indexOf(url) !== -1) {
|
||||
flag = true;
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
if (flag) return;
|
||||
let script;
|
||||
if (type === 'js') {
|
||||
script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.src = url;
|
||||
} else if (type === 'css') {
|
||||
script = document.createElement('link');
|
||||
script.rel = 'stylesheet';
|
||||
script.type = 'text/css';
|
||||
script.href = url;
|
||||
}
|
||||
head.appendChild(script);
|
||||
script.onload = function () {
|
||||
resolve();
|
||||
};
|
||||
});
|
||||
};
|
||||
window.$glob = {}
|
||||
window.$dicts = dicts
|
||||
window.$waitFor = (target, t = 500) => new Promise(resolve => {
|
||||
@@ -50,10 +86,5 @@ Vue.component("tableColumn", {
|
||||
|
||||
export default Promise.all([
|
||||
import("./fetch"),
|
||||
...libs.map(url => new Promise(resolve => {
|
||||
const script = document.createElement("script")
|
||||
script.src = url
|
||||
document.head.appendChild(script)
|
||||
script.onload = () => resolve()
|
||||
})),
|
||||
...libs.map(url => $loadScript('js', url)),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user