From 8f1be39f272f19b53483eaa06255de64553ed1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=BF=E5=B0=8F=E5=A4=A9?= <1638245306@qq.com> Date: Mon, 20 Mar 2023 10:40:48 +0800 Subject: [PATCH] =?UTF-8?q?chore(=E9=83=A8=E9=97=A8=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=F0=9F=9A=B8=20=E9=83=A8=E9=97=A8=E7=AE=A1=E7=90=86=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=B7=BB=E5=8A=A0=E5=AD=90=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/system/dept/crud.tsx | 78 ++++++++++++++++++------------ 1 file changed, 46 insertions(+), 32 deletions(-) diff --git a/web/src/views/system/dept/crud.tsx b/web/src/views/system/dept/crud.tsx index 12a8459..dab8edd 100644 --- a/web/src/views/system/dept/crud.tsx +++ b/web/src/views/system/dept/crud.tsx @@ -49,6 +49,20 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp load: loadContentMethod, treeProps: { children: 'children', hasChildren: 'hasChild' }, }, + rowHandle:{ + fiexd:'right', + width:310, + buttons:{ + addChildren:{ + text: "添加子级", + type:"warning", + click(context){ + const rowId =context.row.id + crudExpose.openAdd({ row: { parent: rowId } }) + } + } + } + }, columns: { _index: { title: '序号', @@ -83,38 +97,38 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp } }, }, - parent: { - column: { - show: false - }, - title: '上级部门', - type: 'dict-tree', - dict: dict({ - url: '/api/system/dept/all_dept/', - value: 'id', - label: 'name', - isTree: true, - getData: async ({ url }: { url: string }) => { - return request({ - url: url, - }).then((ret: any) => { - return ret.data - }) - } - }), - form: { - helper: '默认留空为创建者的部门', - component: { - span: 12, - props: { - props: { - value: "id", - label: "name", - } - } - } - } - }, + // parent: { + // column: { + // show: false + // }, + // title: '上级部门', + // type: 'dict-tree', + // dict: dict({ + // url: '/api/system/dept/all_dept/', + // value: 'id', + // label: 'name', + // isTree: true, + // getData: async ({ url }: { url: string }) => { + // return request({ + // url: url, + // }).then((ret: any) => { + // return ret.data + // }) + // } + // }), + // form: { + // helper: '默认留空为创建者的部门', + // component: { + // span: 12, + // props: { + // props: { + // value: "id", + // label: "name", + // } + // } + // } + // } + // }, name: { title: '部门名称', sortable: true,