Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-Mob-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-Mob-R7-Res
提交
d6087795
提交
d6087795
编写于
9月 08, 2020
作者:
KK
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
定制组件-- 工具服务类注册
上级
dc7aecd6
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
133 行增加
和
88 行删除
+133
-88
app-customize.less
src/components/app-customize/app-customize.less
+68
-68
app-customize.vue
src/components/app-customize/app-customize.vue
+60
-18
index.ts
src/ibiz-core/index.ts
+2
-1
index.d.ts
src/ibiz-core/types/index.d.ts
+3
-1
未找到文件。
src/components/app-customize/app-customize.less
浏览文件 @
d6087795
.drag-list{
background-color: #F4F4F6;
overflow: auto;
height: 100%;
.drag-list-item{
margin: 0 10px;
box-sizing: border-box;
.header{
height: 40px;
line-height: 40px;
color:#BDC4CD;
font-size: 15px;
background-color: #F4F4F6;
overflow: auto;
height: 100%;
.drag-list-item{
margin: 0 10px;
box-sizing: border-box;
.header{
height: 40px;
line-height: 40px;
color:#BDC4CD;
font-size: 15px;
}
.content{
width: 100%;
height: 50px;
background-color: white;
position: relative;
margin-bottom: 10px;
.start{
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 5px;
font-size: 30px;
color: #ED9691;
}
.
content
{
width:
100%
;
.
drag-list-pic
{
width:
50px
;
height: 50px;
background-color: white;
position: relative;
margin-bottom: 10px;
.start{
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 5px;
font-size: 30px;
color: #ED9691;
}
.drag-list-pic{
width: 50px;
height: 50px;
background-color: skyblue;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 50px;
}
.drag-list-text{
width: 200px;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 120px;
div:nth-child(1){
font-size: 15px;
color: #484a4b;
font-weight: 600;
}
div:nth-child(2){
font-size: 12px;
color: #909AA9;
}
background-color: skyblue;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 50px;
}
.drag-list-text{
width: 200px;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 120px;
div:nth-child(1){
font-size: 15px;
color: #484a4b;
font-weight: 600;
}
.end{
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 10px;
font-size: 20px;
color: #797979;
div:nth-child(2){
font-size: 12px;
color: #909AA9;
}
}
}
.add{
.content{
.start{
color:#468CF3;
}
.end{
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 10px;
font-size: 20px;
color: #797979;
}
}
.icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor
;
overflow: hidden;
}
.add{
.content{
.start{
color:#468CF3
;
}
}
}
\ No newline at end of file
}
.icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
}
\ No newline at end of file
src/components/app-customize/app-customize.vue
浏览文件 @
d6087795
...
...
@@ -8,7 +8,7 @@
{{
$t
(
'app.button.back'
)
}}
</ion-button>
</ion-buttons>
<ion-title
class=
"view-title"
><label
class=
"title-label"
>
自定义仪表盘
</label></ion-title>
<ion-title
class=
"view-title"
><label
class=
"title-label"
>
自定义仪表盘
</label></ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
...
...
@@ -16,12 +16,12 @@
<div
class=
"drag-list-item added"
>
<div
class=
"header"
>
已经添加的卡片
</div>
<draggable
v-model=
"list_added"
handle=
".end"
:animation=
"200"
@
end=
"dragEnd"
>
<div
class=
"content"
v-for=
"item in list_added"
:key=
"item.
id
"
>
<div
class=
"content"
v-for=
"item in list_added"
:key=
"item.
componentName
"
>
<div
class=
"start"
@
click=
"delteItem(item.id)"
><ion-icon
name=
"remove-circle-outline"
></ion-icon></div>
<div
class=
"drag-list-pic"
></div>
<div
class=
"drag-list-text"
>
<div>
{{
item
.
titl
e
}}
</div>
<div>
{{
item
.
text
}}
</div>
<div>
{{
item
.
appNam
e
}}
</div>
<div>
{{
item
.
portletName
}}
</div>
</div>
<div
class=
"end"
>
<ion-icon
name =
"drag-point"
></ion-icon>
...
...
@@ -33,13 +33,12 @@
<div
class=
"drag-list-item add"
>
<div
class=
"header"
>
可添加的卡片
</div>
<template
v-for=
"item in list_add"
>
<div
class=
"content"
v-if=
"item.componentName"
:key=
"item.id"
>
<div
class=
"content"
v-if=
"item.componentName"
:key=
"item.componentName"
>
<div
class=
"start"
@
click=
"addItem(item.id)"
><ion-icon
name=
"add-circle-outline"
></ion-icon></div>
<div
class=
"drag-list-pic"
></div>
<div
class=
"drag-list-text"
>
<div>
{{
item
.
titl
e
}}
</div>
<div>
{{
item
.
text
}}
</div>
<div>
{{
item
.
appNam
e
}}
</div>
<div>
{{
item
.
portletName
}}
</div>
</div>
</div>
...
...
@@ -61,6 +60,7 @@ import {
}
from
"vue-property-decorator"
;
import
draggable
from
'vuedraggable'
;
import
{
Http
}
from
'@/ibiz-core/utils'
;
import
UtilService
from
'@/utilservice/util-service'
;
@
Component
({
components
:
{
draggable
,
...
...
@@ -85,15 +85,22 @@ export default class App404 extends Vue {
*/
@
Prop
()
protected
_viewparams
!
:
string
;
/**
* 工具服务对象
*
* @protected
* @type {UtilService}
* @memberof AppDashboardDesignService
*/
protected
utilService
:
UtilService
=
new
UtilService
();
/**
* 传入数据list_add
*
* @type {Array}
* @memberof APPDragList
*/
public
list_add
?:
any
=
[
]
public
list_add
?:
any
=
[]
/**
* 减少item
...
...
@@ -110,6 +117,7 @@ export default class App404 extends Vue {
v
.
id
=
i
+
1
;
})
this
.
list_add
.
push
(
item
);
this
.
customizeChange
();
}
/**
...
...
@@ -137,6 +145,7 @@ export default class App404 extends Vue {
* @memberof APPDragList
*/
public
dragEnd
(){
this
.
customizeChange
();
console
.
log
(
this
.
list_added
)
}
...
...
@@ -206,13 +215,16 @@ export default class App404 extends Vue {
* 解析data
*/
public
parseData
(
data
:
any
)
{
data
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
item
.
id
=
index
;
item
.
text
=
item
.
portletName
;
item
.
title
=
item
.
appName
;
this
.
selectMode
.
forEach
((
i
:
any
,
ins
:
number
)
=>
{
data
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
if
(
i
.
componentName
==
item
.
componentName
){
data
.
splice
(
index
,
1
);
}
});
});
this
.
list_add
=
data
;
this
.
list_added
=
this
.
selectMode
;
}
/**
...
...
@@ -236,7 +248,7 @@ export default class App404 extends Vue {
* customizeChange
*/
public
customizeChange
()
{
this
.
saveModel
(
this
.
utilServiceName
,{},{
utilServiceName
:
this
.
utilServiceName
,
modelid
:
this
.
modelId
,
model
:
this
.
list_added
});
}
/**
...
...
@@ -247,7 +259,9 @@ export default class App404 extends Vue {
if
(
parm
){
this
.
modelId
=
parm
.
modelId
?
parm
.
modelId
:
""
;
this
.
utilServiceName
=
parm
.
utilServiceName
?
parm
.
utilServiceName
:
""
;
this
.
selectMode
=
parm
.
selectMode
?
parm
.
selectMode
:
""
;
}
console
.
log
(
this
.
selectMode
);
}
...
...
@@ -255,8 +269,36 @@ export default class App404 extends Vue {
* 关闭视图
*/
public
closeView
()
{
this
.
$emit
(
"close"
,
[]);
this
.
$emit
(
"close"
,
[
this
.
selectMode
]);
}
public
selectMode
=
[];
/**
* 保存模型
*
* @param {string} serviceName
* @param {*} context
* @param {*} viewparams
* @returns
* @memberof AppDashboardDesignService
*/
public
saveModel
(
serviceName
:
string
,
context
:
any
,
viewparams
:
any
)
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
this
.
utilService
.
getService
(
serviceName
).
then
((
service
:
any
)
=>
{
service
.
saveModelData
(
JSON
.
stringify
(
context
),
''
,
viewparams
).
then
((
response
:
any
)
=>
{
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
reject
(
response
);
});
}).
catch
((
response
:
any
)
=>
{
reject
(
response
);
});
});
}
}
</
script
>
<
style
lang =
"less"
>
...
...
src/ibiz-core/index.ts
浏览文件 @
d6087795
...
...
@@ -48,6 +48,7 @@ import { counterServiceConstructor } from '@/app-core/counter/counter-service-co
import
{
AppCommunicationsCenter
}
from
'./app-service/message-center/app-communications-center'
;
import
{
authServiceConstructor
}
from
'@/app-core/auth-service/auth-service-constructor'
import
{
codeListServiceConstructor
}
from
'@/app-core/code-list/code-list-service-constructor'
;
import
{
utilServiceRegister
}
from
'@/utilservice/util-service-register'
;
// 全局挂载应用实体服务构造器
window
[
'appEntityServiceConstructor'
]
=
appEntityServiceConstructor
;
// 全局挂载计数器服务构造器
...
...
@@ -58,7 +59,7 @@ window['authServiceConstructor'] = authServiceConstructor;
window
[
'codeListServiceConstructor'
]
=
codeListServiceConstructor
;
// 全局挂载应用通讯中心
window
[
'acc'
]
=
AppCommunicationsCenter
.
getInstance
();
window
[
'utilServiceRegister'
]
=
utilServiceRegister
;
/**
* 注册组件
*/
...
...
src/ibiz-core/types/index.d.ts
浏览文件 @
d6087795
...
...
@@ -3,12 +3,14 @@ import { CounterServiceConstructor } from '@/app-core/counter/counter-service-co
import
{
AppCommunicationsCenter
}
from
'../app-service/message-center/app-communications-center'
;
import
{
AuthServiceConstructor
}
from
'@/app-core/auth-service/auth-service-constructor'
;
import
{
CodeListServiceConstructor
}
from
'@/app-core/code-list/code-list-service-constructor'
;
import
{
UtilServiceRegister
}
from
'@/utilservice/util-service-register'
;
declare
global
{
interface
Window
{
appEntityServiceConstructor
:
AppEntityServiceConstructor
,
counterServiceConstructor
:
CounterServiceConstructor
,
authServiceConstructor
:
AuthServiceConstructor
,
codeListServiceConstructor
:
CodeListServiceConstructor
,
acc
:
AppCommunicationsCenter
acc
:
AppCommunicationsCenter
,
utilServiceRegister
:
UtilServiceRegister
}
}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录