From 354d230c2a43d20462507a942827399a714c3f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=BF=E5=B0=8F=E5=A4=A9?= <1638245306@qq.com> Date: Sat, 22 Jun 2024 22:53:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8F=98=E5=8C=96:=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AF=86=E7=A0=81=E5=90=8E=E5=BC=BA=E5=88=B6=E9=80=80?= =?UTF-8?q?=E5=87=BA=E7=99=BB=E5=BD=95=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/dvadmin/__init__.py | 1 + .../system/dept/components/DeptUserCom/api.ts | 14 +++++++------- .../system/dept/components/DeptUserCom/crud.tsx | 15 +++++++++++++-- web/src/views/system/user/api.ts | 2 +- web/src/views/system/user/crud.tsx | 11 +++++++++-- 5 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 backend/dvadmin/__init__.py diff --git a/backend/dvadmin/__init__.py b/backend/dvadmin/__init__.py new file mode 100644 index 0000000..40a96af --- /dev/null +++ b/backend/dvadmin/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/web/src/views/system/dept/components/DeptUserCom/api.ts b/web/src/views/system/dept/components/DeptUserCom/api.ts index 28602c7..b395c39 100644 --- a/web/src/views/system/dept/components/DeptUserCom/api.ts +++ b/web/src/views/system/dept/components/DeptUserCom/api.ts @@ -5,13 +5,13 @@ type GetListType = PageQuery & { show_all: string }; export const apiPrefix = '/api/system/user/'; -export function GetDept(query: PageQuery) { - return request({ - url: '/api/system/dept/dept_lazy_tree/', - method: 'get', - params: query, - }); -} +// export function GetDept(query: PageQuery) { +// return request({ +// url: '/api/system/dept/dept_all/', +// method: 'get', +// params: query, +// }); +// } export function GetList(query: GetListType) { return request({ diff --git a/web/src/views/system/dept/components/DeptUserCom/crud.tsx b/web/src/views/system/dept/components/DeptUserCom/crud.tsx index 8bb2b3c..bcee5b0 100644 --- a/web/src/views/system/dept/components/DeptUserCom/crud.tsx +++ b/web/src/views/system/dept/components/DeptUserCom/crud.tsx @@ -220,7 +220,10 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp label: 'name', }), column: { - minWidth: 150, //最小列宽 + minWidth: 200, //最小列宽 + formatter({value,row,index}){ + return row.dept_name_all + } }, form: { rules: [ @@ -259,7 +262,11 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp label: 'name', }), column: { - minWidth: 100, //最小列宽 + minWidth: 200, //最小列宽 + formatter({value,row,index}){ + const values = row.role_info.map((item:any) => item.name); + return values.join(',') + } }, form: { rules: [ @@ -382,6 +389,10 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp form: { show: false, }, + column:{ + width:150, + showOverflowTooltip: true, + } }, }, }, diff --git a/web/src/views/system/user/api.ts b/web/src/views/system/user/api.ts index 78a15ec..02a2ac6 100644 --- a/web/src/views/system/user/api.ts +++ b/web/src/views/system/user/api.ts @@ -5,7 +5,7 @@ export const apiPrefix = '/api/system/user/'; export function GetDept(query: PageQuery) { return request({ - url: "/api/system/dept/dept_lazy_tree/", + url: "/api/system/dept/all_dept/", method: 'get', params: query, }); diff --git a/web/src/views/system/user/crud.tsx b/web/src/views/system/user/crud.tsx index 7281525..dd24c40 100644 --- a/web/src/views/system/user/crud.tsx +++ b/web/src/views/system/user/crud.tsx @@ -218,7 +218,10 @@ export const createCrudOptions = function ({crudExpose}: CreateCrudOptionsProps) label: 'name' }), column: { - minWidth: 150, //最小列宽 + minWidth: 200, //最小列宽 + formatter({value,row,index}){ + return row.dept_name_all + } }, form: { rules: [ @@ -253,7 +256,11 @@ export const createCrudOptions = function ({crudExpose}: CreateCrudOptionsProps) label: 'name', }), column: { - minWidth: 100, //最小列宽 + minWidth: 200, //最小列宽 + formatter({value,row,index}){ + const values = row.role_info.map((item:any) => item.name); + return values.join(',') + } }, form: { rules: [