es功能开发,基本可用了
This commit is contained in:
@@ -6,8 +6,13 @@
|
||||
<el-container v-else>
|
||||
<el-aside>
|
||||
<div style="padding: 10px;height: 100%;box-sizing: border-box;background: #fafafa;">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<el-select v-model="choiceDatasource" @change="datasourceChangeEvents" filterable placeholder="选择数据源查看索引列表" style="width: 100%;">
|
||||
<el-option v-for="item in datasourceOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<el-menu :router="true" class="el-menu-vertical" style="height: auto;">
|
||||
<el-menu-item index="/"><i class="el-icon-s-home"></i>控制台</el-menu-item>
|
||||
<!-- <el-menu-item index="/"><i class="el-icon-s-home"></i>控制台</el-menu-item>-->
|
||||
<el-submenu index="1">
|
||||
<template slot="title">
|
||||
<i class="el-icon-s-platform"></i>
|
||||
@@ -27,7 +32,7 @@
|
||||
ref="databaseTree" highlight-current draggable
|
||||
:default-expanded-keys="esIndexExpandedKeys"
|
||||
node-key="id" @node-expand="handleNodeExpand"
|
||||
style="background-color: #fafafa;">
|
||||
style="background-color: #fafafa;" empty-text="">
|
||||
<span slot-scope="{node, data}">
|
||||
<span>{{node.label}}</span>
|
||||
</span>
|
||||
@@ -92,6 +97,9 @@
|
||||
defaultProps: {children: 'children', label: 'name'},
|
||||
esIndexList: [],
|
||||
esIndexExpandedKeys: [],
|
||||
// 数据源相关
|
||||
datasourceOptions: [],
|
||||
choiceDatasource: "",
|
||||
// 升级信息
|
||||
upgradeInfo: {},
|
||||
}
|
||||
@@ -101,7 +109,7 @@
|
||||
global.vue.$app = this;
|
||||
this.getSelfUserInfo();
|
||||
this.checkSystemUpgrade();
|
||||
this.loadEsMappingList();
|
||||
this.loadDatasourceList();
|
||||
},
|
||||
methods: {
|
||||
userSettingDropdown(command) {
|
||||
@@ -131,7 +139,7 @@
|
||||
handleNodeClick(node) {
|
||||
console.log("点击节点:", node);
|
||||
if (node.type == 1) {
|
||||
this.nowClickPath = {index: node.name};
|
||||
this.nowClickPath = {id: this.choiceDatasource, index: node.name};
|
||||
this.$router.push({path: '/index/show', query: this.nowClickPath});
|
||||
}
|
||||
},
|
||||
@@ -140,8 +148,12 @@
|
||||
console.log("加载节点:", node);
|
||||
}
|
||||
},
|
||||
datasourceChangeEvents() {
|
||||
app.loadEsMappingList();
|
||||
},
|
||||
loadEsMappingList() {
|
||||
this.common.post(this.apilist1.esMappings, {}, function (json) {
|
||||
var param = {id: this.choiceDatasource};
|
||||
this.common.post(this.apilist1.esMappings, param, function (json) {
|
||||
var result = json.data || {};
|
||||
var pathIndex = [], pathChildren = [];
|
||||
for (var key in result) {
|
||||
@@ -160,6 +172,18 @@
|
||||
app.esIndexList = pathIndex;
|
||||
});
|
||||
},
|
||||
loadDatasourceList() {
|
||||
this.common.post(this.apilist1.manageDatasourceList, {}, function (json) {
|
||||
var datasourceList = json.data || [];
|
||||
var datasourceOptions = [];
|
||||
for (var i = 0; i < datasourceList.length; i++) {
|
||||
datasourceOptions.push({
|
||||
label: datasourceList[i].name, value: datasourceList[i].id
|
||||
});
|
||||
}
|
||||
app.datasourceOptions = datasourceOptions;
|
||||
});
|
||||
},
|
||||
checkSystemUpgrade() {
|
||||
this.common.post(this.apilist1.systemUpgradeInfo, {}, function (json) {
|
||||
if (!!json.data) {
|
||||
|
||||
Reference in New Issue
Block a user