|
@@ -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;
|
|
@@ -109,6 +109,7 @@ export function useApiInfo() {
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
onSearch();
|
|
|
+ apiInfoquery();
|
|
|
});
|
|
|
|
|
|
// 删除
|
|
@@ -131,9 +132,9 @@ export function useApiInfo() {
|
|
|
onSearch();
|
|
|
} else {
|
|
|
ElMessageBox.alert(msg, "提示", {
|
|
|
- confirmButtonText: "关闭",
|
|
|
- type: "warning"
|
|
|
- });
|
|
|
+ confirmButtonText: "关闭",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
};
|
|
|
})
|
|
|
}
|
|
@@ -153,6 +154,19 @@ export function useApiInfo() {
|
|
|
editUpdateFormData.value = row;
|
|
|
};
|
|
|
|
|
|
+ // 分组选项数据
|
|
|
+ const groupIdOptionList = ref([])
|
|
|
+
|
|
|
+ //获取分组数据
|
|
|
+ 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.value = data.records;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
return {
|
|
|
form,
|
|
|
loading,
|
|
@@ -169,6 +183,7 @@ export function useApiInfo() {
|
|
|
editUpdateVisible,
|
|
|
editUpdateFormData,
|
|
|
handleDelete,
|
|
|
+ groupIdOptionList
|
|
|
|
|
|
};
|
|
|
}
|