Răsfoiți Sursa

查询模板查询项

chenrui  2 ani în urmă
părinte
comite
2b25ad75d2

+ 2 - 0
public/demo.js

@@ -65,6 +65,8 @@ const DATACONTENT_ID = {
   sysServiceStrategyId: 18033, //预警报警策略(按照ID)
   sysSourceId: 13, //系统设置-数据源-id
   sysQueryEditId: 24, //系统设置-查询模板-编辑-根据id获取服务
+  sysQueryChildTabId: 25, //系统设置-查询模板-列设置-表格-id
+  sysQueryChildEditTabId: 26, //系统设置-查询模板-列设置-表格-编辑-id
   sysServiceTopTable: 31, //系统设置-服务管理-服务拓扑-查看日志
   messageQueryTabId: 1803442, //系统设置-消息查询-表格-id
 };

+ 64 - 34
src/router/routes/routes-file-four.ts

@@ -70,31 +70,47 @@ 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"),
+      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",
@@ -127,15 +143,29 @@ const HomeRoutes = {
       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"),
+      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",

+ 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,
+      },
+    });
   }
 };
 //删除

+ 174 - 86
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,19 +24,24 @@
         :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>
@@ -45,7 +50,7 @@
                 <el-form-item label="描述" size="default">
                   <el-select
                     style="width: 100%"
-                    v-model="tableForm.englin"
+                    v-model="tableForm.columnDescribe"
                     class="input-shadow"
                     filterable
                     default-first-option
@@ -66,7 +71,7 @@
                 <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 +92,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 +113,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
@@ -129,7 +134,7 @@
                 <el-form-item label="数据类型" size="default">
                   <el-select
                     style="width: 100%"
-                    v-model="tableForm.text1"
+                    v-model="tableForm.dataType"
                     class="input-shadow"
                     filterable
                     default-first-option
@@ -150,7 +155,7 @@
                 <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 +176,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 +197,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 +218,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 +246,40 @@
 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: "",
+  queryTemplateColumnSetID: "",
+  queryTemplateID: route.query.queryTemplateID,
+  columnName: "",
+  columnLabel: "",
+  columnDescribe: "",
+  needSort: "",
+  needFilters: "",
+  needShow: "",
+  needGroup: "",
+  dataType: "",
+  listqueryTemplateID: "",
+  needCount: "",
+  orderNumber: "",
+  needSearch: "",
+  event: "",
 }); //弹窗内容
 //列表
-const tableData = ref([
-  {
-    name: "测试",
-    china: "测试",
-    englin: "测试",
-    two: "测试",
-    three: "测试",
-    text: "测试",
-    text1: "测试",
-    text2: "测试",
-    text3: "测试",
-    text4: "测试",
-    text5: "测试",
-  },
-  {
-    name: "测试",
-    china: "测试",
-    englin: "测试",
-    two: "测试",
-    three: "测试",
-    text: "测试",
-    text1: "测试",
-    text2: "测试",
-    text3: "测试",
-    text4: "测试",
-    text5: "测试",
-  },
-  {
-    name: "测试",
-    china: "测试",
-    englin: "测试",
-    two: "测试",
-    three: "测试",
-    text: "测试",
-    text1: "测试",
-    text2: "测试",
-    text3: "测试",
-    text4: "测试",
-    text5: "测试",
-  },
-]);
+const tableData = ref([]);
 //表头
 const state = reactive({
   list: [
@@ -334,22 +313,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 +351,38 @@ 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;
+    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 === 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 +392,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="请输入连接参数"