|
|
|
|
@ -33,6 +33,73 @@ |
|
|
|
|
:upload-preview="handleUploadPreview" |
|
|
|
|
:upload-after="uploadAfter" |
|
|
|
|
> |
|
|
|
|
<template slot="yunweigongsi"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.yunweigongsi" |
|
|
|
|
placeholder="请选择运维公司" |
|
|
|
|
@change="companyChange" |
|
|
|
|
:disabled="companyList.length === 1 || yunweiDisabled" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in companyList" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.name" |
|
|
|
|
:value="item.id" |
|
|
|
|
> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
<template slot="renwufulei"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.renwufulei" |
|
|
|
|
placeholder="请选择任务父类" |
|
|
|
|
:disabled="parentDisabled" |
|
|
|
|
@change="taskParentChange" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in taskParentList" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.dictValue" |
|
|
|
|
:value="item.id" |
|
|
|
|
> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
<template slot="renwuzhonglei"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.renwuzhonglei" |
|
|
|
|
placeholder="请选择任务种类" |
|
|
|
|
:disabled="kindDisabled" |
|
|
|
|
@change="changeKind" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in kindList" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.taskTypeName" |
|
|
|
|
:value="item.id" |
|
|
|
|
> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
<template slot="xitongmingchengshujuku"> |
|
|
|
|
<el-select |
|
|
|
|
filterable |
|
|
|
|
allow-create |
|
|
|
|
clearable |
|
|
|
|
v-model="form.xitongmingchengshujuku" |
|
|
|
|
placeholder="请选择系统名称/数据库/别名" |
|
|
|
|
:disabled="sqlDisabled" |
|
|
|
|
@change="systemChange" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in taskAndDataBaseList" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.databaseProjectName" |
|
|
|
|
:value="item.id" |
|
|
|
|
> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
<template slot="uploadrecord"> |
|
|
|
|
<el-table |
|
|
|
|
v-if="form.uploadrecord && form.uploadrecord.length > 0" |
|
|
|
|
@ -171,6 +238,20 @@ export default { |
|
|
|
|
}, |
|
|
|
|
immediate: true, |
|
|
|
|
}, |
|
|
|
|
// // 任务种类带出任务等级 |
|
|
|
|
// "form.renwuzhonglei"(val) { |
|
|
|
|
// if (val) { |
|
|
|
|
// const renwuzhonglei = this.findObject( |
|
|
|
|
// this.option.column, |
|
|
|
|
// "renwuzhonglei" |
|
|
|
|
// ); |
|
|
|
|
// for (let i in renwuzhonglei.dicData) { |
|
|
|
|
// if (val === renwuzhonglei.dicData[i].id) { |
|
|
|
|
// this.form.renwudengji = renwuzhonglei.dicData[i].taskLevel; |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// }, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -181,6 +262,14 @@ export default { |
|
|
|
|
vars: [], // 需要提交的字段 |
|
|
|
|
submitLoading: false, // 提交时按钮loading |
|
|
|
|
summaryOption: {}, // 汇总表单option |
|
|
|
|
taskParentList:[], //任务父类 |
|
|
|
|
taskAndDataBaseList:[], //系统名称/数据库 |
|
|
|
|
kindList:[],//任务种类 |
|
|
|
|
companyList:[], //运维公司 |
|
|
|
|
yunweiDisabled:false, //运维公司是否禁用 |
|
|
|
|
parentDisabled:false,//任务父类是否禁用 |
|
|
|
|
sqlDisabled:false,//数据库/系统名称是否禁用 |
|
|
|
|
kindDisabled:false, //任务种类是否禁用 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
@ -239,6 +328,83 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.form.uploadrecord.push(res); |
|
|
|
|
}, |
|
|
|
|
//切换任务父类 |
|
|
|
|
taskParentChange(id){ |
|
|
|
|
getTaskTypeData({ parentId: id,isDetail:0 }).then((res) => { |
|
|
|
|
// this.form.renwuzhonglei = ""; |
|
|
|
|
// this.form.renwudengji = ""; |
|
|
|
|
const renwuzhonglei = this.findObject( |
|
|
|
|
this.option.column, |
|
|
|
|
"renwuzhonglei" |
|
|
|
|
); |
|
|
|
|
// renwuzhonglei.dicData = res.data.data; |
|
|
|
|
this.kindList = res.data.data; |
|
|
|
|
if(res.data.data.length != 0){ |
|
|
|
|
this.form.renwuzhonglei = res.data.data[0].id; |
|
|
|
|
this.form.renwudengji = res.data.data[0].taskLevel; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
this.form.renwuzhonglei = ""; |
|
|
|
|
this.form.renwudengji = ""; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//切换任务种类 |
|
|
|
|
changeKind(id){ |
|
|
|
|
this.form.renwudengji = this.kindList.find(item => item.id == id).taskLevel |
|
|
|
|
}, |
|
|
|
|
//切换系统名称数据库 |
|
|
|
|
systemChange(id){ |
|
|
|
|
getDatabaseTab({ |
|
|
|
|
id: id, |
|
|
|
|
}).then(res =>{ |
|
|
|
|
let xitongmokuaishujubiao = this.findObject( |
|
|
|
|
this.option.column, |
|
|
|
|
"xitongmokuaishujubiao" |
|
|
|
|
); |
|
|
|
|
xitongmokuaishujubiao.dicData = res.data.data; |
|
|
|
|
if(xitongmokuaishujubiao.dicData.length !== 0){ |
|
|
|
|
this.form.xitongmokuaishujubiao = xitongmokuaishujubiao.dicData[0].id; |
|
|
|
|
}else{ |
|
|
|
|
this.form.xitongmokuaishujubiao = '' |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//切换运维公司 |
|
|
|
|
companyChange(id){ |
|
|
|
|
let obj = this.companyList.find(function (i) { |
|
|
|
|
return i.id === id; |
|
|
|
|
}); |
|
|
|
|
getDepts({ id: obj.deptId }).then((res) => { |
|
|
|
|
// const guanlibumen = this.findObject(this.option.column, "guanlibumen"); |
|
|
|
|
const guanlibumen = this.option.column[1]; |
|
|
|
|
guanlibumen.dicData = res.data.data; |
|
|
|
|
if (res.data.data.length === 1) { |
|
|
|
|
this.form.guanlibumen = guanlibumen.dicData[0].id; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
getDatabasePro({id:id}).then(res =>{ |
|
|
|
|
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 = ""; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 获取任务详情 |
|
|
|
|
getDetail(taskId, processInsId) { |
|
|
|
|
this.getTaskDetail(taskId, processInsId).then(async (res) => { |
|
|
|
|
@ -289,7 +455,6 @@ export default { |
|
|
|
|
detail: true, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// console.log(option.column.find(item => item.prop == 'renwudengji')) |
|
|
|
|
option.column.find(item => item.prop == 'renwudengji').dicUrl = '' |
|
|
|
|
this.option = option; |
|
|
|
|
this.vars = vars; |
|
|
|
|
@ -297,31 +462,65 @@ export default { |
|
|
|
|
const { yunweigongsi, renwufulei, xitongmingchengshujuku } = |
|
|
|
|
variables; |
|
|
|
|
// 其它下拉字典匹配 |
|
|
|
|
const companyData = await getCompany({isDetail:1}); |
|
|
|
|
let ywgs = this.findObject(option.column, "yunweigongsi"); |
|
|
|
|
ywgs.dicData = companyData.data.data; |
|
|
|
|
if(status !== 'todo'){ |
|
|
|
|
const companyData = await getCompany({isDetail:1}); |
|
|
|
|
// let ywgs = this.findObject(option.column, "yunweigongsi"); |
|
|
|
|
// ywgs.dicData = companyData.data.data; |
|
|
|
|
this.companyList = companyData.data.data |
|
|
|
|
// 任务父类 |
|
|
|
|
const taskParent = await getTaskParent(); |
|
|
|
|
this.taskParentList = taskParent.data.data |
|
|
|
|
// const rwfl = this.findObject(option.column, "renwufulei"); |
|
|
|
|
// rwfl.dicData = taskParent.data.data; |
|
|
|
|
// 任务种类 |
|
|
|
|
const taskTypeData = await getTaskTypeData({ parentId: renwufulei,isDetail:1 }); |
|
|
|
|
// const renwuzhonglei = this.findObject( |
|
|
|
|
// this.option.column, |
|
|
|
|
// "renwuzhonglei" |
|
|
|
|
// ); |
|
|
|
|
// renwuzhonglei.dicData = taskTypeData.data.data; |
|
|
|
|
this.kindList = taskTypeData.data.data |
|
|
|
|
// 任务等级 |
|
|
|
|
const taskTypeLevel = await getTaskLevel({isDetail:1 }); |
|
|
|
|
const renwudengji = this.findObject( |
|
|
|
|
this.option.column, |
|
|
|
|
"renwudengji" |
|
|
|
|
); |
|
|
|
|
renwudengji.dicData = taskTypeLevel.data.data; |
|
|
|
|
}else{ |
|
|
|
|
const companyData = await getCompany({isDetail:0}); |
|
|
|
|
this.companyList = companyData.data.data |
|
|
|
|
// let ywgs = this.findObject(option.column, "yunweigongsi"); |
|
|
|
|
// ywgs.dicData = companyData.data.data; |
|
|
|
|
// ywgs.disabled = ywgs.dicData.length == 1 ? true : false |
|
|
|
|
// 任务父类 |
|
|
|
|
const taskParent = await getTaskParent(); |
|
|
|
|
// const rwfl = this.findObject(option.column, "renwufulei"); |
|
|
|
|
// rwfl.dicData = taskParent.data.data; |
|
|
|
|
this.taskParentList = taskParent.data.data |
|
|
|
|
// 任务种类 |
|
|
|
|
const taskTypeData = await getTaskTypeData({ parentId: renwufulei,isDetail:0 }); |
|
|
|
|
// const renwuzhonglei = this.findObject( |
|
|
|
|
// this.option.column, |
|
|
|
|
// "renwuzhonglei" |
|
|
|
|
// ); |
|
|
|
|
// renwuzhonglei.dicData = taskTypeData.data.data; |
|
|
|
|
this.kindList = taskTypeData.data.data |
|
|
|
|
const taskTypeLevel = await getTaskLevel({isDetail:0 }); |
|
|
|
|
const renwudengji = this.findObject( |
|
|
|
|
this.option.column, |
|
|
|
|
"renwudengji" |
|
|
|
|
); |
|
|
|
|
renwudengji.dicData = taskTypeLevel.data.data; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 部门 |
|
|
|
|
const deptDate = await getDepts({ id: yunweigongsi }); |
|
|
|
|
const guanlibumen = this.findObject(option.column, "guanlibumen"); |
|
|
|
|
guanlibumen.dicData = deptDate.data.data; |
|
|
|
|
// 任务父类 |
|
|
|
|
const taskParent = await getTaskParent(); |
|
|
|
|
const rwfl = this.findObject(option.column, "renwufulei"); |
|
|
|
|
rwfl.dicData = taskParent.data.data; |
|
|
|
|
// 任务种类 |
|
|
|
|
const taskTypeData = await getTaskTypeData({ parentId: renwufulei,isDetail:1 }); |
|
|
|
|
const renwuzhonglei = this.findObject( |
|
|
|
|
this.option.column, |
|
|
|
|
"renwuzhonglei" |
|
|
|
|
); |
|
|
|
|
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({ |
|
|
|
|
// id: yunweigongsi, |
|
|
|
|
@ -329,16 +528,16 @@ export default { |
|
|
|
|
const taskAndDataBaseData = await getDatabasePro({ |
|
|
|
|
id: yunweigongsi, |
|
|
|
|
}); |
|
|
|
|
let datasql = this.findObject( |
|
|
|
|
this.option.column, |
|
|
|
|
"xitongmingchengshujuku" |
|
|
|
|
); |
|
|
|
|
datasql.dicData = taskAndDataBaseData.data.data; |
|
|
|
|
// let datasql = this.findObject( |
|
|
|
|
// this.option.column, |
|
|
|
|
// "xitongmingchengshujuku" |
|
|
|
|
// ); |
|
|
|
|
// datasql.dicData = taskAndDataBaseData.data.data; |
|
|
|
|
this.taskAndDataBaseList = taskAndDataBaseData.data.data; |
|
|
|
|
// 数据表 |
|
|
|
|
let obj = taskAndDataBaseData.data.data.find(function (i) { |
|
|
|
|
return i.id === xitongmingchengshujuku; |
|
|
|
|
}); |
|
|
|
|
console.log(obj) |
|
|
|
|
if(obj){ |
|
|
|
|
const moduleAndDataTableData = await getDatabaseTab({ |
|
|
|
|
id: obj.id, |
|
|
|
|
@ -355,7 +554,6 @@ export default { |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
console.log('variables',variables) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.form = variables; |
|
|
|
|
// this.form.renwuzhonglei = variables.renwuzhonglei |
|
|
|
|
@ -372,6 +570,10 @@ export default { |
|
|
|
|
for (const i in option.column) { |
|
|
|
|
option.column[i].disabled = true |
|
|
|
|
} |
|
|
|
|
this.yunweiDisabled = true |
|
|
|
|
this.parentDisabled = true |
|
|
|
|
this.sqlDisabled = true |
|
|
|
|
this.kindDisabled = true |
|
|
|
|
let shangchuan = this.findObject(option.column, "shangchuan"); |
|
|
|
|
shangchuan.display = false |
|
|
|
|
if (column && column.length > 0) { |
|
|
|
|
@ -390,6 +592,10 @@ export default { |
|
|
|
|
} else { |
|
|
|
|
const columnFilter = this.filterAvueColumn(column, taskForm); |
|
|
|
|
const columnArr = columnFilter.column; |
|
|
|
|
this.yunweiDisabled = columnArr.find(item => item.prop == 'yunweigongsi').disabled |
|
|
|
|
this.parentDisabled = columnArr.find(item => item.prop == 'renwufulei').disabled |
|
|
|
|
this.sqlDisabled = columnArr.find(item => item.prop == 'xitongmingchengshujuku').disabled |
|
|
|
|
this.kindDisabled = columnArr.find(item => item.prop == 'renwuzhonglei').disabled |
|
|
|
|
vars = columnFilter.vars || []; |
|
|
|
|
|
|
|
|
|
const groupArr = []; |
|
|
|
|
@ -436,7 +642,10 @@ export default { |
|
|
|
|
this.vars.forEach((v) => { |
|
|
|
|
if (v != "comment" && this.form[v]) variables[v] = this.form[v]; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
variables.xitongmingchengshujuku = this.form.xitongmingchengshujuku ? |
|
|
|
|
this.form.xitongmingchengshujuku : ''; |
|
|
|
|
variables.xitongmokuaishujubiao = this.form.xitongmokuaishujubiao ? |
|
|
|
|
this.form.xitongmokuaishujubiao : '' |
|
|
|
|
this.handleCompleteTask(pass, variables) |
|
|
|
|
.then(() => { |
|
|
|
|
this.$message.success("处理成功"); |
|
|
|
|
|