Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Starter Web Vue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
product
kim3-web-vue
Starter Web Vue
Commits
df7f57d9
Commit
df7f57d9
authored
Jul 01, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 抽屉抽取
parent
091a6d45
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
207 additions
and
6 deletions
+207
-6
src/components/menu_tree/index.vue
src/components/menu_tree/index.vue
+0
-1
src/components/table/drawer.vue
src/components/table/drawer.vue
+69
-0
src/components/table/index.vue
src/components/table/index.vue
+3
-1
src/components/table/table.vue
src/components/table/table.vue
+99
-0
src/pages/system/view/role/form.vue
src/pages/system/view/role/form.vue
+9
-2
src/pages/user/components/message.vue
src/pages/user/components/message.vue
+27
-2
No files found.
src/components/menu_tree/index.vue
View file @
df7f57d9
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
checkable
checkable
:replaceFields=
"replaceFields"
:replaceFields=
"replaceFields"
:tree-data=
"treeData"
:tree-data=
"treeData"
style=
"max-height:400px"
class=
"tw-overflow-y-auto"
class=
"tw-overflow-y-auto"
:expandedKeys.sync=
"expandedKeys"
:expandedKeys.sync=
"expandedKeys"
v-bind=
"$attrs"
v-bind=
"$attrs"
...
...
src/components/table/drawer.vue
0 → 100644
View file @
df7f57d9
<
template
>
<a-drawer
placement=
"right"
:visible=
"visible"
:drawerStyle=
"drawerStyle"
:bodyStyle=
"bodyStyle"
destroyOnClose
v-bind=
"$attrs"
>
<div
class=
"tw-overflow-y-hidden"
>
<div
class=
"tw-overflow-y-auto tw-h-full"
>
<slot
/>
</div>
</div>
<template>
<a-divider
/>
<a-space>
<slot
name=
"footer"
>
<a-button
@
click=
"cancel"
>
取消
</a-button>
<a-button
type=
"primary"
@
click=
"ok"
:loading=
"loading"
>
确认
</a-button>
</slot>
</a-space>
</
template
>
</a-drawer>
</template>
<
script
>
export
default
{
props
:
{
oncancel
:
Function
,
onok
:
Function
,
},
data
()
{
return
{
visiable
:
false
,
loading
:
false
,
drawerStyle
:
{
display
:
'
flex
'
,
flexDirection
:
'
column
'
,
overflowY
:
'
hidden
'
,
},
bodyStyle
:
{
flex
:
1
,
overflow
:
'
hidden
'
,
display
:
'
flex
'
,
flexDirection
:
'
column
'
,
},
};
},
methods
:
{
show
()
{
this
.
visiable
=
true
;
},
hidden
()
{
this
.
visiable
=
false
;
},
cancel
()
{
this
.
oncancel
&&
this
.
oncancel
();
this
.
visiable
=
false
;
},
async
ok
()
{
this
.
loading
=
true
;
await
(
this
.
onok
&&
this
.
onok
());
this
.
loading
=
false
;
this
.
visiable
=
false
;
},
},
};
</
script
>
src/components/table/index.vue
View file @
df7f57d9
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
:width=
"(addBtn && addBtn.width) || 600"
:width=
"(addBtn && addBtn.width) || 600"
destroyOnClose
destroyOnClose
>
>
<div
class=
"tw-overflow-y-hidden"
>
<div
class=
"tw-overflow-y-hidden
tw-flex-1
"
>
<div
class=
"tw-overflow-y-auto tw-h-full"
>
<div
class=
"tw-overflow-y-auto tw-h-full"
>
<slot
name=
"drawer"
/>
<slot
name=
"drawer"
/>
</div>
</div>
...
@@ -179,6 +179,8 @@ export default {
...
@@ -179,6 +179,8 @@ export default {
add
()
{
add
()
{
this
.
addVisible
=
true
;
this
.
addVisible
=
true
;
this
.
type
=
0
;
this
.
noFooter
=
false
;
},
},
addDrawerClose
()
{
addDrawerClose
()
{
this
.
addVisible
=
false
;
this
.
addVisible
=
false
;
...
...
src/components/table/table.vue
0 → 100644
View file @
df7f57d9
<
template
>
<div>
<my-card
v-if=
"$scopedSlots.search"
>
<a-form-model
:model=
"queryForm"
layout=
"horizontal"
>
<a-row
:gutter=
"16"
>
<slot
name=
"search"
:query=
"queryForm"
/>
</a-row>
</a-form-model>
<div
class=
"tw-text-right tw-mt-2"
>
<a-space>
<a-button
@
click=
"reset"
>
重置
</a-button>
<a-button
type=
"primary"
@
click=
"getData"
>
查询
</a-button>
</a-space>
</div>
</my-card>
<my-card
class=
"tw-mt-3"
>
<a-space
class=
"tw-mb-2.5"
>
<slot
name=
"action"
/>
</a-space>
<a-table
:data-source=
"data"
:loading=
"loading"
v-bind=
"$attrs"
:pagination=
"pagination"
@
change=
"pageChange"
>
<slot
/>
</a-table>
</my-card>
</div>
</
template
>
<
script
>
import
{
request
,
METHOD
}
from
'
@/utils/requestUtil
'
;
const
initQuery
=
{
pageSize
:
10
,
pageNum
:
1
,
};
export
default
{
props
:
{
url
:
String
,
},
data
()
{
return
{
initQuery
:
{
...
initQuery
,
},
data
:
[],
queryForm
:
{},
loading
:
false
,
total
:
0
,
};
},
mounted
()
{
this
.
getData
();
},
computed
:
{
pagination
()
{
return
{
current
:
this
.
initQuery
.
pageNum
,
pageSize
:
this
.
initQuery
.
pageSize
,
total
:
this
.
total
,
showQuickJumper
:
true
,
};
},
},
methods
:
{
async
getData
()
{
this
.
loading
=
true
;
try
{
await
this
.
getDataWithPage
();
}
catch
(
error
)
{
// todo
}
this
.
loading
=
false
;
},
async
getDataWithPage
()
{
const
res
=
await
request
(
this
.
url
,
METHOD
.
GET
,
{
...
this
.
initQuery
,
...
this
.
queryForm
});
this
.
total
=
res
.
total
;
if
(
this
.
formatData
)
this
.
data
=
this
.
formatData
(
res
);
else
this
.
data
=
res
.
records
;
},
pageChange
(
page
)
{
this
.
initQuery
.
pageNum
=
page
.
current
;
this
.
getData
();
},
},
};
</
script
>
src/pages/system/view/role/form.vue
View file @
df7f57d9
...
@@ -38,10 +38,17 @@ export default {
...
@@ -38,10 +38,17 @@ export default {
defaultCheckedKeys
:
[],
defaultCheckedKeys
:
[],
};
};
},
},
computed
:
{},
methods
:
{
methods
:
{
submit
()
{
submit
()
{
const
query
=
{
...
this
.
form
,
functionAuthority
:
this
.
checkedKeys
.
map
(
i
=>
i
.
toString
())
};
const
query
=
{
...
this
.
form
,
authorityList
:
this
.
$refs
[
'
menuTree
'
].
get
().
map
(
i
=>
({
...
i
,
nodeId
:
i
.
menuId
,
parentNodeId
:
i
.
parentMenuId
,
nodeType
:
i
.
menuType
,
})),
};
return
this
.
isEdit
?
updateRoleApi
(
query
)
:
addRoleApi
(
query
);
return
this
.
isEdit
?
updateRoleApi
(
query
)
:
addRoleApi
(
query
);
},
},
setData
(
data
,
type
)
{
setData
(
data
,
type
)
{
...
...
src/pages/user/components/message.vue
View file @
df7f57d9
<
template
>
<
template
>
<my-table
url=
"/api/v1/messages/notice"
>
<my-table
url=
"/api/v1/messages/notices"
>
<template
#search
="
{query}">
<my-form-item
label=
"开始时间"
>
<a-date-picker
class=
"tw-w-full"
show-time
v-model=
"query.startTime"
valueFormat=
"YYYY-MM-DD HH:mm:ss"
/>
</my-form-item>
<my-form-item
label=
"结束时间"
>
<a-date-picker
class=
"tw-w-full"
show-time
v-model=
"query.endTime"
valueFormat=
"YYYY-MM-DD HH:mm:ss"
/>
</my-form-item>
<my-form-item
label=
"是否已读"
>
<a-select
v-model=
"query.isRead"
allowClear
>
<a-select-option
:value=
"1"
>
已读
</a-select-option>
<a-select-option
:value=
"0"
>
未读
</a-select-option>
</a-select>
</my-form-item>
</
template
>
<a-table-column
title=
"标题"
data-index=
"noticeTitle"
/>
<a-table-column
title=
"标题"
data-index=
"noticeTitle"
/>
<a-table-column
title=
"内容"
data-index=
"noticeContent"
/>
<a-table-column
title=
"内容"
data-index=
"noticeContent"
/>
<a-table-column
title=
"创建时间"
data-index=
"createTime"
/>
<a-table-column
title=
"创建时间"
data-index=
"createTime"
/>
<a-table-column
title=
"发送者"
data-index=
"noticeSenderName"
/>
<a-table-column
title=
"发送者"
data-index=
"noticeSenderName"
/>
<a-table-column
title=
"接受者"
data-index=
"noticeReceiverName"
/>
<a-table-column
title=
"接受者"
data-index=
"noticeReceiverName"
/>
<a-table-column
title=
"是否已读"
data-index=
"isReadName"
/>
<a-table-column
title=
"是否已读"
data-index=
"isReadName"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment