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

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

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

+ 20 - 0
public/demo.js

@@ -27,6 +27,14 @@ const DATACONTENT_ID = {
   authTreeId: 40, //权限管理-权限树
   authTreeNewId: 92, //权限管理-权限树
 
+  /***-----应用管理------***/
+  appTableId: 39, //应用管理
+
+  /***-----账号管理------***/
+  accountTableId: 78, //账号管理-首页-列表
+  accountRoleId: 43, //账号管理-根据id查角色
+  accountDetailsId: 45, //账号管理-根据id查详情
+
   /***-----账号组管理------***/
   accountGroupTableId: 18034, //账号组管理-首页-列表
   accountGroupSelId: 18035, //账号组管理-下拉
@@ -65,14 +73,26 @@ const DATACONTENT_ID = {
   sysServiceStrategyId: 18033, //预警报警策略(按照ID)
   sysSourceId: 13, //系统设置-数据源-id
   sysQueryEditId: 24, //系统设置-查询模板-编辑-根据id获取服务
+  sysQueryChildTabId: 25, //系统设置-查询模板-列设置-表格-id
+  sysQueryChildEditTabId: 26, //系统设置-查询模板-列设置-表格-编辑-id
   sysServiceTopTable: 31, //系统设置-服务管理-服务拓扑-查看日志
   messageQueryTabId: 1803442, //系统设置-消息查询-表格-id
+
+  /***-----数据查询------***/
+  flightTabId: 1803439, //数据查询-航班-表格-id
+  waybillTabId: 1803441, //数据查询-运单-表格-id
+  goodsTabId: 1803440, //数据查询-货物-表格-id
 };
 
 const SERVICE_ID = {
   sysQueryTabId: 5, //系统设置-查询模板-表格-增删改
   /***-----权限项管理------***/
   authScId: 13, //权限项管理-增删改
+  /***-----应用管理------***/
+  appScId: 12, //应用管理-增删改
+  /***-----账号管理------***/
+  accountScId: 17, //账号管理-增删改
+  roleScId: 16, //账号管理-角色授权-增删改
   /***-----角色管理------***/
   roleMsgId: 14, //角色管理-增删改
   roleMsgTreeId: 15, //角色管理-权限树-增删改

+ 11 - 3
src/components/minheader/index.vue

@@ -6,6 +6,8 @@
     <div v-if="isStatus || isStatuser" class="vStatus flex-act">
       <slot name="header" />
       <el-date-picker
+        format="YYYY/MM/DD"
+        value-format="YYYY-MM-DD"
         v-if="isTime"
         v-model="startTime"
         type="date"
@@ -15,6 +17,8 @@
       </el-date-picker>
       <el-date-picker
         v-if="isTime"
+        format="YYYY/MM/DD"
+        value-format="YYYY-MM-DD"
         class="L12"
         size="default"
         v-model="endTime"
@@ -94,6 +98,7 @@
 <script setup lang="ts">
 import Search from "@/components/search/index.vue";
 import { ElMessage } from "element-plus";
+import momentMini from "moment-mini";
 const props = defineProps({
   //是否显示新增按钮
   isBtn: {
@@ -153,20 +158,22 @@ const props = defineProps({
 });
 //搜索内容
 const input = ref("");
-const startTime = ref<String>(""); //时间
-const endTime = ref<String>(""); //时间
+const startTime = momentMini(new Date()).format("YYYY-MM-DD"); //时间
+const endTime = momentMini(new Date()).format("YYYY-MM-DD"); //时间
 const emits = defineEmits([
   "addForm",
   "preserForm",
   "addJournalForm",
   "addslotForm",
   "showForm",
+  "searchForm",
 ]);
 const addBbut = () => {
   emits("addForm");
 };
 const search = (val) => {
-  ElMessage.success(`搜索成功:${val}`);
+  emits("searchForm", [startTime, endTime, val]);
+  // ElMessage.success(`搜索成功:${val}`);
 };
 const clear = () => {
   ElMessage.success(`清除`);
@@ -187,6 +194,7 @@ const addslot = () => {
 const show = () => {
   emits("showForm");
 };
+search();
 </script>
 <style lang="scss" scoped>
 .data-table-btn {

+ 103 - 60
src/router/routes/routes-file-four.ts

@@ -3,18 +3,18 @@ import Layout from '@/layout'
 const HomeRoutes = {
   path: '/systemSettings',
   component: Layout,
-  name: 'systemSettings',
-  redirect: '/systemSettings/securityPolicy',
+  name: "systemSettings",
+  redirect: "/systemSettings/warningSet",
   //using el svg icon, the elSvgIcon first when at the same time using elSvgIcon and icon
   meta: { title: '系统配置', elSvgIcon: 'Fold', breadcrumb: false },
   children: [
-    {
-      path: '/systemSettings/securityPolicy',
-      name: 'SecurityPolicy',
-      meta: { title: '安全策略', elSvgIcon: 'Fold', icon: 'table' },
-      component: () =>
-        import('@/views/systemSettings/securityPolicy/index.vue'),
-    },
+    // {
+    //   path: "/systemSettings/securityPolicy",
+    //   name: "SecurityPolicy",
+    //   meta: { title: "安全策略", elSvgIcon: "Fold", icon: "table" },
+    //   component: () =>
+    //     import("@/views/systemSettings/securityPolicy/index.vue"),
+    // },
     {
       path: '/systemSettings/securityPolicyedit',
       name: 'SecurityPolicyedit',
@@ -24,17 +24,30 @@ const HomeRoutes = {
         import('@/views/systemSettings/securityPolicy/securityPolicyedit.vue'),
     },
     {
-      path: '/systemSettings/warningSet',
-      name: 'WarningSet',
-      meta: { title: '预警告警策略', elSvgIcon: 'Fold', icon: 'table' },
-      component: () => import('@/views/systemSettings/warningSet/index.vue'),
-    },
-    {
-      path: '/systemSettings/warningEdit',
-      name: 'WarningEdit',
-      hidden: true,
-      meta: { title: '预警告警策略编辑', elSvgIcon: 'Fold', icon: 'table' },
-      component: () => import('@/views/systemSettings/warningEdit/index.vue'),
+      path: "/systemSettings/warningSet",
+      name: "WarningSet",
+      meta: { title: "预警告警策略", elSvgIcon: "Fold", icon: "table" },
+      redirect: "/systemSettings/warningSet",
+      component: {
+        render: () => h(resolveComponent("router-view")),
+      },
+      children: [
+        {
+          path: "/systemSettings/warningSet",
+          name: "WarningSet",
+          hidden: true,
+          component: () =>
+            import("@/views/systemSettings/warningSet/index.vue"),
+        },
+        {
+          path: "/systemSettings/warningEdit",
+          name: "WarningEdit",
+          hidden: true,
+          meta: { title: "预警告警策略编辑", elSvgIcon: "Fold", icon: "table" },
+          component: () =>
+            import("@/views/systemSettings/warningEdit/index.vue"),
+        },
+      ],
     },
     {
       path: '/systemSettings/log',
@@ -85,34 +98,50 @@ const HomeRoutes = {
       ],
     },
     {
-      path: '/systemSettings/queryTemplate',
-      name: 'QueryTemplate',
-      meta: { title: '查询模板', elSvgIcon: 'Fold', icon: 'table' },
-      component: () => import('@/views/systemSettings/queryTemplate/index.vue'),
-    },
-    {
-      path: '/systemSettings/queryTemplateAdd',
-      name: 'QueryTemplateAdd',
-      hidden: true,
-      meta: { title: '新增查询模板', elSvgIcon: 'Fold', icon: 'table' },
-      component: () =>
-        import('@/views/systemSettings/queryTemplate/queryTemplateAdd.vue'),
-    },
-    {
-      path: '/systemSettings/queryTemplateEdit',
-      name: 'QueryTemplateEdit',
-      hidden: true,
-      meta: { title: '编辑查询模板', elSvgIcon: 'Fold', icon: 'table' },
-      component: () =>
-        import('@/views/systemSettings/queryTemplate/queryTemplateEdit.vue'),
-    },
-    {
-      path: '/systemSettings/queryTemplateColumn',
-      name: 'QueryTemplateColumn',
-      hidden: true,
-      meta: { title: '查询模板设置', elSvgIcon: 'Fold', icon: 'table' },
-      component: () =>
-        import('@/views/systemSettings/queryTemplate/queryTemplateColumn.vue'),
+      path: "/systemSettings/queryTemplate",
+      name: "QueryTemplate",
+      meta: { title: "查询模板", elSvgIcon: "Fold", icon: "table" },
+      redirect: "/systemSettings/queryTemplate",
+      component: {
+        render: () => h(resolveComponent("router-view")),
+      },
+      children: [
+        {
+          path: "/systemSettings/queryTemplate",
+          name: "QueryTemplate",
+          hidden: true,
+          component: () =>
+            import("@/views/systemSettings/queryTemplate/index.vue"),
+        },
+        {
+          path: "/systemSettings/queryTemplateAdd",
+          name: "QueryTemplateAdd",
+          hidden: true,
+          meta: { title: "新增查询模板", elSvgIcon: "Fold", icon: "table" },
+          component: () =>
+            import("@/views/systemSettings/queryTemplate/queryTemplateAdd.vue"),
+        },
+        {
+          path: "/systemSettings/queryTemplateEdit",
+          name: "QueryTemplateEdit",
+          hidden: true,
+          meta: { title: "编辑查询模板", elSvgIcon: "Fold", icon: "table" },
+          component: () =>
+            import(
+              "@/views/systemSettings/queryTemplate/queryTemplateEdit.vue"
+            ),
+        },
+        {
+          path: "/systemSettings/queryTemplateColumn",
+          name: "QueryTemplateColumn",
+          hidden: true,
+          meta: { title: "查询模板设置", elSvgIcon: "Fold", icon: "table" },
+          component: () =>
+            import(
+              "@/views/systemSettings/queryTemplate/queryTemplateColumn.vue"
+            ),
+        },
+      ],
     },
     // {
     //   path: "/systemSettings/sourceservice",
@@ -142,18 +171,32 @@ const HomeRoutes = {
         import('@/views/systemSettings/protocolManagement/index.vue'),
     },
     {
-      path: '/systemSettings/datastructure',
-      name: 'Datastructure',
-      meta: { title: '数据结构管理', elSvgIcon: 'Fold', icon: 'table' },
-      component: () => import('@/views/systemSettings/datastructure/index.vue'),
-    },
-    {
-      path: '/systemSettings/datastructureTerm',
-      name: 'DatastructureTerm',
-      hidden: true,
-      meta: { title: '数据项', elSvgIcon: 'Fold', icon: 'table' },
-      component: () =>
-        import('@/views/systemSettings/datastructure/datastructureTerm.vue'),
+      path: "/systemSettings/datastructure",
+      name: "Datastructure",
+      meta: { title: "数据结构管理", elSvgIcon: "Fold", icon: "table" },
+      redirect: "/systemSettings/datastructure",
+      component: {
+        render: () => h(resolveComponent("router-view")),
+      },
+      children: [
+        {
+          path: "/systemSettings/datastructure",
+          hidden: true,
+          name: "Datastructure",
+          component: () =>
+            import("@/views/systemSettings/datastructure/index.vue"),
+        },
+        {
+          path: "/systemSettings/datastructureTerm",
+          name: "DatastructureTerm",
+          hidden: true,
+          meta: { title: "数据项", elSvgIcon: "Fold", icon: "table" },
+          component: () =>
+            import(
+              "@/views/systemSettings/datastructure/datastructureTerm.vue"
+            ),
+        },
+      ],
     },
     {
       path: '/systemSettings/messageTemplate',

+ 61 - 25
src/router/routes/routes-file-three.ts

@@ -24,23 +24,47 @@ const HomeRoutes = {
       path: "/BasicsData/airportInfo",
       name: "AirportInfo",
       meta: { title: "机场信息维护", elSvgIcon: "Fold", icon: "table" },
-      component: () => import("@/views/BasicsData/airportInfo/index.vue"),
-    },
-    {
-      path: "/BasicsData/airportInfoChild",
-      name: "AirportInfoChild",
-      hidden: true,
-      meta: { title: "航站楼设置", elSvgIcon: "Fold", icon: "table" },
-      component: () =>
-        import("@/views/BasicsData/airportInfo/airportInfoChild/index.vue"),
-    },
-    {
-      path: "/BasicsData/positionSetting",
-      name: "PositionSetting",
-      hidden: true,
-      meta: { title: "位置设置", elSvgIcon: "Fold", icon: "table" },
-      component: () =>
-        import("@/views/BasicsData/airportInfo/positionSetting/index.vue"),
+      redirect: "/BasicsData/airportInfo",
+      component: {
+        render: () => h(resolveComponent("router-view")),
+      },
+      children: [
+        {
+          path: "/BasicsData/airportInfo",
+          hidden: true,
+          component: () => import("@/views/BasicsData/airportInfo/index.vue"),
+        },
+        {
+          path: "/BasicsData/airportInfoChild",
+          name: "AirportInfoChild",
+          hidden: true,
+          meta: { title: "航站楼设置", elSvgIcon: "Fold", icon: "table" },
+          redirect: "/BasicsData/airportInfoChild",
+          component: {
+            render: () => h(resolveComponent("router-view")),
+          },
+          children: [
+            {
+              path: "/BasicsData/airportInfoChild",
+              hidden: true,
+              component: () =>
+                import(
+                  "@/views/BasicsData/airportInfo/airportInfoChild/index.vue"
+                ),
+            },
+            {
+              path: "/BasicsData/positionSetting",
+              name: "PositionSetting",
+              hidden: true,
+              meta: { title: "位置设置", elSvgIcon: "Fold", icon: "table" },
+              component: () =>
+                import(
+                  "@/views/BasicsData/airportInfo/positionSetting/index.vue"
+                ),
+            },
+          ],
+        },
+      ],
     },
     {
       path: "/BasicsData/deployNode",
@@ -51,15 +75,27 @@ const HomeRoutes = {
     {
       path: "/BasicsData/modelMaintenance",
       name: "ModelMaintenance",
+      redirect: "/BasicsData/modelMaintenance",
       meta: { title: "机型维护", elSvgIcon: "Fold", icon: "table" },
-      component: () => import("@/views/BasicsData/modelMaintenance/index.vue"),
-    },
-    {
-      path: "/BasicsData/modelMaintenance/shippingSpace",
-      name: "ShippingSpace",
-      hidden: true,
-      meta: { title: "舱位管理", elSvgIcon: "Fold", icon: "table" },
-      component: () => import("@/views/BasicsData/shippingSpace/index.vue"),
+      component: {
+        render: () => h(resolveComponent("router-view")),
+      },
+      children: [
+        {
+          path: "/BasicsData/modelMaintenance",
+          name: "ModelMaintenance",
+          hidden: true,
+          component: () =>
+            import("@/views/BasicsData/modelMaintenance/index.vue"),
+        },
+        {
+          path: "/BasicsData/modelMaintenance/shippingSpace",
+          name: "ShippingSpace",
+          hidden: true,
+          meta: { title: "舱位管理", elSvgIcon: "Fold", icon: "table" },
+          component: () => import("@/views/BasicsData/shippingSpace/index.vue"),
+        },
+      ],
     },
     {
       path: "/BasicsData/containerMaintenance",

+ 188 - 177
src/views/dataQuery/flightQuery/index.vue

@@ -7,6 +7,7 @@
         :is-Show="true"
         :is-Time="true"
         @showForm="showForm"
+        @searchForm="searchForm"
       >
         <template #header>
           <div class="status flex-wrap">
@@ -16,10 +17,9 @@
       >
       <div class="app-containers">
         <DataTable
-          :tableHeader="state.list"
+          :tableHeader="tableCols"
           :tableData="tableData"
           :tableProperty="{ rowKey: 'ID' }"
-          @btnClick="btnClick"
         />
       </div>
       <!-- <Dialog
@@ -58,183 +58,155 @@ import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import TableColumnSet from "@/components/tableColumnSet/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 dialogVisible = ref<Boolean>(false); //列设置弹窗开关
-const tableCols = ref([
-  {
-    prop: "flightNO",
-    label: "航班号",
-    desc: "指航班编号",
-    width: 80,
-    fixed: "left",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "flightDate",
-    label: "执飞日期",
-    desc:
-      "指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)",
-    width: 105,
-    fixed: "left",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "planDepartureTime",
-    label: "起飞时间",
-    desc:
-      "根据优先级别显示时间。优先级别:1.实际起飞时间,2.预计起飞时间,3.计划起飞时间",
-    width: 150,
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "targetAirport",
-    label: "目的站",
-    desc: "指航班执飞航段的目的航站,以航站三字码显示",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "departureBuild",
-    label: "航站楼",
-    desc: "指航班执飞航段的目的航站楼",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "bordingGate",
-    label: "登机口",
-    desc: "指航班的登机口代码,数据是变化的,仅显示最新信息",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "standForDepartrue",
-    label: "停机位",
-    desc: "指航班的停机位代码,数据是变化的,仅显示最新信息",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "checkInTravellerNumber",
-    label: "托运旅客",
-    desc: "指航班已办理行李托运业务的旅客人数,含取消托运的旅客人数",
-  },
-  {
-    prop: "checkInNumber",
-    label: "值机数",
-    desc: "指已办理值机托运的行李数量,含取消托运的行李数量,含未激活",
-  },
-  {
-    prop: "unActive",
-    label: "未激活",
-    desc:
-      "指最后的 BSM 报文“.S”中行李状态为“I”的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "preLoad",
-    label: "预计装载",
-    desc: "指已办理值机托运的行李数量,不含取消托运的行李数量,不包含未激活",
-  },
-  {
-    prop: "checkNumber",
-    label: "安检",
-    desc: "指进行安检的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "sortNumber",
-    label: "分拣",
-    desc: "指已分拣完成的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "loadNumber",
-    label: "装车",
-    desc: "指已在分拣口装车完成的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "boardID",
-    label: "装机",
-    desc: "指装机完成的行李数量,不含取消托运的行李数量",
-  },
-  {
-    prop: "tounLoad",
-    label: "待翻减",
-    desc:
-      "指旅客在办理行李托运后,旅客取消该行李的托运并且行李此时已经过装车节点,而没有完成翻减的行李数量(须翻减总数减去已翻减数)",
-  },
-  {
-    prop: "OFFCount",
-    label: "已翻减",
-    desc:
-      "指旅客在办理行李托运后,旅客取消该行李的托运并且行李此时已经过装车节点,且已完成翻减的行李数量",
-  },
-  {
-    prop: "noCheckInNumber",
-    label: "取消托运",
-    desc: "指旅客在办理行李托运后,又取消托运的行李总数量",
-  },
-  {
-    prop: "noBSM",
-    label: "无BSM",
-    desc: "行李有处理信息(BPM)但无值机信息(BSM)的行李数量",
-  },
-  {
-    prop: "warning",
-    label: "风险预警",
-    desc:
-      "指依据航班信息中预计起飞时间和当前时间差,与根据分拣到停机位设置的报警阈值对比,超过阈值的为风险行李,本项显示风险预警行李数量",
-  },
-  {
-    prop: "exceptions",
-    label: "未装机行李",
-    desc: "指航班关闭货舱门后,应装而未装的行李数量",
-  },
-  {
-    prop: "midIn",
-    label: "中转进行李",
-    desc: "指从其他航班中转到当前航班的行李数量",
-  },
-]);
+// const tableCols = ref([
+//   {
+//     prop: "flightNO",
+//     label: "航班号",
+//     desc: "指航班编号",
+//     width: 80,
+//     fixed: "left",
+//     filterable: true,
+//     sortable: true,
+//   },
+//   {
+//     prop: "flightDate",
+//     label: "执飞日期",
+//     desc:
+//       "指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)",
+//     width: 105,
+//     fixed: "left",
+//     filterable: true,
+//     sortable: true,
+//   },
+//   {
+//     prop: "planDepartureTime",
+//     label: "起飞时间",
+//     desc:
+//       "根据优先级别显示时间。优先级别:1.实际起飞时间,2.预计起飞时间,3.计划起飞时间",
+//     width: 150,
+//     filterable: true,
+//     sortable: true,
+//   },
+//   {
+//     prop: "targetAirport",
+//     label: "目的站",
+//     desc: "指航班执飞航段的目的航站,以航站三字码显示",
+//     filterable: true,
+//     sortable: true,
+//   },
+//   {
+//     prop: "departureBuild",
+//     label: "航站楼",
+//     desc: "指航班执飞航段的目的航站楼",
+//     filterable: true,
+//     sortable: true,
+//   },
+//   {
+//     prop: "bordingGate",
+//     label: "登机口",
+//     desc: "指航班的登机口代码,数据是变化的,仅显示最新信息",
+//     filterable: true,
+//     sortable: true,
+//   },
+//   {
+//     prop: "standForDepartrue",
+//     label: "停机位",
+//     desc: "指航班的停机位代码,数据是变化的,仅显示最新信息",
+//     filterable: true,
+//     sortable: true,
+//   },
+//   {
+//     prop: "checkInTravellerNumber",
+//     label: "托运旅客",
+//     desc: "指航班已办理行李托运业务的旅客人数,含取消托运的旅客人数",
+//   },
+//   {
+//     prop: "checkInNumber",
+//     label: "值机数",
+//     desc: "指已办理值机托运的行李数量,含取消托运的行李数量,含未激活",
+//   },
+//   {
+//     prop: "unActive",
+//     label: "未激活",
+//     desc:
+//       "指最后的 BSM 报文“.S”中行李状态为“I”的行李数量,含取消托运的行李数量",
+//   },
+//   {
+//     prop: "preLoad",
+//     label: "预计装载",
+//     desc: "指已办理值机托运的行李数量,不含取消托运的行李数量,不包含未激活",
+//   },
+//   {
+//     prop: "checkNumber",
+//     label: "安检",
+//     desc: "指进行安检的行李数量,含取消托运的行李数量",
+//   },
+//   {
+//     prop: "sortNumber",
+//     label: "分拣",
+//     desc: "指已分拣完成的行李数量,含取消托运的行李数量",
+//   },
+//   {
+//     prop: "loadNumber",
+//     label: "装车",
+//     desc: "指已在分拣口装车完成的行李数量,含取消托运的行李数量",
+//   },
+//   {
+//     prop: "boardID",
+//     label: "装机",
+//     desc: "指装机完成的行李数量,不含取消托运的行李数量",
+//   },
+//   {
+//     prop: "tounLoad",
+//     label: "待翻减",
+//     desc:
+//       "指旅客在办理行李托运后,旅客取消该行李的托运并且行李此时已经过装车节点,而没有完成翻减的行李数量(须翻减总数减去已翻减数)",
+//   },
+//   {
+//     prop: "OFFCount",
+//     label: "已翻减",
+//     desc:
+//       "指旅客在办理行李托运后,旅客取消该行李的托运并且行李此时已经过装车节点,且已完成翻减的行李数量",
+//   },
+//   {
+//     prop: "noCheckInNumber",
+//     label: "取消托运",
+//     desc: "指旅客在办理行李托运后,又取消托运的行李总数量",
+//   },
+//   {
+//     prop: "noBSM",
+//     label: "无BSM",
+//     desc: "行李有处理信息(BPM)但无值机信息(BSM)的行李数量",
+//   },
+//   {
+//     prop: "warning",
+//     label: "风险预警",
+//     desc:
+//       "指依据航班信息中预计起飞时间和当前时间差,与根据分拣到停机位设置的报警阈值对比,超过阈值的为风险行李,本项显示风险预警行李数量",
+//   },
+//   {
+//     prop: "exceptions",
+//     label: "未装机行李",
+//     desc: "指航班关闭货舱门后,应装而未装的行李数量",
+//   },
+//   {
+//     prop: "midIn",
+//     label: "中转进行李",
+//     desc: "指从其他航班中转到当前航班的行李数量",
+//   },
+// ]);
 //列表
-const tableData = ref([
-  {
-    name: "测试",
-    china: "测试",
-    englin: "测试",
-    two: "测试",
-    three: "测试",
-    text: "测试",
-    text1: "测试",
-    text2: "测试",
-    text3: "测试",
-    text4: "测试",
-  },
-  {
-    name: "测试",
-    china: "测试",
-    englin: "测试",
-    two: "测试",
-    three: "测试",
-    text: "测试",
-    text1: "测试",
-    text2: "测试",
-    text3: "测试",
-    text4: "测试",
-  },
-  {
-    name: "测试",
-    china: "测试",
-    englin: "测试",
-    two: "测试",
-    three: "测试",
-    text: "测试",
-    text1: "测试",
-    text2: "测试",
-    text3: "测试",
-    text4: "测试",
-  },
-]);
+const tableData = ref([]);
 //表头
 const state = reactive({
   list: [
@@ -259,6 +231,45 @@ const showForm = () => {
 const closeDialog = () => {
   dialogVisible.value = false;
 };
+//获取表格数据
+const getQuery = async (data) => {
+  try {
+    const { code, returnData } = await Query({
+      id: DATACONTENT_ID.flightTabId,
+      needPage: ++page.value,
+      dataContent: data,
+    });
+    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 searchForm = (data) => {
+  getQuery(data);
+};
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 50 - 139
src/views/dataQuery/freightInquiry/index.vue

@@ -7,6 +7,7 @@
         :is-Show="true"
         :is-Time="true"
         @showForm="showForm"
+        @searchForm="searchForm"
       >
         <template #header>
           <div class="status flex-wrap">
@@ -16,10 +17,9 @@
       >
       <div class="app-containers">
         <DataTable
-          :tableHeader="state.list"
+          :tableHeader="tableCols"
           :tableData="tableData"
           :tableProperty="{ rowKey: 'ID' }"
-          @btnClick="btnClick"
         />
       </div>
       <TableColumnSet
@@ -35,144 +35,16 @@ import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import TableColumnSet from "@/components/tableColumnSet/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 dialogVisible = ref<Boolean>(false); //列设置弹窗开关
-const tableCols = ref([
-  {
-    prop: "flightNO",
-    label: "航班号",
-    desc: "指航班编号",
-    width: 80,
-    fixed: "left",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "flightDate",
-    label: "执飞日期",
-    desc:
-      "指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)",
-    width: 105,
-    fixed: "left",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "planDepartureTime",
-    label: "起飞时间",
-    desc:
-      "根据优先级别显示时间。优先级别:1.实际起飞时间,2.预计起飞时间,3.计划起飞时间",
-    width: 150,
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "targetAirport",
-    label: "目的站",
-    desc: "指航班执飞航段的目的航站,以航站三字码显示",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "departureBuild",
-    label: "航站楼",
-    desc: "指航班执飞航段的目的航站楼",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "bordingGate",
-    label: "登机口",
-    desc: "指航班的登机口代码,数据是变化的,仅显示最新信息",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "standForDepartrue",
-    label: "停机位",
-    desc: "指航班的停机位代码,数据是变化的,仅显示最新信息",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "checkInTravellerNumber",
-    label: "托运旅客",
-    desc: "指航班已办理行李托运业务的旅客人数,含取消托运的旅客人数",
-  },
-  {
-    prop: "checkInNumber",
-    label: "值机数",
-    desc: "指已办理值机托运的行李数量,含取消托运的行李数量,含未激活",
-  },
-  {
-    prop: "unActive",
-    label: "未激活",
-    desc:
-      "指最后的 BSM 报文“.S”中行李状态为“I”的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "preLoad",
-    label: "预计装载",
-    desc: "指已办理值机托运的行李数量,不含取消托运的行李数量,不包含未激活",
-  },
-  {
-    prop: "checkNumber",
-    label: "安检",
-    desc: "指进行安检的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "sortNumber",
-    label: "分拣",
-    desc: "指已分拣完成的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "loadNumber",
-    label: "装车",
-    desc: "指已在分拣口装车完成的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "boardID",
-    label: "装机",
-    desc: "指装机完成的行李数量,不含取消托运的行李数量",
-  },
-  {
-    prop: "tounLoad",
-    label: "待翻减",
-    desc:
-      "指旅客在办理行李托运后,旅客取消该行李的托运并且行李此时已经过装车节点,而没有完成翻减的行李数量(须翻减总数减去已翻减数)",
-  },
-  {
-    prop: "OFFCount",
-    label: "已翻减",
-    desc:
-      "指旅客在办理行李托运后,旅客取消该行李的托运并且行李此时已经过装车节点,且已完成翻减的行李数量",
-  },
-  {
-    prop: "noCheckInNumber",
-    label: "取消托运",
-    desc: "指旅客在办理行李托运后,又取消托运的行李总数量",
-  },
-  {
-    prop: "noBSM",
-    label: "无BSM",
-    desc: "行李有处理信息(BPM)但无值机信息(BSM)的行李数量",
-  },
-  {
-    prop: "warning",
-    label: "风险预警",
-    desc:
-      "指依据航班信息中预计起飞时间和当前时间差,与根据分拣到停机位设置的报警阈值对比,超过阈值的为风险行李,本项显示风险预警行李数量",
-  },
-  {
-    prop: "exceptions",
-    label: "未装机行李",
-    desc: "指航班关闭货舱门后,应装而未装的行李数量",
-  },
-  {
-    prop: "midIn",
-    label: "中转进行李",
-    desc: "指从其他航班中转到当前航班的行李数量",
-  },
-]);
 //列表
 const tableData = ref([
   {
@@ -256,6 +128,45 @@ const showForm = () => {
 const closeDialog = () => {
   dialogVisible.value = false;
 };
+//获取表格数据
+const getQuery = async (data) => {
+  try {
+    const { code, returnData } = await Query({
+      id: DATACONTENT_ID.goodsTabId,
+      needPage: ++page.value,
+      dataContent: data,
+    });
+    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 searchForm = (data) => {
+  getQuery(data);
+};
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 50 - 139
src/views/dataQuery/waybillQuery/index.vue

@@ -7,6 +7,7 @@
         :is-Show="true"
         :is-Time="true"
         @showForm="showForm"
+        @searchForm="searchForm"
       >
         <template #header>
           <div class="status flex-wrap">
@@ -16,10 +17,9 @@
       >
       <div class="app-containers">
         <DataTable
-          :tableHeader="state.list"
+          :tableHeader="tableCols"
           :tableData="tableData"
           :tableProperty="{ rowKey: 'ID' }"
-          @btnClick="btnClick"
         />
       </div>
       <TableColumnSet
@@ -35,144 +35,16 @@ import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import TableColumnSet from "@/components/tableColumnSet/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 dialogVisible = ref<Boolean>(false); //列设置弹窗开关
-const tableCols = ref([
-  {
-    prop: "flightNO",
-    label: "航班号",
-    desc: "指航班编号",
-    width: 80,
-    fixed: "left",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "flightDate",
-    label: "执飞日期",
-    desc:
-      "指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)",
-    width: 105,
-    fixed: "left",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "planDepartureTime",
-    label: "起飞时间",
-    desc:
-      "根据优先级别显示时间。优先级别:1.实际起飞时间,2.预计起飞时间,3.计划起飞时间",
-    width: 150,
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "targetAirport",
-    label: "目的站",
-    desc: "指航班执飞航段的目的航站,以航站三字码显示",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "departureBuild",
-    label: "航站楼",
-    desc: "指航班执飞航段的目的航站楼",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "bordingGate",
-    label: "登机口",
-    desc: "指航班的登机口代码,数据是变化的,仅显示最新信息",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "standForDepartrue",
-    label: "停机位",
-    desc: "指航班的停机位代码,数据是变化的,仅显示最新信息",
-    filterable: true,
-    sortable: true,
-  },
-  {
-    prop: "checkInTravellerNumber",
-    label: "托运旅客",
-    desc: "指航班已办理行李托运业务的旅客人数,含取消托运的旅客人数",
-  },
-  {
-    prop: "checkInNumber",
-    label: "值机数",
-    desc: "指已办理值机托运的行李数量,含取消托运的行李数量,含未激活",
-  },
-  {
-    prop: "unActive",
-    label: "未激活",
-    desc:
-      "指最后的 BSM 报文“.S”中行李状态为“I”的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "preLoad",
-    label: "预计装载",
-    desc: "指已办理值机托运的行李数量,不含取消托运的行李数量,不包含未激活",
-  },
-  {
-    prop: "checkNumber",
-    label: "安检",
-    desc: "指进行安检的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "sortNumber",
-    label: "分拣",
-    desc: "指已分拣完成的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "loadNumber",
-    label: "装车",
-    desc: "指已在分拣口装车完成的行李数量,含取消托运的行李数量",
-  },
-  {
-    prop: "boardID",
-    label: "装机",
-    desc: "指装机完成的行李数量,不含取消托运的行李数量",
-  },
-  {
-    prop: "tounLoad",
-    label: "待翻减",
-    desc:
-      "指旅客在办理行李托运后,旅客取消该行李的托运并且行李此时已经过装车节点,而没有完成翻减的行李数量(须翻减总数减去已翻减数)",
-  },
-  {
-    prop: "OFFCount",
-    label: "已翻减",
-    desc:
-      "指旅客在办理行李托运后,旅客取消该行李的托运并且行李此时已经过装车节点,且已完成翻减的行李数量",
-  },
-  {
-    prop: "noCheckInNumber",
-    label: "取消托运",
-    desc: "指旅客在办理行李托运后,又取消托运的行李总数量",
-  },
-  {
-    prop: "noBSM",
-    label: "无BSM",
-    desc: "行李有处理信息(BPM)但无值机信息(BSM)的行李数量",
-  },
-  {
-    prop: "warning",
-    label: "风险预警",
-    desc:
-      "指依据航班信息中预计起飞时间和当前时间差,与根据分拣到停机位设置的报警阈值对比,超过阈值的为风险行李,本项显示风险预警行李数量",
-  },
-  {
-    prop: "exceptions",
-    label: "未装机行李",
-    desc: "指航班关闭货舱门后,应装而未装的行李数量",
-  },
-  {
-    prop: "midIn",
-    label: "中转进行李",
-    desc: "指从其他航班中转到当前航班的行李数量",
-  },
-]);
 //列表
 const tableData = ref([
   {
@@ -240,6 +112,45 @@ const showForm = () => {
 const closeDialog = () => {
   dialogVisible.value = false;
 };
+//获取表格数据
+const getQuery = async (data) => {
+  try {
+    const { code, returnData } = await Query({
+      id: DATACONTENT_ID.waybillTabId,
+      needPage: ++page.value,
+      dataContent: data,
+    });
+    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 searchForm = (data) => {
+  getQuery(data);
+};
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 6 - 2
src/views/systemSettings/datastructure/index.vue

@@ -40,7 +40,11 @@
               </el-col>
               <el-col>
                 <el-form-item label="数据格式" size="default">
-                  <el-select
+                  <el-input
+                    v-model="tableForm.datatype"
+                    placeholder="请输入数据格式"
+                  />
+                  <!-- <el-select
                     style="width: 100%"
                     v-model="tableForm.datatype"
                     class="input-shadow"
@@ -56,7 +60,7 @@
                       :value="item.v ? item.v : item.planDepartureApt"
                     >
                     </el-option>
-                  </el-select>
+                  </el-select> -->
                 </el-form-item>
               </el-col>
               <el-col>

+ 12 - 1
src/views/systemSettings/queryTemplate/index.vue

@@ -10,6 +10,7 @@
       >
       <div class="app-containers">
         <DataTable
+          BtnGroupWidth=" 300px"
           :tableHeader="tableCols"
           :tableData="tableData"
           :tableBtnGroup="tableBtnGroup"
@@ -78,6 +79,11 @@ const tableBtnGroup = ref([
     className: "editBtn",
     param: 2,
   },
+  {
+    name: "列设置",
+    className: "editBtn",
+    param: 4,
+  },
   {
     name: "删除",
     className: "delBtn",
@@ -136,7 +142,12 @@ const btnClick = (row, index, param) => {
     tableForm.serviceName = index.serviceName;
     tableForm.pageRows = index.pageRows;
   } else if (param === 4) {
-    router.push({ path: "/systemSettings/queryTemplateColumn" });
+    router.push({
+      path: "/systemSettings/queryTemplateColumn",
+      query: {
+        queryTemplateID: index.queryTemplateID,
+      },
+    });
   }
 };
 //删除

+ 190 - 118
src/views/systemSettings/queryTemplate/queryTemplateColumn.vue

@@ -10,7 +10,7 @@
       >
       <div class="app-containers">
         <DataTable
-          :tableHeader="state.list"
+          :tableHeader="tableCols"
           :tableData="tableData"
           :tableBtnGroup="tableBtnGroup"
           :tableProperty="{ rowKey: 'ID' }"
@@ -24,49 +24,41 @@
         :msgTitle="msgTitle"
         @resetForm="resetForm"
         @delRest="delRest"
+        @submitForm="submitForm"
+        @delRemove="delRemove"
       >
         <div class="diacont">
           <el-form :model="tableForm">
             <el-row :gutter="24">
               <el-col :span="12">
                 <el-form-item label="名称" size="default">
-                  <el-input v-model="tableForm.name" placeholder="请输入名称" />
+                  <el-input
+                    v-model="tableForm.columnName"
+                    placeholder="请输入名称"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="标签" size="default">
                   <el-input
-                    v-model="tableForm.china"
+                    v-model="tableForm.columnLabel"
                     placeholder="请输入标签"
                   />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="描述" size="default">
-                  <el-select
-                    style="width: 100%"
-                    v-model="tableForm.englin"
-                    class="input-shadow"
-                    filterable
-                    default-first-option
-                    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>
-                  </el-select>
+                  <el-input
+                    v-model="tableForm.columnDescribe"
+                    placeholder="请输入描述"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="排序" size="default">
                   <el-select
                     style="width: 100%"
-                    v-model="tableForm.two"
+                    v-model="tableForm.needSort"
                     class="input-shadow"
                     filterable
                     default-first-option
@@ -87,7 +79,7 @@
                 <el-form-item label="过滤" size="default">
                   <el-select
                     style="width: 100%"
-                    v-model="tableForm.three"
+                    v-model="tableForm.needFilters"
                     class="input-shadow"
                     filterable
                     default-first-option
@@ -108,7 +100,7 @@
                 <el-form-item label="显示" size="default">
                   <el-select
                     style="width: 100%"
-                    v-model="tableForm.text"
+                    v-model="tableForm.needShow"
                     class="input-shadow"
                     filterable
                     default-first-option
@@ -127,30 +119,17 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item label="数据类型" size="default">
-                  <el-select
-                    style="width: 100%"
-                    v-model="tableForm.text1"
-                    class="input-shadow"
-                    filterable
-                    default-first-option
-                    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>
-                  </el-select>
+                  <el-input
+                    v-model="tableForm.dataType"
+                    placeholder="请输入数据类型"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="分组" size="default">
                   <el-select
                     style="width: 100%"
-                    v-model="tableForm.text2"
+                    v-model="tableForm.needGroup"
                     class="input-shadow"
                     filterable
                     default-first-option
@@ -171,7 +150,7 @@
                 <el-form-item label="下拉" size="default">
                   <el-select
                     style="width: 100%"
-                    v-model="tableForm.text3"
+                    v-model="tableForm.listqueryTemplateID"
                     class="input-shadow"
                     filterable
                     default-first-option
@@ -192,7 +171,7 @@
                 <el-form-item label="合计" size="default">
                   <el-select
                     style="width: 100%"
-                    v-model="tableForm.text4"
+                    v-model="tableForm.needCount"
                     class="input-shadow"
                     filterable
                     default-first-option
@@ -213,7 +192,7 @@
                 <el-form-item label="字段排序" size="default">
                   <el-select
                     style="width: 100%"
-                    v-model="tableForm.text5"
+                    v-model="tableForm.orderNumber"
                     class="input-shadow"
                     filterable
                     default-first-option
@@ -241,66 +220,49 @@
 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 route = useRoute();
+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 tableOptionser = ref<Array>([]); //弹窗下拉
-const tableForm = reactive({
-  name: "",
-  china: "",
-  englin: "",
-  two: "",
-  three: "",
-  text: "",
-  text1: "",
-  text2: "",
-  text3: "",
-  text4: "",
-  text5: "",
-}); //弹窗内容
-//列表
-const tableData = ref([
+const tableOptionser = ref<Array>([
   {
-    name: "测试",
-    china: "测试",
-    englin: "测试",
-    two: "测试",
-    three: "测试",
-    text: "测试",
-    text1: "测试",
-    text2: "测试",
-    text3: "测试",
-    text4: "测试",
-    text5: "测试",
+    k: "是",
+    v: "1",
   },
   {
-    name: "测试",
-    china: "测试",
-    englin: "测试",
-    two: "测试",
-    three: "测试",
-    text: "测试",
-    text1: "测试",
-    text2: "测试",
-    text3: "测试",
-    text4: "测试",
-    text5: "测试",
+    k: "否",
+    v: "0",
   },
-  {
-    name: "测试",
-    china: "测试",
-    englin: "测试",
-    two: "测试",
-    three: "测试",
-    text: "测试",
-    text1: "测试",
-    text2: "测试",
-    text3: "测试",
-    text4: "测试",
-    text5: "测试",
-  },
-]);
+]); //弹窗下拉
+const tableForm = reactive({
+  queryTemplateColumnSetID: "",
+  queryTemplateID: route.query.queryTemplateID,
+  columnName: "",
+  columnLabel: "",
+  columnDescribe: "",
+  needSort: "",
+  needFilters: "",
+  needShow: "",
+  needGroup: "",
+  dataType: "",
+  listqueryTemplateID: "",
+  needCount: "",
+  orderNumber: "",
+  needSearch: "",
+  event: "",
+}); //弹窗内容
+//列表
+const tableData = ref([]);
 //表头
 const state = reactive({
   list: [
@@ -334,22 +296,25 @@ const tableBtnGroup = ref([
 const addForm = () => {
   msgTitle.value = "新增查询项";
   flag.value = true;
+  tableForm.event = 1;
   type.value = "";
 };
 //取消
 const resetForm = () => {
   flag.value = false;
-  tableForm.name = "";
-  tableForm.china = "";
-  tableForm.englin = "";
-  tableForm.two = "";
-  tableForm.three = "";
-  tableForm.text = "";
-  tableForm.text1 = "";
-  tableForm.text2 = "";
-  tableForm.text3 = "";
-  tableForm.text4 = "";
-  tableForm.text5 = "";
+  tableForm.queryTemplateColumnSetID = "";
+  tableForm.columnName = "";
+  tableForm.columnLabel = "";
+  tableForm.columnDescribe = "";
+  tableForm.needSort = "";
+  tableForm.needFilters = "";
+  tableForm.needShow = "";
+  tableForm.needGroup = "";
+  tableForm.dataType = "";
+  tableForm.listqueryTemplateID = "";
+  tableForm.needCount = "";
+  tableForm.orderNumber = "";
+  tableForm.needSearch = "";
 };
 //编辑
 // const editDialog = (data) => {
@@ -369,21 +334,39 @@ 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.text3 = index.text3;
-    tableForm.text4 = index.text4;
-    tableForm.text5 = index.text5;
+    tableForm.event = 2;
+    tableForm.queryTemplateColumnSetID = index.queryTemplateColumnSetID;
+    tableForm.columnName = index.columnName;
+    tableForm.columnLabel = index.columnLabel;
+    tableForm.columnDescribe = index.columnDescribe;
+    tableForm.needSort = index.needSort === "需要" ? "1" : "0";
+    tableForm.needFilters = index.needFilters === "需要" ? "1" : "0";
+    tableForm.needShow = index.needShow === "需要" ? "1" : "0";
+    tableForm.needGroup = index.needGroup === "需要" ? "1" : "0";
+    tableForm.dataType = index.dataType;
+    tableForm.listqueryTemplateID =
+      index.listqueryTemplateID === "需要" ? "1" : "0";
+    tableForm.needCount = index.needCount === "需要" ? "1" : "0";
+    tableForm.orderNumber = index.orderNumber === "需要" ? "1" : "0";
+    tableForm.needSearch = index.needSearch;
   } else if (param === 3) {
     msgTitle.value = "删除查询项";
     flag.value = true;
     type.value = "del";
+    tableForm.event = 3;
+    tableForm.queryTemplateColumnSetID = index.queryTemplateColumnSetID;
+    tableForm.columnName = index.columnName;
+    tableForm.columnLabel = index.columnLabel;
+    tableForm.columnDescribe = index.columnDescribe;
+    tableForm.needSort = index.needSort;
+    tableForm.needFilters = index.needFilters;
+    tableForm.needShow = index.needShow;
+    tableForm.needGroup = index.needGroup;
+    tableForm.dataType = index.dataType;
+    tableForm.listqueryTemplateID = index.listqueryTemplateID;
+    tableForm.needCount = index.needCount;
+    tableForm.orderNumber = index.orderNumber;
+    tableForm.needSearch = index.needSearch;
   } else if (param === 4) {
   }
 };
@@ -393,10 +376,99 @@ 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.sysQueryChildTabId,
+      needPage: ++page.value,
+      dataContent: [route.query.queryTemplateID],
+    });
+    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 {
+    let obj = {
+      IATACode: route.query.IATACode,
+    };
+    data = {
+      ...data,
+      ...obj,
+    };
+    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();
+  }
+};
+getQuery();
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 1 - 0
src/views/systemSettings/sourceTube/index.vue

@@ -61,6 +61,7 @@
               <el-col>
                 <el-form-item label="连接参数" size="default">
                   <el-input
+                    :autosize="{ minRows: 10, maxRows: 10 }"
                     type="textarea"
                     v-model="tableForm.connectConfig"
                     placeholder="请输入连接参数"

+ 136 - 106
src/views/userManagement/account/index.vue

@@ -9,7 +9,7 @@
     </div>
     <div class="application-content flex">
       <div class="box account-tree">
-        <el-tree :data="data" :props="defaultProps" default-expand-all @node-click="handleNodeClick" />
+        <el-tree :data="data" :props="defaultProps" node-key="user_group_id" default-expand-all @node-click="handleNodeClick" />
       </div>
       <Table class="account-table" btnGroupWidth="250px" :tableHeader="tableHeader" @btnClick="btnClick" :tableBtnGroup="tableBtnGroup" :tableData="tableData" />
     </div>
@@ -18,19 +18,19 @@
     <!--新增/编辑-->
     <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="账号名称" prop="roleName">
-          <el-input v-model="ruleForm.roleName" size="default" placeholder="请输入账号名称" />
+        <el-form-item label="账号名称" prop="user_name">
+          <el-input v-model="ruleForm.user_name" size="default" placeholder="请输入账号名称" />
         </el-form-item>
-        <el-form-item label="账号密码" prop="rolePwd">
-          <el-input v-model="ruleForm.rolePwd" type="password" show-password size="default" placeholder="请输入账号名称" />
+        <el-form-item label="账号密码" 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="roleDesc">
-          <el-input v-model="ruleForm.roleDesc" size="default" type="textarea" :rows="3" placeholder="请输入账号描述" />
+        <el-form-item label="账号描述" prop="user_comment">
+          <el-input v-model="ruleForm.user_comment" size="default" type="textarea" :rows="3" placeholder="请输入账号描述" />
         </el-form-item>
-        <el-form-item label="是否启用" prop="roleStatus">
-          <el-radio-group v-model="ruleForm.roleStatus">
-            <el-radio label="1">启用</el-radio>
-            <el-radio label="2"> 禁用</el-radio>
+        <el-form-item label="是否启用" prop="user_status">
+          <el-radio-group v-model="ruleForm.user_status">
+            <el-radio :label="1">启用</el-radio>
+            <el-radio :label="2"> 禁用</el-radio>
           </el-radio-group>
         </el-form-item>
       </el-form>
@@ -39,46 +39,19 @@
 </template>
 
 <script setup lang="ts">
-import { ref, reactive } from "vue";
+import { ref, reactive, onBeforeMount } from "vue";
 import { ElMessage, FormInstance, FormRules } from "element-plus";
 import Table from "@/components/tableTemp/index.vue";
 import Search from "@/components/search/index.vue";
-interface Tree {
-  label: string;
-  children?: Tree[];
-}
+import { translateDataToTreeAll } from "@/utils/validate";
+import { GeneralDataReception, Query } from "@/api/dataIntegration";
+import * as _ from "lodash";
+import MD5 from "blueimp-md5";
+import table from "../hooks/useTable";
 const router = useRouter();
 const ruleFormRef = ref<FormInstance>();
-const tableHeader = [
-  { label: "账号名称", key: "roleName" },
-  { label: "账号数", key: "accountNum" },
-  { label: "权限项数", key: "authNum" },
-  { label: "是否存在互斥", key: "isHc" },
-  { label: "启用状态", key: "status" },
-  { label: "描述", key: "desc" },
-];
-const tableData = ref([
-  {
-    id: 1,
-    roleName: "11",
-    accountNum: "22",
-    authNum: "33",
-    isHc: "是",
-    status: "启用",
-    desc: "555",
-    pwd: "",
-  },
-  {
-    id: 2,
-    roleName: "11",
-    accountNum: "22",
-    authNum: "33",
-    isHc: "是",
-    status: "启用",
-    desc: "555",
-    pwd: "",
-  },
-]);
+const tableHeader = ref<any>([]);
+const tableData = ref<any>([]);
 const tableBtnGroup = [
   {
     name: "编辑",
@@ -101,57 +74,137 @@ const title = ref("");
 const dT = ref("add");
 const editDialogVisible = ref(false);
 const editDialogTitle = ref("新增账号");
-const ruleForm = reactive({
-  roleName: "",
-  roleDesc: "",
-  roleStatus: "",
-  rolePwd: "",
+const ruleForm = ref<any>({
+  user_name: "",
+  user_comment: "",
+  user_status: "",
+  user_pwd: "",
 });
-const rowIndex = ref(1);
+const rowIndex = ref<any>({});
+const data = ref<any>([]);
+const msgId = ref(null);
+const msgType = ref("all");
+const PageIndex = ref(1);
+const searchInfo = ref("");
+//获取用户组
+const getGroup = async () => {
+  const { code, returnData } = await Query({
+    id: DATACONTENT_ID.accountGroupTableId,
+    dataContent: [""],
+  });
+  if (code == 0 && returnData.listValues) {
+    const dataObj = {
+      user_group_id: -1,
+      up_user_group_id: -2,
+      user_group_name: "全部用户组",
+      children: translateDataToTreeAll(
+        returnData.listValues,
+        "up_user_group_id",
+        "user_group_id"
+      ),
+    };
+    data.value = [dataObj];
+  } else {
+    const dataObj = {
+      user_group_id: -1,
+      up_user_group_id: -2,
+      user_group_name: "全部用户组",
+      children: [],
+    };
+    data.value = [dataObj];
+  }
+};
+
+//获取table
+const accountList = async () => {
+  let result: any = null;
+  if (msgType.value == "all") {
+    result = await Query({
+      id: DATACONTENT_ID.accountTableId,
+      needPage: PageIndex.value,
+      dataContent: [searchInfo.value],
+    });
+  } else {
+    result = await Query({
+      id: DATACONTENT_ID.accountGroupDetailsId,
+      dataContent: [msgId.value],
+      needPage: PageIndex.value,
+    });
+  }
+  const { code, returnData, message } = result;
+  if (code == 0) {
+    const { columnSet, listValues } = returnData;
+    tableHeader.value = columnSet;
+    tableData.value = listValues;
+  } else {
+    ElMessage.error(message);
+  }
+};
 
-const handleNodeClick = (data: Tree) => {
-  console.log(data);
+// 回到第一页
+const pageInit = () => {
+  PageIndex.value = 1;
+  tableHeader.value = [];
+  tableData.value = [];
+  accountList();
 };
 
-const data: Tree[] = [
-  {
-    label: "全部账号组",
-    children: [
-      {
-        label: "账号组名称",
-        children: [],
-      },
-      {
-        label: "账号组名称",
-        children: [],
-      },
-    ],
-  },
-];
+//增删改
+const dataChange = async (event, data) => {
+  const { code, message } = await table.dataChange(
+    SERVICE_ID.accountScId,
+    event,
+    data
+  );
+  if (code == 0) {
+    ElMessage.success(message);
+    pageInit();
+  } else {
+    ElMessage.error(message);
+  }
+};
+
+onBeforeMount(() => {
+  getGroup();
+  accountList();
+});
+
+const handleNodeClick = (data) => {
+  tableHeader.value = [];
+  tableData.value = [];
+  if (data.user_group_id != -1 && data.up_user_group_id != -2) {
+    PageIndex.value = 1;
+    msgType.value = "cld";
+    msgId.value = data.user_group_id;
+    accountList();
+  } else {
+    msgType.value = "all";
+    clear();
+  }
+};
 
 const defaultProps = {
   children: "children",
-  label: "label",
+  label: "user_group_name",
 };
 const search = (val) => {
-  ElMessage.success(`搜索成功:${val}`);
+  searchInfo.value = val;
+  pageInit();
 };
 const clear = () => {
-  ElMessage.success(`清除`);
+  searchInfo.value = "";
+  pageInit();
 };
 const btnClick = (index, row, param) => {
-  rowIndex.value = index;
+  rowIndex.value = row;
   if (param == "del") {
     flag.value = true;
-    title.value = row.roleName;
+    title.value = row.user_name;
   } else if (param == "edit") {
     dT.value = "edit";
     editDialogVisible.value = true;
     editDialogTitle.value = "编辑账号";
-    ruleForm.roleName = row.roleName;
-    ruleForm.roleDesc = row.desc;
-    ruleForm.roleStatus = row.status;
-    ruleForm.rolePwd = row.pwd;
+    ruleForm.value = _.cloneDeep(row);
   } else {
     router.push("/userManagement/accountAuth");
   }
@@ -160,47 +213,24 @@ const delRest = () => {
   flag.value = false;
 };
 const remove = () => {
-  tableData.value.splice(rowIndex.value, 1);
-  ElMessage.success("删除成功");
+  dataChange(3, rowIndex.value);
   flag.value = false;
 };
 const addApp = () => {
   editDialogVisible.value = true;
   editDialogTitle.value = "新增账号";
   dT.value = "add";
-  ruleForm.roleDesc = "";
-  ruleForm.roleName = "";
-  ruleForm.roleStatus = "";
+  ruleForm.value = {};
 };
 const submitForm = async (formEl: FormInstance | undefined) => {
   if (!formEl) return;
   await formEl.validate((valid, fields) => {
     if (valid) {
+      ruleForm.value.user_pwd = MD5(ruleForm.value.user_pwd);
       if (dT.value == "add") {
-        const len = tableData.value.length;
-        tableData.value.push({
-          id: len + 1,
-          roleName: ruleForm.roleName,
-          desc: ruleForm.roleDesc,
-          status: ruleForm.roleStatus,
-          pwd: ruleForm.rolePwd,
-          accountNum: "22",
-          authNum: "33",
-          isHc: "是",
-        });
-        ElMessage.success("新增成功");
+        dataChange(1, ruleForm.value);
       } else {
-        tableData.value[rowIndex.value] = {
-          id: tableData.value[rowIndex.value].id,
-          roleName: ruleForm.roleName,
-          desc: ruleForm.roleDesc,
-          status: ruleForm.roleStatus,
-          pwd: ruleForm.rolePwd,
-          accountNum: "22",
-          authNum: "33",
-          isHc: "是",
-        };
-        ElMessage.success("编辑成功");
+        dataChange(2, ruleForm.value);
       }
       editDialogVisible.value = false;
     } else {

+ 25 - 38
src/views/userManagement/accountGroup/index.vue

@@ -27,20 +27,15 @@
 </template>
 
 <script setup lang="ts">
-import { ref, reactive, onBeforeMount } from "vue";
+import { ref, onBeforeMount } from "vue";
 import { ElMessage, FormInstance, FormRules } from "element-plus";
-import { GeneralDataReception, Query } from "@/api/dataIntegration";
 import Table from "@/components/tableTemp/index.vue";
 import Search from "@/components/search/index.vue";
 import * as _ from "lodash";
-interface msgObj {
-  user_group_name: string;
-  user_group_comment: string | undefined;
-  event?: number;
-}
+import table from "../hooks/useTable";
 const ruleFormRef = ref<FormInstance>();
-const tableHeader = ref([]);
-const tableData = ref([]);
+const tableHeader = ref<any>([]);
+const tableData = ref<any>([]);
 const tableBtnGroup = [
   {
     name: "编辑",
@@ -59,11 +54,11 @@ const searchInfo = ref("");
 const dT = ref("add");
 const editDialogVisible = ref(false);
 const editDialogTitle = ref("新增账号组");
-const ruleForm = ref({
+const ruleForm = ref<any>({
   user_group_name: "",
   user_group_comment: "",
 });
-const rowIndex = ref({});
+const rowIndex = ref<any>({});
 
 onBeforeMount(() => {
   accountList();
@@ -71,20 +66,11 @@ onBeforeMount(() => {
 
 //获取账号组数据
 const accountList = async () => {
-  try {
-    const { code, returnData, message } = await Query({
-      id: DATACONTENT_ID.accountGroupTableId,
-      needPage: 1,
-      dataContent: [searchInfo.value],
-    });
-    if (code == 0 && returnData) {
-      const { columnSet, listValues } = returnData;
-      tableHeader.value = columnSet;
-      tableData.value = listValues;
-    } else {
-      ElMessage.error(message);
-    }
-  } catch (err: any) {}
+  const res = await table.getTable(DATACONTENT_ID.accountGroupTableId, [
+    searchInfo.value,
+  ]);
+  tableHeader.value = res.tableHeader.value;
+  tableData.value = res.tableData.value;
 };
 
 const search = (val) => {
@@ -112,11 +98,12 @@ const delRest = () => {
 };
 const remove = async () => {
   try {
-    rowIndex.value.event = 3;
-    const { code, message } = await GeneralDataReception({
-      serviceId: SERVICE_ID.accountGroupScId,
-      dataContent: JSON.stringify(rowIndex.value),
-    });
+    const { code, message } = await table.dataChange(
+      SERVICE_ID.accountGroupScId,
+      3,
+      rowIndex.value
+    );
+
     if (code == 0) {
       ElMessage.success(message);
       accountList();
@@ -133,12 +120,13 @@ const addApp = () => {
   ruleForm.value = {};
 };
 // 新增/编辑账号
-const saveAddAccount = async () => {
+const saveAddAccount = async (event) => {
   try {
-    const { code, message } = await GeneralDataReception({
-      serviceId: SERVICE_ID.accountGroupScId,
-      dataContent: JSON.stringify(ruleForm.value),
-    });
+    const { code, message } = await table.dataChange(
+      SERVICE_ID.accountGroupScId,
+      event,
+      ruleForm.value
+    );
     if (code == 0) {
       ElMessage.success(message);
       accountList();
@@ -152,12 +140,11 @@ const submitForm = async (formEl: FormInstance | undefined) => {
   await formEl.validate((valid, fields) => {
     if (valid) {
       if (dT.value == "add") {
-        ruleForm.value.event = 1;
+        saveAddAccount(1);
       } else {
         // ruleForm.value = rowIndex.value;
-        ruleForm.value.event = 2;
+        saveAddAccount(2);
       }
-      saveAddAccount();
       editDialogVisible.value = false;
     } else {
       console.log("error submit!", fields);

+ 52 - 55
src/views/userManagement/application/index.vue

@@ -14,14 +14,14 @@
     <!--新增/编辑-->
     <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="应用名称" prop="appName">
-          <el-input v-model="ruleForm.appName" size="default" placeholder="请输入应用名称" />
+        <el-form-item label="应用名称" prop="app_name">
+          <el-input v-model="ruleForm.app_name" size="default" placeholder="请输入应用名称" />
         </el-form-item>
-        <el-form-item label="appid" prop="appId">
-          <el-input v-model="ruleForm.appId" size="default" placeholder="请输入appid" />
+        <el-form-item label="appid" prop="app_show_id">
+          <el-input v-model="ruleForm.app_show_id" size="default" placeholder="请输入appid" />
         </el-form-item>
-        <el-form-item label="应用描述" prop="appDesc">
-          <el-input v-model="ruleForm.appDesc" size="default" type="textarea" :rows="3" placeholder="请输入应用描述" />
+        <el-form-item label="应用描述" prop="app_comment">
+          <el-input v-model="ruleForm.app_comment" size="default" type="textarea" :rows="3" placeholder="请输入应用描述" />
         </el-form-item>
       </el-form>
     </Dialog>
@@ -29,29 +29,14 @@
 </template>
 
 <script setup lang="ts">
-import { ref, reactive } from "vue";
+import { ref, onBeforeMount } from "vue";
 import { ElMessage, FormInstance, FormRules } from "element-plus";
 import Table from "@/components/tableTemp/index.vue";
+import * as _ from "lodash";
+import table from "../hooks/useTable";
 const ruleFormRef = ref<FormInstance>();
-const tableHeader = [
-  { label: "应用名称", key: "appName" },
-  { label: "appid", key: "appId" },
-  { label: "应用描述", key: "appDesc" },
-];
-const tableData = ref([
-  {
-    id: 1,
-    appName: "11",
-    appId: "22",
-    appDesc: "33",
-  },
-  {
-    id: 2,
-    appName: "11",
-    appId: "22",
-    appDesc: "33",
-  },
-]);
+const tableHeader = ref<any>([]);
+const tableData = ref<any>([]);
 const tableBtnGroup = [
   {
     name: "编辑",
@@ -69,63 +54,75 @@ const title = ref("");
 const dT = ref("add");
 const editDialogVisible = ref(false);
 const editDialogTitle = ref("新增应用");
-const ruleForm = reactive({
-  appName: "",
-  appDesc: "",
-  appId: "",
+const ruleForm = ref<any>({
+  app_name: "",
+  app_comment: "",
+  app_show_id: "",
 });
 const rowIndex = ref(1);
+const searchInfo = ref("");
+
+onBeforeMount(() => {
+  getApp();
+});
+
+const getApp = async () => {
+  const res = await table.getTable(DATACONTENT_ID.appTableId, [
+    searchInfo.value,
+  ]);
+  tableHeader.value = res.tableHeader.value;
+  tableData.value = res.tableData.value;
+};
+
 const btnClick = (index, row, param) => {
-  rowIndex.value = index;
+  rowIndex.value = _.cloneDeep(row);
   if (param == "del") {
     flag.value = true;
-    title.value = row.appName;
+    title.value = row.app_name;
   } else {
     dT.value = "edit";
     editDialogVisible.value = true;
     editDialogTitle.value = "编辑应用";
-    ruleForm.appDesc = row.appDesc;
-    ruleForm.appName = row.appName;
-    ruleForm.appId = row.appId;
+    ruleForm.value = _.cloneDeep(row);
   }
 };
 const delRest = () => {
   flag.value = false;
 };
 const remove = () => {
-  tableData.value.splice(rowIndex.value, 1);
-  ElMessage.success("删除成功");
+  dataChange(3, rowIndex.value);
   flag.value = false;
 };
 const addApp = () => {
   editDialogVisible.value = true;
   editDialogTitle.value = "新增应用";
   dT.value = "add";
-  ruleForm.appDesc = "";
-  ruleForm.appName = "";
-  ruleForm.appId = "";
+  ruleForm.value = {};
 };
+
+//增删改
+const dataChange = async (event, data) => {
+  const { code, message } = await table.dataChange(
+    SERVICE_ID.appScId,
+    event,
+    data
+  );
+  if (code == 0) {
+    ElMessage.success(message);
+    getApp();
+  } else {
+    ElMessage.error(message);
+  }
+};
+
 const submitForm = async (formEl: FormInstance | undefined) => {
   if (!formEl) return;
   await formEl.validate((valid, fields) => {
     if (valid) {
       if (dT.value == "add") {
-        const len = tableData.value.length;
-        tableData.value.push({
-          id: len + 1,
-          appName: ruleForm.appName,
-          appDesc: ruleForm.appDesc,
-          appId: ruleForm.appId,
-        });
-        ElMessage.success("新增成功");
+        dataChange(1, ruleForm.value);
       } else {
-        tableData.value[rowIndex.value] = {
-          id: tableData.value[rowIndex.value].id,
-          appName: ruleForm.appName,
-          appDesc: ruleForm.appDesc,
-          appId: ruleForm.appId,
-        };
-        ElMessage.success("编辑成功");
+        dataChange(2, ruleForm.value);
       }
       editDialogVisible.value = false;
     } else {

+ 49 - 0
src/views/userManagement/hooks/useTable.ts

@@ -0,0 +1,49 @@
+import { ref } from 'vue'
+import { ElMessage } from 'element-plus'
+import { GeneralDataReception, Query } from '@/api/dataIntegration'
+import { IdType } from '../type'
+const tableHeader = ref<any>([])
+const tableData = 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 } = returnData
+      tableHeader.value = columnSet
+      tableData.value = listValues
+      return {
+        tableHeader,
+        tableData,
+      }
+    } else {
+      ElMessage.error(message)
+      return {
+        tableHeader,
+        tableData,
+      }
+    }
+  } catch (err: any) {
+    return {
+      tableHeader,
+      tableData,
+    }
+  }
+}
+
+const dataChange = async (id: IdType, event: IdType, data) => {
+  const obj = Object.assign(data, { event })
+  const { code, message } = await GeneralDataReception({
+    serviceId: id,
+    dataContent: JSON.stringify(obj),
+  })
+  return {
+    code,
+    message,
+  }
+}
+
+export default { getTable, dataChange }

+ 5 - 4
src/views/userManagement/hooks/useTree.ts

@@ -1,6 +1,7 @@
 import { Query } from '@/api/dataIntegration'
 import { translateDataToTreeAll } from '@/utils/validate'
-import { ref, onBeforeMount } from 'vue'
+import { ref } from 'vue'
+import * as _ from 'lodash'
 const dataObj = ref<any>({
   auth_id: -1,
   auth_name: '所有权限',
@@ -11,6 +12,7 @@ const dataObj = ref<any>({
   children: [] as Array<any>,
 })
 const data = ref<any>([])
+const newData = ref<any>([])
 const setTree = (arr: Array<any>, upkey = 'up_auth_id', key = 'auth_id') => {
   if (arr.length) {
     const datas = translateDataToTreeAll(arr, upkey, key)
@@ -26,6 +28,7 @@ const getTree = async () => {
       dataContent: [sessionStorage.getItem('User_Id')],
     })
     if (code == 0 && returnData.listValues) {
+      newData.value = _.cloneDeep(returnData.listValues)
       data.value = [setTree(returnData.listValues)]
       return data
     } else {
@@ -37,10 +40,8 @@ const getTree = async () => {
     return data
   }
 }
-onBeforeMount(() => {
-  getTree()
-})
 export default {
   setTree,
   getTree,
+  newData,
 }

+ 12 - 54
src/views/userManagement/role/auth.vue

@@ -80,6 +80,7 @@ import { EditRole } from "@/api/apiAuthority";
 import { Query, GeneralDataReception } from "@/api/dataIntegration";
 import { translateDataToTreeAll } from "@/utils/validate";
 import { ElMessage, ElTree } from "element-plus";
+import tree from "../hooks/useTree";
 import * as _ from "lodash";
 const route = useRoute();
 const role_id = route.query.role_id;
@@ -97,11 +98,11 @@ const form = ref({
   edit_row_condition: "",
   edit_col_condition: "",
 });
-const checkObj = ref(null);
-const data = ref([]);
-const newData = ref([]);
-const checkData = ref([]);
-const checkKeys = ref([]);
+const checkObj = ref<any>(null);
+const data = ref<any>([]);
+const newData = ref<any>([]);
+const checkData = ref<any>([]);
+const checkKeys = ref<any>([]);
 const treeRef = ref<InstanceType<typeof ElTree>>();
 onBeforeMount(() => {
   roleDetails();
@@ -118,20 +119,10 @@ watch(
         checkData.value.push(item);
         const datas = _.unionBy(checkData.value, "auth_id");
         checkData.value = datas;
-        console.log(checkData.value);
       }
     });
-    const obj = {
-      auth_id: -1,
-      auth_name: "所有权限",
-      auth_status: true,
-      up_auth_id: -1,
-      auth_type: 0,
-      disabled: true,
-      children: translateDataToTreeAll(newData.value, "up_auth_id", "auth_id"),
-    };
     checkKeys.value = [checkObj.value.auth_id];
-    data.value = [obj];
+    data.value = [tree.setTree(newData.value)];
   },
   { deep: true }
 );
@@ -153,40 +144,9 @@ const roleDetails = async () => {
 
 //权限树
 const getTree = async () => {
-  try {
-    const { code, message, returnData } = await Query({
-      id: DATACONTENT_ID.authTreeNewId,
-      dataContent: [sessionStorage.getItem("User_Id")],
-    });
-    if (code == 0 && returnData.listValues) {
-      newData.value = _.cloneDeep(returnData.listValues);
-      const obj = {
-        auth_id: -1,
-        auth_name: "所有权限",
-        auth_status: true,
-        up_auth_id: -1,
-        auth_type: 0,
-        disabled: true,
-        children: translateDataToTreeAll(
-          returnData.listValues,
-          "up_auth_id",
-          "auth_id"
-        ),
-      };
-      data.value = [obj];
-    } else {
-      const obj = {
-        auth_id: -1,
-        auth_name: "所有权限",
-        auth_status: true,
-        up_auth_id: -1,
-        auth_type: 0,
-        disabled: true,
-        children: [],
-      };
-    }
-    data.value = [obj];
-  } catch (error) {}
+  const res = await tree.getTree();
+  newData.value = await tree.newData.value;
+  data.value = res.value;
 };
 
 //权限详情
@@ -197,7 +157,7 @@ const roleAuths = async () => {
       dataContent: [role_id],
     });
     if (code == 0 && returnData.listValues) {
-      const datas = [];
+      const datas: any = [];
       returnData.listValues.forEach((item) => {
         datas.push(item.auth_id);
       });
@@ -231,9 +191,7 @@ const clearFormData = () => {
 };
 
 const currentChange = () => {
-  const datas = treeRef
-    .value!.getCheckedNodes()
-    .concat(treeRef.value!.getHalfCheckedNodes());
+  const datas = treeRef.value!.getCheckedNodes(false, true);
   console.log(datas);
 };
 

+ 20 - 29
src/views/userManagement/role/index.vue

@@ -33,11 +33,11 @@
 </template>
 
 <script setup lang="ts">
-import { ref, reactive, onBeforeMount } from "vue";
+import { ref, onBeforeMount } from "vue";
 import { ElMessage, FormInstance, FormRules } from "element-plus";
 import Table from "@/components/tableTemp/index.vue";
 import Search from "@/components/search/index.vue";
-import { Query, GeneralDataReception } from "@/api/dataIntegration";
+import table from "../hooks/useTable";
 import * as _ from "lodash";
 const router = useRouter();
 const ruleFormRef = ref<FormInstance>();
@@ -65,32 +65,24 @@ const title = ref("");
 const dT = ref("add");
 const editDialogVisible = ref(false);
 const editDialogTitle = ref("新增角色");
-const ruleForm = ref({
+const ruleForm = ref<any>({
   role_name: "",
   role_comment: "",
   role_status: "",
 });
 const searchInfo = ref("");
-const rowIndex = ref({});
+const rowIndex = ref<any>({});
 onBeforeMount(() => {
   gueryRole();
 });
 
 const gueryRole = async () => {
-  try {
-    const { code, returnData, message } = await Query({
-      id: DATACONTENT_ID.roleTableNId,
-      needPage: 1,
-      dataContent: [searchInfo.value, sessionStorage.getItem("User_Id")],
-    });
-    if (code == 0 && returnData) {
-      const { columnSet, listValues } = returnData;
-      tableHeader.value = columnSet;
-      tableData.value = listValues;
-    } else {
-      ElMessage.error(message);
-    }
-  } catch (err: any) {}
+  const res = await table.getTable(DATACONTENT_ID.roleTableNId, [
+    searchInfo.value,
+    sessionStorage.getItem("User_Id"),
+  ]);
+  tableHeader.value = res.tableHeader.value;
+  tableData.value = res.tableData.value;
 };
 
 const search = (val) => {
@@ -123,10 +115,9 @@ const btnClick = (index, row, param) => {
 const delRest = () => {
   flag.value = false;
 };
-const remove = () => {
-  rowIndex.value.event = 3;
+const remove = async () => {
   rowIndex.value.operator_id = sessionStorage.getItem("User_Id");
-  saveRole(rowIndex.value);
+  saveRole(3, rowIndex.value);
   flag.value = false;
 };
 const addApp = () => {
@@ -136,12 +127,13 @@ const addApp = () => {
   ruleForm.value = {};
 };
 // 新增/编辑角色
-const saveRole = async () => {
+const saveRole = async (event, data) => {
   try {
-    const { code, message } = await GeneralDataReception({
-      serviceId: SERVICE_ID.roleMsgId,
-      dataContent: JSON.stringify(ruleForm.value),
-    });
+    const { code, message } = await table.dataChange(
+      SERVICE_ID.roleMsgId,
+      event,
+      data
+    );
     if (code == 0) {
       ElMessage.success(message);
       gueryRole();
@@ -155,13 +147,12 @@ const submitForm = async (formEl: FormInstance | undefined) => {
   await formEl.validate((valid, fields) => {
     if (valid) {
       if (dT.value == "add") {
-        ruleForm.value.event = 1;
         ruleForm.value.operator_id = sessionStorage.getItem("User_Id");
+        saveRole(1, ruleForm.value);
       } else {
-        ruleForm.value.event = 2;
         ruleForm.value.operator_id = sessionStorage.getItem("User_Id");
+        saveRole(2, ruleForm.value);
       }
-      saveRole();
       editDialogVisible.value = false;
     } else {
       console.log("error submit!", fields);

+ 1 - 0
src/views/userManagement/type.d.ts

@@ -0,0 +1 @@
+export type IdType = string | number

+ 0 - 0
src/views/userManagement/type.ts