<template>
|
<div class="uploads_box">
|
|
<My-bread :list="[
|
`${$t('dataManage.dataManage')}`,
|
`${$t('dataManage.uploadManage')}`,
|
]"></My-bread>
|
<el-divider />
|
<!-- tabs切换 -->
|
<div class="tabs_box">
|
<div
|
class="tabs_pane"
|
@click="setTabsChange(1)"
|
>
|
<div
|
class="tabsSpan"
|
:class="{ changetabs : active == 'first'}"
|
>
|
<span> {{$t('dataManage.uploadObj.dataRelease')}}</span>
|
</div>
|
</div>
|
<div
|
class="tabs_pane"
|
@click="setTabsChange(2)"
|
>
|
<div
|
class="tabsSpan"
|
:class="{ changetabs : active == 'second'}"
|
>
|
<span> {{$t('dataManage.uploadObj.releaseList')}}</span>
|
</div>
|
</div>
|
|
</div>
|
<div
|
v-if="active != 'third'"
|
class="content_box"
|
>
|
<el-form
|
:inline="true"
|
:model="formInline"
|
class="demo-form-inline"
|
>
|
<!-- 目录 -->
|
<el-form-item>
|
|
<el-select
|
ref="tree"
|
size="small"
|
:popper-append-to-body="false"
|
v-model="formInline.dirid"
|
>
|
<el-option
|
:value="formInline.dirid"
|
:label="formInline.dirName"
|
style=" height:auto"
|
>
|
<el-tree
|
class="elTreeData"
|
ref="tree"
|
:data="dirOption"
|
node-key="id"
|
:props="defaultProps"
|
@node-click="handleDirChange"
|
/>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<!-- 版本 -->
|
<el-form-item v-if="active == 'first'">
|
<el-select
|
size="small"
|
v-model="formInline.verid"
|
@change="handleVerChange"
|
> <el-option
|
v-for="item in verOption"
|
:key="item.id"
|
:label="item.name"
|
:value="item.id"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<!-- 类型 -->
|
<el-form-item>
|
<el-select
|
size="small"
|
v-model="formInline.serType"
|
@change="handleTypeChange"
|
>
|
<el-option
|
v-for="item in serverOption"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<!-- 类型 -->
|
<el-form-item>
|
<el-select
|
size="small"
|
v-model="formInline.type"
|
@change="handleTypeChange"
|
:placeholder="$t('shuJuGuanLi.shuJuJianSuo.selectDataType')"
|
>
|
<el-option
|
v-for="item in typeOption"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item>
|
<el-input
|
size="small"
|
:title="$t('dataManage.vmobj.keyword')"
|
v-model="formInline.name"
|
:placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuedataName')"
|
> <i
|
@click="getTableData"
|
:title="$t('common.iquery')"
|
slot="suffix"
|
class="el-icon-search"
|
style="padding-right: 8px"
|
></i></el-input>
|
</el-form-item>
|
<el-form-item style="float:right">
|
<!-- 发布 -->
|
<el-button
|
v-if="active == 'first'"
|
type="success"
|
size="small"
|
icon="el-icon-s-promotion"
|
@click="setPagePublish"
|
>{{$t('common.publish')}}</el-button>
|
<!-- 刪除 -->
|
<el-button
|
v-if="active == 'second'"
|
type="danger"
|
size="small"
|
icon="el-icon-delete"
|
@click="setPageDelete"
|
>{{$t('common.delete')}}</el-button>
|
<!-- 重置 -->
|
<el-button
|
type="info"
|
size="small"
|
@click="setPageStart"
|
icon="el-icon-refresh"
|
>{{$t('common.reset')}}</el-button>
|
</el-form-item>
|
</el-form>
|
|
<div class="dividing-line"></div>
|
<div class="table_box content_Table">
|
<el-table
|
:data="tableData"
|
style="width: 100%"
|
@selection-change="handleSelectionChange"
|
@cell-dblclick="copyText"
|
height="calc(100% - 1px)"
|
ref="tableBox"
|
>
|
<el-table-column
|
type="selection"
|
width="55"
|
key="1"
|
/>
|
<el-table-column
|
:label="$t('dataManage.dictionaryManageObj.number')"
|
type="index"
|
width="50"
|
align="center"
|
key="2"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="name"
|
:label="$t('dataManage.vmobj.name')"
|
align="center"
|
key="3"
|
/>
|
<el-table-column
|
prop="type"
|
:label="$t('dataManage.vmobj.format')"
|
align="center"
|
key="4"
|
/>
|
<el-table-column
|
v-if="active == 'first'"
|
prop="sizes"
|
:label="$t('dataManage.vmobj.size')"
|
:formatter="stateFormatSizes"
|
align="center"
|
key="5"
|
/>
|
|
<el-table-column
|
prop="dirName"
|
:label="$t('dataManage.vmobj.dirName')"
|
width="200"
|
align="center"
|
key="7"
|
/>
|
<el-table-column
|
prop="verName"
|
:label="$t('dataManage.vmobj.versionNumber')"
|
align="center"
|
key="8"
|
/>
|
<el-table-column
|
prop="url"
|
:label="$t('common.publishAddress')"
|
align="center"
|
key="9"
|
/>
|
<el-table-column
|
v-if="active == 'first'"
|
prop="uname"
|
:label="$t('common.rublisher')"
|
align="center"
|
key="10"
|
/>
|
<el-table-column
|
v-if="active != 'first'"
|
prop="createName"
|
:label="$t('common.rublisher')"
|
align="center"
|
key="11"
|
/>
|
<el-table-column
|
prop="createTime"
|
:label="$t('common.releaseTime')"
|
align="center"
|
key="12"
|
/>
|
<el-table-column
|
v-if="active == 'first'"
|
prop="createTime"
|
:label="$t('common.publishStatus')"
|
align="center"
|
key="13"
|
>
|
<template slot-scope="scope">
|
<span v-if="scope.row.url ">已发布</span>
|
|
</template>
|
</el-table-column>
|
<el-table-column
|
min-width="150"
|
:label="$t('common.operate')"
|
v-if="active == 'second'"
|
>
|
<template slot-scope="scope">
|
<el-button
|
v-if="active == 'second'"
|
size="small"
|
type="info"
|
plain
|
@click="setPreviewDetails(scope.row)"
|
>{{$t('common.details')}}
|
|
</el-button>
|
<el-button
|
v-if="active == 'second'"
|
size="small"
|
type="warning"
|
plain
|
@click="setPreviewEdit(scope.row)"
|
>{{$t('common.update')}}
|
|
</el-button>
|
|
<el-button
|
v-if="scope.row.url && active == 'second'"
|
size="small"
|
type="success"
|
plain
|
@click="setPreviewLayer(scope.row)"
|
>{{$t('common.preview')}}
|
|
</el-button>
|
<el-button
|
v-if="scope.row.url && active == 'first'"
|
size="small"
|
type="success"
|
plain
|
>已发布
|
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<div
|
class="pagination_box"
|
style="margin-top: 10px"
|
>
|
<el-pagination
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
:current-page="listData.pageIndex"
|
:page-sizes="showPageSize"
|
:page-size="listData.pageSize"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="listData.count"
|
>
|
</el-pagination>
|
</div>
|
</div>
|
|
<!-- 地址预览 -->
|
<el-dialog
|
:title="$t('common.preview')"
|
:class="isFullscreen ? '' : 'dialogClass_his'"
|
custom-class="handleDialogClass"
|
width="73.4%"
|
:fullscreen="isFullscreen"
|
v-if="dialogVisible"
|
:visible.sync="dialogVisible"
|
:show-close="false"
|
:close-on-click-modal="false"
|
:close-on-press-escape="false"
|
>
|
<dialog-header
|
slot="title"
|
:dialog-tittle="$t('common.preview')"
|
:fullscreen="isFullscreen"
|
@handle-closed="handleClose"
|
@is-fullscreen="onFullscreen"
|
></dialog-header>
|
<div :class="{'fullscreen1':isFullscreen}">
|
<mapview v-if="showMapView"></mapview>
|
</div>
|
</el-dialog>
|
|
<!-- 修改数据 -->
|
<el-dialog
|
:title="$t('common.update')"
|
:visible.sync="editDialogVisible"
|
width="50%"
|
:show-close="false"
|
:close-on-click-modal="false"
|
>
|
<div style="width:100%; ">
|
<el-form
|
ref="form"
|
:model="editLayer"
|
label-width="150px"
|
>
|
<!-- 名称 -->
|
<el-form-item :label="$t('dataManage.vmobj.name')">
|
<el-input
|
v-model="editLayer.name"
|
:placeholder="$t('dataManage.vmobj.name')"
|
></el-input>
|
</el-form-item>
|
<!-- 拉伸方式 -->
|
<el-form-item :label="$t('dataManage.vmobj.labe15')">
|
<el-select
|
size="small"
|
:disabled="true"
|
v-model="editLayer.enhanceType"
|
style="width: 100%;"
|
>
|
<el-option
|
v-for="item in enhanceOption"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
|
</el-form-item>
|
<!-- 坐标系 -->
|
<!-- <el-form-item
|
v-show="editLayer.showFactor"
|
:label="$t('dataManage.vmobj.labe17')"
|
>
|
|
<el-input
|
style="width: 100%;"
|
v-model="editLayer.url"
|
:disabled='true'
|
size="small"
|
>
|
|
</el-input>
|
</el-form-item> -->
|
<!-- 坐标系 -->
|
<el-form-item :label="$t('dataManage.vmobj.labe16')">
|
<el-select
|
size="small"
|
v-model="editLayer.epsg"
|
style="width: 100%;"
|
:disabled="true"
|
>
|
<el-option
|
v-for="item in epsgOption"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<!-- 去除无效值 -->
|
<!-- <el-form-item :label="$t('dataManage.vmobj.labe14')">
|
<el-select
|
size="small"
|
v-model="editLayer.nodata"
|
style="width: 100%;"
|
:disabled="true"
|
>
|
<el-option
|
v-for="item in noDataOption"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item> -->
|
<el-form-item>
|
<el-button
|
size="small"
|
type="primary"
|
@click="setEditLayerSubmit"
|
>{{$t('common.submit')}}</el-button>
|
<el-button
|
size="small"
|
type="info"
|
@click="setEditLayerCancle"
|
>{{$t('common.cancel')}}</el-button>
|
</el-form-item>
|
|
</el-form>
|
</div>
|
</el-dialog>
|
<!-- 数据详情 -->
|
<el-dialog
|
:title="$t('common.details')"
|
:visible.sync="detailsDialogVisible"
|
width="50%"
|
:close-on-click-modal="false"
|
>
|
<div style="width:100%;height:50vh;color: white;">
|
<p>{{ $t("dataManage.vmobj.name") }}:{{ itemdetail.name }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t("dataManage.vmobj.format") }}:{{ itemdetail.type }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t("dataManage.vmobj.depName") }}:{{ itemdetail.depName }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t("dataManage.vmobj.dirName") }}:{{ itemdetail.dirName }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t("dataManage.vmobj.versionNumber") }}:{{ itemdetail.verName }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t("common.publishAddress") }}:{{ itemdetail.url }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t("common.rublisher") }}:{{ itemdetail.createName }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t("common.releaseTime") }}:{{ itemdetail.createTime }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t("dataManage.vmobj.updateonuser") }}:{{ itemdetail.updateName }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t("dataManage.vmobj.updateontime") }}:{{ itemdetail.updateTime }}</p>
|
<el-divider></el-divider>
|
</div>
|
</el-dialog>
|
<!-- 发布 -->
|
<el-dialog
|
:title="$t('common.publish')"
|
:visible.sync="insertDialogVisible"
|
width="40%"
|
:close-on-click-modal="false"
|
:show-close="false"
|
>
|
<div style="width:100%; ">
|
<el-form
|
ref="form"
|
:model="insertLayer"
|
label-width="150px"
|
>
|
<!-- 名称 -->
|
<el-form-item :label="$t('dataManage.vmobj.name')">
|
<el-input
|
v-model="insertLayer.name"
|
:placeholder="$t('dataManage.vmobj.name')"
|
></el-input>
|
</el-form-item>
|
<!-- 拉伸方式 -->
|
<el-form-item :label="$t('dataManage.vmobj.labe15')">
|
<el-select
|
size="small"
|
v-model="insertLayer.enhanceType"
|
style="width: 100%;"
|
@change="setEnhanceTypeChange()"
|
>
|
<el-option
|
v-for="item in enhanceOption"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
|
</el-form-item>
|
<!-- 坐标系 -->
|
<el-form-item
|
v-show="insertLayer.showFactor"
|
:label="$t('dataManage.vmobj.labe17')"
|
>
|
<el-input-number
|
v-model="insertLayer.enhanceFactor"
|
controls-position="right"
|
:min="insertLayer.min"
|
:step="insertLayer.step"
|
:max="insertLayer.max"
|
class="setEnhanceFactor"
|
style="width: 100%;"
|
></el-input-number>
|
</el-form-item>
|
<!-- 坐标系 -->
|
<el-form-item :label="$t('dataManage.vmobj.labe16')">
|
<el-select
|
size="small"
|
v-model="insertLayer.epsg"
|
style="width: 100%;"
|
>
|
<el-option
|
v-for="item in epsgOption"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<!-- 去除无效值 -->
|
<el-form-item :label="$t('dataManage.vmobj.labe14')">
|
<el-select
|
size="small"
|
v-model="insertLayer.nodata"
|
style="width: 100%;"
|
>
|
<el-option
|
v-for="item in noDataOption"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item>
|
<el-button
|
size="small"
|
type="primary"
|
@click="setinsertLayerSubmit()"
|
>{{$t('common.submit')}}</el-button>
|
<el-button
|
size="small"
|
type="info"
|
@click="setinsertLayerCancel()"
|
>{{$t('common.cancel')}}</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
</el-dialog>
|
<!--模型发布 -->
|
<el-dialog
|
:title="$t('common.publish')"
|
:visible.sync="insertModelVisible"
|
width="25%"
|
:close-on-click-modal="false"
|
:show-close="false"
|
>
|
<div style="width:100%; ">
|
|
<div
|
v-for="item in modelOptions"
|
style="margin: 5px;"
|
>
|
<el-row :gutter="20">
|
<el-col :span="10">
|
<div style="height: 64px; display: flex; align-items: center;">
|
{{ item.name }}
|
</div>
|
</el-col>
|
<el-col :span="10">
|
<div style="height: 64px; display: flex; align-items: center;">
|
|
<el-select
|
size="small"
|
v-model="item.isModel"
|
placeholder="请选择数据类型"
|
>
|
<el-option
|
label="单体模型"
|
value="1"
|
></el-option>
|
<el-option
|
label="倾斜模型"
|
value="0"
|
>倾斜模型</el-option>
|
</el-select>
|
|
</div>
|
</el-col>
|
</el-row>
|
</div>
|
<div style="display: flex; justify-content: end;margin-top:10px;">
|
<el-button
|
size="small"
|
type="primary"
|
@click="setModelInsert"
|
>{{$t('common.submit')}}</el-button>
|
<el-button
|
size="small"
|
type="info"
|
@click="setModelCanel"
|
>{{$t('common.cancel')}}</el-button>
|
</div>
|
</div>
|
</el-dialog>
|
|
<div
|
class="loadBox"
|
v-if="loadDialogVisible"
|
>
|
<div style="widht:100%; margin:20px; color:white">
|
<div style="margin-left:99%">
|
<el-link
|
@click="setloadDialogVisible()"
|
style="color:white"
|
> X</el-link>
|
</div>
|
</div>
|
<div
|
v-loading="true"
|
element-loading-background="rgba(0, 0, 0, 0.0) "
|
element-loading-text="数据发布中"
|
style="margin: 0px 20px;widht:100%;height:calc(100% - 80px); "
|
>
|
</div>
|
</div>
|
</div>
|
|
</template>
|
|
<script>
|
|
import dialogHeader from './dialogHeader.vue'
|
import mapview from '../../components/MapView/moonMap.vue'
|
import MyBread from "../../components/MyBread.vue"
|
import {
|
selectdepTab,
|
selectdirTab,
|
meta_selectVerByDirid,
|
publish_selectMetasByPage,
|
publish_selectByPage,
|
publish_deletesSjServices,
|
publish_update,
|
publish_insertSjService,
|
} from '../../api/api.js'
|
import { conditions } from '../Archive/Archive';
|
import { method_option, nodata_Option, server_option, system_Option, type_option } from './js/layerManage';
|
import server from '../../components/js/server.js'
|
export default {
|
components: {
|
MyBread, mapview,
|
'dialog-header': dialogHeader,
|
},
|
data() {
|
return {
|
active: 'first',
|
formInline: {
|
dirid: null,
|
dirName: null,
|
depid: null,
|
verid: null,
|
depName: null,
|
name: "",
|
type: "",
|
serType: '',
|
|
},
|
listData: {
|
pageIndex: 1,
|
pageSize: 100,
|
count: 0
|
},
|
multipleSelection: [],
|
tableData: [],
|
depOption: [],
|
dirOption: [],
|
verOption: [],
|
modelOptions: [],
|
typeOption: [],
|
defaultProps: {
|
label: "name",
|
value: "id",
|
children: "children",
|
checkStrictly: true,
|
emitPath: false,
|
},
|
dialogVisible: false,
|
showMapView: false,
|
showPageSize: [],
|
editLayer: {
|
enhanceType: null
|
},
|
updateLayer: {},
|
editDialogVisible: false,
|
detailsDialogVisible: false,
|
itemdetail: {},
|
insertDialogVisible: false,
|
insertModelVisible: false,
|
insertLayer: {
|
name: '',
|
enhanceType: null,
|
enhanceFactor: null,
|
showFactor: false,
|
epsg: null,
|
nodata: null
|
},
|
loadDialogVisible: false,
|
options: [],
|
isFullscreen: false,
|
serverOption: [],
|
enhanceOption: [],
|
epsgOption: [],
|
noDataOption: []
|
}
|
},
|
methods: {
|
setModelCanel() {
|
this.insertModelVisible = false;
|
this.modelOptions = [];
|
},
|
async setModelInsert() {
|
var val = this.modelOptions.filter(res => {
|
if (!res.isModel) {
|
return res
|
}
|
})
|
var str = [];
|
if (val.length > 0) {
|
for (var i in val) {
|
str.push(val[i].name)
|
}
|
var mesage = str.toString() + '未选择数据类型'
|
this.$message(mesage);
|
return;
|
}
|
var ids = [];
|
var models = [];
|
for (var i in this.modelOptions) {
|
ids.push(this.modelOptions[i].id)
|
models.push(parseInt(this.modelOptions[i].isModel))
|
}
|
var obj = {
|
dircode: this.formInline.dirid,
|
depcode: this.formInline.depid,
|
min: null,
|
max: null,
|
name: null,
|
type: this.formInline.type,
|
noData: null,
|
ids: ids,
|
models: models
|
|
}
|
this.loadDialogVisible = true
|
this.insertModelVisible = false;
|
|
const data = await publish_insert(obj);
|
|
if (data.code == 200 && data.result > 0) {
|
this.$message({
|
message: '数据发布成功',
|
type: 'success'
|
});
|
} else {
|
this.$message.error("数据发布失败")
|
}
|
this.loadDialogVisible = false
|
this.getTableData();
|
|
|
},
|
copyText(row, column, cell, event) {
|
// 双击复制
|
let save = function (e) {
|
e.clipboardData.setData('text/plain', event.target.innerText);
|
e.preventDefault(); //阻止默认行为
|
}
|
document.addEventListener('copy', save);//添加一个copy事件
|
document.execCommand("copy");//执行copy方法
|
this.$message({ message: '复制成功', type: 'success' })//提示
|
},
|
setOptions() {
|
var std = [];
|
for (var i = 0; i < 23; i++) {
|
std.push({
|
value: i,
|
label: i
|
})
|
}
|
this.options = std;
|
},
|
setloadDialogVisible() {
|
this.loadDialogVisible = false
|
},
|
setinsertLayerCancel() {
|
this.insertDialogVisible = false;
|
this.insertLayer = {
|
name: '',
|
enhanceType: null,
|
enhanceFactor: null,
|
showFactor: false,
|
epsg: null,
|
nodata: null
|
};
|
},
|
//发布提交
|
async setinsertLayerSubmit() {
|
var name = this.insertLayer.name;
|
if (!name) {
|
this.$message.error("名称不能为空")
|
return
|
}
|
var std = [];
|
for (var i in this.multipleSelection) {
|
std.push(this.multipleSelection[i].id)
|
}
|
var obj = {
|
dircode: this.formInline.dirid,
|
name: name,
|
ids: std,
|
enhanceType: this.insertLayer.enhanceType,
|
enhanceFactor: this.insertLayer.enhanceFactor,
|
epsg: this.insertLayer.epsg,
|
type: this.formInline.type,
|
noData: this.insertLayer.nodata
|
}
|
|
this.loadDialogVisible = true
|
this.insertDialogVisible = false;
|
|
const data = await publish_insertSjService(obj);
|
|
if (data.code == 200 && data.result > 0) {
|
this.$message({
|
message: '数据发布成功',
|
type: 'success'
|
});
|
} else {
|
this.$message.error("数据发布失败")
|
}
|
this.loadDialogVisible = false
|
this.getTableData();
|
},
|
setEnhanceTypeChange(res) {
|
var val = this.enhanceOption.filter((res) => {
|
if (res.value == this.insertLayer.enhanceType) {
|
return res;
|
}
|
})
|
|
this.insertLayer.enhanceFactor = val[0].enhanceFactor;
|
if (val[0].enhanceFactor != 0) {
|
this.insertLayer.min = val[0].min;
|
this.insertLayer.max = val[0].max;
|
this.insertLayer.step = val[0].step;
|
this.insertLayer.showFactor = true;
|
} else {
|
this.insertLayer.showFactor = false;
|
}
|
},
|
//数据发布
|
async setPagePublish() {
|
if (this.multipleSelection.length == 0) {
|
this.$message("请选择要发布的数据")
|
return
|
}
|
this.insertLayer.name = null
|
var val = this.enhanceOption[0]
|
this.insertLayer.enhanceType = val.value;
|
this.insertLayer.epsg = this.epsgOption[0].value;
|
this.insertLayer.nodata = this.noDataOption[0].value
|
this.insertLayer.enhanceFactor = val.enhanceFactor;
|
if (val.enhanceFactor != 0) {
|
this.insertLayer.min = val.min;
|
this.insertLayer.max = val.max;
|
this.insertLayer.step = val.step;
|
this.insertLayer.showFactor = true;
|
} else {
|
this.insertLayer.showFactor = false;
|
}
|
this.insertDialogVisible = true;
|
|
},
|
//数据详情
|
setPreviewDetails(res) {
|
this.itemdetail = res;
|
this.detailsDialogVisible = true;
|
},
|
//修改提交
|
async setEditLayerSubmit() {
|
if (this.editLayer.url) {
|
var url = this.editLayer.url;
|
this.editLayer.url = url.replace(iisHost, "{host}");
|
}
|
|
const data = await publish_update(this.editLayer);
|
if (data.code != 200) {
|
this.$message.error("数据修改失败")
|
return
|
}
|
this.$message({
|
message: '数据修改成功',
|
type: 'success'
|
});
|
this.getTableData();
|
this.editDialogVisible = false;
|
},
|
//修改取消
|
setEditLayerCancle() {
|
if (this.editLayer == this.updateLayer) {
|
this.editDialogVisible = false;
|
} else {
|
this.$confirm('确认关闭?')
|
.then(_ => {
|
this.editLayer = JSON.parse(this.updateLayer)
|
this.editDialogVisible = false;
|
})
|
.catch(_ => {
|
|
});
|
}
|
},
|
//修改弹窗
|
setPreviewEdit(res) {
|
this.updateLayer = JSON.stringify(res) //备份;
|
var val = JSON.parse(JSON.stringify(res));
|
|
this.editLayer = val;
|
this.editLayer.epsg = val.epsg.toString();
|
var result = this.enhanceOption.filter((res) => {
|
if (res.value == val.enhanceType) {
|
return res;
|
}
|
})
|
if (result[0].enhanceFactor != 0) {
|
this.editLayer.showFactor = true
|
}
|
|
this.editDialogVisible = true;
|
},
|
//删除
|
setPageDelete() {
|
if (this.multipleSelection.length == 0) {
|
return this.$message.error("请选择要删除的数据")
|
} else {
|
var that = this
|
this.$confirm('确定是否删除所选内容?')
|
.then(_ => {
|
done();
|
})
|
.catch(_ => {
|
that.deletePage()
|
});
|
}
|
},
|
async deletePage() {
|
var std = [];
|
for (var i in this.multipleSelection) {
|
std.push(this.multipleSelection[i].id);
|
}
|
const data = await publish_deletesSjServices({ ids: std.toString() });
|
if (data.code != 200) {
|
this.$message.error("单位列表获取失败")
|
return
|
} else {
|
this.$message({
|
message: '删除成功',
|
type: 'success'
|
});
|
this.getTableData();
|
}
|
},
|
//预览弹窗打开
|
setPreviewLayer(res) {
|
this.$store.state.previewLayer = res;
|
|
this.dialogVisible = true;
|
this.showMapView = true;
|
|
|
setTimeout(() => {
|
server.setAddReleaseLayer(res)
|
}, 500);
|
},
|
//是否为全屏函数
|
onFullscreen(fullscreen) {
|
this.isFullscreen = fullscreen;
|
},
|
//预览弹窗关闭
|
handleClose() {
|
this.getTableData();
|
this.dialogVisible = false;
|
this.showMapView = false;
|
|
},
|
// 获取多选选中的对象
|
handleSelectionChange(val) {
|
this.multipleSelection = val
|
},
|
//单位转换
|
stateFormatSizes(row, column) {
|
if (row.sizes >= 1024) {
|
const val = parseFloat(row.sizes / 1024).toFixed(3)
|
return val + " GB"
|
} else {
|
return row.sizes + " MB"
|
}
|
},
|
//格式化地址
|
formatLayer(row, column) {
|
let data = row.layer
|
if (data == null) {
|
return data
|
}
|
|
return data.replace("{host}", iisHost)
|
},
|
//格式化时间
|
formatData(row, column) {
|
let data = row[column.property]
|
if (data == null) {
|
return data
|
}
|
return this.format(data)
|
},
|
//分页切换
|
handleCurrentChange(val) {
|
this.listData.pageIndex = val;
|
this.getTableData_one();
|
},
|
//每页显示数量
|
handleSizeChange(val) {
|
this.listData.pageSize = val;
|
this.listData.pageIndex = 1;
|
this.getTableData_one();
|
},
|
//tabs切換
|
setTabsChange(res) {
|
switch (res) {
|
case 1:
|
this.active = 'first';
|
this.setPageStart();
|
break;
|
case 2:
|
this.active = 'second';
|
this.setPageStart();
|
break;
|
case 3:
|
this.$store.state.previewLayer = {
|
url: "menuLayer"
|
}
|
this.active = 'third';
|
break;
|
|
|
|
this.$nextTick(() => {
|
this.$refs.tableBox.doLayout()
|
})
|
|
|
}
|
},
|
//页面初始化
|
setPageStart() {
|
this.formInline = {
|
dirid: null,
|
dirName: null,
|
depid: null,
|
verid: null,
|
depName: null,
|
name: "",
|
type: ""
|
}
|
if (this.active == "first") {
|
this.listData = {
|
pageIndex: 1,
|
pageSize: 10,
|
count: 0
|
}
|
this.showPageSize = [10, 50, 100, 200]
|
this.formInline.type = this.typeOption[0].value;
|
} else {
|
this.listData = {
|
pageIndex: 1,
|
pageSize: 10,
|
count: 0
|
}
|
this.showPageSize = [10, 50, 100, 200]
|
this.formInline.type = null
|
}
|
|
this.formInline.serType = this.serverOption[0].value;
|
|
// this.getDepTreeList();
|
this.getDirTreeList();
|
|
},
|
//获取目录列表
|
async getDirTreeList() {
|
const data = await selectdirTab();
|
if (data.code != 200) {
|
this.$message.error("单位列表获取失败")
|
return
|
}
|
this.dirOption = this.treeData(data.result);
|
this.formInline.dirid = this.dirOption[0].code;
|
this.formInline.dirName = this.dirOption[0].name;
|
this.getVerList(this.dirOption[0].id)
|
},
|
//获取版本列表
|
async getVerList(res) {
|
const data = await meta_selectVerByDirid({ dirid: res })
|
if (data.code != 200) {
|
this.$message.error("版本列表获取失败")
|
return
|
}
|
this.verOption = data.result
|
this.formInline.verid = data.result[0].id;
|
this.getTableData();
|
},
|
//版本列表切换
|
handleVerChange(value) {
|
|
this.formInline.verid = value;
|
this.getTableData();
|
},
|
//服务类型列表切换
|
handleTypeChange(value) {
|
this.formInline.type = value;
|
this.getTableData();
|
},
|
//单位列表切换
|
handleDepChange(data, node, nodeData) {
|
this.formInline.depid = data.code
|
this.formInline.depName = data.name
|
this.getTableData();
|
},
|
//目录列表切换
|
handleDirChange(data, node, nodeData) {
|
this.formInline.dirid = data.code
|
this.formInline.dirName = data.name
|
this.getVerList(data.id)
|
},
|
//获取Table表格数据
|
async getTableData() {
|
|
this.listData.count = 0;
|
this.listData.pageIndex = 1;
|
this.getTableData_one();
|
},
|
async getTableData_one() {
|
this.tableData = [];
|
if (this.active == "first") {
|
|
this.listData.depcode = this.formInline.depid;
|
this.listData.dircode = this.formInline.dirid;
|
this.listData.name = this.formInline.name;
|
this.listData.type = this.formInline.type;
|
this.listData.verid = this.formInline.verid;
|
const data = await publish_selectMetasByPage(this.listData)
|
if (data.code != 200) {
|
|
}
|
if (data.result) {
|
|
|
var that = this
|
|
var val = data.result.filter((res) => {
|
if (res.createTime) {
|
res.createTime = that.format(res.createTime);
|
}
|
|
if (res.url) {
|
res.url = res.url.replace("{host}", iisHost);
|
}
|
return res
|
})
|
this.tableData = val;
|
this.listData.count = data.count;
|
}
|
}
|
else {
|
if (this.formInline.name) {
|
this.listData.name = this.formInline.name
|
}
|
this.listData.dircode = this.formInline.dirid;
|
this.listData.type = this.formInline.type;
|
const data = await publish_selectByPage(this.listData);
|
if (data.result) {
|
var that = this
|
var val = data.result.filter((rs) => {
|
if (rs.createTime) {
|
rs.createTime = that.format(rs.createTime);
|
}
|
if (rs.updateTime) {
|
rs.updateTime = that.format(rs.updateTime);
|
}
|
if (rs.url) {
|
|
rs.url = rs.url.replace("{host}", iisHost);
|
}
|
return rs
|
})
|
|
this.tableData = val;
|
this.listData.count = data.count;
|
}
|
}
|
},
|
//格式化时间
|
format(shijianchuo) {
|
//shijianchuo是整数,否则要parseInt转换
|
var time = new Date(shijianchuo);
|
var y = time.getFullYear();
|
var m = time.getMonth() + 1;
|
var d = time.getDate();
|
var h = time.getHours();
|
var mm = time.getMinutes();
|
var s = time.getSeconds();
|
return (
|
y +
|
'-' +
|
this.add0(m) +
|
'-' +
|
this.add0(d) +
|
' ' +
|
h +
|
':' +
|
mm +
|
':' +
|
s
|
);
|
},
|
//格式化时间
|
add0(m) {
|
return m < 10 ? '0' + m : m;
|
},
|
//获取单位列表
|
async getDepTreeList() {
|
const data = await selectdepTab();
|
if (data.code != 200) {
|
this.$message.error("单位列表获取失败")
|
return
|
}
|
this.depOption = this.treeData(data.result);
|
this.formInline.depid = this.depOption[0].code
|
this.formInline.depName = this.depOption[0].name
|
},
|
//树列表生成
|
treeData(source) {
|
let cloneData = JSON.parse(JSON.stringify(source)) // 对源数据深度克隆
|
return cloneData.filter(father => {
|
// 循环所有项
|
let branchArr = cloneData.filter(child => father.id == child.pid) // 对比ID,分别上下级菜单,并返回数据
|
branchArr.length > 0 ? (father.children = branchArr) : "" // 给父级添加一个children属性,并赋值
|
return father.pid == 0 // 返回一级菜单
|
})
|
},
|
},
|
mounted() {
|
this.active = 'first';
|
this.typeOption = type_option;
|
this.serverOption = server_option;
|
this.epsgOption = system_Option;
|
this.noDataOption = nodata_Option;
|
this.enhanceOption = method_option
|
this.setPageStart();
|
this.setOptions();
|
|
|
}
|
}
|
</script>
|
|
<style lang="less" scoped>
|
.uploads_box {
|
width: calc(100% - 20px);
|
height: calc(100% - 20px);
|
padding: 10px;
|
.tabs_box {
|
width: 100%;
|
border-bottom: 2px solid #e4e7ed;
|
margin-bottom: 10px;
|
}
|
.tabs_pane {
|
padding: 0 10px;
|
height: 40px;
|
box-sizing: border-box;
|
line-height: 40px;
|
display: inline-block;
|
list-style: none;
|
font-size: 14px;
|
font-weight: 500;
|
color: #303133;
|
}
|
.tabs_pane:hover {
|
color: #409eff;
|
}
|
.changetabs {
|
color: #409eff;
|
|
border-bottom: 2px solid #409eff;
|
}
|
.tabs_nav {
|
width: 100%;
|
height: 2px;
|
background: #e4e7ed;
|
}
|
.content_box {
|
width: 100%;
|
height: calc(100% - 90px);
|
/deep/.el-form-item {
|
margin-bottom: 15px;
|
}
|
.content_Table {
|
height: calc(100% - 110px);
|
}
|
}
|
/deep/.el-divider--horizontal {
|
margin: 14px 0px;
|
}
|
.loadBox {
|
position: fixed;
|
z-index: 2002;
|
background: rgba(0, 0, 0, 0.2);
|
width: 100%;
|
height: 100%;
|
top: 0;
|
left: 0;
|
.el-loading-mask {
|
background: transparent !important;
|
}
|
}
|
.fullscreen1 {
|
width: 100%;
|
height: 92vh;
|
}
|
/deep/.el-dialog__body {
|
padding: 10px !important;
|
}
|
/deep/.el-dialog__header {
|
padding: 10px !important;
|
}
|
}
|
.elTreeData {
|
color: white !important;
|
background: transparent !important;
|
font-size: 15px !important;
|
font-family: Microsoft YaHei !important;
|
}
|
</style>
|