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

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')

View File

@ -702,6 +702,100 @@ export default {
} }
] ]
}, },
],//2
stepOneformRowCopy: [
{
elCol: [
{
type: 'input',
title: '目标地址',
maxlength: 200,
id: 'destinationAddress',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true
}
]
},
{
elCol: [
{
type: 'select',
title: '请求编码',
id: 'requestCoding',
row: 24,
required: true,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '请求方法',
id: 'requestMethod',
row: 24,
required: true,
options: []
}
]
},
{
elCol: [
{
type: 'num',
title: '超出时间',
id: 'timeoutPeriod',
row: 24,
min: 1,
max: 600000,
maxlength: 50,
required: true,
message: 'ms'
}
]
},
{
elCol: [
{
type: 'num',
title: '限流',
maxlength: 50,
id: 'currentLimiting',
min: 1,
row: 24,
max: 1000,
required: true,
message: 'TPS'
}
]
},
{
elCol: [
{
type: 'radio',
title: '是否扩展API',
maxlength: 200,
id: 'extensionApi',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true,
options: [
{
label: '是',
id: '1'
},
{
label: '否',
id: '2'
}
]
}
]
},
{ {
elCol: [ elCol: [
{ {
@ -712,7 +806,7 @@ export default {
pattern: '', pattern: '',
message: 'URL或协议不合法', message: 'URL或协议不合法',
row: 24, row: 24,
required: false required: true
} }
] ]
}, },
@ -726,7 +820,7 @@ export default {
pattern: '', pattern: '',
message: 'URL或协议不合法', message: 'URL或协议不合法',
row: 24, row: 24,
required: false required: true
} }
] ]
} }
@ -1133,8 +1227,225 @@ export default {
stepOneChangeRadio(val, index, indexRow, row) { stepOneChangeRadio(val, index, indexRow, row) {
console.log(row) console.log(row)
if (row.id === 'extensionApi') { if (row.id === 'extensionApi') {
this.stepOneformRow[6].elCol[0].required = val == 1 if (val == 1) {
this.stepOneformRow[7].elCol[0].required = val == 1 this.stepOneformRow = [
{
elCol: [
{
type: 'input',
title: '目标地址',
maxlength: 200,
id: 'destinationAddress',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true
}
]
},
{
elCol: [
{
type: 'select',
title: '请求编码',
id: 'requestCoding',
row: 24,
required: true,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '请求方法',
id: 'requestMethod',
row: 24,
required: true,
options: []
}
]
},
{
elCol: [
{
type: 'num',
title: '超出时间',
id: 'timeoutPeriod',
row: 24,
min: 1,
max: 600000,
maxlength: 50,
required: true,
message: 'ms'
}
]
},
{
elCol: [
{
type: 'num',
title: '限流',
maxlength: 50,
id: 'currentLimiting',
min: 1,
row: 24,
max: 1000,
required: true,
message: 'TPS'
}
]
},
{
elCol: [
{
type: 'radio',
title: '是否扩展API',
maxlength: 200,
id: 'extensionApi',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true,
options: [
{
label: '是',
id: '1'
},
{
label: '否',
id: '2'
}
]
}
]
},
{
elCol: [
{
type: 'input',
title: '内部bean名称',
maxlength: 200,
id: 'beanName',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true
}
]
},
{
elCol: [
{
type: 'input',
title: '方法名称',
maxlength: 200,
id: 'funName',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true
}
]
}
]
} else {
this.stepOneformRow = [
{
elCol: [
{
type: 'input',
title: '目标地址',
maxlength: 200,
id: 'destinationAddress',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true
}
]
},
{
elCol: [
{
type: 'select',
title: '请求编码',
id: 'requestCoding',
row: 24,
required: true,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '请求方法',
id: 'requestMethod',
row: 24,
required: true,
options: []
}
]
},
{
elCol: [
{
type: 'num',
title: '超出时间',
id: 'timeoutPeriod',
row: 24,
min: 1,
max: 600000,
maxlength: 50,
required: true,
message: 'ms'
}
]
},
{
elCol: [
{
type: 'num',
title: '限流',
maxlength: 50,
id: 'currentLimiting',
min: 1,
row: 24,
max: 1000,
required: true,
message: 'TPS'
}
]
},
{
elCol: [
{
type: 'radio',
title: '是否扩展API',
maxlength: 200,
id: 'extensionApi',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true,
options: [
{
label: '是',
id: '1'
},
{
label: '否',
id: '2'
}
]
}
]
},
]
}
} }
}, },
// //
@ -1346,8 +1657,227 @@ export default {
this.stepZeroForm = obj0 this.stepZeroForm = obj0
this.stepOneForm = obj1 this.stepOneForm = obj1
//stepOneChangeRadio //stepOneChangeRadio
this.stepOneformRow[6].elCol[0].required = this.stepOneForm.extensionApi == 1 if (this.stepOneForm.extensionApi == 1) {
this.stepOneformRow[7].elCol[0].required = this.stepOneForm.extensionApi == 1 this.stepOneformRow = [
{
elCol: [
{
type: 'input',
title: '目标地址',
maxlength: 200,
id: 'destinationAddress',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true
}
]
},
{
elCol: [
{
type: 'select',
title: '请求编码',
id: 'requestCoding',
row: 24,
required: true,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '请求方法',
id: 'requestMethod',
row: 24,
required: true,
options: []
}
]
},
{
elCol: [
{
type: 'num',
title: '超出时间',
id: 'timeoutPeriod',
row: 24,
min: 1,
max: 600000,
maxlength: 50,
required: true,
message: 'ms'
}
]
},
{
elCol: [
{
type: 'num',
title: '限流',
maxlength: 50,
id: 'currentLimiting',
min: 1,
row: 24,
max: 1000,
required: true,
message: 'TPS'
}
]
},
{
elCol: [
{
type: 'radio',
title: '是否扩展API',
maxlength: 200,
id: 'extensionApi',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true,
options: [
{
label: '是',
id: '1'
},
{
label: '否',
id: '2'
}
]
}
]
},
{
elCol: [
{
type: 'input',
title: '内部bean名称',
maxlength: 200,
id: 'beanName',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true
}
]
},
{
elCol: [
{
type: 'input',
title: '方法名称',
maxlength: 200,
id: 'funName',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true
}
]
}
]
} else {
this.stepOneformRow = [
{
elCol: [
{
type: 'input',
title: '目标地址',
maxlength: 200,
id: 'destinationAddress',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true
}
]
},
{
elCol: [
{
type: 'select',
title: '请求编码',
id: 'requestCoding',
row: 24,
required: true,
options: []
}
]
},
{
elCol: [
{
type: 'select',
title: '请求方法',
id: 'requestMethod',
row: 24,
required: true,
options: []
}
]
},
{
elCol: [
{
type: 'num',
title: '超出时间',
id: 'timeoutPeriod',
row: 24,
min: 1,
max: 600000,
maxlength: 50,
required: true,
message: 'ms'
}
]
},
{
elCol: [
{
type: 'num',
title: '限流',
maxlength: 50,
id: 'currentLimiting',
min: 1,
row: 24,
max: 1000,
required: true,
message: 'TPS'
}
]
},
{
elCol: [
{
type: 'radio',
title: '是否扩展API',
maxlength: 200,
id: 'extensionApi',
pattern: '',
message: 'URL或协议不合法',
row: 24,
required: true,
options: [
{
label: '是',
id: '1'
},
{
label: '否',
id: '2'
}
]
}
]
},
]
}
// this.stepOneformRow[6].elCol[0].required = this.stepOneForm.extensionApi == 1
// this.stepOneformRow[7].elCol[0].required = this.stepOneForm.extensionApi == 1
if (JSON.parse(res.attribute.queryIn) instanceof Array) { if (JSON.parse(res.attribute.queryIn) instanceof Array) {
this.queryTableInfo.tableData = JSON.parse(res.attribute.queryIn) this.queryTableInfo.tableData = JSON.parse(res.attribute.queryIn)
} }

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,18 +1,30 @@
<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"
@onFuncBtn="onFuncBtn"
:querySwitch="true"
:searchList="requirementList"
@search="handleSearchEvent"
:isPage="true"
@pageChange="handlePageChange"
>
<div slot="main" slot-scope="{ tableHeight }"> <div slot="main" slot-scope="{ tableHeight }">
<base-table ref="baseTable" :showIndex="true" :funWidth="300" :funData="funData" @onFunc="onFunc" <base-table
:tabLoading.sync="tabLoading" :tableHeight="tableHeight" :tableData="tableData" ref="baseTable"
:fixedTable="'right'" :tableColumn="tableColumnData" :showSelect="true"> :showIndex="true"
<template v-slot:new_state="{ row }"> :funWidth="180"
<div style="width: 100%"> :funData="funData"
<span v-if="row.new_state == 'Y'" style="color: #67c23a">成功</span> @onFunc="onFunc"
<span v-else-if="row.new_state == 'H'" style="color: #67c23a">已处理</span> :tabLoading.sync="tabLoading"
<span v-else style="color: #f56c6c">失败</span> :tableHeight="tableHeight"
</div> :tableData="tableData"
:tableColumn="tableColumnData"
>
<template #taskStatus="{row}">
{{ taskStatusDist[row.taskStatus] }}
</template> </template>
</base-table> </base-table>
</div> </div>
@ -22,341 +34,197 @@
</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: [
{
name: "批量推送",
btnFunction: "batchPush",
},
], //
requirementList: [ requirementList: [
{ {
placeholder: "任务名称", placeholder: '任务名称',
prop: "plugin_id", prop: 'taskName',
tag: "elSelect", tag: 'elInput'
options: [], }
optionValue: "pluginId",
optionLabel: "pluginName",
},
{
placeholder: "源系统编码",
prop: "root_app_bill",
tag: "elInput",
},
{
placeholder: "推送时间",
prop: "new_push_date",
tag: "elDatePicker",
valueFormat: "yyyy-MM-dd",
},
{
placeholder: "业务⽇期",
prop: "business_date",
tag: "elDatePicker",
valueFormat: "yyyy-MM-dd",
},
{
placeholder: "下游系统单号",
prop: "new_system_number",
tag: "elInput",
},
{
placeholder: "推送状态",
prop: "new_state",
tag: "elRadio",
options: [
{ label: "全部", value: "" },
{ label: "成功", value: "Y" },
{ label: "已处理", value: "H" },
{ label: "失败", value: "N" },
],
},
], //list ], //list
tabLoading: false, tabLoading: false,
tableColumnData: configData.tableColumnData, // tableColumnData: [
{
prop: 'taskName',
label: '任务名称'
},
{
prop: 'taskId',
label: '任务编码'
},
{
prop: 'taskStatus',
label: '任务状态'
},
{
prop: 'startTime',
label: '当前任务开始时间'
},
{
prop: 'endTime',
label: '结束时间'
},
{
prop: 'diffTime',
label: '耗时'
}
], //
funData: [ funData: [
{ {
color: "#6a9af1", color: '#6a9af1',
text: "查看", text: '查看'
}, }
{
color: "#6a9af1",
text: "重新推送",
},
{
color: "#6a9af1",
text: "手工处理",
},
{
color: "#d67a74",
text: "删除",
},
], ],
tableData: [], // tableData: [], //
pageModel: { pageModel: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 100
}, },
queryModel: { queryModel: {
plugin_id: '', code: '',
root_app_bill: '', name: '',
new_push_date: '', classify: '',
business_date: '', productionCompany: ''
new_system_number: '',
new_state: 'N'
}, },
}; taskStatusDist: {
1: '执行中',
2: '执行成功',
3: '执行失败'
}
}
}, },
mounted() { mounted() {
this.$refs.baseLayout.getField("new_state", "N"); // this.queryProductClassfy();
this.queryProductClassfy(); this.GetProductionTableData()
this.GetProductionTableData();
}, },
methods: { methods: {
onCellClick(row) {
this.openLoading('detail')
this.$refs.rightDialog.openDialog('show', row)
},
// //
async GetProductionTableData() { async GetProductionTableData() {
this.tabLoading = true; this.tabLoading = true
const res = await option({ let param = {
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "queryPage",
}, {
...this.pageModel, ...this.pageModel,
...this.queryModel ...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);
} }
}, let res = await authApi(
async queryProductClassfy() { 'integrationTaskLivingDetailsService',
const res = await option({ '',
tl: "pluginService", 'queryEntityPage',
as: "plugins", '',
dj: "queryPlugins", param
}, {}) )
this.tabLoading = false
if (res.status == "200") { if (res.status == '200') {
this.requirementList[0].options = res.attribute; this.tableData = res.attribute.list
} this.$refs.baseLayout.setPageTotal(res.attribute.total)
},
//
handleSearchEvent() {
let data = this.$refs.baseLayout.ruleForm;
this.queryModel.plugin_id = data.plugin_id;
this.queryModel.root_app_bill = data.root_app_bill;
this.queryModel.new_push_date = data.new_push_date;
this.queryModel.business_date = data.business_date;
this.queryModel.new_system_number = data.new_system_number;
this.queryModel.new_state = data.new_state;
this.resetTable();
},
//
async batchPush() {
let data = ''
this.$refs.baseTable.$refs.elTable.selection.forEach(el => {
if (data == '') {
data = el.id
} else {
data += `,${el.id}`
}
});
if (data.length > 0) {
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) { handlePageChange(val) {
this.pageModel.pageNum = val.pageIndex; this.pageModel.pageNum = val.pageIndex
this.pageModel.pageSize = val.pageSize; this.pageModel.pageSize = val.pageSize
this.GetProductionTableData(); this.GetProductionTableData()
}, },
// //
onFuncBtn(btn) { onFuncBtn(btn) {
this[btn.btnFunction](); this.onCellClick()
}, // this[btn.btnFunction]()
//
onFuncSearchBtn(btn) {
this[btn.btnFunction]();
}, },
// //
add() { add() {
this.$refs.rightDialog.openDialog("add"); this.$refs.rightDialog.openDialog('add')
}, },
// //
async onFunc(index, row) { onFunc(index, row, item) {
// //
if (index == 0) { if (item.text === '查看') {
this.openLoading("detail"); this.openLoading('detail')
this.$refs.rightDialog.openDialog("show", row); this.$refs.rightDialog.openDialog('show', row)
} }
// //
if (index == 1) { if (item.text === '编辑') {
this.$confirm("确认重新推送吗?", "提示", { this.openLoading('detail')
confirmButtonText: "确定", this.$refs.rightDialog.openDialog('edit', row)
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) { if (item.text === '删除') {
this.$confirm("确认删除该内容吗?", "提示", { this.$delConfirm().then(() => {
confirmButtonText: "确定", this.openLoading('del')
cancelButtonText: "取消", this.productionDeleteById(row.id)
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) { async productionDeleteById(id) {
const res = await option({ let param = {
tl: "integration_task_living_detailsService", id: id
as: "integrationTaskLog", }
dj: "deleteEntity", let res = await authApi(
}, { 'sysPlugArgService',
id 'integrationTaskService',
}) 'deletePlugArg',
if (res.status == "200") { '',
this.$vmNews("删除成功", "success"); param
this.resetTable(); )
if (res.status == '200') {
this.$vmNews('删除成功', 'success')
this.resetTable()
} }
}, },
// //
resetTable() { resetTable() {
this.pageModel.pageNum = 1; this.pageModel.pageNum = 1
this.$refs.baseLayout.pageClear(); this.$refs.baseLayout.pageClear()
this.GetProductionTableData(); 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>
@ -364,8 +232,4 @@ export default
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',
disabled: true
}, },
async productGetById(id) { {
this.openLoading("detail"); label: '任务名称',
const res = await option({ prop: 'taskName',
tl: "integration_task_living_detailsService", tag: 'elInput',
as: "integrationTaskLog", disabled: true
dj: "queryEntity",
}, {
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)
// this.tableVersionData = res.attribute.sysPlugArgDetailEntityList
// let result = []; // let result = [];
// if (res.attribute.sysProductVersionList.length > 0) {
// res.attribute.sysProductVersionList.forEach((item) => {
// let obj = {
// id: item.id,
// versionNumber: item.versionNumber,
// versionDescription: item.versionDescription,
// disabled: true
// };
// result.push(obj);
// });
// }
// this.tableVersionData = Object.assign([], result); // 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">

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

@ -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"
> >
<i slot="prefix" class="el-input__icon el-icon-search"></i> <div slot="main" slot-scope="{ tableHeight }">
</el-input> <base-table
</div> ref="baseTable"
</div>
<div class="right">
<el-button type="primary" @click="monPush" :loading="pushLoading"
>输出</el-button
>
<el-button
icon="el-icon-refresh"
:loading="refreshLoading"
@click="initMainTableData(searchForm)"
circle
></el-button>
</div>
</header>
<main>
<BaseTable
ref="mainTable"
:tableData="tableData"
:tableColumn="tableColumn"
:funData="funData"
:funWidth="funWidth"
:showIndex="true" :showIndex="true"
:tabLoading="mainTabLoading" :funWidth="180"
@onFunc="tableButtonHandle" :funData="funData"
:tableHeight="'70vh'" @onFunc="onFunc"
:border="false" :tabLoading.sync="tabLoading"
:tableHeight="tableHeight"
:tableData="tableData"
:tableColumn="tableColumnData"
> >
<template v-slot:sts="{ row }"> <template #taskStatus="{row}">
<div>{{ stsDict[row.sts] }}</div> {{ taskStatusDist[row.taskStatus] }}
</template> </template>
<template v-slot:task_tag="{ row }"> </base-table>
<baseNewSelect </div>
v-model="row.task_tag" </base-layout>
:searchApiInfo="task_tag_apiInfo.searchApiInfo" <right-dialog ref="rightDialog" @resetTable="resetTable"></right-dialog>
: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: '任务名称'
}, },
{
prop: 'taskId',
label: '任务编码'
}, },
stsDict: { {
Y: "正常", prop: 'taskStatus',
N: "不正常", label: '任务状态'
}, },
searchForm: { {
task_name: "", prop: 'oldStartTime',
label: '上次开始时间'
}, },
mainTabLoading: false, {
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",
}, },
{ //
task_name: this.searchForm.task_name, onFuncBtn(btn) {
} this.onCellClick()
); // this[btn.btnFunction]()
this.pushLoading = false;
if (!res) {
this.$message({
type: "error",
message: "下载失败!",
});
} else {
let url = window.URL.createObjectURL(
new Blob([res], { type: "application/vnd.ms-excel" })
);
let fileName = "后台任务监控";
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", fileName + ".xlsx");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
}
}, },
// //
async initMainTableData(obj = {}) { add() {
this.refreshLoading = true; this.$refs.rightDialog.openDialog('add')
const res = await getApiModuleApi(
{
tl: "integrationTaskMonitoringService",
as: "integrationTaskMonitoring",
dj: "queryListJson",
}, },
{ //
pageNum: this.pageModel.pageIndex, onFunc(index, row, item) {
pageSize: this.pageModel.limit, //
...obj, if (item.text === '查看') {
this.openLoading('detail')
this.$refs.rightDialog.openDialog('show', row)
} }
); //
this.refreshLoading = false; if (item.text === '编辑') {
if (res.status == 200) { this.openLoading('detail')
this.tableData = res.attribute; this.$refs.rightDialog.openDialog('edit', row)
}
},
//
submitsearchForm() {
this.initMainTableData(this.searchForm);
},
//
tableButtonHandle(val, item) {
if (item.type === "execute") {
let obj = {
type: "1",
};
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 == "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);
});
} }
//
if (item.text === '删除') {
this.$delConfirm().then(() => {
this.openLoading('del')
this.productionDeleteById(row.id)
}) })
.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 },
});
} }
}, },
currentChangeHandle(pageModel) { async productionDeleteById(id) {
this.pageModel = pageModel; let param = {
this.$nextTick(() => { id: id
this.initMainTableData(this.searchForm); }
}); 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()
}, },
computed: { //
// handleSearchEvent() {
funWidth() { let data = this.$refs.baseLayout.ruleForm
return this.funData.length * 70; this.queryModel = data
this.resetTable()
}, },
}, //
components: { async queryProductClassfy() {
BaseTable, let params = {
basePage, tab_name: 'sys_product',
baseNewSelect, column_name: 'classify'
}, }
created() { let res = await authApi(
this.initMainTableData(); 'generalServiceImpl',
}, 'dictionaryshop',
}; 'selectDictionaryshop',
</script> '',
params
<style scoped lang='scss'> )
.monitoring { if (res.status == '200') {
width: 100%; this.requirementList[2].options = res.attribute
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; </script>
height: 75vh;
border-radius: 20px; <style scoped>
background-color: #fff; .clickTitle {
} color: #409eff;
footer { cursor: pointer;
margin-top: 20px;
}
} }
</style> </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