Browse Source

Merge branch 'master' of http://120.26.64.82:3000/BFFE/CABaggageData2.0

zhongxiaoyu 2 years ago
parent
commit
015a8ef6b0

+ 6 - 6
public/index.html

@@ -1,15 +1,15 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+    <meta charset="utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
     <!-- <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline'"> -->
-    <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-eval'; script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline'"/>
-    <meta http-equiv="X-Content-Security-Policy" content="default-src 'self' 'unsafe-eval'; script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline'"/>
+    <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-eval'; script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline'" />
+    <meta http-equiv="X-Content-Security-Policy" content="default-src 'self' 'unsafe-eval'; script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline'" />
     <meta http-equiv="X-XSS-Protection" content="1;mode=block" />
     <meta http-equiv="X-Content-Type-Options" content="nosniff" />
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
     <title><%= webpackConfig.name %></title>
     <script src="<%= BASE_URL %>configLoader.js" type="text/javascript"></script>
     <script id="configJS" src="<%= BASE_URL %>config.js" type="text/javascript"></script>

+ 41 - 31
src/permission.js

@@ -1,46 +1,56 @@
-import router from './router'
-import store from './store'
-import { Message } from 'element-ui'
-import NProgress from 'nprogress' // progress bar
-import 'nprogress/nprogress.css' // progress bar style
-import { getToken } from '@/utils/auth' // get token from cookie
-import getPageTitle from '@/utils/get-page-title'
+import router from "./router";
+import store from "./store";
+import { Message } from "element-ui";
+import NProgress from "nprogress"; // progress bar
+import "nprogress/nprogress.css"; // progress bar style
+import { getToken } from "@/utils/auth"; // get token from cookie
+import getPageTitle from "@/utils/get-page-title";
 
-NProgress.configure({ showSpinner: false }) // NProgress Configuration
+NProgress.configure({ showSpinner: false }); // NProgress Configuration
 
-const whiteList = ['/login'] // no redirect whitelist
+const whiteList = ["/login"]; // no redirect whitelist
 
 router.beforeEach(async (to, from, next) => {
   // start progress bar
-  NProgress.start()
+  NProgress.start();
 
   // set page title
-  document.title = getPageTitle(to.meta.title)
+  document.title = getPageTitle(to.meta.title);
 
   // determine whether the user has logged in
-  const hasToken = getToken()
+  const hasToken = getToken();
 
   if (hasToken) {
-    if (to.path === '/login') {
+    if (to.path === "/login") {
       // if is logged in, redirect to the home page
-      next({ path: '/' })
-      NProgress.done()
+      next({ path: "/" });
+      NProgress.done();
     } else {
-      const hasRoles = store.getters.roles && store.getters.roles.length > 0
+      const hasRoles = store.getters.roles && store.getters.roles.length > 0;
       if (hasRoles) {
-        next()
+        next();
       } else {
         try {
-          const { roles } = await store.dispatch('user/getInfo')
-          const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
-          router.addRoutes(accessRoutes)
-          next({ ...to, replace: true })
+          const { roles } = await store.dispatch("user/getInfo");
+          if (roles && roles.length) {
+            const accessRoutes = await store.dispatch("permission/generateRoutes", roles);
+            router.addRoutes(accessRoutes);
+            next({ ...to, replace: true });
+          } else {
+            await store.dispatch("user/resetToken");
+            Message.error("当前账号无相关权限,请联系管理员");
+            next(`/login?redirect=${to.path}`);
+            NProgress.done();
+            setTimeout(() => {
+              location.reload();
+            }, 2000);
+          }
         } catch (error) {
           // remove token and go to login page to re-login
-          await store.dispatch('user/resetToken')
-          Message.error(error || 'Has Error')
-          next(`/login?redirect=${to.path}`)
-          NProgress.done()
+          await store.dispatch("user/resetToken");
+          Message.error(error || "Has Error");
+          next(`/login?redirect=${to.path}`);
+          NProgress.done();
         }
       }
     }
@@ -49,16 +59,16 @@ router.beforeEach(async (to, from, next) => {
 
     if (whiteList.indexOf(to.path) !== -1) {
       // in the free login whitelist, go directly
-      next()
+      next();
     } else {
       // other pages that do not have permission to access are redirected to the login page.
-      next(`/login?redirect=${to.path}`)
-      NProgress.done()
+      next(`/login?redirect=${to.path}`);
+      NProgress.done();
     }
   }
-})
+});
 
 router.afterEach(() => {
   // finish progress bar
-  NProgress.done()
-})
+  NProgress.done();
+});

+ 25 - 8
src/views/accountManagement/components/accountHome.vue

@@ -26,7 +26,7 @@
                     <div class="flex-wrap">
                       <div class="name">{{ account.user_name }}</div>
                       <div class="loger" @click="toEdit(account.user_id)" />
-                      <div @click="authAccount(account)" class="loger cap-auth"></div>
+                      <div v-is="['account_authorization_button']" @click="authAccount(account)" class="loger cap-auth"></div>
                     </div>
                     <div class="del" @click="deleteUser(account)">
                       <i class="el-icon-close" />
@@ -176,6 +176,8 @@ export default {
         label: "user_group_name",
       },
       options: [],
+      msgType: "all",
+      msgId: null,
     };
   },
   computed: {
@@ -257,11 +259,16 @@ export default {
     },
     //用户组点击
     handleNodeClick(data) {
+      this.accountArr = [];
       if (data.user_group_id != -1 && data.up_user_group_id != -2) {
         this.PageIndex = 1;
-        this.pages = 1;
-        this.getAccountData(data.user_group_id);
+        // this.pages = 1;
+        this.msgType = "cld";
+        this.msgId = data.user_group_id;
+        this.accountList();
+        //this.getAccountData(data.user_group_id);
       } else {
+        this.msgType = "all";
         this.clearSearchData();
       }
     },
@@ -269,6 +276,7 @@ export default {
       const res = await Query({
         id: DATACONTENT_ID.accountGroupDetailsId,
         dataContent: [id],
+        needPage: this.PageIndex,
       });
       if (res.code == 0) {
         const { listValues } = res.returnData;
@@ -424,11 +432,20 @@ export default {
     async accountList() {
       try {
         this.loading = true;
-        const result = await Query({
-          id: DATACONTENT_ID.accountTableId,
-          needPage: this.PageIndex,
-          dataContent: [this.searchInfo],
-        });
+        let result = null;
+        if (this.msgType == "all") {
+          result = await Query({
+            id: DATACONTENT_ID.accountTableId,
+            needPage: this.PageIndex,
+            dataContent: [this.searchInfo],
+          });
+        } else {
+          result = await Query({
+            id: DATACONTENT_ID.accountGroupDetailsId,
+            dataContent: [this.msgId],
+            needPage: this.PageIndex,
+          });
+        }
         if (result.code == 0) {
           this.loading = false;
           const newDatas = result.returnData.listValues;

+ 1 - 1
src/views/authorityManagement/components/authorityRoleHome.vue

@@ -32,7 +32,7 @@
                     <div class="msg flex-wrap">
                       <p :title="item.role_name" class="name">{{ item.role_name }}</p>
                       <div @click="editRole(item)" class="cap cap-edit"></div>
-                      <div @click="authRole(item)" class="cap cap-auth"></div>
+                      <div v-is="['role_authorization_button']" @click="authRole(item)" class="cap cap-auth"></div>
                     </div>
                   </div>
                   <div class="info-close">

+ 247 - 344
src/views/baggageManagement/components/transferArrival/index.vue

@@ -8,17 +8,8 @@
 <template>
   <div class="transfer-in">
     <!--功能区-表单-->
-    <div
-      ref="formWrap"
-      class="terminal-form-wrap"
-    >
-      <el-form
-        ref="form"
-        :inline="true"
-        :model="formData"
-        :rules="rules"
-        class="form"
-      >
+    <div ref="formWrap" class="terminal-form-wrap">
+      <el-form ref="form" :inline="true" :model="formData" :rules="rules" class="form">
         <div class="form-left">
           <el-form-item prop="currentAirport">
             <!-- <el-cascader
@@ -33,22 +24,8 @@
             filterable
             @change="setCurrentAirport"
           /> -->
-            <el-select
-              v-model="formData.currentAirport"
-              class="input-shadow"
-              size="small"
-              style="width: 100px;"
-              filterable
-              default-first-option
-              placeholder="请选择机场"
-              @change="airPortChange"
-            >
-              <el-option
-                v-for="(item, index) in AirportList"
-                :key="index"
-                :label="item.planDepartureApt"
-                :value="item.planDepartureApt"
-              />
+            <el-select v-model="formData.currentAirport" class="input-shadow" size="small" style="width: 100px" filterable default-first-option placeholder="请选择机场" @change="airPortChange">
+              <el-option v-for="(item, index) in AirportList" :key="index" :label="item.planDepartureApt" :value="item.planDepartureApt" />
             </el-select>
           </el-form-item>
           <el-form-item prop="inboundCarrier">
@@ -107,15 +84,12 @@
               @change="endDateChangeHandler"
             />
           </el-form-item> -->
-          <el-form-item
-            prop="flightDate"
-            label="航班日期"
-          >
+          <el-form-item prop="flightDate" label="航班日期">
             <el-date-picker
               v-model="formData.flightDate"
               :clearable="false"
               size="small"
-              style="width: 300px;"
+              style="width: 300px"
               type="daterange"
               value-format="yyyy-MM-dd"
               start-placeholder="开始日期"
@@ -127,38 +101,24 @@
           <el-form-item>
             <div class="box-item">
               <p>预计中转数:</p>
-              <li
-                v-for="(item, index) in orderNum"
-                :key="index"
-                :class="{ 'number-item': !isNaN(item), 'mark-item': isNaN(item) }"
-              >
+              <li v-for="(item, index) in orderNum" :key="index" :class="{ 'number-item': !isNaN(item), 'mark-item': isNaN(item) }">
                 <span v-if="!isNaN(item)">
                   <i ref="numberItem">0123456789</i>
                 </span>
-                <span
-                  v-else
-                  class="comma"
-                >{{ item }}</span>
+                <span v-else class="comma">{{ item }}</span>
               </li>
             </div>
           </el-form-item>
         </div>
-        <div
-          class="form-right"
-          @keyup.enter="onSubmit(1)"
-        >
+        <div class="form-right" @keyup.enter="onSubmit(1)">
           <el-form-item prop="search">
-            <el-popover
-              :value="popoverVisible"
-              placement="bottom"
-              trigger="manual"
-            >
+            <el-popover :value="popoverVisible" placement="bottom" trigger="manual">
               <span>请输入航班号(示例:CA1234)或行李牌号(示例:1234567890)</span>
               <el-input
                 slot="reference"
                 v-model="formData.search"
                 class="input-shadow"
-                style="width: 240px;"
+                style="width: 240px"
                 size="small"
                 placeholder="请输入内容"
                 prefix-icon="el-icon-search"
@@ -169,51 +129,25 @@
             </el-popover>
           </el-form-item>
           <el-form-item>
-            <el-button
-              class="btn-shadow"
-              size="mini"
-              type="primary"
-              @click="onSubmit(1)"
-            >搜索</el-button>
+            <el-button class="btn-shadow" size="mini" type="primary" @click="onSubmit(1)">搜索</el-button>
           </el-form-item>
-          <el-form-item v-is="['ti_showTransit']">
-            <el-button
-              class="btn-shadow"
-              size="mini"
-              type="primary"
-              @click="changeView"
-            >切换视角</el-button>
+          <el-form-item>
+            <el-button class="btn-shadow" size="mini" type="primary" @click="changeView">切换视角</el-button>
           </el-form-item>
           <el-form-item v-is="['ti_timeIcon']">
             <TimeZoneSelector />
           </el-form-item>
           <el-form-item v-is="['ti_columnSettings']">
-            <img
-              class="btn-img btn-shadow"
-              src="@/assets/baggage/ic_setting.png"
-              title="列设置"
-              @click="show"
-            >
+            <img class="btn-img btn-shadow" src="@/assets/baggage/ic_setting.png" title="列设置" @click="show" />
           </el-form-item>
           <el-form-item v-is="['dm_dt_columnSettings']">
-            <img
-              class="btn-img btn-shadow"
-              src="@/assets/baggage/ic_export.png"
-              title="导出"
-              @click="exportHandler('table', '航站中转进港列表')"
-            >
+            <img class="btn-img btn-shadow" src="@/assets/baggage/ic_export.png" title="导出" @click="exportHandler('table', '航站中转进港列表')" />
           </el-form-item>
         </div>
       </el-form>
     </div>
     <!--表格-->
-    <div
-      v-loading="loading"
-      class="terminal-table"
-      element-loading-text="拼命加载中"
-      element-loading-spinner="el-icon-loading"
-      element-loading-background="rgba(0, 0, 0, 0.8)"
-    >
+    <div v-loading="loading" class="terminal-table" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
       <el-table
         ref="table"
         class="table"
@@ -230,27 +164,10 @@
         fit
         @cell-click="cellClickHandler"
       >
-        <el-table-column
-          v-for="col in tableColsCopy"
-          :key="col.prop"
-          :prop="col.prop"
-          :label="col.label"
-          :width="col.width"
-          :fixed="col.fixed"
-        >
-          <el-table-column
-            v-for="childCol in col.children"
-            :key="childCol.prop"
-            :prop="childCol.prop"
-            :label="childCol.label"
-            :width="childCol.width"
-            :formatter="tableFormat"
-          >
+        <el-table-column v-for="col in tableColsCopy" :key="col.prop" :prop="col.prop" :label="col.label" :width="col.width" :fixed="col.fixed">
+          <el-table-column v-for="childCol in col.children" :key="childCol.prop" :prop="childCol.prop" :label="childCol.label" :width="childCol.width" :formatter="tableFormat">
             <template #header>
-              <el-tooltip
-                :content="childCol.desc || childCol.label"
-                placement="top"
-              >
+              <el-tooltip :content="childCol.desc || childCol.label" placement="top">
                 <TableHeaderCell
                   :label="childCol.label"
                   :filter-options="tableDataFilters[childCol.prop]"
@@ -265,10 +182,7 @@
       </el-table>
     </div>
     <!--列设置-->
-    <Dialog
-      :flag="dialogFlag"
-      class="dialog-check-group"
-    >
+    <Dialog :flag="dialogFlag" class="dialog-check-group">
       <div class="dialog-wrapper">
         <div class="title">列设置</div>
         <div class="content">
@@ -287,16 +201,8 @@
           />
         </div>
         <div class="foot right t30">
-          <el-button
-            size="medium"
-            class="r24"
-            type="primary"
-            @click="onCheck"
-          >确定</el-button>
-          <el-button
-            size="medium"
-            @click="hide"
-          >取消</el-button>
+          <el-button size="medium" class="r24" type="primary" @click="onCheck">确定</el-button>
+          <el-button size="medium" @click="hide">取消</el-button>
         </div>
       </div>
     </Dialog>
@@ -304,159 +210,159 @@
 </template>
 
 <script>
-import Dialog from '@/layout/components/Dialog'
-import TimeZoneSelector from '@/components/TimeZoneSelector'
-import terminalMixin from '../../mixins/terminal'
-import formMixin from '../../mixins/form'
-import tableColsMixin from '../../mixins/tableCols'
-import timeZoneMixin from '../../mixins/timeZone'
-import { getQuery } from '@/api/flight'
-import TableHeaderCell from '@/components/TableHeaderCell'
-import { setTableFilters, throttledExportToExcel } from '@/utils/table'
+import Dialog from "@/layout/components/Dialog";
+import TimeZoneSelector from "@/components/TimeZoneSelector";
+import terminalMixin from "../../mixins/terminal";
+import formMixin from "../../mixins/form";
+import tableColsMixin from "../../mixins/tableCols";
+import timeZoneMixin from "../../mixins/timeZone";
+import { getQuery } from "@/api/flight";
+import TableHeaderCell from "@/components/TableHeaderCell";
+import { setTableFilters, throttledExportToExcel } from "@/utils/table";
 
 export default {
-  name: 'DepartureTerminalView',
+  name: "DepartureTerminalView",
   components: { Dialog, TimeZoneSelector, TableHeaderCell },
   mixins: [terminalMixin, formMixin, tableColsMixin, timeZoneMixin],
   data() {
     return {
       optionProps: {
-        value: 'inAicompanyCode2',
-        label: 'inAicompanyCode2'
+        value: "inAicompanyCode2",
+        label: "inAicompanyCode2",
       },
       optionPropser: {
-        value: 'outAicompanyCode2',
-        label: 'outAicompanyCode2'
+        value: "outAicompanyCode2",
+        label: "outAicompanyCode2",
       },
       popoverVisible: false,
-      orderNum: ['0', '0', '0', '0', '0', '0'], // 默认总数
+      orderNum: ["0", "0", "0", "0", "0", "0"], // 默认总数
       // 初始表头
       tableCols: [
         {
-          prop: 'arrivalInfo',
-          label: '进港航班',
+          prop: "arrivalInfo",
+          label: "进港航班",
           width: 180,
-          fixed: 'left',
+          fixed: "left",
           children: [
             {
-              prop: 'preFlightNO',
-              label: '航班号',
-              desc: '进港航班编号',
+              prop: "preFlightNO",
+              label: "航班号",
+              desc: "进港航班编号",
               width: 80,
               filterable: true,
-              sortable: true
+              sortable: true,
             },
             {
-              prop: 'preFlightDate',
-              label: '航班日期',
-              desc: '指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)',
-              width: 100
+              prop: "preFlightDate",
+              label: "航班日期",
+              desc: "指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)",
+              width: 100,
             },
             {
-              prop: 'preAirport',
-              label: '起飞航站',
-              desc: '指进港航班的起飞机场三字码',
+              prop: "preAirport",
+              label: "起飞航站",
+              desc: "指进港航班的起飞机场三字码",
               width: 100,
               filterable: true,
-              sortable: true
+              sortable: true,
             },
             {
-              prop: 'actualLandingTime',
-              label: '降落时间',
-              desc: '根据优先级别显示时间。优先级别:1.实际降落时间,2.预计降落时间,3.计划降落时间',
-              width: 100
+              prop: "actualLandingTime",
+              label: "降落时间",
+              desc: "根据优先级别显示时间。优先级别:1.实际降落时间,2.预计降落时间,3.计划降落时间",
+              width: 100,
             },
             {
-              prop: 'landingBuild',
-              label: '降落航站楼',
-              desc: '指航班降落后位于机场的哪个航站楼',
+              prop: "landingBuild",
+              label: "降落航站楼",
+              desc: "指航班降落后位于机场的哪个航站楼",
               width: 98,
               filterable: true,
-              sortable: true
+              sortable: true,
             },
             {
-              prop: 'carousel',
-              label: '行李转盘',
-              desc: '指航班到达后行李提取的地方,仅显示最新信息',
+              prop: "carousel",
+              label: "行李转盘",
+              desc: "指航班到达后行李提取的地方,仅显示最新信息",
               width: 100,
               filterable: true,
-              sortable: true
+              sortable: true,
             },
             {
-              prop: 'standForLanding',
-              label: '降落停机位',
-              desc: '指航班的停机位代码,数据是变化的,仅显示最新信息',
+              prop: "standForLanding",
+              label: "降落停机位",
+              desc: "指航班的停机位代码,数据是变化的,仅显示最新信息",
               width: 98,
               filterable: true,
-              sortable: true
+              sortable: true,
             },
             {
-              prop: 'inTransferBaggageCount',
-              label: '中转行李数',
-              desc: '指航班在本航站预计需要中转至对应航班的行李数量'
-            }
-          ]
+              prop: "inTransferBaggageCount",
+              label: "中转行李数",
+              desc: "指航班在本航站预计需要中转至对应航班的行李数量",
+            },
+          ],
         },
         {
-          prop: 'departureInfo',
-          label: '离港航班',
+          prop: "departureInfo",
+          label: "离港航班",
           children: [
             {
-              prop: 'inTransferredBaggageCount',
-              label: '已中转行李数',
-              desc: '指航班在本航站实际已经中转至对应航班的行李数量',
-              width: 100
+              prop: "inTransferredBaggageCount",
+              label: "已中转行李数",
+              desc: "指航班在本航站实际已经中转至对应航班的行李数量",
+              width: 100,
             },
             {
-              prop: 'flightNO',
-              label: '航班号',
-              desc: '指航班编号',
+              prop: "flightNO",
+              label: "航班号",
+              desc: "指航班编号",
               width: 80,
               filterable: true,
-              sortable: true
+              sortable: true,
             },
             {
-              prop: 'flightDate',
-              label: '航班日期',
-              desc: '指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)',
-              width: 100
+              prop: "flightDate",
+              label: "航班日期",
+              desc: "指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)",
+              width: 100,
             },
             {
-              prop: 'actualDepartureTime',
-              label: '起飞时间',
-              desc: '指航班预计起飞时间,数据是变化的,仅显示最新结果',
-              width: 100
+              prop: "actualDepartureTime",
+              label: "起飞时间",
+              desc: "指航班预计起飞时间,数据是变化的,仅显示最新结果",
+              width: 100,
             },
             {
-              prop: 'targetAirport',
-              label: '目的站',
-              desc: '指航班执飞航段的目的航站,以航站三字码+航站简称显示',
+              prop: "targetAirport",
+              label: "目的站",
+              desc: "指航班执飞航段的目的航站,以航站三字码+航站简称显示",
               filterable: true,
-              sortable: true
+              sortable: true,
             },
             {
-              prop: 'departureBuild',
-              label: '起飞航站楼',
-              desc: '指航班执飞航段的起飞航站的航站楼',
+              prop: "departureBuild",
+              label: "起飞航站楼",
+              desc: "指航班执飞航段的起飞航站的航站楼",
               width: 98,
               filterable: true,
-              sortable: true
+              sortable: true,
             },
             {
-              prop: 'bordingGate',
-              label: '起飞登机口',
-              desc: '指航班的登机口代码,数据是变化的,仅显示最新信息',
+              prop: "bordingGate",
+              label: "起飞登机口",
+              desc: "指航班的登机口代码,数据是变化的,仅显示最新信息",
               width: 98,
               filterable: true,
-              sortable: true
+              sortable: true,
             },
             {
-              prop: 'standForDepartrue',
-              label: '起飞停机位',
-              desc: '指航班的停机位代码,数据是变化的,仅显示最新信息',
+              prop: "standForDepartrue",
+              label: "起飞停机位",
+              desc: "指航班的停机位代码,数据是变化的,仅显示最新信息",
               width: 98,
               filterable: true,
-              sortable: true
+              sortable: true,
             },
             // {
             //   prop: 'outTransferBaggageCount',
@@ -471,12 +377,12 @@ export default {
             //   width: 120
             // },
             {
-              prop: 'timeDifference',
-              label: '转运时间',
-              desc: '指中转动作完成时间'
-            }
-          ]
-        }
+              prop: "timeDifference",
+              label: "转运时间",
+              desc: "指中转动作完成时间",
+            },
+          ],
+        },
       ],
       loading: false,
       AirportList: [],
@@ -489,55 +395,52 @@ export default {
       spanArr: [],
       contactDot: 0,
       flag: 0,
-      table: null
-    }
+      table: null,
+    };
   },
   computed: {
     singleDay() {
-      return this.startDate === this.endDate
-    }
+      return this.startDate === this.endDate;
+    },
   },
   watch: {
     dealedTableData: {
       handler(val) {
-        this.spanArr = []
-        let contactDot = this.contactDot
+        this.spanArr = [];
+        let contactDot = this.contactDot;
         val.forEach((item, index, arr) => {
           if (index === 0) {
-            this.spanArr.push(1)
+            this.spanArr.push(1);
           } else {
-            if (
-              item['preFlightNO'] === arr[index - 1]['preFlightNO'] &&
-              item['preFlightDate'] === arr[index - 1]['preFlightDate']
-            ) {
-              this.spanArr[contactDot] += 1
-              this.spanArr.push(0)
+            if (item["preFlightNO"] === arr[index - 1]["preFlightNO"] && item["preFlightDate"] === arr[index - 1]["preFlightDate"]) {
+              this.spanArr[contactDot] += 1;
+              this.spanArr.push(0);
             } else {
-              this.spanArr.push(1)
-              contactDot = index
+              this.spanArr.push(1);
+              contactDot = index;
             }
           }
-        })
+        });
       },
-      deep: true
-    }
+      deep: true,
+    },
   },
   created() {
     // this.getAirPortData()
   },
   mounted() {
-    this.$refs['form'].validateField('flightDate')
-    this.getAirPortData()
-    this.table = this.$refs.table.bodyWrapper
-    const that = this
-    this.table.addEventListener('scroll', () => {
-      that.scrollTop = this.table.scrollTop
-    })
+    this.$refs["form"].validateField("flightDate");
+    this.getAirPortData();
+    this.table = this.$refs.table.bodyWrapper;
+    const that = this;
+    this.table.addEventListener("scroll", () => {
+      that.scrollTop = this.table.scrollTop;
+    });
   },
   activated() {
-    this.table.scrollTop = this.scrollTop
-    this.getTableData()
-    this.loopEvent = setInterval(this.getTableData, LOOP_INTERVAL.transferArrivalTable)
+    this.table.scrollTop = this.scrollTop;
+    this.getTableData();
+    this.loopEvent = setInterval(this.getTableData, LOOP_INTERVAL.transferArrivalTable);
     // const { startDate, endDate } = this.$route.query
     // Object.entries(this.$route.query).forEach(([key, value]) => {
     //   if ((value ?? '') !== '' && JSON.stringify(value) !== '[]') {
@@ -553,41 +456,41 @@ export default {
   },
   deactivated() {
     if (this.loopEvent) {
-      clearInterval(this.loopEvent)
-      this.loopEvent = null
+      clearInterval(this.loopEvent);
+      this.loopEvent = null;
     }
   },
   beforeDestroy() {
     if (this.loopEvent) {
-      clearInterval(this.loopEvent)
-      this.loopEvent = null
+      clearInterval(this.loopEvent);
+      this.loopEvent = null;
     }
   },
   methods: {
     resetLoopEvent() {
-      this.loading = true
-      this.hasSetTableScroll = false
-      this.loopEvent && clearInterval(this.loopEvent)
-      this.getTableData()
-      this.loopEvent = setInterval(this.getTableData, LOOP_INTERVAL.transferArrivalTable)
+      this.loading = true;
+      this.hasSetTableScroll = false;
+      this.loopEvent && clearInterval(this.loopEvent);
+      this.getTableData();
+      this.loopEvent = setInterval(this.getTableData, LOOP_INTERVAL.transferArrivalTable);
     },
     headerCellClass({ row, column }) {
-      const classes = []
-      const rule = this.tableDataSortRules[column.property]
+      const classes = [];
+      const rule = this.tableDataSortRules[column.property];
       if (rule) {
-        classes.push(rule)
+        classes.push(rule);
       }
-      return classes.join(' ')
+      return classes.join(" ");
     },
     tableRowClassName({ row, rowIndex }) {
-      const classes = []
+      const classes = [];
       if (row.hasArrived) {
-        classes.push('bgl-hui')
+        classes.push("bgl-hui");
         if (rowIndex === this.arrivalCount - 1) {
-          classes.push('redBorder')
+          classes.push("redBorder");
         }
       }
-      return classes.join(' ')
+      return classes.join(" ");
     },
     changeView() {
       // const query = {
@@ -600,36 +503,36 @@ export default {
       //   path: '/transfer/departure',
       //   query
       // })
-      this.$router.push('/transfer/departure')
+      this.$router.push("/transfer/departure");
     },
     airPortChange() {
-      this.getAviationData()
-      this.upAviationData()
-      this.resetLoopEvent()
+      this.getAviationData();
+      this.upAviationData();
+      this.resetLoopEvent();
     },
     dateChangeHandler() {
-      this.getAviationData()
-      this.upAviationData()
-      this.resetLoopEvent()
+      this.getAviationData();
+      this.upAviationData();
+      this.resetLoopEvent();
     },
     // 选择机场
     async getAirPortData() {
       try {
         const res = await getQuery({
           id: DATACONTENT_ID.departureAirId,
-          dataContent: []
-        })
+          dataContent: [],
+        });
         if (Number(res.code) === 0) {
-          this.AirportList = res.returnData.listValues
-          this.formData.currentAirport = 'PEK'
-          this.getAviationData()
-          this.upAviationData()
-          this.resetLoopEvent()
+          this.AirportList = res.returnData.listValues;
+          this.formData.currentAirport = "PEK";
+          this.getAviationData();
+          this.upAviationData();
+          this.resetLoopEvent();
         } else {
-          this.$message.error(res.message)
+          this.$message.error(res.message);
         }
       } catch (error) {
-        console.log('出错了', error.message || error)
+        console.log("出错了", error.message || error);
       }
     },
     // 选择航司
@@ -637,15 +540,15 @@ export default {
       try {
         const res = await getQuery({
           id: DATACONTENT_ID.departureAviJoinId,
-          dataContent: [this.formData.currentAirport]
-        })
+          dataContent: [this.formData.currentAirport],
+        });
         if (Number(res.code) === 0) {
-          this.carrierProps = res.returnData.listValues
+          this.carrierProps = res.returnData.listValues;
         } else {
-          this.$message.error(res.message)
+          this.$message.error(res.message);
         }
       } catch (error) {
-        console.log('出错了', error.message || error)
+        console.log("出错了", error.message || error);
       }
     },
     // 选择航司
@@ -653,15 +556,15 @@ export default {
       try {
         const res = await getQuery({
           id: DATACONTENT_ID.departureAviLeaveId,
-          dataContent: [this.formData.currentAirport]
-        })
+          dataContent: [this.formData.currentAirport],
+        });
         if (Number(res.code) === 0) {
-          this.carrierPropsop = res.returnData.listValues
+          this.carrierPropsop = res.returnData.listValues;
         } else {
-          this.$message.error(res.message)
+          this.$message.error(res.message);
         }
       } catch (error) {
-        console.log('出错了', error.message || error)
+        console.log("出错了", error.message || error);
       }
     },
     // 获取表单下拉框数据
@@ -677,10 +580,10 @@ export default {
     // 获取表格数据
     async getTableData() {
       if (!this.formData.currentAirport || !this.startDate || !this.endDate) {
-        return
+        return;
       }
-      const arrs1 = [this.formData.inboundCarrier.length === 0 ? '' : this.formData.inboundCarrier[0]]
-      const arrs2 = [this.formData.outgoingAirline.length === 0 ? '' : this.formData.outgoingAirline[0]]
+      const arrs1 = [this.formData.inboundCarrier.length === 0 ? "" : this.formData.inboundCarrier[0]];
+      const arrs2 = [this.formData.outgoingAirline.length === 0 ? "" : this.formData.outgoingAirline[0]];
       const arr = [
         this.formData.currentAirport,
         this.startDate,
@@ -690,123 +593,123 @@ export default {
         ...arrs1,
         ...arrs2,
         ...arrs2,
-        ...arrs2
+        ...arrs2,
         // this.formData.inboundCarrier,
         // this.formData.outgoingAirline,
         // JSON.stringify(this.formData.inboundCarrier),
         // JSON.stringify(this.formData.outgoingAirline),
-      ]
+      ];
       try {
         const res = await getQuery({
           id: DATACONTENT_ID.departureTableId,
-          dataContent: [...arr]
-        })
+          dataContent: [...arr],
+        });
         if (Number(res.code) === 0) {
-          this.initTableData(res.returnData.listValues)
+          this.initTableData(res.returnData.listValues);
         } else {
-          console.log(res.message)
+          console.log(res.message);
         }
-        this.loading = false
+        this.loading = false;
       } catch (error) {
         if (this.loopEvent) {
-          clearInterval(this.loopEvent)
-          this.loopEvent = null
+          clearInterval(this.loopEvent);
+          this.loopEvent = null;
         }
-        this.loading = false
-        console.log('出错了', error.message || error)
+        this.loading = false;
+        console.log("出错了", error.message || error);
       }
     },
     initTableData(tableData) {
-      this.arrivalCount = 0
-      this.baggageCount = 0
-      tableData.forEach(item => {
+      this.arrivalCount = 0;
+      this.baggageCount = 0;
+      tableData.forEach((item) => {
         if (this.hasArrived(item)) {
-          this.arrivalCount++
+          this.arrivalCount++;
         }
-        this.baggageCount = this.baggageCount + item.inTransferBaggageCount
-      })
-      this.tableData = this._.sortBy(tableData, ['actualLandingTime', 'preFlightNO', 'actualDepartureTime', 'flightNO'])
-      setTableFilters(this.tableData, this.tableDataFilters)
-      this.toOrderNum(this.baggageCount)
+        this.baggageCount = this.baggageCount + item.inTransferBaggageCount;
+      });
+      this.tableData = this._.sortBy(tableData, ["actualLandingTime", "preFlightNO", "actualDepartureTime", "flightNO"]);
+      setTableFilters(this.tableData, this.tableDataFilters);
+      this.toOrderNum(this.baggageCount);
       this.$nextTick(() => {
-        this.setTableScroll()
-      })
+        this.setTableScroll();
+      });
     },
     hasArrived(flight) {
       if (flight.actualLandingTime) {
-        const now = new Date()
-        const actualLandingTime = new Date(flight.actualLandingTime.replace('T', ' '))
-        flight['hasArrived'] = now > actualLandingTime && !flight['flightCanceled']
+        const now = new Date();
+        const actualLandingTime = new Date(flight.actualLandingTime.replace("T", " "));
+        flight["hasArrived"] = now > actualLandingTime && !flight["flightCanceled"];
       } else {
-        flight['hasArrived'] = false
+        flight["hasArrived"] = false;
       }
-      return flight['hasArrived']
+      return flight["hasArrived"];
     },
     setTableScroll() {
       if (!this.singleDay || this.hasSetTableScroll || this.arrivalCount === 0) {
-        return
+        return;
       }
-      const table = this.$refs['table'].$el
-      const scrollParent = table.querySelector('.el-table__body-wrapper')
+      const table = this.$refs["table"].$el;
+      const scrollParent = table.querySelector(".el-table__body-wrapper");
       if (scrollParent.scrollHeight <= scrollParent.offsetHeight) {
-        return
+        return;
       }
-      const lastRow = table.querySelectorAll('.el-table__body tr')[this.arrivalCount - 1]
+      const lastRow = table.querySelectorAll(".el-table__body tr")[this.arrivalCount - 1];
       setTimeout(() => {
-        const scrollMid = lastRow.offsetTop + lastRow.offsetHeight - scrollParent.offsetHeight / 2
-        const scrollMax = scrollParent.scrollHeight - scrollParent.offsetHeight
+        const scrollMid = lastRow.offsetTop + lastRow.offsetHeight - scrollParent.offsetHeight / 2;
+        const scrollMax = scrollParent.scrollHeight - scrollParent.offsetHeight;
         if (scrollMid > 0) {
-          const scrollHeight = Math.min(scrollMid, scrollMax)
-          scrollParent.scrollTo(0, scrollHeight)
+          const scrollHeight = Math.min(scrollMid, scrollMax);
+          scrollParent.scrollTo(0, scrollHeight);
         }
-      }, 0)
-      this.hasSetTableScroll = true
+      }, 0);
+      this.hasSetTableScroll = true;
     },
     setNumberTransform() {
-      const numberItems = this.$refs.numberItem // 拿到数字的ref,计算元素数量
-      const numberArr = this.orderNum.filter(item => !isNaN(item))
+      const numberItems = this.$refs.numberItem; // 拿到数字的ref,计算元素数量
+      const numberArr = this.orderNum.filter((item) => !isNaN(item));
       // 结合CSS 对数字字符进行滚动,显示订单数量
       for (let index = 0; index < numberItems.length; index++) {
-        const elem = numberItems[index]
-        elem.style.transform = `translate(-50%, -${numberArr[index] * 10}%)`
+        const elem = numberItems[index];
+        elem.style.transform = `translate(-50%, -${numberArr[index] * 10}%)`;
       }
     },
 
     toOrderNum(num) {
-      num = num.toString()
+      num = num.toString();
       if (num.length < 6) {
-        num = '0' + num // 如未满八位数,添加"0"补位
-        this.toOrderNum(num) // 递归添加"0"补位
+        num = "0" + num; // 如未满八位数,添加"0"补位
+        this.toOrderNum(num); // 递归添加"0"补位
       } else if (num.length >= 6) {
-        this.orderNum = num.split('') // 将其便变成数据,渲染至滚动数组
+        this.orderNum = num.split(""); // 将其便变成数据,渲染至滚动数组
       } else {
         // 订单总量数字超过八位显示异常
-        this.$message.warning('总量数字过大')
+        this.$message.warning("总量数字过大");
       }
-      this.setNumberTransform()
+      this.setNumberTransform();
     },
     arraySpanMethod({ row, column, rowIndex, columnIndex }) {
       for (let i = 0; i < 7; i++) {
         if (columnIndex === i) {
-          const _row = this.spanArr[rowIndex]
-          const _col = _row > 0 ? 1 : 0
+          const _row = this.spanArr[rowIndex];
+          const _col = _row > 0 ? 1 : 0;
           return {
             rowspan: _row,
-            colspan: _col
-          }
+            colspan: _col,
+          };
         }
       }
     },
     exportHandler(refName, tableName) {
       if (this.loading) {
-        return
+        return;
       }
-      const table = this.$refs[refName].$el.cloneNode(true)
-      const fileName = `${tableName}-${this.currentAirport}-${this.startDate}-${this.endDate}.xlsx`
-      throttledExportToExcel(table, tableName, fileName, 2)
-    }
-  }
-}
+      const table = this.$refs[refName].$el.cloneNode(true);
+      const fileName = `${tableName}-${this.currentAirport}-${this.startDate}-${this.endDate}.xlsx`;
+      throttledExportToExcel(table, tableName, fileName, 2);
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -830,7 +733,7 @@ export default {
       optgroup,
       select,
       textarea {
-        font-family: Helvetica, 'Microsoft YaHei';
+        font-family: Helvetica, "Microsoft YaHei";
         font-size: 14px;
       }
       .el-switch__label {
@@ -936,7 +839,7 @@ export default {
       padding: 0;
       text-align: center;
       font-size: 14px;
-      font-family: Helvetica, 'Microsoft YaHei';
+      font-family: Helvetica, "Microsoft YaHei";
       letter-spacing: 0;
     }
     .cell-click {
@@ -970,7 +873,7 @@ export default {
         &.redBorder {
           position: relative;
           &::after {
-            content: '';
+            content: "";
             position: absolute;
             left: 0;
             bottom: 0;

+ 703 - 0
src/views/systemSettings/views/serviceManagement/serviceEdi2.vue

@@ -0,0 +1,703 @@
+<!--
+ * @Date: 2022-03-24 09:55:13
+ * @LastEditTime: 2022-08-09 17:22:52
+ * @LastEditors: your name
+ * @Description: 服务管理-编辑服务
+ * have a nice day!
+-->
+
+<template>
+  <div class="service-edit">
+    <div class="scrollbar">
+      <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
+          >
+        </header>
+        <main class="content">
+          <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-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>
+              </el-col>
+              <el-col :span="4">
+                <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="管理后端" />
+                    <el-option :value="3" label="业务前端" />
+                    <el-option :value="4" label="业务后端" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <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-select>
+                  </el-form-item>
+                  <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>
+                    <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="6">
+                <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-form-item>
+              </el-col>
+              <!-- <el-col :span="4">
+                <el-form-item label="采集线程" prop="threads">
+                  <el-input v-model="serviceForm.threads" type="number" placeholder="请输入采集线程数" clearable />
+                </el-form-item>
+              </el-col> -->
+              <el-col :span="4">
+                <el-form-item label-width="0" prop="isAsynchronous">
+                  <el-radio-group v-model="serviceForm.isAsynchronous">
+                    <el-radio :label="1">同步</el-radio>
+                    <el-radio :label="0">异步</el-radio>
+                  </el-radio-group>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="6">
+                <el-form-item label="数据类型" prop="datatype">
+                  <el-select v-model="serviceForm.datatype" clearable>
+                    <el-option label="JSON" :value="1" />
+                    <el-option label="XML" :value="2" />
+                    <el-option label="自定义" :value="3" />
+                  </el-select>
+                </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>
+              </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-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-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-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-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>
+              </el-col>
+              <el-col :span="4">
+                <el-form-item label="循环次数" prop="loopCount">
+                  <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-form-item>
+              </el-col>
+              <el-col :span="4">
+                <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" />
+                    <el-option label="分钟" :value="60 * 1000" />
+                    <el-option label="秒" :value="1000" />
+                    <el-option label="毫秒" :value="1" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="4">
+                <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-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>
+              </el-col>
+            </el-row>
+          </el-form>
+        </main>
+      </div>
+      <div class="service-tables">
+        <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
+            >
+          </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"
+            />
+          </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
+            >
+          </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"
+            />
+          </main>
+        </div>
+      </div>
+    </div>
+    <Dialog :flag="sourceFormVisible" width="464px">
+      <div class="dialog-create">
+        <div class="title">新增数据来源</div>
+        <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-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>
+            </el-form-item>
+            <el-form-item label="连接参数">
+              <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
+          >
+        </div>
+      </div>
+    </Dialog>
+  </div>
+</template>
+
+<script>
+// import NoData from '@/components/nodata'
+import Dialog from "@/layout/components/Dialog";
+import DataTable from "@/components/Table";
+import { myQuery, GeneralDataReception } from "@/api/dataIntegration";
+
+import operate from "./mixins/operate";
+
+export default {
+  components: {
+    // NoData,
+    Dialog,
+    DataTable,
+  },
+  mixins: [
+    // query,
+    operate,
+  ],
+  data() {
+    return {
+      outId: DATACONTENT_ID.sysServiceOutTabId,
+      jqId: DATACONTENT_ID.sysServiceJqTabId,
+      serviceID: Number(this.$route.query.serviceID),
+      operateDialogType: null,
+      delObj: {},
+      deleteDialogType: null,
+      sourceFormVisible: false,
+      tempCheckedKeys: [],
+      serviceForm: {
+        serviceName: "",
+        serviceOutputID: null,
+        serviceType: null,
+        sourceObjectName: "",
+        lifeCycleCol: "",
+        serviceDescribe: "",
+        threads: null,
+        isAsynchronous: 1,
+        datatype: null,
+        dataSourceID: null,
+        computingMethod: "",
+        validationExpression: "",
+        startTime: null,
+        stopTime: null,
+        retryCount: null,
+        loopCount: null,
+        frequencyCount: null,
+        frequencyUnit: null,
+        logDataSourceID: null,
+        logList: "",
+      },
+      computedTableHeight: "200px",
+      targetList: [],
+      protocolList: [],
+      nodeList: [],
+      checkedNodeKeys: [],
+      serviceAndNodeList: [],
+      dataSourceList: [],
+      checkedSourceKeys: [],
+      serviceAndSourceList: [],
+      processList: [],
+      checkedProcessKeys: [],
+      outputList: [],
+      formLabelAlign: {
+        dataSourceName: "",
+        protocolName: "",
+        connectConfig: "",
+      },
+      sourceDatas: [],
+    };
+  },
+  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)`;
+  },
+  methods: {
+    editSubmitHandler() {
+      this.$refs["serviceForm"].validate((valid) => {
+        if (valid) {
+          this.updateService();
+        }
+      });
+    },
+    btnAddClickHandler(flag) {
+      switch (flag) {
+        case 1:
+          this.$refs["serviceOutputTable"].handleAdd();
+          break;
+        case 2:
+          this.$refs["serviceMachineTable"].handleAdd();
+          break;
+        default:
+          break;
+      }
+    },
+    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;
+      try {
+        const message = await this.updateServiceNode(event, row);
+        this.$message.success(message ?? "操作成功");
+      } catch (error) {
+        this.$message.error(error);
+        this.$refs["serviceMachineTable"].toggleRowSelection(row, !isSelected);
+      }
+    },
+    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;
+        });
+      } else {
+        this.sourceDatas = dataSourceList.map((item) => {
+          item[item.setlabel] = item.k;
+          item[item.setvalue] = item.v;
+          return item;
+        });
+      }
+    },
+    async getSelectOption(ID) {
+      try {
+        const listValues = await myQuery(ID);
+        return listValues;
+      } catch (error) {
+        this.$message.error(error);
+        return [];
+      }
+    },
+    async queryServiceByID(serviceID) {
+      const serviceInfo = await myQuery(
+        DATACONTENT_ID.sysServiceEditId,
+        serviceID
+      );
+      Object.entries(serviceInfo[0]).forEach(([key, value]) => {
+        this.serviceForm[key] = value;
+      });
+    },
+    async formService() {
+      this.sourceDatas.forEach((item) => {
+        if (item.protocolID == this.formLabelAlign.protocolName) {
+          this.formLabelAlign.protocolName = item.protocolName;
+          this.formLabelAlign.protocolID = item.protocolID;
+        }
+      });
+      try {
+        this.formLabelAlign["event"] = 1;
+        const res = await GeneralDataReception({
+          serviceId: SERVICE_ID.sysServiceAddXyId,
+          dataContent: JSON.stringify(this.formLabelAlign),
+        });
+        if (Number(res.code) === 0) {
+          this.$message.success(res.message ?? "成功");
+          this.sourceFormVisible = false;
+          this.getDataSourceList(DATACONTENT_ID.sysSourceId);
+        } else {
+          this.$message.error(res.message ?? "失败");
+        }
+      } catch (error) {
+        console.log("出错了", error.message || error);
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.service-edit {
+  margin: 0 -24px;
+  padding-bottom: 16px;
+  overflow: hidden;
+  .scrollbar {
+    height: calc(100vh - 120px);
+    padding: 0 24px;
+    overflow-x: hidden;
+    overflow-y: auto;
+    .service-edit-wrapper {
+      padding: 26px 24px 0 24px;
+      .title {
+        display: flex;
+        justify-content: space-between;
+        margin-bottom: 24px;
+        &:nth-of-type(2) {
+          margin-top: 10px;
+        }
+        .manageTitle {
+          height: 32px;
+          line-height: 30px;
+        }
+        .el-button {
+          width: 64px;
+          height: 32px;
+          border: none;
+          &.btn-white {
+            background-color: #ffffff;
+            border: 1px solid #92ace2;
+            color: #2d67e3;
+          }
+          &:hover {
+            background-color: #487be8;
+            color: #ffffff;
+          }
+        }
+      }
+      .content {
+        margin: 0;
+      }
+    }
+    ::v-deep .service-form-wrapper {
+      background: #ffffff;
+      box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.1);
+      border-radius: 4px;
+      .service-form {
+        > .el-row {
+          flex-wrap: wrap;
+          > .el-col {
+            .el-form-item {
+              margin-bottom: 25px;
+              .el-form-item__label {
+                padding-right: 16px;
+              }
+              .el-input,
+              .el-select {
+                width: 100%;
+                height: 32px;
+              }
+            }
+          }
+        }
+        label,
+        span,
+        button,
+        input,
+        optgroup,
+        select,
+        textarea {
+          font-family: Helvetica, Microsoft YaHei;
+          font-size: 14px;
+          font-weight: 400;
+        }
+        label {
+          color: #303133;
+        }
+        input {
+          color: #101116;
+          &::-webkit-outer-spin-button,
+          &::-webkit-inner-spin-button {
+            -webkit-appearance: none !important;
+          }
+          &[type="number"] {
+            -moz-appearance: textfield !important;
+          }
+        }
+        .el-radio {
+          font-weight: 400;
+        }
+      }
+    }
+    .service-tables {
+      width: 100%;
+      display: flex;
+      margin: 0 -12px;
+      .service-table-wrapper {
+        padding-left: 12px;
+        padding-right: 12px;
+        &:nth-child(1) {
+          flex: 1 1 624px;
+        }
+        &:nth-child(2) {
+          flex: 0 1 624px;
+          padding-right: 0px;
+        }
+      }
+    }
+  }
+  .dialog-checkbox {
+    .content {
+      margin-left: 16px;
+      .el-checkbox-group {
+        margin-right: 24px;
+        .el-checkbox {
+          margin-bottom: 24px;
+          font-family: Helvetica, Microsoft YaHei;
+          color: #303133;
+        }
+      }
+    }
+  }
+  ::v-deep #dialog-form .el-select .el-input__inner {
+    width: 100%;
+  }
+}
+</style>

+ 449 - 336
src/views/systemSettings/views/serviceManagement/serviceEdit.vue

@@ -9,327 +9,216 @@
 <template>
   <div class="service-edit">
     <div class="scrollbar">
-      <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
-          >
-        </header>
-        <main class="content">
-          <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 ref="serviceForm" class="service-form" :model="serviceForm" label-position="right" label-width="80px" size="mini">
+        <div class="content-list-box">
+          <div class="flex content-list-box-head">
+            <div class="manageTitle">
+              <span class="s1">当前服务ID:{{ serviceID }}</span>
+              <span class="s2">{{ serviceState }}</span>
+            </div>
+            <div class="manageBtns">
+              <el-button size="mini" @click="slotVisible = true" type="primary">{{ slotValue }}个插槽</el-button>
+              <el-button size="mini" @click="handleLog" class="btn-white" plain type="primary">查看日志</el-button>
+              <el-button size="mini" @click="editSubmitHandler" type="primary">保存</el-button>
+            </div>
+          </div>
+          <div class="content-list-box-body">
+            <el-row :gutter="48" type="flex">
+              <el-col :span="5">
                 <el-form-item label="服务名称" prop="serviceName">
-                  <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>
-              </el-col>
-              <el-col :span="4">
-                <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="管理后端" />
-                    <el-option :value="3" label="业务前端" />
-                    <el-option :value="4" label="业务后端" />
-                  </el-select>
+                  <el-input v-model="serviceForm.serviceName" placeholder="请输入服务名称" clearable />
                 </el-form-item>
               </el-col>
-              <el-col :span="6">
+              <el-col :span="5">
                 <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-form-item label="业务类型" prop="serviceType">
+                    <el-select v-model="serviceForm.serviceType" clearable>
+                      <el-option :value="1" label="管理前端" />
+                      <el-option :value="2" label="管理后端" />
+                      <el-option :value="3" label="业务前端" />
+                      <el-option :value="4" label="业务后端" />
+                    </el-select>
+                  </el-form-item>
+                  <el-form-item class="isAsynchronous">
+                    <el-select v-model="serviceForm.isAsynchronous">
+                      <el-option :value="1" label="同步"></el-option>
+                      <el-option :value="0" label="异步"></el-option>
                     </el-select>
                   </el-form-item>
-                  <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>
-                    <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="6">
-                <el-form-item
-                  label="数据来源对象"
-                  prop="sourceObjectName"
-                  label-width="100px"
-                >
-                  <el-input
-                    v-model="serviceForm.sourceObjectName"
-                    placeholder="请输入数据来源对象名称"
-                    clearable
-                  />
+              <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-form-item>
               </el-col>
-              <el-col :span="12">
-                <el-form-item label="服务描述" prop="serviceDescribe">
-                  <el-input
-                    v-model="serviceForm.serviceDescribe"
-                    placeholder="请输入描述"
-                    clearable
-                  />
+              <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-form-item>
               </el-col>
-              <!-- <el-col :span="4">
-                <el-form-item label="采集线程" prop="threads">
-                  <el-input v-model="serviceForm.threads" type="number" placeholder="请输入采集线程数" clearable />
-                </el-form-item>
-              </el-col> -->
               <el-col :span="4">
-                <el-form-item label-width="0" prop="isAsynchronous">
-                  <el-radio-group v-model="serviceForm.isAsynchronous">
-                    <el-radio :label="1">同步</el-radio>
-                    <el-radio :label="0">异步</el-radio>
-                  </el-radio-group>
+                <el-form-item label="前序输出编号" label-width="100px" prop="serviceOutputID">
+                  <el-input v-model="serviceForm.serviceOutputID" placeholder="请输入前序输出编号" clearable />
                 </el-form-item>
               </el-col>
-              <!-- <el-col :span="6">
-                <el-form-item label="数据类型" prop="datatype">
-                  <el-select v-model="serviceForm.datatype" clearable>
-                    <el-option label="JSON" :value="1" />
-                    <el-option label="XML" :value="2" />
-                    <el-option label="自定义" :value="3" />
+            </el-row>
+          </div>
+        </div>
+        <div class="content-list-box">
+          <div class="manageTitle">主动采集配置</div>
+          <div class="content-list-box-body">
+            <el-row :gutter="48" type="flex">
+              <el-col :span="5">
+                <el-form-item label-width="100px" 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-select>
                 </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>
-              </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-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-col :span="17">
+                <el-form-item label="服务描述" label-width="100px" prop="serviceDescribe">
+                  <el-input v-model="serviceForm.serviceDescribe" placeholder="请输入描述" 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-row>
+            <el-row style="margin-top: 24px" :gutter="48" type="flex">
+              <el-col :span="5">
+                <el-form-item label="计划启动时间" label-width="100px" 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-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-col :span="5">
+                <el-form-item label="计划停止时间" label-width="100px" 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-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" 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" 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" placeholder="请输入循环频率" clearable />
                 </el-form-item>
               </el-col>
-              <el-col :span="4">
-                <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" />
-                    <el-option label="分钟" :value="60 * 1000" />
-                    <el-option label="秒" :value="1000" />
-                    <el-option label="毫秒" :value="1" />
-                  </el-select>
+            </el-row>
+          </div>
+        </div>
+        <div class="content-list-box">
+          <div class="manageTitle">统一接收</div>
+          <div class="content-list-box-body">
+            <el-row style="margin-bottom: 24px" :gutter="48" type="flex">
+              <el-col :span="12">
+                <el-form-item label="生命周期编号" prop="lifeCycleCol" label-width="100px">
+                  <el-input v-model="serviceForm.lifeCycleCol" placeholder="请输入生命周期编号" clearable />
                 </el-form-item>
               </el-col>
-              <el-col :span="4">
-                <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-select>
+            </el-row>
+            <el-row :gutter="48" type="flex">
+              <el-col :span="12">
+                <el-form-item label="取值表达式" label-width="100px" prop="computingMethod">
+                  <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="8">
-                <el-form-item
-                  label="日志过滤条件"
-                  label-width="100px"
-                  prop="logList"
-                >
+              <el-col :span="12">
+                <el-form-item label="检测表达式" label-width="100px" prop="validationExpression">
                   <el-input
-                    v-model="serviceForm.logList"
-                    placeholder="请输入日志过滤条件"
+                    v-model="serviceForm.validationExpression"
+                    placeholder="请输入检测表达式"
+                    type="textarea"
+                    :autosize="{
+                      minRows: 3,
+                      maxRows: 3,
+                    }"
+                    resize="none"
                     clearable
                   />
                 </el-form-item>
               </el-col>
             </el-row>
-          </el-form>
-        </main>
-      </div>
-      <div class="service-tables">
-        <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
-            >
-          </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"
-            />
-          </main>
+          </div>
         </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
-            >
-          </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"
-            />
-          </main>
+        <div class="content-list-tabs">
+          <el-row :gutter="16" type="flex">
+            <el-col :span="12">
+              <div class="content-list-box">
+                <div class="flex">
+                  <div class="manageTitle">输出</div>
+                  <div class="manageBtns">
+                    <el-button size="mini" class="btn-white" @click="btnAddClickHandler(1)" plain type="primary">新增</el-button>
+                  </div>
+                </div>
+                <div class="content-list-box-body">
+                  <DataTable
+                    ref="serviceOutputTable"
+                    :data-id="outId"
+                    :data-content="{
+                      serviceID: serviceID,
+                    }"
+                    :rows="12"
+                    table-height="auto"
+                    margin-top="0"
+                    :is-btn="false"
+                    :is-dialog="true"
+                    labelWidth="100px"
+                  />
+                </div>
+              </div>
+            </el-col>
+            <el-col :span="12">
+              <div class="content-list-box">
+                <div class="manageTitle">日志记录</div>
+                <div class="content-list-box-body">
+                  <el-row style="margin-bottom: 24px" :gutter="48" type="flex">
+                    <el-col :span="12">
+                      <el-form-item label="日志存储数据源" label-width="110px" 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-select>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                      <el-form-item label="详细位置" label-width="110px" prop="serviceName">
+                        <el-input v-model="serviceForm.serviceName" placeholder="请输入服务名称" clearable />
+                      </el-form-item>
+                    </el-col>
+                  </el-row>
+                  <el-form-item label="日志输出条件" label-width="110px" prop="logList">
+                    <el-input
+                      v-model="serviceForm.logList"
+                      placeholder="请输入日志输出条件"
+                      type="textarea"
+                      :autosize="{
+                        minRows: 3,
+                        maxRows: 3,
+                      }"
+                      resize="none"
+                      clearable
+                    />
+                  </el-form-item>
+                </div>
+              </div>
+            </el-col>
+          </el-row>
         </div>
-      </div>
+      </el-form>
     </div>
     <Dialog :flag="sourceFormVisible" width="464px">
       <div class="dialog-create">
@@ -337,50 +226,125 @@
         <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>
+    <Dialog :flag="slotVisible" width="852px">
+      <div class="dialog-create">
+        <div class="title">插槽编辑</div>
+        <div style="padding: 0 24px 24px 24px" class="dialog-content">
+          <div class="flex">
+            <p class="manageTitle">插槽列表</p>
+            <el-button size="small" type="primary" class="btn-white" @click="btnAddClickHandler(2)">新增</el-button>
+          </div>
+          <DataTable
+            ref="serviceMachineTable"
+            :data-id="jqId"
+            :data-content="{
+              serviceID: serviceID,
+            }"
+            :isBody="true"
+            :rows="12"
+            table-height="350px"
+            margin-top="0"
+            :is-btn="false"
+            :is-dialog="true"
+            :selection-enable="true"
+            @selectionAll="selectionAll"
+            @selection-change="machineSelectionChangeHandler"
+          />
+        </div>
+        <div class="foot mt24">
+          <el-button size="medium" @click="slotQd" type="primary" class="r25 r26">确定</el-button>
+          <el-button size="medium" class="r26" @click="slotVisible = false">取消</el-button>
+        </div>
+      </div>
+    </Dialog>
+    <Dialog :flag="logVisible" width="900px">
+      <div class="logDialog">
+        <div style="position: relative" class="title">
+          <span>查看日志</span>
+          <span @click="logVisible = false" class="el-icon-close logClose"></span>
+        </div>
+        <div class="interfaceLog">
+          <div class="interfaceLog_head flex">
+            <div class="interfaceLog_head_time flex-wrap">
+              <div class="interfaceLog_head_time_start">
+                <el-date-picker v-model="timeStart" value-format="yyyy-MM-dd HH:mm:ss" size="small" @change="timeStartChange" type="datetime" placeholder="选择开始日期时间" default-time="00:00:00">
+                </el-date-picker>
+              </div>
+              <div class="interfaceLog_head_time_end">
+                <el-date-picker v-model="timeEnd" value-format="yyyy-MM-dd HH:mm:ss" size="small" @change="timeEndChange" type="datetime" placeholder="选择结束日期时间" default-time="00:00:00">
+                </el-date-picker>
+              </div>
+            </div>
+            <div class="flex-wrap">
+              <el-input placeholder="请输入搜索关键词" size="small" v-model="input" clearable> </el-input>
+              <el-button size="mini" style="margin-left: 16px" @click="handleOk" type="primary">查询</el-button>
+            </div>
+          </div>
+          <div
+            v-loading="loading"
+            element-loading-text="拼命加载中"
+            stripe
+            element-loading-spinner="el-icon-loading"
+            element-loading-background="rgba(0, 0, 0, 0.8)"
+            class="interfaceLog_content flex-wrap"
           >
+            <el-table :data="tableData" class="table" height="500px" border style="width: 100%; margin-top: 20px">
+              <el-table-column prop="logTime" width="200" label="时间"> </el-table-column>
+              <el-table-column prop="logType" width="100" label="类型"> </el-table-column>
+              <el-table-column width="200" label="位置">
+                <template slot-scope="scope">
+                  <el-tooltip class="item" effect="dark" :content="scope.row.logPositionID" placement="top">
+                    <div class="logPositionID">{{ scope.row.logPositionID }}</div>
+                  </el-tooltip>
+                </template>
+              </el-table-column>
+              <el-table-column width="100" prop="resultCode" label="成败"> </el-table-column>
+              <el-table-column label="详情">
+                <template slot-scope="scope">
+                  <div class="flex-wrap">
+                    <el-tooltip class="item" effect="dark" :content="scope.row.resultDetails" placement="top">
+                      <span :id="'logId' + scope.$index" class="logDetails">{{ scope.row.resultDetails }}</span>
+                    </el-tooltip>
+                    <el-button @click="logCopy(scope.$index)" style="margin-left: 10px" type="text">复制</el-button>
+                  </div>
+                </template>
+              </el-table-column>
+            </el-table>
+            <!-- <div class="interfaceLog_content_progress">
+              <el-timeline>
+                <el-timeline-item v-for="(item,index) in preDatas" :key="index">
+                  <div class="list">
+                    <div class="list_status"></div>
+                    <div class="list_title flex">
+                      <span class="l_title">{{item.title}}</span>
+                      <span v-if="item.status == 1" class="l_status l_success">成功</span>
+                      <span v-else class="l_status l_error">失败</span>
+                    </div>
+                    <div class="list_code">{{item.code}}</div>
+                    <div class="list_time">{{item.time}}</div>
+                  </div>
+                </el-timeline-item>
+              </el-timeline>
+            </div> -->
+          </div>
         </div>
       </div>
     </Dialog>
@@ -391,10 +355,9 @@
 // import NoData from '@/components/nodata'
 import Dialog from "@/layout/components/Dialog";
 import DataTable from "@/components/Table";
-import { myQuery, GeneralDataReception } from "@/api/dataIntegration";
-
+import { myQuery, GeneralDataReception, Query } from "@/api/dataIntegration";
+import { parseTime } from "@/utils/index";
 import operate from "./mixins/operate";
-
 export default {
   components: {
     // NoData,
@@ -410,10 +373,13 @@ export default {
       outId: DATACONTENT_ID.sysServiceOutTabId,
       jqId: DATACONTENT_ID.sysServiceJqTabId,
       serviceID: Number(this.$route.query.serviceID),
+      serviceState: this.$route.query.runState,
       operateDialogType: null,
       delObj: {},
+      slotValue: 0,
       deleteDialogType: null,
       sourceFormVisible: false,
+      slotVisible: false,
       tempCheckedKeys: [],
       serviceForm: {
         serviceName: "",
@@ -455,27 +421,32 @@ export default {
         connectConfig: "",
       },
       sourceDatas: [],
+      selDatas: [],
+      selObj: {},
+      selAll: [],
+      logVisible: false,
+      timeStart: parseTime(new Date(), "{y}-{m}-{d} 00:00:00"),
+      timeEnd: parseTime(new Date().getTime() + 24 * 60 * 60 * 1000, "{y}-{m}-{d} 00:00:00"),
+      tableData: [],
+      loading: false,
+      input: "",
     };
   },
+  created() {
+    this.slotVisible = true;
+    setTimeout(() => {
+      this.slotVisible = false;
+    }, 0);
+  },
   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)`;
-  },
   methods: {
+    selectionAll(arr) {
+      this.slotValue = arr.length;
+      this.selAll = _.cloneDeep(arr);
+    },
     editSubmitHandler() {
       this.$refs["serviceForm"].validate((valid) => {
         if (valid) {
@@ -499,18 +470,88 @@ export default {
       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;
+    slotQd() {
+      const arr = this.selDatas;
+      const row = this.selObj;
+      const datas = this.selAll;
+      const res = [...datas, ...arr].filter((item) => !(datas.some((p) => item.deployNodeID == p.deployNodeID) && arr.some((c) => item.deployNodeID == c.deployNodeID)));
+      // const isSelected = selection.findIndex((item) => item.deployNodeID === row.deployNodeID) > -1;
+      const event = arr.length >= datas.length ? 1 : 3;
       try {
-        const message = await this.updateServiceNode(event, row);
-        this.$message.success(message ?? "操作成功");
+        res.forEach(async (item) => {
+          const message = await this.updateServiceNode(event, item);
+          this.$message.success(message ?? "操作成功");
+        });
       } catch (error) {
         this.$message.error(error);
         this.$refs["serviceMachineTable"].toggleRowSelection(row, !isSelected);
       }
+      this.slotVisible = false;
+      this.slotValue = arr.length;
+      this.selAll = _.cloneDeep(arr);
+    },
+    timeStartChange(val) {
+      if (val >= this.timeEnd) {
+        this.timeStart = "";
+        this.$message.error("开始时间不能大于结束时间,请重新选择");
+      }
+    },
+    timeEndChange(val) {
+      if (val <= this.timeEnd) {
+        this.timeEnd = "";
+        this.$message.error("结束时间不能小于开始时间,请重新选择");
+      }
+    },
+    handleLog() {
+      this.logVisible = true;
+      this.getQuery();
+    },
+    handleOk() {
+      this.getQuery();
+    },
+    async getQuery() {
+      try {
+        this.loading = true;
+        const { code, returnData } = await Query({
+          id: DATACONTENT_ID.sysServiceTopTableId,
+          dataContent: JSON.stringify([this.serviceID, this.timeStart, this.timeEnd]),
+        });
+        if (code == 0) {
+          const { listValues } = returnData;
+          this.tableData = listValues;
+          this.loading = false;
+        } else {
+          this.$message.error("网络错误");
+          this.loading = false;
+        }
+      } catch (error) {
+        this.loading = false;
+        console.log(error);
+      }
+    },
+    logCopy(index) {
+      const ele = document.getElementById("logId" + index);
+      const val = ele.innerText;
+      try {
+        const input = document.createElement("input");
+        //将input的值设置为需要复制的内容
+        input.value = val;
+        //添加input标签
+        document.body.appendChild(input);
+        //选中input标签
+        input.select();
+        //执行复制
+        document.execCommand("copy");
+        //移除input标签
+        document.body.removeChild(input);
+        this.$message.success("复制成功");
+      } catch (e) {
+        this.$message.error("复制失败");
+      }
+    },
+    machineSelectionChangeHandler(selection, row) {
+      this.selDatas = selection;
+      this.selObj = row;
     },
     async getDataSourceList(id) {
       const dataSourceList = await this.getSelectOption(id);
@@ -538,10 +579,7 @@ export default {
       }
     },
     async queryServiceByID(serviceID) {
-      const serviceInfo = await myQuery(
-        DATACONTENT_ID.sysServiceEditId,
-        serviceID
-      );
+      const serviceInfo = await myQuery(DATACONTENT_ID.sysServiceEditId, serviceID);
       Object.entries(serviceInfo[0]).forEach(([key, value]) => {
         this.serviceForm[key] = value;
       });
@@ -699,5 +737,80 @@ export default {
   ::v-deep #dialog-form .el-select .el-input__inner {
     width: 100%;
   }
+  ::v-deep .content-list-box {
+    background: #ffffff;
+    box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.1);
+    border-radius: 4px;
+    padding: 24px;
+    margin-bottom: 16px;
+    height: 100%;
+    .isAsynchronous {
+      .el-form-item__content {
+        margin-left: 8px !important;
+        width: 90px;
+      }
+    }
+    .el-date-editor {
+      width: 100%;
+    }
+    .el-form-item {
+      margin-bottom: 0;
+    }
+    .el-select {
+      width: 100%;
+    }
+    .manageTitle {
+      margin-bottom: 32px;
+      .s2 {
+        color: #53b074;
+        margin-left: 35px;
+      }
+    }
+    .btn-white {
+      background-color: #ffffff;
+      border: 1px solid #92ace2;
+      color: #2d67e3;
+    }
+    .data-table-btn {
+      margin-top: 0px;
+      line-height: 0px;
+      margin-bottom: 0px;
+    }
+  }
+  .interfaceLog {
+    padding: 0 20px 20px 20px;
+  }
+  .interfaceLog_head_time_end {
+    margin-left: 16px;
+  }
+  .logClose {
+    font-size: 20px;
+    position: absolute;
+    right: 20px;
+    cursor: pointer;
+  }
+  .interfaceLog_content {
+    ::v-deep .table {
+      color: #101116;
+      thead {
+        color: #101116;
+      }
+      .success {
+        color: #33bf47;
+      }
+      .error {
+        color: #df4545;
+      }
+      .logPositionID,
+      .logDetails {
+        white-space: nowrap;
+        text-overflow: ellipsis;
+        overflow: hidden;
+      }
+      .logDetails {
+        max-width: 65%;
+      }
+    }
+  }
 }
 </style>

+ 0 - 816
src/views/systemSettings/views/serviceManagement/serviceEdit1.vue

@@ -1,816 +0,0 @@
-<!--
- * @Date: 2022-03-24 09:55:13
- * @LastEditTime: 2022-08-09 17:22:52
- * @LastEditors: your name
- * @Description: 服务管理-编辑服务
- * have a nice day!
--->
-
-<template>
-  <div class="service-edit">
-    <div class="scrollbar">
-      <el-form ref="serviceForm" class="service-form" :model="serviceForm" label-position="right" label-width="80px" size="mini">
-        <div class="content-list-box">
-          <div class="flex content-list-box-head">
-            <div class="manageTitle">
-              <span class="s1">当前服务ID:{{ serviceID }}</span>
-              <span class="s2">{{ serviceState }}</span>
-            </div>
-            <div class="manageBtns">
-              <el-button size="mini" @click="slotVisible = true" type="primary">{{ slotValue }}个插槽</el-button>
-              <el-button size="mini" @click="handleLog" class="btn-white" plain type="primary">查看日志</el-button>
-              <el-button size="mini" @click="editSubmitHandler" type="primary">保存</el-button>
-            </div>
-          </div>
-          <div class="content-list-box-body">
-            <el-row :gutter="48" type="flex">
-              <el-col :span="5">
-                <el-form-item label="服务名称" prop="serviceName">
-                  <el-input v-model="serviceForm.serviceName" placeholder="请输入服务名称" clearable />
-                </el-form-item>
-              </el-col>
-              <el-col :span="5">
-                <div class="flex-wrap">
-                  <el-form-item label="业务类型" prop="serviceType">
-                    <el-select v-model="serviceForm.serviceType" clearable>
-                      <el-option :value="1" label="管理前端" />
-                      <el-option :value="2" label="管理后端" />
-                      <el-option :value="3" label="业务前端" />
-                      <el-option :value="4" label="业务后端" />
-                    </el-select>
-                  </el-form-item>
-                  <el-form-item class="isAsynchronous">
-                    <el-select v-model="serviceForm.isAsynchronous">
-                      <el-option :value="1" label="同步"></el-option>
-                      <el-option :value="0" label="异步"></el-option>
-                    </el-select>
-                  </el-form-item>
-                </div>
-              </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-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-form-item>
-              </el-col>
-              <el-col :span="4">
-                <el-form-item label="前序输出编号" label-width="100px" prop="serviceOutputID">
-                  <el-input v-model="serviceForm.serviceOutputID" placeholder="请输入前序输出编号" clearable />
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </div>
-        </div>
-        <div class="content-list-box">
-          <div class="manageTitle">主动采集配置</div>
-          <div class="content-list-box-body">
-            <el-row :gutter="48" type="flex">
-              <el-col :span="5">
-                <el-form-item label-width="100px" 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-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="17">
-                <el-form-item label="服务描述" label-width="100px" prop="serviceDescribe">
-                  <el-input v-model="serviceForm.serviceDescribe" placeholder="请输入描述" clearable />
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row style="margin-top: 24px" :gutter="48" type="flex">
-              <el-col :span="5">
-                <el-form-item label="计划启动时间" label-width="100px" 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-form-item>
-              </el-col>
-              <el-col :span="5">
-                <el-form-item label="计划停止时间" label-width="100px" 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-form-item>
-              </el-col>
-              <el-col :span="4">
-                <el-form-item label="错误重试" prop="retryCount" label-width="100px">
-                  <el-input v-model="serviceForm.retryCount" placeholder="请输入重试次数" clearable />
-                </el-form-item>
-              </el-col>
-              <el-col :span="4">
-                <el-form-item label="循环次数" prop="loopCount">
-                  <el-input v-model="serviceForm.loopCount" placeholder="请输入循环次数" clearable />
-                </el-form-item>
-              </el-col>
-              <el-col :span="4">
-                <el-form-item label="循环频率" prop="frequencyCount">
-                  <el-input v-model="serviceForm.frequencyCount" placeholder="请输入循环频率" clearable />
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </div>
-        </div>
-        <div class="content-list-box">
-          <div class="manageTitle">统一接收</div>
-          <div class="content-list-box-body">
-            <el-row style="margin-bottom: 24px" :gutter="48" type="flex">
-              <el-col :span="12">
-                <el-form-item label="生命周期编号" prop="lifeCycleCol" label-width="100px">
-                  <el-input v-model="serviceForm.lifeCycleCol" placeholder="请输入生命周期编号" clearable />
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row :gutter="48" type="flex">
-              <el-col :span="12">
-                <el-form-item label="取值表达式" label-width="100px" prop="computingMethod">
-                  <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="检测表达式" label-width="100px" prop="validationExpression">
-                  <el-input
-                    v-model="serviceForm.validationExpression"
-                    placeholder="请输入检测表达式"
-                    type="textarea"
-                    :autosize="{
-                      minRows: 3,
-                      maxRows: 3,
-                    }"
-                    resize="none"
-                    clearable
-                  />
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </div>
-        </div>
-        <div class="content-list-tabs">
-          <el-row :gutter="16" type="flex">
-            <el-col :span="12">
-              <div class="content-list-box">
-                <div class="flex">
-                  <div class="manageTitle">输出</div>
-                  <div class="manageBtns">
-                    <el-button size="mini" class="btn-white" @click="btnAddClickHandler(1)" plain type="primary">新增</el-button>
-                  </div>
-                </div>
-                <div class="content-list-box-body">
-                  <DataTable
-                    ref="serviceOutputTable"
-                    :data-id="outId"
-                    :data-content="{
-                      serviceID: serviceID,
-                    }"
-                    :rows="12"
-                    table-height="auto"
-                    margin-top="0"
-                    :is-btn="false"
-                    :is-dialog="true"
-                    labelWidth="100px"
-                  />
-                </div>
-              </div>
-            </el-col>
-            <el-col :span="12">
-              <div class="content-list-box">
-                <div class="manageTitle">日志记录</div>
-                <div class="content-list-box-body">
-                  <el-row style="margin-bottom: 24px" :gutter="48" type="flex">
-                    <el-col :span="12">
-                      <el-form-item label="日志存储数据源" label-width="110px" 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-select>
-                      </el-form-item>
-                    </el-col>
-                    <el-col :span="12">
-                      <el-form-item label="详细位置" label-width="110px" prop="serviceName">
-                        <el-input v-model="serviceForm.serviceName" placeholder="请输入服务名称" clearable />
-                      </el-form-item>
-                    </el-col>
-                  </el-row>
-                  <el-form-item label="日志输出条件" label-width="110px" prop="logList">
-                    <el-input
-                      v-model="serviceForm.logList"
-                      placeholder="请输入日志输出条件"
-                      type="textarea"
-                      :autosize="{
-                        minRows: 3,
-                        maxRows: 3,
-                      }"
-                      resize="none"
-                      clearable
-                    />
-                  </el-form-item>
-                </div>
-              </div>
-            </el-col>
-          </el-row>
-        </div>
-      </el-form>
-    </div>
-    <Dialog :flag="sourceFormVisible" width="464px">
-      <div class="dialog-create">
-        <div class="title">新增数据来源</div>
-        <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-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>
-            </el-form-item>
-            <el-form-item label="连接参数">
-              <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>
-        </div>
-      </div>
-    </Dialog>
-    <Dialog :flag="slotVisible" width="852px">
-      <div class="dialog-create">
-        <div class="title">插槽编辑</div>
-        <div style="padding: 0 24px 24px 24px" class="dialog-content">
-          <div class="flex">
-            <p class="manageTitle">插槽列表</p>
-            <el-button size="small" type="primary" class="btn-white" @click="btnAddClickHandler(2)">新增</el-button>
-          </div>
-          <DataTable
-            ref="serviceMachineTable"
-            :data-id="jqId"
-            :data-content="{
-              serviceID: serviceID,
-            }"
-            :isBody="true"
-            :rows="12"
-            table-height="350px"
-            margin-top="0"
-            :is-btn="false"
-            :is-dialog="true"
-            :selection-enable="true"
-            @selectionAll="selectionAll"
-            @selection-change="machineSelectionChangeHandler"
-          />
-        </div>
-        <div class="foot mt24">
-          <el-button size="medium" @click="slotQd" type="primary" class="r25 r26">确定</el-button>
-          <el-button size="medium" class="r26" @click="slotVisible = false">取消</el-button>
-        </div>
-      </div>
-    </Dialog>
-    <Dialog :flag="logVisible" width="900px">
-      <div class="logDialog">
-        <div style="position: relative" class="title">
-          <span>查看日志</span>
-          <span @click="logVisible = false" class="el-icon-close logClose"></span>
-        </div>
-        <div class="interfaceLog">
-          <div class="interfaceLog_head flex">
-            <div class="interfaceLog_head_time flex-wrap">
-              <div class="interfaceLog_head_time_start">
-                <el-date-picker v-model="timeStart" value-format="yyyy-MM-dd HH:mm:ss" size="small" @change="timeStartChange" type="datetime" placeholder="选择开始日期时间" default-time="00:00:00">
-                </el-date-picker>
-              </div>
-              <div class="interfaceLog_head_time_end">
-                <el-date-picker v-model="timeEnd" value-format="yyyy-MM-dd HH:mm:ss" size="small" @change="timeEndChange" type="datetime" placeholder="选择结束日期时间" default-time="00:00:00">
-                </el-date-picker>
-              </div>
-            </div>
-            <div class="flex-wrap">
-              <el-input placeholder="请输入搜索关键词" size="small" v-model="input" clearable> </el-input>
-              <el-button size="mini" style="margin-left: 16px" @click="handleOk" type="primary">查询</el-button>
-            </div>
-          </div>
-          <div
-            v-loading="loading"
-            element-loading-text="拼命加载中"
-            stripe
-            element-loading-spinner="el-icon-loading"
-            element-loading-background="rgba(0, 0, 0, 0.8)"
-            class="interfaceLog_content flex-wrap"
-          >
-            <el-table :data="tableData" class="table" height="500px" border style="width: 100%; margin-top: 20px">
-              <el-table-column prop="logTime" width="200" label="时间"> </el-table-column>
-              <el-table-column prop="logType" width="100" label="类型"> </el-table-column>
-              <el-table-column width="200" label="位置">
-                <template slot-scope="scope">
-                  <el-tooltip class="item" effect="dark" :content="scope.row.logPositionID" placement="top">
-                    <div class="logPositionID">{{ scope.row.logPositionID }}</div>
-                  </el-tooltip>
-                </template>
-              </el-table-column>
-              <el-table-column width="100" prop="resultCode" label="成败"> </el-table-column>
-              <el-table-column label="详情">
-                <template slot-scope="scope">
-                  <div class="flex-wrap">
-                    <el-tooltip class="item" effect="dark" :content="scope.row.resultDetails" placement="top">
-                      <span :id="'logId' + scope.$index" class="logDetails">{{ scope.row.resultDetails }}</span>
-                    </el-tooltip>
-                    <el-button @click="logCopy(scope.$index)" style="margin-left: 10px" type="text">复制</el-button>
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-            <!-- <div class="interfaceLog_content_progress">
-              <el-timeline>
-                <el-timeline-item v-for="(item,index) in preDatas" :key="index">
-                  <div class="list">
-                    <div class="list_status"></div>
-                    <div class="list_title flex">
-                      <span class="l_title">{{item.title}}</span>
-                      <span v-if="item.status == 1" class="l_status l_success">成功</span>
-                      <span v-else class="l_status l_error">失败</span>
-                    </div>
-                    <div class="list_code">{{item.code}}</div>
-                    <div class="list_time">{{item.time}}</div>
-                  </div>
-                </el-timeline-item>
-              </el-timeline>
-            </div> -->
-          </div>
-        </div>
-      </div>
-    </Dialog>
-  </div>
-</template>
-
-<script>
-// import NoData from '@/components/nodata'
-import Dialog from "@/layout/components/Dialog";
-import DataTable from "@/components/Table";
-import { myQuery, GeneralDataReception, Query } from "@/api/dataIntegration";
-import { parseTime } from "@/utils/index";
-import operate from "./mixins/operate";
-export default {
-  components: {
-    // NoData,
-    Dialog,
-    DataTable,
-  },
-  mixins: [
-    // query,
-    operate,
-  ],
-  data() {
-    return {
-      outId: DATACONTENT_ID.sysServiceOutTabId,
-      jqId: DATACONTENT_ID.sysServiceJqTabId,
-      serviceID: Number(this.$route.query.serviceID),
-      serviceState: this.$route.query.runState,
-      operateDialogType: null,
-      delObj: {},
-      slotValue: 0,
-      deleteDialogType: null,
-      sourceFormVisible: false,
-      slotVisible: false,
-      tempCheckedKeys: [],
-      serviceForm: {
-        serviceName: "",
-        serviceOutputID: null,
-        serviceType: null,
-        sourceObjectName: "",
-        lifeCycleCol: "",
-        serviceDescribe: "",
-        threads: null,
-        isAsynchronous: 1,
-        datatype: null,
-        dataSourceID: null,
-        computingMethod: "",
-        validationExpression: "",
-        startTime: null,
-        stopTime: null,
-        retryCount: null,
-        loopCount: null,
-        frequencyCount: null,
-        frequencyUnit: null,
-        logDataSourceID: null,
-        logList: "",
-      },
-      computedTableHeight: "200px",
-      targetList: [],
-      protocolList: [],
-      nodeList: [],
-      checkedNodeKeys: [],
-      serviceAndNodeList: [],
-      dataSourceList: [],
-      checkedSourceKeys: [],
-      serviceAndSourceList: [],
-      processList: [],
-      checkedProcessKeys: [],
-      outputList: [],
-      formLabelAlign: {
-        dataSourceName: "",
-        protocolName: "",
-        connectConfig: "",
-      },
-      sourceDatas: [],
-      selDatas: [],
-      selObj: {},
-      selAll: [],
-      logVisible: false,
-      timeStart: parseTime(new Date(), "{y}-{m}-{d} 00:00:00"),
-      timeEnd: parseTime(new Date().getTime() + 24 * 60 * 60 * 1000, "{y}-{m}-{d} 00:00:00"),
-      tableData: [],
-      loading: false,
-      input: "",
-    };
-  },
-  created() {
-    this.slotVisible = true;
-    setTimeout(() => {
-      this.slotVisible = false;
-    }, 0);
-  },
-  mounted() {
-    this.queryServiceByID(this.serviceID);
-    this.getDataSourceList(DATACONTENT_ID.sysSourceId);
-  },
-  methods: {
-    selectionAll(arr) {
-      this.slotValue = arr.length;
-      this.selAll = _.cloneDeep(arr);
-    },
-    editSubmitHandler() {
-      this.$refs["serviceForm"].validate((valid) => {
-        if (valid) {
-          this.updateService();
-        }
-      });
-    },
-    btnAddClickHandler(flag) {
-      switch (flag) {
-        case 1:
-          this.$refs["serviceOutputTable"].handleAdd();
-          break;
-        case 2:
-          this.$refs["serviceMachineTable"].handleAdd();
-          break;
-        default:
-          break;
-      }
-    },
-    addService() {
-      this.getDataSourceList(DATACONTENT_ID.sysServiceXyId);
-      this.sourceFormVisible = true;
-    },
-    slotQd() {
-      const arr = this.selDatas;
-      const row = this.selObj;
-      const datas = this.selAll;
-      const res = [...datas, ...arr].filter((item) => !(datas.some((p) => item.deployNodeID == p.deployNodeID) && arr.some((c) => item.deployNodeID == c.deployNodeID)));
-      // const isSelected = selection.findIndex((item) => item.deployNodeID === row.deployNodeID) > -1;
-      const event = arr.length >= datas.length ? 1 : 3;
-      try {
-        res.forEach(async (item) => {
-          const message = await this.updateServiceNode(event, item);
-          this.$message.success(message ?? "操作成功");
-        });
-      } catch (error) {
-        this.$message.error(error);
-        this.$refs["serviceMachineTable"].toggleRowSelection(row, !isSelected);
-      }
-      this.slotVisible = false;
-      this.slotValue = arr.length;
-      this.selAll = _.cloneDeep(arr);
-    },
-    timeStartChange(val) {
-      if (val >= this.timeEnd) {
-        this.timeStart = "";
-        this.$message.error("开始时间不能大于结束时间,请重新选择");
-      }
-    },
-    timeEndChange(val) {
-      if (val <= this.timeEnd) {
-        this.timeEnd = "";
-        this.$message.error("结束时间不能小于开始时间,请重新选择");
-      }
-    },
-    handleLog() {
-      this.logVisible = true;
-      this.getQuery();
-    },
-    handleOk() {
-      this.getQuery();
-    },
-    async getQuery() {
-      try {
-        this.loading = true;
-        const { code, returnData } = await Query({
-          id: DATACONTENT_ID.sysServiceTopTableId,
-          dataContent: JSON.stringify([this.serviceID, this.timeStart, this.timeEnd]),
-        });
-        if (code == 0) {
-          const { listValues } = returnData;
-          this.tableData = listValues;
-          this.loading = false;
-        } else {
-          this.$message.error("网络错误");
-          this.loading = false;
-        }
-      } catch (error) {
-        this.loading = false;
-        console.log(error);
-      }
-    },
-    logCopy(index) {
-      const ele = document.getElementById("logId" + index);
-      const val = ele.innerText;
-      try {
-        const input = document.createElement("input");
-        //将input的值设置为需要复制的内容
-        input.value = val;
-        //添加input标签
-        document.body.appendChild(input);
-        //选中input标签
-        input.select();
-        //执行复制
-        document.execCommand("copy");
-        //移除input标签
-        document.body.removeChild(input);
-        this.$message.success("复制成功");
-      } catch (e) {
-        this.$message.error("复制失败");
-      }
-    },
-    machineSelectionChangeHandler(selection, row) {
-      this.selDatas = selection;
-      this.selObj = row;
-    },
-    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;
-        });
-      } else {
-        this.sourceDatas = dataSourceList.map((item) => {
-          item[item.setlabel] = item.k;
-          item[item.setvalue] = item.v;
-          return item;
-        });
-      }
-    },
-    async getSelectOption(ID) {
-      try {
-        const listValues = await myQuery(ID);
-        return listValues;
-      } catch (error) {
-        this.$message.error(error);
-        return [];
-      }
-    },
-    async queryServiceByID(serviceID) {
-      const serviceInfo = await myQuery(DATACONTENT_ID.sysServiceEditId, serviceID);
-      Object.entries(serviceInfo[0]).forEach(([key, value]) => {
-        this.serviceForm[key] = value;
-      });
-    },
-    async formService() {
-      this.sourceDatas.forEach((item) => {
-        if (item.protocolID == this.formLabelAlign.protocolName) {
-          this.formLabelAlign.protocolName = item.protocolName;
-          this.formLabelAlign.protocolID = item.protocolID;
-        }
-      });
-      try {
-        this.formLabelAlign["event"] = 1;
-        const res = await GeneralDataReception({
-          serviceId: SERVICE_ID.sysServiceAddXyId,
-          dataContent: JSON.stringify(this.formLabelAlign),
-        });
-        if (Number(res.code) === 0) {
-          this.$message.success(res.message ?? "成功");
-          this.sourceFormVisible = false;
-          this.getDataSourceList(DATACONTENT_ID.sysSourceId);
-        } else {
-          this.$message.error(res.message ?? "失败");
-        }
-      } catch (error) {
-        console.log("出错了", error.message || error);
-      }
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.service-edit {
-  margin: 0 -24px;
-  padding-bottom: 16px;
-  overflow: hidden;
-  .scrollbar {
-    height: calc(100vh - 120px);
-    padding: 0 24px;
-    overflow-x: hidden;
-    overflow-y: auto;
-    .service-edit-wrapper {
-      padding: 26px 24px 0 24px;
-      .title {
-        display: flex;
-        justify-content: space-between;
-        margin-bottom: 24px;
-        &:nth-of-type(2) {
-          margin-top: 10px;
-        }
-        .manageTitle {
-          height: 32px;
-          line-height: 30px;
-        }
-        .el-button {
-          width: 64px;
-          height: 32px;
-          border: none;
-          &.btn-white {
-            background-color: #ffffff;
-            border: 1px solid #92ace2;
-            color: #2d67e3;
-          }
-          &:hover {
-            background-color: #487be8;
-            color: #ffffff;
-          }
-        }
-      }
-      .content {
-        margin: 0;
-      }
-    }
-    ::v-deep .service-form-wrapper {
-      background: #ffffff;
-      box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.1);
-      border-radius: 4px;
-      .service-form {
-        > .el-row {
-          flex-wrap: wrap;
-          > .el-col {
-            .el-form-item {
-              margin-bottom: 25px;
-              .el-form-item__label {
-                padding-right: 16px;
-              }
-              .el-input,
-              .el-select {
-                width: 100%;
-                height: 32px;
-              }
-            }
-          }
-        }
-        label,
-        span,
-        button,
-        input,
-        optgroup,
-        select,
-        textarea {
-          font-family: Helvetica, Microsoft YaHei;
-          font-size: 14px;
-          font-weight: 400;
-        }
-        label {
-          color: #303133;
-        }
-        input {
-          color: #101116;
-          &::-webkit-outer-spin-button,
-          &::-webkit-inner-spin-button {
-            -webkit-appearance: none !important;
-          }
-          &[type="number"] {
-            -moz-appearance: textfield !important;
-          }
-        }
-        .el-radio {
-          font-weight: 400;
-        }
-      }
-    }
-    .service-tables {
-      width: 100%;
-      display: flex;
-      margin: 0 -12px;
-      .service-table-wrapper {
-        padding-left: 12px;
-        padding-right: 12px;
-        &:nth-child(1) {
-          flex: 1 1 624px;
-        }
-        &:nth-child(2) {
-          flex: 0 1 624px;
-          padding-right: 0px;
-        }
-      }
-    }
-  }
-  .dialog-checkbox {
-    .content {
-      margin-left: 16px;
-      .el-checkbox-group {
-        margin-right: 24px;
-        .el-checkbox {
-          margin-bottom: 24px;
-          font-family: Helvetica, Microsoft YaHei;
-          color: #303133;
-        }
-      }
-    }
-  }
-  ::v-deep #dialog-form .el-select .el-input__inner {
-    width: 100%;
-  }
-  ::v-deep .content-list-box {
-    background: #ffffff;
-    box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.1);
-    border-radius: 4px;
-    padding: 24px;
-    margin-bottom: 16px;
-    height: 100%;
-    .isAsynchronous {
-      .el-form-item__content {
-        margin-left: 8px !important;
-        width: 90px;
-      }
-    }
-    .el-date-editor {
-      width: 100%;
-    }
-    .el-form-item {
-      margin-bottom: 0;
-    }
-    .el-select {
-      width: 100%;
-    }
-    .manageTitle {
-      margin-bottom: 32px;
-      .s2 {
-        color: #53b074;
-        margin-left: 35px;
-      }
-    }
-    .btn-white {
-      background-color: #ffffff;
-      border: 1px solid #92ace2;
-      color: #2d67e3;
-    }
-    .data-table-btn {
-      margin-top: 0px;
-      line-height: 0px;
-      margin-bottom: 0px;
-    }
-  }
-  .interfaceLog {
-    padding: 0 20px 20px 20px;
-  }
-  .interfaceLog_head_time_end {
-    margin-left: 16px;
-  }
-  .logClose {
-    font-size: 20px;
-    position: absolute;
-    right: 20px;
-    cursor: pointer;
-  }
-  .interfaceLog_content {
-    ::v-deep .table {
-      color: #101116;
-      thead {
-        color: #101116;
-      }
-      .success {
-        color: #33bf47;
-      }
-      .error {
-        color: #df4545;
-      }
-      .logPositionID,
-      .logDetails {
-        white-space: nowrap;
-        text-overflow: ellipsis;
-        overflow: hidden;
-      }
-      .logDetails {
-        max-width: 65%;
-      }
-    }
-  }
-}
-</style>