Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
najiu-frontend
najiu-admin-template
Commits
aee61303
Commit
aee61303
authored
Jun 07, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(mock): remove third-party images
parent
d677729a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
25 deletions
+18
-25
table-demo.ts
mock/demo/table-demo.ts
+12
-0
CustomerCell.vue
src/views/demo/table/CustomerCell.vue
+6
-25
No files found.
mock/demo/table-demo.ts
View file @
aee61303
import
{
MockMethod
}
from
'
vite-plugin-mock
'
;
import
{
MockMethod
}
from
'
vite-plugin-mock
'
;
import
{
Random
}
from
'
mockjs
'
;
import
{
resultPageSuccess
}
from
'
../_util
'
;
import
{
resultPageSuccess
}
from
'
../_util
'
;
function
getRandomPics
(
count
=
10
):
string
[]
{
const
arr
:
string
[]
=
[];
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
arr
.
push
(
Random
.
image
(
'
800x600
'
,
Random
.
color
(),
Random
.
color
(),
Random
.
title
()));
}
return
arr
;
}
const
demoList
=
(()
=>
{
const
demoList
=
(()
=>
{
const
result
:
any
[]
=
[];
const
result
:
any
[]
=
[];
for
(
let
index
=
0
;
index
<
60
;
index
++
)
{
for
(
let
index
=
0
;
index
<
60
;
index
++
)
{
...
@@ -18,6 +27,9 @@ const demoList = (() => {
...
@@ -18,6 +27,9 @@ const demoList = (() => {
name6
:
'
@cname()
'
,
name6
:
'
@cname()
'
,
name7
:
'
@cname()
'
,
name7
:
'
@cname()
'
,
name8
:
'
@cname()
'
,
name8
:
'
@cname()
'
,
avatar
:
Random
.
image
(
'
400x400
'
,
Random
.
color
(),
Random
.
color
(),
Random
.
first
()),
imgArr
:
getRandomPics
(
Math
.
ceil
(
Math
.
random
()
*
3
)
+
1
),
imgs
:
getRandomPics
(
Math
.
ceil
(
Math
.
random
()
*
3
)
+
1
),
date
:
`@date('yyyy-MM-dd')`
,
date
:
`@date('yyyy-MM-dd')`
,
time
:
`@time('HH:mm')`
,
time
:
`@time('HH:mm')`
,
'
no|100000-10000000
'
:
100000
,
'
no|100000-10000000
'
:
100000
,
...
...
src/views/demo/table/CustomerCell.vue
View file @
aee61303
...
@@ -8,32 +8,12 @@
...
@@ -8,32 +8,12 @@
</Tag>
</Tag>
</
template
>
</
template
>
<
template
#avatar
="{
record
}"
>
<
template
#avatar
="{
record
}"
>
<Avatar
<Avatar
:size=
"60"
:src=
"record.avatar"
/>
:size=
"60"
:src=
"'http://api.btstu.cn/sjtx/api.php?lx=c1&format=images&id=' + record.id"
/>
</
template
>
</
template
>
<
template
#img
>
<
template
#img
="{
text
}"
>
<TableImg
<TableImg
:size=
"60"
:simpleShow=
"true"
:imgList=
"text"
/>
:size=
"60"
:simpleShow=
"true"
:imgList=
"[
'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png?1622962250222',
'https://picsum.photos/id/66/346/216',
'https://picsum.photos/id/67/346/216',
]"
/>
</
template
>
<
template
#imgs
>
<TableImg
:size=
"60"
:imgList=
"[
'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png?1622962250222',
'https://picsum.photos/id/66/346/216',
'https://picsum.photos/id/67/346/216',
]"
/>
</
template
>
</
template
>
<
template
#imgs
="{
text
}"
>
<TableImg
:size=
"60"
:imgList=
"text"
/>
</
template
>
<
template
#category
="{
record
}"
>
<
template
#category
="{
record
}"
>
<Tag
color=
"green"
>
<Tag
color=
"green"
>
...
@@ -75,7 +55,7 @@
...
@@ -75,7 +55,7 @@
},
},
{
{
title
:
'
图片列表1
'
,
title
:
'
图片列表1
'
,
dataIndex
:
'
img
'
,
dataIndex
:
'
img
Arr
'
,
helpMessage
:
[
'
这是简单模式的图片列表
'
,
'
只会显示一张在表格中
'
,
'
但点击可预览多张图片
'
],
helpMessage
:
[
'
这是简单模式的图片列表
'
,
'
只会显示一张在表格中
'
,
'
但点击可预览多张图片
'
],
width
:
140
,
width
:
140
,
slots
:
{
customRender
:
'
img
'
},
slots
:
{
customRender
:
'
img
'
},
...
@@ -109,6 +89,7 @@
...
@@ -109,6 +89,7 @@
setup
()
{
setup
()
{
const
[
registerTable
]
=
useTable
({
const
[
registerTable
]
=
useTable
({
title
:
'
自定义列内容
'
,
title
:
'
自定义列内容
'
,
titleHelpMessage
:
'
表格中所有头像、图片均为mock生成,仅用于演示图片占位
'
,
api
:
demoListApi
,
api
:
demoListApi
,
columns
:
columns
,
columns
:
columns
,
bordered
:
true
,
bordered
:
true
,
...
...
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