Skip to content

Commit

Permalink
修正表单字段在没有对应propMeta时的editMode设置
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Sep 3, 2023
1 parent fb880ca commit 193cbeb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36880,6 +36880,10 @@
"name": "getBeforeExecute",
"parameterTypes": []
},
{
"name": "getDecisionMatrix",
"parameterTypes": []
},
{
"name": "getDecisionMatrxi",
"parameterTypes": []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void setBeforeExecute(String value) {
getModelTextXmlComponent().setChildBodyXml(RULE_TAG_NAME, BEFORE_EXECUTE_NAME, value);
}

public String getDecisionMatrxi() {
public String getDecisionMatrix() {
return getModelTextXmlComponent().getChildBodyXml(DECISION_MATRIX_NAME);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</grids>

<forms>
<form id="template" x:abstract="true">
<form id="template" x:abstract="true" layoutControl="tabs" size="xl" labelWidth="130px">
<cells>
<cell id="ruleInputs">
<selection>
Expand All @@ -24,7 +24,7 @@
</cells>
</form>

<form id="edit" layoutControl="tabs" size="xl" x:prototype="template">
<form id="edit" x:prototype="template">
<layout>
==baseInfo[基本信息]====
__useImportFile importFile
Expand Down Expand Up @@ -54,10 +54,10 @@
<!-- custom=true表示此字段不需要在meta中定义
两个下划线作为前缀表示此字段仅在前端使用,不会提交到后台
-->
<cell id="__useImportFile" custom="true" stdDomain="boolean">
<cell id="__useImportFile" label="导入模型文件" custom="true" stdDomain="boolean">
</cell>

<cell id="importFile" stdDomain="file">
<cell id="importFile" stdDomain="file" editMode="edit">
<visibleOn>${__useImportFile}</visibleOn>
</cell>

Expand All @@ -69,6 +69,11 @@
<visibleOn>${!__useImportFile}</visibleOn>
</cell>

<cell id="extConfig">
<visibleOn>${!__useImportFile}</visibleOn>
</cell>


<cell id="matrixConfig">
<visibleOn>${ruleType == 'MATX'}</visibleOn>
</cell>
Expand Down
6 changes: 3 additions & 3 deletions nop-web/src/main/resources/_vfs/nop/web/xlib/web.xlib
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@
let cellModel = formModel.getCell(formCell.id);
let propMeta = objMeta?.getProp(cellModel?.prop || formCell.id);
let rd = formCell.readonly || cellModel?.readonly
|| (formModel.editMode == 'update' && !propMeta?.updatable)
|| (formModel.editMode == 'add' && !propMeta?.insertable);
|| ((formModel.editMode == 'update' or formModel.editMode == 'edit') && propMeta && !propMeta?.updatable)
|| (formModel.editMode == 'add' && propMeta && !propMeta?.insertable);
// 在编辑关联表时会明确指定字段的值固定,此时自动输出hidden字段
if(!rd and fixedProps?.contains(formCell.id)){
Expand All @@ -362,7 +362,7 @@
let hint = cellModel?.hint
let cell = {
name: (mode?.startsWith('query') and !formCell.id.startsWith('v_')?
name: (mode.startsWith('query') and !formCell.id.startsWith('v_')?
'filter_' + formCell.id + (filterOp ? '__'+filterOp:'')
: formCell.id),
// 不显示label的时候,以label为placeholder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,11 @@ $.checkEquals(true, !x && !!!x);
let x = null;
$.checkEquals('a', x ?? 'a');
$.checkEquals(true, x ?? !x);
````

## 5. 空值取反

````expr
let propMeta = null;
$.checkState(!propMeta?.insertable)
````

0 comments on commit 193cbeb

Please sign in to comment.