Эх сурвалжийг харах

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

zhongxiaoyu 2 жил өмнө
parent
commit
2c7dcb081b

+ 47 - 12
src/components/Table/index.vue

@@ -33,10 +33,11 @@
               </span>
             </template>
           </el-table-column>
-          <el-table-column fixed="right" label="操作" width="130">
+          <el-table-column fixed="right" label="操作" width="150">
             <template slot-scope="scope">
               <div class="hd-td">
                 <div class="hd-tr">
+                  <!-- <el-button class="hrefBtn" type="text" @click="handleHerf(scope.row)" size="small">跳转</el-button> -->
                   <el-button type="text" @click="handleEdit(scope.row)" size="small" class="rmScs">编辑</el-button>
                   <el-button class="rmSc" type="text" @click="handleRemove(scope.row)" size="small">删除</el-button>
                 </div>
@@ -107,6 +108,7 @@ import { Query, GeneralDataReception } from "@/api/dataIntegration";
 export default {
   name: "DataTable",
   props: {
+    isDialog:true,
     //接口ID
     dataId: {
       type: String || Number,
@@ -403,18 +405,33 @@ export default {
     },
     //表格-新增
     handleAdd () {
-      this.flag = true;
-      this.tableType = "add";
-      this.tableTitle = "新增";
-      this.tableForm = {};
+      if(this.isDialog == true){
+        this.flag = true;
+        this.tableType = "add";
+        this.tableTitle = "新增";
+        this.tableForm = {};
+      }
+      else{
+        this.$emit("handleAdd");
+      }
+
       console.log(this.tableOptions);
     },
     //表格-编辑
     handleEdit (row) {
-      this.flag = true;
-      this.tableType = "edit";
-      this.tableTitle = "编辑";
-      this.tableForm = row;
+      if(this.isDialog == true){
+        this.flag = true;
+        this.tableType = "edit";
+        this.tableTitle = "编辑";
+        this.tableForm = row;
+      }
+      else{
+        this.$emit("handleEdit",row);
+      }
+    },
+    //表格-跳转
+    handleHerf(row){
+      alert('跳转')
     },
     // 新增/编辑-确认
     submitClickHandler () {
@@ -511,7 +528,6 @@ export default {
       align-items: center;
       justify-content: center;
       float: left;
-      margin: 0 7px;
       span {
         color: #2d67e3;
       }
@@ -529,6 +545,21 @@ export default {
         color: #ffffff;
       }
     }
+
+    .hrefBtn {
+      width: 48px;
+      height: 24px;
+      background: #6F81BC;
+      box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
+      border-radius: 4px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      span {
+        color: #ffffff;
+      }
+    }
+
     .el-table__fixed-right {
       thead {
         div {
@@ -537,8 +568,12 @@ export default {
       }
     }
     .hd-td {
-      display: flex;
-      justify-content: center;
+      .hd-tr{
+        display: flex;
+        justify-content: center;
+        flex-direction: row;
+        padding: 0 8px;
+      }
     }
   }
   .data-table-btn {

+ 1 - 1
src/layout/components/AppMain.vue

@@ -39,7 +39,7 @@ export default {
   /* margin-top: 112px; */
 }
 .app-main-content {
-  min-height: calc(100vh - 80px);
+  min-height: calc(100vh - 100px);
   background: #dfe3ea;
 }
 .fixed-header + .app-main {

+ 18 - 74
src/router/routes/routes-file-two.js

@@ -35,55 +35,6 @@ const systemSettingsRoutes = {
             },
           ]
         },
-        // {
-        //   path: '/systemSettings/sourceDataItemManagement',
-        //   name: 'sourceDataItemManagement',
-        //   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'),
-        //   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: { 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'),
-        //   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',
           name: 'protocolManagement',
@@ -102,30 +53,6 @@ const systemSettingsRoutes = {
           src: require('@/assets/nav/ic_setting_top_default.png'),
           srcer: require('@/assets/nav/ic_setting_top_check.png')
         },
-        // {
-        //   path: '/systemSettings/warningSet',
-        //   name: 'warningSet',
-        //   component: { render(c) { return c('router-view') } },
-        //   redirect: '/systemSettings/warningSet',
-        //   meta: { title: '报警预警设置' },
-        //   hidden: true,
-        //   src: require('@/assets/nav/ic_setting_top_default.png'),
-        //   srcer: require('@/assets/nav/ic_setting_top_check.png'),
-        //   children: [{
-        //     path: '/systemSettings/warningSet',
-        //     component: () => import('@/views/systemSettings/views/warningSet/warningSet'),
-        //   },
-        //   {
-        //     path: '/systemSettings/warningEdit',
-        //     name: 'warningEdit',
-        //     component: () => import('@/views/systemSettings/views/warningSet/warningEdit'),
-        //     meta: { title: '报警预警设置' },
-        //     hidden: false,
-        //     isAlone: true,
-        //     src: require('@/assets/nav/ic_setting_top@2x.png')
-        //   },
-        //   ]
-        // },
         {
           path: '/systemSettings/queryTemplate',
           name: 'queryTemplate',
@@ -218,7 +145,24 @@ const systemSettingsRoutes = {
   ]
 }
 
+// const queryTemplateRoutes = {
+//   path: '/queryTemplate',
+//   component: Layout,
+//   meta: { roles: ['system_menu'] },
+//   children: [
+//     {
+//       path: '/queryTemplate',
+//       name: 'queryTemplate',
+//       component: () => import('@/views/queryTemplate/index'),
+//       meta: { title: '模板管理', icon: 'systemSettings', imgstyle: 'ic_setting_nav_default.png', imgstyleup: 'ic_setting_nav_check.png' },
+//       children: [
+
+//       ]
+//     }
+//   ]
+// }
 
 export default [
-  systemSettingsRoutes
+  systemSettingsRoutes,
+  // queryTemplateRoutes
 ]

+ 307 - 0
src/views/queryTemplate/index.vue

@@ -0,0 +1,307 @@
+<!--
+ * @Author: your name
+ * @Date: 2021-11-17 13:43:58
+ * @LastEditTime: 2021-11-17 13:43:59
+ * @LastEditors: Please set LastEditors
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @FilePath: \CABaggageData\src\views\dashboard\views\info.vue
+-->
+<template>
+  <div class="airportInfo">
+    <DataTable
+      data-id="4"
+      :rows="12"
+      labelWidth="100px"
+      :minHeight="84"
+      width="800px"
+    />
+    <!--删除弹框-->
+    <Dialog :flag="flag">
+      <div class="airportInfoDialog">
+        <div class="del-title">删除分类信息</div>
+        <div class="content er">
+          <div class="log"></div>
+          是否确认删除
+          <p style="color: #eb2f3b; margin-top: 0px; margin-bottom: 0px">
+            {{ rmObj.name }}
+          </p>
+          ?
+        </div>
+        <div class="DelFoot right t30">
+          <el-button
+            size="medium"
+            @click="remove()"
+            class="r25 buwitch"
+            type="danger"
+            >删除</el-button
+          >
+          <el-button size="medium" class="r26" @click="flag = false"
+            >取消</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 { findarrays } from "@/utils/validate";
+import { AirlinesInquiry } from "@/api/SystemSettings";
+import { exceptiontype, exceptionadd, exceptiondel } from "@/api/acquisition";
+import { GeneralDataReception, Query } from "@/api/dataIntegration";
+import DataTable from "@/components/Table";
+export default {
+  name: "queryTemplate",
+  components: { Search, Dialog, DataTable },
+  data() {
+    return {
+      arr: [
+        {
+          typeName: "名称",
+          typeCode: "测试",
+        },
+      ], //内容数据
+      flag: false, //删除弹框开关
+      addFlag: false, //新增机场信息弹框开关
+      EditFlag: false,
+      ids: null,
+      idss: null,
+      listDate: {},
+      rmObj: {
+        //删除内容
+        name: "",
+      },
+      ruleForm: {
+        //新增机场信息表单
+        name: "",
+        fullName: "",
+        code: "",
+      },
+      EditForm: {
+        name: "",
+        fullName: "",
+        code: "",
+      },
+      rules: {
+        //新增机场信息表单验证
+        name: [{ required: true, message: "请输入航司简称", trigger: "blur" }],
+        fullName: [
+          { required: true, message: "请输入航司全称", trigger: "blur" },
+        ],
+        code: [
+          { required: true, message: "请输入航司二字码", trigger: "blur" },
+        ],
+      },
+      modid: "",
+    };
+  },
+  created() {
+    // this.getAirlines();
+    // this.exceptionlist();
+  },
+  computed: {
+    serachBox() {
+      if (this.searchInfo) {
+        return this.arr.filter((data) => {
+          return Object.keys(data).some((key) => {
+            return (
+              String(data[key]).toLowerCase().indexOf(this.searchInfo) > -1
+            );
+          });
+        });
+      }
+      return this.arr;
+    },
+  },
+  methods: {
+    //异常列表查询
+    async exceptionlist() {
+      let params = {
+        id: "",
+      };
+      const result = await exceptiontype(params);
+      if (result.code == 0) {
+        this.arr = result.returnData;
+      }
+    },
+    //搜索
+    getSearchData(val) {
+      let that = this;
+      that.exceptionlist().then(function (data) {
+        if (val) {
+          that.arr = findarrays(that.arr, "typeName", val);
+        } else {
+          that.exceptionlist();
+        }
+      });
+      // console.log(this.searchInfo);
+    },
+    //删除信息
+    handleMove(item) {
+      this.listDate = item;
+      this.flag = true;
+      this.rmObj = {
+        name: item.queryTemplateName,
+      };
+    },
+    airEdit(item) {
+      // this.modid = item;
+      // this.EditForm.name = item.typeName;
+      // this.EditForm.fullName = item.typeCode;
+      this.$router.push({
+        path: "/systemSettings/queryTemplateedit",
+        query: {
+          queryTemplateName: item.queryTemplateName,
+          protocolID: item.protocolID,
+          queryTemplateDescribe: item.queryTemplateDescribe,
+          queryTemplatetConfig: item.queryTemplatetConfig,
+          queryTemplate: item.queryTemplate,
+        },
+      });
+      // this.EditForm.code = item.code2;
+      // this.EditFlag = true;
+    },
+    async EditSubmit() {
+      let arr = 0;
+      this.$refs["ruleFormall"].validate((valid) => {
+        if (valid) {
+          arr = 1;
+        } else {
+          arr = 0;
+          return false;
+        }
+      });
+      if (arr == 1) {
+        let params = {
+          id: this.modid.id,
+          typeName: this.EditForm.name,
+          typeCode: this.EditForm.fullName,
+        };
+        const result = await exceptionadd(params);
+        if (result.code == 0) {
+          this.$message.success("成功");
+          this.exceptionlist();
+          this.$refs.ruleFormall.resetFields();
+        }
+        this.EditFlag = false;
+      }
+    },
+    closeForm() {
+      this.$refs.ruleForm.resetFields();
+    },
+    //获取模板列表
+    async getAirlines() {
+      try {
+        const res = await Query({
+          id: 77,
+          dataContent: [],
+        });
+        if (res.code === "0") {
+          this.arr = res.returnData;
+        } else {
+          this.$message.error(res.message ?? "失败");
+        }
+      } catch (error) {
+        console.log("错误", error);
+      }
+    },
+
+    //新增机场信息-弹框
+    handleAdd() {
+      this.$router.push("/systemSettings/queryTemplateadd");
+    },
+    //新增机场信息-弹框-取消
+    resetForm() {
+      this.addFlag = false;
+      this.EditFlag = false;
+      this.ruleForm.name = "";
+      this.ruleForm.fullName = "";
+      this.$refs.ruleForms.resetFields();
+      this.$refs.ruleFormall.resetFields();
+    },
+    //删除
+    async remove(data) {
+      this.listDate.operate = "3";
+      try {
+        const res = await GeneralDataReception({
+          serviceId: "20",
+          dataContent: JSON.stringify(this.listDate),
+        });
+        if (res.code === "0") {
+          this.$message.success(res.message ?? "成功");
+          this.flag = false;
+          this.listDate = {};
+          this.getAirlines();
+        } else {
+          this.$message.error(res.message ?? "失败");
+        }
+      } catch (error) {
+        console.log("错误", error);
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.airportInfo {
+  padding: 0 10px;
+  .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%;
+  }
+  .er {
+    display: flex;
+    align-items: center;
+  }
+  .airportInfo-search {
+    margin: 40px 0 30px 0;
+  }
+  .airportInfo-content {
+    img {
+      margin: 0 auto;
+      margin-top: 10%;
+      display: -webkit-box;
+      -webkit-box-pack: center;
+      -webkit-box-align: center;
+      -webkit-box-orient: vertical;
+      text-align: center;
+    }
+    .grid-content {
+      height: 144px;
+      padding: 24px;
+      margin-bottom: 24px;
+      .title {
+        font-size: 16px;
+        font-family: Microsoft YaHei;
+        font-weight: bold;
+        color: #303133;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        max-width: 150px;
+      }
+      .edit_log {
+        position: relative;
+        // top: -2px;
+      }
+      .icon {
+        cursor: pointer;
+      }
+      .desc {
+        font-size: 14px;
+        font-family: Microsoft YaHei;
+        font-weight: 400;
+        color: #101116;
+        margin-top: 60px;
+      }
+    }
+  }
+}
+</style>

+ 7 - 167
src/views/systemSettings/views/serviceManagement/serviceHome.vue

@@ -15,144 +15,9 @@
         labelWidth="110px"
         :minHeight="70"
         width="800px"
+        :isDialog="false"
+        @handleAdd="handleAdd"
       />
-      <!-- <div class="service-header flex">
-        <div class="manageTitle">服务管理</div>
-        <div class="btn-create">
-          <el-button class="btn-white" size="small" @click="showCreateDialog"
-            >新增</el-button
-          >
-        </div>
-      </div>
-      <div class="service-content">
-        <el-row :gutter="24">
-          <el-col v-for="item in serviceList" :key="item.serviceID" :span="4">
-            <div class="grid-content">
-              <div class="grid-content-hand flex">
-                <div class="title flex-wrap">
-                  <el-tooltip
-                    class="item"
-                    effect="dark"
-                    :content="item.serviceName"
-                    placement="bottom"
-                  >
-                    <div class="name">{{ item.serviceName }}</div>
-                  </el-tooltip>
-                  <i class="loger" @click="btnEditClickHandler(item)" />
-                </div>
-                <i class="el-icon-close icon" @click="showDeleteDialog(item)" />
-              </div>
-            </div>
-          </el-col>
-        </el-row>
-      </div> -->
-      <!--删除弹框-->
-      <!-- <Dialog :flag="deleteDialogVisible">
-        <div class="dialog-delete">
-          <div class="del-title">删除服务</div>
-          <div class="content er">
-            <div class="log">你是否确认删除{{ delObj.serviceName }}?</div>
-          </div>
-          <div class="del-foot right t30">
-            <el-button
-              size="medium"
-              class="r25 r26"
-              type="danger"
-              @click="deleteSubmitHandler"
-              >删除</el-button
-            >
-            <el-button size="medium" class="r26" @click="hideDeleteDialog"
-              >取消</el-button
-            >
-          </div>
-        </div>
-      </Dialog>
-      <Dialog :flag="createDialogVisible" width="600px">
-        <div class="dialog-create">
-          <div class="title">新增服务</div>
-          <main class="content">
-            <el-form
-              ref="createForm"
-              class="create-form"
-              :model="createForm"
-              :rules="createFormRules"
-              label-position="right"
-              label-width="82px"
-              size="mini"
-            >
-              <el-form-item label="服务名称" prop="serviceName">
-                <el-input
-                  v-model="createForm.serviceName"
-                  placeholder="请输入服务名称"
-                  clearable
-                />
-              </el-form-item>
-              <el-form-item label="描述" prop="serviceDescribe">
-                <el-input
-                  v-model="createForm.serviceDescribe"
-                  placeholder="请输入描述"
-                  type="textarea"
-                  :autosize="{ minRows: 4, maxRows: 4 }"
-                  resize="none"
-                  clearable
-                />
-              </el-form-item>
-              <el-form-item label="是否同步">
-                <el-radio-group v-model="createForm.isAsynchronous">
-                  <el-radio :label="0">是</el-radio>
-                  <el-radio :label="1">否</el-radio>
-                </el-radio-group>
-              </el-form-item>
-              <el-form-item label="来源" prop="protocolID">
-                <el-select
-                  v-model="createForm.protocolID"
-                  placeholder="请选择来源"
-                >
-                  <el-option
-                    v-for="item in protocolList"
-                    :key="item.protocolID"
-                    :value="item.protocolID"
-                    :label="item.protocolName"
-                  />
-                </el-select>
-              </el-form-item>
-              <el-form-item
-                label="并发线程数"
-                prop="threads"
-                label-width="96px"
-              >
-                <el-input
-                  v-model="createForm.threads"
-                  placeholder="请输入并发线程数"
-                  clearable
-                />
-              </el-form-item>
-              <el-form-item label="来源配置" prop="connectConfig">
-                <el-input
-                  v-model="createForm.connectConfig"
-                  placeholder="请输入来源配置"
-                  type="textarea"
-                  :autosize="{ minRows: 4, maxRows: 4 }"
-                  resize="none"
-                  clearable
-                />
-              </el-form-item>
-            </el-form>
-          </main>
-          <div class="foot">
-            <el-button
-              size="medium"
-              type="primary"
-              class="r25 r26"
-              @click="createSubmitHandler"
-              >提交</el-button
-            >
-            <el-button size="medium" class="r26" @click="hideCreateDialog"
-              >取消</el-button
-            >
-          </div>
-        </div>
-      </Dialog> -->
     </div>
   </div>
 </template>
@@ -202,44 +67,19 @@ export default {
     // this.getServiceList();
   },
   methods: {
-    // 新增-弹框
-    showCreateDialog() {
-      this.getProtocolList();
-      this.createDialogVisible = true;
-    },
-    // 新增-提交
-    createSubmitHandler() {
-      this.$refs["createForm"].validate((valid) => {
-        if (valid) {
-          this.createService();
-        }
+    // 新增
+    handleAdd() {
+      this.$router.push({
+        path: "/systemSettings/serviceEdit"
       });
     },
-    // 新增-关闭
-    hideCreateDialog() {
-      this.$refs["createForm"].resetFields();
-      this.createDialogVisible = false;
-    },
     // 编辑-跳转
-    btnEditClickHandler(item) {
+    handleEdit(item) {
       this.$router.push({
         path: "/systemSettings/serviceEdit",
         query: { serviceID: item.serviceID },
       });
     },
-    // 删除-弹框
-    showDeleteDialog(item) {
-      this.delObj = item;
-      this.deleteDialogVisible = true;
-    },
-    // 删除-提交
-    deleteSubmitHandler() {
-      this.deleteService();
-    },
-    // 删除-关闭
-    hideDeleteDialog() {
-      this.deleteDialogVisible = false;
-    },
     async getServiceList() {
       try {
         const res = await Query({