Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7-Res
提交
118b241d
提交
118b241d
编写于
6月 08, 2020
作者:
lijinyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ljy-transfer
多选穿梭框
上级
fc11a999
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
308 行增加
和
0 行删除
+308
-0
app-register.ts
src/app-register.ts
+2
-0
dropdown-list-mpicker-transfer.less
...list-mpicker-transfer/dropdown-list-mpicker-transfer.less
+6
-0
dropdown-list-mpicker-transfer.vue
...-list-mpicker-transfer/dropdown-list-mpicker-transfer.vue
+300
-0
未找到文件。
src/app-register.ts
浏览文件 @
118b241d
...
...
@@ -77,6 +77,7 @@ import IBizGroupSelect from './components/ibiz-group-select/ibiz-group-select.vu
import
IBizGroupPicker
from
'./components/ibiz-group-picker/ibiz-group-picker.vue'
import
AppWFApproval
from
'./components/app-wf-approval/app-wf-approval.vue'
import
Breadcrumb
from
'./components/app-breadcrumb/app-breadcrumb.vue'
;
import
DropdownListMpickerTransfer
from
'./components/dropdown-list-mpicker-transfer/dropdown-list-mpicker-transfer.vue'
// 全局挂载UI实体服务注册中心
window
[
'uiServiceRegister'
]
=
uiServiceRegister
;
...
...
@@ -163,5 +164,6 @@ export const AppComponents = {
v
.
component
(
'ibiz-group-picker'
,
IBizGroupPicker
);
v
.
component
(
'app-wf-approval'
,
AppWFApproval
);
v
.
component
(
'app-breadcrumb'
,
Breadcrumb
);
v
.
component
(
'dropdown-list-mpicker-transfer'
,
DropdownListMpickerTransfer
);
},
};
\ No newline at end of file
src/components/dropdown-list-mpicker-transfer/dropdown-list-mpicker-transfer.less
0 → 100644
浏览文件 @
118b241d
.ivu-select-dropdown {
padding: 0px;
.hidden {
display: none;
}
}
\ No newline at end of file
src/components/dropdown-list-mpicker-transfer/dropdown-list-mpicker-transfer.vue
0 → 100644
浏览文件 @
118b241d
<
template
>
<Select
v-model=
"dataRight"
style=
"width:586px"
multiple
>
<Option
class=
"hidden"
:value=
"item"
v-for=
"(item,i) in dataRight"
:key=
"i"
>
{{
dataLeft
[
item
-
1
].
label
}}
</Option>
<el-transfer
v-model=
"dataRight"
:data=
"dataLeft"
@
change=
dataChange
></el-transfer>
</Select>
</
template
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Watch
,
Prop
,
Model
}
from
"vue-property-decorator"
;
import
CodeListService
from
"@service/app/codelist-service"
;
@
Component
({})
export
default
class
FromTransfer
extends
Vue
{
/**
* 表单传递右侧框中的数据
*/
@
Prop
()
public
data
:
any
;
/**
* 左侧框数据
*/
public
dataLeft
:
any
[]
=
[];
/**
* 右侧框数据
*/
public
dataRight
:
any
[]
=
[];
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof FromTransfer
*/
public
codeListService
:
CodeListService
=
new
CodeListService
({
$store
:
this
.
$store
});
/**
* 额外参数
*
* @type {*}
* @memberof FromTransfer
*/
public
otherParam
:
any
;
/**
* 查询参数
* @type {*}
* @memberof FromTransfer
*/
public
queryParam
:
any
;
/**
* 当前选中值
* @type {any}
* @memberof Drop
*/
@
Model
(
"change"
)
readonly
itemValue
!
:
any
;
/**
* 代码表标识
*
* @type {string}
* @memberof FromTransfer
*/
@
Prop
()
public
tag
?:
string
;
/**
* 代码表类型
*
* @type {string}
* @memberof FromTransfer
*/
@
Prop
()
public
codelistType
?:
string
;
/**
* 监听表单数据
*
* @memberof FromTransfer
*/
@
Watch
(
"data"
,
{
deep
:
true
})
onDataChange
(
newVal
:
any
,
val
:
any
)
{
if
(
newVal
)
{
}
}
/**
* 组件change事件,右侧框数据变化时
* @memberof FromTransfer
*/
dataChange
(
e
:
any
){
console
.
log
(
e
);
let
val
:
any
[]
=
[];
let
newVal
:
any
;
this
.
dataLeft
.
forEach
((
elem
:
any
)
=>
{
e
.
forEach
((
item
:
any
)
=>
{
if
(
elem
.
key
===
item
)
val
.
push
(
elem
.
value
);
});
});
newVal
=
val
.
join
(
','
);
console
.
log
(
newVal
);
this
.
$emit
(
"change"
,
newVal
);
}
/**
* 传入额外参数
*
* @type {*}
* @memberof FromTransfer
*/
@
Prop
()
public
itemParam
?:
any
;
/**
* 视图上下文
*
* @type {*}
* @memberof AppAutocomplete
*/
@
Prop
()
public
context
!
:
any
;
/**
* 视图参数
*
* @type {*}
* @memberof AppFormDRUIPart
*/
@
Prop
()
public
viewparams
!
:
any
;
/**
* 是否禁用
* @type {any}
* @memberof FromTransfer
*
*/
@
Prop
()
public
disabled
?:
any
;
/**
* 是否支持过滤
* @type {boolean}
* @memberof FromTransfer
*/
@
Prop
()
public
filterable
?:
boolean
;
/**
* 下拉选提示内容
* @type {string}
* @memberof FromTransfer
*/
@
Prop
()
public
placeholder
?:
string
;
/**
* 计算属性(当前值)
* @type {any}
* @memberof FromTransfer
*/
set
currentVal
(
val
:
any
)
{
// const type: string = this.$util.typeOf(val);
// val =
// Object.is(type, "null") || Object.is(type, "undefined") ? undefined : val;
// this.dataLeft.forEach((elem: any) => {
// this.dataRight.forEach((item: any) => {
// if (elem.key === item) val.push(elem.value);
// });
// });
// val=val.join(',');
// this.$emit("change", val);
}
/**
* 获取值对象
*
* @memberof FromTransfer
*/
// get currentVal() {
// return this.itemValue;
// }
get
currentVal
()
{
return
this
.
itemValue
;
}
/**
* 代码表
*
* @type {any[]}
* @memberof FromTransfer
*/
// public items: any[] = [];
/**
* 公共参数处理
*
* @param {*} arg
* @returns
* @memberof FromTransfer
*/
public
handlePublicParams
(
arg
:
any
)
{
// 合并表单参数
arg
.
param
=
this
.
viewparams
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
))
:
{};
arg
.
context
=
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
))
:
{};
// 附加参数处理
if
(
this
.
itemParam
&&
this
.
itemParam
.
context
)
{
let
_context
=
this
.
$util
.
formatData
(
this
.
data
,
arg
.
context
,
this
.
itemParam
.
context
);
Object
.
assign
(
arg
.
context
,
_context
);
}
if
(
this
.
itemParam
&&
this
.
itemParam
.
param
)
{
let
_param
=
this
.
$util
.
formatData
(
this
.
data
,
arg
.
param
,
this
.
itemParam
.
param
);
Object
.
assign
(
arg
.
param
,
_param
);
}
}
/**
* vue 生命周期
*
* @memberof FromTransfer
*/
public
created
()
{
this
.
dataHandle
();
this
.
initRight
();
}
/**
* 数据处理
*/
public
dataHandle
()
{
if
(
this
.
tag
&&
Object
.
is
(
this
.
codelistType
,
"STATIC"
))
{
const
codelist
=
this
.
$store
.
getters
.
getCodeList
(
this
.
tag
);
if
(
codelist
)
{
this
.
dataLeft
=
[...
JSON
.
parse
(
JSON
.
stringify
(
codelist
.
items
))];
this
.
initLeft
();
console
.
log
(
this
.
dataLeft
);
}
else
{
console
.
log
(
`----
${
this
.
tag
}
----代码表不存在`
);
}
}
else
if
(
this
.
tag
&&
Object
.
is
(
this
.
codelistType
,
"DYNAMIC"
))
{
// 公共参数处理
let
data
:
any
=
{};
this
.
handlePublicParams
(
data
);
// 参数处理
let
_context
=
data
.
context
;
let
_param
=
data
.
param
;
this
.
codeListService
.
getItems
(
this
.
tag
,
_context
,
_param
)
.
then
((
res
:
any
)
=>
{
this
.
dataLeft
=
res
;
console
.
log
(
this
.
dataLeft
);
this
.
initLeft
();
})
.
catch
((
error
:
any
)
=>
{
console
.
log
(
`----
${
this
.
tag
}
----代码表不存在`
);
});
}
}
/**
* 初始化左侧框数据
*/
public
initLeft
()
{
let
left
:
any
[]
=
[];
Object
.
assign
(
left
,
this
.
dataLeft
);
this
.
dataLeft
=
[];
left
.
forEach
((
elem
:
any
,
i
:
any
)
=>
{
this
.
dataLeft
.
push
({
key
:
i
+
1
,
id
:
elem
.
id
,
value
:
elem
.
value
,
label
:
elem
.
label
,
disabled
:
elem
.
disabled
});
});
}
/**
* 初始化右侧框数据
*/
public
initRight
()
{
if
(
this
.
data
)
{
this
.
data
.
forEach
((
elem
:
any
)
=>
{
this
.
dataRight
.
push
(
elem
);
});
}
}
}
</
script
>
<
style
lang=
'less'
>
@import "./form-transfer.less";
</
style
>
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录