Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
car-database-web
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
中汽研标准应用数据库
car-database-web
Commits
c064cea1
Commit
c064cea1
authored
Apr 15, 2025
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改修改保存bug,增加单选填空上传组件
parent
d1674991
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
215 additions
and
4 deletions
+215
-4
checkInputUpload.vue
src/components/CheckCoiumns/checkInputUpload.vue
+3
-0
checkbox.vue
src/components/CheckCoiumns/checkbox.vue
+1
-1
index.js
src/components/CheckCoiumns/index.js
+2
-0
inputUpload.vue
src/components/CheckCoiumns/inputUpload.vue
+3
-0
radio.vue
src/components/CheckCoiumns/radio.vue
+4
-1
radioInputUpload.vue
src/components/CheckCoiumns/radioInputUpload.vue
+196
-0
index.vue
src/views/plan/customized/index.vue
+6
-1
index.vue
src/views/plan/list/index.vue
+0
-1
No files found.
src/components/CheckCoiumns/checkInputUpload.vue
View file @
c064cea1
...
...
@@ -77,6 +77,9 @@ export default {
},
defaultValue
:
{
default
:
''
},
result
:
{
default
:
''
}
},
data
()
{
...
...
src/components/CheckCoiumns/checkbox.vue
View file @
c064cea1
...
...
@@ -104,7 +104,7 @@ export default {
if
(
this
.
defaultValue
)
{
this
.
value
=
this
.
defaultValue
this
.
$emit
(
'changeVal'
,
{
name
:
this
.
prop
,
val
:
this
.
result
})
this
.
$emit
(
'makeRecord'
,
{
name
:
this
.
prop
,
record
:
this
.
result
})
this
.
$emit
(
'makeRecord'
,
{
name
:
this
.
prop
,
record
:
this
.
value
})
}
else
{
this
.
reset
()
}
...
...
src/components/CheckCoiumns/index.js
View file @
c064cea1
...
...
@@ -8,6 +8,7 @@ import checkInput from './checkInput.vue'
import
radioInput
from
'./radioInput.vue'
import
inputUpload
from
'./inputUpload.vue'
import
checkInputUpload
from
'./checkInputUpload.vue'
import
radioInputUpload
from
"./radioInputUpload.vue"
;
Vue
.
component
(
'FormRadio'
,
radio
)
Vue
.
component
(
'FormRadioUpload'
,
radioUpload
)
Vue
.
component
(
'FormCheckboxUpload'
,
checkboxUpload
)
...
...
@@ -17,3 +18,4 @@ Vue.component('FormInput', input)
Vue
.
component
(
'FormCheckbox'
,
checkbox
)
Vue
.
component
(
'FormCheckInput'
,
checkInput
)
Vue
.
component
(
'FormRadioCheck'
,
radioInput
)
Vue
.
component
(
'FormRadioInputUpload'
,
radioInputUpload
)
src/components/CheckCoiumns/inputUpload.vue
View file @
c064cea1
...
...
@@ -75,6 +75,9 @@ export default {
},
defaultValue
:
{
default
:
''
},
result
:
{
default
:
''
}
},
data
()
{
...
...
src/components/CheckCoiumns/radio.vue
View file @
c064cea1
...
...
@@ -22,6 +22,9 @@ export default {
},
defaultValue
:
{
default
:
''
},
result
:
{
default
:
''
}
},
...
...
src/components/CheckCoiumns/radioInputUpload.vue
0 → 100644
View file @
c064cea1
<
template
>
<div
class=
"checkbox-input-box"
>
<div>
<div
v-for=
"(i, k) in items.options"
class=
"checkbox-item"
:key=
"k"
>
<el-radio
:disabled=
"status"
v-model=
"selectedOption"
:label=
"k"
@
change=
"handleRadioChange(k)"
>
{{
' '
}}
</el-radio>
<el-input
v-bind=
"items"
placeholder=
"请输入"
:disabled=
"selectedOption !== k"
style=
"width: 10rem;margin-left: -30px;margin-right: 10px"
v-model=
"model.list[k].value"
@
input=
"input"
>
</el-input>
<div
style=
"width: 20rem; display: inline-block; vertical-align: middle"
>
{{
i
.
object
}}
</div>
</div>
</div>
<el-upload
class=
"upload-demo"
ref=
"fileUpload"
:action=
"uploadImgUrl"
:on-preview=
"handlePreview"
v-model=
"model.file"
:on-remove=
"handleRemove"
accept=
".pdf ,.doc ,.docx ,.xls, .xlsx"
:before-remove=
"beforeRemove"
:show-file-list=
"false"
:limit=
"1"
:on-success=
"handleSuccess"
:on-exceed=
"handleExceed"
:headers=
"headers"
>
<el-button
size=
"small"
:disabled=
"status"
type=
"primary"
>
上传文件
</el-button
>
<div
slot=
"tip"
class=
"el-upload__tip"
>
<div
v-if=
"model.path"
>
<el-link
:href=
"model.path"
>
{{
model
.
name
}}
</el-link>
</div>
</div>
</el-upload>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
items
:
{
type
:
Object
,
default
:
()
=>
({})
},
prop
:
{
type
:
String
,
default
:
''
},
merge
:
{
type
:
Boolean
,
default
:
false
},
status
:
{
type
:
Boolean
,
default
:
false
},
defaultValue
:
{
default
:
''
},
result
:
{
default
:
''
}
},
data
()
{
return
{
model
:
{
value
:
''
,
list
:
[],
file
:
''
,
path
:
''
,
name
:
''
},
selectedOption
:
null
,
// 记录当前选中的索引
headers
:
{
Authorization
:
'Bearer '
+
this
.
$store
.
getters
.
token
},
uploadImgUrl
:
process
.
env
.
VUE_APP_BASE_API
+
'/common/uploadMinio'
};
},
created
()
{
this
.
reset
();
},
watch
:
{
defaultValue
(
newVal
)
{
this
.
model
=
newVal
;
// 直接赋值,保留原有数据结构
this
.
selectedOption
=
this
.
model
.
list
.
findIndex
(
item
=>
item
.
check
);
},
status
(
newVal
)
{
this
.
reset
();
this
.
$emit
(
'changeVal'
,
{
name
:
this
.
prop
,
val
:
[]
});
this
.
$emit
(
'makeRecord'
,
{
name
:
this
.
prop
,
record
:
{}
});
}
},
mounted
()
{
if
(
this
.
defaultValue
)
{
this
.
model
=
this
.
defaultValue
;
this
.
selectedOption
=
this
.
model
.
list
.
findIndex
(
item
=>
item
.
check
);
this
.
$emit
(
'changeVal'
,
{
name
:
this
.
prop
,
val
:
this
.
result
})
this
.
$emit
(
'makeRecord'
,
{
name
:
this
.
prop
,
record
:
this
.
model
})
}
else
{
this
.
reset
();
}
},
methods
:
{
reset
()
{
this
.
model
.
list
=
[];
this
.
selectedOption
=
null
;
this
.
items
.
options
.
forEach
((
item
,
index
)
=>
{
this
.
model
.
list
.
push
({
value
:
''
,
check
:
false
,
useCaseNo
:
item
.
useCaseNo
,
key
:
item
.
value
,
id
:
item
.
id
,
flag
:
item
.
flag
});
});
},
handleRadioChange
(
newKey
)
{
this
.
model
.
list
.
forEach
((
option
,
index
)
=>
{
option
.
check
=
index
===
newKey
;
});
this
.
selectedOption
=
newKey
;
if
(
this
.
merge
)
{
const
selectedItem
=
this
.
items
.
options
[
newKey
];
this
.
$emit
(
'mergeVal'
,
{
name
:
newKey
,
flag
:
selectedItem
.
flag
?
selectedItem
.
flag
.
split
(
','
)
:
[]
});
}
this
.
input
();
},
input
()
{
const
selected
=
this
.
model
.
list
[
this
.
selectedOption
];
const
arr
=
selected
?
[
selected
.
useCaseNo
]
:
[];
this
.
$emit
(
'changeVal'
,
{
name
:
this
.
prop
,
val
:
arr
.
join
(
','
)
});
this
.
$emit
(
'makeRecord'
,
{
name
:
this
.
prop
,
record
:
this
.
model
});
},
handleRemove
(
file
,
fileList
)
{
console
.
log
(
file
,
fileList
)
},
handlePreview
(
file
)
{
console
.
log
(
file
)
},
handleSuccess
(
res
,
file
)
{
if
(
res
.
code
===
200
)
{
this
.
model
.
path
=
process
.
env
.
VUE_APP_IMAGE_API
+
res
.
url
this
.
model
.
name
=
res
.
originalFilename
this
.
$refs
.
fileUpload
.
clearFiles
()
this
.
$message
.
success
(
'上传成功'
)
}
else
{
this
.
$message
.
error
(
'error'
)
}
},
handleExceed
(
files
,
fileList
)
{
this
.
$message
.
warning
(
`当前限制选择 1 个文件,本次选择了
${
files
.
length
}
个文件,共选择了
${
files
.
length
+
fileList
.
length
}
个文件`
)
},
beforeRemove
(
file
,
fileList
)
{
return
this
.
$confirm
(
`确定移除
${
file
.
name
}
?`
)
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.checkbox-item
{
margin-bottom
:
10px
;
}
.checkbox-input-box
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
</
style
>
src/views/plan/customized/index.vue
View file @
c064cea1
...
...
@@ -84,7 +84,7 @@
</
template
>
<div
class=
"page-footer"
>
<el-button
type=
"primary"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"
handleConfirm
"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"
cancel
"
>
取消
</el-button>
</div>
</page-standard>
</template>
...
...
@@ -207,6 +207,11 @@ export default {
}
})
},
cancel
()
{
this
.
$router
.
push
({
path
:
'/plan/list'
})
},
handleInspectionItem
(
item
)
{
// 查看item.value在this.checkTestScenarioList里面存不存在
// 存在则删除
...
...
src/views/plan/list/index.vue
View file @
c064cea1
...
...
@@ -154,7 +154,6 @@
></page-button>
</el-upload>
</div>
</div>
</
template
>
</el-table-column>
</el-table>
...
...
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