Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
ac8f8271
提交
ac8f8271
authored
3月 15, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 新增树表格
上级
8d911cd4
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
126 行增加
和
22 行删除
+126
-22
index.vue
frontend/src/components/business/tree-table/index.vue
+90
-0
index.vue
frontend/src/views/system/dept/index.vue
+36
-22
index.vue
frontend/src/views/system/menu/index.vue
+0
-0
没有找到文件。
frontend/src/components/business/tree-table/index.vue
0 → 100644
浏览文件 @
ac8f8271
<
template
>
<div
class=
"complex-table"
>
<div
v-if=
"$slots.header || header"
class=
"complex-table__header"
>
<slot
name=
"header"
>
{{
header
}}
</slot>
</div>
<div
v-if=
"$slots.toolbar || searchConfig"
class=
"complex-table__toolbar"
>
<slot
name=
"toolbar"
>
<fu-search-bar
v-bind=
"searchConfig"
@
exec=
"search"
>
<slot
name=
"buttons"
/>
<fu-table-column-select
:columns=
"columns"
/>
</fu-search-bar>
</slot>
</div>
<div
class=
"complex-table__body"
>
<slot
/>
<!--
<fu-table
ref=
"table"
v-bind=
"$attrs"
:columns=
"columns"
:local-key=
"localKey"
v-on=
"$listeners"
>
<slot
/>
</fu-table>
-->
</div>
<div
v-if=
"$slots.pagination || paginationConfig"
class=
"complex-table__pagination"
>
<slot
name=
"pagination"
>
<fu-table-pagination
:current-page
.
sync=
"paginationConfig.currentPage"
:page-size
.
sync=
"paginationConfig.pageSize"
v-bind=
"paginationConfig"
@
change=
"search"
/>
</slot>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'TreeTable'
,
props
:
{
columns
:
{
type
:
Array
,
default
:
()
=>
[]
},
// eslint-disable-next-line vue/require-default-prop
localKey
:
String
,
// 如果需要记住选择的列,则这里添加一个唯一的Key
// eslint-disable-next-line vue/require-default-prop
header
:
String
,
// eslint-disable-next-line vue/require-default-prop
searchConfig
:
Object
,
// eslint-disable-next-line vue/require-default-prop
paginationConfig
:
Object
},
data
()
{
return
{
condition
:
{}
}
},
methods
:
{
search
(
condition
,
e
)
{
if
(
condition
)
{
this
.
condition
=
condition
}
this
.
$emit
(
'search'
,
this
.
condition
,
e
)
}
}
}
</
script
>
<
style
lang=
"scss"
>
@import
"~@/styles/mixin.scss"
;
@import
"~@/styles/variables.scss"
;
.complex-table
{
.complex-table__header
{
@include
flex-row
(
flex-start
,
center
);
height
:
60px
;
font-size
:
20px
;
}
.complex-table__toolbar
{
@include
flex-row
(
flex-end
,
center
);
}
.complex-table__pagination
{
margin-top
:
20px
;
@include
flex-row
(
flex-end
);
}
}
</
style
>
frontend/src/views/system/dept/index.vue
浏览文件 @
ac8f8271
<
template
>
<layout-content
v-loading=
"$store.getters.loadingMap[$store.getters.currentPath]"
>
<complex-table
<
!--
<
complex-table
ref=
"table"
:data=
"tableData"
:lazy=
"isLazy"
...
...
@@ -15,15 +15,31 @@
:default-expand-all="isTableExpand"
row-key="deptId"
@search="search"
> -->
<tree-table
:columns=
"columns"
:buttons=
"buttons"
:header=
"header"
:search-config=
"searchConfig"
@
search=
"search"
>
<template
#
buttons
>
<fu-table-button
icon=
"el-icon-circle-plus-outline"
:label=
"$t('organization.create')"
@
click=
"create"
/>
</
template
>
<!-- <el-table-column type="selection" fix /> -->
<el-table-column
label=
"名称"
prop=
"name"
/>
<el-table-column
label=
"下属组织数"
prop=
"subCount"
/>
<!-- <el-table-column label="状态" align="center" prop="enabled">
<el-table
ref=
"table"
:data=
"tableData"
lazy
:load=
"loadExpandDatas"
style=
"width: 100%"
:tree-props=
"{children: 'children', hasChildren: 'hasChildren'}"
row-key=
"deptId"
>
<!-- <el-table-column type="selection" fix /> -->
<el-table-column
label=
"名称"
prop=
"name"
/>
<el-table-column
label=
"下属组织数"
prop=
"subCount"
/>
<!-- <el-table-column label="状态" align="center" prop="enabled">
<template slot-scope="scope">
<el-switch
v-model="scope.row.enabled"
...
...
@@ -34,14 +50,16 @@
/>
</template>
</el-table-column> -->
<el-table-column
prop=
"createTime"
label=
"创建日期"
>
<
template
v-slot:default=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
timestampFormatDate
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"createTime"
label=
"创建日期"
>
<
template
v-slot:default=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
timestampFormatDate
}}
</span>
</
template
>
</el-table-column>
<fu-table-operations
:buttons=
"buttons"
label=
"操作"
fix
/>
</complex-table>
<fu-table-operations
:buttons=
"buttons"
label=
"操作"
fix
/>
</el-table>
</tree-table>
<!-- </complex-table> -->
<!-- add organization form -->
<el-dialog
...
...
@@ -106,7 +124,7 @@
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
import
ComplexTable
from
'@/components/business/complex
-table'
import
TreeTable
from
'@/components/business/tree
-table'
import
Treeselect
from
'@riophae/vue-treeselect'
import
{
formatCondition
}
from
'@/utils/index'
import
'@riophae/vue-treeselect/dist/vue-treeselect.css'
...
...
@@ -118,7 +136,7 @@ export default {
name
:
'MsOrganization'
,
components
:
{
LayoutContent
,
Complex
Table
,
Tree
Table
,
Treeselect
},
data
()
{
...
...
@@ -168,11 +186,7 @@ export default {
]
},
paginationConfig
:
{
currentPage
:
1
,
pageSize
:
10
,
total
:
0
},
defaultCondition
:
{
field
:
'pid'
,
operator
:
'eq'
,
...
...
@@ -271,7 +285,7 @@ export default {
},
// 加载表格数据
search
(
condition
)
{
this
.
setTableAttr
()
//
this.setTableAttr()
this
.
tableData
=
[]
let
param
=
{}
if
(
condition
&&
condition
.
quick
)
{
...
...
@@ -293,7 +307,7 @@ export default {
if
(
condition
&&
condition
.
quick
)
{
data
=
this
.
buildTree
(
data
)
this
.
setTableAttr
(
true
)
//
this.setTableAttr(true)
}
this
.
tableData
=
data
this
.
depts
=
null
...
...
frontend/src/views/system/menu/index.vue
浏览文件 @
ac8f8271
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论