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

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

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