提交 6ccbdf3e 编写于 作者: sq3536's avatar sq3536

Merge remote-tracking branch 'origin/master'

...@@ -12,6 +12,8 @@ import net.ibizsys.model.control.IPSControl; ...@@ -12,6 +12,8 @@ import net.ibizsys.model.control.IPSControl;
import net.ibizsys.model.control.IPSControlContainer; import net.ibizsys.model.control.IPSControlContainer;
import net.ibizsys.model.control.dashboard.IPSDBContainerPortletPart; import net.ibizsys.model.control.dashboard.IPSDBContainerPortletPart;
import net.ibizsys.model.control.dashboard.IPSDBPortletPart; import net.ibizsys.model.control.dashboard.IPSDBPortletPart;
import net.ibizsys.model.control.grid.IPSDEGrid;
import net.ibizsys.model.control.grid.IPSDEGridColumn;
import net.ibizsys.model.control.toolbar.IPSDETBUIActionItem; import net.ibizsys.model.control.toolbar.IPSDETBUIActionItem;
import net.ibizsys.model.control.toolbar.IPSDEToolbar; import net.ibizsys.model.control.toolbar.IPSDEToolbar;
import net.ibizsys.model.view.IPSUIAction; import net.ibizsys.model.view.IPSUIAction;
...@@ -217,6 +219,38 @@ public class CtrlModel extends BaseModel{ ...@@ -217,6 +219,38 @@ public class CtrlModel extends BaseModel{
} }
} }
// 表格是否需要空白列
public Boolean isNeedEmptyColumn() {
if (getControl().getControlType() != null && "GRID".equals(getControl().getControlType())) {
Boolean flag = true;
for (IPSDEGridColumn column : ((IPSDEGrid)getControl()).getPSDEGridColumns()) {
// 自适应列
if (
column.getWidthUnit() != null
&& "STAR".equals(column.getWidthUnit())
&& column.getColumnType() != null
&& !"GROUPGRIDCOLUMN".equals(column.getColumnType())
) {
flag = false;
break;
}
}
return flag;
}
return false;
}
// 获取表格列总宽度
public Integer getTotalColumnWidth() {
Integer width = 10;
if (getControl().getControlType() != null && "GRID".equals(getControl().getControlType())) {
for (IPSDEGridColumn column : ((IPSDEGrid)getControl()).getPSDEGridColumns()) {
width += column.getWidth();
}
}
return width;
}
// 忽略发布 // 忽略发布
public Boolean ignore() { public Boolean ignore() {
IPSControl control = getControl(); IPSControl control = getControl();
......
{
{{#if item.condOp}}
"condOp": "{{item.condOp}}",
{{/if}}
"notMode": {{item.notMode}},
"condType": "{{item.condType}}",
"ruleInfo": "{{item.ruleInfo}}",
"keyCond": {{item.keyCond}},
{{#eq item.condType 'SIMPLE'}}
"paramType": "{{item.paramType}}",
"paramValue": "{{item.paramValue}}",
{{/eq}}
{{#if (or (eq item.condType 'VALUERANGE2') (eq item.condType 'STRINGLENGTH'))}}
"includeMinValue": {{item.includeMinValue}},
"minValue": "{{item.minValue}}",
"includeMaxValue": {{item.includeMaxValue}},
"maxValue": "{{item.maxValue}}",
{{/if}}
{{#eq item.condType 'REGEX'}}
"regExCode": {{item.regExCode}},
{{/eq}}
{{#if (and (eq item.condType 'SYSVALUERULE') item.psSysValueRule)}}
{{#with item.psSysValueRule as | sysRule |}}
"sysValueRule": {
"ruleType": "{{sysRule.ruleType}}",
"regExCode": "{{sysRule.regExCode}}",
"ruleInfo": "{{sysRule.ruleInfo}}",
"scriptCode": `{{sysRule.scriptCode}}`
}
{{/with}}
{{/if}}
{{#if item.psDEFVRConditions}}
"conditions": [
{{#each item.psDEFVRConditions as | condition |}}
{{> @macro/front-end/common/derules.hbs item=condition}}
{{#unless @last}},{{/unless}}
{{/each}}
]
{{/if}}
}
<AppAutoComplete <AppAutoComplete
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
:data="state.data" :data="state.data"
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
...@@ -51,7 +55,7 @@ ...@@ -51,7 +55,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppCheckboxList <AppCheckboxList
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
:data="state.data" :data="state.data"
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
...@@ -25,7 +29,7 @@ ...@@ -25,7 +29,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppCheckbox <AppCheckbox
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}} {{/eq}}
...@@ -11,7 +15,7 @@ ...@@ -11,7 +15,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppCode <AppCode
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}} {{/eq}}
...@@ -11,7 +15,7 @@ ...@@ -11,7 +15,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
:context="state.context" :context="state.context"
......
<AppDataPickerView <AppDataPickerView
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
:data="state.data" :data="state.data"
{{#if item.valueItemName}} {{#if item.valueItemName}}
valueItem="{{item.valueItemName}}" valueItem="{{item.valueItemName}}"
...@@ -29,7 +33,7 @@ ...@@ -29,7 +33,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppDataPicker <AppDataPicker
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
:data="state.data" :data="state.data"
{{#if item.valueItemName}} {{#if item.valueItemName}}
valueItem="{{item.valueItemName}}" valueItem="{{item.valueItemName}}"
...@@ -52,7 +56,7 @@ ...@@ -52,7 +56,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppDatePicker <AppDatePicker
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#if item.psEditor.placeHolder}} {{#if item.psEditor.placeHolder}}
placeholder="{{item.psEditor.placeHolder}}" placeholder="{{item.psEditor.placeHolder}}"
{{/if}} {{/if}}
...@@ -50,7 +54,7 @@ ...@@ -50,7 +54,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppDropdownList <AppDropdownList
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#if item.psEditor.psAppCodeList}} {{#if item.psEditor.psAppCodeList}}
codeListTag="{{item.psEditor.psAppCodeList.codeListTag}}" codeListTag="{{item.psEditor.psAppCodeList.codeListTag}}"
codeListType="{{item.psEditor.psAppCodeList.codeListType}}" codeListType="{{item.psEditor.psAppCodeList.codeListType}}"
...@@ -33,7 +37,7 @@ ...@@ -33,7 +37,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
:data="record" :data="record"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
......
<AppInputIp <AppInputIp
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}} {{/eq}}
...@@ -11,7 +15,7 @@ ...@@ -11,7 +15,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppInput <AppInput
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}} {{/eq}}
...@@ -44,7 +48,7 @@ ...@@ -44,7 +48,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppListBox <AppListBox
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
:data="state.data" :data="state.data"
:server="state.controlService" :server="state.controlService"
:deMajorField="state.appDeMajorFieldName" :deMajorField="state.appDeMajorFieldName"
...@@ -41,7 +45,7 @@ ...@@ -41,7 +45,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppRadioGroup <AppRadioGroup
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
:data="state.data" :data="state.data"
{{#if item.psEditor.psAppCodeList}} {{#if item.psEditor.psAppCodeList}}
codeListTag="{{item.psEditor.psAppCodeList.codeListTag}}" codeListTag="{{item.psEditor.psAppCodeList.codeListTag}}"
...@@ -25,7 +29,7 @@ ...@@ -25,7 +29,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppRating <AppRating
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}} {{/eq}}
...@@ -17,7 +21,7 @@ ...@@ -17,7 +21,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppRaw <AppRaw
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
:date="state.data" :date="state.data"
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
...@@ -20,7 +24,7 @@ ...@@ -20,7 +24,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppRichText <AppRichText
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}} {{/eq}}
...@@ -23,7 +27,7 @@ ...@@ -23,7 +27,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
:data="record" :data="record"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
......
<AppSlider <AppSlider
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
:date="state.data" :date="state.data"
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
...@@ -21,7 +25,7 @@ ...@@ -21,7 +25,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppSpan <AppSpan
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}} {{/eq}}
...@@ -33,7 +37,7 @@ ...@@ -33,7 +37,7 @@
:value="state.data.{{item.psEditor.name}}" :value="state.data.{{item.psEditor.name}}"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
{{/eq}} {{/eq}}
:context="state.context" :context="state.context"
:viewParams="state.viewParams"/> :viewParams="state.viewParams"/>
<AppStepper <AppStepper
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}} {{/eq}}
...@@ -23,7 +27,7 @@ ...@@ -23,7 +27,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppSwitch <AppSwitch
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}} {{/eq}}
...@@ -14,7 +18,7 @@ ...@@ -14,7 +18,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
<AppUpload <AppUpload
{{#if (and (eq ctrlType 'grid') dataItemName)}}
name="{{dataItemName}}"
{{else}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/if}}
{{#if item.psEditor.editorParams.method}} {{#if item.psEditor.editorParams.method}}
method="{{item.psEditor.editorParams.method}}" method="{{item.psEditor.editorParams.method}}"
{{/if}} {{/if}}
...@@ -34,7 +38,7 @@ ...@@ -34,7 +38,7 @@
@editorEvent="onEditorEvent" @editorEvent="onEditorEvent"
{{/if}} {{/if}}
{{#eq ctrlType 'grid'}} {{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}" :value="record.{{#if dataItemName}}{{dataItemName}}{{else}}{{item.psEditor.name}}{{/if}}"
@editorEvent="onEditorEvent($event,index)" @editorEvent="onEditorEvent($event,index)"
{{/eq}} {{/eq}}
/> />
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
{{/if}} {{/if}}
{{#if (eq item.widthUnit 'PX')}} {{#if (eq item.widthUnit 'PX')}}
width: {{item.width}}, width: {{item.width}},
{{else}} {{else if (gt item.width 1)}}
minWidth: {{item.width}}, minWidth: {{item.width}},
{{/if}} {{/if}}
resizable: true, resizable: true,
......
{{#*inline "COLUMNTEXT"}} {{#*inline "COLUMNTEXT"}}
{{#if (and item.psAppCodeList (eq item.cLConvertMode 'FRONT'))}} {{#if (and item.psAppCodeList (eq item.cLConvertMode 'FRONT'))}}
<AppCodelist <AppCodelist
name="{{#if item.dataItemName}}{{lowerCase item.dataItemName}}{{else}}{{item.codeName}}{{/if}}"
codeListTag="{{item.psAppCodeList.codeListTag}}" codeListTag="{{item.psAppCodeList.codeListTag}}"
:context="state.context" :context="state.context"
:data="record" :data="record"
...@@ -20,7 +21,7 @@ ...@@ -20,7 +21,7 @@
{{else}} {{else}}
{{#if item.valueFormat}} {{#if item.valueFormat}}
<AppSpan <AppSpan
name="{{lowerCase item.codeName}}" name="{{#if item.dataItemName}}{{lowerCase item.dataItemName}}{{else}}{{item.codeName}}{{/if}}"
:value="text" :value="text"
{{#if item.psAppDEField}} {{#if item.psAppDEField}}
:dataType="{{item.psAppDEField.stdDataType}}" :dataType="{{item.psAppDEField.stdDataType}}"
...@@ -40,19 +41,19 @@ ...@@ -40,19 +41,19 @@
{{/each}} {{/each}}
{{else}} {{else}}
{{#unless (or item.hideDefault item.hiddenDataItem)}} {{#unless (or item.hideDefault item.hiddenDataItem)}}
<div v-if="Object.is(column.dataIndex, '{{#if item.dataItemName}}{{lowerCase item.dataItemName}}{{else}}{{item.codeName}}{{/if}}')" class="table-cell {{#if item.cellPSSysCss}} {{item.cellPSSysCss.cssName}}{{/if}}"> <div v-if="Object.is(column.dataIndex, '{{#if item.dataItemName}}{{lowerCase item.dataItemName}}{{else}}{{item.codeName}}{{/if}}')" class="table-cell{{#if item.cellPSSysCss}} {{item.cellPSSysCss.cssName}}{{/if}}">
{{#if (eq item.columnType 'DEFGRIDCOLUMN')}} {{#if (eq item.columnType 'DEFGRIDCOLUMN')}}
{{#if item.enableRowEdit}} {{#if item.enableRowEdit}}
<div v-if="state.rowEditState" class="editor-cell"> <div v-if="state.rowEditState" class="editor-cell">
<AppFormItem <AppFormItem
name="{{item.codeName}}" name="{{#if item.dataItemName}}{{lowerCase item.dataItemName}}{{else}}{{item.codeName}}{{/if}}"
:error="state.gridEditState.{{item.codeName}}?.[index]?.message" :error="state.gridEditState.{{#if item.dataItemName}}{{lowerCase item.dataItemName}}{{else}}{{item.codeName}}{{/if}}?.[index]?.message"
:rules="state.rules.{{item.codeName}}" :rules="state.rules.{{item.codeName}}"
:showLabel="false" :showLabel="false"
> >
{{#each ctrl.psDEGridEditItems as | editColumn | }} {{#each ctrl.psDEGridEditItems as | editColumn | }}
{{#if (eq editColumn.codeName item.codeName)}} {{#if (eq editColumn.codeName item.codeName)}}
{{> @macro/front-end/editors/include-editor.hbs type=editColumn.psEditor.editorType item=editColumn ctrlType="grid"}} {{> @macro/front-end/editors/include-editor.hbs type=editColumn.psEditor.editorType item=editColumn dataItemName=item.dataItemName ctrlType="grid"}}
{{/if}} {{/if}}
{{/each}} {{/each}}
</AppFormItem> </AppFormItem>
...@@ -80,8 +81,8 @@ ...@@ -80,8 +81,8 @@
{{else if (eq item.columnType 'UAGRIDCOLUMN')}} {{else if (eq item.columnType 'UAGRIDCOLUMN')}}
<AppToolbar <AppToolbar
mode="link" mode="link"
name="{{lowerCase item.codeName}}" name="{{#if item.dataItemName}}{{lowerCase item.dataItemName}}{{else}}{{item.codeName}}{{/if}}"
:actionModel="record.{{lowerCase item.codeName}}" :actionModel="record.{{#if item.dataItemName}}{{lowerCase item.dataItemName}}{{else}}{{item.codeName}}{{/if}}"
@onToolbarEvent="onActionColEvent($event, record)"/> @onToolbarEvent="onActionColEvent($event, record)"/>
{{/if}} {{/if}}
</div> </div>
......
...@@ -58,4 +58,18 @@ export interface GridControlState extends MDControlState { ...@@ -58,4 +58,18 @@ export interface GridControlState extends MDControlState {
*/ */
updateDefaultItems: IParam[]; updateDefaultItems: IParam[];
/**
* @description 表格列总宽度
* @type {number}
* @memberof GridControlState
*/
totalColumnWidth: number;
/**
* @description 选择列宽度(默认50,存在聚合列时为100)
* @type {number}
* @memberof GridControlState
*/
selectColumnWidth: number;
} }
import { DataTypes, dateFormat, deepCopy, GridControlState, IActionParam, IParam, isExistAndNotEmpty, MDControl } from "@core"; import { DataTypes, dateFormat, deepCopy, GridControlState, IActionParam, IParam, isExistAndNotEmpty, MDControl } from "@core";
import { createUUID } from "qx-util"; import { createUUID } from "qx-util";
import schema, { ErrorList, FieldErrorList } from 'async-validator'; import schema, { ErrorList, FieldErrorList } from 'async-validator';
import { Ref } from "vue";
/** /**
* @description 表格部件 * @description 表格部件
* @export * @export
...@@ -30,12 +31,12 @@ export class GridControl extends MDControl { ...@@ -30,12 +31,12 @@ export class GridControl extends MDControl {
* @memberof GridControl * @memberof GridControl
*/ */
public useCustom() { public useCustom() {
const { controlName, selectFirstDefault, rowEditState, rowActiveMode, isSingleSelect } = this.state; const { selectFirstDefault, rowEditState, selectColumnWidth, isSingleSelect, totalColumnWidth } = this.state;
// 滚动条配置 // 滚动条配置
const useScrollOption = computed(() => { const useScrollOption = computed(() => {
return { return {
scrollToFirstRowOnChange: true, scrollToFirstRowOnChange: true,
x: '100%', x: totalColumnWidth || '150%',
y: '100%', y: '100%',
} }
}); });
...@@ -100,6 +101,11 @@ export class GridControl extends MDControl { ...@@ -100,6 +101,11 @@ export class GridControl extends MDControl {
} }
}; };
} }
// 展开行
const useExpandedRowKeys: Ref<Array<string>> = ref([]);
const onExpandedRowsChange = (expandedRows: string[]) => {
useExpandedRowKeys.value = expandedRows;
}
// 表格选择功能配置 // 表格选择功能配置
const useRowSelectionOption = computed(() => { const useRowSelectionOption = computed(() => {
if (selectFirstDefault) { if (selectFirstDefault) {
...@@ -107,10 +113,20 @@ export class GridControl extends MDControl { ...@@ -107,10 +113,20 @@ export class GridControl extends MDControl {
} }
return { return {
type: isSingleSelect ? 'radio' : 'checkbox', type: isSingleSelect ? 'radio' : 'checkbox',
columnWidth: 32, columnWidth: selectColumnWidth,
selectedRowKeys: this.state.selectedRowKeys, selectedRowKeys: this.state.selectedRowKeys,
checkStrictly: this.props.multiple ? false : true, checkStrictly: false,
onChange: (_selectedRowKeys: string[], selectedRows: IParam[]) => { onSelect: (record: IParam, selected: boolean, selectedRows: IParam[], $event: any) => {
if (selected) {
const { appDeKeyFieldName } = this.state;
const selectedRowKey: string = record[appDeKeyFieldName] || record.srfkey;
const index: number = useExpandedRowKeys.value.findIndex((key: string) => Object.is(key, selectedRowKey))
if (Object.is(index,-1) && record.children && record.children.length > 0) {
useExpandedRowKeys.value.push(selectedRowKey);
}
}
},
onChange: (_selectedRowKeys: string[], selectedRows: any[]) => {
this.state.selectedRowKeys = _selectedRowKeys; this.state.selectedRowKeys = _selectedRowKeys;
const selection: IParam[] = []; const selection: IParam[] = [];
selectedRows.forEach((select: IParam) => { selectedRows.forEach((select: IParam) => {
...@@ -142,9 +158,11 @@ export class GridControl extends MDControl { ...@@ -142,9 +158,11 @@ export class GridControl extends MDControl {
useRowKey, useRowKey,
useRowClassName, useRowClassName,
useCustomRow, useCustomRow,
useExpandedRowKeys,
useRowSelectionOption, useRowSelectionOption,
onResizeColumn, onResizeColumn,
onGridChange onGridChange,
onExpandedRowsChange
} }
} }
...@@ -171,7 +189,7 @@ export class GridControl extends MDControl { ...@@ -171,7 +189,7 @@ export class GridControl extends MDControl {
* @param {string} tag * @param {string} tag
* @memberof GridControl * @memberof GridControl
*/ */
public handleGridItemValueChange(rowIndex: number, tag: string, data: any) { private handleGridItemValueChange(rowIndex: number, tag: string, data: any) {
const { items } = toRefs(this.state); const { items } = toRefs(this.state);
if (items.value[rowIndex][tag] !== data) { if (items.value[rowIndex][tag] !== data) {
items.value[rowIndex][tag] = data; items.value[rowIndex][tag] = data;
......
...@@ -65,9 +65,13 @@ export class MDControl extends MainControl { ...@@ -65,9 +65,13 @@ export class MDControl extends MainControl {
let tempViewParams = deepCopy(viewParams ? viewParams : {}); let tempViewParams = deepCopy(viewParams ? viewParams : {});
const { noSort, minorSortDir, minorSortPSDEF } = mdCtrlSort; const { noSort, minorSortDir, minorSortPSDEF } = mdCtrlSort;
let { enablePagingBar, current, pageSize } = mdCtrlPaging; let { enablePagingBar, current, pageSize } = mdCtrlPaging;
if (!noSort && minorSortDir && minorSortPSDEF) { if (!noSort) {
if (arg && arg.sort) {
Object.assign(tempViewParams, { sort: arg.sort });
} else if (minorSortDir && minorSortPSDEF) {
Object.assign(tempViewParams, { sort: `${minorSortPSDEF},${minorSortDir}` }); Object.assign(tempViewParams, { sort: `${minorSortPSDEF},${minorSortDir}` });
} }
}
if (enablePagingBar) { if (enablePagingBar) {
Object.assign(tempViewParams, { page: current - 1, size: pageSize }); Object.assign(tempViewParams, { page: current - 1, size: pageSize });
} }
......
...@@ -3,3 +3,4 @@ export { UIUtil } from './ui-util'; ...@@ -3,3 +3,4 @@ export { UIUtil } from './ui-util';
export { UIActionUtil } from './uiaction-util'; export { UIActionUtil } from './uiaction-util';
export { ViewUtil } from './view-util'; export { ViewUtil } from './view-util';
export { DataTypes } from './data-types'; export { DataTypes } from './data-types';
export { Verify } from './verify';
\ No newline at end of file
...@@ -10,8 +10,8 @@ body{ ...@@ -10,8 +10,8 @@ body{
// 滚动条样式 // 滚动条样式
::-webkit-scrollbar { ::-webkit-scrollbar {
background: transparent; background: transparent;
width: 4px; width: 6px;
height: 4px; height: 6px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
......
...@@ -16,3 +16,13 @@ ...@@ -16,3 +16,13 @@
padding-left: 0; padding-left: 0;
} }
} }
.app-grid {
.header-cell {
display: flex;
}
.not-data {
display: flex;
flex-direction: column;
align-items: center;
}
}
\ No newline at end of file
import { ControlVOBase, IParam, GridService } from '@core'; import { ControlVOBase, IParam, GridService, isEmpty, Verify } from '@core';
import { {{pascalCase ctrl.psAppDataEntity.codeName}}Service } from '@api/{{spinalCase ctrl.psAppDataEntity.codeName}}/{{spinalCase ctrl.psAppDataEntity.codeName}}-service'; import { {{pascalCase ctrl.psAppDataEntity.codeName}}Service } from '@api/{{spinalCase ctrl.psAppDataEntity.codeName}}/{{spinalCase ctrl.psAppDataEntity.codeName}}-service';
export class ControlVO extends ControlVOBase { export class ControlVO extends ControlVOBase {
...@@ -22,6 +22,8 @@ export class ControlVO extends ControlVOBase { ...@@ -22,6 +22,8 @@ export class ControlVO extends ControlVOBase {
export const ctrlState = { export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}', controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}', controlName: '{{ctrl.name}}',
totalColumnWidth: {{ctrl.totalColumnWidth}},
selectColumnWidth: {{#if (neq ctrl.aggMode 'NONE')}}100{{else}}50{{/if}},
appEntityCodeName: '{{ctrl.appEntity.codeName}}', appEntityCodeName: '{{ctrl.appEntity.codeName}}',
appDeCodeName:'{{ctrl.appEntity.codeName}}', appDeCodeName:'{{ctrl.appEntity.codeName}}',
appDeKeyFieldName: '{{#if ctrl.appEntity.keyPSAppDEField}}{{ctrl.appEntity.keyPSAppDEField.codeName}}{{/if}}', appDeKeyFieldName: '{{#if ctrl.appEntity.keyPSAppDEField}}{{ctrl.appEntity.keyPSAppDEField.codeName}}{{/if}}',
...@@ -114,8 +116,27 @@ export const ctrlState = { ...@@ -114,8 +116,27 @@ export const ctrlState = {
}, },
{{/if}} {{/if}}
{{/if}} {{/if}}
{{!-- 适配表格操作列浮动 --}}
{{#each ctrl.psDEGridColumns as | column |}} {{#each ctrl.psDEGridColumns as | column |}}
{{#unless (eq column.columnType 'UAGRIDCOLUMN')}}
{{> @macro/front-end/widgets/grid-detail/include-grid.hbs type="COLUMNMODEL" item=column}} {{> @macro/front-end/widgets/grid-detail/include-grid.hbs type="COLUMNMODEL" item=column}}
{{/unless}}
{{/each}}
{{#if ctrl.needEmptyColumn}}
{
title: "",
columnType: "EMPTYCOLUMN",
dataIndex: "autowidthcolumn",
align: "center",
resizable: true,
ellipsis: true,
aggMode: "NONE",
},
{{/if}}
{{#each ctrl.psDEGridColumns as | column |}}
{{#if (eq column.columnType 'UAGRIDCOLUMN')}}
{{> @macro/front-end/widgets/grid-detail/include-grid.hbs type="COLUMNMODEL" item=column}}
{{/if}}
{{/each}} {{/each}}
], ],
// 是否单选 // 是否单选
...@@ -160,16 +181,39 @@ export const ctrlState = { ...@@ -160,16 +181,39 @@ export const ctrlState = {
{{/if}} {{/if}}
rules:{ rules:{
{{#each ctrl.psDEGridEditItemVRs as | ruleItem |}} {{#each ctrl.psDEGridEditItemVRs as | ruleItem |}}
{{#if (eq ruleItem.valueRuleType 'SYSVALUERULE')}}
{{ruleItem.psDEGridEditItemName}}: [ {{ruleItem.psDEGridEditItemName}}: [
{{#if (eq ruleItem.valueRuleType 'SYSVALUERULE')}}
{ {
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
{{#eq ruleItem.psSysValueRule.ruleType 'REG'}} {{#eq ruleItem.psSysValueRule.ruleType 'REG'}}
pattern: /{{ruleItem.psSysValueRule.regExCode}}/, pattern: /{{ruleItem.psSysValueRule.regExCode}}/,
{{/eq}} {{/eq}}
message:'{{ruleItem.psSysValueRule.ruleInfo}}' message:'{{ruleItem.psSysValueRule.ruleInfo}}'
}], },
{{else if (eq ruleItem.valueRuleType 'DEFVALUERULE')}}
{{#each ctrl.psDEGridEditItems as | editItem |}}
{{#eq editItem.codeName ruleItem.psDEGridEditItemName}}
{
validator: (rule: any, value: any, callback: any, source: any) => {
if (!source || isEmpty(source['{{#if editItem.valueItemName}}{{editItem.valueItemName}}{{else}}{{ruleItem.psDEGridEditItemName}}{{/if}}'])) {
return true;
}
const { isPast, infoMessage } = Verify.verifyDeRules(
'{{#if editItem.valueItemName}}{{editItem.valueItemName}}{{else}}{{ruleItem.psDEGridEditItemName}}{{/if}}',
source,
{{> @macro/front-end/common/derules.hbs item=ruleItem.psDEFValueRule.getPSDEFVRGroupCondition}}
);
if (!isPast) {
callback(new Error(infoMessage || '{{ruleItem.psDEFValueRule.ruleInfo}}'));
}
return true;
},
trigger: ['change', 'blur']
}
{{/eq}}
{{/each}}
{{/if}} {{/if}}
],
{{/each}} {{/each}}
} }
}; };
\ No newline at end of file
...@@ -40,7 +40,7 @@ const emit = defineEmits<CtrlEmit>(); ...@@ -40,7 +40,7 @@ const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力 // 安装功能模块,提供状态和能力
const { name, state, useCustom, onEditorEvent, onToolbarEvent, onActionColEvent, newRow, remove, save, load, refresh, getData } = new GridControl(ctrlState, props, emit).moduleInstall(); const { name, state, useCustom, onEditorEvent, onToolbarEvent, onActionColEvent, newRow, remove, save, load, refresh, getData } = new GridControl(ctrlState, props, emit).moduleInstall();
const { useScrollOption, useRowKey, useRowClassName, useCustomRow, useRowSelectionOption, onResizeColumn, onGridChange } = useCustom; const { useScrollOption, useRowKey, useRowClassName, useCustomRow, useRowSelectionOption, onResizeColumn, onGridChange, useExpandedRowKeys, onExpandedRowsChange } = useCustom;
{{#if ctrl.batchToolBarItems}} {{#if ctrl.batchToolBarItems}}
const renderBatchToolbar = (total: number, range: IParam[]) => { const renderBatchToolbar = (total: number, range: IParam[]) => {
return ( return (
...@@ -73,6 +73,7 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData }); ...@@ -73,6 +73,7 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData });
:sortDirections="['ascend', 'descend']" :sortDirections="['ascend', 'descend']"
:data-source="state.items" :data-source="state.items"
:row-selection="useRowSelectionOption" :row-selection="useRowSelectionOption"
:expandedRowKeys="useExpandedRowKeys"
:columns="state.columnsModel" :columns="state.columnsModel"
{{#if ctrl.batchToolBarItems}} {{#if ctrl.batchToolBarItems}}
:pagination="Object.assign(state.mdCtrlPaging.pagination, { :pagination="Object.assign(state.mdCtrlPaging.pagination, {
...@@ -86,6 +87,7 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData }); ...@@ -86,6 +87,7 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData });
:customRow="useCustomRow" :customRow="useCustomRow"
:rowClassName="useRowClassName" :rowClassName="useRowClassName"
@change="onGridChange" @change="onGridChange"
@expandedRowsChange="onExpandedRowsChange"
@resizeColumn="onResizeColumn" @resizeColumn="onResizeColumn"
> >
<template #emptyText> <template #emptyText>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册