فهرست منبع

子账号管理对接

zouzs 6 روز پیش
والد
کامیت
583e4ebb99

+ 62 - 0
src/api/childAccount.ts

@@ -0,0 +1,62 @@
+import { http } from "@/utils/http";
+import { baseUrlApi } from "./utils";
+
+type Result = {
+  code: number;
+  success: boolean;
+  data: Array<any>;
+  msg: string;
+};
+
+export const getMerchantBgSubList = data => {
+  return http.request<Result>(
+    "post",
+    baseUrlApi("merchantUserInfo/getChildAccountNotMainPage"),
+    {
+      data
+    }
+  );
+};
+
+export const createChildAccount = data => {
+  return http.request<Result>(
+    "post",
+    baseUrlApi("merchantUserInfo/createChildAccount"),
+    {
+      data
+    }
+  );
+};
+
+export const updateChildAccount = data => {
+  return http.request<Result>("post", baseUrlApi("merchantUserInfo/update"), {
+    data
+  });
+};
+
+export const merchantUserInfoDetail = (id: string) => {
+  return http.request<Result>(
+    "get",
+    baseUrlApi(`merchantUserInfo/detail/${id}`)
+  );
+};
+
+export const merchantUserInfoupdateStatus = data => {
+  return http.request<Result>(
+    "post",
+    baseUrlApi(`merchantUserInfo/updateStatus`),
+    {
+      data
+    }
+  );
+};
+
+export const merchantUserInfoupdateAllocationStatus = data => {
+  return http.request<Result>(
+    "post",
+    baseUrlApi(`merchantUserInfo/updateAllocationStatus`),
+    {
+      data
+    }
+  );
+};

+ 13 - 0
src/api/public.ts

@@ -0,0 +1,13 @@
+import { http } from "@/utils/http";
+import { baseUrlApi } from "./utils";
+
+type Result = {
+  success: boolean;
+  data: Array<any>;
+};
+
+export const getLocalDict = data => {
+  return http.request<Result>("post", baseUrlApi("crmSystem/getLocalDict"), {
+    data
+  });
+};

+ 0 - 77
src/api/system/code.ts

@@ -1,77 +0,0 @@
-import { http } from "@/utils/http";
-import { baseUrlApi } from "../utils";
-
-export interface BasicResponseModel<T = any> {
-  code: number;
-  msg: string;
-  data: T;
-}
-
-export interface BaseListResponseModel<T = any> {
-  code: number;
-  msg: string;
-  rows: T[];
-  total: number;
-}
-
-/**
- * 获取业务系统列表
- * @param query
- */
-export const getBusinessSystemList = (query?: object) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi("system/businessSystem/list"),
-    { params: query }
-  );
-};
-
-/**
- * 添加业务系统
- * @param query
- */
-export const addBusinessSystem = (query?: object) => {
-  return http.request<BasicResponseModel>(
-    "post",
-    baseUrlApi("system/businessSystem"),
-    {
-      data: query
-    }
-  );
-};
-
-/**
- * 修改业务系统
- * @param query
- */
-export const updateBusinessSystem = (query?: object) => {
-  return http.request<BasicResponseModel>(
-    "put",
-    baseUrlApi("system/businessSystem"),
-    {
-      data: query
-    }
-  );
-};
-
-/**
- * 删除业务系统
- * @param id
- */
-export const deleteBusinessSystem = (id: number) => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    baseUrlApi(`system/businessSystem/${id}`)
-  );
-};
-
-/**
- * 根据ID获取业务系统详细信息
- * @param id
- */
-export const getBusinessSystem = (id: number) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi(`system/businessSystem/info/${id}`)
-  );
-};

+ 0 - 62
src/api/system/dept.ts

@@ -1,62 +0,0 @@
-import { http } from "@/utils/http";
-import { baseUrlApi } from "../utils";
-
-export interface BasicResponseModel<T = any> {
-  code: number;
-  msg: string;
-  data: T;
-}
-
-/**
- * 获取部门列表
- * @param query
- */
-export const getSystemDeptList = (query?: object) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi("system/dept/list"),
-    { params: query }
-  );
-};
-
-/**
- * 添加部门
- * @param query
- */
-export const addDept = (query?: object) => {
-  return http.request<BasicResponseModel>("post", baseUrlApi("system/dept"), {
-    data: query
-  });
-};
-
-/**
- * 修改部门
- * @param query
- */
-export const updateDept = (query?: object) => {
-  return http.request<BasicResponseModel>("put", baseUrlApi("system/dept"), {
-    data: query
-  });
-};
-
-/**
- * 删除部门
- * @param id
- */
-export const deleteDept = (id: number) => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    baseUrlApi(`system/dept/${id}`)
-  );
-};
-
-/**
- * 根据ID获取部门详细信息
- * @param id
- */
-export const getDept = (id: number) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi(`system/dept/${id}`)
-  );
-};

+ 0 - 158
src/api/system/dict.ts

@@ -1,158 +0,0 @@
-import { http } from "@/utils/http";
-import { baseUrlApi } from "../utils";
-
-export interface DictList<T = any> {
-  code: number;
-  msg: string;
-  rows: T;
-  total?: number;
-}
-
-export interface BasicResponseModel<T = any> {
-  code: number;
-  msg: string;
-  data: T;
-}
-
-/**
- * 获取字典类型列表
- * @param query
- */
-export const getSystemDictList = (query?: object) => {
-  return http.request<DictList>("get", baseUrlApi("system/dict/type/list"), {
-    params: query
-  });
-};
-
-/**
- * 添加字典类型
- * @param data
- */
-export const addSystemDictType = (data: object) => {
-  return http.request<BasicResponseModel>(
-    "post",
-    baseUrlApi("system/dict/type"),
-    { data }
-  );
-};
-
-/**
- * 修改字典类型
- * @param data
- */
-export const updateSystemDictType = (data: object) => {
-  return http.request<BasicResponseModel>(
-    "put",
-    baseUrlApi("system/dict/type"),
-    { data }
-  );
-};
-
-/**
- * 删除字典类型
- * @param id
- */
-export const deleteSystemDictType = (id: string) => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    baseUrlApi(`system/dict/type/${id}`)
-  );
-};
-
-/**
- * 根据ID获取字典类型详细信息
- * @param id
- */
-export const getSystemDictById = (id: string) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi(`system/dict/type/${id}`)
-  );
-};
-
-/**
- * 获取字典名称下拉框
- */
-export const getDictTypeOptionSelect = () => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi("system/dict/type/optionselect")
-  );
-};
-
-/**
- * 获取字典数据列表
- * @param query
- */
-export const getSystemDictDataList = (query?: object) => {
-  return http.request<DictList>("get", baseUrlApi("system/dict/data/list"), {
-    params: query
-  });
-};
-
-/**
- * 添加字典数据
- * @param data
- */
-export const addSystemDictData = (data: object) => {
-  return http.request<BasicResponseModel>(
-    "post",
-    baseUrlApi("system/dict/data"),
-    { data }
-  );
-};
-
-/**
- * 修改字典数据
- * @param data
- */
-export const updateSystemDictData = (data: object) => {
-  return http.request<BasicResponseModel>(
-    "put",
-    baseUrlApi("system/dict/data"),
-    { data }
-  );
-};
-
-/**
- * 删除字典数据
- * @param id
- */
-export const deleteSystemDictData = (id: string) => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    baseUrlApi(`system/dict/data/${id}`)
-  );
-};
-
-/**
- * 根据ID获取字典数据详细信息
- * @param id
- */
-export const getSystemDictDataById = (id: string) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi(`system/dict/data/${id}`)
-  );
-};
-
-/**
- * 获取字典数据根据字典类型
- * @param dictType
- */
-export const getDictDataByType = (dictType: string) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi(`system/dict/data/type/${dictType}`)
-  );
-};
-
-/**
- * 刷新字典缓存
- */
-export const refreshDictCache = () => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    baseUrlApi("system/dict/type/refreshCache")
-  );
-};

+ 0 - 57
src/api/system/ipAccount.ts

@@ -1,57 +0,0 @@
-import { http } from "@/utils/http";
-import { interfaceUrlApi } from "../utils";
-
-export interface BasicResponseModel<T = any> {
-  code: number;
-  msg: string;
-  list: T;
-  data: T;
-  total: number;
-}
-
-/**
- * 获取账户列表
- * @param query
- */
-export const getIpAccountList = (query?: object) => {
-  return http.get<BasicResponseModel, any>(interfaceUrlApi("ipAccount/list"), {
-    params: query
-  });
-};
-
-/**
- * 新增账户
- * @param data
- */
-export const addOrEditIpAccount = (data?: object) => {
-  return http.post<BasicResponseModel, any>(
-    interfaceUrlApi(`ipAccount/saveOrUpdate`),
-    {
-      data
-    }
-  );
-};
-
-/**
- * 删除账户
- * @param id
- */
-export const deleteIpAccount = (id: number) => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    interfaceUrlApi(`ipAccount/delete/${id}`)
-  );
-};
-
-/**
- * 切换账户状态
- * @param data
- */
-export const switchIpAccountStatus = (data?: object) => {
-  return http.post<BasicResponseModel, any>(
-    interfaceUrlApi(`ipAccount/switchStatus`),
-    {
-      data
-    }
-  );
-};

+ 0 - 122
src/api/system/ipInterface.ts

@@ -1,122 +0,0 @@
-import { http } from "@/utils/http";
-import { interfaceUrlApi } from "../utils";
-
-export interface BasicResponseModel<T = any> {
-  code: number;
-  msg: string;
-  list: T;
-  data: T;
-  total: number;
-}
-
-/**
- * 获取接口列表
- * @param query
- */
-export const getIpInterfaceList = (query?: object) => {
-  return http.get<BasicResponseModel, any>(
-    interfaceUrlApi("ipInterface/list"),
-    {
-      params: query
-    }
-  );
-};
-
-/**
- * 新增或编辑接口
- * @param data
- */
-export const addOrEditIpInterface = (data?: object) => {
-  return http.post<BasicResponseModel, any>(
-    interfaceUrlApi("ipInterface/saveOrUpdate"),
-    {
-      data
-    }
-  );
-};
-
-/**
- * 删除接口
- * @param id
- */
-export const deleteIpInterface = (id: number) => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    interfaceUrlApi(`ipInterface/delete/${id}`)
-  );
-};
-
-/**
- * 查询账号下关联的接口列表
- * @param query
- */
-export const getIpAccountInterfaceList = (query?: object) => {
-  return http.post<BasicResponseModel, any>(
-    interfaceUrlApi("ipInterface/account/ref/list"),
-    {
-      data: query
-    }
-  );
-};
-
-/**
- * 接口下拉列表
- * @param query
- */
-export const getIpInterfaceOptionList = (query?: object) => {
-  return http.post<BasicResponseModel, any>(
-    interfaceUrlApi("ipInterface/optionList"),
-    {
-      params: query
-    }
-  );
-};
-
-/**
- * 保存账号关联的接口
- * @param data
- */
-export const addOrEditIpAccountInterfaceRef = (data?: object) => {
-  return http.post<BasicResponseModel, any>(
-    interfaceUrlApi("ipInterface/interfaceConfig"),
-    {
-      data
-    }
-  );
-};
-
-/**
- * 切换接口状态
- * @param data
- */
-export const switchIpInterfaceStatus = (data?: object) => {
-  return http.post<BasicResponseModel, any>(
-    interfaceUrlApi(`ipInterface/switchStatus`),
-    {
-      data
-    }
-  );
-};
-
-/**
- * 切换账号关联的接口状态
- * @param data
- */
-export const switchIpAccountInterfaceStatus = (data?: object) => {
-  return http.post<BasicResponseModel, any>(
-    interfaceUrlApi(`ipInterface/account/interface/ref/switchStatus`),
-    {
-      data
-    }
-  );
-};
-
-/**
- * 生成token
- */
-export const generateIpAccountToken = () => {
-  return http.request<BasicResponseModel>(
-    "post",
-    interfaceUrlApi(`ipInterface/token/generate`)
-  );
-};

+ 0 - 45
src/api/system/ipInterfaceCall.ts

@@ -1,45 +0,0 @@
-import { http } from "@/utils/http";
-import { interfaceUrlApi } from "../utils";
-
-export interface BasicResponseModel<T = any> {
-  code: number;
-  msg: string;
-  list: T;
-  data: T;
-  total: number;
-}
-
-/**
- * 获取调用记录列表
- * @param query
- */
-export const getIpInterfaceCallList = (query?: object) => {
-  return http.get<BasicResponseModel, any>(
-    interfaceUrlApi("ipInterface/call/list"),
-    {
-      params: query
-    }
-  );
-};
-
-/**
- * 根据ID获取调用记录详细信息
- * @param id
- */
-export const getIpInterfaceCallDetailById = (id: string) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    interfaceUrlApi(`ipInterface/call/detail/${id}`)
-  );
-};
-
-/**
- * 查询接口回调记录
- * @param id
- */
-export const getIpInterfaceCallRecord = (id: string) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    interfaceUrlApi(`ipInterface/call/callback/history/${id}`)
-  );
-};

+ 0 - 50
src/api/system/logininfor.ts

@@ -1,50 +0,0 @@
-import { http } from "@/utils/http";
-import { baseUrlApi } from "../utils";
-
-export interface operlogList<T = any> {
-  code: number;
-  msg: string;
-  rows: T;
-  total?: number;
-}
-
-export interface BasicResponseModel<T = any> {
-  code: number;
-  msg: string;
-  data: T;
-}
-
-/**
- * 获取登录日志列表
- * @param query
- */
-export const getSystemLogininforList = (query?: object) => {
-  return http.request<operlogList>(
-    "get",
-    baseUrlApi("system/logininfor/list"),
-    {
-      params: query
-    }
-  );
-};
-
-/**
- * 删除登录日志
- * @param id
- */
-export const deleteSystemLogininfor = (id: string) => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    baseUrlApi(`system/logininfor/${id}`)
-  );
-};
-
-/**
- * 清空登录日志
- */
-export const cleanSystemLogininfor = () => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    baseUrlApi("system/logininfor/clean")
-  );
-};

+ 0 - 101
src/api/system/menu.ts

@@ -1,101 +0,0 @@
-import { http } from "@/utils/http";
-import { baseUrlApi } from "../utils";
-
-export interface BasicResponseModel<T = any> {
-  code: number;
-  msg: string;
-  data: T;
-}
-
-/**
- * 获取菜单列表
- * @param query
- */
-export const getSystemMenuList = (query?: object) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi("system/menu/list"),
-    { params: query }
-  );
-};
-
-/**
- * 根据ID获取菜单详细信息
- * @param id
- */
-export const getSystemMenuDetailById = (id: number) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi(`system/menu/${id}`)
-  );
-};
-
-/**
- * 添加菜单
- * @param data
- */
-export const addMenu = (data?: object) => {
-  return http.post<BasicResponseModel, any>(baseUrlApi(`system/menu`), {
-    data
-  });
-};
-
-/**
- * 修改菜单
- * @param data
- */
-export const updateMenu = (data?: object) => {
-  return http.put<BasicResponseModel, any>(baseUrlApi(`system/menu`), { data });
-};
-
-/**
- * 删除菜单
- * @param id
- */
-export const deleteMenu = (id: number) => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    baseUrlApi(`system/menu/${id}`)
-  );
-};
-
-/**
- * 获取业务系统列表
- */
-export const getSystemList = () => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi(`system/businessSystem/list`)
-  );
-};
-
-/**
- * 获取部门树结构
- */
-export interface DeptTreeModel<T = any> {
-  code: number;
-  msg: string;
-  depts: T;
-  checkedKeys: number[];
-}
-
-/**
- * 获取菜单树结构
- */
-export const getMenuListTree = () => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi(`system/menu/treeselect`)
-  );
-};
-
-/**
- * 获取角色对应菜单树结构
- * @param id
- */
-export const getMenuListTreeSelect = (id?: string) => {
-  return http.request<DeptTreeModel>(
-    "get",
-    baseUrlApi(`system/menu/roleMenuTreeselect/${id}`)
-  );
-};

+ 0 - 46
src/api/system/operlog.ts

@@ -1,46 +0,0 @@
-import { http } from "@/utils/http";
-import { baseUrlApi } from "../utils";
-
-export interface operlogList<T = any> {
-  code: number;
-  msg: string;
-  rows: T;
-  total?: number;
-}
-
-export interface BasicResponseModel<T = any> {
-  code: number;
-  msg: string;
-  data: T;
-}
-
-/**
- * 获取操作日志列表
- * @param query
- */
-export const getSystemOperlogList = (query?: object) => {
-  return http.request<operlogList>("get", baseUrlApi("system/operlog/list"), {
-    params: query
-  });
-};
-
-/**
- * 删除操作日志
- * @param ids
- */
-export const deleteSystemOperlog = (ids: string) => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    baseUrlApi(`system/operlog/${ids}`)
-  );
-};
-
-/**
- * 清空操作日志
- */
-export const cleanSystemOperlog = () => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    baseUrlApi("system/operlog/clean")
-  );
-};

+ 0 - 126
src/api/system/role.ts

@@ -1,126 +0,0 @@
-import { http } from "@/utils/http";
-import { baseUrlApi } from "../utils";
-
-export interface BasicResponseModel<T = any> {
-  code: number;
-  msg: string;
-  data: T;
-}
-
-export interface BasicPageResponseModel<T = any> {
-  code: number;
-  msg: string;
-  rows: T;
-  total: number;
-}
-
-export interface DeptTreeModel<T = any> {
-  code: number;
-  msg: string;
-  depts: T;
-  checkedKeys: number[];
-}
-
-/**
- * 获取角色列表
- * @param query
- */
-export const getSystemRoleList = (query?: object) => {
-  return http.request<BasicPageResponseModel>(
-    "post",
-    baseUrlApi("system/role/list"),
-    { params: query }
-  );
-};
-
-/**
- * 修改角色状态
- * @param roleId
- * @param status
- */
-export const changeRoleStatus = (roleId: number, status: string) => {
-  const data = {
-    roleId,
-    status
-  };
-  return http.request<BasicResponseModel>(
-    "put",
-    baseUrlApi("system/role/changeStatus"),
-    { data }
-  );
-};
-
-/**
- * 获取角色部门树
- * @param id
- */
-export const getSystemRoleDeptTree = (id?: string) => {
-  return http.request<DeptTreeModel>(
-    "get",
-    baseUrlApi(`system/role/deptTree/${id}`)
-  );
-};
-
-/**
- * 添加角色
- * @param data
- */
-export const addSystemRole = (data: object) => {
-  return http.request<BasicResponseModel>("post", baseUrlApi("system/role"), {
-    data
-  });
-};
-
-/**
- * 修改角色
- * @param data
- */
-export const updateSystemRole = (data: object) => {
-  return http.request<BasicResponseModel>("put", baseUrlApi("system/role"), {
-    data
-  });
-};
-
-/**
- * 删除角色
- * @param id
- */
-export const deleteSystemRole = (id: string) => {
-  return http.request<BasicResponseModel>(
-    "delete",
-    baseUrlApi(`system/role/${id}`)
-  );
-};
-
-/**
- * 根据ID获取角色详细信息
- * @param id
- */
-export const getSystemRoleById = (id?: string) => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi(`system/role/${id}`)
-  );
-};
-
-/**
- * 修改角色数据权限
- * @param data
- */
-export const putSystemRoleDataScope = (data: object) => {
-  return http.request<BasicResponseModel>(
-    "put",
-    baseUrlApi("system/role/dataScope"),
-    { data }
-  );
-};
-
-/**
- * 获取角色选择框列表
- */
-export const getSystemRoleOptionselect = () => {
-  return http.request<BasicResponseModel>(
-    "get",
-    baseUrlApi("system/role/optionselect")
-  );
-};

+ 18 - 0
src/router/modules/childAccount.ts

@@ -0,0 +1,18 @@
+// 最简代码,也就是这些字段必须有
+export default {
+  path: "/childAccount",
+  meta: {
+    title: "子账号管理"
+  },
+  children: [
+    {
+      path: "/childAccount/index",
+      name: "ChildAccount",
+      component: () => import("@/views/childAccount/index.vue"),
+      meta: {
+        title: "子账号管理",
+        showParent: true
+      }
+    }
+  ]
+} as RouteConfigsTable;

+ 1 - 0
src/router/modules/error.ts

@@ -5,6 +5,7 @@ export default {
     icon: "ri/information-line",
     // showLink: false,
     title: "异常页面",
+    showLink: false,
     rank: 9
   },
   children: [

+ 27 - 0
src/router/modules/order.ts

@@ -0,0 +1,27 @@
+// 最简代码,也就是这些字段必须有
+export default {
+  path: "/order",
+  meta: {
+    title: "订单管理"
+  },
+  children: [
+    {
+      path: "/order/order-loan",
+      name: "OrderLoan",
+      component: () => import("@/views/order/orderLoan/index.vue"),
+      meta: {
+        title: "全部订单",
+        showParent: true
+      }
+    },
+    {
+      path: "/order/order-my",
+      name: "OrderMy",
+      component: () => import("@/views/order/orderMy/index.vue"),
+      meta: {
+        title: "我的订单",
+        showParent: true
+      }
+    }
+  ]
+} as RouteConfigsTable;

+ 3 - 3
src/utils/auth.ts

@@ -114,8 +114,8 @@ export function setUserInfo(data: DataInfo<number>) {
     const user = data.user;
     setUserKey({
       avatar: user?.avatar ?? "",
-      username: user?.username ?? "",
-      nickname: user?.nickname ?? "",
+      username: user?.loginName ?? "",
+      nickname: user?.admUserName ?? "",
       roles,
       permissions
     });
@@ -149,7 +149,7 @@ export function removeToken() {
 
 /** 格式化token(jwt格式) */
 export const formatToken = (token: string): string => {
-  return "Bearer " + token;
+  return token;
 };
 
 /** 是否有按钮级别的权限(根据登录接口返回的`permissions`字段进行判断)*/

+ 2 - 6
src/utils/http/index.ts

@@ -98,14 +98,10 @@ class PureHttp {
                                       PureHttp.isRefreshing = false;
                                     });
                                 }*/
-                  config.headers["authorization"] = formatToken(
-                    data.access_token
-                  );
+                  config.headers["token"] = formatToken(data.token);
                   resolve(config);
                 } else {
-                  config.headers["authorization"] = formatToken(
-                    data.access_token
-                  );
+                  config.headers["token"] = formatToken(data.token);
                   resolve(config);
                 }
               } else {

+ 218 - 107
src/views/ipAccount/index.vue → src/views/childAccount/index.vue

@@ -12,18 +12,14 @@
       :table="{
         actionBar: { buttons, type: 'link', width: 180 },
         adaptive: { offsetBottom: 50 },
-        onFormChange: handleTableChange
+        onFormChange: handleTableChange,
+        hasIndexColumn: true
       }"
       :pageInfoMap="{ page: 'pageNum', pageSize: 'pageSize' }"
     >
       <template #table-title>
         <el-row class="button-row">
-          <el-button
-            v-perms="'ipAccount:index:add'"
-            size="default"
-            type="success"
-            @click="handleCreate"
-          >
+          <el-button size="default" type="success" @click="handleCreate">
             新增
           </el-button>
         </el-row>
@@ -36,8 +32,8 @@
       v-model:visible="dialogVisible"
       :form="{
         columns,
-        labelPosition: 'right',
-        labelWidth: 100,
+        labelPosition: 'left',
+        labelWidth: 190,
         rules
       }"
       :dialog="{ title: dialogTitle + '菜单', width: 600, confirmLoading }"
@@ -48,7 +44,14 @@
 </template>
 
 <script lang="ts" setup>
-import { computed, reactive, ref, resolveDirective, toRefs } from "vue";
+import {
+  computed,
+  onMounted,
+  reactive,
+  ref,
+  resolveDirective,
+  toRefs
+} from "vue";
 import type { FormRules } from "element-plus";
 import { ElMessage, ElMessageBox } from "element-plus";
 import {
@@ -59,18 +62,27 @@ import {
   PlusPageInstance,
   useTable
 } from "plus-pro-components";
-import {
-  addOrEditIpAccount,
-  deleteIpAccount,
-  getIpAccountList,
-  switchIpAccountStatus
-} from "@/api/system/ipAccount";
 import { isString } from "@pureadmin/utils";
 import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
 import { useRouter } from "vue-router";
+import {
+  createChildAccount,
+  getMerchantBgSubList,
+  merchantUserInfoDetail,
+  merchantUserInfoupdateAllocationStatus,
+  merchantUserInfoupdateStatus,
+  updateChildAccount
+} from "@/api/childAccount";
+import { getLocalDict } from "@/api/public";
 
 defineOptions({
-  name: "IpAccountIndex"
+  name: "ChildAccount"
+});
+
+onMounted(() => {
+  getLocalDict().then(res => {
+    console.log(res);
+  });
 });
 
 const router = useRouter();
@@ -78,10 +90,10 @@ const router = useRouter();
 const plusPageInstance = ref<PlusPageInstance | null>(null);
 
 const getList = async (query: Record<string, any>) => {
-  let res = await getIpAccountList(query);
+  let res = await getMerchantBgSubList(query);
   return {
-    data: res.list,
-    total: res.total
+    data: res.data.list,
+    total: res.data.total
   };
 };
 
@@ -123,44 +135,53 @@ const dialogTitle = computed(() => (state.isCreate ? "新增" : "编辑"));
 // 表格数据
 const tableConfig: PlusColumn[] = [
   {
-    label: "账户号",
-    prop: "accNo"
-  },
-  {
-    label: "状态",
-    prop: "status",
-    valueType: "switch",
-    fieldProps: {
-      activeValue: "normal",
-      inactiveValue: "disable"
-    },
-    editable: true,
+    label: "姓名",
+    prop: "contractName",
     hideInSearch: true
   },
   {
-    label: "状态",
-    prop: "status",
-    valueType: "select",
-    options: [
-      { label: "正常", value: "normal" },
-      { label: "停用", value: "disable" }
-    ],
-    hideInTable: true
+    label: "手机号",
+    prop: "contractMobile",
+    hideInSearch: true
   },
   {
     label: "备注",
     prop: "remark",
     hideInSearch: true
   },
+  {
+    label: "创建人",
+    prop: "creater",
+    hideInSearch: true
+  },
   {
     label: "创建时间",
-    prop: "addTime",
-    valueType: "time-picker",
+    prop: "createTime",
     hideInSearch: true
   },
   {
-    label: "创建人",
-    prop: "addUserName",
+    label: "微信号",
+    prop: "wechat",
+    hideInSearch: true
+  },
+  {
+    label: "接单状态",
+    prop: "receiveStatus",
+    valueType: "select",
+    options: [
+      { label: "接单", value: true },
+      { label: "不接单", value: false }
+    ],
+    hideInSearch: true
+  },
+  {
+    label: "当前状态",
+    prop: "status",
+    valueType: "select",
+    options: [
+      { label: "正常", value: "1" },
+      { label: "禁用", value: "0" }
+    ],
     hideInSearch: true
   }
 ];
@@ -188,35 +209,127 @@ const state = reactive<State>({
   isCreate: false,
   form: {},
   rules: {
-    accNo: [{ required: true, message: "请输入账户号", trigger: "blur" }]
+    contractName: [
+      {
+        required: true,
+        message: "请输入姓名",
+        trigger: "blur"
+      }
+    ],
+    contractMobile: [
+      {
+        required: true,
+        message: "请输入手机号",
+        trigger: "blur"
+      },
+      {
+        pattern: /^1[3-9]\d{9}$/,
+        message: "请输入正确的手机号",
+        trigger: "blur"
+      }
+    ],
+    accountName: [
+      {
+        required: true,
+        message: "请输入账号",
+        trigger: "blur"
+      }
+    ],
+    password: [
+      {
+        required: true,
+        message: "请输入密码",
+        trigger: "blur"
+      }
+    ],
+    password1: [
+      {
+        required: true,
+        message: "请输入密码",
+        trigger: "blur"
+      },
+      {
+        validator: (rule, value, callback) => {
+          if (value !== form.value.password) {
+            callback(new Error("密码不一致"));
+          } else {
+            callback();
+          }
+        }
+      }
+    ]
   }
 });
 
 const columns: PlusColumn[] = [
   {
-    label: "账户号",
-    prop: "accNo",
-    valueType: "input",
+    label: "姓名",
+    prop: "contractName",
     fieldProps: {
-      disabled: computed(() => !state.isCreate)
+      clearable: true
     }
   },
   {
-    label: "状态",
-    prop: "status",
-    valueType: "switch",
+    label: "手机号",
+    prop: "contractMobile",
+    fieldProps: {
+      clearable: true
+    }
+  },
+  {
+    label: "微信号",
+    prop: "wechat",
     fieldProps: {
-      activeValue: "normal",
-      inactiveValue: "disable"
+      clearable: true
     }
   },
+  {
+    label: "账号",
+    prop: "accountName",
+    fieldProps: {
+      disabled: computed(() => {
+        return !state.isCreate;
+      })
+    }
+  },
+  {
+    label: "密码",
+    prop: "contractPassword",
+    fieldProps: {
+      type: "password",
+      clearable: true
+    }
+  },
+  {
+    label: "确认密码",
+    prop: "confirmPassword",
+    fieldProps: {
+      type: "password",
+      clearable: true
+    }
+  },
+  {
+    label: "是否愿意客户主动电话联系",
+    prop: "isAllowCusContact",
+    valueType: "radio",
+    options: [
+      {
+        label: "是",
+        value: true
+      },
+      {
+        label: "否",
+        value: false
+      }
+    ]
+  },
   {
     label: "备注",
     prop: "remark",
-    valueType: "input",
     fieldProps: {
       type: "textarea",
-      rows: 3
+      rows: 4,
+      clearable: true
     }
   }
 ];
@@ -236,8 +349,8 @@ const handleSubmit = async (values: FieldValues) => {
   if (state.isCreate) {
     try {
       let params = form.value;
-      let res = await addOrEditIpAccount(params);
-      if (res.code === 200) {
+      let res = await createChildAccount(params);
+      if (res.code === 0) {
         ElMessage.success("新增成功");
         confirmLoading.value = false;
         dialogVisible.value = false;
@@ -252,8 +365,8 @@ const handleSubmit = async (values: FieldValues) => {
     // 编辑
     try {
       let params = form.value;
-      let res = await addOrEditIpAccount(params);
-      if (res.code === 200) {
+      let res = await updateChildAccount(params);
+      if (res.code === 0) {
         ElMessage.success("修改成功");
         confirmLoading.value = false;
         dialogVisible.value = false;
@@ -268,6 +381,7 @@ const handleSubmit = async (values: FieldValues) => {
 };
 
 const handleClose = () => {
+  // 重置表单校验状态
   console.log(dialogForm.value.formInstance);
 };
 
@@ -285,66 +399,64 @@ buttons.value = [
       type: "primary"
     },
     onClick(params) {
-      form.value = params.row;
-      state.isCreate = false;
-      state.dialogVisible = true;
-    },
-    directives: [[perms, "ipAccount:index:edit"]]
+      merchantUserInfoDetail(params.row.id).then(res => {
+        if (res.code === 0) {
+          form.value = res.data;
+          state.isCreate = false;
+          state.dialogVisible = true;
+        }
+      });
+    }
   },
   {
     // 修改
-    text: "管理接口",
-    code: "interface",
-    // props v0.1.16 版本新增函数类型
+    text: "修改状态",
     props: {
-      type: "primary"
+      type: "warning"
     },
-    onClick(val) {
-      console.log("handleClick", val.row.accNo);
-      let params = {
-        accNo: val.row.accNo,
-        accountId: val.row.id
-      };
-      Object.keys(params).forEach(param => {
-        if (!isString(params[param])) {
-          params[param] = params[param].toString();
-        }
-      });
-      // 保存信息到标签页
-      useMultiTagsStoreHook().handleTags("push", {
-        path: `/ipAccount/ipAccountInterface`,
-        name: "IpAccountInterface",
-        query: params,
-        meta: {
-          title: `Token管理`,
-          // 如果使用的是非国际化精简版title可以像下面这么写
-          // title: `No.${index} - 详情信息`,
-          // 最大打开标签数
-          dynamicLevel: 1
-        }
-      });
-      // 路由跳转
-      router.push({ name: "IpAccountInterface", query: params });
+    confirm: {
+      options: {
+        draggable: true,
+        message: "确认修改状态?"
+      }
     },
-    directives: [[perms, "ipAccount:index:interface"]]
+    onConfirm: async params => {
+      try {
+        let res = await merchantUserInfoupdateStatus({
+          id: params.row.id,
+          status: params.row.status === "1" ? "0" : "1"
+        });
+        if (res.code === 0) {
+          ElMessage.success("修改成功");
+          refresh();
+        } else {
+          ElMessage.error(res.msg);
+        }
+      } catch (e) {
+        ElMessage.error("删除失败");
+      }
+    }
   },
   {
-    // 删除
-    text: "删除",
-    code: "delete",
-    // props v0.1.16 版本新增计算属性支持
-    props: computed(() => ({ type: "danger" })),
+    // 修改
+    text: "修改接单状态",
+    props: {
+      type: "warning"
+    },
     confirm: {
       options: {
         draggable: true,
-        message: "确定删除此数据吗?"
+        message: "确认修改接单状态?"
       }
     },
     onConfirm: async params => {
       try {
-        let res = await deleteIpAccount(params.row.id);
-        if (res.code === 200) {
-          ElMessage.success("删除成功");
+        let res = await merchantUserInfoupdateAllocationStatus({
+          ids: [params.row.id],
+          allocationStatus: params.row.receiveStatus === true ? false : true
+        });
+        if (res.code === 0) {
+          ElMessage.success("修改成功");
           refresh();
         } else {
           ElMessage.error(res.msg);
@@ -352,8 +464,7 @@ buttons.value = [
       } catch (e) {
         ElMessage.error("删除失败");
       }
-    },
-    directives: [[perms, "ipAccount:index:remove"]]
+    }
   }
 ];
 

+ 0 - 556
src/views/ipAccount/ipAccountInterface.vue

@@ -1,556 +0,0 @@
-<template>
-  <div>
-    <PlusPage
-      ref="plusPageInstance"
-      :columns="tableConfig"
-      :request="getList"
-      :is-card="true"
-      :search="{
-        labelWidth: 100,
-        showNumber: 3,
-        defaultValues: defaultValues
-      }"
-      :table="{
-        actionBar: { buttons, type: 'link', width: 180 },
-        adaptive: { offsetBottom: 50 },
-        onFormChange: handleTableChange
-      }"
-      :pageInfoMap="{ page: 'pageNum', pageSize: 'pageSize' }"
-    >
-      <template #table-title>
-        <el-row class="button-row">
-          <el-button size="default" type="success" @click="handleCreate">
-            新增
-          </el-button>
-        </el-row>
-      </template>
-    </PlusPage>
-    <!-- 弹窗编辑 -->
-    <PlusDialogForm
-      ref="dialogForm"
-      v-model="form"
-      v-model:visible="dialogVisible"
-      :form="{
-        columns,
-        labelPosition: 'right',
-        labelWidth: 100,
-        rowProps: { gutter: 20 },
-        colProps: { span: 24 },
-        rules
-      }"
-      :dialog="{ title: dialogTitle + '菜单', width: 800, confirmLoading }"
-      @confirm="handleSubmit"
-      @close="handleClose"
-    />
-    <PlusDialog
-      v-model="detailsVisible"
-      :hasFooter="false"
-      title="密钥"
-      width="400"
-    >
-      <PlusDescriptions
-        :column="24"
-        :columns="descriptionsColumns"
-        :data="descriptionsData"
-      />
-    </PlusDialog>
-  </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, onMounted, reactive, ref, toRefs, h } from "vue";
-import type { FormRules } from "element-plus";
-import { ElMessage, ElMessageBox, ElInput, ElButton } from "element-plus";
-import {
-  type FieldValues,
-  type PlusColumn,
-  PlusDescriptions,
-  PlusDialog,
-  PlusDialogForm,
-  PlusPage,
-  PlusPageInstance,
-  useTable
-} from "plus-pro-components";
-import { deleteIpAccount } from "@/api/system/ipAccount";
-import {
-  switchIpAccountInterfaceStatus,
-  addOrEditIpAccountInterfaceRef,
-  generateIpAccountToken,
-  getIpAccountInterfaceList,
-  getIpInterfaceOptionList
-} from "@/api/system/ipInterface";
-import { isString } from "@pureadmin/utils";
-import { useRoute } from "vue-router";
-
-defineOptions({
-  name: "IpAccountIndex"
-});
-
-const route = useRoute();
-
-onMounted(() => {
-  getInterfaceOptions();
-});
-
-const plusPageInstance = ref<PlusPageInstance | null>(null);
-
-const defaultValues = {
-  accountId: isString(route.query.accountId)
-    ? route.query.accountId.toString()
-    : "",
-  accNo: isString(route.query.accNo) ? route.query.accNo.toString() : ""
-};
-
-const getList = async (query: Record<string, any>) => {
-  let res = await getIpAccountInterfaceList(query);
-  return {
-    data: res.list,
-    total: res.total
-  };
-};
-
-// 重新请求列表接口
-const refresh = () => {
-  plusPageInstance.value?.getList();
-};
-
-const handleTableChange = (values: any) => {
-  console.log(values);
-  ElMessageBox.confirm("确定修改此数据吗?", "提示", {
-    confirmButtonText: "确定",
-    cancelButtonText: "取消",
-    type: "warning"
-  })
-    .then(async () => {
-      try {
-        let data = {
-          id: values.row.id,
-          status: values.row.status
-        };
-        let res = await switchIpAccountInterfaceStatus(data);
-        if (res.code === 200) {
-          ElMessage.success("修改成功");
-        } else {
-          ElMessage.error(res.msg);
-        }
-      } catch (e) {
-        ElMessage.error("修改失败");
-      }
-    })
-    .finally(() => {
-      refresh();
-    });
-};
-
-const dialogTitle = computed(() => (state.isCreate ? "新增" : "编辑"));
-
-// 表格数据
-const tableConfig: PlusColumn[] = [
-  {
-    label: "账户号",
-    prop: "accNo",
-    valueType: "input",
-    hideInTable: true
-  },
-  {
-    label: "账户id",
-    prop: "id",
-    hideInSearch: true,
-    hideInTable: true
-  },
-  {
-    label: "接口名称",
-    prop: "interfaceName",
-    hideInSearch: true
-  },
-  {
-    label: "接口厂商",
-    prop: "manufacturer",
-    hideInSearch: true
-  },
-  {
-    label: "状态",
-    prop: "status",
-    valueType: "switch",
-    fieldProps: {
-      activeValue: "normal",
-      inactiveValue: "disable"
-    },
-    editable: true,
-    hideInSearch: true
-  },
-  {
-    label: "状态",
-    prop: "status",
-    valueType: "select",
-    fieldProps: {
-      options: [
-        { label: "正常", value: "normal" },
-        { label: "禁用", value: "disable" }
-      ],
-      clearable: true
-    },
-    hideInTable: true
-  },
-  {
-    label: "备注",
-    prop: "remark",
-    hideInSearch: true
-  },
-  {
-    label: "是否回调",
-    prop: "callback",
-    valueType: "tag",
-    fieldProps: value => ({
-      type: value === true ? "success" : "info"
-    }),
-    formatter: value => (value === true ? "是" : "否"),
-    hideInSearch: true
-  },
-  {
-    label: "创建时间",
-    prop: "addTime",
-    valueType: "time-picker",
-    hideInSearch: true
-  },
-  {
-    label: "创建人",
-    prop: "addUserName",
-    hideInSearch: true
-  }
-];
-
-/*--------------------表单--------------------*/
-
-// 表单实例
-const dialogForm = ref(null);
-
-interface State {
-  dialogVisible: boolean;
-  detailsVisible: boolean;
-  confirmLoading: boolean;
-  selectedIds: number[];
-  isCreate: boolean;
-  form: {};
-  rules: FormRules;
-  descriptionsData: {};
-}
-
-const state = reactive<State>({
-  dialogVisible: false,
-  detailsVisible: false,
-  confirmLoading: false,
-  selectedIds: [],
-  isCreate: false,
-  form: {},
-  rules: {
-    interfaceId: [{ required: true, message: "请选择接口", trigger: "blur" }],
-    token: [{ required: true, message: "请生成token", trigger: "blur" }],
-    secret: [{ required: true, message: "请生成密钥", trigger: "blur" }]
-  },
-  descriptionsData: {}
-});
-
-const interfaceOptions = ref<Array<{ label: string; value: string }>>([]);
-
-const getInterfaceOptions = async () => {
-  let res = await getIpInterfaceOptionList();
-  console.log(res);
-  interfaceOptions.value = res.data;
-};
-
-const columns: PlusColumn[] = [
-  {
-    label: "账户号",
-    prop: "accNo",
-    valueType: "input",
-    fieldProps: {
-      disabled: true
-    },
-    colProps: {
-      span: 12
-    }
-  },
-  {
-    label: "选择接口",
-    prop: "interfaceId",
-    valueType: "select",
-    fieldProps: {
-      activeValue: "normal",
-      inactiveValue: "disable"
-    },
-    options: computed(() => interfaceOptions.value),
-    optionsMap: {
-      label: "name",
-      value: "id"
-    },
-    colProps: {
-      span: 12
-    }
-  },
-  {
-    label: "是否回调",
-    prop: "callback",
-    valueType: "select",
-    fieldProps: {
-      options: [
-        { label: "是", value: true },
-        { label: "否", value: false }
-      ]
-    },
-    colProps: {
-      span: 12
-    }
-  },
-  {
-    label: "回调地址",
-    prop: "callbackUrl",
-    valueType: "input",
-    colProps: {
-      span: 12
-    }
-  },
-  {
-    label: "回调次数",
-    prop: "callbackNum",
-    valueType: "input-number",
-    fieldProps: {
-      min: 0
-    },
-    colProps: {
-      span: 12
-    }
-  },
-  {
-    label: "状态",
-    prop: "status",
-    valueType: "radio",
-    fieldProps: {
-      options: [
-        { label: "正常", value: "normal" },
-        { label: "禁用", value: "disable" }
-      ]
-    },
-    colProps: {
-      span: 12
-    }
-  },
-  {
-    label: "token",
-    prop: "token",
-    renderField: (_, onChange) => {
-      return h(
-        ElInput,
-        {
-          placeholder: "点击生成按钮获取token",
-          disabled: true,
-          // 返回VNode时,需要手动调用 renderField 的onChange 回调把值传给表单
-          onChange
-        },
-        {
-          append: () =>
-            h(
-              ElButton,
-              {
-                onClick: async () => {
-                  try {
-                    let res = await generateIpAccountToken();
-                    console.log(res);
-                    if (res.code === 200) {
-                      ElMessage.success("获取token成功");
-                      form.value = {
-                        ...form.value,
-                        token: res.data.token,
-                        secret: res.data.secret
-                      };
-                    } else {
-                      ElMessage.error(res.msg);
-                    }
-                  } catch (e) {
-                    ElMessage.error("获取token失败");
-                  }
-                }
-              },
-              { default: () => "生成" }
-            )
-        }
-      );
-    },
-    colProps: {
-      span: 12
-    }
-  },
-  {
-    label: "secret",
-    prop: "secret",
-    valueType: "input",
-    fieldProps: {
-      disabled: true,
-      placeholder: "点击生成按钮获取secret",
-      type: "textarea",
-      rows: 3
-    },
-    colProps: {
-      span: 12
-    }
-  },
-  {
-    label: "备注",
-    prop: "remark",
-    valueType: "input",
-    fieldProps: {
-      type: "textarea",
-      rows: 3
-    },
-    colProps: {
-      span: 12
-    }
-  }
-];
-
-const descriptionsColumns: PlusColumn[] = [
-  {
-    label: "token",
-    prop: "token",
-    valueType: "copy",
-    descriptionsItemProps: {
-      span: 24,
-      className: "break-all"
-    }
-  },
-  {
-    label: "secret",
-    prop: "secret",
-    valueType: "copy",
-    descriptionsItemProps: {
-      span: 24,
-      className: "break-all"
-    }
-  }
-];
-
-// 创建
-const handleCreate = (): void => {
-  form.value = {
-    ...defaultValues,
-    status: "normal"
-  };
-  state.isCreate = true;
-  state.dialogVisible = true;
-};
-
-const handleSubmit = async (values: FieldValues) => {
-  console.log(values, "Submit");
-  confirmLoading.value = true;
-  if (state.isCreate) {
-    try {
-      let params = form.value;
-      let res = await addOrEditIpAccountInterfaceRef(params);
-      if (res.code === 200) {
-        ElMessage.success("新增成功");
-        confirmLoading.value = false;
-        dialogVisible.value = false;
-        refresh();
-      } else {
-        ElMessage.error(res.msg);
-      }
-    } finally {
-      confirmLoading.value = false;
-    }
-  } else {
-    // 编辑
-    try {
-      let params = form.value;
-      let res = await addOrEditIpAccountInterfaceRef(params);
-      if (res.code === 200) {
-        ElMessage.success("修改成功");
-        confirmLoading.value = false;
-        dialogVisible.value = false;
-        refresh();
-      } else {
-        ElMessage.error(res.msg);
-      }
-    } finally {
-      confirmLoading.value = false;
-    }
-  }
-};
-
-const handleClose = () => {
-  console.log(dialogForm.value.formInstance);
-};
-
-const { buttons } = useTable();
-
-buttons.value = [
-  {
-    // 修改
-    text: "修改",
-    code: "edit",
-    // props v0.1.16 版本新增函数类型
-    props: {
-      type: "primary"
-    },
-    onClick(params) {
-      console.log(params.row);
-      let paramsRow = params.row;
-      Object.assign(paramsRow, defaultValues);
-      form.value = paramsRow;
-      state.isCreate = false;
-      state.dialogVisible = true;
-    }
-  },
-  {
-    // 修改
-    text: "查看密钥",
-    code: "interface",
-    // props v0.1.16 版本新增函数类型
-    props: {
-      type: "primary"
-    },
-    onClick(val) {
-      console.log(val);
-      detailsVisible.value = true;
-      descriptionsData.value = {
-        token: val.row.token,
-        secret: val.row.secret
-      };
-    }
-  },
-  {
-    // 删除
-    text: "删除",
-    code: "delete",
-    // props v0.1.16 版本新增计算属性支持
-    props: computed(() => ({ type: "danger" })),
-    confirm: {
-      options: {
-        draggable: true,
-        message: "确定删除此数据吗?"
-      }
-    },
-    onConfirm: async params => {
-      try {
-        let res = await deleteIpAccount(params.row.id);
-        if (res.code === 200) {
-          ElMessage.success("删除成功");
-          refresh();
-        } else {
-          ElMessage.error(res.msg);
-        }
-      } catch (e) {
-        ElMessage.error("删除失败");
-      }
-    }
-  }
-];
-
-const {
-  form,
-  confirmLoading,
-  rules,
-  dialogVisible,
-  detailsVisible,
-  descriptionsData
-} = toRefs(state);
-</script>

+ 0 - 432
src/views/ipInterface/index.vue

@@ -1,432 +0,0 @@
-<template>
-  <div>
-    <PlusPage
-      ref="plusPageInstance"
-      :columns="tableConfig"
-      :request="getList"
-      :is-card="true"
-      :search="{
-        labelWidth: 100,
-        showNumber: 3
-      }"
-      :table="{
-        actionBar: { buttons, type: 'link', width: 180 },
-        adaptive: { offsetBottom: 50 },
-        onFormChange: handleTableChange
-      }"
-      :pageInfoMap="{ page: 'pageNum', pageSize: 'pageSize' }"
-    >
-      <template #table-title>
-        <el-row class="button-row">
-          <el-button
-            v-perms="'ipInterface:index:add'"
-            size="default"
-            type="success"
-            @click="handleCreate"
-          >
-            新增
-          </el-button>
-        </el-row>
-      </template>
-    </PlusPage>
-    <!-- 弹窗编辑 -->
-    <PlusDialogForm
-      ref="dialogForm"
-      v-model="form"
-      v-model:visible="dialogVisible"
-      :form="{
-        columns,
-        labelPosition: 'right',
-        labelWidth: 100,
-        rules
-      }"
-      :dialog="{ title: dialogTitle + '菜单', width: 600, confirmLoading }"
-      @confirm="handleSubmit"
-      @close="handleClose"
-    />
-    <PlusDialog
-      v-model="detailsVisible"
-      :hasFooter="false"
-      title="接口配置"
-      width="500"
-    >
-      <PlusDescriptions
-        :column="24"
-        :columns="descriptionsColumns"
-        :data="descriptionsData"
-      />
-    </PlusDialog>
-  </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, reactive, ref, resolveDirective, toRefs } from "vue";
-import type { FormRules } from "element-plus";
-import { ElMessage, ElMessageBox } from "element-plus";
-import {
-  type FieldValues,
-  type PlusColumn,
-  PlusDescriptions,
-  PlusDialog,
-  PlusDialogForm,
-  PlusPage,
-  PlusPageInstance,
-  useTable
-} from "plus-pro-components";
-import {
-  addOrEditIpInterface,
-  deleteIpInterface,
-  getIpInterfaceList,
-  switchIpInterfaceStatus
-} from "@/api/system/ipInterface";
-
-defineOptions({
-  name: "IpInterfaceIndex"
-});
-
-const plusPageInstance = ref<PlusPageInstance | null>(null);
-
-const getList = async (query: Record<string, any>) => {
-  let res = await getIpInterfaceList(query);
-  return {
-    data: res.list,
-    total: res.total
-  };
-};
-
-// 重新请求列表接口
-const refresh = () => {
-  plusPageInstance.value?.getList();
-};
-
-const handleTableChange = (values: any) => {
-  console.log(values);
-  ElMessageBox.confirm("确定修改此数据吗?", "提示", {
-    confirmButtonText: "确定",
-    cancelButtonText: "取消",
-    type: "warning"
-  })
-    .then(async () => {
-      try {
-        let data = {
-          id: values.row.id,
-          status: values.row.status
-        };
-        let res = await switchIpInterfaceStatus(data);
-        if (res.code === 200) {
-          ElMessage.success("修改成功");
-        } else {
-          ElMessage.error(res.msg);
-        }
-      } catch (e) {
-        ElMessage.error("修改失败");
-      }
-    })
-    .finally(() => {
-      refresh();
-    });
-};
-
-const dialogTitle = computed(() => (state.isCreate ? "新增" : "编辑"));
-
-// 表格数据
-const tableConfig: PlusColumn[] = [
-  {
-    label: "接口名称",
-    prop: "interfaceName"
-  },
-  {
-    label: "接口编码",
-    prop: "interfaceNo",
-    hideInSearch: true
-  },
-  {
-    label: "接口厂商",
-    prop: "manufacturer",
-    hideInSearch: true
-  },
-  {
-    label: "状态",
-    prop: "status",
-    valueType: "switch",
-    fieldProps: {
-      activeValue: "normal",
-      inactiveValue: "disable"
-    },
-    editable: true,
-    hideInSearch: true
-  },
-  {
-    label: "状态",
-    prop: "status",
-    valueType: "select",
-    options: [
-      { label: "正常", value: "normal" },
-      { label: "停用", value: "disable" }
-    ],
-    hideInTable: true
-  },
-  {
-    label: "备注",
-    prop: "remark",
-    hideInSearch: true
-  },
-  {
-    label: "创建时间",
-    prop: "addTime",
-    valueType: "time-picker",
-    hideInSearch: true
-  },
-  {
-    label: "创建人",
-    prop: "addUserName",
-    hideInSearch: true
-  }
-];
-
-/*--------------------表单--------------------*/
-
-// 表单实例
-const dialogForm = ref(null);
-
-interface State {
-  dialogVisible: boolean;
-  detailsVisible: boolean;
-  confirmLoading: boolean;
-  selectedIds: number[];
-  isCreate: boolean;
-  form: {};
-  rules: FormRules;
-  descriptionsData: {};
-}
-
-const state = reactive<State>({
-  dialogVisible: false,
-  detailsVisible: false,
-  confirmLoading: false,
-  selectedIds: [],
-  isCreate: false,
-  form: {},
-  rules: {
-    interfaceName: [
-      { required: true, message: "请输入接口名称", trigger: "blur" }
-    ],
-    interfaceNo: [
-      { required: true, message: "请输入接口编码", trigger: "blur" }
-    ],
-    manufacturer: [
-      { required: true, message: "请输入接口厂商", trigger: "blur" }
-    ],
-    interfaceConfig: [
-      { required: true, message: "请输入接口配置", trigger: "blur" }
-    ]
-  },
-  descriptionsData: {}
-});
-
-const columns: PlusColumn[] = [
-  {
-    label: "接口名称",
-    prop: "interfaceName",
-    valueType: "input",
-    fieldProps: {
-      clearable: true
-    }
-  },
-  {
-    label: "接口编码",
-    prop: "interfaceNo",
-    valueType: "input",
-    fieldProps: {
-      clearable: true
-    }
-  },
-  {
-    label: "接口厂商",
-    prop: "manufacturer",
-    valueType: "input",
-    fieldProps: {
-      clearable: true
-    }
-  },
-  {
-    label: "状态",
-    prop: "status",
-    valueType: "radio",
-    fieldProps: {
-      options: [
-        { label: "正常", value: "normal" },
-        { label: "停用", value: "disable" }
-      ]
-    }
-  },
-  {
-    label: "接口配置",
-    prop: "interfaceConfig",
-    valueType: "textarea",
-    fieldProps: {
-      rows: 4
-    }
-  },
-  {
-    label: "备注",
-    prop: "remark",
-    valueType: "textarea",
-    fieldProps: {
-      rows: 4
-    }
-  }
-];
-
-const descriptionsColumns: PlusColumn[] = [
-  {
-    label: "接口配置",
-    prop: "interfaceConfig",
-    valueType: "copy",
-    descriptionsItemProps: {
-      span: 24,
-      className: "break-all"
-    }
-  }
-];
-
-// 创建
-const handleCreate = (): void => {
-  form.value = {
-    status: "normal"
-  };
-  state.isCreate = true;
-  state.dialogVisible = true;
-};
-
-const handleSubmit = async (values: FieldValues) => {
-  console.log(values, "Submit");
-  confirmLoading.value = true;
-  if (state.isCreate) {
-    try {
-      let params = form.value;
-      let res = await addOrEditIpInterface(params);
-      if (res.code === 200) {
-        ElMessage.success("新增成功");
-        confirmLoading.value = false;
-        dialogVisible.value = false;
-      } else {
-        ElMessage.error(res.msg);
-      }
-    } finally {
-      confirmLoading.value = false;
-      refresh();
-    }
-  } else {
-    // 编辑
-    try {
-      let params = form.value;
-      let res = await addOrEditIpInterface(params);
-      if (res.code === 200) {
-        ElMessage.success("修改成功");
-        confirmLoading.value = false;
-        dialogVisible.value = false;
-        refresh();
-      } else {
-        ElMessage.error(res.msg);
-      }
-    } finally {
-      confirmLoading.value = false;
-      refresh();
-    }
-  }
-};
-
-const handleClose = () => {
-  console.log(dialogForm.value.formInstance);
-};
-
-// 参数预期管理
-const normalizeParams = (params: Record<string, any>) => {
-  return {
-    interfaceName: params.interfaceName ?? null,
-    interfaceNo: params.interfaceNo ?? null,
-    manufacturer: params.manufacturer ?? null,
-    status: params.status ?? null,
-    remark: params.remark ?? null,
-    interfaceConfig: params.interfaceConfig ?? null,
-    id: params.id ?? null
-  };
-};
-
-const { buttons } = useTable();
-
-const perms = resolveDirective("perms");
-
-buttons.value = [
-  {
-    // 修改
-    text: "修改",
-    code: "edit",
-    // props v0.1.16 版本新增函数类型
-    props: {
-      type: "primary"
-    },
-    onClick(params) {
-      // form.value = params.row;
-      Object.assign(form.value, normalizeParams(params.row));
-      state.isCreate = false;
-      state.dialogVisible = true;
-    },
-    directives: [[perms, "ipInterface:index:edit"]]
-  },
-  {
-    // 修改
-    text: "查看配置",
-    code: "config",
-    // props v0.1.16 版本新增函数类型
-    props: {
-      type: "primary"
-    },
-    onClick(val) {
-      console.log(val);
-      detailsVisible.value = true;
-      descriptionsData.value = {
-        interfaceConfig: val.row.interfaceConfig
-      };
-    },
-    directives: [[perms, "ipInterface:index:detail"]]
-  },
-  {
-    // 删除
-    text: "删除",
-    code: "delete",
-    // props v0.1.16 版本新增计算属性支持
-    props: computed(() => ({ type: "danger" })),
-    confirm: {
-      options: {
-        draggable: true,
-        message: "确定删除此数据吗?"
-      }
-    },
-    onConfirm: async params => {
-      try {
-        let res = await deleteIpInterface(params.row.id);
-        if (res.code === 200) {
-          ElMessage.success("删除成功");
-          refresh();
-        } else {
-          ElMessage.error(res.msg);
-        }
-      } catch (e) {
-        ElMessage.error("删除失败");
-      }
-    },
-    directives: [[perms, "ipInterface:index:remove"]]
-  }
-];
-
-const {
-  form,
-  confirmLoading,
-  rules,
-  dialogVisible,
-  detailsVisible,
-  descriptionsData
-} = toRefs(state);
-</script>

+ 0 - 150
src/views/ipInterfaceCall/index.vue

@@ -1,150 +0,0 @@
-<template>
-  <div>
-    <PlusPage
-      ref="plusPageInstance"
-      :columns="tableConfig"
-      :request="getList"
-      :is-card="true"
-      :search="{
-        labelWidth: 100,
-        showNumber: 3
-      }"
-      :table="{
-        actionBar: { buttons, type: 'link', width: 180 },
-        adaptive: { offsetBottom: 50 },
-        onFormChange: handleTableChange
-      }"
-      :pageInfoMap="{ page: 'pageNum', pageSize: 'pageSize' }"
-    />
-  </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, ref, resolveDirective } from "vue";
-import {
-  type FieldValues,
-  type PlusColumn,
-  PlusPage,
-  PlusPageInstance,
-  useTable
-} from "plus-pro-components";
-import { isString } from "@pureadmin/utils";
-import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
-import { useRouter } from "vue-router";
-import { getIpInterfaceCallList } from "@/api/system/ipInterfaceCall";
-import {
-  useDict,
-  useDictClass,
-  useDictClassAsync,
-  useDictValue
-} from "@/utils/dict";
-
-defineOptions({
-  name: "IpInterfaceCallIndex"
-});
-
-const router = useRouter();
-
-const plusPageInstance = ref<PlusPageInstance | null>(null);
-
-// const { interface_status } = useDict("interface_status");
-
-const getList = async (query: Record<string, any>) => {
-  let res = await getIpInterfaceCallList(query);
-  return {
-    data: res.list,
-    total: res.total
-  };
-};
-
-const handleTableChange = (values: FieldValues) => {
-  console.log("表格参数变化:", values);
-};
-
-// 表格数据
-const tableConfig: PlusColumn[] = [
-  {
-    label: "调用编号",
-    prop: "id"
-  },
-  {
-    label: "账户编号",
-    prop: "accountNo"
-  },
-  {
-    label: "调用接口",
-    prop: "interfaceName"
-  },
-  {
-    label: "接口厂商",
-    prop: "manufacturer",
-    hideInSearch: true
-  },
-  {
-    label: "调用状态",
-    prop: "status",
-    hideInSearch: true,
-    valueType: "tag",
-    // options: computed(() => interface_status.value),
-    fieldProps: async (value: string) => {
-      return {
-        type: await useDictClassAsync("interface_status", value)
-      };
-    },
-    formatter: value => {
-      return useDictValue("interface_status", value);
-    }
-  },
-  {
-    label: "回调状态",
-    prop: "callbackStatus",
-    hideInSearch: true
-  },
-  {
-    label: "创建时间",
-    prop: "addTime",
-    valueType: "time-picker",
-    hideInSearch: true
-  }
-];
-
-const { buttons } = useTable();
-
-const perms = resolveDirective("perms");
-
-buttons.value = [
-  {
-    // 修改
-    text: "查看日志",
-    code: "interface",
-    // props v0.1.16 版本新增函数类型
-    props: {
-      type: "primary"
-    },
-    onClick(val) {
-      console.log("handleClick", val.row);
-      let params = {
-        id: val.row.id
-      };
-      Object.keys(params).forEach(param => {
-        if (!isString(params[param])) {
-          params[param] = params[param].toString();
-        }
-      });
-      // 保存信息到标签页
-      useMultiTagsStoreHook().handleTags("push", {
-        path: `/ipInterfaceCall/ipInterfaceCallDetail`,
-        name: "IpInterfaceCallDetail",
-        query: params,
-        meta: {
-          title: `接口调用明细`,
-          dynamicLevel: 1
-        }
-      });
-      // 路由跳转
-      router.push({ name: "IpInterfaceCallDetail", query: params });
-    },
-    directives: [[perms, "ipInterfaceCall:index:detail"]]
-  }
-];
-</script>

+ 0 - 185
src/views/ipInterfaceCall/ipInterfaceCallDetail.vue

@@ -1,185 +0,0 @@
-<script setup lang="ts">
-import { useRoute } from "vue-router";
-import { onMounted, computed, ref } from "vue";
-import {
-  getIpInterfaceCallDetailById,
-  getIpInterfaceCallRecord
-} from "@/api/system/ipInterfaceCall";
-import { PlusForm, PlusTable, useTable } from "plus-pro-components";
-import type { PlusColumn, FieldValues } from "plus-pro-components";
-
-defineOptions({
-  name: "IpInterfaceCallDetail"
-});
-const route = useRoute();
-
-console.log(route.query);
-
-onMounted(() => {
-  getDetail();
-});
-
-const getDetail = async () => {
-  let id: any = route.query.id;
-  let res = await getIpInterfaceCallDetailById(id);
-  let res2 = await getIpInterfaceCallRecord(id);
-  console.log(res, res2);
-  Object.assign(form.value, res.data);
-  tableData.value = res2.data;
-};
-
-const columns: PlusColumn[] = [
-  {
-    label: "调用编号",
-    width: 120,
-    prop: "id",
-    valueType: "input",
-    fieldProps: {
-      placeholder: "无",
-      disabled: true
-    },
-    colProps: { span: 8 }
-  },
-  {
-    label: "账户编号",
-    width: 120,
-    prop: "accountNo",
-    valueType: "input",
-    fieldProps: {
-      placeholder: "无",
-      disabled: true
-    },
-    colProps: { span: 8 }
-  },
-  {
-    label: "调用接口",
-    width: 120,
-    prop: "interfaceName",
-    valueType: "input",
-    fieldProps: {
-      placeholder: "无",
-      disabled: true
-    },
-    colProps: { span: 8 }
-  }
-];
-
-const columns1: PlusColumn[] = [
-  {
-    label: "接口参数",
-    prop: "interfaceParam",
-    valueType: "input",
-    fieldProps: {
-      placeholder: "无",
-      type: "textarea",
-      rows: 2,
-      disabled: true
-    },
-    colProps: { span: 12 }
-  },
-  {
-    label: "配置参数",
-    prop: "configParam",
-    valueType: "input",
-    fieldProps: {
-      placeholder: "无",
-      type: "textarea",
-      rows: 2,
-      disabled: true
-    },
-    colProps: { span: 12 }
-  },
-  {
-    label: "请求参数",
-    prop: "requestParam",
-    fieldProps: {
-      placeholder: "无",
-      type: "textarea",
-      rows: 4,
-      disabled: true
-    },
-    colProps: { span: 12 }
-  },
-  {
-    label: "相应结果",
-    prop: "responseParam",
-    fieldProps: {
-      placeholder: "无",
-      type: "textarea",
-      rows: 4,
-      disabled: true
-    },
-    colProps: { span: 12 }
-  }
-];
-
-const columns2: PlusColumn[] = [
-  {
-    label: "回调地址",
-    prop: "callbackUrl"
-  },
-  {
-    label: "请求参数",
-    prop: "requestParam"
-  },
-  {
-    label: "回调时间",
-    prop: "addTime"
-  },
-  {
-    label: "状态",
-    width: 120,
-    prop: "status",
-    valueType: "select",
-    options: [
-      { name: "处理中", value: "handle" },
-      { name: "成功", value: "success" },
-      { name: "失败", value: "fail" }
-    ]
-  },
-  {
-    label: "相应结果",
-    prop: "responseParam"
-  },
-  {
-    label: "响应时间",
-    prop: "updateTime"
-  }
-];
-
-const form = ref<FieldValues>({});
-
-const { tableData } = useTable();
-</script>
-
-<template>
-  <div>
-    <el-card class="w-full h-full">
-      <PlusForm
-        v-model="form"
-        :columns="columns"
-        :hasFooter="false"
-        :row-props="{ gutter: 20 }"
-        :col-props="{ span: 24 }"
-      />
-      <el-card class="mt-2" header="请求记录">
-        <PlusForm
-          v-model="form"
-          :hasFooter="false"
-          :columns="columns1"
-          :row-props="{ gutter: 20 }"
-          :col-props="{ span: 24 }"
-        />
-      </el-card>
-      <el-card class="mt-5" header="回调记录">
-        <PlusTable
-          :columns="columns2"
-          :data="tableData"
-          :table-props="{ height: '400px' }"
-        />
-      </el-card>
-    </el-card>
-  </div>
-</template>
-
-<style scoped lang="scss"></style>

+ 9 - 0
src/views/order/orderLoan/index.vue

@@ -0,0 +1,9 @@
+<script setup lang="ts">
+defineOptions({
+  name: "OrderLoan"
+});
+</script>
+
+<template></template>
+
+<style scoped lang="scss"></style>

+ 9 - 0
src/views/order/orderMy/index.vue

@@ -0,0 +1,9 @@
+<script setup lang="ts">
+defineOptions({
+  name: "OrderMy"
+});
+</script>
+
+<template></template>
+
+<style scoped lang="scss"></style>