Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianzhuanghu
ant-design-pro-vue
Commits
8a85f1ed
Commit
8a85f1ed
authored
Sep 16, 2018
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: inner edit table delete func
parent
94fe1237
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
51 additions
and
161 deletions
+51
-161
App.vue
src/App.vue
+0
-1
TransferBar.vue
src/components/chart/TransferBar.vue
+6
-1
LayoutMain.vue
src/components/layout/LayoutMain.vue
+8
-8
MiniSiderMenu.vue
src/components/menu/MiniSiderMenu.vue
+0
-72
NavMenu.vue
src/components/menu/NavMenu.vue
+0
-37
SubMenu.vue
src/components/menu/SubMenu.vue
+0
-33
StandardTable.vue
src/components/table/StandardTable.vue
+4
-2
TableInnerEditList.vue
src/views/list/TableInnerEditList.vue
+24
-3
TableList.vue
src/views/list/TableList.vue
+1
-0
Index.vue
src/views/profile/basic/Index.vue
+8
-4
No files found.
src/App.vue
View file @
8a85f1ed
...
...
@@ -18,7 +18,6 @@
created
()
{
let
that
=
this
enquireScreen
(
deviceType
=>
{
console
.
log
(
'deviceType'
,
deviceType
)
// tablet
if
(
deviceType
===
0
)
{
that
.
$store
.
commit
(
'TOGGLE_DEVICE'
,
'tablet'
)
...
...
src/components/chart/TransferBar.vue
View file @
8a85f1ed
...
...
@@ -36,7 +36,12 @@
export
default
{
name
:
"Bar"
,
props
:
[
'title'
],
props
:
{
title
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{
data
:
[],
...
...
src/components/layout/LayoutMain.vue
View file @
8a85f1ed
<
template
>
<a-layout
class=
"layout"
>
<a-drawer
v-if=
"device === 'mobile'"
<a-drawer
v-if=
"device === 'mobile'"
wrapClassName=
"drawer-sider"
placement=
"left"
@
close=
"() => this.collapsed = false"
...
...
@@ -43,8 +44,8 @@
import
SiderMenu
from
'@/components/menu/SiderMenu'
import
LayoutHeader
from
'./LayoutHeader'
import
LayoutFooter
from
'./LayoutFooter'
import
{
asyncRouterMap
}
from
'@/router/index'
import
{
mapState
}
from
'vuex'
import
{
asyncRouterMap
}
from
'@/router/index'
import
{
mapState
}
from
'vuex'
export
default
{
name
:
"LayoutView"
,
...
...
@@ -53,7 +54,7 @@
LayoutHeader
,
LayoutFooter
},
data
()
{
data
()
{
return
{
// light, dark
menuTheme
:
'light'
,
...
...
@@ -63,10 +64,8 @@
menus
:
[]
}
},
created
()
{
created
()
{
this
.
menus
=
asyncRouterMap
console
.
log
(
this
.
collapsed
)
},
computed
:
{
...
mapState
({
...
...
@@ -76,7 +75,7 @@
})
},
methods
:
{
toggle
()
{
toggle
()
{
this
.
collapsed
=
!
this
.
collapsed
;
},
}
...
...
@@ -238,6 +237,7 @@
.table-alert
{
margin-bottom
:
16px
;
}
.content
{
.search
{
...
...
src/components/menu/MiniSiderMenu.vue
deleted
100644 → 0
View file @
94fe1237
<
template
>
<a-layout-sider
:class=
"['sider', isMobile ? null : 'shadow', theme ]"
width=
"256px"
:collapsible=
"collapsible"
v-model=
"collapsed"
:trigger=
"null"
>
<div
class=
"logo"
>
<router-link
:to=
"
{name:'dashboard'}">
<img
src=
"~@/assets/logo.svg"
alt=
"logo"
>
<h1>
Ant Design Pro
</h1>
</router-link>
</div>
<s-menu
:collapsed=
"collapsed"
:menu=
"menus"
:theme=
"theme"
@
select=
"onSelect"
:mode=
"mode"
style=
"padding: 16px 0px;"
></s-menu>
</a-layout-sider>
</
template
>
<
script
>
import
ALayoutSider
from
"ant-design-vue/es/layout/Sider"
import
SMenu
from
'./index'
export
default
{
name
:
"SiderMenu"
,
components
:
{
ALayoutSider
,
SMenu
},
props
:
{
mode
:
{
type
:
String
,
required
:
false
,
default
:
'inline'
},
theme
:
{
type
:
String
,
required
:
false
,
default
:
'dark'
},
collapsible
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
},
collapsed
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
},
menus
:
{
type
:
Array
,
required
:
true
}
},
created
()
{
},
computed
:
{
isMobile
()
{
return
this
.
$store
.
state
.
app
.
device
!==
'desktop'
}
},
methods
:
{
onSelect
(
obj
)
{
this
.
$emit
(
'menuSelect'
,
obj
)
}
}
}
</
script
>
\ No newline at end of file
src/components/menu/NavMenu.vue
deleted
100644 → 0
View file @
94fe1237
<
template
>
<a-menu
theme=
"dark"
mode=
"inline"
:defaultSelectedKeys=
"['1']"
>
<template
v-for=
"menu in menus"
>
<s-submenu
:menu=
"menu"
:key=
"menu.id"
></s-submenu>
</
template
>
</a-menu>
</template>
<
script
>
import
SubMenu
from
'./SubMenu'
import
{
asyncRouterMap
}
from
'../../router/index'
export
default
{
name
:
"NavMenu"
,
components
:
{
"s-submenu"
:
SubMenu
},
data
()
{
return
{
menus
:
[]
}
},
created
()
{
this
.
menus
=
asyncRouterMap
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
src/components/menu/SubMenu.vue
deleted
100644 → 0
View file @
94fe1237
<
template
>
<a-menu-item
:key=
"menu.id"
v-if=
"!menu.children && $router.matcher.match(
{ name: menu.permission }).matched.length">
<router-link
:to=
"
{ name: menu.name, params: { pageNo: '1' } }">
<a-icon
v-if=
"menu.meta.icon"
:type=
"menu.meta.icon"
></a-icon>
<span>
{{
menu
.
meta
.
title
}}
</span>
</router-link>
</a-menu-item>
<a-sub-menu
:key=
"menu.id"
v-else
>
<span
slot=
"title"
><a-icon
:type=
"menu.meta.icon"
v-if=
"menu.meta.icon"
/><span>
{{
menu
.
meta
.
title
}}
</span></span>
<template
v-for=
"submenu in menu.children"
>
<s-submenu
:key=
"submenu.id"
:menu=
"submenu"
></s-submenu>
</
template
>
</a-sub-menu>
</template>
<
script
>
import
SubMenu
from
'./SubMenu'
export
default
{
name
:
"SubMenu"
,
components
:
{
"s-submenu"
:
SubMenu
},
props
:
{
menu
:
{},
collapsed
:
{
type
:
Boolean
,
default
:
false
}
}
}
</
script
>
\ No newline at end of file
src/components/table/StandardTable.vue
View file @
8a85f1ed
...
...
@@ -94,10 +94,12 @@
default
:
'default'
},
rowKey
:
{
type
:
String
type
:
String
,
default
:
''
},
selectedRows
:
{
type
:
Array
type
:
Array
,
default
:
null
}
},
data
()
{
...
...
src/views/list/TableInnerEditList.vue
View file @
8a85f1ed
...
...
@@ -84,6 +84,7 @@
size=
"default"
:columns=
"columns"
:data=
"loadData"
:showAlertInfo=
"true"
:rowSelection=
"
{ selectedRowKeys: selectedRowKeys, onChange: onChange }"
>
<template
v-for=
"(col, index) in columns"
v-if=
"col.scopedSlots"
:slot=
"col.dataIndex"
slot-scope=
"text, record, index"
>
...
...
@@ -107,9 +108,9 @@
</a-popconfirm>
</span>
<span
v-else
>
<a
@
click=
"() => edit(record, index
)"
>
修改
</a>
<a
class=
"edit"
@
click=
"() => edit(record
)"
>
修改
</a>
<a-divider
type=
"vertical"
/>
<a
@
click=
"() => delete(record, index
)"
>
删除
</a>
<a
class=
"delete"
@
click=
"() => del(record
)"
>
删除
</a>
</span>
</div>
</
template
>
...
...
@@ -194,9 +195,29 @@
},
edit
(
row
)
{
row
.
editable
=
true
row
=
Object
.
assign
({},
row
)
//
row = Object.assign({}, row)
this
.
$refs
.
table
.
updateEdit
()
},
// eslint-disable-next-line
del
(
row
)
{
this
.
$confirm
({
title
:
'警告'
,
content
:
'真的要删除吗?'
,
okText
:
'删除'
,
okType
:
'danger'
,
cancelText
:
'取消'
,
onOk
()
{
console
.
log
(
'OK'
);
// 在这里调用删除接口
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(
Math
.
random
()
>
0.5
?
resolve
:
reject
,
1000
);
}).
catch
(()
=>
console
.
log
(
'Oops errors!'
));
},
onCancel
()
{
console
.
log
(
'Cancel'
);
},
});
},
save
(
row
)
{
delete
row
.
editable
this
.
$refs
.
table
.
updateEdit
()
...
...
src/views/list/TableList.vue
View file @
8a85f1ed
...
...
@@ -83,6 +83,7 @@
size=
"default"
:columns=
"columns"
:data=
"loadData"
:showAlertInfo=
"true"
:rowSelection=
"
{ selectedRowKeys: selectedRowKeys, onChange: onChange }"
>
<span
slot=
"action"
slot-scope=
"text, record"
>
...
...
src/views/profile/basic/Index.vue
View file @
8a85f1ed
...
...
@@ -19,13 +19,17 @@
<div
class=
"title"
>
退货商品
</div>
<s-table
style=
"margin-bottom: 24px"
:columns=
"goodsColumns"
:data=
"loadGoodsData"
>
style=
"margin-bottom: 24px"
:columns=
"goodsColumns"
:data=
"loadGoodsData"
>
</s-table>
<div
class=
"title"
>
退货进度
</div>
<s-table
style=
"margin-bottom: 24px"
:columns=
"scheduleColumns"
:data=
"loadScheduleData"
>
style=
"margin-bottom: 24px"
:columns=
"scheduleColumns"
:data=
"loadScheduleData"
>
<template
slot=
"status"
...
...
@@ -91,7 +95,7 @@
}
],
// 加载数据方法 必须为 Promise 对象
loadGoodsData
:
parameter
=>
{
loadGoodsData
:
()
=>
{
return
new
Promise
((
resolve
=>
{
resolve
({
data
:
[
...
...
@@ -166,7 +170,7 @@
key
:
'cost'
}
],
loadScheduleData
:
parameter
=>
{
loadScheduleData
:
()
=>
{
return
new
Promise
((
resolve
=>
{
resolve
({
data
:
[
...
...
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