review code.

This commit is contained in:
lijiahang
2022-05-30 16:06:51 +08:00
parent 1ebd9fa7d1
commit 07099476b8
7 changed files with 135 additions and 36 deletions
@@ -38,7 +38,6 @@ export default {
},
methods: {
open() {
this.exportPassword = false
this.protectPassword = undefined
this.loading = false
this.visible = true
@@ -38,7 +38,6 @@ export default {
},
methods: {
open() {
this.exportPassword = false
this.protectPassword = undefined
this.loading = false
this.visible = true
@@ -1,5 +1,9 @@
<template>
<a-select v-model="id" @change="$emit('change', id)" placeholder="全部" allowClear>
<a-select v-model="id"
@change="$emit('change', id)"
placeholder="全部"
:disabled="disabled"
allowClear>
<a-select-option v-for="user in userList"
:value="user.id"
:key="user.id">
@@ -11,6 +15,12 @@
<script>
export default {
name: 'UserSelector',
props: {
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
id: undefined,
+16
View File
@@ -45,6 +45,14 @@
margin-top: 8px !important;
}
.mt8 {
margin-top: 8px !important;
}
.mb8 {
margin-bottom: 8px !important;
}
.mx8 {
margin: 0 8px !important;
}
@@ -66,6 +74,14 @@
margin: 0 16px !important;
}
.mt16 {
margin-top: 16px !important;
}
.mb16 {
margin-bottom: 16px !important;
}
.p0 {
padding: 0 !important;
}
+49 -27
View File
@@ -2183,48 +2183,70 @@ const $api = {
* 导出机器信息
*/
exportMachine: param => {
return $http.$post('/data-export/machine', param, {
skipRespInterceptor: true,
responseType: 'blob',
timeout: 600000,
loading: '正在导出请耐心等待...'
})
return $http.$export('/data-export/machine', param)
},
/**
* 导出机器信息
* 导出机器代理
*/
exportMachineProxy: param => {
return $http.$export('/data-export/machine-proxy', param)
},
/**
* 导出机器终端日志
*/
exportMachineTerminalLog: param => {
return $http.$export('/data-export/machine-terminal-log', param)
},
/**
* 导出机器日志文件
*/
exportMachineTailFile: param => {
return $http.$export('/data-export/machine-tail-file', param)
},
/**
* 导出应用环境
*/
exportAppProfile: param => {
return $http.$post('/data-export/app-profile', param, {
skipRespInterceptor: true,
responseType: 'blob',
timeout: 600000,
loading: '正在导出请耐心等待...'
})
return $http.$export('/data-export/app-profile', param)
},
/**
* 导出机器信息
* 导出应用信息
*/
exportApplication: param => {
return $http.$post('/data-export/application', param, {
skipRespInterceptor: true,
responseType: 'blob',
timeout: 600000,
loading: '正在导出请耐心等待...'
})
return $http.$export('/data-export/application', param)
},
/**
* 导出机器信息
* 导出应用版本仓库
*/
exportAppVcs: param => {
return $http.$post('/data-export/app-vcs', param, {
skipRespInterceptor: true,
responseType: 'blob',
timeout: 600000,
loading: '正在导出请耐心等待...'
})
return $http.$export('/data-export/app-vcs', param)
},
/**
* 导出命令模板
*/
exportCommandTemplate: param => {
return $http.$export('/data-export/command-template', param)
},
/**
* 导出站内信
*/
exportWebSideMessage: param => {
return $http.$export('/data-export/web-side-message', param)
},
/**
* 导出操作日志
*/
exportEventLog: param => {
return $http.$export('/data-export/event-log', param)
},
/**
+41 -5
View File
@@ -1366,7 +1366,7 @@ const $enum = {
},
CANCEL_TIMED_RELEASE: {
value: 5040,
label: '取消发布'
label: '取消定时发布'
},
SET_TIMED_RELEASE: {
value: 5045,
@@ -1569,8 +1569,8 @@ const $enum = {
label: '数据导入',
type: {
DATA_IMPORT_MACHINE: {
value: 8205,
label: '导入机器'
value: 8305,
label: '机器信息'
}
}
},
@@ -1579,8 +1579,44 @@ const $enum = {
label: '数据导出',
type: {
DATA_EXPORT_MACHINE: {
value: 8305,
label: '导出机器'
value: 8505,
label: '机器信息'
},
DATA_EXPORT_MACHINE_PROXY: {
value: 8510,
label: '机器代理'
},
DATA_EXPORT_MACHINE_TERMINAL_LOG: {
value: 8515,
label: '终端日志'
},
DATA_EXPORT_MACHINE_TAIL_FILE: {
value: 8520,
label: '日志文件'
},
DATA_EXPORT_APP_PROFILE: {
value: 8550,
label: '应用环境'
},
DATA_EXPORT_APPLICATION: {
value: 8555,
label: '应用信息'
},
DATA_EXPORT_APP_VCS: {
value: 8560,
label: '应用仓库'
},
DATA_EXPORT_COMMAND_TEMPLATE: {
value: 8605,
label: '命令模板'
},
DATA_EXPORT_WEB_SIDE_MESSAGE: {
value: 8610,
label: '站内信'
},
DATA_EXPORT_EVENT_LOG: {
value: 8615,
label: '操作日志'
}
}
}
+18 -1
View File
@@ -61,6 +61,22 @@ const $fetch = (url, method = 'get', config) => {
})
}
/**
* 导出请求
*/
const $export = (url, data, config) => {
return new Promise((resolve, reject) => {
$http.post(url, data, fillDefaultConfig({
skipRespInterceptor: true,
responseType: 'blob',
timeout: 600000,
loading: '正在导出请耐心等待...',
...config
})).then(res => resolve(res))
.catch(err => reject(err))
})
}
/**
* 填充默认配置
*/
@@ -105,7 +121,7 @@ $http.interceptors.response.use(
resp.config.loadingKey && resp.config.loadingKey()
// 跳过响应拦截器
if (resp.config.skipRespInterceptor) {
return resp.data
return resp
}
const skipErrorMessage = resp.config.skipErrorMessage
// 判断data
@@ -226,6 +242,7 @@ export default {
$get,
$post,
$fetch,
$export,
BASE_URL: process.env.VUE_APP_BASE_URI,
BASE_HOST: process.env.VUE_APP_BASE_HOST
}