Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BI管理后台
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
刘春
BI管理后台
Commits
bddff9b2
Commit
bddff9b2
authored
Jul 01, 2025
by
孙浩然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报表管理--完
parent
17855e64
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
463 additions
and
46 deletions
+463
-46
dictionary.ts
src/api/common/dictionary.ts
+8
-0
index.ts
src/api/system/file/index.ts
+6
-5
index.vue
src/components/CommonUpload/index.vue
+1
-1
pro-form-item.vue
src/components/ProForm/components/pro-form-item.vue
+1
-0
components.d.ts
src/types/components.d.ts
+1
-0
AddReport.vue
src/views/report/components/AddReport.vue
+78
-14
AddReportDetail.vue
src/views/report/components/AddReportDetail.vue
+145
-0
AddSys.vue
src/views/report/components/AddSys.vue
+3
-1
index.vue
src/views/report/index.vue
+220
-25
No files found.
src/api/common/dictionary.ts
View file @
bddff9b2
...
...
@@ -22,3 +22,11 @@ export const getDictDetailDataRequest = (data: DictionaryDetailParams) =>
export
const
getDictsDataByCodeArrary
=
(
data
:
string
[])
=>
request
<
DictCodeDataItem
[]
>
(
'
/portal/public/api/web/getDict
'
,
'
post
'
,
data
);
/**
* 根据类型获取字典项
* @param data
* @returns
*/
export
const
getClassify
=
(
data
)
=>
request
<
string
>
(
'
/bi-manager/dict/getClassify
'
,
'
post
'
,
data
);
\ No newline at end of file
src/api/system/file/index.ts
View file @
bddff9b2
...
...
@@ -17,14 +17,15 @@ export async function uploadFile(
const
formData
=
new
FormData
();
formData
.
append
(
'
file
'
,
file
,
fileName
);
const
res
=
await
request
<
ApiResult
<
FileRecord
>>
(
'
/
f
ile/upload
'
,
'
/
bi-manager/uploadF
ile/upload
'
,
'
POST
'
,
config
formData
);
if
(
res
.
data
.
code
===
0
&&
res
.
data
.
data
)
{
return
res
.
data
.
data
;
console
.
log
(
"
🚀 ~ res:
"
,
res
)
if
(
res
.
code
===
200
&&
res
.
data
)
{
return
res
.
data
;
}
return
Promise
.
reject
(
new
Error
(
res
.
data
.
message
));
return
Promise
.
reject
(
new
Error
(
res
.
message
));
}
/**
...
...
src/components/CommonUpload/index.vue
View file @
bddff9b2
...
...
@@ -167,7 +167,7 @@
.
then
((
res
)
=>
{
item
.
progress
=
100
;
item
.
status
=
'
done
'
;
item
.
url
=
res
.
u
rl
;
item
.
url
=
res
.
imgU
rl
;
})
.
catch
((
e
)
=>
{
item
.
status
=
'
exception
'
;
...
...
src/components/ProForm/components/pro-form-item.vue
View file @
bddff9b2
...
...
@@ -1135,6 +1135,7 @@
<ImageUpload
v-else-if=
"item.type === 'imageUpload'"
v-bind=
"item.props || {}"
:limit=
"item?.limit || 9"
ref=
"imageUploadRef"
:modelValue=
"model[item.prop]"
@
update:modelValue=
"updateValue"
...
...
src/types/components.d.ts
View file @
bddff9b2
...
...
@@ -11,6 +11,7 @@ declare module 'vue' {
AddExpert
:
typeof
import
(
'
./../components/TaskAllocation/AddExpert.vue
'
)[
'
default
'
]
AddMenu
:
typeof
import
(
'
./../views/web/components/AddMenu.vue
'
)[
'
default
'
]
AddReport
:
typeof
import
(
'
./../views/report/components/AddReport.vue
'
)[
'
default
'
]
AddReportDetail
:
typeof
import
(
'
./../views/report/components/AddReportDetail.vue
'
)[
'
default
'
]
AddRole
:
typeof
import
(
'
./../views/role/components/AddRole.vue
'
)[
'
default
'
]
AddSys
:
typeof
import
(
'
./../views/report/components/AddSys.vue
'
)[
'
default
'
]
AddTheme
:
typeof
import
(
'
./../views/theme/components/AddTheme.vue
'
)[
'
default
'
]
...
...
src/views/report/components/AddReport.vue
View file @
bddff9b2
...
...
@@ -4,6 +4,8 @@
:title=
"modalTitle"
width=
"600px"
position=
"center"
:close-on-click-modal=
"false"
@
close=
"handleClose"
>
<ele-loading
:loading=
"pageLoading"
>
<ele-card>
...
...
@@ -19,7 +21,7 @@
</ele-card>
</ele-loading>
<template
#footer
>
<el-button
type=
"primary"
plain
@
click=
"handleC
ancel
"
>
取消
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleC
lose
"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"onSubmit"
>
确定
</el-button>
</
template
>
</ele-modal>
...
...
@@ -36,6 +38,8 @@
import
{
EleMessage
}
from
'
ele-admin-plus
'
;
// apis
import
reportApi
from
'
@/api/reportApi
'
;
import
sysApi
from
'
@/api/sysApi
'
;
import
{
getClassify
}
from
'
@/api/common/dictionary
'
;
const
props
=
defineProps
<
{
curSelectSys
:
any
;
...
...
@@ -48,17 +52,24 @@
return
useType
.
value
===
'
add
'
?
'
添加报表
'
:
'
编辑报表
'
;
});
onMounted
(()
=>
{
getClassifyList
();
// 获取报表分类
});
// 打开
const
curInfo
=
ref
<
addReportDto
>
();
const
open
=
(
type
:
'
add
'
|
'
edit
'
=
'
add
'
,
info
?:
addReportDto
)
=>
{
useType
.
value
=
type
;
modalVisible
.
value
=
true
;
getSysList
();
// 获取系统列表
if
(
type
===
'
edit
'
)
{
curInfo
.
value
=
info
;
Object
.
assign
(
form
,
info
);
}
console
.
log
(
props
.
curSelectSys
);
form
.
reportCategory
=
info
.
dictDataValue
.
split
(
'
,
'
);
}
else
{
form
.
sysId
=
[
props
.
curSelectSys
.
sysId
];
}
};
defineExpose
({
open
:
open
as
(
type
:
'
add
'
|
'
edit
'
,
info
?:
addReportDto
)
=>
void
...
...
@@ -69,17 +80,70 @@
reportStyleUrl
:
''
,
reportName
:
''
,
reportCategory
:
[],
sysId
:
[],
reportType
:
1
reportType
:
1
,
sysId
:
[]
// 系统id
});
const
sysList
=
ref
([]);
// 系统列表
/** 获取系统列表 */
const
getSysList
=
async
()
=>
{
let
params
=
{
pageNum
:
1
,
pageSize
:
99999
};
const
[
error
,
ret
]
=
await
tryit
(
sysApi
.
getSysList
)(
params
);
if
(
error
)
{
console
.
error
(
error
);
return
;
}
if
(
ret
.
code
===
200
)
{
sysList
.
value
=
ret
.
data
.
list
.
map
((
item
)
=>
{
return
{
label
:
item
.
sysName
,
value
:
item
.
sysId
};
});
}
};
const
classifyList
=
ref
([]);
// 报表类型
// 获取报表分类
const
getClassifyList
=
async
()
=>
{
let
params
=
{
typeId
:
'
MEDICAL_ROLE
'
};
const
[
error
,
ret
]
=
await
tryit
(
getClassify
)(
params
);
if
(
error
)
{
console
.
error
(
error
);
return
;
}
if
(
ret
.
code
===
200
)
{
classifyList
.
value
=
ret
.
data
.
map
((
item
)
=>
{
return
{
label
:
item
.
dataLabel
,
value
:
item
.
dataValue
};
});
}
};
/** 表单项 */
const
items
=
computed
<
Array
<
ProFormItemProps
>>
(()
=>
[
{
label
:
'
所属系统
'
,
prop
:
'
sysId
'
,
type
:
'
multipleSelect
'
,
options
:
sysList
.
value
,
required
:
true
},
{
label
:
'
报表名称
'
,
prop
:
'
reportName
'
,
type
:
'
input
'
,
required
:
true
},
{
label
:
'
报表样式图片地址
'
,
prop
:
'
reportStyleUrl
'
,
type
:
'
input
'
,
label
:
'
报表分类
'
,
prop
:
'
reportCategory
'
,
type
:
'
multipleSelect
'
,
multiple
:
true
,
options
:
classifyList
.
value
,
required
:
true
},
{
...
...
@@ -99,12 +163,12 @@
required
:
true
},
{
label
:
'
报表
分类
'
,
prop
:
'
reportCategory
'
,
type
:
'
selec
t
'
,
multiple
:
true
,
options
:
[]
,
required
:
fals
e
label
:
'
报表
样式图片地址
'
,
prop
:
'
reportStyleUrl
'
,
// type: 'inpu
t',
type
:
'
imageUpload
'
,
limit
:
1
,
required
:
tru
e
}
]);
...
...
src/views/report/components/AddReportDetail.vue
0 → 100644
View file @
bddff9b2
<
template
>
<ele-modal
v-model=
"modalVisible"
:title=
"modalTitle"
width=
"600px"
position=
"center"
:close-on-click-modal=
"false"
@
close=
"handleClose"
>
<ele-loading
:loading=
"pageLoading"
>
<ele-card>
<pro-form
ref=
"ProFormRef"
label-width=
"auto"
:model=
"form"
:items=
"items"
:footer=
"false"
:grid=
"
{ span: 24 }"
@updateValue="setFieldValue"
/>
</ele-card>
</ele-loading>
<template
#footer
>
<el-button
type=
"primary"
plain
@
click=
"handleClose"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"onSubmit"
>
确定
</el-button>
</
template
>
</ele-modal>
</template>
<
script
lang=
"ts"
setup
>
// tools
import
{
useFormData
}
from
'
@/utils/use-form-data
'
;
import
{
tryit
}
from
'
radash
'
;
// types
import
type
{
addReportDetailDto
}
from
'
@/types/BiReport
'
;
import
type
{
ProFormItemProps
}
from
'
@/components/ProForm/types
'
;
import
type
{
FormInstance
}
from
'
element-plus
'
;
import
{
EleMessage
}
from
'
ele-admin-plus
'
;
// apis
import
reportApi
from
'
@/api/reportApi
'
;
const
props
=
defineProps
<
{
curSelectReport
:
any
;
}
>
();
const
useType
=
ref
<
'
add
'
|
'
edit
'
>
(
'
add
'
);
const
modalVisible
=
ref
(
false
);
const
modalTitle
=
computed
(()
=>
{
return
useType
.
value
===
'
add
'
?
'
添加详情
'
:
'
编辑详情
'
;
});
// 打开
const
curInfo
=
ref
<
addReportDetailDto
>
();
const
open
=
(
type
:
'
add
'
|
'
edit
'
=
'
add
'
,
info
?:
addReportDetailDto
)
=>
{
useType
.
value
=
type
;
modalVisible
.
value
=
true
;
if
(
type
===
'
edit
'
)
{
curInfo
.
value
=
info
;
Object
.
assign
(
form
,
info
);
}
else
{
form
.
reportId
=
props
.
curSelectReport
.
reportId
;
}
};
defineExpose
({
open
:
open
as
(
type
:
'
add
'
|
'
edit
'
,
info
?:
addReportDetailDto
)
=>
void
});
/** 表单数据 */
const
[
form
,
resetFields
,
,
setFieldValue
]
=
useFormData
<
addReportDetailDto
>
({
calculationFormula
:
''
,
// 计算公式
fieldName
:
''
,
// 字段名称
remark
:
''
,
// 备注信息
reportId
:
''
// 绑定报表id
// detailId: '' //
});
/** 表单项 */
const
items
=
computed
<
Array
<
ProFormItemProps
>>
(()
=>
[
{
label
:
'
字段名
'
,
prop
:
'
fieldName
'
,
type
:
'
input
'
,
required
:
true
},
{
label
:
'
公式
'
,
prop
:
'
calculationFormula
'
,
type
:
'
input
'
,
required
:
true
},
{
label
:
'
备注
'
,
prop
:
'
remark
'
,
type
:
'
textarea
'
}
]);
/** 提交 */
const
ProFormRef
=
ref
<
FormInstance
>
();
const
pageLoading
=
ref
(
false
);
const
emits
=
defineEmits
([
'
reload
'
]);
const
onSubmit
=
()
=>
{
ProFormRef
.
value
?.
validate
(
async
(
valid
)
=>
{
if
(
!
valid
)
{
EleMessage
.
warning
(
'
请填写必填项
'
);
return
;
}
ElMessageBox
.
confirm
(
`确定要
${
useType
.
value
===
'
add
'
?
'
保存
'
:
'
修改
'
}
?`
,
'
提示
'
,
{
type
:
'
warning
'
}
).
then
(
async
()
=>
{
pageLoading
.
value
=
true
;
const
apiObj
=
{
add
:
reportApi
.
addReportDetail
,
edit
:
reportApi
.
editReportDetail
};
const
[,
ret
]
=
await
tryit
(
apiObj
[
useType
.
value
!
])(
form
);
if
(
ret
?.
code
===
200
)
{
EleMessage
.
success
(
useType
.
value
===
'
add
'
?
'
添加成功
'
:
'
修改成功
'
);
emits
(
'
reload
'
);
handleClose
();
}
pageLoading
.
value
=
false
;
});
});
};
// 关闭
const
handleClose
=
()
=>
{
modalVisible
.
value
=
false
;
resetFields
();
};
// 点击取消
const
handleCancel
=
()
=>
{
modalVisible
.
value
=
false
;
};
</
script
>
src/views/report/components/AddSys.vue
View file @
bddff9b2
...
...
@@ -4,6 +4,8 @@
:title=
"modalTitle"
width=
"600px"
position=
"center"
:close-on-click-modal=
"false"
@
close=
"handleClose"
>
<ele-loading
:loading=
"pageLoading"
>
<ele-card>
...
...
@@ -19,7 +21,7 @@
</ele-card>
</ele-loading>
<template
#footer
>
<el-button
type=
"primary"
plain
@
click=
"handleC
ancel
"
>
取消
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleC
lose
"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"onSubmit"
>
确定
</el-button>
</
template
>
</ele-modal>
...
...
src/views/report/index.vue
View file @
bddff9b2
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