|
|
|
|
@ -1,11 +1,11 @@ |
|
|
|
|
<template> |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-skeleton :loading="waiting" avatar :rows="8"> |
|
|
|
|
<avue-title |
|
|
|
|
<!-- <avue-title |
|
|
|
|
style="margin-bottom: 20px" |
|
|
|
|
:styles="{ fontSize: '20px' }" |
|
|
|
|
:value="process.name" |
|
|
|
|
></avue-title> |
|
|
|
|
></avue-title> --> |
|
|
|
|
<el-card shadow="never" style="margin-top: 20px"> |
|
|
|
|
<avue-form |
|
|
|
|
v-if=" |
|
|
|
|
@ -20,27 +20,80 @@ |
|
|
|
|
:upload-preview="handleUploadPreview" |
|
|
|
|
:upload-after="uploadAfter" |
|
|
|
|
> |
|
|
|
|
<template slot="yunweigongsi"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.yunweigongsi" |
|
|
|
|
placeholder="请选择运维公司" |
|
|
|
|
@change="companyChange" |
|
|
|
|
:disabled="companyList.length===1" |
|
|
|
|
> |
|
|
|
|
<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="请选择任务父类" |
|
|
|
|
@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="xitongmingchengshujuku"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.xitongmingchengshujuku" |
|
|
|
|
placeholder="请选择系统名称/数据库" |
|
|
|
|
@change="systemChange" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in taskAndDataBaseList" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.name" |
|
|
|
|
:value="item.id" |
|
|
|
|
> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
<template slot="uploadrecord"> |
|
|
|
|
<el-table |
|
|
|
|
v-if="tableData.length > 0" |
|
|
|
|
:data="tableData" |
|
|
|
|
style="width: 100%" |
|
|
|
|
> |
|
|
|
|
<el-table-column prop="name" label="附件名称" width="180"> |
|
|
|
|
<el-table-column prop="name" label="附件名称" width="250"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span style="color: blue; cursor: pointer">{{ |
|
|
|
|
scope.row.name |
|
|
|
|
}}</span> |
|
|
|
|
<span |
|
|
|
|
style="color: blue; cursor: pointer" |
|
|
|
|
@click="download(scope.row)" |
|
|
|
|
>{{ scope.row.name }}</span |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="path" label="上传人" width="180"> |
|
|
|
|
<el-table-column prop="createUser" label="上传人" width="180"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="path" label="上传时间" width="180"> |
|
|
|
|
<el-table-column prop="createTime" label="上传时间" width="240"> |
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i class="el-icon-delete" style="cursor: pointer"></i> |
|
|
|
|
<template> |
|
|
|
|
<i |
|
|
|
|
class="el-icon-delete" |
|
|
|
|
style="cursor: pointer" |
|
|
|
|
@click="deleteFile(index)" |
|
|
|
|
></i> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
@ -93,6 +146,15 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { |
|
|
|
|
downloadFile, |
|
|
|
|
getCompany, |
|
|
|
|
getDepts, |
|
|
|
|
getTaskParent, |
|
|
|
|
getTaskTypeData, |
|
|
|
|
getTaskAndDataBase, |
|
|
|
|
getModuleAndDataTable, |
|
|
|
|
} from "@/api/plugin/workflow/form.js"; |
|
|
|
|
import WfExamineForm from "./examForm.vue"; |
|
|
|
|
import WfUserSelect from "./user-select"; |
|
|
|
|
import exForm from "../../mixins/ex-form"; |
|
|
|
|
@ -131,16 +193,101 @@ export default { |
|
|
|
|
process: {}, |
|
|
|
|
loading: false, |
|
|
|
|
tableData: [], |
|
|
|
|
companyList: [], //公司 |
|
|
|
|
deptList: [], //部门 |
|
|
|
|
taskParentList: [], //任务父类 |
|
|
|
|
taskAndDataBaseList: [], //数据库 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
// 运维公司 |
|
|
|
|
getCompany().then((res) => { |
|
|
|
|
this.companyList = res.data.data; |
|
|
|
|
if (this.companyList.length > 0) { |
|
|
|
|
const id = this.companyList[0].id |
|
|
|
|
this.form.yunweigongsi = id; |
|
|
|
|
this.companyChange(id) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
getTaskParent().then((res) => { |
|
|
|
|
this.taskParentList = res.data.data; |
|
|
|
|
if(this.$route.query.parent) { |
|
|
|
|
const id = this.$route.query.parent |
|
|
|
|
this.form.renwufulei = id |
|
|
|
|
this.taskParentChange(id) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
getTaskAndDataBase().then((res) => { |
|
|
|
|
this.taskAndDataBaseList = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
uploadAfter(file, column) { |
|
|
|
|
this.tableData.push({ |
|
|
|
|
name: "文件流", |
|
|
|
|
path: "/d:/sgh", |
|
|
|
|
// 运维公司-查部门 |
|
|
|
|
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"); |
|
|
|
|
guanlibumen.dicData = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 任务父类 |
|
|
|
|
taskParentChange(id) { |
|
|
|
|
getTaskTypeData({ parentId: id }).then((res) => { |
|
|
|
|
const renwuzhonglei = this.findObject( |
|
|
|
|
this.option.column, |
|
|
|
|
"renwuzhonglei" |
|
|
|
|
); |
|
|
|
|
renwuzhonglei.dicData = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
systemChange(id) { |
|
|
|
|
let obj = this.taskAndDataBaseList.find(function (i) { |
|
|
|
|
return i.id === id; |
|
|
|
|
}); |
|
|
|
|
getModuleAndDataTable({ id: obj.id, type: obj.type }).then((res) => { |
|
|
|
|
const xitongmokuaishujubiao = this.findObject( |
|
|
|
|
this.option.column, |
|
|
|
|
"xitongmokuaishujubiao" |
|
|
|
|
); |
|
|
|
|
xitongmokuaishujubiao.dicData = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 下载 |
|
|
|
|
async download(row) { |
|
|
|
|
let res = await downloadFile({ |
|
|
|
|
path: row.path, |
|
|
|
|
}); |
|
|
|
|
const fileName = res.headers["content-disposition"].split(";"); |
|
|
|
|
const filename2 = fileName[1].split("="); |
|
|
|
|
const filename3 = decodeURIComponent(filename2[1]); |
|
|
|
|
let blob = new Blob([res.data], { |
|
|
|
|
type: res.type, |
|
|
|
|
}); |
|
|
|
|
let downloadElement = document.createElement("a"); |
|
|
|
|
let href = window.URL.createObjectURL(blob); |
|
|
|
|
downloadElement.href = href; |
|
|
|
|
downloadElement.download = filename3; |
|
|
|
|
document.body.appendChild(downloadElement); |
|
|
|
|
downloadElement.click(); |
|
|
|
|
window.URL.revokeObjectURL(href); |
|
|
|
|
}, |
|
|
|
|
// 文件上传后 |
|
|
|
|
uploadAfter(res, done, loading, column) { |
|
|
|
|
this.tableData.push(res); |
|
|
|
|
done(); |
|
|
|
|
this.$message.success("上传成功!"); |
|
|
|
|
}, |
|
|
|
|
// 删除附件 |
|
|
|
|
deleteFile(index) { |
|
|
|
|
this.$confirm("确定要删除附件吗?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
}).then(() => { |
|
|
|
|
this.tableData.splice(index, 1); |
|
|
|
|
}); |
|
|
|
|
console.log(file); |
|
|
|
|
console.log(column); |
|
|
|
|
}, |
|
|
|
|
getForm(processId, processDefKey) { |
|
|
|
|
let param; |
|
|
|
|
@ -172,7 +319,7 @@ export default { |
|
|
|
|
option.column = columnArr; |
|
|
|
|
option.group = groupArr; |
|
|
|
|
this.option = option; |
|
|
|
|
console.log(this.option) |
|
|
|
|
|
|
|
|
|
// this.findObject(this.option.column, 'yunweigongsi').disabled = true |
|
|
|
|
// 输入框禁用 |
|
|
|
|
// const gongshimingcheng = this.findObject( |
|
|
|
|
@ -218,11 +365,4 @@ export default { |
|
|
|
|
-webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
|
|
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
|
|
|
|
} |
|
|
|
|
.aaa { |
|
|
|
|
// .avue-crud .el-input--small input, .avue-form .el-input--small input { |
|
|
|
|
// width: 420px; |
|
|
|
|
// height: 50px; |
|
|
|
|
// line-height: 50px; |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
|