1、系统运维与数据库运维合成一个页面

2、修改工单相关问题
main
jinna 3 years ago
parent 7e7081b87e
commit cf0302a25a
  1. 49
      src/api/maintenance/basics.js
  2. 157
      src/api/plugin/workflow/form.js
  3. 256
      src/const/maintenance/basics.js
  4. 17
      src/const/workflow/todo.js
  5. 1
      src/page/index/sidebar/sidebarItem.vue
  6. 292
      src/views/maintenance/basics.vue
  7. 275
      src/views/maintenance/system.vue
  8. 64
      src/views/plugin/workflow/process/components/detail.vue
  9. 54
      src/views/plugin/workflow/process/components/effect.vue
  10. 140
      src/views/plugin/workflow/process/components/form.vue
  11. 3
      src/views/plugin/workflow/process/implementation.vue
  12. 4
      src/views/plugin/workflow/process/todo.vue

@ -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) => { export const getList = (current, size, params) => {
return request({ return request({
url: `${prefix}/list`, url: `${prefix}/list`,
method: 'get', method: "get",
params: { params: {
...params, ...params,
current, current,
size, size,
} },
}) });
} };
export const getDetail = (params) => { export const getDetail = (params) => {
return request({ return request({
url: `${prefix}/detail`, url: `${prefix}/detail`,
method: 'get', method: "get",
params params,
}) });
} };
export const remove = (data) => { export const remove = (data) => {
return request({ return request({
url: `${prefix}/remove`, url: `${prefix}/remove`,
method: 'post', method: "post",
data data,
}) });
} };
export const add = (row) => { export const add = (row) => {
return request({ return request({
url: `${prefix}/submit`, url: `${prefix}/submit`,
method: 'post', method: "post",
data: row data: row,
}) });
} };
export const update = (row) => { export const update = (row) => {
return request({ return request({
url: `${prefix}/submit`, url: `${prefix}/submit`,
method: 'post', method: "post",
data: row data: row,
}) });
} };
export const listType = (params) => { export const listType = (params) => {
return request({ return request({
url: `${prefix}/listType`, url: `${prefix}/listType`,
method: 'get', method: "get",
params params,
}) });
} };
export const changeCategory = (row) => { export const changeCategory = (row) => {
return request({ return request({
url: `${prefix}/changeCategory`, url: `${prefix}/changeCategory`,
method: 'post', method: "post",
data: row data: row,
}) });
} };
export const downloadFile = (query) => { export const downloadFile = (query) => {
return request({ return request({
url: '/api/blade-workflow/database/download', url: "/api/blade-workflow/database/download",
method: 'get', method: "get",
params: query, params: query,
responseType: 'blob' responseType: "blob",
}) });
} };
// 运维公司 // 运维公司
export const getCompany = () => { export const getCompany = (query) => {
return request({ return request({
url: '/api/blade-user/maintenanceCompany', url: "/api/blade-user/maintenanceCompany",
method: 'get', method: "get",
}) params: query,
} });
};
// 运维部门 // 运维部门
export const getDepts = (query) => { export const getDepts = (query) => {
return request({ return request({
url: '/api/blade-system/dept/getDepts', url: "/api/blade-system/dept/getDepts",
method: 'get', method: "get",
params:query params: query,
}) });
} };
// 任务父类 // 任务父类
export const getTaskParent = () => { export const getTaskParent = () => {
return request({ return request({
url: '/api/blade-system/dict-biz/dictionary?code=task_parent', url: "/api/blade-system/dict-biz/dictionary?code=task_parent",
method: 'get', method: "get",
}) });
} };
// 任务种类 // 任务种类
export const getTaskTypeData = (query) => { export const getTaskTypeData = (query) => {
return request({ return request({
url: '/api/blade-workflow/taskInfo/taskTypeData', url: "/api/blade-workflow/taskInfo/taskTypeData",
method: 'get', method: "get",
params:query params: query,
}) });
} };
// 任务等级 // 任务等级
export const getTaskLevel= () => { export const getTaskLevel = (query) => {
return request({ return request({
url: '/api/blade-system/dict-biz/dictionary?code=task_level', // url: "/api/blade-system/dict-biz/dictionary?code=task_level",
method: 'get', url: "/api/blade-workflow/taskInfo/taskLevel",
}) method: "get",
} params: query,
});
};
// 系统名称/数据库 // 系统名称/数据库
export const getTaskAndDataBase = (query) => { export const getTaskAndDataBase = (query) => {
return request({ return request({
url: '/api/blade-workflow/projectInfo/projectAndDataBase', url: "/api/blade-workflow/projectInfo/projectAndDataBase",
method: 'get', method: "get",
params:query params: query,
}) });
} };
// 系统名称/数据表 // 系统名称/数据表
export const getModuleAndDataTable = (query) => { export const getModuleAndDataTable = (query) => {
return request({ return request({
url: '/api/blade-workflow/projectInfo/moduleAndDataTable', url: "/api/blade-workflow/projectInfo/moduleAndDataTable",
method: 'get', method: "get",
params:query 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: "请输入模块名称" }],
// },
// ],
// },
// },
],
};

@ -1,14 +1,14 @@
export const tableOption = { export const tableOption = {
index: true, index: true,
indexLabel: "序号", indexLabel: "序号",
indexWidth:120, indexWidth: 120,
selection: false, selection: false,
border: false, border: false,
gutter: 60, //设置input的大小 gutter: 60, //设置input的大小
headerAlign: "left", headerAlign: "left",
align: "left", align: "left",
menuAlign:'left', menuAlign: "left",
menuHeaderAlign:'left', menuHeaderAlign: "left",
menuBtn: true, menuBtn: true,
editBtn: false, editBtn: false,
delBtn: false, delBtn: false,
@ -19,7 +19,7 @@ export const tableOption = {
refreshBtn: false, refreshBtn: false,
// dialogCustomClass: "custom", // dialogCustomClass: "custom",
header: false, header: false,
menuWidth:120, menuWidth: 120,
column: [ column: [
{ {
type: "input", type: "input",
@ -42,6 +42,13 @@ export const tableOption = {
align: "left", align: "left",
overHidden: true, overHidden: true,
}, },
// {
// type: "input",
// label: "操作模块",
// prop: "operateSys",
// align: "left",
// overHidden: true,
// },
{ {
type: "input", type: "input",
label: "当前责任人", label: "当前责任人",
@ -102,4 +109,4 @@ export const tableOption = {
valueFormat: "yyyy-MM-dd HH:mm:ss", valueFormat: "yyyy-MM-dd HH:mm:ss",
}, },
], ],
} };

@ -125,7 +125,6 @@
} }
}, },
open(item) { open(item) {
console.log(item)
if (this.screen <= 1) this.$store.commit("SET_COLLAPSE"); if (this.screen <= 1) this.$store.commit("SET_COLLAPSE");
if (this.validIsOpen(item)) { if (this.validIsOpen(item)) {
window.open(item[this.pathKey]); window.open(item[this.pathKey]);

@ -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>

@ -3,33 +3,50 @@
<el-form :model="searchForm"> <el-form :model="searchForm">
<div class="search"> <div class="search">
<el-select <el-select
v-model="searchForm.projectInfoId" v-model="searchForm.databaseProjectName"
placeholder="系统名称" placeholder="数据库/系统名称"
class="search-select" class="search-select"
filterable
> >
<el-option <el-option
v-for="item in projectList" v-for="item in projectList"
:key="item.id" :key="item.id"
:label="item.projectName" :label="item.databaseProjectName"
:value="item.id" :value="item.databaseProjectName"
> >
</el-option> </el-option>
</el-select> </el-select>
<!-- <el-input placeholder="数据库/系统名称" v-model="searchForm.databaseProjectName" class="search-select"></el-input>
<el-input placeholder="数据表/系统模块" v-model="searchForm.datatableModuleName" class="search-select"></el-input> -->
<el-select <el-select
v-model="searchForm.moduleName" v-model="searchForm.datatableModuleName"
placeholder="模块名称" placeholder="数据表/系统模块"
class="search-select" class="search-select"
filterable
> >
<el-option <el-option
v-for="item in moduleNamesList" v-for="item in moduleNamesList"
:key="item.moduleName" :key="item.datatableModuleName"
:label="item.moduleName" :label="item.datatableModuleName"
:value="item.moduleName" :value="item.datatableModuleName"
>
</el-option>
</el-select>
<el-select
v-model="searchForm.type"
placeholder="类型"
class="search-select"
>
<el-option
v-for="item in typeList"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey"
> >
</el-option> </el-option>
</el-select> </el-select>
<el-select <el-select
v-model="searchForm.manageDeptId" v-model="searchForm.deptId"
placeholder="管理部门" placeholder="管理部门"
class="search-select" class="search-select"
> >
@ -42,7 +59,7 @@
</el-option> </el-option>
</el-select> </el-select>
<el-select <el-select
v-model="searchForm.maintenanceDeptId" v-model="searchForm.company"
placeholder="运维公司" placeholder="运维公司"
class="search-select" class="search-select"
> >
@ -61,15 +78,29 @@
<el-button <el-button
class="search-btn" class="search-btn"
@click="searchHandle(2)" @click="searchHandle(2)"
style="margin-left: 20px;margin-right:10px; background: #ff9130" style="background: #ff9130"
>重置</el-button >重置</el-button
> >
<el-button <el-button
class="search-btn" class="search-btn"
style="background: #2ee27c" style="background: #2ee27c;"
@click="addHandle" @click="addHandle"
>新增</el-button >新增</el-button
> >
<el-button class="search-btn" @click="download">下载模板</el-button>
<el-upload
style="display:inline-block;"
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="background: #2ee27c;"
>导入</el-button
>
</el-upload>
</div> </div>
</div> </div>
</el-form> </el-form>
@ -88,6 +119,26 @@
@current-change="currentChange" @current-change="currentChange"
@size-change="sizeChange" @size-change="sizeChange"
> >
<template slot="databaseProjectNameForm">
<el-select
placeholder="请输入数据库/系统名称"
v-model="form.databaseProjectName"
@change="databaseChange"
filterable
allow-create
>
<el-option
v-for="item in basicsData"
:key="item.id"
:label="item.databaseProjectName"
:value="item.id"
>
</el-option>
</el-select>
</template>
<template slot="type" slot-scope="{ row }">
{{ typeList.find(item => item.dictKey == row.type) ? typeList.find(item => item.dictKey == row.type).dictValue : ''}}
</template>
<template slot-scope="scope" slot="menu"> <template slot-scope="scope" slot="menu">
<el-button type="primary" @click="editHandle(scope.row)" <el-button type="primary" @click="editHandle(scope.row)"
>编辑 >编辑
@ -106,14 +157,18 @@ import {
remove, remove,
getDictionaries, getDictionaries,
} from "@/api/maintenance/system.js"; } from "@/api/maintenance/system.js";
import { tableOption } from "@/const/maintenance/system.js"; import {getBasicsData,getTemplate,getDatabaseType,getDataList,addPullData,addList} from "@/api/maintenance/basics.js";
import { tableOption } from "@/const/maintenance/basics.js";
import { getToken } from "@/util/auth";
export default { export default {
data() { data() {
return { return {
form: { form: {
moduleNameList: [ moduleDatatables: [
{ {
moduleName: "", datatableModuleName: "",
dataTableAlias:''
}, },
], ],
}, },
@ -125,51 +180,88 @@ export default {
pageSize: 10, pageSize: 10,
}, },
// //
tableData: [], tableData: [
],
loading: false, loading: false,
// 4 // 4
usersList: [], usersList: [],
deptsList: [], deptsList: [],
projectList: [], projectList: [],
moduleNamesList: [], moduleNamesList: [],
typeList:[],
//
headers: {
"Blade-Auth": "",
},
basicsData:[]
}; };
}, },
// 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() { created() {
this.getDict(); this.getDict();
this.onLoad(); this.onLoad();
this.headers["Blade-Auth"] = "bearer " + getToken();
}, },
methods: { methods: {
// //
getDict() { getDict() {
getDictionaries().then((res) => { getDatabaseType().then(res =>{
const { depts, moduleNames, projectNames, users } = res.data.data; this.typeList = res.data.data;
// const typeColumn = this.findObject(
this.projectList = projectNames;
const projectNamesColumn = this.findObject(
this.option.column, this.option.column,
"projectName" "type"
); );
projectNamesColumn.dicData = projectNames; typeColumn.dicData = res.data.data;
// })
// 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;
// });
getBasicsData().then(res =>{
const { depts, companys,dataBaseProjectNames,dataTableModuleNames } = res.data.data;
this.projectList = dataBaseProjectNames;
this.moduleNamesList = dataTableModuleNames;
this.deptsList = depts; this.deptsList = depts;
const deptsColumn = this.findObject(this.option.column, "manageDeptId"); this.usersList = companys;
deptsColumn.dicData = depts; })
//
this.usersList = users;
const usersColumn = this.findObject(
this.option.column,
"maintenanceDeptId"
);
usersColumn.dicData = users;
//
this.moduleNamesList = moduleNames;
});
}, },
// //
onLoad() { onLoad() {
this.loading = true; this.loading = true;
const { currentPage, pageSize } = this.page; const { currentPage, pageSize } = this.page;
getList({ getDataList({
current: currentPage, current: currentPage,
size: pageSize, size: pageSize,
...this.searchForm, ...this.searchForm,
@ -196,16 +288,79 @@ export default {
this.searchForm = {}; this.searchForm = {};
} }
this.onLoad(); this.onLoad();
},
//
download(){
getTemplate().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("下载模板成功!");
})
},
databaseChange(id){
let tmp = this.basicsData.find(item => item.id == id)
if(tmp){
const {
dataBaseAlias,
company,
dataBaseIp,
dataBasePort,
deptId,
systemName,
type
} = tmp
this.form.dataBaseAlias = dataBaseAlias;
this.form.company = company;
this.form.dataBaseIp = dataBaseIp;
this.form.dataBasePort = dataBasePort;
this.form.deptId = deptId;
this.form.systemName = systemName;
this.form.type = type + '';
}else{
this.form.dataBaseAlias = '';
this.form.company = '';
this.form.dataBaseIp = '';
this.form.dataBasePort = '';
this.form.deptId = '';
this.form.systemName = '';
this.form.type = '';
}
}, },
// //
addHandle() { addHandle() {
this.form = { this.form = {
moduleNameList: [ moduleDatatables: [
{ {
moduleName: "", datatableModuleName: "",
dataTableAlias:''
}, },
], ],
}; };
addPullData().then(res =>{
const {dataBaseProjectNames,depts,users} = res.data.data;
const projectColumn = this.findObject(this.option.column, "databaseProjectName");
projectColumn.dicData = dataBaseProjectNames;
this.basicsData = dataBaseProjectNames;
const deptsColumn = this.findObject(this.option.column, "deptId");
deptsColumn.dicData = depts;
const usersColumn = this.findObject(
this.option.column,
"company"
);
usersColumn.dicData = users;
})
this.$refs.crud.rowAdd(); this.$refs.crud.rowAdd();
}, },
editHandle(row) { editHandle(row) {
@ -213,21 +368,39 @@ export default {
}, },
// //
rowSave(row, done, loading) { rowSave(row, done, loading) {
add(row).then( row.dataBaseIp = row.dataBaseIp ? row.dataBaseIp : '';
(res) => { row.dataBasePort = row.dataBasePort ? row.dataBasePort : ''
row.dataBaseAlias = row.dataBaseAlias ? row.dataBaseAlias : ''
row.systemName = row.systemName ? row.systemName : '';
addList(row).then(res =>{
const data = res.data.data; const data = res.data.data;
row.id = data.id; row.id = data.id;
this.$message({ type: "success", message: "新增成功!" }); this.$message({ type: "success", message: res.data.msg });
this.onLoad(); this.onLoad();
this.getDict(); this.getDict();
// //
done(row); done(row);
},
(error) => { }).catch(error =>{
window.console.log(error); window.console.log(error);
loading(); 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) { rowUpdate(row, index, done, loading) {
@ -256,7 +429,6 @@ export default {
.then(() => { .then(() => {
remove(row.id).then((res) => { remove(row.id).then((res) => {
// //
console.log(res);
this.$message.success("删除成功!"); this.$message.success("删除成功!");
this.onLoad(this.page[0]); this.onLoad(this.page[0]);
}); });
@ -265,6 +437,10 @@ export default {
// this.$message({ type: "info", message: "" }); // this.$message({ type: "info", message: "" });
}); });
}, },
handleSuccess(res) {
this.$message.success(res.msg);
this.onLoad();
},
}, },
}; };
</script> </script>
@ -284,6 +460,7 @@ export default {
height: 46px !important; height: 46px !important;
background: #2e92f6; background: #2e92f6;
color: #fff; color: #fff;
margin-left: 20px;
} }
/deep/ .el-input__inner { /deep/ .el-input__inner {

@ -143,8 +143,11 @@ import {
getDepts, getDepts,
getTaskParent, getTaskParent,
getTaskTypeData, getTaskTypeData,
getTaskLevel,
getTaskAndDataBase, getTaskAndDataBase,
getModuleAndDataTable, getModuleAndDataTable,
getDatabasePro,
getDatabaseTab
} from "@/api/plugin/workflow/form.js"; } from "@/api/plugin/workflow/form.js";
import WfExamineForm from "./examForm.vue"; import WfExamineForm from "./examForm.vue";
import WfButton from "./button.vue"; import WfButton from "./button.vue";
@ -286,13 +289,15 @@ export default {
detail: true, detail: true,
}); });
} }
// console.log(option.column.find(item => item.prop == 'renwudengji'))
option.column.find(item => item.prop == 'renwudengji').dicUrl = ''
this.option = option; this.option = option;
this.vars = vars; this.vars = vars;
// //
const { yunweigongsi, renwufulei, xitongmingchengshujuku } = const { yunweigongsi, renwufulei, xitongmingchengshujuku } =
variables; variables;
// //
const companyData = await getCompany(); const companyData = await getCompany({isDetail:1});
let ywgs = this.findObject(option.column, "yunweigongsi"); let ywgs = this.findObject(option.column, "yunweigongsi");
ywgs.dicData = companyData.data.data; ywgs.dicData = companyData.data.data;
// //
@ -300,18 +305,28 @@ export default {
const guanlibumen = this.findObject(option.column, "guanlibumen"); const guanlibumen = this.findObject(option.column, "guanlibumen");
guanlibumen.dicData = deptDate.data.data; guanlibumen.dicData = deptDate.data.data;
// //
// const taskParent = await getTaskParent(); const taskParent = await getTaskParent();
// const rwfl = this.findObject(option.column, "renwufulei"); const rwfl = this.findObject(option.column, "renwufulei");
// rwfl.dicData = taskParent.data.data; rwfl.dicData = taskParent.data.data;
// //
// const taskTypeData = await getTaskTypeData({ parentId: renwufulei }); const taskTypeData = await getTaskTypeData({ parentId: renwufulei,isDetail:1 });
// const renwuzhonglei = this.findObject( const renwuzhonglei = this.findObject(
// this.option.column, this.option.column,
// "renwuzhonglei" "renwuzhonglei"
// ); );
// renwuzhonglei.dicData = taskTypeData.data.data; renwuzhonglei.dicData = taskTypeData.data.data;
//
const taskTypeLevel = await getTaskLevel({isDetail:1 });
const renwudengji = this.findObject(
this.option.column,
"renwudengji"
);
renwudengji.dicData = taskTypeLevel.data.data;
// //
const taskAndDataBaseData = await getTaskAndDataBase({ // const taskAndDataBaseData = await getTaskAndDataBase({
// id: yunweigongsi,
// });
const taskAndDataBaseData = await getDatabasePro({
id: yunweigongsi, id: yunweigongsi,
}); });
let datasql = this.findObject( let datasql = this.findObject(
@ -323,18 +338,27 @@ export default {
let obj = taskAndDataBaseData.data.data.find(function (i) { let obj = taskAndDataBaseData.data.data.find(function (i) {
return i.id === xitongmingchengshujuku; return i.id === xitongmingchengshujuku;
}); });
const moduleAndDataTableData = await getModuleAndDataTable({ console.log(obj)
id: obj.id, if(obj){
type: obj.type, const moduleAndDataTableData = await getDatabaseTab({
}); id: obj.id,
let xitongmokuaishujubiao = this.findObject( });
this.option.column, let xitongmokuaishujubiao = this.findObject(
"xitongmokuaishujubiao" this.option.column,
); "xitongmokuaishujubiao"
xitongmokuaishujubiao.dicData = moduleAndDataTableData.data.data; );
xitongmokuaishujubiao.dicData = moduleAndDataTableData.data.data;
}
// const moduleAndDataTableData = await getModuleAndDataTable({
// id: obj.id,
// type: obj.type,
// });
} }
console.log('variables',variables)
setTimeout(() => { setTimeout(() => {
this.form = variables; this.form = variables;
// this.form.renwuzhonglei = variables.renwuzhonglei
this.waiting = false; this.waiting = false;
}, 100); }, 100);
}); });

@ -40,7 +40,7 @@
<span v-else></span> <span v-else></span>
</template> </template>
</avue-form> </avue-form>
<div class="footer" v-if="form.isFinish === 0"> <div class="footer" v-if="form.isFinish === 0 && form.maintenanceCompany == userInfo.user_id">
<el-button type="success" @click="submit" :loading="subLoading" <el-button type="success" @click="submit" :loading="subLoading"
>实施提交</el-button >实施提交</el-button
> >
@ -111,8 +111,16 @@ export default {
prop: "taskLevelName", prop: "taskLevelName",
labelPosition: "top", labelPosition: "top",
disabled: true, disabled: true,
// dicUrl: "/api/blade-workflow//taskInfo/taskLevel", },
// dicMethod: "get", {
type: "input",
label: "系统名称/数据库",
span: 7,
display: true,
prop: "operateSys",
labelPosition: "top",
disabled: true,
display: JSON.parse(this.$route.query.form).operateSysName ? false : true,
}, },
{ {
type: "input", type: "input",
@ -122,6 +130,7 @@ export default {
prop: "operateSysName", prop: "operateSysName",
labelPosition: "top", labelPosition: "top",
disabled: true, disabled: true,
display: JSON.parse(this.$route.query.form).operateSysName ? true : false,
}, },
{ {
type: "input", type: "input",
@ -154,6 +163,15 @@ export default {
// dicUrl: "/api/blade-system/dict-biz/dictionary?code=repeat_mode", // dicUrl: "/api/blade-system/dict-biz/dictionary?code=repeat_mode",
// dicMethod: "get", // dicMethod: "get",
}, },
{
type: "textarea",
label: "详情",
span: 24,
display: true,
prop: "detail",
labelPosition: "top",
disabled: true,
},
// { // {
// type: "textarea", // type: "textarea",
// label: "", // label: "",
@ -178,7 +196,7 @@ export default {
name: "name", name: "name",
}, },
action: "/api/blade-workflow/database/upload", action: "/api/blade-workflow/database/upload",
display: JSON.parse(this.$route.query.form).isFinish === 0 ? true : false, // display: JSON.parse(this.$route.query.form).isFinish === 0 ? true : false,
span: 24, span: 24,
showFileList: true, showFileList: true,
multiple: true, multiple: true,
@ -197,19 +215,23 @@ export default {
prop: "remark", prop: "remark",
labelPosition: "top", labelPosition: "top",
rules: [{ required: true, message: "请输入实施反馈" }], rules: [{ required: true, message: "请输入实施反馈" }],
disabled: JSON.parse(this.$route.query.form).isFinish === 1 ? true : false, // disabled: (JSON.parse(this.$route.query.form).isFinish === 1 ) ? true : false,
}, },
], ],
}, },
isShow:true
}; };
}, },
created() { created() {
const { const {
applyUser,
maintenanceCompanyName, maintenanceCompanyName,
maintenanceCompany,
managementName, managementName,
taskParentName, taskParentName,
taskTypeName, taskTypeName,
taskLevelName, taskLevelName,
operateSys,
operateSysName, operateSysName,
operateModuleName, operateModuleName,
repeatModeName, repeatModeName,
@ -217,13 +239,17 @@ export default {
expectedCompletionTime, expectedCompletionTime,
isFinish, isFinish,
id, id,
remark remark,
detail
} = JSON.parse(this.$route.query.form); } = JSON.parse(this.$route.query.form);
this.form = { this.form = {
applyUser,
maintenanceCompanyName, maintenanceCompanyName,
maintenanceCompany,
managementName, managementName,
taskParentName, taskParentName,
taskTypeName, taskTypeName,
operateSys,
taskLevelName, taskLevelName,
operateSysName, operateSysName,
operateModuleName, operateModuleName,
@ -232,11 +258,24 @@ export default {
expectedCompletionTime, expectedCompletionTime,
isFinish, isFinish,
id, id,
remark remark,
detail
}; };
console.log(this.form)
console.log(this.userInfo)
if(this.userInfo){
this.option.column.find(item => item.prop == 'remark').disabled = (JSON.parse(this.$route.query.form).isFinish === 1 ||
JSON.parse(this.$route.query.form).maintenanceCompany !== this.userInfo.user_id
) ? true : false;
this.option.column.find(item => item.prop == 'shangchuan').display = (JSON.parse(this.$route.query.form).isFinish === 1 ||
JSON.parse(this.$route.query.form).maintenanceCompany !== this.userInfo.user_id
) ? false : true
}
}, },
computed: { computed: {
...mapGetters(["userInfo"]), ...mapGetters(["userInfo"]),
}, },
methods: { methods: {
// //
@ -285,7 +324,6 @@ export default {
add({ id, uploadRecords, remark }) add({ id, uploadRecords, remark })
.then((res) => { .then((res) => {
console.log(res)
this.subLoading = false; this.subLoading = false;
this.$message.success("提交成功!"); this.$message.success("提交成功!");
this.$router.replace("/plugin/workflow/process/implementation"); this.$router.replace("/plugin/workflow/process/implementation");

@ -37,7 +37,7 @@
</el-select> </el-select>
</template> </template>
<!-- <template slot="renwufulei"> <template slot="renwufulei">
<el-select <el-select
v-model="form.renwufulei" v-model="form.renwufulei"
placeholder="请选择任务父类" placeholder="请选择任务父类"
@ -51,19 +51,20 @@
> >
</el-option> </el-option>
</el-select> </el-select>
</template> --> </template>
<template slot="xitongmingchengshujuku"> <template slot="xitongmingchengshujuku">
<el-select <el-select
filterable filterable
allow-create
clearable clearable
v-model="form.xitongmingchengshujuku" v-model="form.xitongmingchengshujuku"
placeholder="请选择系统名称/数据库" placeholder="请选择系统名称/数据库/别名"
@change="systemChange" @change="systemChange"
> >
<el-option <el-option
v-for="item in taskAndDataBaseList" v-for="item in taskAndDataBaseList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.databaseProjectName"
:value="item.id" :value="item.id"
> >
</el-option> </el-option>
@ -164,11 +165,13 @@ import {
downloadFile, downloadFile,
getCompany, getCompany,
getDepts, getDepts,
// getTaskParent, getTaskParent,
// getTaskLevel, getTaskLevel,
getTaskTypeData, getTaskTypeData,
getTaskAndDataBase, getTaskAndDataBase,
getModuleAndDataTable, getModuleAndDataTable,
getDatabasePro,
getDatabaseTab
} from "@/api/plugin/workflow/form.js"; } from "@/api/plugin/workflow/form.js";
import WfExamineForm from "./examForm.vue"; import WfExamineForm from "./examForm.vue";
import WfUserSelect from "./user-select"; import WfUserSelect from "./user-select";
@ -241,14 +244,30 @@ export default {
deptList: [], // deptList: [], //
taskParentList: [], // taskParentList: [], //
taskAndDataBaseList: [], // taskAndDataBaseList: [], //
// taskLevelList: [] // // taskLevelList: [], //
visible: false, visible: false,
isDraft:false
}; };
}, },
created() {}, created() {},
methods: { methods: {
// - // -
companyChange(id) { companyChange(id) {
// this.form.xitongmingchengshujuku = ''
// const xitongmokuaishujubiao = this.findObject(
// this.option.column,
// "xitongmokuaishujubiao"
// );
// xitongmokuaishujubiao.dicData = [];
// this.form.xitongmokuaishujubiao = "";
getTaskLevel({isDetail:0}).then(res =>{
console.log(res.data.data)
const taskLevel = this.findObject(
this.option.column,
"renwudengji"
);
taskLevel.dicData = res.data.data;
})
let obj = this.companyList.find(function (i) { let obj = this.companyList.find(function (i) {
return i.id === id; return i.id === id;
}); });
@ -260,34 +279,87 @@ export default {
this.form.guanlibumen = guanlibumen.dicData[0].id; this.form.guanlibumen = guanlibumen.dicData[0].id;
} }
}); });
getTaskAndDataBase({ id }).then((res) => { // getTaskAndDataBase({ id }).then((res) => {
// this.taskAndDataBaseList = res.data.data;
// });
getDatabasePro({id:id}).then(res =>{
this.taskAndDataBaseList = res.data.data; this.taskAndDataBaseList = res.data.data;
}); if(this.isDraft){
this.systemChange(this.form.xitongmingchengshujuku,1);
this.isDraft = false
}else{
if(this.taskAndDataBaseList.length !== 0){
this.form.xitongmingchengshujuku = this.taskAndDataBaseList[0].id
this.systemChange(this.taskAndDataBaseList[0].id,-1)
}else{
this.form.xitongmingchengshujuku = ''
const xitongmokuaishujubiao = this.findObject(
this.option.column,
"xitongmokuaishujubiao"
);
xitongmokuaishujubiao.dicData = res.data.data;
this.form.xitongmokuaishujubiao = "";
}
}
})
}, },
// //
taskParentChange(id) { taskParentChange(id) {
getTaskTypeData({ parentId: id }).then((res) => { getTaskTypeData({ parentId: id,isDetail:0 }).then((res) => {
this.form.renwuzhonglei = ""; // this.form.renwuzhonglei = "";
this.form.renwudengji = ""; // this.form.renwudengji = "";
const renwuzhonglei = this.option.column[3]; const renwuzhonglei = this.option.column[3];
renwuzhonglei.dicData = res.data.data; renwuzhonglei.dicData = res.data.data;
if(res.data.data.length != 0){
this.form.renwuzhonglei = res.data.data[0].id;
}else{
this.form.renwuzhonglei = "";
this.form.renwudengji = "";
}
}); });
}, },
systemChange(id, index) { systemChange(id, index) {
let obj = this.taskAndDataBaseList.find(function (i) { let obj = this.taskAndDataBaseList.find(function (i) {
return i.id === id; return i.id === id;
}); });
getModuleAndDataTable({ id: obj.id, type: obj.type }).then((res) => { console.log(obj)
if (index !== 1) { // getModuleAndDataTable({ id: obj.id, type: obj.type }).then((res) => {
this.form.xitongmokuaishujubiao = ""; // if (index !== 1) {
} // this.form.xitongmokuaishujubiao = "";
// }
// const xitongmokuaishujubiao = this.findObject(
// this.option.column,
// "xitongmokuaishujubiao"
// );
// xitongmokuaishujubiao.dicData = res.data.data;
// this.form.type = obj.type;
// });
if(obj){
getDatabaseTab({id:obj.id}).then(res =>{
const xitongmokuaishujubiao = this.findObject(
this.option.column,
"xitongmokuaishujubiao"
);
xitongmokuaishujubiao.dicData = res.data.data;
if (index !== 1) {
this.form.xitongmokuaishujubiao = "";
if(xitongmokuaishujubiao.dicData.length !== 0){
this.form.xitongmokuaishujubiao = xitongmokuaishujubiao.dicData[0].id;
}else{
this.form.xitongmokuaishujubiao = ''
}
}
this.form.type = obj.type;
})
}else{
const xitongmokuaishujubiao = this.findObject( const xitongmokuaishujubiao = this.findObject(
this.option.column, this.option.column,
"xitongmokuaishujubiao" "xitongmokuaishujubiao"
); );
xitongmokuaishujubiao.dicData = res.data.data; xitongmokuaishujubiao.dicData = [];
this.form.type = obj.type; this.form.xitongmokuaishujubiao = ''
}); }
}, },
// //
async download(row) { async download(row) {
@ -355,20 +427,20 @@ export default {
option.group = groupArr; option.group = groupArr;
this.option = option; this.option = option;
// //
const companyData = await getCompany(); const companyData = await getCompany({isDetail:0});
this.companyList = companyData.data.data; this.companyList = companyData.data.data;
if (companyData.data.data.length > 0) { if (companyData.data.data.length > 0) {
const id = companyData.data.data[0].id; const id = companyData.data.data[0].id;
this.form.yunweigongsi = id; this.form.yunweigongsi = id;
this.companyChange(id); this.companyChange(id);
};
const taskParentData = await getTaskParent();
this.taskParentList = taskParentData.data.data;
if (this.$route.query.parent) {
const id = this.$route.query.parent;
this.form.renwufulei = id;
this.taskParentChange(id);
} }
// const taskParentData = await getTaskParent();
// this.taskParentList = taskParentData.data.data;
// if (this.$route.query.parent) {
// const id = this.$route.query.parent;
// this.form.renwufulei = id;
// this.taskParentChange(id);
// }
this.form.renwufulei = this.$route.query.parent; this.form.renwufulei = this.$route.query.parent;
const time = this.findObject( const time = this.findObject(
@ -390,9 +462,15 @@ export default {
this.initDraft(process.id).then((data) => { this.initDraft(process.id).then((data) => {
this.$confirm("是否恢复之前保存的草稿?", "提示", {}) this.$confirm("是否恢复之前保存的草稿?", "提示", {})
.then(() => { .then(() => {
this.isDraft = true
const form = JSON.parse(data); const form = JSON.parse(data);
this.systemChange(form.xitongmingchengshujuku, 1); // this.systemChange(form.xitongmingchengshujuku, 1);
this.companyChange(form.yunweigongsi)
// this.systemChange(form.xitongmingchengshujuku, 1);
this.form = form; this.form = form;
}) })
.catch(() => {}); .catch(() => {});
}); });

@ -127,6 +127,9 @@
@current-change="currentChange" @current-change="currentChange"
@size-change="sizeChange" @size-change="sizeChange"
> >
<template slot-scope="scope" slot="operateSysName">
<span>{{scope.row.operateSysName ? scope.row.operateSysName : scope.row.operateSys}}</span>
</template>
<template slot-scope="{ row }" slot="menu"> <template slot-scope="{ row }" slot="menu">
<el-button @click="details(row)">详情 </el-button> <el-button @click="details(row)">详情 </el-button>
</template> </template>

@ -121,7 +121,9 @@
>详情</el-button >详情</el-button
> >
</template> </template>
<template slot-scope="scope" slot="operateSysName">
<span>{{scope.row.operateSysName ? scope.row.operateSysName : scope.row.operateSys}}</span>
</template>
<template slot-scope="scope" slot="approvalStatus"> <template slot-scope="scope" slot="approvalStatus">
<span <span
:style="{ :style="{

Loading…
Cancel
Save