chenrui  2 years ago
parent
commit
5a834a449c

+ 389 - 122
src/components/Table/index.vue

@@ -1,37 +1,90 @@
 <template>
   <div class="data-table" :style="{ marginTop: marginTop }">
-    <div :style="dataTableContentStyle" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="data-table-content">
-      <div :class="isStatus || isStatuser ? 'flex' : 'flex-end'" class="data-table-btn">
+    <div
+      :style="dataTableContentStyle"
+      v-loading="loading"
+      element-loading-text="拼命加载中"
+      element-loading-spinner="el-icon-loading"
+      element-loading-background="rgba(0, 0, 0, 0.8)"
+      class="data-table-content"
+    >
+      <div
+        :class="isStatus || isStatuser ? 'flex' : 'flex-end'"
+        class="data-table-btn"
+      >
         <div v-if="isStatus || isStatuser" class="vStatus">
           <slot name="header" />
         </div>
         <template v-if="isBtn">
           <template v-if="isAuth">
-            <el-button v-if="btnAuthAdd" size="small" @click="handleAdd" plain type="primary">新增</el-button>
+            <el-button
+              v-if="btnAuthAdd"
+              size="small"
+              @click="handleAdd"
+              plain
+              type="primary"
+              >新增</el-button
+            >
           </template>
           <template v-else>
-            <el-button size="small" @click="handleAdd" plain type="primary">新增</el-button>
+            <el-button size="small" @click="handleAdd" plain type="primary"
+              >新增</el-button
+            >
           </template>
         </template>
       </div>
       <template v-if="tableData.length">
         <div>
-          <el-table v-el-table-infinite-scroll="load" :data="filteredTableData" :summary-method="getSummaries" :span-method="tableSpanMethod" :tree-props="treeProps" :row-key="rowKeyTree" stripe :show-summary="showSummary" border ref="table" :height="tableHeight ? tableHeight : minHeight - 8 + 'vh'" class="table infinite-list" style="width: 100%; overflow: auto" @select="selectHandler">
-            <el-table-column v-if="selectionEnable" type="selection" width="35" />
+          <el-table
+            v-el-table-infinite-scroll="load"
+            :data="filteredTableData"
+            :summary-method="getSummaries"
+            :span-method="tableSpanMethod"
+            :tree-props="treeProps"
+            :row-key="rowKeyTree"
+            stripe
+            :show-summary="showSummary"
+            border
+            ref="table"
+            :height="tableHeight ? tableHeight : minHeight - 8 + 'vh'"
+            class="table infinite-list"
+            style="width: 100%; overflow: auto"
+            @select="selectHandler"
+          >
+            <el-table-column
+              v-if="selectionEnable"
+              type="selection"
+              width="35"
+            />
             <el-table-column v-if="isStatus" width="55">
               <template slot-scope="scope">
                 <div class="tableStatus">
-                  <div v-if="filteredTableData[scope.$index].nodeState == '运行'" class="status0">
+                  <div
+                    v-if="filteredTableData[scope.$index].nodeState == '运行'"
+                    class="status0"
+                  >
                     <span class="icon"></span>
                   </div>
-                  <div v-else-if="filteredTableData[scope.$index].nodeState == '停止'" class="status1">
+                  <div
+                    v-else-if="
+                      filteredTableData[scope.$index].nodeState == '停止'
+                    "
+                    class="status1"
+                  >
                     <span class="icon"></span>
                   </div>
                   <div v-else class="status2"><span class="icon"></span></div>
                 </div>
               </template>
             </el-table-column>
-            <el-table-column v-for="(item, index) in tableColsCopy" :sortable="item.needSort ? true : false" :key="index" :prop="item.columnName" :label="item.columnLabel" :show-overflow-tooltip="showOverflowTooltip">
+            <el-table-column
+              v-for="(item, index) in tableColsCopy"
+              :sortable="item.needSort ? true : false"
+              :key="index"
+              :prop="item.columnName"
+              :label="item.columnLabel"
+              :show-overflow-tooltip="showOverflowTooltip"
+            >
               <template #header>
                 <span class="colTips">
                   <el-tooltip :content="item.columnDescribe" placement="top">
@@ -39,12 +92,38 @@
                   </el-tooltip>
                 </span>
                 <span v-if="item.needFilters">
-                  <el-popover placement="bottom" trigger="click" @show="popoverShowHandler(item.columnName)" @hide="popoverHideHandler">
-                    <i slot="reference" :class="['filter-arrow', 'el-icon-arrow-down', arrowClass(item.columnName)]" />
+                  <el-popover
+                    placement="bottom"
+                    trigger="click"
+                    @show="popoverShowHandler(item.columnName)"
+                    @hide="popoverHideHandler"
+                  >
+                    <i
+                      slot="reference"
+                      :class="[
+                        'filter-arrow',
+                        'el-icon-arrow-down',
+                        arrowClass(item.columnName),
+                      ]"
+                    />
                     <el-form>
                       <el-form-item :label="item.columnLabel">
-                        <el-select v-model="filterValues[item.columnName]" size="small" placeholder="筛选" default-first-option filterable clearable>
-                          <el-option v-for="(option, optionIndex) in tableDataFilters[item.columnName]" :key="option.value + optionIndex" :value="option.value" :label="option.text" />
+                        <el-select
+                          v-model="filterValues[item.columnName]"
+                          size="small"
+                          placeholder="筛选"
+                          default-first-option
+                          filterable
+                          clearable
+                        >
+                          <el-option
+                            v-for="(option, optionIndex) in tableDataFilters[
+                              item.columnName
+                            ]"
+                            :key="option.value + optionIndex"
+                            :value="option.value"
+                            :label="option.text"
+                          />
                         </el-select>
                       </el-form-item>
                     </el-form>
@@ -57,44 +136,142 @@
                 <div class="hd-td">
                   <div class="hd-tr">
                     <template v-if="isStatus">
-                      <el-button type="text" @click="handleLook(scope.row)" size="small" class="rmScs">查看</el-button>
-                      <template v-if="scope.row.serviceTypeCode == 2 || scope.row.serviceTypeCode == 4">
-                        <el-button type="text" v-if="scope.row.nodeState == '停止'" @click="stateChangeHandler(scope.row)" size="small" class="rmScs">启动</el-button>
-                        <el-button type="text" v-if="scope.row.nodeState == '运行'" @click="stateChangeHandler(scope.row)" size="small" class="rmScs">停止</el-button>
+                      <el-button
+                        type="text"
+                        @click="handleLook(scope.row)"
+                        size="small"
+                        class="rmScs"
+                        >查看</el-button
+                      >
+                      <template
+                        v-if="
+                          scope.row.serviceTypeCode == 2 ||
+                          scope.row.serviceTypeCode == 4
+                        "
+                      >
+                        <el-button
+                          type="text"
+                          v-if="scope.row.nodeState == '停止'"
+                          @click="stateChangeHandler(scope.row)"
+                          size="small"
+                          class="rmScs"
+                          >启动</el-button
+                        >
+                        <el-button
+                          type="text"
+                          v-if="scope.row.nodeState == '运行'"
+                          @click="stateChangeHandler(scope.row)"
+                          size="small"
+                          class="rmScs"
+                          >停止</el-button
+                        >
                       </template>
                     </template>
                     <!-- <el-button class="hrefBtn" type="text" @click="handleHerf(scope.row)" size="small">跳转</el-button> -->
                     <template v-if="isAuth">
-                      <el-button v-if="btnAuthEdit" type="text" @click="handleEdit(scope.row)" size="small" class="rmScs">编辑</el-button>
+                      <el-button
+                        v-if="btnAuthEdit"
+                        type="text"
+                        @click="handleEdit(scope.row)"
+                        size="small"
+                        class="rmScs"
+                        >编辑</el-button
+                      >
                     </template>
                     <template v-else>
-                      <el-button type="text" @click="handleEdit(scope.row)" size="small" class="rmScs">编辑</el-button>
+                      <el-button
+                        type="text"
+                        @click="handleEdit(scope.row)"
+                        size="small"
+                        class="rmScs"
+                        >编辑</el-button
+                      >
                     </template>
                     <template v-if="isAuth">
-                      <el-button v-if="btnAuthDel" class="rmSc" type="text" @click="handleRemove(scope.row)" size="small">删除</el-button>
+                      <el-button
+                        v-if="btnAuthDel"
+                        class="rmSc"
+                        type="text"
+                        @click="handleRemove(scope.row)"
+                        size="small"
+                        >删除</el-button
+                      >
                     </template>
                     <template v-else>
-                      <el-button class="rmSc" type="text" @click="handleRemove(scope.row)" size="small">删除</el-button>
+                      <el-button
+                        class="rmSc"
+                        type="text"
+                        @click="handleRemove(scope.row)"
+                        size="small"
+                        >删除</el-button
+                      >
                     </template>
-                    <el-button class="rmScs" v-if="withColumnSet" type="text" size="small" @click="handleColumnSet(scope.row)">列设置</el-button>
-                    <el-button class="rmScs" v-if="withItemSet" type="text" size="small" @click="handleItemSet(scope.row)">数据项</el-button>
+                    <el-button
+                      class="rmScs"
+                      v-if="withColumnSet"
+                      type="text"
+                      size="small"
+                      @click="handleColumnSet(scope.row)"
+                      >列设置</el-button
+                    >
+                    <el-button
+                      class="rmScs"
+                      v-if="withItemSet"
+                      type="text"
+                      size="small"
+                      @click="handleItemSet(scope.row)"
+                      >数据项</el-button
+                    >
                     <template v-if="withlodSet">
                       <template v-if="isAuth">
-                        <el-button class="rmScser" v-if="btnAuthWithlodSet" type="text" size="small" @click="handlelodSet(scope.row)">航站设置</el-button>
+                        <el-button
+                          class="rmScser"
+                          v-if="btnAuthWithlodSet"
+                          type="text"
+                          size="small"
+                          @click="handlelodSet(scope.row)"
+                          >航站设置</el-button
+                        >
                       </template>
                       <template v-else>
-                        <el-button class="rmScser" type="text" size="small" @click="handlelodSet(scope.row)">航站设置</el-button>
+                        <el-button
+                          class="rmScser"
+                          type="text"
+                          size="small"
+                          @click="handlelodSet(scope.row)"
+                          >航站设置</el-button
+                        >
                       </template>
                     </template>
                     <template v-if="withnodeSet">
                       <template v-if="isAuth">
-                        <el-button v-if="btnAuthWithnodeSet" class="rmScser" type="text" size="small" @click="handlenodeSet(scope.row)">位置设置</el-button>
+                        <el-button
+                          v-if="btnAuthWithnodeSet"
+                          class="rmScser"
+                          type="text"
+                          size="small"
+                          @click="handlenodeSet(scope.row)"
+                          >位置设置</el-button
+                        >
                       </template>
                       <template v-else>
-                        <el-button class="rmScser" type="text" size="small" @click="handlenodeSet(scope.row)">位置设置</el-button>
+                        <el-button
+                          class="rmScser"
+                          type="text"
+                          size="small"
+                          @click="handlenodeSet(scope.row)"
+                          >位置设置</el-button
+                        >
                       </template>
                     </template>
-                    <el-button v-if="withPreview" type="text" size="small" class="rmScs" @click="handlePreview(scope.row)">预览</el-button>
+                    <el-button
+                      v-if="withPreview"
+                      type="text"
+                      size="small"
+                      class="rmScs"
+                      @click="handlePreview(scope.row)"
+                      >预览</el-button
+                    >
                   </div>
                 </div>
               </template>
@@ -113,20 +290,69 @@
         <div class="dialog-content">
           <div class="title">{{ tableTitle }}</div>
           <div class="contents">
-            <el-form ref="ruleForm" :model="tableForm" :label-width="labelWidth">
+            <el-form
+              ref="ruleForm"
+              :model="tableForm"
+              :label-width="labelWidth"
+            >
               <el-row :gutter="20">
-                <el-col v-for="(item, index) in tableColsCopy" :key="index" :span="rows">
+                <el-col
+                  v-for="(item, index) in tableColsCopy"
+                  :key="index"
+                  :span="rows"
+                >
                   <el-form-item :label="item.columnLabel">
-                    <template v-if="item.listqueryTemplateID || item.listqueryTemplateID == 0">
-                      <el-select size="small" clearable style="width: 100%" v-model="tableForm[item.columnName]" @change="changeSelect(item.columnName)" placeholder="请选择">
-                        <el-option v-for="item in tableOptions[item.columnName]" :key="item.v" :label="item.k" :value="item.v"> </el-option>
+                    <template
+                      v-if="
+                        item.listqueryTemplateID ||
+                        item.listqueryTemplateID == 0
+                      "
+                    >
+                      <el-select
+                        class="input-shadow"
+                        size="small"
+                        filterable
+                        default-first-option
+                        style="width: 100%"
+                        v-model="tableForm[item.columnName]"
+                        @change="changeSelect(item.columnName)"
+                        placeholder="请选择"
+                      >
+                        <el-option
+                          v-for="item in tableOptions[item.columnName]"
+                          :key="item.v ? item.v : item.planDepartureApt"
+                          :label="item.k ? item.k : item.planDepartureApt"
+                          :value="item.v ? item.v : item.planDepartureApt"
+                        >
+                        </el-option>
                       </el-select>
                     </template>
                     <template v-else-if="item.dataType == 'longtext'">
-                      <el-input size="small" :rows="1" type="textarea" @change="inputChangeHandler(item.columnName)" v-model="tableForm[item.columnName]"></el-input>
+                      <el-input
+                        size="small"
+                        :rows="1"
+                        type="textarea"
+                        @change="inputChangeHandler(item.columnName)"
+                        v-model="tableForm[item.columnName]"
+                      ></el-input>
+                    </template>
+                    <template v-else-if="item.dataType == 'datetime'">
+                      <el-date-picker
+                        value-format="yyyy-MM-dd HH:mm:ss"
+                        v-model="tableForm[item.columnName]"
+                        :rows="1"
+                        type="datetime"
+                        placeholder="选择日期时间"
+                        @change="inputChangeHandler(item.columnName)"
+                      >
+                      </el-date-picker>
                     </template>
                     <template v-else>
-                      <el-input size="small" v-model="tableForm[item.columnName]" @change="inputChangeHandler(item.columnName)"></el-input>
+                      <el-input
+                        size="small"
+                        v-model="tableForm[item.columnName]"
+                        @change="inputChangeHandler(item.columnName)"
+                      ></el-input>
                     </template>
                   </el-form-item>
                 </el-col>
@@ -134,7 +360,13 @@
             </el-form>
           </div>
           <div class="foot right">
-            <el-button size="medium" @click="handleOk" class="r24" type="primary">确定</el-button>
+            <el-button
+              size="medium"
+              @click="handleOk"
+              class="r24"
+              type="primary"
+              >确定</el-button
+            >
             <el-button @click="flag = false" size="medium">取消</el-button>
           </div>
         </div>
@@ -143,11 +375,20 @@
         <div class="airportInfoDialog">
           <div class="title del-title">删除</div>
           <div class="content del-content">
-            <span class="el-icon-error error r10"></span>您是否确认删除<span class="error l10">{{ rmTitle }}</span>
+            <span class="el-icon-error error r10"></span>您是否确认删除<span
+              class="error l10"
+              >{{ rmTitle }}</span
+            >
           </div>
           <div class="foot right Delfoot">
-            <el-button size="medium" class="r24" @click="tableRemove" type="danger">删除</el-button>
+            <el-button
+              size="medium"
+              class="r24"
+              @click="tableRemove"
+              type="danger"
+              >删除</el-button
+            >
             <el-button size="medium" @click="rmFlag = false">取消</el-button>
           </div>
         </div>
@@ -162,7 +403,12 @@ import { setTableFilters } from "@/utils/table";
 import Dialog from "@/layout/components/Dialog/index.vue";
 import NoData from "@/components/nodata";
 import { translateDataToTreeAllTreeMsg } from "@/utils/validate";
-import { Query, GeneralDataReception, Start, Stop } from "@/api/dataIntegration";
+import {
+  Query,
+  GeneralDataReception,
+  Start,
+  Stop,
+} from "@/api/dataIntegration";
 export default {
   name: "DataTable",
   props: {
@@ -170,6 +416,10 @@ export default {
       type: Boolean,
       default: true,
     },
+    tableup: {
+      type: Boolean,
+      default: false,
+    },
     //接口ID
     dataId: {
       type: [String, Number],
@@ -330,7 +580,7 @@ export default {
     },
   },
   components: { Dialog, NoData },
-  data () {
+  data() {
     return {
       loading: false,
       flag: false,
@@ -361,7 +611,7 @@ export default {
     };
   },
   computed: {
-    dataTableContentStyle () {
+    dataTableContentStyle() {
       const style = {};
       if (this.minHeight) {
         style["min-height"] = this.minHeight;
@@ -372,22 +622,30 @@ export default {
       return style;
     },
     //设置表头-下拉-箭头样式
-    arrowClass () {
+    arrowClass() {
       return function (prop) {
         let classString = "";
         if (this.colShowFilter === prop) {
           return "arrow-active";
         }
-        if (Object.entries(this.tableDataFilters).find(([key, arr]) => this.filterValues[prop])) {
+        if (
+          Object.entries(this.tableDataFilters).find(
+            ([key, arr]) => this.filterValues[prop]
+          )
+        ) {
           classString += "arrow-blue";
         }
         return classString;
       };
     },
     //设置表头-下拉-选中数据
-    filteredTableData () {
+    filteredTableData() {
       if (this.isTree) {
-        this.tableData = translateDataToTreeAllTreeMsg(this.tableData, "parentID", "companyID");
+        this.tableData = translateDataToTreeAllTreeMsg(
+          this.tableData,
+          "parentID",
+          "companyID"
+        );
       }
       return this.tableData.filter((item) => {
         let flag = true;
@@ -399,35 +657,35 @@ export default {
         return flag;
       });
     },
-    btnAuthAdd () {
+    btnAuthAdd() {
       if (this.roles.includes(this.authAdd)) {
         return true;
       } else {
         return false;
       }
     },
-    btnAuthEdit () {
+    btnAuthEdit() {
       if (this.roles.includes(this.authEdit)) {
         return true;
       } else {
         return false;
       }
     },
-    btnAuthDel () {
+    btnAuthDel() {
       if (this.roles.includes(this.authDel)) {
         return true;
       } else {
         return false;
       }
     },
-    btnAuthWithnodeSet () {
+    btnAuthWithnodeSet() {
       if (this.roles.includes(this.authWithnodeSet)) {
         return true;
       } else {
         return false;
       }
     },
-    btnAuthWithlodSet () {
+    btnAuthWithlodSet() {
       if (this.roles.includes(this.authWithlodSet)) {
         return true;
       } else {
@@ -437,7 +695,7 @@ export default {
   },
   watch: {
     dataContent: {
-      handler (val) {
+      handler(val) {
         if (val) {
           if (val.companyID) {
             this.resetTable();
@@ -450,7 +708,7 @@ export default {
     //监听机场变更的id  不可删除
     // dataId: {
     //   if(val) {
-    //     
+    //
     //     if (val.companyID) {
     //       this.resetTable();
     //       this.getQuery();
@@ -458,15 +716,15 @@ export default {
     //   },
     // },
   },
-  mounted () {
+  mounted() {
     this.getQuery();
   },
-  updated () {
+  updated() {
     this.$refs["table"]?.doLayout();
   },
   methods: {
-    load () {
-      // 
+    load() {
+      //
       if (!this.isTree) {
         if (this.noMore || this.loading) {
           return;
@@ -474,25 +732,26 @@ export default {
         this.getQuery();
       }
     },
-    resetTable () {
+    resetTable() {
       this.page = 0;
       this.noMore = false;
       this.tableData = [];
     },
-    changeSelect (data) {
+    changeSelect(data) {
       if (this.tableForm[data] === "") {
         this.tableForm[data] = null;
       }
-      this.tableForm[this.tableOptions[data][0].setvalue] = this.tableForm[data];
-      // 
+      this.tableForm[this.tableOptions[data][0].setvalue] =
+        this.tableForm[data];
+      //
     },
-    inputChangeHandler (data) {
+    inputChangeHandler(data) {
       if (this.tableForm[data] === "") {
         this.tableForm[data] = null;
       }
     },
     //获取表格数据
-    async getQuery () {
+    async getQuery() {
       try {
         this.loading = true;
         const { code, returnData } = await Query({
@@ -506,7 +765,9 @@ export default {
             this.noMore = true;
             this.loading = false;
           }
-          const titleColumn = returnData.columnSet.find((item) => item.needShow === 1);
+          const titleColumn = returnData.columnSet.find(
+            (item) => item.needShow === 1
+          );
           if (titleColumn) {
             this.rowTitle = titleColumn.columnName;
           }
@@ -525,11 +786,10 @@ export default {
       } catch (error) {
         this.page--;
         this.loading = false;
-
       }
     },
     //表格-增/删/改
-    async generalDataReception (data) {
+    async generalDataReception(data) {
       try {
         data = {
           ...data,
@@ -555,7 +815,6 @@ export default {
           this.tableForm = {};
         }
       } catch (error) {
-
         this.flag = false;
         this.rmFlag = false;
         this.tableObj = {};
@@ -563,20 +822,20 @@ export default {
       }
     },
     // 表格勾选
-    toggleRowSelection (row, isSelected) {
+    toggleRowSelection(row, isSelected) {
       this.$refs["table"].toggleRowSelection(row, isSelected);
     },
     // 表格初始勾选
-    selectTableRows (tableData, selectFlagName) {
+    selectTableRows(tableData, selectFlagName) {
       tableData.forEach((row) => {
         this.$refs["table"].toggleRowSelection(row, !!row[selectFlagName]);
       });
       this.$emit("selectionAll", this.$refs.table.selection);
     },
     //初始化表格
-    initTableData () {
+    initTableData() {
       this.tableColsCopy = this.tableCols.filter((item) => item.needShow);
-      // 
+      //
       // debugger;
       this.tableDataCopy = _.cloneDeep(this.tableData);
       const datas = _.cloneDeep(this.tableColsCopy);
@@ -591,9 +850,11 @@ export default {
           // const reqUt = this.getSelectData(item.listqueryTemplateID)
           // reqUts.push(reqUt)
           if (!this.tableOptions[item.columnName]) {
-            this.tableOptions[item.columnName] = await this.getSelectData(item.listqueryTemplateID);
+            this.tableOptions[item.columnName] = await this.getSelectData(
+              item.listqueryTemplateID
+            );
           }
-          // 
+          //
         }
         // this.filterValues[item.columnName] = ''
       });
@@ -603,7 +864,7 @@ export default {
       // this.getSelectDataAll(reqUts)
     },
     //获取所有获取弹框-下拉数据-请求状态
-    getSelectDataAll (reqUts) {
+    getSelectDataAll(reqUts) {
       Promise.all(reqUts)
         .then((res) => {
           this.proAll = true;
@@ -613,7 +874,7 @@ export default {
         });
     },
     //获取弹框-下拉数据
-    async getSelectData (id) {
+    async getSelectData(id) {
       const { code, returnData } = await Query({
         id,
         dataContent: [],
@@ -625,7 +886,7 @@ export default {
       }
     },
     //重组table-显示名称
-    setTable () {
+    setTable() {
       this.tableArrs.forEach((item) => {
         this.tableOptions[item].forEach((p) => {
           this.tableDataCopy.forEach((msg) => {
@@ -644,7 +905,7 @@ export default {
       this.tableData = this.tableDataCopy;
     },
     //分组
-    tableGroup (tableData) {
+    tableGroup(tableData) {
       const spanArr = [];
       let pos = 0;
       let ifYj = this.tableGroups[0];
@@ -664,14 +925,14 @@ export default {
       this.spanArr = spanArr;
       this.pos = pos;
     },
-    popoverShowHandler (prop) {
+    popoverShowHandler(prop) {
       this.colShowFilter = prop;
     },
-    popoverHideHandler () {
+    popoverHideHandler() {
       this.colShowFilter = "";
     },
     //分组
-    tableSpanMethod ({ row, column, rowIndex, columnIndex }) {
+    tableSpanMethod({ row, column, rowIndex, columnIndex }) {
       if (this.tableGroups.includes(column["property"])) {
         const _row = this.spanArr[rowIndex];
         const _col = _row > 0 ? 1 : 0;
@@ -682,7 +943,7 @@ export default {
       }
     },
     //合计
-    getSummaries (param) {
+    getSummaries(param) {
       const { columns, data } = param;
       const sums = [];
       columns.forEach((column, index) => {
@@ -706,15 +967,13 @@ export default {
       return sums;
     },
     //弹框-确定
-    handleOk () {
+    handleOk() {
       this.submitClickHandler();
     },
     //滚动
-    tableLoad () {
-
-    },
+    tableLoad() {},
     //表格-新增
-    handleAdd () {
+    handleAdd() {
       // this.flag = true;
       //   this.tableType = "add";
       //   this.tableTitle = "新增";
@@ -728,29 +987,41 @@ export default {
         this.$emit("handleAdd");
       }
 
-      // 
+      //
     },
     //表格-编辑
-    async handleEdit (row) {
-      if (this.isDialog) {
-        if (this.editId) {
-          let data = await this.queryOriginRow(this.editId, row.queryTemplateColumnSetID);
-          this.tableForm = JSON.parse(JSON.stringify(data));
-          // this.tableForm =this.tableForm;
-          // Object.entries(tableForm).forEach(([key, value]) => {
-          //   this.tableForm[key] = value
-          // })
+    async handleEdit(row) {
+      if (this.tableup) {
+        this.$router.push({
+          path: "/systemSettings/warningEdit",
+          query: {
+            id: row.alarmSceneId,
+          },
+        });
+      } else {
+        if (this.isDialog) {
+          if (this.editId) {
+            let data = await this.queryOriginRow(
+              this.editId,
+              row.queryTemplateColumnSetID
+            );
+            this.tableForm = JSON.parse(JSON.stringify(data));
+            // this.tableForm =this.tableForm;
+            // Object.entries(tableForm).forEach(([key, value]) => {
+            //   this.tableForm[key] = value
+            // })
+          } else {
+            this.tableForm = JSON.parse(JSON.stringify(row));
+          }
+          this.flag = true;
+          this.tableType = "edit";
+          this.tableTitle = "编辑";
         } else {
-          this.tableForm = JSON.parse(JSON.stringify(row));
+          this.$emit("handleEdit", row);
         }
-        this.flag = true;
-        this.tableType = "edit";
-        this.tableTitle = "编辑";
-      } else {
-        this.$emit("handleEdit", row);
       }
     },
-    async queryOriginRow (editId, queryTemplateColumnSetID) {
+    async queryOriginRow(editId, queryTemplateColumnSetID) {
       try {
         const { code, returnData } = await Query({
           id: editId,
@@ -761,16 +1032,14 @@ export default {
         } else {
           this.$message.error("失败");
         }
-      } catch (error) {
-
-      }
+      } catch (error) {}
     },
     //表格-跳转
-    handleHerf (row) {
+    handleHerf(row) {
       alert("跳转");
     },
     // 新增/编辑-确认
-    submitClickHandler () {
+    submitClickHandler() {
       this.$refs["ruleForm"].validate((valid) => {
         if (valid) {
           if (this.tableType == "add") {
@@ -785,19 +1054,19 @@ export default {
       });
     },
     //表格-删除
-    handleRemove (row) {
+    handleRemove(row) {
       this.rmFlag = true;
       // this.rmTitle = row.className || row.username || row.serviceName || row.queryTemplateName;
       this.rmTitle = row[this.rowTitle];
       this.tableObj = row;
     },
     //表格-删除-确认
-    tableRemove () {
+    tableRemove() {
       this.tableObj.event = 3;
       this.generalDataReception(this.tableObj);
     },
     // 表格-跳转列设置页
-    handleColumnSet (row) {
+    handleColumnSet(row) {
       this.$router.push({
         path: "/systemSettings/queryTemplateChild",
         query: {
@@ -806,7 +1075,7 @@ export default {
       });
     },
     // 表格-跳转数据项设置页
-    handleItemSet (row) {
+    handleItemSet(row) {
       this.$router.push({
         path: "/systemSettings/datastructureChild",
         query: {
@@ -815,7 +1084,7 @@ export default {
       });
     },
     // 表格-跳转航站设置页
-    handlelodSet (row) {
+    handlelodSet(row) {
       this.$router.push({
         path: "/BasicsData/airportInfoChild",
         query: {
@@ -824,7 +1093,7 @@ export default {
       });
     },
     // 表格-节点置页
-    handlenodeSet (row) {
+    handlenodeSet(row) {
       this.$router.push({
         path: "/BasicsData/deployNodeChild",
         query: {
@@ -833,7 +1102,7 @@ export default {
       });
     },
     // 表格-查看
-    handleLook (row) {
+    handleLook(row) {
       this.$router.push({
         name: "serviceTopology",
         params: {
@@ -843,21 +1112,21 @@ export default {
       });
     },
     // 表格-启动/停止
-    async stateChangeHandler (row) {
+    async stateChangeHandler(row) {
       const runState = row.runState == "运行" ? 0 : 1;
       const serviceID = row.serviceID;
       // this.changeBtn(runState, serviceID);
       this.changeState(runState, serviceID);
     },
     // 表格-选中行
-    selectHandler (selection, row) {
+    selectHandler(selection, row) {
       this.$emit("selection-change", selection, row);
     },
     // 表格-查询模板预览
-    handlePreview (row) {
+    handlePreview(row) {
       this.$emit("preview", row);
     },
-    async changeBtn (state, id) {
+    async changeBtn(state, id) {
       let res = null;
       // const { code, message } = await GeneralDataReception({
       //   serviceId: 61,
@@ -880,7 +1149,7 @@ export default {
         this.$message.error(res.message);
       }
     },
-    async changeState (runState, serviceID) {
+    async changeState(runState, serviceID) {
       try {
         const operate = runState ? "start" : "stop";
         const {
@@ -913,9 +1182,7 @@ export default {
         } else {
           this.$message.error("查询节点失败");
         }
-      } catch (error) {
-
-      }
+      } catch (error) {}
     },
   },
 };

+ 40 - 212
src/views/systemSettings/views/warningSet/warningEdit.vue

@@ -10,7 +10,12 @@
       </div>
 
       <div class="formBox">
-        <el-form ref="ruleForm" :model="tableFormer" label-width="100px">
+        <el-form
+          ref="ruleForm"
+          :model="tableFormer"
+          label-width="100px"
+          v-if="viShow"
+        >
           <el-row :gutter="24">
             <el-col
               v-for="(item, index) in tableColsCopys"
@@ -71,121 +76,11 @@
             </el-col>
           </el-row>
         </el-form>
-        <!-- <el-row :gutter="20">
-            <el-col :span="6">
-              <div class="aviName">
-                <span class="aviP">场景编号</span>
-                <el-input
-                  v-model="tableFormer.alarmSceneId"
-                  placeholder="请输入场景编号"
-                ></el-input>
-              </div>
-            </el-col>
-            <el-col :span="6">
-              <div class="aviName">
-                <span class="aviP">航司二字码</span>
-                <el-select
-                  v-model="tableFormer.IATACode"
-                  class="input-shadow"
-                  size="small"
-                  filterable
-                  default-first-option
-                  placeholder="请选择二字码"
-                >
-                  <el-option
-                    v-for="(item, index) in characterList"
-                    :key="index"
-                    :label="item.k"
-                    :value="item.k"
-                  />
-                </el-select>
-              </div>
-            </el-col>
-            <el-col :span="6">
-              <div class="aviName" style="margin-left: 20px">
-                <span class="aviP">起飞机场</span>
-                <el-select
-                  v-model="tableFormer.departmentAirport"
-                  class="input-shadow"
-                  size="small"
-                  filterable
-                  default-first-option
-                  placeholder="请选择机场"
-                >
-                  <el-option
-                    v-for="(item, index) in AirportList"
-                    :key="index"
-                    :label="item.planDepartureApt"
-                    :value="item.planDepartureApt"
-                  />
-                </el-select>
-              </div>
-            </el-col>
-            <el-col :span="6">
-              <div class="aviName" style="margin-left: 20px">
-                <span class="aviP">降落机场</span>
-                <el-select
-                  v-model="tableFormer.landingAirport"
-                  class="input-shadow"
-                  size="small"
-                  filterable
-                  default-first-option
-                  placeholder="请选择机场"
-                >
-                  <el-option
-                    v-for="(item, index) in AirportList"
-                    :key="index"
-                    :label="item.planDepartureApt"
-                    :value="item.planDepartureApt"
-                  />
-                </el-select>
-              </div>
-            </el-col>
-            <el-col :span="6">
-              <div class="digName4">
-                <div class="aviP1">航班号</div>
-                <el-input
-                  placeholder="请输入航班号"
-                  v-model="tableFormer.flightNo"
-                ></el-input>
-              </div>
-            </el-col>
-            <el-col :span="6">
-              <div class="digName1">
-                <div class="aviName1">
-                  <div class="aviP2">起飞时间</div>
-                  <el-date-picker
-                    value-format="yyyy-MM-dd HH:mm:ss"
-                    v-model="tableFormer.startDate"
-                    :rows="1"
-                    type="datetime"
-                    placeholder="选择日期时间"
-                    @change="inputChangeHandler(item.columnName)"
-                  >
-                  </el-date-picker>
-                </div>
-              </div>
-            </el-col>
-            <el-col :span="6">
-              <div class="aviName1">
-                <div class="aviP5">降落时间</div>
-                <el-date-picker
-                  value-format="yyyy-MM-dd HH:mm:ss"
-                  v-model="tableFormer.endDate"
-                  :rows="1"
-                  type="datetime"
-                  placeholder="选择日期时间"
-                  @change="inputChangeHandler(item.columnName)"
-                >
-                </el-date-picker>
-              </div>
-            </el-col>
-          </el-row> -->
       </div>
     </div>
 
     <div class="centerBox">
-      <Search
+      <!-- <Search
         title="报警预警策略"
         :isSearch="false"
         :isSlot="false"
@@ -193,14 +88,28 @@
         @clearSearchData="clearSearchData"
         @getSearchData="getSearchData"
         style="padding-left: 16px; padding-right: 32px"
-      />
-
-      <div class="LBox">
-        <!-- <div @click="addDig" class="lbox-add r24">
-          <div class="terminal-info-add-icons">
-            <span class="icon el-icon-plus"></span>
+      /> -->
+      <DataTable
+        :data-id="dataId"
+        :rows="12"
+        labelWidth="100px"
+        :minHeight="70"
+        width="800px"
+        :isStatuser="true"
+        :isAuth="true"
+        authAdd="ss_aim_add"
+        authEdit="ss_aim_cardEdit"
+        authDel="ss_aim_cardDelete"
+        tableHeight="610"
+        :tableup="true"
+      >
+        <template v-slot:header>
+          <div class="status flex-wrap">
+            <div class="manageTitle">报警预警策略</div>
           </div>
-        </div> -->
+        </template>
+      </DataTable>
+      <!-- <div class="LBox">
         <el-row :gutter="24" @scroll="scrollEvent">
           <el-col :span="4">
             <div @click="addDig" class="lbox-add">
@@ -212,9 +121,6 @@
           <el-col :span="4" v-for="(item, index) in infoArr" :key="index">
             <div class="headerBoxs">
               <div class="tltle-head">
-                <!-- <div class="title flower">
-                  {{ item.name }}
-                </div> -->
                 <el-tooltip
                   effect="dark"
                   :content="item.StrategyName"
@@ -241,23 +147,7 @@
             </div>
           </el-col>
         </el-row>
-        <!-- <div
-          v-for="(item, index) in infoArr"
-          @click="infoIndex(item, index)"
-          :key="index"
-          class="forBox"
-        >
-          <div class="name">{{ item.name }}</div>
-          <div class="edit right">
-            <span @click.stop="editInfo(item)" class="round">
-              <div class="edit_log" style="margin-left: 0"></div>
-            </span>
-          </div>
-          <div @click.stop="delBox(item)" class="close">
-            <i class="el-icon-close"></i>
-          </div>
-        </div> -->
-      </div>
+      </div> -->
     </div>
 
     <!--删除弹框-->
@@ -285,61 +175,8 @@
         </div>
       </div>
     </Dialog>
-    <!-- 新增 -->
-    <!-- <div class="EditDig">
-      <el-dialog @close="closeForm" :visible.sync="editFalg" :title="posType === 1 ? '新增报警预警策略' : '编辑报警预警策略'">
-        <el-form ref="form" :model="form" label-width="80px">
-          <div class="itemBox">
-            <el-form-item label="名称">
-              <el-input @input="changeValue" v-model="form.name" placeholder="请输入名称"></el-input>
-            </el-form-item>
-            <el-form-item label="策略类型">
-              <el-select v-model="region" placeholder="请选择航司">
-                <el-option v-for="(item, index) in regform" :key="index" :label="item.name" :value="item.id"></el-option>
-              </el-select>
-            </el-form-item>
-          </div>
-          <div class="itemBox">
-            <el-form-item label="预警时长">
-              <el-input @input="changeValue1" v-model="form.WarningDur" placeholder="请输入预警时长(分)"></el-input>
-            </el-form-item>
-            <el-form-item label="报警时长">
-              <el-input @input="changeValue2" v-model="form.alamDur" placeholder="请输入报警时长(分)"></el-input>
-            </el-form-item>
-          </div>
-          <div class="itemBox">
-            <el-form-item label="开始节点">
-              <el-select v-model="form.StartNode" placeholder="请选择开始节点">
-                <el-option v-for="(item, index) in traceList" :key="index" :label="item.nodeName" :value="item.id"></el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="开始位置">
-              <el-select v-model="form.StartPosition" placeholder="请选择开始位置">
-                <el-option v-for="(item, index) in StartPositionList" :key="index" :label="item.remarkCn" :value="item.id"></el-option>
-              </el-select>
-            </el-form-item>
-          </div>
-          <div class="itemBox">
-            <el-form-item label="结束节点">
-              <el-select v-model="form.EndNode" placeholder="请选择结束节点">
-                <el-option v-for="(item, index) in traceList" :key="index" :label="item.nodeName" :value="item.id"></el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="结束位置">
-              <el-select v-model="form.StartPosition" placeholder="请选择结束位置">
-                <el-option v-for="(item, index) in endPositionList" :key="index" :label="item.remarkCn" :value="item.id"></el-option>
-              </el-select>
-            </el-form-item>
-          </div>
-        </el-form>
-        <span slot="footer" class="dialog-footer">
-          <el-button type="primary" class="r25 r26" @click="submit">提 交</el-button>
-          <el-button @click="close" class="r26" style="margin-left: 12px">取 消</el-button>
-        </span>
-      </el-dialog>
-    </div> -->
     <!--新增/编辑-->
-    <Dialog :width="width" :flag="flag">
+    <!-- <Dialog :width="width" :flag="true">
       <div class="dialog-content">
         <div class="title">{{ tableTitle }}</div>
         <div class="contents">
@@ -408,7 +245,7 @@
           <el-button @click="flag = false" size="medium">取消</el-button>
         </div>
       </div>
-    </Dialog>
+    </Dialog> -->
   </div>
 </template>
 
@@ -417,6 +254,7 @@ import Dialog from "@/layout/components/Dialog/index.vue";
 import Search from "@/layout/components/Search/index.vue";
 import { Query, GeneralDataReception } from "@/api/dataIntegration";
 import { getQuery } from "@/api/flight";
+import DataTable from "@/components/Table";
 import {
   AddWarning,
   AirlinesInquiry,
@@ -428,9 +266,11 @@ import {
   Alarmlocation,
 } from "@/api/SystemSettings.js";
 export default {
-  components: { Dialog, Search },
+  components: { Dialog, Search, DataTable },
   data() {
     return {
+      viShow: false,
+      dataId: DATACONTENT_ID.sysServiceStrategyId,
       optionProps: {
         value: "inAicompanyCode2",
         label: "inAicompanyCode2",
@@ -450,14 +290,7 @@ export default {
       // code3: this.$route.query.departureAirport,
       // code4: this.$route.query.ladingAirport,
       flag: false,
-      tableFormer: {
-        alarmSceneId: "",
-        IATACode: "",
-        departmentAirport: "",
-        landingAirport: "",
-        flightNo: "",
-        BeginTime1: [],
-      },
+      tableFormer: {},
       aircompeny: [],
       infoArr: [], //报警预警策略列表
       posType: 1,
@@ -533,6 +366,7 @@ export default {
       labelWidth: "110px",
       dataContent: [],
       tableCols: [],
+      tableColser: [],
       tableColsCopy: [],
       tableColsCopys: [],
       tableForm: {}, //弹框表单
@@ -548,20 +382,11 @@ export default {
       characterList: [], //二字码列表
       tableOptions: {},
       tableOptionser: {},
-      tableColser: [],
     };
   },
   created() {
-    this.getAirPortData();
-    this.getCharacterData();
     this.sysServiceWarn();
     this.UserWarning();
-    // this.getAirlines();
-    // this.getAirlist();
-    // this.UserWarning();
-    // this.tracenode();
-    // this.AlarmlocationList(this.code3, "1");
-    // this.AlarmlocationList(this.code4, "2");
   },
   watch: {
     code3() {
@@ -614,6 +439,9 @@ export default {
             }
             // this.filterValues[item.columnName] = ''
           });
+          setTimeout(() => {
+            this.viShow = true;
+          }, 300);
         } else {
           this.page--;
           this.$message.error.message;

+ 27 - 4
src/views/systemSettings/views/warningSet/warningSet.vue

@@ -10,7 +10,7 @@
 <template>
   <div class="airportInfo">
     <!--搜索-->
-    <div class="nodeLnformation_header">
+    <!-- <div class="nodeLnformation_header">
       <Search
         title="报警预警设置"
         @getSearchData="getSearchData"
@@ -52,7 +52,28 @@
           </div>
         </el-col>
       </el-row>
-      <!-- <img v-if="!warningArr.length" src="../../../assets/logo/nodata.png" /> -->
+    </div> -->
+    <div class="wrap">
+      <DataTable
+        :data-id="dataId"
+        :rows="12"
+        labelWidth="100px"
+        :minHeight="70"
+        width="800px"
+        :isStatuser="true"
+        :isAuth="true"
+        authAdd="ss_aim_add"
+        authEdit="ss_aim_cardEdit"
+        authDel="ss_aim_cardDelete"
+        tableHeight="660"
+        :tableup="true"
+      >
+        <template v-slot:header>
+          <div class="status flex-wrap">
+            <div class="manageTitle">报警预警设置</div>
+          </div>
+        </template>
+      </DataTable>
     </div>
     <!--新增/编辑-->
     <Dialog :width="width" :flag="flag">
@@ -230,6 +251,7 @@ import {
 } from "@/api/SystemSettings.js";
 import Dialog from "@/layout/components/Dialog/index.vue";
 import { getQuery } from "@/api/flight";
+import DataTable from "@/components/Table";
 import {
   Query,
   GeneralDataReception,
@@ -238,9 +260,10 @@ import {
 } from "@/api/dataIntegration";
 import { de } from "vis";
 export default {
-  components: { Search, Dialog },
+  components: { Search, Dialog, DataTable },
   data() {
     return {
+      dataId: DATACONTENT_ID.sysServiceWarningId,
       flag: false,
       EditDialogVisible: false,
       name: "",
@@ -323,7 +346,7 @@ export default {
     };
   },
   created() {
-    this.getWarningList();
+    // this.getWarningList();
     // this.getAirlines();
     // this.getAirlist();
   },