lcl před 8 měsíci
rodič
revize
405378e002

+ 13 - 3
src/views/menuitem/ApiInfo/components/add/index.vue

@@ -41,14 +41,14 @@ let UpdateForm = ref({
 
 });
 // 分组选项数据
-const groupIdOptionList = []
+let groupIdOptionList = []
 
 // 选项卡参数(默认值为列表某项的id)
 const activeId = ref('1')
 // 提交函数
 const submit = async () => {
   const UrlList = await getGroupUrl(['kxsConfigServer']);
-  const { status, msg }: any = await http.Request({ method: UrlList.kxsConfigServer.apiInfoadd.method, url: UrlList.kxsConfigServer.apiInfoadd.url, params: UpdateForm.value});
+  const { status, msg }: any = await http.Request({ method: UrlList.kxsConfigServer.apiInfoadd.method, url: UrlList.kxsConfigServer.apiInfoadd.url, params: UpdateForm.value });
   if (status === 1) {
     ElMessage({
       message: "新增成功",
@@ -72,6 +72,16 @@ const submit = async () => {
     });
   };
 };
+//获取分组数据
+const apiInfoquery = async () => {
+  //通过ID获取表格数据
+  const UrlList = await getGroupUrl(['kxsConfigServer']);
+  const { status, data }: any = await http.Request({ method: UrlList.kxsConfigServer.apiGroupselectList.method, url: UrlList.kxsConfigServer.apiGroupselectList.url, params: {} });
+  if (status === 1) {
+    groupIdOptionList = data.records;
+  }
+};
+apiInfoquery();
 const closeFn: any = inject('closeAddVisible');
 // 关闭弹窗回调函数
 const closeVisible = () => {
@@ -100,7 +110,7 @@ const closeVisible = () => {
           clearable,
           class="!w-[230px]"
         )
-          el-option(:label="item.label", :value="item.Id" v-for="(item,index) in groupIdOptionList")
+          el-option(:label="item.groupName", :value="item.id" v-for="(item,index) in groupIdOptionList")
       el-form-item(label='接口名称' prop="apiName")
         el-input(v-model='UpdateForm.apiName' autocomplete='off' class="!w-[230px]"
           placeholder="请输入接口名称")

+ 14 - 4
src/views/menuitem/ApiInfo/components/update/index.vue

@@ -41,14 +41,14 @@ let UpdateForm: any = ref({
 
 });
 // 分组选项数据
-const groupIdOptionList = []
+let groupIdOptionList = []
 
 // 选项卡参数(默认值为列表某项的id)
 const activeId = ref('1')
 // 提交函数
 const submit = async () => {
   const UrlList = await getGroupUrl(['kxsConfigServer']);
-  const { status, msg }: any = await http.Request({ method: UrlList.kxsConfigServer.apiInfoupdate.method, url: UrlList.kxsConfigServer.apiInfoupdate.url, params: UpdateForm.value});
+  const { status, msg }: any = await http.Request({ method: UrlList.kxsConfigServer.apiInfoupdate.method, url: UrlList.kxsConfigServer.apiInfoupdate.url, params: UpdateForm.value });
   if (status === 1) {
     ElMessage({
       message: "修改成功",
@@ -78,11 +78,21 @@ const closeFn: any = inject('closeEditUpdateVisible');
 const openVisible = async () => {
   //通过ID获取表格数据
   const UrlList = await getGroupUrl(['kxsConfigServer']);
-  const { status, data }: any = await http.Request({method: UrlList.kxsConfigServer.apiInfoquery.method, url: UrlList.kxsConfigServer.apiInfoquery.url, params: props.formData});
+  const { status, data }: any = await http.Request({ method: UrlList.kxsConfigServer.apiInfoquery.method, url: UrlList.kxsConfigServer.apiInfoquery.url, params: props.formData });
   if (status === 1) {
     UpdateForm.value = data;
   }
 };
+//获取分组数据
+const apiInfoquery = async () => {
+  //通过ID获取表格数据
+  const UrlList = await getGroupUrl(['kxsConfigServer']);
+  const { status, data }: any = await http.Request({ method: UrlList.kxsConfigServer.apiGroupselectList.method, url: UrlList.kxsConfigServer.apiGroupselectList.url, params: {} });
+  if (status === 1) {
+    groupIdOptionList = data.records;
+  }
+};
+apiInfoquery();
 // 关闭弹窗回调函数
 const closeVisible = () => {
   UpdateForm.value = {
@@ -106,7 +116,7 @@ const closeVisible = () => {
           clearable,
           class="!w-[230px]"
         )
-          el-option(:label="item.label", :value="item.Id" v-for="(item,index) in groupIdOptionList")
+          el-option(:label="item.groupName", :value="item.id" v-for="(item,index) in groupIdOptionList")
       el-form-item(label='接口名称' prop="apiName")
         el-input(v-model='UpdateForm.apiName' autocomplete='off' class="!w-[230px]"
           placeholder="请输入接口名称")

+ 8 - 8
src/views/menuitem/ApiInfo/hook.tsx

@@ -10,8 +10,8 @@ const UrlList = await getGroupUrl(['kxsConfigServer']);
 
 export function useApiInfo() {
   let form = reactive({
-    groupId: "0", //分组
-    apiName: "", //接口名称
+      groupId:0, //分组
+      apiName:"", //接口名称
 
   });
   const dataList = ref([]);
@@ -82,8 +82,8 @@ export function useApiInfo() {
   // 搜索列表
   async function onSearch(type = 'search') {
     if (type === 'all') {
-      form.groupId = "0";
-      form.apiName = "";
+         form.groupId = 0;
+   form.apiName = "";
 
     }
     // if (type == 'search' && !Object.values(form).some(item => !!item)) {
@@ -93,7 +93,7 @@ export function useApiInfo() {
     //   });
     // };
     loading.value = true;
-    const { status, msg, data }: any = await http.Request({ method: UrlList.kxsConfigServer.apiInfolist.method, url: UrlList.kxsConfigServer.apiInfolist.url, params: { ...form, pageSize: pagination.pageSize, pageNum: pagination.currentPage } });
+    const { status, msg, data }: any = await http.Request({ method: UrlList.kxsConfigServer.apiInfolist.method, url: UrlList.kxsConfigServer.apiInfolist.url, params: { ...form, pageSize: pagination.pageSize, pageNum: pagination.currentPage }});
     if (status === 1) {
       dataList.value = data.records;
       pagination.total = data.total;
@@ -131,9 +131,9 @@ export function useApiInfo() {
         onSearch();
       } else {
         ElMessageBox.alert(msg, "提示", {
-          confirmButtonText: "关闭",
-          type: "warning"
-        });
+        confirmButtonText: "关闭",
+        type: "warning"
+      });
       };
     })
   }

+ 16 - 3
src/views/menuitem/ApiInfo/index.vue

@@ -7,6 +7,7 @@ export default {
 <script setup lang="ts">
 import { provide, ref } from "vue";
 import { useApiInfo } from "./hook";
+import { http } from "@/utils/http";
 import { hasAuth } from "@/router/utils";
 import { PureTableBar } from "@/components/RePureTableBar";
 import { useRenderIcon } from "@/components/ReIcon/src/hooks";
@@ -15,6 +16,8 @@ import EditUpdate from "./components/update/index.vue";
 import Search from "@iconify-icons/ep/search";
 import All from "@iconify-icons/ep/refresh-left";
 import Addicon from "@iconify-icons/ep/document-add";
+// 获取URLLIST
+import { getGroupUrl } from "@/utils/getUrl/getUrl";
 
 const formRef = ref();
 const {
@@ -49,8 +52,18 @@ provide('closeEditUpdateVisible', closeEditUpdateVisible)
 
 
 // 分组选项数据
-const groupIdOptionList = []
-
+let groupIdOptionList = []
+
+//获取分组数据
+async function apiInfoquery() {
+  //通过ID获取表格数据
+  const UrlList = await getGroupUrl(['kxsConfigServer']);
+  const { status, data }: any = await http.Request({ method: UrlList.kxsConfigServer.apiGroupselectList.method, url: UrlList.kxsConfigServer.apiGroupselectList.url, params: {} });
+  if (status === 1) {
+    groupIdOptionList = data.records;
+  }
+};
+apiInfoquery();
 </script>
 
 <template lang="pug">
@@ -72,7 +85,7 @@ const groupIdOptionList = []
           clearable,
           class="!w-[230px]"
         )
-          el-option(:label="item.label", :value="item.Id" v-for="(item,index) in groupIdOptionList")
+          el-option(:label="item.groupName", :value="item.id" v-for="(item,index) in groupIdOptionList")
       el-form-item(label='接口名称' prop="apiName")
         el-input(v-model='form.apiName' autocomplete='off' class="!w-[230px]"
           placeholder="请输入接口名称")