集成任务日志、监控开发完成

This commit is contained in:
hyt 2024-05-10 15:33:45 +08:00
parent 87caa89eb2
commit 50209c8a9a
12 changed files with 2539 additions and 1133 deletions

View File

@ -5,7 +5,7 @@
ref="baseRightDialog" ref="baseRightDialog"
:footerShow="true" :footerShow="true"
:dialogVisible.sync="dialogVisible" :dialogVisible.sync="dialogVisible"
:title="dialogTitle + ' 集成前台任务'" :title="dialogTitle + ' 接口管理'"
@handleClose="handleDialogClose" @handleClose="handleDialogClose"
:type="dialogType" :type="dialogType"
:submitShow="submitShow" :submitShow="submitShow"
@ -162,8 +162,8 @@ export default {
if (type == 'add') { if (type == 'add') {
this.dialogTitle = '新增' this.dialogTitle = '新增'
this.dialogType = 'add' this.dialogType = 'add'
this.$nextTick(()=>{ this.$nextTick(() => {
this.$set(this.$refs.basicsForm.ruleForm,'state','0') this.$set(this.$refs.basicsForm.ruleForm, 'state', '0')
}) })
} }
@ -220,7 +220,7 @@ export default {
return return
} else { } else {
let params = { let params = {
...this.$refs.basicsForm.ruleForm, ...this.$refs.basicsForm.ruleForm
} }
if (this.dialogType == 'add') { if (this.dialogType == 'add') {
this.openLoading('submit') this.openLoading('submit')

File diff suppressed because it is too large Load Diff

View File

@ -824,7 +824,8 @@ export default {
color: #999; color: #999;
font-size: 13px; font-size: 13px;
display: block; display: block;
width: 180px; min-width: 80px;
max-width: 180px;
// text-align: left; // text-align: left;
} }

View File

@ -1,371 +1,235 @@
<template> <template>
<div> <div>
<base-layout ref="baseLayout" :buttonList="buttonList" @onFuncBtn="onFuncBtn" :querySwitch="true" <base-layout
:searchBtnList="searchBtnList" :searchList="requirementList" @search="handleSearchEvent" :isPage="true" ref="baseLayout"
@pageChange="handlePageChange" @onFuncSearchBtn="onFuncSearchBtn"> :buttonList="buttonList"
<div slot="main" slot-scope="{ tableHeight }"> @onFuncBtn="onFuncBtn"
<base-table ref="baseTable" :showIndex="true" :funWidth="300" :funData="funData" @onFunc="onFunc" :querySwitch="true"
:tabLoading.sync="tabLoading" :tableHeight="tableHeight" :tableData="tableData" :searchList="requirementList"
:fixedTable="'right'" :tableColumn="tableColumnData" :showSelect="true"> @search="handleSearchEvent"
<template v-slot:new_state="{ row }"> :isPage="true"
<div style="width: 100%"> @pageChange="handlePageChange"
<span v-if="row.new_state == 'Y'" style="color: #67c23a">成功</span> >
<span v-else-if="row.new_state == 'H'" style="color: #67c23a">已处理</span> <div slot="main" slot-scope="{ tableHeight }">
<span v-else style="color: #f56c6c">失败</span> <base-table
</div> ref="baseTable"
</template> :showIndex="true"
</base-table> :funWidth="180"
</div> :funData="funData"
</base-layout> @onFunc="onFunc"
<right-dialog ref="rightDialog" @resetTable="resetTable"></right-dialog> :tabLoading.sync="tabLoading"
:tableHeight="tableHeight"
:tableData="tableData"
:tableColumn="tableColumnData"
>
<template #taskStatus="{row}">
{{ taskStatusDist[row.taskStatus] }}
</template>
</base-table>
</div> </div>
</base-layout>
<right-dialog ref="rightDialog" @resetTable="resetTable"></right-dialog>
</div>
</template> </template>
<script> <script>
import baseLayout from "@/components/base/baseLayout"; import baseLayout from '@/components/base/baseLayout'
import baseTable from "@/components/base/baseTable"; import baseTable from '@/components/base/baseTable'
import rightDialog from "./rightDialog"; import rightDialog from './rightDialog.vue'
import configData from "./configData"; import { authApi } from '@/api/apis/auth'
import {
authApi
} from "@/api/apis/auth";
import { option } from "@/api/apis/detailData"
export default
{ export default {
components: { components: {
baseLayout, baseLayout,
baseTable, baseTable,
rightDialog, rightDialog
}, },
data() { data() {
return { return {
buttonList: [ buttonList: [
{ {
menuName: "刷新", menuName: '刷新',
icon: "el-icon-refresh", icon: 'el-icon-refresh',
btnFunction: "resetLoad", btnFunction: 'resetLoad'
}, }
], // ], //
searchBtnList: [ requirementList: [
{ {
name: "批量推送", placeholder: '任务名称',
btnFunction: "batchPush", prop: 'taskName',
}, tag: 'elInput'
], // }
requirementList: [ ], //list
{ tabLoading: false,
placeholder: "任务名称", tableColumnData: [
prop: "plugin_id", {
tag: "elSelect", prop: 'taskName',
options: [], label: '任务名称'
optionValue: "pluginId", },
optionLabel: "pluginName", {
}, prop: 'taskId',
{ label: '任务编码'
placeholder: "源系统编码", },
prop: "root_app_bill", {
tag: "elInput", prop: 'taskStatus',
}, label: '任务状态'
{ },
placeholder: "推送时间", {
prop: "new_push_date", prop: 'startTime',
tag: "elDatePicker", label: '当前任务开始时间'
valueFormat: "yyyy-MM-dd", },
}, {
{ prop: 'endTime',
placeholder: "业务⽇期", label: '结束时间'
prop: "business_date", },
tag: "elDatePicker", {
valueFormat: "yyyy-MM-dd", prop: 'diffTime',
}, label: '耗时'
{ }
placeholder: "下游系统单号", ], //
prop: "new_system_number", funData: [
tag: "elInput",
},
{
placeholder: "推送状态",
prop: "new_state",
tag: "elRadio",
options: [
{ label: "全部", value: "" },
{ label: "成功", value: "Y" },
{ label: "已处理", value: "H" },
{ label: "失败", value: "N" },
],
},
], //list
tabLoading: false,
tableColumnData: configData.tableColumnData, //
funData: [
{
color: "#6a9af1",
text: "查看",
},
{
color: "#6a9af1",
text: "重新推送",
},
{
color: "#6a9af1",
text: "手工处理",
},
{
color: "#d67a74",
text: "删除",
},
],
tableData: [], //
pageModel: {
pageNum: 1,
pageSize: 10,
},
queryModel: {
plugin_id: '',
root_app_bill: '',
new_push_date: '',
business_date: '',
new_system_number: '',
new_state: 'N'
},
};
},
mounted() {
this.$refs.baseLayout.getField("new_state", "N");
this.queryProductClassfy();
this.GetProductionTableData();
},
methods: {
//
async GetProductionTableData() {
this.tabLoading = true;
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "queryPage",
}, {
...this.pageModel,
...this.queryModel
})
this.tabLoading = false;
if (res.status == "200") {
this.tableData = res.attribute.list;
this.$refs.baseTable.setTableKey()
this.$refs.baseLayout.setPageTotal(res.attribute.total);
}
},
async queryProductClassfy() {
const res = await option({
tl: "pluginService",
as: "plugins",
dj: "queryPlugins",
}, {})
if (res.status == "200") { {
this.requirementList[0].options = res.attribute; color: '#6a9af1',
} text: '查看'
}, }
// ],
handleSearchEvent() { tableData: [], //
let data = this.$refs.baseLayout.ruleForm; pageModel: {
this.queryModel.plugin_id = data.plugin_id; pageNum: 1,
this.queryModel.root_app_bill = data.root_app_bill; pageSize: 100
this.queryModel.new_push_date = data.new_push_date; },
this.queryModel.business_date = data.business_date; queryModel: {
this.queryModel.new_system_number = data.new_system_number; code: '',
this.queryModel.new_state = data.new_state; name: '',
this.resetTable(); classify: '',
}, productionCompany: ''
// },
async batchPush() { taskStatusDist: {
let data = '' 1: '执行中',
this.$refs.baseTable.$refs.elTable.selection.forEach(el => { 2: '执行成功',
if (data == '') { 3: '执行失败'
data = el.id }
} else { }
data += `,${el.id}` },
} mounted() {
}); // this.queryProductClassfy();
if (data.length > 0) { this.GetProductionTableData()
this.$confirm("确认重新推送吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.openLoading("submit");
this.rePushBatch(data)
})
.catch(() => {
this.$vmNews("取消操作", "info");
});
} else {
this.$vmNews("请选择需要推送的单据", "warning");
}
},
async rePushBatch(data) {
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "batchPush",
}, {
id: data
})
if (res.status == "200") {
this.$vmNews("批量推送成功", "success");
this.resetTable();
}
},
//
handlePageChange(val) {
this.pageModel.pageNum = val.pageIndex;
this.pageModel.pageSize = val.pageSize;
this.GetProductionTableData();
},
//
onFuncBtn(btn) {
this[btn.btnFunction]();
},
//
onFuncSearchBtn(btn) {
this[btn.btnFunction]();
},
//
add() {
this.$refs.rightDialog.openDialog("add");
},
//
async onFunc(index, row) {
//
if (index == 0) {
this.openLoading("detail");
this.$refs.rightDialog.openDialog("show", row);
}
//
if (index == 1) {
this.$confirm("确认重新推送吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.openLoading("submit");
this.handleRePush(row);
})
.catch(() => {
this.$vmNews("取消操作", "info");
});
}
//
if (index == 2) {
this.$prompt("请填写旺店通或者NC的单据号方便以后排查", "提示", {
confirmButtonText: "提交",
cancelButtonText: "取消",
inputType: "textarea",
inputValidator: (value) => {
if (!value) {
return "请输入处理内容";
}
},
})
.then(({ value }) => {
this.openLoading("submit");
let params =
{
id: row.id,
processing_remarks: value,
}
;
this.updateManualProcess(params);
})
.catch(() => {
this.$message({
type: "info",
message: "取消操作",
});
});
}
//
if (index == 3) {
this.$confirm("确认删除该内容吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.openLoading("del");
this.productionDeleteById(row.id);
})
.catch(() => {
this.$vmNews("取消操作", "info");
});
}
},
async handleRePush(row) {
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "repush",
}, {
id: row.id
})
if (res.status == "200") {
this.$vmNews("补推成功", "success");
this.resetTable();
} else if (res.status == "500") {
this.$message({
title: "补推失败",
showClose: true,
message: res.msg,
duration: 0,
type: "error",
});
this.resetTable();
}
},
async updateManualProcess(val) {
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "manualProcessing",
}, val)
if (res.status == "200") {
this.$vmNews("手工处理成功", "success");
this.resetTable();
}
},
async productionDeleteById(id) {
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "deleteEntity",
}, {
id
})
if (res.status == "200") {
this.$vmNews("删除成功", "success");
this.resetTable();
}
},
//
resetTable() {
this.pageModel.pageNum = 1;
this.$refs.baseLayout.pageClear();
this.GetProductionTableData();
},
},
};
},
methods: {
onCellClick(row) {
this.openLoading('detail')
this.$refs.rightDialog.openDialog('show', row)
},
//
async GetProductionTableData() {
this.tabLoading = true
let param = {
...this.pageModel,
...this.queryModel
}
let res = await authApi(
'integrationTaskLivingDetailsService',
'',
'queryEntityPage',
'',
param
)
this.tabLoading = false
if (res.status == '200') {
this.tableData = res.attribute.list
this.$refs.baseLayout.setPageTotal(res.attribute.total)
}
},
//
handlePageChange(val) {
this.pageModel.pageNum = val.pageIndex
this.pageModel.pageSize = val.pageSize
this.GetProductionTableData()
},
//
onFuncBtn(btn) {
this.onCellClick()
// this[btn.btnFunction]()
},
//
add() {
this.$refs.rightDialog.openDialog('add')
},
//
onFunc(index, row, item) {
//
if (item.text === '查看') {
this.openLoading('detail')
this.$refs.rightDialog.openDialog('show', row)
}
//
if (item.text === '编辑') {
this.openLoading('detail')
this.$refs.rightDialog.openDialog('edit', row)
}
//
if (item.text === '删除') {
this.$delConfirm().then(() => {
this.openLoading('del')
this.productionDeleteById(row.id)
})
}
},
async productionDeleteById(id) {
let param = {
id: id
}
let res = await authApi(
'sysPlugArgService',
'integrationTaskService',
'deletePlugArg',
'',
param
)
if (res.status == '200') {
this.$vmNews('删除成功', 'success')
this.resetTable()
}
},
//
resetTable() {
this.pageModel.pageNum = 1
this.$refs.baseLayout.pageClear()
this.GetProductionTableData()
},
//
handleSearchEvent() {
let data = this.$refs.baseLayout.ruleForm
this.queryModel = data
this.resetTable()
},
//
async queryProductClassfy() {
let params = {
tab_name: 'sys_product',
column_name: 'classify'
}
let res = await authApi(
'generalServiceImpl',
'dictionaryshop',
'selectDictionaryshop',
'',
params
)
if (res.status == '200') {
this.requirementList[2].options = res.attribute
}
}
}
}
</script> </script>
<style scoped> <style scoped>
.clickTitle { .clickTitle {
color: #409eff; color: #409eff;
cursor: pointer; cursor: pointer;
}
::v-deep .searchBox:nth-child(6) {
width: 250px !important;
} }
</style> </style>

View File

@ -1,133 +1,317 @@
<template> <template>
<div> <div>
<base-right-dialog ref="baseRightDialog" :footerShow="true" :dialogVisible.sync="dialogVisible" <base-right-dialog
:title="dialogTitle + ' 集成产品清单'" @handleClose="handleDialogClose" :type="dialogType" :submitShow="submitShow" ref="baseRightDialog"
@handleConfirmClick="handleConfirmClick"> :footerShow="true"
<base-form ref="basicsForm" :formRow="formRow" :isFunBtn="false" :rules="basicsRules" class="dialog_form" :dialogVisible.sync="dialogVisible"
:spanWidth="`120px`" :loading="vLoading"></base-form> :title="dialogTitle + ' 集成任务日志'"
@handleClose="handleDialogClose"
:type="dialogType"
:submitShow="submitShow"
@handleConfirmClick="handleConfirmClick"
>
<base-form
ref="basicsForm"
:formRow="formRow"
:isFunBtn="false"
class="dialog_form"
:spanWidth="`120px`"
:loading="vLoading"
@onSelect="onSelect"
></base-form>
<!-- <el-button-->
<!-- style="width: 125px; margin: 20px 0"-->
<!-- @click="addVersionDialog"-->
<!-- icon="el-icon-plus"-->
<!-- :disabled="submitShow ? false : true"-->
<!-- v-if="submitShow"-->
<!-- >添加</el-button-->
<!-- >-->
<!-- <base-table-->
<!-- :border="true"-->
<!-- :showIndex="true"-->
<!-- :tableColumn="tableVersionColumn"-->
<!-- :tableData="tableVersionData"-->
<!-- :funWidth="80"-->
<!-- :funData="funData"-->
<!-- @onFunc="onFunc"-->
<!-- >-->
<!-- <template v-slot:argName="{ row }" >-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.argName}}</template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argName"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow || row.disabled"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argCode="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">-->
<!-- {{ row.argCode }}-->
<!-- </template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argCode"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argType="{ row }">-->
<!-- <div style="width: 100%">-->
<!--&lt;!&ndash; <el-radio-group v-model="row.argType" :disabled="!submitShow">&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="1">字符串</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="2">日期</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; </el-radio-group>&ndash;&gt;-->
<!-- <el-select v-model="row.argType" placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:remark="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.remark}}</template>-->
<!-- <el-input-->
<!-- v-model="row.remark"-->
<!-- clearable-->
<!-- type="text"-->
<!-- v-else-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- </base-table>-->
</base-right-dialog> </base-right-dialog>
</div> </div>
</template> </template>
<script> <script>
import baseRightDialog from "@/components/base/baseRightDialog"; import baseRightDialog from '@/components/base/baseRightDialog'
import baseForm from "@/components/base/baseNewForm"; import baseForm from '@/components/base/baseNewForm'
import baseTable from "@/components/base/baseTable"; import baseTable from '@/components/base/baseTable'
import configData from "./configData"; import { authApi } from '@/api/apis/auth'
import { authApi } from "@/api/apis/auth";
import { option } from "@/api/apis/detailData"
export default { export default {
components: { components: {
baseRightDialog, baseRightDialog,
baseForm, baseForm,
baseTable, baseTable
}, },
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
dialogTitle: "", dialogTitle: '',
dialogType: "", dialogType: '',
formRow: configData.formRow, formRow: [],
basicsRules: configData.basicsRules, basicsRules: [],
vLoading: false, vLoading: false,
newMarryOptions: [], newMarryOptions: [],
submitShow: true, submitShow: true,
loadingType: true, loadingType: true,
tableVersionData: [], tableVersionData: [],
tableVersionColumn: configData.tableVersionColumn, tableVersionColumn: [],
funData: [], funData: [],
isEdit: false isEdit: false,
}; select_dist: {},
options: [
{
label: '字符串',
value: '1'
},
{
label: '日期范围选择',
value: '2'
},
{
label: '年月',
value: '3'
},
{
label: '年月日',
value: '4'
},
{
label: '年月日时间',
value: '5'
}
]
}
},
mounted() {
this.initSelect()
}, },
mounted() { },
methods: { methods: {
//
async initSelect() {
let res = await authApi(
'pluginService',
'plugins',
'queryPluginsByType',
'',
{
'pluginType': '1'
}
)
if (res.status == 200) {
console.log(res.attribute)
res.attribute.forEach(item => {
this.$set(this.select_dist, item.pluginId, item)
})
this.formRow[0].elCol[0].options = res.attribute
}
},
//
onSelect(val, index, indexRow, obj) {
this.$set(this.$refs.basicsForm.ruleForm, 'plugName', this.select_dist[val]['pluginName'])
},
openDialog(type, row) { openDialog(type, row) {
// this.queryProductClassfy(); // this.queryProductClassfy();
this.formRow = configData.formRow; this.formRow = []
this.submitShow = true; this.submitShow = true
this.isEdit = false this.isEdit = false
this.funData = [ this.funData = [
{ {
color: "#ff0000", color: '#ff0000',
text: "删除", text: '删除'
} }
] ]
// //
if (type == "add") { if (type == 'add') {
this.dialogTitle = "新增"; this.dialogTitle = '新增'
this.dialogType = "add"; this.dialogType = 'add'
} }
// //
if (type == "edit") { if (type == 'edit') {
this.isEdit = true this.isEdit = true
this.dialogTitle = "编辑"; this.dialogTitle = '编辑'
this.dialogType = "edit"; this.dialogType = 'edit'
this.productGetById(row.id); this.productGetById(row.id)
} }
// //
if (type == "show") { if (type == 'show') {
this.funData = Object.assign([], []) this.funData = Object.assign([], [])
this.submitShow = false; this.submitShow = false
this.formRow = configData.formRowShow; this.formRow = [
this.dialogTitle = "查看"; {
this.dialogType = "show"; elCol: [
this.productGetById(row.id); {
} label: '任务编码',
this.dialogVisible = true; prop: 'taskCode',
}, tag: 'elInput',
async productGetById(id) { disabled: true
this.openLoading("detail"); },
const res = await option({ {
tl: "integration_task_living_detailsService", label: '任务名称',
as: "integrationTaskLog", prop: 'taskName',
dj: "queryEntity", tag: 'elInput',
}, { disabled: true
id }
}) ]
if (res.status == '200') { },
this.$refs.basicsForm.incomingParameters(res.attribute); {
} elCol: [
}, {
label: '任务状态',
prop: 'taskStatus',
tag: 'elRadio',
disabled: true,
options: [
{
label: '执行中',
value: '1'
},
{
label: '执行成功',
value: '2'
},
{
label: '执行失败',
value: '3'
}
],
span: 24
}
]
},
{
elCol: [
{
label: '当前任务开始时间',
prop: 'startTime',
tag: 'elInput',
disabled: true
},
{
label: '结束时间',
prop: 'endTime',
tag: 'elInput',
disabled: true
}
]
},
{
elCol: [
{
label: '耗时',
prop: 'diffTime',
tag: 'elInput',
disabled: true
},
{
label: '备注',
prop: 'remark',
tag: 'elInput',
disabled: true
}
]
}
]
this.dialogTitle = '查看'
this.dialogType = 'show'
this.productGetById(row.id)
}
this.dialogVisible = true
},
// //
// async productGetById(id) { async productGetById(id) {
// let params = { let params = {
// id: id, id: id
// }; }
// let res = await authApi( let res = await authApi(
// "sysProductService", 'integrationTaskLivingDetailsService',
// "product", '',
// "queryProduct", 'getEntity',
// "", '',
// params params
// ); )
// if (res.status == "200") { if (res.status == '200') {
// this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.basicsForm.incomingParameters(res.attribute); this.$refs.basicsForm.incomingParameters(res.attribute)
// let result = []; // this.tableVersionData = res.attribute.sysPlugArgDetailEntityList
// if (res.attribute.sysProductVersionList.length > 0) { // let result = [];
// res.attribute.sysProductVersionList.forEach((item) => { // this.tableVersionData = Object.assign([], result);
// let obj = { })
// id: item.id, }
// versionNumber: item.versionNumber, },
// versionDescription: item.versionDescription,
// disabled: true
// };
// result.push(obj);
// });
// }
// this.tableVersionData = Object.assign([], result);
// });
// }
// },
addVersionDialog() { addVersionDialog() {
let obj = { let obj = {
id: new Date().getTime().toString(), argName: '',
versionNumber: "", argCode: '',
versionDescription: "", argType: '1',
disabled: false remark: ''
}; }
this.tableVersionData.push(obj); this.tableVersionData.push(obj)
}, },
// //
onFunc(index, row) { onFunc(index, row) {
@ -135,99 +319,103 @@ export default {
this.$delConfirm().then(() => { this.$delConfirm().then(() => {
this.tableVersionData.forEach((item, itemIndex) => { this.tableVersionData.forEach((item, itemIndex) => {
if (item.id === row.id) { if (item.id === row.id) {
this.tableVersionData.splice(itemIndex, 1); this.tableVersionData.splice(itemIndex, 1)
} }
}); })
}); })
} }
}, },
// //
handleDialogClose() { handleDialogClose() {
this.tableVersionData = Object.assign([], []); this.tableVersionData = Object.assign([], [])
this.$refs.basicsForm.resetFields(); this.$refs.basicsForm.resetFields()
this.dialogVisible = false; this.dialogVisible = false
}, },
// //
handleConfirmClick() { handleConfirmClick() {
this.$refs.basicsForm.$refs["ruleForm"].validate((valid) => { this.$refs.basicsForm.$refs['ruleForm'].validate((valid) => {
if (!valid) { if (!valid) {
return; return
} else { } else {
if (!this.tableVersionData.length) {
this.$vmNews('请添加列表')
return
}
let flag = this.tableVersionData.some(item => {
if (!item.argName) {
this.$vmNews('请输入参数名称')
return true
}
if (!item.argCode) {
this.$vmNews('参数编码')
return true
}
})
if (flag) return
let params = { let params = {
...this.$refs.basicsForm.ruleForm, ...this.$refs.basicsForm.ruleForm,
sysProductVersionList: [], sysPlugArgDetailEntityList: this.tableVersionData
};
let result = [];
if (this.tableVersionData.length > 0) {
this.tableVersionData.forEach((item) => {
let obj = {
versionNumber: item.versionNumber,
versionDescription: item.versionDescription,
};
result.push(obj);
});
} }
params.sysProductVersionList = Object.assign([], result); if (this.dialogType == 'add') {
if (this.dialogType == "add") { this.openLoading('submit')
this.openLoading("submit"); this.productSaveDto(params)
this.productSaveDto(params);
} }
if (this.dialogType == "edit") { if (this.dialogType == 'edit') {
this.openLoading("submit"); this.openLoading('submit')
this.productUpdateDto(params); this.productUpdateDto(params)
} }
} }
}); })
}, },
// //
async productSaveDto(params) { async productSaveDto(params) {
let res = await authApi( let res = await authApi(
"sysProductService", 'sysPlugArgService',
"product", 'integrationTaskService',
"addProduct", 'savePlugArg',
"", '',
params params
); )
if (res.status == "200") { if (res.status == '200') {
this.handleDialogClose(); this.handleDialogClose()
this.$vmNews("新增成功", "success"); this.$vmNews('新增成功', 'success')
this.$emit("resetTable"); this.$emit('resetTable')
} }
}, },
// //
async productUpdateDto(params) { async productUpdateDto(params) {
let res = await authApi( let res = await authApi(
"sysProductService", 'sysPlugArgService',
"product", 'integrationTaskService',
"updateProduct", 'updatePlugArg',
"", '',
params params
); )
if (res.status == "200") { if (res.status == '200') {
this.handleDialogClose(); this.handleDialogClose()
this.$vmNews("更新成功", "success"); this.$vmNews('更新成功', 'success')
this.$emit("resetTable"); this.$emit('resetTable')
} }
}, },
// //
async queryProductClassfy() { async queryProductClassfy() {
let params = { let params = {
tab_name: "sys_product", tab_name: 'sys_product',
column_name: "classify", column_name: 'classify'
};
let res = await authApi(
"generalServiceImpl",
"dictionaryshop",
"selectDictionaryshop",
"",
params
);
if (res.status == "200") {
this.formRow[1].elCol[0].options = res.attribute;
} }
}, let res = await authApi(
}, 'generalServiceImpl',
}; 'dictionaryshop',
'selectDictionaryshop',
'',
params
)
if (res.status == '200') {
this.formRow[1].elCol[0].options = res.attribute
}
}
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -261,4 +449,4 @@ export default {
::v-deep .app-container { ::v-deep .app-container {
height: auto !important; height: auto !important;
} }
</style> </style>

View File

@ -193,6 +193,16 @@ export default {
text: '查看', text: '查看',
color: '#5a9cf8' color: '#5a9cf8'
}, },
{
type: 'start',
text: '启用',
color: '#5a9cf8'
},
{
type: 'stop',
text: '停用',
color: '#e47470'
},
{ {
type: 'dele', type: 'dele',
text: '删除', text: '删除',
@ -291,13 +301,11 @@ export default {
{} {}
) )
if (res.status == 200) { if (res.status == 200) {
console.log(res)
this.treeData = res.attribute this.treeData = res.attribute
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.menuTree.clickFirst() this.$refs.menuTree.clickFirst()
}) })
} }
console.log(res, '🌲')
}, },
// //
treeAppendHandle(data) { treeAppendHandle(data) {
@ -323,7 +331,6 @@ export default {
treeRemoveHandle(data) { treeRemoveHandle(data) {
this.$confirm('确认删除?') this.$confirm('确认删除?')
.then(async() => { .then(async() => {
console.log(1)
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: 'integrationTaskClassificationService', tl: 'integrationTaskClassificationService',
@ -334,7 +341,6 @@ export default {
id: data.id //id id: data.id //id
} }
) )
console.log(res)
if (res.status == 200) { if (res.status == 200) {
this.$nextTick(() => { this.$nextTick(() => {
this.initTreeData() this.initTreeData()
@ -365,10 +371,9 @@ export default {
pageNum: this.pageModel.pageIndex, pageNum: this.pageModel.pageIndex,
pageSize: this.pageModel.limit, pageSize: this.pageModel.limit,
task_app: this.appId, task_app: this.appId,
...obj, ...obj
} }
) )
console.log(res, 'tabledata')
if (res.status == 200) { if (res.status == 200) {
this.tableData = res.attribute.list this.tableData = res.attribute.list
this.pageModel.total = res.attribute.total this.pageModel.total = res.attribute.total
@ -388,7 +393,6 @@ export default {
}, },
// //
homeHandleNodeClick(data) { homeHandleNodeClick(data) {
console.log(data, 'data')
this.pageModel.pageIndex = 1 this.pageModel.pageIndex = 1
this.pageModel.total = 0 this.pageModel.total = 0
this.pageModel.limit = 10 this.pageModel.limit = 10
@ -414,9 +418,7 @@ export default {
this.$set(this.pluginDist, item.id, item.label) this.$set(this.pluginDist, item.id, item.label)
}) })
this.SearchformRow[1].elCol[0].options = res.attribute this.SearchformRow[1].elCol[0].options = res.attribute
console.log(this.SearchformRow[1].elCol[0], 'this.SearchformRow[1].elCol[0]')
} }
console.log(res, '拿到插件列表')
}, },
// //
currentChangeHandle(pageModel) { currentChangeHandle(pageModel) {
@ -426,14 +428,13 @@ export default {
}) })
}, },
// //
tableButtonHandle(val, item) { async tableButtonHandle(val, item) {
if (item.type === 'view') { if (item.type === 'view') {
this.$router.push({ this.$router.push({
name: 'taskAdd', name: 'taskAdd',
query: { id: val.id, lookFlag: true } query: { id: val.id, lookFlag: true }
}) })
} else if (item.type === 'dele') { } else if (item.type === 'dele') {
console.log(111)
this.$confirm('确认删除?') this.$confirm('确认删除?')
.then(async() => { .then(async() => {
const res = await getUserModuleApi( const res = await getUserModuleApi(
@ -454,16 +455,33 @@ export default {
this.pageModel.pageIndex-- this.pageModel.pageIndex--
} }
this.$nextTick(() => { this.$nextTick(() => {
this.$vmNews("删除成功",'success') this.$vmNews('删除成功', 'success')
this.initTableData({ ...this.searchForm }) this.initTableData({ ...this.searchForm })
}) })
} }
}) })
.catch((err) => { .catch((err) => {
console.log(err)
}) })
} else if (item.type === 'edit') { } else if (item.type === 'edit') {
this.$router.push({ name: 'taskAdd', query: { id: val.id } }) this.$router.push({ name: 'taskAdd', query: { id: val.id } })
} else if (item.type === 'start') {
const res = await authApi('integrationTaskService', '', 'enableDisableEntity', '', {
'id': val.id,
'taskStatus': '1' //12
})
if (res.status === '200') {
this.$vmNews(res.msg, 'success')
this.initTableData()
}
} else if (item.type === 'stop') {
const res = await authApi('integrationTaskService', '', 'enableDisableEntity', '', {
'id': val.id,
'taskStatus': '2' //12
})
if (res.status === '200') {
this.$vmNews(res.msg, 'success')
this.initTableData()
}
} }
} }
}, },

View File

@ -245,4 +245,4 @@ export default {
margin-top: 20px; margin-top: 20px;
} }
} }
</style> </style>

View File

@ -0,0 +1,464 @@
<template>
<div>
<base-right-dialog
ref="baseRightDialog"
:footerShow="true"
:dialogVisible.sync="dialogVisible"
:title="dialogTitle + ' 集成任务监控'"
@handleClose="handleDialogClose"
:type="dialogType"
:submitShow="submitShow"
@handleConfirmClick="handleConfirmClick"
>
<base-form
ref="basicsForm"
:formRow="formRow"
:isFunBtn="false"
class="dialog_form"
:spanWidth="`120px`"
:loading="vLoading"
@onSelect="onSelect"
></base-form>
<!-- <el-button-->
<!-- style="width: 125px; margin: 20px 0"-->
<!-- @click="addVersionDialog"-->
<!-- icon="el-icon-plus"-->
<!-- :disabled="submitShow ? false : true"-->
<!-- v-if="submitShow"-->
<!-- >添加</el-button-->
<!-- >-->
<!-- <base-table-->
<!-- :border="true"-->
<!-- :showIndex="true"-->
<!-- :tableColumn="tableVersionColumn"-->
<!-- :tableData="tableVersionData"-->
<!-- :funWidth="80"-->
<!-- :funData="funData"-->
<!-- @onFunc="onFunc"-->
<!-- >-->
<!-- <template v-slot:argName="{ row }" >-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.argName}}</template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argName"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow || row.disabled"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argCode="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">-->
<!-- {{ row.argCode }}-->
<!-- </template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argCode"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argType="{ row }">-->
<!-- <div style="width: 100%">-->
<!--&lt;!&ndash; <el-radio-group v-model="row.argType" :disabled="!submitShow">&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="1">字符串</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="2">日期</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; </el-radio-group>&ndash;&gt;-->
<!-- <el-select v-model="row.argType" placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:remark="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.remark}}</template>-->
<!-- <el-input-->
<!-- v-model="row.remark"-->
<!-- clearable-->
<!-- type="text"-->
<!-- v-else-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- </base-table>-->
</base-right-dialog>
</div>
</template>
<script>
import baseRightDialog from "@/components/base/baseRightDialog";
import baseForm from "@/components/base/baseNewForm";
import baseTable from "@/components/base/baseTable";
import { authApi } from "@/api/apis/auth";
export default {
components: {
baseRightDialog,
baseForm,
baseTable,
},
data() {
return {
dialogVisible: false,
dialogTitle: "",
dialogType: "",
formRow: [],
basicsRules: [],
vLoading: false,
newMarryOptions: [],
submitShow: true,
loadingType: true,
tableVersionData: [],
tableVersionColumn: [],
funData: [],
isEdit: false,
select_dist:{},
options:[
{
label:"字符串",
value:"1"
},
{
label:"日期范围选择",
value:"2"
},
{
label:"年月",
value:"3"
},
{
label:"年月日",
value:"4"
},
{
label:"年月日时间",
value:"5"
},
]
};
},
mounted() {
this.initSelect()
},
methods: {
//
async initSelect(){
let res = await authApi(
"pluginService",
"plugins",
"queryPluginsByType",
"",
{
"pluginType": "1"
}
);
if(res.status == 200){
console.log(res.attribute)
res.attribute.forEach(item=>{
this.$set(this.select_dist,item.pluginId,item)
})
this.formRow[0].elCol[0].options = res.attribute
}
},
//
onSelect(val, index, indexRow, obj){
this.$set(this.$refs.basicsForm.ruleForm,'plugName',this.select_dist[val]['pluginName'])
},
openDialog(type, row) {
// this.queryProductClassfy();
this.formRow = [];
this.submitShow = true;
this.isEdit = false
this.funData = [
{
color: "#ff0000",
text: "删除",
}
]
//
if (type == "add") {
this.dialogTitle = "新增";
this.dialogType = "add";
}
//
if (type == "edit") {
this.isEdit = true
this.dialogTitle = "编辑";
this.dialogType = "edit";
this.productGetById(row.id);
}
//
if (type == "show") {
this.funData = Object.assign([],[])
this.submitShow = false;
this.formRow = [
{
elCol: [
{
label: "任务编码",
prop: "taskCode",
tag: "elInput",
disabled:true,
},
{
label: "任务名称",
prop: "taskName",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "任务状态",
prop: "taskStatus",
tag: "elRadio",
disabled:true,
options:[
{
label:"执行中",
value:'1'
},
{
label:"待执行",
value:'2'
},
{
label:"错误",
value:'3'
},
],
span:24,
},
],
},
{
elCol: [
{
label: "上次开始时间",
prop: "oldStartTime",
tag: "elInput",
disabled:true,
},
{
label: "当前任务开始时间",
prop: "startTime",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "结束时间",
prop: "endTime",
tag: "elInput",
disabled:true,
},
{
label: "耗时",
prop: "diffTime",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "运行次数",
prop: "`runNum",
tag: "elInput",
disabled:true,
},
],
},
];
this.dialogTitle = "查看";
this.dialogType = "show";
this.productGetById(row.id);
}
this.dialogVisible = true;
},
//
async productGetById(id) {
let params = {
id: id,
};
let res = await authApi(
"integrationTaskLivingService",
"",
"getEntity",
"",
params
);
if (res.status == "200") {
this.$nextTick(() => {
this.$refs.basicsForm.incomingParameters(res.attribute);
// this.tableVersionData = res.attribute.sysPlugArgDetailEntityList
// let result = [];
// this.tableVersionData = Object.assign([], result);
});
}
},
addVersionDialog() {
let obj = {
argName:"",
argCode:"",
argType:"1",
remark:"",
};
this.tableVersionData.push(obj);
},
//
onFunc(index, row) {
if (index == 0) {
this.$delConfirm().then(() => {
this.tableVersionData.forEach((item, itemIndex) => {
if (item.id === row.id) {
this.tableVersionData.splice(itemIndex, 1);
}
});
});
}
},
//
handleDialogClose() {
this.tableVersionData = Object.assign([], []);
this.$refs.basicsForm.resetFields();
this.dialogVisible = false;
},
//
handleConfirmClick() {
this.$refs.basicsForm.$refs["ruleForm"].validate((valid) => {
if (!valid) {
return;
} else {
if(!this.tableVersionData.length){
this.$vmNews("请添加列表")
return
}
let flag = this.tableVersionData.some(item=>{
if(!item.argName){
this.$vmNews("请输入参数名称")
return true
}
if(!item.argCode){
this.$vmNews("参数编码")
return true
}
})
if(flag) return
let params = {
...this.$refs.basicsForm.ruleForm,
sysPlugArgDetailEntityList: this.tableVersionData,
};
if (this.dialogType == "add") {
this.openLoading("submit");
this.productSaveDto(params);
}
if (this.dialogType == "edit") {
this.openLoading("submit");
this.productUpdateDto(params);
}
}
});
},
//
async productSaveDto(params) {
let res = await authApi(
"sysPlugArgService",
"integrationTaskService",
"savePlugArg",
"",
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("新增成功", "success");
this.$emit("resetTable");
}
},
//
async productUpdateDto(params) {
let res = await authApi(
"sysPlugArgService",
"integrationTaskService",
"updatePlugArg",
"",
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("更新成功", "success");
this.$emit("resetTable");
}
},
//
async queryProductClassfy() {
let params = {
tab_name: "sys_product",
column_name: "classify",
};
let res = await authApi(
"generalServiceImpl",
"dictionaryshop",
"selectDictionaryshop",
"",
params
);
if (res.status == "200") {
this.formRow[1].elCol[0].options = res.attribute;
}
},
},
};
</script>
<style scoped lang="scss">
.dialogList {
padding: 16px 0;
border-top: 1px solid #dcdfe6;
display: flex;
flex-direction: column;
}
.updateBtn {
border: 1px solid #ebedf1;
padding: 5px 0;
border-radius: 3px;
text-align: center;
font-size: 14px;
cursor: pointer;
width: 100px;
}
.updateBtn:hover {
color: #1890ff;
border-color: #badeff;
background-color: #e8f4ff;
}
::v-deep .el-table__body-wrapper.is-scrolling-none {
height: auto !important;
}
::v-deep .app-container {
height: auto !important;
}
</style>

View File

@ -0,0 +1,464 @@
<template>
<div>
<base-right-dialog
ref="baseRightDialog"
:footerShow="true"
:dialogVisible.sync="dialogVisible"
:title="dialogTitle + ' 集成任务监控'"
@handleClose="handleDialogClose"
:type="dialogType"
:submitShow="submitShow"
@handleConfirmClick="handleConfirmClick"
>
<base-form
ref="basicsForm"
:formRow="formRow"
:isFunBtn="false"
class="dialog_form"
:spanWidth="`120px`"
:loading="vLoading"
@onSelect="onSelect"
></base-form>
<!-- <el-button-->
<!-- style="width: 125px; margin: 20px 0"-->
<!-- @click="addVersionDialog"-->
<!-- icon="el-icon-plus"-->
<!-- :disabled="submitShow ? false : true"-->
<!-- v-if="submitShow"-->
<!-- >添加</el-button-->
<!-- >-->
<!-- <base-table-->
<!-- :border="true"-->
<!-- :showIndex="true"-->
<!-- :tableColumn="tableVersionColumn"-->
<!-- :tableData="tableVersionData"-->
<!-- :funWidth="80"-->
<!-- :funData="funData"-->
<!-- @onFunc="onFunc"-->
<!-- >-->
<!-- <template v-slot:argName="{ row }" >-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.argName}}</template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argName"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow || row.disabled"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argCode="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">-->
<!-- {{ row.argCode }}-->
<!-- </template>-->
<!-- <el-input-->
<!-- v-else-->
<!-- v-model="row.argCode"-->
<!-- clearable-->
<!-- type="text"-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:argType="{ row }">-->
<!-- <div style="width: 100%">-->
<!--&lt;!&ndash; <el-radio-group v-model="row.argType" :disabled="!submitShow">&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="1">字符串</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; <el-radio label="2">日期</el-radio>&ndash;&gt;-->
<!--&lt;!&ndash; </el-radio-group>&ndash;&gt;-->
<!-- <el-select v-model="row.argType" placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:remark="{ row }">-->
<!-- <div style="width: 100%">-->
<!-- <template v-if="!submitShow">{{row.remark}}</template>-->
<!-- <el-input-->
<!-- v-model="row.remark"-->
<!-- clearable-->
<!-- type="text"-->
<!-- v-else-->
<!-- :disabled="!submitShow"-->
<!-- ></el-input>-->
<!-- </div>-->
<!-- </template>-->
<!-- </base-table>-->
</base-right-dialog>
</div>
</template>
<script>
import baseRightDialog from "@/components/base/baseRightDialog";
import baseForm from "@/components/base/baseNewForm";
import baseTable from "@/components/base/baseTable";
import { authApi } from "@/api/apis/auth";
export default {
components: {
baseRightDialog,
baseForm,
baseTable,
},
data() {
return {
dialogVisible: false,
dialogTitle: "",
dialogType: "",
formRow: [],
basicsRules: [],
vLoading: false,
newMarryOptions: [],
submitShow: true,
loadingType: true,
tableVersionData: [],
tableVersionColumn: [],
funData: [],
isEdit: false,
select_dist:{},
options:[
{
label:"字符串",
value:"1"
},
{
label:"日期范围选择",
value:"2"
},
{
label:"年月",
value:"3"
},
{
label:"年月日",
value:"4"
},
{
label:"年月日时间",
value:"5"
},
]
};
},
mounted() {
this.initSelect()
},
methods: {
//
async initSelect(){
let res = await authApi(
"pluginService",
"plugins",
"queryPluginsByType",
"",
{
"pluginType": "1"
}
);
if(res.status == 200){
console.log(res.attribute)
res.attribute.forEach(item=>{
this.$set(this.select_dist,item.pluginId,item)
})
this.formRow[0].elCol[0].options = res.attribute
}
},
//
onSelect(val, index, indexRow, obj){
this.$set(this.$refs.basicsForm.ruleForm,'plugName',this.select_dist[val]['pluginName'])
},
openDialog(type, row) {
// this.queryProductClassfy();
this.formRow = [];
this.submitShow = true;
this.isEdit = false
this.funData = [
{
color: "#ff0000",
text: "删除",
}
]
//
if (type == "add") {
this.dialogTitle = "新增";
this.dialogType = "add";
}
//
if (type == "edit") {
this.isEdit = true
this.dialogTitle = "编辑";
this.dialogType = "edit";
this.productGetById(row.id);
}
//
if (type == "show") {
this.funData = Object.assign([],[])
this.submitShow = false;
this.formRow = [
{
elCol: [
{
label: "任务编码",
prop: "taskCode",
tag: "elInput",
disabled:true,
},
{
label: "任务名称",
prop: "taskName",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "任务状态",
prop: "taskStatus",
tag: "elRadio",
disabled:true,
options:[
{
label:"执行中",
value:'1'
},
{
label:"待执行",
value:'2'
},
{
label:"错误",
value:'3'
},
],
span:24,
},
],
},
{
elCol: [
{
label: "上次开始时间",
prop: "oldStartTime",
tag: "elInput",
disabled:true,
},
{
label: "当前任务开始时间",
prop: "startTime",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "结束时间",
prop: "endTime",
tag: "elInput",
disabled:true,
},
{
label: "耗时",
prop: "diffTime",
tag: "elInput",
disabled:true,
},
],
},
{
elCol: [
{
label: "运行次数",
prop: "`runNum",
tag: "elInput",
disabled:true,
},
],
},
];
this.dialogTitle = "查看";
this.dialogType = "show";
this.productGetById(row.id);
}
this.dialogVisible = true;
},
//
async productGetById(id) {
let params = {
id: id,
};
let res = await authApi(
"integrationTaskLivingService",
"",
"getEntity",
"",
params
);
if (res.status == "200") {
this.$nextTick(() => {
this.$refs.basicsForm.incomingParameters(res.attribute);
// this.tableVersionData = res.attribute.sysPlugArgDetailEntityList
// let result = [];
// this.tableVersionData = Object.assign([], result);
});
}
},
addVersionDialog() {
let obj = {
argName:"",
argCode:"",
argType:"1",
remark:"",
};
this.tableVersionData.push(obj);
},
//
onFunc(index, row) {
if (index == 0) {
this.$delConfirm().then(() => {
this.tableVersionData.forEach((item, itemIndex) => {
if (item.id === row.id) {
this.tableVersionData.splice(itemIndex, 1);
}
});
});
}
},
//
handleDialogClose() {
this.tableVersionData = Object.assign([], []);
this.$refs.basicsForm.resetFields();
this.dialogVisible = false;
},
//
handleConfirmClick() {
this.$refs.basicsForm.$refs["ruleForm"].validate((valid) => {
if (!valid) {
return;
} else {
if(!this.tableVersionData.length){
this.$vmNews("请添加列表")
return
}
let flag = this.tableVersionData.some(item=>{
if(!item.argName){
this.$vmNews("请输入参数名称")
return true
}
if(!item.argCode){
this.$vmNews("参数编码")
return true
}
})
if(flag) return
let params = {
...this.$refs.basicsForm.ruleForm,
sysPlugArgDetailEntityList: this.tableVersionData,
};
if (this.dialogType == "add") {
this.openLoading("submit");
this.productSaveDto(params);
}
if (this.dialogType == "edit") {
this.openLoading("submit");
this.productUpdateDto(params);
}
}
});
},
//
async productSaveDto(params) {
let res = await authApi(
"sysPlugArgService",
"integrationTaskService",
"savePlugArg",
"",
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("新增成功", "success");
this.$emit("resetTable");
}
},
//
async productUpdateDto(params) {
let res = await authApi(
"sysPlugArgService",
"integrationTaskService",
"updatePlugArg",
"",
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("更新成功", "success");
this.$emit("resetTable");
}
},
//
async queryProductClassfy() {
let params = {
tab_name: "sys_product",
column_name: "classify",
};
let res = await authApi(
"generalServiceImpl",
"dictionaryshop",
"selectDictionaryshop",
"",
params
);
if (res.status == "200") {
this.formRow[1].elCol[0].options = res.attribute;
}
},
},
};
</script>
<style scoped lang="scss">
.dialogList {
padding: 16px 0;
border-top: 1px solid #dcdfe6;
display: flex;
flex-direction: column;
}
.updateBtn {
border: 1px solid #ebedf1;
padding: 5px 0;
border-radius: 3px;
text-align: center;
font-size: 14px;
cursor: pointer;
width: 100px;
}
.updateBtn:hover {
color: #1890ff;
border-color: #badeff;
background-color: #e8f4ff;
}
::v-deep .el-table__body-wrapper.is-scrolling-none {
height: auto !important;
}
::v-deep .app-container {
height: auto !important;
}
</style>

View File

@ -1,365 +1,234 @@
<template> <template>
<div class="monitoring"> <div>
<header> <base-layout
<div class="left"> ref="baseLayout"
<div class="title"> :buttonList="buttonList"
<h1>后台任务监控</h1> @onFuncBtn="onFuncBtn"
</div> :querySwitch="true"
<div class="search"> :searchList="requirementList"
<el-input @search="handleSearchEvent"
placeholder="任务名称" :isPage="true"
v-model="searchForm.task_name" @pageChange="handlePageChange"
@keyup.enter.native="submitsearchForm" >
> <div slot="main" slot-scope="{ tableHeight }">
<i slot="prefix" class="el-input__icon el-icon-search"></i> <base-table
</el-input> ref="baseTable"
</div> :showIndex="true"
</div> :funWidth="180"
<div class="right"> :funData="funData"
<el-button type="primary" @click="monPush" :loading="pushLoading" @onFunc="onFunc"
>输出</el-button :tabLoading.sync="tabLoading"
:tableHeight="tableHeight"
:tableData="tableData"
:tableColumn="tableColumnData"
> >
<el-button <template #taskStatus="{row}">
icon="el-icon-refresh" {{ taskStatusDist[row.taskStatus] }}
:loading="refreshLoading" </template>
@click="initMainTableData(searchForm)" </base-table>
circle
></el-button>
</div> </div>
</header> </base-layout>
<main> <right-dialog ref="rightDialog" @resetTable="resetTable"></right-dialog>
<BaseTable
ref="mainTable"
:tableData="tableData"
:tableColumn="tableColumn"
:funData="funData"
:funWidth="funWidth"
:showIndex="true"
:tabLoading="mainTabLoading"
@onFunc="tableButtonHandle"
:tableHeight="'70vh'"
:border="false"
>
<template v-slot:sts="{ row }">
<div>{{ stsDict[row.sts] }}</div>
</template>
<template v-slot:task_tag="{ row }">
<baseNewSelect
v-model="row.task_tag"
:searchApiInfo="task_tag_apiInfo.searchApiInfo"
:searchKey="task_tag_apiInfo.searchKey"
:prop="task_tag_apiInfo.prop"
:lookflag="true"
></baseNewSelect>
</template>
<template v-slot:diff_time="{ row }">
<div>{{ getTimeHandler(row.diff_time) }}</div>
</template>
</BaseTable>
</main>
<footer>
<basePage
:pageModel="pageModel"
@update:pageModel="currentChangeHandle"
></basePage>
</footer>
</div> </div>
</template> </template>
<script> <script>
import basePage from "./compoments/basePage.vue"; import baseLayout from '@/components/base/baseLayout'
import BaseTable from "./compoments/baseTable.vue"; import baseTable from '@/components/base/baseTable'
import { getApiModuleApi, getExcelApi } from "@/api/apiChunks/index.js"; import rightDialog from './monRightDialog.vue'
import baseNewSelect from "./compoments/baseNewSelect.vue"; import { authApi } from '@/api/apis/auth'
export default { export default {
components: {
baseLayout,
baseTable,
rightDialog
},
data() { data() {
return { return {
refreshLoading: false, buttonList: [
pushLoading: false, {
task_tag_apiInfo: { menuName: '刷新',
searchApiInfo: { icon: 'el-icon-refresh',
tl: "apiReflectionService", btnFunction: 'resetLoad'
as: "sys_api_reflectionService", }
dj: "queryOneById", ], //
requirementList: [
{
placeholder: '任务名称',
prop: 'taskName',
tag: 'elInput'
}, },
searchKey: "id", ], //list
prop: { tabLoading: false,
id: "id", tableColumnData: [
label: "ref_name", {
prop: 'taskName',
label: '任务名称'
}, },
}, {
stsDict: { prop: 'taskId',
Y: "正常", label: '任务编码'
N: "不正常", },
}, {
searchForm: { prop: 'taskStatus',
task_name: "", label: '任务状态'
}, },
mainTabLoading: false, {
prop: 'oldStartTime',
label: '上次开始时间'
},
{
prop: 'startTime',
label: '当前任务开始时间'
},
{
prop: 'runNum',
label: '运行次数'
}
], //
funData: [ funData: [
{ {
type: "execute", color: '#6a9af1',
text: "执行", text: '查看'
color: "#5a9cf8",
},
{
type: "hang_up",
text: "挂起",
color: "#5a9cf8",
},
{
type: "dele",
text: "删除",
color: "#e47470",
}, },
], ],
tableColumn: [ tableData: [], //
{
id: "task_name",
title: "任务名称",
},
{
id: "task_tag",
title: "任务场景",
tooltip: true,
},
{
id: "task_classes",
title: "类型",
},
{
id: "org_id",
title: "部署公司",
},
{
id: "sts",
title: "状态",
tooltip: true,
},
{
id: "plan_time",
title: "计划时间",
tooltip: true,
},
{
id: "diff_time",
title: "上次耗时",
},
{
id: "run_num",
title: "运行次数",
},
{
id: "server_name",
title: "服务器",
tooltip: true,
},
],
tableData: [],
pageModel: { pageModel: {
pageIndex: 1, pageNum: 1,
total: 10, pageSize: 100
limit: 10,
}, },
}; queryModel: {
code: '',
name: '',
classify: '',
productionCompany: ''
},
taskStatusDist: {
1: '执行中',
2: '待执行',
3: '错误'
}
}
},
mounted() {
// this.queryProductClassfy();
this.GetProductionTableData()
}, },
methods: { methods: {
// onCellClick(row) {
getTimeHandler(time) { this.openLoading('detail')
var days = parseInt(time / (1000 * 60 * 60 * 24)); this.$refs.rightDialog.openDialog('show', row)
var hours = parseInt((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = parseInt((time % (1000 * 60 * 60)) / (1000 * 60));
var seconds = (time % (1000 * 60)) / 1000;
return days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
}, },
// //
async executeHandle(obj) { async GetProductionTableData() {
const res = await getApiModuleApi( this.tabLoading = true
{ let param = {
tl: "integrationTaskMonitoringService", ...this.pageModel,
as: "integrationTaskMonitoring", ...this.queryModel
dj: "updateTaskMonitoringCarryAndHang", }
}, let res = await authApi(
obj 'integrationTaskLivingService',
); '',
if (res.status == 200) { 'queryEntityPage',
this.$nextTick(() => { '',
this.initMainTableData(this.searchForm); param
}); )
return true; this.tabLoading = false
if (res.status == '200') {
this.tableData = res.attribute.list
this.$refs.baseLayout.setPageTotal(res.attribute.total)
} }
}, },
// excel //
async monPush() { handlePageChange(val) {
this.pushLoading = true; this.pageModel.pageNum = val.pageIndex
const res = await getExcelApi( this.pageModel.pageSize = val.pageSize
{ this.GetProductionTableData()
tl: "integrationTaskMonitoringService", },
as: "integrationTaskMonitoring", //
dj: "queryMonitoringExportation", onFuncBtn(btn) {
}, this.onCellClick()
{ // this[btn.btnFunction]()
task_name: this.searchForm.task_name, },
} //
); add() {
this.pushLoading = false; this.$refs.rightDialog.openDialog('add')
if (!res) { },
this.$message({ //
type: "error", onFunc(index, row, item) {
message: "下载失败!", //
}); if (item.text === '查看') {
} else { this.openLoading('detail')
let url = window.URL.createObjectURL( this.$refs.rightDialog.openDialog('show', row)
new Blob([res], { type: "application/vnd.ms-excel" }) }
); //
let fileName = "后台任务监控"; if (item.text === '编辑') {
let link = document.createElement("a"); this.openLoading('detail')
link.style.display = "none"; this.$refs.rightDialog.openDialog('edit', row)
link.href = url; }
link.setAttribute("download", fileName + ".xlsx"); //
document.body.appendChild(link); if (item.text === '删除') {
link.click(); this.$delConfirm().then(() => {
document.body.removeChild(link); this.openLoading('del')
window.URL.revokeObjectURL(url); this.productionDeleteById(row.id)
})
} }
}, },
// async productionDeleteById(id) {
async initMainTableData(obj = {}) { let param = {
this.refreshLoading = true; id: id
const res = await getApiModuleApi( }
{ let res = await authApi(
tl: "integrationTaskMonitoringService", 'sysPlugArgService',
as: "integrationTaskMonitoring", 'integrationTaskService',
dj: "queryListJson", 'deletePlugArg',
}, '',
{ param
pageNum: this.pageModel.pageIndex, )
pageSize: this.pageModel.limit, if (res.status == '200') {
...obj, this.$vmNews('删除成功', 'success')
} this.resetTable()
);
this.refreshLoading = false;
if (res.status == 200) {
this.tableData = res.attribute;
} }
}, },
// //
submitsearchForm() { resetTable() {
this.initMainTableData(this.searchForm); this.pageModel.pageNum = 1
this.$refs.baseLayout.pageClear()
this.GetProductionTableData()
}, },
// //
tableButtonHandle(val, item) { handleSearchEvent() {
if (item.type === "execute") { let data = this.$refs.baseLayout.ruleForm
let obj = { this.queryModel = data
type: "1", this.resetTable()
}; },
obj["task_id"] = val.task_id; //
obj["task_code"] = val.task_code; async queryProductClassfy() {
obj["task_name"] = val.task_name; let params = {
this.executeHandle(obj).then(() => { tab_name: 'sys_product',
this.$message({ column_name: 'classify'
type: "success",
message: "执行成功!",
});
});
} else if (item.type == "dele") {
this.$confirm("确认删除?")
.then(async () => {
console.log(111);
const res = await getApiModuleApi(
{
tl: "integrationTaskMonitoringService",
as: "integrationTaskMonitoring",
dj: "updateTaskMonitoringSts",
},
{ task_id: val.task_id }
);
console.log(res);
if (res.status == 200) {
if (
this.pageModel.total + this.pageModel.limit - 1 <=
this.pageModel.pageIndex * this.pageModel.limit
) {
this.pageModel.pageIndex--;
}
console.log("删除");
this.$nextTick(() => {
this.initMainTableData(this.searchForm);
});
}
})
.catch(() => {});
} else if (item.type === "hang_up") {
let obj = {
type: "2",
};
obj["task_id"] = val.task_id;
obj["task_code"] = val.task_code;
obj["task_name"] = val.task_name;
this.executeHandle(obj).then(() => {
this.$message({
type: "success",
message: "挂起成功!",
});
});
} else if (item.type === "view") {
this.$router.push({
name: "sceneAdd",
query: { id: val.id, lookFlag: true },
});
} }
}, let res = await authApi(
currentChangeHandle(pageModel) { 'generalServiceImpl',
this.pageModel = pageModel; 'dictionaryshop',
this.$nextTick(() => { 'selectDictionaryshop',
this.initMainTableData(this.searchForm); '',
}); params
}, )
}, if (res.status == '200') {
computed: { this.requirementList[2].options = res.attribute
//
funWidth() {
return this.funData.length * 70;
},
},
components: {
BaseTable,
basePage,
baseNewSelect,
},
created() {
this.initMainTableData();
},
};
</script>
<style scoped lang='scss'>
.monitoring {
width: 100%;
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
background-color: #fff;
border-radius: 20px;
.left {
align-items: center;
display: flex;
.search {
margin-left: 30px;
} }
} }
} }
main {
padding: 20px;
height: 75vh;
border-radius: 20px;
background-color: #fff;
}
footer {
margin-top: 20px;
}
} }
</style> </script>
<style scoped>
.clickTitle {
color: #409eff;
cursor: pointer;
}
</style>

View File

@ -113,7 +113,8 @@ export default {
title: '任务名称', title: '任务名称',
id: 'taskName', id: 'taskName',
row: 8, row: 8,
required: true required: true,
disabled: false,
}, },
{ {
type: 'input', type: 'input',
@ -671,6 +672,8 @@ export default {
) )
if (res.status == 200) { if (res.status == 200) {
this.ruleForm = res.attribute this.ruleForm = res.attribute
console.log(res)
this.formRow[0].elCol[1].disabled = true
const res2 = await authApi('sysApplicationPluginService', '', 'queryEntity', '', { const res2 = await authApi('sysApplicationPluginService', '', 'queryEntity', '', {
appId: res.attribute.taskApp appId: res.attribute.taskApp
}) })
@ -707,6 +710,10 @@ export default {
}, },
// //
async onSubmitHandle() { async onSubmitHandle() {
if (!this.ruleForm.taskCron) {
this.$vmNews('请编辑发生时间选择任务策略')
return
}
this.commitLoading = true this.commitLoading = true
let obj = { ...this.ruleForm } let obj = { ...this.ruleForm }
if (!this.$route.query.id) { if (!this.$route.query.id) {
@ -722,7 +729,7 @@ export default {
if (res.status == 200) { if (res.status == 200) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '保存成功!' message: res.msg
}) })
this.$router.back() this.$router.back()
// //

View File

@ -106,10 +106,7 @@ export default {
}, },
// //
getFuncBtn(btnEven) { getFuncBtn(btnEven) {
if (!this.delId) {
this.$vmNews('请选择处理的信息')
return
}
if (btnEven.menuName == '新增根节点') { if (btnEven.menuName == '新增根节点') {
let newRuleForm = { let newRuleForm = {
parentMenuName: "", parentMenuName: "",
@ -121,6 +118,10 @@ export default {
}) })
} }
if (btnEven.menuName == '新增子节点') { if (btnEven.menuName == '新增子节点') {
if (!this.delId) {
this.$vmNews('请选择处理的信息')
return
}
let newRuleForm = { let newRuleForm = {
parentMenuName: this.ruleForm.menuName, parentMenuName: this.ruleForm.menuName,
parentMenuId: this.ruleForm.id parentMenuId: this.ruleForm.id