Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
f78b0240
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
9 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f78b0240
编写于
4月 29, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch show checkbox for tree nodes or not
上级
83ce73af
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
9 deletion
+27
-9
ui/src/locales/en-US.ts
ui/src/locales/en-US.ts
+2
-0
ui/src/locales/zh-CN.ts
ui/src/locales/zh-CN.ts
+2
-0
ui/src/views/script/component/tree.vue
ui/src/views/script/component/tree.vue
+23
-9
未找到文件。
ui/src/locales/en-US.ts
浏览文件 @
f78b0240
...
...
@@ -146,6 +146,8 @@ export default {
'
expand_all
'
:
'
Expand
'
,
'
collapse_all
'
:
'
Collapse
'
,
'
show_checkbox
'
:
'
Show Checkbox
'
,
'
hide_checkbox
'
:
'
Hide Checkbox
'
,
'
wrong_url
'
:
'
Please input right ZenTao URL.
'
,
'
delete_success
'
:
'
Delete successfully.
'
,
'
ws_conn_success
'
:
'
Connect to WebSocket successfully.
'
,
...
...
ui/src/locales/zh-CN.ts
浏览文件 @
f78b0240
...
...
@@ -145,6 +145,8 @@ export default {
'
expand_all
'
:
'
展开
'
,
'
collapse_all
'
:
'
收缩
'
,
'
show_checkbox
'
:
'
显示选择框
'
,
'
hide_checkbox
'
:
'
隐藏选择框
'
,
'
wrong_url
'
:
'
请输入正确的的URL地址,以http或https开头。
'
,
'
delete_success
'
:
'
删除成功
'
,
'
ws_conn_success
'
:
'
WebSocket连接成功。
'
,
...
...
ui/src/views/script/component/tree.vue
浏览文件 @
f78b0240
...
...
@@ -32,10 +32,15 @@
</div>
<div
class=
"right"
>
<a-button
@
click=
"expandAll"
type=
"link"
>
<a-button
@
click=
"expandAll
OrNot
"
type=
"link"
>
<span
v-if=
"!isExpand"
>
{{ t('expand_all') }}
</span>
<span
v-if=
"isExpand"
>
{{ t('collapse_all') }}
</span>
</a-button>
<a-button
@
click=
"showCheckboxOrNot"
type=
"link"
>
<span
v-if=
"!showCheckbox"
>
{{ t('show_checkbox') }}
</span>
<span
v-if=
"showCheckbox"
>
{{ t('hide_checkbox') }}
</span>
</a-button>
</div>
</div>
...
...
@@ -49,7 +54,7 @@
v-model:checkedKeys=
"checkedKeys"
:replace-fields=
"replaceFields"
checkable
:checkable=
"showCheckbox"
@
expand=
"expandNode"
@
select=
"selectNode"
@
check=
"checkNode"
...
...
@@ -291,13 +296,13 @@ export default defineComponent({
if
(
filerValue
.
value
.
length
===
0
)
initData
()
const
expandedKeys
=
ref
<
string
[]
>
([]);
const
getOpenKeys
=
(
treeNode
,
isAll
)
=>
{
const
getOpenKeys
=
(
treeNode
:
any
,
openAll
:
boolean
)
=>
{
// expand top one level if openAll is false
if
(
!
treeNode
)
return
expandedKeys
.
value
.
push
(
treeNode
.
path
)
if
(
treeNode
.
children
&&
is
All
)
{
if
(
treeNode
.
children
&&
open
All
)
{
treeNode
.
children
.
forEach
((
item
,
index
)
=>
{
getOpenKeys
(
item
,
is
All
)
getOpenKeys
(
item
,
open
All
)
})
}
...
...
@@ -312,6 +317,7 @@ export default defineComponent({
};
let
isExpand
=
ref
(
false
);
let
showCheckbox
=
ref
(
false
)
let
tree
=
ref
(
null
)
...
...
@@ -402,16 +408,22 @@ export default defineComponent({
console
.
log
(
'
expandNode
'
)
setExpandedKeys
(
currSite
.
value
.
id
,
currProduct
.
value
.
id
,
expandedKeys
.
value
)
}
const
expandAll
=
(
e
)
=>
{
console
.
log
(
'
expandAll
'
)
const
expandAll
OrNot
=
(
e
)
=>
{
console
.
log
(
'
expandAll
OrNot
'
)
isExpand
.
value
=
!
isExpand
.
value
expandedKeys
.
value
=
[]
if
(
isExpand
.
value
)
getOpenKeys
(
treeData
.
value
[
0
],
true
)
else
getOpenKeys
(
treeData
.
value
[
0
],
false
)
setExpandedKeys
(
currSite
.
value
.
id
,
currProduct
.
value
.
id
,
expandedKeys
.
value
)
}
const
showCheckboxOrNot
=
(
e
)
=>
{
console
.
log
(
'
showCheckboxOrNot
'
)
showCheckbox
.
value
=
!
showCheckbox
.
value
}
const
nodeMap
=
{}
const
getNodeMap
=
(
node
):
void
=>
{
if
(
!
node
)
return
...
...
@@ -470,7 +482,9 @@ export default defineComponent({
checkoutCases
,
checkinCases
,
isExpand
,
expandAll
,
showCheckbox
,
expandAllOrNot
,
showCheckboxOrNot
,
tree
,
expandedKeys
,
selectedKeys
,
...
...
@@ -530,7 +544,7 @@ export default defineComponent({
}
.right {
width:
6
0px;
width:
12
0px;
text-align: center;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录