chenrui  преди 1 година
родител
ревизия
80465ab963

+ 37 - 6
public/config.js

@@ -5,7 +5,7 @@ var LOOP_INTERVAL = {
   waybill: 15 * 1000,
   goods: 15 * 1000,
   dashboard: 15 * 1000,
-}
+};
 
 var NEW_DATACONTENT_ID = [
   51000,
@@ -89,6 +89,7 @@ var NEW_DATACONTENT_ID = [
   18,
   131, //登录策略管理
   132, //账号登录策略授权
+  134,
   54001,
   54002,
   54003,
@@ -141,12 +142,13 @@ var NEW_DATACONTENT_ID = [
   52243,
   52244,
   51063,
-  50501
-]
+  50501,
+];
 
 var DATACONTENT_ID = {
   /***-----登录------***/
   loginId: 36, //登录-获取权限-id
+  allId: 134,
 
   /***-----驾驶舱------***/
   jscHourlyPeakId: 51017, //国内出港-小时峰值分布-id
@@ -488,7 +490,7 @@ var DATACONTENT_ID = {
   detailGnArrivalWay: 52240, //数据异常统计-航班节点明细统计-国内进港
   detailGjDepartureWay: 52242, //数据异常统计-航班节点明细统计-国际离港
   detailGjArrivalWay: 52244, //数据异常统计-航班节点明细统计-国际进港
-}
+};
 
 var SERVICE_ID = {
   /***-----账号管理------***/
@@ -529,5 +531,34 @@ var SERVICE_ID = {
 
   /***-----离港管理------***/
   departureScId: 8011, //发送报警预警日志信息
-}
-var NEW_SERVICE_ID = [55001, 65015, 65024, 65002, 65026, 65060, 65061, 65001, 65005, 65008, 65004, 65007, 65009, 65010, 65011, 65013, 65014, 65024, 64015, 65016, 65017, 65018, 65019, 65020, 65021, 10131, 10132, 10133];
+};
+var NEW_SERVICE_ID = [
+  55001,
+  65015,
+  65024,
+  65002,
+  65026,
+  65060,
+  65061,
+  65001,
+  65005,
+  65008,
+  65004,
+  65007,
+  65009,
+  65010,
+  65011,
+  65013,
+  65014,
+  65024,
+  64015,
+  65016,
+  65017,
+  65018,
+  65019,
+  65020,
+  65021,
+  10131,
+  10132,
+  10133,
+];

+ 234 - 199
src/components/SimpleTable/index.vue

@@ -33,13 +33,13 @@
           :sortable="!!column.needSort"
           filter-style="arrow"
           @update:filter-values="
-            filterValues => {
-              filterValuesChangeHandler(column.columnName, filterValues)
+            (filterValues) => {
+              filterValuesChangeHandler(column.columnName, filterValues);
             }
           "
           @update:sort-rule="
-            sortRule => {
-              sortRuleChangeHandler(column.columnName, sortRule)
+            (sortRule) => {
+              sortRuleChangeHandler(column.columnName, sortRule);
             }
           "
         />
@@ -52,246 +52,279 @@
 </template>
 
 <script setup lang="ts">
-import TableHeaderCell from '@/components/TableHeaderCell/index.vue'
-import type { CSSProperties, VNode } from 'vue'
-import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'
-import { CommonData, CommonTableColumn } from '~/common'
-import { Options, useTableFilterAndSort } from '@/hooks/useTableFilterAndSort'
-import { ElTable } from 'element-plus'
-import { useTableSettingsStore } from '@/store/tableSettings'
-
+import TableHeaderCell from "@/components/TableHeaderCell/index.vue";
+import type { CSSProperties, VNode } from "vue";
+import { TableColumnCtx } from "element-plus/es/components/table/src/table-column/defaults";
+import { CommonData, CommonTableColumn } from "~/common";
+import { Options, useTableFilterAndSort } from "@/hooks/useTableFilterAndSort";
+import { ElTable } from "element-plus";
+import { useTableSettingsStore } from "@/store/tableSettings";
+import { Query } from "@/api/webApi";
+const dataContent = ref({});
+const conditon = ref("");
 type SummaryMethod<T> = (data: {
-  columns: TableColumnCtx<T>[]
-  data: T[]
-}) => string[]
-type ColumnCls<T> = string | ((data: { row: T; rowIndex: number }) => string)
+  columns: TableColumnCtx<T>[];
+  data: T[];
+}) => string[];
+type ColumnCls<T> = string | ((data: { row: T; rowIndex: number }) => string);
 type ColumnStyle<T> =
   | CSSProperties
-  | ((data: { row: T; rowIndex: number }) => CSSProperties)
+  | ((data: { row: T; rowIndex: number }) => CSSProperties);
 type CellCls<T> =
   | string
   | ((data: {
-      row: T
-      rowIndex: number
-      column: TableColumnCtx<T>
-      columnIndex: number
-    }) => string)
+      row: T;
+      rowIndex: number;
+      column: TableColumnCtx<T>;
+      columnIndex: number;
+    }) => string);
 type CellStyle<T> =
   | CSSProperties
   | ((data: {
-      row: T
-      rowIndex: number
-      column: TableColumnCtx<T>
-      columnIndex: number
-    }) => CSSProperties)
+      row: T;
+      rowIndex: number;
+      column: TableColumnCtx<T>;
+      columnIndex: number;
+    }) => CSSProperties);
 type Sort = {
-  prop: string
-  order: 'ascending' | 'descending'
-  init?: any
-  silent?: any
-}
+  prop: string;
+  order: "ascending" | "descending";
+  init?: any;
+  silent?: any;
+};
 type TreeNode = {
-  expanded?: boolean
-  loading?: boolean
-  noLazyChildren?: boolean
-  indent?: number
-  level?: number
-  display?: boolean
-}
-type Layout = 'fixed' | 'auto'
+  expanded?: boolean;
+  loading?: boolean;
+  noLazyChildren?: boolean;
+  indent?: number;
+  level?: number;
+  display?: boolean;
+};
+type Layout = "fixed" | "auto";
 type TableColumnProps<T> = {
-  type?: string
-  index?: number | ((index: number) => number)
-  columnKey?: string
-  width?: string | number
-  minWidth?: string | number
-  fixed?: boolean | string
-  renderHeader?: (data: { column: TableColumnCtx<T>; $index: number }) => VNode
-  resizable?: boolean
+  type?: string;
+  index?: number | ((index: number) => number);
+  columnKey?: string;
+  width?: string | number;
+  minWidth?: string | number;
+  fixed?: boolean | string;
+  renderHeader?: (data: { column: TableColumnCtx<T>; $index: number }) => VNode;
+  resizable?: boolean;
   formatter?: (
     row: T,
     column: TableColumnCtx<T>,
     cellValue: any,
     index: number
-  ) => VNode | string
-  showOverflowTooltip?: boolean
-  align?: string
-  headerAlign?: string
-  className?: string
-  labelClassName?: string
-  selectable?: (row: T, index: number) => boolean
-  reserveSelection?: boolean
-}
+  ) => VNode | string;
+  showOverflowTooltip?: boolean;
+  align?: string;
+  headerAlign?: string;
+  className?: string;
+  labelClassName?: string;
+  selectable?: (row: T, index: number) => boolean;
+  reserveSelection?: boolean;
+};
 
 const props = withDefaults(
   defineProps<{
-    data: CommonData[]
-    size?: string
-    width?: string | number
-    height?: string | number
-    maxHeight?: string | number
-    fit?: boolean
-    stripe?: boolean
-    border?: boolean
-    rowKey?: string | ((row: CommonData) => string)
-    showHeader?: boolean
-    showSummary?: boolean
-    sumText?: string
-    summaryMethod?: SummaryMethod<CommonData>
-    rowClassName?: ColumnCls<CommonData>
-    rowStyle?: ColumnStyle<CommonData>
-    cellClassName?: CellCls<CommonData>
-    cellStyle?: CellStyle<CommonData>
-    headerRowClassName?: ColumnCls<CommonData>
-    headerRowStyle?: ColumnStyle<CommonData>
-    headerCellClassName?: CellCls<CommonData>
-    headerCellStyle?: CellStyle<CommonData>
-    highlightCurrentRow?: boolean
-    currentRowKey?: string | number
-    emptyText?: string
-    expandRowKeys?: any[]
-    defaultExpandAll?: boolean
-    defaultSort?: Sort
-    tooltipEffect?: string
+    data: CommonData[];
+    size?: string;
+    width?: string | number;
+    height?: string | number;
+    maxHeight?: string | number;
+    fit?: boolean;
+    stripe?: boolean;
+    border?: boolean;
+    rowKey?: string | ((row: CommonData) => string);
+    showHeader?: boolean;
+    showSummary?: boolean;
+    sumText?: string;
+    summaryMethod?: SummaryMethod<CommonData>;
+    rowClassName?: ColumnCls<CommonData>;
+    rowStyle?: ColumnStyle<CommonData>;
+    cellClassName?: CellCls<CommonData>;
+    cellStyle?: CellStyle<CommonData>;
+    headerRowClassName?: ColumnCls<CommonData>;
+    headerRowStyle?: ColumnStyle<CommonData>;
+    headerCellClassName?: CellCls<CommonData>;
+    headerCellStyle?: CellStyle<CommonData>;
+    highlightCurrentRow?: boolean;
+    currentRowKey?: string | number;
+    emptyText?: string;
+    expandRowKeys?: any[];
+    defaultExpandAll?: boolean;
+    defaultSort?: Sort;
+    tooltipEffect?: string;
     spanMethod?: (data: {
-      row: CommonData
-      rowIndex: number
-      column: TableColumnCtx<CommonData>
-      columnIndex: number
+      row: CommonData;
+      rowIndex: number;
+      column: TableColumnCtx<CommonData>;
+      columnIndex: number;
     }) =>
       | number[]
       | {
-          rowspan: number
-          colspan: number
+          rowspan: number;
+          colspan: number;
         }
-      | undefined
-    selectOnIndeterminate?: boolean
-    indent?: number
+      | undefined;
+    selectOnIndeterminate?: boolean;
+    indent?: number;
     treeProps?: {
-      hasChildren?: string
-      children?: string
-    }
-    lazy?: boolean
+      hasChildren?: string;
+      children?: string;
+    };
+    lazy?: boolean;
     load?: (
       row: CommonData,
       treeNode: TreeNode,
       resolve: (data: CommonData[]) => void
-    ) => void
-    className?: string
-    style?: CSSProperties
-    tableLayout?: Layout
-    flexible?: boolean
-    scrollbarAlwaysOn?: boolean
+    ) => void;
+    className?: string;
+    style?: CSSProperties;
+    tableLayout?: Layout;
+    flexible?: boolean;
+    scrollbarAlwaysOn?: boolean;
     // 上面是el-table原生属性,下面是自定义属性
-    columnProps?: TableColumnProps<CommonData>
-    columns: (CommonTableColumn & TableColumnProps<CommonData>)[]
-    sequence?: boolean
-    customSequence?: boolean
-    filterSortOptions?: Options
-    cacheKeys?: string[]
-    labelFormatter?: (label: string) => string
+    columnProps?: TableColumnProps<CommonData>;
+    columns: (CommonTableColumn & TableColumnProps<CommonData>)[];
+    sequence?: boolean;
+    customSequence?: boolean;
+    filterSortOptions?: Options;
+    cacheKeys?: string[];
+    labelFormatter?: (label: string) => string;
   }>(),
   {
-    size: 'default',
-    height: '100%',
-    maxHeight: '100%',
+    size: "default",
+    height: "100%",
+    maxHeight: "100%",
     stripe: true,
     border: true,
     fit: true,
     showHeader: true,
     labelFormatter: (label: string) => label,
   }
-)
+);
 
 const defaultSummaryMethod: SummaryMethod<CommonData> = ({ columns, data }) => {
-  const sums: string[] = []
+  const sums: string[] = [];
   columns.forEach((column, index) => {
     const countColumn = tableColumns.value.find(
-      col => column.property === col.columnName && col.needCount
-    )
+      (col) => column.property === col.columnName && col.needCount
+    );
     if (countColumn) {
       const sumNumber = data.reduce((prev: number, curr: CommonData) => {
-        const cellData = curr[column.property]
-        if (countColumn.countMode === 'all') {
-          return prev + 1
+        const cellData = curr[column.property];
+        if (countColumn.countMode === "all") {
+          return prev + 1;
         }
-        if (countColumn.countMode === 'notNull') {
-          return cellData ? prev + 1 : prev
+        if (countColumn.countMode === "notNull") {
+          return cellData ? prev + 1 : prev;
         }
-        const value = Number(cellData)
+        const value = Number(cellData);
         if (!Number.isNaN(value)) {
-          prev += value
+          prev += value;
         }
-        return prev
-      }, 0)
-      sums[index] = sumNumber.toString()
+        return prev;
+      }, 0);
+      sums[index] = sumNumber.toString();
     }
-  })
-  sums[0] = '合计:' + (sums[0] ?? '')
-  return sums
-}
+  });
+  sums[0] = "合计:" + (sums[0] ?? "");
+  return sums;
+};
 
 const tableProps = computed(() => {
-  const rawProps = toRaw(props)
-  const result: { [x: string]: any } = {}
+  const rawProps = toRaw(props);
+  const result: { [x: string]: any } = {};
   Object.entries(rawProps).forEach(([key, value]) => {
     if (
       ![
-        'columnProps',
-        'columns',
-        'sequence',
-        'customSequence',
-        'filterSortOptions',
-        'cacheKeys',
-        'labelFormatter',
+        "columnProps",
+        "columns",
+        "sequence",
+        "customSequence",
+        "filterSortOptions",
+        "cacheKeys",
+        "labelFormatter",
       ].includes(key) &&
-      (value ?? '') !== ''
+      (value ?? "") !== ""
     ) {
-      result[key] = value
+      result[key] = value;
     }
-    if (props.columns.some(column => column.needCount)) {
-      result.showSummary = true
+    if (props.columns.some((column) => column.needCount)) {
+      result.showSummary = true;
     }
     if (!result.summaryMethod) {
-      result.summaryMethod = defaultSummaryMethod
+      result.summaryMethod = defaultSummaryMethod;
     }
-  })
-  return result
-})
+  });
+  return result;
+});
 
 const computedColumnProps = computed(() => {
   const defaultColumnProps: TableColumnProps<CommonData> = {
-    align: 'center',
-  }
+    align: "center",
+  };
   return (column: CommonTableColumn & TableColumnProps<CommonData>) => ({
     ...defaultColumnProps,
     ...props.columnProps,
     ...column,
-  })
-})
-
-const tableColumns = ref<CommonTableColumn[]>([])
-const tableData = ref<CommonData[]>([])
+  });
+});
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+};
+gueryRoles();
+const tableColumns = ref<CommonTableColumn[]>([]);
+const tableData = ref<CommonData[]>([]);
 watchEffect(() => {
-  tableColumns.value = props.columns.reduce(
-    (prevColumns: CommonTableColumn[], column) => {
-      if (!column.hidden) {
-        prevColumns.push({
-          label: column.columnLabel,
-          prop: column.columnName,
-          ...column,
-        })
-      }
-      return prevColumns
-    },
-    []
-  )
-  tableData.value = props.data
-})
+  tableColumns.value = [];
+  if (conditon.value == null) {
+    tableColumns.value = props.columns.reduce(
+      (prevColumns: CommonTableColumn[], column) => {
+        if (!column.hidden) {
+          prevColumns.push({
+            label: column.columnLabel,
+            prop: column.columnName,
+            ...column,
+          });
+        }
+        return prevColumns;
+      },
+      []
+    );
+  } else {
+    let arr = props.columns.reduce(
+      (prevColumns: CommonTableColumn[], column) => {
+        if (!column.hidden) {
+          prevColumns.push({
+            label: column.columnLabel,
+            prop: column.columnName,
+            ...column,
+          });
+        }
+        return prevColumns;
+      },
+      []
+    );
+    conditon.value.split(",").forEach((element) => {
+      arr.forEach((res) => {
+        if (element === res.columnName) {
+          tableColumns.value.push(res);
+        }
+      });
+    });
+  }
+  tableData.value = props.data;
+});
 
 const hasFixedColumn = computed(() =>
-  tableColumns.value.some(column => column.fixed)
-)
+  tableColumns.value.some((column) => column.fixed)
+);
 
 const {
   filterOptionMap,
@@ -299,49 +332,51 @@ const {
   sortRuleMap,
   dealedTableData,
   sortChangeHandler,
-} = useTableFilterAndSort(tableColumns, tableData, props.filterSortOptions)
-
-const { saveTableFilterValues } = useTableSettingsStore()
+} = useTableFilterAndSort(tableColumns, tableData, props.filterSortOptions);
+const { saveTableFilterValues } = useTableSettingsStore();
 
 watch(
   sortRuleMap,
-  map => {
-    emit('sortRuleChange', map)
+  (map) => {
+    emit("sortRuleChange", map);
   },
   { deep: true }
-)
+);
 
 const sortRuleChangeHandler = (columnName: string, sortRule: string) => {
-  sortRuleMap[columnName] = sortRule
-  sortChangeHandler(columnName, sortRule)
-}
+  sortRuleMap[columnName] = sortRule;
+  sortChangeHandler(columnName, sortRule);
+};
 
-const filterValuesChangeHandler = (columnName: string, filterValues: string[]) => {
-  filterValueMap[columnName] = filterValues
-  emit('filterChange', filterValues)
-}
+const filterValuesChangeHandler = (
+  columnName: string,
+  filterValues: string[]
+) => {
+  filterValueMap[columnName] = filterValues;
+  emit("filterChange", filterValues);
+};
 
 if (props.cacheKeys?.length) {
-  watch(filterValueMap, map => {
-    const values: { [x: string]: string[] } = {}
-    props.cacheKeys!.forEach(columnName => {
-      values[columnName] = map[columnName]
-    })
-    saveTableFilterValues(values)
-  })
+  watch(filterValueMap, (map) => {
+    const values: { [x: string]: string[] } = {};
+    props.cacheKeys!.forEach((columnName) => {
+      values[columnName] = map[columnName];
+    });
+    saveTableFilterValues(values);
+  });
 }
 
 // 组件的inheritAttrs属性默认为true,此时组件上的属性(包括v-on)会被添加到根元素上
-const emit = defineEmits(['filterChange', 'sortRuleChange', 'scrollOver'])
+const emit = defineEmits(["filterChange", "sortRuleChange", "scrollOver"]);
 
 const scrollOver = () => {
-  emit('scrollOver')
-}
+  emit("scrollOver");
+};
 
-const table = ref<InstanceType<typeof ElTable> | null>(null)
+const table = ref<InstanceType<typeof ElTable> | null>(null);
 defineExpose({
   table,
-})
+});
 </script>
 
 <style scoped lang="scss">
@@ -352,7 +387,7 @@ defineExpose({
     &.cell-filter {
       position: relative;
       &::before {
-        content: '';
+        content: "";
         position: absolute;
         width: 100%;
         height: 100%;

+ 128 - 22
src/views/BasicsData/airlineCompany/index.vue

@@ -1,7 +1,12 @@
 <template>
   <div class="airportInfo scroll-y">
     <div class="wrap">
-      <Minheader :is-auth="true" :is-statuser="true" powerData="new_airlines_button" @addForm="addForm">
+      <Minheader
+        :is-auth="true"
+        :is-statuser="true"
+        powerData="new_airlines_button"
+        @addForm="addForm"
+      >
         <template #header>
           <div class="status flex-wrap">
             <div class="manageTitle">航司信息维护</div>
@@ -9,50 +14,129 @@
         </template>
       </Minheader>
       <div class="app-containers">
-        <DataTable :tableHeader="tableCols" :tableData="tableData" :tableBtnGroup="tableBtnGroup" :tableProperty="{ rowKey: 'ID' }" @btnClick="btnClick" />
+        <DataTable
+          :tableHeader="tableCols"
+          :tableData="tableData"
+          :tableBtnGroup="tableBtnGroup"
+          :tableProperty="{ rowKey: 'ID' }"
+          @btnClick="btnClick"
+        />
       </div>
-      <Dialog :flag="flag" :type="type" :msgTitle="msgTitle" :delName="tableForm.fullName" @resetForm="resetForm" @delRest="delRest" @submitForm="submitForm" @delRemove="delRemove">
+      <Dialog
+        :flag="flag"
+        :type="type"
+        :msgTitle="msgTitle"
+        :delName="tableForm.fullName"
+        @resetForm="resetForm"
+        @delRest="delRest"
+        @submitForm="submitForm"
+        @delRemove="delRemove"
+      >
         <div class="diacont">
-          <el-form :model="tableForm" :rules="formRules" ref="airlineCompanyForm">
+          <el-form
+            :model="tableForm"
+            :rules="formRules"
+            ref="airlineCompanyForm"
+          >
             <el-row :gutter="24">
               <el-col>
-                <el-form-item label="航司ID" size="default" prop="airlineCompanyID" :rules="formRules.isNotNull">
-                  <el-input v-model="tableForm.airlineCompanyID" placeholder="请输入航司ID" />
+                <el-form-item
+                  label="航司ID"
+                  size="default"
+                  prop="airlineCompanyID"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-input
+                    v-model="tableForm.airlineCompanyID"
+                    placeholder="请输入航司ID"
+                  />
                 </el-form-item>
               </el-col>
               <el-col>
-                <el-form-item label="中文名称" size="default" prop="fullName" :rules="formRules.isNotNull">
-                  <el-input v-model="tableForm.fullName" placeholder="请输入中文名称" />
+                <el-form-item
+                  label="中文名称"
+                  size="default"
+                  prop="fullName"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-input
+                    v-model="tableForm.fullName"
+                    placeholder="请输入中文名称"
+                  />
                 </el-form-item>
               </el-col>
               <el-col>
-                <el-form-item label="中文简称" size="default" prop="abbreviation" :rules="formRules.isNotNull">
-                  <el-input v-model="tableForm.abbreviation" placeholder="请输入中文简称" />
+                <el-form-item
+                  label="中文简称"
+                  size="default"
+                  prop="abbreviation"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-input
+                    v-model="tableForm.abbreviation"
+                    placeholder="请输入中文简称"
+                  />
                 </el-form-item>
               </el-col>
               <el-col>
-                <el-form-item label="英文全称" size="default" prop="englishFullName" :rules="formRules.isNotNull">
-                  <el-input v-model="tableForm.englishFullName" placeholder="请输入英文全称" />
+                <el-form-item
+                  label="英文全称"
+                  size="default"
+                  prop="englishFullName"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-input
+                    v-model="tableForm.englishFullName"
+                    placeholder="请输入英文全称"
+                  />
                 </el-form-item>
               </el-col>
               <el-col>
-                <el-form-item label="英文简称" prop="englishAbbreviation" size="default" :rules="formRules.isNotNull">
-                  <el-input v-model="tableForm.englishAbbreviation" placeholder="请输入英文简称" />
+                <el-form-item
+                  label="英文简称"
+                  prop="englishAbbreviation"
+                  size="default"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-input
+                    v-model="tableForm.englishAbbreviation"
+                    placeholder="请输入英文简称"
+                  />
                 </el-form-item>
               </el-col>
               <el-col>
-                <el-form-item label="航司二字码" size="default" prop="ITATCode" :rules="formRules.isNotNull">
-                  <el-input v-model="tableForm.ITATCode" placeholder="请输入航司二字码" />
+                <el-form-item
+                  label="航司二字码"
+                  size="default"
+                  prop="ITATCode"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-input
+                    v-model="tableForm.ITATCode"
+                    placeholder="请输入航司二字码"
+                  />
                 </el-form-item>
               </el-col>
               <el-col>
-                <el-form-item label="航司三字码" size="default" prop="ICAOCode" :rules="formRules.isNotNull">
-                  <el-input v-model="tableForm.ICAOCode" placeholder="请输入航司三字码" />
+                <el-form-item
+                  label="航司三字码"
+                  size="default"
+                  prop="ICAOCode"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-input
+                    v-model="tableForm.ICAOCode"
+                    placeholder="请输入航司三字码"
+                  />
                 </el-form-item>
               </el-col>
               <el-col>
                 <el-form-item label="备注" size="default">
-                  <el-input type="textarea" v-model="tableForm.remarks" placeholder="请输入备注" />
+                  <el-input
+                    type="textarea"
+                    v-model="tableForm.remarks"
+                    placeholder="请输入备注"
+                  />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -79,6 +163,7 @@ const serviceId = ref<number | null>(null);
 const tableObj = ref({}); //增删改数据缓存
 const flag = ref(false); //弹窗开关
 const type = ref(""); //判断是否删除
+const conditon = ref("");
 const msgTitle = ref("新增航司信息维护"); //弹窗标题
 const tableForm = reactive({
   fullName: "",
@@ -175,6 +260,15 @@ const delRemove = () => {
 const delRest = () => {
   flag.value = false;
 };
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+  getQuery();
+};
 //获取表格数据
 const getQuery = async () => {
   try {
@@ -195,7 +289,19 @@ const getQuery = async () => {
         rowTitle.value = titleColumn.columnName;
       }
       tableData.value.push(...returnData.listValues);
-      tableCols.value = returnData.columnSet;
+      tableCols.value = [];
+      if (conditon.value == null) {
+        tableCols.value = returnData.columnSet;
+      } else {
+        tableCols.value = [];
+        conditon.value.split(",").forEach((element) => {
+          returnData.columnSet.forEach((res) => {
+            if (element === res.columnName) {
+              tableCols.value.push(res);
+            }
+          });
+        });
+      }
       tableCols.value.forEach((element) => {
         element.label = element.columnLabel;
         element.key = element.columnName;
@@ -249,7 +355,7 @@ const generalDataReception = async (data) => {
       ElMessage.success(`操作成功`);
       // this.$message.success("操作成功");
       resetTable();
-      getQuery();
+      gueryRoles();
       resetForm();
       flag.value = false;
       // rmFlag.value = false;
@@ -271,7 +377,7 @@ const generalDataReception = async (data) => {
   }
 };
 onMounted(() => {
-  getQuery();
+  gueryRoles();
 });
 </script>
 <style lang="scss" scoped>

+ 27 - 4
src/views/BasicsData/airportCompany/index.vue

@@ -152,6 +152,7 @@ const msgTitle = ref<string>("新增机场公司维护"); //弹窗标题
 const tableOptionser = ref<any>([]); //弹窗下拉
 const tableOptionCopys = ref<any>([]); //弹窗下拉
 const tableColsCopys = reactive([]); //弹窗
+const conditon = ref("");
 const tableForm = reactive<any>({
   companyName: "",
   parentID: "",
@@ -185,11 +186,12 @@ const state = reactive({
   listLoading: true,
 });
 const searchForms = (val) => {
+  gueryRoles();
   getQuery(val);
 };
 
 const clearForm = () => {
-  getQuery();
+  gueryRoles();
 };
 //新增
 const addForm = () => {
@@ -263,6 +265,15 @@ const getSelectData = async (id?, name?) => {
     tableOptionser.value = [];
   }
 };
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+  getQuery();
+};
 //获取表格数据
 const getQuery = async (val = "") => {
   try {
@@ -283,12 +294,24 @@ const getQuery = async (val = "") => {
         rowTitle.value = titleColumn.columnName;
       }
       tableData.value = [...returnData.listValues];
-      tableCols.value = returnData.columnSet;
       returnData.columnSet.forEach((item) => {
         if (item.listqueryTemplateID && item.columnName === "parentID") {
           getSelectData(item.listqueryTemplateID);
         }
       });
+      tableCols.value = [];
+      if (conditon.value == null) {
+        tableCols.value = returnData.columnSet;
+      } else {
+        tableCols.value = [];
+        conditon.value.split(",").forEach((element) => {
+          returnData.columnSet.forEach((res) => {
+            if (element === res.columnName) {
+              tableCols.value.push(res);
+            }
+          });
+        });
+      }
       tableCols.value.forEach((element) => {
         element.label = element.columnLabel;
         element.key = element.columnName;
@@ -333,7 +356,7 @@ const generalDataReception = async (data) => {
       ElMessage.success(`操作成功`);
       // this.$message.success("操作成功");
       resetTable();
-      getQuery();
+      gueryRoles();
       resetForm();
       flag.value = false;
       // rmFlag.value = false;
@@ -372,7 +395,7 @@ const delRemove = () => {
   tableForm.event = 3;
   generalDataReception(tableForm);
 };
-getQuery();
+gueryRoles();
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 25 - 3
src/views/BasicsData/airportInfo/index.vue

@@ -387,6 +387,7 @@ const state = reactive({
 });
 const company = ref("所属公司");
 const data = ref([]);
+const conditon = ref("");
 //新增
 const addForm = () => {
   // console.log(companyID.value);
@@ -485,6 +486,15 @@ const handleNodeClick = (data) => {
   companyID.value = data.companyID;
   tableData.value = [];
   page.value = 0;
+  gueryRoles();
+};
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
   getQuery();
 };
 //获取表格数据
@@ -512,7 +522,19 @@ const getQuery = async () => {
       } else {
         btnGroupWidth.value = "";
       }
-      tableCols.value = returnData.columnSet;
+      tableCols.value = [];
+      if (conditon.value == null) {
+        tableCols.value = returnData.columnSet;
+      } else {
+        tableCols.value = [];
+        conditon.value.split(",").forEach((element) => {
+          returnData.columnSet.forEach((res) => {
+            if (element === res.columnName) {
+              tableCols.value.push(res);
+            }
+          });
+        });
+      }
       tableCols.value.forEach((element) => {
         element.label = element.columnLabel;
         element.key = element.columnName;
@@ -546,7 +568,7 @@ const getAirlines = async () => {
       companyID.value = data.value[0].companyID;
       company.value = data.value[0].companyName;
       tableForm.companyName = data.value[0].companyName;
-      getQuery();
+      gueryRoles();
       // if (!company.length) {
       //   company.value = arr[0].companyID;
       //   company.value = arr[0].companyName;
@@ -588,7 +610,7 @@ const generalDataReception = async (data) => {
       ElMessage.success(`操作成功`);
       // this.$message.success("操作成功");
       resetTable();
-      getQuery();
+      gueryRoles();
       resetForm();
       flag.value = false;
       // rmFlag.value = false;

+ 27 - 4
src/views/BasicsData/cargoInformation/index.vue

@@ -127,6 +127,7 @@ const serviceId = ref<any>("");
 const tableObj = ref({}); //增删改数据缓存
 const flag = ref<boolean>(false); //弹窗开关
 const type = ref<string>(""); //判断是否删除
+const conditon = ref("");
 const msgTitle = ref<string>("新增货代管理"); //弹窗标题
 const tableColsCopys = reactive<Object>({}); //弹窗
 const tableForm = reactive<any>({
@@ -164,11 +165,12 @@ const tableBtnGroup = ref([
   },
 ]);
 const searchForms = (val) => {
+  gueryRoles();
   getQuery(val);
 };
 
 const clearForm = () => {
-  getQuery();
+  gueryRoles();
 };
 //新增
 const addForm = () => {
@@ -237,6 +239,15 @@ const btnClick = (row, index, param) => {
   } else if (param === 4) {
   }
 };
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+  getQuery();
+};
 //获取表格数据
 const getQuery = async (val = "") => {
   try {
@@ -262,7 +273,19 @@ const getQuery = async (val = "") => {
       } else {
         tableData.value.push(...returnData.listValues);
       }
-      tableCols.value = returnData.columnSet;
+      tableCols.value = [];
+      if (conditon.value == null) {
+        tableCols.value = returnData.columnSet;
+      } else {
+        tableCols.value = [];
+        conditon.value.split(",").forEach((element) => {
+          returnData.columnSet.forEach((res) => {
+            if (element === res.columnName) {
+              tableCols.value.push(res);
+            }
+          });
+        });
+      }
       tableCols.value.forEach((element) => {
         element.label = element.columnLabel;
         element.key = element.columnName;
@@ -316,7 +339,7 @@ const generalDataReception = async (data) => {
       ElMessage.success(`操作成功`);
       // this.$message.success("操作成功");
       resetTable();
-      getQuery();
+      gueryRoles();
       resetForm();
       flag.value = false;
       // rmFlag.value = false;
@@ -337,7 +360,7 @@ const generalDataReception = async (data) => {
     resetForm();
   }
 };
-getQuery();
+gueryRoles();
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 25 - 3
src/views/BasicsData/containerMaintenance/index.vue

@@ -127,6 +127,7 @@ const serviceId = ref<any>("");
 const tableObj = ref({}); //增删改数据缓存
 const flag = ref<boolean>(false); //弹窗开关
 const type = ref<string>(""); //判断是否删除
+const conditon = ref("");
 const msgTitle = ref<string>("新增容器维护"); //弹窗标题
 const tableColsCopys = reactive<Object>({}); //弹窗
 const tableForm = reactive<any>({
@@ -239,6 +240,15 @@ const btnClick = (row, index, param) => {
   } else if (param === 4) {
   }
 };
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+  getQuery();
+};
 //获取表格数据
 const getQuery = async (val = "") => {
   try {
@@ -259,7 +269,19 @@ const getQuery = async (val = "") => {
         rowTitle.value = titleColumn.columnName;
       }
       tableData.value = [...returnData.listValues];
-      tableCols.value = returnData.columnSet;
+      tableCols.value = [];
+      if (conditon.value == null) {
+        tableCols.value = returnData.columnSet;
+      } else {
+        tableCols.value = [];
+        conditon.value.split(",").forEach((element) => {
+          returnData.columnSet.forEach((res) => {
+            if (element === res.columnName) {
+              tableCols.value.push(res);
+            }
+          });
+        });
+      }
       tableCols.value.forEach((element) => {
         element.label = element.columnLabel;
         element.key = element.columnName;
@@ -313,7 +335,7 @@ const generalDataReception = async (data) => {
       ElMessage.success(`操作成功`);
       // this.$message.success("操作成功");
       resetTable();
-      getQuery();
+      gueryRoles();
       resetForm();
       flag.value = false;
       // rmFlag.value = false;
@@ -334,7 +356,7 @@ const generalDataReception = async (data) => {
     resetForm();
   }
 };
-getQuery();
+gueryRoles();
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 25 - 3
src/views/BasicsData/deployNode/index.vue

@@ -117,6 +117,7 @@ const tableForm = reactive<any>({
 }); //弹窗内容
 //列表
 const tableData = ref<any>([]);
+const conditon = ref("");
 //表头
 const state = reactive({
   list: [
@@ -206,6 +207,15 @@ const btnClick = (row, index, param) => {
   } else if (param === 4) {
   }
 };
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+  getQuery();
+};
 //获取表格数据
 const getQuery = async () => {
   try {
@@ -226,7 +236,19 @@ const getQuery = async () => {
         rowTitle.value = titleColumn.columnName;
       }
       tableData.value.push(...returnData.listValues);
-      tableCols.value = returnData.columnSet;
+      tableCols.value = [];
+      if (conditon.value == null) {
+        tableCols.value = returnData.columnSet;
+      } else {
+        tableCols.value = [];
+        conditon.value.split(",").forEach((element) => {
+          returnData.columnSet.forEach((res) => {
+            if (element === res.columnName) {
+              tableCols.value.push(res);
+            }
+          });
+        });
+      }
       tableCols.value.forEach((element) => {
         element.label = element.columnLabel;
         element.key = element.columnName;
@@ -280,7 +302,7 @@ const generalDataReception = async (data) => {
       ElMessage.success(`操作成功`);
       // this.$message.success("操作成功");
       resetTable();
-      getQuery();
+      gueryRoles();
       resetForm();
       flag.value = false;
       // rmFlag.value = false;
@@ -301,7 +323,7 @@ const generalDataReception = async (data) => {
     resetForm();
   }
 };
-getQuery();
+gueryRoles();
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 25 - 3
src/views/BasicsData/equipmentMaintenance/index.vue

@@ -156,6 +156,7 @@ const flag = ref<boolean>(false); //弹窗开关
 const type = ref<string>(""); //判断是否删除
 const msgTitle = ref<string>("新增设备维护"); //弹窗标题
 const tableColsCopys = reactive<Object>({}); //弹窗
+const conditon = ref("");
 const tableForm = reactive<any>({
   deviceID: "",
   deviceName: "",
@@ -270,6 +271,15 @@ const btnClick = (row, index, param) => {
   } else if (param === 4) {
   }
 };
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+  getQuery();
+};
 //获取表格数据
 const getQuery = async () => {
   try {
@@ -290,7 +300,19 @@ const getQuery = async () => {
         rowTitle.value = titleColumn.columnName;
       }
       tableData.value.push(...returnData.listValues);
-      tableCols.value = returnData.columnSet;
+      tableCols.value = [];
+      if (conditon.value == null) {
+        tableCols.value = returnData.columnSet;
+      } else {
+        tableCols.value = [];
+        conditon.value.split(",").forEach((element) => {
+          returnData.columnSet.forEach((res) => {
+            if (element === res.columnName) {
+              tableCols.value.push(res);
+            }
+          });
+        });
+      }
       tableCols.value.forEach((element) => {
         element.label = element.columnLabel;
         element.key = element.columnName;
@@ -341,7 +363,7 @@ const generalDataReception = async (data) => {
       ElMessage.success(`操作成功`);
       // this.$message.success("操作成功");
       resetTable();
-      getQuery();
+      gueryRoles();
       resetForm();
       flag.value = false;
       // rmFlag.value = false;
@@ -362,7 +384,7 @@ const generalDataReception = async (data) => {
     resetForm();
   }
 };
-getQuery();
+gueryRoles();
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 73 - 9
src/views/BasicsData/hiddenCompany/index.vue

@@ -1,7 +1,12 @@
 <template>
   <div class="airportInfo scroll-y">
     <div class="wrap">
-      <Minheader :is-auth="true" :is-statuser="true" powerData="new_airlines_button" @addForm="addForm">
+      <Minheader
+        :is-auth="true"
+        :is-statuser="true"
+        powerData="new_airlines_button"
+        @addForm="addForm"
+      >
         <template #header>
           <div class="status flex-wrap">
             <div class="manageTitle">屏蔽航司维护</div>
@@ -9,21 +14,58 @@
         </template>
       </Minheader>
       <div class="app-containers">
-        <DataTable :tableHeader="tableCols" :tableData="tableData" :tableBtnGroup="tableBtnGroup" :tableProperty="{ rowKey: 'ID' }" @btnClick="btnClick" />
+        <DataTable
+          :tableHeader="tableColst"
+          :tableData="tableData"
+          :tableBtnGroup="tableBtnGroup"
+          :tableProperty="{ rowKey: 'ID' }"
+          @btnClick="btnClick"
+        />
       </div>
-      <Dialog :flag="flag" :type="type" :msgTitle="msgTitle" :delName="tableForm.code" @resetForm="resetForm" @delRest="delRest" @submitForm="submitForm" @delRemove="delRemove">
+      <Dialog
+        :flag="flag"
+        :type="type"
+        :msgTitle="msgTitle"
+        :delName="tableForm.code"
+        @resetForm="resetForm"
+        @delRest="delRest"
+        @submitForm="submitForm"
+        @delRemove="delRemove"
+      >
         <div class="diacont">
-          <el-form :model="tableForm" :rules="formRules" ref="airlineCompanyForm">
+          <el-form
+            :model="tableForm"
+            :rules="formRules"
+            ref="airlineCompanyForm"
+          >
             <el-row :gutter="24">
               <el-col>
-                <el-form-item label="航司二字码" prop="code" size="default" :rules="formRules.isNotNull">
-                  <el-input v-model="tableForm.code" placeholder="请输入航司二字码" />
+                <el-form-item
+                  label="航司二字码"
+                  prop="code"
+                  size="default"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-input
+                    v-model="tableForm.code"
+                    placeholder="请输入航司二字码"
+                  />
                 </el-form-item>
                 <el-form-item label="进港" prop="in_type" size="default">
-                  <el-checkbox v-model="tableForm.in_type" :true-label="1" :false-label="0" size="default" />
+                  <el-checkbox
+                    v-model="tableForm.in_type"
+                    :true-label="1"
+                    :false-label="0"
+                    size="default"
+                  />
                 </el-form-item>
                 <el-form-item label="出港" prop="out_type" size="default">
-                  <el-checkbox v-model="tableForm.out_type" :true-label="1" :false-label="0" size="default" />
+                  <el-checkbox
+                    v-model="tableForm.out_type"
+                    :true-label="1"
+                    :false-label="0"
+                    size="default"
+                  />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -69,12 +111,13 @@ const tableColumns = [
   queryTemplateID: null,
   ...column,
 }));
-
+const conditon = ref("");
 const formRules = useElement().formRules;
 const page = ref(0); //分页参数
 const dataContent = ref<any>({});
 const noMore = ref(false);
 const tableCols = ref<CommonTableColumn[]>(tableColumns); //表头数据
+const tableColst = ref<any[]>([]); //表头数据
 const serviceId = ref<number | null>(null);
 const tableObj = ref<any>({}); //增删改数据缓存
 const flag = ref(false); //弹窗开关
@@ -154,6 +197,26 @@ const delRemove = () => {
 const delRest = () => {
   flag.value = false;
 };
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+  if (conditon.value == null) {
+    tableColst.value = tableCols.value;
+  } else {
+    tableColst.value = [];
+    conditon.value.split(",").forEach((element) => {
+      tableCols.value.forEach((res) => {
+        if (element === res.columnName) {
+          tableColst.value.push(res);
+        }
+      });
+    });
+  }
+};
 //获取表格数据
 const getQuery = async () => {
   try {
@@ -242,6 +305,7 @@ const generalDataReception = async (data) => {
   }
 };
 onMounted(() => {
+  gueryRoles();
   getQuery();
 });
 </script>

+ 25 - 3
src/views/BasicsData/modelMaintenance/index.vue

@@ -125,6 +125,7 @@ const router = useRouter();
 const flag = ref<boolean>(false); //弹窗开关
 const type = ref<string>(""); //判断是否删除
 const msgTitle = ref<string>("新增机型维护"); //弹窗标题
+const conditon = ref("");
 const tableColsCopys = reactive<Object>({}); //弹窗
 const tableBtnGroup = ref<any>([
   {
@@ -244,6 +245,15 @@ const btnClick = (row, index, param) => {
     });
   }
 };
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+  getQuery();
+};
 //获取表格数据
 const getQuery = async () => {
   try {
@@ -264,7 +274,19 @@ const getQuery = async () => {
         rowTitle.value = titleColumn.columnName;
       }
       tableData.value.push(...returnData.listValues);
-      tableCols.value = returnData.columnSet;
+      tableCols.value = [];
+      if (conditon.value == null) {
+        tableCols.value = returnData.columnSet;
+      } else {
+        tableCols.value = [];
+        conditon.value.split(",").forEach((element) => {
+          returnData.columnSet.forEach((res) => {
+            if (element === res.columnName) {
+              tableCols.value.push(res);
+            }
+          });
+        });
+      }
       tableCols.value.forEach((element) => {
         element.label = element.columnLabel;
         element.key = element.columnName;
@@ -319,7 +341,7 @@ const generalDataReception = async (data) => {
       ElMessage.success(`操作成功`);
       // this.$message.success("操作成功");
       resetTable();
-      getQuery();
+      gueryRoles();
       resetForm();
       flag.value = false;
       // rmFlag.value = false;
@@ -340,7 +362,7 @@ const generalDataReception = async (data) => {
     resetForm();
   }
 };
-getQuery();
+gueryRoles();
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 27 - 4
src/views/BasicsData/specialCargoMaintenance/index.vue

@@ -129,6 +129,7 @@ const flag = ref<boolean>(false); //弹窗开关
 const type = ref<string>(""); //判断是否删除
 const msgTitle = ref<string>("新增特殊货物类型维护"); //弹窗标题
 const tableColsCopys = reactive<Object>({}); //弹窗
+const conditon = ref("");
 const tableForm = reactive<any>({
   specialTypeID: "",
   specialType: "",
@@ -164,11 +165,12 @@ const tableBtnGroup = ref([
 ]);
 const searchForms = (val) => {
   page.value = 0;
+  gueryRoles();
   getQuery(val);
 };
 
 const clearForm = () => {
-  getQuery();
+  gueryRoles();
 };
 //新增
 const addForm = () => {
@@ -238,6 +240,15 @@ const btnClick = (row, index, param) => {
   } else if (param === 4) {
   }
 };
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+  getQuery();
+};
 //获取表格数据
 const getQuery = async (val = "") => {
   try {
@@ -263,7 +274,19 @@ const getQuery = async (val = "") => {
       } else {
         tableData.value.push(...returnData.listValues);
       }
-      tableCols.value = returnData.columnSet;
+      tableCols.value = [];
+      if (conditon.value == null) {
+        tableCols.value = returnData.columnSet;
+      } else {
+        tableCols.value = [];
+        conditon.value.split(",").forEach((element) => {
+          returnData.columnSet.forEach((res) => {
+            if (element === res.columnName) {
+              tableCols.value.push(res);
+            }
+          });
+        });
+      }
       tableCols.value.forEach((element) => {
         element.label = element.columnLabel;
         element.key = element.columnName;
@@ -317,7 +340,7 @@ const generalDataReception = async (data) => {
       ElMessage.success(`操作成功`);
       // this.$message.success("操作成功");
       resetTable();
-      getQuery();
+      gueryRoles();
       resetForm();
       flag.value = false;
       // rmFlag.value = false;
@@ -338,7 +361,7 @@ const generalDataReception = async (data) => {
     resetForm();
   }
 };
-getQuery();
+gueryRoles();
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 368 - 194
src/views/dataQuery/components/DataQueryView/index.vue

@@ -2,26 +2,80 @@
   <div class="data-query">
     <div class="data-query-header">
       <div class="manageTitle">{{ title }}</div>
-      <el-form ref="formRef" :model="formData" class="data-query-form" :rules="rules" @submit.native.prevent>
+      <el-form
+        ref="formRef"
+        :model="formData"
+        class="data-query-form"
+        :rules="rules"
+        @submit.native.prevent
+      >
         <div v-if="name === 'freight'" class="form-left">
           <el-form-item prop="startDate">
-            <el-date-picker v-model="formData.startDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="default" type="date" placeholder="开始日期" :prefix-icon="datePreTitle('开始')" :clearable="false" class="pre-text" />
+            <el-date-picker
+              v-model="formData.startDate"
+              format="YYYY-MM-DD"
+              value-format="YYYY-MM-DD"
+              size="default"
+              type="date"
+              placeholder="开始日期"
+              :prefix-icon="datePreTitle('开始')"
+              :clearable="false"
+              class="pre-text"
+            />
           </el-form-item>
           <el-form-item prop="endDate">
-            <el-date-picker v-model="formData.endDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" :disabled-date="disabledEndDate" size="default" type="date" placeholder="结束日期" :prefix-icon="datePreTitle('结束')" :clearable="false" class="pre-text" />
+            <el-date-picker
+              v-model="formData.endDate"
+              format="YYYY-MM-DD"
+              value-format="YYYY-MM-DD"
+              :disabled-date="disabledEndDate"
+              size="default"
+              type="date"
+              placeholder="结束日期"
+              :prefix-icon="datePreTitle('结束')"
+              :clearable="false"
+              class="pre-text"
+            />
           </el-form-item>
         </div>
         <div v-if="name === 'waybill'" class="form-left">
           <el-form-item>
-            <el-date-picker v-model="formData.startDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="default" type="date" placeholder="开始日期" :prefix-icon="datePreTitle('开始')" class="pre-text" />
+            <el-date-picker
+              v-model="formData.startDate"
+              format="YYYY-MM-DD"
+              value-format="YYYY-MM-DD"
+              size="default"
+              type="date"
+              placeholder="开始日期"
+              :prefix-icon="datePreTitle('开始')"
+              class="pre-text"
+            />
           </el-form-item>
           <el-form-item>
-            <el-date-picker v-model="formData.endDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" :disabled-date="disabledEndDate" size="default" type="date" placeholder="结束日期" :prefix-icon="datePreTitle('结束')" class="pre-text" />
+            <el-date-picker
+              v-model="formData.endDate"
+              format="YYYY-MM-DD"
+              value-format="YYYY-MM-DD"
+              :disabled-date="disabledEndDate"
+              size="default"
+              type="date"
+              placeholder="结束日期"
+              :prefix-icon="datePreTitle('结束')"
+              class="pre-text"
+            />
           </el-form-item>
         </div>
         <div v-if="name === 'flight'" class="form-left">
           <el-form-item prop="flightDate" style="width: 148px">
-            <el-date-picker v-model="formData.flightDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="default" type="date" placeholder="请选择航班日期" :clearable="false" />
+            <el-date-picker
+              v-model="formData.flightDate"
+              format="YYYY-MM-DD"
+              value-format="YYYY-MM-DD"
+              size="default"
+              type="date"
+              placeholder="请选择航班日期"
+              :clearable="false"
+            />
           </el-form-item>
           <el-form-item prop="inOrOut" style="width: 108px">
             <el-select v-model="formData.inOrOut" size="default">
@@ -30,68 +84,165 @@
             </el-select>
           </el-form-item>
           <el-form-item prop="flightType" style="width: 108px">
-            <el-select v-model="formData.flightType" size="default" placeholder="航班类型" clearable>
+            <el-select
+              v-model="formData.flightType"
+              size="default"
+              placeholder="航班类型"
+              clearable
+            >
               <el-option :value="0" label="货机" />
               <el-option :value="1" label="客机" />
               <el-option :value="2" label="其他" />
             </el-select>
           </el-form-item>
           <el-form-item prop="sAirport" style="width: 108px">
-            <el-select v-model="formData.sAirport" :disabled="formData.inOrOut === 'out'" size="default" placeholder="始发站" filterable clearable>
-              <el-option v-for="{ value, label } in airportOptions" :key="value" :value="value" :label="label" />
+            <el-select
+              v-model="formData.sAirport"
+              :disabled="formData.inOrOut === 'out'"
+              size="default"
+              placeholder="始发站"
+              filterable
+              clearable
+            >
+              <el-option
+                v-for="{ value, label } in airportOptions"
+                :key="value"
+                :value="value"
+                :label="label"
+              />
             </el-select>
           </el-form-item>
           <el-form-item prop="eAirport" style="width: 108px">
-            <el-select v-model="formData.eAirport" :disabled="formData.inOrOut === 'in'" size="default" placeholder="目的站" filterable clearable>
-              <el-option v-for="{ value, label } in airportOptions" :key="value" :value="value" :label="label" />
+            <el-select
+              v-model="formData.eAirport"
+              :disabled="formData.inOrOut === 'in'"
+              size="default"
+              placeholder="目的站"
+              filterable
+              clearable
+            >
+              <el-option
+                v-for="{ value, label } in airportOptions"
+                :key="value"
+                :value="value"
+                :label="label"
+              />
             </el-select>
           </el-form-item>
           <el-form-item prop="planeType" style="width: 108px">
-            <el-select v-model="formData.planeType" size="default" placeholder="属性" clearable>
+            <el-select
+              v-model="formData.planeType"
+              size="default"
+              placeholder="属性"
+              clearable
+            >
               <el-option value="DOM" label="国内" />
               <el-option value="INT" label="国际" />
             </el-select>
           </el-form-item>
           <el-form-item prop="sFlightDate" style="width: 148px">
-            <el-date-picker v-model="formData.sFlightDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="default" type="date" placeholder="请选择实飞时间" />
+            <el-date-picker
+              v-model="formData.sFlightDate"
+              format="YYYY-MM-DD"
+              value-format="YYYY-MM-DD"
+              size="default"
+              type="date"
+              placeholder="请选择实飞时间"
+            />
           </el-form-item>
         </div>
         <div class="form-right">
-          <el-form-item v-if="name === 'flight'" prop="company" style="width: 180px">
-            <el-input v-model.trim="formData.company" size="default" placeholder="请输入航司进行搜索" :prefix-icon="Search" clearable @keyup.enter.prevent="dataQuery" />
+          <el-form-item
+            v-if="name === 'flight'"
+            prop="company"
+            style="width: 180px"
+          >
+            <el-input
+              v-model.trim="formData.company"
+              size="default"
+              placeholder="请输入航司进行搜索"
+              :prefix-icon="Search"
+              clearable
+              @keyup.enter.prevent="dataQuery"
+            />
           </el-form-item>
-          <el-form-item v-if="name === 'waybill'" prop="flightNO" style="width: 180px">
-            <el-input v-model.trim="formData.flightNO" size="default" placeholder="请输入航班号" clearable />
+          <el-form-item
+            v-if="name === 'waybill'"
+            prop="flightNO"
+            style="width: 180px"
+          >
+            <el-input
+              v-model.trim="formData.flightNO"
+              size="default"
+              placeholder="请输入航班号"
+              clearable
+            />
           </el-form-item>
-          <el-form-item prop="keyWords" :style="name === 'flight' ? { width: '190px' } : {}">
-            <el-input v-model.trim="formData.keyWords" size="default" :placeholder="keyWordsPlaceHolder" :prefix-icon="Search" clearable @keyup.enter.prevent="dataQuery" />
+          <el-form-item
+            prop="keyWords"
+            :style="name === 'flight' ? { width: '190px' } : {}"
+          >
+            <el-input
+              v-model.trim="formData.keyWords"
+              size="default"
+              :placeholder="keyWordsPlaceHolder"
+              :prefix-icon="Search"
+              clearable
+              @keyup.enter.prevent="dataQuery"
+            />
           </el-form-item>
         </div>
       </el-form>
-      <el-button size="default" color="#ac014d" @click="dataQuery">搜索</el-button>
+      <el-button size="default" color="#ac014d" @click="dataQuery"
+        >搜索</el-button
+      >
       <el-button size="default" plain @click="resetForm">重置</el-button>
-      <ColumnSet :table-columns="tableColumns" @checked-submit="columnChecked" />
+      <ColumnSet :table-columns="tableCols" @checked-submit="columnChecked" />
     </div>
-    <div v-loading="loading" element-loading-text="拼命加载中" element-loading-background="rgba(0, 0, 0, 0.8)" class="data-query-table">
-      <SimpleTable :header-cell-style="() => ({ background: '#F9FAFC' })" ref="tableRef" :data="
+    <div
+      v-loading="loading"
+      element-loading-text="拼命加载中"
+      element-loading-background="rgba(0, 0, 0, 0.8)"
+      class="data-query-table"
+    >
+      <SimpleTable
+        :header-cell-style="() => ({ background: '#F9FAFC' })"
+        ref="tableRef"
+        :data="
           tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)
-        " :columns="tableColumns" :cell-class-name="cellClass" :column-props="{ formatter }" height="calc(100vh - 220px)" custom-sequence @cell-click="cellClickHandler" />
-      <el-pagination v-if="tableData.length > 0" background layout="total, prev, pager, next, jumper" :total="tableData.length" :page-size="pageSize" style="position: absolute; right: 19px; bottom: 10px" @size-change="handleSizeChange" @current-change="handleCurrentChange">
+        "
+        :columns="tableCols"
+        :cell-class-name="cellClass"
+        :column-props="{ formatter }"
+        height="calc(100vh - 220px)"
+        custom-sequence
+        @cell-click="cellClickHandler"
+      />
+      <el-pagination
+        v-if="tableData.length > 0"
+        background
+        layout="total, prev, pager, next, jumper"
+        :total="tableData.length"
+        :page-size="pageSize"
+        style="position: absolute; right: 19px; bottom: 10px"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      >
       </el-pagination>
     </div>
   </div>
 </template>
 
 <script setup lang="tsx">
-import { Search } from '@element-plus/icons-vue'
-import ColumnSet from '@/components/ColumnSet/index.vue'
-import SimpleTable from '@/components/SimpleTable/index.vue'
-import { ElMessage, FormInstance } from 'element-plus'
-import { parseTime } from '@/utils/validate'
-import { useTable } from './useTable'
-import { useTableColumnSet } from '@/hooks/useTableColumnSet'
-import { CommonTableFormatter } from '~/common'
-import { Query } from '@/api/webApi'
+import { Search } from "@element-plus/icons-vue";
+import ColumnSet from "@/components/ColumnSet/index.vue";
+import SimpleTable from "@/components/SimpleTable/index.vue";
+import { ElMessage, FormInstance } from "element-plus";
+import { parseTime } from "@/utils/validate";
+import { useTable } from "./useTable";
+import { useTableColumnSet } from "@/hooks/useTableColumnSet";
+import { CommonTableFormatter } from "~/common";
+import { Query } from "@/api/webApi";
 
 const props = defineProps({
   name: {
@@ -102,66 +253,69 @@ const props = defineProps({
     type: String,
     required: true,
   },
-})
-const currentPage = ref(1)
-const pageSize = ref(50)
-const today = parseTime(new Date(), '{y}-{m}-{d}') as string
+});
+const tableCols = ref<any[]>([]); //表头数据
+const conditon = ref("");
+const dataContent = ref({});
+const currentPage = ref(1);
+const pageSize = ref(50);
+const today = parseTime(new Date(), "{y}-{m}-{d}") as string;
 const formData = reactive({
   flightDate: today,
-  inOrOut: 'out',
-  flightType: '',
-  sAirport: '',
-  eAirport: '',
-  planeType: '',
-  sFlightDate: '',
-  company: '',
+  inOrOut: "out",
+  flightType: "",
+  sAirport: "",
+  eAirport: "",
+  planeType: "",
+  sFlightDate: "",
+  company: "",
   startDate: today,
   endDate: today,
-  keyWords: '',
-  flightNO:''
-})
+  keyWords: "",
+  flightNO: "",
+});
 watchEffect(() => {
-  if (formData.inOrOut === 'in') {
-    formData.sAirport = ''
-    formData.eAirport = 'SZX'
+  if (formData.inOrOut === "in") {
+    formData.sAirport = "";
+    formData.eAirport = "SZX";
   } else {
-    formData.sAirport = 'SZX'
-    formData.eAirport = ''
+    formData.sAirport = "SZX";
+    formData.eAirport = "";
   }
   if (!formData.startDate || !formData.endDate) {
-    return
+    return;
   }
-  const start = new Date(formData.startDate).getTime()
-  const end = new Date(formData.endDate).getTime()
+  const start = new Date(formData.startDate).getTime();
+  const end = new Date(formData.endDate).getTime();
   if (start > end) {
-    ElMessage.warning('开始时间不能晚于结束时间')
-    formData.endDate = ''
+    ElMessage.warning("开始时间不能晚于结束时间");
+    formData.endDate = "";
   }
   if (start <= end - 2 * 24 * 60 * 60 * 1000) {
-    ElMessage.warning('间隔不能超过2天')
-    formData.endDate = ''
+    ElMessage.warning("间隔不能超过2天");
+    formData.endDate = "";
   }
-})
+});
 const disabledEndDate = (endDate: Date) => {
-  const start = new Date(formData.startDate + ' 00:00:00').getTime()
-  const end = endDate.getTime()
-  return start > end || start <= end - 2 * 24 * 60 * 60 * 1000
-}
+  const start = new Date(formData.startDate + " 00:00:00").getTime();
+  const end = endDate.getTime();
+  return start > end || start <= end - 2 * 24 * 60 * 60 * 1000;
+};
 const datePreTitle = (title: string) => {
-  return <div class="date-pre-title">{title}:</div>
-}
+  return <div class="date-pre-title">{title}:</div>;
+};
 
 const searchTitleMap = {
-  flight: '航班号',
-  waybill: '运单号',
-  freight: '货物编码',
-}
+  flight: "航班号",
+  waybill: "运单号",
+  freight: "货物编码",
+};
 
 const keyWordsPlaceHolder = computed(
-  () => `请输入${searchTitleMap[props.name] ?? '内容'}进行搜索`
-)
+  () => `请输入${searchTitleMap[props.name] ?? "内容"}进行搜索`
+);
 
-const airportOptions = ref<{ value: string; label: string }[]>([])
+const airportOptions = ref<{ value: string; label: string }[]>([]);
 const getAirports = async () => {
   try {
     const {
@@ -171,35 +325,35 @@ const getAirports = async () => {
     } = await Query<{ [x: string]: string }>({
       id: DATACONTENT_ID.airportCode,
       dataContent: [],
-    })
+    });
     if (Number(code) !== 0) {
-      throw new Error(message || '失败')
+      throw new Error(message || "失败");
     }
     airportOptions.value = listValues.map(({ code3 }) => ({
       value: code3,
       label: code3,
-    }))
+    }));
   } catch (error) {
-    console.error(error)
+    console.error(error);
   }
-}
+};
 onMounted(() => {
-  if (props.name === 'flight') {
-    getAirports()
-    dataQuery()
+  if (props.name === "flight") {
+    getAirports();
+    dataQuery();
   }
-})
+});
 
 const keyWordsValidator = (rule: any, value: any, callback: any) => {
-  if (props.name == 'waybill') {
-    return true
+  if (props.name == "waybill") {
+    return true;
   }
-  const searchTitle = searchTitleMap[props.name] ?? '关键词'
+  const searchTitle = searchTitleMap[props.name] ?? "关键词";
   if (!value) {
-    if (['flight'].includes(props.name)) {
-      return callback()
+    if (["flight"].includes(props.name)) {
+      return callback();
     } else {
-      return callback(new Error(`请输入${searchTitle}`))
+      return callback(new Error(`请输入${searchTitle}`));
     }
   }
   const regsMap: { [x: string]: RegExp[] } = {
@@ -207,51 +361,72 @@ const keyWordsValidator = (rule: any, value: any, callback: any) => {
     flight: [/^[0-9]{1,4}$/],
     waybill: [/^[0-9]{8}$/, /^[0-9]{11}$/, /^[0-9]{3}\-[0-9]{8}$/],
     freight: [/^[0-9]{5}$/, /^[0-9]{3}\-[0-9]{8}\-[0-9]{5}$/],
-  }
-  const regs = regsMap[props.name] ?? []
-  const notMatched = regs.length && regs.every(reg => !reg.test(value))
+  };
+  const regs = regsMap[props.name] ?? [];
+  const notMatched = regs.length && regs.every((reg) => !reg.test(value));
   if (notMatched) {
-    return callback(new Error(`请输入正确的${searchTitle}`))
+    return callback(new Error(`请输入正确的${searchTitle}`));
   }
-  return callback()
-}
+  return callback();
+};
 const rules = {
-  startDate: [{ required: true, message: '请选择开始日期', trigger: 'blur' }],
-  endDate: [{ required: true, message: '请选择结束日期', trigger: 'blur' }],
-  keyWords: [{ validator: keyWordsValidator, trigger: 'blur' }],
-  flightDate: [{ required: true, message: '请选择航班日期', trigger: 'blur' }],
+  startDate: [{ required: true, message: "请选择开始日期", trigger: "blur" }],
+  endDate: [{ required: true, message: "请选择结束日期", trigger: "blur" }],
+  keyWords: [{ validator: keyWordsValidator, trigger: "blur" }],
+  flightDate: [{ required: true, message: "请选择航班日期", trigger: "blur" }],
   company: [
     {
       pattern: /^[A-Za-z0-9][A-Za-z0-9]$/,
-      message: '请输入正确的航司',
-      trigger: 'blur',
+      message: "请输入正确的航司",
+      trigger: "blur",
     },
   ],
-}
-const formRef = ref<FormInstance | null>()
+};
+const formRef = ref<FormInstance | null>();
 const dataQuery = () => {
-  formRef.value?.validate(valid => {
+  formRef.value?.validate((valid) => {
     if (valid) {
-      tableInit()
-      getTableData()
+      tableInit();
+      getTableData();
       // load();
     }
-  })
-}
+  });
+};
 const resetForm = () => {
-  formRef.value?.resetFields()
-}
+  formRef.value?.resetFields();
+};
 
-const loading = ref(false)
-const page = ref(1)
-const noMore = ref(false)
+const loading = ref(false);
+const page = ref(1);
+const noMore = ref(false);
 const { tableColumns, tableData, getTableData } = useTable(
   props.name,
   formData,
   page,
   noMore,
   loading
-)
+);
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+  tableCols.value = [];
+  if (conditon.value == null) {
+    tableCols.value = tableColumns.value;
+  } else {
+    conditon.value.split(",").forEach((element) => {
+      tableColumns.value.forEach((res) => {
+        if (element === res.columnName) {
+          tableCols.value.push(res);
+        }
+      });
+    });
+  }
+};
+gueryRoles();
 // const load = () => {
 //   if (loading.value || noMore.value) {
 //     return
@@ -259,137 +434,136 @@ const { tableColumns, tableData, getTableData } = useTable(
 //   page.value++
 //   getTableData()
 // }
-const handleSizeChange = val => {
-  pageSize.value = val
-}
-const handleCurrentChange = val => {
-  currentPage.value = val
-}
+const handleSizeChange = (val) => {
+  pageSize.value = val;
+};
+const handleCurrentChange = (val) => {
+  currentPage.value = val;
+};
 const tableInit = () => {
-  page.value = 0
-  noMore.value = false
-  tableData.value = []
-}
-
-const { columnChecked } = useTableColumnSet(tableColumns)
+  page.value = 0;
+  noMore.value = false;
+  tableData.value = [];
+};
+const { columnChecked } = useTableColumnSet(tableColumns);
 
 const flightStateMap = {
-  CAN: '取消',
-  DLY: '延误',
-}
-const flightTypeMap = ['货机', '客机', '其他']
+  CAN: "取消",
+  DLY: "延误",
+};
+const flightTypeMap = ["货机", "客机", "其他"];
 const DITypeMap = {
-  DOM: '国内',
-  INT: '国际'
-}
+  DOM: "国内",
+  INT: "国际",
+};
 const formatter: CommonTableFormatter = (row, column, cellValue, index) => {
-  const value = String(cellValue ?? '').trim()
-  if (column.property.includes('Time')) {
-    return value.replace(/[T|\s]+/, '\n')
+  const value = String(cellValue ?? "").trim();
+  if (column.property.includes("Time")) {
+    return value.replace(/[T|\s]+/, "\n");
   }
-  if (column.property === 'DIType' && value) {
-    return DITypeMap[value] ?? value
+  if (column.property === "DIType" && value) {
+    return DITypeMap[value] ?? value;
   }
-  if (column.property === 'flightState') {
-    return value ? flightStateMap[value] ?? '正常' : '正常'
+  if (column.property === "flightState") {
+    return value ? flightStateMap[value] ?? "正常" : "正常";
   }
-  if (column.property === 'flightType') {
-    return cellValue ? flightTypeMap[cellValue] ?? '其他' : '其他'
+  if (column.property === "flightType") {
+    return cellValue ? flightTypeMap[cellValue] ?? "其他" : "其他";
   }
-  return value
-}
+  return value;
+};
 
 const cellClass = ({ row, column, rowIndex, columnIndex }) => {
-  const classes: string[] = []
+  const classes: string[] = [];
   switch (props.name) {
-    case 'flight':
-      if (['flightNO'].includes(column.property) && row[column.property]) {
-        classes.push('cell-click')
+    case "flight":
+      if (["flightNO"].includes(column.property) && row[column.property]) {
+        classes.push("cell-click");
       }
-      break
-    case 'waybill':
-      if (['stockCode'].includes(column.property) && row[column.property]) {
-        classes.push('cell-click')
+      break;
+    case "waybill":
+      if (["stockCode"].includes(column.property) && row[column.property]) {
+        classes.push("cell-click");
       }
-      break
-    case 'freight':
-      break
+      break;
+    case "freight":
+      break;
     default:
-      break
+      break;
   }
-  return classes.join(' ')
-}
+  return classes.join(" ");
+};
 
-const router = useRouter()
+const router = useRouter();
 
 const cellClickHandler = (row, column, cell, event) => {
   switch (props.name) {
-    case 'flight': {
+    case "flight": {
       switch (column.property) {
-        case 'flightNO': {
+        case "flightNO": {
           if (!row.flightAllNO || !row.flightDate) {
-            ElMessage.error('航班信息缺失!')
-            return
+            ElMessage.error("航班信息缺失!");
+            return;
           }
-          if (!['INT', 'DOM'].includes(row.DIType)) {
-            ElMessage.error('国内/国际无法识别!')
-            return
+          if (!["INT", "DOM"].includes(row.DIType)) {
+            ElMessage.error("国内/国际无法识别!");
+            return;
           }
-          const viewName = `${row.DIType === 'DOM' ? '' : 'International'}${
-            row.departureAirport === 'SZX' ||
-            (!row.departureAirport && row.arriveAirport !== 'SZX')
-              ? 'Departure'
-              : 'Arrival'
-          }Flight`
+          const viewName = `${row.DIType === "DOM" ? "" : "International"}${
+            row.departureAirport === "SZX" ||
+            (!row.departureAirport && row.arriveAirport !== "SZX")
+              ? "Departure"
+              : "Arrival"
+          }Flight`;
           router.push({
             path: `/dataQuery/flightQuery/${viewName}`,
             query: {
               flightNO: row.flightAllNO,
               flightDate: row.flightDate,
             },
-          })
-          break
+          });
+          break;
         }
         default:
-          break
+          break;
       }
-      break
+      break;
     }
-    case 'waybill': {
+    case "waybill": {
       switch (column.property) {
-        case 'stockCode': {
+        case "stockCode": {
           if (
             !row.stockCode ||
             !row.flightDate ||
-            !['INT', 'DOM'].includes(row.DIType)
+            !["INT", "DOM"].includes(row.DIType)
           ) {
-            ElMessage.error('运单信息缺失!')
-            return
+            ElMessage.error("运单信息缺失!");
+            return;
           }
-          const viewName = `${row.DIType === 'DOM' ? '' : 'International'}${
-            row.departureAirport === 'SZX' ||
-            (!row.departureAirport && row.arriveAirport !== 'SZX')
-              ? 'Departure'
-              : 'Arrival'
-          }Waybill`
+          const viewName = `${row.DIType === "DOM" ? "" : "International"}${
+            row.departureAirport === "SZX" ||
+            (!row.departureAirport && row.arriveAirport !== "SZX")
+              ? "Departure"
+              : "Arrival"
+          }Waybill`;
           router.push({
             path: `/dataQuery/waybillQuery/${viewName}`,
             query: {
               waybillNO: row.stockCode,
               flightDate: row.flightDate,
             },
-          })
-          break
+          });
+          break;
         }
       }
-      break
+      break;
     }
-    case 'freight':
-      break
+    case "freight":
+      break;
     default:
-      break
+      break;
   }
-}
+};
 </script>
 
 <style lang="scss" scoped>

+ 95 - 95
src/views/dataQuery/components/DataQueryView/useTable.ts

@@ -1,115 +1,115 @@
-import { Query } from '@/api/webApi'
-import { Ref } from 'vue'
-import { CommonData, CommonTableColumn, CommonValue } from '~/common'
+import { Query } from "@/api/webApi";
+import { Ref } from "vue";
+import { CommonData, CommonTableColumn, CommonValue } from "~/common";
 
-const idGetter = (name: string) => DATACONTENT_ID[name + 'DataQuery']
+const idGetter = (name: string) => DATACONTENT_ID[name + "DataQuery"];
 
 const tableColumnsMap: {
   [tableName: string]: {
-    columnLabel: string
-    columnName: string
-    [x: string]: any
-  }[]
+    columnLabel: string;
+    columnName: string;
+    [x: string]: any;
+  }[];
 } = {
   flight: [
     {
-      columnLabel: '航司二字码',
-      columnName: 'IATACode',
+      columnLabel: "航司二字码",
+      columnName: "IATACode",
       width: 80,
     },
     {
-      columnLabel: '航班号',
-      columnName: 'flightNO',
+      columnLabel: "航班号",
+      columnName: "flightNO",
       width: 80,
     },
     {
-      columnLabel: '机型',
-      columnName: 'planeType',
+      columnLabel: "机型",
+      columnName: "planeType",
     },
     {
-      columnLabel: '起飞机场',
-      columnName: 'departureAirport',
+      columnLabel: "起飞机场",
+      columnName: "departureAirport",
     },
     {
-      columnLabel: '经停机场',
-      columnName: 'transferAirport',
+      columnLabel: "经停机场",
+      columnName: "transferAirport",
     },
     {
-      columnLabel: '降落机场',
-      columnName: 'landingAirport',
+      columnLabel: "降落机场",
+      columnName: "landingAirport",
     },
     {
-      columnLabel: '计划起飞时间',
-      columnName: 'planDepartureTime',
+      columnLabel: "计划起飞时间",
+      columnName: "planDepartureTime",
     },
     {
-      columnLabel: '实际起飞时间',
-      columnName: 'acDepartureTime',
+      columnLabel: "实际起飞时间",
+      columnName: "acDepartureTime",
     },
     {
-      columnLabel: '计划降落时间',
-      columnName: 'planLandingTime',
+      columnLabel: "计划降落时间",
+      columnName: "planLandingTime",
     },
     {
-      columnLabel: '实际降落时间',
-      columnName: 'acLandingTime',
+      columnLabel: "实际降落时间",
+      columnName: "acLandingTime",
     },
     {
-      columnLabel: '航班类型',
-      columnName: 'flightType',
+      columnLabel: "航班类型",
+      columnName: "flightType",
     },
     {
-      columnLabel: '航班状态',
-      columnName: 'flightState',
+      columnLabel: "航班状态",
+      columnName: "flightState",
     },
     {
-      columnLabel: '国内国际',
-      columnName: 'DIType',
+      columnLabel: "国内国际",
+      columnName: "DIType",
     },
     {
-      columnLabel: '国内国际标识',
-      columnName: 'DIType_OLD',
+      columnLabel: "国内国际标识",
+      columnName: "DIType_OLD",
     },
   ],
   waybill: [
     {
-      columnLabel: '运单号',
-      columnName: 'stockCode',
+      columnLabel: "运单号",
+      columnName: "stockCode",
     },
     {
-      columnLabel: '品名',
-      columnName: 'typeCode',
+      columnLabel: "品名",
+      columnName: "typeCode",
     },
     {
-      columnLabel: '离港航班号',
-      columnName: 'flightNO',
+      columnLabel: "离港航班号",
+      columnName: "flightNO",
     },
     {
-      columnLabel: '离港航班日期',
-      columnName: 'flightDate',
+      columnLabel: "离港航班日期",
+      columnName: "flightDate",
     },
     {
-      columnLabel: '离港出发机场',
-      columnName: 'departureAirport',
+      columnLabel: "离港出发机场",
+      columnName: "departureAirport",
     },
     {
-      columnLabel: '离港到达机场',
-      columnName: 'arriveAirport',
+      columnLabel: "离港到达机场",
+      columnName: "arriveAirport",
     },
     {
-      columnLabel: '总重量',
-      columnName: 'weight',
+      columnLabel: "总重量",
+      columnName: "weight",
     },
     {
-      columnLabel: '总件数',
-      columnName: 'luggageCount',
+      columnLabel: "总件数",
+      columnName: "luggageCount",
     },
     {
-      columnLabel: '计费重量',
-      columnName: 'feeWeight',
+      columnLabel: "计费重量",
+      columnName: "feeWeight",
     },
   ],
-}
+};
 
 export function useTable(
   tableName: string,
@@ -118,15 +118,15 @@ export function useTable(
   noMore: Ref<boolean>,
   loading?: Ref<boolean>
 ) {
-  const tableColumns = ref<CommonTableColumn[]>([])
-  const tableData = ref<CommonData[]>([])
+  const tableColumns = ref<CommonTableColumn[]>([]);
+  const tableData = ref<CommonData[]>([]);
 
   const getTableData = async (defaultDataContent?: CommonValue[]) => {
     if (!idGetter(tableName)) {
-      return
+      return;
     }
     if (loading) {
-      loading.value = true
+      loading.value = true;
     }
     try {
       let {
@@ -142,16 +142,16 @@ export function useTable(
         endDate,
         keyWords,
         flightNO,
-      } = formData
+      } = formData;
       if (
-        tableName === 'waybill' &&
-        typeof keyWords === 'string' &&
+        tableName === "waybill" &&
+        typeof keyWords === "string" &&
         keyWords.length === 11
       ) {
-        keyWords = `${keyWords.slice(0, 3)}-${keyWords.slice(3)}`
+        keyWords = `${keyWords.slice(0, 3)}-${keyWords.slice(3)}`;
       }
       let dataContent =
-        tableName === 'flight'
+        tableName === "flight"
           ? [
               keyWords,
               company,
@@ -162,10 +162,10 @@ export function useTable(
               flightType,
               sFlightDate,
             ]
-          : tableName === 'waybill'
+          : tableName === "waybill"
           ? [startDate, endDate, flightNO, keyWords]
-          : [startDate, endDate, keyWords]
-      dataContent = dataContent.map((v) => (v === '' ? null : v))
+          : [startDate, endDate, keyWords];
+      dataContent = dataContent.map((v) => (v === "" ? null : v));
       const {
         code,
         returnData: { columnSet, listValues },
@@ -175,12 +175,12 @@ export function useTable(
         dataContent: defaultDataContent ?? dataContent,
         pageSize: 9999,
         // needPage: page.value,
-      })
+      });
       if (Number(code) !== 0) {
-        throw new Error(message || '失败')
+        throw new Error(message || "失败");
       }
       if (!tableColumnsMap[tableName]) {
-        tableColumns.value = columnSet
+        tableColumns.value = columnSet;
       }
       if (listValues.length) {
         tableData.value.push(
@@ -188,36 +188,36 @@ export function useTable(
             (row) =>
               !Object.values(row).some(
                 (cellValue) =>
-                  typeof cellValue === 'string' &&
-                  cellValue.includes('undefined')
+                  typeof cellValue === "string" &&
+                  cellValue.includes("undefined")
               )
           )
-        )
+        );
         tableData.value.forEach((row, rowIndex) => {
-          row.index = rowIndex + 1
-        })
+          row.index = rowIndex + 1;
+        });
       } else {
-        page.value--
-        noMore.value = true
+        page.value--;
+        noMore.value = true;
       }
     } catch (error) {
-      console.error(error)
-      page.value--
-      noMore.value = true
+      console.error(error);
+      page.value--;
+      noMore.value = true;
     }
     if (loading) {
-      loading.value = false
+      loading.value = false;
     }
-  }
+  };
 
-  const route = useRoute()
-  const { flightDate, stockCode } = route.query
+  const route = useRoute();
+  const { flightDate, stockCode } = route.query;
 
   onMounted(() => {
     if (tableColumnsMap[tableName]) {
       tableColumns.value = tableColumnsMap[tableName].map((column) => ({
-        columnDescribe: '',
-        dataType: '',
+        columnDescribe: "",
+        dataType: "",
         listqueryTemplateID: null,
         needCount: null,
         needFilters: null,
@@ -229,7 +229,7 @@ export function useTable(
         queryTemplateColumnSetID: null,
         queryTemplateID: null,
         ...column,
-      }))
+      }));
     }
 
     // const defaultDataContent =
@@ -239,20 +239,20 @@ export function useTable(
     //     ? [flightDate, flightDate, stockCode]
     //     : [null, null, null]
     // getTableData(defaultDataContent as CommonValue[])
-    if (tableName === 'waybill') {
-      formData.startDate = formData.endDate = null
+    if (tableName === "waybill") {
+      formData.startDate = formData.endDate = null;
       if (stockCode) {
-        formData.keyWords = stockCode as string
-        getTableData()
+        formData.keyWords = stockCode as string;
+        getTableData();
       }
-    } else if (tableName === 'freight') {
-      getTableData([null, null, null])
+    } else if (tableName === "freight") {
+      getTableData([null, null, null]);
     }
-  })
+  });
 
   return {
     tableColumns,
     tableData,
     getTableData,
-  }
+  };
 }

+ 3 - 3
src/views/dataQuery/flight/index.vue

@@ -3,12 +3,12 @@
 </template>
 
 <script lang="ts">
-import DataQueryView from '../components/DataQueryView/index.vue'
+import DataQueryView from "../components/DataQueryView/index.vue";
 
 export default defineComponent({
-  name: 'FlightQuery',
+  name: "FlightQuery",
   components: { DataQueryView },
-})
+});
 </script>
 
 <style scoped></style>

+ 77 - 77
src/views/realTime/components/FlightView/ContainerWaybillDialog.vue

@@ -18,18 +18,18 @@
 </template>
 
 <script setup lang="ts">
-import Dialog from '@/components/dialog/index.vue'
-import SimpleTable from '@/components/SimpleTable/index.vue'
-import { Query } from '@/api/webApi'
-import { PropType } from 'vue'
+import Dialog from "@/components/dialog/index.vue";
+import SimpleTable from "@/components/SimpleTable/index.vue";
+import { Query } from "@/api/webApi";
+import { PropType } from "vue";
 import {
   CommonData,
   CommonTableColumn,
   CommonTableFormatter,
   CommonValue,
-} from '~/common'
-import { ellipsisCell } from '@/components/SimpleTable/customRender'
-import { datetimeToTime } from '@/utils/validate'
+} from "~/common";
+import { ellipsisCell } from "@/components/SimpleTable/customRender";
+import { datetimeToTime } from "@/utils/validate";
 
 const props = defineProps({
   flag: {
@@ -44,77 +44,77 @@ const props = defineProps({
     type: Array as PropType<CommonValue[]>,
     required: true,
   },
-})
+});
 
-const emit = defineEmits(['update:flag'])
+const emit = defineEmits(["update:flag"]);
 
 const dialogHide = () => {
-  emit('update:flag', false)
-}
+  emit("update:flag", false);
+};
 
 const tableColumnsMap = {
   departure: [
-    { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
+    { columnLabel: "运单号", columnName: "stockCode", width: 120 },
     // { columnLabel: '集装器数量', columnName: 'stowageNum', needCount: 1 },
     {
-      columnLabel: '品名',
-      columnName: 'typeCode',
+      columnLabel: "品名",
+      columnName: "typeCode",
       width: 300,
       showOverflowTooltip: true,
     },
     {
-      columnLabel: '特货信息',
-      columnName: 'speCargoInfo',
+      columnLabel: "特货信息",
+      columnName: "speCargoInfo",
       customRender: ellipsisCell,
     },
-    { columnLabel: '货物件数', columnName: 'luggageCount', needCount: 1 },
-    { columnLabel: '拉下件数', columnName: 'pullNum', needCount: 1 },
-    { columnLabel: '退运件数', columnName: 'returnNum', needCount: 1 },
-    { columnLabel: '最新节点', columnName: 'nodeCode' },
+    { columnLabel: "货物件数", columnName: "luggageCount", needCount: 1 },
+    { columnLabel: "拉下件数", columnName: "pullNum", needCount: 1 },
+    { columnLabel: "退运件数", columnName: "returnNum", needCount: 1 },
+    { columnLabel: "最新节点", columnName: "nodeCode" },
     // { columnLabel: '最新位置', columnName: 'execPosition' },
-    { columnLabel: '处理结果', columnName: 'execResult' },
-    { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
+    { columnLabel: "处理结果", columnName: "execResult" },
+    { columnLabel: "处理时间", columnName: "execTime", width: 130 },
   ],
   arrival: [
-    { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
+    { columnLabel: "运单号", columnName: "stockCode", width: 120 },
     {
-      columnLabel: '品名',
-      columnName: 'typeCode',
+      columnLabel: "品名",
+      columnName: "typeCode",
       width: 300,
       showOverflowTooltip: true,
     },
     {
-      columnLabel: '特货信息',
-      columnName: 'speCargoInfo',
+      columnLabel: "特货信息",
+      columnName: "speCargoInfo",
       needCount: 1,
       customRender: ellipsisCell,
     },
     {
-      columnLabel: '运单件数',
-      columnName: 'luggageCount',
+      columnLabel: "运单件数",
+      columnName: "luggageCount",
       needCount: 1,
     },
     {
-      columnLabel: '理货件数',
-      columnName: 'tallyCount',
+      columnLabel: "理货件数",
+      columnName: "tallyCount",
       needCount: 1,
     },
-    { columnLabel: '最新节点', columnName: 'nodeCode' },
+    { columnLabel: "最新节点", columnName: "nodeCode" },
     // { columnLabel: '最新位置', columnName: 'execPosition' },
-    { columnLabel: '处理结果', columnName: 'execResult' },
-    { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
+    { columnLabel: "处理结果", columnName: "execResult" },
+    { columnLabel: "处理时间", columnName: "execTime", width: 130 },
   ],
-}
+};
 
-const msgTitle = computed(() => props.dataContent.join('-'))
+const msgTitle = computed(() => props.dataContent.join("-"));
 
-const tableColumns = ref<CommonTableColumn[]>([])
+const tableColumns = ref<CommonTableColumn[]>([]);
 const getTableColumns = () => {
   tableColumns.value = tableColumnsMap[
-    props.name.includes('Departure') ? 'departure' : 'arrival'
-  ].map(column => ({
-    columnDescribe: '',
-    dataType: '',
+    props.name.includes("Departure") ? "departure" : "arrival"
+  ].map((column) => ({
+    columnDescribe: "",
+    dataType: "",
     listqueryTemplateID: null,
     needCount: null,
     needFilters: null,
@@ -126,9 +126,9 @@ const getTableColumns = () => {
     queryTemplateColumnSetID: null,
     queryTemplateID: null,
     ...column,
-  }))
-}
-const tableData = ref<CommonData[]>([])
+  }));
+};
+const tableData = ref<CommonData[]>([]);
 const getTableData = async () => {
   try {
     const {
@@ -143,68 +143,68 @@ const getTableData = async () => {
           )}ContainerWaybill`
         ],
       dataContent: props.dataContent,
-    })
+    });
     if (Number(code) !== 0) {
-      throw new Error(message || '失败')
+      throw new Error(message || "失败");
     }
     tableData.value = listValues.filter(
-      row =>
+      (row) =>
         !Object.values(row).some(
-          cellValue =>
-            typeof cellValue === 'string' && cellValue.includes('undefined')
+          (cellValue) =>
+            typeof cellValue === "string" && cellValue.includes("undefined")
         )
-    )
+    );
   } catch (error) {
-    console.error(error)
+    console.error(error);
   }
-}
+};
 const resetTable = () => {
-  tableColumns.value = []
-  tableData.value = []
-}
+  tableColumns.value = [];
+  tableData.value = [];
+};
 watchEffect(() => {
-  tableData.value.forEach(row => {
-    row.tallyCount = row.luggageCount
-  })
-})
+  tableData.value.forEach((row) => {
+    row.tallyCount = row.luggageCount;
+  });
+});
 
 watch(
   () => props.flag,
-  val => {
-    resetTable()
+  (val) => {
+    resetTable();
     if (val) {
-      getTableColumns()
-      getTableData()
+      getTableColumns();
+      getTableData();
     }
   }
-)
+);
 
-const flightDate = computed(() => props.dataContent[0])
+const flightDate = computed(() => props.dataContent[0]);
 
 const formatter: CommonTableFormatter = (row, column, cellValue, index) => {
-  const value = String(cellValue ?? '').trim()
-  if (column.property.includes('Time')) {
-    return datetimeToTime(value, flightDate.value)
+  const value = String(cellValue ?? "").trim();
+  if (column.property.includes("Time")) {
+    return datetimeToTime(value, flightDate.value);
   }
-  if (column.property === 'nodeCode') {
+  if (column.property === "nodeCode") {
     const name = `${props.name.slice(0, 1).toLowerCase()}${props.name
       .slice(1)
-      .replace('Flight', '')}`
+      .replace("Flight", "")}`;
     const node =
-      NODE_CODE[name]?.find(node => node.nodeCode === value) ||
-      NODE_CODE.common?.find(node => node.nodeCode === value)
-    return node?.nodeName || value
+      NODE_CODE[name]?.find((node) => node.nodeCode === value) ||
+      NODE_CODE.common?.find((node) => node.nodeCode === value);
+    return node?.nodeName || value;
   }
-  if (column.property === 'execResult') {
+  if (column.property === "execResult") {
     // const execResult = Number(cellValue)
     // if (Number.isNaN(execResult)) {
     //   return cellValue
     // }
     // return execResult ? '通过' : '未通过'
-    return '通过'
+    return "通过";
   }
-  return value
-}
+  return value;
+};
 </script>
 
 <style scoped lang="scss">

+ 200 - 29
src/views/systemSettings/warningSet/index.vue

@@ -1,18 +1,42 @@
 <template>
   <div class="airportInfo scroll-y">
     <div class="wrap">
-      <Minheader :is-auth="true" :is-btn="true" :is-search="true" :is-statuser="true" powerData="alert_alarm_settings_add_button" @addForm="addForm" @searchForms="searchForms" @clearForm="clearForm">
+      <Minheader
+        :is-auth="true"
+        :is-btn="true"
+        :is-search="true"
+        :is-statuser="true"
+        powerData="alert_alarm_settings_add_button"
+        @addForm="addForm"
+        @searchForms="searchForms"
+        @clearForm="clearForm"
+      >
         <template #header>
           <div class="status flex-wrap">
             <div class="manageTitle">预警告警维护</div>
           </div>
         </template>
-
       </Minheader>
       <div class="app-containers">
-        <DataTable :tableHeader="tableCols" :tableData="tableData" :tableBtnGroup="tableBtnGroup" :tableProperty="{ rowKey: 'ID' }" @btnClick="btnClick" />
+        <DataTable
+          :tableHeader="tableCols"
+          :tableData="tableData"
+          :tableBtnGroup="tableBtnGroup"
+          :tableProperty="{ rowKey: 'ID' }"
+          @btnClick="btnClick"
+        />
       </div>
-      <Dialog width="600px" :flag="flag" :type="type" :msgTitle="msgTitle" :delName="delName" @resetForm="resetForm" @delRest="delRest" @submitForm="submitForm" @delRemove="delRemove">
+      <Dialog
+        width="600px"
+        :flag="flag"
+        :type="type"
+        :msgTitle="msgTitle"
+        :delName="delName"
+        @resetForm="resetForm"
+        @delRest="delRest"
+        @submitForm="submitForm"
+        @delRemove="delRemove"
+      >
         <div class="diacont">
           <el-form :model="tableForm" :rules="formRules" ref="warningSetForm">
             <el-row :gutter="24">
@@ -25,50 +49,134 @@
                 </el-form-item>
               </el-col> -->
               <el-col :span="12">
-                <el-form-item label="名称" prop="alarmname" size="default" :rules="formRules.isNotNull">
-                  <el-input v-model="tableForm.alarmname" placeholder="请输入名称" />
+                <el-form-item
+                  label="名称"
+                  prop="alarmname"
+                  size="default"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-input
+                    v-model="tableForm.alarmname"
+                    placeholder="请输入名称"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="起飞机场" size="default" prop="departmentAirport" :rules="formRules.isNotNull">
-                  <el-select style="width: 100%" v-model="tableForm.departmentAirport" class="input-shadow" filterable allow-create default-first-option clearable placeholder="请选择起飞机场">
-                    <el-option v-for="item in tableOptionser" :key="item.airportID" :label="item.IATACode" :value="item.IATACode">
+                <el-form-item
+                  label="起飞机场"
+                  size="default"
+                  prop="departmentAirport"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-select
+                    style="width: 100%"
+                    v-model="tableForm.departmentAirport"
+                    class="input-shadow"
+                    filterable
+                    allow-create
+                    default-first-option
+                    clearable
+                    placeholder="请选择起飞机场"
+                  >
+                    <el-option
+                      v-for="item in tableOptionser"
+                      :key="item.airportID"
+                      :label="item.IATACode"
+                      :value="item.IATACode"
+                    >
                     </el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="降落机场" size="default">
-                  <el-select style="width: 100%" v-model="tableForm.landingAirport" class="input-shadow" filterable allow-create default-first-option clearable placeholder="请选择降落机场">
-                    <el-option v-for="item in tableOptionser" :key="item.airportID" :label="item.IATACode" :value="item.IATACode">
+                  <el-select
+                    style="width: 100%"
+                    v-model="tableForm.landingAirport"
+                    class="input-shadow"
+                    filterable
+                    allow-create
+                    default-first-option
+                    clearable
+                    placeholder="请选择降落机场"
+                  >
+                    <el-option
+                      v-for="item in tableOptionser"
+                      :key="item.airportID"
+                      :label="item.IATACode"
+                      :value="item.IATACode"
+                    >
                     </el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="航司二字码" size="default" prop="IATACode">
-                  <el-select style="width: 100%" v-model="tableForm.IATACode" class="input-shadow" filterable allow-create default-first-option clearable placeholder="请选择航司二字码">
-                    <el-option v-for="item in iaCodeArr" :key="item.airlineCompanyID" :label="item.ITATCode" :value="item.ITATCode">
+                  <el-select
+                    style="width: 100%"
+                    v-model="tableForm.IATACode"
+                    class="input-shadow"
+                    filterable
+                    allow-create
+                    default-first-option
+                    clearable
+                    placeholder="请选择航司二字码"
+                  >
+                    <el-option
+                      v-for="item in iaCodeArr"
+                      :key="item.airlineCompanyID"
+                      :label="item.ITATCode"
+                      :value="item.ITATCode"
+                    >
                     </el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="国内国际" size="default" prop="ditype" :rules="formRules.isNotNull">
-                  <el-select style="width: 100%" v-model="tableForm.ditype" class="input-shadow" filterable allow-create default-first-option placeholder="请选择国内国际">
-                    <el-option v-for="(item, index) in ditypeAll" :key="index" :label="item.k" :value="item.v">
+                <el-form-item
+                  label="国内国际"
+                  size="default"
+                  prop="ditype"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-select
+                    style="width: 100%"
+                    v-model="tableForm.ditype"
+                    class="input-shadow"
+                    filterable
+                    allow-create
+                    default-first-option
+                    placeholder="请选择国内国际"
+                  >
+                    <el-option
+                      v-for="(item, index) in ditypeAll"
+                      :key="index"
+                      :label="item.k"
+                      :value="item.v"
+                    >
                     </el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="航班号" size="default">
-                  <el-input v-model="tableForm.flightNo" placeholder="请输入航班号" />
+                  <el-input
+                    v-model="tableForm.flightNo"
+                    placeholder="请输入航班号"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="机型" prop="planetype" size="default">
-                  <el-select style="width: 100%" v-model="tableForm.planetype" class="input-shadow" filterable allow-create default-first-option placeholder="请选择机型">
+                  <el-select
+                    style="width: 100%"
+                    v-model="tableForm.planetype"
+                    class="input-shadow"
+                    filterable
+                    allow-create
+                    default-first-option
+                    placeholder="请选择机型"
+                  >
                     <el-option label="宽体机" value="宽体机" />
                     <el-option label="窄体机" value="窄体机" />
                     <el-option label="全部" value="全部" />
@@ -77,7 +185,15 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item label="客货机" prop="flighttype" size="default">
-                  <el-select style="width: 100%" v-model="tableForm.flighttype" class="input-shadow" filterable allow-create default-first-option placeholder="请选择客货机">
+                  <el-select
+                    style="width: 100%"
+                    v-model="tableForm.flighttype"
+                    class="input-shadow"
+                    filterable
+                    allow-create
+                    default-first-option
+                    placeholder="请选择客货机"
+                  >
                     <el-option label="客机" value="客机" />
                     <el-option label="货机" value="货机" />
                     <el-option label="全部" value="全部" />
@@ -86,24 +202,50 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item label="停机位" prop="landingstand" size="default">
-                  <el-input ref="inputRef" v-model="tableForm.landingstand" placeholder="请输入停机位" />
+                  <el-input
+                    ref="inputRef"
+                    v-model="tableForm.landingstand"
+                    placeholder="请输入停机位"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="生效时间" size="default" prop="startDate" :rules="formRules.isNotNull">
-                  <el-date-picker v-model="tableForm.startDate" :rows="1" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="选择日期时间">
+                <el-form-item
+                  label="生效时间"
+                  size="default"
+                  prop="startDate"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-date-picker
+                    v-model="tableForm.startDate"
+                    :rows="1"
+                    type="date"
+                    format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
+                    placeholder="选择日期时间"
+                  >
                   </el-date-picker>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="失效时间" size="default" prop="endDate">
-                  <el-date-picker format="YYYY-MM-DD" value-format="YYYY-MM-DD" v-model="tableForm.endDate" :rows="1" type="date" placeholder="选择日期时间">
+                  <el-date-picker
+                    format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
+                    v-model="tableForm.endDate"
+                    :rows="1"
+                    type="date"
+                    placeholder="选择日期时间"
+                  >
                   </el-date-picker>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="描述" prop="alarmdesc" size="default">
-                  <el-input v-model="tableForm.alarmdesc" placeholder="请输入描述" />
+                  <el-input
+                    v-model="tableForm.alarmdesc"
+                    placeholder="请输入描述"
+                  />
                 </el-form-item>
               </el-col>
               <!-- <el-col>
@@ -119,7 +261,14 @@
           </el-form>
         </div>
       </Dialog>
-      <el-popover ref="popoverRef" :virtual-ref="inputRef" virtual-triggering placement="right" trigger="click" content="多个停机位用逗号分隔,例如 51,52" />
+      <el-popover
+        ref="popoverRef"
+        :virtual-ref="inputRef"
+        virtual-triggering
+        placement="right"
+        trigger="click"
+        content="多个停机位用逗号分隔,例如 51,52"
+      />
     </div>
   </div>
 </template>
@@ -152,6 +301,7 @@ const msgTitle = ref<string>("新增告警预警维护"); //弹窗标题
 const tableColsCopys = reactive<Object>({}); //弹窗\
 const tableOptionser = ref<any>([]); //弹窗下拉
 const submitID = ref<string | any>("");
+const conditon = ref("");
 const delName = ref<string>("");
 const listqueryTemplateID = ref<string | any>("");
 const inputRef = ref(null);
@@ -305,6 +455,15 @@ const delRemove = () => {
 const delRest = () => {
   flag.value = false;
 };
+const gueryRoles = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.allId,
+    needPage: ++page.value,
+    dataContent: Object.values(dataContent.value),
+  });
+  conditon.value = returnData.listValues[0].query_col_conditon;
+  getQuery();
+};
 //获取表格数据
 const getQuery = async (data?) => {
   try {
@@ -537,7 +696,19 @@ const getQuery = async (data?) => {
         tableData.value.push(...returnData);
         tableDataCopy.value.push(...returnData);
       }
-      tableCols.value = columnSet;
+      tableCols.value = [];
+      if (conditon.value == null) {
+        tableCols.value = columnSet;
+      } else {
+        tableCols.value = [];
+        conditon.value.split(",").forEach((element) => {
+          columnSet.forEach((res) => {
+            if (element === res.columnName) {
+              tableCols.value.push(res);
+            }
+          });
+        });
+      }
       // console.log(tableData);
       // const titleColumn = returnData.columnSet.find(
       //   (item) => item.needShow == 1
@@ -602,7 +773,7 @@ const generalDataReception = async (data, event) => {
       ElMessage.success(`操作成功`);
       // this.$message.success("操作成功");
       resetTable();
-      getQuery();
+      gueryRoles();
       resetForm();
       flag.value = false;
       // rmFlag.value = false;
@@ -636,7 +807,7 @@ const searchForms = (val) => {
 
 const clearForm = () => {
   resetTable();
-  getQuery();
+  gueryRoles();
 };
 //获取航司二字码
 const getIaCode = async () => {
@@ -649,7 +820,7 @@ const getAirpot = async () => {
   tableOptionser.value = result;
 };
 onMounted(() => {
-  getQuery();
+  gueryRoles();
   getIaCode();
   getAirpot();
 });

+ 134 - 20
src/views/userManagement/account/index.vue

@@ -4,37 +4,128 @@
       <div class="manageTitle">账号管理</div>
       <div class="flex-wrap">
         <Search @clear="clear" @search="search" />
-        <el-button v-permission="['add_account_button']" size="default" @click="addApp" plain>新增</el-button>
+        <el-button
+          v-permission="['add_account_button']"
+          size="default"
+          @click="addApp"
+          plain
+          >新增</el-button
+        >
       </div>
     </div>
     <div class="application-content flex">
       <div class="box account-tree">
-        <el-tree :data="data" :props="defaultProps" node-key="user_group_id" default-expand-all :expand-on-click-node="false" @node-click="handleNodeClick" />
+        <el-tree
+          :data="data"
+          :props="defaultProps"
+          node-key="user_group_id"
+          default-expand-all
+          :expand-on-click-node="false"
+          @node-click="handleNodeClick"
+        />
       </div>
-      <Table class="account-table" btnGroupWidth="250px" :tableHeader="tableHeader" @btnClick="btnClick" :tableBtnGroup="tableBtnGroup" :tableData="tableData" />
+      <Table
+        class="account-table"
+        btnGroupWidth="250px"
+        :tableHeader="tableHeader"
+        @btnClick="btnClick"
+        :tableBtnGroup="tableBtnGroup"
+        :tableData="tableData"
+      />
     </div>
     <!--删除弹框-->
-    <Dialog :flag="flag" msgTitle="删除账号" type="del" :delName="title" @delRest="delRest" @delRemove="remove" />
+    <Dialog
+      :flag="flag"
+      msgTitle="删除账号"
+      type="del"
+      :delName="title"
+      @delRest="delRest"
+      @delRemove="remove"
+    />
     <!--新增/编辑-->
-    <Dialog :flag="editDialogVisible" :msgTitle="editDialogTitle" @submitForm="submitForm(ruleFormRef)" @resetForm="resetForm(ruleFormRef)" :show-flag="true">
-      <el-form ref="ruleFormRef" :model="ruleForm" label-width="110px" class="demo-ruleForm">
-        <el-form-item label="账号名称" :rules="[{required: true,message: '请输入账号名称',trigger: 'blur',}]" prop="user_name">
-          <el-input :disabled="dT == 'edit'" v-model="ruleForm.user_name" size="default" placeholder="请输入账号名称" />
+    <Dialog
+      :flag="editDialogVisible"
+      :msgTitle="editDialogTitle"
+      @submitForm="submitForm(ruleFormRef)"
+      @resetForm="resetForm(ruleFormRef)"
+      :show-flag="true"
+    >
+      <el-form
+        ref="ruleFormRef"
+        :model="ruleForm"
+        label-width="110px"
+        class="demo-ruleForm"
+      >
+        <el-form-item
+          label="账号名称"
+          :rules="[
+            { required: true, message: '请输入账号名称', trigger: 'blur' },
+          ]"
+          prop="user_name"
+        >
+          <el-input
+            :disabled="dT == 'edit'"
+            v-model="ruleForm.user_name"
+            size="default"
+            placeholder="请输入账号名称"
+          />
         </el-form-item>
-        <el-form-item label="账号密码" :rules="[{required: true,message: '请输入账号密码',trigger: 'blur',}]" prop="user_pwd">
-          <el-input v-model="ruleForm.user_pwd" type="password" show-password size="default" placeholder="请输入账号密码" />
+        <el-form-item
+          label="账号密码"
+          :rules="[
+            { required: true, message: '请输入账号密码', trigger: 'blur' },
+          ]"
+          prop="user_pwd"
+        >
+          <el-input
+            v-model="ruleForm.user_pwd"
+            type="password"
+            show-password
+            size="default"
+            placeholder="请输入账号密码"
+          />
         </el-form-item>
         <el-form-item label="账号组关联" prop="user_gropu_id">
-          <el-select size="default" style="width: 100%" v-model="ruleForm.user_group_id" placeholder="请选择">
-            <el-option v-for="item in options" :key="item.v" :label="item.k" :value="item.v"> </el-option>
+          <el-select
+            size="default"
+            style="width: 100%"
+            v-model="ruleForm.user_group_id"
+            placeholder="请选择"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.v"
+              :label="item.k"
+              :value="item.v"
+            >
+            </el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="账号描述" prop="user_comment">
-          <el-input v-model="ruleForm.user_comment" size="default" type="textarea" :rows="3" placeholder="请输入账号描述" />
+          <el-input
+            v-model="ruleForm.user_comment"
+            size="default"
+            type="textarea"
+            :rows="3"
+            placeholder="请输入账号描述"
+          />
         </el-form-item>
-        <el-form-item label="是否启用" :rules="[{required: true,message: '请选择是否启用',trigger: 'change',}]" prop="user_status">
+        <el-form-item
+          label="是否启用"
+          :rules="[
+            { required: true, message: '请选择是否启用', trigger: 'change' },
+          ]"
+          prop="user_status"
+        >
           <el-radio-group v-model="ruleForm.user_status">
-            <el-radio :label="ruleForm.user_status != '0' && ruleForm.user_status == '1' ? '1' : '2'">启用</el-radio>
+            <el-radio
+              :label="
+                ruleForm.user_status != '0' && ruleForm.user_status == '1'
+                  ? '1'
+                  : '2'
+              "
+              >启用</el-radio
+            >
             <el-radio label="0">禁用</el-radio>
           </el-radio-group>
         </el-form-item>
@@ -58,6 +149,7 @@ const router = useRouter();
 const ruleFormRef = ref<FormInstance>();
 const tableHeader = ref<any>([]);
 const tableData = ref<any>([]);
+const conditon = ref("");
 const tableBtnGroup = <any>[
   {
     name: "编辑",
@@ -127,7 +219,14 @@ const getGroup = async () => {
     data.value = [dataObj];
   }
 };
-
+const gueryRoles = async () => {
+  const res = await table.getTable(DATACONTENT_ID.allId, [
+    searchInfo.value,
+    sessionStorage.getItem("User_Id"),
+  ]);
+  conditon.value = res.tableData.value[0].query_col_conditon;
+  accountList();
+};
 //获取table
 const accountList = async (type?: string) => {
   let result: any = null;
@@ -150,7 +249,7 @@ const accountList = async (type?: string) => {
   const { code, returnData, message } = result;
   if (code == 0) {
     const { columnSet, listValues } = returnData;
-    tableHeader.value = columnSet.map((column) => ({
+    let arr = columnSet.map((column) => ({
       ...column,
       formatter:
         column.columnName === "user_status"
@@ -159,6 +258,18 @@ const accountList = async (type?: string) => {
             }
           : undefined,
     }));
+    if (conditon.value == null) {
+      tableHeader.value = arr;
+    } else {
+      tableHeader.value = [];
+      conditon.value.split(",").forEach((element) => {
+        arr.forEach((res) => {
+          if (element === res.columnName) {
+            tableHeader.value.push(res);
+          }
+        });
+      });
+    }
     tableData.value = listValues;
     submitID.value = returnData.submitID;
   } else {
@@ -171,7 +282,8 @@ const pageInit = () => {
   PageIndex.value = 1;
   tableHeader.value = [];
   tableData.value = [];
-  accountList();
+  gueryRoles();
+  // accountList();
 };
 
 const btnAuthMap = [
@@ -215,7 +327,8 @@ const getGroupSelect = async () => {
 
 onBeforeMount(() => {
   getGroup();
-  accountList();
+  gueryRoles();
+  // accountList();
   getGroupSelect();
 });
 
@@ -226,6 +339,7 @@ const handleNodeClick = (data) => {
     PageIndex.value = 1;
     msgType.value = "cld";
     msgId.value = data.user_group_id;
+    gueryRoles();
     accountList("tree");
   } else {
     msgType.value = "all";
@@ -327,4 +441,4 @@ const resetForm = (formEl: FormInstance | undefined) => {
     flex: 1;
   }
 }
-</style>
+</style>

+ 80 - 16
src/views/userManagement/accountGroup/index.vue

@@ -4,22 +4,67 @@
       <div class="manageTitle">账号组管理</div>
       <div class="flex-wrap">
         <Search @clear="clear" @search="search" />
-        <el-button v-permission="['add_account_group_button']" size="default" @click="addApp" plain>新增</el-button>
+        <el-button
+          v-permission="['add_account_group_button']"
+          size="default"
+          @click="addApp"
+          plain
+          >新增</el-button
+        >
       </div>
     </div>
     <div class="application-content">
-      <Table :tableHeader="tableHeader" @btnClick="btnClick" :tableBtnGroup="tableBtnGroup" :tableData="tableData" />
+      <Table
+        :tableHeader="tableHeader"
+        @btnClick="btnClick"
+        :tableBtnGroup="tableBtnGroup"
+        :tableData="tableData"
+      />
     </div>
     <!--删除弹框-->
-    <Dialog :flag="flag" msgTitle="删除账号组" type="del" :delName="title" @delRest="delRest" @delRemove="remove" />
+    <Dialog
+      :flag="flag"
+      msgTitle="删除账号组"
+      type="del"
+      :delName="title"
+      @delRest="delRest"
+      @delRemove="remove"
+    />
     <!--新增/编辑-->
-    <Dialog :flag="editDialogVisible" :msgTitle="editDialogTitle" @submitForm="submitForm(ruleFormRef)" @resetForm="resetForm(ruleFormRef)" :show-flag="true">
-      <el-form ref="ruleFormRef" :model="ruleForm" label-width="110px" class="demo-ruleForm">
-        <el-form-item label="账号组名称" :rules="[{required: true,message: '请输入账号组名称',trigger: 'blur',}]" prop="user_group_name">
-          <el-input v-model="ruleForm.user_group_name" size="default" placeholder="请输入账号组名称" />
+    <Dialog
+      :flag="editDialogVisible"
+      :msgTitle="editDialogTitle"
+      @submitForm="submitForm(ruleFormRef)"
+      @resetForm="resetForm(ruleFormRef)"
+      :show-flag="true"
+    >
+      <el-form
+        ref="ruleFormRef"
+        :model="ruleForm"
+        label-width="110px"
+        class="demo-ruleForm"
+      >
+        <el-form-item
+          label="账号组名称"
+          :rules="[
+            { required: true, message: '请输入账号组名称', trigger: 'blur' },
+          ]"
+          prop="user_group_name"
+        >
+          <el-input
+            v-model="ruleForm.user_group_name"
+            size="default"
+            placeholder="请输入账号组名称"
+          />
         </el-form-item>
         <el-form-item label="账号组描述" prop="user_group_comment">
-          <el-input v-model="ruleForm.user_group_comment" size="default" type="textarea" :rows="3" placeholder="请输入账号组描述" />
+          <el-input
+            v-model="ruleForm.user_group_comment"
+            size="default"
+            type="textarea"
+            :rows="3"
+            placeholder="请输入账号组描述"
+          />
         </el-form-item>
       </el-form>
     </Dialog>
@@ -50,6 +95,7 @@ const tableBtnGroup = <any>[
     is: "account_group_deletion_button",
   },
 ];
+const conditon = ref("");
 const flag = ref(false);
 const title = ref("");
 const searchInfo = ref("");
@@ -64,26 +110,44 @@ const ruleForm = ref<any>({
 const rowIndex = ref<any>({});
 
 onBeforeMount(() => {
-  accountList();
+  gueryRoles();
 });
-
+const gueryRoles = async () => {
+  const res = await table.getTable(DATACONTENT_ID.allId, [
+    searchInfo.value,
+    sessionStorage.getItem("User_Id"),
+  ]);
+  conditon.value = res.tableData.value[0].query_col_conditon;
+  accountList();
+};
 //获取账号组数据
 const accountList = async () => {
   const res = await table.getTable(DATACONTENT_ID.accountGroupTableId, [
     searchInfo.value,
   ]);
-  tableHeader.value = res.tableHeader.value;
   tableData.value = res.tableData.value;
   submitID.value = res.msgId.value;
+  if (conditon.value == null) {
+    tableHeader.value = res.tableHeader.value;
+  } else {
+    tableHeader.value = [];
+    conditon.value.split(",").forEach((element) => {
+      res.tableHeader.value.forEach((res) => {
+        if (element === res.columnName) {
+          tableHeader.value.push(res);
+        }
+      });
+    });
+  }
 };
 
 const search = (val) => {
   searchInfo.value = val;
-  accountList();
+  gueryRoles();
 };
 const clear = () => {
   searchInfo.value = "";
-  accountList();
+  gueryRoles();
 };
 const btnClick = (index, row, param) => {
   rowIndex.value = _.cloneDeep(row);
@@ -114,7 +178,7 @@ const remove = async () => {
 
     if (code == 0) {
       ElMessage.success(message);
-      accountList();
+      gueryRoles();
     } else {
       ElMessage.error(message);
     }
@@ -138,7 +202,7 @@ const saveAddAccount = async (event) => {
     );
     if (code == 0) {
       ElMessage.success(message);
-      accountList();
+      gueryRoles();
     } else {
       ElMessage.error(message);
     }
@@ -175,4 +239,4 @@ const resetForm = (formEl: FormInstance | undefined) => {
     height: calc(100% - 56px);
   }
 }
-</style>
+</style>

+ 107 - 18
src/views/userManagement/application/index.vue

@@ -7,27 +7,98 @@
       </div>
     </div>
     <div class="application-content">
-      <Table :tableHeader="tableHeader" @btnClick="btnClick" :tableBtnGroup="tableBtnGroup" :tableData="tableData" />
+      <Table
+        :tableHeader="tableHeader"
+        @btnClick="btnClick"
+        :tableBtnGroup="tableBtnGroup"
+        :tableData="tableData"
+      />
     </div>
     <!--删除弹框-->
-    <Dialog :flag="flag" msgTitle="删除应用" type="del" :delName="title" @delRest="delRest" @delRemove="remove" />
+    <Dialog
+      :flag="flag"
+      msgTitle="删除应用"
+      type="del"
+      :delName="title"
+      @delRest="delRest"
+      @delRemove="remove"
+    />
     <!--新增/编辑-->
-    <Dialog :flag="editDialogVisible" :msgTitle="editDialogTitle" @submitForm="submitForm(ruleFormRef)" @resetForm="resetForm(ruleFormRef)" :show-flag="true">
-      <el-form ref="ruleFormRef" :model="ruleForm" label-width="110px" class="demo-ruleForm">
-        <el-form-item label="应用ID" prop="app_id" :rules="[{required: dT === 'edit', message: '请输入应用ID', trigger: 'blur',}]">
-          <el-input v-model="ruleForm.app_id" size="default" placeholder="请输入应用ID" />
+    <Dialog
+      :flag="editDialogVisible"
+      :msgTitle="editDialogTitle"
+      @submitForm="submitForm(ruleFormRef)"
+      @resetForm="resetForm(ruleFormRef)"
+      :show-flag="true"
+    >
+      <el-form
+        ref="ruleFormRef"
+        :model="ruleForm"
+        label-width="110px"
+        class="demo-ruleForm"
+      >
+        <el-form-item
+          label="应用ID"
+          prop="app_id"
+          :rules="[
+            {
+              required: dT === 'edit',
+              message: '请输入应用ID',
+              trigger: 'blur',
+            },
+          ]"
+        >
+          <el-input
+            v-model="ruleForm.app_id"
+            size="default"
+            placeholder="请输入应用ID"
+          />
         </el-form-item>
-        <el-form-item label="应用名称" prop="app_name" :rules="[{required: true, message: '请输入应用名称', trigger: 'blur',}]">
-          <el-input v-model="ruleForm.app_name" size="default" placeholder="请输入应用名称" />
+        <el-form-item
+          label="应用名称"
+          prop="app_name"
+          :rules="[
+            { required: true, message: '请输入应用名称', trigger: 'blur' },
+          ]"
+        >
+          <el-input
+            v-model="ruleForm.app_name"
+            size="default"
+            placeholder="请输入应用名称"
+          />
         </el-form-item>
-        <el-form-item label="appid" prop="app_show_id" :rules="[{required: true, message: '请输入appid', trigger: 'blur',}]">
-          <el-input v-model="ruleForm.app_show_id" size="default" placeholder="请输入appid" />
+        <el-form-item
+          label="appid"
+          prop="app_show_id"
+          :rules="[{ required: true, message: '请输入appid', trigger: 'blur' }]"
+        >
+          <el-input
+            v-model="ruleForm.app_show_id"
+            size="default"
+            placeholder="请输入appid"
+          />
         </el-form-item>
-        <el-form-item label="应用链接密钥" prop="app_show_secret" :rules="[{required: true, message: '请输入应用链接密钥', trigger: 'blur',}]">
-          <el-input v-model="ruleForm.app_show_secret" size="default" placeholder="请输入应用链接密钥" />
+        <el-form-item
+          label="应用链接密钥"
+          prop="app_show_secret"
+          :rules="[
+            { required: true, message: '请输入应用链接密钥', trigger: 'blur' },
+          ]"
+        >
+          <el-input
+            v-model="ruleForm.app_show_secret"
+            size="default"
+            placeholder="请输入应用链接密钥"
+          />
         </el-form-item>
         <el-form-item label="应用描述" prop="app_comment">
-          <el-input v-model="ruleForm.app_comment" size="default" type="textarea" :rows="3" placeholder="请输入应用描述" />
+          <el-input
+            v-model="ruleForm.app_comment"
+            size="default"
+            type="textarea"
+            :rows="3"
+            placeholder="请输入应用描述"
+          />
         </el-form-item>
       </el-form>
     </Dialog>
@@ -72,18 +143,36 @@ const ruleForm = ref<any>({
 });
 const rowIndex = ref(1);
 const searchInfo = ref("");
-
+const conditon = ref("");
 onBeforeMount(() => {
-  getApp();
+  gueryRoles();
 });
-
+const gueryRoles = async () => {
+  const res = await table.getTable(DATACONTENT_ID.allId, [
+    searchInfo.value,
+    sessionStorage.getItem("User_Id"),
+  ]);
+  conditon.value = res.tableData.value[0].query_col_conditon;
+  getApp();
+};
 const getApp = async () => {
   const res = await table.getTable(DATACONTENT_ID.appTableId, [
     searchInfo.value,
   ]);
-  tableHeader.value = res.tableHeader.value;
   tableData.value = res.tableData.value;
   submitID.value = res.msgId.value;
+  if (conditon.value == null) {
+    tableHeader.value = res.tableHeader.value;
+  } else {
+    tableHeader.value = [];
+    conditon.value.split(",").forEach((element) => {
+      res.tableHeader.value.forEach((res) => {
+        if (element === res.columnName) {
+          tableHeader.value.push(res);
+        }
+      });
+    });
+  }
 };
 
 const btnClick = (index, row, param) => {
@@ -128,7 +217,7 @@ const dataChange = async (event, data) => {
   );
   if (code == 0) {
     ElMessage.success(message);
-    getApp();
+    gueryRoles();
   } else {
     ElMessage.error(message);
   }

+ 22 - 22
src/views/userManagement/hooks/useTable.ts

@@ -1,43 +1,43 @@
-import { ref } from 'vue'
-import { ElMessage } from 'element-plus'
-import { GeneralDataReception, Query } from '@/api/webApi'
-import { IdType } from '../type'
-const tableHeader = ref<any>([])
-const tableData = ref<any>([])
-const msgId = ref<any>('')
+import { ref } from "vue";
+import { ElMessage } from "element-plus";
+import { GeneralDataReception, Query } from "@/api/webApi";
+import { IdType } from "../type";
+const tableHeader = ref<any>([]);
+const tableData = ref<any>([]);
+const msgId = ref<any>("");
 const getTable = async (id: IdType, dataContent) => {
   try {
     const { code, returnData, message } = await Query({
       id: id,
       needPage: 1,
       dataContent: [...dataContent],
-    })
+    });
     if (code == 0 && returnData) {
-      const { columnSet, listValues, submitID } = returnData
-      tableHeader.value = columnSet
-      tableData.value = listValues
-      msgId.value = submitID
+      const { columnSet, listValues, submitID } = returnData;
+      tableHeader.value = columnSet;
+      tableData.value = listValues;
+      msgId.value = submitID;
       return {
         tableHeader,
         tableData,
         msgId,
-      }
+      };
     } else {
-      ElMessage.error(message)
+      ElMessage.error(message);
       return {
         tableHeader,
         tableData,
         msgId,
-      }
+      };
     }
   } catch (err: any) {
     return {
       tableHeader,
       tableData,
       msgId,
-    }
+    };
   }
-}
+};
 
 const dataChange = async (
   id: IdType,
@@ -45,16 +45,16 @@ const dataChange = async (
   data: any,
   btnAuth?: string
 ) => {
-  const obj = Object.assign(data, { event })
+  const obj = Object.assign(data, { event });
   const { code, message } = await GeneralDataReception({
     serviceId: id,
     dataContent: JSON.stringify(obj),
     btnAuth,
-  })
+  });
   return {
     code,
     message,
-  }
-}
+  };
+};
 
-export default { getTable, dataChange }
+export default { getTable, dataChange };

+ 77 - 19
src/views/userManagement/role/auth.vue

@@ -6,10 +6,22 @@
         <div class="role-info-content t30">
           <el-form ref="ruleFormRef" :model="ruleForm" class="demo-ruleForm">
             <el-form-item label="角色名称" prop="role_name">
-              <el-input disabled v-model="ruleForm.role_name" size="default" placeholder="请输入角色名称" />
+              <el-input
+                disabled
+                v-model="ruleForm.role_name"
+                size="default"
+                placeholder="请输入角色名称"
+              />
             </el-form-item>
             <el-form-item label="角色描述" prop="role_comment">
-              <el-input disabled v-model="ruleForm.role_comment" size="default" type="textarea" :rows="3" placeholder="请输入角色描述" />
+              <el-input
+                disabled
+                v-model="ruleForm.role_comment"
+                size="default"
+                type="textarea"
+                :rows="3"
+                placeholder="请输入角色描述"
+              />
             </el-form-item>
             <el-form-item label="是否启用" prop="role_status">
               <el-radio-group disabled v-model="ruleForm.role_status">
@@ -24,18 +36,33 @@
         <div class="manageTitle">权限树</div>
         <div class="t30 auth-tree">
           <el-scrollbar>
-            <el-tree ref="treeRef" highlight-current @check="currentChange" :default-expanded-keys="checkKeys" :data="data" show-checkbox :props="defaultProps" :expand-on-click-node="false" node-key="auth_id" @node-click="handleNodeClick">
-              <template #default="{data}">
+            <el-tree
+              ref="treeRef"
+              highlight-current
+              @check="currentChange"
+              :default-expanded-keys="checkKeys"
+              :data="data"
+              show-checkbox
+              :props="defaultProps"
+              :expand-on-click-node="false"
+              node-key="auth_id"
+              @node-click="handleNodeClick"
+            >
+              <template #default="{ data }">
                 <span class="custom-tree-node">
                   {{ data.auth_name }}
                 </span>
-                <span v-if="
-              data.edit_col_condition ||
-              data.delete_row_condition ||
-              data.edit_row_condition ||
-              data.new_col_condition ||
-              data.query_col_conditon ||
-              data.query_row_condition" class="custom-tree-icon"></span>
+                <span
+                  v-if="
+                    data.edit_col_condition ||
+                    data.delete_row_condition ||
+                    data.edit_row_condition ||
+                    data.new_col_condition ||
+                    data.query_col_conditon ||
+                    data.query_row_condition
+                  "
+                  class="custom-tree-icon"
+                ></span>
               </template>
             </el-tree>
           </el-scrollbar>
@@ -52,22 +79,50 @@
         <div class="t30">
           <el-form :model="form" class="demo-ruleForm">
             <el-form-item label="许可查询行">
-              <el-input size="default" v-model="form.query_row_condition" placeholder="请输入内容"></el-input>
+              <el-input
+                size="default"
+                v-model="form.query_row_condition"
+                placeholder="请输入内容"
+              ></el-input>
             </el-form-item>
             <el-form-item label="许可查询列">
-              <el-input size="default" v-model="form.query_col_conditon" placeholder="请输入内容"></el-input>
+              <el-input
+                size="default"
+                v-model="form.query_col_conditon"
+                placeholder="请输入内容"
+              ></el-input>
             </el-form-item>
             <el-form-item label="许可删除行">
-              <el-input size="default" v-model="form.delete_row_condition" placeholder="请输入内容"></el-input>
+              <el-input
+                disabled
+                size="default"
+                v-model="form.delete_row_condition"
+                placeholder="请输入内容"
+              ></el-input>
             </el-form-item>
             <el-form-item label="许可新增列">
-              <el-input size="default" v-model="form.new_col_condition" placeholder="请输入内容"></el-input>
+              <el-input
+                disabled
+                size="default"
+                v-model="form.new_col_condition"
+                placeholder="请输入内容"
+              ></el-input>
             </el-form-item>
             <el-form-item label="许可编辑行">
-              <el-input size="default" v-model="form.edit_row_condition" placeholder="请输入内容"></el-input>
+              <el-input
+                disabled
+                size="default"
+                v-model="form.edit_row_condition"
+                placeholder="请输入内容"
+              ></el-input>
             </el-form-item>
             <el-form-item label="许可编辑列">
-              <el-input size="default" v-model="form.edit_col_condition" placeholder="请输入内容"></el-input>
+              <el-input
+                disabled
+                size="default"
+                v-model="form.edit_col_condition"
+                placeholder="请输入内容"
+              ></el-input>
             </el-form-item>
           </el-form>
         </div>
@@ -114,10 +169,13 @@ onBeforeMount(() => {
   roleDetails();
   getTree();
 });
-
 watch(
   () => form,
   (newValue) => {
+    form.value.delete_row_condition = form.value.query_row_condition;
+    form.value.edit_row_condition = form.value.query_row_condition;
+    form.value.new_col_condition = form.value.query_col_conditon;
+    form.value.edit_col_condition = form.value.query_col_conditon;
     newData.value.forEach((item) => {
       if (item.children) {
         delete item.children;
@@ -412,4 +470,4 @@ const defaultProps = {
     }
   }
 }
-</style>
+</style>

+ 22 - 2
src/views/userManagement/role/index.vue

@@ -144,20 +144,40 @@ const ruleForm = ref<any>({
   repel: "",
 });
 const submitID = ref("");
+const conditon = ref("");
 const searchInfo = ref("");
 const rowIndex = ref<any>({});
 onBeforeMount(() => {
-  gueryRole();
+  gueryRoles();
 });
 
+const gueryRoles = async () => {
+  const res = await table.getTable(DATACONTENT_ID.allId, [
+    searchInfo.value,
+    sessionStorage.getItem("User_Id"),
+  ]);
+  conditon.value = res.tableData.value[0].query_col_conditon;
+  gueryRole();
+};
 const gueryRole = async () => {
   const res = await table.getTable(DATACONTENT_ID.roleTableNId, [
     searchInfo.value,
     sessionStorage.getItem("User_Id"),
   ]);
-  tableHeader.value = res.tableHeader.value;
   tableData.value = res.tableData.value;
   submitID.value = res.msgId.value;
+  if (conditon.value == null) {
+    tableHeader.value = res.tableHeader.value;
+  } else {
+    tableHeader.value = [];
+    conditon.value.split(",").forEach((element) => {
+      res.tableHeader.value.forEach((res) => {
+        if (element === res.columnName) {
+          tableHeader.value.push(res);
+        }
+      });
+    });
+  }
 };
 
 const search = (val) => {