Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
01ca5b58
提交
01ca5b58
编写于
6月 28, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chitanda 发布系统代码
上级
a9606446
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
129 行增加
和
129 行删除
+129
-129
MPickupViewBase.tsx
app_CRM/src/studio-core/view/MPickupViewBase.tsx
+123
-0
PickupViewBase.tsx
app_CRM/src/studio-core/view/PickupViewBase.tsx
+6
-129
未找到文件。
app_CRM/src/studio-core/view/MPickupViewBase.tsx
浏览文件 @
01ca5b58
import
{
Prop
}
from
'vue-property-decorator'
;
import
{
PickupViewBase
}
from
'./PickupViewBase'
;
/**
...
...
@@ -9,6 +10,14 @@ import { PickupViewBase } from './PickupViewBase';
*/
export
class
MPickupViewBase
extends
PickupViewBase
{
/**
* 是否初始化已选中项
*
* @type {boolean}
* @memberof MPickupViewBase
*/
public
isInitSelected
:
boolean
=
false
;
/**
* 是否单选
*
...
...
@@ -16,4 +25,118 @@ export class MPickupViewBase extends PickupViewBase {
* @memberof MPickupViewBase
*/
public
isSingleSelect
:
boolean
=
false
;
/**
* 视图参数变更
*
* @protected
* @param {*} newVal
* @param {*} oldVal
* @memberof MPickupViewBase
*/
protected
viewParamChange
(
newVal
:
any
,
oldVal
:
any
):
void
{
if
(
this
.
viewparams
.
selectedData
)
{
this
.
selectedData
=
JSON
.
stringify
(
this
.
viewparams
.
selectedData
);
}
}
/**
* 视图组件挂载完毕
*
* @protected
* @memberof MPickupViewBase
*/
protected
viewMounted
():
void
{
if
(
this
.
viewparams
.
selectedData
)
{
this
.
engine
.
onCtrlEvent
(
'pickupviewpanel'
,
'selectionchange'
,
this
.
viewparams
.
selectedData
);
this
.
onCLickRight
();
}
}
/**
* 选中数据单击
*
* @param {*} item
* @memberof MPickupViewBase
*/
public
selectionsClick
(
item
:
any
):
void
{
item
.
_select
=
!
item
.
_select
;
const
removeSelect
:
boolean
=
this
.
viewSelections
.
some
((
selection
:
any
)
=>
selection
.
_select
);
this
.
containerModel
.
view_leftbtn
.
disabled
=
!
removeSelect
;
}
/**
* 选中树双击
*
* @param {*} item
* @memberof MPickupViewBase
*/
public
selectionsDBLClick
(
item
:
any
):
void
{
const
index
:
number
=
this
.
viewSelections
.
findIndex
((
selection
:
any
)
=>
Object
.
is
(
selection
.
srfkey
,
item
.
srfkey
));
if
(
index
!==
-
1
)
{
this
.
viewSelections
.
splice
(
index
,
1
);
}
const
removeSelect
:
boolean
=
this
.
viewSelections
.
some
((
selection
:
any
)
=>
selection
.
_select
);
this
.
containerModel
.
view_leftbtn
.
disabled
=
!
removeSelect
;
this
.
selectedData
=
JSON
.
stringify
(
this
.
viewSelections
);
}
/**
* 删除右侧全部选中数据
*
* @memberof MPickupViewBase
*/
public
onCLickLeft
():
void
{
const
_selectiions
=
[...
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewSelections
))];
_selectiions
.
forEach
((
item
:
any
)
=>
{
if
(
!
item
.
_select
)
{
return
;
}
const
index
=
this
.
viewSelections
.
findIndex
((
selection
:
any
)
=>
Object
.
is
(
item
.
srfkey
,
selection
.
srfkey
));
if
(
index
!==
-
1
)
{
this
.
viewSelections
.
splice
(
index
,
1
);
}
});
const
removeSelect
:
boolean
=
this
.
viewSelections
.
some
((
selection
:
any
)
=>
selection
.
_select
);
this
.
containerModel
.
view_leftbtn
.
disabled
=
!
removeSelect
;
this
.
selectedData
=
JSON
.
stringify
(
this
.
viewSelections
);
}
/**
* 添加左侧选中数据
*
* @memberof MPickupViewBase
*/
public
onCLickRight
():
void
{
Object
.
values
(
this
.
containerModel
).
forEach
((
model
:
any
)
=>
{
if
(
!
Object
.
is
(
model
.
type
,
'PICKUPVIEWPANEL'
))
{
return
;
}
let
newSelections
:
any
[]
=
[];
model
.
selections
.
forEach
((
item
:
any
)
=>
{
const
index
:
number
=
this
.
viewSelections
.
findIndex
((
selection
:
any
)
=>
Object
.
is
(
item
.
srfkey
,
selection
.
srfkey
));
if
(
index
===
-
1
)
{
let
_item
:
any
=
{
...
JSON
.
parse
(
JSON
.
stringify
(
item
))
};
Object
.
assign
(
_item
,
{
_select
:
false
})
newSelections
.
push
(
_item
);
}
else
{
newSelections
.
push
(
this
.
viewSelections
[
index
]);
}
});
this
.
viewSelections
=
newSelections
;
});
this
.
selectedData
=
JSON
.
stringify
(
this
.
viewSelections
);
}
/**
* 选中数据全部删除
*
* @memberof MPickupViewBase
*/
public
onCLickAllLeft
():
void
{
this
.
viewSelections
=
[];
this
.
containerModel
.
view_leftbtn
.
disabled
=
true
;
this
.
engine
.
onCtrlEvent
(
'pickupviewpanel'
,
'selectionchange'
,
[]);
this
.
selectedData
=
JSON
.
stringify
(
this
.
viewSelections
);
}
}
\ No newline at end of file
app_CRM/src/studio-core/view/PickupViewBase.tsx
浏览文件 @
01ca5b58
import
{
Prop
}
from
'vue-property-decorator'
;
import
{
ViewBase
}
from
'./ViewBase'
;
/**
...
...
@@ -11,12 +10,12 @@ import { ViewBase } from './ViewBase';
export
class
PickupViewBase
extends
ViewBase
{
/**
*
视图选中数据
*
是否单选
*
* @type {
any[]
}
* @type {
boolean
}
* @memberof PickupViewBase
*/
public
viewSelections
:
any
[]
=
[]
;
public
isSingleSelect
:
boolean
=
true
;
/**
* 是否显示按钮
...
...
@@ -36,134 +35,12 @@ export class PickupViewBase extends ViewBase {
public
selectedData
:
string
=
''
;
/**
* 是否初始化已选中项
*
* @type {boolean}
* @memberof PickupViewBase
*/
public
isInitSelected
:
boolean
=
false
;
/**
* 是否单选
*
* @type {boolean}
* @memberof PickupViewBase
*/
public
isSingleSelect
:
boolean
=
true
;
/**
* 视图参数变更
*
* @protected
* @param {*} newVal
* @param {*} oldVal
* @memberof PickupViewBase
*/
protected
viewParamChange
(
newVal
:
any
,
oldVal
:
any
):
void
{
if
(
this
.
viewparams
.
selectedData
)
{
this
.
selectedData
=
JSON
.
stringify
(
this
.
viewparams
.
selectedData
);
}
}
/**
* 视图组件挂载完毕
*
* @protected
* @memberof PickupViewBase
*/
protected
viewMounted
():
void
{
if
(
this
.
viewparams
.
selectedData
)
{
this
.
engine
.
onCtrlEvent
(
'pickupviewpanel'
,
'selectionchange'
,
this
.
viewparams
.
selectedData
);
this
.
onCLickRight
();
}
}
/**
* 选中数据单击
*
* @param {*} item
* @memberof PickupViewBase
*/
public
selectionsClick
(
item
:
any
):
void
{
item
.
_select
=
!
item
.
_select
;
const
removeSelect
:
boolean
=
this
.
viewSelections
.
some
((
selection
:
any
)
=>
selection
.
_select
);
this
.
containerModel
.
view_leftbtn
.
disabled
=
!
removeSelect
;
}
/**
* 选中树双击
*
* @param {*} item
* @memberof PickupViewBase
*/
public
selectionsDBLClick
(
item
:
any
):
void
{
const
index
:
number
=
this
.
viewSelections
.
findIndex
((
selection
:
any
)
=>
Object
.
is
(
selection
.
srfkey
,
item
.
srfkey
));
if
(
index
!==
-
1
)
{
this
.
viewSelections
.
splice
(
index
,
1
);
}
const
removeSelect
:
boolean
=
this
.
viewSelections
.
some
((
selection
:
any
)
=>
selection
.
_select
);
this
.
containerModel
.
view_leftbtn
.
disabled
=
!
removeSelect
;
this
.
selectedData
=
JSON
.
stringify
(
this
.
viewSelections
);
}
/**
* 删除右侧全部选中数据
*
* @memberof PickupViewBase
*/
public
onCLickLeft
():
void
{
const
_selectiions
=
[...
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewSelections
))];
_selectiions
.
forEach
((
item
:
any
)
=>
{
if
(
!
item
.
_select
)
{
return
;
}
const
index
=
this
.
viewSelections
.
findIndex
((
selection
:
any
)
=>
Object
.
is
(
item
.
srfkey
,
selection
.
srfkey
));
if
(
index
!==
-
1
)
{
this
.
viewSelections
.
splice
(
index
,
1
);
}
});
const
removeSelect
:
boolean
=
this
.
viewSelections
.
some
((
selection
:
any
)
=>
selection
.
_select
);
this
.
containerModel
.
view_leftbtn
.
disabled
=
!
removeSelect
;
this
.
selectedData
=
JSON
.
stringify
(
this
.
viewSelections
);
}
/**
* 添加左侧选中数据
*
* @memberof PickupViewBase
*/
public
onCLickRight
():
void
{
Object
.
values
(
this
.
containerModel
).
forEach
((
model
:
any
)
=>
{
if
(
!
Object
.
is
(
model
.
type
,
'PICKUPVIEWPANEL'
))
{
return
;
}
let
newSelections
:
any
[]
=
[];
model
.
selections
.
forEach
((
item
:
any
)
=>
{
const
index
:
number
=
this
.
viewSelections
.
findIndex
((
selection
:
any
)
=>
Object
.
is
(
item
.
srfkey
,
selection
.
srfkey
));
if
(
index
===
-
1
)
{
let
_item
:
any
=
{
...
JSON
.
parse
(
JSON
.
stringify
(
item
))
};
Object
.
assign
(
_item
,
{
_select
:
false
})
newSelections
.
push
(
_item
);
}
else
{
newSelections
.
push
(
this
.
viewSelections
[
index
]);
}
});
this
.
viewSelections
=
newSelections
;
});
this
.
selectedData
=
JSON
.
stringify
(
this
.
viewSelections
);
}
/**
* 选中数据全部删除
* 视图选中数据
*
* @type {any[]}
* @memberof PickupViewBase
*/
public
onCLickAllLeft
():
void
{
this
.
viewSelections
=
[];
this
.
containerModel
.
view_leftbtn
.
disabled
=
true
;
this
.
engine
.
onCtrlEvent
(
'pickupviewpanel'
,
'selectionchange'
,
[]);
this
.
selectedData
=
JSON
.
stringify
(
this
.
viewSelections
);
}
public
viewSelections
:
any
[]
=
[];
/**
* 确定
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录