소스 검색

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

chenrui  3 년 전
부모
커밋
dcd14a79b0

+ 36 - 5
src/router/routes/routes-file-two.js

@@ -15,7 +15,7 @@ const systemSettingsRoutes = {
           path: '/systemSettings',
           name: 'serviceManagement',
           component: () => import('@/views/systemSettings/views/serviceManagement/serviceHome'),
-          meta: { title: '服务管理'},
+          meta: { title: '服务管理' },
           hidden: true,
           src: require('@/assets/nav/ic_setting_top_default.png'),
           srcer: require('@/assets/nav/ic_setting_top_check.png')
@@ -23,20 +23,51 @@ const systemSettingsRoutes = {
         {
           path: '/systemSettings/sourceDataItemManagement',
           name: 'sourceDataItemManagement',
-          component: () => import('@/views/systemSettings/views/sourceDataItemManagement/sourceDataItemHome'),
+          component: { render(c) { return c('router-view') } },
+          redirect: '/systemSettings/sourceDataItemManagement',
           meta: { title: '源数据管理' },
           hidden: true,
           src: require('@/assets/nav/ic_setting_top_default.png'),
-          srcer: require('@/assets/nav/ic_setting_top_check.png')
+          srcer: require('@/assets/nav/ic_setting_top_check.png'),
+          children: [
+          {
+            path: '/systemSettings/sourceDataItemManagement',
+            component: () => import('@/views/systemSettings/views/sourceDataItemManagement/sourceDataItemHome'),
+          },
+          {
+            path: '/systemSettings/sourceDataItemEdit',
+            name: 'sourceDataItemEdit',
+            component: () => import('@/views/systemSettings/views/sourceDataItemManagement/sourceDataItemEdit'),
+            meta: { title: '源数据编辑' },
+            hidden: false,
+            isAlone: true,
+            src: require('@/assets/nav/ic_setting_top@2x.png')
+          },
+          ]
         },
         {
           path: '/systemSettings/targetDataManagement',
           name: 'targetDataManagement',
-          component: () => import('@/views/systemSettings/views/targetDataManagement/targetDataHome'),
+          component: { render(c) { return c('router-view') } },
+          redirect: '/systemSettings/targetDataManagement',
           meta: { title: '目标数据管理' },
           hidden: true,
           src: require('@/assets/nav/ic_setting_top_default.png'),
-          srcer: require('@/assets/nav/ic_setting_top_check.png')
+          srcer: require('@/assets/nav/ic_setting_top_check.png'),
+          children: [{
+            path: '/systemSettings/targetDataManagement',
+            component: () => import('@/views/systemSettings/views/targetDataManagement/targetDataHome'),
+          },
+          {
+            path: '/systemSettings/targetDataEdit',
+            name: 'targetDataEdit',
+            component: () => import('@/views/systemSettings/views/targetDataManagement/targetDataEdit'),
+            meta: { title: '目标数据编辑' },
+            hidden: false,
+            isAlone: true,
+            src: require('@/assets/nav/ic_setting_top@2x.png')
+          },
+          ]
         },
         {
           path: '/systemSettings/protocolManagement',

+ 66 - 34
src/views/systemSettings/views/machineManagement/machineHome.vue

@@ -13,8 +13,9 @@
       <div class="protocol-header flex">
         <div class="status flex-wrap">
           <div class="manageTitle">机器维护</div>
-          <div class="status1"><span class="icon"></span>内置</div>
-          <div class="status2"><span class="icon"></span>扩展</div>
+          <div class="status1"><span class="icon"></span>物理机</div>
+          <div class="status2"><span class="icon"></span>虚拟机</div>
+          <div class="status3"><span class="icon"></span>docker</div>
         </div>
         <div class="addBtn">
           <el-button class="button-white" size="small" @click="showAddDialog()">新增</el-button>
@@ -22,16 +23,22 @@
       </div>
       <div class="protocol-content">
         <el-row :gutter="24">
-          <el-col v-for="item in dataList" :key="item.protocolId" :span="4">
+          <el-col v-for="item in dataList" :key="item.deployNodeID" :span="4">
             <div class="grid-content">
-              <div :class="item.protocolStatus ? 'success' : 'error'" class="grid-content-bg"></div>
+              <div :class="item.deployNodeType ? 'success' : 'error'" class="grid-content-bg"></div>
               <div class="grid-content-hand flex">
                 <div class="title flex-wrap">
-                  <div class="name">{{ item.protocolName }}</div>
+                  <div class="name">{{ item.deployNodeName }}</div>
                   <i class="loger" @click="showEditDialog(item)" />
                 </div>
                 <i class="el-icon-close icon" @click="showRemoveDialog(item)" />
               </div>
+              <div class="grid-content-hand flex">
+                <div class="cardContent">
+                  <div class="IPadress">服务地址信息:10.72.3.66</div>
+                  <div class="type">类型:物理机</div>
+                </div>
+              </div>
             </div>
           </el-col>
         </el-row>
@@ -41,21 +48,23 @@
         <div class="airportInfoDialog dialog-public-background">
           <div class="title">{{ editDialogTitle }}</div>
           <div class="content">
-            <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px" class="demo-ruleForm">
-              <el-form-item label="协议名称" prop="protocolName">
-                <el-input v-model="ruleForm.protocolName" size="medium" placeholder="请输入协议名称(必填)" />
-              </el-form-item>
-              <el-form-item label="类名" prop="className">
-                <el-input v-model="ruleForm.className" size="medium" type="textarea" :rows="2" placeholder="请输入类名(必填)" />
+            <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="130px" class="demo-ruleForm">
+              <el-form-item label="机器" prop="deployNodeName">
+                <el-input v-model="ruleForm.deployNodeName" size="medium" placeholder="请输入机器名称" />
               </el-form-item>
-              <el-form-item label="读方法名" prop="rmethodName">
-                <el-input v-model="ruleForm.rmethodName" size="medium" placeholder="请输入读方法名(必填)" />
+              <el-form-item label="机器描述">
+                <el-input v-model="ruleForm.deployNodeDescribe" size="medium" type="textarea" :rows="2" placeholder="请输入描述" />
               </el-form-item>
-              <el-form-item label="写方法名" prop="smethodName">
-                <el-input v-model="ruleForm.smethodName" size="medium" placeholder="请输入写方法名(必填)" />
+              <el-form-item label="服务器地址信息" prop="serviceURL">
+                <el-input v-model="ruleForm.serviceURL" size="medium" placeholder="请输入服务器地址信息" />
+
               </el-form-item>
-              <el-form-item label="文件名及路径" prop="filePath">
-                <el-input v-model="ruleForm.filePath" size="medium" type="textarea" :rows="3" placeholder="请输入文件名及路径" />
+              <el-form-item label="机器类型" prop="deployNodeType">
+                <el-select v-model="ruleForm.deployNodeType" size="medium" placeholder="请选择机器类型">
+                  <el-option label="物理机" value="1"></el-option>
+                  <el-option label="虚拟机" value="2"></el-option>
+                  <el-option label="docker" value="3"></el-option>
+                </el-select>
               </el-form-item>
             </el-form>
           </div>
@@ -97,43 +106,41 @@ export default {
       editDialogVisible: false,
       removeDialogVisible: false,
       rmObj: {},
-      editDialogTitle: '新增协议',
+      editDialogTitle: '新增机器',
       ruleForm: {
         // 协议信息表单
-        protocolId: null,
-        protocolName: '',
-        className: '',
-        rmethodName: '',
-        smethodName: '',
-        filePath: ''
+        deployNodeID: null,
+        deployNodeName: '',
+        deployNodeDescribe: '',
+        serviceURL: '',
+        deployNodeType: ''
       },
       rules: {
         // 协议信息表单验证
-        protocolName: [{ required: true, message: '请输入协议名称', trigger: 'blur' }],
-        className: [{ required: true, message: '请输入类名', trigger: 'blur' }],
-        rmethodName: [{ required: true, message: '请输入读方法名', trigger: 'blur' }],
-        smethodName: [{ required: true, message: '请输入写方法名', trigger: 'blur' }]
+        deployNodeName: [{ required: true, message: '请输入机器名称', trigger: 'blur' }],
+        serviceURL: [{ required: true, message: '请输入服务器地址信息', trigger: 'blur' }],
+        deployNodeType: [{ required: true, message: '请选择机器类型', trigger: 'blur' }]
       }
     }
   },
   created () {
     for (let index = 0; index < 20; index++) {
       this.dataList.push({
-        protocolId: index,
-        protocolStatus: index % 2 == 0 ? true : false,
-        protocolName: 'IMBQ-' + (Math.floor(Math.random() * 10) + 1)
+        deployNodeID: index,
+        deployNodeType: index % 2 == 0 ? true : false,
+        deployNodeName: '主采集服务器-' + (Math.floor(Math.random() * 10) + 1)
       })
     }
   },
   methods: {
     // 新增-弹框
     showAddDialog () {
-      this.editDialogTitle = '新增协议'
+      this.editDialogTitle = '新增机器'
       this.editDialogVisible = true
     },
     // 编辑-弹框
     showEditDialog (item) {
-      this.editDialogTitle = '编辑协议'
+      this.editDialogTitle = '编辑机器'
       this.ruleForm = item
       this.editDialogVisible = true
     },
@@ -240,15 +247,22 @@ export default {
         }
         .status2 {
           font-size: 14px;
+          margin-right: 28px;
           .icon {
             background: #f4c154;
           }
         }
+        .status3 {
+          font-size: 14px;
+          .icon {
+            background: #73D970;
+          }
+        }
       }
     }
     .protocol-content {
       .grid-content {
-        height: 120px;
+        height: 136px;
         background: #ffffff;
         box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.1);
         border-radius: 4px;
@@ -296,6 +310,24 @@ export default {
             background-size: 100% 100%;
           }
         }
+        .cardContent{
+          margin-top: 30px;
+          text-align: left;
+          width: 100%;
+          .IPadress{
+            font-size: 14px;
+            font-weight: normal;
+            color: #101116;
+            width: 100%;
+          }
+          .type{
+            margin-top: 14px;
+            font-size: 14px;
+            font-weight: normal;
+            color: #101116;
+            width: 100%;
+          }
+        }
         .icon {
           cursor: pointer;
           font-size: 16px;

+ 4 - 1
src/views/systemSettings/views/protocolManagement/protocolHome.vue

@@ -13,7 +13,7 @@
       <div class="protocol-header flex">
         <div class="status flex-wrap">
           <div class="manageTitle">协议管理</div>
-          <div class="status1"><span class="icon"></span>内置</div>
+          <div class="status1"><span class="icon"></span>物流</div>
           <div class="status2"><span class="icon"></span>扩展</div>
         </div>
         <div class="addBtn">
@@ -309,6 +309,9 @@ export default {
         }
       }
     }
+    .r25{
+      color: #ffffff;
+    }
   }
 }
 </style>

+ 1 - 1
src/views/systemSettings/views/sourceDataItemManagement/sourceDataItemHome.vue

@@ -75,7 +75,7 @@ export default {
   methods: {
     // 新增-跳转
     showAddDialog () {
-      this.$router.push('/sourceDataItem/sourceDataItemEdit')
+      this.$router.push('/systemSettings/sourceDataItemEdit')
     },
     // 编辑-跳转
     showEditDialog (item) {

+ 789 - 0
src/views/systemSettings/views/targetDataManagement/targetDataEdit.vue

@@ -0,0 +1,789 @@
+<!--
+ * @Date: 2021-11-19 11:34:20
+ * @LastEditTime: 2022-03-02 09:41:02
+ * @LastEditors: Please set LastEditors
+ * @Description: 目标数据-基本信息
+-->
+<template>
+  <div class="dataStoreInfo">
+    <!--基本信息-->
+    <div class="airportInfoDetails-head">
+      <Search title="编辑目标数据信息" :isSearch="false">
+        <button class="childBtnAn" @click="storagemod">保存</button>
+      </Search>
+      <div class="airportInfoDetails-head-content dialog-public-background">
+        <el-form
+          :inline="true"
+          :rules="rules"
+          :model="ruleForm"
+          ref="ruleForm"
+          class="demo-ruleForm"
+          label-width="140px"
+        >
+          <el-form-item label="目标数据名" prop="name">
+            <el-input
+              size="medium"
+              maxlength="128"
+              placeholder="请输入目标数据名"
+              v-model="ruleForm.name"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="数据类型" prop="tag">
+            <el-select
+              size="medium"
+              style="width: 100%"
+              v-model="ruleForm.tag"
+              placeholder="请选择数据类型"
+            >
+              <el-option label="Mysql_local" value="1"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="目标数据事件标识" prop="fullName">
+            <el-input
+              size="medium"
+              maxlength="128"
+              placeholder="请输入目标数据事件标识"
+              v-model="ruleForm.fullName"
+            ></el-input>
+          </el-form-item>
+          <el-row>
+              <el-form-item label="目标数据描述" prop="code">
+            <el-col :span="24">
+                <el-input
+                  maxlength="128"
+                  placeholder="请输入描述"
+                  v-model="ruleForm.code"
+                ></el-input>
+            </el-col>
+              </el-form-item>
+          </el-row>
+        </el-form>
+      </div>
+    </div>
+    <!--数据项信息-->
+    <div class="airportInfoDetails-content">
+      <Search
+        style="padding-left: 24px"
+        :isChild="true"
+        title="数据项信息"
+        @clearSearchData="clearSearchData"
+        @getSearchData="getSearchData"
+      >
+        <button @click="addStore" class="childBtnAdd">新增</button>
+      </Search>
+      <div class="table-info">
+        <el-table
+          :data="posArr"
+          row-key="id"
+          :row-class-name="tabRowClassName"
+          height="56vh"
+          :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
+          class="table"
+          style="width: 100%"
+          :header-cell-style="{ 'text-align': 'center' }"
+          :cell-style="{ 'text-align': 'center' }"
+        >
+          <el-table-column prop="itemName" label="数据项名称"></el-table-column>
+          <el-table-column prop="itemCode" label="数据项标识"></el-table-column>
+          <el-table-column
+            prop="dataTypeName"
+            label="数据类型"
+          ></el-table-column>
+          <el-table-column
+            prop="canNullName"
+            label="数据项描述"
+          ></el-table-column>
+          <el-table-column
+            prop="isOnlyMarkName"
+            label="数据来源表达式"
+          ></el-table-column>
+          <el-table-column
+            prop="analysisDataItemName"
+            label="是否必填"
+          ></el-table-column>
+          <el-table-column
+            prop="analysisDataItemName"
+            label="是否唯一"
+          ></el-table-column>
+          <el-table-column label="操作">
+            <div
+              slot-scope="scope"
+              style="
+                width: 100%;
+                height: 100%;
+                display: flex;
+                align-items: center;
+                justify-content: center;
+              "
+            >
+              <el-button
+                class="fut"
+                size="small"
+                @click="handleEdit(scope.$index, scope.row)"
+                >新增</el-button
+              >
+              <el-button
+                class="fut"
+                size="small"
+                @click="handleEdit(scope.$index, scope.row)"
+                >编辑</el-button
+              >
+              <el-button
+                class="futdel"
+                size="small"
+                type="danger"
+                @click="handleDelete(scope.$index, scope.row)"
+                >删除</el-button
+              >
+            </div>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+    <!--删除弹框-->
+    <Dialog :flag="flag">
+      <div class="airportInfoDialog">
+        <div class="del-title">删除存储数据项</div>
+        <div class="content er">
+          <div class="log"></div>
+          是否确认删除{{ rmObj.name }}?
+        </div>
+        <div class="foot right t30" style="background: #ffffff">
+          <el-button size="medium" @click="remove" class="r25 r26" type="danger"
+            >删除</el-button
+          >
+          <el-button size="medium" class="r26" @click="flag = false"
+            >取消</el-button
+          >
+        </div>
+      </div>
+    </Dialog>
+    <!--新增/编辑存储数据项弹框-->
+    <Dialog width="657px" customClass="dataStoreInfoDialog" :flag="addFlag">
+      <div class="dialog-public-background">
+        <div class="flx">{{ msgType === 1 ? "新增" : "编辑" }}存储数据项</div>
+        <div class="contenter">
+          <el-form
+            :model="dataForm"
+            :rules="dataRules"
+            ref="dataForm"
+            label-width="100px"
+            class="demo-dataForm"
+          >
+            <el-row :gutter="24">
+              <el-col :span="12">
+                <el-form-item class="flex1" label="名称" prop="name">
+                  <el-input
+                    maxlength="128"
+                    size="medium"
+                    placeholder="请输入名称"
+                    v-model="dataForm.name"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row :gutter="24">
+              <el-col :span="12">
+                <el-form-item class="flex1" label="标识" prop="code">
+                  <el-input
+                    maxlength="128"
+                    size="medium"
+                    placeholder="请输入标识"
+                    v-model="dataForm.code"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item class="flex1" label="数据类型" prop="tag">
+                  <el-select
+                    size="medium"
+                    style="width: 100%"
+                    v-model="dataForm.tag"
+                    placeholder="请选择数据类型"
+                  >
+                    <el-option
+                      v-for="item in optiondata"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row :gutter="24">
+              <el-col :span="12">
+                <el-form-item class="flexer" label="允许空值">
+                  <el-radio v-model="dataForm.isnull" label="1">是</el-radio>
+                  <el-radio v-model="dataForm.isnull" label="0">否</el-radio>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item class="flexer" label="唯一项标志">
+                  <el-radio v-model="dataForm.uninq" label="1">是</el-radio>
+                  <el-radio v-model="dataForm.uninq" label="0">否</el-radio>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row :gutter="24">
+              <el-col :span="12">
+                <el-form-item label="取值来源">
+                  <el-select
+                    size="medium"
+                    v-model="sourceider"
+                    placeholder="请选择取值来源"
+                  >
+                    <el-option
+                      v-for="item in sourceList"
+                      :key="item.id"
+                      :label="item.sourceName"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item class="noleft">
+                  <el-select
+                    size="medium"
+                    style="width: 100%"
+                    v-model="dataForm.datas"
+                    placeholder="请选择数据项"
+                  >
+                    <el-option
+                      v-for="item in tableData"
+                      :key="item.id"
+                      :label="item.itemName"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row :gutter="24">
+              <el-col :span="12">
+                <el-form-item class="flex1" label="取值优先级" prop="priority">
+                  <el-input
+                    maxlength="128"
+                    size="medium"
+                    type="number"
+                    placeholder="请输入优先级"
+                    v-model="dataForm.priority"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+        </div>
+        <div class="foot center" style="padding-right: 35px">
+          <el-button
+            v-is="['ds_dsp_cardEdit_store_edit_submit']"
+            size="medium"
+            type="primary"
+            @click="addSubmit('dataForm')"
+            class="r25 r26"
+            >提交</el-button
+          >
+          <el-button
+            v-is="['ds_dsp_cardEdit_store_edit_cancel']"
+            size="medium"
+            class="r26"
+            @click="resetForm('dataForm')"
+            >取消</el-button
+          >
+        </div>
+      </div>
+    </Dialog>
+  </div>
+</template>
+
+<script>
+import Search from "@/layout/components/Search/index.vue";
+import Dialog from "@/layout/components/Dialog/index.vue";
+import {
+  Datastorage,
+  Datastoragemod,
+  storageList,
+  analysisList,
+  anaListmod,
+  storageListadd,
+  storageListdel,
+} from "@/api/acquisition";
+import { translateDataToTreeAll, findarrays } from "@/utils/validate";
+export default {
+  name: "dataStoreInfo",
+  components: { Search, Dialog },
+  data() {
+    return {
+      ruleForm: {
+        //基本信息表单
+        name: "",
+        fullName: "",
+        code: "",
+        tag: "",
+      },
+      rules: {
+        //基本信息验证
+        name: [{ required: true, message: "请输入存储名称", trigger: "blur" }],
+        fullName: [
+          { required: true, message: "请输入存储标识", trigger: "blur" },
+        ],
+        tag: [{ required: true, message: "请选择存储方式", trigger: "change" }],
+      },
+      posArr: [], //存储数据项数据
+      posArrCopy: [], //临时存放数据
+      rmObj: {}, //选中的表格信息
+      rmIndex: null, //选中的表格序号
+      flag: false, //删除弹框
+      msgType: 1, //新增or编辑
+      dataForm: {
+        //数据项表单
+        id: "",
+        name: "",
+        demo: "",
+        code: "",
+        tag: "",
+        uninq: "1",
+        isnull: "1",
+        form: "",
+        datas: "",
+        priority: "",
+        analysisDataItemSourceId: "",
+      },
+      dataRules: {
+        //数据项表单验证
+        name: [{ required: true, message: "请输入存储名称", trigger: "blur" }],
+        code: [{ required: true, message: "请输入存储标识", trigger: "blur" }],
+        tag: [{ required: true, message: "请选择存储方式", trigger: "change" }],
+        priority: [
+          { required: true, message: "请选取值优先级", trigger: "change" },
+        ],
+      },
+      addFlag: false, //数据项弹框,
+      dataStoreid: "", //修改id,
+      analyList: [], //遍历后的确定数据
+      dataitem: [], //所属数据项
+      optiondata: [
+        //数据类型
+        {
+          name: "字符",
+          id: 1,
+        },
+        {
+          name: "数字",
+          id: 2,
+        },
+        {
+          name: "日期",
+          id: 3,
+        },
+        {
+          name: "时间",
+          id: 4,
+        },
+      ],
+      sourceList: [], //取值来源
+      sourceider: "", //取值来源id
+      tableData: [],
+      deleID: "", //删除id
+    };
+  },
+  created() {
+    const { id } = this.$route.query;
+    this.dataStoreid = id;
+    this.AcquisitionList();
+    this.DatastorageList();
+    this.storagedetails();
+  },
+  watch: {
+    sourceider() {
+      this.Dataitem();
+    },
+  },
+  methods: {
+    tabRowClassName({ row, rowIndex }) {
+      if (row.index) {
+        let index = row.index + 1;
+        if (index % 2 == 0) {
+          return "warning-row";
+        } else {
+          return "warning-rows";
+        }
+      }
+    },
+    //数据采集列表-取值来源
+    async AcquisitionList() {
+      const result = await analysisList();
+      if (result.code == 0) {
+        this.sourceList = result.returnData;
+      }
+    },
+    //数据项信息
+    async Dataitem() {
+      let params = {
+        sourceId: this.sourceider,
+      };
+      const result = await anaListmod(params);
+      if (result.code == 0) {
+        this.tableData = result.returnData;
+      }
+    },
+    //详情查询
+    async storagedetails() {
+      let params = {
+        targetId: this.dataStoreid,
+      };
+      const result = await storageList(params);
+      if (result.code == 0) {
+        result.returnData.forEach((element) => {
+          if (element.dataType == "1") {
+            element.dataTypeName = "字符";
+          } else if (element.dataType == "2") {
+            element.dataTypeName = "数字";
+          } else if (element.dataType == "3") {
+            element.dataTypeName = "日期";
+          } else {
+            element.dataTypeName = "时间";
+          }
+          if (element.canNull == true) {
+            element.canNullName = "是";
+          } else {
+            element.canNullName = "否";
+          }
+          if (element.isOnlyMark == true) {
+            element.isOnlyMarkName = "是";
+          } else {
+            element.isOnlyMarkName = "否";
+          }
+        });
+        this.posArr = translateDataToTreeAll(
+          result.returnData,
+          "parentItemID",
+          "id"
+        );
+        this.posArr.forEach((res, index) => {
+          res.index = index + 1;
+        });
+        this.dataitem = result.returnData;
+      }
+    },
+    //保存
+    async storagemod() {
+      let params = {
+        id: this.dataStoreid,
+        targetName: this.ruleForm.name, //储存名称
+        targetCode: this.ruleForm.fullName, //储存标识
+        saveType: this.ruleForm.tag, //储存类型
+        saveInfo: this.ruleForm.code, //储存目标
+        status: this.analyList[0].status,
+      };
+      const result = await Datastoragemod(params);
+      if (result.code == 0) {
+        this.$message.success("成功");
+        this.$router.push("/dataStore");
+      } else {
+        this.$message.error(result.message);
+      }
+    },
+    //数据存储列
+    async DatastorageList() {
+      const result = await Datastorage();
+      if (result.code == 0) {
+        this.analyList = result.returnData.filter(
+          (i) => i.id == this.dataStoreid
+        );
+        this.ruleForm.name = this.analyList[0].targetName; //储存名称
+        this.ruleForm.fullName = this.analyList[0].targetCode; //储存标识
+        this.ruleForm.tag = this.analyList[0].saveType; //储存类型
+        this.ruleForm.code = this.analyList[0].saveInfo; //储存目标
+      }
+    },
+    //搜索
+    getSearchData(val) {
+      let that = this;
+      that.storagedetails().then(function (data) {
+        if (val) {
+          that.posArr = findarrays(that.posArr, "itemName", val);
+        } else {
+          that.storagedetails();
+        }
+      });
+    },
+    //清空搜索
+    clearSearchData() {
+      this.posArr = this.posArrCopy;
+    },
+    //编辑信息
+    handleEdit(index, row) {
+      this.rmObj = row;
+      this.rmIndex = index;
+      this.msgType = 2;
+      this.addFlag = true;
+      const {
+        id,
+        itemName,
+        itemCode,
+        dataType,
+        isOnlyMark,
+        canNull,
+        sourceDataAnalysisId,
+        dataLevel,
+        parentItemID,
+        analysisDataItemSourceId,
+      } = row;
+      this.dataForm.id = id;
+      this.dataForm.name = itemName;
+      this.dataForm.code = itemCode;
+      this.dataForm.tag = Number(dataType);
+      this.dataForm.uninq = isOnlyMark === true ? "1" : "0";
+      this.dataForm.isnull = canNull === true ? "1" : "0";
+      this.dataForm.datas = sourceDataAnalysisId;
+      this.dataForm.priority = dataLevel;
+      this.dataForm.demo = parentItemID == 0 ? null : parentItemID;
+      this.sourceider = analysisDataItemSourceId;
+    },
+    //删除信息
+    handleDelete(index, row) {
+      this.rmObj = row;
+      this.rmIndex = index;
+      this.flag = true;
+      this.deleID = row.id;
+    },
+    //删除
+    async remove() {
+      let params = {
+        id: this.deleID,
+      };
+      const result = await storageListdel(params);
+      if (result.code == 0) {
+        this.$message.success("成功");
+      } else {
+        this.$message.error(result.message);
+      }
+      this.storagedetails();
+      this.flag = false;
+    },
+    //新增数据项
+    addStore() {
+      this.msgType = 1;
+      this.addFlag = true;
+    },
+    //存储数据项-提交
+    async addSubmit(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          // this.$message.success("提交成功");
+          // this.resetForm(formName);
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+      if (this.msgType === 1) {
+        let params = {
+          id: "",
+          targetDataID: this.dataStoreid,
+          parentItemID: this.dataForm.demo ? this.dataForm.demo : 0, //所属数据项
+          itemName: this.dataForm.name, //名称
+          itemCode: this.dataForm.code, //标识
+          dataType: this.dataForm.tag, //数据类型
+          isOnlyMark: this.dataForm.uninq == 1 ? true : false, //唯一项标志
+          canNull: this.dataForm.isnull == 1 ? true : false, //允许空值
+          sourceDataAnalysisId: this.dataForm.datas, //取值来源
+          dataLevel: this.dataForm.priority, //取值优先级
+        };
+        const result = await storageListadd(params);
+        if (result.code == 0) {
+          this.storagedetails();
+          this.$message.success("成功");
+          this.resetForm(formName);
+          this.dataForm = this.$options.data().dataForm;
+          this.sourceider = null;
+        }
+      } else {
+        let params = {
+          id: this.dataForm.id,
+          targetDataID: this.dataStoreid,
+          parentItemID: this.dataForm.demo ? this.dataForm.demo : 0, //所属数据项
+          itemName: this.dataForm.name, //名称
+          itemCode: this.dataForm.code, //标识
+          dataType: this.dataForm.tag, //数据类型
+          isOnlyMark: this.dataForm.uninq == 1 ? true : false, //唯一项标志
+          canNull: this.dataForm.isnull == 1 ? true : false, //允许空值
+          sourceDataAnalysisId: this.dataForm.datas, //取值来源
+          dataLevel: this.dataForm.priority, //取值优先级
+        };
+        const result = await storageListadd(params);
+        if (result.code == 0) {
+          this.storagedetails();
+          this.$message.success("成功");
+          this.resetForm(formName);
+          this.dataForm = this.$options.data().dataForm;
+          this.sourceider = null;
+        }
+        this.resetForm(formName);
+      }
+    },
+    //存储数据项-取消
+    resetForm(formName) {
+      this.addFlag = false;
+      this.dataForm = this.$options.data().dataForm;
+      this.sourceider = null;
+      this.$refs[formName].resetFields();
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.dataStoreInfo {
+  ::v-deep .warning-row {
+    background: #f0f3f7;
+  }
+  ::v-deep .warning-rows {
+    background: #ffffff;
+  }
+  .log {
+    width: 26px;
+    height: 26px;
+    background: #eb2f3b;
+    border-radius: 50%;
+    margin-right: 15px;
+    background: url("../../../../assets/index/ic_close_hint.png") no-repeat;
+    background-size: 100% 100%;
+  }
+  .fut {
+    width: 48px;
+    height: 24px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background: #ffffff;
+    border: 1px solid #9ebbf7;
+    box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
+    border-radius: 4px;
+    font-size: 12px;
+    font-family: Microsoft YaHei;
+    font-weight: 400;
+    color: #2d67e3;
+  }
+  .futdel {
+    width: 48px;
+    height: 24px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background: #eb2f3b;
+    box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
+    border-radius: 4px;
+    font-size: 12px;
+    font-family: Microsoft YaHei;
+    font-weight: 400;
+    color: #ffffff;
+  }
+  .contenter {
+    padding: 0 24px 0 24px;
+  }
+  .flexer {
+    margin-left: 0;
+  }
+  // ::v-deep .cell {
+  //   display: flex;
+  // }
+  .er {
+    display: flex;
+    align-items: center;
+  }
+  .airportInfoDetails-head {
+    padding: 32px 40px 44px 24px;
+    background: #ffffff;
+    box-shadow: 8px 6px 7px 0px rgba(0, 0, 0, 0.06);
+    border-radius: 4px;
+    .airportInfoDetails-head-content {
+      margin-top: 48px;
+      .el-input {
+        min-width: 188px;
+      }
+      .el-form--inline .el-form-item {
+        margin-bottom: 0;
+        margin-right: 48px;
+      }
+    }
+  }
+  .airportInfoDetails-content {
+    // height: 56vh;
+    overflow-x: hidden;
+    overflow-y: hidden;
+    padding: 0 0 0 0;
+    background: #dfe3ea;
+    // box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.06);
+    border-radius: 4px;
+    margin-top: 10px;
+    .table-info {
+      margin-top: 8px;
+      ::v-deep .table {
+        .el-table__header {
+          .has-gutter {
+            color: #101116;
+            .is-leaf {
+              height: 40px;
+              background: #ffffff;
+              &:first-child {
+                border-top-left-radius: 4px;
+              }
+            }
+            .gutter {
+              background: #ffffff;
+              border-top-right-radius: 4px;
+            }
+          }
+        }
+        td.el-table__cell,
+        th.el-table__cell.is-leaf {
+          border-bottom: none;
+        }
+        .el-table__cell {
+          padding: 16px 0;
+          // background: #f5f7fa;
+        }
+        .el-table__row--level-1 {
+          td {
+            background: #dfe4ec;
+          }
+        }
+        tr {
+          transition: all 0.3s;
+          &:hover {
+            td {
+              background-color: #cbd7ee;
+            }
+          }
+        }
+        &::before {
+          width: 0;
+        }
+      }
+    }
+  }
+  ::v-deep .dataStoreInfoDialog {
+    .demo-dataForm {
+      .noleft {
+        .el-form-item__content {
+          margin-left: 0 !important;
+          margin-right: 0 !important;
+          width: 300px;
+          .el-input__suffix {
+            right: 23px;
+          }
+        }
+      }
+    }
+  }
+  ::v-deep .el-input__suffix {
+    right: 15px;
+  }
+}
+</style>

+ 40 - 177
src/views/systemSettings/views/targetDataManagement/targetDataHome.vue

@@ -13,113 +13,35 @@
       <div class="targetData-header flex">
         <div class="manageTitle">目标数据管理</div>
         <div class="addBtn">
-          <el-button
-            class="button-white"
-            size="small"
-            @click="showAddDialog()"
-          >新增</el-button>
+          <el-button class="button-white" size="small" @click="showAdd()"
+            >新增</el-button
+          >
         </div>
       </div>
       <div class="targetData-content">
         <el-row :gutter="24">
-          <el-col
-            v-for="item in dataList"
-            :key="item.protocolId"
-            :span="4"
-          >
+          <el-col v-for="item in dataList" :key="item.protocolId" :span="4">
             <div class="grid-content">
               <div class="grid-content-hand flex">
                 <div class="title flex-wrap">
                   <div class="name">{{ item.protocolName }}</div>
-                  <i
-                    class="loger"
-                    @click="showEditDialog(item)"
-                  />
+                  <i class="loger" @click="showEditDialog(item)" />
                 </div>
-                <i
-                  class="el-icon-close icon"
-                  @click="showRemoveDialog(item)"
-                />
+                <i class="el-icon-close icon" @click="showRemoveDialog(item)" />
+              </div>
+              <div class="dataType">
+                <span>字符串</span>
               </div>
             </div>
           </el-col>
         </el-row>
       </div>
-      <!--新增/编辑-->
-      <Dialog
-        :flag="editDialogVisible"
-        width="508px"
-        :show-flag="true"
-      >
-        <div class="airportInfoDialog dialog-public-background">
-          <div class="title">{{ editDialogTitle }}</div>
-          <div class="content">
-            <el-form
-              ref="ruleForm"
-              :model="ruleForm"
-              :rules="rules"
-              label-width="100px"
-              class="demo-ruleForm"
-            >
-              <el-form-item
-                label="节点名称"
-                prop="deployNodeName"
-              >
-                <el-input
-                  v-model="ruleForm.deployNodeName"
-                  size="medium"
-                  placeholder="请输入节点名称(必填)"
-                />
-              </el-form-item>
-              <el-form-item
-                label="服务地址信息"
-                prop="className"
-              >
-                <el-input
-                  v-model="ruleForm.serviceURL"
-                  size="medium"
-                  type="textarea"
-                  :rows="2"
-                  placeholder="请输入服务地址信息(必填)"
-                />
-              </el-form-item>
-              <el-form-item
-                label="描述"
-                prop="deployNodeDescribe"
-              >
-                <el-input
-                  v-model="ruleForm.deployNodeDescribe"
-                  size="medium"
-                  type="textarea"
-                  :rows="3"
-                  placeholder="请输入节点描述"
-                />
-              </el-form-item>
-            </el-form>
-          </div>
-          <div class="foot center t30">
-            <el-button
-              size="medium"
-              type="primary"
-              class="r25 r26"
-              @click="submitClickHandler()"
-            >提交</el-button>
-            <el-button
-              size="medium"
-              class="r26"
-              @click="resetForm('ruleForm')"
-            >取消</el-button>
-          </div>
-        </div>
-      </Dialog>
       <!--删除弹框-->
       <Dialog :flag="removeDialogVisible">
         <div class="airportInfoDialog">
           <div class="Deltitle">删除协议</div>
           <div class="content er">
-            <div class="log">
-              是否确认删除{{ rmObj.protocolName }}?
-            </div>
+            <div class="log">是否确认删除{{ rmObj.protocolName }}?</div>
           </div>
           <div class="DelFoot right t30">
             <el-button
@@ -127,12 +49,14 @@
               class="r25 r26"
               type="danger"
               @click="removeSubmit()"
-            >删除</el-button>
+              >删除</el-button
+            >
             <el-button
               size="medium"
               class="r26"
               @click="removeDialogVisible = false"
-            >取消</el-button>
+              >取消</el-button
+            >
           </div>
         </div>
       </Dialog>
@@ -141,113 +65,42 @@
 </template>
 
 <script>
-import Dialog from '@/layout/components/Dialog/index.vue'
-import { GeneralDataReception } from '@/api/dataIntegration'
+import Dialog from "@/layout/components/Dialog/index.vue";
 
 export default {
-  name: 'targetDataHome',
+  name: "targetDataHome",
   components: { Dialog },
   data() {
     return {
       dataList: [],
-      editDialogVisible: false,
       removeDialogVisible: false,
-      rmObj: {},
-      editDialogTitle: '新增节点',
-      ruleForm: {
-        // 节点信息表单
-        deployNodeID: null,
-        deployNodeName: '',
-        serviceURL: '',
-        deployNodeDescribe: ''
-      },
-      rules: {
-        // 节点信息表单验证
-        deployNodeName: [{ required: true, message: '请输入节点名称', trigger: 'blur' }],
-        serviceURL: [{ required: true, message: '请输入服务地址信息', trigger: 'blur' }]
-      }
-    }
+      rmObj: {}
+    };
   },
   created() {
     for (let index = 0; index < 20; index++) {
       this.dataList.push({
         protocolId: index,
-        protocolName: '节点-' + (Math.floor(Math.random() * 20) + 1)
-      })
+        protocolName: "BSM报文-" + (Math.floor(Math.random() * 20) + 1),
+      });
     }
   },
   methods: {
-    // 新增-弹框
-    showAddDialog() {
-      this.editDialogTitle = '新增节点'
-      this.editDialogVisible = true
-    },
-    // 编辑-弹框
-    showEditDialog(item) {
-      this.editDialogTitle = '编辑节点'
-      this.ruleForm = item
-      this.editDialogVisible = true
-    },
-    // 新增/编辑-确认
-    submitClickHandler() {
-      this.$refs['ruleForm'].validate(valid => {
-        if (valid) {
-          if (this.ruleForm.deployNodeID) {
-            this.addSubmit()
-          } else {
-            this.editSubmit()
-          }
-          this.resetForm('ruleForm')
-        }
-      })
-    },
-    // 重置
-    resetForm(formName) {
-      this.$refs[formName].resetFields()
-      this.editDialogVisible = false
+    showAdd(){
+      this.$router.push('/systemSettings/targetDataEdit')
     },
     // 删除-弹框
     showRemoveDialog(item) {
-      this.rmObj = item
-      this.removeDialogVisible = true
+      this.rmObj = item;
+      this.removeDialogVisible = true;
     },
     // 确认删除
     removeSubmit() {
-      this.removeDialogVisible = false
-      this.$message.success('删除成功')
-    },
-    async addSubmit() {
-      try {
-        const res = await GeneralDataReception({
-          serviceId: '1',
-          dataContent: JSON.stringify(this.ruleForm)
-        })
-        if (res.code === 0) {
-          this.$message.success(res.message ?? '成功')
-        } else {
-          this.$message.error(res.message ?? '失败')
-        }
-      } catch (error) {
-        console.log('错误', error)
-      }
+      this.removeDialogVisible = false;
+      this.$message.success("删除成功");
     },
-    async editSubmit() {
-      try {
-        const res = await GeneralDataReception({
-          serviceId: '1',
-          dataContent: JSON.stringify(this.ruleForm)
-        })
-        if (res.code === 0) {
-          this.$message.success(res.message ?? '成功')
-        } else {
-          this.$message.error(res.message ?? '失败')
-        }
-      } catch (error) {
-        console.log('错误', error)
-      }
-    }
-  }
-}
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -277,6 +130,14 @@ export default {
         border-radius: 4px;
         padding: 25px;
         margin-bottom: 24px;
+        display: flex;
+        flex-direction: column;
+        justify-content: space-between;
+        .dataType {
+          font-size: 14px;
+          font-weight: 400;
+          color: #101116;
+        }
         .title {
           font-size: 16px;
           font-family: Helvetica;
@@ -296,14 +157,16 @@ export default {
             width: 14px;
             height: 14px;
             margin-left: 24px;
-            background: url('../../../../assets/status/ic_edit_default.png') no-repeat;
+            background: url("../../../../assets/status/ic_edit_default.png")
+              no-repeat;
             background-size: 100% 100%;
             cursor: pointer;
             position: relative;
             top: 2px;
           }
           .loger:hover {
-            background: url('../../../../assets/status/ic_edit_hovar.png') no-repeat;
+            background: url("../../../../assets/status/ic_edit_hovar.png")
+              no-repeat;
             background-size: 100% 100%;
           }
         }