init
This commit is contained in:
512
src/Obj/Base/Vector/color.json
Normal file
512
src/Obj/Base/Vector/color.json
Normal file
@ -0,0 +1,512 @@
|
||||
{
|
||||
"地震灾害": {
|
||||
"1": {
|
||||
"c": 30,
|
||||
"m": 85,
|
||||
"y": 65,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 0,
|
||||
"m": 95,
|
||||
"y": 40,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 5,
|
||||
"m": 55,
|
||||
"y": 40,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 2,
|
||||
"m": 20,
|
||||
"y": 20,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"洪水灾害": {
|
||||
"1": {
|
||||
"c": 100,
|
||||
"m": 70,
|
||||
"y": 40,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 70,
|
||||
"m": 50,
|
||||
"y": 10,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 55,
|
||||
"m": 30,
|
||||
"y": 10,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 20,
|
||||
"m": 10,
|
||||
"y": 5,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"干旱灾害": {
|
||||
"1": {
|
||||
"c": 10,
|
||||
"m": 15,
|
||||
"y": 100,
|
||||
"k": 10
|
||||
},
|
||||
"2": {
|
||||
"c": 0,
|
||||
"m": 5,
|
||||
"y": 55,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 0,
|
||||
"m": 2,
|
||||
"y": 25,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 0,
|
||||
"m": 0,
|
||||
"y": 10,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"雪灾灾害": {
|
||||
"1": {
|
||||
"c": 100,
|
||||
"m": 65,
|
||||
"y": 40,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 100,
|
||||
"m": 40,
|
||||
"y": 15,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 65,
|
||||
"m": 25,
|
||||
"y": 10,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 18,
|
||||
"m": 8,
|
||||
"y": 8,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"雷电、冰雹灾害": {
|
||||
"1": {
|
||||
"c": 40,
|
||||
"m": 45,
|
||||
"y": 40,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 30,
|
||||
"m": 30,
|
||||
"y": 25,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 0,
|
||||
"m": 0,
|
||||
"y": 0,
|
||||
"k": 16
|
||||
},
|
||||
"4": {
|
||||
"c": 0,
|
||||
"m": 0,
|
||||
"y": 0,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"高温灾害": {
|
||||
"1": {
|
||||
"c": 20,
|
||||
"m": 90,
|
||||
"y": 65,
|
||||
"k": 20
|
||||
},
|
||||
"2": {
|
||||
"c": 20,
|
||||
"m": 85,
|
||||
"y": 100,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 0,
|
||||
"m": 55,
|
||||
"y": 80,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 0,
|
||||
"m": 30,
|
||||
"y": 85,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"低温灾害": {
|
||||
"1": {
|
||||
"c": 70,
|
||||
"m": 70,
|
||||
"y": 50,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 60,
|
||||
"m": 50,
|
||||
"y": 30,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 40,
|
||||
"m": 35,
|
||||
"y": 20,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 10,
|
||||
"m": 10,
|
||||
"y": 5,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"台风灾害": {
|
||||
"1": {
|
||||
"c": 95,
|
||||
"m": 75,
|
||||
"y": 75,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 75,
|
||||
"m": 60,
|
||||
"y": 65,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 40,
|
||||
"m": 25,
|
||||
"y": 30,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 25,
|
||||
"m": 10,
|
||||
"y": 15,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"大风、沙尘暴灾害": {
|
||||
"1": {
|
||||
"c": 0,
|
||||
"m": 40,
|
||||
"y": 100,
|
||||
"k": 45
|
||||
},
|
||||
"2": {
|
||||
"c": 0,
|
||||
"m": 0,
|
||||
"y": 100,
|
||||
"k": 25
|
||||
},
|
||||
"3": {
|
||||
"c": 0,
|
||||
"m": 0,
|
||||
"y": 60,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 0,
|
||||
"m": 0,
|
||||
"y": 25,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"暴雨灾害": {
|
||||
"1": {
|
||||
"c": 100,
|
||||
"m": 70,
|
||||
"y": 40,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 70,
|
||||
"m": 50,
|
||||
"y": 10,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 55,
|
||||
"m": 30,
|
||||
"y": 10,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 20,
|
||||
"m": 10,
|
||||
"y": 5,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"自然灾害GDP综合风险图色彩样式": {
|
||||
"1": {
|
||||
"c": 15,
|
||||
"m": 100,
|
||||
"y": 85,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 7,
|
||||
"m": 50,
|
||||
"y": 60,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 0,
|
||||
"m": 5,
|
||||
"y": 55,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 0,
|
||||
"m": 2,
|
||||
"y": 25,
|
||||
"k": 0
|
||||
},
|
||||
"5": {
|
||||
"c": 0,
|
||||
"m": 0,
|
||||
"y": 10,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"自然灾害死亡人口综合风险图色彩样式": {
|
||||
"1": {
|
||||
"c": 0,
|
||||
"m": 100,
|
||||
"y": 100,
|
||||
"k": 25
|
||||
},
|
||||
"2": {
|
||||
"c": 15,
|
||||
"m": 100,
|
||||
"y": 85,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 5,
|
||||
"m": 50,
|
||||
"y": 60,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 5,
|
||||
"m": 35,
|
||||
"y": 40,
|
||||
"k": 0
|
||||
},
|
||||
"5": {
|
||||
"c": 0,
|
||||
"m": 15,
|
||||
"y": 15,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"自然灾害受灾人口综合风险图色彩样式": {
|
||||
"1": {
|
||||
"c": 25,
|
||||
"m": 58,
|
||||
"y": 95,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 8,
|
||||
"m": 45,
|
||||
"y": 95,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 5,
|
||||
"m": 30,
|
||||
"y": 60,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 2,
|
||||
"m": 20,
|
||||
"y": 40,
|
||||
"k": 0
|
||||
},
|
||||
"5": {
|
||||
"c": 0,
|
||||
"m": 10,
|
||||
"y": 20,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"自然灾害农作物综合风险图色彩样式": {
|
||||
"1": {
|
||||
"c": 0,
|
||||
"m": 40,
|
||||
"y": 100,
|
||||
"k": 45
|
||||
},
|
||||
"2": {
|
||||
"c": 0,
|
||||
"m": 0,
|
||||
"y": 100,
|
||||
"k": 45
|
||||
},
|
||||
"3": {
|
||||
"c": 0,
|
||||
"m": 0,
|
||||
"y": 100,
|
||||
"k": 25
|
||||
},
|
||||
"4": {
|
||||
"c": 0,
|
||||
"m": 0,
|
||||
"y": 60,
|
||||
"k": 0
|
||||
},
|
||||
"5": {
|
||||
"c": 10,
|
||||
"m": 5,
|
||||
"y": 15,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"自然灾害房屋综合风险图色彩样式": {
|
||||
"1": {
|
||||
"c": 60,
|
||||
"m": 90,
|
||||
"y": 70,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 50,
|
||||
"m": 90,
|
||||
"y": 60,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 40,
|
||||
"m": 80,
|
||||
"y": 40,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 25,
|
||||
"m": 45,
|
||||
"y": 25,
|
||||
"k": 0
|
||||
},
|
||||
"5": {
|
||||
"c": 15,
|
||||
"m": 25,
|
||||
"y": 15,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"自然灾害道路综合风险图色彩样式": {
|
||||
"1": {
|
||||
"c": 55,
|
||||
"m": 65,
|
||||
"y": 75,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 45,
|
||||
"m": 50,
|
||||
"y": 60,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 20,
|
||||
"m": 30,
|
||||
"y": 40,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 7,
|
||||
"m": 15,
|
||||
"y": 35,
|
||||
"k": 0
|
||||
},
|
||||
"5": {
|
||||
"c": 0,
|
||||
"m": 10,
|
||||
"y": 25,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"自然灾害减灾能力图色彩样式": {
|
||||
"1": {
|
||||
"c": 90,
|
||||
"m": 50,
|
||||
"y": 95,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 70,
|
||||
"m": 40,
|
||||
"y": 80,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 50,
|
||||
"m": 30,
|
||||
"y": 65,
|
||||
"k": 0
|
||||
},
|
||||
"4": {
|
||||
"c": 35,
|
||||
"m": 20,
|
||||
"y": 50,
|
||||
"k": 0
|
||||
},
|
||||
"5": {
|
||||
"c": 10,
|
||||
"m": 5,
|
||||
"y": 35,
|
||||
"k": 0
|
||||
}
|
||||
},
|
||||
"自然灾害综合防治区划图色彩样式": {
|
||||
"1": {
|
||||
"c": 0,
|
||||
"m": 90,
|
||||
"y": 80,
|
||||
"k": 0
|
||||
},
|
||||
"2": {
|
||||
"c": 0,
|
||||
"m": 50,
|
||||
"y": 80,
|
||||
"k": 0
|
||||
},
|
||||
"3": {
|
||||
"c": 60,
|
||||
"m": 0,
|
||||
"y": 50,
|
||||
"k": 25
|
||||
},
|
||||
"4": {
|
||||
"c": 60,
|
||||
"m": 0,
|
||||
"y": 100,
|
||||
"k": 0
|
||||
}
|
||||
}
|
||||
}
|
1708
src/Obj/Base/Vector/index.js
Normal file
1708
src/Obj/Base/Vector/index.js
Normal file
File diff suppressed because it is too large
Load Diff
172
src/Obj/Base/Vector/openAllNodeList.js
Normal file
172
src/Obj/Base/Vector/openAllNodeList.js
Normal file
@ -0,0 +1,172 @@
|
||||
import Dialog from "../../../BaseDialog/index";
|
||||
import { generatePagination } from "../../Element/Pagination";
|
||||
|
||||
let _DialogObject
|
||||
|
||||
const openAllNodeList = async (that) => {
|
||||
let total = 0
|
||||
let page = 1
|
||||
let pageSize = 20
|
||||
let currentData = []
|
||||
|
||||
if (_DialogObject && !_DialogObject.isDestroy) {
|
||||
_DialogObject.close()
|
||||
_DialogObject = null
|
||||
}
|
||||
|
||||
const createTableContent = () => {
|
||||
let trsElm = ''
|
||||
for (let i = 0; i < currentData.length; i++) {
|
||||
let trElm = '<tr class="el-table__row">'
|
||||
let tdElm = ''
|
||||
if ('fid' in currentData[i].properties) {
|
||||
tdElm = `<td rowspan="1" colspan="1" class="el-table_1_column_${i} el-table__cell"><div class="cell">${currentData[i].properties.fid}</div></td>`
|
||||
}
|
||||
for (let key in currentData[i].properties) {
|
||||
if (key !== 'id' && key !== 'ID' && key !== 'fid') {
|
||||
tdElm = tdElm + `<td rowspan="1" colspan="1" class="el-table_1_column_${i} el-table__cell"><div class="cell">${currentData[i].properties[key]}</div></td>`
|
||||
}
|
||||
}
|
||||
trElm = trElm + tdElm + '</tr>'
|
||||
trsElm = trsElm + trElm
|
||||
}
|
||||
return trsElm
|
||||
}
|
||||
|
||||
_DialogObject = await new Dialog(that.viewer._container, {
|
||||
title: '', left: '17%', top: '100px'
|
||||
})
|
||||
await _DialogObject.init()
|
||||
let dataArrayFilter = [...that.geojson.features]
|
||||
total = dataArrayFilter.length
|
||||
currentData = dataArrayFilter.slice(pageSize * (page - 1), pageSize * page)
|
||||
|
||||
let trsElm = createTableContent()
|
||||
|
||||
let box = document.createElement('div')
|
||||
box.style.height = '100%'
|
||||
let searchElm = '<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>'
|
||||
let talbeElm = '<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: calc(100% - 100px);">'
|
||||
let headerElm = '<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 1213px;">'
|
||||
let hcolgroupElm = '<colgroup>'
|
||||
let theadElm = '<thead class="has-gutter"><tr>'
|
||||
let bodyElm = '<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 1186px;">'
|
||||
let bcolgroupElm = '<colgroup>'
|
||||
|
||||
let i = 1
|
||||
// thead
|
||||
if ('fid' in that.geojson.features[0].properties) {
|
||||
hcolgroupElm = hcolgroupElm + `<col name="el-table_1_column_${i}" width="150">`
|
||||
bcolgroupElm = bcolgroupElm + `<col name="el-table_1_column_${i}" width="150">`
|
||||
theadElm = theadElm + `<th colspan="1" rowspan="1" class="el-table_1_column_${i} is-leaf el-table__cell"><div class="cell">fid</div></th>`
|
||||
i++
|
||||
}
|
||||
for (let key in that.geojson.features[0].properties) {
|
||||
if (key !== 'id' && key !== 'ID' && key !== 'fid') {
|
||||
hcolgroupElm = hcolgroupElm + `<col name="el-table_1_column_${i}" width="150">`
|
||||
bcolgroupElm = bcolgroupElm + `<col name="el-table_1_column_${i}" width="150">`
|
||||
theadElm = theadElm + `<th colspan="1" rowspan="1" class="el-table_1_column_${i} is-leaf el-table__cell"><div class="cell">${key}</div></th>`
|
||||
i++
|
||||
}
|
||||
}
|
||||
//tbody
|
||||
let tbodyElm = '<tbody>'
|
||||
tbodyElm = tbodyElm + trsElm + '</tbody>'
|
||||
//empty
|
||||
let emptyElm = '<div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div>'
|
||||
|
||||
hcolgroupElm = hcolgroupElm + '<col name="gutter" width="17"></colgroup>'
|
||||
bcolgroupElm = bcolgroupElm + '</colgroup>'
|
||||
theadElm = theadElm + '</tr></thead>'
|
||||
headerElm = headerElm + hcolgroupElm + theadElm + '</table></div>'
|
||||
bodyElm = bodyElm + bcolgroupElm + tbodyElm + '</table>' + emptyElm + '</div>'
|
||||
talbeElm = talbeElm + headerElm + bodyElm + '</div>'
|
||||
|
||||
|
||||
box.innerHTML = searchElm + talbeElm + '<div class="pagination"></div>'
|
||||
let emptyNode = box.getElementsByClassName('el-table__empty-block')[0]
|
||||
if (currentData.length == 0) {
|
||||
emptyNode.style.display = 'flex'
|
||||
}
|
||||
else {
|
||||
emptyNode.style.display = 'none'
|
||||
}
|
||||
// this.viewer._container.appendChild(box)
|
||||
_DialogObject.contentAppChild(box)
|
||||
let headerWrapper = box.getElementsByClassName('el-table__header-wrapper')[0]
|
||||
let bodyWrapper = box.getElementsByClassName('el-table__body-wrapper')[0]
|
||||
bodyWrapper.addEventListener('scroll', function (e) {
|
||||
headerWrapper.scrollLeft = e.target.scrollLeft
|
||||
});
|
||||
_DialogObject._element.title.style.height = '40px'
|
||||
_DialogObject._element.body.style.width = '65%'
|
||||
_DialogObject._element.body.style.height = '80%'
|
||||
_DialogObject._element.content.style.height = 'calc(100% - 40px)'
|
||||
_DialogObject._element.content.style.overflow = 'hidden'
|
||||
_DialogObject._element.foot.style.display = 'none'
|
||||
|
||||
bodyWrapper.style.height = `calc(100% - ${headerWrapper.offsetHeight}px)`
|
||||
let paginationElm = box.getElementsByClassName('pagination')[0]
|
||||
generatePagination(paginationElm, total, pageSize, page, (pageIndex) => {
|
||||
page = pageIndex
|
||||
currentData = dataArrayFilter.slice(pageSize * (page - 1), pageSize * page)
|
||||
let trsElm = createTableContent()
|
||||
box.getElementsByTagName('tbody')[0].innerHTML = trsElm
|
||||
if (currentData.length == 0) {
|
||||
emptyNode.style.display = 'flex'
|
||||
}
|
||||
else {
|
||||
emptyNode.style.display = 'none'
|
||||
}
|
||||
});
|
||||
const search = () => {
|
||||
let input = box.getElementsByClassName('search-box')[0].getElementsByTagName('input')[0]
|
||||
let array = []
|
||||
for (let i = 0; i < that.geojson.features.length; i++) {
|
||||
for (let key in that.geojson.features[i].properties) {
|
||||
let str = that.geojson.features[i].properties[key] + ''
|
||||
if (str.indexOf(input.value) != -1) {
|
||||
array.push(that.geojson.features[i])
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
dataArrayFilter = array
|
||||
total = dataArrayFilter.length
|
||||
currentData = dataArrayFilter.slice(pageSize * (page - 1), pageSize * page)
|
||||
if (currentData.length == 0) {
|
||||
emptyNode.style.display = 'flex'
|
||||
}
|
||||
else {
|
||||
emptyNode.style.display = 'none'
|
||||
}
|
||||
let trsElm = createTableContent()
|
||||
box.getElementsByTagName('tbody')[0].innerHTML = trsElm
|
||||
generatePagination(paginationElm, total, pageSize, page, (pageIndex) => {
|
||||
page = pageIndex
|
||||
currentData = dataArrayFilter.slice(pageSize * (page - 1), pageSize * page)
|
||||
let trsElm = createTableContent()
|
||||
box.getElementsByTagName('tbody')[0].innerHTML = trsElm
|
||||
if (currentData.length == 0) {
|
||||
emptyNode.style.display = 'flex'
|
||||
}
|
||||
else {
|
||||
emptyNode.style.display = 'none'
|
||||
}
|
||||
});
|
||||
}
|
||||
box.getElementsByClassName('search')[0].addEventListener('click', () => {
|
||||
pageSize = 20
|
||||
page = 1
|
||||
search()
|
||||
})
|
||||
box.getElementsByClassName('export')[0].addEventListener('click', () => {
|
||||
let data = []
|
||||
for (let i = 0; i < that.geojson.features.length; i++) {
|
||||
data.push({ ...that.geojson.features[i].properties, 'positions': JSON.stringify(that.geojson.features[i].geometry.coordinates) })
|
||||
}
|
||||
that.exportExcel(data)
|
||||
})
|
||||
}
|
||||
|
||||
export { openAllNodeList }
|
140
src/Obj/Base/Vector/openNodeListById.js
Normal file
140
src/Obj/Base/Vector/openNodeListById.js
Normal file
@ -0,0 +1,140 @@
|
||||
import Dialog from "../../../BaseDialog/index";
|
||||
import cy_tabs from "../../Element/cy_html_tabs";
|
||||
|
||||
let _DialogObject
|
||||
|
||||
const openNodeListById = async (that, id) => {
|
||||
if (_DialogObject && !_DialogObject.isDestroy) {
|
||||
_DialogObject.close()
|
||||
_DialogObject = null
|
||||
}
|
||||
let currentData = []
|
||||
const createTableContent = () => {
|
||||
let trsElm = ''
|
||||
for (let i = 0; i < currentData.length; i++) {
|
||||
let trElm = '<tr class="el-table__row">'
|
||||
let tdElm = ''
|
||||
if ('fid' in currentData[i].properties) {
|
||||
tdElm = `<td rowspan="1" colspan="1" class="el-table_1_column_${i} el-table__cell"><div class="cell">${currentData[i].properties.fid}</div></td>`
|
||||
}
|
||||
for (let key in currentData[i].properties) {
|
||||
if (key !== 'id' && key !== 'ID' && key !== 'fid') {
|
||||
tdElm = tdElm + `<td rowspan="1" colspan="1" class="el-table_1_column_${i} el-table__cell"><div class="cell">${currentData[i].properties[key]}</div></td>`
|
||||
}
|
||||
}
|
||||
trElm = trElm + tdElm + '</tr>'
|
||||
trsElm = trsElm + trElm
|
||||
}
|
||||
return trsElm
|
||||
}
|
||||
let flag = false
|
||||
for (let i = 0; i < that.geojson.features.length; i++) {
|
||||
if (that.geojson.features[i].properties.id && that.geojson.features[i].properties.id == id) {
|
||||
currentData = [that.geojson.features[i]]
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
window.ELEMENT && window.ELEMENT.Message({
|
||||
message: '数据不存在!',
|
||||
type: 'warning',
|
||||
duration: 1500
|
||||
});
|
||||
return
|
||||
}
|
||||
_DialogObject = await new Dialog(that.viewer._container, {
|
||||
title: id, left: '17%', top: '100px'
|
||||
})
|
||||
await _DialogObject.init()
|
||||
let trsElm = createTableContent(that)
|
||||
|
||||
let box = document.createElement('div')
|
||||
box.style.height = '100%'
|
||||
let talbeElm = '<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: 100%;">'
|
||||
let headerElm = '<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 930px;">'
|
||||
let hcolgroupElm = '<colgroup>'
|
||||
let theadElm = '<thead class="has-gutter"><tr>'
|
||||
let bodyElm = '<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 913px;">'
|
||||
let bcolgroupElm = '<colgroup>'
|
||||
|
||||
let i = 1
|
||||
// thead
|
||||
if ('fid' in that.geojson.features[0].properties) {
|
||||
hcolgroupElm = hcolgroupElm + `<col name="el-table_1_column_${i}" width="150">`
|
||||
bcolgroupElm = bcolgroupElm + `<col name="el-table_1_column_${i}" width="150">`
|
||||
theadElm = theadElm + `<th colspan="1" rowspan="1" class="el-table_1_column_${i} is-leaf el-table__cell"><div class="cell">fid</div></th>`
|
||||
i++
|
||||
}
|
||||
for (let key in that.geojson.features[0].properties) {
|
||||
if (key !== 'id' && key !== 'ID' && key !== 'fid') {
|
||||
hcolgroupElm = hcolgroupElm + `<col name="el-table_1_column_${i}" width="150">`
|
||||
bcolgroupElm = bcolgroupElm + `<col name="el-table_1_column_${i}" width="150">`
|
||||
theadElm = theadElm + `<th colspan="1" rowspan="1" class="el-table_1_column_${i} is-leaf el-table__cell"><div class="cell">${key}</div></th>`
|
||||
i++
|
||||
}
|
||||
}
|
||||
//tbody
|
||||
let tbodyElm = '<tbody>'
|
||||
tbodyElm = tbodyElm + trsElm + '</tbody>'
|
||||
hcolgroupElm = hcolgroupElm + '<col name="gutter" width="17"></colgroup>'
|
||||
bcolgroupElm = bcolgroupElm + '</colgroup>'
|
||||
theadElm = theadElm + '</tr></thead>'
|
||||
headerElm = headerElm + hcolgroupElm + theadElm + '</table></div>'
|
||||
bodyElm = bodyElm + bcolgroupElm + tbodyElm + '</table></div>'
|
||||
talbeElm = talbeElm + headerElm + bodyElm + '</div>'
|
||||
|
||||
let tabsElm = `
|
||||
<DIV-cy-tabs id="shp-list-id-tabs">
|
||||
<DIV-cy-tab-pane label="属性列表">
|
||||
${talbeElm + '<div class="pagination"></div>'}
|
||||
</DIV-cy-tab-pane>
|
||||
`
|
||||
if (currentData[0].content && currentData[0].content.richTextContent) {
|
||||
let tabPaneElm = `
|
||||
<DIV-cy-tab-pane class="editor-content-view" label="富文本信息">
|
||||
${currentData[0].content.richTextContent}
|
||||
</DIV-cy-tab-pane>
|
||||
`
|
||||
tabsElm = tabsElm + tabPaneElm
|
||||
}
|
||||
if (currentData[0].content && currentData[0].content.link && currentData[0].content.link.content && currentData[0].content.link.content.length > 0) {
|
||||
for (let i = 0; i < currentData[0].content.link.content.length; i++) {
|
||||
let url = currentData[0].content.link.content[i].url
|
||||
let tabPaneElm = `
|
||||
<DIV-cy-tab-pane class="editor-content-view" label="${currentData[0].content.link.content[i].name}">
|
||||
<iframe src="${url}"></iframe>
|
||||
</DIV-cy-tab-pane>
|
||||
`
|
||||
tabsElm = tabsElm + tabPaneElm
|
||||
}
|
||||
}
|
||||
tabsElm = tabsElm + '</DIV-cy-tabs>'
|
||||
box.innerHTML = tabsElm
|
||||
// that.viewer._container.appendChild(box)
|
||||
_DialogObject.contentAppChild(box)
|
||||
new cy_tabs('shp-list-id-tabs')
|
||||
let tabsNode = box.getElementsByClassName('DIV-cy-tabs')[0]
|
||||
tabsNode.style.height = '100%'
|
||||
tabsNode.style.display = 'flex'
|
||||
tabsNode.style.flexDirection = 'column';
|
||||
tabsNode.getElementsByClassName('DIV-cy-tab-content')[0].style.flex = '1'
|
||||
let tabContentPane = tabsNode.getElementsByClassName('DIV-cy-tab-content-pane')
|
||||
for (let i = 0; i < tabContentPane.length; i++) {
|
||||
tabContentPane[i].style.height = '100%'
|
||||
}
|
||||
let headerWrapper = box.getElementsByClassName('el-table__header-wrapper')[0]
|
||||
let bodyWrapper = box.getElementsByClassName('el-table__body-wrapper')[0]
|
||||
bodyWrapper.addEventListener('scroll', function (e) {
|
||||
headerWrapper.scrollLeft = e.target.scrollLeft
|
||||
});
|
||||
_DialogObject._element.title.style.height = '40px'
|
||||
_DialogObject._element.body.style.width = '65%'
|
||||
_DialogObject._element.body.style.height = '80%'
|
||||
_DialogObject._element.content.style.height = 'calc(100% - 40px)'
|
||||
_DialogObject._element.foot.style.display = 'none'
|
||||
|
||||
bodyWrapper.style.height = `calc(100% - ${headerWrapper.offsetHeight}px)`
|
||||
}
|
||||
|
||||
export { openNodeListById }
|
Reference in New Issue
Block a user