Compare commits
17 Commits
chenzihao-
...
ca_router
Author | SHA1 | Date | |
---|---|---|---|
![]() |
acdff7a6b7 | ||
![]() |
7355312bb9 | ||
![]() |
a988640126 | ||
![]() |
fd2a6fa329 | ||
![]() |
63dddd09bb | ||
![]() |
9de067b234 | ||
![]() |
e116552b90 | ||
![]() |
de36f8ffce | ||
0af6901d0d | |||
b539e95ed1 | |||
![]() |
7a2ac63e78 | ||
![]() |
589d916d91 | ||
![]() |
26b0c8d585 | ||
![]() |
07ed193c7d | ||
![]() |
cec4b26323 | ||
79d27f6986 | |||
9e2f59a048 |
1
pom.xml
1
pom.xml
@ -28,6 +28,7 @@
|
|||||||
<velocity.version>2.3</velocity.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
<jwt.version>0.9.1</jwt.version>
|
<jwt.version>0.9.1</jwt.version>
|
||||||
<hutool.version>5.8.22</hutool.version>
|
<hutool.version>5.8.22</hutool.version>
|
||||||
|
<pagehelper.boot.version>1.4.6</pagehelper.boot.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 依赖声明 -->
|
<!-- 依赖声明 -->
|
||||||
|
@ -151,4 +151,5 @@ sac:
|
|||||||
# port: 5566
|
# port: 5566
|
||||||
host: 192.168.1.23
|
host: 192.168.1.23
|
||||||
port: 1775
|
port: 1775
|
||||||
|
url_pre: /gateway
|
||||||
|
|
||||||
|
@ -26,6 +26,12 @@
|
|||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
<version>1.4</version>
|
<version>1.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- pagehelper 分页插件 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.pagehelper</groupId>
|
||||||
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
|
<version>${pagehelper.boot.version}</version>
|
||||||
|
</dependency>
|
||||||
<!-- Spring框架基本的核心工具 -->
|
<!-- Spring框架基本的核心工具 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
@ -44,10 +50,16 @@
|
|||||||
<artifactId>spring-boot-starter-security</artifactId>
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.pagehelper</groupId>
|
||||||
|
<artifactId>pagehelper</artifactId>
|
||||||
|
<version>5.1.9</version>
|
||||||
|
</dependency>
|
||||||
<!-- pagehelper 分页插件 -->
|
<!-- pagehelper 分页插件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.pagehelper</groupId>
|
<groupId>com.github.pagehelper</groupId>
|
||||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
|
<version>${pagehelper.boot.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 自定义验证注解 -->
|
<!-- 自定义验证注解 -->
|
||||||
|
@ -77,13 +77,33 @@
|
|||||||
<groupId>io.springfox</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
<artifactId>springfox-boot-starter</artifactId>
|
<artifactId>springfox-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis</artifactId>
|
||||||
|
<version>3.5.16</version>
|
||||||
|
</dependency>
|
||||||
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-models</artifactId>
|
<artifactId>swagger-models</artifactId>
|
||||||
<version>1.6.2</version>
|
<version>1.6.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.pagehelper</groupId>
|
||||||
|
<artifactId>pagehelper</artifactId>
|
||||||
|
<version>5.1.9</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis-spring</artifactId>
|
||||||
|
<version>2.1.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
|
<artifactId>mybatis-spring-boot-autoconfigure</artifactId>
|
||||||
|
<version>2.3.2</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -78,20 +78,20 @@ public class ApijsonInitUtil {
|
|||||||
GenTableColumnServiceImpl genTableColumnService = SpringUtils.getBean("genTableColumnServiceImpl", GenTableColumnServiceImpl.class);
|
GenTableColumnServiceImpl genTableColumnService = SpringUtils.getBean("genTableColumnServiceImpl", GenTableColumnServiceImpl.class);
|
||||||
|
|
||||||
int pageNum = 1;
|
int pageNum = 1;
|
||||||
while (true) {
|
// while (true) {
|
||||||
PageHelper.startPage(pageNum, 50, "table_id");
|
// PageHelper.startPage(pageNum, 50, "table_id");
|
||||||
GenTable genTableSearch = new GenTable();
|
// GenTable genTableSearch = new GenTable();
|
||||||
List<GenTable> list = genTableService.selectGenTableList(genTableSearch);
|
// List<GenTable> list = genTableService.selectGenTableList(genTableSearch);
|
||||||
if (list.size() == 0) {
|
// if (list.size() == 0) {
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
for (GenTable genTable : list) {
|
// for (GenTable genTable : list) {
|
||||||
// 查询表字段
|
// // 查询表字段
|
||||||
List<GenTableColumn> listColumn = genTableColumnService.selectGenTableColumnListByTableId(genTable.getTableId());
|
// List<GenTableColumn> listColumn = genTableColumnService.selectGenTableColumnListByTableId(genTable.getTableId());
|
||||||
initConfigTableUserId(genTable.getTableName(), genTable.getUserId() , listColumn);
|
// initConfigTableUserId(genTable.getTableName(), genTable.getUserId() , listColumn);
|
||||||
}
|
// }
|
||||||
pageNum++;
|
// pageNum++;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void deleteTablePkConfig(String tableName) {
|
public static void deleteTablePkConfig(String tableName) {
|
||||||
|
@ -47,6 +47,9 @@ public class GatewayConfigServiceImpl implements IGatewayConfigService {
|
|||||||
@Value("${sac.gateway.port:5566}")
|
@Value("${sac.gateway.port:5566}")
|
||||||
private Integer sacGatewayPort;
|
private Integer sacGatewayPort;
|
||||||
|
|
||||||
|
@Value("${sac.gateway.url_pre:}")
|
||||||
|
private String urlPre;
|
||||||
|
|
||||||
private static final String SYNC_CONFIG_PATH = "/vertx/app/config";
|
private static final String SYNC_CONFIG_PATH = "/vertx/app/config";
|
||||||
|
|
||||||
private static final Long DEFAULT_API_TIMEOUT = 3000L;
|
private static final Long DEFAULT_API_TIMEOUT = 3000L;
|
||||||
@ -101,7 +104,7 @@ public class GatewayConfigServiceImpl implements IGatewayConfigService {
|
|||||||
public void synchronization(String appCode) {
|
public void synchronization(String appCode) {
|
||||||
Assert.hasText(sacGatewayHost, "网关地址未配置");
|
Assert.hasText(sacGatewayHost, "网关地址未配置");
|
||||||
Assert.notNull(sacGatewayPort, "网关端口未配置");
|
Assert.notNull(sacGatewayPort, "网关端口未配置");
|
||||||
String urlStr = "http://" + sacGatewayHost + ":" + sacGatewayPort + SYNC_CONFIG_PATH;
|
String urlStr = "http://" + sacGatewayHost + ":" + sacGatewayPort + urlPre + SYNC_CONFIG_PATH;
|
||||||
AppConfig appConfig = new AppConfig();
|
AppConfig appConfig = new AppConfig();
|
||||||
appConfig.setAppCode(appCode);
|
appConfig.setAppCode(appCode);
|
||||||
GatewayConfig gatewayConfig = selectGatewayConfigByAppCode(appCode);
|
GatewayConfig gatewayConfig = selectGatewayConfigByAppCode(appCode);
|
||||||
|
@ -26,6 +26,11 @@
|
|||||||
<groupId>com.smarterFramework</groupId>
|
<groupId>com.smarterFramework</groupId>
|
||||||
<artifactId>sf-file</artifactId>
|
<artifactId>sf-file</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis</artifactId>
|
||||||
|
<version>3.5.16</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
FROM node:24-alpine AS builder
|
FROM node:24-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
ENV NODE_OPTIONS=--openssl-legacy-provider
|
||||||
RUN npm install --registry=https://registry.npmmirror.com && npm run build:stage
|
RUN npm install --registry=https://registry.npmmirror.com && npm run build:stage
|
||||||
|
|
||||||
FROM registry.zsmarter.com/public/nginx:1.22.1
|
FROM registry.zsmarter.com/public/nginx:1.22.1
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
worker_processes 1;
|
worker_processes 1;
|
||||||
|
|
||||||
events {
|
events {
|
||||||
@ -29,14 +28,6 @@ http {
|
|||||||
rewrite ^.*$ /index.html last;
|
rewrite ^.*$ /index.html last;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /stage-api/ {
|
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header REMOTE-HOST $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_pass http://zt-sac-java:7781/;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
error_page 500 502 503 504 /50x.html;
|
||||||
location = /50x.html {
|
location = /50x.html {
|
||||||
root html;
|
root html;
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 4.2 KiB |
@ -42,3 +42,72 @@ export function delWhitelist (id) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询白名单成员列列表
|
||||||
|
export function listWhitelistMember (query) {
|
||||||
|
return request({
|
||||||
|
url: '/deployment/whitelistMember/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询白名单成员列详细
|
||||||
|
export function getWhitelistMember (id) {
|
||||||
|
return request({
|
||||||
|
url: '/deployment/whitelistMember/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增白名单成员列
|
||||||
|
export function addWhitelistMember (data) {
|
||||||
|
return request({
|
||||||
|
url: '/deployment/whitelistMember',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改白名单成员列
|
||||||
|
export function updateWhitelistMember (data) {
|
||||||
|
return request({
|
||||||
|
url: '/deployment/whitelistMember',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除白名单成员列
|
||||||
|
export function delWhitelistMember (id) {
|
||||||
|
return request({
|
||||||
|
url: '/deployment/whitelistMember/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 发布白名单
|
||||||
|
export function publishWhitelist (id) {
|
||||||
|
return request({
|
||||||
|
url: '/deployment/whitelist/publish/' + id,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下架白名单
|
||||||
|
export function soldOutWhitelist (id) {
|
||||||
|
return request({
|
||||||
|
url: '/deployment/whitelist/sold/out/' + id,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量上传白名单
|
||||||
|
export function importWhitelist (data) {
|
||||||
|
return request({
|
||||||
|
url: 'deployment/whitelistMember/batch/import',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
28
sf-ui/src/api/gateway/config.js
Normal file
28
sf-ui/src/api/gateway/config.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询网关配置信息
|
||||||
|
export function getGatewayConfig(params) {
|
||||||
|
return request({
|
||||||
|
url: '/gateway/config',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新网关配置
|
||||||
|
export function updateGatewayConfig(data) {
|
||||||
|
return request({
|
||||||
|
url: '/gateway/config',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 同步网关配置
|
||||||
|
export function updateGatewaySync(data) {
|
||||||
|
return request({
|
||||||
|
url: '/gateway/config/sync',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
@ -42,3 +42,12 @@ export function delRoute(id) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询可绑定的路由列表(不分页)
|
||||||
|
export function getBindableList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/gateway/route/bindableList',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
@ -51,3 +51,12 @@ export function changeServerStatus(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询可绑定的服务列表(状态为启用的,不分页)
|
||||||
|
export function bindableServerList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/gateway/server/bindableList',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -51,3 +51,12 @@ export function changeStrategyStatus(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询可绑定的策略列表(状态为启用的,不分页)
|
||||||
|
export function bindableStrategyList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/gateway/strategy/bindableList',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
66
sf-ui/src/api/mandate/appMandate.js
Normal file
66
sf-ui/src/api/mandate/appMandate.js
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询应用授权列表
|
||||||
|
export function listAppMandate (query) {
|
||||||
|
return request({
|
||||||
|
url: '/mandate/appMandate/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询应用授权详细
|
||||||
|
export function getAppMandate (id) {
|
||||||
|
return request({
|
||||||
|
url: '/mandate/appMandate/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增应用授权
|
||||||
|
export function addAppMandate (data) {
|
||||||
|
return request({
|
||||||
|
url: '/mandate/appMandate',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增应用授权批量
|
||||||
|
export function addAppMandateList (data) {
|
||||||
|
return request({
|
||||||
|
url: '/mandate/appMandate/addList',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 修改应用授权
|
||||||
|
export function updateAppMandate (data) {
|
||||||
|
return request({
|
||||||
|
url: '/mandate/appMandate',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除应用授权
|
||||||
|
export function delAppMandate (id) {
|
||||||
|
return request({
|
||||||
|
url: '/mandate/appMandate/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 查询应用授权列表
|
||||||
|
export function appMandateUser () {
|
||||||
|
return request({
|
||||||
|
url: '/mandate/appMandate/queryUser',
|
||||||
|
method: 'get',
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
BIN
sf-ui/src/assets/images/filter_icon.png
Normal file
BIN
sf-ui/src/assets/images/filter_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 575 B |
BIN
sf-ui/src/assets/images/login-background.png
Normal file
BIN
sf-ui/src/assets/images/login-background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 MiB |
BIN
sf-ui/src/assets/images/profile.png
Normal file
BIN
sf-ui/src/assets/images/profile.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
27
sf-ui/src/assets/logo/logo.svg
Normal file
27
sf-ui/src/assets/logo/logo.svg
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="104px" height="30px" viewBox="0 0 104 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>SAC</title>
|
||||||
|
<defs>
|
||||||
|
<linearGradient x1="50%" y1="12.1751553%" x2="57.1919171%" y2="87.8248447%" id="linearGradient-1">
|
||||||
|
<stop stop-color="#FFFFFF" offset="0%"></stop>
|
||||||
|
<stop stop-color="#E5F1FF" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="89.6896665%" y1="8.24507501%" x2="11.6260569%" y2="79.7724897%" id="linearGradient-2">
|
||||||
|
<stop stop-color="#79C3FF" offset="0%"></stop>
|
||||||
|
<stop stop-color="#4490FE" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="17.0179916%" x2="57.1919171%" y2="82.9820084%" id="linearGradient-3">
|
||||||
|
<stop stop-color="#FFFFFF" offset="0%"></stop>
|
||||||
|
<stop stop-color="#E5F1FF" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<g id="官网" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="首页" transform="translate(-262, -23)" fill-rule="nonzero">
|
||||||
|
<g id="logo" transform="translate(262, 23)">
|
||||||
|
<path d="M32.7865113,0.35850417 L30.7865113,6.44149583 L9.48530263,6.44149583 C8.1356254,6.44149583 7.04149583,7.5356254 7.04149583,8.88530263 C7.04149583,10.2349799 8.1356254,11.3291094 9.48530263,11.3291094 L23.8419133,11.3291094 C28.4569114,11.3291094 32.1981065,15.0703046 32.1981065,19.6853026 C32.1981065,24.3003007 28.4569114,28.0414958 23.8419133,28.0414958 L1.31479405,28.0414958 L3.31479405,21.9585042 L23.8419133,21.9585042 C25.0973678,21.9585042 26.1151148,20.9407572 26.1151148,19.6853026 C26.1151148,18.4298481 25.0973678,17.4121011 23.8419133,17.4121011 L9.48530263,17.4121011 C4.77608188,17.4121011 0.95850417,13.5945234 0.95850417,8.88530263 C0.95850417,4.17608188 4.77608188,0.35850417 9.48530263,0.35850417 L32.7865113,0.35850417 Z" id="路径-9" fill="url(#linearGradient-1)"></path>
|
||||||
|
<path d="M38.8681484,0.0454698506 L50.8563478,21.0969657 L59.5873478,6.61496568 L47.4598541,6.61559281 L44.4598541,0.532601149 L64.9730561,0.532601149 C67.3400843,0.532601149 68.7999234,3.11736276 67.5777828,5.14447769 L55.2888271,25.5276696 C54.8343051,26.2815668 54.1956757,26.9076108 53.4328824,27.3470396 C50.9465576,28.7793575 47.76987,27.9249162 46.337552,25.4385914 L31.7387233,0.0819362866 L38.8681484,0.0454698506 Z" id="路径-27" fill="url(#linearGradient-2)" transform="translate(49.879, 14.0435) scale(1, -1) translate(-49.879, -14.0435)"></path>
|
||||||
|
<path d="M94.832475,0.35850417 L96.832475,6.44149583 L82.7982917,6.44149583 C78.5133882,6.44149583 75.0397876,9.91509647 75.0397876,14.2 C75.0397876,18.4849035 78.5133882,21.9585042 82.7982917,21.9585042 L101.041496,21.9585042 L103.041496,28.0414958 L82.7982917,28.0414958 C75.1538447,28.0414958 68.9567959,21.8444471 68.9567959,14.2 C68.9567959,6.55555294 75.1538447,0.35850417 82.7982917,0.35850417 L94.832475,0.35850417 Z" id="路径-28" fill="url(#linearGradient-3)"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.1 KiB |
@ -1,4 +1,4 @@
|
|||||||
@import './variables.scss';
|
@import "./variables.scss";
|
||||||
|
|
||||||
@mixin colorBtn($color) {
|
@mixin colorBtn($color) {
|
||||||
background: $color;
|
background: $color;
|
||||||
@ -14,31 +14,31 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.blue-btn {
|
.blue-btn {
|
||||||
@include colorBtn($blue)
|
@include colorBtn($blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
.light-blue-btn {
|
.light-blue-btn {
|
||||||
@include colorBtn($light-blue)
|
@include colorBtn($light-blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
.red-btn {
|
.red-btn {
|
||||||
@include colorBtn($red)
|
@include colorBtn($red);
|
||||||
}
|
}
|
||||||
|
|
||||||
.pink-btn {
|
.pink-btn {
|
||||||
@include colorBtn($pink)
|
@include colorBtn($pink);
|
||||||
}
|
}
|
||||||
|
|
||||||
.green-btn {
|
.green-btn {
|
||||||
@include colorBtn($green)
|
@include colorBtn($green);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tiffany-btn {
|
.tiffany-btn {
|
||||||
@include colorBtn($tiffany)
|
@include colorBtn($tiffany);
|
||||||
}
|
}
|
||||||
|
|
||||||
.yellow-btn {
|
.yellow-btn {
|
||||||
@include colorBtn($yellow)
|
@include colorBtn($yellow);
|
||||||
}
|
}
|
||||||
|
|
||||||
.pan-btn {
|
.pan-btn {
|
||||||
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
&:before,
|
&:before,
|
||||||
&:after {
|
&:after {
|
||||||
content: '';
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
@ -52,6 +52,19 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
.el-dialog__header {
|
||||||
|
padding: 20px 24px;
|
||||||
|
}
|
||||||
|
.el-dialog__header {
|
||||||
|
padding: 20px 24px;
|
||||||
|
}
|
||||||
|
.el-dialog__body {
|
||||||
|
padding: 24px;
|
||||||
|
}
|
||||||
|
.el-dialog__footer {
|
||||||
|
padding: 24px;
|
||||||
|
padding-top: 0px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// refine element ui upload
|
// refine element ui upload
|
||||||
@ -69,7 +82,7 @@
|
|||||||
// dropdown
|
// dropdown
|
||||||
.el-dropdown-menu {
|
.el-dropdown-menu {
|
||||||
a {
|
a {
|
||||||
display: block
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,3 +103,38 @@
|
|||||||
.el-submenu__icon-arrow {
|
.el-submenu__icon-arrow {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
.el-table {
|
||||||
|
.el-dropdown-menu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dropdown-menu__item {
|
||||||
|
display: flex;
|
||||||
|
flex: 1; /* 让所有项均分空间 */
|
||||||
|
justify-content: center; /* 水平居中 */
|
||||||
|
}
|
||||||
|
.el-dropdown-menu--mini .el-dropdown-menu__item {
|
||||||
|
padding: 0px;
|
||||||
|
margin-right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dropdown-menu--mini .el-dropdown-menu__item:first-child {
|
||||||
|
padding: 0px;
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-table__column-filter-trigger {
|
||||||
|
position: relative;
|
||||||
|
.el-icon-arrow-down {
|
||||||
|
background: url("../images/filter_icon.png") no-repeat;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: -12px;
|
||||||
|
&::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
// display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -4,10 +4,15 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
/* theme color */
|
/* theme color */
|
||||||
$--color-primary: #1890ff;
|
$--color-primary: #3F68FF;
|
||||||
$--color-success: #13ce66;
|
$--color-success: #67C23A;
|
||||||
$--color-warning: #ffba00;
|
$--color-warning: #ffba00;
|
||||||
$--color-danger: #ff4949;
|
$--color-danger: #FA5555;
|
||||||
|
// $--color-info: #1E1E1E;
|
||||||
|
// $--color-primary: #1890ff;
|
||||||
|
// $--color-success: #13ce66;
|
||||||
|
// $--color-warning: #ffba00;
|
||||||
|
// $--color-danger: #ff4949;
|
||||||
// $--color-info: #1E1E1E;
|
// $--color-info: #1E1E1E;
|
||||||
|
|
||||||
$--button-font-weight: 400;
|
$--button-font-weight: 400;
|
||||||
|
@ -122,6 +122,12 @@ aside {
|
|||||||
//main-container全局样式
|
//main-container全局样式
|
||||||
.app-container {
|
.app-container {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
&-flex {
|
||||||
|
padding: 20px;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.components-container {
|
.components-container {
|
||||||
@ -180,3 +186,9 @@ aside {
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.required-asterisk::before {
|
||||||
|
content: "*";
|
||||||
|
color: #ff4949;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
@ -46,6 +46,12 @@
|
|||||||
.mr20 {
|
.mr20 {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
.mb14 {
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
.mb16 {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
.mb20 {
|
.mb20 {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
@ -53,7 +59,18 @@
|
|||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
|
.h1,
|
||||||
|
.h2,
|
||||||
|
.h3,
|
||||||
|
.h4,
|
||||||
|
.h5,
|
||||||
|
.h6,
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6 {
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
@ -74,13 +91,17 @@
|
|||||||
max-height: 70vh;
|
max-height: 70vh;
|
||||||
padding: 10px 20px 0;
|
padding: 10px 20px 0;
|
||||||
}
|
}
|
||||||
|
.el-table th {
|
||||||
|
background-color: #f0f0f0; /* 你想要的颜色 */
|
||||||
|
}
|
||||||
|
// .has
|
||||||
.el-table {
|
.el-table {
|
||||||
.el-table__header-wrapper, .el-table__fixed-header-wrapper {
|
.el-table__header-wrapper,
|
||||||
|
.el-table__fixed-header-wrapper {
|
||||||
th {
|
th {
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
background-color: #f8f8f9;
|
background-color: #d4e1ff !important;
|
||||||
color: #515a6e;
|
color: #4169ff;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
@ -98,7 +119,7 @@
|
|||||||
color: #6379bb;
|
color: #6379bb;
|
||||||
border-bottom: 1px solid #ddd;
|
border-bottom: 1px solid #ddd;
|
||||||
margin: 8px 10px 25px 10px;
|
margin: 8px 10px 25px 10px;
|
||||||
padding-bottom:5px
|
padding-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表格布局 **/
|
/** 表格布局 **/
|
||||||
@ -114,7 +135,7 @@
|
|||||||
.tree-border {
|
.tree-border {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
border: 1px solid #e5e6e7;
|
border: 1px solid #e5e6e7;
|
||||||
background: #FFFFFF none;
|
background: #ffffff none;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,12 +160,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表格更多操作下拉样式 */
|
/** 表格更多操作下拉样式 */
|
||||||
.el-table .el-dropdown-link,.el-table .el-dropdown-selfdefine {
|
.el-table .el-dropdown-link,
|
||||||
|
.el-table .el-dropdown-selfdefine {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-table .el-dropdown, .el-icon-arrow-down {
|
.el-table .el-dropdown,
|
||||||
|
.el-icon-arrow-down {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,22 +218,22 @@
|
|||||||
/* button color */
|
/* button color */
|
||||||
.el-button--cyan.is-active,
|
.el-button--cyan.is-active,
|
||||||
.el-button--cyan:active {
|
.el-button--cyan:active {
|
||||||
background: #20B2AA;
|
background: #20b2aa;
|
||||||
border-color: #20B2AA;
|
border-color: #20b2aa;
|
||||||
color: #FFFFFF;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-button--cyan:focus,
|
.el-button--cyan:focus,
|
||||||
.el-button--cyan:hover {
|
.el-button--cyan:hover {
|
||||||
background: #48D1CC;
|
background: #48d1cc;
|
||||||
border-color: #48D1CC;
|
border-color: #48d1cc;
|
||||||
color: #FFFFFF;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-button--cyan {
|
.el-button--cyan {
|
||||||
background-color: #20B2AA;
|
background-color: #20b2aa;
|
||||||
border-color: #20B2AA;
|
border-color: #20b2aa;
|
||||||
color: #FFFFFF;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* text color */
|
/* text color */
|
||||||
@ -266,7 +289,7 @@
|
|||||||
|
|
||||||
/* 拖拽列样式 */
|
/* 拖拽列样式 */
|
||||||
.sortable-ghost {
|
.sortable-ghost {
|
||||||
opacity: .8;
|
opacity: 0.8;
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
background: #42b983 !important;
|
background: #42b983 !important;
|
||||||
}
|
}
|
||||||
@ -275,3 +298,16 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
.dropdown-max {
|
||||||
|
max-width: 600px;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
padding-left: 5px;
|
||||||
|
li {
|
||||||
|
margin-right: 5px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-radio {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
@ -31,7 +31,8 @@ function install() {
|
|||||||
} else {
|
} else {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getDicts(dictMeta.type).then(res => {
|
getDicts(dictMeta.type).then(res => {
|
||||||
store.dispatch('dict/setDict', { key: dictMeta.type, value: res.data })
|
console.log(res);
|
||||||
|
store.dispatch('dict/setDict', { key: dictMeta.type, value: res.data, text: res.data.dictLabel })
|
||||||
resolve(res.data)
|
resolve(res.data)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
@ -5,19 +5,19 @@
|
|||||||
<span
|
<span
|
||||||
v-if="item.raw.listClass == 'default' || item.raw.listClass == ''"
|
v-if="item.raw.listClass == 'default' || item.raw.listClass == ''"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:class="item.raw.cssClass"
|
|
||||||
:index="index"
|
:index="index"
|
||||||
>{{ item.label + ' ' }}</span
|
:class="item.raw.cssClass"
|
||||||
|
>{{ item.label + " " }}</span
|
||||||
>
|
>
|
||||||
<el-tag
|
<el-tag
|
||||||
v-else
|
v-else
|
||||||
:key="item.value"
|
|
||||||
:class="item.raw.cssClass"
|
|
||||||
:disable-transitions="true"
|
:disable-transitions="true"
|
||||||
|
:key="item.value"
|
||||||
:index="index"
|
:index="index"
|
||||||
:type="item.raw.listClass == 'primary' ? '' : item.raw.listClass"
|
:type="item.raw.listClass == 'primary' ? '' : item.raw.listClass"
|
||||||
|
:class="item.raw.cssClass"
|
||||||
>
|
>
|
||||||
{{ item.label + ' ' }}
|
{{ item.label + " " }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@ -29,63 +29,61 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'DictTag',
|
name: "DictTag",
|
||||||
props: {
|
props: {
|
||||||
options: {
|
options: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: null
|
default: null,
|
||||||
},
|
},
|
||||||
value: [Number, String, Array],
|
value: [Number, String, Array],
|
||||||
// 当未找到匹配的数据时,显示value
|
// 当未找到匹配的数据时,显示value
|
||||||
showValue: {
|
showValue: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
unmatchArray: [] // 记录未匹配的项
|
unmatchArray: [], // 记录未匹配的项
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
values() {
|
values() {
|
||||||
if (this.value !== null && typeof this.value !== 'undefined') {
|
if (this.value !== null && typeof this.value !== "undefined") {
|
||||||
console.log(this.value)
|
return Array.isArray(this.value) ? this.value : [String(this.value)];
|
||||||
return Array.isArray(this.value) ? this.value : [String(this.value)]
|
|
||||||
} else {
|
} else {
|
||||||
return []
|
return [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
unmatch() {
|
unmatch() {
|
||||||
this.unmatchArray = []
|
this.unmatchArray = [];
|
||||||
if (this.value !== null && typeof this.value !== 'undefined') {
|
if (this.value !== null && typeof this.value !== "undefined") {
|
||||||
// 传入值为非数组
|
// 传入值为非数组
|
||||||
if (!Array.isArray(this.value)) {
|
if (!Array.isArray(this.value)) {
|
||||||
if (this.options.some((v) => v.value == this.value)) return false
|
if (this.options.some((v) => v.value == this.value)) return false;
|
||||||
this.unmatchArray.push(this.value)
|
this.unmatchArray.push(this.value);
|
||||||
return true
|
return true;
|
||||||
}
|
}
|
||||||
// 传入值为Array
|
// 传入值为Array
|
||||||
this.value.forEach((item) => {
|
this.value.forEach((item) => {
|
||||||
if (!this.options.some((v) => v.value == item)) {
|
if (!this.options.some((v) => v.value == item))
|
||||||
this.unmatchArray.push(item)
|
this.unmatchArray.push(item);
|
||||||
}
|
});
|
||||||
})
|
return true;
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
// 没有value不显示
|
// 没有value不显示
|
||||||
return false
|
return false;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
handleArray(array) {
|
handleArray(array) {
|
||||||
if (array.length === 0) return ''
|
if (array.length === 0) return "";
|
||||||
return array.reduce((pre, cur) => {
|
return array.reduce((pre, cur) => {
|
||||||
return pre + ' ' + cur
|
return pre + " " + cur;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-tag + .el-tag {
|
.el-tag + .el-tag {
|
||||||
|
79
sf-ui/src/components/DropDown/MyDropDown.vue
Normal file
79
sf-ui/src/components/DropDown/MyDropDown.vue
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<template>
|
||||||
|
<div class="my-dropdown" @click.stop="trigger == 'click' ? (showMenu = !showMenu) : ''"
|
||||||
|
@mouseenter="trigger == 'hover' ? (showMenu = true) : ''"
|
||||||
|
@mouseleave="trigger == 'hover' ? (showMenu = false) : ''" ref="myDropDdown" >
|
||||||
|
<div class="tip-text" ref="tipText">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
<slot name="list"></slot>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import emitter from "./emitter";
|
||||||
|
export default {
|
||||||
|
name: "MyDropdown",
|
||||||
|
componentName: "MyDropdown",
|
||||||
|
mixins: [emitter],
|
||||||
|
props: {
|
||||||
|
// 触发显示方式
|
||||||
|
trigger: {
|
||||||
|
type: String,
|
||||||
|
default: "click",
|
||||||
|
},
|
||||||
|
// 下来菜单的出现位置(上方,下方)
|
||||||
|
placement: {
|
||||||
|
type: String,
|
||||||
|
default: "bottom",
|
||||||
|
validator: function (value) {
|
||||||
|
// 这个值必须匹配下列字符串中的一个
|
||||||
|
return ["bottom", "top"].includes(value);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
//控制菜单是否显示
|
||||||
|
showMenu: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
//初始化自定义事件
|
||||||
|
this.initEvent();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 初始化
|
||||||
|
initEvent () {
|
||||||
|
//订阅当item点击的时候,发布on-click事件,告知外部
|
||||||
|
this.$on("item-click", (params) => {
|
||||||
|
this.$emit("on-click", params);
|
||||||
|
this.showMenu = false;
|
||||||
|
});
|
||||||
|
//空白点击要隐藏菜单,需要执行的函数需要绑定this指向
|
||||||
|
this.handleEmptyDomElementClickBindThis =
|
||||||
|
this.handleEmptyDomElementClick.bind(this);
|
||||||
|
window.addEventListener("click", this.handleEmptyDomElementClickBindThis);
|
||||||
|
},
|
||||||
|
// 处理空白区域点击,隐藏菜单列表
|
||||||
|
handleEmptyDomElementClick (e) {
|
||||||
|
if (!Array.from(this.$refs.myDropDdown.childNodes).includes(e.target)) {
|
||||||
|
this.showMenu = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
beforeDestroy () {
|
||||||
|
// 移除window上面的事件
|
||||||
|
window.removeEventListener(this.handleEmptyDomElementClickBindThis);
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
//变化的时候,通知子组件隐藏菜单列表
|
||||||
|
showMenu () {
|
||||||
|
this.broadcast("MyDropdownMenu", "set-menu-status", this.showMenu);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.my-dropdown {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
</style>
|
75
sf-ui/src/components/DropDown/MyDropDownItem.vue
Normal file
75
sf-ui/src/components/DropDown/MyDropDownItem.vue
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<template>
|
||||||
|
<div :class="[
|
||||||
|
'my-dropdownItem',
|
||||||
|
divided ? 'my-dropdownItem-divided' : '',
|
||||||
|
disabled ? 'my-dropdownItem-disabled' : '',
|
||||||
|
]" @click.stop="handleItemClick" >
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import emitter from "./emitter";
|
||||||
|
export default {
|
||||||
|
name: "MyDropdownItem",
|
||||||
|
componentName: "MyDropdownItem",
|
||||||
|
mixins: [emitter],
|
||||||
|
props: {
|
||||||
|
divided: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleItemClick () {
|
||||||
|
if (this.disabled) return;
|
||||||
|
// item项点击通知dropdown组件派发到外部的自定义事件
|
||||||
|
this.dispatch("MyDropdown", "item-click", this.name);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.my-dropdownItem {
|
||||||
|
margin: 0;
|
||||||
|
line-height: normal;
|
||||||
|
padding: 7px 16px;
|
||||||
|
clear: both;
|
||||||
|
color: #515a6e;
|
||||||
|
font-size: 14px !important;
|
||||||
|
white-space: nowrap;
|
||||||
|
list-style: none;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.2s ease-in-out;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #f3f3f3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.my-dropdownItem-divided {
|
||||||
|
border-bottom: 1px solid #eee
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.my-dropdownItem-disabled {
|
||||||
|
color: #cacdd2;
|
||||||
|
|
||||||
|
cursor: not-allowed;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
96
sf-ui/src/components/DropDown/MyDropDownMenu.vue
Normal file
96
sf-ui/src/components/DropDown/MyDropDownMenu.vue
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 涉及到高度,位移,过渡使用js钩子函数的方式比较好处理些 -->
|
||||||
|
<transition @before-enter="beforeEnter" @enter="enter" @leave="leave" v-bind:css="false">
|
||||||
|
<div class="my-dropdown-menu" v-if="showMenue" ref="myDroupdownMenu">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import emitter from "./emitter";
|
||||||
|
export default {
|
||||||
|
name: "MyDropdownMenu",
|
||||||
|
componentName: "MyDropdownMenu",
|
||||||
|
mixins: [emitter],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
showMeune: false,
|
||||||
|
timer: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
this.$on("set-menu-status", (status) => {
|
||||||
|
this.showMeune = status;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
//进入前,初始化需要过渡的属性
|
||||||
|
beforeEnter: function (el) {
|
||||||
|
// 初始化
|
||||||
|
el.style.opacity = 0;
|
||||||
|
el.style.transform = "scaleY(0)";
|
||||||
|
el.style.transformOrigin = "top center";
|
||||||
|
},
|
||||||
|
//dom进入
|
||||||
|
enter: function (el, done) {
|
||||||
|
console.log(el);
|
||||||
|
|
||||||
|
//获取文档可视区高度
|
||||||
|
const htmlClientHeight = document.documentElement.clientHeight;
|
||||||
|
//菜单列表相对于父元素的top偏移量
|
||||||
|
const offsetTop = el.offsetTop;
|
||||||
|
const scrollHeight = el.scrollHeight;
|
||||||
|
//获取当前元素和可视区的一些长度(top,left,bottom等)
|
||||||
|
const { bottom } = el.getBoundingClientRect();
|
||||||
|
// 说明底部高度不够显示菜单了,这时候我们需要调整菜单朝上面显示
|
||||||
|
if (htmlClientHeight - bottom < scrollHeight) {
|
||||||
|
el.style.transformOrigin = "bottom center";
|
||||||
|
el.style.top = -(scrollHeight + 20) + "px";
|
||||||
|
} else {
|
||||||
|
//查看是否placement属性,是的话我们主动处理
|
||||||
|
if (this.$parent.placement == "top") {
|
||||||
|
el.style.transformOrigin = "bottom center";
|
||||||
|
el.style.top = -(scrollHeight + 20) + "px";
|
||||||
|
} else {
|
||||||
|
el.style.top = offsetTop + "px";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
el.style.transform = "scaleY(1)";
|
||||||
|
el.style.opacity = 1;
|
||||||
|
//根据官网事例,必须在enter和leave里面调用done函数,不然过渡动画不生效(切记)
|
||||||
|
done();
|
||||||
|
},
|
||||||
|
//dom元素离开
|
||||||
|
leave: function (el, done) {
|
||||||
|
el.style.transform = "scaleY(0)";
|
||||||
|
el.style.opacity = 0;
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
//根据官网事例,必须在enter和leave里面调用done函数,不然过渡动画不生效(切记)
|
||||||
|
done();
|
||||||
|
}, 250);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.my-dropdown-menu {
|
||||||
|
|
||||||
|
|
||||||
|
min-width: 100px;
|
||||||
|
max-height: 200px;
|
||||||
|
overflow: auto;
|
||||||
|
margin: 5px 0;
|
||||||
|
padding: 5px 0;
|
||||||
|
background-color: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 1px 6px rgb(0 0 0 / 20%);
|
||||||
|
z-index: 999;
|
||||||
|
transform-origin: top center;
|
||||||
|
position: absolute;
|
||||||
|
transition: transform .25s ease, opacity 0.25s ease;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
45
sf-ui/src/components/DropDown/emitter.js
Normal file
45
sf-ui/src/components/DropDown/emitter.js
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/**
|
||||||
|
* @Description 由于涉及到跨组件之间通信,因此我们只有自己实现发布订阅的模式,来实现组件之间通信,灵感主要来源于element-ui组件库源码中跨层级父子组件通信方案,本质上也是发布订阅和$emit和$on
|
||||||
|
* @param { String } componentName 组件名
|
||||||
|
* @param { String } eventName 事件名
|
||||||
|
* @param { argument } params 参数
|
||||||
|
**/
|
||||||
|
// 广播通知事件
|
||||||
|
function _broadcast (componentName, eventName, params) {
|
||||||
|
// 遍历当前组件的子组件
|
||||||
|
this.$children.forEach(function (child) {
|
||||||
|
// 取出componentName,组件options上面可以自己配置
|
||||||
|
var name = child.$options.componentName;
|
||||||
|
// 如果找到了需要通知的组件名,触发组件上面的$eimit方法,触发自定义事件
|
||||||
|
if (name === componentName) {
|
||||||
|
child.$emit.apply(child, [eventName].concat(params));
|
||||||
|
} else {
|
||||||
|
// 没找到,递归往下找
|
||||||
|
_broadcast.apply(child, [componentName, eventName].concat([params]));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const emiiter = {
|
||||||
|
methods: {
|
||||||
|
// 派发事件(通知父组件)
|
||||||
|
dispatch (componentName, eventName, params) {
|
||||||
|
var parent = this.$parent || this.$root;
|
||||||
|
var name = parent.$options.componentName;
|
||||||
|
// 循环往上层父组件,知道知道组件名和需要触发的组件名相同即可,然后触发对应组件的事件
|
||||||
|
while (parent && (!name || name !== componentName)) {
|
||||||
|
parent = parent.$parent;
|
||||||
|
if (parent) {
|
||||||
|
name = parent.$options.componentName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (parent) {
|
||||||
|
parent.$emit.apply(parent, [eventName].concat(params));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 广播事件(通知子组件)
|
||||||
|
broadcast (componentName, eventName, params) {
|
||||||
|
_broadcast.call(this, componentName, eventName, params);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
export default emiiter;
|
@ -2,7 +2,7 @@
|
|||||||
<div class="upload-file">
|
<div class="upload-file">
|
||||||
<el-upload
|
<el-upload
|
||||||
ref="fileUpload"
|
ref="fileUpload"
|
||||||
:accept="accept"
|
:accept="suffixArr.join(',')"
|
||||||
:action="baseUrl+uploadFileUrl"
|
:action="baseUrl+uploadFileUrl"
|
||||||
:before-upload="handleBeforeUpload"
|
:before-upload="handleBeforeUpload"
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
@ -13,16 +13,17 @@
|
|||||||
:on-success="handleUploadSuccess"
|
:on-success="handleUploadSuccess"
|
||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
class="upload-file-uploader"
|
class="upload-file-uploader"
|
||||||
multiple
|
:multiple="multiple"
|
||||||
>
|
>
|
||||||
<!-- 上传按钮 -->
|
<!-- 上传按钮 -->
|
||||||
<el-button size="mini" type="primary">选取文件</el-button>
|
<el-button size="mini" type="default" icon="el-icon-upload2">选取文件</el-button>
|
||||||
<!-- 上传提示 -->
|
<!-- 上传提示 -->
|
||||||
<div v-if="showTip" slot="tip" class="el-upload__tip">
|
<div v-if="showTip" slot="tip" class="el-upload__tip">
|
||||||
请上传
|
<!-- 请上传
|
||||||
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
|
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
|
||||||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b></template>
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b></template>
|
||||||
的文件
|
的文件 -->
|
||||||
|
<span style="color: #999;">支持扩展名:{{ suffixArr.join(' ') }}...</span>
|
||||||
</div>
|
</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|
||||||
@ -30,7 +31,7 @@
|
|||||||
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||||
<li v-for="(file, index) in fileList" :key="file.url" class="el-upload-list__item ele-upload-list__item-content">
|
<li v-for="(file, index) in fileList" :key="file.url" class="el-upload-list__item ele-upload-list__item-content">
|
||||||
<el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
|
<el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
|
||||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
<span class="el-icon-document"> {{ getFileName(file) }} </span>
|
||||||
</el-link>
|
</el-link>
|
||||||
<div class="ele-upload-list__item-content-action">
|
<div class="ele-upload-list__item-content-action">
|
||||||
<el-link :underline="false" type="danger" @click="handleDelete(index)">删除</el-link>
|
<el-link :underline="false" type="danger" @click="handleDelete(index)">删除</el-link>
|
||||||
@ -72,9 +73,9 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: () => '/system/oss/zip/upload'
|
default: () => '/system/oss/zip/upload'
|
||||||
},
|
},
|
||||||
accept: {
|
multiple: {
|
||||||
type: Array,
|
type: Boolean,
|
||||||
default: () => []
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
@ -93,6 +94,7 @@ export default {
|
|||||||
value: {
|
value: {
|
||||||
handler (val) {
|
handler (val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
|
console.log(val)
|
||||||
let temp = 1
|
let temp = 1
|
||||||
// 首先将值转为数组
|
// 首先将值转为数组
|
||||||
const list = Array.isArray(val) ? val : this.value.split(',')
|
const list = Array.isArray(val) ? val : this.value.split(',')
|
||||||
@ -117,6 +119,11 @@ export default {
|
|||||||
// 是否显示提示
|
// 是否显示提示
|
||||||
showTip () {
|
showTip () {
|
||||||
return this.isShowTip && (this.fileType || this.fileSize)
|
return this.isShowTip && (this.fileType || this.fileSize)
|
||||||
|
},
|
||||||
|
suffixArr() {
|
||||||
|
return this.fileType.map(item => {
|
||||||
|
return `.${item}`
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -126,7 +133,7 @@ export default {
|
|||||||
if (this.fileType) {
|
if (this.fileType) {
|
||||||
const fileName = file.name.split('.')
|
const fileName = file.name.split('.')
|
||||||
const fileExt = fileName[fileName.length - 1]
|
const fileExt = fileName[fileName.length - 1]
|
||||||
const isTypeOk = this.fileType.indexOf(fileExt) >= 0
|
const isTypeOk = this.fileType.indexOf(fileExt.toLocaleUpperCase()) >= 0 || this.fileType.indexOf(fileExt.toLocaleLowerCase()) >= 0
|
||||||
if (!isTypeOk) {
|
if (!isTypeOk) {
|
||||||
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join('/')}格式文件!`)
|
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join('/')}格式文件!`)
|
||||||
return false
|
return false
|
||||||
@ -156,7 +163,9 @@ export default {
|
|||||||
// 上传成功回调
|
// 上传成功回调
|
||||||
handleUploadSuccess (res, file) {
|
handleUploadSuccess (res, file) {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.uploadList.push({ name: res.data.url, url: res.data.url, size: res.data.size })
|
const { data } = res;
|
||||||
|
data.name = data.url;
|
||||||
|
this.uploadList.push(data)
|
||||||
|
|
||||||
this.uploadedSuccessfully()
|
this.uploadedSuccessfully()
|
||||||
} else {
|
} else {
|
||||||
@ -171,6 +180,8 @@ export default {
|
|||||||
handleDelete (index) {
|
handleDelete (index) {
|
||||||
this.fileList.splice(index, 1)
|
this.fileList.splice(index, 1)
|
||||||
this.$emit('input', this.listToString(this.fileList))
|
this.$emit('input', this.listToString(this.fileList))
|
||||||
|
this.$emit('change', this.fileList)
|
||||||
|
this.$emit('getSize', this.fileList)
|
||||||
},
|
},
|
||||||
// 上传结束处理
|
// 上传结束处理
|
||||||
uploadedSuccessfully () {
|
uploadedSuccessfully () {
|
||||||
@ -179,12 +190,15 @@ export default {
|
|||||||
this.uploadList = []
|
this.uploadList = []
|
||||||
this.number = 0
|
this.number = 0
|
||||||
this.$emit('input', this.listToString(this.fileList))
|
this.$emit('input', this.listToString(this.fileList))
|
||||||
|
this.$emit('change', this.fileList)
|
||||||
this.$emit('getSize', this.fileList)
|
this.$emit('getSize', this.fileList)
|
||||||
this.$modal.closeLoading()
|
this.$modal.closeLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取文件名称
|
// 获取文件名称
|
||||||
getFileName(name) {
|
getFileName(file) {
|
||||||
|
const {name, originalName} = file;
|
||||||
|
if (originalName) return originalName;
|
||||||
if (name.lastIndexOf('/') > -1) {
|
if (name.lastIndexOf('/') > -1) {
|
||||||
return name.slice(name.lastIndexOf('/') + 1)
|
return name.slice(name.lastIndexOf('/') + 1)
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,44 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="component-upload-image">
|
<div class="component-upload-image">
|
||||||
<el-upload
|
<el-upload ref="imageUpload" :action="baseUrl + uploadImgUrl" :before-upload="handleBeforeUpload"
|
||||||
ref="imageUpload"
|
:class="{ hide: this.fileList.length >= this.limit }" :file-list="fileList" :headers="headers" :accept="accept"
|
||||||
:action="baseUrl+uploadImgUrl"
|
:limit="limit" :list-type="listType" :on-error="handleUploadError" :on-exceed="handleExceed"
|
||||||
:before-upload="handleBeforeUpload"
|
:on-preview="handlePictureCardPreview" :on-remove="handleDelete" :on-success="handleUploadSuccess"
|
||||||
:class="{hide: this.fileList.length >= this.limit}"
|
:show-file-list="true" multiple>
|
||||||
:file-list="fileList"
|
|
||||||
:headers="headers"
|
|
||||||
:limit="limit"
|
|
||||||
:list-type="listType"
|
|
||||||
:on-error="handleUploadError"
|
|
||||||
:on-exceed="handleExceed"
|
|
||||||
:on-preview="handlePictureCardPreview"
|
|
||||||
:on-remove="handleDelete"
|
|
||||||
:on-success="handleUploadSuccess"
|
|
||||||
:show-file-list="true"
|
|
||||||
multiple
|
|
||||||
>
|
|
||||||
<i v-if="listType == 'picture-card'" class="el-icon-plus"></i>
|
<i v-if="listType == 'picture-card'" class="el-icon-plus"></i>
|
||||||
<el-button v-else icon="el-icon-upload" size="small" type="primary">上传文件</el-button>
|
<el-button v-else icon="el-icon-upload" size="small" type="primary">上传文件</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|
||||||
<!-- 上传提示 -->
|
<!-- 上传提示 -->
|
||||||
<div v-if="showTip" slot="tip" class="el-upload__tip">
|
<div v-if="showTip" slot="tip" class="el-upload__tip">
|
||||||
请上传
|
请上传<template v-if="fileSize">大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
|
||||||
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
|
|
||||||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b></template>
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b></template>
|
||||||
的文件
|
的文件
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog :visible.sync="dialogVisible" append-to-body title="预览" width="800">
|
||||||
:visible.sync="dialogVisible"
|
<img :src="dialogImageUrl" style="display: block; max-width: 100%; margin: 0 auto" />
|
||||||
append-to-body
|
|
||||||
title="预览"
|
|
||||||
width="800"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
:src="dialogImageUrl"
|
|
||||||
style="display: block; max-width: 100%; margin: 0 auto"
|
|
||||||
/>
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -76,6 +55,10 @@ export default {
|
|||||||
uploadImgUrl: {
|
uploadImgUrl: {
|
||||||
type: String,
|
type: String,
|
||||||
default: () => '/system/oss/upload'
|
default: () => '/system/oss/upload'
|
||||||
|
},
|
||||||
|
accept: {
|
||||||
|
type: String,
|
||||||
|
default: () => ".png,.jpg,.jpeg"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
@ -102,12 +85,9 @@ export default {
|
|||||||
// 然后将数组转为对象数组
|
// 然后将数组转为对象数组
|
||||||
this.fileList = list.map(item => {
|
this.fileList = list.map(item => {
|
||||||
if (typeof item === 'string') {
|
if (typeof item === 'string') {
|
||||||
console.log(333333)
|
|
||||||
if (item.indexOf(this.baseUrl) === -1) {
|
if (item.indexOf(this.baseUrl) === -1) {
|
||||||
item = { name: item, url: item }
|
item = { name: item, url: item }
|
||||||
console.log(item)
|
|
||||||
} else {
|
} else {
|
||||||
console.log(7777)
|
|
||||||
item = { name: item, url: item }
|
item = { name: item, url: item }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,7 +214,8 @@ export default {
|
|||||||
transition: all 0s;
|
transition: all 0s;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-list-enter, .el-list-leave-active {
|
::v-deep .el-list-enter,
|
||||||
|
.el-list-leave-active {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dropdown trigger="click" @command="handleSetSize">
|
<el-dropdown trigger="hover" @command="handleSetSize">
|
||||||
<div>
|
<div>
|
||||||
<svg-icon class-name="size-icon" icon-class="size" />
|
<svg-icon class-name="size-icon" icon-class="size" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,9 +30,10 @@ export default {
|
|||||||
.app-main {
|
.app-main {
|
||||||
/* 50= navbar 50 */
|
/* 50= navbar 50 */
|
||||||
min-height: calc(100vh - 50px);
|
min-height: calc(100vh - 50px);
|
||||||
|
height: calc(100vh - 50px);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed-header + .app-main {
|
.fixed-header + .app-main {
|
||||||
@ -43,6 +44,7 @@ export default {
|
|||||||
.app-main {
|
.app-main {
|
||||||
/* 84 = navbar + tags-view = 50 + 34 */
|
/* 84 = navbar + tags-view = 50 + 34 */
|
||||||
min-height: calc(100vh - 84px);
|
min-height: calc(100vh - 84px);
|
||||||
|
height: calc(100vh - 84px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed-header + .app-main {
|
.fixed-header + .app-main {
|
||||||
|
@ -1,36 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<!-- <div style="float: left; line-height: 50px;" class="sidebar-logo-container">
|
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
|
||||||
<Logo :collapse="true" />
|
@toggleClick="toggleSideBar" />
|
||||||
</div> -->
|
|
||||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
|
||||||
|
|
||||||
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav" />
|
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav" />
|
||||||
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
|
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
|
||||||
|
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
<template v-if="device!=='mobile'">
|
<!-- <template v-if="device !== 'mobile'">
|
||||||
<search id="header-search" class="right-menu-item" />
|
<search id="header-search" class="right-menu-item" />
|
||||||
|
|
||||||
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
|
<el-tooltip content="源码地址" effect="dark" placement="bottom">
|
||||||
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
|
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|
||||||
<el-tooltip content="文档地址" effect="dark" placement="bottom">
|
<el-tooltip content="文档地址" effect="dark" placement="bottom">
|
||||||
<ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
|
<ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
|
||||||
</el-tooltip> -->
|
</el-tooltip>
|
||||||
|
|
||||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||||
|
|
||||||
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">
|
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||||
</el-tooltip> -->
|
</el-tooltip>
|
||||||
|
|
||||||
</template>
|
</template> -->
|
||||||
|
|
||||||
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="hover">
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<img :src="avatar" class="user-avatar">
|
<img :src="avatar" class="user-avatar">
|
||||||
|
<span class="ml10">{{ name }}</span>
|
||||||
<i class="el-icon-caret-bottom" />
|
<i class="el-icon-caret-bottom" />
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
@ -51,7 +50,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import Logo from "../components/Sidebar/Logo";
|
|
||||||
import Breadcrumb from '@/components/Breadcrumb'
|
import Breadcrumb from '@/components/Breadcrumb'
|
||||||
import TopNav from '@/components/TopNav'
|
import TopNav from '@/components/TopNav'
|
||||||
import Hamburger from '@/components/Hamburger'
|
import Hamburger from '@/components/Hamburger'
|
||||||
@ -63,7 +61,6 @@ import RuoYiDoc from '@/components/RuoYi/Doc'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Logo,
|
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
TopNav,
|
TopNav,
|
||||||
Hamburger,
|
Hamburger,
|
||||||
@ -77,7 +74,8 @@ export default {
|
|||||||
...mapGetters([
|
...mapGetters([
|
||||||
'sidebar',
|
'sidebar',
|
||||||
'avatar',
|
'avatar',
|
||||||
'device'
|
'device',
|
||||||
|
'name'
|
||||||
]),
|
]),
|
||||||
setting: {
|
setting: {
|
||||||
get () {
|
get () {
|
||||||
@ -183,6 +181,9 @@ export default {
|
|||||||
.avatar-wrapper {
|
.avatar-wrapper {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
line-height: initial;
|
||||||
|
|
||||||
.user-avatar {
|
.user-avatar {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@ -195,7 +196,7 @@ export default {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: -20px;
|
right: -20px;
|
||||||
top: 25px;
|
// top: 25px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import logoImg from '@/assets/logo/logo.png'
|
import logoImg from '@/assets/logo/logo.svg'
|
||||||
import variables from '@/assets/styles/variables.scss'
|
import variables from '@/assets/styles/variables.scss'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
export { default as AppMain } from './AppMain'
|
export { default as AppMain } from './AppMain'
|
||||||
export { default as Navbar } from './Navbar'
|
export { default as Navbar } from './Navbar'
|
||||||
// export { default as NavbarNew } from './NavbarNew'
|
|
||||||
export { default as Settings } from './Settings'
|
export { default as Settings } from './Settings'
|
||||||
export { default as Sidebar } from './Sidebar/index.vue'
|
export { default as Sidebar } from './Sidebar/index.vue'
|
||||||
export { default as TagsView } from './TagsView/index.vue'
|
export { default as TagsView } from './TagsView/index.vue'
|
||||||
|
@ -18,7 +18,7 @@ import './assets/icons' // icon
|
|||||||
import './permission' // permission control
|
import './permission' // permission control
|
||||||
import { getDicts } from "@/api/system/dict/data";
|
import { getDicts } from "@/api/system/dict/data";
|
||||||
import { getConfigKey } from "@/api/system/config";
|
import { getConfigKey } from "@/api/system/config";
|
||||||
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
|
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree, addDateRange2 } from "@/utils/ruoyi";
|
||||||
// 分页组件
|
// 分页组件
|
||||||
import Pagination from "@/components/Pagination";
|
import Pagination from "@/components/Pagination";
|
||||||
// 自定义表格工具组件
|
// 自定义表格工具组件
|
||||||
@ -48,6 +48,7 @@ Vue.prototype.selectDictLabel = selectDictLabel
|
|||||||
Vue.prototype.selectDictLabels = selectDictLabels
|
Vue.prototype.selectDictLabels = selectDictLabels
|
||||||
Vue.prototype.download = download
|
Vue.prototype.download = download
|
||||||
Vue.prototype.handleTree = handleTree
|
Vue.prototype.handleTree = handleTree
|
||||||
|
Vue.prototype.addDateRange2 = addDateRange2
|
||||||
|
|
||||||
// 全局组件挂载
|
// 全局组件挂载
|
||||||
Vue.component('DictTag', DictTag)
|
Vue.component('DictTag', DictTag)
|
||||||
@ -71,7 +72,10 @@ DictData.install()
|
|||||||
* Currently MockJs will be used in the production environment,
|
* Currently MockJs will be used in the production environment,
|
||||||
* please remove it before going online! ! !
|
* please remove it before going online! ! !
|
||||||
*/
|
*/
|
||||||
|
Element.Table.props.stripe = { type: Boolean, default: true }
|
||||||
|
Element.Dialog.props.closeOnPressEscape = { type: Boolean, default: false }
|
||||||
|
// Element.Dialog.props.width = { type: Boolean, default: '700' }
|
||||||
|
// Element.Radio.props.border = { type: Boolean, default: true }
|
||||||
Vue.use(Element, {
|
Vue.use(Element, {
|
||||||
size: Cookies.get('size') || 'medium' // set element-ui default size
|
size: Cookies.get('size') || 'medium' // set element-ui default size
|
||||||
})
|
})
|
||||||
|
@ -10,7 +10,7 @@ import { getApplicationId } from './utils/application'
|
|||||||
NProgress.configure({ showSpinner: false })
|
NProgress.configure({ showSpinner: false })
|
||||||
|
|
||||||
const whiteList = ['/login', '/register']
|
const whiteList = ['/login', '/register']
|
||||||
const needApplicationList = ['/build/installationList', '/build/whiteListManagement', '/build/publish']
|
const needApplicationList = ['/build', '/gateway']
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
@ -65,7 +65,8 @@ router.beforeEach((to, from, next) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function checkApplication(path) {
|
function checkApplication(path) {
|
||||||
return needApplicationList.includes(path) && !getApplicationId();
|
return needApplicationList.some(item => path.startsWith(item)) && !getApplicationId()
|
||||||
|
// return needApplicationList.includes(path) && !getApplicationId();
|
||||||
}
|
}
|
||||||
|
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
|
@ -88,20 +88,44 @@ export const constantRoutes = [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
// 本地测试-----------
|
// 本地测试-----------
|
||||||
{
|
// {
|
||||||
path: '/gateway',
|
// path: '/gateway',
|
||||||
component: Layout,
|
// component: Layout,
|
||||||
hidden: true,
|
// hidden: true,
|
||||||
redirect: 'server-config',
|
// redirect: 'server-config',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// // {
|
||||||
path: 'server-config',
|
// // path: 'server-config',
|
||||||
component: () => import('@/views/gateway/server/config/index'),
|
// // component: () => import('@/views/gateway/server/config/index'),
|
||||||
name: 'serverConfig',
|
// // name: 'serverConfig',
|
||||||
meta: { title: '新增服务配置', breadcrumb: false, }
|
// // meta: { title: '新增服务配置', breadcrumb: false, }
|
||||||
}
|
// // },
|
||||||
]
|
// // {
|
||||||
},
|
// // path: 'server-detail',
|
||||||
|
// // component: () => import('@/views/gateway/server/detail'),
|
||||||
|
// // name: 'serverDetail',
|
||||||
|
// // meta: { title: '服务详情', breadcrumb: false, }
|
||||||
|
// // },
|
||||||
|
// // {
|
||||||
|
// // path: 'route-edit',
|
||||||
|
// // component: () => import('@/views/gateway/route/edit'),
|
||||||
|
// // name: 'routeEdit',
|
||||||
|
// // meta: { title: '路由配置', breadcrumb: false, }
|
||||||
|
// // },
|
||||||
|
// // {
|
||||||
|
// // path: 'strategy-edit',
|
||||||
|
// // component: () => import('@/views/gateway/strategy/edit'),
|
||||||
|
// // name: 'strategyEdit',
|
||||||
|
// // meta: { title: '策略配置', breadcrumb: false, }
|
||||||
|
// // },
|
||||||
|
// // {
|
||||||
|
// // path: 'interface-edit',
|
||||||
|
// // component: () => import('@/views/gateway/interface/edit'),
|
||||||
|
// // name: 'interfaceEdit',
|
||||||
|
// // meta: { title: '接口配置', breadcrumb: false, }
|
||||||
|
// // }
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
// 本地测试-----------
|
// 本地测试-----------
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -115,8 +139,7 @@ export const dynamicRoutes = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'role/:userId(\\d+)',
|
path: 'role/:userId(\\d+)',
|
||||||
// component: () => import('@/views/system/user/authRole'),
|
component: () => import('@/views/system/user/authRole'),
|
||||||
component: (resolve) => require(['@/views/system/user/authRole'], resolve),
|
|
||||||
name: 'AuthRole',
|
name: 'AuthRole',
|
||||||
meta: { title: '分配角色', activeMenu: '/system/user' }
|
meta: { title: '分配角色', activeMenu: '/system/user' }
|
||||||
}
|
}
|
||||||
@ -178,139 +201,7 @@ export const dynamicRoutes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/build/install',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
permissions: ['build:install:add'],
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'add',
|
|
||||||
component: () => import('@/views/FDS/installationList/add'),
|
|
||||||
name: 'InstallAdd',
|
|
||||||
meta: { title: '新增安装包', activeMenu: '/build/installationList' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: '/build/install',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
permissions: ['build:install:edit'],
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'edit',
|
|
||||||
component: () => import('@/views/FDS/installationList/edit'),
|
|
||||||
name: 'InstallEdit',
|
|
||||||
meta: { title: '编辑安装包', activeMenu: '/build/installationList' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: '/build/install',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
permissions: ['build:install:detail'],
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'detail',
|
|
||||||
component: () => import('@/views/FDS/installationList/detail'),
|
|
||||||
name: 'InstallDetail',
|
|
||||||
meta: { title: '安装包详情', activeMenu: '/build/installationList' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: '/build/publishList',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
permissions: ['build:publishList:add'],
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'add',
|
|
||||||
component: () => import('@/views/FDS/publishList/add'),
|
|
||||||
name: 'PublishAdd',
|
|
||||||
meta: { title: '新增发布', activeMenu: '/build/publish' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/build/publishList',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
permissions: ['build:publishList:detail'],
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'detail',
|
|
||||||
component: () => import('@/views/FDS/publishList/detail'),
|
|
||||||
name: 'PublishDetail',
|
|
||||||
meta: { title: '发布详情', activeMenu: '/build/publish' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: '/build/whiteList',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
permissions: ['build:whiteListManagement:add'],
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'add',
|
|
||||||
component: () => import('@/views/FDS/whiteListManagement/add'),
|
|
||||||
name: 'WhiteListManagementAdd',
|
|
||||||
meta: { title: '新增白名单', activeMenu: '/build/whiteListManagement' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: '/build/whiteList',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
permissions: ['build:whiteListManagement:detail'],
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'detail',
|
|
||||||
component: () => import('@/views/FDS/whiteListManagement/detail'),
|
|
||||||
name: 'WhiteListManagementDetail',
|
|
||||||
meta: { title: '白名单详情', activeMenu: '/build/whiteListManagement' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: '/build/whiteList',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
permissions: ['build:whiteListManagement:equepDetail'],
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'equepDetail',
|
|
||||||
component: () => import('@/views/FDS/whiteListManagement/equepDetail'),
|
|
||||||
name: 'WhiteListManagementEquepDetail',
|
|
||||||
meta: { title: '白名单设备详情', activeMenu: '/build/whiteListManagement' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: '/build/whiteList',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
permissions: ['build:whiteListManagement:addConfig'],
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'addConfig',
|
|
||||||
component: () => import('@/views/FDS/whiteListManagement/addConfig'),
|
|
||||||
name: 'WhiteListManagementConfigAdd',
|
|
||||||
meta: { title: '新增白名单配置', activeMenu: '/build/whiteListManagement' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dyn
|
|||||||
const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
|
const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
|
||||||
const state = {
|
const state = {
|
||||||
title: '',
|
title: '',
|
||||||
theme: storageSetting.theme || '#409EFF',
|
theme: storageSetting.theme || '#3F68FF',
|
||||||
sideTheme: storageSetting.sideTheme || sideTheme,
|
sideTheme: storageSetting.sideTheme || sideTheme,
|
||||||
showSettings: showSettings,
|
showSettings: showSettings,
|
||||||
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
|
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
|
||||||
|
@ -37,8 +37,8 @@ const user = {
|
|||||||
state.permissions = permissions
|
state.permissions = permissions
|
||||||
},
|
},
|
||||||
SET_APPLICATION: (state, applicationInfo) => {
|
SET_APPLICATION: (state, applicationInfo) => {
|
||||||
const { id } = applicationInfo
|
const { appCode } = applicationInfo
|
||||||
state.applicationId = id || ''
|
state.applicationId = appCode || ''
|
||||||
state.applicationInfo = applicationInfo
|
state.applicationInfo = applicationInfo
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -66,7 +66,7 @@ const user = {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getInfo().then(res => {
|
getInfo().then(res => {
|
||||||
const user = res.user
|
const user = res.user
|
||||||
const avatar = (user.avatar == '' || user.avatar == null) ? require('@/assets/images/profile.jpg') : process.env.VUE_APP_BASE_API + user.avatar
|
const avatar = (user.avatar == '' || user.avatar == null) ? require('@/assets/images/profile.png') : process.env.VUE_APP_BASE_API + user.avatar
|
||||||
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||||
commit('SET_ROLES', res.roles)
|
commit('SET_ROLES', res.roles)
|
||||||
commit('SET_PERMISSIONS', res.permissions)
|
commit('SET_PERMISSIONS', res.permissions)
|
||||||
@ -113,9 +113,9 @@ const user = {
|
|||||||
// 设置选中的项目应用信息
|
// 设置选中的项目应用信息
|
||||||
SetApplication ({ commit }, applicationInfo) {
|
SetApplication ({ commit }, applicationInfo) {
|
||||||
commit('SET_APPLICATION', applicationInfo)
|
commit('SET_APPLICATION', applicationInfo)
|
||||||
const { id, appName } = applicationInfo || {}
|
const { appCode, appName, isAdmin } = applicationInfo || {}
|
||||||
if (id) {
|
if (appCode) {
|
||||||
setApplicationId(applicationInfo.id)
|
setApplicationId(appCode)
|
||||||
Cookies.set('Admin-Application-appCode', applicationInfo.appCode)
|
Cookies.set('Admin-Application-appCode', applicationInfo.appCode)
|
||||||
} else {
|
} else {
|
||||||
removeApplicationId()
|
removeApplicationId()
|
||||||
@ -126,6 +126,14 @@ const user = {
|
|||||||
} else {
|
} else {
|
||||||
removeApplicationName()
|
removeApplicationName()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (isAdmin) {
|
||||||
|
Cookies.set('Admin-isAdmin', isAdmin)
|
||||||
|
} else {
|
||||||
|
Cookies.set('Admin-isAdmin', 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
3
sf-ui/src/utils/eventBus.js
Normal file
3
sf-ui/src/utils/eventBus.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import vue from 'vue'
|
||||||
|
const EventBus = new vue();
|
||||||
|
export default EventBus;
|
@ -7,6 +7,7 @@ import { blobValidate, tansParams } from '@/utils/ruoyi'
|
|||||||
import cache from '@/plugins/cache'
|
import cache from '@/plugins/cache'
|
||||||
import { saveAs } from 'file-saver'
|
import { saveAs } from 'file-saver'
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
|
import router from '@/router'
|
||||||
|
|
||||||
let downloadLoadingInstance
|
let downloadLoadingInstance
|
||||||
// 是否显示重新登录
|
// 是否显示重新登录
|
||||||
@ -97,6 +98,15 @@ service.interceptors.response.use(res => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||||
|
} else if (code === 4030) {
|
||||||
|
MessageBox.confirm('AppCode未找到,请重新选择项目。', '系统提示', {
|
||||||
|
confirmButtonText: '重新选择',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
router.push('/')
|
||||||
|
})
|
||||||
|
return Promise.reject('AppCode未找到,请重新选择项目。')
|
||||||
} else if (code === 500) {
|
} else if (code === 500) {
|
||||||
Message({ message: msg, type: 'error' })
|
Message({ message: msg, type: 'error' })
|
||||||
return Promise.reject(new Error(msg))
|
return Promise.reject(new Error(msg))
|
||||||
|
@ -68,6 +68,25 @@ export function addDateRange(params, dateRange, propName) {
|
|||||||
return search;
|
return search;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 添加日期范围
|
||||||
|
export function addDateRange2 (params, dateRange, propName) {
|
||||||
|
let search = params;
|
||||||
|
search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
|
||||||
|
dateRange = Array.isArray(dateRange) ? dateRange : [];
|
||||||
|
if (typeof (propName) === 'undefined') {
|
||||||
|
search.beginTime = dateRange[0];
|
||||||
|
search.endTime = dateRange[1];
|
||||||
|
} else {
|
||||||
|
search.params['begin' + propName] = dateRange[0];
|
||||||
|
search.params['end' + propName] = dateRange[1];
|
||||||
|
}
|
||||||
|
return search;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 回显数据字典
|
// 回显数据字典
|
||||||
export function selectDictLabel (datas, value) {
|
export function selectDictLabel (datas, value) {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
|
@ -8,25 +8,29 @@
|
|||||||
<el-main>
|
<el-main>
|
||||||
<div class="form-main">
|
<div class="form-main">
|
||||||
<el-form ref="elForm" :model="formData" :rules="rules" label-width="100px" size="medium">
|
<el-form ref="elForm" :model="formData" :rules="rules" label-width="100px" size="medium">
|
||||||
<!-- <el-form-item label="上传方式" prop="uploadingType">-->
|
<el-form-item label="上传方式" prop="uploadingType">
|
||||||
<!-- <el-radio-group v-model="formData.uploadingType" size="medium">-->
|
<el-radio-group v-model="formData.uploadingType" size="medium">
|
||||||
<!-- <el-radio v-for="(item, index) in dict.type.sys_apk_uploading_type" :key="index"-->
|
<el-radio v-for="(item, index) in dict.type.sys_apk_uploading_type" :key="index"
|
||||||
<!-- :disabled="item.disabled"-->
|
:disabled="item.disabled"
|
||||||
<!-- :label="item.value"-->
|
:label="item.value"
|
||||||
<!-- >{{ item.label }}-->
|
>{{ item.label }}
|
||||||
<!-- </el-radio>-->
|
</el-radio>
|
||||||
<!-- </el-radio-group>-->
|
</el-radio-group>
|
||||||
<!-- </el-form-item>-->
|
</el-form-item>
|
||||||
<el-form-item v-if="activeTabs==='1'" label="安装包名称" prop="sysApkName">
|
<el-form-item v-if="activeTabs==='1'" label="安装包名称" prop="sysApkName">
|
||||||
<el-input v-model="formData.sysApkName" :style="{width: '100%'}" clearable placeholder="请输入安装包名称">
|
<el-input v-model="formData.sysApkName" :style="{width: '100%'}" clearable placeholder="请输入安装包名称">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item v-else label="模块包名称" prop="field107">-->
|
||||||
|
<!-- <el-input v-model="formData.field107" :style="{width: '100%'}" clearable placeholder="请输入模块包名称">-->
|
||||||
|
<!-- </el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
<el-form-item label="版本号" prop="version">
|
<el-form-item label="版本号" prop="version">
|
||||||
<el-input v-model="formData.version" :style="{width: '100%'}" clearable placeholder="请输入版本号">
|
<el-input v-model="formData.version" :style="{width: '100%'}" clearable placeholder="请输入版本号">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="安装包文件" prop="sysApk">
|
<el-form-item label="安装包文件" prop="sysApk">
|
||||||
<file-upload v-model="formData.sysApk" :fileSize="50" :fileType="['apk','hap','iap','zip']" :limit="1"
|
<file-upload v-model="formData.sysApk" :fileType="['apk','txt']" :limit="1"
|
||||||
@getSize="getSize"
|
@getSize="getSize"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -43,6 +47,16 @@
|
|||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item v-if="activeTabs!='1'" label="适用模块" prop="configName">-->
|
||||||
|
<!-- <el-select v-model="formData.field108" clearable placeholder="请选择对应的模块">-->
|
||||||
|
<!-- <el-option-->
|
||||||
|
<!-- v-for="dict in dict.type.sys_yes_no"-->
|
||||||
|
<!-- :key="dict.value"-->
|
||||||
|
<!-- :label="dict.label"-->
|
||||||
|
<!-- :value="dict.value"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </el-select>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
<el-form-item size="large">
|
<el-form-item size="large">
|
||||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
@ -63,7 +77,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formData: {
|
formData: {
|
||||||
uploadingType: 'OnLineUploading',
|
uploadingType: 'OffLineUploading',
|
||||||
sysApkName: undefined,
|
sysApkName: undefined,
|
||||||
version: undefined,
|
version: undefined,
|
||||||
sysApk: null,
|
sysApk: null,
|
||||||
@ -109,7 +123,6 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getSize(e) {
|
getSize(e) {
|
||||||
console.log(e)
|
|
||||||
this.formData.sysApkSize = e[0].size + 'kb'
|
this.formData.sysApkSize = e[0].size + 'kb'
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -27,11 +27,11 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="activeTabs!='1'" label="适用模块:">登录模块</el-form-item>
|
<el-form-item v-if="activeTabs!='1'" label="适用模块:">登录模块</el-form-item>
|
||||||
<el-form-item label="上传时间:">{{ form.createTime }}</el-form-item>
|
<el-form-item label="上传时间:">{{ form.createTime }}</el-form-item>
|
||||||
<!-- <el-form-item label="上传状态:">-->
|
<el-form-item label="上传状态:">
|
||||||
<!-- <dict-tag :options="dict.type.uploading_status" :value="form.uploadingStatus"/>-->
|
<dict-tag :options="dict.type.uploading_status" :value="form.uploadingStatus"/>
|
||||||
<!-- </el-form-item>-->
|
</el-form-item>
|
||||||
<el-form-item label="上传人员:">{{ form.created }}</el-form-item>
|
<el-form-item label="上传人员:">{{ form.created }}</el-form-item>
|
||||||
<!-- <el-form-item label="上传日志:"></el-form-item>-->
|
<el-form-item label="上传日志:">日志日志</el-form-item>
|
||||||
<el-form-item size="large">
|
<el-form-item size="large">
|
||||||
<el-button @click="cancel">关 闭</el-button>
|
<el-button @click="cancel">关 闭</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -8,27 +8,30 @@
|
|||||||
<el-main>
|
<el-main>
|
||||||
<div class="form-main">
|
<div class="form-main">
|
||||||
<el-form ref="elForm" :model="formData" :rules="rules" label-width="100px" size="medium">
|
<el-form ref="elForm" :model="formData" :rules="rules" label-width="100px" size="medium">
|
||||||
<!-- <el-form-item label="上传方式" prop="uploadingType">-->
|
<el-form-item label="上传方式" prop="uploadingType">
|
||||||
<!-- <el-radio-group v-model="formData.uploadingType" size="medium">-->
|
<el-radio-group v-model="formData.uploadingType" size="medium">
|
||||||
<!-- <el-radio v-for="(item, index) in dict.type.sys_apk_uploading_type" :key="index"-->
|
<el-radio v-for="(item, index) in dict.type.sys_apk_uploading_type" :key="index"
|
||||||
<!-- :disabled="item.disabled"-->
|
:disabled="item.disabled"
|
||||||
<!-- :label="item.value"-->
|
:label="item.value"
|
||||||
<!-- >{{ item.label }}-->
|
>{{ item.label }}
|
||||||
<!-- </el-radio>-->
|
</el-radio>
|
||||||
<!-- </el-radio-group>-->
|
</el-radio-group>
|
||||||
<!-- </el-form-item>-->
|
</el-form-item>
|
||||||
<el-form-item v-if="activeTabs==='1'" label="安装包名称" prop="sysApkName">
|
<el-form-item v-if="activeTabs==='1'" label="安装包名称" prop="sysApkName">
|
||||||
<el-input v-model="formData.sysApkName" :style="{width: '100%'}" clearable placeholder="请输入安装包名称">
|
<el-input v-model="formData.sysApkName" :style="{width: '100%'}" clearable placeholder="请输入安装包名称">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item v-else label="模块包名称" prop="field107">-->
|
||||||
|
<!-- <el-input v-model="formData.field107" :style="{width: '100%'}" clearable placeholder="请输入模块包名称">-->
|
||||||
|
<!-- </el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
<el-form-item label="版本号" prop="version">
|
<el-form-item label="版本号" prop="version">
|
||||||
<el-input v-model="formData.version" :style="{width: '100%'}" clearable placeholder="请输入版本号">
|
<el-input v-model="formData.version" :style="{width: '100%'}" clearable placeholder="请输入版本号">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="安装包文件" prop="sysApk">
|
<el-form-item label="安装包文件" prop="sysApk">
|
||||||
|
|
||||||
<file-upload v-model="formData.sysApk" :fileSize="50" :fileType="['apk','hap','iap','zip']" :limit="1"
|
<file-upload v-model="formData.sysApk" :fileType="['apk','txt']" :limit="1"
|
||||||
:uploadFileUrl="formData.uploadingType==='OffLineUploading'?'/system/oss/zip/upload':'/system/oss/upload'"
|
|
||||||
@getSize="getSize"
|
@getSize="getSize"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -45,6 +48,16 @@
|
|||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item v-if="activeTabs!='1'" label="适用模块" prop="configName">-->
|
||||||
|
<!-- <el-select v-model="formData.field108" clearable placeholder="请选择对应的模块">-->
|
||||||
|
<!-- <el-option-->
|
||||||
|
<!-- v-for="dict in dict.type.sys_yes_no"-->
|
||||||
|
<!-- :key="dict.value"-->
|
||||||
|
<!-- :label="dict.label"-->
|
||||||
|
<!-- :value="dict.value"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </el-select>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
<el-form-item size="large">
|
<el-form-item size="large">
|
||||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
@ -1,39 +1,68 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="120px" size="small">
|
<el-tabs v-model="activeTabs" type="card" @tab-click="handleClickTabs">
|
||||||
<!-- <el-form-item label="上传类型" prop="uploadingType">-->
|
<el-tab-pane
|
||||||
<!-- <el-select v-model="queryParams.uploadingType" placeholder="请选择上传类型" clearable>-->
|
v-for="item in packTabs"
|
||||||
<!-- <el-option-->
|
:key="item.name"
|
||||||
<!-- v-for="dict in dict.type.sys_apk_uploading_type"-->
|
:label="item.title"
|
||||||
<!-- :key="dict.value"-->
|
:name="item.name"
|
||||||
<!-- :label="dict.label"-->
|
>
|
||||||
<!-- :value="dict.value"-->
|
</el-tab-pane>
|
||||||
<!-- />-->
|
</el-tabs>
|
||||||
<!-- </el-select>-->
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px" size="small">
|
||||||
<!-- </el-form-item>-->
|
<el-form-item label="上传类型" prop="uploadingType">
|
||||||
|
<el-select v-model="queryParams.uploadingType" clearable placeholder="请选择上传类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.sys_apk_uploading_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="安装包名称" prop="sysApkName">
|
<el-form-item label="安装包名称" prop="sysApkName">
|
||||||
<el-input v-model="queryParams.sysApkName" clearable placeholder="请输入安装包名称" @keyup.enter.native="handleQuery" />
|
<el-input
|
||||||
|
v-model="queryParams.sysApkName"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入安装包名称"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="版本号" prop="version">
|
<el-form-item label="版本号" prop="version">
|
||||||
<el-input v-model="queryParams.version" clearable placeholder="请输入版本号" @keyup.enter.native="handleQuery" />
|
<el-input
|
||||||
|
v-model="queryParams.version"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入版本号"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="安装包类型" prop="sysType">
|
<el-form-item label="安装包类型" prop="sysType">
|
||||||
<el-select v-model="queryParams.sysType" clearable placeholder="请选择安装包类型">
|
<el-select v-model="queryParams.sysType" clearable placeholder="请选择安装包类型">
|
||||||
<el-option v-for="dict in dict.type.sys_apk_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
<el-option
|
||||||
|
v-for="dict in dict.type.sys_apk_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="上传状态" prop="uploadingStatus">
|
||||||
|
<el-select v-model="queryParams.uploadingStatus" clearable placeholder="请选择上传状态">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.uploading_status"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="上传状态" prop="uploadingStatus">-->
|
|
||||||
<!-- <el-select v-model="queryParams.uploadingStatus" clearable placeholder="请选择上传状态">-->
|
|
||||||
<!-- <el-option-->
|
|
||||||
<!-- v-for="dict in dict.type.uploading_status"-->
|
|
||||||
<!-- :key="dict.value"-->
|
|
||||||
<!-- :label="dict.label"-->
|
|
||||||
<!-- :value="dict.value"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </el-select>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<el-form-item label="创建人" prop="created">
|
<el-form-item label="创建人" prop="created">
|
||||||
<el-input v-model="queryParams.created" clearable placeholder="请输入创建人" @keyup.enter.native="handleQuery" />
|
<el-input
|
||||||
|
v-model="queryParams.created"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入创建人"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||||
@ -43,45 +72,41 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPermi="['deploy:INFO:add']" icon="el-icon-plus" plain size="mini" type="primary"
|
<el-button
|
||||||
@click="handleAdd">新增
|
v-hasPermi="['system:config:add']"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新建
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="1.5">-->
|
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- v-hasPermi="['deploy:INFO:edit']"-->
|
|
||||||
<!-- :disabled="single"-->
|
|
||||||
<!-- icon="el-icon-edit"-->
|
|
||||||
<!-- plain-->
|
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- type="success"-->
|
|
||||||
<!-- @click="handleUpdate"-->
|
|
||||||
<!-- >修改-->
|
|
||||||
<!-- </el-button>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPermi="['deploy:INFO:remove']" :disabled="multiple" icon="el-icon-delete" plain size="mini"
|
<el-button
|
||||||
type="danger" @click="handleDelete">批量删除
|
v-hasPermi="['system:config:delete']"
|
||||||
|
:disabled="multiple"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
type="info"
|
||||||
|
@click="handleDelete"
|
||||||
|
>批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table v-loading="loading" :data="INFOList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="INFOList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column align="center" type="selection" width="55"/>
|
<el-table-column align="center" type="selection" width="55"/>
|
||||||
<el-table-column align="center" label="安装包名称" prop="sysApkName" />
|
<template v-if="activeTabs=='1'">
|
||||||
<el-table-column align="center" label="版本号" prop="version" />
|
<el-table-column align="center" label="上传类型" prop="uploadingType">
|
||||||
<el-table-column align="center" label="安装包" prop="sysApk">
|
|
||||||
<template slot="header" slot-scope="scope">
|
|
||||||
<span>安装包</span>
|
|
||||||
<el-tooltip placement="top">
|
|
||||||
<div slot="content">复制当前的安装包地址</div>
|
|
||||||
<i class="el-icon-warning-outline" size="20"></i>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button icon="el-icon-copy" type="primary" @click="copyIt(scope.row.sysApk)">复制</el-button>
|
<dict-tag :options="dict.type.sys_apk_uploading_type" :value="scope.row.uploadingType"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="安装包名称" prop="sysApkName"/>
|
||||||
|
<el-table-column align="center" label="版本号" prop="version"/>
|
||||||
|
<el-table-column align="center" label="安装包" prop="sysApk"/>
|
||||||
<el-table-column align="center" label="安装包大小" prop="sysApkSize"/>
|
<el-table-column align="center" label="安装包大小" prop="sysApkSize"/>
|
||||||
<el-table-column align="center" label="安装包类型" prop="sysType">
|
<el-table-column align="center" label="安装包类型" prop="sysType">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -89,113 +114,78 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="创建人" prop="created"/>
|
<el-table-column align="center" label="创建人" prop="created"/>
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
|
</template>
|
||||||
|
<template v-if="activeTabs=='2'">
|
||||||
|
<el-table-column align="center" label="安装包名称" prop="configId"/>
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="版本号" prop="version"/>
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="安装包大小" prop="sys_apk_size"/>
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="上传方式" prop="uploading_type"/>
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="创建人" prop="created"/>
|
||||||
|
<el-table-column align="center" label="创建时间" prop="create_time" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
<el-button icon="el-icon-download" size="mini" type="text" @click="handleDownload(scope.row)">下载安装包
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</template>
|
||||||
|
<el-table-column align="center" label="状态" prop="uploading_status">
|
||||||
|
<template slot-scope="scopeA">
|
||||||
|
<dict-tag :options="dict.type.uploading_status" :value="scopeA.row.uploadingStatus"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="250">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['system:config:dowmload']"
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleDownload(scope.row)"
|
||||||
|
>下载安装包
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
<el-button v-hasPermi="['deploy:INFO:edit']" icon="el-icon-edit" size="mini" type="text"
|
v-hasPermi="['system:config:edit']"
|
||||||
@click="handleUpdate(scope.row)">修改
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleEdit(scope.row)"
|
||||||
|
>编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
<el-button icon="el-icon-view" size="mini" type="text" @click="handleDetail(scope.row)">详情
|
v-hasPermi="['system:config:detail']"
|
||||||
|
icon="el-icon-view"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleDetail(scope.row)"
|
||||||
|
>详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-hasPermi="['deploy:INFO:remove']" icon="el-icon-delete" size="mini" type="text"
|
<el-button
|
||||||
@click="handleDelete(scope.row)">删除
|
v-hasPermi="['system:config:delete']"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<pagination
|
||||||
<pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum" :total="total"
|
v-show="total>0"
|
||||||
@pagination="getList" />
|
:limit.sync="queryParams.pageSize"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
<!-- 添加或修改安装包管理(新)对话框 -->
|
:total="total"
|
||||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="700px">
|
@pagination="getList"
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
/>
|
||||||
|
|
||||||
<el-form-item label="安装包名称" prop="sysApkName">
|
|
||||||
<el-input v-model="form.sysApkName" placeholder="请输入安装包名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="版本号" prop="version">
|
|
||||||
<el-input v-model="form.version" placeholder="请输入版本号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="安装包" prop="sysApk">
|
|
||||||
<file-upload v-model="form.sysApk" :accept="['.zip', '.apk', '.hap', '.iap']" :fileSize="50"
|
|
||||||
:fileType="['apk', 'hap', 'iap', 'zip']" :limit="1" uploadFileUrl="/system/oss/upload" @getSize="getSize" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="安装包大小" prop="sysApkSize">
|
|
||||||
<el-input v-model="form.sysApkSize" placeholder="请输入安装包大小" readonly />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="安装包类型" prop="sysType">
|
|
||||||
<el-select v-model="form.sysType" placeholder="请选择安装包类型">
|
|
||||||
<el-option v-for="dict in dict.type.sys_apk_type" :key="dict.value" :label="dict.label"
|
|
||||||
:value="dict.value"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
|
|
||||||
<el-dialog :title="title" :visible.sync="openDetail" append-to-body width="700px">
|
|
||||||
<el-form ref="form" :model="form" label-width="120px">
|
|
||||||
<el-form-item label="安装包名称" prop="moduleName">
|
|
||||||
{{ form.sysApkName }}
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="版本号" prop="version">
|
|
||||||
{{ form.version }}
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="安装包" prop="moduleUrl">
|
|
||||||
{{ form.sysApk }}
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="安装包大小" prop="moduleSize">
|
|
||||||
{{ form.sysApkSize }}
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="系统类型" prop="sysType">
|
|
||||||
{{ form.sysType }}
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="下载地址:">
|
|
||||||
<el-input v-model="form.sysApk" class="input-with-select" readonly>
|
|
||||||
<el-button slot="append" @click="copyIt(form.sysApk)">复制</el-button>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="上传时间:">{{ form.createTime }}</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="上传人员:">{{ form.created }}</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="cancelDetail">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { addINFO, delINFO, getINFO, listINFO, updateINFO } from '@/api/FDS/installList'
|
import { delINFO, listINFO } from '@/api/FDS/installList'
|
||||||
import Cookies from 'js-cookie'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'INFO',
|
name: 'InstallationList',
|
||||||
dicts: ['sys_apk_uploading_type', 'uploading_status', 'sys_apk_type'],
|
dicts: ['sys_apk_uploading_type', 'uploading_status', 'sys_apk_type'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
form: {
|
|
||||||
uploadingType: 'OnLineUploading',
|
|
||||||
sysApkName: undefined,
|
|
||||||
version: undefined,
|
|
||||||
sysApk: null,
|
|
||||||
sysApkSize: undefined,
|
|
||||||
sysType: '',
|
|
||||||
appCode: Cookies.get('Admin-Application-appCode')
|
|
||||||
},
|
|
||||||
|
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@ -210,11 +200,15 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
// 安装包管理(新)表格数据
|
// 安装包管理(新)表格数据
|
||||||
INFOList: [],
|
INFOList: [],
|
||||||
// 弹出层标题
|
packTabs: [{
|
||||||
title: '',
|
name: '1',
|
||||||
// 是否显示弹出层
|
title: 'APP安装包'
|
||||||
open: false,
|
}, {
|
||||||
openDetail: false,
|
name: '2',
|
||||||
|
title: 'H5模块包'
|
||||||
|
}],
|
||||||
|
// 日期范围
|
||||||
|
create_time: [],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -226,24 +220,15 @@ export default {
|
|||||||
uploadingStatus: null,
|
uploadingStatus: null,
|
||||||
created: null
|
created: null
|
||||||
},
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
activeTabs: '1'
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
|
||||||
uploadingType: [
|
|
||||||
{ required: true, message: '上传类型不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
sysApkName: [
|
|
||||||
{ required: true, message: '安装包名称不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
version: [
|
|
||||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
sysType: [
|
|
||||||
{ required: true, message: '安装包类型不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
sysApk: [
|
|
||||||
{ required: true, message: '安装包不能为空', trigger: 'change' }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
$route(to, from) {
|
||||||
|
if (to) this.getList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -252,31 +237,13 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
/** 查询安装包管理(新)列表 */
|
/** 查询安装包管理(新)列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = false
|
||||||
listINFO(this.queryParams).then(response => {
|
listINFO(this.queryParams).then(response => {
|
||||||
this.INFOList = response.rows
|
this.INFOList = response.rows
|
||||||
this.total = response.total
|
this.total = response.total
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 取消按钮
|
|
||||||
cancel () {
|
|
||||||
this.open = false
|
|
||||||
this.reset()
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset () {
|
|
||||||
this.form = {
|
|
||||||
uploadingType: 'OnLineUploading',
|
|
||||||
sysApkName: undefined,
|
|
||||||
version: undefined,
|
|
||||||
sysApk: null,
|
|
||||||
sysApkSize: undefined,
|
|
||||||
sysType: '',
|
|
||||||
appCode: Cookies.get('Admin-Application-appCode')
|
|
||||||
}
|
|
||||||
this.resetForm('form')
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1
|
this.queryParams.pageNum = 1
|
||||||
@ -284,99 +251,77 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
|
this.create_time = []
|
||||||
this.resetForm('queryForm')
|
this.resetForm('queryForm')
|
||||||
this.handleQuery()
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
const query = {
|
||||||
|
activeTabs: this.activeTabs
|
||||||
|
}
|
||||||
|
this.$router.push({
|
||||||
|
path: '/build/install/add/',
|
||||||
|
query: query
|
||||||
|
})
|
||||||
|
// this.$tab.openPage('新增安装包', '/build/install/add/', params)
|
||||||
|
|
||||||
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map(item => item.id)
|
||||||
this.single = selection.length !== 1
|
this.single = selection.length != 1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd () {
|
|
||||||
this.reset()
|
|
||||||
this.open = true
|
|
||||||
this.title = '添加安装包管理'
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate (row) {
|
|
||||||
this.reset()
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getINFO(id).then(response => {
|
|
||||||
this.form = response.data
|
|
||||||
this.open = true
|
|
||||||
this.title = '修改安装包管理'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 详情按钮操作 */
|
|
||||||
handleDetail (row) {
|
|
||||||
this.reset()
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getINFO(id).then(response => {
|
|
||||||
this.form = response.data
|
|
||||||
this.openDetail = true
|
|
||||||
this.title = '安装包详情'
|
|
||||||
this.type = 'detail'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm () {
|
|
||||||
this.$refs['form'].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
let data = Object.assign({}, this.form)
|
|
||||||
data.appCode = Cookies.get('Admin-Application-appCode')
|
|
||||||
delete data.explain
|
|
||||||
updateINFO(data).then(response => {
|
|
||||||
this.$modal.msgSuccess('修改成功')
|
|
||||||
this.open = false
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
addINFO(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess('新增成功')
|
|
||||||
this.open = false
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids
|
const configIds = row.id || this.ids
|
||||||
this.$modal.confirm('是否确认删除安装包管理编号为"' + ids + '"的数据项?').then(function () {
|
this.$modal.confirm('是否确认删除编号为"' + configIds + '"的数据项?').then(function() {
|
||||||
return delINFO(ids)
|
return delINFO(configIds)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.$modal.msgSuccess('删除成功')
|
this.$modal.msgSuccess('删除成功')
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getSize (e) {
|
/** 修改按钮操作 */
|
||||||
this.form.sysApkSize = e[0].size + 'kb'
|
handleEdit(row) {
|
||||||
},
|
const query = {
|
||||||
// /** 导出按钮操作 */
|
activeTabs: this.activeTabs,
|
||||||
// handleExport() {
|
id: row.id
|
||||||
// this.download('deploy/INFO/export', {
|
}
|
||||||
// ...this.queryParams
|
this.$router.push({
|
||||||
// }, `INFO_${new Date().getTime()}.xlsx`)
|
path: '/build/install/edit/',
|
||||||
// },
|
query: query
|
||||||
|
})
|
||||||
|
|
||||||
/**下载安装包*/
|
// this.$tab.openPage('编辑安装包', '/build/install/add/', params)
|
||||||
|
},
|
||||||
|
/** 查看详情弹窗 **/
|
||||||
|
handleDetail(row) {
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
id: row.id
|
||||||
|
}
|
||||||
|
this.$tab.openPage('安装包详情', '/build/install/detail/', params)
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 切换TAB触发的事件 */
|
||||||
|
handleClickTabs() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 下载按钮 */
|
||||||
handleDownload(row) {
|
handleDownload(row) {
|
||||||
window.open(row.sysApk)
|
const configIds = row.id || this.ids
|
||||||
},
|
this.$modal.confirm('是否确认下载编号为"' + configIds + '"的数据项?').then(function() {
|
||||||
cancelDetail () {
|
return delConfig(configIds)
|
||||||
this.openDetail = false
|
}).then(() => {
|
||||||
this.reset()
|
this.getList()
|
||||||
},
|
this.$modal.msgSuccess('下载成功')
|
||||||
copyIt (url) {
|
}).catch(() => {
|
||||||
navigator.clipboard.writeText(url)
|
})
|
||||||
this.$message.success('复制成功')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,48 +1,55 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :modal-append-to-body="false" :title="title"
|
<el-dialog :modal-append-to-body="false" :title="title" v-bind="$attrs" width="700px"
|
||||||
:visible.sync="open" v-bind="$attrs" width="700px" @close="onClose" @open="onOpen" v-on="$listeners">
|
@close="onClose"
|
||||||
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px" size="small">
|
@open="onOpen"
|
||||||
|
v-on="$listeners"
|
||||||
|
>
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-form-item label="安装包名称" prop="installpackName">
|
<el-form-item label="安装包名称" prop="installpackName">
|
||||||
<el-input v-model="queryParams.sysApkName" clearable placeholder="请输入安装包名称" style="width: 240px"
|
<el-input
|
||||||
@keyup.enter.native="handleQuery" />
|
v-model="queryParams.installpackName"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入安装包名称"
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table v-loading="loading" :data="moduleList">
|
<el-table v-loading="loading" :data="dataList">
|
||||||
<el-table-column align="center" label="安装包名称" prop="sysApkName" />
|
<el-table-column align="center" label="安装包名称" prop="configId"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="版本号" prop="version" />
|
<el-table-column :show-overflow-tooltip="true" align="center" label="版本号" prop="configName"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="安装包大小" prop="sysApkSize" />
|
<el-table-column :show-overflow-tooltip="true" align="center" label="安装包大小" prop="configName"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="适用系统" prop="sysType" />
|
<el-table-column :show-overflow-tooltip="true" align="center" label="适用系统" prop="configValue"/>
|
||||||
<!-- <el-table-column align="center" label="状态" prop="uploadingStatus">-->
|
<el-table-column align="center" label="状态" prop="configType">
|
||||||
<!-- <template slot-scope="scopeA">-->
|
<template slot-scope="scopeA">
|
||||||
<!-- <dict-tag :options="dict.type.sys_yes_no" :value="scopeA.row.type"/>-->
|
<dict-tag :options="dict.type.sys_yes_no" :value="scopeA.row.type"/>
|
||||||
<!-- </template>-->
|
</template>
|
||||||
<!-- </el-table-column>-->
|
</el-table-column>
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="50">
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="50">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button circle icon="el-icon-plus" size="20" type="primary" @click="addPack(scope.row)"></el-button>
|
<el-button circle icon="el-icon-plus" size="20" type="primary" @click="addPack"
|
||||||
|
></el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<!-- <div slot="footer" class="dialog-footer">-->
|
||||||
|
<!-- <el-button type="primary" @click="submitAddForm()">确 定</el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { listINFO } from '@/api/FDS/installList'
|
import { listConfig } from '@/api/system/config'
|
||||||
import Cookies from 'js-cookie'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddPack',
|
name: 'AddPack',
|
||||||
dicts: ['sys_yes_no'],
|
dicts: ['sys_yes_no'],
|
||||||
props: {
|
|
||||||
systemType: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
@ -50,19 +57,18 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
configName: undefined,
|
configName: undefined,
|
||||||
form: {},
|
form: {},
|
||||||
moduleList: [],
|
dataList: [],
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
total: 0,
|
total: 0,
|
||||||
open: true,
|
|
||||||
// 白名单配置表单验证
|
// 白名单配置表单验证
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
sysApkName: null,
|
installpackName: undefined
|
||||||
appCode: Cookies.get('Admin-Application-appCode')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
@ -72,15 +78,12 @@ export default {
|
|||||||
/** 查询参数列表 */
|
/** 查询参数列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
listINFO(
|
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
{
|
this.dataList = response.rows
|
||||||
...this.queryParams,
|
|
||||||
sysType: this.systemType
|
|
||||||
}).then(response => {
|
|
||||||
this.moduleList = response.rows
|
|
||||||
this.total = response.total
|
this.total = response.total
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
}
|
||||||
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
@ -94,16 +97,14 @@ export default {
|
|||||||
this.resetForm('queryForm')
|
this.resetForm('queryForm')
|
||||||
this.handleQuery()
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
|
// 确定安装包
|
||||||
|
submitAddForm() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
/** 新增当前包的按钮 */
|
/** 新增当前包的按钮 */
|
||||||
addPack (row) {
|
addPack() {
|
||||||
this.$emit('addPack', {
|
|
||||||
apkId: row.id,
|
|
||||||
version: row.version,
|
|
||||||
sysType: row.sysType,
|
|
||||||
sysApkName: row.sysApkName,
|
|
||||||
sysApk: row.sysApk
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
closeModal() {
|
closeModal() {
|
||||||
|
@ -3,21 +3,43 @@
|
|||||||
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px" size="small">
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px" size="small">
|
||||||
<el-form-item label="选择APP" prop="configName">
|
<el-form-item label="选择APP" prop="configName">
|
||||||
<el-select v-model="queryParams.configType" clearable placeholder="请选择APP">
|
<el-select v-model="queryParams.configType" clearable placeholder="请选择APP">
|
||||||
<el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label" :value="dict.value" />
|
<el-option
|
||||||
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="版本号" prop="version">
|
<el-form-item label="版本号" prop="version">
|
||||||
<el-input v-model="queryParams.version" clearable placeholder="请输入版本号" style="width: 240px"
|
<el-input
|
||||||
@keyup.enter.native="handleQuery" />
|
v-model="queryParams.version"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入版本号"
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="公开时间">
|
<el-form-item label="公开时间">
|
||||||
<el-date-picker v-model="dateRange" end-placeholder="结束日期" range-separator="-" start-placeholder="开始日期"
|
<el-date-picker
|
||||||
style="width: 240px" type="daterange" value-format="yyyy-MM-dd"></el-date-picker>
|
v-model="dateRange"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
style="width: 240px"
|
||||||
|
type="daterange"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="configType">
|
<el-form-item label="状态" prop="configType">
|
||||||
<el-select v-model="queryParams.configType" clearable placeholder="请选择状态">
|
<el-select v-model="queryParams.configType" clearable placeholder="请选择状态">
|
||||||
<el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label" :value="dict.value" />
|
<el-option
|
||||||
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@ -28,17 +50,37 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPermi="['system:config:add']" icon="el-icon-plus" plain size="mini" type="primary"
|
<el-button
|
||||||
@click="handleAdd">新增
|
v-hasPermi="['system:config:add']"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button :disabled="multiple" icon="el-icon-plus" plain size="mini" type="info" @click="handlePublish">批量发布
|
<el-button
|
||||||
|
:disabled="multiple"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
type="info"
|
||||||
|
@click="handlePublish"
|
||||||
|
>批量发布
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPermi="['system:config:add']" :disabled="multiple" icon="el-icon-plus" plain size="mini"
|
<el-button
|
||||||
type="info" @click="handleDelete">批量删除
|
v-hasPermi="['system:config:add']"
|
||||||
|
:disabled="multiple"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
type="info"
|
||||||
|
@click="handleDelete"
|
||||||
|
>批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
@ -50,8 +92,12 @@
|
|||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="文件类型" prop="configName"/>
|
<el-table-column :show-overflow-tooltip="true" align="center" label="文件类型" prop="configName"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="版本号" prop="version"/>
|
<el-table-column :show-overflow-tooltip="true" align="center" label="版本号" prop="version"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="子版本号" prop="configValue"/>
|
<el-table-column :show-overflow-tooltip="true" align="center" label="子版本号" prop="configValue"/>
|
||||||
<el-table-column label="系统" min-width="80" prop="platform">
|
<el-table-column
|
||||||
<template slot-scope="scope">
|
label="系统"
|
||||||
|
min-width="80"
|
||||||
|
prop="platform"
|
||||||
|
>
|
||||||
|
<template scope="scope">
|
||||||
<div>{{ scope.row.platform === '0' ? '安卓' : 'IOS' }}</div>
|
<div>{{ scope.row.platform === '0' ? '安卓' : 'IOS' }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -86,10 +132,18 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="更新说明" prop="remark"/>
|
<el-table-column :show-overflow-tooltip="true" align="center" label="更新说明" prop="remark"/>
|
||||||
<el-table-column align="center" label="二维码" min-width="80">
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="二维码"
|
||||||
|
min-width="80"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<el-image :preview-src-list="srcList" :src="url" style="width: 80px; height: 80px">
|
<el-image
|
||||||
|
:preview-src-list="srcList"
|
||||||
|
:src="url"
|
||||||
|
style="width: 80px; height: 80px"
|
||||||
|
>
|
||||||
</el-image>
|
</el-image>
|
||||||
|
|
||||||
<!-- <el-popover-->
|
<!-- <el-popover-->
|
||||||
@ -108,21 +162,39 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="150">
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button v-hasPermi="['system:config:edit']" icon="el-icon-bottom" size="mini" type="text"
|
<el-button
|
||||||
@click="handleDown(scope.row)">下架
|
v-hasPermi="['system:config:edit']"
|
||||||
|
icon="el-icon-bottom"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleDown(scope.row)"
|
||||||
|
>下架
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-hasPermi="['system:config:edit']" icon="el-icon-edit" size="mini" type="text"
|
<el-button
|
||||||
@click="handleEdit(scope.row)">修改
|
v-hasPermi="['system:config:edit']"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleEdit(scope.row)"
|
||||||
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)">
|
<el-dropdown size="mini"
|
||||||
|
@command="(command) => handleCommand(command, scope.row)"
|
||||||
|
>
|
||||||
<el-button icon="el-icon-d-arrow-right" size="mini" type="text">更多</el-button>
|
<el-button icon="el-icon-d-arrow-right" size="mini" type="text">更多</el-button>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item v-hasPermi="['system:user:resetPwd']" command="handleDetail" icon="el-icon-view">详情
|
<el-dropdown-item v-hasPermi="['system:user:resetPwd']" command="handleDetail"
|
||||||
|
icon="el-icon-view"
|
||||||
|
>详情
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item v-hasPermi="['system:user:edit']" command="handleDownload" icon="el-icon-download">下载安装包
|
<el-dropdown-item v-hasPermi="['system:user:edit']" command="handleDownload"
|
||||||
|
icon="el-icon-download"
|
||||||
|
>下载安装包
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
|
||||||
<el-dropdown-item v-hasPermi="['system:user:edit']" command="handleDelete" icon="el-icon-delete">删除
|
<el-dropdown-item v-hasPermi="['system:user:edit']" command="handleDelete"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
@ -131,8 +203,13 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum" :total="total"
|
<pagination
|
||||||
@pagination="getList" />
|
v-show="total>0"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:total="total"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -8,17 +8,17 @@
|
|||||||
<el-main>
|
<el-main>
|
||||||
<div class="form-main">
|
<div class="form-main">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="白名单名称" prop="whitelistName">
|
<el-form-item label="白名单名称" prop="whiteListName">
|
||||||
<el-input v-model="form.whiteListName" placeholder="请输入白名单名称"/>
|
<el-input v-model="form.whiteListName" placeholder="请输入白名单名称"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="白名单类型" prop="whitelistType">
|
<el-form-item label="白名单类型" prop="whiteListType">
|
||||||
<el-select v-model="form.whiteListType" clearable placeholder="请选择白名单类型">
|
<el-select v-model="form.whiteListType" clearable placeholder="请选择白名单类型">
|
||||||
<el-option label="白名单人员" value="0"/>
|
<el-option label="白名单人员" value="0"/>
|
||||||
<el-option label="白名单设备" value="1"/>
|
<el-option label="白名单设备" value="1"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="白名单模式" prop="whitelistMode">
|
<el-form-item label="白名单模式" prop="whitePattern">
|
||||||
<el-select v-model="form.whitePattern" clearable placeholder="请选择白名单模式">
|
<el-select v-model="form.whitePattern" clearable placeholder="请选择白名单模式">
|
||||||
<el-option label="正则模式" value="0"/>
|
<el-option label="正则模式" value="0"/>
|
||||||
<el-option label="普通模式" value="1"/>
|
<el-option label="普通模式" value="1"/>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="form.remarks" placeholder="请输入内容" type="textarea"/>
|
<el-input v-model="form.remark" placeholder="请输入内容" type="textarea"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { addWhitelist } from '@/api/FDS/whiteList'
|
import { addConfig } from '@/api/system/config'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WhiteAdd',
|
name: 'WhiteAdd',
|
||||||
@ -85,7 +85,7 @@ export default {
|
|||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
||||||
addWhitelist(this.form).then(response => {
|
addConfig(this.form).then(response => {
|
||||||
this.$modal.msgSuccess('新增成功')
|
this.$modal.msgSuccess('新增成功')
|
||||||
})
|
})
|
||||||
this.$router.push({ path: '/build/whiteListManagement' })
|
this.$router.push({ path: '/build/whiteListManagement' })
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { updateConfig } from '@/api/FDS/whiteList'
|
import { updateConfig } from '@/api/system/config'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WhiteAdd',
|
name: 'WhiteAdd',
|
||||||
@ -84,7 +84,7 @@ export default {
|
|||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.configId != undefined) {
|
if (this.form.configId != undefined) {
|
||||||
updateWhitelist(this.form).then(response => {
|
updateConfig(this.form).then(response => {
|
||||||
this.$modal.msgSuccess('修改成功')
|
this.$modal.msgSuccess('修改成功')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { delConfig, getConfig, listConfig } from '@/api/system/config'
|
import { delConfig, getConfig, listConfig } from '@/api/system/config'
|
||||||
import { listWhitelist,delWhitelist} from '@/api/FDS/whiteList'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WhiteList',
|
name: 'WhiteList',
|
||||||
dicts: ['sys_yes_no'],
|
dicts: ['sys_yes_no'],
|
||||||
@ -222,7 +222,7 @@ export default {
|
|||||||
/** 查询参数列表 */
|
/** 查询参数列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
listWhitelist(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
this.configList = response.rows
|
this.configList = response.rows
|
||||||
this.total = response.total
|
this.total = response.total
|
||||||
this.loading = false
|
this.loading = false
|
||||||
@ -288,7 +288,7 @@ export default {
|
|||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const configIds = row.configId || this.ids
|
const configIds = row.configId || this.ids
|
||||||
this.$modal.confirm('是否确认删除编号为"' + configIds + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除编号为"' + configIds + '"的数据项?').then(function() {
|
||||||
return delWhitelist(configIds)
|
return delConfig(configIds)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.$modal.msgSuccess('删除成功')
|
this.$modal.msgSuccess('删除成功')
|
||||||
|
@ -1,13 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="">
|
||||||
<el-form-item label="环境名称" prop="name">
|
<el-form-item label="环境名称" prop="name">
|
||||||
<el-input
|
<el-input v-model="queryParams.name" placeholder="请输入环境名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.name"
|
|
||||||
placeholder="请输入环境名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
@ -17,87 +12,41 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||||
type="primary"
|
v-hasPermi="['deployment:environment:add']">新增</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['deployment:environment:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||||
type="success"
|
v-hasPermi="['deployment:environment:edit']">修改</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['deployment:environment:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||||
type="danger"
|
v-hasPermi="['deployment:environment:remove']">删除</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['deployment:environment:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['deployment:environment:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="environmentList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="environmentList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="主键" align="center" prop="id" />
|
|
||||||
<el-table-column label="环境名称" align="center" prop="name" />
|
<el-table-column label="环境名称" align="center" prop="name" />
|
||||||
<el-table-column label="服务器地址" align="center" prop="serverAddress" />
|
<el-table-column label="服务器地址" align="center" prop="serverAddress" />
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||||
size="mini"
|
v-hasPermi="['deployment:environment:edit']">修改</el-button>
|
||||||
type="text"
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||||
icon="el-icon-edit"
|
v-hasPermi="['deployment:environment:remove']">删除</el-button>
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['deployment:environment:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['deployment:environment:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||||
v-show="total>0"
|
@pagination="getList" />
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改环境维护对话框 -->
|
<!-- 添加或修改环境维护对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-form-item label="应用id" prop="appId">
|
<el-form-item label="应用id" prop="appId">
|
||||||
<el-input v-model="form.appId" placeholder="请输入应用id" />
|
<el-input v-model="form.appId" placeholder="请输入应用id" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -112,8 +61,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
@ -272,3 +221,14 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog .el-form {
|
||||||
|
|
||||||
|
.el-input,
|
||||||
|
.el-select,
|
||||||
|
.el-textarea {
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
403
sf-ui/src/views/deployment/install/index.vue
Normal file
403
sf-ui/src/views/deployment/install/index.vue
Normal file
@ -0,0 +1,403 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="" size="small">
|
||||||
|
<el-form-item label="安装包名称" prop="sysApkName">
|
||||||
|
<el-input v-model="queryParams.sysApkName" clearable placeholder="请输入安装包名称" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="版本号" prop="version">
|
||||||
|
<el-input v-model="queryParams.version" clearable placeholder="请输入版本号" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安装包类型" prop="sysType">
|
||||||
|
<el-select v-model="queryParams.sysType" clearable placeholder="请选择安装包类型">
|
||||||
|
<el-option v-for="dict in dict.type.sys_apk_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建人" prop="created">
|
||||||
|
<el-input v-model="queryParams.created" clearable placeholder="请输入创建人" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['deployment:install:add']" icon="el-icon-plus" plain size="mini" type="primary"
|
||||||
|
@click="handleAdd">新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['deploy:INFO:remove']" :disabled="multiple" icon="el-icon-delete" plain size="mini"
|
||||||
|
type="danger" @click="handleDelete">批量删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
<el-table v-loading="loading" :data="INFOList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column align="center" type="selection" width="55" />
|
||||||
|
<el-table-column align="center" label="安装包名称" prop="sysApkName" />
|
||||||
|
<el-table-column align="center" label="版本号" prop="version" />
|
||||||
|
<el-table-column align="center" label="安装包" prop="sysApk">
|
||||||
|
<template slot="header" slot-scope="scope">
|
||||||
|
<span>安装包</span>
|
||||||
|
<el-popover placement="top-start" width="180" trigger="hover">
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">复制当前的安装包地址</p>
|
||||||
|
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button icon="el-icon-copy" type="text" @click="copyIt(scope.row.sysApk)">复制</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="安装包大小" prop="sysApkSize" />
|
||||||
|
<el-table-column align="center" label="安装包类型" prop="sysType" :filters="dict.type.sys_apk_type.map(item => ({
|
||||||
|
...item,
|
||||||
|
text: item.label
|
||||||
|
}))" :filter-method="filterTagSysType">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.sys_apk_type" :value="scope.row.sysType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="创建人" prop="created" />
|
||||||
|
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-popover placement="left" width="" trigger="hover">
|
||||||
|
<div>
|
||||||
|
<div style="margin-bottom: 10px;color:#000;font-size:14px">操作</div>
|
||||||
|
<div style="text-align: right; margin: 0">
|
||||||
|
<el-button @click="handleDownload(scope.row)" size="mini">下载</el-button>
|
||||||
|
<el-button v-hasPermi="['deployment:install:edit']" plain size="mini"
|
||||||
|
@click="handleUpdate(scope.row)">修改</el-button>
|
||||||
|
<el-button v-hasPermi="['deployment:install:detail']" plain size="mini"
|
||||||
|
@click="handleDetail(scope.row)">详情</el-button>
|
||||||
|
<el-button v-hasPermi="['deployment:install:remove']" plain type="danger" size="mini"
|
||||||
|
@click="handleDelete(scope.row)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-button slot="reference" size="mini" type="text">更多<i class="el-icon-caret-right"></i></el-button>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum" :total="total"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 添加或修改安装包管理(新)对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" append-to-body width="550px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px" labelPosition="left">
|
||||||
|
<el-form-item label="安装包名称" prop="sysApkName">
|
||||||
|
<el-input v-model="form.sysApkName" placeholder="请输入安装包名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="版本号" prop="version">
|
||||||
|
<el-input v-model="form.version" placeholder="请输入版本号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安装包" prop="sysApk">
|
||||||
|
<file-upload v-model="form.sysApk" :accept="'.zip,.apk,.hap, .iap'" :fileSize="50"
|
||||||
|
:fileType="['apk', 'hap', 'iap', 'zip']" :limit="1" uploadFileUrl="/system/oss/upload" @getSize="getSize" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安装包大小" prop="sysApkSize">
|
||||||
|
<el-input v-model="form.sysApkSize" placeholder="请输入安装包大小" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安装包类型" prop="sysType">
|
||||||
|
<el-select v-model="form.sysType" placeholder="请选择安装包类型">
|
||||||
|
<el-option v-for="dict in dict.type.sys_apk_type" :key="dict.value" :label="dict.label"
|
||||||
|
:value="dict.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog :title="title" :visible.sync="openDetail" append-to-body width="550px">
|
||||||
|
<el-form ref="form" :model="form" label-width="100px" labelPosition="left">
|
||||||
|
<el-form-item label="安装包名称" prop="moduleName" filters>
|
||||||
|
{{ form.sysApkName }}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="版本号" prop="version">
|
||||||
|
{{ form.version }}
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="安装包">
|
||||||
|
<el-input v-model="form.sysApk" class="input-with-select" readonly>
|
||||||
|
<el-button slot="append" @click="copyIt(form.sysApk)">复制</el-button>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安装包大小" prop="moduleSize">
|
||||||
|
{{ form.sysApkSize }}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="系统类型" prop="sysType">
|
||||||
|
{{ form.sysType }}
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="上传时间:">{{ form.createTime }}</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="上传人员:">{{ form.created }}</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cancelDetail">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addINFO, delINFO, getINFO, listINFO, updateINFO } from '@/api/FDS/installList'
|
||||||
|
export default {
|
||||||
|
name: 'INFO',
|
||||||
|
dicts: ['sys_apk_uploading_type', 'uploading_status', 'sys_apk_type'],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
uploadingType: 'OnLineUploading',
|
||||||
|
sysApkName: undefined,
|
||||||
|
version: undefined,
|
||||||
|
sysApk: null,
|
||||||
|
sysApkSize: undefined,
|
||||||
|
sysType: '',
|
||||||
|
},
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 安装包管理(新)表格数据
|
||||||
|
INFOList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: '',
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
openDetail: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
uploadingType: null,
|
||||||
|
sysApkName: null,
|
||||||
|
version: null,
|
||||||
|
sysType: null,
|
||||||
|
uploadingStatus: null,
|
||||||
|
created: null
|
||||||
|
},
|
||||||
|
elDropdown: '',
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
uploadingType: [
|
||||||
|
{ required: true, message: '上传类型不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
sysApkName: [
|
||||||
|
{ required: true, message: '安装包名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
version: [
|
||||||
|
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
sysType: [
|
||||||
|
{ required: true, message: '安装包类型不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
sysApk: [
|
||||||
|
{ required: true, message: '安装包不能为空', trigger: 'change' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.getList()
|
||||||
|
|
||||||
|
|
||||||
|
// const dropdownMenu = this.$refs['elDropdown'].$children[0] // 找到dropdown下面的dropdownMenu
|
||||||
|
|
||||||
|
// dropdownMenu.$data.currentPlacement = 'start'
|
||||||
|
// console.log(dropdownMenu.$data)
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询安装包管理(新)列表 */
|
||||||
|
getList () {
|
||||||
|
this.loading = true
|
||||||
|
listINFO(this.queryParams).then(response => {
|
||||||
|
this.INFOList = response.rows
|
||||||
|
this.total = response.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel () {
|
||||||
|
this.open = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset () {
|
||||||
|
this.form = {
|
||||||
|
uploadingType: 'OnLineUploading',
|
||||||
|
sysApkName: undefined,
|
||||||
|
version: undefined,
|
||||||
|
sysApk: null,
|
||||||
|
sysApkSize: undefined,
|
||||||
|
sysType: '',
|
||||||
|
}
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery () {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery () {
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange (selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd () {
|
||||||
|
this.reset()
|
||||||
|
this.open = true
|
||||||
|
this.title = '添加安装包'
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate (row) {
|
||||||
|
this.reset()
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getINFO(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
this.open = true
|
||||||
|
this.title = '修改安装包'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 详情按钮操作 */
|
||||||
|
handleDetail (row) {
|
||||||
|
this.reset()
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getINFO(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
this.openDetail = true
|
||||||
|
this.title = '安装包详情'
|
||||||
|
this.type = 'detail'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm () {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
let data = Object.assign({}, this.form)
|
||||||
|
delete data.explain
|
||||||
|
updateINFO(data).then(response => {
|
||||||
|
this.$modal.msgSuccess('修改成功')
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addINFO(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess('新增成功')
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete (row) {
|
||||||
|
const ids = row.id || this.ids
|
||||||
|
this.$modal.confirm('是否确认删除安装包管理编号为"' + ids + '"的数据项?').then(function () {
|
||||||
|
return delINFO(ids)
|
||||||
|
}).then(() => {
|
||||||
|
this.getList()
|
||||||
|
this.$modal.msgSuccess('删除成功')
|
||||||
|
}).catch(() => {
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getSize (e) {
|
||||||
|
if (e && e.length > 0) {
|
||||||
|
|
||||||
|
this.form.sysApkSize = (e[0].size / 1024 / 1024).toFixed(2) + 'm'
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.form.sysApkSize = ''
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**下载安装包*/
|
||||||
|
handleDownload (row) {
|
||||||
|
window.open(row.sysApk)
|
||||||
|
},
|
||||||
|
cancelDetail () {
|
||||||
|
this.openDetail = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
copyIt (url) {
|
||||||
|
navigator.clipboard.writeText(url)
|
||||||
|
this.$message.success('复制成功')
|
||||||
|
},
|
||||||
|
// 筛选处理
|
||||||
|
filterTagSysType (value, row) {
|
||||||
|
return row.sysType === Number(value);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 更多操作触发
|
||||||
|
handleCommand (command, row) {
|
||||||
|
switch (command) {
|
||||||
|
case "handleDownload":
|
||||||
|
this.handleDownload(row);
|
||||||
|
break;
|
||||||
|
case "handleUpdate":
|
||||||
|
this.handleUpdate(row);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "handleDetail":
|
||||||
|
this.handleDetail(row);
|
||||||
|
break;
|
||||||
|
case "handleDelete":
|
||||||
|
this.handleDelete(row);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog .el-form {
|
||||||
|
|
||||||
|
.el-input,
|
||||||
|
.el-select,
|
||||||
|
.el-textarea {
|
||||||
|
width: 100%
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropDown {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lang-select-dropdown {
|
||||||
|
position: absolute;
|
||||||
|
top: 30px;
|
||||||
|
left: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
min-width: max-content;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="120px" size="small">
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="" size="small">
|
||||||
<el-form-item label="模块包名称名称" prop="moduleName">
|
<el-form-item label="模块包名称" prop="moduleName">
|
||||||
<el-input v-model="queryParams.moduleName" clearable placeholder="请输入模块包名称名称" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.moduleName" clearable placeholder="请输入模块包名称" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="版本号" prop="version">
|
<el-form-item label="版本号" prop="version">
|
||||||
<el-input v-model="queryParams.version" clearable placeholder="请输入版本号" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.version" clearable placeholder="请输入版本号" @keyup.enter.native="handleQuery" />
|
||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPermi="['deployment:module:add']" icon="el-icon-plus" plain size="mini" type="primary"
|
<el-button v-hasPermi="['deployment:module:add']" icon="el-icon-plus" size="mini" type="primary"
|
||||||
@click="handleAdd">新增
|
@click="handleAdd">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -34,47 +34,63 @@
|
|||||||
type="danger" @click="handleDelete">删除
|
type="danger" @click="handleDelete">删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button v-hasPermi="['deployment:module:export']" icon="el-icon-download" plain size="mini" type="warning"
|
|
||||||
@click="handleExport">导出
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="moduleList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="moduleList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
<el-table-column align="center" type="selection" width="55" />
|
||||||
<!-- <el-table-column align="center" label="主键" prop="id"/>-->
|
|
||||||
<el-table-column align="center" label="模块包名称" prop="moduleName" />
|
<el-table-column align="center" label="模块包名称" prop="moduleName" />
|
||||||
<el-table-column align="center" label="版本号" prop="version" />
|
<el-table-column align="center" label="版本号" prop="version" />
|
||||||
<el-table-column align="center" label="安装包" prop="moduleUrl" />
|
|
||||||
|
<el-table-column align="center" label="安装包" prop="moduleUrl">
|
||||||
|
<template slot="header" slot-scope="scope">
|
||||||
|
<span>安装包</span>
|
||||||
|
<el-popover placement="top-start" width="180" trigger="hover">
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">复制当前的H5模块包地址</p>
|
||||||
|
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button icon="el-icon-copy" type="text" @click="copyIt(scope.row.moduleUrl)">复制</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column align="center" label="安装包大小" prop="moduleSize" />
|
<el-table-column align="center" label="安装包大小" prop="moduleSize" />
|
||||||
<el-table-column align="center" label="系统类型" prop="sysType">
|
<el-table-column align="center" label="系统类型" prop="sysType" :filters="dict.type.sys_apk_type.map(item => ({
|
||||||
|
...item,
|
||||||
|
text: item.label
|
||||||
|
}))" :filter-method="filterTagSysType">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_apk_type" :value="scope.row.sysType" />
|
<dict-tag :options="dict.type.sys_apk_type" :value="scope.row.sysType" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="模块类型" prop="moduleType">
|
<el-table-column align="center" label="模块类型" prop="moduleType" :filters="dict.type.module_type.map(item => ({
|
||||||
|
...item,
|
||||||
|
text: item.label
|
||||||
|
}))" :filter-method="filterTagModuleType">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.module_type" :value="scope.row.moduleType" />
|
<dict-tag :options="dict.type.module_type" :value="scope.row.moduleType" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column align="center" label="上传状态" prop="uploadingStatus"/>-->
|
<!-- <el-table-column align="center" label="上传状态" prop="uploadingStatus"/>-->
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button icon="el-icon-download" size="mini" type="text" @click="handleDownLoad(scope.row)">下载安装包
|
<el-popover placement="left" width="" trigger="hover">
|
||||||
</el-button>
|
<div>
|
||||||
|
<div style="margin-bottom: 10px;color:#000;font-size:14px">操作</div>
|
||||||
<el-button v-hasPermi="['deployment:module:edit']" icon="el-icon-edit" size="mini" type="text"
|
<div style="text-align: right; margin: 0">
|
||||||
@click="handleUpdate(scope.row)">修改
|
<el-button @click="handleDownLoad(scope.row)" size="mini">下载</el-button>
|
||||||
</el-button>
|
<el-button v-hasPermi="['deployment:module:edit']" plain size="mini"
|
||||||
|
@click="handleUpdate(scope.row)">修改</el-button>
|
||||||
<el-button icon="el-icon-detail" size="mini" type="text" @click="handleDetail(scope.row)">详情
|
<el-button v-hasPermi="['deployment:module:detail']" plain size="mini"
|
||||||
</el-button>
|
@click="handleDetail(scope.row)">详情</el-button>
|
||||||
|
<el-button v-hasPermi="['deployment:module:remove']" plain type="danger" size="mini"
|
||||||
<el-button v-hasPermi="['deployment:module:remove']" icon="el-icon-delete" size="mini" type="text"
|
@click="handleDelete(scope.row)">删除</el-button>
|
||||||
@click="handleDelete(scope.row)">删除
|
</div>
|
||||||
</el-button>
|
</div>
|
||||||
|
<el-button slot="reference" size="mini" type="text">更多<i class="el-icon-caret-right"></i></el-button>
|
||||||
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -83,17 +99,20 @@
|
|||||||
@pagination="getList" />
|
@pagination="getList" />
|
||||||
|
|
||||||
<!-- 添加或修改H5模块包对话框 -->
|
<!-- 添加或修改H5模块包对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
<el-dialog :title="title" :visible.sync="open" append-to-body width="550px">
|
||||||
<el-form-item label="模块包名称名称" prop="moduleName">
|
|
||||||
<el-input v-model="form.moduleName" placeholder="请输入模块包名称名称" />
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px" labelPosition="left">
|
||||||
|
|
||||||
|
<el-form-item label="模块包名称" prop="moduleName">
|
||||||
|
<el-input v-model="form.moduleName" placeholder="请输入模块包名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="版本号" prop="version">
|
<el-form-item label="版本号" prop="version">
|
||||||
<el-input v-model="form.version" placeholder="请输入版本号" />
|
<el-input v-model="form.version" placeholder="请输入版本号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="安装包" prop="moduleUrl">
|
<el-form-item label="安装包" prop="moduleUrl">
|
||||||
|
|
||||||
<file-upload v-model="form.moduleUrl" :accept="['.zip']" :fileSize="20" :fileType="['zip']" :limit="1"
|
<file-upload v-model="form.moduleUrl" :accept="'.zip'" :fileSize="20" :fileType="['zip']" :limit="1"
|
||||||
@getSize="getSize" />
|
@getSize="getSize" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="安装包大小" prop="moduleSize">
|
<el-form-item label="安装包大小" prop="moduleSize">
|
||||||
@ -113,74 +132,38 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
<!-- 添加或修改H5模块包对话框 -->
|
<!-- 添加或修改H5模块包对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="openDetail" append-to-body width="500px">
|
<el-dialog :title="title" :visible.sync="openDetail" append-to-body width="550px">
|
||||||
<el-form ref="form" :model="form" label-width="120px">
|
<el-form ref="form" :model="form" label-width="100px" labelPosition="left">
|
||||||
<el-form-item label="模块包名称名称" prop="moduleName">
|
<el-form-item label="模块包名称" prop="moduleName">
|
||||||
{{ form.moduleName }}
|
{{ form.moduleName }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="版本号" prop="version">
|
<el-form-item label="版本号" prop="version">
|
||||||
{{ form.version }}
|
{{ form.version }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="安装包" prop="moduleUrl">
|
<el-form-item label="安装包" prop="moduleUrl">
|
||||||
{{ form.moduleUrl }}
|
|
||||||
<!-- <file-upload v-model="form.moduleUrl" :fileSize="20" :fileType="['apk','hap','iap']"-->
|
|
||||||
<!-- :limit="1"-->
|
|
||||||
<!-- uploadFileUrl="/system/oss/upload"-->
|
|
||||||
<!-- @getSize="getSize"-->
|
|
||||||
<!-- />-->
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="安装包大小" prop="moduleSize">
|
|
||||||
{{ form.moduleSize }}
|
|
||||||
<!-- <el-input v-model="form.moduleSize" placeholder="请输入安装包大小"/>-->
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="系统类型" prop="sysType">
|
|
||||||
{{ form.sysType }}
|
|
||||||
<!-- <el-select v-model="form.sysType" placeholder="请选择系统类型">-->
|
|
||||||
<!-- <el-option-->
|
|
||||||
<!-- v-for="dict in dict.type.sys_apk_type"-->
|
|
||||||
<!-- :key="dict.value"-->
|
|
||||||
<!-- :label="dict.label"-->
|
|
||||||
<!-- :value="dict.value"-->
|
|
||||||
<!-- ></el-option>-->
|
|
||||||
<!-- </el-select>-->
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="模块类型" prop="moduleType">
|
|
||||||
|
|
||||||
<dict-tag :options="dict.type.module_type" :value="form.moduleType" />
|
|
||||||
|
|
||||||
<!-- {{ form.moduleType }}-->
|
|
||||||
<!-- <el-select v-model="form.moduleType" placeholder="请选择模块类型">-->
|
|
||||||
<!-- <el-option-->
|
|
||||||
<!-- v-for="dict in dict.type.module_type"-->
|
|
||||||
<!-- :key="dict.value"-->
|
|
||||||
<!-- :label="dict.label"-->
|
|
||||||
<!-- :value="dict.value"-->
|
|
||||||
<!-- ></el-option>-->
|
|
||||||
<!-- </el-select>-->
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="下载地址:">
|
|
||||||
|
|
||||||
<el-input v-model="form.moduleUrl" class="input-with-select" readonly>
|
<el-input v-model="form.moduleUrl" class="input-with-select" readonly>
|
||||||
<el-button slot="append" @click="copyIt(form.moduleUrl)">复制</el-button>
|
<el-button slot="append" @click="copyIt(form.moduleUrl)">复制</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安装包大小" prop="moduleSize">
|
||||||
|
{{ form.moduleSize }}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="系统类型" prop="sysType">
|
||||||
|
{{ form.sysType }}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="模块类型" prop="moduleType">
|
||||||
|
<dict-tag :options="dict.type.module_type" :value="form.moduleType" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="上传时间:">{{ form.createTime }}</el-form-item>
|
<el-form-item label="上传时间:">{{ form.createTime }}</el-form-item>
|
||||||
<!-- <el-form-item label="上传状态:">-->
|
|
||||||
<!-- <dict-tag :options="dict.type.uploading_status" :value="form.uploadingStatus"/>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<el-form-item label="上传人员:">{{ form.created }}</el-form-item>
|
<el-form-item label="上传人员:">{{ form.created }}</el-form-item>
|
||||||
<!-- <el-form-item label="上传日志:"></el-form-item>-->
|
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="cancelDetail">取 消</el-button>
|
<el-button @click="cancelDetail">取 消</el-button>
|
||||||
@ -192,8 +175,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { addModule, delModule, getModule, listModule, updateModule } from '@/api/deployment/module'
|
import { addModule, delModule, getModule, listModule, updateModule } from '@/api/deployment/module'
|
||||||
import Cookies from 'js-cookie'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Module',
|
name: 'Module',
|
||||||
dicts: ['module_type', 'sys_apk_type', 'uploading_status'],
|
dicts: ['module_type', 'sys_apk_type', 'uploading_status'],
|
||||||
@ -232,7 +213,7 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
moduleName: [
|
moduleName: [
|
||||||
{ required: true, message: '模块包名称名称不能为空', trigger: 'blur' }
|
{ required: true, message: '模块包名称不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
version: [
|
version: [
|
||||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||||
@ -243,14 +224,39 @@ export default {
|
|||||||
moduleType: [
|
moduleType: [
|
||||||
{ required: true, message: '模块类型不能为空', trigger: 'change' }
|
{ required: true, message: '模块类型不能为空', trigger: 'change' }
|
||||||
],
|
],
|
||||||
uploadingStatus: [
|
moduleUrl: [
|
||||||
{ required: true, message: '上传状态不能为空', trigger: 'change' }
|
{ required: true, message: '模块包不能为空', trigger: 'change' }
|
||||||
]
|
]
|
||||||
|
// uploadingStatus: [
|
||||||
|
// { required: true, message: '上传状态不能为空', trigger: 'change' }
|
||||||
|
// ]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
console.log(this.dict.type.module_type)
|
||||||
|
let arr = [{
|
||||||
|
|
||||||
|
label: "通用",
|
||||||
|
|
||||||
|
value: "universal",
|
||||||
|
|
||||||
|
}]
|
||||||
|
arr = arr.map(item => ({
|
||||||
|
|
||||||
|
...item,
|
||||||
|
text: item.label
|
||||||
|
}))
|
||||||
|
console.log(arr);
|
||||||
|
// console.log(this.dict.type.module_type.map(d => d.value))
|
||||||
|
// arr = this.dict.type.module_type.map(item => {
|
||||||
|
// item.text = item.label
|
||||||
|
// })
|
||||||
|
// console.log(arr);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询H5模块包列表 */
|
/** 查询H5模块包列表 */
|
||||||
@ -294,7 +300,6 @@ export default {
|
|||||||
modified: null,
|
modified: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
appCode: Cookies.get('Admin-Application-appCode')
|
|
||||||
}
|
}
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
@ -349,7 +354,6 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
let data = Object.assign({}, this.form)
|
let data = Object.assign({}, this.form)
|
||||||
data.appCode = Cookies.get('Admin-Application-appCode')
|
|
||||||
delete data.explain
|
delete data.explain
|
||||||
updateModule(data).then(response => {
|
updateModule(data).then(response => {
|
||||||
this.$modal.msgSuccess('修改成功')
|
this.$modal.msgSuccess('修改成功')
|
||||||
@ -384,19 +388,62 @@ export default {
|
|||||||
}, `module_${new Date().getTime()}.xlsx`)
|
}, `module_${new Date().getTime()}.xlsx`)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getSize (e) {
|
getSize (e) {
|
||||||
console.log(e)
|
if (e && e.length > 0) {
|
||||||
console.log(this.form)
|
|
||||||
this.form.moduleSize = e[0].size + 'kb'
|
this.form.moduleSize = (e[0].size / 1024 / 1024).toFixed(2) + 'm'
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.form.moduleSize = ''
|
||||||
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
filterTagModuleType (value, row) {
|
||||||
|
return row.moduleType === Number(value);
|
||||||
|
},
|
||||||
|
filterTagSysType (value, row) {
|
||||||
|
return row.sysType === Number(value);
|
||||||
|
},
|
||||||
handleDownLoad (row) {
|
handleDownLoad (row) {
|
||||||
window.open(row.moduleUrl)
|
window.open(row.moduleUrl)
|
||||||
},
|
},
|
||||||
copyIt (url) {
|
copyIt (url) {
|
||||||
navigator.clipboard.writeText(url)
|
navigator.clipboard.writeText(url)
|
||||||
this.$message.success('复制成功')
|
this.$message.success('复制成功')
|
||||||
|
},
|
||||||
|
handleCommand (command, row) {
|
||||||
|
switch (command) {
|
||||||
|
case "handleDownload":
|
||||||
|
this.handleDownload(row);
|
||||||
|
break;
|
||||||
|
case "handleUpdate":
|
||||||
|
this.handleUpdate(row);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "handleDetail":
|
||||||
|
this.handleDetail(row);
|
||||||
|
break;
|
||||||
|
case "handleDelete":
|
||||||
|
this.handleDelete(row);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog .el-form {
|
||||||
|
|
||||||
|
.el-input,
|
||||||
|
.el-select,
|
||||||
|
.el-textarea {
|
||||||
|
width: 100%
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
381
sf-ui/src/views/deployment/publish/add.vue
Normal file
381
sf-ui/src/views/deployment/publish/add.vue
Normal file
@ -0,0 +1,381 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-container>
|
||||||
|
<!-- <el-header>
|
||||||
|
<div>新增发布</div>
|
||||||
|
<el-divider />
|
||||||
|
</el-header> -->
|
||||||
|
<el-main>
|
||||||
|
<div class="form-main">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="APP名称" prop="versionDesc">
|
||||||
|
<el-input v-model="form.appName" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12"> <el-form-item label="选择系统" prop="systemType">
|
||||||
|
<el-select v-model="form.systemType" placeholder="请选择系统类型" @change="changeSys">
|
||||||
|
<el-option v-for="dict in dict.type.sys_apk_type" :key="dict.value" :label="dict.label"
|
||||||
|
:value="dict.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
<el-col :span="12"> <el-form-item v-if="form.systemType != 'IOS'" label="安装包" prop="sysApkName">
|
||||||
|
<el-input v-model="form.sysApkName" class="input-with-select" placeholder="请选择包" readonly>
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click="handlePackOpen"></el-button>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="form.systemType == 'ios'" label="app store地址" prop="appStoreAddress">
|
||||||
|
<el-input v-model="form.appStoreAddress" placeholder="请输入app store地址" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="版本号" prop="version">
|
||||||
|
<el-input v-model="form.version" placeholder="请输入版本号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="版本说明" prop="versionDesc">
|
||||||
|
<el-input v-model="form.versionDesc" placeholder="请输入版本说明" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="有效期" prop="validityStartTime">
|
||||||
|
<el-date-picker v-model="daterangeDate" style="width: 400px" value-format="yyyy-MM-dd" type="daterange"
|
||||||
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发布环境" prop="publishEnvironment">
|
||||||
|
|
||||||
|
<el-select v-model="form.publishEnvironment">
|
||||||
|
<el-option v-for="dict in environmentList" :key="dict.value" :label="dict.name"
|
||||||
|
:value="parseInt(dict.id)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发布策略" prop="publishStrategy">
|
||||||
|
|
||||||
|
<el-select v-model="form.publishStrategy">
|
||||||
|
<el-option v-for="dict in dict.type.release_strategy" :key="dict.value" :label="dict.label"
|
||||||
|
:value="parseInt(dict.value)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="结果通知" prop="resultNotify">
|
||||||
|
<el-switch v-model="form.resultNotify" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="公开版" prop="publicVersion">
|
||||||
|
|
||||||
|
<el-switch v-model="form.publicVersion" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="强制更新" prop="forceUpdate">
|
||||||
|
<el-switch v-model="form.forceUpdate" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="下载验证" prop="downloadVerification">
|
||||||
|
<el-switch v-model="form.downloadVerification" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="更新对象" prop="updateObject">
|
||||||
|
<el-select v-model="form.updateObject">
|
||||||
|
<el-option v-for="dict in dict.type.release_user_type" :key="dict.value" :label="dict.label"
|
||||||
|
:value="parseInt(dict.value)" />
|
||||||
|
</el-select>
|
||||||
|
<!-- <el-button v-if="form.updateObject === 0" circle icon="el-icon-plus" size="16" type="primary"
|
||||||
|
@click="whiteOpen = true"></el-button> -->
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <div v-if="form.updateObject === 0" class="area-box">
|
||||||
|
<el-tag v-for="tag in WhiteArr" type="info" :key="tag.sysApkName" @close="handleDeleteTag(tag.apkId)"
|
||||||
|
closable>
|
||||||
|
{{ tag.sysApkName }}
|
||||||
|
</el-tag>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</el-main>
|
||||||
|
<!--安装包弹窗-->
|
||||||
|
</el-container>
|
||||||
|
<div slot="footer" class="footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button v-if="form.status != 2" type="primary" @click="pubLishForm">发 布
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
<AddPack :systemType="form.systemType" v-if="packOpen" @close="closeAddPack" @addPack="handleAddPack"></AddPack>
|
||||||
|
<AddWhite :systemType="form.systemType" v-if="whiteOpen" @close="closeAddWhite" @addWhiteList="handleAddWhite">
|
||||||
|
</AddWhite>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import AddPack from './component/addPack.vue'
|
||||||
|
import AddWhite from './component/addWhite.vue'
|
||||||
|
|
||||||
|
import {
|
||||||
|
addPublish,
|
||||||
|
} from '@/api/deployment/publish'
|
||||||
|
import { listEnvironment } from '@/api/deployment/environment'
|
||||||
|
import { getApplicationName } from '@/utils/application'
|
||||||
|
export default {
|
||||||
|
name: 'PublishAdd',
|
||||||
|
dicts: ['release_strategy', 'release_user_type', 'sys_apk_type'],
|
||||||
|
components: {
|
||||||
|
AddPack, AddWhite
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
// 总条数
|
||||||
|
form: {
|
||||||
|
appName: getApplicationName(),
|
||||||
|
},
|
||||||
|
packOpen: false,
|
||||||
|
whiteOpen: false,
|
||||||
|
environmentList: [],
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
dataList: [],
|
||||||
|
queryParamsEnvironment: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 999
|
||||||
|
},
|
||||||
|
daterangeDate: '',
|
||||||
|
WhiteArr: [],
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
appName: [
|
||||||
|
{ required: true, message: '应用名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
systemType: [
|
||||||
|
{ required: true, message: '系统类型不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
apkId: [
|
||||||
|
{ required: true, message: '安装包编号不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
version: [
|
||||||
|
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
publishEnvironment: [
|
||||||
|
{ required: true, message: '发布环境不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
publishStrategy: [
|
||||||
|
{ required: true, message: '发布策略不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
publicVersion: [
|
||||||
|
{ required: true, message: '公开版不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
forceUpdate: [
|
||||||
|
{ required: true, message: '强制更新不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
sysApkName: [
|
||||||
|
{ required: true, message: '安装包不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
|
||||||
|
mounted () {
|
||||||
|
this.getEnvironmentList()
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
reset () {
|
||||||
|
this.form = {
|
||||||
|
appName: getApplicationName(),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 弹出包选择框*/
|
||||||
|
handlePackOpen () {
|
||||||
|
this.packOpen = true
|
||||||
|
},
|
||||||
|
/** 查询环境维护列表 */
|
||||||
|
getEnvironmentList () {
|
||||||
|
listEnvironment(this.queryParamsEnvironment).then(response => {
|
||||||
|
this.environmentList = response.rows
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAddPack (e) {
|
||||||
|
this.form.apkId = e.apkId
|
||||||
|
this.form.version = e.version
|
||||||
|
this.form.systemType = e.sysType
|
||||||
|
this.form.sysApkName = e.sysApkName
|
||||||
|
this.form.apkUrl = e.sysApk
|
||||||
|
this.packOpen = false
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
handleAddWhite (e) {
|
||||||
|
if (e) {
|
||||||
|
this.WhiteArr.push(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm () {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
let data = Object.assign({}, this.form)
|
||||||
|
delete data.explain
|
||||||
|
this.form.validityStartTime = this.daterangeDate[0]
|
||||||
|
this.form.validityEndTime = this.daterangeDate[1]
|
||||||
|
addPublish(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess('新增成功')
|
||||||
|
this.loading = false
|
||||||
|
this.open = false
|
||||||
|
this.close()
|
||||||
|
this.$router.push({ path: '/build/publish' })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 选择系统做一些逻辑判断
|
||||||
|
changeSys () {
|
||||||
|
// this.form.systemType = sysType
|
||||||
|
this.form.apkId = null
|
||||||
|
this.form.version = null
|
||||||
|
this.form.sysApkName = null
|
||||||
|
this.form.appStoreAddress = null
|
||||||
|
this.form.apkUrl = null
|
||||||
|
},
|
||||||
|
// 发布按钮
|
||||||
|
|
||||||
|
pubLishForm () {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
let data = Object.assign({}, this.form)
|
||||||
|
delete data.explain
|
||||||
|
addPublish(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess('新增成功')
|
||||||
|
this.loading = false
|
||||||
|
this.open = false
|
||||||
|
this.close()
|
||||||
|
this.$router.push({ path: '/build/publish' })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
closeAddPack () {
|
||||||
|
this.packOpen = false
|
||||||
|
},
|
||||||
|
closeAddWhite () {
|
||||||
|
this.whiteOpen = false
|
||||||
|
},
|
||||||
|
cancel () {
|
||||||
|
this.close()
|
||||||
|
this.$router.push({ path: '/build/publish' })
|
||||||
|
},
|
||||||
|
handleDeleteTag (e) {
|
||||||
|
for (var i in this.WhiteArr) {
|
||||||
|
if (this.WhiteArr[i].apkId == e) {
|
||||||
|
this.WhiteArr.splice(i, 1);
|
||||||
|
break; // 删除后退出循环
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.$tab.closePage();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-container {
|
||||||
|
background: #ffffff;
|
||||||
|
// margin: 24px;
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-main {
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input.is-disabled .el-input__inner,
|
||||||
|
.el-textarea.is-disabled .el-textarea__inner {
|
||||||
|
border: 1px solid #E4E7ED !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-group {
|
||||||
|
.el-tag {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tag+.el-tag {
|
||||||
|
margin-left: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input {
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 24px;
|
||||||
|
right: 80px
|
||||||
|
}
|
||||||
|
|
||||||
|
.area-box {
|
||||||
|
max-width: 400px;
|
||||||
|
min-height: 100px;
|
||||||
|
padding: 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 1px solid #DCDFE6;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input,
|
||||||
|
.el-select {
|
||||||
|
max-width: 400px;
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
</style>
|
119
sf-ui/src/views/deployment/publish/component/addPack.vue
Normal file
119
sf-ui/src/views/deployment/publish/component/addPack.vue
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :modal-append-to-body="false" :title="title"
|
||||||
|
:visible.sync="open" v-bind="$attrs" width="700px" @close="onClose" @open="onOpen" attrs v-on="$listeners">
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px" size="small">
|
||||||
|
<el-form-item label="安装包名称" prop="installpackName">
|
||||||
|
<el-input v-model="queryParams.sysApkName" clearable placeholder="请输入安装包名称" style="width: 240px"
|
||||||
|
@keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table v-loading="loading" :data="moduleList">
|
||||||
|
<el-table-column align="center" label="安装包名称" prop="sysApkName" />
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="版本号" prop="version" />
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="安装包大小" prop="sysApkSize" />
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="适用系统" prop="sysType" />
|
||||||
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="50">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button circle icon="el-icon-plus" size="20" type="primary" @click="addPack(scope.row)"></el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum" :total="total"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { listINFO } from '@/api/FDS/installList'
|
||||||
|
export default {
|
||||||
|
name: 'AddPack',
|
||||||
|
dicts: ['sys_yes_no'],
|
||||||
|
props: {
|
||||||
|
systemType: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
title: '筛选安装包',
|
||||||
|
loading: true,
|
||||||
|
configName: undefined,
|
||||||
|
form: {},
|
||||||
|
moduleList: [],
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
total: 0,
|
||||||
|
open: true,
|
||||||
|
// 白名单配置表单验证
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
sysApkName: null,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
/** 查询参数列表 */
|
||||||
|
getList () {
|
||||||
|
this.loading = true
|
||||||
|
listINFO(
|
||||||
|
{
|
||||||
|
...this.queryParams,
|
||||||
|
sysType: this.systemType
|
||||||
|
}).then(response => {
|
||||||
|
this.moduleList = response.rows
|
||||||
|
this.total = response.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery () {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery () {
|
||||||
|
this.dateRange = []
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 新增当前包的按钮 */
|
||||||
|
addPack (row) {
|
||||||
|
this.$emit('addPack', {
|
||||||
|
apkId: row.id,
|
||||||
|
version: row.version,
|
||||||
|
sysType: row.sysType,
|
||||||
|
sysApkName: row.sysApkName,
|
||||||
|
sysApk: row.sysApk
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
closeModal () {
|
||||||
|
this.$emit('close')
|
||||||
|
},
|
||||||
|
onOpen () {
|
||||||
|
this.active = this.current
|
||||||
|
this.key = ''
|
||||||
|
},
|
||||||
|
cancel () {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
119
sf-ui/src/views/deployment/publish/component/addWhite.vue
Normal file
119
sf-ui/src/views/deployment/publish/component/addWhite.vue
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :modal-append-to-body="false" :title="title"
|
||||||
|
:visible.sync="open" v-bind="$attrs" width="700px" @close="onClose" @open="onOpen" attrs v-on="$listeners">
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px" size="small">
|
||||||
|
<el-form-item label="安装包名称" prop="installpackName">
|
||||||
|
<el-input v-model="queryParams.sysApkName" clearable placeholder="请输入安装包名称" style="width: 240px"
|
||||||
|
@keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table v-loading="loading" :data="moduleList">
|
||||||
|
<el-table-column align="center" label="安装包名称" prop="sysApkName" />
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="版本号" prop="version" />
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="安装包大小" prop="sysApkSize" />
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="适用系统" prop="sysType" />
|
||||||
|
<!-- <el-table-column align="center" label="状态" prop="uploadingStatus">-->
|
||||||
|
<!-- <template slot-scope="scopeA">-->
|
||||||
|
<!-- <dict-tag :options="dict.type.sys_yes_no" :value="scopeA.row.type"/>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="50">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button circle icon="el-icon-plus" size="20" type="primary" @click="addPack(scope.row)"></el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { listINFO } from '@/api/FDS/installList'
|
||||||
|
import Cookies from 'js-cookie'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AddPack',
|
||||||
|
dicts: ['sys_yes_no'],
|
||||||
|
props: {
|
||||||
|
systemType: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
title: '筛选白名单',
|
||||||
|
loading: true,
|
||||||
|
configName: undefined,
|
||||||
|
form: {},
|
||||||
|
moduleList: [],
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
total: 0,
|
||||||
|
open: true,
|
||||||
|
// 白名单配置表单验证
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
sysApkName: null,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
/** 查询参数列表 */
|
||||||
|
getList () {
|
||||||
|
this.loading = true
|
||||||
|
listINFO(
|
||||||
|
{
|
||||||
|
...this.queryParams,
|
||||||
|
sysType: this.systemType
|
||||||
|
}).then(response => {
|
||||||
|
this.moduleList = response.rows
|
||||||
|
this.total = response.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery () {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery () {
|
||||||
|
this.dateRange = []
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 新增当前包的按钮 */
|
||||||
|
addPack (row) {
|
||||||
|
this.$emit('addWhiteList', {
|
||||||
|
apkId: row.id,
|
||||||
|
version: row.version,
|
||||||
|
sysType: row.sysType,
|
||||||
|
sysApkName: row.sysApkName,
|
||||||
|
sysApk: row.sysApk
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
closeModal () {
|
||||||
|
this.$emit('close')
|
||||||
|
},
|
||||||
|
onOpen () {
|
||||||
|
this.active = this.current
|
||||||
|
this.key = ''
|
||||||
|
},
|
||||||
|
onClose () {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
289
sf-ui/src/views/deployment/publish/detail.vue
Normal file
289
sf-ui/src/views/deployment/publish/detail.vue
Normal file
@ -0,0 +1,289 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-container>
|
||||||
|
<el-main>
|
||||||
|
<div class="form-main">
|
||||||
|
<el-form ref="form" :model="form" label-width="120px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="APP名称" prop="versionDesc">
|
||||||
|
{{ form.appName }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12"> <el-form-item label="选择系统" prop="systemType">
|
||||||
|
{{ form.systemType }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item v-if="form.systemType != 'ios'" label="安装包" prop="sysApkName">
|
||||||
|
{{ form.sysApkName }}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="form.systemType == 'ios'" label="app store地址" prop="appStoreAddress">
|
||||||
|
{{ form.appStoreAddress }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="版本号" prop="version">
|
||||||
|
{{ form.version }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="版本说明" prop="versionDesc">
|
||||||
|
{{ form.versionDesc }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="有效期" prop="validityStartTime">
|
||||||
|
{{ form.validityStartTime }}至{{ form.validityEndTime }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发布环境" prop="publishEnvironment">
|
||||||
|
<el-select v-model="form.publishEnvironment" disabled>
|
||||||
|
<el-option v-for="dict in environmentList" :key="dict.value" :label="dict.name"
|
||||||
|
:value="parseInt(dict.id)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发布策略" prop="publishStrategy">
|
||||||
|
|
||||||
|
<el-select v-model="form.publishStrategy" disabled>
|
||||||
|
<el-option v-for="dict in dict.type.release_strategy" :key="dict.value" :label="dict.label"
|
||||||
|
:value="parseInt(dict.value)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="结果通知" prop="resultNotify">
|
||||||
|
<el-switch v-model="form.resultNotify" disabled :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="公开版" prop="publicVersion">
|
||||||
|
|
||||||
|
<el-switch v-model="form.publicVersion" disabled :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="强制更新" prop="forceUpdate">
|
||||||
|
<el-switch v-model="form.forceUpdate" disabled :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="下载验证" prop="downloadVerification">
|
||||||
|
<el-switch v-model="form.downloadVerification" disabled :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="更新对象" prop="updateObject">
|
||||||
|
<el-select v-model="form.updateObject" disabled>
|
||||||
|
<el-option v-for="dict in dict.type.release_user_type" :key="dict.value" :label="dict.label"
|
||||||
|
:value="parseInt(dict.value)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
{{ form.remark }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="下载地址" prop="apkUrl">
|
||||||
|
<el-input v-model="form.apkUrl" class="input-with-select" readonly>
|
||||||
|
<el-button slot="append" @click="copyIt(form.apkUrl)">复制</el-button>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发布状态" prop="status">
|
||||||
|
<span v-for="item in dict.type.release_status">
|
||||||
|
<el-tag v-if="item.value == form.status" :type="item.listClass">{{ item.label }}</el-tag>
|
||||||
|
</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="创建人" prop="created">
|
||||||
|
{{ form.created }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发布时间" prop="validityStartTime">
|
||||||
|
{{ form.validityStartTime }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
<div slot="footer" class="footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { listEnvironment } from '@/api/deployment/environment'
|
||||||
|
import { getApplicationName } from '@/utils/application'
|
||||||
|
import { getINFO } from '@/api/FDS/installList'
|
||||||
|
import {
|
||||||
|
getPublish,
|
||||||
|
} from '@/api/deployment/publish'
|
||||||
|
export default {
|
||||||
|
name: 'publishDetail',
|
||||||
|
dicts: ['release_environment', 'sys_yes_no', 'release_strategy', 'release_user_type', 'release_status'],
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
packOpen: false,
|
||||||
|
environmentList: [],
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
dataList: [],
|
||||||
|
// 白名单配置表单验证
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
sysApkName: null,
|
||||||
|
},
|
||||||
|
queryParamsEnvironment: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 999
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
if (this.$route.query.id) {
|
||||||
|
this.getPublishById(this.$route.query.id)
|
||||||
|
}
|
||||||
|
this.getEnvironmentList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getPublishById (id) {
|
||||||
|
this.loading = true
|
||||||
|
getPublish(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.form.sysApkName = this.getINFOById();
|
||||||
|
this.form.appName = getApplicationName();
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 查询环境维护列表 */
|
||||||
|
getEnvironmentList () {
|
||||||
|
listEnvironment(this.queryParamsEnvironment).then(response => {
|
||||||
|
this.environmentList = response.rows
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 根据apkId查询安装包 */
|
||||||
|
getINFOById () {
|
||||||
|
getINFO(this.form.apkId).then(res => {
|
||||||
|
console.log(res.data.sysApkName)
|
||||||
|
return res.data.sysApkName
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 查询环境维护列表 */
|
||||||
|
getEnvironmentList () {
|
||||||
|
this.loading = true
|
||||||
|
listEnvironment(this.queryParamsEnvironment).then(response => {
|
||||||
|
this.environmentList = response.rows
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel () {
|
||||||
|
this.close()
|
||||||
|
this.$router.push({ path: '/build/publish' })
|
||||||
|
},
|
||||||
|
copyIt (url) {
|
||||||
|
navigator.clipboard.writeText(url)
|
||||||
|
this.$message.success('复制成功')
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.$tab.closePage();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-container {
|
||||||
|
background: #ffffff;
|
||||||
|
// margin: 24px;
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.form-main {
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input.is-disabled .el-input__inner,
|
||||||
|
.el-textarea.is-disabled .el-textarea__inner {
|
||||||
|
border: 1px solid #E4E7ED !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-group {
|
||||||
|
.el-tag {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tag+.el-tag {
|
||||||
|
margin-left: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 24px;
|
||||||
|
right: 80px
|
||||||
|
}
|
||||||
|
|
||||||
|
.area-box {
|
||||||
|
max-width: 400px;
|
||||||
|
min-height: 100px;
|
||||||
|
padding: 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 1px solid #DCDFE6;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input {
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input,
|
||||||
|
.el-select {
|
||||||
|
max-width: 400px;
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
</style>
|
407
sf-ui/src/views/deployment/publish/edit.vue
Normal file
407
sf-ui/src/views/deployment/publish/edit.vue
Normal file
@ -0,0 +1,407 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-container>
|
||||||
|
<!-- <el-header>
|
||||||
|
<div>编辑发布</div>
|
||||||
|
<el-divider />
|
||||||
|
</el-header> -->
|
||||||
|
<el-main v-loading="loading">
|
||||||
|
<div class="form-main">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="APP名称" prop="versionDesc">
|
||||||
|
<el-input v-model="form.appName" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12"> <el-form-item label="选择系统" prop="systemType">
|
||||||
|
<el-select v-model="form.systemType" placeholder="请选择系统类型" @change="changeSys">
|
||||||
|
<el-option v-for="dict in dict.type.sys_apk_type" :key="dict.value" :label="dict.label"
|
||||||
|
:value="dict.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
<el-col :span="12"> <el-form-item v-if="form.systemType != 'IOS'" label="安装包" prop="sysApkName">
|
||||||
|
<el-input v-model="form.sysApkName" class="input-with-select" placeholder="请选择包" readonly>
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click="handlePackOpen"></el-button>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="form.systemType == 'ios'" label="app store地址" prop="appStoreAddress">
|
||||||
|
<el-input v-model="form.appStoreAddress" placeholder="请输入app store地址" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="版本号" prop="version">
|
||||||
|
<el-input v-model="form.version" placeholder="请输入版本号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="版本说明" prop="versionDesc">
|
||||||
|
<el-input v-model="form.versionDesc" placeholder="请输入版本说明" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="有效期" prop="validityStartTime">
|
||||||
|
<el-date-picker v-model="daterangeDate" style="width: 400px" value-format="yyyy-MM-dd" type="daterange"
|
||||||
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发布环境" prop="publishEnvironment">
|
||||||
|
|
||||||
|
<el-select v-model="form.publishEnvironment">
|
||||||
|
<el-option v-for="dict in environmentList" :key="dict.value" :label="dict.name"
|
||||||
|
:value="parseInt(dict.id)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发布策略" prop="publishStrategy">
|
||||||
|
|
||||||
|
<el-select v-model="form.publishStrategy">
|
||||||
|
<el-option v-for="dict in dict.type.release_strategy" :key="dict.value" :label="dict.label"
|
||||||
|
:value="parseInt(dict.value)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="结果通知" prop="resultNotify">
|
||||||
|
<el-switch v-model="form.resultNotify" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="公开版" prop="publicVersion">
|
||||||
|
|
||||||
|
<el-switch v-model="form.publicVersion" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="强制更新" prop="forceUpdate">
|
||||||
|
<el-switch v-model="form.forceUpdate" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="下载验证" prop="downloadVerification">
|
||||||
|
<el-switch v-model="form.downloadVerification" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="更新对象" prop="updateObject">
|
||||||
|
|
||||||
|
<el-select v-model="form.updateObject">
|
||||||
|
<el-option v-for="dict in dict.type.release_user_type" :key="dict.value" :label="dict.label"
|
||||||
|
:value="parseInt(dict.value)" />
|
||||||
|
</el-select>
|
||||||
|
<!-- <el-button v-if="form.updateObject === 0" circle icon="el-icon-plus" size="16" type="primary"
|
||||||
|
@click="whiteOpen = true"></el-button> -->
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <div v-if="form.updateObject === 0" class="area-box">
|
||||||
|
<el-tag v-for="tag in WhiteArr" type="info" :key="tag.sysApkName" @close="handleDeleteTag(tag.apkId)"
|
||||||
|
closable>
|
||||||
|
{{ tag.sysApkName }}
|
||||||
|
</el-tag>
|
||||||
|
</div> -->
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-main>
|
||||||
|
<!--安装包弹窗-->
|
||||||
|
</el-container>
|
||||||
|
<div class="footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button v-if="form.status != 2" type="primary" @click="pubLishForm">发 布
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
<AddPack :systemType="form.systemType" v-if="packOpen" @close="closeAddPack" @addPack="handleAddPack"></AddPack>
|
||||||
|
<AddWhite :systemType="form.systemType" v-if="whiteOpen" @close="closeAddWhite" @addWhiteList="handleAddWhite">
|
||||||
|
</AddWhite>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import AddPack from './component/addPack.vue'
|
||||||
|
import AddWhite from './component/addWhite.vue'
|
||||||
|
import {
|
||||||
|
addPublish,
|
||||||
|
getPublish,
|
||||||
|
updatePublish,
|
||||||
|
publish
|
||||||
|
} from '@/api/deployment/publish'
|
||||||
|
import { listEnvironment } from '@/api/deployment/environment'
|
||||||
|
import { getApplicationName } from '@/utils/application'
|
||||||
|
import { getINFO } from '@/api/FDS/installList'
|
||||||
|
export default {
|
||||||
|
name: 'PublishEdit',
|
||||||
|
dicts: ['release_strategy', 'release_user_type', 'sys_apk_type'],
|
||||||
|
components: {
|
||||||
|
AddPack, AddWhite
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
// 总条数
|
||||||
|
form: {
|
||||||
|
sysApkName: ''
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
packOpen: false,
|
||||||
|
whiteOpen: false,
|
||||||
|
environmentList: [],
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
dataList: [],
|
||||||
|
queryParamsEnvironment: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 999
|
||||||
|
},
|
||||||
|
daterangeDate: '',
|
||||||
|
WhiteArr: [],
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
sysApkName: null,
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
appName: [
|
||||||
|
{ required: true, message: '应用名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
systemType: [
|
||||||
|
{ required: true, message: '系统类型不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
apkId: [
|
||||||
|
{ required: true, message: '安装包编号不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
version: [
|
||||||
|
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
publishEnvironment: [
|
||||||
|
{ required: true, message: '发布环境不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
publishStrategy: [
|
||||||
|
{ required: true, message: '发布策略不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
publicVersion: [
|
||||||
|
{ required: true, message: '公开版不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
forceUpdate: [
|
||||||
|
{ required: true, message: '强制更新不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
sysApkName: [
|
||||||
|
{ required: true, message: '安装包不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
|
||||||
|
mounted () {
|
||||||
|
if (this.$route.query.id) {
|
||||||
|
this.getPublishById(this.$route.query.id)
|
||||||
|
}
|
||||||
|
this.getEnvironmentList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getPublishById (id) {
|
||||||
|
this.loading = true
|
||||||
|
getPublish(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
this.form.appName = getApplicationName();
|
||||||
|
this.daterangeDate = [this.form.validityStartTime, this.form.validityEndTime]
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.getINFOById();
|
||||||
|
this.loading = false
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getINFOById () {
|
||||||
|
getINFO(this.form.apkId).then(res => {
|
||||||
|
this.form.sysApkName = res.data.sysApkName
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 弹出包选择框*/
|
||||||
|
handlePackOpen () {
|
||||||
|
this.packOpen = true
|
||||||
|
},
|
||||||
|
/** 查询环境维护列表 */
|
||||||
|
getEnvironmentList () {
|
||||||
|
listEnvironment(this.queryParamsEnvironment).then(response => {
|
||||||
|
this.environmentList = response.rows
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAddPack (e) {
|
||||||
|
this.form.apkId = e.apkId
|
||||||
|
this.form.version = e.version
|
||||||
|
this.form.systemType = e.sysType
|
||||||
|
this.form.sysApkName = e.sysApkName
|
||||||
|
this.form.apkUrl = e.sysApk
|
||||||
|
this.packOpen = false
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm () {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
let data = Object.assign({}, this.form)
|
||||||
|
delete data.explain
|
||||||
|
this.form.validityStartTime = this.daterangeDate[0]
|
||||||
|
this.form.validityEndTime = this.daterangeDate[1]
|
||||||
|
updatePublish(data).then(response => {
|
||||||
|
this.$modal.msgSuccess('修改成功')
|
||||||
|
this.loading = false
|
||||||
|
this.open = false
|
||||||
|
this.$router.push({ path: '/build/publish' })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 选择系统做一些逻辑判断
|
||||||
|
changeSys () {
|
||||||
|
// this.form.systemType = sysType
|
||||||
|
this.form.apkId = null
|
||||||
|
this.form.version = null
|
||||||
|
this.form.sysApkName = null
|
||||||
|
this.form.appStoreAddress = null
|
||||||
|
this.form.apkUrl = null
|
||||||
|
},
|
||||||
|
// 发布按钮
|
||||||
|
|
||||||
|
pubLishForm () {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
let data = Object.assign({}, this.form)
|
||||||
|
delete data.explain
|
||||||
|
updatePublish(data).then(response => {
|
||||||
|
this.handlePublish(data.id)
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addPublish(this.form).then((res) => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.close()
|
||||||
|
this.$router.push({ path: '/build/publish' })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handlePublish (id) {
|
||||||
|
publish(id).then(response => {
|
||||||
|
this.close()
|
||||||
|
this.$modal.msgSuccess('发布成功')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAddWhite (e) {
|
||||||
|
if (e) {
|
||||||
|
this.WhiteArr.push(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 关闭包选择框*/
|
||||||
|
|
||||||
|
closeAddPack () {
|
||||||
|
this.packOpen = false
|
||||||
|
},
|
||||||
|
closeAddWhite () {
|
||||||
|
this.whiteOpen = false
|
||||||
|
},
|
||||||
|
cancel () {
|
||||||
|
this.close()
|
||||||
|
this.$router.push({ path: '/build/publish' })
|
||||||
|
},
|
||||||
|
handleDeleteTag (e) {
|
||||||
|
for (var i in this.WhiteArr) {
|
||||||
|
if (this.WhiteArr[i].apkId == e) {
|
||||||
|
this.WhiteArr.splice(i, 1);
|
||||||
|
break; // 删除后退出循环
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.$tab.closePage();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-container {
|
||||||
|
background: #ffffff;
|
||||||
|
// margin: 24px;
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-main {
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input.is-disabled .el-input__inner,
|
||||||
|
.el-textarea.is-disabled .el-textarea__inner {
|
||||||
|
border: 1px solid #E4E7ED !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-group {
|
||||||
|
.el-tag {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tag+.el-tag {
|
||||||
|
margin-left: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 24px;
|
||||||
|
right: 80px
|
||||||
|
}
|
||||||
|
|
||||||
|
.area-box {
|
||||||
|
max-width: 400px;
|
||||||
|
min-height: 100px;
|
||||||
|
padding: 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 1px solid #DCDFE6;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input,
|
||||||
|
.el-select {
|
||||||
|
max-width: 400px;
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="120px" size="small">
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="" size="small"
|
||||||
|
labelPosition="left">
|
||||||
<el-form-item label="APP名称" prop="appName">
|
<el-form-item label="APP名称" prop="appName">
|
||||||
<el-input v-model="queryParams.appName" clearable placeholder="请输入APP名称" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.appName" clearable placeholder="请输入APP名称" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -34,12 +35,10 @@
|
|||||||
type="success" @click="handleUpdate">修改
|
type="success" @click="handleUpdate">修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<!-- <el-col :span="1.5">
|
||||||
<el-col :span="1.5">
|
<el-button :disabled="multiple" icon="el-icon-top" plain size="mini" type="info" @click="handlePublish">批量发布
|
||||||
<el-button :disabled="multiple" icon="el-icon-top" plain size="mini" type="info" @click="handleDelete">批量发布
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
|
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPermi="['deployment:publish:remove']" :disabled="multiple" icon="el-icon-delete" plain size="mini"
|
<el-button v-hasPermi="['deployment:publish:remove']" :disabled="multiple" icon="el-icon-delete" plain size="mini"
|
||||||
type="danger" @click="handleDelete">批量删除
|
type="danger" @click="handleDelete">批量删除
|
||||||
@ -52,7 +51,10 @@
|
|||||||
<el-table-column :show-overflow-tooltip="true" align="center" type="selection" width="55" />
|
<el-table-column :show-overflow-tooltip="true" align="center" type="selection" width="55" />
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="APP名称" prop="appName" />
|
<el-table-column :show-overflow-tooltip="true" align="center" label="APP名称" prop="appName" />
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="版本号" prop="version" />
|
<el-table-column :show-overflow-tooltip="true" align="center" label="版本号" prop="version" />
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="系统" prop="systemType" />
|
<el-table-column :show-overflow-tooltip="true" align="center" label="系统" prop="systemType" :filters="dict.type.sys_apk_type.map(item => ({
|
||||||
|
...item,
|
||||||
|
text: item.label
|
||||||
|
}))" :filter-method="filterTagSysType" />
|
||||||
<el-table-column align="center" label="公开版" prop="publicVersion">
|
<el-table-column align="center" label="公开版" prop="publicVersion">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch v-model="scope.row.publicVersion" :active-value="1" :inactive-value="0" class="drawer-switch"
|
<el-switch v-model="scope.row.publicVersion" :active-value="1" :inactive-value="0" class="drawer-switch"
|
||||||
@ -65,222 +67,109 @@
|
|||||||
disabled />
|
disabled />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="上传时间" prop="updateTime">
|
<el-table-column :show-overflow-tooltip="true" align="center" label="上传时间" prop="updateTime" sortable>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="发布环境" prop="publishEnvironment">
|
<el-table-column :show-overflow-tooltip="true" align="center" label="发布环境" prop="publishEnvironment" :filters="environmentList.map(item => ({
|
||||||
|
...item,
|
||||||
|
text: item.name,
|
||||||
|
value: item.id
|
||||||
|
}))" :filter-method="filterPublishEnvironment" filter-placement="bottom-end">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-for="item in environmentList" :key="item.id">
|
<div v-for="item in environmentList" :key="item.id">
|
||||||
<div v-if="item.id === scope.row.publishEnvironment">{{ item.name }}</div>
|
<div v-if="item.id === scope.row.publishEnvironment">{{ item.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <dict-tag :options="environmentList" :value="scope.row.publishEnvironment"/>-->
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="发布状态" prop="publishEnvironment">
|
<el-table-column :show-overflow-tooltip="true" align="center" :filters="dict.type.release_status.map(item => ({
|
||||||
|
...item,
|
||||||
|
text: item.label
|
||||||
|
}))" :filter-method="filterTagStatus" label="发布状态" prop="publishEnvironment">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.release_status" :value="scope.row.status" />
|
<span v-for="item in dict.type.release_status">
|
||||||
|
<el-tag v-if="item.value == scope.row.status"
|
||||||
|
:type="scope.row.status == 0 ? 'info' : scope.row.status == 1 ? 'success' : 'warning'">{{ item.label
|
||||||
|
}}</el-tag>
|
||||||
|
</span>
|
||||||
|
<!-- <dict-tag :options="dict.type.release_status" :value="scope.row.status" /> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="安装包编号" prop="apkId" />
|
<el-table-column :show-overflow-tooltip="true" align="center" label="安装包编号" prop="apkId" />
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="版本说明" prop="versionDesc" />
|
<el-table-column :show-overflow-tooltip="true" align="center" label="版本说明" prop="versionDesc" />
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="公开时间" prop="createTime">
|
<el-table-column :show-overflow-tooltip="true" align="center" label="公开时间" prop="createTime" sortable>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
<el-table-column align="center" label="二维码" min-width="80">
|
<el-table-column align="center" label="二维码" min-width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<template v-if="scope.row.quickMark">
|
<template v-if="scope.row.quickMark">
|
||||||
<el-image v-if="scope.row.status != 2" :preview-src-list="[scope.row.quickMark]" :src="scope.row.quickMark"
|
<el-image v-if="scope.row.status != 2" :preview-src-list="[scope.row.quickMark]" :src="scope.row.quickMark"
|
||||||
style="width: 80px; height: 80px">
|
style="width: 80px; height: 80px">
|
||||||
</el-image>
|
</el-image>
|
||||||
|
|
||||||
<el-image v-else :src="scope.row.quickMark" style="width: 80px; height: 80px">
|
<el-image v-else :src="scope.row.quickMark" style="width: 80px; height: 80px">
|
||||||
</el-image>
|
</el-image>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div v-else>/</div>
|
<div v-else>/</div>
|
||||||
<!-- <el-popover-->
|
|
||||||
<!-- v-if="scope.row.qrCode && scopeC.row.status !== '20'"-->
|
|
||||||
<!-- ref="popver"-->
|
|
||||||
<!-- trigger="click"-->
|
|
||||||
<!-- width="200"-->
|
|
||||||
<!-- >-->
|
|
||||||
<!-- <div class="table-img">-->
|
|
||||||
<!-- <img :src="'data:image/jpg;base64,'+ scope.row.qrCode">-->
|
|
||||||
<!-- <p v-if="scopeC.row.verifyCode">密码:{{ scope.row.verifyCode }}</p>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </el-popover>-->
|
|
||||||
<!-- <div v-else>-</div>-->
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" fixed="right">
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button v-if="scope.row.status === 1" icon="el-icon-bottom" size="mini" type="text"
|
<el-popover placement="left" width="" trigger="hover">
|
||||||
@click="handleDown(scope.row)">下架
|
<div>
|
||||||
</el-button>
|
<div style="margin-bottom: 10px;color:#000;font-size:14px">操作</div>
|
||||||
<el-button v-if="scope.row.status == 2 || scope.row.status == 0" icon="el-icon-top" size="mini" type="text"
|
<div style="text-align: right; margin: 0">
|
||||||
@click="handlePublish(scope.row.id)">发布
|
<el-button @click="handlePublish(scope.row)" v-if="scope.row.status == 2 || scope.row.status == 0" plain
|
||||||
</el-button>
|
size="mini">发布</el-button>
|
||||||
|
<el-button @click="handleDown(scope.row)" plain size="mini" v-if="scope.row.status == 1">下架</el-button>
|
||||||
<el-button icon="el-icon-view" size="mini" type="text" @click="handleDetail(scope.row)">详情
|
<el-button @click="handleDownload(scope.row)" size="mini">下载</el-button>
|
||||||
</el-button>
|
<el-button plain size="mini" @click="handleUpdate(scope.row)"
|
||||||
|
v-if="scope.row.status === 2 || scope.row.status === 0">修改</el-button>
|
||||||
<el-button icon="el-icon-download" size="mini" type="text" @click="handleDownload(scope.row)">下载安装包
|
<el-button plain size="mini" @click="handleDetail(scope.row)">详情</el-button>
|
||||||
</el-button>
|
<el-button plain type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
<el-button v-if="scope.row.status === 2 || scope.row.status === 0" v-hasPermi="['deployment:publish:edit']"
|
</div>
|
||||||
icon="el-icon-edit" size="mini" type="text" @click="handleUpdate(scope.row)">修改
|
</div>
|
||||||
</el-button>
|
<el-button slot="reference" size="mini" type="text">更多<i class="el-icon-caret-right"></i></el-button>
|
||||||
<el-button v-if="scope.row.status === 2 || scope.row.status === 0" v-hasPermi="['deployment:publish:remove']"
|
</el-popover>
|
||||||
icon="el-icon-delete" size="mini" type="text" @click="handleDelete(scope.row)">删除
|
<!--
|
||||||
</el-button>
|
<el-dropdown trigger="hover" placement="left-start" size="mini"
|
||||||
|
@command="(command) => handleCommand(command, scope.row)">
|
||||||
|
<el-button size="mini" type="text">更多<i class="el-icon-caret-right"></i></el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown" class="dropdown-max">
|
||||||
|
<el-dropdown-item command="handlePublish"
|
||||||
|
v-if="scope.row.status == 2 || scope.row.status == 0">发布</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleDown" v-if="scope.row.status == 1">下架</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleUpdate"
|
||||||
|
v-if="scope.row.status === 2 || scope.row.status === 0">编辑</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleDownload">下载安装包
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleDetail">详情</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleDelete"
|
||||||
|
v-if="scope.row.status === 2 || scope.row.status === 0">删除</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum" :total="total"
|
<pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum" :total="total"
|
||||||
@pagination="getList" />
|
@pagination="getList" />
|
||||||
|
|
||||||
<!-- 添加或修改发布列表对话框 -->
|
|
||||||
|
|
||||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="900px">
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
||||||
<el-form-item label="APPid">
|
|
||||||
<el-input v-model="form.applyId" placeholder="请输入Appid" readonly />
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="APP名称">
|
|
||||||
<el-input v-model="form.appName" placeholder="请输入APP名称" readonly />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="选择系统" prop="systemType">
|
|
||||||
|
|
||||||
<el-select v-model="form.systemType" placeholder="请选择系统类型" @change="changeSys">
|
|
||||||
<el-option v-for="dict in dict.type.sys_apk_type" :key="dict.value" :label="dict.label"
|
|
||||||
:value="dict.value"></el-option>
|
|
||||||
</el-select>
|
|
||||||
<!-- <el-radio-group v-model="form.systemType" @change="changeSys">-->
|
|
||||||
<!-- <el-radio-button label="android">android</el-radio-button>-->
|
|
||||||
<!-- <el-radio-button label="IOS">IOS</el-radio-button>-->
|
|
||||||
<!-- <el-radio-button label="HarmonyOS">HarmonyOS</el-radio-button>-->
|
|
||||||
<!-- </el-radio-group>-->
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="form.systemType != 'IOS'" label="安装包" prop="sysApkName">
|
|
||||||
<!-- <el-input v-model="form.apkId" class="input-with-select" placeholder="请选择包" readonly>-->
|
|
||||||
<!-- <el-button slot="append" icon="el-icon-search" @click="handlePackOpen"></el-button>-->
|
|
||||||
<!-- </el-input>-->
|
|
||||||
<el-input v-model="form.sysApkName" class="input-with-select" placeholder="请选择包" readonly>
|
|
||||||
<el-button slot="append" icon="el-icon-search" @click="handlePackOpen"></el-button>
|
|
||||||
</el-input>
|
|
||||||
|
|
||||||
<!-- <el-input v-model="form.apkId" placeholder="请输入安装包编号"/>-->
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="form.systemType == 'ios'" label="app store地址" prop="appStoreAddress">
|
|
||||||
<el-input v-model="form.appStoreAddress" placeholder="请输入app store地址" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="版本号" prop="version">
|
|
||||||
<el-input v-model="form.version" placeholder="请输入版本号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="版本说明" prop="versionDesc">
|
|
||||||
<el-input v-model="form.versionDesc" placeholder="请输入版本说明" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="发布环境" prop="publishEnvironment">
|
|
||||||
|
|
||||||
<el-select v-model="form.publishEnvironment">
|
|
||||||
<el-option v-for="dict in environmentList" :key="dict.value" :label="dict.name" :value="parseInt(dict.id)" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="发布策略" prop="publishStrategy">
|
|
||||||
|
|
||||||
<el-select v-model="form.publishStrategy">
|
|
||||||
<el-option v-for="dict in dict.type.release_strategy" :key="dict.value" :label="dict.label"
|
|
||||||
:value="parseInt(dict.value)" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="结果通知" prop="resultNotify">
|
|
||||||
<el-switch v-model="form.resultNotify" :active-value="1" :inactive-value="0" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="公开版" prop="publicVersion">
|
|
||||||
|
|
||||||
<el-switch v-model="form.publicVersion" :active-value="1" :inactive-value="0" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="强制更新" prop="forceUpdate">
|
|
||||||
<el-switch v-model="form.forceUpdate" :active-value="1" :inactive-value="0" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="下载验证" prop="downloadVerification">
|
|
||||||
<el-switch v-model="form.downloadVerification" :active-value="1" :inactive-value="0" />
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="更新对象(-1: 不限制, 白名单id)" prop="updateObject">-->
|
|
||||||
<!-- <el-form-item label="更新对象" prop="updateObject">-->
|
|
||||||
|
|
||||||
<!-- <el-select v-model="form.publishStrategy">-->
|
|
||||||
<!-- <el-option-->
|
|
||||||
<!-- v-for="dict in dict.type.release_user_type"-->
|
|
||||||
<!-- :key="dict.value"-->
|
|
||||||
<!-- :label="dict.label"-->
|
|
||||||
<!-- :value="parseInt(dict.value)"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </el-select>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<el-form-item label="有效期开始时间" prop="validityStartTime">
|
|
||||||
<el-date-picker v-model="form.validityStartTime" clearable placeholder="请选择有效期开始时间" type="date"
|
|
||||||
value-format="yyyy-MM-dd">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="有效期结束时间" prop="validityEndTime">
|
|
||||||
<el-date-picker v-model="form.validityEndTime" clearable placeholder="请选择有效期结束时间" type="date"
|
|
||||||
value-format="yyyy-MM-dd">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button v-if="form.status != 2" type="primary" @click="pubLishForm">发 布
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
|
|
||||||
<AddPack v-if="packOpen" :systemType="form.systemType" @addPack="addPack" @close="closeAddPack"></AddPack>
|
|
||||||
<DetailModal v-if="openDetail" :detailId="detailId" :openDetail="openDetail" @close="closeDetailModal"></DetailModal>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
addPublish,
|
|
||||||
delPublish,
|
delPublish,
|
||||||
getPublish,
|
|
||||||
listPublish,
|
listPublish,
|
||||||
publish,
|
publish,
|
||||||
soldPublish,
|
soldPublish,
|
||||||
updatePublish
|
|
||||||
} from '@/api/deployment/publish'
|
} from '@/api/deployment/publish'
|
||||||
import Cookies from 'js-cookie'
|
|
||||||
import AddPack from '@/views/FDS/publishList/components/addPack.vue'
|
|
||||||
import DetailModal from './component/detail.vue'
|
|
||||||
import { listEnvironment } from '@/api/deployment/environment'
|
import { listEnvironment } from '@/api/deployment/environment'
|
||||||
import { getApplicationName } from '@/utils/application'
|
|
||||||
import { getINFO } from '@/api/FDS/installList'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Publish',
|
name: 'Publish',
|
||||||
dicts: ['release_environment', 'sys_yes_no', 'release_strategy', 'release_user_type', 'release_status', 'sys_apk_type'],
|
dicts: ['release_environment', 'sys_yes_no', 'release_strategy', 'release_user_type', 'release_status', 'sys_apk_type'],
|
||||||
components: {
|
|
||||||
AddPack,
|
|
||||||
DetailModal
|
|
||||||
},
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
@ -300,7 +189,6 @@ export default {
|
|||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: '',
|
title: '',
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
|
||||||
packOpen: false,
|
packOpen: false,
|
||||||
openDetail: false,
|
openDetail: false,
|
||||||
detailId: '',
|
detailId: '',
|
||||||
@ -324,50 +212,7 @@ export default {
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
sysApkName: null,
|
sysApkName: null,
|
||||||
appCode: Cookies.get('Admin-Application-appCode')
|
|
||||||
},
|
},
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
appName: [
|
|
||||||
{ required: true, message: '应用name不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
systemType: [
|
|
||||||
{ required: true, message: '系统类型不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
apkId: [
|
|
||||||
{ required: true, message: '安装包编号不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
version: [
|
|
||||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
publishEnvironment: [
|
|
||||||
{ required: true, message: '发布环境不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
publishStrategy: [
|
|
||||||
{ required: true, message: '发布策略不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
publicVersion: [
|
|
||||||
{ required: true, message: '公开版不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
forceUpdate: [
|
|
||||||
{ required: true, message: '强制更新不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
updateObject: [
|
|
||||||
{ required: true, message: '更新对象(-1: 不限制, 白名单id)不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
status: [
|
|
||||||
{ required: true, message: '0:保存,1:已发布,2:已下架不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
isDelete: [
|
|
||||||
{ required: true, message: '逻辑删除,0:未删除,1:删除不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
createTime: [
|
|
||||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
sysApkName: [
|
|
||||||
{ required: true, message: '安装包不能为空', trigger: 'blur' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
@ -377,7 +222,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
/** 查询发布列表列表 */
|
/** 查询发布列表列表 */
|
||||||
getList (type) {
|
getList (type) {
|
||||||
|
|
||||||
this.loading = true
|
this.loading = true
|
||||||
listPublish(this.queryParams).then(response => {
|
listPublish(this.queryParams).then(response => {
|
||||||
this.publishList = response.rows
|
this.publishList = response.rows
|
||||||
@ -388,45 +232,7 @@ export default {
|
|||||||
this.handlePublish(this.publishList[0].id)
|
this.handlePublish(this.publishList[0].id)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 取消按钮
|
|
||||||
cancel () {
|
|
||||||
this.open = false
|
|
||||||
this.loading = false
|
|
||||||
this.reset()
|
|
||||||
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset () {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
applyId: Cookies.get('Admin-Application-Id'),
|
|
||||||
appName: getApplicationName(),
|
|
||||||
systemType: null,
|
|
||||||
apkId: null,
|
|
||||||
appStoreAddress: null,
|
|
||||||
version: null,
|
|
||||||
versionDesc: null,
|
|
||||||
publishEnvironment: null,
|
|
||||||
publishStrategy: null,
|
|
||||||
resultNotify: null,
|
|
||||||
publicVersion: null,
|
|
||||||
forceUpdate: null,
|
|
||||||
downloadVerification: null,
|
|
||||||
updateObject: null,
|
|
||||||
validityStartTime: null,
|
|
||||||
validityEndTime: null,
|
|
||||||
remark: null,
|
|
||||||
status: null,
|
|
||||||
isDelete: null,
|
|
||||||
created: null,
|
|
||||||
modified: null,
|
|
||||||
createTime: null,
|
|
||||||
updateTime: null,
|
|
||||||
apkUrl: null,
|
|
||||||
sysApkName: null
|
|
||||||
}
|
|
||||||
this.resetForm('form')
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery () {
|
handleQuery () {
|
||||||
this.queryParams.pageNum = 1
|
this.queryParams.pageNum = 1
|
||||||
@ -445,84 +251,19 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd () {
|
handleAdd () {
|
||||||
this.reset()
|
this.$router.push('/build/publishAdd')
|
||||||
this.open = true
|
|
||||||
this.title = '添加发布列表'
|
|
||||||
this.getEnvironmentList()
|
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
|
||||||
|
/** 编辑按钮操作 */
|
||||||
handleUpdate (row) {
|
handleUpdate (row) {
|
||||||
this.reset()
|
this.$router.push({
|
||||||
this.getEnvironmentList()
|
path: '/build/publishEdit',
|
||||||
const id = row.id || this.ids
|
query: {
|
||||||
getPublish(id).then(response => {
|
id: row.id,
|
||||||
this.form = response.data
|
|
||||||
this.getPackList(this.form.apkId)
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 查询参数列表 */
|
|
||||||
getPackList (id) {
|
|
||||||
getINFO(id).then(response => {
|
|
||||||
this.form.sysApkName = response.data.sysApkName
|
|
||||||
this.open = true
|
|
||||||
this.title = '修改发布列表'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm () {
|
|
||||||
this.$refs['form'].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
let data = Object.assign({}, this.form)
|
|
||||||
delete data.explain
|
|
||||||
updatePublish(data).then(response => {
|
|
||||||
console.log(data)
|
|
||||||
this.$modal.msgSuccess('修改成功')
|
|
||||||
this.loading = false
|
|
||||||
this.open = false
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
addPublish(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess('新增成功')
|
|
||||||
this.loading = false
|
|
||||||
this.open = false
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 发布按钮
|
|
||||||
|
|
||||||
pubLishForm () {
|
|
||||||
this.$refs['form'].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
let data = Object.assign({}, this.form)
|
|
||||||
delete data.explain
|
|
||||||
updatePublish(data).then(response => {
|
|
||||||
this.handlePublish(data.id)
|
|
||||||
this.loading = false
|
|
||||||
this.open = false
|
|
||||||
|
|
||||||
// this.getList()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
addPublish(this.form).then((res) => {
|
|
||||||
this.loading = false
|
|
||||||
this.open = false
|
|
||||||
this.getList('publish')
|
|
||||||
// this.handlePublish(res.id)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete (row) {
|
handleDelete (row) {
|
||||||
@ -535,32 +276,6 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport () {
|
|
||||||
this.download('deployment/publish/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `publish_${new Date().getTime()}.xlsx`)
|
|
||||||
},
|
|
||||||
/** 弹出包选择框*/
|
|
||||||
handlePackOpen () {
|
|
||||||
this.packOpen = true
|
|
||||||
},
|
|
||||||
|
|
||||||
addPack (e) {
|
|
||||||
this.form.apkId = e.apkId
|
|
||||||
this.form.version = e.version
|
|
||||||
this.form.systemType = e.sysType
|
|
||||||
this.form.sysApkName = e.sysApkName
|
|
||||||
this.form.apkUrl = e.sysApk
|
|
||||||
this.packOpen = false
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 关闭包选择框*/
|
|
||||||
|
|
||||||
closeAddPack () {
|
|
||||||
|
|
||||||
this.packOpen = false
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 查询环境维护列表 */
|
/** 查询环境维护列表 */
|
||||||
getEnvironmentList () {
|
getEnvironmentList () {
|
||||||
@ -569,19 +284,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选择系统做一些逻辑判断
|
|
||||||
changeSys () {
|
|
||||||
// this.form.systemType = sysType
|
|
||||||
this.form.apkId = null
|
|
||||||
this.form.version = null
|
|
||||||
this.form.sysApkName = null
|
|
||||||
this.form.appStoreAddress = null
|
|
||||||
this.form.apkUrl = null
|
|
||||||
console.log(this.form, 99999999)
|
|
||||||
},
|
|
||||||
/**下载安装包*/
|
|
||||||
handleDownload () {
|
|
||||||
|
|
||||||
|
/**下载安装包*/
|
||||||
|
handleDownload (row) {
|
||||||
|
window.open(row.apkUrl);
|
||||||
},
|
},
|
||||||
/**下架*/
|
/**下架*/
|
||||||
handleDown (row) {
|
handleDown (row) {
|
||||||
@ -591,21 +297,56 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**发布*/
|
/**发布*/
|
||||||
handlePublish (id) {
|
handlePublish (row) {
|
||||||
publish(id).then(response => {
|
publish(row.id).then(response => {
|
||||||
this.$modal.msgSuccess('发布成功')
|
this.$modal.msgSuccess('发布成功')
|
||||||
this.getList()
|
this.getList()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**详情*/
|
/**详情*/
|
||||||
handleDetail (row) {
|
handleDetail (row) {
|
||||||
this.detailId = row.id
|
this.$router.push({
|
||||||
this.openDetail = true
|
path: '/build/publishDetail',
|
||||||
},
|
query: {
|
||||||
closeDetailModal () {
|
id: row.id,
|
||||||
this.openDetail = false
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
filterTagStatus (value, row) {
|
||||||
|
return row.status === Number(value);
|
||||||
|
},
|
||||||
|
filterTagSysType (value, row) {
|
||||||
|
return row.sysType === Number(value);
|
||||||
|
},
|
||||||
|
filterPublishEnvironment (value, row) {
|
||||||
|
return row.publishEnvironment === Number(value);
|
||||||
|
},
|
||||||
|
// 更多操作触发
|
||||||
|
handleCommand (command, row) {
|
||||||
|
switch (command) {
|
||||||
|
case "handlePublish":
|
||||||
|
this.handlePublish(row);
|
||||||
|
break;
|
||||||
|
case "handleDown":
|
||||||
|
this.handleDown(row);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "handleUpdate":
|
||||||
|
this.handleUpdate(row);
|
||||||
|
break;
|
||||||
|
case "handleDownload":
|
||||||
|
this.handleDownload(row);
|
||||||
|
break;
|
||||||
|
case "handleDetail":
|
||||||
|
this.handleDetail(row);
|
||||||
|
break;
|
||||||
|
case "handleDelete":
|
||||||
|
this.handleDelete(row);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -620,4 +361,14 @@ export default {
|
|||||||
.el-tag+.el-tag {
|
.el-tag+.el-tag {
|
||||||
margin-left: 10px
|
margin-left: 10px
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropdown-container {
|
||||||
|
display: flex;
|
||||||
|
/* 设置为Flex布局 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dropdown-link {
|
||||||
|
cursor: pointer;
|
||||||
|
color: #409EFF;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
147
sf-ui/src/views/deployment/whitelist/add.vue
Normal file
147
sf-ui/src/views/deployment/whitelist/add.vue
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-container>
|
||||||
|
<el-main>
|
||||||
|
<div class="form-main">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
|
<el-form-item label="白名单名称" prop="whitelistName">
|
||||||
|
<el-input v-model="form.whitelistName" placeholder="请输入白名单名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="白名单类型" prop="whitelistType">
|
||||||
|
<el-select v-model="form.whitelistType" clearable placeholder="请选择白名单类型">
|
||||||
|
<el-option v-for="dict in dict.type.whitelist_type" :key="dict.value" :label="dict.label"
|
||||||
|
:value="parseInt(dict.value)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="白名单模式" prop="whitelistMode">
|
||||||
|
<el-select v-model="form.whitelistMode" clearable placeholder="请选择白名单模式">
|
||||||
|
|
||||||
|
<el-option v-for="dict in dict.type.white_mode" :key="dict.value" :label="dict.label"
|
||||||
|
:value="parseInt(dict.value)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.remarks" placeholder="请输入内容" type="textarea" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div class="footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitAddForm()">保 存</el-button>
|
||||||
|
</div>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { addWhitelist } from '@/api/FDS/whiteList'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WhiteAdd',
|
||||||
|
dicts: ["white_mode", 'whitelist_type'],
|
||||||
|
data () {
|
||||||
|
|
||||||
|
return {
|
||||||
|
form: {},
|
||||||
|
tokenId: '',
|
||||||
|
// 文件存放的路径
|
||||||
|
fileList: [],
|
||||||
|
rules: {
|
||||||
|
whitelistName: [
|
||||||
|
{ required: true, message: '白名单名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
whitelistType: [
|
||||||
|
{ required: true, message: '白名单类型不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
whitelistMode: [
|
||||||
|
{ required: true, message: '白名单模式不能为空', trigger: 'change' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
mounted () {
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
reset () {
|
||||||
|
this.form = {
|
||||||
|
}
|
||||||
|
console.log(this.form)
|
||||||
|
},
|
||||||
|
/** 新增按钮 */
|
||||||
|
submitAddForm: function () {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
|
||||||
|
addWhitelist(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess('新增成功')
|
||||||
|
})
|
||||||
|
this.close()
|
||||||
|
this.$router.push({ path: '/build/whitelist' })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cancel () {
|
||||||
|
this.close()
|
||||||
|
this.$router.push({ path: '/build/whitelist' })
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.$tab.closePage();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-container {
|
||||||
|
background: #ffffff;
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-main {
|
||||||
|
width: 700px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input.is-disabled .el-input__inner,
|
||||||
|
.el-textarea.is-disabled .el-textarea__inner {
|
||||||
|
border: 1px solid #E4E7ED !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-group {
|
||||||
|
.el-tag {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tag+.el-tag {
|
||||||
|
margin-left: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-footer {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 700px;
|
||||||
|
justify-content: center;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input,
|
||||||
|
.el-select,
|
||||||
|
.el-textarea {
|
||||||
|
max-width: 400px;
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
margin-top: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 24px;
|
||||||
|
right: 80px
|
||||||
|
}
|
||||||
|
</style>
|
292
sf-ui/src/views/deployment/whitelist/addConfig.vue
Normal file
292
sf-ui/src/views/deployment/whitelist/addConfig.vue
Normal file
@ -0,0 +1,292 @@
|
|||||||
|
、
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div>白名单配置</div>
|
||||||
|
<el-divider />
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<div class="form-main">
|
||||||
|
<el-form ref="configForm" :model="configForm" :rules="configRules" label-width="120px">
|
||||||
|
<el-form-item label="添加方式" prop="configName">
|
||||||
|
<el-radio-group v-model="configForm.addMode">
|
||||||
|
<el-radio :label="1">手动添加
|
||||||
|
</el-radio>
|
||||||
|
<el-radio :label="2">批量添加
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="白名单类型">
|
||||||
|
<dict-tag :options="dict.type.white_mode" :value="configForm.whitelistType" />
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
<template v-if="configForm.addMode == 1">
|
||||||
|
<el-form-item :label="configForm.whiteListType == 0 ? '用户ID' : '白名单设备'" prop="user">
|
||||||
|
<el-input v-model="configForm.userId" :placeholder="configForm.whiteListType == 0 ? '请输入用户ID' : '请输入设备信息'"
|
||||||
|
type="textarea" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<el-form-item v-else-if="configForm.addMode == 2" label="白名单文件" prop="fileList">
|
||||||
|
<div class="upload-file">
|
||||||
|
<el-upload ref="fileUpload" :accept="accept" action="#" :before-upload="handleBeforeUpload"
|
||||||
|
:file-list="fileList" :limit="1" :auto-upload="false" :on-error="handleUploadError"
|
||||||
|
:on-exceed="handleExceed" :on-success="handleUploadSuccess" :on-change="changeFile"
|
||||||
|
:show-file-list="false" class="upload-file-uploader" multiple>
|
||||||
|
<!-- 上传按钮 -->
|
||||||
|
<el-button size="mini" type="primary">选取文件</el-button>
|
||||||
|
<!-- 上传提示 -->
|
||||||
|
<div v-if="showTip" slot="tip" class="el-upload__tip">
|
||||||
|
请上传
|
||||||
|
<template v-if="fileSize">大小不超过 <b style="color: #f56c6c">1MB</b></template>
|
||||||
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">txt</b></template>
|
||||||
|
的文件
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
|
||||||
|
<!-- 文件列表 -->
|
||||||
|
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear"
|
||||||
|
tag="ul">
|
||||||
|
<li v-for="(file, index) in fileList" :key="file.uid"
|
||||||
|
class="el-upload-list__item ele-upload-list__item-content fl-ac">
|
||||||
|
<div class="el-icon-document"> {{ file.name }} </div>
|
||||||
|
<div class="ele-upload-list__item-content-action">
|
||||||
|
<el-link :underline="false" type="danger" @click="handleDelete(index)">删除</el-link>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</transition-group>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div class="page-footer">
|
||||||
|
<el-button type="primary" @click="submitAddForm()">保 存</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { listWhitelistMember, addWhitelistMember, importWhitelist } from "@/api/FDS/whiteList";
|
||||||
|
import { getToken } from '@/utils/auth'
|
||||||
|
export default {
|
||||||
|
name: 'WhiteAddConfig',
|
||||||
|
dicts: ["white_mode", 'whitelist_type', 'release_status'],
|
||||||
|
data () {
|
||||||
|
|
||||||
|
return {
|
||||||
|
form: {},
|
||||||
|
tokenId: '',
|
||||||
|
// 文件存放的路径
|
||||||
|
fileList: [],
|
||||||
|
configForm: {
|
||||||
|
addMode: 1,
|
||||||
|
whiteListType: '',
|
||||||
|
whitelistIds: '',
|
||||||
|
remark: '',
|
||||||
|
equepid: '',
|
||||||
|
fileList: []
|
||||||
|
},
|
||||||
|
accept: 'text/plain',
|
||||||
|
headers: {
|
||||||
|
Authorization: 'Bearer ' + getToken()
|
||||||
|
},
|
||||||
|
number: 0,
|
||||||
|
isShowTip: true,
|
||||||
|
fileSize: 1,
|
||||||
|
fileList: [],
|
||||||
|
uploadList: [],
|
||||||
|
_formData: new FormData(),
|
||||||
|
file: {},
|
||||||
|
fileType: ['txt'],
|
||||||
|
configRules: {
|
||||||
|
user: [
|
||||||
|
{ required: true, message: '用户Id不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
fileList: [
|
||||||
|
{ required: true, message: '白名单文件不能为空', trigger: 'change' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
// 是否显示提示
|
||||||
|
showTip () {
|
||||||
|
return this.isShowTip && (this.fileType || this.fileSize)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
this.whitelistId = this.$route.query.id;
|
||||||
|
this.configForm.whitelistType = this.$route.query.whitelistType
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
reset () {
|
||||||
|
this.form = {
|
||||||
|
addMode: undefined,
|
||||||
|
whiteListType: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
equepid: undefined,
|
||||||
|
file: undefined
|
||||||
|
}
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitAddForm: function () {
|
||||||
|
this.$refs['configForm'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.configForm.addMode == 1) {
|
||||||
|
addWhitelistMember({
|
||||||
|
user: this.configForm.user,
|
||||||
|
whitelistId: this.whitelistId
|
||||||
|
}).then(response => {
|
||||||
|
this.$modal.msgSuccess('新增成功')
|
||||||
|
this.$router.push({ path: '/build/whitelist' })
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
importWhitelist(this._formData).then(res => {
|
||||||
|
this.$modal.msgSuccess('新增成功')
|
||||||
|
this.$router.push({ path: '/build/whitelist' })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cancel () {
|
||||||
|
this.$router.push({ path: '/build/whitelist' })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 上传前校检格式和大小
|
||||||
|
handleBeforeUpload (file) {
|
||||||
|
console.log(file)
|
||||||
|
// 校检文件类型
|
||||||
|
if (this.fileType) {
|
||||||
|
const fileName = file.name.split('.')
|
||||||
|
const fileExt = fileName[fileName.length - 1]
|
||||||
|
const isTypeOk = this.fileType.indexOf(fileExt) >= 0
|
||||||
|
if (!isTypeOk) {
|
||||||
|
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join('/')}格式文件!`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 校检文件大小
|
||||||
|
if (this.fileSize) {
|
||||||
|
const isLt = file.size / 1024 / 1024 < this.fileSize
|
||||||
|
if (!isLt) {
|
||||||
|
this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$modal.loading('正在上传文件,请稍候...')
|
||||||
|
this.number++
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
// 文件个数超出
|
||||||
|
handleExceed () {
|
||||||
|
this.$modal.msgError(`上传文件数量不能超过 1 个!`)
|
||||||
|
},
|
||||||
|
// 上传失败
|
||||||
|
handleUploadError (err) {
|
||||||
|
console.log(222);
|
||||||
|
this.$modal.msgError('上传文件失败,请重试')
|
||||||
|
this.$modal.closeLoading()
|
||||||
|
},
|
||||||
|
// 上传成功回调
|
||||||
|
handleUploadSuccess (res, file) {
|
||||||
|
console.log(res);
|
||||||
|
if (res.status == 'ready') {
|
||||||
|
this.uploadList.push(res)
|
||||||
|
this.$modal.closeLoading()
|
||||||
|
this.uploadedSuccessfully()
|
||||||
|
} else {
|
||||||
|
this.$modal.closeLoading()
|
||||||
|
this.uploadedSuccessfully()
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (res.code === 200) {
|
||||||
|
// this.uploadList.push({ name: res.data.url, url: res.data.url, size: res.data.size })
|
||||||
|
|
||||||
|
// this.uploadedSuccessfully()
|
||||||
|
// } else {
|
||||||
|
// this.number--
|
||||||
|
// this.$modal.closeLoading()
|
||||||
|
// this.$refs.fileUpload.handleRemove(file)
|
||||||
|
// this.uploadedSuccessfully()
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
// 上传结束处理
|
||||||
|
uploadedSuccessfully () {
|
||||||
|
if (this.number > 0 && this.uploadList.length === this.number) {
|
||||||
|
this.fileList = this.fileList.concat(this.uploadList)
|
||||||
|
this.configForm.fileList = this.fileList.concat(this.uploadList)
|
||||||
|
this.uploadList = []
|
||||||
|
this.number = 0
|
||||||
|
this.$modal.closeLoading()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取文件名称
|
||||||
|
getFileName (name) {
|
||||||
|
if (name.lastIndexOf('/') > -1) {
|
||||||
|
return name.slice(name.lastIndexOf('/') + 1)
|
||||||
|
} else {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeFile (file) {
|
||||||
|
this.handleBeforeUpload(file)
|
||||||
|
this.handleUploadSuccess(file, file)
|
||||||
|
let formData = new FormData()
|
||||||
|
this.file = file
|
||||||
|
formData.append('file', file.raw)// 传文件
|
||||||
|
formData.append('whitelistId', this.whitelistId)// 传文件
|
||||||
|
this._formData = formData
|
||||||
|
},
|
||||||
|
|
||||||
|
handleDelete (index) {
|
||||||
|
this.fileList.splice(index, 1)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-container {
|
||||||
|
background: #ffffff;
|
||||||
|
margin: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-main {
|
||||||
|
width: 700px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input.is-disabled .el-input__inner,
|
||||||
|
.el-textarea.is-disabled .el-textarea__inner {
|
||||||
|
border: 1px solid #E4E7ED !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-group {
|
||||||
|
.el-tag {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tag+.el-tag {
|
||||||
|
margin-left: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-footer {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 700px;
|
||||||
|
justify-content: center;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fl-ac {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,112 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :modal-append-to-body="false" :visible.sync="dialogVisible" :title="title" v-bind="$attrs" width="550px"
|
||||||
|
v-on="$listeners">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item v-if="whitelistType == 0" label="用户Id" prop="user">
|
||||||
|
<el-input v-model="form.user" placeholder="请输入用户Id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item v-else label="设备号" prop="user">
|
||||||
|
<el-input v-model="form.user" placeholder="请输入设备号" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitAddForm()">保 存</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { updateWhitelistMember, getWhitelistMember } from '@/api/FDS/whiteList'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'EditWhiteList',
|
||||||
|
props: {
|
||||||
|
//类型
|
||||||
|
user: {
|
||||||
|
type: Number,
|
||||||
|
default: undefined
|
||||||
|
},
|
||||||
|
whitelistType: {
|
||||||
|
type: String,
|
||||||
|
default: undefined
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
default: undefined
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
configName: undefined,
|
||||||
|
dialogVisible: true,
|
||||||
|
form: {
|
||||||
|
user: undefined,
|
||||||
|
},
|
||||||
|
id: undefined,
|
||||||
|
title: '编辑',
|
||||||
|
// 详情信息
|
||||||
|
rules: {
|
||||||
|
user: [
|
||||||
|
{ required: true, message: '用户Id不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
this.form.user = this.user
|
||||||
|
this.form.id = this.id
|
||||||
|
this.getWhitelistMemberById()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 查询白名单成员列详细
|
||||||
|
*/
|
||||||
|
getWhitelistMemberById () {
|
||||||
|
getWhitelistMember(this.user).then(res => {
|
||||||
|
this.form.user = res.data.id
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitAddForm: function () {
|
||||||
|
// this.form.id = this.user
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
updateWhitelistMember(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess('修改成功')
|
||||||
|
this.closeModal()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
reset () {
|
||||||
|
this.form = {
|
||||||
|
user: undefined,
|
||||||
|
}
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel () {
|
||||||
|
this.reset()
|
||||||
|
this.closeModal()
|
||||||
|
},
|
||||||
|
closeModal () {
|
||||||
|
this.$emit('close')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog .el-form {
|
||||||
|
|
||||||
|
.el-input,
|
||||||
|
.el-select,
|
||||||
|
.el-textarea {
|
||||||
|
width: 100%
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
155
sf-ui/src/views/deployment/whitelist/detail.vue
Normal file
155
sf-ui/src/views/deployment/whitelist/detail.vue
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px" size="small">
|
||||||
|
<el-form-item label="白名单信息" prop="user">
|
||||||
|
<el-input v-model="queryParams.user" clearable :placeholder="whitelistType == 0 ? '请输入用户Id' : '请输入设备号'"
|
||||||
|
style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['system:config:delete']" :disabled="multiple" icon="el-icon-plus" plain size="mini"
|
||||||
|
type="info" @click="handleDelete">批量删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column align="center" type="selection" width="55" />
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" :label="whitelistType == 0 ? '用户Id' : '设备号'"
|
||||||
|
prop="user" />
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="添加时间" prop="createTime" />
|
||||||
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="250">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button v-hasPermi="['system:config:edit']" icon="el-icon-edit" size="mini" type="text"
|
||||||
|
@click="handleEdit(scope.row)">编辑
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button v-hasPermi="['system:config:delete']" icon="el-icon-delete" size="mini" type="text"
|
||||||
|
@click="handleDelete(scope.row)">删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum" :total="total"
|
||||||
|
@pagination="getList" />
|
||||||
|
<EditWhiteList v-if="editWhiteListOpen" @close="closeEditWhiteList" :user="user" :id='id'
|
||||||
|
:whitelistType="whitelistType" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { listWhitelistMember, delWhitelistMember } from '@/api/FDS/whiteList'
|
||||||
|
import EditWhiteList from './components/editWhiteList.vue'
|
||||||
|
export default {
|
||||||
|
name: 'WhiteListDetail',
|
||||||
|
components: { EditWhiteList },
|
||||||
|
dicts: ['sys_yes_no'],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 参数表格数据
|
||||||
|
dataList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: '',
|
||||||
|
editWhiteListOpen: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
user: undefined,
|
||||||
|
whitelistId: ''
|
||||||
|
},
|
||||||
|
user: '',
|
||||||
|
id: '',
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
whitelistId: '',
|
||||||
|
whitelistType: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
this.whitelistId = this.$route.query.id
|
||||||
|
this.whitelistType = this.$route.query.whitelistType
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询参数列表 */
|
||||||
|
getList () {
|
||||||
|
this.loading = true
|
||||||
|
this.queryParams.whitelistId = this.$route.query.id;
|
||||||
|
listWhitelistMember(this.queryParams).then(response => {
|
||||||
|
this.dataList = response.rows
|
||||||
|
this.total = response.total
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset () {
|
||||||
|
this.form = {
|
||||||
|
phoneNumber: undefined
|
||||||
|
}
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery () {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery () {
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange (selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length != 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete (row) {
|
||||||
|
const configIds = row.id || this.ids
|
||||||
|
this.$modal.confirm('是否确认删除编号为"' + configIds + '"的数据项?').then(function () {
|
||||||
|
return delWhitelistMember(configIds)
|
||||||
|
}).then(() => {
|
||||||
|
this.getList()
|
||||||
|
this.$modal.msgSuccess('删除成功')
|
||||||
|
}).catch(() => {
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleEdit (row) {
|
||||||
|
this.reset()
|
||||||
|
this.user = row.user
|
||||||
|
this.id = row.id
|
||||||
|
this.editWhiteListOpen = true
|
||||||
|
},
|
||||||
|
/** 关闭新增弹出框*/
|
||||||
|
closeEditWhiteList () {
|
||||||
|
this.editWhiteListOpen = false
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
148
sf-ui/src/views/deployment/whitelist/edit.vue
Normal file
148
sf-ui/src/views/deployment/whitelist/edit.vue
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-container>
|
||||||
|
<el-main>
|
||||||
|
<div class="form-main">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
|
<el-form-item label="白名单名称" prop="whitelistName">
|
||||||
|
<el-input v-model="form.whitelistName" placeholder="请输入白名单名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="白名单类型" prop="whitelistType">
|
||||||
|
<el-select v-model="form.whitelistType" clearable placeholder="请选择白名单类型">
|
||||||
|
<el-option v-for="dict in dict.type.whitelist_type" :key="dict.value" :label="dict.label"
|
||||||
|
:value="parseInt(dict.value)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="白名单模式" prop="whitelistMode">
|
||||||
|
<el-select v-model="form.whitelistMode" clearable placeholder="请选择白名单模式">
|
||||||
|
|
||||||
|
<el-option v-for="dict in dict.type.white_mode" :key="dict.value" :label="dict.label"
|
||||||
|
:value="parseInt(dict.value)" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.remarks" placeholder="请输入内容" type="textarea" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div class="footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
|
||||||
|
<el-button type="primary" @click="submitAddForm()">保 存</el-button>
|
||||||
|
</div>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { updateWhitelist, getWhitelist } from '@/api/FDS/whiteList'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WhiteEdit',
|
||||||
|
dicts: ["white_mode", 'whitelist_type'],
|
||||||
|
data () {
|
||||||
|
|
||||||
|
return {
|
||||||
|
form: {},
|
||||||
|
tokenId: '',
|
||||||
|
rules: {
|
||||||
|
whitelistName: [
|
||||||
|
{ required: true, message: '白名单名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
whitelistType: [
|
||||||
|
{ required: true, message: '白名单类型不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
whitelistMode: [
|
||||||
|
{ required: true, message: '白名单模式不能为空', trigger: 'change' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
mounted () {
|
||||||
|
this.getWhitelistById(this.$route.query.id)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getWhitelistById (id) {
|
||||||
|
getWhitelist(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitAddForm: function () {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
updateWhitelist(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess('修改成功')
|
||||||
|
})
|
||||||
|
this.close()
|
||||||
|
this.$router.push({ path: '/build/whitelist' })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel () {
|
||||||
|
this.close()
|
||||||
|
this.$router.push({ path: '/build/whitelist' })
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.$tab.closePage();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-container {
|
||||||
|
background: #ffffff;
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.form-main {
|
||||||
|
width: 700px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input.is-disabled .el-input__inner,
|
||||||
|
.el-textarea.is-disabled .el-textarea__inner {
|
||||||
|
border: 1px solid #E4E7ED !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-group {
|
||||||
|
.el-tag {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tag+.el-tag {
|
||||||
|
margin-left: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-footer {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 700px;
|
||||||
|
justify-content: center;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
::v-deep .el-input,
|
||||||
|
.el-select,
|
||||||
|
.el-textarea {
|
||||||
|
max-width: 400px;
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
margin-top: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 24px;
|
||||||
|
right: 80px
|
||||||
|
}
|
||||||
|
</style>
|
154
sf-ui/src/views/deployment/whitelist/equepDetail.vue
Normal file
154
sf-ui/src/views/deployment/whitelist/equepDetail.vue
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px" size="small">
|
||||||
|
<el-form-item label="白名单信息" prop="user">
|
||||||
|
<el-input v-model="queryParams.user" clearable placeholder="请输入设备号" style="width: 240px"
|
||||||
|
@keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['system:config:delete']" :disabled="multiple" icon="el-icon-plus" plain size="mini"
|
||||||
|
type="info" @click="handleDelete">批量删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column align="center" type="selection" width="55" />
|
||||||
|
<el-table-column align="center" label="设备号" prop="user" />
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="添加时间" prop="createTime" />
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="备注" prop="remarks" />
|
||||||
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="250">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button v-hasPermi="['system:config:edit']" icon="el-icon-edit" size="mini" type="text"
|
||||||
|
@click="handleEdit(scope.row)">编辑
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button v-hasPermi="['system:config:delete']" icon="el-icon-delete" size="mini" type="text"
|
||||||
|
@click="handleDelete(scope.row)">删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum" :total="total"
|
||||||
|
@pagination="getList" />
|
||||||
|
<EditWhiteList :visible.sync="editWhiteListOpen" @close="closeEditWhiteList" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { delConfig, listConfig } from '@/api/system/config'
|
||||||
|
import EditWhiteList from './components/editWhiteList.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WhiteListEquepDetail',
|
||||||
|
dicts: ['sys_yes_no'],
|
||||||
|
components: {
|
||||||
|
EditWhiteList
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 参数表格数据
|
||||||
|
|
||||||
|
dataList: [],
|
||||||
|
|
||||||
|
configList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: '',
|
||||||
|
// 是否显示编辑详情弹窗
|
||||||
|
editWhiteListOpen: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
user: undefined
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询参数列表 */
|
||||||
|
getList () {
|
||||||
|
this.loading = true
|
||||||
|
listConfig(this.queryParams).then(response => {
|
||||||
|
this.dataList = response.rows
|
||||||
|
this.total = response.total
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
|
||||||
|
// 表单重置
|
||||||
|
reset () {
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery () {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery () {
|
||||||
|
this.dateRange = []
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange (selection) {
|
||||||
|
this.ids = selection.map(item => item.configId)
|
||||||
|
this.single = selection.length != 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete (row) {
|
||||||
|
const configIds = row.configId || this.ids
|
||||||
|
this.$modal.confirm('是否确认删除编号为"' + configIds + '"的数据项?').then(function () {
|
||||||
|
return delConfig(configIds)
|
||||||
|
}).then(() => {
|
||||||
|
this.getList()
|
||||||
|
this.$modal.msgSuccess('删除成功')
|
||||||
|
}).catch(() => {
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleEdit (row) {
|
||||||
|
this.reset()
|
||||||
|
const configId = row.configId || this.ids
|
||||||
|
this.editWhiteListOpen = true
|
||||||
|
// getConfig(configId).then(response => {
|
||||||
|
// this.form = response.data
|
||||||
|
// this.editWhiteListOpen = true
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 关闭新增弹出框*/
|
||||||
|
closeEditWhiteList () {
|
||||||
|
this.editWhiteListOpen = false
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
360
sf-ui/src/views/deployment/whitelist/index.vue
Normal file
360
sf-ui/src/views/deployment/whitelist/index.vue
Normal file
@ -0,0 +1,360 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="" size="small">
|
||||||
|
<el-form-item label="名单类型" prop="whitelistType">
|
||||||
|
<el-select v-model="queryParams.whitelistType" clearable placeholder="请选择名单类型">
|
||||||
|
<el-option v-for="dict in dict.type.whitelist_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="名称" prop="whitelistName">
|
||||||
|
<el-input v-model="queryParams.whitelistName" clearable placeholder="请输入名称" style="width: 240px"
|
||||||
|
@keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间">
|
||||||
|
<el-date-picker v-model="dateRange" end-placeholder="结束日期" range-separator="-" start-placeholder="开始日期"
|
||||||
|
style="width: 240px" type="daterange" value-format="yyyy-MM-dd"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="configType">
|
||||||
|
<el-select v-model="queryParams.status" clearable placeholder="请选择状态">
|
||||||
|
<el-option v-for="dict in dict.type.release_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['system:config:add']" icon="el-icon-plus" plain size="mini" type="primary"
|
||||||
|
@click="handleAdd">新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="1.5">
|
||||||
|
<el-button :disabled="multiple" icon="el-icon-plus" plain size="mini" type="info" @click="handlePublish">批量发布
|
||||||
|
</el-button>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button :disabled="multiple" icon="el-icon-plus" plain size="mini" type="info" @click="handleDelete">批量删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="datalist" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column align="center" type="selection" width="55" />
|
||||||
|
<el-table-column align="center" label="白名单名称" prop="whitelistName" />
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="白名单类型" prop="whitelistType" :filters="dict.type.whitelist_type.map(item => ({
|
||||||
|
...item,
|
||||||
|
text: item.label
|
||||||
|
}))" :filter-method="filterTagWhitelistType">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.whitelist_type" :value="scope.row.whitelistType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="白名单模式" prop="whitelistMode" :filters="dict.type.white_mode.map(item => ({
|
||||||
|
...item,
|
||||||
|
text: item.label
|
||||||
|
}))" :filter-method="filterTagWhitelistMode">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.white_mode" :value="scope.row.whitelistMode" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="数量" prop="deploymentWhitelistListList">
|
||||||
|
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.deploymentWhitelistListList ? scope.row.deploymentWhitelistListList.length : 0 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column align="center" label="创建时间" prop="createTime" width="180" sortable>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="状态" prop="status" :filters="dict.type.release_status.map(item => ({
|
||||||
|
...item,
|
||||||
|
text: item.label
|
||||||
|
}))" :filter-method="filterTagStatus">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-for="item in dict.type.release_status">
|
||||||
|
<el-tag v-if="item.value == scope.row.status"
|
||||||
|
:type="scope.row.status == 0 ? 'info' : scope.row.status == 1 ? 'success' : 'warning'">{{ item.label
|
||||||
|
}}</el-tag>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :show-overflow-tooltip="true" align="center" label="备注" prop="remarks" />
|
||||||
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-popover placement="left" width="" trigger="hover">
|
||||||
|
<div>
|
||||||
|
<div style="margin-bottom: 10px;color:#000;font-size:14px">操作</div>
|
||||||
|
<div style="text-align: right; margin: 0">
|
||||||
|
<el-button @click="handlePublish(scope.row)" v-if="scope.row.status != 1" plain size="mini">发布</el-button>
|
||||||
|
<el-button @click="handleDown(scope.row)" plain size="mini" v-if="scope.row.status == 1">下架</el-button>
|
||||||
|
<el-button @click="handleConfig(scope.row)" size="mini" v-if="scope.row.status != 1">名单配置</el-button>
|
||||||
|
<el-button v-hasPermi="['deployment:module:edit']" plain size="mini" @click="handleEdit(scope.row)"
|
||||||
|
v-if="scope.row.status != 1">修改</el-button>
|
||||||
|
<el-button plain size="mini" @click="handleDetail(scope.row)">详情</el-button>
|
||||||
|
<el-button v-hasPermi="['deployment:module:remove']" plain type="danger" size="mini"
|
||||||
|
v-if="scope.row.status != 1" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-button slot="reference" size="mini" type="text">更多<i class="el-icon-caret-right"></i></el-button>
|
||||||
|
</el-popover>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<el-dropdown trigger="hover" placement="left-start" size="mini"
|
||||||
|
@command="(command) => handleCommand(command, scope.row)">
|
||||||
|
<el-button size="mini" type="text">更多<i class="el-icon-caret-right"></i></el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown" class="dropdown-max">
|
||||||
|
<el-dropdown-item command="handlePublish" v-if="scope.row.status != 1">发布</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleDown" v-if="scope.row.status == 1">下架</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleEdit" v-if="scope.row.status != 1">编辑</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleConfig" v-if="scope.row.status != 1">名单配置</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleDetail">详情</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleDelete" v-if="scope.row.status != 1">删除</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum" :total="total"
|
||||||
|
@pagination="getList" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { listWhitelist, delWhitelist, publishWhitelist, soldOutWhitelist } from "@/api/FDS/whiteList";
|
||||||
|
export default {
|
||||||
|
name: "WhiteList",
|
||||||
|
dicts: ["white_mode", 'whitelist_type', 'release_status'],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 参数表格数据
|
||||||
|
datalist: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示新增白名单弹出框
|
||||||
|
addOpen: false,
|
||||||
|
// 是否显示白名单配置弹出框
|
||||||
|
configOpen: false,
|
||||||
|
// 日期范围
|
||||||
|
dateRange: [],
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
whitelistName: undefined,
|
||||||
|
whitelistType: undefined,
|
||||||
|
status: undefined,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 白名单配置表单参数
|
||||||
|
configForm: {
|
||||||
|
addMode: 1,
|
||||||
|
whitelistType: undefined,
|
||||||
|
whitelistName: undefined,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询参数列表 */
|
||||||
|
getList () {
|
||||||
|
this.loading = true;
|
||||||
|
listWhitelist(this.addDateRange2(this.queryParams, this.dateRange)).then(response => {
|
||||||
|
// listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(
|
||||||
|
this.datalist = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset () {
|
||||||
|
this.form = {
|
||||||
|
configId: undefined,
|
||||||
|
configName: undefined,
|
||||||
|
configKey: undefined,
|
||||||
|
configValue: undefined,
|
||||||
|
configType: "Y",
|
||||||
|
remark: undefined,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery () {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery () {
|
||||||
|
this.dateRange = [];
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd () {
|
||||||
|
const params = {
|
||||||
|
type: "add",
|
||||||
|
};
|
||||||
|
this.$tab.openPage("新增白名单", "/build/whiteAdd/", params);
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange (selection) {
|
||||||
|
this.ids = selection.map((item) => item.id);
|
||||||
|
this.single = selection.length != 1;
|
||||||
|
this.multiple = !selection.length;
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleEdit (row) {
|
||||||
|
// E: \zhongtianBase\smarterFramework\sf - ui\src\views\deployment\whitelist\edit.vue
|
||||||
|
const params = {
|
||||||
|
type: "edit",
|
||||||
|
id: row.id
|
||||||
|
};
|
||||||
|
this.$tab.openPage("编辑白名单", "/build/whiteEdit/", params);
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 白名单配置弹窗 **/
|
||||||
|
handleConfig (row) {
|
||||||
|
this.reset();
|
||||||
|
this.$router.push({
|
||||||
|
path: "/build/addConfig",
|
||||||
|
query: {
|
||||||
|
id: row.id,
|
||||||
|
whitelistType: row.whitelistType
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete (row) {
|
||||||
|
const configIds = row.id || this.ids;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认删除编号为"' + configIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delWhitelist(configIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 发布按钮操作 */
|
||||||
|
handlePublish (row) {
|
||||||
|
const configIds = row.id || this.ids;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认发布编号为"' + configIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
//这里写发布操作
|
||||||
|
return publishWhitelist(configIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("发布成功");
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 下架按钮操作 */
|
||||||
|
handleDown (row) {
|
||||||
|
const configIds = row.id || this.ids;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认下架编号为"' + configIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
//这里写下架操作
|
||||||
|
return soldOutWhitelist(configIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("下架成功");
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 查看详情按钮操作 */
|
||||||
|
handleDetail (row) {
|
||||||
|
if (row.type == 1) {
|
||||||
|
this.$router.push({
|
||||||
|
path: "/build/whitelistDetail",
|
||||||
|
query: {
|
||||||
|
id: row.id,
|
||||||
|
whitelistType: row.whitelistType
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$router.push({
|
||||||
|
path: "/build/whitelistDetail",
|
||||||
|
query: {
|
||||||
|
id: row.id,
|
||||||
|
whitelistType: row.whitelistType
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 更多操作触发
|
||||||
|
handleCommand (command, row) {
|
||||||
|
switch (command) {
|
||||||
|
case "handlePublish":
|
||||||
|
this.handlePublish(row);
|
||||||
|
break;
|
||||||
|
case "handleDown":
|
||||||
|
this.handleDown(row);
|
||||||
|
break;
|
||||||
|
case "handleEdit":
|
||||||
|
this.handleEdit(row);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "handleConfig":
|
||||||
|
this.handleConfig(row);
|
||||||
|
break;
|
||||||
|
case "handleDetail":
|
||||||
|
this.handleDetail(row);
|
||||||
|
break;
|
||||||
|
case "handleDelete":
|
||||||
|
this.handleDelete(row);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
filterTagWhitelistType (value, row) {
|
||||||
|
return row.whitelistType === Number(value);
|
||||||
|
},
|
||||||
|
filterTagWhitelistMode (value, row) {
|
||||||
|
return row.whitelistMode === Number(value);
|
||||||
|
},
|
||||||
|
filterTagStatus (value, row) {
|
||||||
|
return row.status === Number(value);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped></style>
|
@ -1,12 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-table v-loading="loading" :data="tableData" max-height="500" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
v-loading="loading"
|
||||||
|
:data="tableData"
|
||||||
|
max-height="500"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
@row-click="handleRowClick"
|
||||||
|
>
|
||||||
<el-table-column align="center" type="selection" width="55"/>
|
<el-table-column align="center" type="selection" width="55"/>
|
||||||
|
|
||||||
<template v-for="item in tableOptions">
|
<template v-for="item in tableOptions">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="item.type === 'slot'"
|
v-if="item.type === 'slot'"
|
||||||
:key="item.prop"
|
:key="`${item.prop}_slot`"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:width="item.width"
|
:width="item.width"
|
||||||
:fixed="item.fixed"
|
:fixed="item.fixed"
|
||||||
@ -65,9 +72,22 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleRowClick(row) {
|
||||||
|
this.$refs.table.toggleRowSelection(row);
|
||||||
|
},
|
||||||
handleSelectionChange(val) {
|
handleSelectionChange(val) {
|
||||||
this.multipleSelection = val;
|
this.multipleSelection = val;
|
||||||
this.$emit('chooseChange', val);
|
this.$emit('chooseChange', val);
|
||||||
|
},
|
||||||
|
setCheckedRows(rows) {
|
||||||
|
const ids = rows.map(item => item.id);
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.tableData.forEach((row) => {
|
||||||
|
if (ids.includes(row.id)) {
|
||||||
|
this.$refs.table.toggleRowSelection(row, true);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
355
sf-ui/src/views/gateway/config/index.vue
Normal file
355
sf-ui/src/views/gateway/config/index.vue
Normal file
@ -0,0 +1,355 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container-flex">
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<el-row type="flex" justify="space-between">
|
||||||
|
<span>网关设置</span>
|
||||||
|
<div>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
:icon="editable ? 'el-icon-close' : `el-icon-edit`"
|
||||||
|
plain
|
||||||
|
@click="handleToggle"
|
||||||
|
:disabled="loading || btnLoading"
|
||||||
|
>{{ editable ? '取消' : '编辑' }}</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-setting"
|
||||||
|
plain
|
||||||
|
@click="handleSyncConfig"
|
||||||
|
:disabled="loading || btnLoading || syncLoading"
|
||||||
|
>同步配置</el-button>
|
||||||
|
</div>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-divider class="mt10 mb10" />
|
||||||
|
</el-header>
|
||||||
|
<el-main v-loading="loading">
|
||||||
|
<el-form
|
||||||
|
ref="form"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-position="left"
|
||||||
|
size="mini"
|
||||||
|
:disabled="!editable"
|
||||||
|
:validate-on-rule-change="false"
|
||||||
|
>
|
||||||
|
<el-row :gutter="40">
|
||||||
|
<!-- <el-col :span="24">
|
||||||
|
<el-form-item label="限流">
|
||||||
|
<el-switch v-model="limiting" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="API限流默认配置" prop="apiCurrentLimitingStatus" label-width="145px">
|
||||||
|
<template slot="label">
|
||||||
|
<span>API限流默认配置</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
width="360"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">1.对开启默认限流配置开关之前的历史API不受影响;</p>
|
||||||
|
<p class="tip">2.对已经生效了的使用默认限流配置的API,在下次修改默认配置时同样会生效;</p>
|
||||||
|
<p class="tip">3.单个API限流配置会覆盖API默认限流配置</p>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<el-switch v-model="form.apiCurrentLimitingStatus" active-value="1" inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="限流阈值" prop="apiCurrentLimitingThreshold" label-width="106px">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.apiCurrentLimitingThreshold"
|
||||||
|
placeholder="设置限流的阈值,即允许通过的请求次数或者并发连接数"
|
||||||
|
:min="1"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="限流时间窗口" prop="apiCurrentLimitingTimeWindow" label-width="106px">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.apiCurrentLimitingTimeWindow"
|
||||||
|
placeholder="请输入限流时间窗口"
|
||||||
|
:min="1"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="限流响应" prop="apiCurrentLimitingDefaultResponse">
|
||||||
|
<el-input
|
||||||
|
v-model="form.apiCurrentLimitingDefaultResponse"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 4}"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="限流响应,JSON字符串"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="数据加密" prop="dataEncryptionStatus">
|
||||||
|
<el-switch v-model="form.dataEncryptionStatus" active-value="1" inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="加密算法" prop="encryptionAlgorithm" label-width="80px">
|
||||||
|
<el-radio-group v-model="form.encryptionAlgorithm">
|
||||||
|
<el-radio label="ECC" border>ECC</el-radio>
|
||||||
|
<el-radio label="RSA" border>RSA</el-radio>
|
||||||
|
<el-radio label="SM2" border>国密</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="`${isRSA ? '私钥' : '秘钥'}内容`" prop="privateKey" label-width="80px">
|
||||||
|
<el-input
|
||||||
|
v-model="form.privateKey"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 4}"
|
||||||
|
type="textarea"
|
||||||
|
:placeholder="`请输入${isRSA ? '私钥' : '秘钥'}内容`"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<template v-if="isRSA">
|
||||||
|
<el-form-item label="公钥内容" prop="publicKey" label-width="80px">
|
||||||
|
<el-input
|
||||||
|
v-model="form.publicKey"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 4}"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入公钥内容"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="APP限流默认配置" prop="appCurrentLimitingStatus" label-width="150px">
|
||||||
|
<template slot="label">
|
||||||
|
<span>APP限流默认配置</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
width="360"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">1.对开启默认限流配置开关之前的历史APP不受影响;</p>
|
||||||
|
<p class="tip">2.对已经生效了的使用默认限流配置的APP,在下次修改默认配置时同样会生效;</p>
|
||||||
|
<p class="tip">3.单个APP限流配置会覆盖APP默认限流配置</p>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<el-switch v-model="form.appCurrentLimitingStatus" active-value="1" inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="限流阈值" prop="appCurrentLimitingThreshold" label-width="106px">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.appCurrentLimitingThreshold"
|
||||||
|
placeholder="设置限流的阈值,即允许通过的请求次数或者并发连接数"
|
||||||
|
:min="1"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="限流时间窗口" prop="appCurrentLimitingTimeWindow" label-width="106px">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.appCurrentLimitingTimeWindow"
|
||||||
|
placeholder="请输入限流时间窗口"
|
||||||
|
:min="1"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="限流响应" prop="appCurrentLimitingDefaultResponse">
|
||||||
|
<el-input
|
||||||
|
v-model="form.appCurrentLimitingDefaultResponse"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 4}"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="限流响应,JSON字符串"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-main>
|
||||||
|
|
||||||
|
<el-footer v-if="editable">
|
||||||
|
<el-row type="flex" justify="end">
|
||||||
|
<el-button :disabled="btnLoading" @click="close">返回</el-button>
|
||||||
|
<el-button type="primary" :loading="btnLoading" @click="submitForm">保存</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-footer>
|
||||||
|
</el-container>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { deepClone } from '@/utils'
|
||||||
|
import { getGatewayConfig, updateGatewayConfig, updateGatewaySync } from '@/api/gateway/config'
|
||||||
|
let CACHEFOEM;
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
editable: false,
|
||||||
|
loading: false,
|
||||||
|
btnLoading: false,
|
||||||
|
syncLoading: false,
|
||||||
|
form: {
|
||||||
|
apiCurrentLimitingStatus: '0',
|
||||||
|
apiCurrentLimitingThreshold: void 0,
|
||||||
|
apiCurrentLimitingTimeWindow: void 0,
|
||||||
|
apiCurrentLimitingDefaultResponse: void 0,
|
||||||
|
appCurrentLimitingStatus: '0',
|
||||||
|
appCurrentLimitingThreshold: void 0,
|
||||||
|
appCurrentLimitingTimeWindow: void 0,
|
||||||
|
appCurrentLimitingDefaultResponse: void 0,
|
||||||
|
dataEncryptionStatus: '0',
|
||||||
|
encryptionAlgorithm: void 0,
|
||||||
|
privateKey: void 0,
|
||||||
|
publicKey: void 0,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isRSA() {
|
||||||
|
return this.form.encryptionAlgorithm === 'RSA'
|
||||||
|
},
|
||||||
|
apiRequired() {
|
||||||
|
return this.form.apiCurrentLimitingStatus === '1'
|
||||||
|
},
|
||||||
|
appRequired() {
|
||||||
|
return this.form.appCurrentLimitingStatus === '1'
|
||||||
|
},
|
||||||
|
dataEncryRequired() {
|
||||||
|
return this.form.dataEncryptionStatus === '1'
|
||||||
|
},
|
||||||
|
rules() {
|
||||||
|
return {
|
||||||
|
// apiCurrentLimitingStatus: [
|
||||||
|
// { required: true, message: 'API限流默认配置不能为空', trigger: 'change' }
|
||||||
|
// ],
|
||||||
|
apiCurrentLimitingThreshold: [
|
||||||
|
{ required: this.apiRequired, message: '限流阈值不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
apiCurrentLimitingTimeWindow: [
|
||||||
|
{ required: this.apiRequired, message: '限流时间窗口不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
apiCurrentLimitingDefaultResponse: [
|
||||||
|
{ required: this.apiRequired, message: '限流响应不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
// appCurrentLimitingStatus: [
|
||||||
|
// { required: true, message: 'APP限流默认配置不能为空', trigger: 'change' }
|
||||||
|
// ],
|
||||||
|
appCurrentLimitingThreshold: [
|
||||||
|
{ required: this.appRequired, message: '限流阈值不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
appCurrentLimitingTimeWindow: [
|
||||||
|
{ required: this.appRequired, message: '限流时间窗口不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
appCurrentLimitingDefaultResponse: [
|
||||||
|
{ required: this.appRequired, message: '限流响应不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
// dataEncryptionStatus: [
|
||||||
|
// { required: true, message: '数据加密默认配置不能为空', trigger: 'change' }
|
||||||
|
// ],
|
||||||
|
encryptionAlgorithm: [
|
||||||
|
{ required: this.dataEncryRequired, message: '加密算法不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
privateKey: [
|
||||||
|
{ required: this.dataEncryRequired, message: '秘钥内容不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
publicKey: [
|
||||||
|
{ required: this.dataEncryRequired, message: '公钥内容不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getDetail() {
|
||||||
|
try {
|
||||||
|
this.loading = true;
|
||||||
|
const {code, data} = await getGatewayConfig();
|
||||||
|
if (code === 200) {
|
||||||
|
Object.keys(this.form).forEach((key) => {
|
||||||
|
this.form[key] = data[key];
|
||||||
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
CACHEFOEM = deepClone(this.form);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
} catch (error) {
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleToggle() {
|
||||||
|
await this.validateChange();
|
||||||
|
if (this.editable) this.$refs.form.clearValidate();
|
||||||
|
this.editable = !this.editable;
|
||||||
|
},
|
||||||
|
async handleSyncConfig() {
|
||||||
|
await this.$modal.confirm('确定同步网关配置吗?', '提示', {
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消'
|
||||||
|
})
|
||||||
|
try {
|
||||||
|
this.syncLoading = true;
|
||||||
|
const res = await updateGatewaySync();
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$modal.msgSuccess('同步配置成功')
|
||||||
|
this.getDetail();
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError(res.msg || '同步配置失败')
|
||||||
|
}
|
||||||
|
this.syncLoading = false;
|
||||||
|
} catch (error) {
|
||||||
|
this.syncLoading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async submitForm() {
|
||||||
|
// if (!this.apiRequired && !this.appRequired && !this.dataEncryRequired) {
|
||||||
|
// this.$modal.msgError('请至少选择一种配置')
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
|
await this.$refs.form.validate();
|
||||||
|
try {
|
||||||
|
this.btnLoading = true;
|
||||||
|
await updateGatewayConfig(this.form);
|
||||||
|
this.$modal.msgSuccess('保存成功')
|
||||||
|
this.getDetail();
|
||||||
|
this.btnLoading = false;
|
||||||
|
} catch (error) {
|
||||||
|
this.$modal.msgError(error.message || '保存失败')
|
||||||
|
this.btnLoading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validateChange() {
|
||||||
|
if (!this.editable || JSON.stringify(this.form) === JSON.stringify(CACHEFOEM)) {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
return this.$modal.confirm('当前有未保存的配置,是否放弃修改?', '提示', {
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消'
|
||||||
|
}).then(() => {
|
||||||
|
this.form = deepClone(CACHEFOEM);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.validateChange().then(() => {
|
||||||
|
this.$tab.closePage();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep.el-input-number {
|
||||||
|
width: 100%;
|
||||||
|
.el-input__inner {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-icon-info {
|
||||||
|
color: #959595;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.tip {
|
||||||
|
color: #999;
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
416
sf-ui/src/views/gateway/interface/edit.vue
Normal file
416
sf-ui/src/views/gateway/interface/edit.vue
Normal file
@ -0,0 +1,416 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container-flex">
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
{{titleName}}
|
||||||
|
<el-divider/>
|
||||||
|
</el-header>
|
||||||
|
<el-main v-loading="loading">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="right" :disabled="!editable">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="24">
|
||||||
|
<!-- <el-form-item label="策略类型" prop="strategyType">
|
||||||
|
<el-radio-group v-model="form.strategyType" @input="strategyTypeChange">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in dict.type.gateway_strategy_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
:disabled="disabledType(dict.value)"
|
||||||
|
>{{dict.label}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item> -->
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="接口名称" prop="interfaceName">
|
||||||
|
<el-input v-model="form.interfaceName" clearable placeholder="请输入接口名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="接口编码" prop="apiCode">
|
||||||
|
<el-input v-model="form.apiCode" clearable placeholder="请输入接口编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="接口版本" prop="version">
|
||||||
|
<el-input v-model="form.version" placeholder="标识接口的版本号,用于版本控制和管理" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="接口描述" prop="description">
|
||||||
|
<el-input v-model="form.description" type="textarea" placeholder="对接口功能、参数、返回结果等进行描述" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="接口路径" prop="interfacePath">
|
||||||
|
<el-input v-model="form.interfacePath" placeholder="接口的访问路径或URL" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="选择服务" prop="serverId">
|
||||||
|
<el-select
|
||||||
|
v-model="form.serverId"
|
||||||
|
placeholder="请选择服务"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in serverList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.serverName"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="请求方法" prop="requestMethod">
|
||||||
|
<el-select
|
||||||
|
v-model="form.requestMethod"
|
||||||
|
placeholder="请选择服务"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.type.http_request_method"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<!-- <el-row :gutter="20">
|
||||||
|
<el-col :span="8"> -->
|
||||||
|
<el-form-item label="Mock" prop="mockStatus">
|
||||||
|
<el-switch v-model="form.mockStatus" active-value="1" inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- </el-col>
|
||||||
|
</el-row> -->
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="超时时间" prop="timeout">
|
||||||
|
<template slot="label">
|
||||||
|
<span>超时时间</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">超时时间: 1-150000ms 默认3000ms 单位ms</p>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.timeout"
|
||||||
|
placeholder="请输入超时时间"
|
||||||
|
:min="1"
|
||||||
|
:max="150000"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<template v-if="form.mockStatus === '1'">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="Mock响应" prop="mockResponse">
|
||||||
|
<el-input
|
||||||
|
v-model="form.mockResponse"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="Mock响应,JSON字符串"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="接口文档" prop="document">
|
||||||
|
<file-upload
|
||||||
|
:value="documentList"
|
||||||
|
uploadFileUrl="/system/oss/upload"
|
||||||
|
:fileType="['doc', 'docx', 'md', 'pdf', 'txt']"
|
||||||
|
@change="handleChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="关联策略" prop="strategyIds">
|
||||||
|
<el-button type="primary" size="mini" @click="chooseStrategy">选择策略</el-button>
|
||||||
|
<div style="margin-top: 7px;position: relative;">
|
||||||
|
<el-tag
|
||||||
|
v-for="tag in strategyList"
|
||||||
|
style="margin: 2px 6px 2px 0;"
|
||||||
|
type="info"
|
||||||
|
:key="tag.id"
|
||||||
|
:closable="editable"
|
||||||
|
:disable-transitions="false"
|
||||||
|
@close="handleClose(tag)"
|
||||||
|
>
|
||||||
|
{{ tag.strategyName }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-main>
|
||||||
|
<el-footer class="footer">
|
||||||
|
<el-button :disabled="btnLoading" @click="close">取消</el-button>
|
||||||
|
<el-button v-if="editable" type="primary" :loading="btnLoading" @click="submitForm()">保存</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-container>
|
||||||
|
|
||||||
|
<el-dialog title="选择策略" :visible.sync="open" :close-on-click-modal="false" width="1200px" append-to-body destroy-on-close>
|
||||||
|
<BaseSearch
|
||||||
|
:defaultValue="queryParams"
|
||||||
|
:queryOptions="queryOptions"
|
||||||
|
@query="handleQuery"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- v-loading="loading" -->
|
||||||
|
<BaseTable
|
||||||
|
ref="chooseTableRef"
|
||||||
|
:tableData="tableData"
|
||||||
|
:tableOptions="tableOptions"
|
||||||
|
@chooseChange="chooseChange"
|
||||||
|
>
|
||||||
|
<template #strategyType="{ row }">
|
||||||
|
<dict-tag :options="dict.type.gateway_strategy_type" :value="row.strategyType"/>
|
||||||
|
</template>
|
||||||
|
</BaseTable>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="open = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="chooseEnd">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BaseSearch from '@/views/gateway/components/BaseSearch';
|
||||||
|
import BaseTable from '@/views/gateway/components/BaseTable';
|
||||||
|
import { deepClone } from '@/utils'
|
||||||
|
import { getInterface, addInterface, updateInterface } from "@/api/gateway/interface";
|
||||||
|
import { bindableServerList } from '@/api/gateway/server'
|
||||||
|
import { bindableStrategyList } from '@/api/gateway/strategy'
|
||||||
|
import EventBus from '@/utils/eventBus'
|
||||||
|
// let CACHEFOEM;
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
BaseSearch,
|
||||||
|
BaseTable,
|
||||||
|
},
|
||||||
|
dicts: ['gateway_strategy_type', 'http_request_method'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
btnLoading: false,
|
||||||
|
serverList: [],
|
||||||
|
form: {
|
||||||
|
id: void 0,
|
||||||
|
interfaceName: void 0,
|
||||||
|
apiCode: void 0,
|
||||||
|
interfacePath: void 0,
|
||||||
|
requestMethod: 'POST',
|
||||||
|
description: void 0, //描述(备注)
|
||||||
|
version: void 0,
|
||||||
|
document: void 0,
|
||||||
|
serverId: void 0, //服务id
|
||||||
|
strategyIds: [], //策略ids
|
||||||
|
mockStatus: '0',
|
||||||
|
timeout: void 0,
|
||||||
|
mockResponse: void 0,
|
||||||
|
},
|
||||||
|
strategyList: [],
|
||||||
|
documentList: [],
|
||||||
|
rules: {
|
||||||
|
interfaceName: [
|
||||||
|
{ required: true, message: '接口名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
apiCode: [
|
||||||
|
{ required: true, message: '接口编码不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
interfacePath: [
|
||||||
|
{ required: true, message: '接口路径不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
serverId: [
|
||||||
|
{ required: true, message: '服务不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
requestMethod: [
|
||||||
|
{ required: true, message: '请求方法不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
// strategyIds: [
|
||||||
|
// { required: true, type: 'array', message: '关联策略不能为空', trigger: 'change' }
|
||||||
|
// ],
|
||||||
|
version: [
|
||||||
|
{ required: true, message: '接口版本不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
mockResponse: [
|
||||||
|
{ required: true, message: 'Mock响应数据不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
open: false,
|
||||||
|
|
||||||
|
queryParams: {},
|
||||||
|
tableData: [],
|
||||||
|
tableOptions: [
|
||||||
|
{ type: 'slot', label: '策略类型', prop: 'strategyType', width: '120' },
|
||||||
|
{ label: '策略名称', prop: 'strategyName' },
|
||||||
|
{ label: '策略描述', prop: 'description' },
|
||||||
|
],
|
||||||
|
multipleSelection: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
editable() {
|
||||||
|
return this.$route.query.type !== 'detail'
|
||||||
|
},
|
||||||
|
titleName() {
|
||||||
|
if (!this.editable) {
|
||||||
|
return '接口详情'
|
||||||
|
}
|
||||||
|
return this.$route.query.id ? '编辑接口' : '新增接口'
|
||||||
|
},
|
||||||
|
queryOptions() {
|
||||||
|
return [
|
||||||
|
{ label: '策略名称', prop: 'strategyName', type: 'input' },
|
||||||
|
{ label: '策略类型', prop: 'strategyType', type: 'select', dicts: this.dict.type.gateway_strategy_type },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.init();
|
||||||
|
this.getDetail()
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
this.getDetail()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
bindableServerList().then((list) => {
|
||||||
|
this.serverList = list;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getDetail() {
|
||||||
|
const { id } = this.$route.query
|
||||||
|
if (id) {
|
||||||
|
this.loading = true;
|
||||||
|
try {
|
||||||
|
const { data } = await getInterface(id)
|
||||||
|
this.reset();
|
||||||
|
Object.keys(this.form).forEach(key => {
|
||||||
|
if (data[key] !== void 0) {
|
||||||
|
this.$set(this.form, key, data[key])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.form.timeout = data.timeout ?? void 0;
|
||||||
|
this.strategyList = data.strategyList;
|
||||||
|
this.documentList = data.document ? [data.document] : [];
|
||||||
|
this.form.strategyIds = data.strategyList.map(item => item.id);
|
||||||
|
// CACHEFOEM = deepClone(data);
|
||||||
|
} catch (error) {
|
||||||
|
this.$message.error(error.message || '请求失败')
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleChange(files) {
|
||||||
|
this.documentList = files;
|
||||||
|
const [file] = files;
|
||||||
|
if (!file) this.form.document = null;
|
||||||
|
const {id, fileName, originalName, fileSuffix, url, size} = file;
|
||||||
|
this.form.document = { id, fileName, originalName, fileSuffix, url, size };
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: void 0,
|
||||||
|
interfaceName: void 0,
|
||||||
|
apiCode: void 0,
|
||||||
|
interfacePath: void 0,
|
||||||
|
requestMethod: 'POST',
|
||||||
|
description: void 0, //描述(备注)
|
||||||
|
version: void 0,
|
||||||
|
document: void 0,
|
||||||
|
serverId: void 0, //服务id
|
||||||
|
strategyIds: [], //策略ids
|
||||||
|
mockStatus: '0',
|
||||||
|
timeout: void 0,
|
||||||
|
mockResponse: void 0,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
async submitForm() {
|
||||||
|
const request = this.form.id != null ? updateInterface : addInterface;
|
||||||
|
const msg = this.form.id != null ? '修改' : '新增';
|
||||||
|
await this.$refs.form.validate();
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
...this.form,
|
||||||
|
strategyIds: this.strategyList.map(item => item.id)
|
||||||
|
}
|
||||||
|
this.btnLoading = true;
|
||||||
|
await request(params);
|
||||||
|
this.$modal.msgSuccess(`${msg}成功`);
|
||||||
|
EventBus.$emit('reloadInterfaceList');
|
||||||
|
this.btnLoading = false;
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
this.$modal.msgError(`${msg}失败`);
|
||||||
|
this.btnLoading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$tab.closePage();
|
||||||
|
},
|
||||||
|
|
||||||
|
chooseStrategy() {
|
||||||
|
this.open = true;
|
||||||
|
this.handleQuery(this.queryParams);
|
||||||
|
},
|
||||||
|
handleQuery(form) {
|
||||||
|
bindableStrategyList(form).then((res) => {
|
||||||
|
this.tableData = res;
|
||||||
|
|
||||||
|
this.$refs.chooseTableRef.setCheckedRows(this.strategyList);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleClose(tag) {
|
||||||
|
this.strategyList = this.strategyList.filter((item) => {
|
||||||
|
return item.id !== tag.id
|
||||||
|
})
|
||||||
|
},
|
||||||
|
chooseChange(rows) {
|
||||||
|
this.multipleSelection = rows;
|
||||||
|
},
|
||||||
|
chooseEnd() {
|
||||||
|
this.strategyList = deepClone(this.multipleSelection);
|
||||||
|
this.form.strategyIds = this.strategyList.map(item => item.id);
|
||||||
|
this.open = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
::v-deep.el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
::v-deep.el-input-number {
|
||||||
|
width: 100%;
|
||||||
|
.el-input__inner{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}.el-icon-info {
|
||||||
|
color: #959595;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.tip {
|
||||||
|
color: #999;
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container-flex">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="接口名称" prop="interfaceName">
|
<el-form-item label="接口名称" prop="interfaceName">
|
||||||
<el-input
|
<el-input
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb14">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -69,7 +69,7 @@
|
|||||||
v-hasPermi="['gateway:interface:remove']"
|
v-hasPermi="['gateway:interface:remove']"
|
||||||
>批量删除</el-button>
|
>批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
@ -78,29 +78,49 @@
|
|||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['gateway:interface:export']"
|
v-hasPermi="['gateway:interface:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="interfaceList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="interfaceList" @selection-change="handleSelectionChange" height="100%">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="接口ID" width="60" align="center" prop="id" />
|
<el-table-column label="关联服务" min-width="180" prop="serverName">
|
||||||
<el-table-column label="接口名称" align="center" show-overflow-tooltip prop="interfaceName" />
|
<template slot-scope="scope">
|
||||||
<el-table-column label="接口路径" align="center" show-overflow-tooltip prop="interfacePath" />
|
<el-button @click="handleServerDetail(scope.row)" type="text">{{scope.row.serverName}}</el-button>
|
||||||
<el-table-column label="接口描述" align="center" show-overflow-tooltip prop="description" />
|
</template>
|
||||||
<el-table-column label="接口文档" align="center" show-overflow-tooltip prop="document" />
|
</el-table-column>
|
||||||
<el-table-column label="请求方式" width="80" align="center" prop="requestMethod">
|
<el-table-column label="接口名称" min-width="180" show-overflow-tooltip prop="interfaceName">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button @click="handleUpdate(scope.row, 'detail')" type="text">{{scope.row.interfaceName}}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="接口编码" min-width="150" show-overflow-tooltip prop="apiCode" />
|
||||||
|
<el-table-column label="接口路径" min-width="150" show-overflow-tooltip prop="interfacePath" />
|
||||||
|
<el-table-column label="接口描述" min-width="180" show-overflow-tooltip prop="description" />
|
||||||
|
<el-table-column label="接口文档" min-width="200" show-overflow-tooltip prop="document" />
|
||||||
|
<el-table-column label="请求方式" min-width="100" prop="requestMethod">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.http_request_method" :value="scope.row.requestMethod"/>
|
<dict-tag :options="dict.type.http_request_method" :value="scope.row.requestMethod"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="接口版本" width="100" align="center" prop="version" />
|
<el-table-column label="接口版本" min-width="100" prop="version" />
|
||||||
<el-table-column label="接口状态" width="80" align="center" prop="status">
|
<el-table-column label="接口状态" min-width="100" align="center" prop="status">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.gateway_data_status" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.gateway_data_status" :value="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
|
<!-- <el-table-column label="创建者" width="100" prop="created" /> -->
|
||||||
|
<el-table-column label="创建时间" min-width="120" prop="createTime">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="更新时间" align="center" prop="updateTime" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column label="操作" width="180" fixed="right" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -108,7 +128,7 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleStatus(scope.row)"
|
@click="handleStatus(scope.row)"
|
||||||
v-hasPermi="['gateway:interface:edit']"
|
v-hasPermi="['gateway:interface:edit']"
|
||||||
>{{scope.row === '0' ? '启用' : '禁用' }}</el-button>
|
>{{scope.row.status === '0' ? '启用' : '禁用' }}</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@ -136,7 +156,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改接口管理对话框 -->
|
<!-- 添加或修改接口管理对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
<!-- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="接口名称" prop="interfaceName">
|
<el-form-item label="接口名称" prop="interfaceName">
|
||||||
<el-input v-model="form.interfaceName" placeholder="请输入接口名称" />
|
<el-input v-model="form.interfaceName" placeholder="请输入接口名称" />
|
||||||
@ -167,11 +187,12 @@
|
|||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import EventBus from '@/utils/eventBus'
|
||||||
import { listInterface, getInterface, delInterface, addInterface, updateInterface, changeInterfaceStatus } from "@/api/gateway/interface";
|
import { listInterface, getInterface, delInterface, addInterface, updateInterface, changeInterfaceStatus } from "@/api/gateway/interface";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -194,9 +215,9 @@ export default {
|
|||||||
// 接口管理表格数据
|
// 接口管理表格数据
|
||||||
interfaceList: [],
|
interfaceList: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
// title: "",
|
||||||
// 是否显示弹出层
|
// // 是否显示弹出层
|
||||||
open: false,
|
// open: false,
|
||||||
// 接口文档时间范围
|
// 接口文档时间范围
|
||||||
daterangeCreateTime: [],
|
daterangeCreateTime: [],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
@ -208,23 +229,28 @@ export default {
|
|||||||
createTime: null,
|
createTime: null,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
// form: {},
|
||||||
// 表单校验
|
// // 表单校验
|
||||||
rules: {
|
// rules: {
|
||||||
interfaceName: [
|
// interfaceName: [
|
||||||
{ required: true, message: "接口名称不能为空", trigger: "blur" }
|
// { required: true, message: "接口名称不能为空", trigger: "blur" }
|
||||||
],
|
// ],
|
||||||
interfacePath: [
|
// interfacePath: [
|
||||||
{ required: true, message: "接口路径不能为空", trigger: "blur" }
|
// { required: true, message: "接口路径不能为空", trigger: "blur" }
|
||||||
],
|
// ],
|
||||||
requestMethod: [
|
// requestMethod: [
|
||||||
{ required: true, message: "请求方式不能为空", trigger: "change" }
|
// { required: true, message: "请求方式不能为空", trigger: "change" }
|
||||||
],
|
// ],
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
|
||||||
|
EventBus.$on("reloadInterfaceList",this.getList);
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
EventBus.$off('reloadInterfaceList', this.getList);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询接口管理列表 */
|
/** 查询接口管理列表 */
|
||||||
@ -244,27 +270,31 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
// cancel() {
|
||||||
this.open = false;
|
// this.open = false;
|
||||||
this.reset();
|
// this.reset();
|
||||||
},
|
// },
|
||||||
// 表单重置
|
// // 表单重置
|
||||||
reset() {
|
// reset() {
|
||||||
this.form = {
|
// this.form = {
|
||||||
id: null,
|
// id: null,
|
||||||
interfaceName: null,
|
// interfaceName: null,
|
||||||
interfacePath: null,
|
// interfacePath: null,
|
||||||
requestMethod: null,
|
// requestMethod: null,
|
||||||
description: null,
|
// description: null,
|
||||||
version: null,
|
// version: null,
|
||||||
status: null,
|
// status: null,
|
||||||
document: null,
|
// document: null,
|
||||||
createBy: null,
|
// createBy: null,
|
||||||
createTime: null,
|
// createTime: null,
|
||||||
updateBy: null,
|
// updateBy: null,
|
||||||
updateTime: null
|
// updateTime: null
|
||||||
};
|
// };
|
||||||
this.resetForm("form");
|
// this.resetForm("form");
|
||||||
|
// },
|
||||||
|
handleServerDetail(row) {
|
||||||
|
// console.log(row.serverId, '到服务详情')
|
||||||
|
this.$router.push({path: '/gateway/server-detail', query: {id: row.serverId}})
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
@ -286,19 +316,27 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
// this.reset();
|
||||||
this.open = true;
|
// this.open = true;
|
||||||
this.title = "添加接口管理";
|
// this.title = "添加接口管理";
|
||||||
|
this.$router.push({path: '/gateway/interface-edit'})
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row, type) {
|
||||||
this.reset();
|
// this.reset();
|
||||||
const id = row.id || this.ids
|
const id = row.id;
|
||||||
getInterface(id).then(response => {
|
// getInterface(id).then(response => {
|
||||||
this.form = response.data;
|
// this.form = response.data;
|
||||||
this.open = true;
|
// this.open = true;
|
||||||
this.title = "修改接口管理";
|
// this.title = "修改接口管理";
|
||||||
});
|
// });
|
||||||
|
this.$router.push({
|
||||||
|
path: '/gateway/interface-edit',
|
||||||
|
query: {
|
||||||
|
id,
|
||||||
|
type
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 启用/禁用按钮操作 */
|
/** 启用/禁用按钮操作 */
|
||||||
handleStatus(row) {
|
handleStatus(row) {
|
||||||
@ -316,30 +354,30 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
// submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
// this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
// if (valid) {
|
||||||
if (this.form.id != null) {
|
// if (this.form.id != null) {
|
||||||
let data = Object.assign({},this.form)
|
// let data = Object.assign({},this.form)
|
||||||
delete data.explain
|
// delete data.explain
|
||||||
updateInterface(data).then(response => {
|
// updateInterface(data).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
// this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
// this.open = false;
|
||||||
this.getList();
|
// this.getList();
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
addInterface(this.form).then(response => {
|
// addInterface(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
// this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
// this.open = false;
|
||||||
this.getList();
|
// this.getList();
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row?.id || this.ids;
|
||||||
this.$modal.confirm('是否确认删除接口管理编号为"' + ids + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除接口管理编号为"' + ids + '"的数据项?').then(function() {
|
||||||
return delInterface(ids);
|
return delInterface(ids);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
220
sf-ui/src/views/gateway/route/edit.vue
Normal file
220
sf-ui/src/views/gateway/route/edit.vue
Normal file
@ -0,0 +1,220 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container-flex">
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
{{titleName}}
|
||||||
|
<el-divider/>
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="right" :disabled="!editable">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="16">
|
||||||
|
<el-form-item label="路由名称" prop="routeName">
|
||||||
|
<el-input v-model="form.routeName" placeholder="路由规则的名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="后端协议类型" prop="requestProtocol">
|
||||||
|
<el-select v-model="form.requestProtocol">
|
||||||
|
<el-option label="HTTP" value="HTTP" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="路由方式" prop="routeType">
|
||||||
|
<el-radio-group v-model="form.routeType" @change="handleRouteTypeChange">
|
||||||
|
<el-radio label="WEIGHT_ROUTE">权重路由</el-radio>
|
||||||
|
<el-radio label="HEADER_ROUTE">请求头路由</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="规则详情" prop="routeContent">
|
||||||
|
<EditTable
|
||||||
|
ref="editTable"
|
||||||
|
:editable="editable"
|
||||||
|
:routeType="form.routeType"
|
||||||
|
:value="form.routeContent"
|
||||||
|
:loading="tableLoading"
|
||||||
|
@validate="$refs.form.validateField('routeContent')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="路由状态探活" prop="routeStatusActiveMonitoring">
|
||||||
|
<el-switch
|
||||||
|
v-model="form.routeStatusActiveMonitoring"
|
||||||
|
active-value="1"
|
||||||
|
inactive-value="0">
|
||||||
|
</el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="路径path" prop="routeActiveMonitoringPath">
|
||||||
|
<el-input v-model="form.routeActiveMonitoringPath" placeholder="默认'/'" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="超时时间" prop="routeActiveMonitoringTimeout">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.routeActiveMonitoringTimeout"
|
||||||
|
placeholder="请输入超时时间"
|
||||||
|
:min="1"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
<span class="ml10">ms</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-main>
|
||||||
|
<el-footer class="footer">
|
||||||
|
<el-button :disabled="btnLoading" @click="close">取消</el-button>
|
||||||
|
<el-button v-if="editable" :loading="btnLoading" type="primary" @click="submitForm">保存</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import EventBus from '@/utils/eventBus';
|
||||||
|
import { deepClone } from '@/utils'
|
||||||
|
import { addRoute, getRoute, updateRoute } from "@/api/gateway/route";
|
||||||
|
import EditTable from './editTable.vue'
|
||||||
|
|
||||||
|
// 缓存表单数据
|
||||||
|
let CACHEFOEM = {};
|
||||||
|
export default {
|
||||||
|
components: { EditTable },
|
||||||
|
data() {
|
||||||
|
const checkRouteContent = async(rule, value, callback) => {
|
||||||
|
try {
|
||||||
|
await this.$refs.editTable.validtorTable()
|
||||||
|
callback()
|
||||||
|
} catch (error) {
|
||||||
|
callback(error)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
tableLoading: false,
|
||||||
|
btnLoading: false,
|
||||||
|
form: {
|
||||||
|
routeName: '',
|
||||||
|
requestProtocol: 'HTTP',
|
||||||
|
routeType: 'WEIGHT_ROUTE',
|
||||||
|
routeContent: [
|
||||||
|
// {
|
||||||
|
// weight: 0,
|
||||||
|
// serverAddress: '',
|
||||||
|
// headerKey: '',
|
||||||
|
// headerValues: '',
|
||||||
|
// matchType: '',
|
||||||
|
// }
|
||||||
|
],
|
||||||
|
routeStatusActiveMonitoring: '1', // (0停用 1启用)
|
||||||
|
routeActiveMonitoringPath: '/',
|
||||||
|
routeActiveMonitoringTimeout: 3000,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
routeName: [
|
||||||
|
{ required: true, message: '路由名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
routeContent:[
|
||||||
|
{ required: true, type: 'array', message: '规则详情不能为空' },
|
||||||
|
{ validator: checkRouteContent, trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
editable() {
|
||||||
|
return this.$route.query.type !== 'detail'
|
||||||
|
},
|
||||||
|
titleName() {
|
||||||
|
if (!this.editable) {
|
||||||
|
return '路由详情'
|
||||||
|
}
|
||||||
|
return this.$route.query.id ? '编辑路由' : '新增路由'
|
||||||
|
},
|
||||||
|
newRow() {
|
||||||
|
const weightRow = { weight: 0, serverAddress: '' };
|
||||||
|
const headerRow = { headerKey: '', headerValues: [], matchType: '' };
|
||||||
|
return this.form.routeType === 'WEIGHT_ROUTE' ? weightRow : headerRow;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
this.getDetail()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getDetail() {
|
||||||
|
CACHEFOEM = {};
|
||||||
|
const { id } = this.$route.query
|
||||||
|
if (id) {
|
||||||
|
getRoute(id).then(res => {
|
||||||
|
const { routeContent, ...args } = res.data;
|
||||||
|
this.form = {
|
||||||
|
...args,
|
||||||
|
routeContent: JSON.parse(routeContent)
|
||||||
|
};
|
||||||
|
CACHEFOEM = deepClone(this.form)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleRouteTypeChange(val) {
|
||||||
|
this.tableLoading = true;
|
||||||
|
if (val === CACHEFOEM.routeType) {
|
||||||
|
this.form.routeContent = [...CACHEFOEM.routeContent];
|
||||||
|
} else {
|
||||||
|
this.form.routeContent = [];
|
||||||
|
}
|
||||||
|
this.$refs.form.clearValidate('routeContent');
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.tableLoading = false;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAddRow() {
|
||||||
|
this.form.routeContent.unshift({...this.newRow})
|
||||||
|
},
|
||||||
|
handleDeleteRow(index) {
|
||||||
|
this.form.routeContent.splice(index, 1)
|
||||||
|
},
|
||||||
|
async submitForm() {
|
||||||
|
const request = this.form.id != null ? updateRoute : addRoute;
|
||||||
|
const msg = this.form.id != null ? '修改' : '新增';
|
||||||
|
await this.$refs.form.validate();
|
||||||
|
try {
|
||||||
|
this.btnLoading = true
|
||||||
|
await request(this.form);
|
||||||
|
this.btnLoading = false;
|
||||||
|
this.$modal.msgSuccess(`${msg}成功`);
|
||||||
|
EventBus.$emit('reloadRouteList');
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
this.btnLoading = false;
|
||||||
|
this.$modal.msgError(`${msg}失败`);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
// this.$refs.form.resetFields();
|
||||||
|
this.$tab.closePage();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
::v-deep.el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
::v-deep.el-input-number .el-input__inner{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
</style>
|
277
sf-ui/src/views/gateway/route/editTable.vue
Normal file
277
sf-ui/src/views/gateway/route/editTable.vue
Normal file
@ -0,0 +1,277 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-row type="flex" justify="end">
|
||||||
|
<el-button
|
||||||
|
v-if="editable"
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAddRow"
|
||||||
|
>新增一行</el-button>
|
||||||
|
</el-row>
|
||||||
|
<el-form :model="formModel" ref="form" class="table-form" @validate="validateForm">
|
||||||
|
<el-table v-loading="loading" :data="formModel.tableData" style="margin-top: 10px;" max-height="400" border>
|
||||||
|
<template v-if="routeType === 'WEIGHT_ROUTE'">
|
||||||
|
<el-table-column prop="weight" width="240" key="weight">
|
||||||
|
<template slot="header">
|
||||||
|
<span class="required-asterisk">流量占比(%)</span>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<template v-if="!editable">{{ row.weight }}</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item
|
||||||
|
:prop="`tableData[${$index}].weight`"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: '流量占比不能为空', trigger: 'blur' },
|
||||||
|
{ type: 'number', message: '流量占比必须为数字值', trigger: 'blur' }
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<el-input-number
|
||||||
|
v-model="tableData[$index].weight"
|
||||||
|
placeholder="请输入流量占比"
|
||||||
|
:min="0"
|
||||||
|
:max="100"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-table-column prop="headerKey" key="headerKey">
|
||||||
|
<template slot="header">
|
||||||
|
<span class="required-asterisk">参数名</span>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<template v-if="!editable">{{ row.headerKey }}</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item
|
||||||
|
:prop="`tableData[${$index}].headerKey`"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: '参数名不能为空', trigger: 'blur' },
|
||||||
|
{ pattern: /^[a-zA-Z0-9\_]+$/, message: '参数名只能是字母数字和下划线组合', trigger: 'blur' }
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<el-input v-model="tableData[$index].headerKey" clearable placeholder="请输入参数名"/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="matchType" label="匹配方式" key="matchType">
|
||||||
|
<template slot="header">
|
||||||
|
<span class="required-asterisk">匹配方式</span>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<template v-if="!editable">{{ {'EQ': '完全匹配', 'IN': '模式匹配'}[row.matchType] }}</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item
|
||||||
|
:prop="`tableData[${$index}].matchType`"
|
||||||
|
:rules="{
|
||||||
|
required: true, message: '匹配方式不能为空', trigger: 'change'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<el-select v-model="value[$index].matchType" @change="$refs.form.validateField(`tableData[${$index}].headerValues`)">
|
||||||
|
<el-option label="完全匹配" value="EQ" />
|
||||||
|
<el-option label="模式匹配" value="IN" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="headerValues" label="参数值" key="headerValues">
|
||||||
|
<template slot="header">
|
||||||
|
<span class="required-asterisk">参数值</span>
|
||||||
|
<el-tooltip class="item" effect="dark" placement="top">
|
||||||
|
<div slot="content">完全匹配为精准匹配,只能匹配一个参数值;<br/>IN 模糊匹配支持输入多个值,输入单个值后<br/>需使用分号分隔第二行信息</div>
|
||||||
|
<i class="el-icon-info ml10"></i>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<template v-if="!editable">{{ row.headerValues.join(';') }}</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item
|
||||||
|
:prop="`tableData[${$index}].headerValues`"
|
||||||
|
:rules="{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
validatorHeaderValues($index, value, callback)
|
||||||
|
}, trigger: 'blur'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-if="tableData[$index].headerValues"
|
||||||
|
:value="tableData[$index].headerValues.join(';')"
|
||||||
|
@input="tableData[$index].headerValues = $event.split(';')"
|
||||||
|
placeholder="请输入参数值"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</template>
|
||||||
|
<el-table-column prop="serverAddress" label="服务地址" key="serverAddress">
|
||||||
|
<template slot="header">
|
||||||
|
<span class="required-asterisk">服务地址</span>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<template v-if="!editable">{{ row.serverAddress }}</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item
|
||||||
|
:prop="`tableData[${$index}].serverAddress`"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: '服务地址不能为空', trigger: 'blur' },
|
||||||
|
{ pattern: /^(https?:\/\/)?((?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d+)?$/, message: '请输入正确的服务地址', trigger: 'blur' }
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="tableData[$index].serverAddress"
|
||||||
|
placeholder="请输入服务地址"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-if="editable" prop="address" label="操作" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDeleteRow(scope.$index)"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'WeightTable',
|
||||||
|
props: {
|
||||||
|
editable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
routeType: {
|
||||||
|
type: String,
|
||||||
|
default: 'WEIGHT_ROUTE'
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
tableData: {
|
||||||
|
get() {
|
||||||
|
return this.value
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$emit('input', val)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
formModel() {
|
||||||
|
return {
|
||||||
|
tableData: this.tableData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 校验表格数据完整性(流量占比之和不为100、未填写完整、表格数据为空)
|
||||||
|
validtorTable() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (this.tableData.length === 0) {
|
||||||
|
reject(new Error('请添加规则详情'))
|
||||||
|
}
|
||||||
|
const hasEmty = this.tableData.some(item => {
|
||||||
|
const values = this.routeType === 'WEIGHT_ROUTE' ? ['weight', 'serverAddress'] : ['headerKey', 'headerValues', 'matchType', 'serverAddress'];
|
||||||
|
return values.some(key => {
|
||||||
|
return item[key] === '' || item[key] === null || item[key] === void 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
if (hasEmty) {
|
||||||
|
reject(new Error('请填写完整'))
|
||||||
|
}
|
||||||
|
if (this.routeType === 'WEIGHT_ROUTE') {
|
||||||
|
const weightCount = this.tableData.reduce((acc, cur) => {
|
||||||
|
return acc + cur.weight;
|
||||||
|
}, 0);
|
||||||
|
if (weightCount !== 100) {
|
||||||
|
reject(new Error('流量占比之和必须为100'))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
validatorHeaderValues(index, value, callback) {
|
||||||
|
if (value.length === 0) {
|
||||||
|
callback(new Error('参数值不能为空'))
|
||||||
|
}
|
||||||
|
const row = this.tableData[index];
|
||||||
|
if (row.matchType === 'EQ' && value.length > 1) {
|
||||||
|
callback(new Error('完全匹配为精准匹配,只能匹配一个参数值'))
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
},
|
||||||
|
handleAddRow() {
|
||||||
|
const weightRow = { weight: 0, serverAddress: '' };
|
||||||
|
const headerRow = { headerKey: '', headerValues: [], matchType: '' };
|
||||||
|
const newRow = this.routeType === 'WEIGHT_ROUTE' ? weightRow : headerRow;
|
||||||
|
this.tableData.unshift(newRow)
|
||||||
|
},
|
||||||
|
handleDeleteRow(index) {
|
||||||
|
this.tableData.splice(index, 1)
|
||||||
|
this.$emit('validate')
|
||||||
|
},
|
||||||
|
// 校验数据准确性,在输入时即时校验,不暴露方法
|
||||||
|
// validtorFrom() {
|
||||||
|
// return new Promise(async(resolve, reject) => {
|
||||||
|
// try {
|
||||||
|
// await this.$refs.form.validate();
|
||||||
|
// resolve()
|
||||||
|
// } catch (error) {
|
||||||
|
// reject(new Error('请填写完整'))
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
validateForm(key, res) {
|
||||||
|
this.$emit('validate')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
// ::v-deep.el-form-item {
|
||||||
|
|
||||||
|
// }
|
||||||
|
.table-form {
|
||||||
|
::v-deep.el-form-item {
|
||||||
|
margin-bottom: 22px;
|
||||||
|
&.is-error .el-input__inner {
|
||||||
|
border-color: #ff4949;
|
||||||
|
}
|
||||||
|
.el-input__inner {
|
||||||
|
border-color: #DCDFE6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep.el-input-number .el-input__inner{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container-flex">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="路由名称" prop="routerName">
|
<el-form-item label="路由名称" prop="routerName">
|
||||||
<el-input
|
<el-input
|
||||||
@ -10,12 +10,14 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="请求方式" prop="requestMethod">
|
<el-form-item label="请求方式" prop="requestMethod">
|
||||||
<el-input
|
<el-select v-model="queryParams.requestMethod" clearable placeholder="请选择请求方式">
|
||||||
v-model="queryParams.requestMethod"
|
<el-option
|
||||||
placeholder="请输入请求方式"
|
v-for="dict in dict.type.http_request_method"
|
||||||
clearable
|
:key="dict.value"
|
||||||
@keyup.enter.native="handleQuery"
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="创建人" prop="createBy">
|
<el-form-item label="创建人" prop="createBy">
|
||||||
<el-input
|
<el-input
|
||||||
@ -42,7 +44,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb14">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -53,17 +55,17 @@
|
|||||||
v-hasPermi="['gateway:route:add']"
|
v-hasPermi="['gateway:route:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleDetail"
|
||||||
v-hasPermi="['gateway:route:edit']"
|
v-hasPermi="['gateway:route:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
@ -73,9 +75,9 @@
|
|||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['gateway:route:remove']"
|
v-hasPermi="['gateway:route:remove']"
|
||||||
>删除</el-button>
|
>批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
@ -84,36 +86,47 @@
|
|||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['gateway:route:export']"
|
v-hasPermi="['gateway:route:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="routeList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="routeList" @selection-change="handleSelectionChange" height="100%">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="ID" align="center" prop="id" />
|
<el-table-column label="路由名称" prop="routeName" min-width="150">
|
||||||
<el-table-column label="路由名称" align="center" prop="routerName" />
|
|
||||||
<el-table-column label="请求路径" align="center" prop="requestPath" />
|
|
||||||
<el-table-column label="请求方式" align="center" prop="requestMethod">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.http_request_method" :value="scope.row.requestMethod"/>
|
<el-button @click="handleDetail(scope.row, 'detail')" type="text">{{scope.row.routeName}}</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="请求参数,json格式" align="center" prop="requestParameter" />
|
<el-table-column label="路由方式" prop="routeType" min-width="100">
|
||||||
<el-table-column label="服务地址" align="center" prop="serverAddress" />
|
<template slot-scope="scope">
|
||||||
<el-table-column label="服务器端口" align="center" prop="serverPort" />
|
{{{'WEIGHT_ROUTE': '权重路由', 'HEADER_ROUTE': '请求头路由'}[scope.row.routeType]}}
|
||||||
<el-table-column label="创建人" align="center" prop="createBy" />
|
</template>
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
</el-table-column>
|
||||||
|
<el-table-column label="协议" prop="requestProtocol" min-width="100" />
|
||||||
|
<el-table-column label="路由活跃状态" align="center" prop="routeActiveStatus" min-width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<!-- 0=探活未开启,1=状态获取中,2=正常,3=异常 -->
|
||||||
|
<dict-tag :options="dict.type.route_active_status" :value="scope.row.routeActiveStatus"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="创建人" align="center" prop="created" width="120" /> -->
|
||||||
|
<el-table-column label="创建时间" prop="createTime" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<!-- <el-table-column label="更新时间" prop="updateTime" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column label="操作" fixed="right" width="150" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleDetail(scope.row)"
|
||||||
v-hasPermi="['gateway:route:edit']"
|
v-hasPermi="['gateway:route:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@ -134,42 +147,16 @@
|
|||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改路由管理对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="路由名称" prop="routerName">
|
|
||||||
<el-input v-model="form.routerName" placeholder="请输入路由名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="请求路径" prop="requestPath">
|
|
||||||
<el-input v-model="form.requestPath" placeholder="请输入请求路径" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="请求方式" prop="requestMethod">
|
|
||||||
<el-input v-model="form.requestMethod" placeholder="请输入请求方式" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="请求参数,json格式" prop="requestParameter">
|
|
||||||
<el-input v-model="form.requestParameter" placeholder="请输入请求参数,json格式" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="服务地址" prop="serverAddress">
|
|
||||||
<el-input v-model="form.serverAddress" placeholder="请输入服务地址" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="服务器端口" prop="serverPort">
|
|
||||||
<el-input v-model="form.serverPort" placeholder="请输入服务器端口" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import EventBus from '@/utils/eventBus'
|
||||||
import { listRoute, getRoute, delRoute, addRoute, updateRoute } from "@/api/gateway/route";
|
import { listRoute, getRoute, delRoute, addRoute, updateRoute } from "@/api/gateway/route";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Route",
|
name: "Route",
|
||||||
|
dicts: ['http_request_method', 'route_active_status'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
@ -201,24 +188,15 @@ export default {
|
|||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
},
|
},
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
routerName: [
|
|
||||||
{ required: true, message: "路由名称不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
requestPath: [
|
|
||||||
{ required: true, message: "请求路径不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
requestMethod: [
|
|
||||||
{ required: true, message: "请求方式不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
|
||||||
|
EventBus.$on("reloadRouteList",this.getList);
|
||||||
|
},
|
||||||
|
befoueDestroy() {
|
||||||
|
EventBus.$off('reloadRouteList', this.getList);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询路由管理列表 */
|
/** 查询路由管理列表 */
|
||||||
@ -237,28 +215,6 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
routerName: null,
|
|
||||||
requestPath: null,
|
|
||||||
requestMethod: null,
|
|
||||||
requestParameter: null,
|
|
||||||
serverAddress: null,
|
|
||||||
serverPort: null,
|
|
||||||
createBy: null,
|
|
||||||
createTime: null,
|
|
||||||
updateBy: null,
|
|
||||||
updateTime: null
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
@ -279,45 +235,21 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.$router.push({path: '/gateway/route-edit'});
|
||||||
this.open = true;
|
|
||||||
this.title = "添加路由管理";
|
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleDetail(row, type) {
|
||||||
this.reset();
|
this.$router.push({
|
||||||
const id = row.id || this.ids
|
path: '/gateway/route-edit',
|
||||||
getRoute(id).then(response => {
|
query: {
|
||||||
this.form = response.data;
|
id: row.id,
|
||||||
this.open = true;
|
type,
|
||||||
this.title = "修改路由管理";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
let data = Object.assign({},this.form)
|
|
||||||
delete data.explain
|
|
||||||
updateRoute(data).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addRoute(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row?.id || this.ids;
|
||||||
this.$modal.confirm('是否确认删除路由管理编号为"' + ids + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除路由管理编号为"' + ids + '"的数据项?').then(function() {
|
||||||
return delRoute(ids);
|
return delRoute(ids);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
@ -62,7 +62,7 @@ export default {
|
|||||||
tableOptions: [
|
tableOptions: [
|
||||||
{ label: '接口ID', prop: 'id', width: '80' },
|
{ label: '接口ID', prop: 'id', width: '80' },
|
||||||
{ label: '接口名称', prop: 'interfaceName' },
|
{ label: '接口名称', prop: 'interfaceName' },
|
||||||
{ label: '接口路劲', prop: 'interfacePath' },
|
{ label: '接口路径', prop: 'interfacePath' },
|
||||||
{ label: '接口描述', prop: 'description' },
|
{ label: '接口描述', prop: 'description' },
|
||||||
{ label: '接口版本', prop: 'version', width: '120' },
|
{ label: '接口版本', prop: 'version', width: '120' },
|
||||||
{ type: 'slot', prop: 'action', label: '操作', fixed: 'right', width: '100px' }
|
{ type: 'slot', prop: 'action', label: '操作', fixed: 'right', width: '100px' }
|
||||||
|
112
sf-ui/src/views/gateway/server/detail.vue
Normal file
112
sf-ui/src/views/gateway/server/detail.vue
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container-flex" v-loading="loading">
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
服务详情
|
||||||
|
<el-divider/>
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<el-descriptions title="基础信息" border>
|
||||||
|
<el-descriptions-item label="服务名称">{{ detail.serverName }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="服务模式">
|
||||||
|
<dict-tag :options="dict.type.gateway_service_model" :value="detail.serviceModel"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="服务地址">{{ detail.serverAddress }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="服务状态">
|
||||||
|
<dict-tag :options="dict.type.gateway_data_status" :value="detail.status"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="服务备注">{{ detail.remark }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<!-- <el-divider/> -->
|
||||||
|
|
||||||
|
<div class="el-descriptions__header" style="margin-top: 40px;">
|
||||||
|
<div class="el-descriptions__title">接口信息</div>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:data="detail.interfaceInfoList"
|
||||||
|
style="width: 100%;margin-bottom: 20px;"
|
||||||
|
row-key="id"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column prop="interfaceName" label="接口名称">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<el-button
|
||||||
|
@click="handleInterfaceDetail(row.id)"
|
||||||
|
type="text"
|
||||||
|
>{{row.interfaceName}}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="interfacePath" label="接口路径" />
|
||||||
|
<el-table-column prop="description" label="接口描述" />
|
||||||
|
<el-table-column prop="strategyList" label="关联策略" width="300">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
v-for="item in scope.row.strategyList"
|
||||||
|
:key="item.id"
|
||||||
|
@click="handleStrategyDetail(item.id)"
|
||||||
|
type="text"
|
||||||
|
>{{item.strategyName}}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="version" label="接口版本" width="100" />
|
||||||
|
<el-table-column prop="requestMethod" label="请求方式" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.http_request_method" :value="scope.row.requestMethod"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getServer } from "@/api/gateway/server";
|
||||||
|
export default {
|
||||||
|
dicts: ['gateway_service_model', 'gateway_data_status', 'http_request_method'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
detail: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getDetail() {
|
||||||
|
this.loading = true;
|
||||||
|
const { id } = this.$route.query;
|
||||||
|
try {
|
||||||
|
const {dode, data} = await getServer(id);
|
||||||
|
this.detail = data;
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
},
|
||||||
|
handleInterfaceDetail(id) {
|
||||||
|
this.$router.push({
|
||||||
|
path: '/gateway/interface-edit',
|
||||||
|
query: {
|
||||||
|
id: id,
|
||||||
|
type: 'detail'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleStrategyDetail(id) {
|
||||||
|
this.$router.push({
|
||||||
|
path: '/gateway/strategy-edit',
|
||||||
|
query: {
|
||||||
|
id: id,
|
||||||
|
type: 'detail'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container-flex">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="服务名称" prop="serverName">
|
<el-form-item label="服务名称" prop="serverName">
|
||||||
<el-input
|
<el-input
|
||||||
@ -44,7 +44,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb14">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -63,7 +63,7 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleStatus()"
|
@click="handleStatus()"
|
||||||
>批量发布</el-button>
|
>批量启用</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -76,7 +76,7 @@
|
|||||||
v-hasPermi="['gateway:server:remove']"
|
v-hasPermi="['gateway:server:remove']"
|
||||||
>批量删除</el-button>
|
>批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
@ -85,56 +85,63 @@
|
|||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['gateway:server:export']"
|
v-hasPermi="['gateway:server:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="serverList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="serverList" @selection-change="handleSelectionChange" height="100%">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="服务ID" width="60" align="center" prop="id" />
|
<!-- <el-table-column label="服务ID" width="60" align="center" prop="id" /> -->
|
||||||
<el-table-column label="服务名称" align="center" show-overflow-tooltip prop="serverName" />
|
<el-table-column label="服务名称" align="left" show-overflow-tooltip prop="serverName">
|
||||||
<el-table-column label="服务地址" align="center" show-overflow-tooltip prop="serverAddress" />
|
<template slot-scope="scope">
|
||||||
<el-table-column label="备注" align="center" show-overflow-tooltip prop="remark" />
|
<el-button @click="handleDetail(scope.row)" type="text">{{scope.row.serverName}}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="服务地址" align="left" show-overflow-tooltip prop="serverAddress" />
|
||||||
|
<el-table-column label="备注" align="left" show-overflow-tooltip prop="remark" />
|
||||||
<!-- <el-table-column label="接口版本" align="center" prop="version" /> -->
|
<!-- <el-table-column label="接口版本" align="center" prop="version" /> -->
|
||||||
<el-table-column label="服务状态" width="100" align="center" prop="status">
|
<el-table-column label="服务状态" width="100" align="center" prop="status">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.gateway_data_status" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.gateway_data_status" :value="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建者" width="100" align="center" prop="createBy" />
|
<el-table-column label="创建者" width="150" align="left" prop="created" />
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
|
<el-table-column label="创建时间" align="left" prop="createTime" width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="更新时间" align="center" prop="updateTime" width="100">
|
<el-table-column label="更新时间" align="left" prop="updateTime" width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
<el-table-column label="操作" fixed="right" align="left" width="180" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['gateway:server:edit']"
|
v-hasPermi="['gateway:server:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<!-- <el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@click="handleConfig(scope.row)"
|
@click="handleConfig(scope.row)"
|
||||||
v-hasPermi="['gateway:server:config']"
|
v-hasPermi="['gateway:server:config']"
|
||||||
>服务配置</el-button>
|
>服务配置</el-button> -->
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
@click="handleStatus(scope.row)"
|
@click="handleStatus(scope.row)"
|
||||||
v-hasPermi="['gateway:server:config']"
|
v-hasPermi="['gateway:server:config']"
|
||||||
>{{scope.row.status == '1' ? '停止' : '启用'}}</el-button>
|
>{{scope.row.status == '1' ? '停止' : '启用'}}</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['gateway:server:remove']"
|
v-hasPermi="['gateway:server:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
@ -151,21 +158,65 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改服务管理对话框 -->
|
<!-- 添加或修改服务管理对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" class="server-dialog" width="600px" append-to-body destroy-on-close>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
||||||
<el-form-item label="服务名称" prop="serverName">
|
<el-form-item label="服务名称" prop="serverName">
|
||||||
<el-input v-model="form.serverName" placeholder="请输入服务名称" />
|
<el-input
|
||||||
|
v-model="form.serverName"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入服务名称"
|
||||||
|
maxlength="50"
|
||||||
|
show-word-limit
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服务地址" prop="serverAddress">
|
<el-form-item label="服务类型" prop="serviceType">
|
||||||
<el-input v-model="form.serverAddress" placeholder="请输入服务地址" />
|
<el-select v-model="form.serviceType" clearable placeholder="请选择服务类型">
|
||||||
|
<el-option v-for="item in dict.type.gateway_service_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
<!-- <el-radio-group v-model="form.serviceType">
|
||||||
|
<el-radio v-for="item in dict.type.gateway_service_type" :key="item.value" :label="item.value">{{item.label}}</el-radio>
|
||||||
|
</el-radio-group> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="服务模式" prop="serviceModel">
|
||||||
|
<el-radio-group v-model="form.serviceModel" @change="handleServiceModelChange">
|
||||||
|
<el-radio v-for="item in dict.type.gateway_service_model" :key="item.value" :label="item.value">{{item.label}}</el-radio>
|
||||||
|
<!-- <el-radio label="ROUTE">路由模式</el-radio> -->
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="form.serviceModel === 'NORMAL'" label="服务地址" prop="serverAddress" key="serverAddress">
|
||||||
|
<el-input v-model="form.serverAddress" clearable placeholder="请输入服务地址" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="form.serviceModel === 'ROUTE'" label="路由规则" prop="routeId" key="routeId">
|
||||||
|
<el-select v-model="form.routeId" clearable placeholder="请选择路由规则" style="width: 100%">
|
||||||
|
<el-option v-for="item in routeList" :key="item.id" :label="item.routeName" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="超时时间" prop="timeout">
|
||||||
|
<template slot="label">
|
||||||
|
<span>超时时间</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">超时时间: 1-150000ms 默认3000ms 单位ms</p>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.timeout"
|
||||||
|
placeholder="请输入超时时间"
|
||||||
|
:min="1"
|
||||||
|
:max="150000"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
@ -173,10 +224,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listServer, getServer, delServer, addServer, updateServer, changeServerStatus } from "@/api/gateway/server";
|
import { listServer, getServer, delServer, addServer, updateServer, changeServerStatus } from "@/api/gateway/server";
|
||||||
|
import { getBindableList } from "@/api/gateway/route"
|
||||||
export default {
|
export default {
|
||||||
name: "Server",
|
name: "Server",
|
||||||
dicts: ['gateway_data_status'],
|
dicts: ['gateway_data_status', 'gateway_service_model', 'gateway_service_type'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
@ -205,6 +256,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
serverName: null,
|
serverName: null,
|
||||||
serverAddress: null,
|
serverAddress: null,
|
||||||
|
remark: null,
|
||||||
status: null,
|
status: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
@ -214,18 +266,44 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
serverName: [
|
serverName: [
|
||||||
{ required: true, message: "服务名称不能为空", trigger: "blur" }
|
// 服务名只能以字母或下划线开头,只能包含字母、数字、下划线,不超过50个字符
|
||||||
|
{ required: true, message: "服务名称不能为空", trigger: "blur" },
|
||||||
|
{ min: 0, max: 50, message: "长度在 0 到 50 个字符" },
|
||||||
|
{ pattern: /^[a-zA-Z_][a-zA-Z0-9_]*$/, message: "只能以字母或下划线开头,只能包含字母、数字、下划线", trigger: "blur" }
|
||||||
|
],
|
||||||
|
serviceType: [
|
||||||
|
{ required: true, message: "服务类型不能为空", trigger: "change" },
|
||||||
],
|
],
|
||||||
serverAddress: [
|
serverAddress: [
|
||||||
{ required: true, message: "服务地址不能为空", trigger: "blur" }
|
{ required: true, message: "服务地址不能为空", trigger: "blur" },
|
||||||
],
|
{
|
||||||
|
pattern: /^(https?:\/\/)?((?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d+)?$/,
|
||||||
|
message: "请输入正确的服务地址",
|
||||||
|
trigger: "blur",
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
routeId: [
|
||||||
|
{ required: true, message: "路由规则不能为空", trigger: "change" },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
routeList: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.getRouteList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleServiceModelChange(val) {
|
||||||
|
if (val === 'ROUTE') {
|
||||||
|
this.getRouteList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getRouteList() {
|
||||||
|
const data = await getBindableList();
|
||||||
|
this.routeList = data;
|
||||||
|
},
|
||||||
/** 查询服务管理列表 */
|
/** 查询服务管理列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@ -252,7 +330,11 @@ export default {
|
|||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: null,
|
||||||
serverName: null,
|
serverName: null,
|
||||||
|
serviceType: 'SAC',
|
||||||
|
serviceModel: 'NORMAL',
|
||||||
serverAddress: null,
|
serverAddress: null,
|
||||||
|
timeout: void 0,
|
||||||
|
routeId: null,
|
||||||
remark: null,
|
remark: null,
|
||||||
version: null,
|
version: null,
|
||||||
status: null,
|
status: null,
|
||||||
@ -285,7 +367,17 @@ export default {
|
|||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加服务管理";
|
this.title = "新增服务";
|
||||||
|
},
|
||||||
|
/** 详情按钮操作 */
|
||||||
|
handleDetail(row) {
|
||||||
|
const { id } = row;
|
||||||
|
this.$router.push({
|
||||||
|
path: '/gateway/server-detail',
|
||||||
|
query: {
|
||||||
|
id: row.id
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
@ -293,8 +385,9 @@ export default {
|
|||||||
const id = row.id || this.ids
|
const id = row.id || this.ids
|
||||||
getServer(id).then(response => {
|
getServer(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
this.form.timeout = response.data?.timeout ?? void 0;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改服务管理";
|
this.title = "修改服务";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 服务配置 */
|
/** 服务配置 */
|
||||||
@ -330,7 +423,7 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids.join(",");
|
const ids = row?.id || this.ids.join(",");
|
||||||
this.$modal.confirm('是否确认删除服务管理编号为"' + ids + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除服务管理编号为"' + ids + '"的数据项?').then(function() {
|
||||||
return delServer(ids);
|
return delServer(ids);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
@ -350,7 +443,6 @@ export default {
|
|||||||
status: status
|
status: status
|
||||||
}
|
}
|
||||||
changeServerStatus(params).then((res) => {
|
changeServerStatus(params).then((res) => {
|
||||||
console.log(res)
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess(row.status === '1' ? "停用成功" : "启用成功");
|
this.$modal.msgSuccess(row.status === '1' ? "停用成功" : "启用成功");
|
||||||
@ -368,3 +460,28 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
::v-deep.el-input-number {
|
||||||
|
width: 100%;
|
||||||
|
.el-input__inner{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.server-dialog {
|
||||||
|
::v-deep.el-form {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-icon-info {
|
||||||
|
color: #959595;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.tip {
|
||||||
|
color: #999;
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
350
sf-ui/src/views/gateway/strategy/edit.vue
Normal file
350
sf-ui/src/views/gateway/strategy/edit.vue
Normal file
@ -0,0 +1,350 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container-flex">
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
{{titleName}}
|
||||||
|
<el-divider/>
|
||||||
|
</el-header>
|
||||||
|
<el-main v-loading="loading">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="130px" label-position="right" :disabled="!editable">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="策略类型" prop="strategyType">
|
||||||
|
<el-radio-group v-model="form.strategyType" @input="strategyTypeChange">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in dict.type.gateway_strategy_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
:disabled="disabledType(dict.value)"
|
||||||
|
>{{dict.label}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="策略名称" prop="strategyName">
|
||||||
|
<el-input v-model="form.strategyName" clearable placeholder="描述性的名称,用于识别和管理该策略" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="策略描述" prop="description">
|
||||||
|
<el-input v-model="form.description" type="textarea" placeholder="请输入策略描述" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 认证策略 start -->
|
||||||
|
<!-- 认证策略 end -->
|
||||||
|
|
||||||
|
<!-- 鉴权策略 start -->
|
||||||
|
<!-- 鉴权策略 end -->
|
||||||
|
|
||||||
|
<!-- 限流策略 start-->
|
||||||
|
<template v-if="form.strategyType === 'CURRENT_LIMITING'">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="限流阈值" prop="currentLimitingThreshold">
|
||||||
|
<template slot="label">
|
||||||
|
<span>限流阈值</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
width="280"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">设置限流的阈值,即允许通过的请求次数或者并发连接数</p>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.currentLimitingThreshold"
|
||||||
|
placeholder="请输入限流阈值"
|
||||||
|
:min="0"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="限流时间窗口" prop="currentLimitingTimeWindow">
|
||||||
|
<template slot="label">
|
||||||
|
<span>限流时间窗口</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">限流时间窗口,单位s</p>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.currentLimitingTimeWindow"
|
||||||
|
placeholder="请输入限流时间窗口"
|
||||||
|
:min="0"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="限流响应" prop="currentLimitingResponse">
|
||||||
|
<template slot="label">
|
||||||
|
<span>限流响应</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">限流响应,JSON字符串</p>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<el-input
|
||||||
|
v-model="form.currentLimitingResponse"
|
||||||
|
:autosize="{ minRows: 4}"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入限流响应"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<!-- 限流策略 end -->
|
||||||
|
<!-- 熔断策略 start -->
|
||||||
|
<template v-if="form.strategyType === 'CIRCUIT_BREAKER'">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="熔断阈值" prop="circuitBreakerThreshold">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.circuitBreakerThreshold"
|
||||||
|
placeholder="请输入熔断阈值"
|
||||||
|
:min="0"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="熔断时间窗口" prop="circuitBreakerTimeWindow">
|
||||||
|
<template slot="label">
|
||||||
|
<span>熔断时间窗口</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">调用失败阈值对应的时间窗口,单位s</p>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.circuitBreakerTimeWindow"
|
||||||
|
placeholder="请输入熔断时间窗口"
|
||||||
|
:min="0"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="恢复时间间隔" prop="circuitBreakerRecoveryInterval">
|
||||||
|
<template slot="label">
|
||||||
|
<span>恢复时间间隔</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">熔断后的恢复时间间隔,单位s</p>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.circuitBreakerRecoveryInterval"
|
||||||
|
placeholder="请输入恢复时间间隔"
|
||||||
|
:min="0"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="熔断响应" prop="circuitBreakerResponse">
|
||||||
|
<template slot="label">
|
||||||
|
<span>熔断响应</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<span slot="reference"><i class="el-icon-info ml10"></i></span>
|
||||||
|
<p class="tip">熔断响应,JSON字符串</p>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<el-input
|
||||||
|
v-model="form.circuitBreakerResponse"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 4}"
|
||||||
|
placeholder="请输入熔断响应"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<!-- 熔断策略 end -->
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-main>
|
||||||
|
<el-footer class="footer">
|
||||||
|
<el-button :disabled="btnLoading" @click="close">取消</el-button>
|
||||||
|
<el-button v-if="editable" type="primary" :loading="btnLoading" @click="submitForm">保存</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import EventBus from '@/utils/eventBus'
|
||||||
|
import { deepClone } from '@/utils'
|
||||||
|
import { updateStrategy, getStrategy, addStrategy } from "@/api/gateway/strategy";
|
||||||
|
let CACHEFOEM;
|
||||||
|
export default {
|
||||||
|
components: { },
|
||||||
|
dicts: ['gateway_strategy_type'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
btnLoading: false,
|
||||||
|
form: {
|
||||||
|
id: void 0,
|
||||||
|
strategyType: 'CURRENT_LIMITING',
|
||||||
|
strategyName: void 0,
|
||||||
|
description: void 0,
|
||||||
|
currentLimitingThreshold: void 0,
|
||||||
|
currentLimitingTimeWindow: void 0,
|
||||||
|
currentLimitingResponse: '{"msg":"到达限流阈值,请稍后重试!","code":500}',
|
||||||
|
circuitBreakerThreshold: void 0,
|
||||||
|
circuitBreakerTimeWindow: void 0,
|
||||||
|
circuitBreakerRecoveryInterval: void 0,
|
||||||
|
circuitBreakerResponse: '{"msg":"到达熔断阈值,请稍后重试!","code":500}',
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
strategyType: [
|
||||||
|
{ required: true, message: '策略类型不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
strategyName:[
|
||||||
|
{ required: true, message: '策略名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
currentLimitingThreshold: [
|
||||||
|
{ required: true, message: '限流阈值不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
currentLimitingTimeWindow: [
|
||||||
|
{ required: true, message: '限流时间窗口不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
currentLimitingResponse: [
|
||||||
|
{ required: true, message: '限流响应不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
circuitBreakerThreshold: [
|
||||||
|
{ required: true, message: '熔断阈值不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
circuitBreakerTimeWindow: [
|
||||||
|
{ required: true, message: '熔断时间窗口不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
circuitBreakerRecoveryInterval: [
|
||||||
|
{ required: true, message: '恢复时间间隔不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
circuitBreakerResponse: [
|
||||||
|
{ required: true, message: '熔断响应不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
editable() {
|
||||||
|
return this.$route.query.type !== 'detail'
|
||||||
|
},
|
||||||
|
titleName() {
|
||||||
|
if (!this.editable) {
|
||||||
|
return '策略详情'
|
||||||
|
}
|
||||||
|
return this.$route.query.id ? '编辑策略' : '新增策略'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
this.getDetail()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
disabledType(type) {
|
||||||
|
return !(['CURRENT_LIMITING', 'CIRCUIT_BREAKER'].includes(type)) || !!(this.form.id);
|
||||||
|
},
|
||||||
|
async getDetail() {
|
||||||
|
const { id } = this.$route.query
|
||||||
|
if (id) {
|
||||||
|
this.loading = true;
|
||||||
|
try {
|
||||||
|
const { data } = await getStrategy(id)
|
||||||
|
this.form = data;
|
||||||
|
CACHEFOEM = deepClone(data);
|
||||||
|
} catch (error) {
|
||||||
|
this.$message.error(error.message || '请求失败')
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: void 0,
|
||||||
|
strategyType: 'CURRENT_LIMITING',
|
||||||
|
strategyName: void 0,
|
||||||
|
description: void 0,
|
||||||
|
currentLimitingThreshold: void 0,
|
||||||
|
currentLimitingTimeWindow: void 0,
|
||||||
|
currentLimitingResponse: '{"msg":"到达限流阈值,请稍后重试!","code":500}',
|
||||||
|
circuitBreakerThreshold: void 0,
|
||||||
|
circuitBreakerTimeWindow: void 0,
|
||||||
|
circuitBreakerRecoveryInterval: void 0,
|
||||||
|
circuitBreakerResponse: '{"msg":"到达熔断阈值,请稍后重试!","code":500}',
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
strategyTypeChange() {
|
||||||
|
const { id, strategyType } = this.form;
|
||||||
|
this.reset();
|
||||||
|
if (CACHEFOEM && strategyType === CACHEFOEM.strategyType) {
|
||||||
|
Object.keys(this.form).forEach((key) => {
|
||||||
|
this.form[key] = CACHEFOEM[key];
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.form.id = id;
|
||||||
|
this.form.strategyType = strategyType;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async submitForm() {
|
||||||
|
const request = this.form.id != null ? updateStrategy : addStrategy;
|
||||||
|
const msg = this.form.id != null ? '修改' : '新增';
|
||||||
|
await this.$refs.form.validate();
|
||||||
|
try {
|
||||||
|
this.btnLoading = true;
|
||||||
|
await request(this.form);
|
||||||
|
this.$modal.msgSuccess(`${msg}成功`);
|
||||||
|
EventBus.$emit('reloadStratefyList');
|
||||||
|
this.close();
|
||||||
|
} catch (error) {
|
||||||
|
this.$modal.msgError(`${msg}失败`);
|
||||||
|
}
|
||||||
|
this.btnLoading = false;
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$tab.closePage();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
::v-deep.el-input-number .el-input__inner{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.el-icon-info {
|
||||||
|
color: #959595;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.tip {
|
||||||
|
color: #999;
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container-flex">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="策略名称" prop="strategyName">
|
<el-form-item label="策略名称" prop="strategyName">
|
||||||
<el-input
|
<el-input
|
||||||
@ -46,7 +46,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb14">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -79,7 +79,7 @@
|
|||||||
v-hasPermi="['gateway:strategy:remove']"
|
v-hasPermi="['gateway:strategy:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
@ -88,37 +88,41 @@
|
|||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['gateway:strategy:export']"
|
v-hasPermi="['gateway:strategy:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="strategyList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="strategyList" @selection-change="handleSelectionChange" height="100%">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="策略ID" width="60" align="center" prop="id" />
|
<el-table-column label="策略名称" min-width="180" show-overflow-tooltip prop="strategyName">
|
||||||
<el-table-column label="策略类型" width="120" align="center" prop="strategyType">
|
<template slot-scope="scope">
|
||||||
|
<el-button @click="handleUpdate(scope.row, 'detail')" type="text">{{scope.row.strategyName}}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="策略描述" min-width="180" show-overflow-tooltip prop="description" />
|
||||||
|
<!-- <el-table-column label="请求方式" prop="requestMethod" /> -->
|
||||||
|
<el-table-column label="策略类型" min-width="120" prop="strategyType">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.gateway_strategy_type" :value="scope.row.strategyType"/>
|
<dict-tag :options="dict.type.gateway_strategy_type" :value="scope.row.strategyType"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="策略名称" align="left" show-overflow-tooltip prop="strategyName" />
|
<el-table-column label="策略状态" min-width="100" align="center" prop="status">
|
||||||
<el-table-column label="策略描述" align="left" show-overflow-tooltip prop="description" />
|
|
||||||
<!-- <el-table-column label="请求方式" align="center" prop="requestMethod" /> -->
|
|
||||||
<el-table-column label="策略状态" width="80" align="center" prop="status">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.gateway_data_status" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.gateway_data_status" :value="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
|
<el-table-column label="创建者" min-width="100" prop="created" />
|
||||||
|
<el-table-column label="创建时间" prop="createTime" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="更新时间" align="center" prop="updateTime" width="100">
|
<el-table-column label="更新时间" prop="updateTime" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
|
<el-table-column label="操作" width="180" fixed="right" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -126,7 +130,7 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleStatus(scope.row)"
|
@click="handleStatus(scope.row)"
|
||||||
v-hasPermi="['gateway:strategy:edit']"
|
v-hasPermi="['gateway:strategy:edit']"
|
||||||
>{{scope.row === '0' ? '启用' : '禁用' }}</el-button>
|
>{{scope.row.status === '0' ? '启用' : '禁用' }}</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@ -154,9 +158,9 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改策略管理对话框 -->
|
<!-- 添加或修改策略管理对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
<!-- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> -->
|
||||||
<el-form ref="form" :model="form" :rules="rules" :validate-on-rule-change="false" label-width="100px">
|
<!-- <el-form ref="form" :model="form" :rules="rules" :validate-on-rule-change="false" label-width="100px"> -->
|
||||||
<el-form-item label="策略类型" prop="strategyType">
|
<!-- <el-form-item label="策略类型" prop="strategyType">
|
||||||
<el-radio-group v-model="form.strategyType" @input="strategyTypeChange">
|
<el-radio-group v-model="form.strategyType" @input="strategyTypeChange">
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.gateway_strategy_type"
|
v-for="dict in dict.type.gateway_strategy_type"
|
||||||
@ -170,23 +174,23 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="策略描述" prop="description">
|
<el-form-item label="策略描述" prop="description">
|
||||||
<el-input v-model="form.description" placeholder="请输入策略描述" />
|
<el-input v-model="form.description" placeholder="请输入策略描述" />
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
|
|
||||||
<!-- 认证策略 -->
|
<!-- 认证策略 -->
|
||||||
<template v-if="form.strategyType === 'AUTHENTICATION'">
|
<!-- <template v-if="form.strategyType === 'AUTHENTICATION'"> -->
|
||||||
<!-- 缺 认证方式 -->
|
<!-- 缺 认证方式 -->
|
||||||
<!-- 缺 认证配置 针对选定的认证方式,需要相应的配置信息,如秘钥、证书、令牌有效期等 -->
|
<!-- 缺 认证配置 针对选定的认证方式,需要相应的配置信息,如秘钥、证书、令牌有效期等 -->
|
||||||
<!-- 缺 生效范围 -->
|
<!-- 缺 生效范围 -->
|
||||||
</template>
|
<!-- </template> -->
|
||||||
<!-- 认证策略 -->
|
<!-- 认证策略 -->
|
||||||
|
|
||||||
<!-- 鉴权策略 -->
|
<!-- 鉴权策略 -->
|
||||||
<template v-if="form.strategyType === 'PERMISSION'">
|
<!-- <template v-if="form.strategyType === 'PERMISSION'"> -->
|
||||||
<!-- 缺 角色授权 指定用户或角色是否具有访问接口或资源的权限-->
|
<!-- 缺 角色授权 指定用户或角色是否具有访问接口或资源的权限-->
|
||||||
<!-- 缺 角色列表 指定哪些角色拥有访问接口或资源的权限-->
|
<!-- 缺 角色列表 指定哪些角色拥有访问接口或资源的权限-->
|
||||||
<!-- 缺 用户ID 标识请求中的用户身份信息-->
|
<!-- 缺 用户ID 标识请求中的用户身份信息-->
|
||||||
<!-- 缺 IP地址 允许访问接口或资源的IP地址范围,限制请求来源-->
|
<!-- 缺 IP地址 允许访问接口或资源的IP地址范围,限制请求来源-->
|
||||||
<el-form-item label="请求方法" prop="requestMethod">
|
<!-- <el-form-item label="请求方法" prop="requestMethod">
|
||||||
<el-radio-group v-model="form.requestMethod">
|
<el-radio-group v-model="form.requestMethod">
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.http_request_method"
|
v-for="dict in dict.type.http_request_method"
|
||||||
@ -194,19 +198,19 @@
|
|||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{dict.label}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<!-- 缺 请求路劲 允许访问的接口路劲或URL -->
|
<!-- 缺 请求路径 允许访问的接口路径或URL -->
|
||||||
<!-- 缺 访问频率限制 设置允许用户或角色在一定时间内访问接口的次数限制 -->
|
<!-- 缺 访问频率限制 设置允许用户或角色在一定时间内访问接口的次数限制 -->
|
||||||
<!-- 缺 访问时间限制 允许用户或者角色访问接口的时间段 -->
|
<!-- 缺 访问时间限制 允许用户或者角色访问接口的时间段 -->
|
||||||
<!-- 缺 访问来源 访问接口的来源 -->
|
<!-- 缺 访问来源 访问接口的来源 -->
|
||||||
<!-- 缺 有限期 -->
|
<!-- 缺 有限期 -->
|
||||||
<!-- 缺 授权范围 指定用户或角色 -->
|
<!-- 缺 授权范围 指定用户或角色 -->
|
||||||
</template>
|
<!-- </template> -->
|
||||||
<!-- 鉴权策略 -->
|
<!-- 鉴权策略 -->
|
||||||
|
|
||||||
<!-- 限流策略 -->
|
<!-- 限流策略 -->
|
||||||
<template v-if="form.strategyType == 'CURRENT_LIMITING'">
|
<!-- <template v-if="form.strategyType == 'CURRENT_LIMITING'"> -->
|
||||||
<el-form-item label="限流算法" prop="currentLimitingAlgorithm">
|
<!-- <el-form-item label="限流算法" prop="currentLimitingAlgorithm">
|
||||||
<el-input v-model="form.currentLimitingAlgorithm" placeholder="选择具体的限流算法,如令牌桶算法、楼桶算法、计数器算法等" />
|
<el-input v-model="form.currentLimitingAlgorithm" placeholder="选择具体的限流算法,如令牌桶算法、楼桶算法、计数器算法等" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="限流阈值" prop="currentLimitingThreshold">
|
<el-form-item label="限流阈值" prop="currentLimitingThreshold">
|
||||||
@ -214,20 +218,20 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="限流周期" prop="currentLimitingPeriod">
|
<el-form-item label="限流周期" prop="currentLimitingPeriod">
|
||||||
<el-input v-model="form.currentLimitingPeriod" placeholder="设置限流的时间周期,如每秒限流、没分钟限流等" />
|
<el-input v-model="form.currentLimitingPeriod" placeholder="设置限流的时间周期,如每秒限流、没分钟限流等" />
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<!-- 缺 生效范围 -->
|
<!-- 缺 生效范围 -->
|
||||||
<el-form-item label="限流处理方式" prop="currentLimitingProcessingMethod">
|
<!-- <el-form-item label="限流处理方式" prop="currentLimitingProcessingMethod">
|
||||||
<el-input v-model="form.currentLimitingProcessingMethod" placeholder="请输入限流处理方式" />
|
<el-input v-model="form.currentLimitingProcessingMethod" placeholder="请输入限流处理方式" />
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<!-- 缺 超限处理策略 -->
|
<!-- 缺 超限处理策略 -->
|
||||||
<!-- 缺 监控和警告 -->
|
<!-- 缺 监控和警告 -->
|
||||||
<!-- 缺 限流日志 -->
|
<!-- 缺 限流日志 -->
|
||||||
</template>
|
<!-- </template> -->
|
||||||
<!-- 限流策略 -->
|
<!-- 限流策略 -->
|
||||||
|
|
||||||
<!-- 数据加密策略 -->
|
<!-- 数据加密策略 -->
|
||||||
<template v-if="form.strategyType == 'DATA_ENCRYPTION'">
|
<!-- <template v-if="form.strategyType == 'DATA_ENCRYPTION'"> -->
|
||||||
<el-form-item label="状态" prop="status">
|
<!-- <el-form-item label="状态" prop="status">
|
||||||
<el-radio-group v-model="form.status">
|
<el-radio-group v-model="form.status">
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.gateway_data_status"
|
v-for="dict in dict.type.gateway_data_status"
|
||||||
@ -235,10 +239,9 @@
|
|||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{dict.label}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="加密算法" prop="encryptionAlgorithm">
|
<!-- <el-form-item label="加密算法" prop="encryptionAlgorithm">
|
||||||
<el-radio-group v-model="form.encryptionAlgorithm" @input="changeEncryptionAlgorithm">
|
<el-radio-group v-model="form.encryptionAlgorithm" @input="changeEncryptionAlgorithm">
|
||||||
<!-- ECC、RSA、SM2(国密) -->
|
|
||||||
<el-radio label="ECC">ECC</el-radio>
|
<el-radio label="ECC">ECC</el-radio>
|
||||||
<el-radio label="RSA">RSA</el-radio>
|
<el-radio label="RSA">RSA</el-radio>
|
||||||
<el-radio label="SM2">国密</el-radio>
|
<el-radio label="SM2">国密</el-radio>
|
||||||
@ -249,19 +252,20 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="publicKeyRequired" label="公钥内容" prop="publicKey">
|
<el-form-item v-if="publicKeyRequired" label="公钥内容" prop="publicKey">
|
||||||
<el-input v-model="form.publicKey" type="textarea" placeholder="请输入公钥" />
|
<el-input v-model="form.publicKey" type="textarea" placeholder="请输入公钥" />
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
</template>
|
<!-- </template> -->
|
||||||
<!-- 数据加密策略 -->
|
<!-- 数据加密策略 -->
|
||||||
</el-form>
|
<!-- </el-form> -->
|
||||||
<div slot="footer" class="dialog-footer">
|
<!-- <div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div> -->
|
||||||
</el-dialog>
|
<!-- </el-dialog> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import EventBus from "@/utils/eventBus";
|
||||||
import { listStrategy, getStrategy, delStrategy, addStrategy, updateStrategy, changeStrategyStatus } from "@/api/gateway/strategy";
|
import { listStrategy, getStrategy, delStrategy, addStrategy, updateStrategy, changeStrategyStatus } from "@/api/gateway/strategy";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -283,10 +287,10 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
// 策略管理表格数据
|
// 策略管理表格数据
|
||||||
strategyList: [],
|
strategyList: [],
|
||||||
// 弹出层标题
|
// // 弹出层标题
|
||||||
title: "",
|
// title: "",
|
||||||
// 是否显示弹出层
|
// // 是否显示弹出层
|
||||||
open: false,
|
// open: false,
|
||||||
// 限流处理方式时间范围
|
// 限流处理方式时间范围
|
||||||
daterangeCreateTime: [],
|
daterangeCreateTime: [],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
@ -300,57 +304,62 @@ export default {
|
|||||||
createTime: null,
|
createTime: null,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
// form: {
|
||||||
id: null,
|
// id: null,
|
||||||
strategyName: null,
|
// strategyName: null,
|
||||||
strategyType: null,
|
// strategyType: null,
|
||||||
description: null,
|
// description: null,
|
||||||
requestMethod: null,
|
// requestMethod: null,
|
||||||
encryptionAlgorithm: null,
|
// encryptionAlgorithm: null,
|
||||||
status: null,
|
// status: null,
|
||||||
privateKey: null,
|
// privateKey: null,
|
||||||
publicKey: null,
|
// publicKey: null,
|
||||||
currentLimitingAlgorithm: null,
|
// currentLimitingAlgorithm: null,
|
||||||
currentLimitingThreshold: null,
|
// currentLimitingThreshold: null,
|
||||||
currentLimitingPeriod: null,
|
// currentLimitingPeriod: null,
|
||||||
currentLimitingProcessingMethod: null,
|
// currentLimitingProcessingMethod: null,
|
||||||
createBy: null,
|
// createBy: null,
|
||||||
createTime: null,
|
// createTime: null,
|
||||||
updateBy: null,
|
// updateBy: null,
|
||||||
updateTime: null
|
// updateTime: null
|
||||||
},
|
// },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
publicKeyRequired() {
|
// publicKeyRequired() {
|
||||||
return this.form.encryptionAlgorithm === 'RSA';
|
// return this.form.encryptionAlgorithm === 'RSA';
|
||||||
},
|
// },
|
||||||
// 表单校验
|
// // 表单校验
|
||||||
rules() {
|
// rules() {
|
||||||
return {
|
// return {
|
||||||
strategyName: [
|
// strategyName: [
|
||||||
{ required: this.form.strategyType === 'DATA_ENCRYPTION', message: "策略名称不能为空", trigger: "blur" }
|
// { required: this.form.strategyType === 'DATA_ENCRYPTION', message: "策略名称不能为空", trigger: "blur" }
|
||||||
],
|
|
||||||
strategyType: [
|
|
||||||
{ required: true, message: "策略类型不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
// requestMethod: [
|
|
||||||
// { required: true, message: "请求方式不能为空", trigger: "blur" }
|
|
||||||
// ],
|
// ],
|
||||||
encryptionAlgorithm: [
|
// strategyType: [
|
||||||
{ required: true, message: "加密算法不能为空", trigger: "blur" }
|
// { required: true, message: "策略类型不能为空", trigger: "change" }
|
||||||
],
|
// ],
|
||||||
privateKey: [
|
// // requestMethod: [
|
||||||
{ required: true, message: "私钥内容不能为空", trigger: "blur" }
|
// // { required: true, message: "请求方式不能为空", trigger: "blur" }
|
||||||
],
|
// // ],
|
||||||
publicKey: [
|
// encryptionAlgorithm: [
|
||||||
{ required: this.publicKeyRequired, message: "公钥内容不能为空", trigger: "blur" }
|
// { required: true, message: "加密算法不能为空", trigger: "blur" }
|
||||||
],
|
// ],
|
||||||
}
|
// privateKey: [
|
||||||
}
|
// { required: true, message: "私钥内容不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
// publicKey: [
|
||||||
|
// { required: this.publicKeyRequired, message: "公钥内容不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
// }
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
|
||||||
|
EventBus.$on("reloadStratefyList",this.getList);
|
||||||
|
},
|
||||||
|
befoueDestroy() {
|
||||||
|
EventBus.$off('reloadStratefyList', this.getList);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询策略管理列表 */
|
/** 查询策略管理列表 */
|
||||||
@ -370,33 +379,33 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
// cancel() {
|
||||||
this.open = false;
|
// this.open = false;
|
||||||
this.reset();
|
// this.reset();
|
||||||
},
|
// },
|
||||||
// 表单重置
|
// // 表单重置
|
||||||
reset() {
|
// reset() {
|
||||||
this.form = {
|
// this.form = {
|
||||||
id: null,
|
// id: null,
|
||||||
strategyName: null,
|
// strategyName: null,
|
||||||
strategyType: null,
|
// strategyType: null,
|
||||||
description: null,
|
// description: null,
|
||||||
requestMethod: null,
|
// requestMethod: null,
|
||||||
encryptionAlgorithm: null,
|
// encryptionAlgorithm: null,
|
||||||
status: null,
|
// status: null,
|
||||||
privateKey: null,
|
// privateKey: null,
|
||||||
publicKey: null,
|
// publicKey: null,
|
||||||
currentLimitingAlgorithm: null,
|
// currentLimitingAlgorithm: null,
|
||||||
currentLimitingThreshold: null,
|
// currentLimitingThreshold: null,
|
||||||
currentLimitingPeriod: null,
|
// currentLimitingPeriod: null,
|
||||||
currentLimitingProcessingMethod: null,
|
// currentLimitingProcessingMethod: null,
|
||||||
createBy: null,
|
// createBy: null,
|
||||||
createTime: null,
|
// createTime: null,
|
||||||
updateBy: null,
|
// updateBy: null,
|
||||||
updateTime: null
|
// updateTime: null
|
||||||
};
|
// };
|
||||||
this.resetForm("form");
|
// this.resetForm("form");
|
||||||
},
|
// },
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
@ -417,60 +426,68 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
// this.reset();
|
||||||
this.open = true;
|
// this.open = true;
|
||||||
this.title = "添加策略管理";
|
// this.title = "添加策略管理";
|
||||||
|
this.$router.push({path:'/gateway/strategy-edit'})
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row, type) {
|
||||||
this.reset();
|
// this.reset();
|
||||||
const id = row.id || this.ids
|
const id = row.id;
|
||||||
getStrategy(id).then(response => {
|
// getStrategy(id).then(response => {
|
||||||
this.form = response.data;
|
// this.form = response.data;
|
||||||
this.open = true;
|
// this.open = true;
|
||||||
this.title = "修改策略管理";
|
// this.title = "修改策略管理";
|
||||||
});
|
// });
|
||||||
},
|
this.$router.push({
|
||||||
strategyTypeChange() {
|
path:'/gateway/strategy-edit',
|
||||||
const { id, strategyName, strategyType } = this.form;
|
query: {
|
||||||
this.reset();
|
id,
|
||||||
this.form.id = id;
|
type
|
||||||
this.form.strategyName = strategyName;
|
|
||||||
this.form.strategyType = strategyType;
|
|
||||||
},
|
|
||||||
changeEncryptionAlgorithm(val) {
|
|
||||||
// 非RSA,清空公钥
|
|
||||||
if (val === 'RSA') {
|
|
||||||
this.form.publicKey = null;
|
|
||||||
};
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
console.log(this.form)
|
|
||||||
// return;
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
let data = Object.assign({},this.form)
|
|
||||||
delete data.explain
|
|
||||||
updateStrategy(data).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addStrategy(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
// strategyTypeChange() {
|
||||||
|
// const { id, strategyName, strategyType } = this.form;
|
||||||
|
// this.reset();
|
||||||
|
// this.form.id = id;
|
||||||
|
// this.form.strategyName = strategyName;
|
||||||
|
// this.form.strategyType = strategyType;
|
||||||
|
// },
|
||||||
|
// changeEncryptionAlgorithm(val) {
|
||||||
|
// // 非RSA,清空公钥
|
||||||
|
// if (val === 'RSA') {
|
||||||
|
// this.form.publicKey = null;
|
||||||
|
// };
|
||||||
|
// },
|
||||||
|
// /** 提交按钮 */
|
||||||
|
// submitForm() {
|
||||||
|
// console.log(this.form)
|
||||||
|
// // return;
|
||||||
|
// this.$refs["form"].validate(valid => {
|
||||||
|
// if (valid) {
|
||||||
|
// if (this.form.id != null) {
|
||||||
|
// let data = Object.assign({},this.form)
|
||||||
|
// delete data.explain
|
||||||
|
// updateStrategy(data).then(response => {
|
||||||
|
// this.$modal.msgSuccess("修改成功");
|
||||||
|
// this.open = false;
|
||||||
|
// this.getList();
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// addStrategy(this.form).then(response => {
|
||||||
|
// this.$modal.msgSuccess("新增成功");
|
||||||
|
// this.open = false;
|
||||||
|
// this.getList();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// },
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row?.id || this.ids;
|
||||||
this.$modal.confirm('是否确认删除策略管理编号为"' + ids + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除策略管理编号为"' + ids + '"的数据项?').then(function() {
|
||||||
return delStrategy(ids);
|
return delStrategy(ids);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
@ -106,8 +106,12 @@ export default {
|
|||||||
return this.$store.state.permission.addRoutes;
|
return this.$store.state.permission.addRoutes;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
async created() {
|
||||||
this.$store.dispatch('app/toggleSideBarHide', true);
|
this.$store.dispatch('app/toggleSideBarHide', true);
|
||||||
|
// if (this.routes.length === 0) {
|
||||||
|
// let routes = await this.$store.dispatch('GenerateRoutes');
|
||||||
|
// this.$router.addRoutes(routes)
|
||||||
|
// }
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -120,7 +124,6 @@ export default {
|
|||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getListApi(this.queryParams).then(response => {
|
getListApi(this.queryParams).then(response => {
|
||||||
console.log(response)
|
|
||||||
this.list = response.rows;
|
this.list = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
@ -161,7 +161,7 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-image: url("../assets/images/login-background.jpg");
|
background-image: url("../assets/images/login-background.png");
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
.title {
|
.title {
|
||||||
|
266
sf-ui/src/views/mandate/appMandate/index.vue
Normal file
266
sf-ui/src/views/mandate/appMandate/index.vue
Normal file
@ -0,0 +1,266 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="用户名" prop="userName">
|
||||||
|
<el-input v-model="queryParams.userName" placeholder="请输入用户名" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||||
|
v-hasPermi="['mandate:appMandate:add']"
|
||||||
|
:disabled="Cookies.get('Admin-isAdmin') == 1 ? false : true">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="el-icon-delete" size="mini"
|
||||||
|
:disabled="multiple && Cookies.get('Admin-isAdmin') == 1 ? false : true" @click="handleDelete"
|
||||||
|
v-hasPermi="['mandate:appMandate:remove']">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
<el-table v-loading="loading" :data="appMandateList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="用户名" align="center" prop="userName" />
|
||||||
|
<el-table-column label="是否为管理员" align="center" prop="isAdmin">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-switch :disabled="Cookies.get('Admin-isAdmin') == 1 ? false : true" :value="scope.row.isAdmin"
|
||||||
|
@change="isAdminChange(scope.row)" :active-value="1" :inactive-value="0" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-button :disabled="Cookies.get('Admin-isAdmin') == 1 ? false : true" size="mini" type="text"
|
||||||
|
icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['mandate:appMandate:remove']">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 添加或修改应用授权对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="650px" append-to-body>
|
||||||
|
<el-transfer :titles="['可选用户', '选中用户']" v-model="value" :data="columns" @change="dataChange"></el-transfer>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listAppMandate, delAppMandate, addAppMandateList, updateAppMandate, appMandateUser } from "@/api/mandate/appMandate";
|
||||||
|
import { listUser } from "@/api/system/user";
|
||||||
|
import Cookies from 'js-cookie'
|
||||||
|
export default {
|
||||||
|
name: "AppMandate",
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
Cookies: Cookies,
|
||||||
|
columns: [],
|
||||||
|
value: [],
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 应用授权表格数据
|
||||||
|
appMandateList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
userName: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
userName: [
|
||||||
|
{ required: true, message: "用户名不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询应用授权列表 */
|
||||||
|
getList () {
|
||||||
|
this.loading = true;
|
||||||
|
listAppMandate(this.queryParams).then(response => {
|
||||||
|
this.appMandateList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getUserList () {
|
||||||
|
this.loading = true;
|
||||||
|
appMandateUser().then(res => {
|
||||||
|
const arr1 = JSON.parse(JSON.stringify(res.rows));
|
||||||
|
const arr2 = JSON.parse(JSON.stringify(this.appMandateList))
|
||||||
|
const mergedArr = [...arr1, ...arr2];
|
||||||
|
const userIdCounts = new Map();
|
||||||
|
mergedArr.forEach(item => {
|
||||||
|
if (!userIdCounts.has(item.userId)) {
|
||||||
|
userIdCounts.set(item.userId, 1);
|
||||||
|
} else {
|
||||||
|
userIdCounts.set(item.userId, userIdCounts.get(item.userId) + 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const uniqueItems = mergedArr.filter(item => userIdCounts.get(item.userId) === 1);
|
||||||
|
for (var i in uniqueItems) {
|
||||||
|
uniqueItems[i].key = i
|
||||||
|
uniqueItems[i].label = uniqueItems[i].userName
|
||||||
|
}
|
||||||
|
this.columns = uniqueItems;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
dataChange () {
|
||||||
|
},
|
||||||
|
|
||||||
|
removeDuplicateValues (arrays) {
|
||||||
|
// 展平多维数组
|
||||||
|
const flatArray = arrays.flat();
|
||||||
|
|
||||||
|
// 使用Map存储元素及其出现次数
|
||||||
|
const elementMap = new Map();
|
||||||
|
|
||||||
|
// 遍历数组,将元素作为键,出现次数作为值
|
||||||
|
for (const item of flatArray) {
|
||||||
|
elementMap.set(item, (elementMap.get(item.userId) || 0) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提取只出现一次的元素
|
||||||
|
const uniqueElements = Array.from(elementMap.entries())
|
||||||
|
.filter(([value, count]) => count === 1)
|
||||||
|
.map(([value, _]) => value);
|
||||||
|
|
||||||
|
return uniqueElements;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 取消按钮
|
||||||
|
cancel () {
|
||||||
|
this.open = false;
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery () {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery () {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange (selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd () {
|
||||||
|
this.open = true;
|
||||||
|
this.getUserList();
|
||||||
|
this.title = "添加应用授权";
|
||||||
|
this.value = [];
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm () {
|
||||||
|
const group = [];
|
||||||
|
for (var j in this.value) {
|
||||||
|
group.push({
|
||||||
|
userName: this.columns[this.value[j]].userName,
|
||||||
|
userId: this.columns[this.value[j]].userId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
addAppMandateList(group).then(res => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete (row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除应用授权编号为"' + ids + '"的数据项?').then(function () {
|
||||||
|
return delAppMandate(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => { });
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
isAdminChange (row) {
|
||||||
|
if (row.isAdmin == 0) {
|
||||||
|
this.$confirm('是否将该用户设置为管理员', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
updateAppMandate({
|
||||||
|
isAdmin: 1,
|
||||||
|
id: row.id
|
||||||
|
}).then(res => {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '设置成功!'
|
||||||
|
});
|
||||||
|
this.getList();
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$confirm("是否撤销该用户的管理员权限", '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
updateAppMandate({
|
||||||
|
isAdmin: 0,
|
||||||
|
id: row.id
|
||||||
|
}).then(res => {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '设置成功!'
|
||||||
|
});
|
||||||
|
this.getList();
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -8,35 +8,20 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<el-input
|
<el-input v-model="registerForm.password" type="password" auto-complete="off" placeholder="密码"
|
||||||
v-model="registerForm.password"
|
@keyup.enter.native="handleRegister">
|
||||||
type="password"
|
|
||||||
auto-complete="off"
|
|
||||||
placeholder="密码"
|
|
||||||
@keyup.enter.native="handleRegister"
|
|
||||||
>
|
|
||||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="confirmPassword">
|
<el-form-item prop="confirmPassword">
|
||||||
<el-input
|
<el-input v-model="registerForm.confirmPassword" type="password" auto-complete="off" placeholder="确认密码"
|
||||||
v-model="registerForm.confirmPassword"
|
@keyup.enter.native="handleRegister">
|
||||||
type="password"
|
|
||||||
auto-complete="off"
|
|
||||||
placeholder="确认密码"
|
|
||||||
@keyup.enter.native="handleRegister"
|
|
||||||
>
|
|
||||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="code" v-if="captchaEnabled">
|
<el-form-item prop="code" v-if="captchaEnabled">
|
||||||
<el-input
|
<el-input v-model="registerForm.code" auto-complete="off" placeholder="验证码" style="width: 63%"
|
||||||
v-model="registerForm.code"
|
@keyup.enter.native="handleRegister">
|
||||||
auto-complete="off"
|
|
||||||
placeholder="验证码"
|
|
||||||
style="width: 63%"
|
|
||||||
@keyup.enter.native="handleRegister"
|
|
||||||
>
|
|
||||||
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
|
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
|
||||||
</el-input>
|
</el-input>
|
||||||
<div class="register-code">
|
<div class="register-code">
|
||||||
@ -44,13 +29,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="width:100%;">
|
<el-form-item style="width:100%;">
|
||||||
<el-button
|
<el-button :loading="loading" size="medium" type="primary" style="width:100%;"
|
||||||
:loading="loading"
|
@click.native.prevent="handleRegister">
|
||||||
size="medium"
|
|
||||||
type="primary"
|
|
||||||
style="width:100%;"
|
|
||||||
@click.native.prevent="handleRegister"
|
|
||||||
>
|
|
||||||
<span v-if="!loading">注 册</span>
|
<span v-if="!loading">注 册</span>
|
||||||
<span v-else>注 册 中...</span>
|
<span v-else>注 册 中...</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -151,9 +131,10 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-image: url("../assets/images/login-background.jpg");
|
background-image: url("../assets/images/login-background.png");
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
margin: 0px auto 30px auto;
|
margin: 0px auto 30px auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -165,32 +146,39 @@ export default {
|
|||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
padding: 25px 25px 5px 25px;
|
padding: 25px 25px 5px 25px;
|
||||||
|
|
||||||
.el-input {
|
.el-input {
|
||||||
height: 38px;
|
height: 38px;
|
||||||
|
|
||||||
input {
|
input {
|
||||||
height: 38px;
|
height: 38px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-icon {
|
.input-icon {
|
||||||
height: 39px;
|
height: 39px;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-tip {
|
.register-tip {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #bfbfbf;
|
color: #bfbfbf;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-code {
|
.register-code {
|
||||||
width: 33%;
|
width: 33%;
|
||||||
height: 38px;
|
height: 38px;
|
||||||
float: right;
|
float: right;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-register-footer {
|
.el-register-footer {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
@ -203,6 +191,7 @@ export default {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-code-img {
|
.register-code-img {
|
||||||
height: 38px;
|
height: 38px;
|
||||||
}
|
}
|
||||||
|
@ -1,216 +1,122 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="商品编号" prop="goodsCode">
|
<el-form-item label="商品编号" prop="goodsCode">
|
||||||
<el-input
|
<el-input v-model="queryParams.goodsCode" placeholder="请输入商品编号" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.goodsCode"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入商品编号"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="审核状态" prop="reviewStatus">
|
<el-form-item label="审核状态" prop="reviewStatus">
|
||||||
<el-select v-model="queryParams.reviewStatus" clearable placeholder="请选择审核状态">
|
<el-select v-model="queryParams.reviewStatus" placeholder="请选择审核状态" clearable>
|
||||||
<el-option
|
<el-option v-for="dict in dict.type.goods_review_status" :key="dict.value" :label="dict.label"
|
||||||
v-for="dict in dict.type.goods_review_status"
|
:value="dict.value" />
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品标题" prop="productTitle">
|
<el-form-item label="商品标题" prop="productTitle">
|
||||||
<el-input
|
<el-input v-model="queryParams.productTitle" placeholder="请输入商品标题" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.productTitle"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入商品标题"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品原价" prop="originalPrice">
|
<el-form-item label="商品原价" prop="originalPrice">
|
||||||
<el-input
|
<el-input v-model="queryParams.originalPrice" placeholder="请输入商品原价" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.originalPrice"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入商品原价"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品类型" prop="goodsType">
|
<el-form-item label="商品类型" prop="goodsType">
|
||||||
<el-select v-model="queryParams.goodsType" clearable placeholder="请选择商品类型">
|
<el-select v-model="queryParams.goodsType" placeholder="请选择商品类型" clearable>
|
||||||
<el-option
|
<el-option v-for="dict in dict.type.goods_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
v-for="dict in dict.type.goods_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品规格" prop="goodsSpec">
|
<el-form-item label="商品规格" prop="goodsSpec">
|
||||||
<el-input
|
<el-input v-model="queryParams.goodsSpec" placeholder="请输入商品规格" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.goodsSpec"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入商品规格"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品型号" prop="goodsModel">
|
<el-form-item label="商品型号" prop="goodsModel">
|
||||||
<el-input
|
<el-input v-model="queryParams.goodsModel" placeholder="请输入商品型号" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.goodsModel"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入商品型号"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||||
v-hasPermi="['service:goods:add']"
|
v-hasPermi="['service:goods:add']">新增</el-button>
|
||||||
icon="el-icon-plus"
|
|
||||||
plain
|
|
||||||
size="mini"
|
|
||||||
type="primary"
|
|
||||||
@click="handleAdd"
|
|
||||||
>新增
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||||
v-hasPermi="['service:goods:edit']"
|
v-hasPermi="['service:goods:edit']">修改</el-button>
|
||||||
:disabled="single"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
plain
|
|
||||||
size="mini"
|
|
||||||
type="success"
|
|
||||||
@click="handleUpdate"
|
|
||||||
>修改
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||||
v-hasPermi="['service:goods:remove']"
|
v-hasPermi="['service:goods:remove']">删除</el-button>
|
||||||
:disabled="multiple"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
plain
|
|
||||||
size="mini"
|
|
||||||
type="danger"
|
|
||||||
@click="handleDelete"
|
|
||||||
>删除
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||||
v-hasPermi="['service:goods:export']"
|
v-hasPermi="['service:goods:export']">导出</el-button>
|
||||||
icon="el-icon-download"
|
|
||||||
plain
|
|
||||||
size="mini"
|
|
||||||
type="warning"
|
|
||||||
@click="handleExport"
|
|
||||||
>导出
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="goodsList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="goodsList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column align="center" type="selection" width="55"/>
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column align="center" label="主键" prop="id"/>
|
<el-table-column label="商品编号" align="center" prop="goodsCode" />
|
||||||
<el-table-column align="center" label="商品编号" prop="goodsCode"/>
|
<el-table-column label="审核状态" align="center" prop="reviewStatus">
|
||||||
<el-table-column align="center" label="审核状态" prop="reviewStatus">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.goods_review_status" :value="scope.row.reviewStatus" />
|
<dict-tag :options="dict.type.goods_review_status" :value="scope.row.reviewStatus" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="商品标题" prop="productTitle"/>
|
<el-table-column label="商品标题" align="center" prop="productTitle" />
|
||||||
<el-table-column align="center" label="商品图片" prop="productPicture" width="100">
|
<el-table-column label="商品图片" align="center" prop="productPicture" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<image-preview :height="50" :src="scope.row.productPicture" :width="50"/>
|
<image-preview :src="scope.row.productPicture" :width="50" :height="50" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="商品原价" prop="originalPrice">
|
<el-table-column label="商品原价" align="center" prop="originalPrice" />
|
||||||
<template slot-scope="scope">
|
<el-table-column label="商品描述" align="center" prop="productDesc" />
|
||||||
<span>{{ scope.row.originalPrice / 100 }}</span>
|
<el-table-column label="商品类型" align="center" prop="goodsType">
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="商品描述" prop="productDesc"/>
|
|
||||||
<el-table-column align="center" label="商品类型" prop="goodsType">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.goods_type" :value="scope.row.goodsType" />
|
<dict-tag :options="dict.type.goods_type" :value="scope.row.goodsType" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="商品规格" prop="goodsSpec"/>
|
<el-table-column label="商品规格" align="center" prop="goodsSpec" />
|
||||||
<el-table-column align="center" label="商品型号" prop="goodsModel"/>
|
<el-table-column label="商品型号" align="center" prop="goodsModel" />
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['service:goods:edit']"
|
v-hasPermi="['service:goods:edit']">修改</el-button>
|
||||||
icon="el-icon-edit"
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||||
size="mini"
|
v-hasPermi="['service:goods:remove']">删除</el-button>
|
||||||
type="text"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
>修改
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-hasPermi="['service:goods:remove']"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
>删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||||
v-show="total>0"
|
@pagination="getList" />
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改商品信息对话框 -->
|
<!-- 添加或修改商品信息对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="商品编号" prop="goodsCode">
|
<el-form-item label="商品编号" prop="goodsCode">
|
||||||
<el-input v-model="form.goodsCode" placeholder="请输入商品编号" />
|
<el-input v-model="form.goodsCode" placeholder="请输入商品编号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="审核状态" prop="reviewStatus">
|
<el-form-item label="审核状态" prop="reviewStatus">
|
||||||
<el-radio-group v-model="form.reviewStatus">
|
<el-radio-group v-model="form.reviewStatus">
|
||||||
<el-radio
|
<el-radio v-for="dict in dict.type.goods_review_status" :key="dict.value"
|
||||||
v-for="dict in dict.type.goods_review_status"
|
:label="parseInt(dict.value)">{{ dict.label }}</el-radio>
|
||||||
:key="dict.value"
|
|
||||||
:label="parseInt(dict.value)"
|
|
||||||
>{{ dict.label }}
|
|
||||||
</el-radio>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品标题" prop="productTitle">
|
<el-form-item label="商品标题" prop="productTitle">
|
||||||
<el-input v-model="form.productTitle" placeholder="请输入商品标题" />
|
<el-input v-model="form.productTitle" placeholder="请输入商品标题" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品图片" prop="productPicture">
|
<el-form-item label="商品图片" prop="productPicture">
|
||||||
<image-upload v-model="form.productPicture" :limit="1"/>
|
<image-upload v-model="form.productPicture" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品原价" prop="originalPrice">
|
<el-form-item label="商品原价" prop="originalPrice">
|
||||||
<el-input v-model="form.originalPrice" placeholder="请输入商品原价" />
|
<el-input v-model="form.originalPrice" placeholder="请输入商品原价" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品描述" prop="productDesc">
|
<el-form-item label="商品描述" prop="productDesc">
|
||||||
<el-input v-model="form.productDesc" placeholder="请输入内容" type="textarea"/>
|
<el-input v-model="form.productDesc" type="textarea" placeholder="请输入内容" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品类型" prop="goodsType">
|
<el-form-item label="商品类型" prop="goodsType">
|
||||||
<el-radio-group v-model="form.goodsType">
|
<el-radio-group v-model="form.goodsType">
|
||||||
<el-radio
|
<el-radio v-for="dict in dict.type.goods_type" :key="dict.value"
|
||||||
v-for="dict in dict.type.goods_type"
|
:label="parseInt(dict.value)">{{ dict.label }}</el-radio>
|
||||||
:key="dict.value"
|
|
||||||
:label="parseInt(dict.value)"
|
|
||||||
>{{ dict.label }}
|
|
||||||
</el-radio>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品规格" prop="goodsSpec">
|
<el-form-item label="商品规格" prop="goodsSpec">
|
||||||
@ -232,10 +138,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { addGoods, delGoods, getGoods, listGoods, updateGoods } from '@/api/service/goods'
|
import { listGoods, getGoods, delGoods, addGoods, updateGoods } from "@/api/service/goods";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Goods',
|
name: "Goods",
|
||||||
dicts: ['goods_review_status', 'goods_type'],
|
dicts: ['goods_review_status', 'goods_type'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
@ -254,7 +160,7 @@ export default {
|
|||||||
// 商品信息表格数据
|
// 商品信息表格数据
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: '',
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
@ -274,49 +180,49 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
goodsCode: [
|
goodsCode: [
|
||||||
{ required: true, message: '商品编号不能为空', trigger: 'blur' }
|
{ required: true, message: "商品编号不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
reviewStatus: [
|
reviewStatus: [
|
||||||
{ required: true, message: '审核状态不能为空', trigger: 'change' }
|
{ required: true, message: "审核状态不能为空", trigger: "change" }
|
||||||
],
|
],
|
||||||
productTitle: [
|
productTitle: [
|
||||||
{ required: true, message: '商品标题不能为空', trigger: 'blur' }
|
{ required: true, message: "商品标题不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
productPicture: [
|
productPicture: [
|
||||||
{ required: true, message: '商品图片不能为空', trigger: 'blur' }
|
{ required: true, message: "商品图片不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
originalPrice: [
|
originalPrice: [
|
||||||
{ required: true, message: '商品原价不能为空', trigger: 'blur' }
|
{ required: true, message: "商品原价不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
goodsType: [
|
goodsType: [
|
||||||
{ required: true, message: '商品类型不能为空', trigger: 'change' }
|
{ required: true, message: "商品类型不能为空", trigger: "change" }
|
||||||
],
|
],
|
||||||
goodsSpec: [
|
goodsSpec: [
|
||||||
{ required: true, message: '商品规格不能为空', trigger: 'blur' }
|
{ required: true, message: "商品规格不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
goodsModel: [
|
goodsModel: [
|
||||||
{ required: true, message: '商品型号不能为空', trigger: 'blur' }
|
{ required: true, message: "商品型号不能为空", trigger: "blur" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询商品信息列表 */
|
/** 查询商品信息列表 */
|
||||||
getList () {
|
getList () {
|
||||||
this.loading = true
|
this.loading = true;
|
||||||
listGoods(this.queryParams).then(response => {
|
listGoods(this.queryParams).then(response => {
|
||||||
this.goodsList = response.rows
|
this.goodsList = response.rows;
|
||||||
this.total = response.total
|
this.total = response.total;
|
||||||
this.loading = false
|
this.loading = false;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel () {
|
cancel () {
|
||||||
this.open = false
|
this.open = false;
|
||||||
this.reset()
|
this.reset();
|
||||||
},
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset () {
|
reset () {
|
||||||
@ -339,18 +245,18 @@ export default {
|
|||||||
updateTime: null,
|
updateTime: null,
|
||||||
goodsName: null,
|
goodsName: null,
|
||||||
goodsModel: null
|
goodsModel: null
|
||||||
}
|
};
|
||||||
this.resetForm('form')
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery () {
|
handleQuery () {
|
||||||
this.queryParams.pageNum = 1
|
this.queryParams.pageNum = 1;
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery () {
|
resetQuery () {
|
||||||
this.resetForm('queryForm')
|
this.resetForm("queryForm");
|
||||||
this.handleQuery()
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange (selection) {
|
handleSelectionChange (selection) {
|
||||||
@ -360,52 +266,51 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd () {
|
handleAdd () {
|
||||||
this.reset()
|
this.reset();
|
||||||
this.open = true
|
this.open = true;
|
||||||
this.title = '添加商品信息'
|
this.title = "添加商品信息";
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate (row) {
|
handleUpdate (row) {
|
||||||
this.reset()
|
this.reset();
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids
|
||||||
getGoods(id).then(response => {
|
getGoods(id).then(response => {
|
||||||
this.form = response.data
|
this.form = response.data;
|
||||||
this.open = true
|
this.open = true;
|
||||||
this.title = '修改商品信息'
|
this.title = "修改商品信息";
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm () {
|
submitForm () {
|
||||||
this.$refs['form'].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
let data = Object.assign({}, this.form)
|
let data = Object.assign({}, this.form)
|
||||||
delete data.explain
|
delete data.explain
|
||||||
updateGoods(data).then(response => {
|
updateGoods(data).then(response => {
|
||||||
this.$modal.msgSuccess('修改成功')
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false
|
this.open = false;
|
||||||
this.getList()
|
this.getList();
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
addGoods(this.form).then(response => {
|
addGoods(this.form).then(response => {
|
||||||
this.$modal.msgSuccess('新增成功')
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false
|
this.open = false;
|
||||||
this.getList()
|
this.getList();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete (row) {
|
handleDelete (row) {
|
||||||
const ids = row.id || this.ids
|
const ids = row.id || this.ids;
|
||||||
this.$modal.confirm('是否确认删除商品信息编号为"' + ids + '"的数据项?').then(function () {
|
this.$modal.confirm('是否确认删除商品信息编号为"' + ids + '"的数据项?').then(function () {
|
||||||
return delGoods(ids)
|
return delGoods(ids);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList()
|
this.getList();
|
||||||
this.$modal.msgSuccess('删除成功')
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {
|
}).catch(() => { });
|
||||||
})
|
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport () {
|
handleExport () {
|
||||||
@ -414,5 +319,5 @@ export default {
|
|||||||
}, `goods_${new Date().getTime()}.xlsx`)
|
}, `goods_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -2,21 +2,12 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
||||||
<el-form-item label="菜单名称" prop="menuName">
|
<el-form-item label="菜单名称" prop="menuName">
|
||||||
<el-input
|
<el-input v-model="queryParams.menuName" placeholder="请输入菜单名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.menuName"
|
|
||||||
placeholder="请输入菜单名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable>
|
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable>
|
||||||
<el-option
|
<el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label"
|
||||||
v-for="dict in dict.type.sys_normal_disable"
|
:value="dict.value" />
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@ -27,35 +18,17 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||||
type="primary"
|
v-hasPermi="['system:menu:add']">新增</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['system:menu:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">展开/折叠</el-button>
|
||||||
type="info"
|
|
||||||
plain
|
|
||||||
icon="el-icon-sort"
|
|
||||||
size="mini"
|
|
||||||
@click="toggleExpandAll"
|
|
||||||
>展开/折叠</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table
|
<el-table v-if="refreshTable" v-loading="loading" :data="menuList" row-key="menuId" :default-expand-all="isExpandAll"
|
||||||
v-if="refreshTable"
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||||
v-loading="loading"
|
|
||||||
:data="menuList"
|
|
||||||
row-key="menuId"
|
|
||||||
:default-expand-all="isExpandAll"
|
|
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
||||||
>
|
|
||||||
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
|
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
|
||||||
<el-table-column prop="icon" label="图标" align="center" width="100">
|
<el-table-column prop="icon" label="图标" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -77,27 +50,12 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||||
size="mini"
|
v-hasPermi="['system:menu:edit']">修改</el-button>
|
||||||
type="text"
|
<el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)"
|
||||||
icon="el-icon-edit"
|
v-hasPermi="['system:menu:add']">新增</el-button>
|
||||||
@click="handleUpdate(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['system:menu:edit']"
|
v-hasPermi="['system:menu:remove']">删除</el-button>
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
@click="handleAdd(scope.row)"
|
|
||||||
v-hasPermi="['system:menu:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['system:menu:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -108,13 +66,8 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="上级菜单" prop="parentId">
|
<el-form-item label="上级菜单" prop="parentId">
|
||||||
<treeselect
|
<treeselect v-model="form.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true"
|
||||||
v-model="form.parentId"
|
placeholder="选择上级菜单" />
|
||||||
:options="menuOptions"
|
|
||||||
:normalizer="normalizer"
|
|
||||||
:show-count="true"
|
|
||||||
placeholder="选择上级菜单"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
@ -128,20 +81,10 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" v-if="form.menuType != 'F'">
|
<el-col :span="24" v-if="form.menuType != 'F'">
|
||||||
<el-form-item label="菜单图标" prop="icon">
|
<el-form-item label="菜单图标" prop="icon">
|
||||||
<el-popover
|
<el-popover placement="bottom-start" width="460" trigger="hover" @show="$refs['iconSelect'].reset()">
|
||||||
placement="bottom-start"
|
|
||||||
width="460"
|
|
||||||
trigger="click"
|
|
||||||
@show="$refs['iconSelect'].reset()"
|
|
||||||
>
|
|
||||||
<IconSelect ref="iconSelect" @selected="selected" :active-icon="form.icon" />
|
<IconSelect ref="iconSelect" @selected="selected" :active-icon="form.icon" />
|
||||||
<el-input slot="reference" v-model="form.icon" placeholder="点击选择图标" readonly>
|
<el-input slot="reference" v-model="form.icon" placeholder="点击选择图标" readonly>
|
||||||
<svg-icon
|
<svg-icon v-if="form.icon" slot="prefix" :icon-class="form.icon" style="width: 25px;" />
|
||||||
v-if="form.icon"
|
|
||||||
slot="prefix"
|
|
||||||
:icon-class="form.icon"
|
|
||||||
style="width: 25px;"
|
|
||||||
/>
|
|
||||||
<i v-else slot="prefix" class="el-icon-search el-input__icon" />
|
<i v-else slot="prefix" class="el-icon-search el-input__icon" />
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
@ -238,11 +181,8 @@
|
|||||||
显示状态
|
显示状态
|
||||||
</span>
|
</span>
|
||||||
<el-radio-group v-model="form.visible">
|
<el-radio-group v-model="form.visible">
|
||||||
<el-radio
|
<el-radio v-for="dict in dict.type.sys_show_hide" :key="dict.value"
|
||||||
v-for="dict in dict.type.sys_show_hide"
|
:label="dict.value">{{ dict.label }}</el-radio>
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.value"
|
|
||||||
>{{dict.label}}</el-radio>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -255,11 +195,8 @@
|
|||||||
菜单状态
|
菜单状态
|
||||||
</span>
|
</span>
|
||||||
<el-radio-group v-model="form.status">
|
<el-radio-group v-model="form.status">
|
||||||
<el-radio
|
<el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value"
|
||||||
v-for="dict in dict.type.sys_normal_disable"
|
:label="dict.value">{{ dict.label }}</el-radio>
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.value"
|
|
||||||
>{{dict.label}}</el-radio>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -2,31 +2,14 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="表名称" prop="tableName">
|
<el-form-item label="表名称" prop="tableName">
|
||||||
<el-input
|
<el-input v-model="queryParams.tableName" placeholder="请输入表名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.tableName"
|
|
||||||
placeholder="请输入表名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="表描述" prop="tableComment">
|
<el-form-item label="表描述" prop="tableComment">
|
||||||
<el-input
|
<el-input v-model="queryParams.tableComment" placeholder="请输入表描述" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.tableComment"
|
|
||||||
placeholder="请输入表描述"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="创建时间">
|
<el-form-item label="创建时间">
|
||||||
<el-date-picker
|
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
|
||||||
v-model="dateRange"
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||||
style="width: 240px"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
type="daterange"
|
|
||||||
range-separator="-"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
></el-date-picker>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
@ -36,46 +19,20 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleGenTable"
|
||||||
type="primary"
|
v-hasPermi="['tool:gen:code']">生成</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleGenTable"
|
|
||||||
v-hasPermi="['tool:gen:code']"
|
|
||||||
>生成</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="info" plain icon="el-icon-upload" size="mini" @click="openImportTable"
|
||||||
type="info"
|
v-hasPermi="['tool:gen:import']">导入</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-upload"
|
|
||||||
size="mini"
|
|
||||||
@click="openImportTable"
|
|
||||||
v-hasPermi="['tool:gen:import']"
|
|
||||||
>导入</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleEditTable"
|
||||||
type="success"
|
v-hasPermi="['tool:gen:edit']">修改</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleEditTable"
|
|
||||||
v-hasPermi="['tool:gen:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||||
type="danger"
|
v-hasPermi="['tool:gen:remove']">删除</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['tool:gen:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -87,100 +44,40 @@
|
|||||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column label="表名称" align="center" prop="tableName" :show-overflow-tooltip="true" width="120" />
|
||||||
label="表名称"
|
<el-table-column label="表描述" align="center" prop="tableComment" :show-overflow-tooltip="true" width="120" />
|
||||||
align="center"
|
<el-table-column label="实体" align="center" prop="className" :show-overflow-tooltip="true" width="120" />
|
||||||
prop="tableName"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
width="120"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="表描述"
|
|
||||||
align="center"
|
|
||||||
prop="tableComment"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
width="120"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="实体"
|
|
||||||
align="center"
|
|
||||||
prop="className"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
width="120"
|
|
||||||
/>
|
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160" />
|
<el-table-column label="创建时间" align="center" prop="createTime" width="160" />
|
||||||
<el-table-column label="更新时间" align="center" prop="updateTime" width="160" />
|
<el-table-column label="更新时间" align="center" prop="updateTime" width="160" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button type="text" size="small" icon="el-icon-view" @click="handlePreview(scope.row, false)"
|
||||||
type="text"
|
v-hasPermi="['tool:gen:preview']">预览</el-button>
|
||||||
size="small"
|
<el-button type="text" size="small" icon="el-icon-view" @click="handlePreview(scope.row, true)"
|
||||||
icon="el-icon-view"
|
v-hasPermi="['tool:gen:preview']">预览JSON</el-button>
|
||||||
@click="handlePreview(scope.row, false)"
|
<el-button type="text" size="small" icon="el-icon-edit" @click="handleEditTable(scope.row)"
|
||||||
v-hasPermi="['tool:gen:preview']"
|
v-hasPermi="['tool:gen:edit']">编辑</el-button>
|
||||||
>预览</el-button>
|
<el-button type="text" size="small" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||||
<el-button
|
v-hasPermi="['tool:gen:remove']">删除</el-button>
|
||||||
type="text"
|
<el-button type="text" size="small" icon="el-icon-refresh" @click="handleSynchDb(scope.row)"
|
||||||
size="small"
|
v-hasPermi="['tool:gen:edit']">同步</el-button>
|
||||||
icon="el-icon-view"
|
<el-button type="text" size="small" icon="el-icon-download" @click="handleGenTable(scope.row, false)"
|
||||||
@click="handlePreview(scope.row,true)"
|
v-hasPermi="['tool:gen:code']">生成代码</el-button>
|
||||||
v-hasPermi="['tool:gen:preview']"
|
<el-button type="text" size="small" icon="el-icon-download" @click="handleGenTable(scope.row, true)"
|
||||||
>预览JSON</el-button>
|
v-hasPermi="['tool:gen:code']">生成JSON</el-button>
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleEditTable(scope.row)"
|
|
||||||
v-hasPermi="['tool:gen:edit']"
|
|
||||||
>编辑</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['tool:gen:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
icon="el-icon-refresh"
|
|
||||||
@click="handleSynchDb(scope.row)"
|
|
||||||
v-hasPermi="['tool:gen:edit']"
|
|
||||||
>同步</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
icon="el-icon-download"
|
|
||||||
@click="handleGenTable(scope.row,false)"
|
|
||||||
v-hasPermi="['tool:gen:code']"
|
|
||||||
>生成代码</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
icon="el-icon-download"
|
|
||||||
@click="handleGenTable(scope.row,true)"
|
|
||||||
v-hasPermi="['tool:gen:code']"
|
|
||||||
>生成JSON</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||||
v-show="total>0"
|
@pagination="getList" />
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<!-- 预览界面 -->
|
<!-- 预览界面 -->
|
||||||
<el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body class="scrollbar">
|
<el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body class="scrollbar">
|
||||||
<el-tabs v-model="preview.activeName">
|
<el-tabs v-model="preview.activeName">
|
||||||
<el-tab-pane
|
<el-tab-pane v-for="(value, key) in preview.data"
|
||||||
v-for="(value, key) in preview.data"
|
|
||||||
:label="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))"
|
:label="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))"
|
||||||
:name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
|
:name="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))" :key="key">
|
||||||
:key="key"
|
<el-link :underline="false" icon="el-icon-document-copy" v-clipboard:copy="value"
|
||||||
>
|
v-clipboard:success="clipboardSuccess" style="float:right">复制</el-link>
|
||||||
<el-link :underline="false" icon="el-icon-document-copy" v-clipboard:copy="value" v-clipboard:success="clipboardSuccess" style="float:right">复制</el-link>
|
|
||||||
<pre><code class="hljs" v-html="highlightedCode(value, key)"></code></pre>
|
<pre><code class="hljs" v-html="highlightedCode(value, key)"></code></pre>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
@ -35,7 +35,8 @@ module.exports = {
|
|||||||
proxy: {
|
proxy: {
|
||||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
target: `http://192.168.1.23:22009`,
|
// target: `http://192.168.1.23:22009`,
|
||||||
|
target: `/`,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM docker.yzj/library/maven:latest AS builder
|
FROM 192.168.5.120:5000/library/maven:latest AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<vertx.version>4.5.7</vertx.version>
|
<vertx.version>4.5.7</vertx.version>
|
||||||
<hystrix.version>1.5.2</hystrix.version>
|
<hystrix.version>1.5.2</hystrix.version>
|
||||||
<resilience4j.version>2.2.0</resilience4j.version>
|
<resilience4j.version>1.7.0</resilience4j.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
@ -8,8 +8,9 @@ import com.sf.vertx.exception.ServiceException;
|
|||||||
import com.sf.vertx.pojo.SacCurrentLimiting;
|
import com.sf.vertx.pojo.SacCurrentLimiting;
|
||||||
import com.sf.vertx.utils.AppUtils;
|
import com.sf.vertx.utils.AppUtils;
|
||||||
|
|
||||||
import io.github.resilience4j.core.functions.CheckedRunnable;
|
//import io.github.resilience4j.core.functions.CheckedRunnable;
|
||||||
import io.github.resilience4j.ratelimiter.RateLimiter;
|
import io.github.resilience4j.ratelimiter.RateLimiter;
|
||||||
|
import io.vavr.CheckedRunnable;
|
||||||
import io.vertx.ext.web.RoutingContext;
|
import io.vertx.ext.web.RoutingContext;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@ -6,8 +6,9 @@ import com.sf.vertx.exception.ServiceException;
|
|||||||
import com.sf.vertx.pojo.SacCurrentLimiting;
|
import com.sf.vertx.pojo.SacCurrentLimiting;
|
||||||
import com.sf.vertx.utils.AppUtils;
|
import com.sf.vertx.utils.AppUtils;
|
||||||
|
|
||||||
import io.github.resilience4j.core.functions.CheckedRunnable;
|
//import io.github.resilience4j.core.functions.CheckedRunnable;
|
||||||
import io.github.resilience4j.ratelimiter.RateLimiter;
|
import io.github.resilience4j.ratelimiter.RateLimiter;
|
||||||
|
import io.vavr.CheckedRunnable;
|
||||||
import io.vertx.ext.web.RoutingContext;
|
import io.vertx.ext.web.RoutingContext;
|
||||||
import io.vertx.ext.web.handler.HttpException;
|
import io.vertx.ext.web.handler.HttpException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<vertx.version>4.5.7</vertx.version>
|
<vertx.version>4.5.7</vertx.version>
|
||||||
<hystrix.version>1.5.2</hystrix.version>
|
<hystrix.version>1.5.2</hystrix.version>
|
||||||
<resilience4j.version>2.2.0</resilience4j.version>
|
<resilience4j.version>1.7.0</resilience4j.version>
|
||||||
<fastjson.version>2.0.34</fastjson.version>
|
<fastjson.version>2.0.34</fastjson.version>
|
||||||
<commons.collections.version>3.2.2</commons.collections.version>
|
<commons.collections.version>3.2.2</commons.collections.version>
|
||||||
<hutool.version>5.8.22</hutool.version>
|
<hutool.version>5.8.22</hutool.version>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user