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
535bdddf
Commit
535bdddf
authored
Jul 19, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(demo): fix display problem of editable table with `apiSelect`
修复ApiSelect在可编辑表格中的显示问题
parent
18567e13
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
EditCellTable.vue
src/views/demo/table/EditCellTable.vue
+13
-1
EditRowTable.vue
src/views/demo/table/EditRowTable.vue
+13
-1
No files found.
src/views/demo/table/EditCellTable.vue
View file @
535bdddf
...
...
@@ -8,11 +8,12 @@
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
;
import
{
defineComponent
,
ref
}
from
'
vue
'
;
import
{
BasicTable
,
useTable
,
BasicColumn
}
from
'
/@/components/Table
'
;
import
{
optionsListApi
}
from
'
/@/api/demo/select
'
;
import
{
demoListApi
}
from
'
/@/api/demo/table
'
;
const
optionsData
=
ref
([]);
const
columns
:
BasicColumn
[]
=
[
{
title
:
'
输入框
'
,
...
...
@@ -87,6 +88,17 @@
resultField
:
'
list
'
,
labelField
:
'
name
'
,
valueField
:
'
id
'
,
onOptionsChange
(
options
)
{
optionsData
.
value
=
options
;
},
},
editValueMap
(
value
:
any
)
{
const
found
=
optionsData
.
value
.
find
((
option
)
=>
option
.
id
===
value
);
if
(
found
)
{
return
found
.
name
;
}
else
{
return
value
;
}
},
width
:
200
,
},
...
...
src/views/demo/table/EditRowTable.vue
View file @
535bdddf
...
...
@@ -20,6 +20,8 @@
import
{
optionsListApi
}
from
'
/@/api/demo/select
'
;
import
{
demoListApi
}
from
'
/@/api/demo/table
'
;
const
optionsData
=
ref
([]);
const
columns
:
BasicColumn
[]
=
[
{
title
:
'
输入框
'
,
...
...
@@ -98,6 +100,17 @@
resultField
:
'
list
'
,
labelField
:
'
name
'
,
valueField
:
'
id
'
,
onOptionsChange
(
options
)
{
optionsData
.
value
=
options
;
},
},
editValueMap
(
value
:
any
)
{
const
found
=
optionsData
.
value
.
find
((
option
)
=>
option
.
id
===
value
);
if
(
found
)
{
return
found
.
name
;
}
else
{
return
value
;
}
},
width
:
200
,
},
...
...
@@ -149,7 +162,6 @@
components
:
{
BasicTable
,
TableAction
},
setup
()
{
const
currentEditKeyRef
=
ref
(
''
);
const
[
registerTable
]
=
useTable
({
title
:
'
可编辑行示例
'
,
titleHelpMessage
:
[
...
...
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