提交 0014dcc9 编写于 作者: Mosher's avatar Mosher

update:更新适配TS版本发布器

上级 d008398c
......@@ -2,10 +2,10 @@
{{#if item.condOp}}
"condOp": "{{item.condOp}}",
{{/if}}
"notMode": {{item.notMode}},
"notMode": {{#if item.notMode}}true{{else}}false{{/if}},
"condType": "{{item.condType}}",
"ruleInfo": "{{item.ruleInfo}}",
"keyCond": {{item.keyCond}},
"keyCond": {{#if item.keyCond}}true{{else}}false{{/if}},
{{#eq item.condType 'SIMPLE'}}
"paramType": "{{item.paramType}}",
"paramValue": "{{item.paramValue}}",
......
......@@ -6,7 +6,8 @@ interface IProps {
name: string;
layoutOpts: ILayoutOpts;
visible: boolean;
showCaption?: boolean
showCaption?: boolean;
labelCssName?: string;
}
const props = withDefaults(defineProps<IProps>(), {
showCaption: true
......@@ -17,7 +18,7 @@ const props = withDefaults(defineProps<IProps>(), {
<template>
<AppRow :layoutOpts="layoutOpts" v-show="visible">
<div v-if="showCaption" class="panel-container-header">
<span class="text">{{caption}}</span>
<span :class="['text', labelCssName]">{{caption}}</span>
</div>
<slot></slot>
</AppRow>
......
......@@ -128,8 +128,8 @@ export class ControlBase {
return {
state: this.state,
name: this.state.controlName,
getData: this.getData,
onCtrlEvent: this.onCtrlEvent,
getData: this.getData.bind(this),
onCtrlEvent: this.onCtrlEvent.bind(this),
};
}
}
......@@ -34,9 +34,8 @@ export class ExpBarControl extends MainControl {
*/
protected useExpCtrlInit() {
onMounted(() => {
const xDataControl = this.getXDataCtrl();
if (xDataControl) {
this.next({ tag: xDataControl.name, action: 'load', data: null });
if (this.xDataControl) {
this.next({ tag: this.xDataControl.name, action: 'load', data: null });
}
})
}
......@@ -48,7 +47,6 @@ export class ExpBarControl extends MainControl {
*/
public onCtrlEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
const { selection } = this.state;
switch (action) {
case 'selectionchange':
this.onSelectionChange(data);
......@@ -56,6 +54,34 @@ export class ExpBarControl extends MainControl {
}
}
/**
* 工具栏事件
*
* @param {IActionParam} actionParam
* @return {*}
* @memberof ExpBarControl
*/
public onToolbarEvent(actionParam: IActionParam) {
const { data } = actionParam;
if (!data) {
console.warn("工具栏事件执行参数不足");
return;
}
const { uIAction } = data;
if (!uIAction) {
console.warn("工具栏事件执行参数不足");
return;
}
const inputParam = {
context: this.state.context,
viewParams: this.state.viewParams,
data: this.getData(),
event: data.event,
actionEnvironment: this
}
App.getAppActionService().execute(uIAction, inputParam);
}
/**
* @description 处理选中事件
* @protected
......@@ -112,7 +138,7 @@ export class ExpBarControl extends MainControl {
this.useExpCtrlInit();
return {
...superParams,
onCtrlEvent: this.onCtrlEvent.bind(this)
onToolbarEvent: this.onToolbarEvent.bind(this)
};
}
}
\ No newline at end of file
......@@ -21,7 +21,8 @@ export class MainControl extends ControlBase {
* @type {IParam}
* @memberof MainControl
*/
protected declare xData: IParam;
protected declare xDataControl: IParam;
/**
* 界面行为服务
......@@ -61,21 +62,14 @@ export class MainControl extends ControlBase {
* @return {*}
* @memberof MainControl
*/
private useSetXDataCtrl() {
private useSetXDataControl() {
const xData = ref(null);
this.xData = xData;
onMounted(() => {
this.xDataControl = unref(xData) as any;
})
return xData;
}
/**
* @description 获取数据部件
* @return {*}
* @memberof MainControl
*/
protected getXDataCtrl() {
return unref(this.xData);
}
/**
* @description 安装部件所有功能模块的方法
* @return {*}
......@@ -87,7 +81,7 @@ export class MainControl extends ControlBase {
this.useUIService();
return {
...superParams,
xDataCtrl: this.useSetXDataCtrl()
xDataControl: this.useSetXDataControl()
};
}
}
......@@ -51,11 +51,11 @@ export const ctrlState = {
controlName: '{{ctrl.name}}',
controlService: new EditFormService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
data: new ControlVO({}),
appEntityCodeName: '{{ctrl.appEntity.codeName}}',
appDeCodeName:'{{ctrl.appEntity.codeName}}',
appDeLogicName: '{{ctrl.appEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.appEntity.keyPSAppDEField}}{{ctrl.appEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.appEntity.majorPSAppDEField}}{{ctrl.appEntity.majorPSAppDEField.codeName}}{{/if}}',
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
enableAutoSave: {{ctrl.enableAutoSave}},
// 错误信息
errorMessages: [],
......@@ -132,7 +132,7 @@ export const ctrlState = {
if (isEmpty(value)) {
return Promise.resolve();
}
let source: any = { '{{ruleItem.getPSDEFormItemName}}': value };
let source: any = { '{{ruleItem.psDEFormItemName}}': value };
try {
eval(`{{ruleItem.psSysValueRule.scriptCode}}`);
} catch (error: any) {
......@@ -148,7 +148,7 @@ export const ctrlState = {
if (isEmpty(value)) {
return Promise.resolve();
}
let source: any = { '{{ruleItem.getPSDEFormItemName}}': value };
let source: any = { '{{ruleItem.psDEFormItemName}}': value };
const { isPast, infoMessage } = Verify.verifyDeRules(
'{{ruleItem.getPSDEFormItemName}}',
source,
......
......@@ -32,11 +32,11 @@ export const ctrlState = {
controlName: '{{ctrl.name}}',
totalColumnWidth: {{ctrl.totalColumnWidth}},
selectColumnWidth: {{#if (neq ctrl.aggMode 'NONE')}}100{{else}}50{{/if}},
appEntityCodeName: '{{ctrl.appEntity.codeName}}',
appDeCodeName:'{{ctrl.appEntity.codeName}}',
appDeLogicName: '{{ctrl.appEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.appEntity.keyPSAppDEField}}{{ctrl.appEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.appEntity.majorPSAppDEField}}{{ctrl.appEntity.majorPSAppDEField.codeName}}{{/if}}',
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
controlService: new GridService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
// 新建默认值
createDefaultItems: [
......@@ -217,7 +217,7 @@ export const ctrlState = {
rules:{
{{#each ctrl.psDEGridEditItemVRs as | ruleItem |}}
{{ruleItem.psDEGridEditItemName}}: [
{{#if (eq ruleItem.valueRuleType 'SYSVALUERULE')}}
{{#eq ruleItem.valueRuleType 'SYSVALUERULE'}}
{
{{#eq ruleItem.psSysValueRule.ruleType 'REG'}}
trigger: ['change', 'blur'],
......@@ -238,7 +238,8 @@ export const ctrlState = {
}
{{/eq}}
},
{{else if (eq ruleItem.valueRuleType 'DEFVALUERULE')}}
{{/eq}}
{{#eq ruleItem.valueRuleType 'DEFVALUERULE'}}
{{#each ctrl.psDEGridEditItems as | editItem |}}
{{#eq editItem.codeName ruleItem.psDEGridEditItemName}}
{
......@@ -249,7 +250,7 @@ export const ctrlState = {
const { isPast, infoMessage } = Verify.verifyDeRules(
'{{#if editItem.valueItemName}}{{editItem.valueItemName}}{{else if editItem.dataItemName}}{{editItem.dataItemName}}{{else}}{{ruleItem.psDEGridEditItemName}}{{/if}}',
source,
{{> @macro/front-end/common/derules.hbs item=ruleItem.psDEFValueRule.getPSDEFVRGroupCondition}}
{{> @macro/front-end/common/derules.hbs item=ruleItem.psDEFValueRule.psDEFVRGroupCondition}}
);
if (!isPast) {
return Promise.reject(infoMessage || '{{ruleItem.psDEFValueRule.ruleInfo}}');
......@@ -259,7 +260,7 @@ export const ctrlState = {
}
{{/eq}}
{{/each}}
{{/if}}
{{/eq}}
],
{{/each}}
}
......
......@@ -14,7 +14,7 @@ export const ctrlState = {
{{#eq childCtrl.controlType 'TOOLBAR'}}
toolbar: [
{{#childCtrl.psDEToolbarItems}}
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{#if uIAction.counterId}},counterId: '{{uIAction.counterId}}'{{/if}}{{/if}} },
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if psUIAction}}uIAction:{codeName:'{{psUIAction.codeName}}',fullCodeName:'{{psUIAction.fullCodeName}}',uIActionMode:'{{psUIAction.uIActionMode}}',actionTarget:'{{psUIAction.actionTarget}}',uIActionTag:'{{psUIAction.uIActionTag}}',dataAccessAction:'{{psUIAction.dataAccessAction}}',uIActionType:'{{psUIAction.uIActionType}}'}{{#if psUIAction.counterId}},counterId: '{{psUIAction.counterId}}'{{/if}}{{/if}} },
{{/childCtrl.psDEToolbarItems}}
],
{{/eq}}
......
......@@ -2,12 +2,12 @@
import { Subject } from 'rxjs';
import { IActionParam, IParam, ControlAction, TreeExpBarControl, IContext } from '@core';
import { ctrlState } from './{{spinalCase ctrl.codeName}}-tree-exp-bar-state';
{{#ctrl.ctrls}}
{{#ctrl.psControls}}
{{#eq controlType "TREEVIEW"}}
import { {{codeName}}Tree} from '@widgets/{{spinalCase psAppDataEntity.codeName}}/{{spinalCase codeName}}-tree';
{{/eq}}
{{/ctrl.ctrls}}
{{#each ctrl.appViewRefs as | viewRef |}}
{{/ctrl.psControls}}
{{#each ctrl.psAppViewRefs as | viewRef |}}
{{#if viewRef.refPSAppView}}
{{#if
(or
......@@ -55,7 +55,7 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { name, state, onCtrlEvent, xDataCtrl, search, onToolbarEvent } = new TreeExpBarControl(ctrlState, props, emit).moduleInstall();
const { name, state, onCtrlEvent, xDataControl, search, onToolbarEvent } = new TreeExpBarControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ name, state });
......@@ -68,7 +68,7 @@ defineExpose({ name, state });
<div v-if="state.enableSearch || state.toolbar || state.showTitleBar" class="tree-exp-bar-header">
<div class="title" v-if="state.showTitleBar"><span>\{{ state.title }}</span></div>
{{~#if ctrl.enableSearch}}
<a-input-search class="tree-exp-bar__search" v-model:value="state.searchValue" @search="search" />
<a-input-search class="search" v-model:value="state.searchValue" @search="search" />
{{/if}}
{{#each ctrl.psControls as | childCtrl |}}
{{#eq childCtrl.controlType 'TOOLBAR'}}
......@@ -83,10 +83,10 @@ defineExpose({ name, state });
{{/each}}
</div>
<div class="tree-exp-bar-body">
{{#ctrl.ctrls}}
{{#ctrl.psControls}}
{{#eq controlType "TREEVIEW"}}
<{{codeName}}Tree
ref="xDataCtrl"
ref="xDataControl"
name="{{name}}"
:context="state.context"
:viewParams="state.viewParams"
......@@ -97,11 +97,11 @@ defineExpose({ name, state });
@ctrlEvent="onCtrlEvent"
></{{codeName}}Tree>
{{/eq}}
{{/ctrl.ctrls}}
{{/ctrl.psControls}}
</div>
</template>
<template #right>
{{#each ctrl.appViewRefs as | viewRef |}}
{{#each ctrl.psAppViewRefs as | viewRef |}}
{{#if viewRef.refPSAppView}}
{{#if
(or
......
......@@ -65,7 +65,7 @@ export class ControlVO extends ControlVOBase implements TreeControlVO {
enableQuickSearch: {{treeNode.enableQuickSearch}},
expandFirstOnly: {{treeNode.expandFirstOnly}},
expanded: {{treeNode.expanded}},
hasPSDETreeNodeRSs: {{treeNode.hasPSDETreeNodeRSs}},
hasPSDETreeNodeRSs: {{treeNode.psDETreeNodeRSs}},
{{#if treeNode.leafFlagPSAppDEField}}
leafFlagPSAppDEField: { codeName: '{{treeNode.leafFlagPSAppDEField.codeName}}' },
{{/if}}
......
......@@ -47,7 +47,7 @@ const getCustomText = (scriptCode: any) => {
}
// 安装功能模块,提供状态和能力方法
const { name, state, load, onTreeNodeSelect, onContextMenuClick, onRightClick } = new TreeControl(ctrlState, props, emit).moduleInstall();
const { name, state, load, refresh, onTreeNodeSelect, onContextMenuClick, onRightClick } = new TreeControl(ctrlState, props, emit).moduleInstall();
{{#and ctrl.psAppCounterRef ctrl.psAppCounterRef.psAppCounter}}
// 获取计数器数据
......@@ -60,7 +60,7 @@ const counterData = computed(() => {
})
{{/and}}
// 暴露内部状态及能力
defineExpose({ name, state });
defineExpose({ name, state, load, refresh });
</script>
<template>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册