Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
0e167c54
提交
0e167c54
编写于
3月 18, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新多项选择视图逻辑
上级
85348837
变更
12
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
51 行增加
和
83 行删除
+51
-83
mpickup-view.ts
...pps}}/src/core/modules/views/mpickup-view/mpickup-view.ts
+9
-5
control-base.ts
...s}}/src/core/modules/widgets/control-base/control-base.ts
+0
-10
grid-control.ts
...s}}/src/core/modules/widgets/grid-control/grid-control.ts
+6
-23
md-control-state.ts
...}/src/core/modules/widgets/md-control/md-control-state.ts
+0
-7
md-control.ts
...{apps}}/src/core/modules/widgets/md-control/md-control.ts
+20
-22
pickup-view-panel-control.ts
...ts/pickup-view-panel-control/pickup-view-panel-control.ts
+0
-10
{{pages@DEMPICKUPVIEW}}-state.ts.hbs
...ages@DEMPICKUPVIEW}}/{{pages@DEMPICKUPVIEW}}-state.ts.hbs
+4
-0
{{pages@DEMPICKUPVIEW}}.vue.hbs
...}/{{pages@DEMPICKUPVIEW}}/{{pages@DEMPICKUPVIEW}}.vue.hbs
+5
-2
{{pages@DEPICKUPGRIDVIEW}}.vue.hbs
...ges@DEPICKUPGRIDVIEW}}/{{pages@DEPICKUPGRIDVIEW}}.vue.hbs
+2
-1
{{pages@DEPICKUPTREEVIEW}}.vue.hbs
...ges@DEPICKUPTREEVIEW}}/{{pages@DEPICKUPTREEVIEW}}.vue.hbs
+2
-1
{{ctrls@GRID}}-grid.vue.hbs
...ntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
+1
-0
{{ctrls@PICKUPVIEWPANEL}}-pickup-view-panel.vue.hbs
...panel/{{ctrls@PICKUPVIEWPANEL}}-pickup-view-panel.vue.hbs
+2
-2
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/mpickup-view/mpickup-view.ts
浏览文件 @
0e167c54
...
@@ -24,11 +24,9 @@ export class MPickupView extends PickupView {
...
@@ -24,11 +24,9 @@ export class MPickupView extends PickupView {
*/
*/
public
declare
props
:
MPickupViewProps
;
public
declare
props
:
MPickupViewProps
;
public
select
:
IParam
=
{};
public
onMoveRight
()
{
public
onMoveRight
()
{
const
{
selections
,
selectedData
}
=
toRefs
(
this
.
state
);
const
{
selections
,
selectedData
}
=
toRefs
(
this
.
state
);
selections
.
value
.
push
(
selectedData
.
value
)
;
selections
.
value
=
selectedData
.
value
;
}
}
public
onMoveLeft
()
{
public
onMoveLeft
()
{
...
@@ -44,8 +42,13 @@ export class MPickupView extends PickupView {
...
@@ -44,8 +42,13 @@ export class MPickupView extends PickupView {
}
}
public
onAllMoveLeft
()
{
public
onAllMoveLeft
()
{
const
{
selections
}
=
toRefs
(
this
.
state
);
const
{
selections
,
selectedData
}
=
toRefs
(
this
.
state
);
selections
.
value
.
splice
(
0
,
selections
.
value
.
length
);
selections
.
value
=
[];
selectedData
.
value
=
[];
}
protected
onRightPanelClick
(
item
:
IParam
,
event
:
MouseEvent
)
{
console
.
log
(
"选中右侧面板数据"
,
item
,
event
);
}
}
/**
/**
...
@@ -61,6 +64,7 @@ export class MPickupView extends PickupView {
...
@@ -61,6 +64,7 @@ export class MPickupView extends PickupView {
onMoveLeft
:
this
.
onMoveLeft
.
bind
(
this
),
onMoveLeft
:
this
.
onMoveLeft
.
bind
(
this
),
onAllMoveRight
:
this
.
onAllMoveRight
.
bind
(
this
),
onAllMoveRight
:
this
.
onAllMoveRight
.
bind
(
this
),
onAllMoveLeft
:
this
.
onAllMoveLeft
.
bind
(
this
),
onAllMoveLeft
:
this
.
onAllMoveLeft
.
bind
(
this
),
onRightPanelClick
:
this
.
onRightPanelClick
.
bind
(
this
)
};
};
}
}
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/control-base/control-base.ts
浏览文件 @
0e167c54
...
@@ -87,14 +87,6 @@ export class ControlBase {
...
@@ -87,14 +87,6 @@ export class ControlBase {
});
});
}
}
/**
* 使用部件初始化模块
*
* @protected
* @memberof ControlBase
*/
protected
useCtrlInit
():
void
{};
/**
/**
* 获取当前激活数据
* 获取当前激活数据
*
*
...
@@ -133,8 +125,6 @@ export class ControlBase {
...
@@ -133,8 +125,6 @@ export class ControlBase {
this
.
useControlContextParams
();
this
.
useControlContextParams
();
// 使用计数器服务
// 使用计数器服务
this
.
useCounterService
();
this
.
useCounterService
();
// 使用部件初始化模块
this
.
useCtrlInit
();
return
{
return
{
state
:
this
.
state
,
state
:
this
.
state
,
name
:
this
.
state
.
controlName
,
name
:
this
.
state
.
controlName
,
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control.ts
浏览文件 @
0e167c54
...
@@ -358,24 +358,8 @@ export class GridControl extends MDControl {
...
@@ -358,24 +358,8 @@ export class GridControl extends MDControl {
* @memberof GridControl
* @memberof GridControl
*/
*/
public
handleDefaultSelect
()
{
public
handleDefaultSelect
()
{
const
{
selectedData
,
selectFirstDefault
,
items
}
=
this
.
state
;
const
{
selectFirstDefault
,
items
}
=
this
.
state
;
const
{
selectedRowKeys
,
selections
}
=
toRefs
(
this
.
state
);
if
(
selectFirstDefault
&&
items
&&
items
.
length
)
{
if
(
selectedData
?.
length
>
0
)
{
const
_selectedRowKeys
:
string
[]
=
[];
const
_selections
:
IParam
[]
=
[];
selectedData
.
forEach
((
selected
:
IParam
)
=>
{
if
(
selected
.
srfkey
)
{
_selectedRowKeys
.
push
(
selected
.
srfkey
);
const
item
=
items
.
find
((
item
:
IParam
)
=>
item
.
srfkey
===
selected
.
srfkey
);
if
(
item
)
{
_selections
.
push
(
item
);
}
}
});
selectedRowKeys
.
value
=
[...
_selectedRowKeys
];
selections
.
value
=
[...
_selections
];
}
else
if
(
selectFirstDefault
)
{
if
(
items
&&
items
.
length
>
0
)
{
this
.
emit
(
"ctrlEvent"
,
{
this
.
emit
(
"ctrlEvent"
,
{
tag
:
this
.
props
.
name
,
tag
:
this
.
props
.
name
,
action
:
"selectionChange"
,
action
:
"selectionChange"
,
...
@@ -383,7 +367,6 @@ export class GridControl extends MDControl {
...
@@ -383,7 +367,6 @@ export class GridControl extends MDControl {
});
});
}
}
}
}
}
/**
/**
* @description 处理数据聚合
* @description 处理数据聚合
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/md-control/md-control-state.ts
浏览文件 @
0e167c54
...
@@ -71,13 +71,6 @@ export interface MDControlState extends MainControlState {
...
@@ -71,13 +71,6 @@ export interface MDControlState extends MainControlState {
*/
*/
rowActiveMode
:
0
|
1
|
2
;
rowActiveMode
:
0
|
1
|
2
;
/**
* @description 选中数据(选择视图传递)
* @type {IParam[]}
* @memberof MDControlState
*/
selectedData
:
IParam
[];
/**
/**
* @description 选中数据
* @description 选中数据
* @type {IParam[]}
* @type {IParam[]}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/md-control/md-control.ts
浏览文件 @
0e167c54
...
@@ -26,11 +26,9 @@ export class MDControl extends MainControl {
...
@@ -26,11 +26,9 @@ export class MDControl extends MainControl {
this
.
state
.
rowEditState
=
toRef
(
this
.
props
,
'rowEditState'
)
as
any
;
this
.
state
.
rowEditState
=
toRef
(
this
.
props
,
'rowEditState'
)
as
any
;
this
.
state
.
rowActiveMode
=
toRef
(
this
.
props
,
'rowActiveMode'
)
as
any
;
this
.
state
.
rowActiveMode
=
toRef
(
this
.
props
,
'rowActiveMode'
)
as
any
;
this
.
state
.
selectFirstDefault
=
toRef
(
this
.
props
,
'selectFirstDefault'
)
as
any
;
this
.
state
.
selectFirstDefault
=
toRef
(
this
.
props
,
'selectFirstDefault'
)
as
any
;
}
watch
(()
=>
this
.
props
.
selectedData
,
(
newVal
:
IParam
[],
oldVal
:
any
)
=>
{
this
.
handleSelectedData
(
newVal
,
oldVal
);
protected
useCtrlInit
()
{
});
super
.
useCtrlInit
();
this
.
handleSelectedData
();
}
}
/**
/**
...
@@ -39,22 +37,22 @@ export class MDControl extends MainControl {
...
@@ -39,22 +37,22 @@ export class MDControl extends MainControl {
* @private
* @private
* @memberof MDControl
* @memberof MDControl
*/
*/
protected
handleSelectedData
()
{
protected
handleSelectedData
(
newVal
:
IParam
[],
oldVal
:
any
)
{
const
{
viewParams
}
=
this
.
state
;
const
{
selections
,
selectedRowKeys
,
items
}
=
toRefs
(
this
.
state
);
// 存在该字段则表示在选择视图中
selections
.
value
=
[];
if
(
viewParams
&&
viewParams
.
selectedData
)
{
const
_selectedRowKeys
:
string
[]
=
[];
const
data
=
viewParams
.
selectedData
[
0
];
const
_selections
:
IParam
[]
=
[];
const
keys
=
data
?.
srfkey
?.
split
(
','
)
||
[];
newVal
.
forEach
((
selected
:
IParam
)
=>
{
this
.
state
.
selectedData
=
[];
if
(
selected
.
srfkey
)
{
if
(
keys
.
length
)
{
_selectedRowKeys
.
push
(
selected
.
srfkey
);
keys
.
forEach
((
key
:
string
)
=>
{
const
item
=
items
.
value
.
find
((
item
:
IParam
)
=>
item
.
srfkey
===
selected
.
srfkey
);
this
.
state
.
selectedData
.
push
({
srfkey
:
key
});
if
(
item
)
{
});
_selections
.
push
(
item
);
}
else
{
// 无值时给一个空对象,确保清空选中数据
this
.
state
.
selectedData
.
push
({});
}
}
}
}
});
selectedRowKeys
.
value
=
[...
_selectedRowKeys
];
selections
.
value
=
[...
_selections
];
}
}
/**
/**
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/pickup-view-panel-control/pickup-view-panel-control.ts
浏览文件 @
0e167c54
...
@@ -18,16 +18,6 @@ export class PickupViewPanelControl extends MainControl {
...
@@ -18,16 +18,6 @@ export class PickupViewPanelControl extends MainControl {
*/
*/
public
declare
state
:
PickupViewPanelControlState
;
public
declare
state
:
PickupViewPanelControlState
;
/**
* 设置部件状态
*
* @memberof PickupViewPanelControl
*/
public
setState
():
void
{
super
.
setState
();
this
.
state
.
selectedData
=
toRef
(
this
.
props
,
'selectedData'
)
as
any
;
}
/**
/**
* @description
* @description
* @param {PickupViewPanelControlProps} props
* @param {PickupViewPanelControlProps} props
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEMPICKUPVIEW}}/{{pages@DEMPICKUPVIEW}}-state.ts.hbs
浏览文件 @
0e167c54
export const viewState = {
export const viewState = {
// 实际选中数据
selections: [],
// 右侧面板选中数据
rightPanelSelections: [],
{{>
@macro
/
front-end
/
views
/
view-base-config
.
hbs
}}
{{>
@macro
/
front-end
/
views
/
view-base-config
.
hbs
}}
};
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEMPICKUPVIEW}}/{{pages@DEMPICKUPVIEW}}.vue.hbs
浏览文件 @
0e167c54
...
@@ -30,7 +30,7 @@ const emit = defineEmits<ViewEmit>();
...
@@ -30,7 +30,7 @@ const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
// 安装功能模块,提供状态和能力方法
const
mpickupView
=
new
MPickupView
(
viewState
,
props
,
emit
).
moduleInstall
();
const
mpickupView
=
new
MPickupView
(
viewState
,
props
,
emit
).
moduleInstall
();
const
{
state
,
onCancel
,
onConfirm
,
onCtrlEvent
,
onMoveRight
,
onMoveLeft
,
onAllMoveRight
,
onAllMoveLeft
}
=
mpickupView
;
const
{
state
,
onCancel
,
onConfirm
,
onCtrlEvent
,
onMoveRight
,
onMoveLeft
,
onAllMoveRight
,
onAllMoveLeft
,
onRightPanelClick
}
=
mpickupView
;
</script>
</script>
<template>
<template>
...
@@ -63,6 +63,7 @@ const { state, onCancel, onConfirm, onCtrlEvent, onMoveRight, onMoveLeft, onAllM
...
@@ -63,6 +63,7 @@ const { state, onCancel, onConfirm, onCtrlEvent, onMoveRight, onMoveLeft, onAllM
:controlAction=
"state.
{{
name
}}
.action"
:controlAction=
"state.
{{
name
}}
.action"
:viewSubject=
"state.viewSubject"
:viewSubject=
"state.viewSubject"
:multiple=
"true"
:multiple=
"true"
:selectedData=
"state.selections"
:parent=
"mpickupView"
:parent=
"mpickupView"
@
onCtrlEvent=
"onCtrlEvent"
@
onCtrlEvent=
"onCtrlEvent"
></
{{
codeName
}}
PickupViewPanel>
></
{{
codeName
}}
PickupViewPanel>
...
@@ -78,7 +79,9 @@ const { state, onCancel, onConfirm, onCtrlEvent, onMoveRight, onMoveLeft, onAllM
...
@@ -78,7 +79,9 @@ const { state, onCancel, onConfirm, onCtrlEvent, onMoveRight, onMoveLeft, onAllM
</a-space>
</a-space>
</a-col>
</a-col>
<a-col
:span=
"5"
class=
"split__right"
>
<a-col
:span=
"5"
class=
"split__right"
>
<div
v-for=
"(item,index) in state.selections"
:key=
"index"
>
\{{item.srfmajortext}}
</div>
<div
v-for=
"(item, index) in state.selections"
:key=
"index"
class=
"selection-item"
@
click=
"(event) => onRightPanelClick(item, event)"
>
<span
class=
"text"
>
\{{item.srfmajortext}}
</span>
</div>
</a-col>
</a-col>
</a-row>
</a-row>
<template
v-slot:footer
>
<template
v-slot:footer
>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEPICKUPGRIDVIEW}}/{{pages@DEPICKUPGRIDVIEW}}.vue.hbs
浏览文件 @
0e167c54
...
@@ -22,7 +22,7 @@ interface Props {
...
@@ -22,7 +22,7 @@ interface Props {
viewParams
?:
IParam
;
viewParams
?:
IParam
;
openType
?:
"ROUTE"
|
"MODAL"
|
"EMBED"
;
openType
?:
"ROUTE"
|
"MODAL"
|
"EMBED"
;
viewSubject
?:
Subject
<
IActionParam
>
;
viewSubject
?:
Subject
<
IActionParam
>
;
selectedData
?:
string
;
selectedData
?:
IParam
[]
;
multiple
?:
boolean
;
multiple
?:
boolean
;
}
}
...
@@ -113,6 +113,7 @@ const { state, grid, onCtrlEvent, onQuickGroupEvent, onQuickSearchEvent } = pick
...
@@ -113,6 +113,7 @@ const { state, grid, onCtrlEvent, onQuickGroupEvent, onQuickSearchEvent } = pick
:showBusyIndicator=
"true"
:showBusyIndicator=
"true"
:viewParams=
"state.viewParams"
:viewParams=
"state.viewParams"
:controlAction=
"state.
{{
name
}}
.action"
:controlAction=
"state.
{{
name
}}
.action"
:selectedData=
"selectedData"
:viewSubject=
"state.viewSubject"
:viewSubject=
"state.viewSubject"
:parent=
"pickupGridView"
:parent=
"pickupGridView"
@
ctrlEvent=
"onCtrlEvent"
@
ctrlEvent=
"onCtrlEvent"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEPICKUPTREEVIEW}}/{{pages@DEPICKUPTREEVIEW}}.vue.hbs
浏览文件 @
0e167c54
...
@@ -22,7 +22,7 @@ interface Props {
...
@@ -22,7 +22,7 @@ interface Props {
viewParams
?:
IParam
;
viewParams
?:
IParam
;
openType
?:
"ROUTE"
|
"MODAL"
|
"EMBED"
;
openType
?:
"ROUTE"
|
"MODAL"
|
"EMBED"
;
viewSubject
?:
Subject
<
IActionParam
>
;
viewSubject
?:
Subject
<
IActionParam
>
;
selectedData
?:
string
;
selectedData
?:
IParam
[]
;
}
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
...
@@ -111,6 +111,7 @@ const { state, tree, onCtrlEvent, onQuickGroupEvent, onQuickSearchEvent } = pick
...
@@ -111,6 +111,7 @@ const { state, tree, onCtrlEvent, onQuickGroupEvent, onQuickSearchEvent } = pick
:controlAction=
"state.
{{
name
}}
.action"
:controlAction=
"state.
{{
name
}}
.action"
:viewSubject=
"state.viewSubject"
:viewSubject=
"state.viewSubject"
:parent=
"pickupTreeView"
:parent=
"pickupTreeView"
:selectedData=
"selectedData"
@
ctrlEvent=
"onCtrlEvent"
@
ctrlEvent=
"onCtrlEvent"
></
{{
codeName
}}
Tree>
></
{{
codeName
}}
Tree>
{{/
eq
}}
{{/
eq
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
浏览文件 @
0e167c54
...
@@ -14,6 +14,7 @@ interface Props {
...
@@ -14,6 +14,7 @@ interface Props {
multiple
?:
boolean
;
multiple
?:
boolean
;
rowEditState
?:
boolean
;
rowEditState
?:
boolean
;
rowActiveMode
?:
0
|
1
|
2
;
rowActiveMode
?:
0
|
1
|
2
;
selectedData
:
IParam
[];
selectFirstDefault
?:
boolean
;
selectFirstDefault
?:
boolean
;
controlAction
:
ControlAction
;
controlAction
:
ControlAction
;
showBusyIndicator
?:
boolean
;
showBusyIndicator
?:
boolean
;
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@PICKUPVIEWPANEL}}-pickup-view-panel/{{ctrls@PICKUPVIEWPANEL}}-pickup-view-panel.vue.hbs
浏览文件 @
0e167c54
...
@@ -14,7 +14,7 @@ interface Props {
...
@@ -14,7 +14,7 @@ interface Props {
showBusyIndicator
?:
boolean
;
showBusyIndicator
?:
boolean
;
isSingleSelect
?:
boolean
;
isSingleSelect
?:
boolean
;
viewMode
?:
number
;
viewMode
?:
number
;
selectedData
?:
string
;
selectedData
?:
IParam
[]
;
isShowButton
?:
boolean
;
isShowButton
?:
boolean
;
viewSubject
:
Subject
<
IActionParam
>
;
viewSubject
:
Subject
<
IActionParam
>
;
multiple
?:
boolean
;
multiple
?:
boolean
;
...
@@ -51,7 +51,7 @@ defineExpose({ name, state});
...
@@ -51,7 +51,7 @@ defineExpose({ name, state});
:context
="
state
.
context
"
:context
="
state
.
context
"
:viewParams=
"state.viewParams"
:viewParams=
"state.viewParams"
:isShowButton=
"state.isShowButton"
:isShowButton=
"state.isShowButton"
:selectedData=
"s
tate.s
electedData"
:selectedData=
"selectedData"
:viewSubject=
"state.viewSubject"
:viewSubject=
"state.viewSubject"
:multiple=
"multiple"
:multiple=
"multiple"
@
viewEvent=
"onViewEvent"
@
viewEvent=
"onViewEvent"
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录