parent
7e7081b87e
commit
cf0302a25a
12 changed files with 1128 additions and 184 deletions
@ -0,0 +1,49 @@ |
||||
import request from "@/router/axios"; |
||||
|
||||
// 获取搜索条件数据
|
||||
export const getBasicsData = () => { |
||||
return request({ |
||||
url: "/api/blade-workflow/database/listData", |
||||
method: "get", |
||||
}); |
||||
}; |
||||
|
||||
// 下载模板
|
||||
export const getTemplate = () => { |
||||
return request({ |
||||
url: "/api/blade-workflow/database/exportTemplate", |
||||
method: "get", |
||||
responseType: "blob", |
||||
}); |
||||
}; |
||||
|
||||
// 新增数据
|
||||
export const addList = (data) => { |
||||
return request({ |
||||
url: "/api/blade-workflow/database/save", |
||||
method: "post", |
||||
data, |
||||
}); |
||||
}; |
||||
// 获取新增下拉字段
|
||||
export const addPullData = (data) => { |
||||
return request({ |
||||
url: "/api/blade-workflow/database/basicData", |
||||
method: "get", |
||||
}); |
||||
}; |
||||
// 类型
|
||||
export const getDatabaseType = () => { |
||||
return request({ |
||||
url: "/api/blade-system/dict-biz/dictionary?code=database_type", |
||||
method: "get", |
||||
}); |
||||
}; |
||||
// 查询列表
|
||||
export const getDataList = (query) => { |
||||
return request({ |
||||
url: "/api/blade-workflow/database/list", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
}; |
||||
@ -1,127 +1,146 @@ |
||||
import request from '@/router/axios'; |
||||
import request from "@/router/axios"; |
||||
|
||||
const prefix = '/api/blade-workflow/design/form' |
||||
const prefix = "/api/blade-workflow/design/form"; |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: `${prefix}/list`, |
||||
method: 'get', |
||||
method: "get", |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
}, |
||||
}); |
||||
}; |
||||
|
||||
export const getDetail = (params) => { |
||||
return request({ |
||||
url: `${prefix}/detail`, |
||||
method: 'get', |
||||
params |
||||
}) |
||||
} |
||||
method: "get", |
||||
params, |
||||
}); |
||||
}; |
||||
|
||||
export const remove = (data) => { |
||||
return request({ |
||||
url: `${prefix}/remove`, |
||||
method: 'post', |
||||
data |
||||
}) |
||||
} |
||||
method: "post", |
||||
data, |
||||
}); |
||||
}; |
||||
|
||||
export const add = (row) => { |
||||
return request({ |
||||
url: `${prefix}/submit`, |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
method: "post", |
||||
data: row, |
||||
}); |
||||
}; |
||||
|
||||
export const update = (row) => { |
||||
return request({ |
||||
url: `${prefix}/submit`, |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
method: "post", |
||||
data: row, |
||||
}); |
||||
}; |
||||
|
||||
export const listType = (params) => { |
||||
return request({ |
||||
url: `${prefix}/listType`, |
||||
method: 'get', |
||||
params |
||||
}) |
||||
} |
||||
method: "get", |
||||
params, |
||||
}); |
||||
}; |
||||
|
||||
export const changeCategory = (row) => { |
||||
return request({ |
||||
url: `${prefix}/changeCategory`, |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
method: "post", |
||||
data: row, |
||||
}); |
||||
}; |
||||
|
||||
export const downloadFile = (query) => { |
||||
return request({ |
||||
url: '/api/blade-workflow/database/download', |
||||
method: 'get', |
||||
url: "/api/blade-workflow/database/download", |
||||
method: "get", |
||||
params: query, |
||||
responseType: 'blob' |
||||
}) |
||||
} |
||||
responseType: "blob", |
||||
}); |
||||
}; |
||||
// 运维公司
|
||||
export const getCompany = () => { |
||||
export const getCompany = (query) => { |
||||
return request({ |
||||
url: '/api/blade-user/maintenanceCompany', |
||||
method: 'get', |
||||
}) |
||||
} |
||||
url: "/api/blade-user/maintenanceCompany", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
}; |
||||
// 运维部门
|
||||
export const getDepts = (query) => { |
||||
return request({ |
||||
url: '/api/blade-system/dept/getDepts', |
||||
method: 'get', |
||||
params:query |
||||
}) |
||||
} |
||||
url: "/api/blade-system/dept/getDepts", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
}; |
||||
// 任务父类
|
||||
export const getTaskParent = () => { |
||||
return request({ |
||||
url: '/api/blade-system/dict-biz/dictionary?code=task_parent', |
||||
method: 'get', |
||||
}) |
||||
} |
||||
url: "/api/blade-system/dict-biz/dictionary?code=task_parent", |
||||
method: "get", |
||||
}); |
||||
}; |
||||
// 任务种类
|
||||
export const getTaskTypeData = (query) => { |
||||
return request({ |
||||
url: '/api/blade-workflow/taskInfo/taskTypeData', |
||||
method: 'get', |
||||
params:query |
||||
}) |
||||
} |
||||
url: "/api/blade-workflow/taskInfo/taskTypeData", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
}; |
||||
// 任务等级
|
||||
export const getTaskLevel= () => { |
||||
export const getTaskLevel = (query) => { |
||||
return request({ |
||||
url: '/api/blade-system/dict-biz/dictionary?code=task_level', |
||||
method: 'get', |
||||
}) |
||||
} |
||||
// url: "/api/blade-system/dict-biz/dictionary?code=task_level",
|
||||
url: "/api/blade-workflow/taskInfo/taskLevel", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
}; |
||||
// 系统名称/数据库
|
||||
export const getTaskAndDataBase = (query) => { |
||||
return request({ |
||||
url: '/api/blade-workflow/projectInfo/projectAndDataBase', |
||||
method: 'get', |
||||
params:query |
||||
}) |
||||
} |
||||
url: "/api/blade-workflow/projectInfo/projectAndDataBase", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
}; |
||||
// 系统名称/数据表
|
||||
export const getModuleAndDataTable = (query) => { |
||||
return request({ |
||||
url: '/api/blade-workflow/projectInfo/moduleAndDataTable', |
||||
method: 'get', |
||||
params:query |
||||
}) |
||||
} |
||||
url: "/api/blade-workflow/projectInfo/moduleAndDataTable", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
}; |
||||
|
||||
// 工单数据库和系统名称返回
|
||||
export const getDatabasePro = (query) => { |
||||
return request({ |
||||
url: "/api/blade-workflow/database/projectAndDataBase", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
}; |
||||
|
||||
// 工单数据表和系统模块返回
|
||||
export const getDatabaseTab = (query) => { |
||||
return request({ |
||||
url: "/api/blade-workflow/database/moduleAndDataTable", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
}; |
||||
|
||||
@ -0,0 +1,256 @@ |
||||
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: [ |
||||
{ |
||||
type: "select", |
||||
label: "数据库/系统名称", |
||||
prop: "databaseProjectName", |
||||
align: "left", |
||||
overHidden: true, |
||||
allowCreate: true, |
||||
filterable: true, |
||||
dicData: [], |
||||
props: { |
||||
label: "databaseProjectName", |
||||
value: "id", |
||||
}, |
||||
span: 8, |
||||
allowCreate: true, |
||||
filterable: true, |
||||
formslot: true, |
||||
rules: [{ required: true, message: "请输入数据库/系统名称" }], |
||||
}, |
||||
{ |
||||
type: "input", |
||||
label: "数据库/系统别名", |
||||
prop: "dataBaseAlias", |
||||
align: "left", |
||||
overHidden: true, |
||||
// dicData: [],
|
||||
// props: {
|
||||
// label: "projectName",
|
||||
// value: "id",
|
||||
// },
|
||||
span: 8, |
||||
hide: true, |
||||
allowCreate: true, |
||||
filterable: true, |
||||
}, |
||||
{ |
||||
label: "类型", |
||||
prop: "type", |
||||
type: "select", |
||||
align: "left", |
||||
span: 8, |
||||
dicData: [], |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
rules: [{ required: true, message: "请选择类型" }], |
||||
}, |
||||
{ |
||||
label: "数据表/系统模块", |
||||
prop: "datatableModuleName", |
||||
type: "input", |
||||
overHidden: true, |
||||
align: "left", |
||||
span: 8, |
||||
rules: [{ required: true, message: "请输入模块名称" }], |
||||
addDisplay: false, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "数据表/系统模块别名", |
||||
prop: "moduleAlias", |
||||
type: "input", |
||||
align: "left", |
||||
span: 8, |
||||
hide: true, |
||||
// rules: [{ required: true, message: "请输入模块名称" }],
|
||||
addDisplay: false, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
type: "input", |
||||
label: "运维公司", |
||||
prop: "companyName", |
||||
align: "left", |
||||
overHidden: true, |
||||
addDisplay: false, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
type: "select", |
||||
label: "运维公司", |
||||
prop: "company", |
||||
align: "left", |
||||
overHidden: true, |
||||
dicData: [], |
||||
props: { |
||||
label: "name", |
||||
value: "id", |
||||
}, |
||||
hide: true, |
||||
span: 8, |
||||
rules: [{ required: true, message: "请选择运维公司" }], |
||||
}, |
||||
{ |
||||
type: "select", |
||||
label: "管理部门", |
||||
prop: "deptId", |
||||
align: "left", |
||||
overHidden: true, |
||||
dicData: [], |
||||
props: { |
||||
label: "deptName", |
||||
value: "id", |
||||
}, |
||||
hide: true, |
||||
span: 8, |
||||
rules: [{ required: true, message: "请选择管理部门" }], |
||||
}, |
||||
{ |
||||
type: "input", |
||||
label: "管理部门", |
||||
prop: "deptName", |
||||
align: "left", |
||||
overHidden: true, |
||||
addDisplay: false, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
type: "input", |
||||
label: "IP地址", |
||||
prop: "dataBaseIp", |
||||
align: "left", |
||||
overHidden: true, |
||||
span: 8, |
||||
}, |
||||
{ |
||||
type: "input", |
||||
label: "端口号", |
||||
prop: "dataBasePort", |
||||
align: "left", |
||||
overHidden: true, |
||||
span: 8, |
||||
}, |
||||
{ |
||||
type: "input", |
||||
label: "所属系统", |
||||
prop: "systemName", |
||||
align: "left", |
||||
overHidden: true, |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "", |
||||
prop: "moduleDatatables", |
||||
type: "dynamic", |
||||
span: 24, |
||||
hide: true, |
||||
children: { |
||||
align: "left", |
||||
headerAlign: "left", |
||||
column: [ |
||||
{ |
||||
label: "数据表/系统模块", |
||||
prop: "datatableModuleName", |
||||
type: "input", |
||||
align: "left", |
||||
rules: [{ required: true, message: "请输入数据表/系统模块" }], |
||||
}, |
||||
{ |
||||
label: "数据表/系统模块别名", |
||||
prop: "dataTableAlias", |
||||
type: "input", |
||||
align: "left", |
||||
}, |
||||
], |
||||
}, |
||||
}, |
||||
// {
|
||||
// type: "input",
|
||||
// label: "数据库名称",
|
||||
// prop: "mc",
|
||||
// align: "left",
|
||||
// overHidden: true,
|
||||
// hide:true,
|
||||
// span: 8,
|
||||
// },
|
||||
// {
|
||||
// type: "select",
|
||||
// label: "数据库信息属性",
|
||||
// prop: "sx",
|
||||
// align: "left",
|
||||
// overHidden: true,
|
||||
// dicData: [],
|
||||
// props: {
|
||||
// label: "dictValue",
|
||||
// value: "id",
|
||||
// },
|
||||
// span: 8,
|
||||
// hide:true
|
||||
// },
|
||||
// {
|
||||
// type: "input",
|
||||
// label: "创建人",
|
||||
// prop: "createName",
|
||||
// align: "left",
|
||||
// overHidden: true,
|
||||
// addDisplay: false,
|
||||
// editDisplay: false,
|
||||
// },
|
||||
// {
|
||||
// label: "创建时间",
|
||||
// type: "datetime",
|
||||
// overHidden: true,
|
||||
// prop: "createTime",
|
||||
// format: "yyyy-MM-dd HH:mm",
|
||||
// valueFormat: "yyyy-MM-dd HH:mm:ss",
|
||||
// addDisplay: false,
|
||||
// editDisplay: false,
|
||||
// },
|
||||
// {
|
||||
// label: "",
|
||||
// prop: "moduleNameList",
|
||||
// type: "dynamic",
|
||||
// span: 24,
|
||||
// hide: true,
|
||||
// children: {
|
||||
// align: "left",
|
||||
// headerAlign: "left",
|
||||
// column: [
|
||||
// {
|
||||
// label: "模块名称",
|
||||
// prop: "moduleName",
|
||||
// type: "input",
|
||||
// align: "left",
|
||||
// rules: [{ required: true, message: "请输入模块名称" }],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// },
|
||||
], |
||||
}; |
||||
@ -0,0 +1,292 @@ |
||||
<template> |
||||
<div class="cus-container"> |
||||
<el-form :model="searchForm"> |
||||
<div class="search"> |
||||
<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.moduleName" |
||||
placeholder="模块名称" |
||||
class="search-select" |
||||
> |
||||
<el-option |
||||
v-for="item in moduleNamesList" |
||||
:key="item.moduleName" |
||||
:label="item.moduleName" |
||||
:value="item.moduleName" |
||||
> |
||||
</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.deptName" |
||||
: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="margin-left:auto;"> |
||||
<el-button class="search-btn" @click="searchHandle(1)" |
||||
>查询</el-button |
||||
> |
||||
<el-button |
||||
class="search-btn" |
||||
@click="searchHandle(2)" |
||||
style="margin-left: 20px;margin-right:10px; background: #ff9130" |
||||
>重置</el-button |
||||
> |
||||
<el-button |
||||
class="search-btn" |
||||
style="background: #2ee27c" |
||||
@click="addHandle" |
||||
>新增</el-button |
||||
> |
||||
</div> |
||||
</div> |
||||
</el-form> |
||||
<div style="margin-top: 15px"> |
||||
<avue-crud |
||||
id="avue-id" |
||||
ref="crud" |
||||
v-model="form" |
||||
:option="option" |
||||
:data="tableData" |
||||
:page.sync="page" |
||||
:table-loading="loading" |
||||
@row-save="rowSave" |
||||
@row-update="rowUpdate" |
||||
@row-del="rowDel" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
> |
||||
<template slot-scope="scope" slot="menu"> |
||||
<el-button type="primary" @click="editHandle(scope.row)" |
||||
>编辑 |
||||
</el-button> |
||||
<el-button type="danger" @click="rowDel(scope.row)">删除 </el-button> |
||||
</template> |
||||
</avue-crud> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import { |
||||
getList, |
||||
add, |
||||
update, |
||||
remove, |
||||
getDictionaries, |
||||
} from "@/api/maintenance/system.js"; |
||||
import { tableOption } from "@/const/maintenance/system.js"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: { |
||||
moduleNameList: [ |
||||
{ |
||||
moduleName: "", |
||||
}, |
||||
], |
||||
}, |
||||
searchForm: {}, |
||||
option: tableOption, |
||||
page: { |
||||
currentPage: 1, |
||||
total: 0, |
||||
pageSize: 10, |
||||
}, |
||||
// 表格数据 |
||||
tableData: [], |
||||
loading: false, |
||||
// 4个字典下拉 |
||||
usersList: [], |
||||
deptsList: [], |
||||
projectList: [], |
||||
moduleNamesList: [], |
||||
}; |
||||
}, |
||||
created() { |
||||
this.getDict(); |
||||
this.onLoad(); |
||||
}, |
||||
methods: { |
||||
// 字典请求 |
||||
getDict() { |
||||
getDictionaries().then((res) => { |
||||
const { depts, moduleNames, projectNames, users } = res.data.data; |
||||
// 系统 |
||||
this.projectList = projectNames; |
||||
const projectNamesColumn = this.findObject( |
||||
this.option.column, |
||||
"projectName" |
||||
); |
||||
projectNamesColumn.dicData = projectNames; |
||||
// 部门 |
||||
this.deptsList = depts; |
||||
const deptsColumn = this.findObject(this.option.column, "manageDeptId"); |
||||
deptsColumn.dicData = depts; |
||||
// 运维公司 |
||||
this.usersList = users; |
||||
const usersColumn = this.findObject( |
||||
this.option.column, |
||||
"maintenanceDeptId" |
||||
); |
||||
usersColumn.dicData = users; |
||||
// 模块 |
||||
this.moduleNamesList = moduleNames; |
||||
}); |
||||
}, |
||||
// 列表 |
||||
onLoad() { |
||||
this.loading = true; |
||||
const { currentPage, pageSize } = this.page; |
||||
getList({ |
||||
current: currentPage, |
||||
size: pageSize, |
||||
...this.searchForm, |
||||
}).then((res) => { |
||||
const { total, records } = res.data.data; |
||||
this.page.total = total; |
||||
this.tableData = records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
// 分页 |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
this.onLoad(); |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
this.onLoad(); |
||||
}, |
||||
// 查询重置 |
||||
searchHandle(index) { |
||||
this.page.currentPage = 1; |
||||
if (index === 2) { |
||||
this.searchForm = {}; |
||||
} |
||||
this.onLoad(); |
||||
}, |
||||
// 新增 |
||||
addHandle() { |
||||
this.form = { |
||||
moduleNameList: [ |
||||
{ |
||||
moduleName: "", |
||||
}, |
||||
], |
||||
}; |
||||
this.$refs.crud.rowAdd(); |
||||
}, |
||||
editHandle(row) { |
||||
this.$refs.crud.rowEdit(row); |
||||
}, |
||||
// 新增 |
||||
rowSave(row, done, loading) { |
||||
add(row).then( |
||||
(res) => { |
||||
const data = res.data.data; |
||||
row.id = data.id; |
||||
this.$message({ type: "success", message: "新增成功!" }); |
||||
this.onLoad(); |
||||
this.getDict(); |
||||
// 数据回调进行刷新 |
||||
done(row); |
||||
}, |
||||
(error) => { |
||||
window.console.log(error); |
||||
loading(); |
||||
} |
||||
); |
||||
}, |
||||
// 编辑 |
||||
rowUpdate(row, index, done, loading) { |
||||
update(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "修改成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
window.console.log(error); |
||||
loading(); |
||||
} |
||||
); |
||||
}, |
||||
// 行删除 |
||||
rowDel(row) { |
||||
this.$confirm("此操作会删除该数据,且无法恢复,确定删除数据?", "提示", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}) |
||||
.then(() => { |
||||
remove(row.id).then((res) => { |
||||
// 测试用的假方法 |
||||
console.log(res); |
||||
this.$message.success("删除成功!"); |
||||
this.onLoad(this.page[0]); |
||||
}); |
||||
}) |
||||
.catch(() => { |
||||
// this.$message({ type: "info", message: "已取消删除" }); |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.search { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
} |
||||
.search-select { |
||||
width: 150px; |
||||
margin-right: 20px; |
||||
margin-bottom: 15px; |
||||
} |
||||
|
||||
.search-btn { |
||||
width: 100px; |
||||
height: 46px !important; |
||||
background: #2e92f6; |
||||
color: #fff; |
||||
} |
||||
|
||||
/deep/ .el-input__inner { |
||||
height: 46px; |
||||
} |
||||
</style> |
||||
Loading…
Reference in new issue