Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
9d52e4f8
提交
9d52e4f8
编写于
3月 21, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新多选视图逻辑
上级
3c609cf3
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
50 行增加
和
21 行删除
+50
-21
mpickup-view.ts
...pps}}/src/core/modules/views/mpickup-view/mpickup-view.ts
+33
-19
index.scss
...esources/templ/r7/app_{{apps}}/src/style/views/index.scss
+2
-1
mpickup-view.scss
...s/templ/r7/app_{{apps}}/src/style/views/mpickup-view.scss
+14
-0
{{pages@DEMPICKUPVIEW}}.vue.hbs
...}/{{pages@DEMPICKUPVIEW}}/{{pages@DEMPICKUPVIEW}}.vue.hbs
+1
-1
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/mpickup-view/mpickup-view.ts
浏览文件 @
9d52e4f8
...
...
@@ -32,16 +32,19 @@ export class MPickupView extends PickupView {
*/
protected
initSelectedData
()
{
const
{
viewParams
}
=
this
.
state
;
const
{
selectedData
,
selections
}
=
toRefs
(
this
.
state
);
const
selected
:
IParam
=
viewParams
?.
selectedData
?.[
0
]
||
{};
const
keys
=
selected
.
srfkey
?.
split
(
','
)
||
[];
const
texts
=
selected
.
srfmajortext
?.
split
(
','
)
||
[];
if
(
keys
.
length
&&
texts
.
length
)
{
keys
.
forEach
((
key
:
string
,
index
:
number
)
=>
{
selectedData
.
value
.
push
({
srfkey
:
key
,
srfmajortext
:
texts
[
index
]
});
});
}
selections
.
value
=
[...
selectedData
.
value
];
const
{
selectedData
,
selections
}
=
toRefs
(
this
.
state
);
selections
.
value
.
splice
(
0
,
selections
.
value
.
length
);
nextTick
(()
=>
{
const
selected
:
IParam
=
viewParams
?.
selectedData
?.[
0
]
||
{};
const
keys
=
selected
.
srfkey
?.
split
(
','
)
||
[];
const
texts
=
selected
.
srfmajortext
?.
split
(
','
)
||
[];
if
(
keys
.
length
&&
texts
.
length
)
{
keys
.
forEach
((
key
:
string
,
index
:
number
)
=>
{
selectedData
.
value
.
push
({
srfkey
:
key
,
srfmajortext
:
texts
[
index
]
});
});
}
selections
.
value
=
[...
selectedData
.
value
];
});
}
/**
...
...
@@ -52,7 +55,7 @@ export class MPickupView extends PickupView {
*/
protected
onMoveRight
()
{
const
{
selections
,
selectedData
}
=
toRefs
(
this
.
state
);
selections
.
value
=
selectedData
.
value
;
selections
.
value
=
[...
selectedData
.
value
]
;
}
/**
...
...
@@ -64,12 +67,16 @@ export class MPickupView extends PickupView {
protected
onMoveLeft
()
{
const
{
selections
,
rightPanelSelections
}
=
toRefs
(
this
.
state
);
if
(
rightPanelSelections
.
value
&&
rightPanelSelections
.
value
.
length
)
{
rightPanelSelections
.
value
.
forEach
((
pickItem
:
IParam
)
=>
{
const
index
=
selections
.
value
.
findIndex
((
select
:
IParam
)
=>
select
.
srfkey
===
pickItem
.
srfkey
);
for
(
let
i
=
0
;
i
<
rightPanelSelections
.
value
.
length
;
i
++
)
{
const
index
=
selections
.
value
.
findIndex
((
select
:
IParam
)
=>
select
.
srfkey
===
rightPanelSelections
.
value
[
i
]
.
srfkey
);
if
(
index
!==
-
1
)
{
selections
.
value
.
splice
(
index
,
1
);
// 重新赋值确保数组变化,后续能监听到该变化
selections
.
value
=
[...
selections
.
value
];
}
});
rightPanelSelections
.
value
.
splice
(
i
,
1
);
i
-=
1
;
}
}
}
...
...
@@ -109,6 +116,13 @@ export class MPickupView extends PickupView {
*/
protected
onRightPanelClick
(
item
:
IParam
,
event
:
MouseEvent
)
{
const
{
rightPanelSelections
}
=
toRefs
(
this
.
state
);
// 判断右侧面板选中数据里面是否有正点击的这项,有就移除,没有就添加
const
index
=
rightPanelSelections
.
value
.
indexOf
(
item
);
if
(
index
>=
0
)
{
rightPanelSelections
.
value
.
splice
(
index
,
1
);
}
else
{
rightPanelSelections
.
value
.
push
(
item
);
}
}
/**
...
...
@@ -117,14 +131,14 @@ export class MPickupView extends PickupView {
* @memberof MPickupView
*/
public
onConfirm
():
void
{
const
{
selections
}
=
t
his
.
state
;
const
{
selections
}
=
t
oRefs
(
this
.
state
)
;
const
data
:
IParam
[]
=
[];
if
(
selections
&&
selections
.
length
)
{
if
(
selections
.
value
&&
selections
.
value
.
length
)
{
let
srfkey
:
string
=
''
;
let
srfmajortext
:
string
=
''
;
selections
.
forEach
((
select
:
IParam
,
index
:
number
)
=>
{
srfkey
+=
`
${
select
.
srfkey
}${
index
!==
selections
.
length
-
1
?
','
:
''
}
`
;
srfmajortext
+=
`
${
select
.
srfmajortext
}${
index
!==
selections
.
length
-
1
?
','
:
''
}
`
;
selections
.
value
.
forEach
((
select
:
IParam
,
index
:
number
)
=>
{
srfkey
+=
`
${
select
.
srfkey
}${
index
!==
selections
.
value
.
length
-
1
?
','
:
''
}
`
;
srfmajortext
+=
`
${
select
.
srfmajortext
}${
index
!==
selections
.
value
.
length
-
1
?
','
:
''
}
`
;
});
data
.
push
({
srfkey
:
srfkey
,
srfmajortext
:
srfmajortext
});
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/style/views/index.scss
浏览文件 @
9d52e4f8
// 视图样式汇总
@use
'./view-base.scss'
;
\ No newline at end of file
@use
'./view-base.scss'
;
@use
'./mpickup-view.scss'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/style/views/mpickup-view.scss
0 → 100644
浏览文件 @
9d52e4f8
.app-mpickup-view
{
.picker-item
{
height
:
32px
;
line-height
:
32px
;
background
:
#ffffff
;
color
:
#666666
;
border-radius
:
3px
;
margin
:
10px
;
text-indent
:
20px
;
}
.picker-item__selected
{
background
:
#e6f7ff
;
}
}
\ 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
浏览文件 @
9d52e4f8
...
...
@@ -83,7 +83,7 @@ const { state, pickupViewPanel, onCancel, onConfirm, onCtrlEvent, onMoveRight, o
<div
v-for=
"(item, index) in state.selections"
:key=
"index"
:class=
"['picker-item', state.rightPanelSelections.includes(
(panel) => panel.srfkey === item.srfkey)
]"
:class=
"['picker-item', state.rightPanelSelections.includes(
item) ? 'picker-item__selected' : ''
]"
@
click=
"(event) => onRightPanelClick(item, event)"
>
<span
class=
"text"
>
\{{item.srfmajortext}}
</span>
</div>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录