parent
74831eb690
commit
72818d64d3
15 changed files with 1066 additions and 1058 deletions
@ -0,0 +1,26 @@ |
||||
import request from '@/router/axios'; |
||||
const prefix = '/api/blade-workflow/database' |
||||
// 查询
|
||||
export const getList = (query) => { |
||||
return request({ |
||||
url: `${prefix}/list`, |
||||
method: 'get', |
||||
params:query |
||||
}) |
||||
} |
||||
// 下载模板
|
||||
export const dowmLoadTemplate = () => { |
||||
return request({ |
||||
url: `${prefix}/exportTemplate`, |
||||
method: 'get', |
||||
responseType: 'blob' |
||||
}) |
||||
} |
||||
|
||||
// 数据库类型
|
||||
export const getDatabaseType = () => { |
||||
return request({ |
||||
url: "/api/blade-system/dict-biz/dictionary?code=database_type", |
||||
method: "get", |
||||
}) |
||||
} |
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,93 @@ |
||||
export const tableOption = { |
||||
index: true, |
||||
indexLabel: "序号", |
||||
indexWidth: 120, |
||||
labelPosition: "top", |
||||
selection: false, |
||||
border: false, |
||||
headerAlign: "left", |
||||
align: "left", |
||||
menuAlign: "left", |
||||
menuHeaderAlign: "left", |
||||
menuBtn: true, |
||||
editBtn: false, |
||||
delBtn: false, |
||||
addBtn: false, |
||||
tip: false, |
||||
searchMenuSpan: 3, //控制搜索按钮
|
||||
columnBtn: false, |
||||
refreshBtn: false, |
||||
header: false, |
||||
menuWidth: 220, |
||||
dialogCustomClass: "custom", |
||||
menu: false, |
||||
column: [ |
||||
|
||||
{ |
||||
label: "IP地址", |
||||
prop: "dataBaseIp", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
{ |
||||
label: "端口号", |
||||
prop: "dataBasePort", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
{ |
||||
label: "数据库实例", |
||||
prop: "dataBaseName", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
{ |
||||
label: "数据库类型", |
||||
prop: "dataBaseType", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
{ |
||||
label: "数据库中文名", |
||||
prop: "dataBaseAlias", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
{ |
||||
label: "系统名称", |
||||
prop: "systemName", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
{ |
||||
label: "模块名称", |
||||
prop: "systemModuleName", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
{ |
||||
label: "管理部门", |
||||
prop: "deptName", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
{ |
||||
label: "运维公司", |
||||
prop: "companyName", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
{ |
||||
label: "表名", |
||||
prop: "dataTableName", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
{ |
||||
label: "中文表别名", |
||||
prop: "dataTableAlias", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
], |
||||
}; |
||||
@ -1,114 +0,0 @@ |
||||
<template> |
||||
<div class="cus-container"> |
||||
<div class="content"> |
||||
<div class="main"> |
||||
<div class="item" v-for="(item, index) in menuList" :key="index"> |
||||
<div class="item-top"> |
||||
<div> |
||||
<div class="title">{{ item.title }}</div> |
||||
<div class="subTitle">{{ item.subTitle }}</div> |
||||
</div> |
||||
<div class="item-top-right"> |
||||
<img :src="require(`@/assets/img/gdwel/${item.id}.png`)" alt="" /> |
||||
</div> |
||||
</div> |
||||
<div class="btn" @click="createNow(item.id)">立即创建</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data() { |
||||
return { |
||||
menuList: [ |
||||
{ |
||||
id: 1, |
||||
title: "数据管理", |
||||
subTitle: "日常数据管理维护工作", |
||||
}, |
||||
{ |
||||
id: 2, |
||||
title: "网络终端维护", |
||||
subTitle: "网络终端设备的日常维护工作", |
||||
}, |
||||
{ |
||||
id: 3, |
||||
title: "办公系统维护", |
||||
subTitle: "日常办公系统软件维护工作", |
||||
}, |
||||
{ |
||||
id: 4, |
||||
title: "系统优化", |
||||
subTitle: "日常优化系统相关工作任务", |
||||
}, |
||||
{ |
||||
id: 5, |
||||
title: "网站维护", |
||||
subTitle: "网站网页维护相关工作", |
||||
}, |
||||
{ |
||||
id: 6, |
||||
title: "公众号APP维护", |
||||
subTitle: "移动端日常维护工作", |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
methods: { |
||||
createNow(index) {}, |
||||
}, |
||||
}; |
||||
</script> |
||||
<style scoped lang="scss"> |
||||
.content { |
||||
background: #fff; |
||||
height: 760px; |
||||
min-height: 760px; |
||||
padding: 50px; |
||||
box-sizing: border-box; |
||||
border-radius: 3px; |
||||
} |
||||
.main { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
.item { |
||||
padding: 32px 30px 26px 37px; |
||||
box-sizing: border-box; |
||||
width: 336px; |
||||
height: 184px; |
||||
border: 1px solid #cfcfcf; |
||||
margin-right: 50px; |
||||
margin-bottom: 50px; |
||||
.item-top { |
||||
margin-bottom: 34px; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
} |
||||
.title { |
||||
font-size: 20px; |
||||
color: #333333; |
||||
} |
||||
.subTitle { |
||||
margin-top: 10px; |
||||
color: #999999; |
||||
font-size: 14px; |
||||
} |
||||
.btn { |
||||
width: 117px; |
||||
height: 37px; |
||||
border-radius: 100px 100px 100px 100px; |
||||
border: 1px solid #cfcfcf; |
||||
font-size: 16px; |
||||
color: #666; |
||||
text-align: center; |
||||
line-height: 37px; |
||||
} |
||||
} |
||||
.item:nth-child(4) { |
||||
margin-right: 0; |
||||
} |
||||
} |
||||
</style> |
||||
@ -0,0 +1,241 @@ |
||||
<template> |
||||
<div class="cus-container"> |
||||
<el-form :model="searchForm"> |
||||
<div class="search"> |
||||
<div style="display: flex; align-items: center"> |
||||
<el-select |
||||
v-model="searchForm.projectInfoId" |
||||
placeholder="数据库实例名" |
||||
class="search-select" |
||||
> |
||||
<el-option |
||||
v-for="item in projectList" |
||||
:key="item.id" |
||||
:label="item.projectName" |
||||
:value="item.id" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
<el-select |
||||
v-model="searchForm.dataBaseType" |
||||
placeholder="数据库类型" |
||||
class="search-select" |
||||
> |
||||
<el-option |
||||
v-for="item in databaseTypeList" |
||||
:key="item.dictKey" |
||||
:label="item.dictValue" |
||||
:value="item.dictKey" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
<el-select |
||||
v-model="searchForm.manageDeptId" |
||||
placeholder="运维公司" |
||||
class="search-select" |
||||
> |
||||
<el-option |
||||
v-for="item in deptsList" |
||||
:key="item.id" |
||||
:label="item.fullName" |
||||
:value="item.id" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
<el-select |
||||
v-model="searchForm.maintenanceDeptId" |
||||
placeholder="管理部门" |
||||
class="search-select" |
||||
> |
||||
<el-option |
||||
v-for="item in usersList" |
||||
:key="item.id" |
||||
:label="item.name" |
||||
:value="item.id" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
<div style="display: flex"> |
||||
<el-button class="search-btn" @click="searchHandle(1)" |
||||
>查询</el-button |
||||
> |
||||
<div class="search-reset" @click="searchHandle(2)"> |
||||
<i class="el-icon-refresh-right" style="font-size: 20px"></i> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div style="display: flex"> |
||||
<el-button class="search-btn" @click="download">下载模板</el-button> |
||||
<el-upload |
||||
accept=".xls,.xlsx" |
||||
class="upload-demo" |
||||
:show-file-list="false" |
||||
:headers="headers" |
||||
action="/api/blade-workflow/database/dataImport" |
||||
:on-success="handleSuccess" |
||||
> |
||||
<el-button class="search-btn" style="margin: 0; background: #2ee27c" |
||||
>导入</el-button |
||||
> |
||||
</el-upload> |
||||
</div> |
||||
</div> |
||||
</el-form> |
||||
<div style="margin-top: 30px"> |
||||
<avue-crud |
||||
id="avue-id" |
||||
ref="crud" |
||||
v-model="form" |
||||
:option="option" |
||||
:data="tableData" |
||||
:page.sync="page" |
||||
:table-loading="loading" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
> |
||||
<template slot="dataBaseType" slot-scope="{ row }"> |
||||
{{ row.dataBaseType | dataBaseTypeFl }} |
||||
</template> |
||||
</avue-crud> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import { |
||||
getList, |
||||
dowmLoadTemplate, |
||||
getDatabaseType, |
||||
} from "@/api/maintenance/database.js"; |
||||
import { tableOption } from "@/const/maintenance/database.js"; |
||||
import { getToken } from "@/util/auth"; |
||||
let that; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
searchForm: {}, |
||||
option: tableOption, |
||||
page: { |
||||
current: 1, |
||||
total: 0, |
||||
size: 10, |
||||
}, |
||||
// 表格数据 |
||||
tableData: [], |
||||
loading: false, |
||||
// 图片 |
||||
headers: { |
||||
"Blade-Auth": "", |
||||
}, |
||||
databaseTypeList: [], |
||||
}; |
||||
}, |
||||
filters: { |
||||
dataBaseTypeFl: (data) => { |
||||
for (const i in that.databaseTypeList) { |
||||
const element = that.databaseTypeList[i]; |
||||
if (data == element.dictKey) { |
||||
return element.dictValue; |
||||
} |
||||
} |
||||
}, |
||||
}, |
||||
beforeCreate() { |
||||
that = this; |
||||
}, |
||||
created() { |
||||
this.dicBiz(); |
||||
this.onLoad(); |
||||
this.headers["Blade-Auth"] = "bearer " + getToken(); |
||||
}, |
||||
methods: { |
||||
dicBiz() { |
||||
getDatabaseType().then((res) => { |
||||
this.databaseTypeList = res.data.data; |
||||
}); |
||||
}, |
||||
// 列表 |
||||
onLoad() { |
||||
this.loading = true; |
||||
const { current, size } = this.page; |
||||
getList({ current, size, ...this.searchForm }).then((res) => { |
||||
const { total, records } = res.data.data; |
||||
this.page.total = total; |
||||
this.tableData = records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
// 分页 |
||||
currentChange(currentPage) { |
||||
this.page.current = currentPage; |
||||
this.onLoad(); |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.size = pageSize; |
||||
this.onLoad(); |
||||
}, |
||||
// 查询重置 |
||||
searchHandle(index) { |
||||
this.page.current = 1; |
||||
if (index === 2) { |
||||
this.searchForm = {}; |
||||
} |
||||
this.onLoad(); |
||||
}, |
||||
// 下载模板 |
||||
download() { |
||||
dowmLoadTemplate().then((res) => { |
||||
const blob = res.data; |
||||
const link = document.createElement("a"); |
||||
let binaryData = []; |
||||
binaryData.push(blob); |
||||
link.href = window.URL.createObjectURL(new Blob(binaryData)); |
||||
link.download = "数据库运维模板.xlsx"; |
||||
document.body.appendChild(link); |
||||
link.click(); |
||||
window.setTimeout(function () { |
||||
URL.revokeObjectURL(blob); |
||||
document.body.removeChild(link); |
||||
}, 0); |
||||
this.$message.success("下载模板成功!"); |
||||
}); |
||||
}, |
||||
handleSuccess() { |
||||
this.$message.success("导入成功"); |
||||
this.onLoad(); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.search { |
||||
display: flex; |
||||
justify-content: space-between; |
||||
} |
||||
.search-select { |
||||
width: 150px; |
||||
margin-right: 20px; |
||||
} |
||||
.search-input { |
||||
width: 288px; |
||||
} |
||||
.search-btn { |
||||
width: 130px; |
||||
height: 46px !important; |
||||
background: #2e92f6; |
||||
color: #fff; |
||||
margin: 0 20px; |
||||
} |
||||
.search-reset { |
||||
width: 46px; |
||||
height: 44px !important; |
||||
background: #ff9130; |
||||
margin-left: 0px; |
||||
color: #fff; |
||||
text-align: center; |
||||
line-height: 46px; |
||||
} |
||||
/deep/ .el-input__inner { |
||||
height: 46px; |
||||
} |
||||
</style> |
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue