Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
a254c334
Commit
a254c334
authored
Apr 16, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
5d7e8582
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
22 deletions
+76
-22
iview-admin/.eslintrc.js
+1
-1
iview-admin/src/components/tables/tables.vue
+0
-0
iview-admin/src/config/index.js
+1
-1
iview-admin/src/view/components/tables/forms/forms.vue
+68
-0
iview-admin/src/view/components/tables/tables.vue
+6
-20
No files found.
iview-admin/.eslintrc.js
View file @
a254c334
...
@@ -2,7 +2,7 @@ module.exports = {
...
@@ -2,7 +2,7 @@ module.exports = {
root
:
true
,
root
:
true
,
'extends'
:
[
'extends'
:
[
'plugin:vue/essential'
,
'plugin:vue/essential'
,
'@vue/standard'
//
'@vue/standard'
],
],
rules
:
{
rules
:
{
// allow async-await
// allow async-await
...
...
iview-admin/src/components/tables/tables.vue
View file @
a254c334
This diff is collapsed.
Click to expand it.
iview-admin/src/config/index.js
View file @
a254c334
...
@@ -17,7 +17,7 @@ export default {
...
@@ -17,7 +17,7 @@ export default {
* @description api请求基础路径
* @description api请求基础路径
*/
*/
baseUrl
:
{
baseUrl
:
{
dev
:
'http
s://www.easy-mock.com/mock/5add9213ce4d0e69998a6f51/iview-admin
/'
,
dev
:
'http
://t9.com:8000
/'
,
pro
:
'https://produce.com'
pro
:
'https://produce.com'
},
},
/**
/**
...
...
iview-admin/src/view/components/tables/forms/forms.vue
0 → 100644
View file @
a254c334
<
template
>
<div>
<Card>
<Form
ref=
"formInline"
:model=
"formInline"
:rules=
"ruleInline"
inline
>
<FormItem
prop=
"user"
>
<Input
type=
"text"
v-model=
"formInline.user"
placeholder=
"Username"
>
<Icon
type=
"ios-person-outline"
slot=
"prepend"
></Icon>
</Input>
</FormItem>
<FormItem
prop=
"password"
>
<Input
type=
"password"
v-model=
"formInline.password"
placeholder=
"Password"
>
<Icon
type=
"ios-lock-outline"
slot=
"prepend"
></Icon>
</Input>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit('formInline')"
>
Signin
</Button>
</FormItem>
</Form>
</Card>
</div>
</
template
>
<
script
>
// import { getTableData } from '@/api/data'
export
default
{
name
:
'forms'
,
components
:
{
},
data
()
{
return
{
columns
:
[
{
title
:
'Name'
,
key
:
'name'
,
sortable
:
true
},
{
title
:
'Email'
,
key
:
'email'
,
editable
:
true
},
{
title
:
'Create-Time'
,
key
:
'createTime'
},
{
title
:
'Handle'
,
key
:
'handle'
,
options
:
[
'delete'
],
button
:
[
{
title
:
"编辑"
,
type
:
"text"
,
icon
:
""
,
key
:
"edit"
},
{
title
:
"启用"
,
type
:
"text"
,
icon
:
""
,
key
:
"enable"
},
]
}
],
tableData
:
[]
}
},
methods
:
{
handleDelete
(
params
)
{
console
.
log
(
params
)
},
exportExcel
()
{
this
.
$refs
.
tables
.
exportCsv
({
filename
:
`table-
${(
new
Date
()).
valueOf
()}
.csv`
})
}
},
mounted
()
{
getTableData
().
then
(
res
=>
{
this
.
tableData
=
res
.
data
})
}
}
</
script
>
<
style
>
</
style
>
iview-admin/src/view/components/tables/tables.vue
View file @
a254c334
<
template
>
<
template
>
<div>
<div>
<Card>
<Card>
<tables
ref=
"tables"
editable
searchable
search-place=
"top"
v-model=
"tableData"
:columns=
"columns"
@
on-
delete=
"handleDelete
"
/>
<tables
ref=
"tables"
editable
searchable
search-place=
"top"
v-model=
"tableData"
:columns=
"columns"
@
on-
exec=
"doexec
"
/>
<Button
style=
"margin: 10px 0;"
type=
"primary"
@
click=
"exportExcel"
>
导出为Csv文件
</Button>
<Button
style=
"margin: 10px 0;"
type=
"primary"
@
click=
"exportExcel"
>
导出为Csv文件
</Button>
</Card>
</Card>
</div>
</div>
...
@@ -24,24 +24,10 @@ export default {
...
@@ -24,24 +24,10 @@ export default {
{
{
title
:
'Handle'
,
title
:
'Handle'
,
key
:
'handle'
,
key
:
'handle'
,
options
:
[
'delete'
],
button
:
[
button
:
[
(
h
,
params
,
vm
)
=>
{
{
title
:
"删除"
,
type
:
"text"
,
icon
:
"md-trash"
,
key
:
"delete"
},
return
h
(
'Poptip'
,
{
{
title
:
"编辑"
,
type
:
"text"
,
icon
:
""
,
key
:
"edit"
},
props
:
{
{
title
:
"启用"
,
type
:
"text"
,
icon
:
""
,
key
:
"enable"
},
confirm
:
true
,
title
:
'你确定要删除吗?'
},
on
:
{
'on-ok'
:
()
=>
{
vm
.
$emit
(
'on-delete'
,
params
)
vm
.
$emit
(
'input'
,
params
.
tableData
.
filter
((
item
,
index
)
=>
index
!==
params
.
row
.
initRowIndex
))
}
}
},
[
h
(
'Button'
,
'自定义删除'
)
])
}
]
]
}
}
],
],
...
@@ -49,8 +35,8 @@ export default {
...
@@ -49,8 +35,8 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
handleDelete
(
params
)
{
doexec
(
key
,
row
)
{
console
.
log
(
params
)
console
.
log
(
key
,
row
)
},
},
exportExcel
()
{
exportExcel
()
{
this
.
$refs
.
tables
.
exportCsv
({
this
.
$refs
.
tables
.
exportCsv
({
...
...
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