File tree Expand file tree Collapse file tree 4 files changed +54
-37
lines changed Expand file tree Collapse file tree 4 files changed +54
-37
lines changed Original file line number Diff line number Diff line change 11import { http } from "@/utils/http" ;
22
3- type postArrayResult = {
4- ret : number ;
5- msg : string ;
6- success ?: boolean ;
7- data ?: Array < any > ;
8- } ;
9-
10- type postResult = {
11- ret : number ;
12- msg : string ;
13- success ?: boolean ;
14- data ?: any ;
15- } ;
16-
173type Result = {
184 success : boolean ;
195 data ?: Array < any > ;
@@ -97,22 +83,3 @@ export const getRoleMenu = (data?: object) => {
9783export const getRoleMenuIds = ( data ?: object ) => {
9884 return http . request < Result > ( "post" , "/role-menu-ids" , { data } ) ;
9985} ;
100-
101- /** 获取角色管理列表 */
102- export const getRoleList2 = ( params ?: object ) => {
103- // return http.request<ResultTable>("post", "/role", { data });
104- return http . request < ResultTable > ( "get" , "/api/roles/" , { params } ) ;
105- } ;
106-
107- export const getRoleColumns = ( ) => {
108- // return http.request<ResultTable>("post", "/role", { data });
109- return http . request < postArrayResult > ( "options" , "/api/roles/" , { } ) ;
110- } ;
111-
112- /** 修改角色 */
113- export const updateRole = ( id : number , data ?: object ) => {
114- // return http.request<Result>("get", apiUrl("rbac/menus/"));
115- return http . request < postResult > ( "patch" , `api/roles/${ id } /` , {
116- data
117- } ) ;
118- } ;
Original file line number Diff line number Diff line change 1+ import { http } from "@/utils/http" ;
2+
3+ type ResultTable = {
4+ success : boolean ;
5+ data ?: {
6+ /** 列表数据 */
7+ list : Array < any > ;
8+ /** 总条目数 */
9+ total ?: number ;
10+ /** 每页显示条目个数 */
11+ pageSize ?: number ;
12+ /** 当前页数 */
13+ currentPage ?: number ;
14+ } ;
15+ } ;
16+
17+ type postArrayResult = {
18+ ret : number ;
19+ msg : string ;
20+ success ?: boolean ;
21+ data ?: Array < any > ;
22+ } ;
23+
24+ type postResult = {
25+ ret : number ;
26+ msg : string ;
27+ success ?: boolean ;
28+ data ?: any ;
29+ } ;
30+
31+
32+ /** 获取角色管理列表 */
33+ export const getRoleList = ( params ?: object ) => {
34+ // return http.request<ResultTable>("post", "/role", { data });
35+ return http . request < ResultTable > ( "get" , "/api/roles/" , { params } ) ;
36+ } ;
37+
38+ export const getRoleColumns = ( ) => {
39+ // return http.request<ResultTable>("post", "/role", { data });
40+ return http . request < postArrayResult > ( "options" , "/api/roles/" , { } ) ;
41+ } ;
42+
43+ /** 修改角色 */
44+ export const updateRole = ( id : number , data ?: object ) => {
45+ // return http.request<Result>("get", apiUrl("rbac/menus/"));
46+ return http . request < postResult > ( "patch" , `api/roles/${ id } /` , {
47+ data
48+ } ) ;
49+ } ;
Original file line number Diff line number Diff line change 11import { ref } from "vue" ;
22
3- import { getRoleList2 as getRoleList , updateRole } from "@/api/system " ;
3+ import { getRoleList , updateRole } from "@/api/tableExample " ;
44// import { useUserStoreHook } from "@/store/modules/user";
55import { onStatusChange , usePublicHooks } from "@/utils/common" ;
66import { useTableBase } from "@/utils/tableHook" ;
Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- import { reactive } from " vue" ;
2+ // import { reactive } from "vue";
33import { CusTable } from " @/components/CusTable" ;
44import { CusTableBar } from " @/components/CusTableBar" ;
5- import { PaginationProps } from " @pureadmin/table" ;
5+ // import { PaginationProps } from "@pureadmin/table";
66import { useTable } from " ./hook" ;
7- import { getRoleColumns } from " @/api/system " ;
7+ import { getRoleColumns } from " @/api/tableExample " ;
88
99defineOptions ({
1010 name: " TableCustom"
1111});
1212
13+ // 自定义分页信息
1314// const pagination = reactive<PaginationProps>({
1415// total: 0,
1516// pageSize: 10,
You can’t perform that action at this time.
0 commit comments