|
@@ -1,34 +1,34 @@
|
|
|
<template>
|
|
|
<div id="configManage">
|
|
|
<div class="functionBtn">
|
|
|
- <el-select v-show="proxyType!='INTEGRATION'" v-model="dataType" placeholder="请选择类型" style="margin-right: 12px" default-first-option>
|
|
|
- <el-option v-for="(item, index) in selectOptions" :key="index" :label="item.label" :value="item.value" ></el-option>
|
|
|
+ <el-select v-show="proxyType != 'INTEGRATION'" v-model="dataType" placeholder="请选择类型" style="margin-right: 12px"
|
|
|
+ default-first-option>
|
|
|
+ <el-option v-for="(item, index) in selectOptions" :key="index" :label="item.label"
|
|
|
+ :value="item.value"></el-option>
|
|
|
</el-select>
|
|
|
- <el-button type="primary" round @click="handleDetailVisible('Add')">新增配置</el-button>
|
|
|
- <el-button v-show="proxyType!='INTEGRATION'" round @click="viewAllModel">全部预览</el-button>
|
|
|
+ <el-button type="primary" round @click="handleDetailVisible('Add')">新增配置</el-button>
|
|
|
+ <el-button v-show="proxyType != 'INTEGRATION'" round @click="viewAllModel">全部预览</el-button>
|
|
|
<el-tooltip content="刷新" placement="right">
|
|
|
<el-button circle @click="refresh"><el-icon><IconPark-refresh /></el-icon></el-button>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
<div class="tableContent">
|
|
|
- <el-table ref="table"
|
|
|
- :data="tableData"
|
|
|
- :max-height="maxHeight"
|
|
|
- v-loading="loading"
|
|
|
- @current-change="(row)=>{this.currRow=row}"
|
|
|
- border
|
|
|
- stripe
|
|
|
- >
|
|
|
- <el-table-column prop="id" label="ID" width="60" align="center"/>
|
|
|
+ <el-table ref="table" :data="tableData" :max-height="maxHeight" v-loading="loading"
|
|
|
+ @current-change="(row) => { this.currRow = row }" border stripe>
|
|
|
+ <el-table-column prop="id" label="ID" width="60" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.row.id + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="key" label="标题" min-width="100">
|
|
|
<template #default="scope">
|
|
|
- <span style="font-weight: bold;font-family: JetBrainsMono-Regular,serif" >{{scope.row.key}}</span>
|
|
|
+ <span style="font-weight: bold;font-family: JetBrainsMono-Regular,serif">{{ scope.row.key }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="content" label="描述" min-width="120" />
|
|
|
- <el-table-column prop="proxyUrl" label="链接" min-width="180">
|
|
|
+ <el-table-column prop="content" label="描述" min-width="100" />
|
|
|
+ <el-table-column prop="proxyUrl" label="链接" min-width="350">
|
|
|
<template #default="scope">
|
|
|
- <span style="font-family: JetBrainsMono-Regular,serif" >{{ scope.row.proxyUrl}}</span>
|
|
|
+ <span style="font-family: JetBrainsMono-Regular,serif">{{ scope.row.proxyUrl }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="operation" label="操作" min-width="120">
|
|
@@ -41,7 +41,7 @@
|
|
|
<el-icon><IconPark-delete /></el-icon>
|
|
|
删除
|
|
|
</el-button>
|
|
|
- <el-button v-show="proxyType!='INTEGRATION'" size="small" @click="view(scope.row)" >
|
|
|
+ <el-button v-show="proxyType != 'INTEGRATION'" size="small" @click="view(scope.row)">
|
|
|
<el-icon><IconPark-preview-open /></el-icon>
|
|
|
预览
|
|
|
</el-button>
|
|
@@ -49,41 +49,20 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<div class="pagination">
|
|
|
- <el-pagination background
|
|
|
- layout="sizes, prev, pager, next, jumper, ->, total"
|
|
|
- v-model:current-page="pageInfo.page"
|
|
|
- v-model:page-size="pageInfo.pageSize"
|
|
|
- :total="pageInfo.total"
|
|
|
- />
|
|
|
+ <el-pagination background layout="sizes, prev, pager, next, jumper, ->, total"
|
|
|
+ v-model:current-page="pageInfo.page" v-model:page-size="pageInfo.pageSize" :total="pageInfo.total" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <ConfigDetail v-model:show="detailVisible"
|
|
|
- :operation="detailOperation"
|
|
|
- :item="currRow"
|
|
|
- :is-edit="detailIsEdit"
|
|
|
- :select-options="selectOptions"
|
|
|
- :proxy-type="proxyType"
|
|
|
- :data-type="dataType"
|
|
|
- :refresh="getData"
|
|
|
- >
|
|
|
+ <ConfigDetail v-model:show="detailVisible" :operation="detailOperation" :item="currRow" :is-edit="detailIsEdit"
|
|
|
+ :select-options="selectOptions" :proxy-type="proxyType" :data-type="dataType" :refresh="getData">
|
|
|
</ConfigDetail>
|
|
|
|
|
|
- <CesiumMap v-if="isMapShow"
|
|
|
- :is-show="isMapShow"
|
|
|
- :type="mapType"
|
|
|
- :close="closeMap"
|
|
|
- :item="mapItem"
|
|
|
- >
|
|
|
+ <CesiumMap v-if="isMapShow" :is-show="isMapShow" :type="mapType" :close="closeMap" :item="mapItem">
|
|
|
</CesiumMap>
|
|
|
|
|
|
- <AllCesiumMap v-if="isAllMapShow"
|
|
|
- :is-show="isAllMapShow"
|
|
|
- :type="allMapType"
|
|
|
- :close="closeMap"
|
|
|
- :item="tableData"
|
|
|
- >
|
|
|
+ <AllCesiumMap v-if="isAllMapShow" :is-show="isAllMapShow" :type="allMapType" :close="closeMap" :item="tableData">
|
|
|
</AllCesiumMap>
|
|
|
</template>
|
|
|
|
|
@@ -138,7 +117,7 @@ export default {
|
|
|
},
|
|
|
'publish_threeD': {
|
|
|
proxyType: 'PUBLISH',
|
|
|
- dataTypes: [2,3],
|
|
|
+ dataTypes: [2, 3],
|
|
|
},
|
|
|
'integration_data': {
|
|
|
proxyType: 'INTEGRATION',
|
|
@@ -191,7 +170,7 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
let container = document.getElementById("configManage");
|
|
|
- this.maxHeight = container.clientHeight*0.85;
|
|
|
+ this.maxHeight = container.clientHeight * 0.85;
|
|
|
|
|
|
this.getData();
|
|
|
},
|
|
@@ -208,7 +187,7 @@ export default {
|
|
|
for (let index of obj.dataTypes) {
|
|
|
this.selectOptions.push(this.dataTypes[index])
|
|
|
}
|
|
|
- if (this.selectOptions.length>0) {
|
|
|
+ if (this.selectOptions.length > 0) {
|
|
|
this.dataType = this.selectOptions[0].value
|
|
|
}
|
|
|
},
|
|
@@ -219,7 +198,7 @@ export default {
|
|
|
this.getData();
|
|
|
},
|
|
|
getData() {
|
|
|
- if (!this.dataType || this.dataType=='') {
|
|
|
+ if (!this.dataType || this.dataType == '') {
|
|
|
this.configData = [];
|
|
|
this.tableData = []
|
|
|
this.pageInfo.total = 0;
|
|
@@ -238,24 +217,51 @@ export default {
|
|
|
let num = 0;
|
|
|
that.configData = [];
|
|
|
that.pageInfo.total = 0;
|
|
|
+ // let t = []
|
|
|
if (res.content) {
|
|
|
that.configData = JSON.parse(JSON.stringify(res.content))
|
|
|
- that.configData.forEach(i=>{
|
|
|
+ // let t = []
|
|
|
+ that.configData.forEach(i => {
|
|
|
i.id = num++;
|
|
|
- i.proxyUrl = systemConfig.proxyUrl.replace('{PROXYURL}', i.key);
|
|
|
+ // if (i.type == "3dtiles") {
|
|
|
+ if (i.type.indexOf("arcgis") >= 0) {
|
|
|
+ i.proxyUrl = systemConfig.proxyUrl_arcgis.replace('{PROXYURL}', i.key);
|
|
|
+ // if (i.type.indexOf("arcgis-tile") >= 0) t.push(encodeURIComponent(i.proxyUrl + "622067E9-93E5-D8EC-E677-85B58A63C0C7"))
|
|
|
+ }
|
|
|
+ else if (i.type == "cartodb") {
|
|
|
+ let one = systemConfig.proxyUrl.replace('proxy/?', "proxy/{z}/{x}/{y}.png?");
|
|
|
+ i.proxyUrl = one.replace('{PROXYURL}', i.key);
|
|
|
+ }
|
|
|
+ else if (i.type == "xyz_jpg") {
|
|
|
+ let one = systemConfig.proxyUrl.replace('proxy/?', "proxy/{z}/{x}/{y}.jpg?");
|
|
|
+ i.proxyUrl = one.replace('{PROXYURL}', i.key);
|
|
|
+ }
|
|
|
+ else if (i.type == "xyz_png") {
|
|
|
+ let one = systemConfig.proxyUrl.replace('proxy/?', "proxy/{z}/{x}/{y}.png?");
|
|
|
+ i.proxyUrl = one.replace('{PROXYURL}', i.key);
|
|
|
+ }
|
|
|
+ else if (that.dataType == "MODEL") {
|
|
|
+ let one = systemConfig.proxyUrl.replace('proxy/?', "proxy/tileset.json?");
|
|
|
+ i.proxyUrl = one.replace('{PROXYURL}', i.key);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ i.proxyUrl = systemConfig.proxyUrl.replace('{PROXYURL}', i.key);
|
|
|
+ }
|
|
|
})
|
|
|
that.pageInfo.total = that.configData.length;
|
|
|
+ // console.log(JSON.stringify(t))
|
|
|
}
|
|
|
+
|
|
|
this.renderTable();
|
|
|
}
|
|
|
that.loading = false;
|
|
|
- }).catch(err=>{
|
|
|
+ }).catch(err => {
|
|
|
that.loading = false;
|
|
|
- that.$message({message: err.message, type: 'error'});
|
|
|
+ that.$message({ message: err.message, type: 'error' });
|
|
|
})
|
|
|
},
|
|
|
renderTable() {
|
|
|
- let start = (this.pageInfo.page-1) * this.pageInfo.pageSize
|
|
|
+ let start = (this.pageInfo.page - 1) * this.pageInfo.pageSize
|
|
|
let end = this.pageInfo.page * this.pageInfo.pageSize
|
|
|
this.tableData = this.configData.slice(start, end)
|
|
|
},
|
|
@@ -263,8 +269,8 @@ export default {
|
|
|
this.detailOperation = operation;
|
|
|
this.detailVisible = true;
|
|
|
this.detailIsEdit = true;
|
|
|
- if (operation==='Add') {
|
|
|
- this.currRow = {title: '', url: ''};
|
|
|
+ if (operation === 'Add') {
|
|
|
+ this.currRow = { title: '', url: '' };
|
|
|
this.detailIsEdit = false;
|
|
|
} else {
|
|
|
this.currRow = JSON.parse(JSON.stringify(item));
|
|
@@ -275,19 +281,23 @@ export default {
|
|
|
if (type) {
|
|
|
this.allMapType = type;
|
|
|
this.isAllMapShow = true;
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
this.$message.error('该类型暂不支持预览');
|
|
|
return;
|
|
|
}
|
|
|
},
|
|
|
view(item) {
|
|
|
// 0-GeoJson、1-3DTiles、2-gltf/glb、3-水面、4-地图
|
|
|
+
|
|
|
+ // debugger;
|
|
|
+ // console.log(item)
|
|
|
+ // console.log(this.dataType)
|
|
|
this.mapItem = JSON.parse(JSON.stringify(item))
|
|
|
let type = this.mapTypes[this.dataType];
|
|
|
if (type) {
|
|
|
this.mapType = type;
|
|
|
this.isMapShow = true;
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
this.$message.error('该类型暂不支持预览');
|
|
|
return;
|
|
|
}
|
|
@@ -298,21 +308,21 @@ export default {
|
|
|
},
|
|
|
deleteConfig(item) {
|
|
|
let that = this;
|
|
|
- this.$msgbox.confirm('确定要删除:'+item.key+'吗?').then(()=>{
|
|
|
+ this.$msgbox.confirm('确定要删除:' + item.key + '吗?').then(() => {
|
|
|
let params = {
|
|
|
proxyType: this.proxyType,
|
|
|
dataType: this.dataType,
|
|
|
index: item.id
|
|
|
}
|
|
|
- that.$request.deleteForm('/proxy_proxy/proxy_api/config/delete', params).then(res=>{
|
|
|
+ that.$request.deleteForm('/proxy_proxy/proxy_api/config/delete', params).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
- that.$message({message:'删除成功', type: 'success'});
|
|
|
+ that.$message({ message: '删除成功', type: 'success' });
|
|
|
that.getData();
|
|
|
} else {
|
|
|
- that.$message({message:res.content, type: 'error'});
|
|
|
+ that.$message({ message: res.content, type: 'error' });
|
|
|
}
|
|
|
- }).catch(err=>{
|
|
|
- that.$message({message:err.message, type: 'error'});
|
|
|
+ }).catch(err => {
|
|
|
+ that.$message({ message: err.message, type: 'error' });
|
|
|
})
|
|
|
})
|
|
|
|
|
@@ -332,6 +342,7 @@ export default {
|
|
|
|
|
|
.tableContent {
|
|
|
margin-top: 1%;
|
|
|
+
|
|
|
.pagination {
|
|
|
margin-top: 1%;
|
|
|
position: relative;
|