增加es文档雏形~
This commit is contained in:
1
pom.xml
1
pom.xml
@@ -28,5 +28,6 @@
|
||||
<module>zyplayer-doc-data</module>
|
||||
<module>zyplayer-doc-grpc</module>
|
||||
<module>zyplayer-doc-other</module>
|
||||
<module>zyplayer-doc-es</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
||||
@@ -42,7 +42,11 @@ public class ElasticSearchUtil {
|
||||
if (!this.isOpen()) {
|
||||
return null;
|
||||
}
|
||||
String mapKey = esScheme + "_" + hostAndPort;
|
||||
return this.getEsClient(hostAndPort, esScheme);
|
||||
}
|
||||
|
||||
public RestHighLevelClient getEsClient(String hostPort, String scheme) {
|
||||
String mapKey = scheme + "_" + hostPort;
|
||||
RestHighLevelClient restClient = restClientMap.get(mapKey);
|
||||
if (restClient == null) {
|
||||
synchronized (createLock) {
|
||||
@@ -52,9 +56,9 @@ public class ElasticSearchUtil {
|
||||
// rest请求客户端
|
||||
// 例:10.16.32.12:9200,10.16.32.12:9201
|
||||
List<HttpHost> hostPortList = new LinkedList<>();
|
||||
for (String hostPortStr : hostAndPort.split(",")) {
|
||||
for (String hostPortStr : hostPort.split(",")) {
|
||||
String[] splitArr = hostPortStr.split(":");
|
||||
hostPortList.add(new HttpHost(splitArr[0], Integer.valueOf(splitArr[1]), esScheme));
|
||||
hostPortList.add(new HttpHost(splitArr[0], Integer.valueOf(splitArr[1]), scheme));
|
||||
}
|
||||
restClient = new RestHighLevelClient(RestClient.builder(hostPortList.toArray(new HttpHost[]{})));
|
||||
restClientMap.put(mapKey, restClient);
|
||||
|
||||
221
zyplayer-doc-es/pom.xml
Normal file
221
zyplayer-doc-es/pom.xml
Normal file
@@ -0,0 +1,221 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-es</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>zyplayer-doc-es</name>
|
||||
<description>wiki文档工具</description>
|
||||
<url>https://gitee.com/zyplayer/zyplayer-doc/zyplayer-doc-es</url>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>zyplayer</id>
|
||||
<name>暮光:城中城</name>
|
||||
<email>806783409@qq.com</email>
|
||||
<roles>
|
||||
<role>Java Development Engineer</role>
|
||||
</roles>
|
||||
<timezone>2018-05-22 16:06:06</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.1.6.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<zyplayer.doc.version>1.0.2</zyplayer.doc.version>
|
||||
<!-- 打包跳过单元测试 -->
|
||||
<skipTests>true</skipTests>
|
||||
<elasticsearch.version>7.2.0</elasticsearch.version>
|
||||
<destDir>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${project.version}</destDir>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-data</artifactId>
|
||||
<version>${zyplayer.doc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-core</artifactId>
|
||||
<version>${zyplayer.doc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-http</artifactId>
|
||||
<version>4.1.8</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
</license>
|
||||
</licenses>
|
||||
<scm>
|
||||
<connection>scm:git@git.oschina.net:zyplayer/zyplayer-doc.git</connection>
|
||||
<developerConnection>scm:git@git.oschina.net:zyplayer/zyplayer-doc.git</developerConnection>
|
||||
<url>git@git.oschina.net:zyplayer/zyplayer-doc.git</url>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>snapshots</id>
|
||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<targetPath>META-INF/resources/</targetPath>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/*.java</exclude>
|
||||
</excludes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/webapp</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.2</version>
|
||||
<configuration>
|
||||
<aggregate>true</aggregate>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.18.1</version>
|
||||
<configuration>
|
||||
<skipTests>${skipTests}</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.2</version>
|
||||
<configuration>
|
||||
<aggregate>true</aggregate>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.zyplayer.doc.elasticsearch.controller;
|
||||
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.service.elasticsearch.support.ElasticSearchUtil;
|
||||
import org.elasticsearch.client.RequestOptions;
|
||||
import org.elasticsearch.client.RestHighLevelClient;
|
||||
import org.elasticsearch.client.indices.GetMappingsRequest;
|
||||
import org.elasticsearch.client.indices.GetMappingsResponse;
|
||||
import org.elasticsearch.cluster.metadata.MappingMetaData;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* es的控制器,7.2.0版本
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019年7月14日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/zyplayer-doc-es/es-mapping")
|
||||
public class EsMappingController {
|
||||
private static Logger logger = LoggerFactory.getLogger(EsMappingController.class);
|
||||
|
||||
// 相关文档地址
|
||||
// https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-get-settings.html
|
||||
// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html
|
||||
|
||||
@Resource
|
||||
ElasticSearchUtil elasticSearchUtil;
|
||||
|
||||
@GetMapping("/mappings")
|
||||
public ResponseJson<Object> mappings() throws IOException {
|
||||
GetMappingsRequest request = new GetMappingsRequest();
|
||||
request.setMasterTimeout(TimeValue.timeValueMinutes(1));
|
||||
|
||||
RestHighLevelClient client = elasticSearchUtil.getEsClient("127.0.0.1:9200", "http");
|
||||
GetMappingsResponse getMappingResponse = client.indices().getMapping(request, RequestOptions.DEFAULT);
|
||||
Map<String, MappingMetaData> allMappings = getMappingResponse.mappings();
|
||||
return DocResponseJson.ok(allMappings);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseJson<Object> list(String keywords) throws IOException {
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.elasticsearch.framework.config;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Configuration
|
||||
@ComponentScan(basePackages = {
|
||||
"com.zyplayer.doc.elasticsearch",
|
||||
})
|
||||
public @interface EnableDocEs {
|
||||
}
|
||||
@@ -116,6 +116,12 @@
|
||||
<artifactId>zyplayer-doc-swagger</artifactId>
|
||||
<version>${zyplayer.doc.version}</version>
|
||||
</dependency>
|
||||
<!--zyplayer-doc-es-->
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-es</artifactId>
|
||||
<version>${zyplayer.doc.version}</version>
|
||||
</dependency>
|
||||
<!--swagger-bootstrap-ui-->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.zyplayer.doc.manage.framework.config;
|
||||
import com.zyplayer.doc.db.framework.configuration.EnableDocDb;
|
||||
import com.zyplayer.doc.db.framework.db.bean.DatabaseRegistrationBean;
|
||||
import com.zyplayer.doc.dubbo.framework.config.EnableDocDubbo;
|
||||
import com.zyplayer.doc.grpc.framework.config.EnableDocGrpc;
|
||||
import com.zyplayer.doc.elasticsearch.framework.config.EnableDocEs;
|
||||
import com.zyplayer.doc.swagger.framework.configuration.EnableDocSwagger;
|
||||
import com.zyplayer.doc.wiki.framework.config.EnableDocWiki;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -25,6 +25,9 @@ public class ZyplayerDocConfig {
|
||||
@EnableDocWiki
|
||||
public class enableDocWiki{}
|
||||
|
||||
@EnableDocEs
|
||||
public class enableDocEs{}
|
||||
|
||||
@EnableDocDubbo
|
||||
public class enableDocDubbo{}
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@ import org.elasticsearch.action.update.UpdateResponse;
|
||||
import org.elasticsearch.client.RequestOptions;
|
||||
import org.elasticsearch.client.RestClient;
|
||||
import org.elasticsearch.client.RestHighLevelClient;
|
||||
import org.elasticsearch.client.indices.GetMappingsRequest;
|
||||
import org.elasticsearch.client.indices.GetMappingsResponse;
|
||||
import org.elasticsearch.cluster.metadata.MappingMetaData;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
@@ -187,6 +190,21 @@ public class TestEsRestController {
|
||||
return DocResponseJson.warn("失败");
|
||||
}
|
||||
|
||||
@GetMapping("/mappings")
|
||||
public ResponseJson<Object> mappings() throws IOException {
|
||||
GetMappingsRequest request = new GetMappingsRequest();
|
||||
// request.indices(ES_INDEX);
|
||||
request.setMasterTimeout(TimeValue.timeValueMinutes(1));
|
||||
GetMappingsResponse getMappingResponse = client.indices().getMapping(request, RequestOptions.DEFAULT);
|
||||
Map<String, MappingMetaData> allMappings = getMappingResponse.mappings();
|
||||
MappingMetaData indexMapping = allMappings.get(ES_INDEX);
|
||||
Map<String, Object> mapping = indexMapping.sourceAsMap();
|
||||
// 相关文档地址
|
||||
// https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-get-settings.html
|
||||
// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html
|
||||
return DocResponseJson.ok(allMappings);
|
||||
}
|
||||
|
||||
@GetMapping("/other")
|
||||
public ResponseJson<Object> other() {
|
||||
return DocResponseJson.ok();
|
||||
|
||||
3
zyplayer-doc-ui/es-ui/.babelrc
Normal file
3
zyplayer-doc-ui/es-ui/.babelrc
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"presets": ["vue-app"]
|
||||
}
|
||||
5
zyplayer-doc-ui/es-ui/.gitignore
vendored
Normal file
5
zyplayer-doc-ui/es-ui/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
dist/
|
||||
npm-debug.log
|
||||
.idea
|
||||
9
zyplayer-doc-ui/es-ui/Makefile
Normal file
9
zyplayer-doc-ui/es-ui/Makefile
Normal file
@@ -0,0 +1,9 @@
|
||||
.PHONY: dist build
|
||||
install:
|
||||
@npm install
|
||||
|
||||
dev: install
|
||||
@npm run dev
|
||||
|
||||
build:
|
||||
@npm run build
|
||||
50
zyplayer-doc-ui/es-ui/README.md
Normal file
50
zyplayer-doc-ui/es-ui/README.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# zyplayer-doc-manage项目的UI
|
||||
|
||||
## 常见问题
|
||||
|
||||
1、命令行要进入这个文件夹才能执行命令:
|
||||
|
||||
zyplayer-doc/zyplayer-doc-ui/manage-ui
|
||||
|
||||
2、增加host,否则run不起来:
|
||||
|
||||
在文件 C:\Windows\System32\drivers\etc\hosts 末尾增加:
|
||||
|
||||
127.0.0.1 local.zyplayer.com
|
||||
|
||||
## 配置文件
|
||||
|
||||
1、这里可以配置接口请求的域名,可使用本地、线上,测试通过后就会打包到zyplayer-doc-wiki项目里面使用
|
||||
|
||||
zyplayer-doc-ui/manage-ui/src/common/config/apimix.js
|
||||
|
||||
2、这里可以配置启动后访问的地址,建议不改
|
||||
|
||||
zyplayer-doc-ui/manage-ui/webpack.config.js
|
||||
|
||||
## 环境要求
|
||||
|
||||
`Node >= 6`
|
||||
|
||||
|
||||
## 开始
|
||||
|
||||
``` bash
|
||||
# 执行下面的命令初始化
|
||||
yarn
|
||||
```
|
||||
|
||||
## 开发环境
|
||||
|
||||
``` bash
|
||||
# 执行下面的命令后即可到 localhost:8010 看到页面
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## 打包
|
||||
|
||||
``` bash
|
||||
# 开发完成后执行打包命令,然后复制dist目录里的文件到zyplayer-doc-manage项目的webjars目录下即可
|
||||
# 打包前记得修改zyplayer-doc-ui/manage-ui/src/common/config/apimix.js里的HOST接口地址
|
||||
npm run build
|
||||
```
|
||||
7697
zyplayer-doc-ui/es-ui/package-lock.json
generated
Normal file
7697
zyplayer-doc-ui/es-ui/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
40
zyplayer-doc-ui/es-ui/package.json
Normal file
40
zyplayer-doc-ui/es-ui/package.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "console-ui",
|
||||
"description": "console-ui",
|
||||
"author": "yi.shyang@ele.me",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "webpack-dev-server --inline --hot --env.dev",
|
||||
"build": "rimraf dist && webpack -p --progress --hide-modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.18.0",
|
||||
"element-ui": "^2.10.0",
|
||||
"vue": "^2.5.16",
|
||||
"vue-axios": "^2.1.4",
|
||||
"vue-router": "^3.0.6",
|
||||
"wangeditor": "^3.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^6.6.0",
|
||||
"babel-core": "^6.24.1",
|
||||
"babel-loader": "^6.4.0",
|
||||
"babel-preset-vue-app": "^1.2.0",
|
||||
"css-loader": "^0.27.0",
|
||||
"file-loader": "^0.10.1",
|
||||
"html-webpack-plugin": "^2.24.1",
|
||||
"postcss-loader": "^1.3.3",
|
||||
"rimraf": "^2.6.3",
|
||||
"style-loader": "^0.13.2",
|
||||
"url-loader": "^0.5.8",
|
||||
"vue-loader": "^13.3.0",
|
||||
"vue-template-compiler": "^2.5.16",
|
||||
"webpack": "^2.4.1",
|
||||
"webpack-dev-server": "^2.4.2",
|
||||
"axios": "^0.18.0",
|
||||
"vue-axios": "^2.1.4"
|
||||
}
|
||||
}
|
||||
5
zyplayer-doc-ui/es-ui/postcss.config.js
Normal file
5
zyplayer-doc-ui/es-ui/postcss.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require('autoprefixer')()
|
||||
]
|
||||
}
|
||||
257
zyplayer-doc-ui/es-ui/src/App.vue
Normal file
257
zyplayer-doc-ui/es-ui/src/App.vue
Normal file
@@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<template v-if="global.fullscreen">
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
<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-submenu index="1">
|
||||
<template slot="title">
|
||||
<i class="el-icon-s-platform"></i>
|
||||
<span slot="title">系统管理</span>
|
||||
</template>
|
||||
<el-menu-item index="/data/datasourceManage"><i class="el-icon-coin"></i>数据源管理</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
<el-tree :props="defaultProps" :data="databaseList" @node-click="handleNodeClick"
|
||||
ref="databaseTree" highlight-current draggable
|
||||
:default-expanded-keys="databaseExpandedKeys"
|
||||
node-key="id" @node-expand="handleNodeExpand"
|
||||
style="background-color: #fafafa;">
|
||||
<span slot-scope="{node, data}">
|
||||
<span v-if="data.needLoad"><i class="el-icon-loading"></i></span>
|
||||
<span v-else>{{node.label}}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-aside>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<span class="header-right-user-name">{{userSelfInfo.userName}}</span>
|
||||
<el-dropdown @command="userSettingDropdown" trigger="click">
|
||||
<i class="el-icon-setting" style="margin-right: 15px; font-size: 16px;cursor: pointer;color: #fff;"> </i>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="console">控制台</el-dropdown-item>
|
||||
<el-dropdown-item command="aboutDoc" divided>关于</el-dropdown-item>
|
||||
<el-dropdown-item command="myInfo">我的资料</el-dropdown-item>
|
||||
<el-dropdown-item command="userSignOut">退出登录</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-header>
|
||||
<el-main style="padding: 0;">
|
||||
<router-view></router-view>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
<!--关于弹窗-->
|
||||
<el-dialog title="关于zyplayer-doc" :visible.sync="aboutDialogVisible" width="600px">
|
||||
<el-form>
|
||||
<el-form-item label="项目地址:">
|
||||
<a target="_blank" href="https://gitee.com/zyplayer/zyplayer-doc">zyplayer-doc</a>
|
||||
</el-form-item>
|
||||
<el-form-item label="开发人员:">
|
||||
<a target="_blank" href="http://zyplayer.com">暮光:城中城</a>
|
||||
</el-form-item>
|
||||
<template v-if="upgradeInfo.lastVersion">
|
||||
<el-form-item label="当前版本:">{{upgradeInfo.nowVersion}}</el-form-item>
|
||||
<el-form-item label="最新版本:">{{upgradeInfo.lastVersion}}</el-form-item>
|
||||
<el-form-item label="升级地址:">
|
||||
<a target="_blank" :href="upgradeInfo.upgradeUrl">{{upgradeInfo.upgradeUrl}}</a>
|
||||
</el-form-item>
|
||||
<el-form-item label="升级内容:">{{upgradeInfo.upgradeContent}}</el-form-item>
|
||||
</template>
|
||||
<el-form-item label="">
|
||||
欢迎加群讨论,QQ群号:466363173,欢迎提交需求,欢迎使用和加入开发!
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import global from './common/config/global'
|
||||
import toast from './common/lib/common/toast'
|
||||
|
||||
var app;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isCollapse: false,
|
||||
aboutDialogVisible: false,
|
||||
userSelfInfo: {},
|
||||
// 数据源相关
|
||||
datasourceOptions: [],
|
||||
datasourceList: [],
|
||||
choiceDatasource: "",
|
||||
defaultProps: {children: 'children', label: 'name'},
|
||||
// 页面展示相关
|
||||
nowDatasourceShow: {},
|
||||
databaseList: [],
|
||||
databaseExpandedKeys: [],
|
||||
// 升级信息
|
||||
upgradeInfo: {},
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
app = this;
|
||||
global.vue.$app = this;
|
||||
this.getSelfUserInfo();
|
||||
this.checkSystemUpgrade();
|
||||
this.loadDatasourceList();
|
||||
},
|
||||
methods: {
|
||||
userSettingDropdown(command) {
|
||||
console.log("command:" + command);
|
||||
if (command == 'userSignOut') {
|
||||
this.userSignOut();
|
||||
} else if (command == 'aboutDoc') {
|
||||
app.aboutDialogVisible = true;
|
||||
} else if (command == 'myInfo') {
|
||||
this.$router.push({path: '/user/myInfo'});
|
||||
} else if (command == 'console') {
|
||||
window.location = this.apilist1.HOST;
|
||||
} else {
|
||||
toast.notOpen();
|
||||
}
|
||||
},
|
||||
userSignOut() {
|
||||
this.common.post(this.apilist1.userLogout, {}, function (json) {
|
||||
location.reload();
|
||||
});
|
||||
},
|
||||
getSelfUserInfo() {
|
||||
this.common.post(this.apilist1.getSelfUserInfo, {}, function (json) {
|
||||
app.userSelfInfo = json.data;
|
||||
});
|
||||
},
|
||||
datasourceChangeEvents() {
|
||||
app.nowDatasourceShow = this.choiceDatasource;
|
||||
app.loadDatabaseList(this.choiceDatasource);
|
||||
},
|
||||
handleNodeClick(node) {
|
||||
console.log("点击节点:", node);
|
||||
if (node.type == 1) {
|
||||
this.nowClickPath = {host: node.host, dbName: node.dbName, tableName: node.tableName};
|
||||
this.$router.push({path: '/table/database', query: this.nowClickPath});
|
||||
} else if (node.type == 2) {
|
||||
this.nowClickPath = {host: node.host, dbName: node.dbName, tableName: node.tableName};
|
||||
this.$router.push({path: '/table/info', query: this.nowClickPath});
|
||||
}
|
||||
},
|
||||
handleNodeExpand(node) {
|
||||
if (node.children.length > 0 && node.children[0].needLoad) {
|
||||
console.log("加载节点:", node);
|
||||
if (node.type == 1) {
|
||||
app.loadGetTableList(node);
|
||||
}
|
||||
}
|
||||
},
|
||||
loadGetTableList(node, callback) {
|
||||
this.common.post(this.apilist1.tableList, {host: node.host, dbName: node.dbName}, function (json) {
|
||||
var pathIndex = [];
|
||||
var result = json.data || [];
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
var item = {
|
||||
id: node.host + "_" + node.dbName + "_" + result[i].tableName, host: node.host,
|
||||
dbName: node.dbName, tableName: result[i].tableName, name: result[i].tableName, type: 2
|
||||
};
|
||||
// item.children = [{label: '', needLoad: true}];// 初始化一个对象,点击展开时重新查询加载
|
||||
pathIndex.push(item);
|
||||
}
|
||||
node.children = pathIndex;
|
||||
if (typeof callback == 'function') {
|
||||
callback(pathIndex);
|
||||
}
|
||||
});
|
||||
},
|
||||
loadDatasourceList() {
|
||||
this.common.post(this.apilist1.datasourceList, {}, function (json) {
|
||||
app.datasourceList = json.data || [];
|
||||
var datasourceOptions = [];
|
||||
for (var i = 0; i < app.datasourceList.length; i++) {
|
||||
datasourceOptions.push({
|
||||
label: app.datasourceList[i], value: app.datasourceList[i]
|
||||
});
|
||||
}
|
||||
app.datasourceOptions = datasourceOptions;
|
||||
});
|
||||
},
|
||||
loadDatabaseList(host, callback) {
|
||||
this.common.post(this.apilist1.databaseList, {host: host}, function (json) {
|
||||
var result = json.data || [];
|
||||
var pathIndex = [];
|
||||
var children = [];
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
var item = {
|
||||
id: host + "_" + result[i].dbName, host: host, dbName: result[i].dbName,
|
||||
name: result[i].dbName, type: 1
|
||||
};
|
||||
item.children = [{label: '', needLoad: true}];// 初始化一个对象,点击展开时重新查询加载
|
||||
children.push(item);
|
||||
}
|
||||
pathIndex.push({id: host, host: host, name: host, children: children});
|
||||
app.databaseList = pathIndex;
|
||||
if (typeof callback == 'function') {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
},
|
||||
initLoadDataList(host, dbName) {
|
||||
if (app.databaseList.length > 0) {
|
||||
return;
|
||||
}
|
||||
this.loadDatabaseList(host, function () {
|
||||
app.databaseExpandedKeys = [host];
|
||||
// 展不开、、
|
||||
// setTimeout(()=> {
|
||||
// var node = app.$refs.databaseTree.getNode(host + "_" + dbName);
|
||||
// if (!!node) {
|
||||
// app.loadGetTableList(node.data, function (children) {
|
||||
// var node = app.$refs.databaseTree.getNode(host + "_" + dbName);
|
||||
// node.childNodes = children;
|
||||
// app.$refs.databaseTree.updateKeyChildren(host + "_" + dbName);
|
||||
// // node.setChildren(node.data);
|
||||
// });
|
||||
// }
|
||||
// }, 500);
|
||||
});
|
||||
},
|
||||
checkSystemUpgrade() {
|
||||
this.common.post(this.apilist1.systemUpgradeInfo, {}, function (json) {
|
||||
if (!!json.data) {
|
||||
app.upgradeInfo = json.data;
|
||||
console.log("zyplayer-doc发现新版本:"
|
||||
+ "\n升级地址:" + json.data.upgradeUrl
|
||||
+ "\n当前版本:" + json.data.nowVersion
|
||||
+ "\n最新版本:" + json.data.lastVersion
|
||||
+ "\n升级内容:" + json.data.upgradeContent
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
#app, .el-container, .el-menu {
|
||||
height: 100%;
|
||||
}
|
||||
.header-right-user-name{color: #fff;padding-right: 5px;}
|
||||
.el-menu-vertical{border-right: 0;background: #fafafa;}
|
||||
.el-menu-vertical .el-menu{background: #fafafa;}
|
||||
.el-header {background-color: #409EFF; color: #333; line-height: 40px; text-align: right;height: 40px !important;}
|
||||
</style>
|
||||
BIN
zyplayer-doc-ui/es-ui/src/assets/img/dubbo.png
Normal file
BIN
zyplayer-doc-ui/es-ui/src/assets/img/dubbo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
28
zyplayer-doc-ui/es-ui/src/common/config/apilist.js
Normal file
28
zyplayer-doc-ui/es-ui/src/common/config/apilist.js
Normal file
@@ -0,0 +1,28 @@
|
||||
var URL = {
|
||||
userLogin: '/login',
|
||||
userLogout: '/logout',
|
||||
getSelfUserInfo: '/user/info/selfInfo',
|
||||
|
||||
datasourceList: '/zyplayer-doc-db/doc-db/getDataSourceList',
|
||||
databaseList: '/zyplayer-doc-db/doc-db/getDatabaseList',
|
||||
tableList: '/zyplayer-doc-db/doc-db/getTableList',
|
||||
tableColumnList: '/zyplayer-doc-db/doc-db/getTableColumnList',
|
||||
tableAndColumnBySearch: '/zyplayer-doc-db/doc-db/getTableAndColumnBySearch',
|
||||
updateTableDesc: '/zyplayer-doc-db/doc-db/updateTableDesc',
|
||||
updateTableColumnDesc: '/zyplayer-doc-db/doc-db/updateTableColumnDesc',
|
||||
|
||||
manageDatasourceList: '/zyplayer-doc-db/datasource/list',
|
||||
manageUpdateDatasource: '/zyplayer-doc-db/datasource/update',
|
||||
|
||||
systemUpgradeInfo: '/system/info/upgrade',
|
||||
};
|
||||
|
||||
var URL1 = {};
|
||||
|
||||
export default {
|
||||
URL, URL1
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
52
zyplayer-doc-ui/es-ui/src/common/config/apimix.js
Normal file
52
zyplayer-doc-ui/es-ui/src/common/config/apimix.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import apilist from './apilist'
|
||||
|
||||
var href = window.location.href;
|
||||
|
||||
var _fn = {
|
||||
href: href,
|
||||
// 本地启动时使用本地接口调试
|
||||
// HOST: 'http://local.zyplayer.com:8083/zyplayer-doc-manage',
|
||||
// HOST1: 'http://local.zyplayer.com:8083/zyplayer-doc-manage',
|
||||
// 也可以直接使用线上的服务调试
|
||||
// HOST: 'http://doc.zyplayer.com/zyplayer-doc-manage',
|
||||
// HOST1: 'http://doc.zyplayer.com/zyplayer-doc-manage',
|
||||
// 打包时使用下面这两行,文件就放在根目录下,所以当前路劲就好
|
||||
HOST: './',
|
||||
HOST1: './',
|
||||
|
||||
mixUrl: function (host, url) {
|
||||
var p;
|
||||
if (!host || !url || _fn.isEmptyObject(url)) {
|
||||
return;
|
||||
}
|
||||
url.HOST = host;
|
||||
for (p in url) {
|
||||
if (url[p].indexOf('http') == -1) {
|
||||
url[p] = host + url[p];
|
||||
}
|
||||
}
|
||||
return url;
|
||||
},
|
||||
//判断是否空对象
|
||||
isEmptyObject: function (obj) { //判断空对象
|
||||
if (typeof obj === "object" && !(obj instanceof Array)) {
|
||||
var hasProp = false;
|
||||
for (var prop in obj) {
|
||||
hasProp = true;
|
||||
break;
|
||||
}
|
||||
if (hasProp) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var apilist1 = _fn.mixUrl(_fn.HOST, apilist.URL);
|
||||
var apilist2 = _fn.mixUrl(_fn.HOST1, apilist.URL1);
|
||||
|
||||
export default {
|
||||
apilist1, apilist2
|
||||
};
|
||||
|
||||
12
zyplayer-doc-ui/es-ui/src/common/config/global.js
Normal file
12
zyplayer-doc-ui/es-ui/src/common/config/global.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const user = {
|
||||
isLogin: true,
|
||||
};
|
||||
const vue = {};
|
||||
const fullscreen = false;
|
||||
|
||||
export default {
|
||||
vue,
|
||||
user,
|
||||
fullscreen,
|
||||
}
|
||||
|
||||
113
zyplayer-doc-ui/es-ui/src/common/lib/common/common.js
Normal file
113
zyplayer-doc-ui/es-ui/src/common/lib/common/common.js
Normal file
@@ -0,0 +1,113 @@
|
||||
import Qs from 'qs'
|
||||
import global from '../../config/global'
|
||||
import apimix from '../../config/apimix'
|
||||
|
||||
export default {
|
||||
data: {
|
||||
accessToken: '',
|
||||
},
|
||||
setAccessToken: function (token) {
|
||||
this.data.accessToken = token;
|
||||
},
|
||||
getAccessToken: function () {
|
||||
if (!this.data.accessToken) {
|
||||
var arr, reg = new RegExp("(^| )accessToken=([^;]*)(;|$)");
|
||||
if (arr = document.cookie.match(reg)) {
|
||||
this.data.accessToken = unescape(arr[2]);
|
||||
}
|
||||
}
|
||||
return this.data.accessToken;
|
||||
},
|
||||
validateResult: function (res, callback) {
|
||||
if (!!res.message) {
|
||||
global.vue.$message('请求错误:' + res.message);
|
||||
} else if (res.data.errCode == 400) {
|
||||
global.vue.$message('请先登录');
|
||||
var href = encodeURIComponent(window.location.href);
|
||||
// if (global.vue.$router.currentRoute.path != '/user/login') {
|
||||
// global.vue.$router.push({path: '/user/login', query: {redirect: href}});
|
||||
// }
|
||||
window.location = apimix.apilist1.HOST + "#/user/login?redirect=" + href;
|
||||
} else if (res.data.errCode == 402) {
|
||||
global.vue.$router.push("/common/noAuth");
|
||||
} else if (res.data.errCode !== 200) {
|
||||
global.vue.$message(res.data.errMsg || "未知错误");
|
||||
} else {
|
||||
if (typeof callback == 'function') {
|
||||
callback(res.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
post: function (url, param, callback) {
|
||||
param = param || {};
|
||||
param.accessToken = this.getAccessToken();
|
||||
global.vue.axios({
|
||||
method: "post",
|
||||
url: url,
|
||||
headers: {'Content-type': 'application/x-www-form-urlencoded'},
|
||||
data: Qs.stringify(param),
|
||||
withCredentials: true,
|
||||
}).then((res) => {
|
||||
console.log("ok", res);
|
||||
this.validateResult(res, callback);
|
||||
}).catch((res) => {
|
||||
console.log("error", res);
|
||||
this.validateResult(res);
|
||||
});
|
||||
},
|
||||
postNonCheck: function (url, param, callback) {
|
||||
param = param || {};
|
||||
param.accessToken = this.getAccessToken();
|
||||
global.vue.axios({
|
||||
method: "post",
|
||||
url: url,
|
||||
headers: {'Content-type': 'application/x-www-form-urlencoded'},
|
||||
data: Qs.stringify(param),
|
||||
withCredentials: true,
|
||||
}).then((res) => {
|
||||
console.log("ok", res);
|
||||
if (typeof callback == 'function') {
|
||||
callback(res.data);
|
||||
}
|
||||
}).catch((res) => {
|
||||
console.log("error", res);
|
||||
if (typeof callback == 'function') {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 返回不为空的字符串,为空返回def
|
||||
*/
|
||||
getNotEmptyStr(str, def) {
|
||||
if (isEmpty(str)) {
|
||||
return isEmpty(def) ? "" : def;
|
||||
}
|
||||
return str;
|
||||
},
|
||||
/**
|
||||
* 是否是空对象
|
||||
* @param obj
|
||||
* @returns
|
||||
*/
|
||||
isEmptyObject(obj) {
|
||||
return isEmpty(obj) || $.isEmptyObject(obj);
|
||||
},
|
||||
/**
|
||||
* 是否是空字符串
|
||||
* @param str
|
||||
* @returns
|
||||
*/
|
||||
isEmpty(str) {
|
||||
return (str == "" || str == null || str == undefined);
|
||||
},
|
||||
/**
|
||||
* 是否不是空字符串
|
||||
* @param str
|
||||
* @returns
|
||||
*/
|
||||
isNotEmpty(str) {
|
||||
return !isEmpty(str);
|
||||
},
|
||||
}
|
||||
|
||||
40
zyplayer-doc-ui/es-ui/src/common/lib/common/toast.js
Normal file
40
zyplayer-doc-ui/es-ui/src/common/lib/common/toast.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import global from '../../config/global'
|
||||
|
||||
/**
|
||||
* 提示工具类
|
||||
* @author
|
||||
* @since 2017年5月7日
|
||||
*/
|
||||
export default {
|
||||
notOpen: function () {
|
||||
global.vue.$message({
|
||||
message: '该功能暂未开放,敬请期待!',
|
||||
type: 'warning',
|
||||
showClose: true
|
||||
});
|
||||
},
|
||||
success: function (msg, time) {
|
||||
global.vue.$message({
|
||||
message: msg,
|
||||
duration: time || 3000,
|
||||
type: 'success',
|
||||
showClose: true
|
||||
});
|
||||
},
|
||||
warn: function (msg, time) {
|
||||
global.vue.$message({
|
||||
message: msg,
|
||||
duration: time || 3000,
|
||||
type: 'warning',
|
||||
showClose: true
|
||||
});
|
||||
},
|
||||
error: function (msg, time) {
|
||||
global.vue.$message({
|
||||
message: msg,
|
||||
duration: time || 3000,
|
||||
type: 'error',
|
||||
showClose: true
|
||||
});
|
||||
},
|
||||
};
|
||||
4
zyplayer-doc-ui/es-ui/src/common/lib/jquery/jquery-3.1.0.min.js
vendored
Normal file
4
zyplayer-doc-ui/es-ui/src/common/lib/jquery/jquery-3.1.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
zyplayer-doc-ui/es-ui/src/common/lib/jquery/qrcode.min.js
vendored
Normal file
1
zyplayer-doc-ui/es-ui/src/common/lib/jquery/qrcode.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
14
zyplayer-doc-ui/es-ui/src/doc-es.html
Normal file
14
zyplayer-doc-ui/es-ui/src/doc-es.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>数据库文档管理</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
14
zyplayer-doc-ui/es-ui/src/index.html
Normal file
14
zyplayer-doc-ui/es-ui/src/index.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>数据库文档管理</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
59
zyplayer-doc-ui/es-ui/src/main.js
Normal file
59
zyplayer-doc-ui/es-ui/src/main.js
Normal file
@@ -0,0 +1,59 @@
|
||||
import Vue from 'vue'
|
||||
import ElementUI from 'element-ui'
|
||||
import 'element-ui/lib/theme-chalk/index.css'
|
||||
import App from './App.vue'
|
||||
|
||||
import global from './common/config/global'
|
||||
import apimix from './common/config/apimix'
|
||||
import common from './common/lib/common/common'
|
||||
import toast from './common/lib/common/toast'
|
||||
|
||||
import VueRouter from 'vue-router'
|
||||
import routes from './routes'
|
||||
import axios from 'axios'
|
||||
import VueAxios from 'vue-axios'
|
||||
|
||||
Vue.use(ElementUI);
|
||||
Vue.use(VueRouter);
|
||||
Vue.use(VueAxios, axios);
|
||||
|
||||
// 全局参数
|
||||
Vue.prototype.global = global;
|
||||
// 接口列表
|
||||
Vue.prototype.apilist1 = apimix.apilist1;
|
||||
Vue.prototype.apilist2 = apimix.apilist1;
|
||||
// 公用方法
|
||||
Vue.prototype.common = common;
|
||||
Vue.prototype.toast = toast;
|
||||
|
||||
const router = new VueRouter({routes});
|
||||
// 路由跳转时判断处理
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.meta.title) {
|
||||
document.title = to.meta.title
|
||||
}
|
||||
global.fullscreen = !!to.meta.fullscreen;
|
||||
/* 判断该路由是否需要登录权限 */
|
||||
if (to.matched.some(record => record.meta.requireAuth)) {
|
||||
if (global.user.isLogin) {
|
||||
next();
|
||||
} else {
|
||||
next({path: '/login'});
|
||||
}
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
render(h) {
|
||||
var app = h(App);
|
||||
global.vue = app.context;
|
||||
return app;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
60
zyplayer-doc-ui/es-ui/src/routes.js
Normal file
60
zyplayer-doc-ui/es-ui/src/routes.js
Normal file
@@ -0,0 +1,60 @@
|
||||
import Home from './views/home/Home.vue'
|
||||
|
||||
import UserLogin from './views/user/Login.vue'
|
||||
import UserMyInfo from './views/user/MyInfo.vue'
|
||||
import UserRouterView from './views/user/RouterView.vue'
|
||||
|
||||
import TableInfo from './views/table/Info.vue'
|
||||
import TableDatabase from './views/table/Database.vue'
|
||||
import TableRouterView from './views/table/RouterView.vue'
|
||||
|
||||
import DataDatasourceManage from './views/data/DatasourceManage.vue'
|
||||
import DataRouterView from './views/data/RouterView.vue'
|
||||
|
||||
import CommonNoAuth from './views/common/NoAuth.vue'
|
||||
|
||||
let routes = [
|
||||
{
|
||||
path: '/home',
|
||||
component: Home,
|
||||
name: '主页',
|
||||
meta: {
|
||||
requireAuth: true,
|
||||
}
|
||||
}, {
|
||||
path: '/user',
|
||||
name: '用户管理',
|
||||
component: UserRouterView,
|
||||
children: [
|
||||
{path: 'login', name: '系统登录',component: UserLogin, meta: {fullscreen: true}},
|
||||
{path: 'myInfo', name: '我的信息',component: UserMyInfo},
|
||||
]
|
||||
}, {
|
||||
path: '/table',
|
||||
name: '表信息',
|
||||
component: TableRouterView,
|
||||
children: [
|
||||
{path: 'info', name: '表信息',component: TableInfo},
|
||||
{path: 'database', name: '库信息',component: TableDatabase},
|
||||
]
|
||||
}, {
|
||||
path: '/data',
|
||||
name: '数据信息',
|
||||
component: DataRouterView,
|
||||
children: [
|
||||
{path: 'datasourceManage', name: '数据源管理',component: DataDatasourceManage},
|
||||
]
|
||||
}, {
|
||||
path: '/common',
|
||||
name: '',
|
||||
component: UserRouterView,
|
||||
children: [
|
||||
{path: 'noAuth', name: '没有权限',component: CommonNoAuth},
|
||||
]
|
||||
}, {
|
||||
path: '/',
|
||||
redirect: '/home'
|
||||
}
|
||||
];
|
||||
|
||||
export default routes;
|
||||
2
zyplayer-doc-ui/es-ui/src/vendor.js
Normal file
2
zyplayer-doc-ui/es-ui/src/vendor.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import Vue from 'vue'
|
||||
import ElementUI from 'element-ui'
|
||||
18
zyplayer-doc-ui/es-ui/src/views/common/NoAuth.vue
Normal file
18
zyplayer-doc-ui/es-ui/src/views/common/NoAuth.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<div>没有权限访问该模块</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
mounted: function () {
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
118
zyplayer-doc-ui/es-ui/src/views/data/DatasourceManage.vue
Normal file
118
zyplayer-doc-ui/es-ui/src/views/data/DatasourceManage.vue
Normal file
@@ -0,0 +1,118 @@
|
||||
<template>
|
||||
<div style="padding: 10px;">
|
||||
<div style="max-width: 1200px;margin: 20px auto;">
|
||||
<el-card style="margin: 10px;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>数据源管理</span>
|
||||
<el-button style="float: right;margin-left: 5px;" :loading="loadDataListLoading" v-on:click="getDatasourceList" plain icon="el-icon-refresh" size="small">刷新</el-button>
|
||||
<el-button style="float: right;" v-on:click="addDatasource" type="primary" icon="el-icon-circle-plus-outline" size="small">新增</el-button>
|
||||
</div>
|
||||
<el-table :data="datasourceList" stripe border style="width: 100%; margin-bottom: 5px;">
|
||||
<el-table-column prop="driverClassName" label="驱动类" width="200"></el-table-column>
|
||||
<el-table-column prop="sourceUrl" label="数据源URL"></el-table-column>
|
||||
<el-table-column prop="sourceName" label="账号"></el-table-column>
|
||||
<el-table-column prop="sourcePassword" label="密码"></el-table-column>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-on:click="editDatasource(scope.row)" type="primary" size="small">修改</el-button>
|
||||
<el-button v-on:click="deleteDatasource(scope.row)" type="danger" size="small">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
<!--增加数据源弹窗-->
|
||||
<el-dialog :inline="true" :title="newDatasource.id>0?'编辑数据源':'新增数据源'" :visible.sync="datasourceDialogVisible" width="600px">
|
||||
<el-alert
|
||||
title="重要提醒"
|
||||
description="请录入正确可用的数据库连接、账号、密码信息,否则初始化数据源失败将影响整个系统,有可能需要重启服务才能解决"
|
||||
type="warning" :closable="false"
|
||||
show-icon style="margin-bottom: 10px;">
|
||||
</el-alert>
|
||||
<el-form label-width="120px">
|
||||
<el-form-item label="驱动类:">
|
||||
<el-select v-model="newDatasource.driverClassName" placeholder="驱动类" style="width: 100%">
|
||||
<el-option label="com.mysql.jdbc.Driver" value="com.mysql.jdbc.Driver"></el-option>
|
||||
<el-option label="net.sourceforge.jtds.jdbc.Driver" value="net.sourceforge.jtds.jdbc.Driver"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据源URL:">
|
||||
<el-input v-model="newDatasource.sourceUrl" placeholder="数据源URL"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="账号:">
|
||||
<el-input v-model="newDatasource.sourceName" placeholder="账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码:">
|
||||
<el-input v-model="newDatasource.sourcePassword" placeholder="密码"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" style="text-align: center;">
|
||||
<el-button v-on:click="saveDatasource" type="primary">保存</el-button>
|
||||
<el-button v-on:click="datasourceDialogVisible=false" plain>取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import toast from '../../common/lib/common/toast'
|
||||
import global from '../../common/config/global'
|
||||
|
||||
var app;
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loadDataListLoading: false,
|
||||
datasourceDialogVisible: false,
|
||||
datasourceList: [],
|
||||
newDatasource: {},
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
app = this;
|
||||
this.getDatasourceList();
|
||||
},
|
||||
methods: {
|
||||
addDatasource() {
|
||||
this.datasourceDialogVisible = true;
|
||||
this.newDatasource = {driverClassName: "", sourceUrl: "", sourceName: "", sourcePassword: ""};
|
||||
},
|
||||
editDatasource(row) {
|
||||
this.newDatasource = row;
|
||||
this.datasourceDialogVisible = true;
|
||||
},
|
||||
deleteDatasource(row) {
|
||||
this.$confirm('确定要删除此数据源吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
row.yn = 0;
|
||||
this.common.post(this.apilist1.manageUpdateDatasource, row, function (json) {
|
||||
app.$message.success("删除成功!");
|
||||
app.getDatasourceList();
|
||||
});
|
||||
}).catch(()=>{});
|
||||
},
|
||||
saveDatasource() {
|
||||
this.datasourceDialogVisible = false;
|
||||
this.common.post(this.apilist1.manageUpdateDatasource, this.newDatasource, function (json) {
|
||||
app.$message.success("保存成功!");
|
||||
app.getDatasourceList();
|
||||
});
|
||||
},
|
||||
getDatasourceList() {
|
||||
this.loadDataListLoading = true;
|
||||
this.common.post(this.apilist1.manageDatasourceList, {}, function (json) {
|
||||
app.datasourceList = json.data || [];
|
||||
setTimeout(()=>{app.loadDataListLoading = false;}, 800);
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
4
zyplayer-doc-ui/es-ui/src/views/data/RouterView.vue
Normal file
4
zyplayer-doc-ui/es-ui/src/views/data/RouterView.vue
Normal file
@@ -0,0 +1,4 @@
|
||||
<template>
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
|
||||
30
zyplayer-doc-ui/es-ui/src/views/home/Home.vue
Normal file
30
zyplayer-doc-ui/es-ui/src/views/home/Home.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div style="padding: 10px;">
|
||||
<div style="max-width: 1200px;margin: 20px auto;">
|
||||
<div style="text-align: center;">欢迎使用ヾ(๑╹◡╹)ノ" - 在左上角选择一个数据源吧~</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import toast from '../../common/lib/common/toast'
|
||||
import global from '../../common/config/global'
|
||||
|
||||
var app;
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
app = this;
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
72
zyplayer-doc-ui/es-ui/src/views/table/Database.vue
Normal file
72
zyplayer-doc-ui/es-ui/src/views/table/Database.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<div class="table-database-vue">
|
||||
<el-card style="margin: 10px;" shadow="never">
|
||||
<div slot="header" class="clearfix">库信息</div>
|
||||
<el-form label-width="100px">
|
||||
<el-form-item label="数据源:">{{vueQueryParam.host}}</el-form-item>
|
||||
<el-form-item label="数据库:">{{vueQueryParam.dbName}}</el-form-item>
|
||||
</el-form>
|
||||
<el-form :inline="true" label-width="100px">
|
||||
<el-form-item label="关键字:">
|
||||
<el-input v-model="keyword" placeholder="输入字段名或注释搜索相关的表或字段信息" style="width: 500px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button class="search-submit" type="primary" icon="el-icon-search" @click="searchSubmit">模糊搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div style="padding: 10px;" v-loading="columnListLoading">
|
||||
<el-table :data="columnList" stripe border style="width: 100%; margin-bottom: 5px;">
|
||||
<el-table-column prop="tableName" label="表名" width="200"></el-table-column>
|
||||
<el-table-column prop="columnName" label="字段名" width="200"></el-table-column>
|
||||
<el-table-column prop="description" label="注释"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import global from '../../common/config/global'
|
||||
var app;
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
columnListLoading: false,
|
||||
vueQueryParam: {},
|
||||
columnList: [],
|
||||
tableInfo: [],
|
||||
keyword: '',
|
||||
};
|
||||
},
|
||||
beforeRouteUpdate(to, from, next) {
|
||||
this.initQueryParam(to);
|
||||
next();
|
||||
},
|
||||
mounted: function () {
|
||||
app = this;
|
||||
this.initQueryParam(this.$route);
|
||||
// 延迟设置展开的目录,edit比app先初始化
|
||||
setTimeout(function () {
|
||||
global.vue.$app.initLoadDataList(app.vueQueryParam.host, app.vueQueryParam.dbName);
|
||||
}, 500);
|
||||
},
|
||||
methods: {
|
||||
initQueryParam(to) {
|
||||
this.vueQueryParam = to.query;
|
||||
},
|
||||
searchSubmit() {
|
||||
this.columnListLoading = true;
|
||||
this.vueQueryParam.searchText = this.keyword;
|
||||
this.common.post(this.apilist1.tableAndColumnBySearch, this.vueQueryParam, function (json) {
|
||||
app.columnList = json.data || [];
|
||||
app.columnListLoading = false;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.table-database-vue .el-table td, .table-database-vue .el-table th{padding: 5px 0;}
|
||||
</style>
|
||||
|
||||
128
zyplayer-doc-ui/es-ui/src/views/table/Info.vue
Normal file
128
zyplayer-doc-ui/es-ui/src/views/table/Info.vue
Normal file
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<div class="table-info-vue">
|
||||
<el-card style="margin: 10px;">
|
||||
<div slot="header" class="clearfix">表信息</div>
|
||||
<el-form label-width="100px">
|
||||
<el-form-item label="数据源:">{{vueQueryParam.host}}</el-form-item>
|
||||
<el-form-item label="数据库:">{{vueQueryParam.dbName}}</el-form-item>
|
||||
<el-form-item label="数据表:">{{vueQueryParam.tableName}}</el-form-item>
|
||||
<el-form-item label="表注释:">
|
||||
<span v-if="tableInfo.inEdit == 1" @keyup.enter="saveTableDescription">
|
||||
<el-input v-model="tableInfo.newDesc" placeholder="输入表注释" v-on:blur="saveTableDescription" style="width: 500px;"></el-input>
|
||||
</span>
|
||||
<span v-else>{{tableInfo.description || '暂无注释'}} <i class="el-icon-edit edit-table-desc" v-on:click="tableInfo.inEdit = 1"></i></span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card style="margin: 10px;">
|
||||
<div slot="header" class="clearfix">字段信息</div>
|
||||
<div style="padding: 10px;" v-loading="columnListLoading">
|
||||
<el-table :data="columnList" stripe border style="width: 100%; margin-bottom: 5px;">
|
||||
<el-table-column prop="name" label="字段名" width="200"></el-table-column>
|
||||
<el-table-column label="自增" width="50">
|
||||
<template slot-scope="scope">{{scope.row.isidentity ? '是' : '否'}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="类型" width="150"></el-table-column>
|
||||
<el-table-column prop="length" label="长度" width="80"></el-table-column>
|
||||
<el-table-column label="NULL" width="60">
|
||||
<template slot-scope="scope">{{scope.row.nullable ? '允许' : '不允许'}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主键" width="50">
|
||||
<template slot-scope="scope">{{scope.row.ispramary ? '是' : '否'}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="注释">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.inEdit == 1" @keyup.enter="saveColumnDescription(scope.row)">
|
||||
<el-input v-model="scope.row.newDesc" placeholder="输入字段注释" v-on:blur="saveColumnDescription(scope.row)"></el-input>
|
||||
</div>
|
||||
<div v-else class="description" v-on:click="descBoxClick(scope.row)">{{scope.row.description}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import global from '../../common/config/global'
|
||||
var app;
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
columnListLoading: false,
|
||||
vueQueryParam: {},
|
||||
columnList: [],
|
||||
tableInfo: [],
|
||||
};
|
||||
},
|
||||
beforeRouteUpdate(to, from, next) {
|
||||
this.initQueryParam(to);
|
||||
next();
|
||||
},
|
||||
mounted: function () {
|
||||
app = this;
|
||||
this.initQueryParam(this.$route);
|
||||
// 延迟设置展开的目录,edit比app先初始化
|
||||
setTimeout(function () {
|
||||
global.vue.$app.initLoadDataList(app.vueQueryParam.host, app.vueQueryParam.dbName);
|
||||
}, 500);
|
||||
},
|
||||
methods: {
|
||||
initQueryParam(to) {
|
||||
this.columnListLoading = true;
|
||||
this.vueQueryParam = to.query;
|
||||
this.common.post(this.apilist1.tableColumnList, this.vueQueryParam, function (json) {
|
||||
var columnList = json.data.columnList || [];
|
||||
for (var i = 0; i < columnList.length; i++) {
|
||||
columnList[i].inEdit = 0;
|
||||
columnList[i].newDesc = columnList[i].description;
|
||||
}
|
||||
app.columnList = columnList;
|
||||
var tableInfo = json.data.tableInfo || {};
|
||||
tableInfo.inEdit = 0;
|
||||
tableInfo.newDesc = tableInfo.description;
|
||||
app.tableInfo = tableInfo;
|
||||
app.columnListLoading = false;
|
||||
});
|
||||
},
|
||||
descBoxClick(row) {
|
||||
// row.newDesc = row.description;
|
||||
row.inEdit = 1;
|
||||
},
|
||||
saveColumnDescription(row) {
|
||||
if (row.inEdit == 0 || row.description == row.newDesc) {
|
||||
row.inEdit = 0;
|
||||
return;
|
||||
}
|
||||
row.inEdit = 0;
|
||||
this.vueQueryParam.columnName = row.name;
|
||||
this.vueQueryParam.newDesc = row.newDesc;
|
||||
this.common.post(this.apilist1.updateTableColumnDesc, this.vueQueryParam, function (json) {
|
||||
row.description = row.newDesc;
|
||||
app.$message.success("修改成功");
|
||||
});
|
||||
},
|
||||
saveTableDescription() {
|
||||
if (this.tableInfo.inEdit == 0 || this.tableInfo.description == this.tableInfo.newDesc) {
|
||||
this.tableInfo.inEdit = 0;
|
||||
return;
|
||||
}
|
||||
this.tableInfo.inEdit = 0;
|
||||
this.vueQueryParam.newDesc = this.tableInfo.newDesc;
|
||||
this.common.post(this.apilist1.updateTableDesc, this.vueQueryParam, function (json) {
|
||||
app.tableInfo.description = app.tableInfo.newDesc;
|
||||
app.$message.success("修改成功");
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.table-info-vue .el-form-item{margin-bottom: 5px;}
|
||||
.table-info-vue .edit-table-desc{cursor: pointer; color: #409EFF;}
|
||||
.table-info-vue .description{cursor: pointer;}
|
||||
.table-info-vue .el-table td, .table-info-vue .el-table th{padding: 5px 0;}
|
||||
</style>
|
||||
|
||||
4
zyplayer-doc-ui/es-ui/src/views/table/RouterView.vue
Normal file
4
zyplayer-doc-ui/es-ui/src/views/table/RouterView.vue
Normal file
@@ -0,0 +1,4 @@
|
||||
<template>
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
|
||||
88
zyplayer-doc-ui/es-ui/src/views/user/Login.vue
Normal file
88
zyplayer-doc-ui/es-ui/src/views/user/Login.vue
Normal file
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<div style="padding-top: 50px;" @keyup.enter="loginSubmit">
|
||||
<el-form :model="loginParam" :rules="loginRules" ref="loginParam" label-position="left" label-width="0px"
|
||||
class="demo-ruleForm login-container">
|
||||
<h3 class="title">系统登录</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input type="text" v-model="loginParam.username" auto-complete="off" placeholder="账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input type="password" v-model="loginParam.password" auto-complete="off" placeholder="密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="width:100%;">
|
||||
<el-button type="primary" style="width:100%;" @click.native.prevent="loginSubmit" :loading="logining">登录
|
||||
</el-button>
|
||||
<!--<el-button @click.native.prevent="handleReset2">重置</el-button>-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
logining: false,
|
||||
redirect: '',
|
||||
loginParam: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
loginRules: {
|
||||
username: [
|
||||
{required: true, message: '请输入账号', trigger: 'blur'},
|
||||
],
|
||||
password: [
|
||||
{required: true, message: '请输入密码', trigger: 'blur'},
|
||||
]
|
||||
},
|
||||
checked: true
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
this.redirect = this.$route.query.redirect;
|
||||
},
|
||||
methods: {
|
||||
loginSubmit() {
|
||||
var that = this;
|
||||
this.$refs.loginParam.validate((valid) => {
|
||||
if (!valid) return;
|
||||
that.common.post(that.apilist1.userLogin, that.loginParam, function (json) {
|
||||
if(!!that.redirect) {
|
||||
location.href = decodeURIComponent(that.redirect);
|
||||
} else {
|
||||
that.$router.back();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.login-container {
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
background-clip: padding-box;
|
||||
margin: 0 auto;
|
||||
width: 350px;
|
||||
padding: 35px 35px 15px 35px;
|
||||
background: #fff;
|
||||
border: 1px solid #eaeaea;
|
||||
box-shadow: 0 0 25px #cac6c6;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0px auto 40px auto;
|
||||
text-align: center;
|
||||
color: #505458;
|
||||
}
|
||||
|
||||
.remember {
|
||||
margin: 0px 0px 35px 0px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
49
zyplayer-doc-ui/es-ui/src/views/user/MyInfo.vue
Normal file
49
zyplayer-doc-ui/es-ui/src/views/user/MyInfo.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<div class="my-info-vue">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right" style="padding: 20px 10px;">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>我的信息</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div style="margin: 0 auto;max-width: 1000px;">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">我的信息</div>
|
||||
<el-form class="search-form-box" label-width="100px">
|
||||
<el-form-item label="账号:">{{userInfo.userNo}}</el-form-item>
|
||||
<el-form-item label="用户名:">{{userInfo.userName}}</el-form-item>
|
||||
<el-form-item label="手机号:">{{userInfo.phone}}</el-form-item>
|
||||
<el-form-item label="邮箱:">{{userInfo.email}}</el-form-item>
|
||||
<el-form-item label="状态:">{{userInfo.delFlag==0?'正常':'停用'}}</el-form-item>
|
||||
<el-form-item label="性别:">{{userInfo.sex==0?'女':'男'}}</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var app;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userInfo: {}
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
app = this;
|
||||
this.getUserInfo();
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
this.common.post(this.apilist1.getSelfUserInfo, this.searchParam, function (json) {
|
||||
app.userInfo = json.data;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.my-info-vue{}
|
||||
.my-info-vue .box-card{margin: 10px;}
|
||||
</style>
|
||||
|
||||
4
zyplayer-doc-ui/es-ui/src/views/user/RouterView.vue
Normal file
4
zyplayer-doc-ui/es-ui/src/views/user/RouterView.vue
Normal file
@@ -0,0 +1,4 @@
|
||||
<template>
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
|
||||
75
zyplayer-doc-ui/es-ui/webpack.config.js
Normal file
75
zyplayer-doc-ui/es-ui/webpack.config.js
Normal file
@@ -0,0 +1,75 @@
|
||||
const resolve = require('path').resolve;
|
||||
const webpack = require('webpack');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const url = require('url');
|
||||
const publicPath = '';
|
||||
|
||||
module.exports = (options = {}) => ({
|
||||
entry: {
|
||||
vendor: './src/vendor',
|
||||
index: './src/main.js'
|
||||
},
|
||||
output: {
|
||||
path: resolve(__dirname, 'dist'),
|
||||
filename: options.dev ? '[name].js' : 'doc-es-[name].js?[chunkhash]',
|
||||
chunkFilename: '[id].js?[chunkhash]',
|
||||
publicPath: options.dev ? '/assets/' : publicPath
|
||||
},
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.vue$/,
|
||||
use: ['vue-loader']
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
use: ['babel-loader'],
|
||||
exclude: /node_modules/
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ['style-loader', 'css-loader', 'postcss-loader']
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpg|jpeg|gif|eot|ttf|woff|woff2|svg|svgz)(\?.+)?$/,
|
||||
use: [{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 800000
|
||||
}
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
names: ['vendor', 'manifest']
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: options.dev ? 'src/index.html':'src/doc-es.html',
|
||||
filename: options.dev ? 'index.html':'doc-es.html',
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'~': resolve(__dirname, 'src')
|
||||
},
|
||||
extensions: ['.js', '.vue', '.json', '.css']
|
||||
},
|
||||
devServer: {
|
||||
host: 'local.zyplayer.com',
|
||||
port: 8010,
|
||||
proxy: {
|
||||
'/api/': {
|
||||
target: 'http://local.zyplayer.com:8080',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/api': ''
|
||||
}
|
||||
}
|
||||
},
|
||||
historyApiFallback: {
|
||||
index: url.parse(options.dev ? '/assets/' : publicPath).pathname
|
||||
}
|
||||
},
|
||||
devtool: options.dev ? '#eval-source-map' : '#source-map'
|
||||
});
|
||||
4078
zyplayer-doc-ui/es-ui/yarn.lock
Normal file
4078
zyplayer-doc-ui/es-ui/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user