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

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

zhongxiaoyu 2 жил өмнө
parent
commit
5b43f21a8d

+ 2 - 0
components.d.ts

@@ -5,6 +5,8 @@ import '@vue/runtime-core'
 
 declare module '@vue/runtime-core' {
   export interface GlobalComponents {
+    CommonChartsBar: typeof import('./src/components/Echarts/commonChartsBar.vue')['default']
+    CommonChartsChinaMap: typeof import('./src/components/Echarts/commonChartsChinaMap.vue')['default']
     Dialog: typeof import('./src/components/dialog/index.vue')['default']
     ElSvgIcon: typeof import('./src/components/ElSvgIcon.vue')['default']
     Minheader: typeof import('./src/components/minheader/index.vue')['default']

+ 25 - 0
package-lock.json

@@ -11,10 +11,12 @@
       "dependencies": {
         "@element-plus/icons-vue": "^2.0.9",
         "axios": "0.21.3",
+        "blueimp-md5": "^2.19.0",
         "echarts": "5.3.2",
         "el-table-infinite-scroll": "^3.0.1",
         "element-plus": "^2.2.9",
         "file-saver": "^2.0.5",
+        "js-cookie": "^3.0.1",
         "js-error-collection": "^1.0.7",
         "mitt": "^3.0.0",
         "moment-mini": "2.22.1",
@@ -3853,6 +3855,11 @@
       "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
       "dev": true
     },
+    "node_modules/blueimp-md5": {
+      "version": "2.19.0",
+      "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
+      "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w=="
+    },
     "node_modules/bn.js": {
       "version": "5.2.1",
       "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz",
@@ -10790,6 +10797,14 @@
       "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==",
       "dev": true
     },
+    "node_modules/js-cookie": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.1.tgz",
+      "integrity": "sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw==",
+      "engines": {
+        "node": ">=12"
+      }
+    },
     "node_modules/js-error-collection": {
       "version": "1.0.8",
       "resolved": "https://registry.npmjs.org/js-error-collection/-/js-error-collection-1.0.8.tgz",
@@ -23961,6 +23976,11 @@
       "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
       "dev": true
     },
+    "blueimp-md5": {
+      "version": "2.19.0",
+      "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
+      "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w=="
+    },
     "bn.js": {
       "version": "5.2.1",
       "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz",
@@ -29304,6 +29324,11 @@
       "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==",
       "dev": true
     },
+    "js-cookie": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.1.tgz",
+      "integrity": "sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw=="
+    },
     "js-error-collection": {
       "version": "1.0.8",
       "resolved": "https://registry.npmjs.org/js-error-collection/-/js-error-collection-1.0.8.tgz",

+ 2 - 0
package.json

@@ -22,6 +22,7 @@
   },
   "dependencies": {
     "@element-plus/icons-vue": "^2.0.9",
+    "@types/lodash": "^4.14.186",
     "axios": "0.21.3",
     "blueimp-md5": "^2.19.0",
     "echarts": "5.3.2",
@@ -30,6 +31,7 @@
     "file-saver": "^2.0.5",
     "js-cookie": "^3.0.1",
     "js-error-collection": "^1.0.7",
+    "lodash": "^4.17.21",
     "mitt": "^3.0.0",
     "moment-mini": "2.22.1",
     "nprogress": "0.2.0",

+ 17 - 1
public/demo.js

@@ -22,4 +22,20 @@ const LOOP_INTERVAL = {
 const DATACONTENT_ID = {
   /***-----登录------***/
   loginId: 36, //登录-获取权限-id
-}
+
+  /***-----基础数据------***/
+  airlineTableId: 80, //基础数据-航司信息维护-表格-id
+  airportTreeId: 58, //基础数据-机场信息维护-公司列表-id
+  airportTableId: 79, //基础数据-机场信息维护-表格-id
+  terminalTableId: 1803432, //基础数据-机场信息维护-航站楼-表格-id
+  airpositTableId: 1803433, //基础数据-机场信息维护-航站楼位置-表格-id
+
+  /***-----系统设置------***/
+  sysSourceId: 13, //系统设置-数据源-id
+  sysProtoTabId: 1, //系统设置-协议管理-表格-id
+  sysServiceTabId: 2, //系统设置-服务管理-表格-id
+};
+
+const SERVICE_ID = {
+  sysQueryTabId: 5, //系统设置-查询模板-表格-增删改
+};

+ 8 - 0
src/api/webApi.ts

@@ -25,3 +25,11 @@ export async function myQuery(id, ...dataContent) {
     return Promise.reject(error);
   }
 }
+
+export function GeneralDataReception(params) {
+  return request({
+    url: "/openApi/generalDataReception",
+    method: "post",
+    data: params,
+  });
+}

BIN
src/assets/home/pic_border.png


+ 92 - 0
src/components/Echarts/commonChartsBar.vue

@@ -0,0 +1,92 @@
+<!--
+ * @Author: zk
+ * @Date: 2021-09-16 16:24:53
+ * @LastEditTime: 2021-09-28 14:43:06
+ * @LastEditors: Please set LastEditors
+ * @Description: 柱状图
+ * @FilePath: \vue-admin-template-master\src\layout\components\Echarts\commonChartsBar.vue
+-->
+<template>
+  <div class="ChartsBar" :id="id"></div>
+</template>
+
+<script>
+import { markRaw } from 'vue'
+import * as echarts from "echarts";
+import * as _ from 'lodash'
+// 柱状图初始数据
+import ChartsBar from '../mixin/commonChartsBar'
+export default {
+  name: 'ChartsBar',
+  props: {
+    // 柱状图生成所需id
+    id: {
+      type: String,
+      default: ''
+    },
+    // 柱状图额外的数据
+    option: {
+      type: Object,
+      default: () => { }
+    }
+  },
+  mixins: [ChartsBar],
+  data () {
+    return {
+      myChart: null, //柱状图实例
+      desc: 300 // 防抖时间
+    }
+  },
+  mounted () {
+    // 初始数据和额外的配置数据耦合
+    const objData = _.merge(this.options.baseOption, this.option)
+    // 柱状图dom
+    const chartDom = document.getElementById(this.id)
+    // 柱状图初始化
+    this.myChart = markRaw(echarts.init(chartDom))
+    // 生成柱状图
+    this.myChart.setOption(objData)
+    // 监听页面缩放 防止dom重复渲染
+    window.addEventListener('resize', _.debounce(this.handle, this.desc))
+  },
+  watch: {
+    // 监听数据变化,重绘折线图
+    option: {
+      deep: true,
+      handler (newVal) {
+        const objData = _.merge(this.options, newVal)
+        const chartDom = document.getElementById(this.id)
+        // 先移除之前的实例,保证重绘的流畅性
+        chartDom.removeAttribute('_echarts_instance_')
+        this.myChart = markRaw(echarts.init(chartDom))
+        this.myChart.setOption(objData)
+      }
+    }
+  },
+  destroyed () {
+    // 销毁实例和移除监听
+    this.myChart.dispose()
+    window.removeEventListener('resize', this.handle)
+  },
+  methods: {
+    /**
+     * @description: 图形缩放
+     * @param {*}
+     * @return {*}
+     */
+    handle () {
+      this.myChart.resize()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.ChartsBar {
+  height: 100%;
+  width: 100%;
+  position: absolute;
+  left: 0;
+  top: 0;
+}
+</style>

+ 75 - 0
src/components/Echarts/commonChartsChinaMap.vue

@@ -0,0 +1,75 @@
+<!--
+ * @Author: your name
+ * @Date: 2021-09-23 11:16:14
+ * @LastEditTime: 2021-09-23 16:51:29
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: \bigDataScreen\src\components\Echarts\commonChartsChinaMap.vue
+-->
+<template>
+  <div class="ChartsChinaMap" :id="id"></div>
+</template>
+
+<script>
+// 饼图初始数据
+import ChartsChinaMap from '../mixin/commonChartsChinaMap'
+export default {
+  name: 'ChartsChinaMap',
+  props: {
+    // 饼图生成所需id
+    id: {
+      type: String,
+      default: ''
+    },
+    // 饼图额外的数据
+    option: {
+      type: Object,
+      default: () => { }
+    }
+  },
+  mixins: [ChartsChinaMap],
+  data () {
+    return {
+      myChart: null, //饼图实例
+      desc: 300 // 防抖时间
+    }
+  },
+  mounted () {
+    // 初始数据和额外的配置数据耦合
+    const objData = _.merge(this.options, this.option)
+    // 饼图dom
+    const chartDom = document.getElementById(this.id)
+    // 饼图初始化
+    this.myChart = this.$echarts.init(chartDom)
+    // 生成饼图
+    this.myChart.setOption(objData)
+    // 监听页面缩放 防止dom重复渲染
+    window.addEventListener('resize', _.debounce(this.handle, this.desc))
+  },
+  destroyed () {
+    // 销毁实例和移除监听
+    this.myChart.dispose();
+    window.removeEventListener('resize', this.handle);
+  },
+  methods: {
+    /**
+     * @description: 图形缩放
+     * @param {*}
+     * @return {*}
+     */
+    handle () {
+      this.myChart.resize()
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.ChartsChinaMap {
+  height: 100%;
+  width: 100%;
+  position: absolute;
+  left: 0;
+  top: 0;
+}
+</style>

+ 88 - 0
src/components/mixin/commonChartsBar.js

@@ -0,0 +1,88 @@
+/*
+ * @Author: zk
+ * @Date: 2021-09-16 16:20:11
+ * @LastEditTime: 2021-09-28 14:11:50
+ * @LastEditors: Please set LastEditors
+ * @Description: 柱状图初始数据
+ * @FilePath: \vue-admin-template-master\src\layout\mixin\commonChartsLine.js
+ */
+export default {
+  data () {
+    return {
+      options: {
+        // echarts4要用timeline就要把通用属性写到baseOption里
+        baseOption: {
+          textStyle: {
+            color: '#698dc3'
+          },
+          title: {
+            top: '4%',
+            left: '5%',
+            textStyle: {
+              color: '#4bb4dd'
+            }
+          },
+          legend: {
+            top: '4%',
+            right: '5%',
+            textStyle: {
+              color: '#698dc3'
+            }
+          },
+          tooltip: {
+            trigger: 'axis',
+            axisPointer: {
+              type: 'shadow'
+            }
+          },
+          grid: {
+            left: '5%',
+            right: '5%',
+            bottom: '5%',
+            top: '25%',
+            containLabel: true
+          },
+          xAxis: {
+            type: 'category',
+            axisTick: {
+              show: false
+            },
+            axisLine: {
+              show: false,
+              lineStyle: {
+                color: '#698dc3'
+              }
+            },
+            splitLine: {
+              lineStyle: {
+                type: 'dashed',
+                color: '#698dc3'
+              }
+            },
+            axisLabel: {
+              color: '#698dc3'
+            }
+          },
+          yAxis: {
+            type: 'value',
+            axisLine: {
+              show: false,
+              lineStyle: {
+                color: '#698dc3'
+              }
+            },
+            splitLine: {
+              lineStyle: {
+                type: 'dashed',
+                color: '#698dc3'
+              }
+            },
+            axisLabel: {
+              color: '#698dc3'
+            }
+          },
+        }
+      }
+    }
+  }
+}

+ 304 - 0
src/components/mixin/commonChartsChinaMap.js

@@ -0,0 +1,304 @@
+/*
+ * @Author: your name
+ * @Date: 2021-09-23 11:12:40
+ * @LastEditTime: 2021-09-23 13:43:32
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: \bigDataScreen\src\components\mixin\commonChartsChinaMap.js
+ */
+import '../../util/china'
+var geoCoordMap = {
+  '上海': [121.4648, 31.2891],
+  '东莞': [113.8953, 22.901],
+  '东营': [118.7073, 37.5513],
+  '中山': [113.4229, 22.478],
+  '临汾': [111.4783, 36.1615],
+  '临沂': [118.3118, 35.2936],
+  '丹东': [124.541, 40.4242],
+  '丽水': [119.5642, 28.1854],
+  '乌鲁木齐': [87.9236, 43.5883],
+  '佛山': [112.8955, 23.1097],
+  '保定': [115.0488, 39.0948],
+  '兰州': [103.5901, 36.3043],
+  '包头': [110.3467, 41.4899],
+  '北京': [116.4551, 40.2539],
+  '北海': [109.314, 21.6211],
+  '南京': [118.8062, 31.9208],
+  '南宁': [108.479, 23.1152],
+  '南昌': [116.0046, 28.6633],
+  '南通': [121.1023, 32.1625],
+  '厦门': [118.1689, 24.6478],
+  '台州': [121.1353, 28.6688],
+  '合肥': [117.29, 32.0581],
+  '呼和浩特': [111.4124, 40.4901],
+  '咸阳': [108.4131, 34.8706],
+  '哈尔滨': [127.9688, 45.368],
+  '唐山': [118.4766, 39.6826],
+  '嘉兴': [120.9155, 30.6354],
+  '大同': [113.7854, 39.8035],
+  '大连': [122.2229, 39.4409],
+  '天津': [117.4219, 39.4189],
+  '太原': [112.3352, 37.9413],
+  '威海': [121.9482, 37.1393],
+  '宁波': [121.5967, 29.6466],
+  '宝鸡': [107.1826, 34.3433],
+  '宿迁': [118.5535, 33.7775],
+  '常州': [119.4543, 31.5582],
+  '广州': [113.5107, 23.2196],
+  '廊坊': [116.521, 39.0509],
+  '延安': [109.1052, 36.4252],
+  '张家口': [115.1477, 40.8527],
+  '徐州': [117.5208, 34.3268],
+  '德州': [116.6858, 37.2107],
+  '惠州': [114.6204, 23.1647],
+  '成都': [103.9526, 30.7617],
+  '扬州': [119.4653, 32.8162],
+  '承德': [117.5757, 41.4075],
+  '拉萨': [91.1865, 30.1465],
+  '无锡': [120.3442, 31.5527],
+  '日照': [119.2786, 35.5023],
+  '昆明': [102.9199, 25.4663],
+  '杭州': [119.5313, 29.8773],
+  '枣庄': [117.323, 34.8926],
+  '柳州': [109.3799, 24.9774],
+  '株洲': [113.5327, 27.0319],
+  '武汉': [114.3896, 30.6628],
+  '汕头': [117.1692, 23.3405],
+  '江门': [112.6318, 22.1484],
+  '沈阳': [123.1238, 42.1216],
+  '沧州': [116.8286, 38.2104],
+  '河源': [114.917, 23.9722],
+  '泉州': [118.3228, 25.1147],
+  '泰安': [117.0264, 36.0516],
+  '泰州': [120.0586, 32.5525],
+  '济南': [117.1582, 36.8701],
+  '济宁': [116.8286, 35.3375],
+  '海口': [110.3893, 19.8516],
+  '淄博': [118.0371, 36.6064],
+  '淮安': [118.927, 33.4039],
+  '深圳': [114.5435, 22.5439],
+  '清远': [112.9175, 24.3292],
+  '温州': [120.498, 27.8119],
+  '渭南': [109.7864, 35.0299],
+  '湖州': [119.8608, 30.7782],
+  '湘潭': [112.5439, 27.7075],
+  '滨州': [117.8174, 37.4963],
+  '潍坊': [119.0918, 36.524],
+  '烟台': [120.7397, 37.5128],
+  '玉溪': [101.9312, 23.8898],
+  '珠海': [113.7305, 22.1155],
+  '盐城': [120.2234, 33.5577],
+  '盘锦': [121.9482, 41.0449],
+  '石家庄': [114.4995, 38.1006],
+  '福州': [119.4543, 25.9222],
+  '秦皇岛': [119.2126, 40.0232],
+  '绍兴': [120.564, 29.7565],
+  '聊城': [115.9167, 36.4032],
+  '肇庆': [112.1265, 23.5822],
+  '舟山': [122.2559, 30.2234],
+  '苏州': [120.6519, 31.3989],
+  '莱芜': [117.6526, 36.2714],
+  '菏泽': [115.6201, 35.2057],
+  '营口': [122.4316, 40.4297],
+  '葫芦岛': [120.1575, 40.578],
+  '衡水': [115.8838, 37.7161],
+  '衢州': [118.6853, 28.8666],
+  '西宁': [101.4038, 36.8207],
+  '西安': [109.1162, 34.2004],
+  '贵阳': [106.6992, 26.7682],
+  '连云港': [119.1248, 34.552],
+  '邢台': [114.8071, 37.2821],
+  '邯郸': [114.4775, 36.535],
+  '郑州': [113.4668, 34.6234],
+  '鄂尔多斯': [108.9734, 39.2487],
+  '重庆': [107.7539, 30.1904],
+  '金华': [120.0037, 29.1028],
+  '铜川': [109.0393, 35.1947],
+  '银川': [106.3586, 38.1775],
+  '镇江': [119.4763, 31.9702],
+  '长春': [125.8154, 44.2584],
+  '长沙': [113.0823, 28.2568],
+  '长治': [112.8625, 36.4746],
+  '阳泉': [113.4778, 38.0951],
+  '青岛': [120.4651, 36.3373],
+  '韶关': [113.7964, 24.7028]
+};
+
+var BJData = [
+  [{ name: '北京' }, { name: '上海', value: 95 }],
+  [{ name: '北京' }, { name: '广州', value: 90 }],
+  [{ name: '北京' }, { name: '大连', value: 80 }],
+  [{ name: '北京' }, { name: '南宁', value: 70 }],
+  [{ name: '北京' }, { name: '南昌', value: 60 }],
+  [{ name: '北京' }, { name: '拉萨', value: 50 }],
+  [{ name: '北京' }, { name: '长春', value: 40 }],
+  [{ name: '北京' }, { name: '包头', value: 30 }],
+  [{ name: '北京' }, { name: '重庆', value: 20 }],
+  [{ name: '北京' }, { name: '常州', value: 10 }]
+];
+
+var SHData = [
+  [{ name: '上海' }, { name: '包头', value: 95 }],
+  [{ name: '上海' }, { name: '昆明', value: 90 }],
+  [{ name: '上海' }, { name: '广州', value: 80 }],
+  [{ name: '上海' }, { name: '郑州', value: 70 }],
+  [{ name: '上海' }, { name: '长春', value: 60 }],
+  [{ name: '上海' }, { name: '重庆', value: 50 }],
+  [{ name: '上海' }, { name: '长沙', value: 40 }],
+  [{ name: '上海' }, { name: '北京', value: 30 }],
+  [{ name: '上海' }, { name: '丹东', value: 20 }],
+  [{ name: '上海' }, { name: '大连', value: 10 }]
+];
+
+var GZData = [
+  [{ name: '广州' }, { name: '福州', value: 95 }],
+  [{ name: '广州' }, { name: '太原', value: 90 }],
+  [{ name: '广州' }, { name: '长春', value: 80 }],
+  [{ name: '广州' }, { name: '重庆', value: 70 }],
+  [{ name: '广州' }, { name: '西安', value: 60 }],
+  [{ name: '广州' }, { name: '成都', value: 50 }],
+  [{ name: '广州' }, { name: '常州', value: 40 }],
+  [{ name: '广州' }, { name: '北京', value: 30 }],
+  [{ name: '广州' }, { name: '北海', value: 20 }],
+  [{ name: '广州' }, { name: '海口', value: 10 }]
+];
+
+var planePath = 'path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z';
+
+var convertData = function (data) {
+  var res = [];
+  for (var i = 0; i < data.length; i++) {
+    var dataItem = data[i];
+    var fromCoord = geoCoordMap[dataItem[0].name];
+    var toCoord = geoCoordMap[dataItem[1].name];
+    if (fromCoord && toCoord) {
+      res.push({
+        fromName: dataItem[0].name,
+        toName: dataItem[1].name,
+        coords: [fromCoord, toCoord],
+        value: dataItem[1].value
+      });
+    }
+  }
+  return res;
+};
+
+var color = ['#a6c84c', '#ffa022', '#46bee9'];
+var series = [];
+[['北京', BJData], ['上海', SHData], ['广州', GZData]].forEach(function (item, i) {
+  //console.log(item,i);
+  series.push({
+    name: item[0] + ' Top10',
+    type: 'lines',
+    zlevel: 1,
+    effect: {
+      show: true,
+      period: 6,
+      trailLength: 0.7,
+      color: '#fff',
+      symbolSize: 3
+    },
+    lineStyle: {
+      normal: {
+        color: color[i],
+        width: 0,
+        curveness: 0.2
+      }
+    },
+    data: convertData(item[1])
+  },
+    {
+      name: item[0] + ' Top10',
+      type: 'lines',
+      zlevel: 2,
+      symbol: ['none', 'arrow'],
+      symbolSize: 10,
+      effect: {
+        show: true,
+        period: 6,
+        trailLength: 0,
+        symbol: planePath,
+        symbolSize: 15
+      },
+      lineStyle: {
+        normal: {
+          color: color[i],
+          width: 1,
+          opacity: 0.6,
+          curveness: 0.2
+        }
+      },
+      data: convertData(item[1])
+    },
+    {
+      name: item[0] + ' Top10',
+      type: 'effectScatter',
+      coordinateSystem: 'geo',
+      zlevel: 2,
+      rippleEffect: {
+        brushType: 'stroke'
+      },
+      label: {
+        normal: {
+          show: true,
+          position: 'right',
+          formatter: '{b}'
+        }
+      },
+      symbolSize: function (val) {
+        return val[2] / 8;
+      },
+      itemStyle: {
+        normal: {
+          color: color[i]
+        }
+      },
+      data: item[1].map(function (dataItem) {
+        return {
+          name: dataItem[1].name,
+          value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
+        };
+      })
+    });
+});
+export default {
+  data () {
+    return {
+      options: {
+        tooltip: {
+          trigger: 'item',
+          formatter: function (params, ticket, callback) {
+            if (params.seriesType == "effectScatter") {
+              return "线路:" + params.data.name + "" + params.data.value[2];
+            } else if (params.seriesType == "lines") {
+              return params.data.fromName + ">" + params.data.toName + "<br />" + params.data.value;
+            } else {
+              return params.name;
+            }
+          }
+        },
+        geo: {
+          map: 'china',
+          label: {
+            emphasis: {
+              show: true,
+              color: '#fff'
+            }
+          },
+          roam: true,
+          itemStyle: {
+            normal: {
+              areaColor: '#154186',
+              borderColor: '#255caf'
+            },
+            emphasis: {
+              areaColor: '#255caf'
+            }
+          }
+        },
+        series: series
+      }
+    }
+  }
+}
+

+ 4 - 4
src/main.ts

@@ -46,8 +46,8 @@ import 'uno.css'
 // app.component('ElSvgIcon', ElSvgIcon)
 
 //error log  collection
-import errorLog from '@/hooks/useErrorLog'
-errorLog()
+// import errorLog from '@/hooks/useErrorLog'
+// errorLog()
 
 //pinia
 import { createPinia } from 'pinia'
@@ -56,6 +56,6 @@ app.use(createPinia())
 
 app.use(router).mount('#app')
 
-import elTableInfiniteScroll from 'el-table-infinite-scroll';
+import elTableInfiniteScroll from 'el-table-infinite-scroll'
 
-app.use(elTableInfiniteScroll);
+app.use(elTableInfiniteScroll)

+ 54 - 54
src/utils/axiosReq2.ts

@@ -1,113 +1,113 @@
-import axios from 'axios'
-import router from '@/router'
-import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
-import { getToken, setToken } from '@/utils/auth'
-import { AxiosConfigTy, AxiosReqTy, ObjTy } from '~/common'
-import { useUserStore } from '@/store/user'
-let reqConfig: any
-let loadingE: any
+import axios from "axios";
+import router from "@/router";
+import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
+import { getToken, setToken } from "@/utils/auth";
+import { AxiosConfigTy, AxiosReqTy, ObjTy } from "~/common";
+import { useUserStore } from "@/store/user";
+let reqConfig: any;
+let loadingE: any;
 
-const service: any = axios.create()
+const service: any = axios.create();
 
 // 请求拦截
 service.interceptors.request.use(
   (request: AxiosReqTy) => {
     // token setting
-    request.headers['AUTHORIZE_TOKEN'] = getToken()
-    request.headers['token'] = "4cdc82f3d9374abc9cd2c940170a770b"
-    request.data["OperatorId"] ="1656481036138";
+    request.headers["AUTHORIZE_TOKEN"] = getToken();
+    request.headers["token"] = "ca7c45f8a4754528b966c5266df906fb";
+    request.data["OperatorId"] = "1656481036138";
     /* download file*/
     if (request.isDownLoadFile) {
-      request.responseType = 'blob'
+      request.responseType = "blob";
     }
     /* upload file*/
     if (request.isUploadFile) {
-      request.headers['Content-Type'] = 'application/json'
+      request.headers["Content-Type"] = "application/json";
     }
-    reqConfig = request
+    reqConfig = request;
     if (request.bfLoading) {
       loadingE = ElLoading.service({
         lock: true,
-        text: '数据载入中',
+        text: "数据载入中",
         // spinner: 'el-icon-ElLoading',
-        background: 'rgba(0, 0, 0, 0.1)'
-      })
+        background: "rgba(0, 0, 0, 0.1)",
+      });
     }
     /*
      *params会拼接到url上
      * */
     if (request.isParams) {
-      request.params = request.data
-      request.data = {}
+      request.params = request.data;
+      request.data = {};
     }
-    return request
+    return request;
   },
   (err: any) => {
-    Promise.reject(err)
+    Promise.reject(err);
   }
-)
+);
 // 响应拦截
 service.interceptors.response.use(
   (res: any) => {
     if (reqConfig.afHLoading && loadingE) {
-      loadingE.close()
+      loadingE.close();
     }
     // 如果是下载文件直接返回
     if (reqConfig.isDownLoadFile) {
-      return res
+      return res;
     }
-    const { flag, msg, isNeedUpdateToken, updateToken, code } = res.data
+    const { flag, msg, isNeedUpdateToken, updateToken, code } = res.data;
     //更新token保持登录状态
     if (isNeedUpdateToken) {
-      setToken(updateToken)
+      setToken(updateToken);
     }
-    const successCode = '0,200,20000'
+    const successCode = "0,200,20000";
     if (successCode.includes(code)) {
-      return res.data
+      return res.data;
     } else {
       if (code === 403) {
-        ElMessageBox.confirm('请重新登录', {
-          confirmButtonText: '重新登录',
-          cancelButtonText: '取消',
-          type: 'warning'
+        ElMessageBox.confirm("请重新登录", {
+          confirmButtonText: "重新登录",
+          cancelButtonText: "取消",
+          type: "warning",
         }).then(() => {
-          const userStore = useUserStore()
+          const userStore = useUserStore();
           userStore.resetState().then(() => {
-            router.push({ path: '/login' })
-          })
-        })
+            router.push({ path: "/login" });
+          });
+        });
       }
       if (reqConfig.isAlertErrorMsg) {
         ElMessage({
           message: msg,
-          type: 'error',
-          duration: 2 * 1000
-        })
+          type: "error",
+          duration: 2 * 1000,
+        });
       }
       //返回错误信息
       //如果未catch 走unhandledrejection进行收集
       //注:如果没有return 则,会放回到请求方法中.then ,返回的res为 undefined
-      return Promise.reject(res.data)
+      return Promise.reject(res.data);
     }
   },
   (err: any) => {
     /*http错误处理,处理跨域,404,401,500*/
-    if (loadingE) loadingE.close()
+    if (loadingE) loadingE.close();
     ElMessage({
       message: err,
-      type: 'error',
-      duration: 2 * 1000
-    })
+      type: "error",
+      duration: 2 * 1000,
+    });
     //如果是跨域
     //Network Error,cross origin
     const errObj: ObjTy = {
       msg: err.toString(),
       reqUrl: reqConfig.baseURL + reqConfig.url,
-      params: reqConfig.isParams ? reqConfig.params : reqConfig.data
-    }
-    return Promise.reject(JSON.stringify(errObj))
+      params: reqConfig.isParams ? reqConfig.params : reqConfig.data,
+    };
+    return Promise.reject(JSON.stringify(errObj));
   }
-)
+);
 
 export function axiosReq({
   url,
@@ -120,11 +120,11 @@ export function axiosReq({
   isDownLoadFile,
   baseURL,
   timeout,
-  isAlertErrorMsg = true
+  isAlertErrorMsg = true,
 }: AxiosConfigTy): any {
   return service({
     url: url,
-    method: method ?? 'get',
+    method: method ?? "get",
     data: data ?? {},
     isParams: isParams ?? false,
     bfLoading: bfLoading ?? false,
@@ -133,8 +133,8 @@ export function axiosReq({
     isDownLoadFile: isDownLoadFile ?? false,
     isAlertErrorMsg: isAlertErrorMsg,
     baseURL: baseURL ?? import.meta.env.VITE_WEB_BASE_URL,
-    timeout: timeout ?? 15000
-  })
+    timeout: timeout ?? 15000,
+  });
 }
 
-export default axiosReq
+export default axiosReq;

+ 33 - 0
src/utils/validate.ts

@@ -129,3 +129,36 @@ export function parseTime(time: any, cFormat: string) {
   });
   return time_str;
 }
+
+export function translateDataToTreeAll(arr, parentKey, key) {
+  const map = {};
+  const result = [];
+  arr.forEach((element) => {
+    const id = element[key];
+    const pid = element[parentKey];
+    if (map[id]) {
+      map[id] = {
+        ...element,
+        children: map[id].children,
+      };
+    } else {
+      map[id] = {
+        ...element,
+        children: [],
+      };
+    }
+    const item = map[id];
+    if (pid <= 0) {
+      result.push(item);
+    } else {
+      if (map[pid]) {
+        map[pid].children.push(item);
+      } else {
+        map[pid] = {
+          children: [item],
+        };
+      }
+    }
+  });
+  return result;
+}

+ 139 - 63
src/views/BasicsData/airlineCompany/index.vue

@@ -10,7 +10,7 @@
       >
       <div class="app-containers">
         <DataTable
-          :tableHeader="state.list"
+          :tableHeader="tableCols"
           :tableData="tableData"
           :tableBtnGroup="tableBtnGroup"
           :tableProperty="{ rowKey: 'ID' }"
@@ -23,6 +23,8 @@
         :msgTitle="msgTitle"
         @resetForm="resetForm"
         @delRest="delRest"
+        @submitForm="submitForm"
+        @delRemove="delRemove"
       >
         <div class="diacont">
           <el-form :model="tableForm">
@@ -30,7 +32,7 @@
               <el-col>
                 <el-form-item label="航司名称" size="default">
                   <el-input
-                    v-model="tableForm.name"
+                    v-model="tableForm.fullName"
                     placeholder="请输入航司名称"
                   />
                 </el-form-item>
@@ -38,7 +40,7 @@
               <el-col>
                 <el-form-item label="中文简称" size="default">
                   <el-input
-                    v-model="tableForm.china"
+                    v-model="tableForm.abbreviation"
                     placeholder="请输入中文简称"
                   />
                 </el-form-item>
@@ -46,7 +48,7 @@
               <el-col>
                 <el-form-item label="英文简称" size="default">
                   <el-input
-                    v-model="tableForm.englin"
+                    v-model="tableForm.englishAbbreviation"
                     placeholder="请输入英文简称"
                   />
                 </el-form-item>
@@ -54,7 +56,7 @@
               <el-col>
                 <el-form-item label="航司二字码" size="default">
                   <el-input
-                    v-model="tableForm.two"
+                    v-model="tableForm.ITATCode"
                     placeholder="请输入航司二字码"
                   />
                 </el-form-item>
@@ -62,7 +64,7 @@
               <el-col>
                 <el-form-item label="航司三字码" size="default">
                   <el-input
-                    v-model="tableForm.three"
+                    v-model="tableForm.ICAOCode"
                     placeholder="请输入航司三字码"
                   />
                 </el-form-item>
@@ -71,7 +73,7 @@
                 <el-form-item label="备注" size="default">
                   <el-input
                     type="textarea"
-                    v-model="tableForm.text"
+                    v-model="tableForm.remarks"
                     placeholder="请输入备注"
                   />
                 </el-form-item>
@@ -87,45 +89,31 @@
 import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
+import { Query, GeneralDataReception } from "@/api/webApi";
+import { ElMessage } from "element-plus";
+const page = ref<number>(0); //分页参数
+const dataContent = ref<object>({});
+const noMore = ref<Boolean>(false);
+const rowTitle = ref<String>("");
+const tableCols = ref([]); //表头数据
+const serviceId = ref<String>("");
+const tableObj = ref({}); //增删改数据缓存
 const flag = ref<Boolean>(false); //弹窗开关
 const type = ref<String>(""); //判断是否删除
 const msgTitle = ref<String>("新增航司信息维护"); //弹窗标题
 const tableColsCopys = reactive<Object>({}); //弹窗
 const tableForm = reactive({
-  name: "",
-  china: "",
-  englin: "",
-  two: "",
-  three: "",
-  text: "",
+  fullName: "",
+  abbreviation: "",
+  englishAbbreviation: "",
+  ITATCode: "",
+  ICAOCode: "",
+  remarks: "",
+  event: "",
+  airlineCompanyID: "",
 }); //弹窗内容
 //列表
-const tableData = ref([
-  {
-    name: "中国国际航空",
-    china: "国航",
-    englin: "AIRCHINA",
-    two: "CA",
-    three: "CCA",
-    text: "CA国航",
-  },
-  {
-    name: "中国国际航空",
-    china: "国航",
-    englin: "AIRCHINA",
-    two: "CA",
-    three: "CCA",
-    text: "CA国航",
-  },
-  {
-    name: "中国国际航空",
-    china: "国航",
-    englin: "AIRCHINA",
-    two: "CA",
-    three: "CCA",
-    text: "CA国航",
-  },
-]);
+const tableData = ref([]);
 //表头
 const state = reactive({
   list: [
@@ -153,47 +141,47 @@ const tableBtnGroup = ref([
 //新增
 const addForm = () => {
   msgTitle.value = "新增航司信息维护";
+  tableForm.event = 1;
   flag.value = true;
   type.value = "";
 };
 //取消
 const resetForm = () => {
   flag.value = false;
-  tableForm.name = "";
-  tableForm.china = "";
-  tableForm.englin = "";
-  tableForm.two = "";
-  tableForm.three = "";
-  tableForm.text = "";
+  tableForm.fullName = "";
+  tableForm.abbreviation = "";
+  tableForm.englishAbbreviation = "";
+  tableForm.ITATCode = "";
+  tableForm.ICAOCode = "";
+  tableForm.remarks = "";
+  tableForm.airlineCompanyID = "";
 };
-//编辑
-// const editDialog = (data) => {
-//   msgTitle.value = "编辑航司信息维护";
-//   flag.value = true;
-//   type.value = "";
-//   tableForm.name = data.name;
-//   tableForm.china = data.china;
-//   tableForm.englin = data.englin;
-//   tableForm.two = data.two;
-//   tableForm.three = data.three;
-//   tableForm.text = data.text;
-// };
 //编辑-删除
 const btnClick = (row, index, param) => {
   if (param === 2) {
     msgTitle.value = "编辑航司信息维护";
     flag.value = true;
     type.value = "";
-    tableForm.name = index.name;
-    tableForm.china = index.china;
-    tableForm.englin = index.englin;
-    tableForm.two = index.two;
-    tableForm.three = index.three;
-    tableForm.text = index.text;
+    tableForm.event = 2;
+    tableForm.fullName = index.fullName;
+    tableForm.abbreviation = index.abbreviation;
+    tableForm.englishAbbreviation = index.englishAbbreviation;
+    tableForm.ITATCode = index.ITATCode;
+    tableForm.ICAOCode = index.ICAOCode;
+    tableForm.remarks = index.remarks;
+    tableForm.airlineCompanyID = index.airlineCompanyID;
   } else if (param === 3) {
     msgTitle.value = "删除航司信息维护";
     flag.value = true;
     type.value = "del";
+    tableForm.event = 3;
+    tableForm.fullName = index.fullName;
+    tableForm.abbreviation = index.abbreviation;
+    tableForm.englishAbbreviation = index.englishAbbreviation;
+    tableForm.ITATCode = index.ITATCode;
+    tableForm.ICAOCode = index.ICAOCode;
+    tableForm.remarks = index.remarks;
+    tableForm.airlineCompanyID = index.airlineCompanyID;
   } else if (param === 4) {
   }
 };
@@ -203,10 +191,98 @@ const eleDialog = () => {
   flag.value = true;
   type.value = "del";
 };
+const delRemove = () => {
+  tableForm.event = 3;
+  generalDataReception(tableForm);
+};
 //删除
 const delRest = () => {
   flag.value = false;
 };
+//获取表格数据
+const getQuery = async () => {
+  try {
+    const { code, returnData } = await Query({
+      id: DATACONTENT_ID.airlineTableId,
+      needPage: ++page.value,
+      dataContent: Object.values(dataContent.value),
+    });
+    if (code === "0") {
+      if (returnData.listValues.length === 0) {
+        page.value--;
+        noMore.value = true;
+      }
+      const titleColumn = returnData.columnSet.find(
+        (item) => item.needShow === 1
+      );
+      if (titleColumn) {
+        rowTitle.value = titleColumn.columnName;
+      }
+      tableData.value.push(...returnData.listValues);
+      tableCols.value = returnData.columnSet;
+      tableCols.value.forEach((element) => {
+        element.label = element.columnLabel;
+        element.key = element.columnName;
+        // if (element.columnName === "queryTemplate") {
+        //   element.width = "300px";
+        // }
+      });
+      serviceId.value = returnData.submitID;
+    } else {
+      page.value--;
+    }
+  } catch (error) {
+    page.value--;
+  }
+};
+//确认提交
+const submitForm = () => {
+  generalDataReception(tableForm);
+};
+const resetTable = () => {
+  page.value = 0;
+  noMore.value = false;
+  tableData.value = [];
+};
+//新增-编辑-删除
+const generalDataReception = async (data) => {
+  try {
+    data = {
+      ...data,
+      ...dataContent,
+    };
+    const { code } = await GeneralDataReception({
+      serviceId: serviceId.value,
+      dataContent: JSON.stringify(data),
+    });
+    if (code == 0) {
+      ElMessage.success(`操作成功`);
+      // this.$message.success("操作成功");
+      resetTable();
+      getQuery();
+      resetForm();
+      flag.value = false;
+      // rmFlag.value = false;
+      tableObj.value = {};
+      // this.$router.go(0);
+    } else {
+      ElMessage.error(`操作失败`);
+      // this.$message.error("操作失败");
+      // this.flag = false;
+      // this.rmFlag = false;
+      tableObj.value = {};
+      resetForm();
+    }
+  } catch (error) {
+    flag.value = false;
+    //  rmFlag.value = false;
+    tableObj.value = {};
+    resetForm();
+  }
+};
+onMounted(() => {
+  getQuery();
+});
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 149 - 35
src/views/BasicsData/airportCompany/index.vue

@@ -10,7 +10,7 @@
       >
       <div class="app-containers">
         <DataTable
-          :tableHeader="state.list"
+          :tableHeader="tableCols"
           :tableData="tableData"
           :tableBtnGroup="tableBtnGroup"
           :tableProperty="{ rowKey: 'ID' }"
@@ -23,6 +23,8 @@
         :msgTitle="msgTitle"
         @resetForm="resetForm"
         @delRest="delRest"
+        @submitForm="submitForm"
+        @delRemove="delRemove"
       >
         <div class="diacont">
           <el-form :model="tableForm">
@@ -30,7 +32,7 @@
               <el-col>
                 <el-form-item label="公司名称" size="default">
                   <el-input
-                    v-model="tableForm.name"
+                    v-model="tableForm.companyName"
                     placeholder="请输入公司名称"
                   />
                 </el-form-item>
@@ -39,7 +41,7 @@
                 <el-form-item label="上级公司" size="default">
                   <el-select
                     style="width: 100%"
-                    v-model="tableForm.china"
+                    v-model="tableForm.parentID"
                     class="input-shadow"
                     filterable
                     default-first-option
@@ -48,9 +50,9 @@
                   >
                     <el-option
                       v-for="item in tableOptionser"
-                      :key="item.v ? item.v : item.planDepartureApt"
-                      :label="item.k ? item.k : item.planDepartureApt"
-                      :value="item.v ? item.v : item.planDepartureApt"
+                      :key="item.v"
+                      :label="item.k"
+                      :value="item.v"
                     >
                     </el-option>
                   </el-select>
@@ -60,7 +62,7 @@
                 <el-form-item label="公司描述" size="default">
                   <el-input
                     type="textarea"
-                    v-model="tableForm.englin"
+                    v-model="tableForm.companyDesc"
                     placeholder="请输入公司描述"
                   />
                 </el-form-item>
@@ -76,15 +78,27 @@
 import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
+import { Query, GeneralDataReception } from "@/api/webApi";
+import { ElMessage } from "element-plus";
+const page = ref<number>(0); //分页参数
+const dataContent = ref<object>({});
+const noMore = ref<Boolean>(false);
+const asShow = ref<Boolean>(false);
+const rowTitle = ref<String>("");
+const tableCols = ref([]); //表头数据
+const serviceId = ref<String>("");
+const tableObj = ref({}); //增删改数据缓存
 const flag = ref<Boolean>(false); //弹窗开关
 const type = ref<String>(""); //判断是否删除
 const msgTitle = ref<String>("新增机场公司维护"); //弹窗标题
-const tableOptionser = ref<Array>([]); //弹窗下拉
-const tableColsCopys = reactive<Object>({}); //弹窗
+const tableOptionser = ref([]); //弹窗下拉
+const tableColsCopys = reactive([]); //弹窗
 const tableForm = reactive({
-  name: "",
-  china: "",
-  englin: "",
+  companyName: "",
+  parentID: "",
+  companyDesc: "",
+  companyID: "",
+  event: "",
 }); //弹窗内容
 const tableBtnGroup = ref([
   {
@@ -99,23 +113,7 @@ const tableBtnGroup = ref([
   },
 ]);
 //列表
-const tableData = ref([
-  {
-    name: "中国国际航空",
-    china: "中国国际航空",
-    englin: "",
-  },
-  {
-    name: "中国国际航空",
-    china: "中国国际航空",
-    englin: "",
-  },
-  {
-    name: "中国国际航空",
-    china: "中国国际航空",
-    englin: "",
-  },
-]);
+const tableData = ref([]);
 //表头
 const state = reactive({
   list: [
@@ -130,13 +128,17 @@ const addForm = () => {
   msgTitle.value = "新增机场公司维护";
   flag.value = true;
   type.value = "";
+  tableForm.event = 1;
+  asShow.value = false;
+  asShow.value = true;
 };
 //取消
 const resetForm = () => {
   flag.value = false;
-  tableForm.name = "";
-  tableForm.china = "";
-  tableForm.englin = "";
+  tableForm.companyName = "";
+  tableForm.parentID = "";
+  tableForm.companyDesc = "";
+  tableForm.companyID = "";
 };
 //编辑-删除
 const btnClick = (row, index, param) => {
@@ -144,13 +146,20 @@ const btnClick = (row, index, param) => {
     msgTitle.value = "编辑机场公司维护";
     flag.value = true;
     type.value = "";
-    tableForm.name = index.name;
-    tableForm.china = index.china;
-    tableForm.englin = index.englin;
+    tableForm.event = 2;
+    tableForm.companyName = index.companyName;
+    tableForm.parentID = index.parentID;
+    tableForm.companyDesc = index.companyDesc;
+    tableForm.companyID = index.companyID;
   } else if (param === 3) {
     msgTitle.value = "删除机场公司维护";
     flag.value = true;
     type.value = "del";
+    tableForm.event = 3;
+    tableForm.companyName = index.companyName;
+    tableForm.parentID = index.parentID;
+    tableForm.companyDesc = index.companyDesc;
+    tableForm.companyID = index.companyID;
   } else if (param === 4) {
   }
 };
@@ -158,6 +167,111 @@ const btnClick = (row, index, param) => {
 const delRest = () => {
   flag.value = false;
 };
+//获取弹框-下拉数据
+const getSelectData = async (id, name) => {
+  const { code, returnData } = await Query({
+    id,
+    dataContent: name ? [name] : name === null ? [null] : [],
+  });
+  if (code == 0) {
+    tableOptionser.value = returnData.listValues;
+  } else {
+    tableOptionser.value = [];
+  }
+};
+//获取表格数据
+const getQuery = async () => {
+  try {
+    const { code, returnData } = await Query({
+      id: DATACONTENT_ID.airportTreeId,
+      needPage: ++page.value,
+      dataContent: Object.values(dataContent.value),
+    });
+    if (code === "0") {
+      if (returnData.listValues.length === 0) {
+        page.value--;
+        noMore.value = true;
+      }
+      const titleColumn = returnData.columnSet.find(
+        (item) => item.needShow === 1
+      );
+      if (titleColumn) {
+        rowTitle.value = titleColumn.columnName;
+      }
+      tableData.value.push(...returnData.listValues);
+      tableCols.value = returnData.columnSet;
+      returnData.columnSet.forEach((item) => {
+        if (item.listqueryTemplateID && item.columnName === "parentID") {
+          getSelectData(item.listqueryTemplateID);
+        }
+      });
+      tableCols.value.forEach((element) => {
+        element.label = element.columnLabel;
+        element.key = element.columnName;
+      });
+      serviceId.value = returnData.submitID;
+    } else {
+      page.value--;
+    }
+  } catch (error) {
+    page.value--;
+  }
+};
+const changeSelect = (data, name) => {
+  if (tableForm[data].value === "") {
+    tableForm[data].value = null;
+  }
+};
+const resetTable = () => {
+  page.value = 0;
+  noMore.value = false;
+  tableData.value = [];
+};
+//新增-编辑-删除
+const generalDataReception = async (data) => {
+  try {
+    data = {
+      ...data,
+      ...dataContent,
+    };
+    const { code } = await GeneralDataReception({
+      serviceId: serviceId.value,
+      dataContent: JSON.stringify(data),
+    });
+    if (code == 0) {
+      ElMessage.success(`操作成功`);
+      // this.$message.success("操作成功");
+      resetTable();
+      getQuery();
+      resetForm();
+      flag.value = false;
+      // rmFlag.value = false;
+      tableObj.value = {};
+      // this.$router.go(0);
+    } else {
+      ElMessage.error(`操作失败`);
+      // this.$message.error("操作失败");
+      // this.flag = false;
+      // this.rmFlag = false;
+      tableObj.value = {};
+      resetForm();
+    }
+  } catch (error) {
+    flag.value = false;
+    //  rmFlag.value = false;
+    tableObj.value = {};
+    resetForm();
+  }
+};
+//确认提交
+const submitForm = () => {
+  generalDataReception(tableForm);
+};
+const delRemove = () => {
+  tableForm.event = 3;
+  generalDataReception(tableForm);
+};
+getQuery();
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 100 - 1
src/views/BasicsData/airportInfo/airportInfoChild/index.vue

@@ -10,7 +10,7 @@
       >
       <div class="app-containers">
         <DataTable
-          :tableHeader="state.list"
+          :tableHeader="tableCols"
           :tableData="tableData"
           :tableBtnGroup="tableBtnGroup"
           :tableProperty="{ rowKey: 'ID' }"
@@ -23,6 +23,8 @@
         :msgTitle="msgTitle"
         @resetForm="resetForm"
         @delRest="delRest"
+        @submitForm="submitForm"
+        @delRemove="delRemove"
       >
         <div class="diacont">
           <el-form :model="tableForm">
@@ -59,7 +61,16 @@
 import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
+import { Query, GeneralDataReception } from "@/api/webApi";
+import { ElMessage } from "element-plus";
 const router = useRouter();
+const page = ref<number>(0); //分页参数
+const dataContent = ref<object>({});
+const noMore = ref<Boolean>(false);
+const rowTitle = ref<String>("");
+const tableCols = ref([]); //表头数据
+const serviceId = ref<String>("");
+const tableObj = ref({}); //增删改数据缓存
 const flag = ref<Boolean>(false); //弹窗开关
 const type = ref<String>(""); //判断是否删除
 const msgTitle = ref<String>("新增航站楼"); //弹窗标题
@@ -81,10 +92,12 @@ const tableBtnGroup = ref<Array>([
     param: 3,
   },
 ]); //单独的编辑
+// console.log(router.IATACode);
 const tableForm = reactive({
   name: "",
   china: "",
   englin: "",
+  event: "",
 }); //弹窗内容
 //列表
 const tableData = ref([
@@ -106,6 +119,7 @@ const state = reactive({
 //新增
 const addForm = () => {
   msgTitle.value = "新增航站楼";
+  tableForm.event = 1;
   flag.value = true;
   type.value = "";
 };
@@ -131,6 +145,10 @@ const eleDialog = () => {
   flag.value = true;
   type.value = "del";
 };
+const delRemove = () => {
+  tableForm.event = 3;
+  generalDataReception(tableForm);
+};
 //删除取消
 const delRest = () => {
   flag.value = false;
@@ -156,6 +174,87 @@ const btnClick = (row, index, param) => {
     router.push({ path: "/BasicsData/positionSetting" });
   }
 };
+//获取表格数据
+const getQuery = async () => {
+  try {
+    const { code, returnData } = await Query({
+      id: DATACONTENT_ID.terminalTableId,
+      needPage: ++page.value,
+      dataContent: Object.values(dataContent.value),
+    });
+    if (code === "0") {
+      if (returnData.listValues.length === 0) {
+        page.value--;
+        noMore.value = true;
+      }
+      const titleColumn = returnData.columnSet.find(
+        (item) => item.needShow === 1
+      );
+      if (titleColumn) {
+        rowTitle.value = titleColumn.columnName;
+      }
+      tableData.value.push(...returnData.listValues);
+      tableCols.value = returnData.columnSet;
+      tableCols.value.forEach((element) => {
+        element.label = element.columnLabel;
+        element.key = element.columnName;
+        // if (element.columnName === "queryTemplate") {
+        //   element.width = "300px";
+        // }
+      });
+      serviceId.value = returnData.submitID;
+    } else {
+      page.value--;
+    }
+  } catch (error) {
+    page.value--;
+  }
+};
+//确认提交
+const submitForm = () => {
+  generalDataReception(tableForm);
+};
+const resetTable = () => {
+  page.value = 0;
+  noMore.value = false;
+  tableData.value = [];
+};
+//新增-编辑-删除
+const generalDataReception = async (data) => {
+  try {
+    data = {
+      ...data,
+      ...dataContent,
+    };
+    const { code } = await GeneralDataReception({
+      serviceId: serviceId.value,
+      dataContent: JSON.stringify(data),
+    });
+    if (code == 0) {
+      ElMessage.success(`操作成功`);
+      // this.$message.success("操作成功");
+      resetTable();
+      getQuery();
+      resetForm();
+      flag.value = false;
+      // rmFlag.value = false;
+      tableObj.value = {};
+      // this.$router.go(0);
+    } else {
+      ElMessage.error(`操作失败`);
+      // this.$message.error("操作失败");
+      // this.flag = false;
+      // this.rmFlag = false;
+      tableObj.value = {};
+      resetForm();
+    }
+  } catch (error) {
+    flag.value = false;
+    //  rmFlag.value = false;
+    tableObj.value = {};
+    resetForm();
+  }
+};
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 300 - 92
src/views/BasicsData/airportInfo/index.vue

@@ -13,7 +13,12 @@
           <div class="tree_left">
             <el-scrollbar style="height: 100%">
               <div class="corporate">{{ company }}</div>
-              <el-tree :data="data2" accordion @node-click="handleNodeClick">
+              <el-tree
+                :data="data.value"
+                :props="defaultProps"
+                accordion
+                @node-click="handleNodeClick"
+              >
               </el-tree>
             </el-scrollbar>
           </div>
@@ -21,8 +26,8 @@
         <el-col :span="18">
           <div class="app-containers">
             <DataTable
-              BtnGroupWidth="300px"
-              :tableHeader="state.list"
+              :BtnGroupWidth="BtnGroupWidth"
+              :tableHeader="tableCols"
               :tableData="tableData"
               :tableBtnGroup="tableBtnGroup"
               :tableProperty="{ rowKey: 'ID' }"
@@ -39,6 +44,8 @@
       :msgTitle="msgTitle"
       @resetForm="resetForm"
       @delRest="delRest"
+      @submitForm="submitForm"
+      @delRemove="delRemove"
     >
       <div class="diacont">
         <el-form :model="tableForm">
@@ -46,7 +53,7 @@
             <el-col :span="12">
               <el-form-item label="机场名称" size="default">
                 <el-input
-                  v-model="tableForm.name"
+                  v-model="tableForm.airportName"
                   placeholder="请输入机场名称"
                 />
               </el-form-item>
@@ -54,7 +61,7 @@
             <el-col :span="12">
               <el-form-item label="三字码" size="default">
                 <el-input
-                  v-model="tableForm.china"
+                  v-model="tableForm.IATACode"
                   placeholder="请输入三字码"
                 />
               </el-form-item>
@@ -62,7 +69,7 @@
             <el-col :span="12">
               <el-form-item label="四字码" size="default">
                 <el-input
-                  v-model="tableForm.englin"
+                  v-model="tableForm.ICAOCode"
                   placeholder="请输入四字码"
                 />
               </el-form-item>
@@ -70,7 +77,7 @@
             <el-col :span="12">
               <el-form-item label="中文简称" size="default">
                 <el-input
-                  v-model="tableForm.two"
+                  v-model="tableForm.abbreviation"
                   placeholder="请输入中文简称"
                 />
               </el-form-item>
@@ -78,14 +85,17 @@
             <el-col :span="12">
               <el-form-item label="英文简称" size="default">
                 <el-input
-                  v-model="tableForm.three"
+                  v-model="tableForm.englishAbbreviation"
                   placeholder="请输入英文简称"
                 />
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="全称" size="default">
-                <el-input v-model="tableForm.text" placeholder="请输入全称" />
+                <el-input
+                  v-model="tableForm.fullName"
+                  placeholder="请输入全称"
+                />
               </el-form-item>
             </el-col>
             <el-col :span="12">
@@ -93,7 +103,7 @@
                 <!-- <el-input v-model="tableForm.china" /> -->
                 <el-select
                   style="width: 100%"
-                  v-model="tableForm.text1"
+                  v-model="tableForm.airportTimeZone"
                   class="input-shadow"
                   filterable
                   default-first-option
@@ -111,10 +121,10 @@
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="描述" size="default">
+              <el-form-item label="公司名称" size="default">
                 <el-input
-                  v-model="tableForm.text2"
-                  placeholder="请输入机场三字码"
+                  v-model="tableForm.companyName"
+                  placeholder="请输入公司名称"
                 />
               </el-form-item>
             </el-col>
@@ -127,6 +137,9 @@
 <script setup lang="ts">
 import DataTable from "@/components/tableTemp/index.vue";
 import Dialog from "@/components/dialog/index.vue";
+import { translateDataToTreeAll } from "@/utils/validate";
+import { Query, GeneralDataReception } from "@/api/webApi";
+import { ElMessage } from "element-plus";
 const router = useRouter();
 const tableBtnGroup = ref<Array>([
   {
@@ -145,20 +158,129 @@ const tableBtnGroup = ref<Array>([
     param: 3,
   },
 ]); //单独的编辑
+const page = ref<number>(0); //分页参数
+const dataContent = ref<object>({});
+const noMore = ref<Boolean>(false);
+const rowTitle = ref<String>("");
+const tableCols = ref([]); //表头数据
+const serviceId = ref<String>("");
+const tableObj = ref({}); //增删改数据缓存
+const defaultProps = ref({
+  children: "children",
+  label: "companyName",
+});
+const companyID = ref(""); //机场id
+const BtnGroupWidth = ref<String>("");
 const flag = ref<Boolean>(false); //弹窗开关
 const type = ref<String>(""); //判断是否删除
 const msgTitle = ref<String>("新增机场信息维护"); //弹窗标题
-const tableOptionser = ref<Array>([]); //弹窗下拉
+const tableOptionser = ref<Array>([
+  {
+    k: "UTC",
+    v: "1",
+  },
+  {
+    k: "UTC+1",
+    v: "+1",
+  },
+  {
+    k: "UTC+2",
+    v: "+2",
+  },
+  {
+    k: "UTC+3",
+    v: "+3",
+  },
+  {
+    k: "UTC+4",
+    v: "+4",
+  },
+  {
+    k: "UTC+5",
+    v: "+5",
+  },
+  {
+    k: "UTC+6",
+    v: "+6",
+  },
+  {
+    k: "UTC+7",
+    v: "+7",
+  },
+  {
+    k: "UTC+8",
+    v: "+8",
+  },
+  {
+    k: "UTC+9",
+    v: "+9",
+  },
+  {
+    k: "UTC+10",
+    v: "+10",
+  },
+  {
+    k: "UTC+11",
+    v: "+11",
+  },
+  {
+    k: "UTC-1",
+    v: "-1",
+  },
+  {
+    k: "UTC-2",
+    v: "-2",
+  },
+  {
+    k: "UTC-3",
+    v: "-3",
+  },
+  {
+    k: "UTC-4",
+    v: "-4",
+  },
+  {
+    k: "UTC-5",
+    v: "-5",
+  },
+  {
+    k: "UTC-6",
+    v: "-6",
+  },
+  {
+    k: "UTC-7",
+    v: "-7",
+  },
+  {
+    k: "UTC-8",
+    v: "-8",
+  },
+  {
+    k: "UTC-9",
+    v: "-9",
+  },
+  {
+    k: "UTC-10",
+    v: "-10",
+  },
+  {
+    k: "UTC-11",
+    v: "-11",
+  },
+]); //弹窗下拉
 const tableColsCopys = reactive<Object>({}); //弹窗
 const tableForm = reactive({
-  name: "",
-  china: "",
-  englin: "",
-  two: "",
-  three: "",
-  text: "",
-  text1: "",
-  text2: "",
+  airportID: "",
+  airportName: "",
+  IATACode: "",
+  ICAOCode: "",
+  abbreviation: "",
+  englishAbbreviation: "",
+  fullName: "",
+  companyID: "",
+  airportTimeZone: "",
+  companyName: "",
+  event: "",
 }); //弹窗内容
 const tableColumnProperty = reactive({
   width: "120px",
@@ -169,38 +291,7 @@ const tableColumnProperty = reactive({
   headerAlign: "",
 }); //弹窗内容
 //列表
-const tableData = ref([
-  {
-    name: "成都双流机场",
-    china: "CTU",
-    englin: "ZUUU",
-    two: "",
-    three: "CHENGDU",
-    text: "成都双流机场",
-    text1: "",
-    text2: "西南分公司",
-  },
-  {
-    name: "成都双流机场",
-    china: "CTU",
-    englin: "ZUUU",
-    two: "",
-    three: "CHENGDU",
-    text: "成都双流机场",
-    text1: "",
-    text2: "西南分公司",
-  },
-  {
-    name: "成都双流机场",
-    china: "CTU",
-    englin: "ZUUU",
-    two: "",
-    three: "CHENGDU",
-    text: "成都双流机场",
-    text1: "",
-    text2: "西南分公司",
-  },
-]);
+const tableData = ref([]);
 //表头
 const state = reactive({
   list: [
@@ -216,39 +307,14 @@ const state = reactive({
   listLoading: true,
 });
 const company = ref("所属公司");
-const data2 = reactive([
-  {
-    id: 1,
-    label: "中国国际航空",
-    children: [
-      {
-        id: 2,
-        label: "西南分公司",
-      },
-      {
-        id: 3,
-        label: "浙江分公司",
-      },
-      {
-        id: 4,
-        label: "重庆分公司",
-      },
-      {
-        id: 5,
-        label: "天津分公司",
-      },
-      {
-        id: 6,
-        label: "上海分公司",
-      },
-    ],
-  },
-]);
+const data = reactive([]);
 //新增
 const addForm = () => {
   msgTitle.value = "新增机场信息维护";
   flag.value = true;
   type.value = "";
+  tableForm.event = 1;
+  tableForm.companyID = companyID;
 };
 //取消
 const resetForm = () => {
@@ -288,26 +354,168 @@ const btnClick = (row, index, param) => {
     msgTitle.value = "编辑机场信息维护";
     flag.value = true;
     type.value = "";
-    tableForm.name = index.name;
-    tableForm.china = index.china;
-    tableForm.englin = index.englin;
-    tableForm.two = index.two;
-    tableForm.three = index.three;
-    tableForm.text = index.text;
-    tableForm.text1 = index.text1;
-    tableForm.text2 = index.text2;
+    tableForm.airportID = index.airportID;
+    tableForm.airportName = index.airportName;
+    tableForm.IATACode = index.IATACode;
+    tableForm.ICAOCode = index.ICAOCode;
+    tableForm.abbreviation = index.abbreviation;
+    tableForm.englishAbbreviation = index.englishAbbreviation;
+    tableForm.fullName = index.fullName;
+    tableForm.companyID = index.companyID;
+    tableForm.airportTimeZone = index.airportTimeZone;
+    tableForm.companyName = index.companyName;
+    tableForm.event = index.event;
   } else if (param === 3) {
     msgTitle.value = "删除机场信息维护";
     flag.value = true;
     type.value = "del";
+    tableForm.event = 3;
+    tableForm.airportID = index.airportID;
+    tableForm.airportName = index.airportName;
+    tableForm.IATACode = index.IATACode;
+    tableForm.ICAOCode = index.ICAOCode;
+    tableForm.abbreviation = index.abbreviation;
+    tableForm.englishAbbreviation = index.englishAbbreviation;
+    tableForm.fullName = index.fullName;
+    tableForm.companyID = index.companyID;
+    tableForm.airportTimeZone = index.airportTimeZone;
+    tableForm.companyName = index.companyName;
+    tableForm.event = index.event;
   } else if (param === 4) {
-    router.push({ path: "/BasicsData/airportInfoChild" });
+    router.push({
+      path: "/BasicsData/airportInfoChild",
+      params: {
+        IATACode: row.IATACode,
+      },
+    });
   }
 };
 //点击树事件
 const handleNodeClick = (data) => {
-  company.value = data.label;
+  // console.log(data);
+  company.value = data.companyName;
+  companyID.value = data.companyID;
+  tableData.value = [];
+  getQuery();
+};
+//获取表格数据
+const getQuery = async () => {
+  try {
+    const { code, returnData } = await Query({
+      id: DATACONTENT_ID.airportTableId,
+      needPage: ++page.value,
+      dataContent: [JSON.stringify(companyID.value)],
+    });
+    if (code === "0") {
+      if (returnData.listValues.length === 0) {
+        page.value--;
+        noMore.value = true;
+      }
+      const titleColumn = returnData.columnSet.find(
+        (item) => item.needShow === 1
+      );
+      if (titleColumn) {
+        rowTitle.value = titleColumn.columnName;
+      }
+      tableData.value.push(...returnData.listValues);
+      if (returnData.columnSet) {
+        BtnGroupWidth.value = "300px";
+      } else {
+        BtnGroupWidth.value = "";
+      }
+      tableCols.value = returnData.columnSet;
+      tableCols.value.forEach((element) => {
+        element.label = element.columnLabel;
+        element.key = element.columnName;
+        // if (element.columnName === "queryTemplate") {
+        //   element.width = "300px";
+        // }
+      });
+      serviceId.value = returnData.submitID;
+    } else {
+      page.value--;
+    }
+  } catch (error) {
+    page.value--;
+  }
 };
+//公司列表
+const getAirlines = async () => {
+  try {
+    const res = await Query({
+      id: DATACONTENT_ID.airportTreeId,
+      dataContent: [],
+    });
+    if (res.code === "0") {
+      let arr = [];
+      arr = translateDataToTreeAll(
+        res.returnData.listValues,
+        "parentID",
+        "companyID"
+      );
+      data.value = arr;
+      // if (!company.length) {
+      //   company.value = arr[0].companyID;
+      //   company.value = arr[0].companyName;
+      // }
+    } else {
+      // this.$message.error(res.message ?? "失败");
+    }
+  } catch (error) {
+    // this.$message.error("失败");
+  }
+};
+//确认提交
+const submitForm = () => {
+  generalDataReception(tableForm);
+};
+const resetTable = () => {
+  page.value = 0;
+  noMore.value = false;
+  tableData.value = [];
+};
+//新增-编辑-删除
+const generalDataReception = async (data) => {
+  try {
+    data = {
+      ...data,
+      ...dataContent,
+    };
+    const { code } = await GeneralDataReception({
+      serviceId: serviceId.value,
+      dataContent: JSON.stringify(data),
+    });
+    if (code == 0) {
+      ElMessage.success(`操作成功`);
+      // this.$message.success("操作成功");
+      resetTable();
+      getQuery();
+      resetForm();
+      flag.value = false;
+      // rmFlag.value = false;
+      tableObj.value = {};
+      // this.$router.go(0);
+    } else {
+      ElMessage.error(`操作失败`);
+      // this.$message.error("操作失败");
+      // this.flag = false;
+      // this.rmFlag = false;
+      tableObj.value = {};
+      resetForm();
+    }
+  } catch (error) {
+    flag.value = false;
+    //  rmFlag.value = false;
+    tableObj.value = {};
+    resetForm();
+  }
+};
+const delRemove = () => {
+  tableForm.event = 3;
+  generalDataReception(tableForm);
+};
+
+getAirlines();
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 99 - 1
src/views/BasicsData/airportInfo/positionSetting/index.vue

@@ -10,7 +10,7 @@
       >
       <div class="app-containers">
         <DataTable
-          :tableHeader="state.list"
+          :tableHeader="tableCols"
           :tableData="tableData"
           :tableBtnGroup="tableBtnGroup"
           :tableProperty="{ rowKey: 'ID' }"
@@ -23,6 +23,8 @@
         :msgTitle="msgTitle"
         @resetForm="resetForm"
         @delRest="delRest"
+        @submitForm="submitForm"
+        @delRemove="delRemove"
       >
         <div class="diacont">
           <el-form :model="tableForm">
@@ -79,6 +81,15 @@
 import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
+import { Query, GeneralDataReception } from "@/api/webApi";
+import { ElMessage } from "element-plus";
+const page = ref<number>(0); //分页参数
+const dataContent = ref<object>({});
+const noMore = ref<Boolean>(false);
+const rowTitle = ref<String>("");
+const tableCols = ref([]); //表头数据
+const serviceId = ref<String>("");
+const tableObj = ref({}); //增删改数据缓存
 const flag = ref<Boolean>(false); //弹窗开关
 const type = ref<String>(""); //判断是否删除
 const msgTitle = ref<String>("新增位置设置"); //弹窗标题
@@ -89,6 +100,7 @@ const tableForm = reactive({
   englin: "",
   two: "",
   three: "",
+  event: "",
 }); //弹窗内容
 //列表
 const tableData = ref([
@@ -140,6 +152,7 @@ const tableBtnGroup = ref([
 //新增
 const addForm = () => {
   msgTitle.value = "新增位置";
+  tableForm.event = 1;
   flag.value = true;
   type.value = "";
 };
@@ -169,6 +182,10 @@ const eleDialog = () => {
   flag.value = true;
   type.value = "del";
 };
+const delRemove = () => {
+  tableForm.event = 3;
+  generalDataReception(tableForm);
+};
 //删除
 const delRest = () => {
   flag.value = false;
@@ -191,6 +208,87 @@ const btnClick = (row, index, param) => {
   } else if (param === 4) {
   }
 };
+//获取表格数据
+const getQuery = async () => {
+  try {
+    const { code, returnData } = await Query({
+      id: DATACONTENT_ID.airpositTableId,
+      needPage: ++page.value,
+      dataContent: Object.values(dataContent.value),
+    });
+    if (code === "0") {
+      if (returnData.listValues.length === 0) {
+        page.value--;
+        noMore.value = true;
+      }
+      const titleColumn = returnData.columnSet.find(
+        (item) => item.needShow === 1
+      );
+      if (titleColumn) {
+        rowTitle.value = titleColumn.columnName;
+      }
+      tableData.value.push(...returnData.listValues);
+      tableCols.value = returnData.columnSet;
+      tableCols.value.forEach((element) => {
+        element.label = element.columnLabel;
+        element.key = element.columnName;
+        // if (element.columnName === "queryTemplate") {
+        //   element.width = "300px";
+        // }
+      });
+      serviceId.value = returnData.submitID;
+    } else {
+      page.value--;
+    }
+  } catch (error) {
+    page.value--;
+  }
+};
+//确认提交
+const submitForm = () => {
+  generalDataReception(tableForm);
+};
+const resetTable = () => {
+  page.value = 0;
+  noMore.value = false;
+  tableData.value = [];
+};
+//新增-编辑-删除
+const generalDataReception = async (data) => {
+  try {
+    data = {
+      ...data,
+      ...dataContent,
+    };
+    const { code } = await GeneralDataReception({
+      serviceId: serviceId.value,
+      dataContent: JSON.stringify(data),
+    });
+    if (code == 0) {
+      ElMessage.success(`操作成功`);
+      // this.$message.success("操作成功");
+      resetTable();
+      getQuery();
+      resetForm();
+      flag.value = false;
+      // rmFlag.value = false;
+      tableObj.value = {};
+      // this.$router.go(0);
+    } else {
+      ElMessage.error(`操作失败`);
+      // this.$message.error("操作失败");
+      // this.flag = false;
+      // this.rmFlag = false;
+      tableObj.value = {};
+      resetForm();
+    }
+  } catch (error) {
+    flag.value = false;
+    //  rmFlag.value = false;
+    tableObj.value = {};
+    resetForm();
+  }
+};
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 230 - 2
src/views/dashboard/index.vue

@@ -1,7 +1,235 @@
 <template>
-  <div class="scroll-y">
-    首页
+  <div class="dashboard">
+    <div class="dashboard-head flex">
+      <div class="dashboard-head-title">{{title}}</div>
+      <div class="dashboard-head-tabs flex-wrap">
+        <div class="dashboard-head-tabs-list" :class="tabsIndex == index ? 'active' : ''" @click="tabClick(item,index)" v-for="(item,index) in tabs" :key="index">{{item.label}}</div>
+      </div>
+      <div class="dashboard-head-zw"></div>
+    </div>
+    <div class="dashboard-content">
+      <div v-if="false" class="dashboard-content-top flex">
+        <div class="dashboard-content-top-left">
+          <Echarts id="ww" :option="optionLeft" />
+        </div>
+        <div class="dashboard-content-top-center">2</div>
+        <div class="dashboard-content-top-right">3</div>
+      </div>
+      <div class="dashboard-content-bottom"></div>
+    </div>
   </div>
 </template>
+
 <script setup lang="ts">
+import { ref } from "vue";
+import Echarts from "@/components/Echarts/commonChartsBar.vue";
+const title = ref("决策管理驾驶舱");
+const tabs = [
+  {
+    id: 1,
+    label: "国内进港",
+    value: "one",
+  },
+  {
+    id: 2,
+    label: "国内出港",
+    value: "two",
+  },
+  {
+    id: 3,
+    label: "国际进港",
+    value: "three",
+  },
+  {
+    id: 4,
+    label: "国际出港",
+    value: "four",
+  },
+];
+const tabsIndex = ref(2);
+const optionLeft = {
+  tooltip: {
+    trigger: "axis",
+  },
+  // legend: {
+  //   data: ['运输总数', '托运旅客数'],
+  //   show: true,
+  //   top: 0,
+  //   icon: 'roundRect'
+  // },
+  grid: {
+    left: "0%",
+    right: "0%",
+    bottom: "0%",
+    top: "15%",
+    containLabel: true,
+  },
+  color: ["#F5BB3D", "#73D970", "#6A9DD9"],
+  xAxis: {
+    type: "category",
+    boundaryGap: true,
+    data: ["2021.12", "2022.01", "2022.02", "2022.03", "2022.04", "2022.05"],
+    axisLine: {
+      show: true,
+      lineStyle: {
+        color: "#8897BC",
+      },
+    },
+    axisTick: {
+      show: false,
+    },
+    axisLabel: {
+      color: "#8897BC",
+    },
+  },
+  yAxis: {
+    type: "value",
+    axisLabel: {
+      color: "#8897BC",
+      formatter: function (item) {
+        return item / 10000 + "万";
+      },
+    },
+    splitLine: {
+      lineStyle: {
+        type: "dashed",
+        color: "rgba(196,194,225, 0.54)",
+      },
+    },
+  },
+  series: [
+    {
+      name: "运输总数",
+      type: "line",
+      symbol: "none",
+      key: "bagsnum",
+      data: [120, 132, 101, 134, 90, 230, 210],
+      areaStyle: {
+        color: {
+          type: "linear",
+          x: 0,
+          y: 0,
+          x2: 0,
+          y2: 1,
+          colorStops: [
+            {
+              offset: 0,
+              color: "rgba(125,72,255,0.5)",
+            },
+            {
+              offset: 1,
+              color: "rgba(0,180,255,0.01)",
+            },
+          ],
+          global: false,
+        },
+      },
+    },
+    {
+      name: "托运旅客数",
+      type: "line",
+      symbol: "none",
+      key: "passengers",
+      data: [220, 182, 191, 234, 290, 330, 310],
+      areaStyle: {
+        color: {
+          type: "linear",
+          x: 0,
+          y: 0,
+          x2: 0,
+          y2: 1,
+          colorStops: [
+            {
+              offset: 0,
+              color: "rgba(125,72,255,0.5)",
+            },
+            {
+              offset: 1,
+              color: "rgba(0,180,255,0.01)",
+            },
+          ],
+          global: false,
+        },
+      },
+    },
+  ],
+};
+const tabClick = (item, index) => {
+  tabsIndex.value = index;
+  console.log(item, index);
+};
 </script>
+
+<style lang="scss" scoped>
+.dashboard {
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  left: 0;
+  top: 0;
+  background: linear-gradient(185deg, #1e305f, #0f1015);
+  z-index: 2000;
+  color: #fff;
+  &-head {
+    padding: 0 32px;
+    height: 48px;
+    line-height: 48px;
+    background: #1d2948;
+    &-title {
+      font-size: 24px;
+      font-family: Microsoft YaHei;
+      font-weight: bold;
+      color: #51dee9;
+    }
+    &-tabs {
+      font-size: 16px;
+      font-family: Microsoft YaHei;
+      font-weight: 400;
+      color: #ffffff;
+      &-list {
+        margin-right: 60px;
+        cursor: pointer;
+        position: relative;
+        &:last-child {
+          margin-right: 0;
+        }
+      }
+      .active {
+        color: #51dee9;
+        &::after {
+          content: "";
+          position: absolute;
+          bottom: 0;
+          width: 80%;
+          left: 10%;
+          height: 2px;
+          background: #51dee9;
+        }
+      }
+    }
+    &-zw {
+      width: 190px;
+    }
+  }
+  &-content {
+    padding: 24px 32px;
+    &-top {
+      width: 100%;
+      height: 60vh;
+      &-left,
+      &-right {
+        width: 25%;
+        position: relative;
+      }
+      &-center {
+        width: 50%;
+      }
+    }
+    .pBox {
+      background-image: url("../../assets/home/pic_border.png");
+      background-repeat: no-repeat;
+      background-size: 100% 100%;
+    }
+  }
+}
+</style>

+ 55 - 47
src/views/systemSettings/queryTemplate/queryTemplateAdd.vue

@@ -13,66 +13,64 @@
       </template></Minheader
     >
     <div class="app-container">
-      <el-form :model="tableForm">
+      <el-form :model="ruleForm">
         <el-row :gutter="24">
-          <el-col :span="5">
+          <el-col :span="6">
             <el-form-item label="查询模板名称" size="default">
               <el-input
-                v-model="tableForm.queryTemplateName"
+                v-model="ruleForm.queryTemplateName"
                 placeholder="请输入查询模板名称"
               />
             </el-form-item>
           </el-col>
-          <el-col :span="5">
+          <el-col :span="6">
             <el-form-item label="数据源" prop="dataSourceID" size="default">
               <el-select
-                v-model="tableForm.dataSourceID"
+                v-model="ruleForm.dataSourceID"
                 placeholder="请选择"
                 clearable
               >
                 <el-option
-                  v-for="item in tableOptionser"
-                  :key="item.v"
-                  :label="item.k"
-                  :value="item.v"
+                  v-for="item in dataSourceList"
+                  :key="item.dataSourceID"
+                  :label="item.dataSourceName"
+                  :value="item.dataSourceID"
                 />
               </el-select>
             </el-form-item>
-            <!-- <el-form-item label="查询协议" size="default">
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="服务名称" prop="submitID" size="default">
               <el-select
-                style="width: 100%"
-                v-model="tableForm.china"
-                class="input-shadow"
-                filterable
-                default-first-option
+                v-model="ruleForm.submitID"
+                placeholder="请选择"
                 clearable
-                placeholder="请选择查询协议"
               >
                 <el-option
-                  v-for="item in tableOptionser"
-                  :key="item.v ? item.v : item.planDepartureApt"
-                  :label="item.k ? item.k : item.planDepartureApt"
-                  :value="item.v ? item.v : item.planDepartureApt"
-                >
-                </el-option>
+                  v-for="item in serviceList"
+                  :key="item.submitID"
+                  :label="item.serviceName"
+                  :value="item.submitID"
+                />
               </el-select>
-            </el-form-item> -->
+            </el-form-item>
           </el-col>
-          <el-col :span="14">
-            <el-form-item label="查询模板描述" size="default">
+          <el-col :span="6">
+            <el-form-item label="每页显示" prop="pageRows" size="default">
               <el-input
-                v-model="tableForm.queryTemplateDescribe"
-                placeholder="请输入查询模板描述"
+                v-model="ruleForm.pageRows"
+                size="medium"
+                placeholder="请输入每页显示行数"
+                type="number"
+                clearable
               />
             </el-form-item>
           </el-col>
           <el-col>
-            <el-form-item label="查询配置" size="default">
+            <el-form-item label="查询模板描述" size="default">
               <el-input
-                :autosize="{ minRows: 4, maxRows: 4 }"
-                type="textarea"
-                v-model="tableForm.two"
-                placeholder="请输入查询配置"
+                v-model="ruleForm.queryTemplateDescribe"
+                placeholder="请输入查询模板描述"
               />
             </el-form-item>
           </el-col>
@@ -81,7 +79,7 @@
               <el-input
                 :autosize="{ minRows: 24, maxRows: 24 }"
                 type="textarea"
-                v-model="tableForm.serviceName"
+                v-model="ruleForm.serviceName"
                 placeholder="请输入查询语句"
               />
             </el-form-item>
@@ -95,43 +93,47 @@
 <script setup lang="ts">
 import Minheader from "@/components/minheader/index.vue";
 import { Query, myQuery } from "@/api/webApi";
+import { ElMessage } from "element-plus";
 const router = useRouter();
-const tableOptionser = ref<Array>([]); //下拉
-const tableForm = reactive({
+const asShOW = ref<boolean>(false);
+const dataSourceList = ref<Array>([]); //下拉
+const serviceList = ref<Array>([]); //下拉
+const ruleForm = reactive({
   queryTemplateName: "",
   queryTemplateDescribe: "",
   submitID: null,
   queryTemplate: "",
   pageRows: null,
-  serviceName: "",
-  dataSourceID: "",
 }); //内容
 //保存
 const preserForm = async () => {
   const params = {
-    ...tableForm,
-    submitID: tableForm.serviceID,
+    ...ruleForm,
+    submitID: ruleForm.serviceID,
   };
   delete params.serviceID;
   try {
     const res = await Query({
-      serviceId: "5",
+      serviceId: SERVICE_ID.sysQueryTabId,
       dataContent: JSON.stringify(params),
     });
     if (Number(res.code) === 0) {
+      ElMessage.success(`成功`);
+      router.push({ path: "/systemSettings/queryTemplate" });
       // this.$message.success(res.message ?? "成功");
       // this.$router.push("/systemSettings/queryTemplate");
     } else {
+      ElMessage.error(`失败`);
       // this.$message.error(res.message ?? "失败");
     }
   } catch (error) {
-    // this.$message.error("失败");
+    ElMessage.error(`失败`);
   }
   // router.push({ path: "/systemSettings/queryTemplate" });
 };
 const getDataSourceList = async () => {
-  const tableOptionser = await getSelectOption(13);
-  tableOptionser.value = tableOptionser.map((item) => {
+  const dataSourceLists = await getSelectOption(13);
+  dataSourceList.value = dataSourceLists.map((item) => {
     item[item.setlabel] = item.k;
     item[item.setvalue] = item.v;
     return item;
@@ -146,10 +148,16 @@ const getSelectOption = async (ID) => {
     return [];
   }
 };
-
-onMounted(() => {
-  getDataSourceList();
-});
+const queryServiceList = async (ID) => {
+  const serviceLists = await getSelectOption(DATACONTENT_ID.sysServiceTabId);
+  serviceList.value = serviceLists.map((item) => {
+    item[item.setlabel] = item.k;
+    item[item.setvalue] = item.v;
+    return item;
+  });
+};
+getDataSourceList();
+queryServiceList();
 </script>
 
 <style lang="scss" scoped>