Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qr-consistency-vue3
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
刘怀志
qr-consistency-vue3
Commits
3e7248b2
Commit
3e7248b2
authored
Apr 22, 2025
by
高滢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(预制数据管理): 文件上传 模板下载
parent
763e7903
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
13 deletions
+30
-13
index.vue
src/components/FileUpload/index.vue
+9
-2
details.vue
src/views/controlPlan/baseConfig/presetData/details.vue
+14
-8
index.vue
src/views/controlPlan/baseConfig/presetData/index.vue
+7
-3
No files found.
src/components/FileUpload/index.vue
View file @
3e7248b2
...
@@ -20,9 +20,11 @@
...
@@ -20,9 +20,11 @@
</el-upload>
</el-upload>
<!-- 上传提示 -->
<!-- 上传提示 -->
<div
v-if=
"showTip && !disabled"
class=
"el-upload__tip"
>
<div
v-if=
"showTip && !disabled"
class=
"el-upload__tip"
>
请上传
<template
v-if=
"otherTips"
>
<b
style=
"color: #f56c6c"
>
{{
otherTips
}}
</b>
</
template
>
<
template
v-if=
"fileSize"
>
<
template
v-if=
"fileSize"
>
大小不超过
<b
style=
"color: #f56c6c"
>
{{
fileSize
}}
MB
</b>
请上传
大小不超过
<b
style=
"color: #f56c6c"
>
{{
fileSize
}}
MB
</b>
</
template
>
</
template
>
<
template
v-if=
"fileType"
>
<
template
v-if=
"fileType"
>
格式为
<b
style=
"color: #f56c6c"
>
{{
fileType
.
join
(
'/'
)
}}
</b>
格式为
<b
style=
"color: #f56c6c"
>
{{
fileType
.
join
(
'/'
)
}}
</b>
...
@@ -72,6 +74,11 @@ const props = defineProps({
...
@@ -72,6 +74,11 @@ const props = defineProps({
type
:
Number
,
type
:
Number
,
default
:
5
,
default
:
5
,
},
},
// 大小限制(MB)
otherTips
:
{
type
:
String
,
default
:
''
,
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType
:
{
fileType
:
{
type
:
Array
,
type
:
Array
,
...
...
src/views/controlPlan/baseConfig/presetData/details.vue
View file @
3e7248b2
...
@@ -7,17 +7,17 @@
...
@@ -7,17 +7,17 @@
<el-button
type=
"text"
@
click=
"$router.go(-1)"
>
返回
</el-button>
<el-button
type=
"text"
@
click=
"$router.go(-1)"
>
返回
</el-button>
</el-col>
</el-col>
<el-col
:span=
"6"
>
<el-col
:span=
"6"
>
<el-form-item
label=
"所属填写模板"
>
<el-form-item
label=
"所属填写模板
:
"
>
<span>
{{
contentData
.
templateCod
e
}}
</span>
<span>
{{
contentData
.
relatedTemplateNam
e
}}
</span>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"6"
>
<el-col
:span=
"6"
>
<el-form-item
label=
"所属表单"
>
<el-form-item
label=
"所属表单
:
"
>
<span>
{{
contentData
.
relatedFormName
}}
</span>
<span>
{{
contentData
.
relatedFormName
}}
</span>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"6"
>
<el-col
:span=
"6"
>
<el-form-item
label=
"备注"
>
<el-form-item
label=
"备注
:
"
>
<span>
{{
contentData
.
remark
}}
</span>
<span>
{{
contentData
.
remark
}}
</span>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
...
@@ -31,14 +31,20 @@
...
@@ -31,14 +31,20 @@
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
getPreset
}
from
"@/api/control/preset.js"
;
import
{
getPreset
}
from
"@/api/control/preset.js"
;
import
{
onMounted
}
from
"vue"
;
import
{
useRouter
}
from
"vue-router"
;
const
router
=
useRouter
();
let
contentData
=
reactive
({})
let
contentData
=
reactive
({})
function
getContentData
(){
function
getContentData
(
id
){
getPreset
(
route
.
query
.
id
).
then
(
res
=>
{
getPreset
(
id
).
then
(
res
=>
{
contentData
=
res
.
data
contentData
=
res
.
data
})
})
}
}
getContentData
()
onMounted
(()
=>
{
console
.
log
(
'111'
,
router
.
currentRoute
.
value
.
query
.
id
)
const
id
=
router
.
currentRoute
.
value
.
query
.
id
getContentData
(
id
)
})
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
...
...
src/views/controlPlan/baseConfig/presetData/index.vue
View file @
3e7248b2
...
@@ -90,9 +90,8 @@
...
@@ -90,9 +90,8 @@
<
/el-table-column
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"操作"
align
=
"center"
class
-
name
=
"small-padding fixed-width"
>
<
el
-
table
-
column
label
=
"操作"
align
=
"center"
class
-
name
=
"small-padding fixed-width"
>
<
template
#
default
=
"scope"
>
<
template
#
default
=
"scope"
>
<
el
-
button
link
type
=
"primary"
@
click
=
""
v
-
hasPermi
=
"['control:preset:edit']"
>
下载
<
/el-button
>
<
el
-
button
link
type
=
"primary"
@
click
=
"
downFile(scope.row)
"
v
-
hasPermi
=
"['control:preset:edit']"
>
下载
<
/el-button
>
<
el
-
button
link
type
=
"primary"
@
click
=
"handleUpdate(scope.row)"
v
-
hasPermi
=
"['control:preset:edit']"
>
上传更新
<
/el-button
>
<
el
-
button
link
type
=
"primary"
@
click
=
"handleUpdate(scope.row)"
v
-
hasPermi
=
"['control:preset:edit']"
>
上传更新
<
/el-button
>
<
el
-
button
link
type
=
"primary"
@
click
=
""
v
-
hasPermi
=
"['control:preset:edit']"
>
恢复默认
<
/el-button
>
<
/template
>
<
/template
>
<
/el-table-column
>
<
/el-table-column
>
<
/el-table
>
<
/el-table
>
...
@@ -145,7 +144,7 @@
...
@@ -145,7 +144,7 @@
<
/el-select
>
<
/el-select
>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"上传文件"
prop
=
"file"
>
<
el
-
form
-
item
label
=
"上传文件"
prop
=
"file"
>
<
FileUpload
ref
=
"upload"
:
modelValue
=
"form.file"
:
limit
=
"1"
:
fileType
=
"['xls', 'xlsx']"
:
file
-
size
=
"30
"
/>
<
FileUpload
ref
=
"upload"
v
-
model
=
"form.fileUrl"
:
modelValue
=
"form.fileUrl"
:
limit
=
"1"
:
fileType
=
"['xls', 'xlsx']"
:
file
-
size
=
"30"
other
-
tips
=
"请先下载模板填好数据再上传
"
/>
<
el
-
button
type
=
"text"
:
disabled
=
"form.relatedFormId==''||form.relatedFormId==null"
@
click
=
"downloadTemplate"
>
点击下载数据内容模板
<
/el-button
>
<
el
-
button
type
=
"text"
:
disabled
=
"form.relatedFormId==''||form.relatedFormId==null"
@
click
=
"downloadTemplate"
>
点击下载数据内容模板
<
/el-button
>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"备注"
prop
=
"remark"
>
<
el
-
form
-
item
label
=
"备注"
prop
=
"remark"
>
...
@@ -187,6 +186,7 @@ const file = ref(null);
...
@@ -187,6 +186,7 @@ const file = ref(null);
const
upload
=
ref
(
null
);
const
upload
=
ref
(
null
);
const
templateList
=
ref
([]);
const
templateList
=
ref
([]);
const
formList
=
ref
([]);
const
formList
=
ref
([]);
const
baseUrl
=
ref
(
import
.
meta
.
env
.
VITE_APP_BASE_API
)
const
data
=
reactive
({
const
data
=
reactive
({
form
:
{
}
,
form
:
{
}
,
queryParams
:
{
queryParams
:
{
...
@@ -277,6 +277,10 @@ function dataContent(row){
...
@@ -277,6 +277,10 @@ function dataContent(row){
}
}
}
);
}
);
}
}
// 文件下载
function
downFile
(
row
){
window
.
location
.
href
=
row
.
fileUrl
}
/** 修改按钮操作 */
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
function
handleUpdate
(
row
)
{
reset
();
reset
();
...
...
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