工具
This commit is contained in:
@ -1534,7 +1534,13 @@ class Tools {
|
||||
document.body.appendChild(message)
|
||||
message.classList.add(type)
|
||||
}
|
||||
|
||||
/**两点之间的距离 */
|
||||
pointDistance(p1, p2) {
|
||||
let centerDegress = Cesium.Cartesian3.fromDegrees(p1.lng, p1.lat)
|
||||
let point = Cesium.Cartesian3.fromDegrees(p2, p2)
|
||||
let distance = Cesium.Cartesian3.distance(point, centerDegress)
|
||||
return distance
|
||||
}
|
||||
}
|
||||
|
||||
export default Tools
|
||||
|
||||
@ -1,138 +1,141 @@
|
||||
import Dialog from '../BaseDialog'
|
||||
import { Proj } from './proj'
|
||||
import { legp } from '../Obj/Element/datalist';
|
||||
import Tools from "../Tools";
|
||||
let _DialogObject
|
||||
const open = async (sdk, closeCallBack) => {
|
||||
let proj = new Proj()
|
||||
if (_DialogObject && _DialogObject.close) {
|
||||
_DialogObject.close()
|
||||
_DialogObject = null
|
||||
}
|
||||
_DialogObject = await new Dialog(sdk.viewer._container, {
|
||||
title: '度分秒',
|
||||
left: '180px',
|
||||
top: '100px',
|
||||
closeCallBack: () => {
|
||||
closeCallBack && closeCallBack()
|
||||
}
|
||||
})
|
||||
await _DialogObject.init()
|
||||
let tools = new Tools(sdk)
|
||||
// if (_DialogObject && _DialogObject.close) {
|
||||
// _DialogObject.close()
|
||||
// _DialogObject = null
|
||||
// }
|
||||
// _DialogObject = await new Dialog(sdk.viewer._container, {
|
||||
// title: '度分秒',
|
||||
// left: '180px',
|
||||
// top: '100px',
|
||||
// closeCallBack: () => {
|
||||
// closeCallBack && closeCallBack()
|
||||
// }
|
||||
// })
|
||||
// await _DialogObject.init()
|
||||
|
||||
let html = `
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
<div class="col input-select-box">
|
||||
<span class="label" style="flex: 0 0 60px;">输入格式</span>
|
||||
<div class="input-select"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-item item" data-type="${0}">
|
||||
<span class="custom-divider"></span>
|
||||
<p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">
|
||||
<span style="margin-right: 10px;">度</span>
|
||||
<span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如116.6°, 39.9°</span>
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label" style="flex: auto;">经度</span>
|
||||
<input class="input lng" type="number" min="-180" max="180" value="0" title="">
|
||||
</div>
|
||||
<div class="col" style="margin: 0;">
|
||||
<span class="label">纬度</span>
|
||||
<input class="input lat" type="number" min="-90" max="90" value="0" title="">
|
||||
</div>
|
||||
<div class="col" style="flex: 0 0 24px;">
|
||||
<i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;">
|
||||
<svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>
|
||||
</i>
|
||||
<button class="convert" style="margin-left: 10px;">转 换</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-item item" data-type="${1}">
|
||||
<span class="custom-divider"></span>
|
||||
<p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">
|
||||
<span style="margin-right: 10px;">度分</span>
|
||||
<span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如95°10.1702', 49°12.4015'</span>
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col" style="flex-direction: column;">
|
||||
<div class="row" style="margin-bottom: 15px;">
|
||||
<span class="label">经度</span>
|
||||
<input class="input lng-dm-d" style="flex: 1;" type="number" min="-180" max="180" value="0" title="">
|
||||
<span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>
|
||||
<input class="input lng-dm-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
<span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>
|
||||
<span class="top-line"></span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="label">纬度</span>
|
||||
<input class="input lat-dm-d" style="flex: 1;" type="number" min="-90" max="90" value="0" title="">
|
||||
<span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>
|
||||
<input class="input lat-dm-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
<span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>
|
||||
<span class="bottom-line"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col" style="flex: 0 0 24px;margin: 0;">
|
||||
<i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;position: relative;left: -30px;">
|
||||
<svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>
|
||||
</i>
|
||||
<button class="convert" style="margin-left: 10px;">转 换</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-item item" data-type="${2}">
|
||||
<span class="custom-divider"></span>
|
||||
<p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">
|
||||
<span style="margin-right: 10px;">度分秒</span>
|
||||
<span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如11°18'54.37", 39°13'46.57"</span>
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col" style="flex-direction: column;">
|
||||
<div class="row" style="margin-bottom: 15px;">
|
||||
<span class="label">经度</span>
|
||||
<input class="input lng-dms-d" style="flex: 1;" type="number" min="-180" max="180" value="0" title="">
|
||||
<span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>
|
||||
<input class="input lng-dms-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
<span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>
|
||||
<input class="input lng-dms-s" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
<span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>
|
||||
<span class="top-line"></span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="label">纬度</span>
|
||||
<input class="input lat-dms-d" style="flex: 1;" type="number" min="-90" max="90" value="0" title="">
|
||||
<span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>
|
||||
<input class="input lat-dms-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
<span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>
|
||||
<input class="input lat-dms-s" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
<span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>
|
||||
<span class="bottom-line"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col" style="flex: 0 0 24px; margin: 0;">
|
||||
<i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;position: relative;left: -30px;">
|
||||
<svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>
|
||||
</i>
|
||||
<button class="convert" style="margin-left: 10px;">转 换</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="custom-divider" style="order: 10;margin-top: 12px;"></span>
|
||||
`
|
||||
_DialogObject._element.body.className = _DialogObject._element.body.className + ' proj-convert'
|
||||
let contentElm = document.createElement('div')
|
||||
contentElm.style.width = '460px'
|
||||
contentElm.style.display = 'flex'
|
||||
contentElm.style.flexDirection = 'column'
|
||||
contentElm.innerHTML = html
|
||||
_DialogObject.contentAppChild(contentElm)
|
||||
// let html = `
|
||||
// <span class="custom-divider"></span>
|
||||
// <div class="div-item">
|
||||
// <div class="row">
|
||||
// <div class="col input-select-box">
|
||||
// <span class="label" style="flex: 0 0 60px;">输入格式</span>
|
||||
// <div class="input-select"></div>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="div-item item" data-type="${0}">
|
||||
// <span class="custom-divider"></span>
|
||||
// <p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">
|
||||
// <span style="margin-right: 10px;">度</span>
|
||||
// <span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如116.6°, 39.9°</span>
|
||||
// </p>
|
||||
// <div class="row">
|
||||
// <div class="col">
|
||||
// <span class="label" style="flex: auto;">经度</span>
|
||||
// <input class="input lng" type="number" min="-180" max="180" value="0" title="">
|
||||
// </div>
|
||||
// <div class="col" style="margin: 0;">
|
||||
// <span class="label">纬度</span>
|
||||
// <input class="input lat" type="number" min="-90" max="90" value="0" title="">
|
||||
// </div>
|
||||
// <div class="col" style="flex: 0 0 24px;">
|
||||
// <i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;">
|
||||
// <svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>
|
||||
// </i>
|
||||
// <button class="convert" style="margin-left: 10px;">转 换</button>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="div-item item" data-type="${1}">
|
||||
// <span class="custom-divider"></span>
|
||||
// <p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">
|
||||
// <span style="margin-right: 10px;">度分</span>
|
||||
// <span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如95°10.1702', 49°12.4015'</span>
|
||||
// </p>
|
||||
// <div class="row">
|
||||
// <div class="col" style="flex-direction: column;">
|
||||
// <div class="row" style="margin-bottom: 15px;">
|
||||
// <span class="label">经度</span>
|
||||
// <input class="input lng-dm-d" style="flex: 1;" type="number" min="-180" max="180" value="0" title="">
|
||||
// <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>
|
||||
// <input class="input lng-dm-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
// <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>
|
||||
// <span class="top-line"></span>
|
||||
// </div>
|
||||
// <div class="row">
|
||||
// <span class="label">纬度</span>
|
||||
// <input class="input lat-dm-d" style="flex: 1;" type="number" min="-90" max="90" value="0" title="">
|
||||
// <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>
|
||||
// <input class="input lat-dm-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
// <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>
|
||||
// <span class="bottom-line"></span>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="col" style="flex: 0 0 24px;margin: 0;">
|
||||
// <i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;position: relative;left: -30px;">
|
||||
// <svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>
|
||||
// </i>
|
||||
// <button class="convert" style="margin-left: 10px;">转 换</button>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="div-item item" data-type="${2}">
|
||||
// <span class="custom-divider"></span>
|
||||
// <p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">
|
||||
// <span style="margin-right: 10px;">度分秒</span>
|
||||
// <span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如11°18'54.37", 39°13'46.57"</span>
|
||||
// </p>
|
||||
// <div class="row">
|
||||
// <div class="col" style="flex-direction: column;">
|
||||
// <div class="row" style="margin-bottom: 15px;">
|
||||
// <span class="label">经度</span>
|
||||
// <input class="input lng-dms-d" style="flex: 1;" type="number" min="-180" max="180" value="0" title="">
|
||||
// <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>
|
||||
// <input class="input lng-dms-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
// <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>
|
||||
// <input class="input lng-dms-s" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
// <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>
|
||||
// <span class="top-line"></span>
|
||||
// </div>
|
||||
// <div class="row">
|
||||
// <span class="label">纬度</span>
|
||||
// <input class="input lat-dms-d" style="flex: 1;" type="number" min="-90" max="90" value="0" title="">
|
||||
// <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>
|
||||
// <input class="input lat-dms-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
// <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>
|
||||
// <input class="input lat-dms-s" style="flex: 1;" type="number" min="0" max="60" value="0" title="">
|
||||
// <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>
|
||||
// <span class="bottom-line"></span>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="col" style="flex: 0 0 24px; margin: 0;">
|
||||
// <i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;position: relative;left: -30px;">
|
||||
// <svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>
|
||||
// </i>
|
||||
// <button class="convert" style="margin-left: 10px;">转 换</button>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// <span class="custom-divider" style="order: 10;margin-top: 12px;"></span>
|
||||
// `
|
||||
// _DialogObject._element.body.className = _DialogObject._element.body.className + ' proj-convert'
|
||||
// let contentElm = document.createElement('div')
|
||||
// contentElm.style.width = '460px'
|
||||
// contentElm.style.display = 'flex'
|
||||
// contentElm.style.flexDirection = 'column'
|
||||
// contentElm.innerHTML = html
|
||||
// _DialogObject.contentAppChild(contentElm)
|
||||
|
||||
let contentElm = document.getElementsByClassName('proj-convert')[0].getElementsByClassName('content')[0]
|
||||
|
||||
let items = contentElm.getElementsByClassName('item')
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
let type = items[i].getAttribute('data-type')
|
||||
let convertElm = items[i].getElementsByClassName('convert')[0]
|
||||
@ -183,20 +186,10 @@ const open = async (sdk, closeCallBack) => {
|
||||
});
|
||||
|
||||
clipboard.on('success', function (e) {
|
||||
window.ELEMENT &&
|
||||
window.ELEMENT.Message({
|
||||
message: '已复制到剪切板',
|
||||
type: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
tools.message({ text: '已复制到剪切板' })
|
||||
});
|
||||
clipboard.on('error', function (e) {
|
||||
window.ELEMENT &&
|
||||
window.ELEMENT.Message({
|
||||
message: '复制失败',
|
||||
type: 'warning',
|
||||
duration: 1500
|
||||
})
|
||||
tools.message({ type: 'warning', text: '复制失败' })
|
||||
});
|
||||
convertElm.addEventListener('click', () => {
|
||||
// let a = proj.degreesToDMS(100.345546743)
|
||||
@ -317,12 +310,7 @@ const open = async (sdk, closeCallBack) => {
|
||||
contentElm.getElementsByClassName('lat-dm-m')[0].value = latdnArr2[0]
|
||||
break
|
||||
}
|
||||
window.ELEMENT &&
|
||||
window.ELEMENT.Message({
|
||||
message: '转换成功',
|
||||
type: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
tools.message({ text: '转换成功' })
|
||||
for (let m = 0; m < items.length; m++) {
|
||||
items[m].style.display = 'block'
|
||||
}
|
||||
@ -372,10 +360,10 @@ const open = async (sdk, closeCallBack) => {
|
||||
}
|
||||
]
|
||||
|
||||
let selectDataLegpObject = legp(_DialogObject._element.content.getElementsByClassName('input-select-box')[0], ".input-select")
|
||||
let selectDataLegpObject = legp(contentElm.getElementsByClassName('input-select-box')[0], ".input-select")
|
||||
if (selectDataLegpObject) {
|
||||
selectDataLegpObject.legp_search(selectData)
|
||||
let selectDataLegpElm = _DialogObject._element.content.getElementsByClassName('input-select')[0].getElementsByTagName('input')[0]
|
||||
let selectDataLegpElm = contentElm.getElementsByClassName('input-select')[0].getElementsByTagName('input')[0]
|
||||
selectDataLegpElm.value = selectData[0].value
|
||||
selectDataLegpElm.addEventListener('input', () => {
|
||||
for (let i = 0; i < selectData.length; i++) {
|
||||
|
||||
@ -5,77 +5,78 @@ import MouseEvent from '../Event/index'
|
||||
import MouseTip from '../MouseTip'
|
||||
import Tools from '../Tools'
|
||||
let _DialogObject
|
||||
let tip
|
||||
let event
|
||||
const open = async (sdk, closeCallBack) => {
|
||||
let topls = new Tools()
|
||||
let proj = new Proj()
|
||||
let tip
|
||||
let event
|
||||
if (_DialogObject && _DialogObject.close) {
|
||||
_DialogObject.close()
|
||||
_DialogObject = null
|
||||
}
|
||||
_DialogObject = await new Dialog(sdk.viewer._container, {
|
||||
title: '投影转换', left: '180px', top: '100px',
|
||||
closeCallBack: () => {
|
||||
closeCallBack && closeCallBack()
|
||||
},
|
||||
})
|
||||
await _DialogObject.init()
|
||||
// if (_DialogObject && _DialogObject.close) {
|
||||
// _DialogObject.close()
|
||||
// _DialogObject = null
|
||||
// }
|
||||
// _DialogObject = await new Dialog(sdk.viewer._container, {
|
||||
// title: '投影转换', left: '180px', top: '100px',
|
||||
// closeCallBack: () => {
|
||||
// closeCallBack && closeCallBack()
|
||||
// },
|
||||
// })
|
||||
// await _DialogObject.init()
|
||||
|
||||
let html = `
|
||||
<span class="custom-divider"></span>
|
||||
<div style="width: 540px;display: flex;">
|
||||
<div class="row left" style="flex: 1;margin-bottom: 0;">
|
||||
<div style="margin: 10px 0;flex: 1;display: flex;align-items: center;flex: 1;justify-content: space-between;">
|
||||
<span class="lable-left-line">源坐标</span>
|
||||
<button class="btn pick" style="margin-left: 20px;"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>坐标拾取</button>
|
||||
</div>
|
||||
<div>
|
||||
<div style="display: flex;margin-bottom: 12px;align-items: center;">
|
||||
<span class="label" style="flex: 0 0 60px;">椭圆基准</span>
|
||||
<div class="datalist_left"></div>
|
||||
</div>
|
||||
<div style="display: flex;margin-bottom: 12px;align-items: center;">
|
||||
<span class="label" style="flex: 0 0 60px;">经度(x)</span>
|
||||
<input class="input left-x" type="number" title="">
|
||||
</div>
|
||||
<div style="display: flex;margin-bottom: 10px;align-items: center;">
|
||||
<span class="label" style="flex: 0 0 60px;">纬度(y)</span>
|
||||
<input class="input left-y" type="number" title="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;flex-direction: column;justify-content: center;margin: 28px 15px 0 15px;">
|
||||
<button class="btn convert">坐标转换<i style="margin-top: 2px;margin-left: 5px;" class="el-icon-right"></i></button>
|
||||
</div>
|
||||
<div class="row right" style="flex: 1;margin-bottom: 0;">
|
||||
<div style="margin: 10px 0;height: 32px; display: flex;align-items: center;flex: 1;justify-content: space-between;">
|
||||
<span class="lable-left-line">目标坐标</span>
|
||||
<button class="btn copy" data-clipboard-action="copy" data-clipboard-target=".input" style="margin-left: 20px;"><svg class="icon-copy"><use xlink:href="#yj-icon-copy"></use></svg>复制</button>
|
||||
</div>
|
||||
<div>
|
||||
<div style="display: flex;margin-bottom: 12px;align-items: center;">
|
||||
<span class="label" style="flex: 0 0 60px;">椭圆基准</span>
|
||||
<div class="datalist_right"></div>
|
||||
</div>
|
||||
<div style="display: flex;margin-bottom: 12px;align-items: center;">
|
||||
<span class="label" style="flex: 0 0 60px;">经度(x)</span>
|
||||
<input class="input right-x" readonly="readonly">
|
||||
</div>
|
||||
<div style="display: flex;margin-bottom: 10px;align-items: center;">
|
||||
<span class="label" style="flex: 0 0 60px;">纬度(y)</span>
|
||||
<input class="input right-y" readonly="readonly">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="custom-divider"></span>
|
||||
`
|
||||
let contentElm = document.createElement('div');
|
||||
contentElm.innerHTML = html
|
||||
_DialogObject.contentAppChild(contentElm)
|
||||
// let html = `
|
||||
// <span class="custom-divider"></span>
|
||||
// <div style="width: 540px;display: flex;">
|
||||
// <div class="row left" style="flex: 1;margin-bottom: 0;">
|
||||
// <div style="margin: 10px 0;flex: 1;display: flex;align-items: center;flex: 1;justify-content: space-between;">
|
||||
// <span class="lable-left-line">源坐标</span>
|
||||
// <button class="btn pick" style="margin-left: 20px;"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>坐标拾取</button>
|
||||
// </div>
|
||||
// <div>
|
||||
// <div style="display: flex;margin-bottom: 12px;align-items: center;">
|
||||
// <span class="label" style="flex: 0 0 60px;">椭圆基准</span>
|
||||
// <div class="datalist_left"></div>
|
||||
// </div>
|
||||
// <div style="display: flex;margin-bottom: 12px;align-items: center;">
|
||||
// <span class="label" style="flex: 0 0 60px;">经度(x)</span>
|
||||
// <input class="input left-x" type="number" title="">
|
||||
// </div>
|
||||
// <div style="display: flex;margin-bottom: 10px;align-items: center;">
|
||||
// <span class="label" style="flex: 0 0 60px;">纬度(y)</span>
|
||||
// <input class="input left-y" type="number" title="">
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div style="display: flex;flex-direction: column;justify-content: center;margin: 28px 15px 0 15px;">
|
||||
// <button class="btn convert">坐标转换<i style="margin-top: 2px;margin-left: 5px;" class="el-icon-right"></i></button>
|
||||
// </div>
|
||||
// <div class="row right" style="flex: 1;margin-bottom: 0;">
|
||||
// <div style="margin: 10px 0;height: 32px; display: flex;align-items: center;flex: 1;justify-content: space-between;">
|
||||
// <span class="lable-left-line">目标坐标</span>
|
||||
// <button class="btn copy" data-clipboard-action="copy" data-clipboard-target=".input" style="margin-left: 20px;"><svg class="icon-copy"><use xlink:href="#yj-icon-copy"></use></svg>复制</button>
|
||||
// </div>
|
||||
// <div>
|
||||
// <div style="display: flex;margin-bottom: 12px;align-items: center;">
|
||||
// <span class="label" style="flex: 0 0 60px;">椭圆基准</span>
|
||||
// <div class="datalist_right"></div>
|
||||
// </div>
|
||||
// <div style="display: flex;margin-bottom: 12px;align-items: center;">
|
||||
// <span class="label" style="flex: 0 0 60px;">经度(x)</span>
|
||||
// <input class="input right-x" readonly="readonly">
|
||||
// </div>
|
||||
// <div style="display: flex;margin-bottom: 10px;align-items: center;">
|
||||
// <span class="label" style="flex: 0 0 60px;">纬度(y)</span>
|
||||
// <input class="input right-y" readonly="readonly">
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// <span class="custom-divider"></span>
|
||||
// `
|
||||
// let contentElm = document.createElement('div');
|
||||
// contentElm.innerHTML = html
|
||||
// _DialogObject.contentAppChild(contentElm)
|
||||
|
||||
// legp(contentElm, ".datalist").legp_search(tagData)
|
||||
let contentElm = document.getElementsByClassName('projection-convert')[0].getElementsByClassName('content')[0]
|
||||
|
||||
let tagData = []
|
||||
let i = 0
|
||||
@ -95,6 +96,7 @@ const open = async (sdk, closeCallBack) => {
|
||||
|
||||
let pickElm = contentElm.getElementsByClassName('pick')[0]
|
||||
let copyElm = contentElm.getElementsByClassName('copy')[0]
|
||||
let sourceCopyElm = contentElm.getElementsByClassName('sourceCopy')[0]
|
||||
let datalistLeftInput = contentElm.getElementsByClassName('datalist_left')[0].getElementsByTagName('input')[0]
|
||||
datalistLeftInput.value = tagData[0].value
|
||||
legpObjectLeft.legp_searchActive(tagData[0].value)
|
||||
@ -137,11 +139,7 @@ const open = async (sdk, closeCallBack) => {
|
||||
if (!leftXElm.value || !leftYElm.value) {
|
||||
rightXElm.value = ''
|
||||
rightYElm.value = ''
|
||||
window.ELEMENT && window.ELEMENT.Message({
|
||||
message: '请输入源坐标',
|
||||
type: 'warning',
|
||||
duration: 1500
|
||||
});
|
||||
topls.message({ type: 'warning', text: '请输入源坐标' })
|
||||
return
|
||||
}
|
||||
let result = proj.convert([{ x: Number(leftXElm.value), y: Number(leftYElm.value) }], datalistLeftInput.value, datalistRightInput.value)
|
||||
@ -150,11 +148,7 @@ const open = async (sdk, closeCallBack) => {
|
||||
rightYElm.value = result.points[0].y
|
||||
}
|
||||
else {
|
||||
window.ELEMENT && window.ELEMENT.Message({
|
||||
message: result.message,
|
||||
type: 'warning',
|
||||
duration: 1500
|
||||
});
|
||||
topls.message({ type: 'warning', text: result.message })
|
||||
}
|
||||
})
|
||||
|
||||
@ -164,11 +158,7 @@ const open = async (sdk, closeCallBack) => {
|
||||
if (!rightXElm.value || !rightYElm.value) {
|
||||
rightXElm.value = ''
|
||||
rightYElm.value = ''
|
||||
window.ELEMENT && window.ELEMENT.Message({
|
||||
message: '复制失败,目标坐标为空!',
|
||||
type: 'warning',
|
||||
duration: 1500
|
||||
});
|
||||
topls.message({ type: 'warning', text: '复制失败,目标坐标为空!' })
|
||||
}
|
||||
else {
|
||||
let text = `${rightXElm.value},${rightYElm.value}`
|
||||
@ -177,13 +167,26 @@ const open = async (sdk, closeCallBack) => {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
clipboard.on('success', function (e) {
|
||||
window.ELEMENT &&
|
||||
window.ELEMENT.Message({
|
||||
message: '已复制到剪切板',
|
||||
type: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
topls.message({ text: '已复制到剪切板' })
|
||||
});
|
||||
|
||||
let sourcelipboard = new ClipboardJS(sourceCopyElm, {
|
||||
text: (trigger) => {
|
||||
if (!leftXElm.value || !leftYElm.value) {
|
||||
leftXElm.value = ''
|
||||
leftYElm.value = ''
|
||||
topls.message({ type: 'warning', text: '复制失败,目标坐标为空!' })
|
||||
}
|
||||
else {
|
||||
let text = `${leftXElm.value},${leftYElm.value}`
|
||||
return text;
|
||||
}
|
||||
}
|
||||
});
|
||||
sourcelipboard.on('success', function (e) {
|
||||
topls.message({ text: '已复制到剪切板' })
|
||||
});
|
||||
}
|
||||
|
||||
@ -192,6 +195,8 @@ const close = () => {
|
||||
_DialogObject.close()
|
||||
_DialogObject = null
|
||||
}
|
||||
tip && tip.destroy()
|
||||
event && event.destroy()
|
||||
}
|
||||
|
||||
export { open, close }
|
||||
export { open, close }
|
||||
|
||||
Reference in New Issue
Block a user