|
@@ -1,7 +1,12 @@
|
|
|
<template>
|
|
|
<div class="serivce-home scroll-y">
|
|
|
<div class="wrap">
|
|
|
- <MinHeader :is-auth="true" :is-statuser="true" power-data="service_addition_button" @addForm="addServiceDialogShow">
|
|
|
+ <MinHeader
|
|
|
+ :is-auth="true"
|
|
|
+ :is-statuser="true"
|
|
|
+ power-data="service_addition_button"
|
|
|
+ @addForm="addServiceDialogShow"
|
|
|
+ >
|
|
|
<template #header>
|
|
|
<div class="status flex-wrap">
|
|
|
<div class="manageTitle">服务管理</div>
|
|
@@ -12,19 +17,57 @@
|
|
|
</template>
|
|
|
</MinHeader>
|
|
|
<div class="app-containers">
|
|
|
- <DataTable :is-Status="true" :table-header="tableColumns" :table-data="tableData" :table-btn-group="tableBtnGroup" btn-group-width="310px" :table-property="{ rowKey: 'ID' }" @btn-click="tableButtonClickHandler" />
|
|
|
+ <DataTable
|
|
|
+ :is-Status="true"
|
|
|
+ :table-header="tableColumns"
|
|
|
+ :table-data="tableData"
|
|
|
+ :table-btn-group="tableBtnGroup"
|
|
|
+ btn-group-width="310px"
|
|
|
+ :table-property="{ rowKey: 'ID' }"
|
|
|
+ @btn-click="tableButtonClickHandler"
|
|
|
+ />
|
|
|
</div>
|
|
|
- <Dialog :width="serviceDialogWidth" :flag="serviceDialogVisible" :type="serviceDialogType" :del-name="delName" :msg-title="msgTitle" @del-remove="delSubmitHandler" @del-rest="delDialogHide" @submit-form="serviceSubmitHandler" @reset-form="addServiceDialogHide">
|
|
|
- <el-form ref="serviceFormRef" class="service-form" :model="serviceForm" :rules="serviceFormRules" label-position="right" label-width="90px" size="mini">
|
|
|
+ <Dialog
|
|
|
+ :width="serviceDialogWidth"
|
|
|
+ :flag="serviceDialogVisible"
|
|
|
+ :type="serviceDialogType"
|
|
|
+ :del-name="delName"
|
|
|
+ :msg-title="msgTitle"
|
|
|
+ @del-remove="delSubmitHandler"
|
|
|
+ @del-rest="delDialogHide"
|
|
|
+ @submit-form="serviceSubmitHandler"
|
|
|
+ @reset-form="addServiceDialogHide"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="serviceFormRef"
|
|
|
+ class="service-form"
|
|
|
+ :model="serviceForm"
|
|
|
+ :rules="serviceFormRules"
|
|
|
+ label-position="right"
|
|
|
+ label-width="90px"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
<el-row :gutter="36" type="flex">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="服务名称" prop="serviceName">
|
|
|
- <el-input v-model="serviceForm.serviceName" placeholder="请输入服务名称" clearable />
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.serviceName"
|
|
|
+ placeholder="请输入服务名称"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="前序输出编号" label-width="120px" prop="serviceOutputID">
|
|
|
- <el-input v-model="serviceForm.serviceOutputID" placeholder="请输入前序输出编号" clearable />
|
|
|
+ <el-form-item
|
|
|
+ label="前序输出编号"
|
|
|
+ label-width="120px"
|
|
|
+ prop="serviceOutputID"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.serviceOutputID"
|
|
|
+ placeholder="请输入前序输出编号"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
@@ -49,66 +92,146 @@
|
|
|
<div class="flex">
|
|
|
<el-form-item label="数据来源" prop="dataSourceID">
|
|
|
<el-select v-model="serviceForm.dataSourceID" clearable>
|
|
|
- <el-option v-for="dataSource in selectOptionMap[
|
|
|
+ <el-option
|
|
|
+ v-for="dataSource in selectOptionMap[
|
|
|
queryTemplateIDMap.dataSourceName
|
|
|
- ]" :key="dataSource.dataSourceID" :value="dataSource.dataSourceID" :label="dataSource.dataSourceName" />
|
|
|
+ ]"
|
|
|
+ :key="dataSource.dataSourceID"
|
|
|
+ :value="dataSource.dataSourceID"
|
|
|
+ :label="dataSource.dataSourceName"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-button type="primary" size="small" style="height: 28px; line-height: 0px" @click="addDataSourceDialogShow">新增</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ style="height: 28px; line-height: 0px"
|
|
|
+ @click="addDataSourceDialogShow"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="数据来源对象" label-width="120px" prop="sourceObjectName">
|
|
|
- <el-input v-model="serviceForm.sourceObjectName" placeholder="请输入数据来源对象名称" clearable />
|
|
|
+ <el-form-item
|
|
|
+ label="数据来源对象"
|
|
|
+ label-width="120px"
|
|
|
+ prop="sourceObjectName"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.sourceObjectName"
|
|
|
+ placeholder="请输入数据来源对象名称"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="服务描述" prop="serviceDescribe">
|
|
|
- <el-input v-model="serviceForm.serviceDescribe" placeholder="请输入描述" clearable />
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.serviceDescribe"
|
|
|
+ placeholder="请输入描述"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="生命周期ID键名" prop="lifeCycleCol" label-width="120px">
|
|
|
- <el-input v-model="serviceForm.lifeCycleCol" placeholder="请输入生命周期ID键名" clearable />
|
|
|
+ <el-form-item
|
|
|
+ label="生命周期ID键名"
|
|
|
+ prop="lifeCycleCol"
|
|
|
+ label-width="120px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.lifeCycleCol"
|
|
|
+ placeholder="请输入生命周期ID键名"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="取值规则" prop="computingMethod">
|
|
|
- <el-input v-model="serviceForm.computingMethod" placeholder="请输入取值规则" type="textarea" :autosize="{ minRows: 4, maxRows: 4 }" resize="none" clearable />
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.computingMethod"
|
|
|
+ placeholder="请输入取值规则"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 4, maxRows: 4 }"
|
|
|
+ resize="none"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="检测规则" prop="validationExpression">
|
|
|
- <el-input v-model="serviceForm.validationExpression" placeholder="请输入检测规则" type="textarea" :autosize="{ minRows: 4, maxRows: 4 }" resize="none" clearable />
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.validationExpression"
|
|
|
+ placeholder="请输入检测规则"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 4, maxRows: 4 }"
|
|
|
+ resize="none"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="启动时间" prop="startTime">
|
|
|
- <el-date-picker v-model="serviceForm.startTime" type="datetime" format="YYYY-MM-DD HH:mm" value-format="YYYY-MM-DD HH:mm" placeholder="请选择启动时间" />
|
|
|
+ <el-date-picker
|
|
|
+ v-model="serviceForm.startTime"
|
|
|
+ type="datetime"
|
|
|
+ format="YYYY-MM-DD HH:mm"
|
|
|
+ value-format="YYYY-MM-DD HH:mm"
|
|
|
+ placeholder="请选择启动时间"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="停止时间" prop="stopTime">
|
|
|
- <el-date-picker v-model="serviceForm.stopTime" type="datetime" format="YYYY-MM-DD HH:mm" value-format="YYYY-MM-DD HH:mm" placeholder="请选择停止时间" />
|
|
|
+ <el-date-picker
|
|
|
+ v-model="serviceForm.stopTime"
|
|
|
+ type="datetime"
|
|
|
+ format="YYYY-MM-DD HH:mm"
|
|
|
+ value-format="YYYY-MM-DD HH:mm"
|
|
|
+ placeholder="请选择停止时间"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="失败重试次数" prop="retryCount" label-width="100px">
|
|
|
- <el-input v-model="serviceForm.retryCount" type="number" placeholder="请输入重试次数" clearable />
|
|
|
+ <el-form-item
|
|
|
+ label="失败重试次数"
|
|
|
+ prop="retryCount"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.retryCount"
|
|
|
+ type="number"
|
|
|
+ placeholder="请输入重试次数"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="循环次数" prop="loopCount">
|
|
|
- <el-input v-model="serviceForm.loopCount" type="number" placeholder="请输入循环次数" clearable />
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.loopCount"
|
|
|
+ type="number"
|
|
|
+ placeholder="请输入循环次数"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="循环频率" prop="frequencyCount">
|
|
|
- <el-input v-model="serviceForm.frequencyCount" type="number" placeholder="请输入循环频率" clearable />
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.frequencyCount"
|
|
|
+ type="number"
|
|
|
+ placeholder="请输入循环频率"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="循环频率单位" prop="frequencyUnit" label-width="100px">
|
|
|
+ <el-form-item
|
|
|
+ label="循环频率单位"
|
|
|
+ prop="frequencyUnit"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
<el-select v-model="serviceForm.frequencyUnit" clearable>
|
|
|
<el-option label="天" :value="24 * 60 * 60 * 1000" />
|
|
|
<el-option label="小时" :value="60 * 60 * 1000" />
|
|
@@ -119,36 +242,75 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="日志存储位置" label-width="100px" prop="logDataSourceID">
|
|
|
+ <el-form-item
|
|
|
+ label="日志存储位置"
|
|
|
+ label-width="100px"
|
|
|
+ prop="logDataSourceID"
|
|
|
+ >
|
|
|
<el-select v-model="serviceForm.logDataSourceID">
|
|
|
- <el-option v-for="dataSource in selectOptionMap[
|
|
|
+ <el-option
|
|
|
+ v-for="dataSource in selectOptionMap[
|
|
|
queryTemplateIDMap.dataSourceName
|
|
|
- ]" :key="dataSource.dataSourceID" :value="dataSource.dataSourceID" :label="dataSource.dataSourceName" />
|
|
|
+ ]"
|
|
|
+ :key="dataSource.dataSourceID"
|
|
|
+ :value="dataSource.dataSourceID"
|
|
|
+ :label="dataSource.dataSourceName"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="日志过滤条件" label-width="100px" prop="logList">
|
|
|
- <el-input v-model="serviceForm.logList" placeholder="请输入日志过滤条件" clearable />
|
|
|
+ <el-form-item
|
|
|
+ label="日志过滤条件"
|
|
|
+ label-width="100px"
|
|
|
+ prop="logList"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.logList"
|
|
|
+ placeholder="请输入日志过滤条件"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</Dialog>
|
|
|
- <Dialog type="add" width="500px" :flag="dataSourceDialogVisible" msg-title="新增数据来源" @submit-form="dataSourceSubmitHandler" @reset-form="dataSourceDialogHide">
|
|
|
+ <Dialog
|
|
|
+ type="add"
|
|
|
+ width="500px"
|
|
|
+ :flag="dataSourceDialogVisible"
|
|
|
+ msg-title="新增数据来源"
|
|
|
+ @submit-form="dataSourceSubmitHandler"
|
|
|
+ @reset-form="dataSourceDialogHide"
|
|
|
+ >
|
|
|
<el-form ref="sourceFormRef" label-width="100px" :model="sourceForm">
|
|
|
<el-form-item label="数据源名称">
|
|
|
<el-input v-model="sourceForm.dataSourceName" size="small" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="协议名称">
|
|
|
- <el-select size="small" style="width: 100%" v-model="sourceForm.protocolID" placeholder="请选择活动区域">
|
|
|
- <el-option v-for="protocol in selectOptionMap[
|
|
|
+ <el-select
|
|
|
+ size="small"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="sourceForm.protocolID"
|
|
|
+ placeholder="请选择活动区域"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="protocol in selectOptionMap[
|
|
|
queryTemplateIDMap.protocolName
|
|
|
- ]" :key="protocol.protocolID" :label="protocol.protocolName" :value="protocol.protocolID" />
|
|
|
+ ]"
|
|
|
+ :key="protocol.protocolID"
|
|
|
+ :label="protocol.protocolName"
|
|
|
+ :value="protocol.protocolID"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="连接参数">
|
|
|
- <el-input size="small" type="textarea" rows="3" v-model="sourceForm.connectConfig" />
|
|
|
+ <el-input
|
|
|
+ size="small"
|
|
|
+ type="textarea"
|
|
|
+ rows="3"
|
|
|
+ v-model="sourceForm.connectConfig"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</Dialog>
|
|
@@ -192,18 +354,14 @@ const getSelectOptionOfColumn = (columns: CommonTableColumn[]) => {
|
|
|
};
|
|
|
const getSelectOptions = async (id: number) => {
|
|
|
try {
|
|
|
- const {
|
|
|
- code,
|
|
|
- returnData,
|
|
|
- message,
|
|
|
- }: SelectOptionQueryResult = await Query({
|
|
|
+ const { code, returnData, message }: SelectOptionQueryResult = await Query({
|
|
|
id,
|
|
|
dataContent: [],
|
|
|
});
|
|
|
if (Number(code) !== 0) {
|
|
|
throw new Error(message ?? "失败");
|
|
|
}
|
|
|
- const listValues = returnData.listValues || returnData
|
|
|
+ const listValues = returnData.listValues || returnData;
|
|
|
const options = listValues.map(({ k, v, setlabel, setvalue }) => ({
|
|
|
k,
|
|
|
v,
|
|
@@ -258,7 +416,7 @@ const getTableData = async () => {
|
|
|
page.value--;
|
|
|
noMore.value = false;
|
|
|
}
|
|
|
- const titleColumn = columnSet.find((column) => column.needShow === 1);
|
|
|
+ const titleColumn = columnSet.find((column) => column.needShow == 1);
|
|
|
if (titleColumn) {
|
|
|
rowTitle.value = titleColumn.columnName;
|
|
|
}
|
|
@@ -337,7 +495,7 @@ const changeServiceState = async (serviceID: number, runState: string) => {
|
|
|
} = await Query({
|
|
|
id: DATACONTENT_ID.sysServiceNodeList,
|
|
|
dataContent: [serviceID],
|
|
|
- btnAuth: 'service_stop_button'
|
|
|
+ btnAuth: "service_stop_button",
|
|
|
});
|
|
|
if (Number(code) !== 0) {
|
|
|
throw new Error(message ?? "失败");
|
|
@@ -407,7 +565,7 @@ const deleteService = async () => {
|
|
|
const { code, message } = await GeneralDataReception({
|
|
|
serviceId: SERVICE_ID.sysServiceEdit,
|
|
|
dataContent: JSON.stringify(dataContent),
|
|
|
- btnAuth: 'service_deletion_button'
|
|
|
+ btnAuth: "service_deletion_button",
|
|
|
});
|
|
|
if (Number(code) === 0) {
|
|
|
ElMessage.success(message ?? "成功");
|
|
@@ -494,7 +652,7 @@ const createService = async () => {
|
|
|
const { code, message } = await GeneralDataReception({
|
|
|
serviceId: SERVICE_ID.sysServiceEdit,
|
|
|
dataContent: JSON.stringify(dataContent),
|
|
|
- btnAuth: 'service_addition_button',
|
|
|
+ btnAuth: "service_addition_button",
|
|
|
});
|
|
|
if (Number(code) === 0) {
|
|
|
ElMessage.success(message ?? "成功");
|