Skip to content

Commit

Permalink
增加关联子表弹出编辑功能
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Jul 27, 2023
1 parent 887aff9 commit cec0708
Show file tree
Hide file tree
Showing 76 changed files with 1,150 additions and 971 deletions.
29 changes: 28 additions & 1 deletion docs/dev-guide/xui/xview.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,31 @@ url: "@query:NopAuthDept__findList/value:id,label:deptName,children @TreeChildre
<form id="view" layoutControl="tabs" >...</form>
```

配置layoutComponent=tabs。
配置layoutComponent=tabs。


## 11. 点击行上按钮弹出关联子表的增删改查页面

````xml
<action id="row-edit-rule-nodes" label="@i18n:rule.ruleNodes|规则节点" actionType="drawer">
<dialog page="/nop/rule/pages/NopRuleNode/ref-ruleDefinition.page.yaml" size="xl">
<data>
<ruleId>$ruleId</ruleId>
<ruleDefinition>
<displayName>$displayName</displayName>
</ruleDefinition>
</data>
</dialog>
</action>
````

弹出对话框时通过data段指定在弹出页面中哪些字段的值为固定值。

> ruleId字段转换为使用查看控件显示时,需要使用ruleDefinition.displayName作为显示文本,所以需要传入这个值
在弹出页面文件 ref-ruleDefinition.page.yaml中我们可以引用已有的crud页面,但是通过fixedProps指定哪些字段使用固定值,不允许用户编辑

````yaml
x:gen-extends: |
<web:GenPage view="NopRuleNode.view.xml" page="main" fixedProps="ruleId" xpl:lib="/nop/web/xlib/web.xlib" />
````
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<view x:schema="/nop/schema/xui/xview.xdef" bizObjName="NopAuthDept" xmlns:i18n-en="i18n-en"
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j">
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j" xmlns:gql="gql">

<objMeta>/nop/auth/model/NopAuthDept/NopAuthDept.xmeta</objMeta>

Expand Down Expand Up @@ -87,7 +87,7 @@
<pages>
<crud name="main" grid="tree-list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table loadDataOnce="true" sortable="false" pager="none">
<api url="@query:NopAuthDept__findList/{@listSelection}?filter_parentId=__null"/>
<api url="@query:NopAuthDept__findList?filter_parentId=__null" gql:selection="{@listSelection}"/>
</table>
<listActions>
<action id="batch-delete-button" label="@i18n:common.batchDelete" batch="true">
Expand Down Expand Up @@ -125,17 +125,17 @@
</crud>
<picker name="picker" grid="pick-list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table>
<api url="@query:NopAuthDept__findPage/{@pageSelection}"/>
<api url="@query:NopAuthDept__findPage" gql:selection="{@pageSelection}"/>
</table>
</picker>
<simple name="add" form="add">
<api url="@mutation:NopAuthDept__save/id"/>
</simple>
<simple name="view" form="view">
<initApi url="@query:NopAuthDept__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthDept__get?id=$id" gql:selection="{@formSelection}"/>
</simple>
<simple name="update" form="edit">
<initApi url="@query:NopAuthDept__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthDept__get?id=$id" gql:selection="{@formSelection}"/>
<api url="@mutation:NopAuthDept__update/id?id=$id" withFormData="true"/>
</simple>
<simple name="add-child" form="add">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<view x:schema="/nop/schema/xui/xview.xdef" bizObjName="NopAuthExtLogin" xmlns:i18n-en="i18n-en"
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j">
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j" xmlns:gql="gql">

<objMeta>/nop/auth/model/NopAuthExtLogin/NopAuthExtLogin.xmeta</objMeta>

Expand Down Expand Up @@ -69,7 +69,7 @@
<pages>
<crud name="main" grid="list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table autoFillHeight="true">
<api url="@query:NopAuthExtLogin__findPage/{@pageSelection}"/>
<api url="@query:NopAuthExtLogin__findPage" gql:selection="{@pageSelection}"/>
</table>
<listActions>
<action id="batch-delete-button" label="@i18n:common.batchDelete" batch="true">
Expand Down Expand Up @@ -104,17 +104,17 @@
</crud>
<picker name="picker" grid="pick-list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table>
<api url="@query:NopAuthExtLogin__findPage/{@pageSelection}"/>
<api url="@query:NopAuthExtLogin__findPage" gql:selection="{@pageSelection}"/>
</table>
</picker>
<simple name="add" form="add">
<api url="@mutation:NopAuthExtLogin__save/id"/>
</simple>
<simple name="view" form="view">
<initApi url="@query:NopAuthExtLogin__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthExtLogin__get?id=$id" gql:selection="{@formSelection}"/>
</simple>
<simple name="update" form="edit">
<initApi url="@query:NopAuthExtLogin__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthExtLogin__get?id=$id" gql:selection="{@formSelection}"/>
<api url="@mutation:NopAuthExtLogin__update/id?id=$id" withFormData="true"/>
</simple>
</pages>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<view x:schema="/nop/schema/xui/xview.xdef" bizObjName="NopAuthOpLog" xmlns:i18n-en="i18n-en"
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j">
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j" xmlns:gql="gql">

<objMeta>/nop/auth/model/NopAuthOpLog/NopAuthOpLog.xmeta</objMeta>

Expand Down Expand Up @@ -76,7 +76,7 @@
<pages>
<crud name="main" grid="list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table autoFillHeight="true">
<api url="@query:NopAuthOpLog__findPage/{@pageSelection}"/>
<api url="@query:NopAuthOpLog__findPage" gql:selection="{@pageSelection}"/>
</table>
<listActions>
<action id="batch-delete-button" label="@i18n:common.batchDelete" batch="true">
Expand Down Expand Up @@ -108,11 +108,11 @@
</crud>
<picker name="picker" grid="pick-list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table>
<api url="@query:NopAuthOpLog__findPage/{@pageSelection}"/>
<api url="@query:NopAuthOpLog__findPage" gql:selection="{@pageSelection}"/>
</table>
</picker>
<simple name="view" form="view">
<initApi url="@query:NopAuthOpLog__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthOpLog__get?id=$id" gql:selection="{@formSelection}"/>
</simple>
</pages>
</view>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<view x:schema="/nop/schema/xui/xview.xdef" bizObjName="NopAuthPosition" xmlns:i18n-en="i18n-en"
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j">
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j" xmlns:gql="gql">

<objMeta>/nop/auth/model/NopAuthPosition/NopAuthPosition.xmeta</objMeta>

Expand Down Expand Up @@ -64,7 +64,7 @@
<pages>
<crud name="main" grid="list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table autoFillHeight="true">
<api url="@query:NopAuthPosition__findPage/{@pageSelection}"/>
<api url="@query:NopAuthPosition__findPage" gql:selection="{@pageSelection}"/>
</table>
<listActions>
<action id="batch-delete-button" label="@i18n:common.batchDelete" batch="true">
Expand Down Expand Up @@ -99,17 +99,17 @@
</crud>
<picker name="picker" grid="pick-list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table>
<api url="@query:NopAuthPosition__findPage/{@pageSelection}"/>
<api url="@query:NopAuthPosition__findPage" gql:selection="{@pageSelection}"/>
</table>
</picker>
<simple name="add" form="add">
<api url="@mutation:NopAuthPosition__save/id"/>
</simple>
<simple name="view" form="view">
<initApi url="@query:NopAuthPosition__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthPosition__get?id=$id" gql:selection="{@formSelection}"/>
</simple>
<simple name="update" form="edit">
<initApi url="@query:NopAuthPosition__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthPosition__get?id=$id" gql:selection="{@formSelection}"/>
<api url="@mutation:NopAuthPosition__update/id?id=$id" withFormData="true"/>
</simple>
</pages>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<view x:schema="/nop/schema/xui/xview.xdef" bizObjName="NopAuthResource" xmlns:i18n-en="i18n-en"
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j">
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j" xmlns:gql="gql">

<objMeta>/nop/auth/model/NopAuthResource/NopAuthResource.xmeta</objMeta>

Expand Down Expand Up @@ -137,7 +137,7 @@
<pages>
<crud name="main" grid="tree-list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table loadDataOnce="true" sortable="false" pager="none">
<api url="@query:NopAuthResource__findList/{@listSelection}?filter_parentId=__null"/>
<api url="@query:NopAuthResource__findList?filter_parentId=__null" gql:selection="{@listSelection}"/>
</table>
<listActions>
<action id="batch-delete-button" label="@i18n:common.batchDelete" batch="true">
Expand Down Expand Up @@ -175,17 +175,17 @@
</crud>
<picker name="picker" grid="pick-list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table>
<api url="@query:NopAuthResource__findPage/{@pageSelection}"/>
<api url="@query:NopAuthResource__findPage" gql:selection="{@pageSelection}"/>
</table>
</picker>
<simple name="add" form="add">
<api url="@mutation:NopAuthResource__save/id"/>
</simple>
<simple name="view" form="view">
<initApi url="@query:NopAuthResource__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthResource__get?id=$id" gql:selection="{@formSelection}"/>
</simple>
<simple name="update" form="edit">
<initApi url="@query:NopAuthResource__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthResource__get?id=$id" gql:selection="{@formSelection}"/>
<api url="@mutation:NopAuthResource__update/id?id=$id" withFormData="true"/>
</simple>
<simple name="add-child" form="add">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<view x:schema="/nop/schema/xui/xview.xdef" bizObjName="NopAuthRole" xmlns:i18n-en="i18n-en"
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j">
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j" xmlns:gql="gql">

<objMeta>/nop/auth/model/NopAuthRole/NopAuthRole.xmeta</objMeta>

Expand Down Expand Up @@ -74,7 +74,7 @@
<pages>
<crud name="main" grid="list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table autoFillHeight="true">
<api url="@query:NopAuthRole__findPage/{@pageSelection}"/>
<api url="@query:NopAuthRole__findPage" gql:selection="{@pageSelection}"/>
</table>
<listActions>
<action id="batch-delete-button" label="@i18n:common.batchDelete" batch="true">
Expand Down Expand Up @@ -109,17 +109,17 @@
</crud>
<picker name="picker" grid="pick-list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table>
<api url="@query:NopAuthRole__findPage/{@pageSelection}"/>
<api url="@query:NopAuthRole__findPage" gql:selection="{@pageSelection}"/>
</table>
</picker>
<simple name="add" form="add">
<api url="@mutation:NopAuthRole__save/id"/>
</simple>
<simple name="view" form="view">
<initApi url="@query:NopAuthRole__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthRole__get?id=$id" gql:selection="{@formSelection}"/>
</simple>
<simple name="update" form="edit">
<initApi url="@query:NopAuthRole__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthRole__get?id=$id" gql:selection="{@formSelection}"/>
<api url="@mutation:NopAuthRole__update/id?id=$id" withFormData="true"/>
</simple>
</pages>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<view x:schema="/nop/schema/xui/xview.xdef" bizObjName="NopAuthRoleDataAuth" xmlns:i18n-en="i18n-en"
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j">
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j" xmlns:gql="gql">

<objMeta>/nop/auth/model/NopAuthRoleDataAuth/NopAuthRoleDataAuth.xmeta</objMeta>

Expand Down Expand Up @@ -82,7 +82,7 @@
<pages>
<crud name="main" grid="list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table autoFillHeight="true">
<api url="@query:NopAuthRoleDataAuth__findPage/{@pageSelection}"/>
<api url="@query:NopAuthRoleDataAuth__findPage" gql:selection="{@pageSelection}"/>
</table>
<listActions>
<action id="batch-delete-button" label="@i18n:common.batchDelete" batch="true">
Expand Down Expand Up @@ -117,17 +117,17 @@
</crud>
<picker name="picker" grid="pick-list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table>
<api url="@query:NopAuthRoleDataAuth__findPage/{@pageSelection}"/>
<api url="@query:NopAuthRoleDataAuth__findPage" gql:selection="{@pageSelection}"/>
</table>
</picker>
<simple name="add" form="add">
<api url="@mutation:NopAuthRoleDataAuth__save/id"/>
</simple>
<simple name="view" form="view">
<initApi url="@query:NopAuthRoleDataAuth__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthRoleDataAuth__get?id=$id" gql:selection="{@formSelection}"/>
</simple>
<simple name="update" form="edit">
<initApi url="@query:NopAuthRoleDataAuth__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthRoleDataAuth__get?id=$id" gql:selection="{@formSelection}"/>
<api url="@mutation:NopAuthRoleDataAuth__update/id?id=$id" withFormData="true"/>
</simple>
</pages>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<view x:schema="/nop/schema/xui/xview.xdef" bizObjName="NopAuthSession" xmlns:i18n-en="i18n-en"
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j">
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j" xmlns:gql="gql">

<objMeta>/nop/auth/model/NopAuthSession/NopAuthSession.xmeta</objMeta>

Expand Down Expand Up @@ -76,7 +76,7 @@
<pages>
<crud name="main" grid="list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table autoFillHeight="true">
<api url="@query:NopAuthSession__findPage/{@pageSelection}"/>
<api url="@query:NopAuthSession__findPage" gql:selection="{@pageSelection}"/>
</table>
<listActions>
<action id="batch-delete-button" label="@i18n:common.batchDelete" batch="true">
Expand Down Expand Up @@ -108,11 +108,11 @@
</crud>
<picker name="picker" grid="pick-list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table>
<api url="@query:NopAuthSession__findPage/{@pageSelection}"/>
<api url="@query:NopAuthSession__findPage" gql:selection="{@pageSelection}"/>
</table>
</picker>
<simple name="view" form="view">
<initApi url="@query:NopAuthSession__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthSession__get?id=$id" gql:selection="{@formSelection}"/>
</simple>
</pages>
</view>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<view x:schema="/nop/schema/xui/xview.xdef" bizObjName="NopAuthSite" xmlns:i18n-en="i18n-en"
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j">
xmlns:x="/nop/schema/xdsl.xdef" xmlns:j="j" xmlns:gql="gql">

<objMeta>/nop/auth/model/NopAuthSite/NopAuthSite.xmeta</objMeta>

Expand Down Expand Up @@ -89,7 +89,7 @@
<pages>
<crud name="main" grid="list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table autoFillHeight="true">
<api url="@query:NopAuthSite__findPage/{@pageSelection}"/>
<api url="@query:NopAuthSite__findPage" gql:selection="{@pageSelection}"/>
</table>
<listActions>
<action id="batch-delete-button" label="@i18n:common.batchDelete" batch="true">
Expand Down Expand Up @@ -124,17 +124,17 @@
</crud>
<picker name="picker" grid="pick-list" asideFilterForm="asideFilter" filterForm="query" x:abstract="true">
<table>
<api url="@query:NopAuthSite__findPage/{@pageSelection}"/>
<api url="@query:NopAuthSite__findPage" gql:selection="{@pageSelection}"/>
</table>
</picker>
<simple name="add" form="add">
<api url="@mutation:NopAuthSite__save/id"/>
</simple>
<simple name="view" form="view">
<initApi url="@query:NopAuthSite__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthSite__get?id=$id" gql:selection="{@formSelection}"/>
</simple>
<simple name="update" form="edit">
<initApi url="@query:NopAuthSite__get/{@formSelection}?id=$id"/>
<initApi url="@query:NopAuthSite__get?id=$id" gql:selection="{@formSelection}"/>
<api url="@mutation:NopAuthSite__update/id?id=$id" withFormData="true"/>
</simple>
</pages>
Expand Down
Loading

0 comments on commit cec0708

Please sign in to comment.