|
@@ -10,7 +10,8 @@ const UrlList = await getGroupUrl(['KxsConfigServer']);
|
|
|
|
|
|
export function useApiGroup() {
|
|
|
let form = reactive({
|
|
|
- GroupName: "1"
|
|
|
+ GroupName: "", //名称
|
|
|
+
|
|
|
});
|
|
|
const dataList = ref([]);
|
|
|
const loading = ref(false);
|
|
@@ -36,7 +37,7 @@ export function useApiGroup() {
|
|
|
},
|
|
|
{
|
|
|
label: "名称",
|
|
|
- prop: "GroupName",
|
|
|
+ prop: "groupName",
|
|
|
minWidth: 200
|
|
|
},
|
|
|
|
|
@@ -64,23 +65,29 @@ export function useApiGroup() {
|
|
|
}
|
|
|
// 搜索列表
|
|
|
async function onSearch(type = 'search') {
|
|
|
- if (type == 'search' && !Object.values(form).some(item => !!item)) {
|
|
|
- return ElMessage({
|
|
|
- message: "请输入查询条件",
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- };
|
|
|
+ if (type === 'all') {
|
|
|
+ form.GroupName = "";
|
|
|
+ }
|
|
|
+ // if (type == 'search' && !Object.values(form).some(item => !!item)) {
|
|
|
+ // return ElMessage({
|
|
|
+ // message: "请输入查询条件",
|
|
|
+ // type: "error"
|
|
|
+ // });
|
|
|
+ // };
|
|
|
loading.value = true;
|
|
|
- var sss = await http.Request({ method: UrlList.KxsConfigServer.ApiGrouplist.method, url: UrlList.KxsConfigServer.ApiGrouplist.url, params: { ...form, page_size: pagination.pageSize, page_num: pagination.currentPage } });
|
|
|
- console.log('sss:', sss);
|
|
|
- const { data, other }: any = http.Request({ method: UrlList.KxsConfigServer.ApiGrouplist.method, url: UrlList.KxsConfigServer.ApiGrouplist.url, params: { ...form, page_size: pagination.pageSize, page_num: pagination.currentPage } });
|
|
|
- console.log('data:', data);
|
|
|
- console.log('other:', other);
|
|
|
- dataList.value = data;
|
|
|
- pagination.total = other.Count;
|
|
|
- setTimeout(() => {
|
|
|
- loading.value = false;
|
|
|
- }, 500);
|
|
|
+ const { status, msg, data }: any = await http.Request({ method: UrlList.KxsConfigServer.ApiGrouplist.method, url: UrlList.KxsConfigServer.ApiGrouplist.url, params: { ...form, PageSize: pagination.pageSize, PageNum: pagination.currentPage } });
|
|
|
+ if (status === 1) {
|
|
|
+ dataList.value = data.result;
|
|
|
+ pagination.total = data.totalNum;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 500);
|
|
|
+ } else {
|
|
|
+ ElMessageBox.alert(msg, "提示", {
|
|
|
+ confirmButtonText: "关闭",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
onSearch();
|
|
@@ -97,7 +104,7 @@ export function useApiGroup() {
|
|
|
type: "warning"
|
|
|
}
|
|
|
).then(async () => {
|
|
|
- const { status, info }: any = await http.request(KxsConfigServer.ApiGroupdelete.method, KxsConfigServer.ApiGroupdelete.url, { Id: row.Id });
|
|
|
+ const { status, info }: any = await http.Request({ method: UrlList.KxsConfigServer.ApiGroupdelete.method, url: UrlList.KxsConfigServer.ApiGroupdelete.url, params: { Id: row.Id } });
|
|
|
if (status === "1") {
|
|
|
ElMessage({
|
|
|
message: "删除成功",
|