chenjun 2 years ago
parent
commit
ecb83888db

+ 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
 ]

+ 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({