Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7-Res
提交
1143c3c5
提交
1143c3c5
编写于
8月 28, 2020
作者:
Shine-zwj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
面板属性,面板成员(按钮,直接内容)
上级
9e302601
变更
5
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
263 行增加
和
248 行删除
+263
-248
app-register.ts
src/app-register.ts
+2
-2
app-panel-button.vue
src/components/app-panel-button/app-panel-button.vue
+0
-54
app-panel-field.less
src/components/app-panel-field/app-panel-field.less
+0
-0
app-panel-field.vue
src/components/app-panel-field/app-panel-field.vue
+212
-0
app-panel-item.vue
src/components/app-panel-item/app-panel-item.vue
+49
-192
未找到文件。
src/app-register.ts
浏览文件 @
1143c3c5
...
...
@@ -86,8 +86,8 @@ import AppLockScren from './components/app-lock-scren/app-lock-scren.vue'
import
ActionTimeline
from
'./components/action-timeline/action-timeline.vue'
import
CronEditor
from
'./components/cron-editor/cron-editor.vue'
import
AppMessagePopover
from
'./components/app-message-popover/app-message-popover.vue'
import
AppPanelField
from
'./components/app-panel-field/app-panel-field.vue'
import
AppPanelItem
from
'./components/app-panel-item/app-panel-item.vue'
import
AppPanelButton
from
'./components/app-panel-button/app-panel-button.vue'
// 全局挂载UI实体服务注册中心
...
...
@@ -114,8 +114,8 @@ export const AppComponents = {
v
.
prototype
.
$verify
=
Verify
;
v
.
prototype
.
$viewTool
=
ViewTool
;
v
.
prototype
.
$uiActionTool
=
UIActionTool
;
v
.
component
(
'app-panel-button'
,
AppPanelButton
);
v
.
component
(
'app-panel-item'
,
AppPanelItem
);
v
.
component
(
'app-panel-field'
,
AppPanelField
);
v
.
component
(
'app-full-scren'
,
AppFullScren
);
v
.
component
(
'app-lock-scren'
,
AppLockScren
);
v
.
component
(
'input-box'
,
InputBox
);
...
...
src/components/app-panel-button/app-panel-button.vue
已删除
100644 → 0
浏览文件 @
9e302601
<
template
>
<div>
<Button
type=
"primary"
long
@
click=
"onClick"
>
<i
v-if=
"icon"
:class=
"icon"
></i>
<span
v-if=
"showCaption"
>
{{
caption
?
caption
:
''
}}
</span>
</Button>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Prop
,
Watch
}
from
"vue-property-decorator"
;
@
Component
({})
export
default
class
AppPanelButton
extends
Vue
{
/**
* 图标
*
* @type {string}
* @memberof AppPanelButton
*/
@
Prop
()
public
icon
?:
string
;
/**
* 标题
*
* @type {string}
* @memberof AppPanelButton
*/
@
Prop
()
public
caption
?:
string
;
/**
* 显示标题
*
* @type {boolean}
* @memberof AppPanelButton
*/
@
Prop
()
public
showCaption
!
:
boolean
;
/**
* 点击按钮
*
* @param {*} $event
* @memberof AppPanelButton
*/
public
onClick
(
$event
:
any
){
this
.
$emit
(
'onClick'
,
$event
);
}
}
</
script
>
<
style
lang=
'less'
>
</
style
>
\ No newline at end of file
src/components/app-panel-
item/app-panel-item
.less
→
src/components/app-panel-
field/app-panel-field
.less
浏览文件 @
1143c3c5
文件已移动
src/components/app-panel-field/app-panel-field.vue
0 → 100644
浏览文件 @
1143c3c5
<
template
>
<div
:class=
"classes"
>
<div
v-if=
"Object.is(labelPos,'NONE') || !labelPos"
class=
"editor"
>
<div
:class=
"valueCheck == true ?'':'editorStyle'"
>
<slot
></slot>
</div>
</div>
<div
v-if=
"!Object.is(labelPos,'NONE')"
class=
"app-panel-item-label"
>
<span
v-if=
"required"
style=
"color:red;"
>
*
</span>
{{
isEmptyCaption
?
''
:
caption
}}
</div>
<div
v-if=
"Object.is(labelPos,'BOTTOM') || Object.is(labelPos,'TOP') || Object.is(labelPos,'LEFT') || Object.is(labelPos,'RIGHT')"
class=
"editor"
>
<div
:class=
"valueCheck == true ?'':'editorStyle'"
>
<slot
></slot>
</div>
</div>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Prop
,
Watch
}
from
"vue-property-decorator"
;
@
Component
({})
export
default
class
AppPanelItem
extends
Vue
{
/**
* 名称
*
* @type {string}
* @memberof AppPanelItem
*/
@
Prop
()
public
caption
!
:
string
;
/**
* 错误信息
*
* @type {string}
* @memberof AppPanelItem
*/
@
Prop
()
public
error
?:
string
;
/**
* 标签位置
*
* @type {(string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP')}
* @memberof AppPanelItem
*/
@
Prop
()
public
labelPos
?:
|
string
|
"BOTTOM"
|
"LEFT"
|
"NONE"
|
"RIGHT"
|
"TOP"
;
/**
* 标签是否空白
*
* @type {boolean}
* @memberof AppPanelItem
*/
@
Prop
()
public
isEmptyCaption
?:
boolean
;
/**
* 列表项名称
*
* @type {string}
* @memberof AppPanelItem
*/
@
Prop
()
public
name
!
:
string
;
/**
* 面板数据
*
* @type {any}
* @memberof AppPanelItem
*/
@
Prop
()
public
data
!
:
any
;
/**
* 编辑器值
*
* @type {any}
* @memberof AppPanelItem
*/
@
Prop
()
public
value
!
:
any
;
/**
* 值规则
*
* @type {string}
* @memberof AppPanelItem
*/
@
Prop
()
public
itemRules
!
:
any
;
/**
* 是否必填
*
* @type {boolean}
* @memberof AppPanelItem
*/
public
required
:
boolean
=
false
;
/**
* 值规则数组
*
* @type {any[]}
* @memberof AppPanelItem
*/
public
rules
:
any
[]
=
[];
/**
* 值规则监控
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppPanelItem
*/
@
Watch
(
"itemRules"
,
{
deep
:
true
})
onItemRulesChange
(
newVal
:
any
,
oldVal
:
any
)
{
if
(
newVal
)
{
try
{
this
.
rules
=
[];
const
_rules
:
any
[]
=
newVal
;
this
.
rules
=
[...
_rules
];
this
.
rules
.
some
((
rule
:
any
)
=>
{
if
(
rule
.
hasOwnProperty
(
"required"
))
{
this
.
required
=
rule
.
required
;
return
true
;
}
return
false
;
});
}
catch
(
error
)
{}
}
}
/**
* 编辑器样式
*
* @type {boolean}
* @memberof AppPanelItem
*/
public
valueCheck
:
boolean
=
true
;
/**
* 编辑器值监控
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppPanelItem
*/
@
Watch
(
"value"
)
ItemValueRules
(
newVal
:
any
,
oldVal
:
any
)
{
if
(
this
.
required
&&
!
newVal
)
{
this
.
valueCheck
=
false
;
}
else
{
this
.
valueCheck
=
true
;
}
}
/**
* 计算样式
*
* @readonly
* @type {string []}
* @memberof AppPanelItem
*/
get
classes
():
string
[]
{
let
posClass
=
""
;
switch
(
this
.
labelPos
)
{
case
"TOP"
:
posClass
=
"label-top"
;
break
;
case
"LEFT"
:
posClass
=
"label-left"
;
break
;
case
"BOTTOM"
:
posClass
=
"label-bottom"
;
break
;
case
"RIGHT"
:
posClass
=
"label-right"
;
break
;
case
"NONE"
:
posClass
=
"label-none"
;
break
;
}
return
[
"app-panel-item"
,
posClass
];
}
/**
* vue 生命周期
*
* @memberof AppPanelItem
*/
public
mounted
()
{
if
(
this
.
itemRules
)
{
try
{
const
_rules
:
any
[]
=
this
.
itemRules
;
this
.
rules
=
[...
_rules
];
this
.
rules
.
some
((
rule
:
any
)
=>
{
if
(
rule
.
hasOwnProperty
(
"required"
))
{
this
.
required
=
rule
.
required
;
return
true
;
}
return
false
;
});
}
catch
(
error
)
{}
}
}
}
</
script
>
<
style
lang=
'less'
>
@import "./app-panel-field.less";
</
style
>
\ No newline at end of file
src/components/app-panel-item/app-panel-item.vue
浏览文件 @
1143c3c5
<
template
>
<div
:class=
"classes"
>
<div
v-if=
"Object.is(labelPos,'NONE') || !labelPos"
class=
"editor"
>
<div
:class=
"valueCheck == true ?'':'editorStyle'"
>
<slot
></slot>
</div>
</div>
<div
v-if=
"!Object.is(labelPos,'NONE')"
class=
"app-panel-item-label"
>
<span
v-if=
"required"
style=
"color:red;"
>
*
</span>
{{
isEmptyCaption
?
''
:
caption
}}
</div>
<div
v-if=
"Object.is(labelPos,'BOTTOM') || Object.is(labelPos,'TOP') || Object.is(labelPos,'LEFT') || Object.is(labelPos,'RIGHT')"
class=
"editor"
>
<div
:class=
"valueCheck == true ?'':'editorStyle'"
>
<slot
></slot>
<div>
<div
v-if=
"Object.is(itemType,'BUTTON')"
>
<Button
type=
"primary"
long
@
click=
"onClick"
>
<i
v-if=
"icon"
:class=
"icon"
></i>
<span
v-if=
"showCaption"
>
{{
caption
?
caption
:
''
}}
</span>
</Button>
</div>
<div
v-if=
"Object.is(itemType,'RAWITEM')"
>
<i
v-if=
"icon"
:class=
"icon"
></i>
<span
v-if=
"showCaption"
style=
"padding-right: 10px;"
>
{{
caption
?
caption
:
''
}}
</span>
<slot></slot>
</div>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Prop
,
Watch
}
from
"vue-property-decorator"
;
@
Component
({})
export
default
class
AppPanelItem
extends
Vue
{
/**
* 名称
*
* @type {string}
* @memberof AppPanelItem
*/
@
Prop
()
public
caption
!
:
string
;
export
default
class
AppPanelButton
extends
Vue
{
/**
* 错误信息
* 面板成员类型
*
* @type {string}
* @memberof AppPanelItem
*/
@
Prop
()
public
error
?:
string
;
/**
* 标签位置
*
* @type {(string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP')}
* @memberof AppPanelItem
*/
@
Prop
()
public
labelPos
?:
|
string
|
"BOTTOM"
|
"LEFT"
|
"NONE"
|
"RIGHT"
|
"TOP"
;
/**
* 标签是否空白
*
* @type {boolean}
* @memberof AppPanelItem
* @memberof AppPanelButton
*/
@
Prop
()
public
isEmptyCaption
?:
boolean
;
@
Prop
()
public
itemType
!
:
string
;
/**
* 列表项名称
* 图标
*
* @type {string}
* @memberof AppPanelItem
*/
@
Prop
()
public
name
!
:
string
;
/**
* 面板数据
*
* @type {any}
* @memberof AppPanelItem
* @memberof AppPanelButton
*/
@
Prop
()
public
data
!
:
any
;
@
Prop
()
public
icon
?:
string
;
/**
* 编辑器值
*
* @type {any}
* @memberof AppPanelItem
*/
@
Prop
()
public
value
!
:
any
;
/**
* 值规则
* 标题
*
* @type {string}
* @memberof AppPanelItem
* @memberof AppPanelButton
*/
@
Prop
()
public
itemRules
!
:
any
;
@
Prop
()
public
caption
?:
string
;
/**
* 是否必填
* 显示标题
*
* @type {boolean}
* @memberof AppPanelItem
* @memberof AppPanelButton
*/
public
required
:
boolean
=
false
;
@
Prop
()
public
showCaption
?:
boolean
;
/**
* 值规则数组
* 点击按钮
*
* @type {any[]}
* @memberof AppPanelItem
* @param {*} $event
* @memberof AppPanelButton
*/
public
rules
:
any
[]
=
[];
/**
* 值规则监控
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppPanelItem
*/
@
Watch
(
"itemRules"
,
{
deep
:
true
})
onItemRulesChange
(
newVal
:
any
,
oldVal
:
any
)
{
if
(
newVal
)
{
try
{
this
.
rules
=
[];
const
_rules
:
any
[]
=
newVal
;
this
.
rules
=
[...
_rules
];
this
.
rules
.
some
((
rule
:
any
)
=>
{
if
(
rule
.
hasOwnProperty
(
"required"
))
{
this
.
required
=
rule
.
required
;
return
true
;
}
return
false
;
});
}
catch
(
error
)
{}
}
}
/**
* 编辑器样式
*
* @type {boolean}
* @memberof AppPanelItem
*/
public
valueCheck
:
boolean
=
true
;
/**
* 编辑器值监控
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppPanelItem
*/
@
Watch
(
"value"
)
ItemValueRules
(
newVal
:
any
,
oldVal
:
any
)
{
if
(
this
.
required
&&
!
newVal
)
{
this
.
valueCheck
=
false
;
}
else
{
this
.
valueCheck
=
true
;
}
public
onClick
(
$event
:
any
){
this
.
$emit
(
'onClick'
,
$event
);
}
/**
* 计算样式
*
* @readonly
* @type {string []}
* @memberof AppPanelItem
*/
get
classes
():
string
[]
{
let
posClass
=
""
;
switch
(
this
.
labelPos
)
{
case
"TOP"
:
posClass
=
"label-top"
;
break
;
case
"LEFT"
:
posClass
=
"label-left"
;
break
;
case
"BOTTOM"
:
posClass
=
"label-bottom"
;
break
;
case
"RIGHT"
:
posClass
=
"label-right"
;
break
;
case
"NONE"
:
posClass
=
"label-none"
;
break
;
}
return
[
"app-panel-item"
,
posClass
];
}
/**
* vue 生命周期
*
* @memberof AppPanelItem
*/
public
mounted
()
{
if
(
this
.
itemRules
)
{
try
{
const
_rules
:
any
[]
=
this
.
itemRules
;
this
.
rules
=
[...
_rules
];
this
.
rules
.
some
((
rule
:
any
)
=>
{
if
(
rule
.
hasOwnProperty
(
"required"
))
{
this
.
required
=
rule
.
required
;
return
true
;
}
return
false
;
});
}
catch
(
error
)
{}
}
}
}
</
script
>
<
style
lang=
'less'
>
@import "./app-panel-item.less";
</
style
>
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录