明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jt_front
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
Administrator
jt_front
Commits
05d4eaef
Commit
05d4eaef
authored
Mar 16, 2026
by
zhanghan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
92ea2af0
Pipeline
#108418
passed with stage
in 20 seconds
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8821 additions
and
5972 deletions
+8821
-5972
index.vue
src/components/FileUploader/index.vue
+23
-20
addControl.vue
src/views/investingManage/addControl.vue
+1322
-914
addStatement.vue
src/views/investingManage/addStatement.vue
+1024
-813
addProject.vue
src/views/projectManage/addProject.vue
+6452
-4225
No files found.
src/components/FileUploader/index.vue
View file @
05d4eaef
...
...
@@ -26,7 +26,7 @@
<!-- 文件列表表格 -->
<el-table
v-if=
"!isInline"
:data=
"
f
ileList"
:data=
"
safeF
ileList"
style=
"width: 100%"
empty-text=
"暂无数据"
border
...
...
@@ -66,21 +66,21 @@
placement=
"bottom-start"
width=
"420"
trigger=
"hover"
:disabled=
"
f
ileList.length === 0 || disabled"
:disabled=
"
safeF
ileList.length === 0 || disabled"
popper-class=
"file-popover"
>
<!-- 弹窗内容 -->
<
template
#
default
>
<div
class=
"file-popover-content"
>
<!-- 无文件提示 -->
<div
v-if=
"
f
ileList.length === 0"
class=
"empty-file-tip"
>
<div
v-if=
"
safeF
ileList.length === 0"
class=
"empty-file-tip"
>
暂无上传文件
</div>
<!-- 文件列表 -->
<div
v-else
class=
"file-list"
>
<div
v-for=
"(file, index) in
f
ileList"
v-for=
"(file, index) in
safeF
ileList"
:key=
"file.id || index"
class=
"file-item"
>
...
...
@@ -127,7 +127,7 @@
<
template
#
reference
>
<div
class=
"inline-file"
>
<div
class=
"file-count"
>
<span
class=
"count-num"
>
{{
f
ileList
.
length
}}
</span>
<span
class=
"count-num"
>
{{
safeF
ileList
.
length
}}
</span>
<span
class=
"count-text"
>
个文件
</span>
</div>
<el-icon
class=
"upload-icon"
><ArrowDown
/></el-icon>
...
...
@@ -144,12 +144,12 @@ import { ElMessageBox, ElMessage } from "element-plus";
import
moment
from
"moment"
;
import
windowConfig
from
"@/window"
;
// 引入需要的图标
import
{
Document
,
Download
,
Delete
}
from
"@element-plus/icons-vue"
;
import
{
Document
,
Download
,
Delete
,
ArrowDown
}
from
"@element-plus/icons-vue"
;
// 补充缺失的 ArrowDown 图标
// 定义组件 props(
设置默认值,无需外部传参
)
// 定义组件 props(
放宽类型限制,增加兼容性
)
const
props
=
defineProps
({
modelValue
:
{
type
:
Array
,
type
:
[
Array
,
String
,
Number
],
// 兼容更多类型
default
:
()
=>
[],
required
:
true
,
},
...
...
@@ -192,13 +192,15 @@ const emit = defineEmits(["update:modelValue"]);
const
selectedIds
=
ref
([]);
const
popoverVisible
=
ref
(
false
);
//
计算属性:获取文件列表(双向绑定)
const
f
ileList
=
computed
({
//
核心:安全处理文件列表,将非数组值转为空数组
const
safeF
ileList
=
computed
({
get
()
{
return
props
.
modelValue
;
// 校验:如果是数组则直接返回,否则转为空数组
return
Array
.
isArray
(
props
.
modelValue
)
?
props
.
modelValue
:
[];
},
set
(
value
)
{
emit
(
"update:modelValue"
,
value
);
// 向外发射的值始终是数组,保证数据类型统一
emit
(
"update:modelValue"
,
Array
.
isArray
(
value
)
?
value
:
[]);
},
});
...
...
@@ -210,7 +212,7 @@ const formatDate = (date) => {
// 文件上传成功处理
const
handleUploadSuccess
=
(
res
)
=>
{
if
(
res
&&
res
.
data
)
{
fileList
.
value
=
[...
fileList
.
value
,
res
.
data
];
safeFileList
.
value
=
[...
safeFileList
.
value
,
res
.
data
];
// 改用 safeFileList
console
.
log
(
"上传成功:"
,
res
.
data
);
ElMessage
.
success
(
"文件上传成功"
);
popoverVisible
.
value
=
false
;
...
...
@@ -253,9 +255,9 @@ const handleDelete = (index) => {
type
:
"warning"
,
})
.
then
(()
=>
{
const
newList
=
[...
fileList
.
value
];
const
newList
=
[...
safeFileList
.
value
];
// 改用 safeFileList
newList
.
splice
(
index
,
1
);
fileList
.
value
=
newList
;
safeFileList
.
value
=
newList
;
// 改用 safeFileList
// 删除后关闭popover
popoverVisible
.
value
=
false
;
})
...
...
@@ -270,20 +272,21 @@ const handleMultiDelete = () => {
type
:
"warning"
,
})
.
then
(()
=>
{
const
newList
=
fileList
.
value
.
filter
(
const
newList
=
safeFileList
.
value
.
filter
(
// 改用 safeFileList
(
item
)
=>
!
selectedIds
.
value
.
includes
(
item
.
id
),
);
fileList
.
value
=
newList
;
safeFileList
.
value
=
newList
;
// 改用 safeFileList
selectedIds
.
value
=
[];
})
.
catch
(()
=>
{});
};
// 监听外部文件列表变化
// 监听外部文件列表变化
(改为监听 safeFileList,无需额外处理)
watch
(
()
=>
props
.
modelV
alue
,
()
=>
safeFileList
.
v
alue
,
(
newVal
)
=>
{
fileList
.
value
=
newVal
;
// 空监听,仅保证响应式(safeFileList 已处理类型兼容)
},
{
deep
:
true
},
);
...
...
src/views/investingManage/addControl.vue
View file @
05d4eaef
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/views/investingManage/addStatement.vue
View file @
05d4eaef
This diff is collapsed.
Click to expand it.
src/views/projectManage/addProject.vue
View file @
05d4eaef
This diff is collapsed.
Click to expand it.
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