|
@@ -12,23 +12,52 @@
|
|
|
<div ref="formWrap" class="service-form-wrapper service-edit-wrapper">
|
|
|
<header class="title">
|
|
|
<p class="manageTitle">服务</p>
|
|
|
- <el-button size="small" type="primary" class="btn-save" @click="editSubmitHandler">保存</el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ class="btn-save"
|
|
|
+ @click="editSubmitHandler"
|
|
|
+ >保存</el-button
|
|
|
+ >
|
|
|
</header>
|
|
|
<main class="content">
|
|
|
- <el-form ref="serviceForm" class="service-form" :model="serviceForm" label-position="right" label-width="72px" size="mini">
|
|
|
+ <el-form
|
|
|
+ ref="serviceForm"
|
|
|
+ class="service-form"
|
|
|
+ :model="serviceForm"
|
|
|
+ label-position="right"
|
|
|
+ label-width="72px"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
<el-row :gutter="60" type="flex">
|
|
|
<el-col :span="4">
|
|
|
<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="4">
|
|
|
- <el-form-item label="前序输出编号" label-width="114px" prop="serviceOutputID">
|
|
|
- <el-input v-model="serviceForm.serviceOutputID" placeholder="请输入前序输出编号" clearable />
|
|
|
+ <el-form-item
|
|
|
+ label="前序输出编号"
|
|
|
+ label-width="114px"
|
|
|
+ prop="serviceOutputID"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.serviceOutputID"
|
|
|
+ placeholder="请输入前序输出编号"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
- <el-form-item label="类型" prop="serviceType" label-width="44px">
|
|
|
+ <el-form-item
|
|
|
+ label="类型"
|
|
|
+ prop="serviceType"
|
|
|
+ label-width="44px"
|
|
|
+ >
|
|
|
<el-select v-model="serviceForm.serviceType" clearable>
|
|
|
<el-option :value="1" label="管理前端" />
|
|
|
<el-option :value="2" label="管理后端" />
|
|
@@ -41,10 +70,21 @@
|
|
|
<div class="flex-wrap">
|
|
|
<el-form-item label="数据来源" prop="dataSourceID">
|
|
|
<el-select v-model="serviceForm.dataSourceID" clearable>
|
|
|
- <el-option v-for="dataSource in dataSourceList" :key="dataSource.dataSourceID" :value="dataSource.dataSourceID" :label="dataSource.dataSourceName" />
|
|
|
+ <el-option
|
|
|
+ v-for="dataSource in dataSourceList"
|
|
|
+ :key="dataSource.dataSourceID"
|
|
|
+ :value="dataSource.dataSourceID"
|
|
|
+ :label="dataSource.dataSourceName"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-button style="height:28px;line-height: 0px;margin-left:16px;" size="small" @click="addService" type="primary">新增</el-button>
|
|
|
+ <el-button
|
|
|
+ style="height: 28px; line-height: 0px; margin-left: 16px"
|
|
|
+ size="small"
|
|
|
+ @click="addService"
|
|
|
+ type="primary"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
<!-- <el-form-item label="数据来源" prop="dataSourceID">
|
|
|
<el-select v-model="serviceForm.dataSourceID" clearable>
|
|
@@ -53,13 +93,25 @@
|
|
|
</el-form-item> -->
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="数据来源对象" prop="sourceObjectName" label-width="100px">
|
|
|
- <el-input v-model="serviceForm.sourceObjectName" placeholder="请输入数据来源对象名称" clearable />
|
|
|
+ <el-form-item
|
|
|
+ label="数据来源对象"
|
|
|
+ prop="sourceObjectName"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+ <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="4">
|
|
@@ -85,47 +137,104 @@
|
|
|
</el-form-item>
|
|
|
</el-col> -->
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="生命周期ID键名" prop="lifeCycleCol" label-width="114px">
|
|
|
- <el-input v-model="serviceForm.lifeCycleCol" placeholder="请输入生命周期ID键名" clearable />
|
|
|
+ <el-form-item
|
|
|
+ label="生命周期ID键名"
|
|
|
+ prop="lifeCycleCol"
|
|
|
+ label-width="114px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.lifeCycleCol"
|
|
|
+ placeholder="请输入生命周期ID键名"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="取值规则" prop="computingMethod">
|
|
|
- <el-input v-model="serviceForm.computingMethod" placeholder="请输入取值规则" type="textarea" :autosize="{ minRows: 3, maxRows: 3 }" resize="none" clearable />
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.computingMethod"
|
|
|
+ placeholder="请输入取值规则"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 3, maxRows: 3 }"
|
|
|
+ resize="none"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="检测规则" prop="validationExpression">
|
|
|
- <el-input v-model="serviceForm.validationExpression" placeholder="请输入检测规则" type="textarea" :autosize="{ minRows: 3, maxRows: 3 }" resize="none" clearable />
|
|
|
+ <el-input
|
|
|
+ v-model="serviceForm.validationExpression"
|
|
|
+ placeholder="请输入检测规则"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 3, maxRows: 3 }"
|
|
|
+ resize="none"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
<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="4">
|
|
|
<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="4">
|
|
|
- <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="4">
|
|
|
<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="4">
|
|
|
<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="4">
|
|
|
- <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" />
|
|
@@ -136,15 +245,32 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
- <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 dataSourceList" :key="dataSource.dataSourceID" :value="dataSource.dataSourceID" :label="dataSource.dataSourceName" />
|
|
|
+ <el-option
|
|
|
+ v-for="dataSource in dataSourceList"
|
|
|
+ :key="dataSource.dataSourceID"
|
|
|
+ :value="dataSource.dataSourceID"
|
|
|
+ :label="dataSource.dataSourceName"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <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>
|
|
@@ -155,19 +281,52 @@
|
|
|
<div class="service-table-wrapper service-edit-wrapper">
|
|
|
<header class="title">
|
|
|
<p class="manageTitle">输出</p>
|
|
|
- <el-button size="small" type="primary" class="btn-white" @click="btnAddClickHandler(1)">新增</el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ class="btn-white"
|
|
|
+ @click="btnAddClickHandler(1)"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
</header>
|
|
|
<main class="content">
|
|
|
- <DataTable ref="serviceOutputTable" :data-id="outId" :data-content="{ serviceID: serviceID }" :rows="12" :table-height="computedTableHeight" margin-top="0" :is-btn="false" :is-dialog="true" labelWidth="100px" />
|
|
|
+ <DataTable
|
|
|
+ ref="serviceOutputTable"
|
|
|
+ :data-id="outId"
|
|
|
+ :data-content="{ serviceID: serviceID }"
|
|
|
+ :rows="12"
|
|
|
+ :table-height="computedTableHeight"
|
|
|
+ margin-top="0"
|
|
|
+ :is-btn="false"
|
|
|
+ :is-dialog="true"
|
|
|
+ labelWidth="100px"
|
|
|
+ />
|
|
|
</main>
|
|
|
</div>
|
|
|
<div class="service-table-wrapper service-edit-wrapper">
|
|
|
<header class="title">
|
|
|
<p class="manageTitle">部署机器</p>
|
|
|
- <el-button size="small" type="primary" class="btn-white" @click="btnAddClickHandler(2)">新增</el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ class="btn-white"
|
|
|
+ @click="btnAddClickHandler(2)"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
</header>
|
|
|
<main class="content">
|
|
|
- <DataTable ref="serviceMachineTable" :data-id="jqId" :data-content="{ serviceID: serviceID }" :rows="12" :table-height="computedTableHeight" margin-top="0" :is-btn="false" :is-dialog="true" :selection-enable="true" @selection-change="machineSelectionChangeHandler" />
|
|
|
+ <DataTable
|
|
|
+ ref="serviceMachineTable"
|
|
|
+ :data-id="jqId"
|
|
|
+ :data-content="{ serviceID: serviceID }"
|
|
|
+ :rows="12"
|
|
|
+ :table-height="computedTableHeight"
|
|
|
+ margin-top="0"
|
|
|
+ :is-btn="false"
|
|
|
+ :is-dialog="true"
|
|
|
+ :selection-enable="true"
|
|
|
+ @selection-change="machineSelectionChangeHandler"
|
|
|
+ />
|
|
|
</main>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -178,21 +337,50 @@
|
|
|
<div class="content">
|
|
|
<el-form ref="sourceForm" label-width="100px" :model="formLabelAlign">
|
|
|
<el-form-item label="数据源名称">
|
|
|
- <el-input size="small" v-model="formLabelAlign.dataSourceName"></el-input>
|
|
|
+ <el-input
|
|
|
+ size="small"
|
|
|
+ v-model="formLabelAlign.dataSourceName"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="协议名称">
|
|
|
- <el-select size="small" style="width:100%;" v-model="formLabelAlign.protocolName" placeholder="请选择活动区域">
|
|
|
- <el-option v-for="item in sourceDatas" :key="item.protocolID" :label="item.protocolName" :value="item.protocolID"></el-option>
|
|
|
+ <el-select
|
|
|
+ size="small"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="formLabelAlign.protocolName"
|
|
|
+ placeholder="请选择活动区域"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in sourceDatas"
|
|
|
+ :key="item.protocolID"
|
|
|
+ :label="item.protocolName"
|
|
|
+ :value="item.protocolID"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="连接参数">
|
|
|
- <el-input size="small" type="textarea" rows="3" v-model="formLabelAlign.connectConfig"></el-input>
|
|
|
+ <el-input
|
|
|
+ size="small"
|
|
|
+ type="textarea"
|
|
|
+ rows="3"
|
|
|
+ v-model="formLabelAlign.connectConfig"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="foot">
|
|
|
- <el-button size="medium" type="primary" @click="formService" class="r25 r26">提交</el-button>
|
|
|
- <el-button size="medium" class="r26" @click="sourceFormVisible = false">取消</el-button>
|
|
|
+ <el-button
|
|
|
+ size="medium"
|
|
|
+ type="primary"
|
|
|
+ @click="formService"
|
|
|
+ class="r25 r26"
|
|
|
+ >提交</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="medium"
|
|
|
+ class="r26"
|
|
|
+ @click="sourceFormVisible = false"
|
|
|
+ >取消</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</Dialog>
|
|
@@ -201,23 +389,23 @@
|
|
|
|
|
|
<script>
|
|
|
// import NoData from '@/components/nodata'
|
|
|
-import Dialog from '@/layout/components/Dialog'
|
|
|
-import DataTable from '@/components/Table'
|
|
|
-import { myQuery, GeneralDataReception } from '@/api/dataIntegration'
|
|
|
+import Dialog from "@/layout/components/Dialog";
|
|
|
+import DataTable from "@/components/Table";
|
|
|
+import { myQuery, GeneralDataReception } from "@/api/dataIntegration";
|
|
|
|
|
|
-import operate from './mixins/operate'
|
|
|
+import operate from "./mixins/operate";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
// NoData,
|
|
|
Dialog,
|
|
|
- DataTable
|
|
|
+ DataTable,
|
|
|
},
|
|
|
mixins: [
|
|
|
// query,
|
|
|
- operate
|
|
|
+ operate,
|
|
|
],
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
outId: DATACONTENT_ID.sysServiceOutTabId,
|
|
|
jqId: DATACONTENT_ID.sysServiceJqTabId,
|
|
@@ -228,18 +416,18 @@ export default {
|
|
|
sourceFormVisible: false,
|
|
|
tempCheckedKeys: [],
|
|
|
serviceForm: {
|
|
|
- serviceName: '',
|
|
|
+ serviceName: "",
|
|
|
serviceOutputID: null,
|
|
|
serviceType: null,
|
|
|
- sourceObjectName: '',
|
|
|
- lifeCycleCol: '',
|
|
|
- serviceDescribe: '',
|
|
|
+ sourceObjectName: "",
|
|
|
+ lifeCycleCol: "",
|
|
|
+ serviceDescribe: "",
|
|
|
threads: null,
|
|
|
isAsynchronous: 1,
|
|
|
datatype: null,
|
|
|
dataSourceID: null,
|
|
|
- computingMethod: '',
|
|
|
- validationExpression: '',
|
|
|
+ computingMethod: "",
|
|
|
+ validationExpression: "",
|
|
|
startTime: null,
|
|
|
stopTime: null,
|
|
|
retryCount: null,
|
|
@@ -247,9 +435,9 @@ export default {
|
|
|
frequencyCount: null,
|
|
|
frequencyUnit: null,
|
|
|
logDataSourceID: null,
|
|
|
- logList: '',
|
|
|
+ logList: "",
|
|
|
},
|
|
|
- computedTableHeight: '200px',
|
|
|
+ computedTableHeight: "200px",
|
|
|
targetList: [],
|
|
|
protocolList: [],
|
|
|
nodeList: [],
|
|
@@ -262,117 +450,128 @@ export default {
|
|
|
checkedProcessKeys: [],
|
|
|
outputList: [],
|
|
|
formLabelAlign: {
|
|
|
- dataSourceName: '',
|
|
|
- protocolName: '',
|
|
|
- connectConfig: ''
|
|
|
+ dataSourceName: "",
|
|
|
+ protocolName: "",
|
|
|
+ connectConfig: "",
|
|
|
},
|
|
|
sourceDatas: [],
|
|
|
- }
|
|
|
+ };
|
|
|
},
|
|
|
- mounted () {
|
|
|
- this.queryServiceByID(this.serviceID)
|
|
|
- this.getDataSourceList(DATACONTENT_ID.sysSourceId)
|
|
|
+ mounted() {
|
|
|
+ this.queryServiceByID(this.serviceID);
|
|
|
+ this.getDataSourceList(DATACONTENT_ID.sysSourceId);
|
|
|
},
|
|
|
- updated () {
|
|
|
- const headerHeight = 80 + 24
|
|
|
- const bottomBlankHeight = 16
|
|
|
- const formWrapHeight = this.$refs['formWrap'].offsetHeight
|
|
|
- const tableWrapHeaderHeight = 26 + 32 + 24
|
|
|
- const tableWrapPadding = 20 * 2
|
|
|
- this.computedTableHeight = `calc(100vh - ${headerHeight + formWrapHeight + bottomBlankHeight + tableWrapHeaderHeight + tableWrapPadding}px)`
|
|
|
+ updated() {
|
|
|
+ const headerHeight = 80 + 24;
|
|
|
+ const bottomBlankHeight = 16;
|
|
|
+ const formWrapHeight = this.$refs["formWrap"].offsetHeight;
|
|
|
+ const tableWrapHeaderHeight = 26 + 32 + 24;
|
|
|
+ const tableWrapPadding = 20 * 2;
|
|
|
+ this.computedTableHeight = `calc(100vh - ${
|
|
|
+ headerHeight +
|
|
|
+ formWrapHeight +
|
|
|
+ bottomBlankHeight +
|
|
|
+ tableWrapHeaderHeight +
|
|
|
+ tableWrapPadding
|
|
|
+ }px)`;
|
|
|
},
|
|
|
methods: {
|
|
|
- editSubmitHandler () {
|
|
|
- this.$refs['serviceForm'].validate(valid => {
|
|
|
+ editSubmitHandler() {
|
|
|
+ this.$refs["serviceForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.updateService()
|
|
|
+ this.updateService();
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
- btnAddClickHandler (flag) {
|
|
|
+ btnAddClickHandler(flag) {
|
|
|
switch (flag) {
|
|
|
case 1:
|
|
|
- this.$refs['serviceOutputTable'].handleAdd()
|
|
|
- break
|
|
|
+ this.$refs["serviceOutputTable"].handleAdd();
|
|
|
+ break;
|
|
|
case 2:
|
|
|
- this.$refs['serviceMachineTable'].handleAdd()
|
|
|
- break
|
|
|
+ this.$refs["serviceMachineTable"].handleAdd();
|
|
|
+ break;
|
|
|
default:
|
|
|
- break
|
|
|
+ break;
|
|
|
}
|
|
|
},
|
|
|
- addService () {
|
|
|
- this.getDataSourceList(DATACONTENT_ID.sysServiceXyId)
|
|
|
- this.sourceFormVisible = true
|
|
|
+ addService() {
|
|
|
+ this.getDataSourceList(DATACONTENT_ID.sysServiceXyId);
|
|
|
+ this.sourceFormVisible = true;
|
|
|
},
|
|
|
- async machineSelectionChangeHandler (selection, row) {
|
|
|
- const isSelected = selection.findIndex(item => item.deployNodeID === row.deployNodeID) > -1
|
|
|
- const event = isSelected ? 1 : 3
|
|
|
+ async machineSelectionChangeHandler(selection, row) {
|
|
|
+ const isSelected =
|
|
|
+ selection.findIndex((item) => item.deployNodeID === row.deployNodeID) >
|
|
|
+ -1;
|
|
|
+ const event = isSelected ? 1 : 3;
|
|
|
try {
|
|
|
- const message = await this.updateServiceNode(event, row)
|
|
|
- this.$message.success(message ?? '操作成功')
|
|
|
+ const message = await this.updateServiceNode(event, row);
|
|
|
+ this.$message.success(message ?? "操作成功");
|
|
|
} catch (error) {
|
|
|
- this.$message.error(error)
|
|
|
- this.$refs['serviceMachineTable'].toggleRowSelection(row, !isSelected)
|
|
|
+ this.$message.error(error);
|
|
|
+ this.$refs["serviceMachineTable"].toggleRowSelection(row, !isSelected);
|
|
|
}
|
|
|
},
|
|
|
- async getDataSourceList (id) {
|
|
|
- const dataSourceList = await this.getSelectOption(id)
|
|
|
+ async getDataSourceList(id) {
|
|
|
+ const dataSourceList = await this.getSelectOption(id);
|
|
|
if (id == DATACONTENT_ID.sysSourceId) {
|
|
|
- this.dataSourceList = dataSourceList.map(item => {
|
|
|
- item[item.setlabel] = item.k
|
|
|
- item[item.setvalue] = item.v
|
|
|
- return item
|
|
|
- })
|
|
|
+ this.dataSourceList = dataSourceList.map((item) => {
|
|
|
+ item[item.setlabel] = item.k;
|
|
|
+ item[item.setvalue] = item.v;
|
|
|
+ return item;
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.sourceDatas = dataSourceList.map(item => {
|
|
|
- item[item.setlabel] = item.k
|
|
|
- item[item.setvalue] = item.v
|
|
|
- return item
|
|
|
- })
|
|
|
+ this.sourceDatas = dataSourceList.map((item) => {
|
|
|
+ item[item.setlabel] = item.k;
|
|
|
+ item[item.setvalue] = item.v;
|
|
|
+ return item;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
- async getSelectOption (ID) {
|
|
|
+ async getSelectOption(ID) {
|
|
|
try {
|
|
|
- const listValues = await myQuery(ID)
|
|
|
- return listValues
|
|
|
+ const listValues = await myQuery(ID);
|
|
|
+ return listValues;
|
|
|
} catch (error) {
|
|
|
- this.$message.error(error)
|
|
|
- return []
|
|
|
+ this.$message.error(error);
|
|
|
+ return [];
|
|
|
}
|
|
|
},
|
|
|
- async queryServiceByID (serviceID) {
|
|
|
- const serviceInfo = await myQuery(DATACONTENT_ID.sysServiceEditId, serviceID)
|
|
|
+ async queryServiceByID(serviceID) {
|
|
|
+ const serviceInfo = await myQuery(
|
|
|
+ DATACONTENT_ID.sysServiceEditId,
|
|
|
+ serviceID
|
|
|
+ );
|
|
|
Object.entries(serviceInfo[0]).forEach(([key, value]) => {
|
|
|
- this.serviceForm[key] = value
|
|
|
- })
|
|
|
+ this.serviceForm[key] = value;
|
|
|
+ });
|
|
|
},
|
|
|
- async formService () {
|
|
|
- this.sourceDatas.forEach(item => {
|
|
|
+ async formService() {
|
|
|
+ this.sourceDatas.forEach((item) => {
|
|
|
if (item.protocolID == this.formLabelAlign.protocolName) {
|
|
|
- this.formLabelAlign.protocolName = item.protocolName
|
|
|
- this.formLabelAlign.protocolID = item.protocolID
|
|
|
+ this.formLabelAlign.protocolName = item.protocolName;
|
|
|
+ this.formLabelAlign.protocolID = item.protocolID;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
try {
|
|
|
- this.formLabelAlign['event'] = 1
|
|
|
+ this.formLabelAlign["event"] = 1;
|
|
|
const res = await GeneralDataReception({
|
|
|
serviceId: SERVICE_ID.sysServiceAddXyId,
|
|
|
- dataContent: JSON.stringify(this.formLabelAlign)
|
|
|
- })
|
|
|
+ dataContent: JSON.stringify(this.formLabelAlign),
|
|
|
+ });
|
|
|
if (Number(res.code) === 0) {
|
|
|
- this.$message.success(res.message ?? '成功')
|
|
|
- this.sourceFormVisible = false
|
|
|
- this.getDataSourceList(DATACONTENT_ID.sysSourceId)
|
|
|
+ this.$message.success(res.message ?? "成功");
|
|
|
+ this.sourceFormVisible = false;
|
|
|
+ this.getDataSourceList(DATACONTENT_ID.sysSourceId);
|
|
|
} else {
|
|
|
- this.$message.error(res.message ?? '失败')
|
|
|
+ this.$message.error(res.message ?? "失败");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log('出错了', error.message || error)
|
|
|
+ console.log("出错了", error.message || error);
|
|
|
}
|
|
|
},
|
|
|
- }
|
|
|
-}
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -479,6 +678,7 @@ export default {
|
|
|
}
|
|
|
&:nth-child(2) {
|
|
|
flex: 0 1 624px;
|
|
|
+ padding-right: 0px;
|
|
|
}
|
|
|
}
|
|
|
}
|