Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
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
李俊赕
self-support
Commits
9164eccf
Commit
9164eccf
authored
Jun 22, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文档补充
parent
b6fed07b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
38 deletions
+47
-38
index.md
src/components/select-parts/index.md
+47
-38
No files found.
src/components/select-parts/index.md
View file @
9164eccf
## 配件组件使用说明
```
该组件用于
仓库配件的选择与
数量调整
该组件用于
备件申请,
数量调整
```
## API
...
...
@@ -11,20 +11,22 @@
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :---------: | :-----: | :----: | :--------: | :---------------------: |
| showChecked | Boolean | false | true/false | 是否需要复选框 |
| disabled | Boolean | true | true/false | 是否禁用 |
| info | Object | {} | - | 列表数据
**格式见下文**
|
### lists 格式
```
json
{
"name"
:
"正泰漏保"
,
//
配件名称
"num"
:
1
,
//
配件数量
"min"
:
1
,
//
数量最小值
"max"
:
100
,
//
数量最大值
"desc"
:
"NO.202006170015"
,
//
描述
"img"
:
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
//
图片地址
"checked"
:
false
//
勾选状态,如果需要回显勾选状态需传
id
:
1
,
name
:
"正泰漏保"
,
//
名称
no
:
'NO.
202006170015
'
,
//
编号
desc
:
'这个空开盒子和其他的空开有什么不一样,这里可以写一下'
,
//
描述
num
:
1
,
//
默认数量
min
:
1
,
//
数量最小值
max
:
100
,
//
数量最大值
img
:
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
//
图片
checked
:
false
,
//
是否勾选
disabled
:
true
//
是否禁用数量调整,如果禁用则会显示添加申请按钮
}
```
...
...
@@ -34,6 +36,7 @@
| :-----------: | :----------: | :--------: |
| @numChange | 数量发生改变 | 改变的数量 |
| @selectChange | 勾选发生改变 | 勾选的状态 |
| @apply | 点击添加申请 | 无 |
## 组件用法
...
...
@@ -41,12 +44,13 @@
```
html
<select-parts
v-for=
"(item, index) in lists"
v-for=
"(item, index) in lists"
:key=
"index"
:info=
"item"
:show-checked=
"true"
@
numChange=
"numChange"
@
selectChange=
"selectChange"
:show-checked=
"false"
@
numChange=
"numChange($event, index)"
@
selectChange=
"selectChange($event, index)"
@
apply=
"apply(index)"
></select-parts>
```
...
...
@@ -60,36 +64,41 @@ export default {
return
{
lists
:
[
{
id
:
1
,
name
:
"正泰漏保"
,
desc
:
"NO.202006170015"
,
num
:
1
,
min
:
1
,
max
:
100
,
img
:
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
checked
:
false
,
},
{
id
:
2
,
name
:
"挚达广汽充电桩"
,
desc
:
"NO.202006170014"
,
num
:
3
,
min
:
1
,
max
:
5
,
img
:
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
checked
:
false
,
},
id
:
1
,
name
:
"正泰漏保"
,
no
:
'NO.202006170015'
,
desc
:
'这个空开盒子和其他的空开有什么不一样,这里可以写一下'
,
num
:
1
,
min
:
1
,
max
:
100
,
img
:
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
checked
:
false
,
disabled
:
true
},
{
id
:
1
,
name
:
"挚达广汽充电桩"
,
no
:
'NO.202006170014'
,
desc
:
'这个空开盒子和其他的空开有什么不一样,这里可以写一下'
,
num
:
3
,
min
:
1
,
max
:
5
,
img
:
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
checked
:
false
,
disabled
:
true
},
],
}
},
methods
:
{
numChange
(
val
)
{
console
.
log
(
"val"
,
val
)
apply
(
index
)
{
// 添加申请
this
.
$set
(
this
.
lists
[
index
],
'disabled'
,
false
)
},
numChange
(
val
,
index
)
{
// 设置数量
this
.
$set
(
this
.
lists
[
index
],
'num'
,
val
)
},
selectChange
(
val
)
{
console
.
log
(
"val"
,
val
)
selectChange
(
val
,
index
)
{
// 设置勾选状态
this
.
$set
(
this
.
lists
[
index
],
'checked'
,
val
)
},
},
}
...
...
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